From 541e0eb512e303f64afca61867ffc4edb9cb54ce Mon Sep 17 00:00:00 2001 From: status-im-auto Date: Sun, 10 Nov 2024 20:21:51 +0000 Subject: [PATCH] Updates --- buddybook/.vite/manifest.json | 93 +- buddybook/assets/ccip-BL6nn1x6.js | 1 - buddybook/assets/ccip-DqOSmZ6J.js | 1 + ...{events-q8pkyiVZ.js => events-EbrwmdBG.js} | 2 +- buddybook/assets/hooks.module-Bu9ycfnK.js | 1 - buddybook/assets/hooks.module-D0gf0yJl.js | 1 + buddybook/assets/index-B6MMxlAs.js | 3 + buddybook/assets/index-BA4zS8rk.js | 2 + .../{index-CEoqBmQK.js => index-BhswOEW5.js} | 2 +- .../{index-xoNRwz7B.js => index-C91wHTLi.js} | 4 +- buddybook/assets/index-CF3pMtIR.js | 7 - buddybook/assets/index-CRce2FXR.js | 7 + buddybook/assets/index-Cr-ON-_S.js | 2 - ...{index-DQCSip5A.css => index-CwoEHhxw.css} | 0 buddybook/assets/index-Cye4tEiE.js | 4272 +++++++++++++++++ buddybook/assets/index-D8m_BJXT.js | 1 - buddybook/assets/index-DsVjVM-s.js | 1 - buddybook/assets/index-Gmp6KMX1.js | 4272 ----------------- buddybook/assets/index-c_vQ90mY.js | 1 + buddybook/assets/index.es-BocJIoGE.js | 70 + buddybook/assets/index.es-D00CSFMM.js | 70 - ...oMugCi.js => inherits_browser-DKXdsDax.js} | 2 +- buddybook/index.html | 4 +- flush-notes/404.html | 2 +- .../_buildManifest.js | 0 .../_ssgManifest.js | 0 flush-notes/index.html | 2 +- flush-notes/index.txt | 2 +- flush-notes/view.html | 2 +- flush-notes/view.txt | 2 +- 30 files changed, 4414 insertions(+), 4415 deletions(-) delete mode 100644 buddybook/assets/ccip-BL6nn1x6.js create mode 100644 buddybook/assets/ccip-DqOSmZ6J.js rename buddybook/assets/{events-q8pkyiVZ.js => events-EbrwmdBG.js} (98%) delete mode 100644 buddybook/assets/hooks.module-Bu9ycfnK.js create mode 100644 buddybook/assets/hooks.module-D0gf0yJl.js create mode 100644 buddybook/assets/index-B6MMxlAs.js create mode 100644 buddybook/assets/index-BA4zS8rk.js rename buddybook/assets/{index-CEoqBmQK.js => index-BhswOEW5.js} (99%) rename buddybook/assets/{index-xoNRwz7B.js => index-C91wHTLi.js} (97%) delete mode 100644 buddybook/assets/index-CF3pMtIR.js create mode 100644 buddybook/assets/index-CRce2FXR.js delete mode 100644 buddybook/assets/index-Cr-ON-_S.js rename buddybook/assets/{index-DQCSip5A.css => index-CwoEHhxw.css} (100%) create mode 100644 buddybook/assets/index-Cye4tEiE.js delete mode 100644 buddybook/assets/index-D8m_BJXT.js delete mode 100644 buddybook/assets/index-DsVjVM-s.js delete mode 100644 buddybook/assets/index-Gmp6KMX1.js create mode 100644 buddybook/assets/index-c_vQ90mY.js create mode 100644 buddybook/assets/index.es-BocJIoGE.js delete mode 100644 buddybook/assets/index.es-D00CSFMM.js rename buddybook/assets/{inherits_browser-C-oMugCi.js => inherits_browser-DKXdsDax.js} (74%) rename flush-notes/_next/static/{ByRzlDfDsRSlEfHLzI4Mq => 5-GwyAoDnZqLVyoBYvyMp}/_buildManifest.js (100%) rename flush-notes/_next/static/{ByRzlDfDsRSlEfHLzI4Mq => 5-GwyAoDnZqLVyoBYvyMp}/_ssgManifest.js (100%) diff --git a/buddybook/.vite/manifest.json b/buddybook/.vite/manifest.json index fdb4b22..1b9273d 100644 --- a/buddybook/.vite/manifest.json +++ b/buddybook/.vite/manifest.json @@ -1,85 +1,82 @@ { - "_events-q8pkyiVZ.js": { - "file": "assets/events-q8pkyiVZ.js", + "_events-EbrwmdBG.js": { + "file": "assets/events-EbrwmdBG.js", "name": "events", "imports": [ "index.html" ] }, - "_hooks.module-Bu9ycfnK.js": { - "file": "assets/hooks.module-Bu9ycfnK.js", - "name": "hooks.module", - "imports": [ - "index.html", - "_events-q8pkyiVZ.js", - "_inherits_browser-C-oMugCi.js" - ] + "_hooks.module-D0gf0yJl.js": { + "file": "assets/hooks.module-D0gf0yJl.js", + "name": "hooks.module" }, - "_index-CF3pMtIR.js": { - "file": "assets/index-CF3pMtIR.js", + "_index-C91wHTLi.js": { + "file": "assets/index-C91wHTLi.js", "name": "index", "isDynamicEntry": true, "imports": [ - "index.html", - "_inherits_browser-C-oMugCi.js", - "_hooks.module-Bu9ycfnK.js", - "_events-q8pkyiVZ.js" + "index.html" + ], + "dynamicImports": [ + "node_modules/@walletconnect/modal-ui/dist/index.js" ] }, - "_index-D8m_BJXT.js": { - "file": "assets/index-D8m_BJXT.js", + "_index-CRce2FXR.js": { + "file": "assets/index-CRce2FXR.js", "name": "index", "isDynamicEntry": true, "imports": [ "index.html", - "_hooks.module-Bu9ycfnK.js" - ] - }, - "_index-DsVjVM-s.js": { - "file": "assets/index-DsVjVM-s.js", - "name": "index", - "isDynamicEntry": true, - "imports": [ - "_events-q8pkyiVZ.js" + "_inherits_browser-DKXdsDax.js", + "_hooks.module-D0gf0yJl.js", + "_events-EbrwmdBG.js" ] }, - "_index-xoNRwz7B.js": { - "file": "assets/index-xoNRwz7B.js", + "_index-c_vQ90mY.js": { + "file": "assets/index-c_vQ90mY.js", "name": "index", "isDynamicEntry": true, "imports": [ - "index.html" - ], - "dynamicImports": [ - "node_modules/@walletconnect/modal-ui/dist/index.js" + "index.html", + "_events-EbrwmdBG.js" ] }, - "_inherits_browser-C-oMugCi.js": { - "file": "assets/inherits_browser-C-oMugCi.js", + "_inherits_browser-DKXdsDax.js": { + "file": "assets/inherits_browser-DKXdsDax.js", "name": "inherits_browser", "imports": [ "index.html" ] }, "index.html": { - "file": "assets/index-Gmp6KMX1.js", + "file": "assets/index-Cye4tEiE.js", "name": "index", "src": "index.html", "isEntry": true, "dynamicImports": [ "node_modules/viem/_esm/utils/ccip.js", - "_index-D8m_BJXT.js", - "_index-CF3pMtIR.js", + "node_modules/@coinbase/wallet-sdk/dist/index.js", + "_index-CRce2FXR.js", "node_modules/@safe-global/safe-apps-sdk/dist/esm/index.js", - "_index-DsVjVM-s.js", + "_index-c_vQ90mY.js", "node_modules/@walletconnect/ethereum-provider/dist/index.es.js" ], "css": [ - "assets/index-DQCSip5A.css" + "assets/index-CwoEHhxw.css" + ] + }, + "node_modules/@coinbase/wallet-sdk/dist/index.js": { + "file": "assets/index-B6MMxlAs.js", + "name": "index", + "src": "node_modules/@coinbase/wallet-sdk/dist/index.js", + "isDynamicEntry": true, + "imports": [ + "index.html", + "_hooks.module-D0gf0yJl.js" ] }, "node_modules/@safe-global/safe-apps-sdk/dist/esm/index.js": { - "file": "assets/index-Cr-ON-_S.js", + "file": "assets/index-BA4zS8rk.js", "name": "index", "src": "node_modules/@safe-global/safe-apps-sdk/dist/esm/index.js", "isDynamicEntry": true, @@ -88,31 +85,31 @@ ] }, "node_modules/@walletconnect/ethereum-provider/dist/index.es.js": { - "file": "assets/index.es-D00CSFMM.js", + "file": "assets/index.es-BocJIoGE.js", "name": "index.es", "src": "node_modules/@walletconnect/ethereum-provider/dist/index.es.js", "isDynamicEntry": true, "imports": [ "index.html", - "_events-q8pkyiVZ.js", - "_inherits_browser-C-oMugCi.js" + "_events-EbrwmdBG.js", + "_inherits_browser-DKXdsDax.js" ], "dynamicImports": [ - "_index-xoNRwz7B.js" + "_index-C91wHTLi.js" ] }, "node_modules/@walletconnect/modal-ui/dist/index.js": { - "file": "assets/index-CEoqBmQK.js", + "file": "assets/index-BhswOEW5.js", "name": "index", "src": "node_modules/@walletconnect/modal-ui/dist/index.js", "isDynamicEntry": true, "imports": [ - "_index-xoNRwz7B.js", + "_index-C91wHTLi.js", "index.html" ] }, "node_modules/viem/_esm/utils/ccip.js": { - "file": "assets/ccip-BL6nn1x6.js", + "file": "assets/ccip-DqOSmZ6J.js", "name": "ccip", "src": "node_modules/viem/_esm/utils/ccip.js", "isDynamicEntry": true, diff --git a/buddybook/assets/ccip-BL6nn1x6.js b/buddybook/assets/ccip-BL6nn1x6.js deleted file mode 100644 index 7d41b7e..0000000 --- a/buddybook/assets/ccip-BL6nn1x6.js +++ /dev/null @@ -1 +0,0 @@ -import{i as h,I as m,v as p,w,x as g,y as E,z as x,c as O,e as b,H as y,A as M}from"./index-Gmp6KMX1.js";function R(s,e){if(!h(s,{strict:!1}))throw new m({address:s});if(!h(e,{strict:!1}))throw new m({address:e});return s.toLowerCase()===e.toLowerCase()}class $ extends p{constructor({callbackSelector:e,cause:a,data:n,extraData:c,sender:d,urls:t}){var i;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(i=a.metaMessages)!=null&&i.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(f=>` ${w(f)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${e}`,` Extra data: ${c}`].flat(),name:"OffchainLookupError"})}}class A extends p{constructor({result:e,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(a)}`,`Response: ${g(e)}`],name:"OffchainLookupResponseMalformedError"})}}class S extends p{constructor({sender:e,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${e}`],name:"OffchainLookupSenderMismatchError"})}}const T="0x556f1830",q={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function v(s,{blockNumber:e,blockTag:a,data:n,to:c}){const{args:d}=E({data:n,abi:[q]}),[t,i,f,r,o]=d,{ccipRead:u}=s,k=u&&typeof(u==null?void 0:u.request)=="function"?u.request:C;try{if(!R(c,t))throw new S({sender:t,to:c});const l=await k({data:f,sender:t,urls:i}),{data:L}=await x(s,{blockNumber:e,blockTag:a,data:O([r,b([{type:"bytes"},{type:"bytes"}],[l,o])]),to:c});return L}catch(l){throw new $({callbackSelector:r,cause:l,data:n,extraData:o,sender:t,urls:i})}}async function C({data:s,sender:e,urls:a}){var c;let n=new Error("An unknown error occurred.");for(let d=0;d` ${w(f)}`)],` Sender: ${d}`,` Data: ${n}`,` Callback selector: ${a}`,` Extra data: ${i}`].flat(),name:"OffchainLookupError"})}}class $ extends p{constructor({result:a,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${w(t)}`,`Response: ${g(a)}`],name:"OffchainLookupResponseMalformedError"})}}class A extends p{constructor({sender:a,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${a}`],name:"OffchainLookupSenderMismatchError"})}}const D="0x556f1830",C={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function G(r,{blockNumber:a,blockTag:t,data:n,to:i}){const{args:d}=E({data:n,abi:[C]}),[s,c,f,u,o]=d,{ccipRead:e}=r,k=e&&typeof(e==null?void 0:e.request)=="function"?e.request:T;try{if(!R(i,s))throw new A({sender:s,to:i});const l=await k({data:f,sender:s,urls:c}),{data:L}=await O(r,{blockNumber:a,blockTag:t,data:x([u,b([{type:"bytes"},{type:"bytes"}],[l,o])]),to:i});return L}catch(l){throw new S({callbackSelector:u,cause:l,data:n,extraData:o,sender:s,urls:c})}}async function T({data:r,sender:a,urls:t}){var i;let n=new Error("An unknown error occurred.");for(let d=0;d0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")d(c,this,n);else for(var h=c.length,O=E(c,h),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,j(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function R(){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 _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=R.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():N(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?M(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;r0&&(s=n[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var c=f[e];if(c===void 0)return!1;if(typeof c=="function")d(c,this,n);else for(var h=c.length,O=E(c,h),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=s.length,j(u)}return t}o.prototype.addListener=function(e,n){return g(this,e,n,!1)};o.prototype.on=o.prototype.addListener;o.prototype.prependListener=function(e,n){return g(this,e,n,!0)};function R(){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 _(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=R.bind(r);return i.listener=n,r.wrapFn=i,i}o.prototype.once=function(e,n){return v(n),this.on(e,_(this,e,n)),this};o.prototype.prependOnceListener=function(e,n){return v(n),this.prependListener(e,_(this,e,n)),this};o.prototype.removeListener=function(e,n){var r,i,f,s,u;if(v(n),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===n||r.listener===n)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||n));else if(typeof r!="function"){for(f=-1,s=r.length-1;s>=0;s--)if(r[s]===n||r[s].listener===n){u=r[s].listener,f=s;break}if(f<0)return this;f===0?r.shift():N(r,f),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,u||n)}return this};o.prototype.off=o.prototype.removeListener;o.prototype.removeAllListeners=function(e){var n,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var f=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(e,n[i]);return this};function w(t,e,n){var r=t._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?n?[i.listener||i]:[i]:n?M(i):E(i,i.length)}o.prototype.listeners=function(e){return w(this,e,!0)};o.prototype.rawListeners=function(e){return w(this,e,!1)};o.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):b.call(t,e)};o.prototype.listenerCount=b;function b(t){var e=this._events;if(e!==void 0){var n=e[t];if(typeof n=="function")return 1;if(n!==void 0)return n.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]};function E(t,e){for(var n=new Array(e),r=0;r0?this.tail.next=s:this.head=s,this.tail=s,++this.length}},{key:"unshift",value:function(E){var s={data:E,next:this.head};this.length===0&&(this.tail=s),this.head=s,++this.length}},{key:"shift",value:function(){if(this.length!==0){var E=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,E}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(E){if(this.length===0)return"";for(var s=this.head,p=""+s.data;s=s.next;)p+=E+s.data;return p}},{key:"concat",value:function(E){if(this.length===0)return h.alloc(0);for(var s=h.allocUnsafe(E>>>0),p=this.head,C=0;p;)v(p.data,s,C),C+=p.data.length,p=p.next;return s}},{key:"consume",value:function(E,s){var p;return ER.length?R.length:E;if(S===R.length?C+=R:C+=R.slice(0,E),E-=S,E===0){S===R.length?(++p,s.next?this.head=s.next:this.head=this.tail=null):(this.head=s,s.data=R.slice(S));break}++p}return this.length-=p,C}},{key:"_getBuffer",value:function(E){var s=h.allocUnsafe(E),p=this.head,C=1;for(p.data.copy(s),E-=p.data.length;p=p.next;){var R=p.data,S=E>R.length?R.length:E;if(R.copy(s,s.length-E,0,S),E-=S,E===0){S===R.length?(++C,p.next?this.head=p.next:this.head=this.tail=null):(this.head=p,p.data=R.slice(S));break}++C}return this.length-=C,s}},{key:w,value:function(E,s){return _(this,t(t({},s),{},{depth:0,customInspect:!1}))}}]),m}(),Yt}var pe={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};function zi(e,t){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,pe.nextTick(or,this,e)):pe.nextTick(or,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(f){!t&&f?r._writableState?r._writableState.errorEmitted?pe.nextTick(ze,r):(r._writableState.errorEmitted=!0,pe.nextTick(mr,r,f)):pe.nextTick(mr,r,f):t?(pe.nextTick(ze,r),t(f)):pe.nextTick(ze,r)}),this)}function mr(e,t){or(e,t),ze(e)}function ze(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Vi(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function or(e,t){e.emit("error",t)}function Gi(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}var ii={destroy:zi,undestroy:Vi,errorOrDestroy:Gi},ve={};function Ki(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ni={};function J(e,t,r){r||(r=Error);function i(f,l,u){return typeof t=="string"?t:t(f,l,u)}var n=function(f){Ki(l,f);function l(u,b,h){return f.call(this,i(u,b,h))||this}return l}(r);n.prototype.name=r.name,n.prototype.code=e,ni[e]=n}function Sr(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(i){return String(i)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Yi(e,t,r){return e.substr(0,t.length)===t}function Ji(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Xi(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}J("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);J("ERR_INVALID_ARG_TYPE",function(e,t,r){var i;typeof t=="string"&&Yi(t,"not ")?(i="must not be",t=t.replace(/^not /,"")):i="must be";var n;if(Ji(e," argument"))n="The ".concat(e," ").concat(i," ").concat(Sr(t,"type"));else{var f=Xi(e,".")?"property":"argument";n='The "'.concat(e,'" ').concat(f," ").concat(i," ").concat(Sr(t,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);J("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");J("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});J("ERR_STREAM_PREMATURE_CLOSE","Premature close");J("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});J("ERR_MULTIPLE_CALLBACK","Callback called multiple times");J("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");J("ERR_STREAM_WRITE_AFTER_END","write after end");J("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);J("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);J("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");ve.codes=ni;var Qi=ve.codes.ERR_INVALID_OPT_VALUE;function Zi(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function en(e,t,r,i){var n=Zi(t,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var f=i?r:"highWaterMark";throw new Qi(f,n)}return Math.floor(n)}return e.objectMode?16:16*1024}var ai={getHighWaterMark:en},tn=rn;function rn(e,t){if(Jt("noDeprecation"))return e;var r=!1;function i(){if(!r){if(Jt("throwDeprecation"))throw new Error(t);Jt("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return i}function Jt(e){try{if(!globalThis.localStorage)return!1}catch{return!1}var t=globalThis.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Xt,Rr;function oi(){if(Rr)return Xt;Rr=1;var e={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};Xt=D;function t(c){var d=this;this.next=null,this.entry=null,this.finish=function(){q(d,c)}}var r;D.WritableState=M;var i={deprecate:tn},n=ri,f=Oe.Buffer,l=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function u(c){return f.from(c)}function b(c){return f.isBuffer(c)||c instanceof l}var h=ii,g=ai,_=g.getHighWaterMark,w=ve.codes,v=w.ERR_INVALID_ARG_TYPE,m=w.ERR_METHOD_NOT_IMPLEMENTED,T=w.ERR_MULTIPLE_CALLBACK,E=w.ERR_STREAM_CANNOT_PIPE,s=w.ERR_STREAM_DESTROYED,p=w.ERR_STREAM_NULL_VALUES,C=w.ERR_STREAM_WRITE_AFTER_END,R=w.ERR_UNKNOWN_ENCODING,S=h.errorOrDestroy;Z(D,n);function N(){}function M(c,d,x){r=r||Se(),c=c||{},typeof x!="boolean"&&(x=d instanceof r),this.objectMode=!!c.objectMode,x&&(this.objectMode=this.objectMode||!!c.writableObjectMode),this.highWaterMark=_(this,c,"writableHighWaterMark",x),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var k=c.decodeStrings===!1;this.decodeStrings=!k,this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(O){he(d,O)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=c.emitClose!==!1,this.autoDestroy=!!c.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}M.prototype.getBuffer=function(){for(var d=this.bufferedRequest,x=[];d;)x.push(d),d=d.next;return x},function(){try{Object.defineProperty(M.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var P;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(P=Function.prototype[Symbol.hasInstance],Object.defineProperty(D,Symbol.hasInstance,{value:function(d){return P.call(this,d)?!0:this!==D?!1:d&&d._writableState instanceof M}})):P=function(d){return d instanceof this};function D(c){r=r||Se();var d=this instanceof r;if(!d&&!P.call(D,this))return new D(c);this._writableState=new M(c,this,d),this.writable=!0,c&&(typeof c.write=="function"&&(this._write=c.write),typeof c.writev=="function"&&(this._writev=c.writev),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.final=="function"&&(this._final=c.final)),n.call(this)}D.prototype.pipe=function(){S(this,new E)};function B(c,d){var x=new C;S(c,x),e.nextTick(d,x)}function j(c,d,x,k){var O;return x===null?O=new p:typeof x!="string"&&!d.objectMode&&(O=new v("chunk",["string","Buffer"],x)),O?(S(c,O),e.nextTick(k,O),!1):!0}D.prototype.write=function(c,d,x){var k=this._writableState,O=!1,a=!k.objectMode&&b(c);return a&&!f.isBuffer(c)&&(c=u(c)),typeof d=="function"&&(x=d,d=null),a?d="buffer":d||(d=k.defaultEncoding),typeof x!="function"&&(x=N),k.ending?B(this,x):(a||j(this,k,c,x))&&(k.pendingcb++,O=W(this,k,a,c,d,x)),O},D.prototype.cork=function(){this._writableState.corked++},D.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&Q(this,c))},D.prototype.setDefaultEncoding=function(d){if(typeof d=="string"&&(d=d.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((d+"").toLowerCase())>-1))throw new R(d);return this._writableState.defaultEncoding=d,this},Object.defineProperty(D.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function X(c,d,x){return!c.objectMode&&c.decodeStrings!==!1&&typeof d=="string"&&(d=f.from(d,x)),d}Object.defineProperty(D.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function W(c,d,x,k,O,a){if(!x){var o=X(d,k,O);k!==o&&(x=!0,O="buffer",k=o)}var y=d.objectMode?1:k.length;d.length+=y;var A=d.length */var Cr;function nn(){return Cr||(Cr=1,function(e,t){var r=Oe,i=r.Buffer;function n(l,u){for(var b in l)u[b]=l[b]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=f);function f(l,u,b){return i(l,u,b)}f.prototype=Object.create(i.prototype),n(i,f),f.from=function(l,u,b){if(typeof l=="number")throw new TypeError("Argument must not be a number");return i(l,u,b)},f.alloc=function(l,u,b){if(typeof l!="number")throw new TypeError("Argument must be a number");var h=i(l);return u!==void 0?typeof b=="string"?h.fill(u,b):h.fill(u):h.fill(0),h},f.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return i(l)},f.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(l)}}(je,je.exports)),je.exports}var Ar;function Br(){if(Ar)return Zt;Ar=1;var e=nn().Buffer,t=e.isEncoding||function(s){switch(s=""+s,s&&s.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(s){if(!s)return"utf8";for(var p;;)switch(s){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return s;default:if(p)return;s=(""+s).toLowerCase(),p=!0}}function i(s){var p=r(s);if(typeof p!="string"&&(e.isEncoding===t||!t(s)))throw new Error("Unknown encoding: "+s);return p||s}Zt.StringDecoder=n;function n(s){this.encoding=i(s);var p;switch(this.encoding){case"utf16le":this.text=_,this.end=w,p=4;break;case"utf8":this.fillLast=b,p=4;break;case"base64":this.text=v,this.end=m,p=3;break;default:this.write=T,this.end=E;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(p)}n.prototype.write=function(s){if(s.length===0)return"";var p,C;if(this.lastNeed){if(p=this.fillLast(s),p===void 0)return"";C=this.lastNeed,this.lastNeed=0}else C=0;return C>5===6?2:s>>4===14?3:s>>3===30?4:s>>6===2?-1:-2}function l(s,p,C){var R=p.length-1;if(R=0?(S>0&&(s.lastNeed=S-1),S):--R=0?(S>0&&(s.lastNeed=S-2),S):--R=0?(S>0&&(S===2?S=0:s.lastNeed=S-3),S):0))}function u(s,p,C){if((p[0]&192)!==128)return s.lastNeed=0,"�";if(s.lastNeed>1&&p.length>1){if((p[1]&192)!==128)return s.lastNeed=1,"�";if(s.lastNeed>2&&p.length>2&&(p[2]&192)!==128)return s.lastNeed=2,"�"}}function b(s){var p=this.lastTotal-this.lastNeed,C=u(this,s);if(C!==void 0)return C;if(this.lastNeed<=s.length)return s.copy(this.lastChar,p,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);s.copy(this.lastChar,p,0,s.length),this.lastNeed-=s.length}function h(s,p){var C=l(this,s,p);if(!this.lastNeed)return s.toString("utf8",p);this.lastTotal=C;var R=s.length-(C-this.lastNeed);return s.copy(this.lastChar,0,R),s.toString("utf8",p,R)}function g(s){var p=s&&s.length?this.write(s):"";return this.lastNeed?p+"�":p}function _(s,p){if((s.length-p)%2===0){var C=s.toString("utf16le",p);if(C){var R=C.charCodeAt(C.length-1);if(R>=55296&&R<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=s[s.length-2],this.lastChar[1]=s[s.length-1],C.slice(0,-1)}return C}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=s[s.length-1],s.toString("utf16le",p,s.length-1)}function w(s){var p=s&&s.length?this.write(s):"";if(this.lastNeed){var C=this.lastTotal-this.lastNeed;return p+this.lastChar.toString("utf16le",0,C)}return p}function v(s,p){var C=(s.length-p)%3;return C===0?s.toString("base64",p):(this.lastNeed=3-C,this.lastTotal=3,C===1?this.lastChar[0]=s[s.length-1]:(this.lastChar[0]=s[s.length-2],this.lastChar[1]=s[s.length-1]),s.toString("base64",p,s.length-C))}function m(s){var p=s&&s.length?this.write(s):"";return this.lastNeed?p+this.lastChar.toString("base64",0,3-this.lastNeed):p}function T(s){return s.toString(this.encoding)}function E(s){return s&&s.length?this.write(s):""}return Zt}var kr=ve.codes.ERR_STREAM_PREMATURE_CLOSE;function an(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n0)if(typeof o!="string"&&!L.objectMode&&Object.getPrototypeOf(o)!==n.prototype&&(o=l(o)),A)L.endEmitted?N(a,new p):X(a,L,o,!0);else if(L.ended)N(a,new E);else{if(L.destroyed)return!1;L.reading=!1,L.decoder&&!y?(o=L.decoder.write(o),L.objectMode||o.length!==0?X(a,L,o,!1):Q(a,L)):X(a,L,o,!1)}else A||(L.reading=!1,Q(a,L))}return!L.ended&&(L.length=V?a=V:(a--,a|=a>>>1,a|=a>>>2,a|=a>>>4,a|=a>>>8,a|=a>>>16,a++),a}function ne(a,o){return a<=0||o.length===0&&o.ended?0:o.objectMode?1:a!==a?o.flowing&&o.length?o.buffer.head.data.length:o.length:(a>o.highWaterMark&&(o.highWaterMark=G(a)),a<=o.length?a:o.ended?o.length:(o.needReadable=!0,0))}B.prototype.read=function(a){h("read",a),a=parseInt(a,10);var o=this._readableState,y=a;if(a!==0&&(o.emittedReadable=!1),a===0&&o.needReadable&&((o.highWaterMark!==0?o.length>=o.highWaterMark:o.length>0)||o.ended))return h("read: emitReadable",o.length,o.ended),o.length===0&&o.ended?x(this):K(this),null;if(a=ne(a,o),a===0&&o.ended)return o.length===0&&x(this),null;var A=o.needReadable;h("need readable",A),(o.length===0||o.length-a0?U=d(a,o):U=null,U===null?(o.needReadable=o.length<=o.highWaterMark,a=0):(o.length-=a,o.awaitDrain=0),o.length===0&&(o.ended||(o.needReadable=!0),y!==a&&o.ended&&x(this)),U!==null&&this.emit("data",U),U};function he(a,o){if(h("onEofChunk"),!o.ended){if(o.decoder){var y=o.decoder.end();y&&y.length&&(o.buffer.push(y),o.length+=o.objectMode?1:y.length)}o.ended=!0,o.sync?K(a):(o.needReadable=!1,o.emittedReadable||(o.emittedReadable=!0,ee(a)))}}function K(a){var o=a._readableState;h("emitReadable",o.needReadable,o.emittedReadable),o.needReadable=!1,o.emittedReadable||(h("emitReadable",o.flowing),o.emittedReadable=!0,e.nextTick(ee,a))}function ee(a){var o=a._readableState;h("emitReadable_",o.destroyed,o.length,o.ended),!o.destroyed&&(o.length||o.ended)&&(a.emit("readable"),o.emittedReadable=!1),o.needReadable=!o.flowing&&!o.ended&&o.length<=o.highWaterMark,c(a)}function Q(a,o){o.readingMore||(o.readingMore=!0,e.nextTick(ae,a,o))}function ae(a,o){for(;!o.reading&&!o.ended&&(o.length1&&O(A.pipes,a)!==-1)&&!Be&&(h("false write response, pause",A.awaitDrain),A.awaitDrain++),y.pause())}function Ee(re){h("onerror",re),ce(),a.removeListener("error",Ee),r(a,"error")===0&&N(a,re)}P(a,"error",Ee);function xe(){a.removeListener("finish",me),ce()}a.once("close",xe);function me(){h("onfinish"),a.removeListener("close",xe),ce()}a.once("finish",me);function ce(){h("unpipe"),y.unpipe(a)}return a.emit("pipe",y),A.flowing||(h("pipe resume"),y.resume()),a};function _e(a){return function(){var y=a._readableState;h("pipeOnDrain",y.awaitDrain),y.awaitDrain&&y.awaitDrain--,y.awaitDrain===0&&r(a,"data")&&(y.flowing=!0,c(a))}}B.prototype.unpipe=function(a){var o=this._readableState,y={hasUnpiped:!1};if(o.pipesCount===0)return this;if(o.pipesCount===1)return a&&a!==o.pipes?this:(a||(a=o.pipes),o.pipes=null,o.pipesCount=0,o.flowing=!1,a&&a.emit("unpipe",this,y),this);if(!a){var A=o.pipes,U=o.pipesCount;o.pipes=null,o.pipesCount=0,o.flowing=!1;for(var L=0;L0,A.flowing!==!1&&this.resume()):a==="readable"&&!A.endEmitted&&!A.readableListening&&(A.readableListening=A.needReadable=!0,A.flowing=!1,A.emittedReadable=!1,h("on readable",A.length,A.reading),A.length?K(this):A.reading||e.nextTick(Y,this)),y},B.prototype.addListener=B.prototype.on,B.prototype.removeListener=function(a,o){var y=i.prototype.removeListener.call(this,a,o);return a==="readable"&&e.nextTick(te,this),y},B.prototype.removeAllListeners=function(a){var o=i.prototype.removeAllListeners.apply(this,arguments);return(a==="readable"||a===void 0)&&e.nextTick(te,this),o};function te(a){var o=a._readableState;o.readableListening=a.listenerCount("readable")>0,o.resumeScheduled&&!o.paused?o.flowing=!0:a.listenerCount("data")>0&&a.resume()}function Y(a){h("readable nexttick read 0"),a.read(0)}B.prototype.resume=function(){var a=this._readableState;return a.flowing||(h("resume"),a.flowing=!a.readableListening,oe(this,a)),a.paused=!1,this};function oe(a,o){o.resumeScheduled||(o.resumeScheduled=!0,e.nextTick(q,a,o))}function q(a,o){h("resume",o.reading),o.reading||a.read(0),o.resumeScheduled=!1,a.emit("resume"),c(a),o.flowing&&!o.reading&&a.read(0)}B.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function c(a){var o=a._readableState;for(h("flow",o.flowing);o.flowing&&a.read()!==null;);}B.prototype.wrap=function(a){var o=this,y=this._readableState,A=!1;a.on("end",function(){if(h("wrapped end"),y.decoder&&!y.ended){var I=y.decoder.end();I&&I.length&&o.push(I)}o.push(null)}),a.on("data",function(I){if(h("wrapped data"),y.decoder&&(I=y.decoder.write(I)),!(y.objectMode&&I==null)&&!(!y.objectMode&&(!I||!I.length))){var fe=o.push(I);fe||(A=!0,a.pause())}});for(var U in a)this[U]===void 0&&typeof a[U]=="function"&&(this[U]=function(fe){return function(){return a[fe].apply(a,arguments)}}(U));for(var L=0;L=o.length?(o.decoder?y=o.buffer.join(""):o.buffer.length===1?y=o.buffer.first():y=o.buffer.concat(o.length),o.buffer.clear()):y=o.buffer.consume(a,o.decoder),y}function x(a){var o=a._readableState;h("endReadable",o.endEmitted),o.endEmitted||(o.ended=!0,e.nextTick(k,o,a))}function k(a,o){if(h("endReadableNT",a.endEmitted,a.length),!a.endEmitted&&a.length===0&&(a.endEmitted=!0,o.readable=!1,o.emit("end"),a.autoDestroy)){var y=o._writableState;(!y||y.autoDestroy&&y.finished)&&o.destroy()}}typeof Symbol=="function"&&(B.from=function(a,o){return S===void 0&&(S=ln()),S(B,a,o)});function O(a,o){for(var y=0,A=a.length;y0;return En(l,b,h,function(g){n||(n=g),g&&f.forEach(Pr),!b&&(f.forEach(Pr),i(n))})});return t.reduce(xn)}var Rn=Sn;(function(e,t){t=e.exports=si(),t.Stream=t,t.Readable=t,t.Writable=oi(),t.Duplex=Se(),t.Transform=li,t.PassThrough=bn,t.finished=pr,t.pipeline=Rn})(ar,ar.exports);var _i=ar.exports;const{Transform:Tn}=_i;var Cn=e=>class ci extends Tn{constructor(r,i,n,f,l){super(l),this._rate=r,this._capacity=i,this._delimitedSuffix=n,this._hashBitLength=f,this._options=l,this._state=new e,this._state.initialize(r,i),this._finalized=!1}_transform(r,i,n){let f=null;try{this.update(r,i)}catch(l){f=l}n(f)}_flush(r){let i=null;try{this.push(this.digest())}catch(n){i=n}r(i)}update(r,i){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,i)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let i=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(i=i.toString(r)),this._resetState(),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new ci(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:An}=_i;var Bn=e=>class di extends An{constructor(r,i,n,f){super(f),this._rate=r,this._capacity=i,this._delimitedSuffix=n,this._options=f,this._state=new e,this._state.initialize(r,i),this._finalized=!1}_transform(r,i,n){let f=null;try{this.update(r,i)}catch(l){f=l}n(f)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,i){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,i)),this._state.absorb(r),this}squeeze(r,i){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let n=this._state.squeeze(r);return i!==void 0&&(n=n.toString(i)),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new di(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const kn=Cn,Mn=Bn;var Nn=function(e){const t=kn(e),r=Mn(e);return function(i,n){switch(typeof i=="string"?i.toLowerCase():i){case"keccak224":return new t(1152,448,null,224,n);case"keccak256":return new t(1088,512,null,256,n);case"keccak384":return new t(832,768,null,384,n);case"keccak512":return new t(576,1024,null,512,n);case"sha3-224":return new t(1152,448,6,224,n);case"sha3-256":return new t(1088,512,6,256,n);case"sha3-384":return new t(832,768,6,384,n);case"sha3-512":return new t(576,1024,6,512,n);case"shake128":return new r(1344,256,31,n);case"shake256":return new r(1088,512,31,n);default:throw new Error("Invald algorithm: "+i)}}},pi={};const Ir=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];pi.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],n=e[2]^e[12]^e[22]^e[32]^e[42],f=e[3]^e[13]^e[23]^e[33]^e[43],l=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],b=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],g=e[8]^e[18]^e[28]^e[38]^e[48],_=e[9]^e[19]^e[29]^e[39]^e[49];let w=g^(n<<1|f>>>31),v=_^(f<<1|n>>>31);const m=e[0]^w,T=e[1]^v,E=e[10]^w,s=e[11]^v,p=e[20]^w,C=e[21]^v,R=e[30]^w,S=e[31]^v,N=e[40]^w,M=e[41]^v;w=r^(l<<1|u>>>31),v=i^(u<<1|l>>>31);const P=e[2]^w,D=e[3]^v,B=e[12]^w,j=e[13]^v,X=e[22]^w,W=e[23]^v,V=e[32]^w,G=e[33]^v,ne=e[42]^w,he=e[43]^v;w=n^(b<<1|h>>>31),v=f^(h<<1|b>>>31);const K=e[4]^w,ee=e[5]^v,Q=e[14]^w,ae=e[15]^v,_e=e[24]^w,te=e[25]^v,Y=e[34]^w,oe=e[35]^v,q=e[44]^w,c=e[45]^v;w=l^(g<<1|_>>>31),v=u^(_<<1|g>>>31);const d=e[6]^w,x=e[7]^v,k=e[16]^w,O=e[17]^v,a=e[26]^w,o=e[27]^v,y=e[36]^w,A=e[37]^v,U=e[46]^w,L=e[47]^v;w=b^(r<<1|i>>>31),v=h^(i<<1|r>>>31);const I=e[8]^w,fe=e[9]^v,de=e[18]^w,Be=e[19]^v,qe=e[28]^w,ke=e[29]^v,Ee=e[38]^w,xe=e[39]^v,me=e[48]^w,ce=e[49]^v,re=m,ie=T,tt=s<<4|E>>>28,rt=E<<4|s>>>28,it=p<<3|C>>>29,nt=C<<3|p>>>29,at=S<<9|R>>>23,ot=R<<9|S>>>23,ft=N<<18|M>>>14,st=M<<18|N>>>14,lt=P<<1|D>>>31,ut=D<<1|P>>>31,ht=j<<12|B>>>20,_t=B<<12|j>>>20,ct=X<<10|W>>>22,dt=W<<10|X>>>22,pt=G<<13|V>>>19,bt=V<<13|G>>>19,vt=ne<<2|he>>>30,gt=he<<2|ne>>>30,yt=ee<<30|K>>>2,wt=K<<30|ee>>>2,Et=Q<<6|ae>>>26,xt=ae<<6|Q>>>26,mt=te<<11|_e>>>21,St=_e<<11|te>>>21,Rt=Y<<15|oe>>>17,Tt=oe<<15|Y>>>17,Ct=c<<29|q>>>3,At=q<<29|c>>>3,Bt=d<<28|x>>>4,kt=x<<28|d>>>4,Mt=O<<23|k>>>9,Nt=k<<23|O>>>9,Dt=a<<25|o>>>7,Lt=o<<25|a>>>7,Ot=y<<21|A>>>11,Pt=A<<21|y>>>11,It=L<<24|U>>>8,$t=U<<24|L>>>8,Ft=I<<27|fe>>>5,Ut=fe<<27|I>>>5,Ht=de<<20|Be>>>12,qt=Be<<20|de>>>12,jt=ke<<7|qe>>>25,Wt=qe<<7|ke>>>25,zt=Ee<<8|xe>>>24,Vt=xe<<8|Ee>>>24,Gt=me<<14|ce>>>18,Kt=ce<<14|me>>>18;e[0]=re^~ht&mt,e[1]=ie^~_t&St,e[10]=Bt^~Ht&it,e[11]=kt^~qt&nt,e[20]=lt^~Et&Dt,e[21]=ut^~xt&Lt,e[30]=Ft^~tt&ct,e[31]=Ut^~rt&dt,e[40]=yt^~Mt&jt,e[41]=wt^~Nt&Wt,e[2]=ht^~mt&Ot,e[3]=_t^~St&Pt,e[12]=Ht^~it&pt,e[13]=qt^~nt&bt,e[22]=Et^~Dt&zt,e[23]=xt^~Lt&Vt,e[32]=tt^~ct&Rt,e[33]=rt^~dt&Tt,e[42]=Mt^~jt&at,e[43]=Nt^~Wt&ot,e[4]=mt^~Ot&Gt,e[5]=St^~Pt&Kt,e[14]=it^~pt&Ct,e[15]=nt^~bt&At,e[24]=Dt^~zt&ft,e[25]=Lt^~Vt&st,e[34]=ct^~Rt&It,e[35]=dt^~Tt&$t,e[44]=jt^~at&vt,e[45]=Wt^~ot>,e[6]=Ot^~Gt&re,e[7]=Pt^~Kt&ie,e[16]=pt^~Ct&Bt,e[17]=bt^~At&kt,e[26]=zt^~ft<,e[27]=Vt^~st&ut,e[36]=Rt^~It&Ft,e[37]=Tt^~$t&Ut,e[46]=at^~vt&yt,e[47]=ot^~gt&wt,e[8]=Gt^~re&ht,e[9]=Kt^~ie&_t,e[18]=Ct^~Bt&Ht,e[19]=At^~kt&qt,e[28]=ft^~lt&Et,e[29]=st^~ut&xt,e[38]=It^~Ft&tt,e[39]=$t^~Ut&rt,e[48]=vt^~yt&Mt,e[49]=gt^~wt&Nt,e[0]^=Ir[t*2],e[1]^=Ir[t*2+1]}};const Ge=pi;function Ce(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}Ce.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};Ce.prototype.absorb=function(e){for(let t=0;t>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Ge.p1600(this.state),this.count=0);return t};Ce.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Dn=Ce,Ja=Nn(Dn),bi={exports:{}},fr={exports:{}};(function(e,t){var r=Oe,i=r.Buffer;function n(l,u){for(var b in l)u[b]=l[b]}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(n(r,t),t.Buffer=f);function f(l,u,b){return i(l,u,b)}n(i,f),f.from=function(l,u,b){if(typeof l=="number")throw new TypeError("Argument must not be a number");return i(l,u,b)},f.alloc=function(l,u,b){if(typeof l!="number")throw new TypeError("Argument must be a number");var h=i(l);return u!==void 0?typeof b=="string"?h.fill(u,b):h.fill(u):h.fill(0),h},f.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return i(l)},f.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(l)}})(fr,fr.exports);var ge=fr.exports,vi=ge.Buffer;function Xe(e,t){this._block=vi.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Xe.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=vi.from(e,t));for(var r=this._block,i=this._blockSize,n=e.length,f=this._len,l=0;l=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var f=this._hash();return e?f.toString(e):f};Xe.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Ae=Xe,Ln=Z,gi=Ae,On=ge.Buffer,Pn=[1518500249,1859775393,-1894007588,-899497514],In=new Array(80);function Pe(){this.init(),this._w=In,gi.call(this,64,56)}Ln(Pe,gi);Pe.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function $n(e){return e<<5|e>>>27}function Fn(e){return e<<30|e>>>2}function Un(e,t,r,i){return e===0?t&r|~t&i:e===2?t&r|t&i|r&i:t^r^i}Pe.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,f=this._d|0,l=this._e|0,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=t[u-3]^t[u-8]^t[u-14]^t[u-16];for(var b=0;b<80;++b){var h=~~(b/20),g=$n(r)+Un(h,i,n,f)+l+t[b]+Pn[h]|0;l=f,f=n,n=Fn(i),i=r,r=g}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=f+this._d|0,this._e=l+this._e|0};Pe.prototype._hash=function(){var e=On.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Hn=Pe,qn=Z,yi=Ae,jn=ge.Buffer,Wn=[1518500249,1859775393,-1894007588,-899497514],zn=new Array(80);function Ie(){this.init(),this._w=zn,yi.call(this,64,56)}qn(Ie,yi);Ie.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Vn(e){return e<<1|e>>>31}function Gn(e){return e<<5|e>>>27}function Kn(e){return e<<30|e>>>2}function Yn(e,t,r,i){return e===0?t&r|~t&i:e===2?t&r|t&i|r&i:t^r^i}Ie.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,f=this._d|0,l=this._e|0,u=0;u<16;++u)t[u]=e.readInt32BE(u*4);for(;u<80;++u)t[u]=Vn(t[u-3]^t[u-8]^t[u-14]^t[u-16]);for(var b=0;b<80;++b){var h=~~(b/20),g=Gn(r)+Yn(h,i,n,f)+l+t[b]+Wn[h]|0;l=f,f=n,n=Kn(i),i=r,r=g}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=f+this._d|0,this._e=l+this._e|0};Ie.prototype._hash=function(){var e=jn.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Jn=Ie,Xn=Z,wi=Ae,Qn=ge.Buffer,Zn=[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],ea=new Array(64);function $e(){this.init(),this._w=ea,wi.call(this,64,56)}Xn($e,wi);$e.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ta(e,t,r){return r^e&(t^r)}function ra(e,t,r){return e&t|r&(e|t)}function ia(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function na(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function aa(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function oa(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}$e.prototype._update=function(e){for(var t=this._w,r=this._a|0,i=this._b|0,n=this._c|0,f=this._d|0,l=this._e|0,u=this._f|0,b=this._g|0,h=this._h|0,g=0;g<16;++g)t[g]=e.readInt32BE(g*4);for(;g<64;++g)t[g]=oa(t[g-2])+t[g-7]+aa(t[g-15])+t[g-16]|0;for(var _=0;_<64;++_){var w=h+na(l)+ta(l,u,b)+Zn[_]+t[_]|0,v=ia(r)+ra(r,i,n)|0;h=b,b=u,u=l,l=f+w|0,f=n,n=i,i=r,r=w+v|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=f+this._d|0,this._e=l+this._e|0,this._f=u+this._f|0,this._g=b+this._g|0,this._h=h+this._h|0};$e.prototype._hash=function(){var e=Qn.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Ei=$e,fa=Z,sa=Ei,la=Ae,ua=ge.Buffer,ha=new Array(64);function Qe(){this.init(),this._w=ha,la.call(this,64,56)}fa(Qe,sa);Qe.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Qe.prototype._hash=function(){var e=ua.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var _a=Qe,ca=Z,xi=Ae,da=ge.Buffer,$r=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],pa=new Array(160);function Fe(){this.init(),this._w=pa,xi.call(this,128,112)}ca(Fe,xi);Fe.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Fr(e,t,r){return r^e&(t^r)}function Ur(e,t,r){return e&t|r&(e|t)}function Hr(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function qr(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ba(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function va(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function ga(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function ya(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function z(e,t){return e>>>0>>0?1:0}Fe.prototype._update=function(e){for(var t=this._w,r=this._ah|0,i=this._bh|0,n=this._ch|0,f=this._dh|0,l=this._eh|0,u=this._fh|0,b=this._gh|0,h=this._hh|0,g=this._al|0,_=this._bl|0,w=this._cl|0,v=this._dl|0,m=this._el|0,T=this._fl|0,E=this._gl|0,s=this._hl|0,p=0;p<32;p+=2)t[p]=e.readInt32BE(p*4),t[p+1]=e.readInt32BE(p*4+4);for(;p<160;p+=2){var C=t[p-30],R=t[p-15*2+1],S=ba(C,R),N=va(R,C);C=t[p-2*2],R=t[p-2*2+1];var M=ga(C,R),P=ya(R,C),D=t[p-7*2],B=t[p-7*2+1],j=t[p-16*2],X=t[p-16*2+1],W=N+B|0,V=S+D+z(W,N)|0;W=W+P|0,V=V+M+z(W,P)|0,W=W+X|0,V=V+j+z(W,X)|0,t[p]=V,t[p+1]=W}for(var G=0;G<160;G+=2){V=t[G],W=t[G+1];var ne=Ur(r,i,n),he=Ur(g,_,w),K=Hr(r,g),ee=Hr(g,r),Q=qr(l,m),ae=qr(m,l),_e=$r[G],te=$r[G+1],Y=Fr(l,u,b),oe=Fr(m,T,E),q=s+ae|0,c=h+Q+z(q,s)|0;q=q+oe|0,c=c+Y+z(q,oe)|0,q=q+te|0,c=c+_e+z(q,te)|0,q=q+W|0,c=c+V+z(q,W)|0;var d=ee+he|0,x=K+ne+z(d,ee)|0;h=b,s=E,b=u,E=T,u=l,T=m,m=v+q|0,l=f+c+z(m,v)|0,f=n,v=w,n=i,w=_,i=r,_=g,g=q+d|0,r=c+x+z(g,q)|0}this._al=this._al+g|0,this._bl=this._bl+_|0,this._cl=this._cl+w|0,this._dl=this._dl+v|0,this._el=this._el+m|0,this._fl=this._fl+T|0,this._gl=this._gl+E|0,this._hl=this._hl+s|0,this._ah=this._ah+r+z(this._al,g)|0,this._bh=this._bh+i+z(this._bl,_)|0,this._ch=this._ch+n+z(this._cl,w)|0,this._dh=this._dh+f+z(this._dl,v)|0,this._eh=this._eh+l+z(this._el,m)|0,this._fh=this._fh+u+z(this._fl,T)|0,this._gh=this._gh+b+z(this._gl,E)|0,this._hh=this._hh+h+z(this._hl,s)|0};Fe.prototype._hash=function(){var e=da.allocUnsafe(64);function t(r,i,n){e.writeInt32BE(r,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var mi=Fe,wa=Z,Ea=mi,xa=Ae,ma=ge.Buffer,Sa=new Array(160);function Ze(){this.init(),this._w=Sa,xa.call(this,128,112)}wa(Ze,Ea);Ze.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Ze.prototype._hash=function(){var e=ma.allocUnsafe(48);function t(r,i,n){e.writeInt32BE(r,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Ra=Ze,ye=bi.exports=function(t){t=t.toLowerCase();var r=ye[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};ye.sha=Hn;ye.sha1=Jn;ye.sha224=_a;ye.sha256=Ei;ye.sha384=Ra;ye.sha512=mi;var Xa=bi.exports,Ue,F,Si,Ri,be,jr,Ti,sr,br,lr,ur,Ci,Le={},Ai=[],Ta=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,et=Array.isArray;function se(e,t){for(var r in t)e[r]=t[r];return e}function Bi(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function hr(e,t,r){var i,n,f,l={};for(f in t)f=="key"?i=t[f]:f=="ref"?n=t[f]:l[f]=t[f];if(arguments.length>2&&(l.children=arguments.length>3?Ue.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(f in e.defaultProps)l[f]===void 0&&(l[f]=e.defaultProps[f]);return Me(e,l,i,n,null)}function Me(e,t,r,i,n){var f={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++Si,__i:-1,__u:0};return n==null&&F.vnode!=null&&F.vnode(f),f}function Ca(){return{current:null}}function He(e){return e.children}function Ne(e,t){this.props=e,this.context=t}function Re(e,t){if(t==null)return e.__?Re(e.__,e.__i+1):null;for(var r;tt&&be.sort(sr));Ke.__r=0}function Mi(e,t,r,i,n,f,l,u,b,h,g){var _,w,v,m,T,E=i&&i.__k||Ai,s=t.length;for(r.__d=b,Aa(r,t,E),b=r.__d,_=0;_0?Me(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n).__=e,n.__b=e.__b+1,f=null,(u=n.__i=Ba(n,r,l,g))!==-1&&(g--,(f=r[u])&&(f.__u|=131072)),f==null||f.__v===null?(u==-1&&_--,typeof n.type!="function"&&(n.__u|=65536)):u!==l&&(u==l-1?_--:u==l+1?_++:(u>l?_--:_++,n.__u|=65536))):n=e.__k[i]=null;if(g)for(i=0;i(b!=null&&!(131072&b.__u)?1:0))for(;l>=0||u=0){if((b=t[l])&&!(131072&b.__u)&&n==b.key&&f===b.type)return l;l--}if(u2&&(u.children=arguments.length>3?Ue.call(arguments,2):r),Me(e.type,u,i||e.key,n||e.ref,null)}function Da(e,t){var r={__c:t="__cC"+Ci++,__:e,Consumer:function(i,n){return i.children(n)},Provider:function(i){var n,f;return this.getChildContext||(n=new Set,(f={})[t]=this,this.getChildContext=function(){return f},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(l){this.props.value!==l.value&&n.forEach(function(u){u.__e=!0,_r(u)})},this.sub=function(l){n.add(l);var u=l.componentWillUnmount;l.componentWillUnmount=function(){n&&n.delete(l),u&&u.call(l)}}),i.children}};return r.Provider.__=r.Consumer.contextType=r}Ue=Ai.slice,F={__e:function(e,t,r,i){for(var n,f,l;t=t.__;)if((n=t.__c)&&!n.__)try{if((f=n.constructor)&&f.getDerivedStateFromError!=null&&(n.setState(f.getDerivedStateFromError(e)),l=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,i||{}),l=n.__d),l)return n.__E=n}catch(u){e=u}throw e}},Si=0,Ri=function(e){return e!=null&&e.constructor==null},Ne.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=se({},this.state),typeof e=="function"&&(e=e(se({},r),this.props)),e&&se(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),_r(this))},Ne.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_r(this))},Ne.prototype.render=He,be=[],Ti=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,sr=function(e,t){return e.__v.__b-t.__v.__b},Ke.__r=0,br=0,lr=zr(!1),ur=zr(!0),Ci=0;const La=Object.freeze(Object.defineProperty({__proto__:null,Component:Ne,Fragment:He,cloneElement:Na,createContext:Da,createElement:hr,createRef:Ca,h:hr,hydrate:Ii,get isValidElement(){return Ri},get options(){return F},render:Pi,toChildArray:Di},Symbol.toStringTag,{value:"Module"})),Qa=dr(La);var ue,$,nr,Vr,Te=0,$i=[],H=F,Gr=H.__b,Kr=H.__r,Yr=H.diffed,Jr=H.__c,Xr=H.unmount,Qr=H.__;function we(e,t){H.__h&&H.__h($,e,Te||t),Te=0;var r=$.__H||($.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Fi(e){return Te=1,Ui(qi,e)}function Ui(e,t,r){var i=we(ue++,2);if(i.t=e,!i.__c&&(i.__=[r?r(t):qi(void 0,t),function(u){var b=i.__N?i.__N[0]:i.__[0],h=i.t(b,u);b!==h&&(i.__N=[h,i.__[1]],i.__c.setState({}))}],i.__c=$,!$.u)){var n=function(u,b,h){if(!i.__c.__H)return!0;var g=i.__c.__H.__.filter(function(w){return!!w.__c});if(g.every(function(w){return!w.__N}))return!f||f.call(this,u,b,h);var _=!1;return g.forEach(function(w){if(w.__N){var v=w.__[0];w.__=w.__N,w.__N=void 0,v!==w.__[0]&&(_=!0)}}),!(!_&&i.__c.props===u)&&(!f||f.call(this,u,b,h))};$.u=!0;var f=$.shouldComponentUpdate,l=$.componentWillUpdate;$.componentWillUpdate=function(u,b,h){if(this.__e){var g=f;f=void 0,n(u,b,h),f=g}l&&l.call(this,u,b,h)},$.shouldComponentUpdate=n}return i.__N||i.__}function Oa(e,t){var r=we(ue++,3);!H.__s&&wr(r.__H,t)&&(r.__=e,r.i=t,$.__H.__h.push(r))}function Hi(e,t){var r=we(ue++,4);!H.__s&&wr(r.__H,t)&&(r.__=e,r.i=t,$.__h.push(r))}function Pa(e){return Te=5,yr(function(){return{current:e}},[])}function Ia(e,t,r){Te=6,Hi(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function yr(e,t){var r=we(ue++,7);return wr(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function $a(e,t){return Te=8,yr(function(){return e},t)}function Fa(e){var t=$.context[e.__c],r=we(ue++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub($)),t.props.value):e.__}function Ua(e,t){H.useDebugValue&&H.useDebugValue(t?t(e):e)}function Ha(e){var t=we(ue++,10),r=Fi();return t.__=e,$.componentDidCatch||($.componentDidCatch=function(i,n){t.__&&t.__(i,n),r[1](i)}),[r[0],function(){r[1](void 0)}]}function qa(){var e=we(ue++,11);if(!e.__){for(var t=$.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function ja(){for(var e;e=$i.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ve),e.__H.__h.forEach(cr),e.__H.__h=[]}catch(t){e.__H.__h=[],H.__e(t,e.__v)}}H.__b=function(e){$=null,Gr&&Gr(e)},H.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Qr&&Qr(e,t)},H.__r=function(e){Kr&&Kr(e),ue=0;var t=($=e.__c).__H;t&&(nr===$?(t.__h=[],$.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(Ve),t.__h.forEach(cr),t.__h=[],ue=0)),nr=$},H.diffed=function(e){Yr&&Yr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&($i.push(t)!==1&&Vr===H.requestAnimationFrame||((Vr=H.requestAnimationFrame)||Wa)(ja)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),nr=$=null},H.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ve),r.__h=r.__h.filter(function(i){return!i.__||cr(i)})}catch(i){t.some(function(n){n.__h&&(n.__h=[])}),t=[],H.__e(i,r.__v)}}),Jr&&Jr(e,t)},H.unmount=function(e){Xr&&Xr(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(i){try{Ve(i)}catch(n){t=n}}),r.__H=void 0,t&&H.__e(t,r.__v))};var Zr=typeof requestAnimationFrame=="function";function Wa(e){var t,r=function(){clearTimeout(i),Zr&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,100);Zr&&(t=requestAnimationFrame(r))}function Ve(e){var t=$,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),$=t}function cr(e){var t=$;e.__c=e.__(),$=t}function wr(e,t){return!e||e.length!==t.length||t.some(function(r,i){return r!==e[i]})}function qi(e,t){return typeof t=="function"?t(e):t}const za=Object.freeze(Object.defineProperty({__proto__:null,useCallback:$a,useContext:Fa,useDebugValue:Ua,useEffect:Oa,useErrorBoundary:Ha,useId:qa,useImperativeHandle:Ia,useLayoutEffect:Hi,useMemo:yr,useReducer:Ui,useRef:Pa,useState:Fi},Symbol.toStringTag,{value:"Module"})),Za=dr(za);export{Za as a,Ya as b,Ja as j,Qa as r,Xa as s}; diff --git a/buddybook/assets/hooks.module-D0gf0yJl.js b/buddybook/assets/hooks.module-D0gf0yJl.js new file mode 100644 index 0000000..d5abf3e --- /dev/null +++ b/buddybook/assets/hooks.module-D0gf0yJl.js @@ -0,0 +1 @@ +var F,d,d_,v_,H,o_,m_,z,Y,G,J,y_,M={},g_=[],M_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,B=Array.isArray;function w(e,_){for(var t in _)e[t]=_[t];return e}function b_(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function K(e,_,t){var n,o,i,l={};for(i in _)i=="key"?n=_[i]:i=="ref"?o=_[i]:l[i]=_[i];if(arguments.length>2&&(l.children=arguments.length>3?F.call(arguments,2):t),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return N(e,l,n,o,null)}function N(e,_,t,n,o){var i={type:e,props:_,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++d_,__i:-1,__u:0};return o==null&&d.vnode!=null&&d.vnode(i),i}function F_(){return{current:null}}function A(e){return e.children}function D(e,_){this.props=e,this.context=_}function S(e,_){if(_==null)return e.__?S(e.__,e.__i+1):null;for(var t;__&&H.sort(z));j.__r=0}function $_(e,_,t,n,o,i,l,u,s,c,a){var r,h,f,g,k,b=n&&n.__k||g_,v=_.length;for(t.__d=s,A_(t,_,b),s=t.__d,r=0;r0?N(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,i=null,(u=o.__i=L_(o,t,l,a))!==-1&&(a--,(i=t[u])&&(i.__u|=131072)),i==null||i.__v===null?(u==-1&&r--,typeof o.type!="function"&&(o.__u|=65536)):u!==l&&(u==l-1?r--:u==l+1?r++:(u>l?r--:r++,o.__u|=65536))):o=e.__k[n]=null;if(a)for(n=0;n(s!=null&&!(131072&s.__u)?1:0))for(;l>=0||u<_.length;){if(l>=0){if((s=_[l])&&!(131072&s.__u)&&o==s.key&&i===s.type)return l;l--}if(u<_.length){if((s=_[u])&&!(131072&s.__u)&&o==s.key&&i===s.type)return u;u++}}return-1}function r_(e,_,t){_[0]==="-"?e.setProperty(_,t??""):e[_]=t==null?"":typeof t!="number"||M_.test(_)?t:t+"px"}function R(e,_,t,n,o){var i;_:if(_==="style")if(typeof t=="string")e.style.cssText=t;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(_ in n)t&&_ in t||r_(e.style,_,"");if(t)for(_ in t)n&&t[_]===n[_]||r_(e.style,_,t[_])}else if(_[0]==="o"&&_[1]==="n")i=_!==(_=_.replace(/(PointerCapture)$|Capture$/i,"$1")),_=_.toLowerCase()in e||_==="onFocusOut"||_==="onFocusIn"?_.toLowerCase().slice(2):_.slice(2),e.l||(e.l={}),e.l[_+i]=t,t?n?t.u=n.u:(t.u=Y,e.addEventListener(_,i?J:G,i)):e.removeEventListener(_,i?J:G,i);else{if(o=="http://www.w3.org/2000/svg")_=_.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(_!="width"&&_!="height"&&_!="href"&&_!="list"&&_!="form"&&_!="tabIndex"&&_!="download"&&_!="rowSpan"&&_!="colSpan"&&_!="role"&&_!="popover"&&_ in e)try{e[_]=t??"";break _}catch{}typeof t=="function"||(t==null||t===!1&&_[4]!=="-"?e.removeAttribute(_):e.setAttribute(_,_=="popover"&&t==1?"":t))}}function i_(e){return function(_){if(this.l){var t=this.l[_.type+e];if(_.t==null)_.t=Y++;else if(_.t2&&(u.children=arguments.length>3?F.call(arguments,2):t),N(e.type,u,n||e.key,o||e.ref,null)}function O_(e,_){var t={__c:_="__cC"+y_++,__:e,Consumer:function(n,o){return n.children(o)},Provider:function(n){var o,i;return this.getChildContext||(o=new Set,(i={})[_]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(l){this.props.value!==l.value&&o.forEach(function(u){u.__e=!0,Q(u)})},this.sub=function(l){o.add(l);var u=l.componentWillUnmount;l.componentWillUnmount=function(){o&&o.delete(l),u&&u.call(l)}}),n.children}};return t.Provider.__=t.Consumer.contextType=t}F=g_.slice,d={__e:function(e,_,t,n){for(var o,i,l;_=_.__;)if((o=_.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),l=o.__d),l)return o.__E=o}catch(u){e=u}throw e}},d_=0,v_=function(e){return e!=null&&e.constructor==null},D.prototype.setState=function(e,_){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=w({},this.state),typeof e=="function"&&(e=e(w({},t),this.props)),e&&w(t,e),e!=null&&this.__v&&(_&&this._sb.push(_),Q(this))},D.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Q(this))},D.prototype.render=A,H=[],m_=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,z=function(e,_){return e.__v.__b-_.__v.__b},j.__r=0,Y=0,G=i_(!1),J=i_(!0),y_=0;const Y_=Object.freeze(Object.defineProperty({__proto__:null,Component:D,Fragment:A,cloneElement:R_,createContext:O_,createElement:K,createRef:F_,h:K,hydrate:S_,get isValidElement(){return v_},get options(){return d},render:P_,toChildArray:C_},Symbol.toStringTag,{value:"Module"}));var C,p,V,u_,E=0,E_=[],y=d,l_=y.__b,c_=y.__r,f_=y.diffed,s_=y.__c,a_=y.unmount,p_=y.__;function P(e,_){y.__h&&y.__h(p,e,E||_),E=0;var t=p.__H||(p.__H={__:[],__h:[]});return e>=t.__.length&&t.__.push({}),t.__[e]}function T_(e){return E=1,U_(D_,e)}function U_(e,_,t){var n=P(C++,2);if(n.t=e,!n.__c&&(n.__=[t?t(_):D_(void 0,_),function(u){var s=n.__N?n.__N[0]:n.__[0],c=n.t(s,u);s!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=p,!p.u)){var o=function(u,s,c){if(!n.__c.__H)return!0;var a=n.__c.__H.__.filter(function(h){return!!h.__c});if(a.every(function(h){return!h.__N}))return!i||i.call(this,u,s,c);var r=!1;return a.forEach(function(h){if(h.__N){var f=h.__[0];h.__=h.__N,h.__N=void 0,f!==h.__[0]&&(r=!0)}}),!(!r&&n.__c.props===u)&&(!i||i.call(this,u,s,c))};p.u=!0;var i=p.shouldComponentUpdate,l=p.componentWillUpdate;p.componentWillUpdate=function(u,s,c){if(this.__e){var a=i;i=void 0,o(u,s,c),i=a}l&&l.call(this,u,s,c)},p.shouldComponentUpdate=o}return n.__N||n.__}function j_(e,_){var t=P(C++,3);!y.__s&&t_(t.__H,_)&&(t.__=e,t.i=_,p.__H.__h.push(t))}function N_(e,_){var t=P(C++,4);!y.__s&&t_(t.__H,_)&&(t.__=e,t.i=_,p.__h.push(t))}function B_(e){return E=5,e_(function(){return{current:e}},[])}function q_(e,_,t){E=6,N_(function(){return typeof e=="function"?(e(_()),function(){return e(null)}):e?(e.current=_(),function(){return e.current=null}):void 0},t==null?t:t.concat(e))}function e_(e,_){var t=P(C++,7);return t_(t.__H,_)&&(t.__=e(),t.__H=_,t.__h=e),t.__}function V_(e,_){return E=8,e_(function(){return e},_)}function z_(e){var _=p.context[e.__c],t=P(C++,9);return t.c=e,_?(t.__==null&&(t.__=!0,_.sub(p)),_.props.value):e.__}function G_(e,_){y.useDebugValue&&y.useDebugValue(_?_(e):e)}function J_(e){var _=P(C++,10),t=T_();return _.__=e,p.componentDidCatch||(p.componentDidCatch=function(n,o){_.__&&_.__(n,o),t[1](n)}),[t[0],function(){t[1](void 0)}]}function K_(){var e=P(C++,11);if(!e.__){for(var _=p.__v;_!==null&&!_.__m&&_.__!==null;)_=_.__;var t=_.__m||(_.__m=[0,0]);e.__="P"+t[0]+"-"+t[1]++}return e.__}function Q_(){for(var e;e=E_.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(O),e.__H.__h.forEach(X),e.__H.__h=[]}catch(_){e.__H.__h=[],y.__e(_,e.__v)}}y.__b=function(e){p=null,l_&&l_(e)},y.__=function(e,_){e&&_.__k&&_.__k.__m&&(e.__m=_.__k.__m),p_&&p_(e,_)},y.__r=function(e){c_&&c_(e),C=0;var _=(p=e.__c).__H;_&&(V===p?(_.__h=[],p.__h=[],_.__.forEach(function(t){t.__N&&(t.__=t.__N),t.i=t.__N=void 0})):(_.__h.forEach(O),_.__h.forEach(X),_.__h=[],C=0)),V=p},y.diffed=function(e){f_&&f_(e);var _=e.__c;_&&_.__H&&(_.__H.__h.length&&(E_.push(_)!==1&&u_===y.requestAnimationFrame||((u_=y.requestAnimationFrame)||X_)(Q_)),_.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.i=void 0})),V=p=null},y.__c=function(e,_){_.some(function(t){try{t.__h.forEach(O),t.__h=t.__h.filter(function(n){return!n.__||X(n)})}catch(n){_.some(function(o){o.__h&&(o.__h=[])}),_=[],y.__e(n,t.__v)}}),s_&&s_(e,_)},y.unmount=function(e){a_&&a_(e);var _,t=e.__c;t&&t.__H&&(t.__H.__.forEach(function(n){try{O(n)}catch(o){_=o}}),t.__H=void 0,_&&y.__e(_,t.__v))};var h_=typeof requestAnimationFrame=="function";function X_(e){var _,t=function(){clearTimeout(n),h_&&cancelAnimationFrame(_),setTimeout(e)},n=setTimeout(t,100);h_&&(_=requestAnimationFrame(t))}function O(e){var _=p,t=e.__c;typeof t=="function"&&(e.__c=void 0,t()),p=_}function X(e){var _=p;e.__c=e.__(),p=_}function t_(e,_){return!e||e.length!==_.length||_.some(function(t,n){return t!==e[n]})}function D_(e,_){return typeof _=="function"?_(e):_}const Z_=Object.freeze(Object.defineProperty({__proto__:null,useCallback:V_,useContext:z_,useDebugValue:G_,useEffect:j_,useErrorBoundary:J_,useId:K_,useImperativeHandle:q_,useLayoutEffect:N_,useMemo:e_,useReducer:U_,useRef:B_,useState:T_},Symbol.toStringTag,{value:"Module"}));export{P_ as B,K as _,Z_ as a,T_ as h,Y_ as p,j_ as y}; diff --git a/buddybook/assets/index-B6MMxlAs.js b/buddybook/assets/index-B6MMxlAs.js new file mode 100644 index 0000000..606b7e1 --- /dev/null +++ b/buddybook/assets/index-B6MMxlAs.js @@ -0,0 +1,3 @@ +import{j as rt,l as at,m as ot,o as ct,E as dt}from"./index-Cye4tEiE.js";import{B as Y,_ as h,h as ae,y as lt}from"./hooks.module-D0gf0yJl.js";const ht=(t,e)=>{let s;switch(t){case"standard":return s=e,`data:image/svg+xml,%3Csvg width='${e}' height='${s}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return s=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${s}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return s=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${s}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return s=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${s}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return s=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${s}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return s=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${s}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return s=e,`data:image/svg+xml,%3Csvg width='${e}' height='${s}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};class v{constructor(e,s){this.scope=e,this.module=s}storeObject(e,s){this.setItem(e,JSON.stringify(s))}loadObject(e){const s=this.getItem(e);return s?JSON.parse(s):void 0}setItem(e,s){localStorage.setItem(this.scopedKey(e),s)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),s=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new v("CBWSDK").clear(),new v("walletlink").clear()}}const u={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},J={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},Ie="Unspecified error message.",ut="Unspecified server error.";function te(t,e=Ie){if(t&&Number.isInteger(t)){const s=t.toString();if(Q(J,s))return J[s].message;if(Se(t))return ut}return e}function pt(t){if(!Number.isInteger(t))return!1;const e=t.toString();return!!(J[e]||Se(t))}function ft(t,{shouldIncludeStack:e=!1}={}){const s={};if(t&&typeof t=="object"&&!Array.isArray(t)&&Q(t,"code")&&pt(t.code)){const n=t;s.code=n.code,n.message&&typeof n.message=="string"?(s.message=n.message,Q(n,"data")&&(s.data=n.data)):(s.message=te(s.code),s.data={originalError:oe(t)})}else s.code=u.rpc.internal,s.message=ce(t,"message")?t.message:Ie,s.data={originalError:oe(t)};return e&&(s.stack=ce(t,"stack")?t.stack:void 0),s}function Se(t){return t>=-32099&&t<=-32e3}function oe(t){return t&&typeof t=="object"&&!Array.isArray(t)?Object.assign({},t):t}function Q(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function ce(t,e){return typeof t=="object"&&t!==null&&e in t&&typeof t[e]=="string"}const l={rpc:{parse:t=>b(u.rpc.parse,t),invalidRequest:t=>b(u.rpc.invalidRequest,t),invalidParams:t=>b(u.rpc.invalidParams,t),methodNotFound:t=>b(u.rpc.methodNotFound,t),internal:t=>b(u.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return b(e,t)},invalidInput:t=>b(u.rpc.invalidInput,t),resourceNotFound:t=>b(u.rpc.resourceNotFound,t),resourceUnavailable:t=>b(u.rpc.resourceUnavailable,t),transactionRejected:t=>b(u.rpc.transactionRejected,t),methodNotSupported:t=>b(u.rpc.methodNotSupported,t),limitExceeded:t=>b(u.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>P(u.provider.userRejectedRequest,t),unauthorized:t=>P(u.provider.unauthorized,t),unsupportedMethod:t=>P(u.provider.unsupportedMethod,t),disconnected:t=>P(u.provider.disconnected,t),chainDisconnected:t=>P(u.provider.chainDisconnected,t),unsupportedChain:t=>P(u.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:s,data:n}=t;if(!s||typeof s!="string")throw new Error('"message" must be a nonempty string');return new Ae(e,s,n)}}};function b(t,e){const[s,n]=Me(e);return new xe(t,s||te(t),n)}function P(t,e){const[s,n]=Me(e);return new Ae(t,s||te(t),n)}function Me(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:s}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,s]}}return[]}class xe extends Error{constructor(e,s,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!s||typeof s!="string")throw new Error('"message" must be a nonempty string.');super(s),this.code=e,n!==void 0&&(this.data=n)}}class Ae extends xe{constructor(e,s,n){if(!gt(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,s,n)}}function gt(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function se(){return t=>t}const B=se(),mt=se(),wt=se();function I(t){return Math.floor(t)}const _e=/^[0-9]*$/,Le=/^[a-f0-9]*$/;function _(t){return ne(crypto.getRandomValues(new Uint8Array(t)))}function ne(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}function H(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function O(t,e=!1){const s=t.toString("hex");return B(e?`0x${s}`:s)}function z(t){return O(X(t),!0)}function k(t){return wt(t.toString(10))}function A(t){return B(`0x${BigInt(t).toString(16)}`)}function Pe(t){return t.startsWith("0x")||t.startsWith("0X")}function ie(t){return Pe(t)?t.slice(2):t}function Re(t){return Pe(t)?`0x${t.slice(2)}`:`0x${t}`}function K(t){if(typeof t!="string")return!1;const e=ie(t).toLowerCase();return Le.test(e)}function bt(t,e=!1){if(typeof t=="string"){const s=ie(t).toLowerCase();if(Le.test(s))return B(e?`0x${s}`:s)}throw l.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}function re(t,e=!1){let s=bt(t,!1);return s.length%2===1&&(s=B(`0${s}`)),e?B(`0x${s}`):s}function x(t){if(typeof t=="string"){const e=ie(t).toLowerCase();if(K(e)&&e.length===40)return mt(Re(e))}throw l.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}function X(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(K(t)){const e=re(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw l.rpc.invalidParams(`Not binary data: ${String(t)}`)}function j(t){if(typeof t=="number"&&Number.isInteger(t))return I(t);if(typeof t=="string"){if(_e.test(t))return I(Number(t));if(K(t))return I(Number(BigInt(re(t,!0))))}throw l.rpc.invalidParams(`Not an integer: ${String(t)}`)}function D(t){if(t!==null&&(typeof t=="bigint"||vt(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(j(t));if(typeof t=="string"){if(_e.test(t))return BigInt(t);if(K(t))return BigInt(re(t,!0))}throw l.rpc.invalidParams(`Not an integer: ${String(t)}`)}function yt(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw l.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}function vt(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}function kt(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:s}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?`${e}//${s}/favicon.ico`:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${s}${n}`}async function Et(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function Ct(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function It(t,e){const s=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:s},t,new TextEncoder().encode(e));return{iv:s,cipherText:n}}async function St(t,{iv:e,cipherText:s}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,s);return new TextDecoder().decode(n)}function Ne(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function Te(t,e){const s=Ne(t),n=await crypto.subtle.exportKey(s,e);return ne(new Uint8Array(n))}async function De(t,e){const s=Ne(t),n=H(e).buffer;return await crypto.subtle.importKey(s,new Uint8Array(n),{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}async function Mt(t,e){const s=JSON.stringify(t,(n,i)=>{if(!(i instanceof Error))return i;const r=i;return Object.assign(Object.assign({},r.code?{code:r.code}:{}),{message:r.message})});return It(e,s)}async function xt(t,e){return JSON.parse(await St(e,t))}const Z={storageKey:"ownPrivateKey",keyType:"private"},F={storageKey:"ownPublicKey",keyType:"public"},$={storageKey:"peerPublicKey",keyType:"public"};class At{constructor(){this.storage=new v("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey($,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(F.storageKey),this.storage.removeItem(Z.storageKey),this.storage.removeItem($.storageKey)}async generateKeyPair(){const e=await Et();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(Z,e.privateKey),await this.storeKey(F,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(Z)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(F)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey($)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await Ct(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const s=this.storage.getItem(e.storageKey);return s?De(e.keyType,s):null}async storeKey(e,s){const n=await Te(e.keyType,s);this.storage.setItem(e.storageKey,n)}}const T="4.2.1",Oe="@coinbase/wallet-sdk";async function je(t,e){const s=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()}),n=await window.fetch(e,{method:"POST",body:JSON.stringify(s),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":T,"X-Cbw-Sdk-Platform":Oe}}),{result:i,error:r}=await n.json();if(r)throw r;return i}function _t(){return globalThis.coinbaseWalletExtension}function Lt(){var t,e;try{const s=globalThis;return(t=s.ethereum)!==null&&t!==void 0?t:(e=s.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function Ue({metadata:t,preference:e}){var s,n;const{appName:i,appLogoUrl:r,appChainIds:a}=t;if(e.options!=="smartWalletOnly"){const c=_t();if(c)return(s=c.setAppInfo)===null||s===void 0||s.call(c,i,r,a,e),c}const o=Lt();if(o!=null&&o.isCoinbaseBrowser)return(n=o.setAppInfo)===null||n===void 0||n.call(o,i,r,a,e),o}function Pt(t){if(!t||typeof t!="object"||Array.isArray(t))throw l.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:s}=t;if(typeof e!="string"||e.length===0)throw l.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(s!==void 0&&!Array.isArray(s)&&(typeof s!="object"||s===null))throw l.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t});switch(e){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw l.provider.unsupportedMethod()}}const de="accounts",le="activeChain",he="availableChains",ue="walletCapabilities";class Rt{constructor(e){var s,n,i;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new At,this.storage=new v("CBWSDK","SCWStateManager"),this.accounts=(s=this.storage.loadObject(de))!==null&&s!==void 0?s:[],this.chain=this.storage.loadObject(le)||{id:(i=(n=e.metadata.appChainIds)===null||n===void 0?void 0:n[0])!==null&&i!==void 0?i:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var s,n;const i=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,(s=e.params)!==null&&s!==void 0?s:{})}}),r=await this.communicator.postRequestAndWaitForResponse(i);if("failure"in r.content)throw r.content.failure;const a=await De("public",r.sender);await this.keyManager.setPeerPublicKey(a);const c=(await this.decryptResponseMessage(r)).result;if("error"in c)throw c.error;const d=c.value;this.accounts=d,this.storage.storeObject(de,d),(n=this.callback)===null||n===void 0||n.call(this,"accountsChanged",d)}async request(e){var s;if(this.accounts.length===0)throw l.provider.unauthorized();switch(e.method){case"eth_requestAccounts":return(s=this.callback)===null||s===void 0||s.call(this,"connect",{chainId:A(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return A(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(ue);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw l.rpc.internal("No RPC URL set for chain");return je(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var s,n;await((n=(s=this.communicator).waitForPopupLoaded)===null||n===void 0?void 0:n.call(s));const i=await this.sendEncryptedRequest(e),a=(await this.decryptResponseMessage(i)).result;if("error"in a)throw a.error;return a.value}async cleanup(){var e,s;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:(s=(e=this.metadata.appChainIds)===null||e===void 0?void 0:e[0])!==null&&s!==void 0?s:1}}async handleSwitchChainRequest(e){var s;const n=e.params;if(!n||!(!((s=n[0])===null||s===void 0)&&s.chainId))throw l.rpc.invalidParams();const i=j(n[0].chainId);if(this.updateChain(i))return null;const a=await this.sendRequestToPopup(e);return a===null&&this.updateChain(i),a}async sendEncryptedRequest(e){const s=await this.keyManager.getSharedSecret();if(!s)throw l.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await Mt({action:e,chainId:this.chain.id},s),i=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(i)}async createRequestMessage(e){const s=await Te("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:s,content:e,timestamp:new Date}}async decryptResponseMessage(e){var s,n;const i=e.content;if("failure"in i)throw i.failure;const r=await this.keyManager.getSharedSecret();if(!r)throw l.provider.unauthorized("Invalid session");const a=await xt(i.encrypted,r),o=(s=a.data)===null||s===void 0?void 0:s.chains;if(o){const d=Object.entries(o).map(([g,p])=>({id:Number(g),rpcUrl:p}));this.storage.storeObject(he,d),this.updateChain(this.chain.id,d)}const c=(n=a.data)===null||n===void 0?void 0:n.capabilities;return c&&this.storage.storeObject(ue,c),a}updateChain(e,s){var n;const i=s??this.storage.loadObject(he),r=i==null?void 0:i.find(a=>a.id===e);return r?(r!==this.chain&&(this.chain=r,this.storage.storeObject(le,r),(n=this.callback)===null||n===void 0||n.call(this,"chainChanged",A(r.id))),!0):!1}}const Nt=rt(at),{keccak_256:Tt}=Nt;function We(t){return Buffer.allocUnsafe(t).fill(0)}function Dt(t){return t.toString(2).length}function Be(t,e){let s=t.toString(16);s.length%2!==0&&(s="0"+s);const n=s.match(/.{1,2}/g).map(i=>parseInt(i,16));for(;n.length"u")throw new Error("Not an array?");if(s=Ze(t),s!=="dynamic"&&s!==0&&e.length>s)throw new Error("Elements exceed array size: "+s);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(r in e)i.push(E(t,e[r]));if(s==="dynamic"){var a=E("uint256",e.length);i.unshift(a)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([E("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,w.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(s=R(t),s<1||s>32)throw new Error("Invalid bytes width: "+s);return w.setLengthRight(e,32)}else if(t.startsWith("uint")){if(s=R(t),s%8||s<8||s>256)throw new Error("Invalid uint width: "+s);n=L(e);const o=w.bitLengthFromBigInt(n);if(o>s)throw new Error("Supplied uint exceeds width: "+s+" vs "+o);if(n<0)throw new Error("Supplied uint is negative");return w.bufferBEFromBigInt(n,32)}else if(t.startsWith("int")){if(s=R(t),s%8||s<8||s>256)throw new Error("Invalid int width: "+s);n=L(e);const o=w.bitLengthFromBigInt(n);if(o>s)throw new Error("Supplied int exceeds width: "+s+" vs "+o);const c=w.twosFromBigInt(n,256);return w.bufferBEFromBigInt(c,32)}else if(t.startsWith("ufixed")){if(s=pe(t),n=L(e),n<0)throw new Error("Supplied ufixed is negative");return E("uint256",n*BigInt(2)**BigInt(s[1]))}else if(t.startsWith("fixed"))return s=pe(t),E("int256",L(e)*BigInt(2)**BigInt(s[1]))}throw new Error("Unsupported or invalid type: "+t)}function qt(t){return t==="string"||t==="bytes"||Ze(t)==="dynamic"}function Ht(t){return t.lastIndexOf("]")===t.length-1}function Kt(t,e){var s=[],n=[],i=32*t.length;for(var r in t){var a=ze(t[r]),o=e[r],c=E(a,o);qt(a)?(s.push(E("uint256",i)),n.push(c),i+=c.length):s.push(c)}return Buffer.concat(s.concat(n))}function Fe(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var s,n,i=[],r=0;r32)throw new Error("Invalid bytes width: "+s);i.push(w.setLengthRight(o,s))}else if(a.startsWith("uint")){if(s=R(a),s%8||s<8||s>256)throw new Error("Invalid uint width: "+s);n=L(o);const c=w.bitLengthFromBigInt(n);if(c>s)throw new Error("Supplied uint exceeds width: "+s+" vs "+c);i.push(w.bufferBEFromBigInt(n,s/8))}else if(a.startsWith("int")){if(s=R(a),s%8||s<8||s>256)throw new Error("Invalid int width: "+s);n=L(o);const c=w.bitLengthFromBigInt(n);if(c>s)throw new Error("Supplied int exceeds width: "+s+" vs "+c);const d=w.twosFromBigInt(n,s);i.push(w.bufferBEFromBigInt(d,s/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(i)}function Vt(t,e){return w.keccak(Fe(t,e))}var zt={rawEncode:Kt,solidityPack:Fe,soliditySHA3:Vt};const y=Ve,U=zt,$e={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},G={encodeData(t,e,s,n=!0){const i=["bytes32"],r=[this.hashType(t,s)];if(n){const a=(o,c,d)=>{if(s[c]!==void 0)return["bytes32",d==null?"0x0000000000000000000000000000000000000000000000000000000000000000":y.keccak(this.encodeData(c,d,s,n))];if(d===void 0)throw new Error(`missing value for field ${o} of type ${c}`);if(c==="bytes")return["bytes32",y.keccak(d)];if(c==="string")return typeof d=="string"&&(d=Buffer.from(d,"utf8")),["bytes32",y.keccak(d)];if(c.lastIndexOf("]")===c.length-1){const g=c.slice(0,c.lastIndexOf("[")),p=d.map(f=>a(o,g,f));return["bytes32",y.keccak(U.rawEncode(p.map(([f])=>f),p.map(([,f])=>f)))]}return[c,d]};for(const o of s[t]){const[c,d]=a(o.name,o.type,e[o.name]);i.push(c),r.push(d)}}else for(const a of s[t]){let o=e[a.name];if(o!==void 0)if(a.type==="bytes")i.push("bytes32"),o=y.keccak(o),r.push(o);else if(a.type==="string")i.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=y.keccak(o),r.push(o);else if(s[a.type]!==void 0)i.push("bytes32"),o=y.keccak(this.encodeData(a.type,o,s,n)),r.push(o);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),r.push(o)}}return U.rawEncode(i,r)},encodeType(t,e){let s="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);s+=i+"("+e[i].map(({name:a,type:o})=>o+" "+a).join(",")+")"}return s},findTypeDependencies(t,e,s=[]){if(t=t.match(/^\w*/)[0],s.includes(t)||e[t]===void 0)return s;s.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,s))!s.includes(i)&&s.push(i);return s},hashStruct(t,e,s,n=!0){return y.keccak(this.encodeData(t,e,s,n))},hashType(t,e){return y.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const s in $e.properties)t[s]&&(e[s]=t[s]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const s=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",s.domain,s.types,e)),s.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(s.primaryType,s.message,s.types,e)),y.keccak(Buffer.concat(n))}};var q={TYPED_MESSAGE_SCHEMA:$e,TypedDataUtils:G,hashForSignTypedDataLegacy:function(t){return Zt(t.data)},hashForSignTypedData_v3:function(t){return G.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return G.hash(t.data)}};function Zt(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const s=t.map(function(r){return r.type==="bytes"?y.toBuffer(r.value):r.value}),n=t.map(function(r){return r.type}),i=t.map(function(r){if(!r.name)throw e;return r.type+" "+r.name});return U.soliditySHA3(["bytes32","bytes32"],[U.soliditySHA3(new Array(t.length).fill("string"),i),U.soliditySHA3(n,s)])}const Ft="walletUsername",ee="Addresses",$t="AppVersion";function m(t){return t.errorMessage!==void 0}class Gt{constructor(e){this.secret=e}async encrypt(e){const s=this.secret;if(s.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",H(s),{name:"aes-gcm"},!1,["encrypt","decrypt"]),r=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,r.encode(e)),o=16,c=a.slice(a.byteLength-o),d=a.slice(0,a.byteLength-o),g=new Uint8Array(c),p=new Uint8Array(d),f=new Uint8Array([...n,...g,...p]);return ne(f)}async decrypt(e){const s=this.secret;if(s.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const r=await crypto.subtle.importKey("raw",H(s),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=H(e),o=a.slice(0,12),c=a.slice(12,28),d=a.slice(28),g=new Uint8Array([...d,...c]),p={name:"AES-GCM",iv:new Uint8Array(o)};try{const f=await window.crypto.subtle.decrypt(p,r,g),C=new TextDecoder;n(C.decode(f))}catch(f){i(f)}})()})}}class Yt{constructor(e,s,n){this.linkAPIUrl=e,this.sessionId=s;const i=`${s}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(s=>fetch(`${this.linkAPIUrl}/events/${s.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(s=>console.error("Unabled to mark event as failed:",s))}async fetchUnseenEvents(){var e;const s=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(s.ok){const{events:n,error:i}=await s.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const r=(e=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(r),r}throw new Error(`Check unseen events failed: ${s.status}`)}}var M;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(M||(M={}));class Jt{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,s=WebSocket){this.WebSocketClass=s,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,s)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(r){s(r);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,M.CONNECTING),i.onclose=r=>{var a;this.clearWebSocket(),s(new Error(`websocket error ${r.code}: ${r.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,M.DISCONNECTED)},i.onopen=r=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,M.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},i.onmessage=r=>{var a,o;if(r.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(r.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,c)}catch{}}})}disconnect(){var e;const{webSocket:s}=this;if(s){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,M.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{s.close()}catch{}}}sendData(e){const{webSocket:s}=this;if(!s){this.pendingData.push(e),this.connect();return}s.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}const fe=1e4,Qt=6e4;class Xt{constructor({session:e,linkAPIUrl:s,listener:n}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=I(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=r=>{if(!r)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",o=>r.JsonRpcUrl&&this.handleChainUpdated(o,r.JsonRpcUrl)]]).forEach((o,c)=>{const d=r[c];d!==void 0&&o(d)})},this.handleDestroyed=r=>{var a;r==="1"&&((a=this.listener)===null||a===void 0||a.resetAndReload())},this.handleAccountUpdated=async r=>{var a;const o=await this.cipher.decrypt(r);(a=this.listener)===null||a===void 0||a.accountUpdated(o)},this.handleMetadataUpdated=async(r,a)=>{var o;const c=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.metadataUpdated(r,c)},this.handleWalletUsernameUpdated=async r=>{this.handleMetadataUpdated(Ft,r)},this.handleAppVersionUpdated=async r=>{this.handleMetadataUpdated($t,r)},this.handleChainUpdated=async(r,a)=>{var o;const c=await this.cipher.decrypt(r),d=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.chainUpdated(c,d)},this.session=e,this.cipher=new Gt(e.secret),this.listener=n;const i=new Jt(`${s}/rpc`,WebSocket);i.setConnectionStateListener(async r=>{let a=!1;switch(r){case M.DISCONNECTED:if(!this.destroyed){const o=async()=>{await new Promise(c=>setTimeout(c,5e3)),this.destroyed||i.connect().catch(()=>{o()})};o()}break;case M.CONNECTED:a=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},fe),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case M.CONNECTING:break}this.connected!==a&&(this.connected=a)}),i.setIncomingDataListener(r=>{var a;switch(r.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const o=r.type==="IsLinkedOK"?r.linked:void 0;this.linked=o||r.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(r.metadata);break}case"Event":{this.handleIncomingEvent(r);break}}r.id!==void 0&&((a=this.requestResolutions.get(r.id))===null||a===void 0||a(r))}),this.ws=i,this.http=new Yt(s,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:I(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var s,n;this._linked=e,e&&((s=this.onceLinked)===null||s===void 0||s.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(s=>{this.linked?e().then(s):this.onceLinked=()=>{e().then(s),this.onceLinked=void 0}})}async handleIncomingEvent(e){var s;if(e.type!=="Event"||e.event!=="Web3Response")return;const n=await this.cipher.decrypt(e.data),i=JSON.parse(n);if(i.type!=="WEB3_RESPONSE")return;const{id:r,response:a}=i;(s=this.listener)===null||s===void 0||s.handleWeb3ResponseMessage(r,a)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(s=>this.handleIncomingEvent(s))}async publishEvent(e,s,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},s),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),r={type:"PublishEvent",id:I(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(r);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>fe*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,s={timeout:Qt}){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((r,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},s.timeout)}),new Promise(r=>{this.requestResolutions.set(n,a=>{clearTimeout(i),r(a),this.requestResolutions.delete(n)})})])}async handleConnected(){return(await this.makeRequest({type:"HostSession",id:I(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type==="Fail"?!1:(this.sendData({type:"IsLinked",id:I(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:I(this.nextReqId++),sessionId:this.session.id}),!0)}}class es{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,s=Re(e.toString(16));return this.callbacks.get(s)&&this.callbacks.delete(s),e}}const ge="session:id",me="session:secret",we="session:linked";class N{constructor(e,s,n,i=!1){this.storage=e,this.id=s,this.secret=n,this.key=ot(ct(`${s}, ${n} WalletLink`)),this._linked=!!i}static create(e){const s=_(16),n=_(32);return new N(e,s,n).save()}static load(e){const s=e.getItem(ge),n=e.getItem(we),i=e.getItem(me);return s&&i?new N(e,s,i,n==="1"):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(ge,this.id),this.storage.setItem(me,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(we,this._linked?"1":"0")}}function ts(){try{return window.frameElement!==null}catch{return!1}}function ss(){try{return ts()&&window.top?window.top.location:window.location}catch{return window.location}}function ns(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}function Ge(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}const is='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';function Ye(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(is)),document.documentElement.appendChild(t)}function Je(t){var e,s,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e{this.items.delete(s),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&Y(h("div",null,h(Qe,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,s])=>h(ds,Object.assign({},s,{key:e}))))),this.root)}}const Qe=t=>h("div",{class:W("-cbwsdk-snackbar-container")},h("style",null,rs),h("div",{class:"-cbwsdk-snackbar"},t.children)),ds=({autoExpand:t,message:e,menuItems:s})=>{const[n,i]=ae(!0),[r,a]=ae(t??!1);lt(()=>{const c=[window.setTimeout(()=>{i(!1)},1),window.setTimeout(()=>{a(!0)},1e4)];return()=>{c.forEach(window.clearTimeout)}});const o=()=>{a(!r)};return h("div",{class:W("-cbwsdk-snackbar-instance",n&&"-cbwsdk-snackbar-instance-hidden",r&&"-cbwsdk-snackbar-instance-expanded")},h("div",{class:"-cbwsdk-snackbar-instance-header",onClick:o},h("img",{src:as,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",h("div",{class:"-cbwsdk-snackbar-instance-header-message"},e),h("div",{class:"-gear-container"},!r&&h("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),h("img",{src:os,class:"-gear-icon",title:"Expand"}))),s&&s.length>0&&h("div",{class:"-cbwsdk-snackbar-instance-menu"},s.map((c,d)=>h("div",{class:W("-cbwsdk-snackbar-instance-menu-item",c.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:c.onClick,key:d},h("svg",{width:c.svgWidth,height:c.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h("path",{"fill-rule":c.defaultFillRule,"clip-rule":c.defaultClipRule,d:c.path,fill:"#AAAAAA"})),h("span",{class:W("-cbwsdk-snackbar-instance-menu-item-info",c.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},c.info)))))};class ls{constructor(){this.attached=!1,this.snackbar=new cs}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,s=document.createElement("div");s.className="-cbwsdk-css-reset",e.appendChild(s),this.snackbar.attach(s),this.attached=!0,Ye()}showConnecting(e){let s;return e.isUnlinkedErrorState?s={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:s={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(s)}}const hs=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";class us{constructor(){this.root=null,this.darkMode=Ge()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),Ye()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(Y(null,this.root),e&&Y(h(ps,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const ps=({title:t,buttonText:e,darkMode:s,onButtonClick:n,onDismiss:i})=>{const r=s?"dark":"light";return h(Qe,{darkMode:s},h("div",{class:"-cbwsdk-redirect-dialog"},h("style",null,hs),h("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),h("div",{class:W("-cbwsdk-redirect-dialog-box",r)},h("p",null,t),h("button",{onClick:n},e))))},fs="https://keys.coinbase.com/connect",be="https://www.walletlink.org",gs="https://go.cb-w.com/walletlink";class ye{constructor(){this.attached=!1,this.redirectDialog=new us}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const s=new URL(gs);s.searchParams.append("redirect_url",ss().href),e&&s.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=s.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class S{constructor(e){this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=ns(),this.linkedUpdated=r=>{this.isLinked=r;const a=this.storage.getItem(ee);if(r&&(this._session.linked=r),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!r&&this._session.linked&&!c&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(r,a)=>{this.storage.setItem(r,a)},this.chainUpdated=(r,a)=>{this.chainCallbackParams.chainId===r&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:r,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(a,Number.parseInt(r,10)))},this.accountUpdated=r=>{this.accountsCallback&&this.accountsCallback([r]),S.accountRequestCallbackIds.size>0&&(Array.from(S.accountRequestCallbackIds.values()).forEach(a=>{this.invokeCallback(a,{method:"requestEthereumAccounts",result:[r]})}),S.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;const{session:s,ui:n,connection:i}=this.subscribe();this._session=s,this.connection=i,this.relayEventManager=new es,this.ui=n,this.ui.attach()}subscribe(){const e=N.load(this.storage)||N.create(this.storage),{linkAPIUrl:s}=this,n=new Xt({session:e,linkAPIUrl:s,listener:this}),i=this.isMobileWeb?new ye:new ls;return n.connect(),{session:e,ui:i,connection:n}}resetAndReload(){this.connection.destroy().then(()=>{const e=N.load(this.storage);(e==null?void 0:e.id)===this._session.id&&v.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:k(e.weiValue),data:O(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?k(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?k(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?k(e.gasPriceInWei):null,gasLimit:e.gasLimit?k(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:k(e.weiValue),data:O(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?k(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?k(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?k(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?k(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,s){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:O(e,!0),chainId:s}})}getWalletLinkSession(){return this._session}sendRequest(e){let s=null;const n=_(8),i=r=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,r),s==null||s()};return new Promise((r,a)=>{s=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,o=>{if(s==null||s(),m(o))return a(new Error(o.errorMessage));r(o)}),this.publishWeb3RequestEvent(n,e)})}publishWeb3RequestEvent(e,s){const n={type:"WEB3_REQUEST",id:e,request:s};this.publishEvent("Web3Request",n,!0).then(i=>{}).catch(i=>{this.handleWeb3ResponseMessage(n.id,{method:s.method,errorMessage:i.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(s.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof ye)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const s={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",s,!1).then()}publishEvent(e,s,n){return this.connection.publishEvent(e,s,n)}handleWeb3ResponseMessage(e,s){if(s.method==="requestEthereumAccounts"){S.accountRequestCallbackIds.forEach(n=>this.invokeCallback(n,s)),S.accountRequestCallbackIds.clear();return}this.invokeCallback(e,s)}handleErrorResponse(e,s,n){var i;const r=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:s,errorMessage:r})}invokeCallback(e,s){const n=this.relayEventManager.callbacks.get(e);n&&(n(s),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:s}=this.metadata,n={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:s}},i=_(8);return new Promise((r,a)=>{this.relayEventManager.callbacks.set(i,o=>{if(m(o))return a(new Error(o.errorMessage));r(o)}),S.accountRequestCallbackIds.add(i),this.publishWeb3RequestEvent(i,n)})}watchAsset(e,s,n,i,r,a){const o={method:"watchAsset",params:{type:e,options:{address:s,symbol:n,decimals:i,image:r},chainId:a}};let c=null;const d=_(8),g=p=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,o.method,p),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:g,onResetConnection:this.resetAndReload}),new Promise((p,f)=>{this.relayEventManager.callbacks.set(d,C=>{if(c==null||c(),m(C))return f(new Error(C.errorMessage));p(C)}),this.publishWeb3RequestEvent(d,o)})}addEthereumChain(e,s,n,i,r,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:s,blockExplorerUrls:i,chainName:r,iconUrls:n,nativeCurrency:a}};let c=null;const d=_(8),g=p=>{this.publishWeb3RequestCanceledEvent(d),this.handleErrorResponse(d,o.method,p),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:g,onResetConnection:this.resetAndReload}),new Promise((p,f)=>{this.relayEventManager.callbacks.set(d,C=>{if(c==null||c(),m(C))return f(new Error(C.errorMessage));p(C)}),this.publishWeb3RequestEvent(d,o)})}switchEthereumChain(e,s){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:s})};let i=null;const r=_(8),a=o=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,n.method,o),i==null||i()};return i=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:a,onResetConnection:this.resetAndReload}),new Promise((o,c)=>{this.relayEventManager.callbacks.set(r,d=>{if(i==null||i(),m(d)&&d.errorCode)return c(l.provider.custom({code:d.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(m(d))return c(new Error(d.errorMessage));o(d)}),this.publishWeb3RequestEvent(r,n)})}}S.accountRequestCallbackIds=new Set;const ve="DefaultChainId",ke="DefaultJsonRpcUrl";class Xe{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new v("walletlink",be),this.callback=e.callback||null;const s=this._storage.getItem(ee);if(s){const n=s.split(" ");n[0]!==""&&(this._addresses=n.map(i=>x(i)))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:s,secret:n}=e.getWalletLinkSession();return{id:s,secret:n}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(ke))!==null&&e!==void 0?e:void 0}set jsonRpcUrl(e){this._storage.setItem(ke,e)}updateProviderInfo(e,s){var n;this.jsonRpcUrl=e;const i=this.getChainId();this._storage.setItem(ve,s.toString(10)),j(s)!==i&&((n=this.callback)===null||n===void 0||n.call(this,"chainChanged",A(s)))}async watchAsset(e){const s=Array.isArray(e)?e[0]:e;if(!s.type)throw l.rpc.invalidParams("Type is required");if((s==null?void 0:s.type)!=="ERC20")throw l.rpc.invalidParams(`Asset of type '${s.type}' is not supported`);if(!(s!=null&&s.options))throw l.rpc.invalidParams("Options are required");if(!(s!=null&&s.options.address))throw l.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:r,image:a,decimals:o}=s.options,d=await this.initializeRelay().watchAsset(s.type,i,r,o,a,n==null?void 0:n.toString());return m(d)?!1:!!d.result}async addEthereumChain(e){var s,n;const i=e[0];if(((s=i.rpcUrls)===null||s===void 0?void 0:s.length)===0)throw l.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!i.chainName||i.chainName.trim()==="")throw l.rpc.invalidParams("chainName is a required field");if(!i.nativeCurrency)throw l.rpc.invalidParams("nativeCurrency is a required field");const r=Number.parseInt(i.chainId,16);if(r===this.getChainId())return!1;const a=this.initializeRelay(),{rpcUrls:o=[],blockExplorerUrls:c=[],chainName:d,iconUrls:g=[],nativeCurrency:p}=i,f=await a.addEthereumChain(r.toString(),o,g,c,d,p);if(m(f))return!1;if(((n=f.result)===null||n===void 0?void 0:n.isApproved)===!0)return this.updateProviderInfo(o[0],r),null;throw l.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){const s=e[0],n=Number.parseInt(s.chainId,16),r=await this.initializeRelay().switchEthereumChain(n.toString(10),this.selectedAddress||void 0);if(m(r))throw r;const a=r.result;return a.isApproved&&a.rpcUrl.length>0&&this.updateProviderInfo(a.rpcUrl,n),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,s){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const i=e.map(r=>x(r));JSON.stringify(i)!==JSON.stringify(this._addresses)&&(this._addresses=i,(n=this.callback)===null||n===void 0||n.call(this,"accountsChanged",i),this._storage.setItem(ee,i.join(" ")))}async request(e){const s=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return A(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(s);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(s);case"eth_sendTransaction":return this._eth_sendTransaction(s);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(s);case"wallet_switchEthereumChain":return this.switchEthereumChain(s);case"wallet_watchAsset":return this.watchAsset(s);default:if(!this.jsonRpcUrl)throw l.rpc.internal("No RPC URL set for chain");return je(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const s=x(e);if(!this._addresses.map(i=>x(i)).includes(s))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const s=e.from?x(e.from):this.selectedAddress;if(!s)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(s);const n=e.to?x(e.to):null,i=e.value!=null?D(e.value):BigInt(0),r=e.data?X(e.data):Buffer.alloc(0),a=e.nonce!=null?j(e.nonce):null,o=e.gasPrice!=null?D(e.gasPrice):null,c=e.maxFeePerGas!=null?D(e.maxFeePerGas):null,d=e.maxPriorityFeePerGas!=null?D(e.maxPriorityFeePerGas):null,g=e.gas!=null?D(e.gas):null,p=e.chainId?j(e.chainId):this.getChainId();return{fromAddress:s,toAddress:n,weiValue:i,data:r,nonce:a,gasPriceInWei:o,maxFeePerGas:c,maxPriorityFeePerGas:d,gasLimit:g,chainId:p}}async ecRecover(e){const{method:s,params:n}=e;if(!Array.isArray(n))throw l.rpc.invalidParams();const r=await this.initializeRelay().sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:z(n[0]),signature:z(n[1]),addPrefix:s==="personal_ecRecover"}});if(m(r))throw r;return r.result}getChainId(){var e;return Number.parseInt((e=this._storage.getItem(ve))!==null&&e!==void 0?e:"1",10)}async _eth_requestAccounts(){var e,s;if(this._addresses.length>0)return(e=this.callback)===null||e===void 0||e.call(this,"connect",{chainId:A(this.getChainId())}),this._addresses;const i=await this.initializeRelay().requestEthereumAccounts();if(m(i))throw i;if(!i.result)throw new Error("accounts received is empty");return this._setAddresses(i.result),(s=this.callback)===null||s===void 0||s.call(this,"connect",{chainId:A(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw l.rpc.invalidParams();const s=e[1],n=e[0];this._ensureKnownAddress(s);const r=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:x(s),message:z(n),addPrefix:!0,typedDataJson:null}});if(m(r))throw r;return r.result}async _eth_signTransaction(e){const s=this._prepareTransactionParams(e[0]||{}),i=await this.initializeRelay().signEthereumTransaction(s);if(m(i))throw i;return i.result}async _eth_sendRawTransaction(e){const s=X(e[0]),i=await this.initializeRelay().submitEthereumTransaction(s,this.getChainId());if(m(i))throw i;return i.result}async _eth_sendTransaction(e){const s=this._prepareTransactionParams(e[0]||{}),i=await this.initializeRelay().signAndSubmitEthereumTransaction(s);if(m(i))throw i;return i.result}async signTypedData(e){const{method:s,params:n}=e;if(!Array.isArray(n))throw l.rpc.invalidParams();const i=d=>{const g={eth_signTypedData_v1:q.hashForSignTypedDataLegacy,eth_signTypedData_v3:q.hashForSignTypedData_v3,eth_signTypedData_v4:q.hashForSignTypedData_v4,eth_signTypedData:q.hashForSignTypedData_v4};return O(g[s]({data:yt(d)}),!0)},r=n[s==="eth_signTypedData_v1"?1:0],a=n[s==="eth_signTypedData_v1"?0:1];this._ensureKnownAddress(r);const c=await this.initializeRelay().sendRequest({method:"signEthereumMessage",params:{address:x(r),message:i(a),typedDataJson:JSON.stringify(a,null,2),addPrefix:!1}});if(m(c))throw c;return c.result}initializeRelay(){return this._relay||(this._relay=new S({linkAPIUrl:be,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const et="SignerType",tt=new v("CBWSDK","SignerConfigurator");function ms(){return tt.getItem(et)}function ws(t){tt.setItem(et,t)}async function bs(t){const{communicator:e,metadata:s,handshakeRequest:n,callback:i}=t;vs(e,s,i).catch(()=>{});const r={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},t.preference),{handshakeRequest:n})},{data:a}=await e.postRequestAndWaitForResponse(r);return a}function ys(t){const{signerType:e,metadata:s,communicator:n,callback:i}=t;switch(e){case"scw":return new Rt({metadata:s,callback:i,communicator:n});case"walletlink":return new Xe({metadata:s,callback:i})}}async function vs(t,e,s){await t.onMessage(({event:i})=>i==="WalletLinkSessionRequest");const n=new Xe({metadata:e,callback:s});t.postMessage({event:"WalletLinkUpdate",data:{session:n.getSession()}}),await n.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}const ks=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app. + +Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,Es=()=>{let t;return{getCrossOriginOpenerPolicy:()=>t===void 0?"undefined":t,checkCrossOriginOpenerPolicy:async()=>{if(typeof window>"u"){t="non-browser-env";return}try{const e=`${window.location.origin}${window.location.pathname}`,s=await fetch(e,{method:"HEAD"});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const n=s.headers.get("Cross-Origin-Opener-Policy");t=n??"null",t==="same-origin"&&console.error(ks)}catch(e){console.error("Error checking Cross-Origin-Opener-Policy:",e.message),t="error"}}}},{checkCrossOriginOpenerPolicy:st,getCrossOriginOpenerPolicy:Cs}=Es(),Ee=420,Ce=540;function Is(t){const e=(window.innerWidth-Ee)/2+window.screenX,s=(window.innerHeight-Ce)/2+window.screenY;Ms(t);const n=window.open(t,"Smart Wallet",`width=${Ee}, height=${Ce}, left=${e}, top=${s}`);if(n==null||n.focus(),!n)throw l.rpc.internal("Pop up window failed to open");return n}function Ss(t){t&&!t.closed&&t.close()}function Ms(t){const e={sdkName:Oe,sdkVersion:T,origin:window.location.origin,coop:Cs()};for(const[s,n]of Object.entries(e))t.searchParams.append(s,n.toString())}class xs{constructor({url:e=fs,metadata:s,preference:n}){this.popup=null,this.listeners=new Map,this.postMessage=async i=>{(await this.waitForPopupLoaded()).postMessage(i,this.url.origin)},this.postRequestAndWaitForResponse=async i=>{const r=this.onMessage(({requestId:a})=>a===i.id);return this.postMessage(i),await r},this.onMessage=async i=>new Promise((r,a)=>{const o=c=>{if(c.origin!==this.url.origin)return;const d=c.data;i(d)&&(r(d),window.removeEventListener("message",o),this.listeners.delete(o))};window.addEventListener("message",o),this.listeners.set(o,{reject:a})}),this.disconnect=()=>{Ss(this.popup),this.popup=null,this.listeners.forEach(({reject:i},r)=>{i(l.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",r)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=Is(this.url),this.onMessage(({event:i})=>i==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:i})=>i==="PopupLoaded").then(i=>{this.postMessage({requestId:i.id,data:{version:T,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>{if(!this.popup)throw l.rpc.internal();return this.popup})),this.url=new URL(e),this.metadata=s,this.preference=n}}function As(t){const e=ft(_s(t),{shouldIncludeStack:!0}),s=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return s.searchParams.set("version",T),s.searchParams.set("code",e.code.toString()),s.searchParams.set("message",e.message),Object.assign(Object.assign({},e),{docUrl:s.href})}function _s(t){var e;if(typeof t=="string")return{message:t,code:u.rpc.internal};if(m(t)){const s=t.errorMessage,n=(e=t.errorCode)!==null&&e!==void 0?e:s.match(/(denied|rejected)/i)?u.provider.userRejectedRequest:void 0;return Object.assign(Object.assign({},t),{message:s,code:n,data:{method:t.method}})}return t}class Ls extends dt{}var Ps=function(t,e){var s={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(s[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i(i||(i=Rs(n)),i)}}export{Os as CoinbaseWalletSDK,js as createCoinbaseWalletSDK,Os as default}; diff --git a/buddybook/assets/index-BA4zS8rk.js b/buddybook/assets/index-BA4zS8rk.js new file mode 100644 index 0000000..742294f --- /dev/null +++ b/buddybook/assets/index-BA4zS8rk.js @@ -0,0 +1,2 @@ +import{B as k,k as m,c as q,e as F,t as $,n as Ye,i as Ze,I as xe,s as B,a as et,b as G,d as tt,f as p,g as W}from"./index-Cye4tEiE.js";const nt=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,st=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;class it extends k{constructor({primaryType:t,types:n}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(n))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class at extends k{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function ct(e){const{domain:t={},message:n,primaryType:s}=e,r={EIP712Domain:lt({domain:t}),...e.types};dt({domain:t,message:n,primaryType:s,types:r});const i=["0x1901"];return t&&i.push(rt({domain:t,types:r})),s!=="EIP712Domain"&&i.push(K({data:n,primaryType:s,types:r})),m(q(i))}function rt({domain:e,types:t}){return K({data:e,primaryType:"EIP712Domain",types:t})}function K({data:e,primaryType:t,types:n}){const s=X({data:e,primaryType:t,types:n});return m(s)}function X({data:e,primaryType:t,types:n}){const s=[{type:"bytes32"}],r=[ot({primaryType:t,types:n})];for(const i of n[t]){const[u,l]=z({types:n,name:i.name,type:i.type,value:e[i.name]});s.push(u),r.push(l)}return F(s,r)}function ot({primaryType:e,types:t}){const n=$(ut({primaryType:e,types:t}));return m(n)}function ut({primaryType:e,types:t}){let n="";const s=Q({primaryType:e,types:t});s.delete(e);const r=[e,...Array.from(s).sort()];for(const i of r)n+=`${i}(${t[i].map(({name:u,type:l})=>`${l} ${u}`).join(",")})`;return n}function Q({primaryType:e,types:t},n=new Set){const s=e.match(/^\w*/u),r=s==null?void 0:s[0];if(n.has(r)||t[r]===void 0)return n;n.add(r);for(const i of t[r])Q({primaryType:i.type,types:t},n);return n}function z({types:e,name:t,type:n,value:s}){if(e[n]!==void 0)return[{type:"bytes32"},m(X({data:s,primaryType:n,types:e}))];if(n==="bytes")return s=`0x${(s.length%2?"0":"")+s.slice(2)}`,[{type:"bytes32"},m(s)];if(n==="string")return[{type:"bytes32"},m($(s))];if(n.lastIndexOf("]")===n.length-1){const r=n.slice(0,n.lastIndexOf("[")),i=s.map(u=>z({name:t,type:r,types:e,value:u}));return[{type:"bytes32"},m(F(i.map(([u])=>u),i.map(([,u])=>u)))]}return[{type:n},s]}function dt(e){const{domain:t,message:n,primaryType:s,types:r}=e,i=(u,l)=>{for(const g of u){const{name:v,type:f}=g,h=l[v],N=f.match(st);if(N&&(typeof h=="number"||typeof h=="bigint")){const[M,S,L]=N;Ye(h,{signed:S==="int",size:Number.parseInt(L)/8})}if(f==="address"&&typeof h=="string"&&!Ze(h))throw new xe({address:h});const C=f.match(nt);if(C){const[M,S]=C;if(S&&B(h)!==Number.parseInt(S))throw new et({expectedSize:Number.parseInt(S),givenSize:B(h)})}const D=r[f];D&&(ft(f),i(D,h))}};if(r.EIP712Domain&&t&&i(r.EIP712Domain,t),s!=="EIP712Domain")if(r[s])i(r[s],n);else throw new it({primaryType:s,types:r})}function lt({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},typeof(e==null?void 0:e.chainId)=="number"&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function ft(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new at({type:e})}const gt=`Ethereum Signed Message: +`;function ht(e){const t=typeof e=="string"?G(e):typeof e.raw=="string"?e.raw:tt(e.raw),n=G(`${gt}${B(t)}`);return q([n,t])}function Et(e,t){return m(ht(e),t)}const yt=()=>"9.1.0",_t=e=>e.toString(16).padStart(2,"0"),Tt=e=>{const t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t,_t).join("")},vt=()=>typeof window<"u"?Tt(10):new Date().getTime().toString(36);class w{}w.makeRequest=(e,t)=>({id:vt(),method:e,params:t,env:{sdkVersion:yt()}});w.makeResponse=(e,t,n)=>({id:e,success:!0,version:n,data:t});w.makeErrorResponse=(e,t,n)=>({id:e,success:!1,error:t,version:n});var E;(function(e){e.sendTransactions="sendTransactions",e.rpcCall="rpcCall",e.getChainInfo="getChainInfo",e.getSafeInfo="getSafeInfo",e.getTxBySafeTxHash="getTxBySafeTxHash",e.getSafeBalances="getSafeBalances",e.signMessage="signMessage",e.signTypedMessage="signTypedMessage",e.getEnvironmentInfo="getEnvironmentInfo",e.getOffChainSignature="getOffChainSignature",e.requestAddressBook="requestAddressBook",e.wallet_getPermissions="wallet_getPermissions",e.wallet_requestPermissions="wallet_requestPermissions"})(E||(E={}));var H;(function(e){e.requestAddressBook="requestAddressBook"})(H||(H={}));class It{constructor(t=null,n=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:s,data:r,source:i})=>{const u=!r,l=!this.isServer&&i===window.parent,g=typeof r.version<"u"&&parseInt(r.version.split(".")[0]),v=typeof g=="number"&&g>=1;let f=!0;return Array.isArray(this.allowedOrigins)&&(f=this.allowedOrigins.find(h=>h.test(s))!==void 0),!u&&l&&v&&f},this.logIncomingMessage=s=>{console.info(`Safe Apps SDK v1: A message was received from origin ${s.origin}. `,s.data)},this.onParentMessage=s=>{this.isValidMessage(s)&&(this.debugMode&&this.logIncomingMessage(s),this.handleIncomingMessage(s.data))},this.handleIncomingMessage=s=>{const{id:r}=s,i=this.callbacks.get(r);i&&(i(s),this.callbacks.delete(r))},this.send=(s,r)=>{const i=w.makeRequest(s,r);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(i,"*"),new Promise((u,l)=>{this.callbacks.set(i.id,g=>{if(!g.success){l(new Error(g.error));return}u(g)})})},this.allowedOrigins=t,this.debugMode=n,this.isServer||window.addEventListener("message",this.onParentMessage)}}const J=e=>typeof e=="object"&&e!=null&&"domain"in e&&"types"in e&&"message"in e;var At={},_={},T={},j=p&&p.__awaiter||function(e,t,n,s){function r(i){return i instanceof n?i:new n(function(u){u(i)})}return new(n||(n=Promise))(function(i,u){function l(f){try{v(s.next(f))}catch(h){u(h)}}function g(f){try{v(s.throw(f))}catch(h){u(h)}}function v(f){f.done?i(f.value):r(f.value).then(l,g)}v((s=s.apply(e,t||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.getData=T.fetchData=T.stringifyQuery=T.insertParams=void 0;const mt=e=>typeof e=="object"&&e!==null&&"code"in e&&"message"in e;function St(e,t,n){return e.replace(new RegExp(`\\{${t}\\}`,"g"),n)}function Ot(e,t){return t?Object.keys(t).reduce((n,s)=>St(n,s,String(t[s])),e):e}T.insertParams=Ot;function pt(e){if(!e)return"";const t=new URLSearchParams;Object.keys(e).forEach(s=>{e[s]!=null&&t.append(s,String(e[s]))});const n=t.toString();return n?`?${n}`:""}T.stringifyQuery=pt;function Y(e){return j(this,void 0,void 0,function*(){let t;try{t=yield e.json()}catch{t={}}if(!e.ok){const n=mt(t)?`CGW error - ${t.code}: ${t.message}`:`CGW error - status ${e.statusText}`;throw new Error(n)}return t})}function bt(e,t,n,s,r){return j(this,void 0,void 0,function*(){const i=Object.assign({"Content-Type":"application/json"},s),u={method:t??"POST",headers:i};r&&(u.credentials=r),n!=null&&(u.body=typeof n=="string"?n:JSON.stringify(n));const l=yield fetch(e,u);return Y(l)})}T.fetchData=bt;function Nt(e,t,n){return j(this,void 0,void 0,function*(){const s={method:"GET"};t&&(s.headers=Object.assign(Object.assign({},t),{"Content-Type":"application/json"})),n&&(s.credentials=n);const r=yield fetch(e,s);return Y(r)})}T.getData=Nt;Object.defineProperty(_,"__esModule",{value:!0});_.getEndpoint=_.deleteEndpoint=_.putEndpoint=_.postEndpoint=void 0;const O=T;function P(e,t,n,s){const r=(0,O.insertParams)(t,n),i=(0,O.stringifyQuery)(s);return`${e}${r}${i}`}function Ct(e,t,n){const s=P(e,t,n==null?void 0:n.path,n==null?void 0:n.query);return(0,O.fetchData)(s,"POST",n==null?void 0:n.body,n==null?void 0:n.headers,n==null?void 0:n.credentials)}_.postEndpoint=Ct;function Dt(e,t,n){const s=P(e,t,n==null?void 0:n.path,n==null?void 0:n.query);return(0,O.fetchData)(s,"PUT",n==null?void 0:n.body,n==null?void 0:n.headers,n==null?void 0:n.credentials)}_.putEndpoint=Dt;function wt(e,t,n){const s=P(e,t,n==null?void 0:n.path,n==null?void 0:n.query);return(0,O.fetchData)(s,"DELETE",n==null?void 0:n.body,n==null?void 0:n.headers,n==null?void 0:n.credentials)}_.deleteEndpoint=wt;function Pt(e,t,n,s){if(s)return(0,O.getData)(s,void 0,n==null?void 0:n.credentials);const r=P(e,t,n==null?void 0:n.path,n==null?void 0:n.query);return(0,O.getData)(r,n==null?void 0:n.headers,n==null?void 0:n.credentials)}_.getEndpoint=Pt;var R={};Object.defineProperty(R,"__esModule",{value:!0});R.DEFAULT_BASE_URL=void 0;R.DEFAULT_BASE_URL="https://safe-client.safe.global";var Z={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationVersionState=void 0,function(t){t.UP_TO_DATE="UP_TO_DATE",t.OUTDATED="OUTDATED",t.UNKNOWN="UNKNOWN"}(e.ImplementationVersionState||(e.ImplementationVersionState={}))})(Z);var x={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAppSocialPlatforms=e.SafeAppFeatures=e.SafeAppAccessPolicyTypes=void 0,function(t){t.NoRestrictions="NO_RESTRICTIONS",t.DomainAllowlist="DOMAIN_ALLOWLIST"}(e.SafeAppAccessPolicyTypes||(e.SafeAppAccessPolicyTypes={})),function(t){t.BATCHED_TRANSACTIONS="BATCHED_TRANSACTIONS"}(e.SafeAppFeatures||(e.SafeAppFeatures={})),function(t){t.TWITTER="TWITTER",t.GITHUB="GITHUB",t.DISCORD="DISCORD"}(e.SafeAppSocialPlatforms||(e.SafeAppSocialPlatforms={}))})(x);var ee={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LabelValue=e.StartTimeValue=e.DurationType=e.DetailedExecutionInfoType=e.TransactionListItemType=e.ConflictType=e.TransactionInfoType=e.SettingsInfoType=e.TransactionTokenType=e.TransferDirection=e.TransactionStatus=e.Operation=void 0,function(t){t[t.CALL=0]="CALL",t[t.DELEGATE=1]="DELEGATE"}(e.Operation||(e.Operation={})),function(t){t.AWAITING_CONFIRMATIONS="AWAITING_CONFIRMATIONS",t.AWAITING_EXECUTION="AWAITING_EXECUTION",t.CANCELLED="CANCELLED",t.FAILED="FAILED",t.SUCCESS="SUCCESS"}(e.TransactionStatus||(e.TransactionStatus={})),function(t){t.INCOMING="INCOMING",t.OUTGOING="OUTGOING",t.UNKNOWN="UNKNOWN"}(e.TransferDirection||(e.TransferDirection={})),function(t){t.ERC20="ERC20",t.ERC721="ERC721",t.NATIVE_COIN="NATIVE_COIN"}(e.TransactionTokenType||(e.TransactionTokenType={})),function(t){t.SET_FALLBACK_HANDLER="SET_FALLBACK_HANDLER",t.ADD_OWNER="ADD_OWNER",t.REMOVE_OWNER="REMOVE_OWNER",t.SWAP_OWNER="SWAP_OWNER",t.CHANGE_THRESHOLD="CHANGE_THRESHOLD",t.CHANGE_IMPLEMENTATION="CHANGE_IMPLEMENTATION",t.ENABLE_MODULE="ENABLE_MODULE",t.DISABLE_MODULE="DISABLE_MODULE",t.SET_GUARD="SET_GUARD",t.DELETE_GUARD="DELETE_GUARD"}(e.SettingsInfoType||(e.SettingsInfoType={})),function(t){t.TRANSFER="Transfer",t.SETTINGS_CHANGE="SettingsChange",t.CUSTOM="Custom",t.CREATION="Creation",t.SWAP_ORDER="SwapOrder",t.TWAP_ORDER="TwapOrder",t.SWAP_TRANSFER="SwapTransfer"}(e.TransactionInfoType||(e.TransactionInfoType={})),function(t){t.NONE="None",t.HAS_NEXT="HasNext",t.END="End"}(e.ConflictType||(e.ConflictType={})),function(t){t.TRANSACTION="TRANSACTION",t.LABEL="LABEL",t.CONFLICT_HEADER="CONFLICT_HEADER",t.DATE_LABEL="DATE_LABEL"}(e.TransactionListItemType||(e.TransactionListItemType={})),function(t){t.MULTISIG="MULTISIG",t.MODULE="MODULE"}(e.DetailedExecutionInfoType||(e.DetailedExecutionInfoType={})),function(t){t.AUTO="AUTO",t.LIMIT_DURATION="LIMIT_DURATION"}(e.DurationType||(e.DurationType={})),function(t){t.AT_MINING_TIME="AT_MINING_TIME",t.AT_EPOCH="AT_EPOCH"}(e.StartTimeValue||(e.StartTimeValue={})),function(t){t.Queued="Queued",t.Next="Next"}(e.LabelValue||(e.LabelValue={}))})(ee);var te={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FEATURES=e.GAS_PRICE_TYPE=e.RPC_AUTHENTICATION=void 0,function(t){t.API_KEY_PATH="API_KEY_PATH",t.NO_AUTHENTICATION="NO_AUTHENTICATION",t.UNKNOWN="UNKNOWN"}(e.RPC_AUTHENTICATION||(e.RPC_AUTHENTICATION={})),function(t){t.ORACLE="ORACLE",t.FIXED="FIXED",t.FIXED_1559="FIXED1559",t.UNKNOWN="UNKNOWN"}(e.GAS_PRICE_TYPE||(e.GAS_PRICE_TYPE={})),function(t){t.ERC721="ERC721",t.SAFE_APPS="SAFE_APPS",t.CONTRACT_INTERACTION="CONTRACT_INTERACTION",t.DOMAIN_LOOKUP="DOMAIN_LOOKUP",t.SPENDING_LIMIT="SPENDING_LIMIT",t.EIP1559="EIP1559",t.SAFE_TX_GAS_OPTIONAL="SAFE_TX_GAS_OPTIONAL",t.TX_SIMULATION="TX_SIMULATION",t.EIP1271="EIP1271"}(e.FEATURES||(e.FEATURES={}))})(te);var ne={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TokenType=void 0,function(t){t.ERC20="ERC20",t.ERC721="ERC721",t.NATIVE_TOKEN="NATIVE_TOKEN"}(e.TokenType||(e.TokenType={}))})(ne);var se={};Object.defineProperty(se,"__esModule",{value:!0});var ie={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfirmationViewTypes=void 0,function(t){t.COW_SWAP_ORDER="COW_SWAP_ORDER",t.COW_SWAP_TWAP_ORDER="COW_SWAP_TWAP_ORDER"}(e.ConfirmationViewTypes||(e.ConfirmationViewTypes={}))})(ie);var ae={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SafeMessageStatus=e.SafeMessageListItemType=void 0,function(t){t.DATE_LABEL="DATE_LABEL",t.MESSAGE="MESSAGE"}(e.SafeMessageListItemType||(e.SafeMessageListItemType={})),function(t){t.NEEDS_CONFIRMATION="NEEDS_CONFIRMATION",t.CONFIRMED="CONFIRMED"}(e.SafeMessageStatus||(e.SafeMessageStatus={}))})(ae);var ce={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeviceType=void 0,function(t){t.ANDROID="ANDROID",t.IOS="IOS",t.WEB="WEB"}(e.DeviceType||(e.DeviceType={}))})(ce);var re={};Object.defineProperty(re,"__esModule",{value:!0});(function(e){var t=p&&p.__createBinding||(Object.create?function(a,c,o,d){d===void 0&&(d=o);var A=Object.getOwnPropertyDescriptor(c,o);(!A||("get"in A?!c.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(a,d,A)}:function(a,c,o,d){d===void 0&&(d=o),a[d]=c[o]}),n=p&&p.__exportStar||function(a,c){for(var o in a)o!=="default"&&!Object.prototype.hasOwnProperty.call(c,o)&&t(c,a,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.deleteAccount=e.getAccount=e.createAccount=e.verifyAuth=e.getAuthNonce=e.getContract=e.getSafeOverviews=e.unsubscribeAll=e.unsubscribeSingle=e.registerRecoveryModule=e.deleteRegisteredEmail=e.getRegisteredEmail=e.verifyEmail=e.resendEmailVerificationCode=e.changeEmail=e.registerEmail=e.unregisterDevice=e.unregisterSafe=e.registerDevice=e.getDelegates=e.confirmSafeMessage=e.proposeSafeMessage=e.getSafeMessage=e.getSafeMessages=e.getDecodedData=e.getMasterCopies=e.getSafeApps=e.getChainConfig=e.getChainsConfig=e.getConfirmationView=e.proposeTransaction=e.getNonces=e.postSafeGasEstimation=e.deleteTransaction=e.getTransactionDetails=e.getTransactionQueue=e.getTransactionHistory=e.getCollectiblesPage=e.getCollectibles=e.getAllOwnedSafes=e.getOwnedSafes=e.getFiatCurrencies=e.getBalances=e.getMultisigTransactions=e.getModuleTransactions=e.getIncomingTransfers=e.getSafeInfo=e.getRelayCount=e.relayTransaction=e.setBaseUrl=void 0,e.putAccountDataSettings=e.getAccountDataSettings=e.getAccountDataTypes=void 0;const s=_,r=R;n(Z,e),n(x,e),n(ee,e),n(te,e),n(ne,e),n(se,e),n(ie,e),n(ae,e),n(ce,e),n(re,e);let i=r.DEFAULT_BASE_URL;const u=a=>{i=a};e.setBaseUrl=u;function l(a,c){return(0,s.postEndpoint)(i,"/v1/chains/{chainId}/relay",{path:{chainId:a},body:c})}e.relayTransaction=l;function g(a,c){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/relay/{address}",{path:{chainId:a,address:c}})}e.getRelayCount=g;function v(a,c){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{address}",{path:{chainId:a,address:c}})}e.getSafeInfo=v;function f(a,c,o,d){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{address}/incoming-transfers/",{path:{chainId:a,address:c},query:o},d)}e.getIncomingTransfers=f;function h(a,c,o,d){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{address}/module-transactions/",{path:{chainId:a,address:c},query:o},d)}e.getModuleTransactions=h;function N(a,c,o,d){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{address}/multisig-transactions/",{path:{chainId:a,address:c},query:o},d)}e.getMultisigTransactions=N;function C(a,c,o="usd",d={}){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{address}/balances/{currency}",{path:{chainId:a,address:c,currency:o},query:d})}e.getBalances=C;function D(){return(0,s.getEndpoint)(i,"/v1/balances/supported-fiat-codes")}e.getFiatCurrencies=D;function M(a,c){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/owners/{address}/safes",{path:{chainId:a,address:c}})}e.getOwnedSafes=M;function S(a){return(0,s.getEndpoint)(i,"/v1/owners/{address}/safes",{path:{address:a}})}e.getAllOwnedSafes=S;function L(a,c,o={}){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:a,address:c},query:o})}e.getCollectibles=L;function de(a,c,o={},d){return(0,s.getEndpoint)(i,"/v2/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:a,address:c},query:o},d)}e.getCollectiblesPage=de;function le(a,c,o={},d){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/transactions/history",{path:{chainId:a,safe_address:c},query:o},d)}e.getTransactionHistory=le;function fe(a,c,o={},d){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/transactions/queued",{path:{chainId:a,safe_address:c},query:o},d)}e.getTransactionQueue=fe;function ge(a,c){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/transactions/{transactionId}",{path:{chainId:a,transactionId:c}})}e.getTransactionDetails=ge;function he(a,c,o){return(0,s.deleteEndpoint)(i,"/v1/chains/{chainId}/transactions/{safeTxHash}",{path:{chainId:a,safeTxHash:c},body:{signature:o}})}e.deleteTransaction=he;function Ee(a,c,o){return(0,s.postEndpoint)(i,"/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations",{path:{chainId:a,safe_address:c},body:o})}e.postSafeGasEstimation=Ee;function ye(a,c){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/nonces",{path:{chainId:a,safe_address:c}})}e.getNonces=ye;function _e(a,c,o){return(0,s.postEndpoint)(i,"/v1/chains/{chainId}/transactions/{safe_address}/propose",{path:{chainId:a,safe_address:c},body:o})}e.proposeTransaction=_e;function Te(a,c,o,d){return(0,s.postEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/views/transaction-confirmation",{path:{chainId:a,safe_address:c},body:{data:o,to:d}})}e.getConfirmationView=Te;function ve(a){return(0,s.getEndpoint)(i,"/v1/chains",{query:a})}e.getChainsConfig=ve;function Ie(a){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}",{path:{chainId:a}})}e.getChainConfig=Ie;function Ae(a,c={}){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safe-apps",{path:{chainId:a},query:c})}e.getSafeApps=Ae;function me(a){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/about/master-copies",{path:{chainId:a}})}e.getMasterCopies=me;function Se(a,c,o){return(0,s.postEndpoint)(i,"/v1/chains/{chainId}/data-decoder",{path:{chainId:a},body:{data:c,to:o}})}e.getDecodedData=Se;function Oe(a,c,o){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:a,safe_address:c},query:{}},o)}e.getSafeMessages=Oe;function pe(a,c){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/messages/{message_hash}",{path:{chainId:a,message_hash:c}})}e.getSafeMessage=pe;function be(a,c,o){return(0,s.postEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:a,safe_address:c},body:o})}e.proposeSafeMessage=be;function Ne(a,c,o){return(0,s.postEndpoint)(i,"/v1/chains/{chainId}/messages/{message_hash}/signatures",{path:{chainId:a,message_hash:c},body:o})}e.confirmSafeMessage=Ne;function Ce(a,c={}){return(0,s.getEndpoint)(i,"/v2/chains/{chainId}/delegates",{path:{chainId:a},query:c})}e.getDelegates=Ce;function De(a){return(0,s.postEndpoint)(i,"/v1/register/notifications",{body:a})}e.registerDevice=De;function we(a,c,o){return(0,s.deleteEndpoint)(i,"/v1/chains/{chainId}/notifications/devices/{uuid}/safes/{safe_address}",{path:{chainId:a,safe_address:c,uuid:o}})}e.unregisterSafe=we;function Pe(a,c){return(0,s.deleteEndpoint)(i,"/v1/chains/{chainId}/notifications/devices/{uuid}",{path:{chainId:a,uuid:c}})}e.unregisterDevice=Pe;function Re(a,c,o,d){return(0,s.postEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/emails",{path:{chainId:a,safe_address:c},body:o,headers:d})}e.registerEmail=Re;function Me(a,c,o,d,A){return(0,s.putEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:a,safe_address:c,signer:o},body:d,headers:A})}e.changeEmail=Me;function Le(a,c,o){return(0,s.postEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify-resend",{path:{chainId:a,safe_address:c,signer:o},body:""})}e.resendEmailVerificationCode=Le;function Be(a,c,o,d){return(0,s.putEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify",{path:{chainId:a,safe_address:c,signer:o},body:d})}e.verifyEmail=Be;function He(a,c,o,d){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:a,safe_address:c,signer:o},headers:d})}e.getRegisteredEmail=He;function Ue(a,c,o,d){return(0,s.deleteEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:a,safe_address:c,signer:o},headers:d})}e.deleteRegisteredEmail=Ue;function je(a,c,o){return(0,s.postEndpoint)(i,"/v1/chains/{chainId}/safes/{safe_address}/recovery",{path:{chainId:a,safe_address:c},body:o})}e.registerRecoveryModule=je;function Ge(a){return(0,s.deleteEndpoint)(i,"/v1/subscriptions",{query:a})}e.unsubscribeSingle=Ge;function We(a){return(0,s.deleteEndpoint)(i,"/v1/subscriptions/all",{query:a})}e.unsubscribeAll=We;function Ve(a,c){return(0,s.getEndpoint)(i,"/v1/safes",{query:Object.assign(Object.assign({},c),{safes:a.join(",")})})}e.getSafeOverviews=Ve;function ke(a,c){return(0,s.getEndpoint)(i,"/v1/chains/{chainId}/contracts/{contractAddress}",{path:{chainId:a,contractAddress:c}})}e.getContract=ke;function qe(){return(0,s.getEndpoint)(i,"/v1/auth/nonce",{credentials:"include"})}e.getAuthNonce=qe;function Fe(a){return(0,s.postEndpoint)(i,"/v1/auth/verify",{body:a,credentials:"include"})}e.verifyAuth=Fe;function $e(a){return(0,s.postEndpoint)(i,"/v1/accounts",{body:a,credentials:"include"})}e.createAccount=$e;function Ke(a){return(0,s.getEndpoint)(i,"/v1/accounts/{address}",{path:{address:a},credentials:"include"})}e.getAccount=Ke;function Xe(a){return(0,s.deleteEndpoint)(i,"/v1/accounts/{address}",{path:{address:a},credentials:"include"})}e.deleteAccount=Xe;function Qe(){return(0,s.getEndpoint)(i,"/v1/accounts/data-types")}e.getAccountDataTypes=Qe;function ze(a){return(0,s.getEndpoint)(i,"/v1/accounts/{address}/data-settings",{path:{address:a},credentials:"include"})}e.getAccountDataSettings=ze;function Je(a,c){return(0,s.putEndpoint)(i,"/v1/accounts/{address}/data-settings",{path:{address:a},body:c,credentials:"include"})}e.putAccountDataSettings=Je})(At);class Rt{constructor(t){this.communicator=t}async getBySafeTxHash(t){if(!t)throw new Error("Invalid safeTxHash");return(await this.communicator.send(E.getTxBySafeTxHash,{safeTxHash:t})).data}async signMessage(t){const n={message:t};return(await this.communicator.send(E.signMessage,n)).data}async signTypedMessage(t){if(!J(t))throw new Error("Invalid typed data");return(await this.communicator.send(E.signTypedMessage,{typedData:t})).data}async send({txs:t,params:n}){if(!t||!t.length)throw new Error("No transactions were passed");const s={txs:t,params:n};return(await this.communicator.send(E.sendTransactions,s)).data}}const y={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},I={defaultBlockParam:(e="latest")=>e,returnFullTxObjectParam:(e=!1)=>e,blockNumberToHex:e=>Number.isInteger(e)?`0x${e.toString(16)}`:e};class Mt{constructor(t){this.communicator=t,this.call=this.buildRequest({call:y.eth_call,formatters:[null,I.defaultBlockParam]}),this.getBalance=this.buildRequest({call:y.eth_getBalance,formatters:[null,I.defaultBlockParam]}),this.getCode=this.buildRequest({call:y.eth_getCode,formatters:[null,I.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:y.eth_getStorageAt,formatters:[null,I.blockNumberToHex,I.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:y.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:y.eth_getBlockByHash,formatters:[null,I.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:y.eth_getBlockByNumber,formatters:[I.blockNumberToHex,I.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:y.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:y.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:y.eth_getTransactionCount,formatters:[null,I.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:y.eth_gasPrice}),this.getEstimateGas=n=>this.buildRequest({call:y.eth_estimateGas})([n]),this.setSafeSettings=this.buildRequest({call:y.safe_setSettings})}buildRequest(t){const{call:n,formatters:s}=t;return async r=>{s&&Array.isArray(r)&&s.forEach((l,g)=>{l&&(r[g]=l(r[g]))});const i={call:n,params:r||[]};return(await this.communicator.send(E.rpcCall,i)).data}}}const Lt="0x1626ba7e",Bt="0x20c13b0b",U=4001;class b extends Error{constructor(t,n,s){super(t),this.code=n,this.data=s,Object.setPrototypeOf(this,b.prototype)}}class oe{constructor(t){this.communicator=t}async getPermissions(){return(await this.communicator.send(E.wallet_getPermissions,void 0)).data}async requestPermissions(t){if(!this.isPermissionRequestValid(t))throw new b("Permissions request is invalid",U);try{return(await this.communicator.send(E.wallet_requestPermissions,t)).data}catch{throw new b("Permissions rejected",U)}}isPermissionRequestValid(t){return t.every(n=>typeof n=="object"?Object.keys(n).every(s=>!!Object.values(H).includes(s)):!1)}}const V=(e,t)=>t.some(n=>n.parentCapability===e),Ht=()=>(e,t,n)=>{const s=n.value;return n.value=async function(){const r=new oe(this.communicator);let i=await r.getPermissions();if(V(t,i)||(i=await r.requestPermissions([{[t]:{}}])),!V(t,i))throw new b("Permissions rejected",U);return s.apply(this)},n};var Ut=function(e,t,n,s){var r=arguments.length,i=r<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,s);else for(var l=e.length-1;l>=0;l--)(u=e[l])&&(i=(r<3?u(i):r>3?u(t,n,i):u(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i};class ue{constructor(t){this.communicator=t}async getChainInfo(){return(await this.communicator.send(E.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(E.getSafeInfo,void 0)).data}async experimental_getBalances({currency:t="usd"}={}){return(await this.communicator.send(E.getSafeBalances,{currency:t})).data}async check1271Signature(t,n="0x"){const s=await this.getInfo(),r=W({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[t,n]}),i={call:y.eth_call,params:[{to:s.safeAddress,data:r},"latest"]};try{return(await this.communicator.send(E.rpcCall,i)).data.slice(0,10).toLowerCase()===Lt}catch{return!1}}async check1271SignatureBytes(t,n="0x"){const s=await this.getInfo(),r=W({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[t,n]}),i={call:y.eth_call,params:[{to:s.safeAddress,data:r},"latest"]};try{return(await this.communicator.send(E.rpcCall,i)).data.slice(0,10).toLowerCase()===Bt}catch{return!1}}calculateMessageHash(t){return Et(t)}calculateTypedMessageHash(t){const n=typeof t.domain.chainId=="object"?t.domain.chainId.toNumber():Number(t.domain.chainId);let s=t.primaryType;if(!s){const r=Object.values(t.types),i=Object.keys(t.types).filter(u=>r.every(l=>l.every(({type:g})=>g.replace("[","").replace("]","")!==u)));if(i.length===0||i.length>1)throw new Error("Please specify primaryType");s=i[0]}return ct({message:t.message,domain:{...t.domain,chainId:n,verifyingContract:t.domain.verifyingContract,salt:t.domain.salt},types:t.types,primaryType:s})}async getOffChainSignature(t){return(await this.communicator.send(E.getOffChainSignature,t)).data}async isMessageSigned(t,n="0x"){let s;if(typeof t=="string"&&(s=async()=>{const r=this.calculateMessageHash(t);return await this.isMessageHashSigned(r,n)}),J(t)&&(s=async()=>{const r=this.calculateTypedMessageHash(t);return await this.isMessageHashSigned(r,n)}),s)return await s();throw new Error("Invalid message type")}async isMessageHashSigned(t,n="0x"){const s=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const r of s)if(await r(t,n))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(E.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(E.requestAddressBook,void 0)).data}}Ut([Ht()],ue.prototype,"requestAddressBook",null);class Gt{constructor(t={}){const{allowedDomains:n=null,debug:s=!1}=t;this.communicator=new It(n,s),this.eth=new Mt(this.communicator),this.txs=new Rt(this.communicator),this.safe=new ue(this.communicator),this.wallet=new oe(this.communicator)}}export{w as MessageFormatter,E as Methods,y as RPC_CALLS,H as RestrictedMethods,Gt as default,yt as getSDKVersion,J as isObjectEIP712TypedData}; diff --git a/buddybook/assets/index-CEoqBmQK.js b/buddybook/assets/index-BhswOEW5.js similarity index 99% rename from buddybook/assets/index-CEoqBmQK.js rename to buddybook/assets/index-BhswOEW5.js index 66ee61a..cf2d19a 100644 --- a/buddybook/assets/index-CEoqBmQK.js +++ b/buddybook/assets/index-BhswOEW5.js @@ -1,4 +1,4 @@ -import{T as $t,M as re,R as N,E as k,C as $,a as X,b as Bo,O as Z,c as ht}from"./index-xoNRwz7B.js";import{C as Wo}from"./index-Gmp6KMX1.js";class Uo{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}function jo(e,t){e.indexOf(t)===-1&&e.push(t)}const Gr=(e,t,r)=>Math.min(Math.max(r,e),t),V={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},ne=e=>typeof e=="number",bt=e=>Array.isArray(e)&&!ne(e[0]),ko=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function Ho(e,t){return bt(e)?e[ko(0,e.length,t)]:e}const Jr=(e,t,r)=>-r*e+r*t+e,Qr=()=>{},et=e=>e,ur=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function Xr(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=ur(0,t,n);e.push(Jr(r,1,o))}}function zo(e){const t=[0];return Xr(t,e-1),t}function Fo(e,t=zo(e.length),r=et){const n=e.length,o=n-t.length;return o>0&&Xr(t,o),i=>{let s=0;for(;sArray.isArray(e)&&ne(e[0]),ke=e=>typeof e=="object"&&!!e.createAnimation,xt=e=>typeof e=="function",Vo=e=>typeof e=="string",Nt={ms:e=>e*1e3,s:e=>e/1e3},eo=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Zo=1e-7,Ko=12;function qo(e,t,r,n,o){let i,s,l=0;do s=t+(r-t)/2,i=eo(s,n,o)-e,i>0?r=s:t=s;while(Math.abs(i)>Zo&&++lqo(i,0,1,e,r);return i=>i===0||i===1?i:eo(o(i),t,n)}const Yo=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,o=t==="end"?Math.floor(n):Math.ceil(n);return Gr(0,1,o/e)},Go={ease:Lt(.25,.1,.25,1),"ease-in":Lt(.42,0,1,1),"ease-in-out":Lt(.42,0,.58,1),"ease-out":Lt(0,0,.58,1)},Jo=/\((.*?)\)/;function Er(e){if(xt(e))return e;if(to(e))return Lt(...e);const t=Go[e];if(t)return t;if(e.startsWith("steps")){const r=Jo.exec(e);if(r){const n=r[1].split(",");return Yo(parseFloat(n[0]),n[1].trim())}}return et}class ro{constructor(t,r=[0,1],{easing:n,duration:o=V.duration,delay:i=V.delay,endDelay:s=V.endDelay,repeat:l=V.repeat,offset:a,direction:c="normal",autoplay:d=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=et,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((h,p)=>{this.resolve=h,this.reject=p}),n=n||V.easing,ke(n)){const h=n.createAnimation(r);n=h.easing,r=h.keyframes||r,o=h.duration||o}this.repeat=l,this.easing=bt(n)?et:Er(n),this.updateDuration(o);const y=Fo(r,a,bt(n)?n.map(Er):et);this.tick=h=>{var p;i=i;let g=0;this.pauseTime!==void 0?g=this.pauseTime:g=(h-this.startTime)*this.rate,this.t=g,g/=1e3,g=Math.max(g-i,0),this.playState==="finished"&&this.pauseTime===void 0&&(g=this.totalDuration);const f=g/this.duration;let O=Math.floor(f),m=f%1;!m&&f>=1&&(m=1),m===1&&O--;const b=O%2;(c==="reverse"||c==="alternate"&&b||c==="alternate-reverse"&&!b)&&(m=1-m);const w=g>=this.totalDuration?1:Math.min(m,1),v=y(this.easing(w));t(v),this.pauseTime===void 0&&(this.playState==="finished"||g>=this.totalDuration+s)?(this.playState="finished",(p=this.resolve)===null||p===void 0||p.call(this,v)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},d&&this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}/** +import{T as $t,M as re,R as N,E as k,C as $,a as X,b as Bo,O as Z,c as ht}from"./index-C91wHTLi.js";import{C as Wo}from"./index-Cye4tEiE.js";class Uo{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}function jo(e,t){e.indexOf(t)===-1&&e.push(t)}const Gr=(e,t,r)=>Math.min(Math.max(r,e),t),V={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},ne=e=>typeof e=="number",bt=e=>Array.isArray(e)&&!ne(e[0]),ko=(e,t,r)=>{const n=t-e;return((r-e)%n+n)%n+e};function Ho(e,t){return bt(e)?e[ko(0,e.length,t)]:e}const Jr=(e,t,r)=>-r*e+r*t+e,Qr=()=>{},et=e=>e,ur=(e,t,r)=>t-e===0?1:(r-e)/(t-e);function Xr(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=ur(0,t,n);e.push(Jr(r,1,o))}}function zo(e){const t=[0];return Xr(t,e-1),t}function Fo(e,t=zo(e.length),r=et){const n=e.length,o=n-t.length;return o>0&&Xr(t,o),i=>{let s=0;for(;sArray.isArray(e)&&ne(e[0]),ke=e=>typeof e=="object"&&!!e.createAnimation,xt=e=>typeof e=="function",Vo=e=>typeof e=="string",Nt={ms:e=>e*1e3,s:e=>e/1e3},eo=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Zo=1e-7,Ko=12;function qo(e,t,r,n,o){let i,s,l=0;do s=t+(r-t)/2,i=eo(s,n,o)-e,i>0?r=s:t=s;while(Math.abs(i)>Zo&&++lqo(i,0,1,e,r);return i=>i===0||i===1?i:eo(o(i),t,n)}const Yo=(e,t="end")=>r=>{r=t==="end"?Math.min(r,.999):Math.max(r,.001);const n=r*e,o=t==="end"?Math.floor(n):Math.ceil(n);return Gr(0,1,o/e)},Go={ease:Lt(.25,.1,.25,1),"ease-in":Lt(.42,0,1,1),"ease-in-out":Lt(.42,0,.58,1),"ease-out":Lt(0,0,.58,1)},Jo=/\((.*?)\)/;function Er(e){if(xt(e))return e;if(to(e))return Lt(...e);const t=Go[e];if(t)return t;if(e.startsWith("steps")){const r=Jo.exec(e);if(r){const n=r[1].split(",");return Yo(parseFloat(n[0]),n[1].trim())}}return et}class ro{constructor(t,r=[0,1],{easing:n,duration:o=V.duration,delay:i=V.delay,endDelay:s=V.endDelay,repeat:l=V.repeat,offset:a,direction:c="normal",autoplay:d=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=et,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((h,p)=>{this.resolve=h,this.reject=p}),n=n||V.easing,ke(n)){const h=n.createAnimation(r);n=h.easing,r=h.keyframes||r,o=h.duration||o}this.repeat=l,this.easing=bt(n)?et:Er(n),this.updateDuration(o);const y=Fo(r,a,bt(n)?n.map(Er):et);this.tick=h=>{var p;i=i;let g=0;this.pauseTime!==void 0?g=this.pauseTime:g=(h-this.startTime)*this.rate,this.t=g,g/=1e3,g=Math.max(g-i,0),this.playState==="finished"&&this.pauseTime===void 0&&(g=this.totalDuration);const f=g/this.duration;let O=Math.floor(f),m=f%1;!m&&f>=1&&(m=1),m===1&&O--;const b=O%2;(c==="reverse"||c==="alternate"&&b||c==="alternate-reverse"&&!b)&&(m=1-m);const w=g>=this.totalDuration?1:Math.min(m,1),v=y(this.easing(w));t(v),this.pauseTime===void 0&&(this.playState==="finished"||g>=this.totalDuration+s)?(this.playState="finished",(p=this.resolve)===null||p===void 0||p.call(this,v)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},d&&this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause diff --git a/buddybook/assets/index-xoNRwz7B.js b/buddybook/assets/index-C91wHTLi.js similarity index 97% rename from buddybook/assets/index-xoNRwz7B.js rename to buddybook/assets/index-C91wHTLi.js index 71e34e7..1a5e4f1 100644 --- a/buddybook/assets/index-xoNRwz7B.js +++ b/buddybook/assets/index-C91wHTLi.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CEoqBmQK.js","assets/index-Gmp6KMX1.js","assets/index-DQCSip5A.css"])))=>i.map(i=>d[i]); -import{_ as pe}from"./index-Gmp6KMX1.js";const me=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,he=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_WALLETCONNECT_PROJECT_ID:"1d93edc21291f98e3bed6ff7617ff539"},J=e=>typeof e=="object"&&e!==null,L=new WeakMap,x=new WeakSet,ye=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>J(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(b,!0),l.set(o,[g,b]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(b,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(L.has(O)){const[y,H]=L.get(O);A.value=c(y,H(),I)}Object.defineProperty(b,j,A)}),Object.preventExtensions(b)},d=new WeakMap,f=[1,1],W=o=>{if(!J(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,b=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],b(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const N=r[3](A(U));y.set(U,[r,N])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),R=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&b(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),N=Reflect.get(i,a,h);if(U&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Z(a),J(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(C=>{r.status="fulfilled",r.value=C,b(["resolve",[a],C])}).catch(C=>{r.status="rejected",r.reason=C,b(["reject",[a],C])});else{!L.has(r)&&s(r)&&(V=W(r));const C=!x.has(V)&&L.get(V);C&&H(a,C)}return Reflect.set(i,a,V,h),b(["set",[a],r,N]),!0}});d.set(o,R);const fe=[q,O,c,ue];return L.set(R,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(R[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),R})=>[W,L,x,e,t,s,n,l,c,d,f],[ve]=ye();function P(e={}){return ve(e)}function D(e,t,s){const n=L.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function be(e,t){const s=L.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:p,subscribe(e){return D(p.events,()=>e(be(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var _e=Object.defineProperty,se=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=We({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const M={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Le.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Pe.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await M.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=w.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await M.getMobileListings(d):await M.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),F={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=w.state;if(m.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))De.call(t,s)&&le(e,s,t[s]);return e};function Ue(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const k=P({themeMode:Ue()?"dark":"light"}),ce={state:k,subscribe(e){return D(k,()=>e(k))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(k.themeMode=t),s&&(k.themeVariables=je({},s))}},S=P({open:!1,message:"",variant:"success"}),Re={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Te{constructor(t){this.openModal=F.open,this.closeModal=F.close,this.subscribeModal=F.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-CEoqBmQK.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Te},Symbol.toStringTag,{value:"Module"}));export{m as C,ke as E,F as M,w as O,de as R,ce as T,Re as a,Ie as b,$ as c,Ve as i}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BhswOEW5.js","assets/index-Cye4tEiE.js","assets/index-CwoEHhxw.css"])))=>i.map(i=>d[i]); +import{_ as pe}from"./index-Cye4tEiE.js";const me=Symbol(),ee=Object.getPrototypeOf,Y=new WeakMap,he=e=>e&&(Y.has(e)?Y.get(e):ee(e)===Object.prototype||ee(e)===Array.prototype),ge=e=>he(e)&&e[me]||null,te=(e,t=!0)=>{Y.set(e,t)},z={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_WALLETCONNECT_PROJECT_ID:"1d93edc21291f98e3bed6ff7617ff539"},J=e=>typeof e=="object"&&e!==null,L=new WeakMap,x=new WeakSet,ye=(e=Object.is,t=(o,g)=>new Proxy(o,g),s=o=>J(o)&&!x.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),n=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},l=new WeakMap,c=(o,g,I=n)=>{const v=l.get(o);if((v==null?void 0:v[0])===g)return v[1];const b=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return te(b,!0),l.set(o,[g,b]),Reflect.ownKeys(o).forEach(j=>{if(Object.getOwnPropertyDescriptor(b,j))return;const O=Reflect.get(o,j),A={value:O,enumerable:!0,configurable:!0};if(x.has(O))te(O,!1);else if(O instanceof Promise)delete A.value,A.get=()=>I(O);else if(L.has(O)){const[y,H]=L.get(O);A.value=c(y,H(),I)}Object.defineProperty(b,j,A)}),Object.preventExtensions(b)},d=new WeakMap,f=[1,1],W=o=>{if(!J(o))throw new Error("object required");const g=d.get(o);if(g)return g;let I=f[0];const v=new Set,b=(i,a=++f[0])=>{I!==a&&(I=a,v.forEach(r=>r(i,a)))};let j=f[1];const O=(i=++f[1])=>(j!==i&&!v.size&&(j=i,y.forEach(([a])=>{const r=a[1](i);r>I&&(I=r)})),I),A=i=>(a,r)=>{const h=[...a];h[1]=[i,...h[1]],b(h,r)},y=new Map,H=(i,a)=>{if((z?"production":void 0)!=="production"&&y.has(i))throw new Error("prop listener already exists");if(v.size){const r=a[3](A(i));y.set(i,[a,r])}else y.set(i,[a])},Z=i=>{var a;const r=y.get(i);r&&(y.delete(i),(a=r[1])==null||a.call(r))},ue=i=>(v.add(i),v.size===1&&y.forEach(([r,h],U)=>{if((z?"production":void 0)!=="production"&&h)throw new Error("remove already exists");const N=r[3](A(U));y.set(U,[r,N])}),()=>{v.delete(i),v.size===0&&y.forEach(([r,h],U)=>{h&&(h(),y.set(U,[r]))})}),q=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),R=t(q,{deleteProperty(i,a){const r=Reflect.get(i,a);Z(a);const h=Reflect.deleteProperty(i,a);return h&&b(["delete",[a],r]),h},set(i,a,r,h){const U=Reflect.has(i,a),N=Reflect.get(i,a,h);if(U&&(e(N,r)||d.has(r)&&e(N,d.get(r))))return!0;Z(a),J(r)&&(r=ge(r)||r);let V=r;if(r instanceof Promise)r.then(C=>{r.status="fulfilled",r.value=C,b(["resolve",[a],C])}).catch(C=>{r.status="rejected",r.reason=C,b(["reject",[a],C])});else{!L.has(r)&&s(r)&&(V=W(r));const C=!x.has(V)&&L.get(V);C&&H(a,C)}return Reflect.set(i,a,V,h),b(["set",[a],r,N]),!0}});d.set(o,R);const fe=[q,O,c,ue];return L.set(R,fe),Reflect.ownKeys(o).forEach(i=>{const a=Object.getOwnPropertyDescriptor(o,i);"value"in a&&(R[i]=o[i],delete a.value,delete a.writable),Object.defineProperty(q,i,a)}),R})=>[W,L,x,e,t,s,n,l,c,d,f],[ve]=ye();function P(e={}){return ve(e)}function D(e,t,s){const n=L.get(e);(z?"production":void 0)!=="production"&&!n&&console.warn("Please use proxy object");let l;const c=[],d=n[3];let f=!1;const o=d(g=>{c.push(g),l||(l=Promise.resolve().then(()=>{l=void 0,f&&t(c.splice(0))}))});return f=!0,()=>{f=!1,o()}}function be(e,t){const s=L.get(e);(z?"production":void 0)!=="production"&&!s&&console.warn("Please use proxy object");const[n,l,c]=s;return c(n,l(),t)}const u=P({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),de={state:u,subscribe(e){return D(u,()=>e(u))},push(e,t){e!==u.view&&(u.view=e,t&&(u.data=t),u.history.push(e))},reset(e){u.view=e,u.history=[e]},replace(e){u.history.length>1&&(u.history[u.history.length-1]=e,u.view=e)},goBack(){if(u.history.length>1){u.history.pop();const[e]=u.history.slice(-1);u.view=e}},setData(e){u.data=e}},m={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return m.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const e=navigator.userAgent.toLowerCase();return m.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl(e){return e.startsWith("http://")||e.startsWith("https://")},isArray(e){return Array.isArray(e)&&e.length>0},isTelegram(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)},formatNativeUrl(e,t,s){if(m.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let n=e;n.includes("://")||(n=e.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},formatUniversalUrl(e,t,s){if(!m.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let n=e;if(n.startsWith("https://t.me")){const c=Buffer.from(t).toString("base64").replace(/[=]/g,"");n.endsWith("/")&&(n=n.slice(0,-1)),this.setWalletConnectDeepLink(n,s);const d=new URL(n);return d.searchParams.set("startapp",c),d.toString()}n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,s);const l=encodeURIComponent(t);return`${n}wc?uri=${l}`},async wait(e){return new Promise(t=>{setTimeout(t,e)})},openHref(e,t){const s=this.isTelegram()?"_blank":t;window.open(e,s,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{const[t]=e.split("?");localStorage.setItem(m.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(m.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(m.WCM_VERSION,"2.7.0")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;const t=(e=de.state.data)==null?void 0:e.Wallet;if(!t)throw new Error('Missing "Wallet" view data');return t}},we=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),p=P({enabled:we,userSessionId:"",events:[],connectedWalletId:void 0}),Ie={state:p,subscribe(e){return D(p.events,()=>e(be(p.events[p.events.length-1])))},initialize(){p.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(p.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){p.connectedWalletId=e},click(e){if(p.enabled){const t={type:"CLICK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},track(e){if(p.enabled){const t={type:"TRACK",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}},view(e){if(p.enabled){const t={type:"VIEW",name:e.name,userSessionId:p.userSessionId,timestamp:Date.now(),data:e};p.events.push(t)}}},_=P({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),w={state:_,subscribe(e){return D(_,()=>e(_))},setChains(e){_.chains=e},setWalletConnectUri(e){_.walletConnectUri=e},setIsCustomDesktop(e){_.isCustomDesktop=e},setIsCustomMobile(e){_.isCustomMobile=e},setIsDataLoaded(e){_.isDataLoaded=e},setIsUiLoaded(e){_.isUiLoaded=e},setIsAuth(e){_.isAuth=e}},B=P({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),$={state:B,subscribe(e){return D(B,()=>e(B))},setConfig(e){var t,s;Ie.initialize(),w.setChains(e.chains),w.setIsAuth(!!e.enableAuthMode),w.setIsCustomMobile(!!((t=e.mobileWallets)!=null&&t.length)),w.setIsCustomDesktop(!!((s=e.desktopWallets)!=null&&s.length)),m.setModalVersionInStorage(),Object.assign(B,e)}};var _e=Object.defineProperty,se=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,ne=(e,t,s)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,We=(e,t)=>{for(var s in t||(t={}))Ee.call(t,s)&&ne(e,s,t[s]);if(se)for(var s of se(t))Oe.call(t,s)&&ne(e,s,t[s]);return e};const G="https://explorer-api.walletconnect.com",Q="wcm",X="js-2.7.0";async function K(e,t){const s=We({sdkType:Q,sdkVersion:X},t),n=new URL(e,G);return n.searchParams.append("projectId",$.state.projectId),Object.entries(s).forEach(([c,d])=>{d&&n.searchParams.append(c,String(d))}),(await fetch(n)).json()}const M={async getDesktopListings(e){return K("/w3m/v1/getDesktopListings",e)},async getMobileListings(e){return K("/w3m/v1/getMobileListings",e)},async getInjectedListings(e){return K("/w3m/v1/getInjectedListings",e)},async getAllListings(e){return K("/w3m/v1/getAllListings",e)},getWalletImageUrl(e){return`${G}/w3m/v1/getWalletImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`},getAssetImageUrl(e){return`${G}/w3m/v1/getAssetImage/${e}?projectId=${$.state.projectId}&sdkType=${Q}&sdkVersion=${X}`}};var Ce=Object.defineProperty,oe=Object.getOwnPropertySymbols,Le=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,re=(e,t,s)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ae=(e,t)=>{for(var s in t||(t={}))Le.call(t,s)&&re(e,s,t[s]);if(oe)for(var s of oe(t))Pe.call(t,s)&&re(e,s,t[s]);return e};const ae=m.isMobile(),E=P({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),ke={state:E,async getRecomendedWallets(){const{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=$.state;if(e==="NONE"||t==="ALL"&&!e)return E.recomendedWallets;if(m.isArray(e)){const n={recommendedIds:e.join(",")},{listings:l}=await M.getAllListings(n),c=Object.values(l);c.sort((d,f)=>{const W=e.indexOf(d.id),o=e.indexOf(f.id);return W-o}),E.recomendedWallets=c}else{const{chains:s,isAuth:n}=w.state,l=s==null?void 0:s.join(","),c=m.isArray(t),d={page:1,sdks:n?"auth_v1":void 0,entries:m.RECOMMENDED_WALLET_AMOUNT,chains:l,version:2,excludedIds:c?t.join(","):void 0},{listings:f}=ae?await M.getMobileListings(d):await M.getDesktopListings(d);E.recomendedWallets=Object.values(f)}return E.recomendedWallets},async getWallets(e){const t=Ae({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:n}=$.state,{recomendedWallets:l}=E;if(n==="ALL")return E.wallets;l.length?t.excludedIds=l.map(I=>I.id).join(","):m.isArray(s)&&(t.excludedIds=s.join(",")),m.isArray(n)&&(t.excludedIds=[t.excludedIds,n].filter(Boolean).join(",")),w.state.isAuth&&(t.sdks="auth_v1");const{page:c,search:d}=e,{listings:f,total:W}=ae?await M.getMobileListings(t):await M.getDesktopListings(t),o=Object.values(f),g=d?"search":"wallets";return E[g]={listings:[...E[g].listings,...o],total:W,page:c??1},{listings:o,total:W}},getWalletImageUrl(e){return M.getWalletImageUrl(e)},getAssetImageUrl(e){return M.getAssetImageUrl(e)},resetSearch(){E.search={listings:[],total:0,page:1}}},T=P({open:!1}),F={state:T,subscribe(e){return D(T,()=>e(T))},async open(e){return new Promise(t=>{const{isUiLoaded:s,isDataLoaded:n}=w.state;if(m.removeWalletConnectDeepLink(),w.setWalletConnectUri(e==null?void 0:e.uri),w.setChains(e==null?void 0:e.chains),de.reset("ConnectWallet"),s&&n)T.open=!0,t();else{const l=setInterval(()=>{const c=w.state;c.isUiLoaded&&c.isDataLoaded&&(clearInterval(l),T.open=!0,t())},200)}})},close(){T.open=!1}};var Me=Object.defineProperty,ie=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,De=Object.prototype.propertyIsEnumerable,le=(e,t,s)=>t in e?Me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,je=(e,t)=>{for(var s in t||(t={}))Se.call(t,s)&&le(e,s,t[s]);if(ie)for(var s of ie(t))De.call(t,s)&&le(e,s,t[s]);return e};function Ue(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const k=P({themeMode:Ue()?"dark":"light"}),ce={state:k,subscribe(e){return D(k,()=>e(k))},setThemeConfig(e){const{themeMode:t,themeVariables:s}=e;t&&(k.themeMode=t),s&&(k.themeVariables=je({},s))}},S=P({open:!1,message:"",variant:"success"}),Re={state:S,subscribe(e){return D(S,()=>e(S))},openToast(e,t){S.open=!0,S.message=e,S.variant=t},closeToast(){S.open=!1}};class Te{constructor(t){this.openModal=F.open,this.closeModal=F.close,this.subscribeModal=F.subscribe,this.setTheme=ce.setThemeConfig,ce.setThemeConfig(t),$.setConfig(t),this.initUi()}async initUi(){if(typeof window<"u"){await pe(()=>import("./index-BhswOEW5.js"),__vite__mapDeps([0,1,2]));const t=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",t),w.setIsUiLoaded(!0)}}}const Ve=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:Te},Symbol.toStringTag,{value:"Module"}));export{m as C,ke as E,F as M,w as O,de as R,ce as T,Re as a,Ie as b,$ as c,Ve as i}; diff --git a/buddybook/assets/index-CF3pMtIR.js b/buddybook/assets/index-CF3pMtIR.js deleted file mode 100644 index 52f0fbb..0000000 --- a/buddybook/assets/index-CF3pMtIR.js +++ /dev/null @@ -1,7 +0,0 @@ -import{d as T,g as Hs,j as Tc,l as xc,h as Pc}from"./index-Gmp6KMX1.js";import{r as $c}from"./inherits_browser-C-oMugCi.js";import{s as Oc,r as Ke,a as an,j as Bc,b as Dc}from"./hooks.module-Bu9ycfnK.js";import{e as ta}from"./events-q8pkyiVZ.js";var ra={},br={},cn={};Object.defineProperty(cn,"__esModule",{value:!0});cn.walletLogo=void 0;const jc=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};cn.walletLogo=jc;var ln={};Object.defineProperty(ln,"__esModule",{value:!0});ln.LINK_API_URL=void 0;ln.LINK_API_URL="https://www.walletlink.org";var A={},Us={exports:{}};Us.exports;(function(t){(function(e,r){function n(b,o){if(!b)throw new Error(o||"Assertion failed")}function i(b,o){b.super_=o;var l=function(){};l.prototype=o.prototype,b.prototype=new l,b.prototype.constructor=b}function s(b,o,l){if(s.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((o==="le"||o==="be")&&(l=o,o=10),this._init(b||0,o||10,l||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=$c.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,l){return o.cmp(l)>0?o:l},s.min=function(o,l){return o.cmp(l)<0?o:l},s.prototype._init=function(o,l,f){if(typeof o=="number")return this._initNumber(o,l,f);if(typeof o=="object")return this._initArray(o,l,f);l==="hex"&&(l=16),n(l===(l|0)&&l>=2&&l<=36),o=o.toString().replace(/\s+/g,"");var g=0;o[0]==="-"&&(g++,this.negative=1),g=0;g-=3)w=o[g]|o[g-1]<<8|o[g-2]<<16,this.words[m]|=w<<_&67108863,this.words[m+1]=w>>>26-_&67108863,_+=24,_>=26&&(_-=26,m++);else if(f==="le")for(g=0,m=0;g>>26-_&67108863,_+=24,_>=26&&(_-=26,m++);return this._strip()};function u(b,o){var l=b.charCodeAt(o);if(l>=48&&l<=57)return l-48;if(l>=65&&l<=70)return l-55;if(l>=97&&l<=102)return l-87;n(!1,"Invalid character in "+b)}function d(b,o,l){var f=u(b,l);return l-1>=o&&(f|=u(b,l-1)<<4),f}s.prototype._parseHex=function(o,l,f){this.length=Math.ceil((o.length-l)/6),this.words=new Array(this.length);for(var g=0;g=l;g-=2)_=d(o,l,g)<=18?(m-=18,w+=1,this.words[w]|=_>>>26):m+=8;else{var p=o.length-l;for(g=p%2===0?l+1:l;g=18?(m-=18,w+=1,this.words[w]|=_>>>26):m+=8}this._strip()};function h(b,o,l,f){for(var g=0,m=0,w=Math.min(b.length,l),_=o;_=49?m=p-49+10:p>=17?m=p-17+10:m=p,n(p>=0&&m1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=S}catch{s.prototype.inspect=S}else s.prototype.inspect=S;function S(){return(this.red?""}var E=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],M=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],k=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(o,l){o=o||10,l=l|0||1;var f;if(o===16||o==="hex"){f="";for(var g=0,m=0,w=0;w>>24-g&16777215,g+=2,g>=26&&(g-=26,w--),m!==0||w!==this.length-1?f=E[6-p.length]+p+f:f=p+f}for(m!==0&&(f=m.toString(16)+f);f.length%l!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}if(o===(o|0)&&o>=2&&o<=36){var a=M[o],v=k[o];f="";var N=this.clone();for(N.negative=0;!N.isZero();){var I=N.modrn(v).toString(o);N=N.idivn(v),N.isZero()?f=I+f:f=E[a-I.length]+I+f}for(this.isZero()&&(f="0"+f);f.length%l!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},c&&(s.prototype.toBuffer=function(o,l){return this.toArrayLike(c,o,l)}),s.prototype.toArray=function(o,l){return this.toArrayLike(Array,o,l)};var x=function(o,l){return o.allocUnsafe?o.allocUnsafe(l):new o(l)};s.prototype.toArrayLike=function(o,l,f){this._strip();var g=this.byteLength(),m=f||Math.max(1,g);n(g<=m,"byte array longer than desired length"),n(m>0,"Requested array length <= 0");var w=x(o,m),_=l==="le"?"LE":"BE";return this["_toArrayLike"+_](w,g),w},s.prototype._toArrayLikeLE=function(o,l){for(var f=0,g=0,m=0,w=0;m>8&255),f>16&255),w===6?(f>24&255),g=0,w=0):(g=_>>>24,w+=2)}if(f=0&&(o[f--]=_>>8&255),f>=0&&(o[f--]=_>>16&255),w===6?(f>=0&&(o[f--]=_>>24&255),g=0,w=0):(g=_>>>24,w+=2)}if(f>=0)for(o[f--]=g;f>=0;)o[f--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var l=o,f=0;return l>=4096&&(f+=13,l>>>=13),l>=64&&(f+=7,l>>>=7),l>=8&&(f+=4,l>>>=4),l>=2&&(f+=2,l>>>=2),f+l},s.prototype._zeroBits=function(o){if(o===0)return 26;var l=o,f=0;return l&8191||(f+=13,l>>>=13),l&127||(f+=7,l>>>=7),l&15||(f+=4,l>>>=4),l&3||(f+=2,l>>>=2),l&1||f++,f},s.prototype.bitLength=function(){var o=this.words[this.length-1],l=this._countBits(o);return(this.length-1)*26+l};function O(b){for(var o=new Array(b.bitLength()),l=0;l>>g&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,l=0;lo.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var l;this.length>o.length?l=o:l=this;for(var f=0;fo.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var l,f;this.length>o.length?(l=this,f=o):(l=o,f=this);for(var g=0;go.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var l=Math.ceil(o/26)|0,f=o%26;this._expand(l),f>0&&l--;for(var g=0;g0&&(this.words[g]=~this.words[g]&67108863>>26-f),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,l){n(typeof o=="number"&&o>=0);var f=o/26|0,g=o%26;return this._expand(f+1),l?this.words[f]=this.words[f]|1<o.length?(f=this,g=o):(f=o,g=this);for(var m=0,w=0;w>>26;for(;m!==0&&w>>26;if(this.length=f.length,m!==0)this.words[this.length]=m,this.length++;else if(f!==this)for(;wo.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var l=this.iadd(o);return o.negative=1,l._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var f=this.cmp(o);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var g,m;f>0?(g=this,m=o):(g=o,m=this);for(var w=0,_=0;_>26,this.words[_]=l&67108863;for(;w!==0&&_>26,this.words[_]=l&67108863;if(w===0&&_>>26,N=p&67108863,I=Math.min(a,o.length-1),$=Math.max(0,a-b.length+1);$<=I;$++){var ze=a-$|0;g=b.words[ze]|0,m=o.words[$]|0,w=g*m+N,v+=w/67108864|0,N=w&67108863}l.words[a]=N|0,p=v|0}return p!==0?l.words[a]=p|0:l.length--,l._strip()}var L=function(o,l,f){var g=o.words,m=l.words,w=f.words,_=0,p,a,v,N=g[0]|0,I=N&8191,$=N>>>13,ze=g[1]|0,G=ze&8191,Z=ze>>>13,ki=g[2]|0,te=ki&8191,re=ki>>>13,Ri=g[3]|0,ne=Ri&8191,se=Ri>>>13,Ii=g[4]|0,ie=Ii&8191,oe=Ii>>>13,Ci=g[5]|0,ae=Ci&8191,ce=Ci>>>13,Ai=g[6]|0,le=Ai&8191,ue=Ai>>>13,Ni=g[7]|0,de=Ni&8191,he=Ni>>>13,Li=g[8]|0,fe=Li&8191,ge=Li>>>13,Ti=g[9]|0,pe=Ti&8191,me=Ti>>>13,xi=m[0]|0,ve=xi&8191,we=xi>>>13,Pi=m[1]|0,ye=Pi&8191,be=Pi>>>13,$i=m[2]|0,_e=$i&8191,Ee=$i>>>13,Oi=m[3]|0,Se=Oi&8191,Me=Oi>>>13,Bi=m[4]|0,ke=Bi&8191,Re=Bi>>>13,Di=m[5]|0,Ie=Di&8191,Ce=Di>>>13,ji=m[6]|0,Ae=ji&8191,Ne=ji>>>13,Fi=m[7]|0,Le=Fi&8191,Te=Fi>>>13,Hi=m[8]|0,xe=Hi&8191,Pe=Hi>>>13,Ui=m[9]|0,$e=Ui&8191,Oe=Ui>>>13;f.negative=o.negative^l.negative,f.length=19,p=Math.imul(I,ve),a=Math.imul(I,we),a=a+Math.imul($,ve)|0,v=Math.imul($,we);var Xn=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,p=Math.imul(G,ve),a=Math.imul(G,we),a=a+Math.imul(Z,ve)|0,v=Math.imul(Z,we),p=p+Math.imul(I,ye)|0,a=a+Math.imul(I,be)|0,a=a+Math.imul($,ye)|0,v=v+Math.imul($,be)|0;var Yn=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(Yn>>>26)|0,Yn&=67108863,p=Math.imul(te,ve),a=Math.imul(te,we),a=a+Math.imul(re,ve)|0,v=Math.imul(re,we),p=p+Math.imul(G,ye)|0,a=a+Math.imul(G,be)|0,a=a+Math.imul(Z,ye)|0,v=v+Math.imul(Z,be)|0,p=p+Math.imul(I,_e)|0,a=a+Math.imul(I,Ee)|0,a=a+Math.imul($,_e)|0,v=v+Math.imul($,Ee)|0;var es=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(es>>>26)|0,es&=67108863,p=Math.imul(ne,ve),a=Math.imul(ne,we),a=a+Math.imul(se,ve)|0,v=Math.imul(se,we),p=p+Math.imul(te,ye)|0,a=a+Math.imul(te,be)|0,a=a+Math.imul(re,ye)|0,v=v+Math.imul(re,be)|0,p=p+Math.imul(G,_e)|0,a=a+Math.imul(G,Ee)|0,a=a+Math.imul(Z,_e)|0,v=v+Math.imul(Z,Ee)|0,p=p+Math.imul(I,Se)|0,a=a+Math.imul(I,Me)|0,a=a+Math.imul($,Se)|0,v=v+Math.imul($,Me)|0;var ts=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(ts>>>26)|0,ts&=67108863,p=Math.imul(ie,ve),a=Math.imul(ie,we),a=a+Math.imul(oe,ve)|0,v=Math.imul(oe,we),p=p+Math.imul(ne,ye)|0,a=a+Math.imul(ne,be)|0,a=a+Math.imul(se,ye)|0,v=v+Math.imul(se,be)|0,p=p+Math.imul(te,_e)|0,a=a+Math.imul(te,Ee)|0,a=a+Math.imul(re,_e)|0,v=v+Math.imul(re,Ee)|0,p=p+Math.imul(G,Se)|0,a=a+Math.imul(G,Me)|0,a=a+Math.imul(Z,Se)|0,v=v+Math.imul(Z,Me)|0,p=p+Math.imul(I,ke)|0,a=a+Math.imul(I,Re)|0,a=a+Math.imul($,ke)|0,v=v+Math.imul($,Re)|0;var rs=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(rs>>>26)|0,rs&=67108863,p=Math.imul(ae,ve),a=Math.imul(ae,we),a=a+Math.imul(ce,ve)|0,v=Math.imul(ce,we),p=p+Math.imul(ie,ye)|0,a=a+Math.imul(ie,be)|0,a=a+Math.imul(oe,ye)|0,v=v+Math.imul(oe,be)|0,p=p+Math.imul(ne,_e)|0,a=a+Math.imul(ne,Ee)|0,a=a+Math.imul(se,_e)|0,v=v+Math.imul(se,Ee)|0,p=p+Math.imul(te,Se)|0,a=a+Math.imul(te,Me)|0,a=a+Math.imul(re,Se)|0,v=v+Math.imul(re,Me)|0,p=p+Math.imul(G,ke)|0,a=a+Math.imul(G,Re)|0,a=a+Math.imul(Z,ke)|0,v=v+Math.imul(Z,Re)|0,p=p+Math.imul(I,Ie)|0,a=a+Math.imul(I,Ce)|0,a=a+Math.imul($,Ie)|0,v=v+Math.imul($,Ce)|0;var ns=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(ns>>>26)|0,ns&=67108863,p=Math.imul(le,ve),a=Math.imul(le,we),a=a+Math.imul(ue,ve)|0,v=Math.imul(ue,we),p=p+Math.imul(ae,ye)|0,a=a+Math.imul(ae,be)|0,a=a+Math.imul(ce,ye)|0,v=v+Math.imul(ce,be)|0,p=p+Math.imul(ie,_e)|0,a=a+Math.imul(ie,Ee)|0,a=a+Math.imul(oe,_e)|0,v=v+Math.imul(oe,Ee)|0,p=p+Math.imul(ne,Se)|0,a=a+Math.imul(ne,Me)|0,a=a+Math.imul(se,Se)|0,v=v+Math.imul(se,Me)|0,p=p+Math.imul(te,ke)|0,a=a+Math.imul(te,Re)|0,a=a+Math.imul(re,ke)|0,v=v+Math.imul(re,Re)|0,p=p+Math.imul(G,Ie)|0,a=a+Math.imul(G,Ce)|0,a=a+Math.imul(Z,Ie)|0,v=v+Math.imul(Z,Ce)|0,p=p+Math.imul(I,Ae)|0,a=a+Math.imul(I,Ne)|0,a=a+Math.imul($,Ae)|0,v=v+Math.imul($,Ne)|0;var ss=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(ss>>>26)|0,ss&=67108863,p=Math.imul(de,ve),a=Math.imul(de,we),a=a+Math.imul(he,ve)|0,v=Math.imul(he,we),p=p+Math.imul(le,ye)|0,a=a+Math.imul(le,be)|0,a=a+Math.imul(ue,ye)|0,v=v+Math.imul(ue,be)|0,p=p+Math.imul(ae,_e)|0,a=a+Math.imul(ae,Ee)|0,a=a+Math.imul(ce,_e)|0,v=v+Math.imul(ce,Ee)|0,p=p+Math.imul(ie,Se)|0,a=a+Math.imul(ie,Me)|0,a=a+Math.imul(oe,Se)|0,v=v+Math.imul(oe,Me)|0,p=p+Math.imul(ne,ke)|0,a=a+Math.imul(ne,Re)|0,a=a+Math.imul(se,ke)|0,v=v+Math.imul(se,Re)|0,p=p+Math.imul(te,Ie)|0,a=a+Math.imul(te,Ce)|0,a=a+Math.imul(re,Ie)|0,v=v+Math.imul(re,Ce)|0,p=p+Math.imul(G,Ae)|0,a=a+Math.imul(G,Ne)|0,a=a+Math.imul(Z,Ae)|0,v=v+Math.imul(Z,Ne)|0,p=p+Math.imul(I,Le)|0,a=a+Math.imul(I,Te)|0,a=a+Math.imul($,Le)|0,v=v+Math.imul($,Te)|0;var is=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(is>>>26)|0,is&=67108863,p=Math.imul(fe,ve),a=Math.imul(fe,we),a=a+Math.imul(ge,ve)|0,v=Math.imul(ge,we),p=p+Math.imul(de,ye)|0,a=a+Math.imul(de,be)|0,a=a+Math.imul(he,ye)|0,v=v+Math.imul(he,be)|0,p=p+Math.imul(le,_e)|0,a=a+Math.imul(le,Ee)|0,a=a+Math.imul(ue,_e)|0,v=v+Math.imul(ue,Ee)|0,p=p+Math.imul(ae,Se)|0,a=a+Math.imul(ae,Me)|0,a=a+Math.imul(ce,Se)|0,v=v+Math.imul(ce,Me)|0,p=p+Math.imul(ie,ke)|0,a=a+Math.imul(ie,Re)|0,a=a+Math.imul(oe,ke)|0,v=v+Math.imul(oe,Re)|0,p=p+Math.imul(ne,Ie)|0,a=a+Math.imul(ne,Ce)|0,a=a+Math.imul(se,Ie)|0,v=v+Math.imul(se,Ce)|0,p=p+Math.imul(te,Ae)|0,a=a+Math.imul(te,Ne)|0,a=a+Math.imul(re,Ae)|0,v=v+Math.imul(re,Ne)|0,p=p+Math.imul(G,Le)|0,a=a+Math.imul(G,Te)|0,a=a+Math.imul(Z,Le)|0,v=v+Math.imul(Z,Te)|0,p=p+Math.imul(I,xe)|0,a=a+Math.imul(I,Pe)|0,a=a+Math.imul($,xe)|0,v=v+Math.imul($,Pe)|0;var os=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(os>>>26)|0,os&=67108863,p=Math.imul(pe,ve),a=Math.imul(pe,we),a=a+Math.imul(me,ve)|0,v=Math.imul(me,we),p=p+Math.imul(fe,ye)|0,a=a+Math.imul(fe,be)|0,a=a+Math.imul(ge,ye)|0,v=v+Math.imul(ge,be)|0,p=p+Math.imul(de,_e)|0,a=a+Math.imul(de,Ee)|0,a=a+Math.imul(he,_e)|0,v=v+Math.imul(he,Ee)|0,p=p+Math.imul(le,Se)|0,a=a+Math.imul(le,Me)|0,a=a+Math.imul(ue,Se)|0,v=v+Math.imul(ue,Me)|0,p=p+Math.imul(ae,ke)|0,a=a+Math.imul(ae,Re)|0,a=a+Math.imul(ce,ke)|0,v=v+Math.imul(ce,Re)|0,p=p+Math.imul(ie,Ie)|0,a=a+Math.imul(ie,Ce)|0,a=a+Math.imul(oe,Ie)|0,v=v+Math.imul(oe,Ce)|0,p=p+Math.imul(ne,Ae)|0,a=a+Math.imul(ne,Ne)|0,a=a+Math.imul(se,Ae)|0,v=v+Math.imul(se,Ne)|0,p=p+Math.imul(te,Le)|0,a=a+Math.imul(te,Te)|0,a=a+Math.imul(re,Le)|0,v=v+Math.imul(re,Te)|0,p=p+Math.imul(G,xe)|0,a=a+Math.imul(G,Pe)|0,a=a+Math.imul(Z,xe)|0,v=v+Math.imul(Z,Pe)|0,p=p+Math.imul(I,$e)|0,a=a+Math.imul(I,Oe)|0,a=a+Math.imul($,$e)|0,v=v+Math.imul($,Oe)|0;var as=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(as>>>26)|0,as&=67108863,p=Math.imul(pe,ye),a=Math.imul(pe,be),a=a+Math.imul(me,ye)|0,v=Math.imul(me,be),p=p+Math.imul(fe,_e)|0,a=a+Math.imul(fe,Ee)|0,a=a+Math.imul(ge,_e)|0,v=v+Math.imul(ge,Ee)|0,p=p+Math.imul(de,Se)|0,a=a+Math.imul(de,Me)|0,a=a+Math.imul(he,Se)|0,v=v+Math.imul(he,Me)|0,p=p+Math.imul(le,ke)|0,a=a+Math.imul(le,Re)|0,a=a+Math.imul(ue,ke)|0,v=v+Math.imul(ue,Re)|0,p=p+Math.imul(ae,Ie)|0,a=a+Math.imul(ae,Ce)|0,a=a+Math.imul(ce,Ie)|0,v=v+Math.imul(ce,Ce)|0,p=p+Math.imul(ie,Ae)|0,a=a+Math.imul(ie,Ne)|0,a=a+Math.imul(oe,Ae)|0,v=v+Math.imul(oe,Ne)|0,p=p+Math.imul(ne,Le)|0,a=a+Math.imul(ne,Te)|0,a=a+Math.imul(se,Le)|0,v=v+Math.imul(se,Te)|0,p=p+Math.imul(te,xe)|0,a=a+Math.imul(te,Pe)|0,a=a+Math.imul(re,xe)|0,v=v+Math.imul(re,Pe)|0,p=p+Math.imul(G,$e)|0,a=a+Math.imul(G,Oe)|0,a=a+Math.imul(Z,$e)|0,v=v+Math.imul(Z,Oe)|0;var cs=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(cs>>>26)|0,cs&=67108863,p=Math.imul(pe,_e),a=Math.imul(pe,Ee),a=a+Math.imul(me,_e)|0,v=Math.imul(me,Ee),p=p+Math.imul(fe,Se)|0,a=a+Math.imul(fe,Me)|0,a=a+Math.imul(ge,Se)|0,v=v+Math.imul(ge,Me)|0,p=p+Math.imul(de,ke)|0,a=a+Math.imul(de,Re)|0,a=a+Math.imul(he,ke)|0,v=v+Math.imul(he,Re)|0,p=p+Math.imul(le,Ie)|0,a=a+Math.imul(le,Ce)|0,a=a+Math.imul(ue,Ie)|0,v=v+Math.imul(ue,Ce)|0,p=p+Math.imul(ae,Ae)|0,a=a+Math.imul(ae,Ne)|0,a=a+Math.imul(ce,Ae)|0,v=v+Math.imul(ce,Ne)|0,p=p+Math.imul(ie,Le)|0,a=a+Math.imul(ie,Te)|0,a=a+Math.imul(oe,Le)|0,v=v+Math.imul(oe,Te)|0,p=p+Math.imul(ne,xe)|0,a=a+Math.imul(ne,Pe)|0,a=a+Math.imul(se,xe)|0,v=v+Math.imul(se,Pe)|0,p=p+Math.imul(te,$e)|0,a=a+Math.imul(te,Oe)|0,a=a+Math.imul(re,$e)|0,v=v+Math.imul(re,Oe)|0;var ls=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(ls>>>26)|0,ls&=67108863,p=Math.imul(pe,Se),a=Math.imul(pe,Me),a=a+Math.imul(me,Se)|0,v=Math.imul(me,Me),p=p+Math.imul(fe,ke)|0,a=a+Math.imul(fe,Re)|0,a=a+Math.imul(ge,ke)|0,v=v+Math.imul(ge,Re)|0,p=p+Math.imul(de,Ie)|0,a=a+Math.imul(de,Ce)|0,a=a+Math.imul(he,Ie)|0,v=v+Math.imul(he,Ce)|0,p=p+Math.imul(le,Ae)|0,a=a+Math.imul(le,Ne)|0,a=a+Math.imul(ue,Ae)|0,v=v+Math.imul(ue,Ne)|0,p=p+Math.imul(ae,Le)|0,a=a+Math.imul(ae,Te)|0,a=a+Math.imul(ce,Le)|0,v=v+Math.imul(ce,Te)|0,p=p+Math.imul(ie,xe)|0,a=a+Math.imul(ie,Pe)|0,a=a+Math.imul(oe,xe)|0,v=v+Math.imul(oe,Pe)|0,p=p+Math.imul(ne,$e)|0,a=a+Math.imul(ne,Oe)|0,a=a+Math.imul(se,$e)|0,v=v+Math.imul(se,Oe)|0;var us=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(us>>>26)|0,us&=67108863,p=Math.imul(pe,ke),a=Math.imul(pe,Re),a=a+Math.imul(me,ke)|0,v=Math.imul(me,Re),p=p+Math.imul(fe,Ie)|0,a=a+Math.imul(fe,Ce)|0,a=a+Math.imul(ge,Ie)|0,v=v+Math.imul(ge,Ce)|0,p=p+Math.imul(de,Ae)|0,a=a+Math.imul(de,Ne)|0,a=a+Math.imul(he,Ae)|0,v=v+Math.imul(he,Ne)|0,p=p+Math.imul(le,Le)|0,a=a+Math.imul(le,Te)|0,a=a+Math.imul(ue,Le)|0,v=v+Math.imul(ue,Te)|0,p=p+Math.imul(ae,xe)|0,a=a+Math.imul(ae,Pe)|0,a=a+Math.imul(ce,xe)|0,v=v+Math.imul(ce,Pe)|0,p=p+Math.imul(ie,$e)|0,a=a+Math.imul(ie,Oe)|0,a=a+Math.imul(oe,$e)|0,v=v+Math.imul(oe,Oe)|0;var ds=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(ds>>>26)|0,ds&=67108863,p=Math.imul(pe,Ie),a=Math.imul(pe,Ce),a=a+Math.imul(me,Ie)|0,v=Math.imul(me,Ce),p=p+Math.imul(fe,Ae)|0,a=a+Math.imul(fe,Ne)|0,a=a+Math.imul(ge,Ae)|0,v=v+Math.imul(ge,Ne)|0,p=p+Math.imul(de,Le)|0,a=a+Math.imul(de,Te)|0,a=a+Math.imul(he,Le)|0,v=v+Math.imul(he,Te)|0,p=p+Math.imul(le,xe)|0,a=a+Math.imul(le,Pe)|0,a=a+Math.imul(ue,xe)|0,v=v+Math.imul(ue,Pe)|0,p=p+Math.imul(ae,$e)|0,a=a+Math.imul(ae,Oe)|0,a=a+Math.imul(ce,$e)|0,v=v+Math.imul(ce,Oe)|0;var hs=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(hs>>>26)|0,hs&=67108863,p=Math.imul(pe,Ae),a=Math.imul(pe,Ne),a=a+Math.imul(me,Ae)|0,v=Math.imul(me,Ne),p=p+Math.imul(fe,Le)|0,a=a+Math.imul(fe,Te)|0,a=a+Math.imul(ge,Le)|0,v=v+Math.imul(ge,Te)|0,p=p+Math.imul(de,xe)|0,a=a+Math.imul(de,Pe)|0,a=a+Math.imul(he,xe)|0,v=v+Math.imul(he,Pe)|0,p=p+Math.imul(le,$e)|0,a=a+Math.imul(le,Oe)|0,a=a+Math.imul(ue,$e)|0,v=v+Math.imul(ue,Oe)|0;var fs=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(fs>>>26)|0,fs&=67108863,p=Math.imul(pe,Le),a=Math.imul(pe,Te),a=a+Math.imul(me,Le)|0,v=Math.imul(me,Te),p=p+Math.imul(fe,xe)|0,a=a+Math.imul(fe,Pe)|0,a=a+Math.imul(ge,xe)|0,v=v+Math.imul(ge,Pe)|0,p=p+Math.imul(de,$e)|0,a=a+Math.imul(de,Oe)|0,a=a+Math.imul(he,$e)|0,v=v+Math.imul(he,Oe)|0;var gs=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(gs>>>26)|0,gs&=67108863,p=Math.imul(pe,xe),a=Math.imul(pe,Pe),a=a+Math.imul(me,xe)|0,v=Math.imul(me,Pe),p=p+Math.imul(fe,$e)|0,a=a+Math.imul(fe,Oe)|0,a=a+Math.imul(ge,$e)|0,v=v+Math.imul(ge,Oe)|0;var ps=(_+p|0)+((a&8191)<<13)|0;_=(v+(a>>>13)|0)+(ps>>>26)|0,ps&=67108863,p=Math.imul(pe,$e),a=Math.imul(pe,Oe),a=a+Math.imul(me,$e)|0,v=Math.imul(me,Oe);var ms=(_+p|0)+((a&8191)<<13)|0;return _=(v+(a>>>13)|0)+(ms>>>26)|0,ms&=67108863,w[0]=Xn,w[1]=Yn,w[2]=es,w[3]=ts,w[4]=rs,w[5]=ns,w[6]=ss,w[7]=is,w[8]=os,w[9]=as,w[10]=cs,w[11]=ls,w[12]=us,w[13]=ds,w[14]=hs,w[15]=fs,w[16]=gs,w[17]=ps,w[18]=ms,_!==0&&(w[19]=_,f.length++),f};Math.imul||(L=B);function R(b,o,l){l.negative=o.negative^b.negative,l.length=b.length+o.length;for(var f=0,g=0,m=0;m>>26)|0,g+=w>>>26,w&=67108863}l.words[m]=_,f=w,w=g}return f!==0?l.words[m]=f:l.length--,l._strip()}function z(b,o,l){return R(b,o,l)}s.prototype.mulTo=function(o,l){var f,g=this.length+o.length;return this.length===10&&o.length===10?f=L(this,o,l):g<63?f=B(this,o,l):g<1024?f=R(this,o,l):f=z(this,o,l),f},s.prototype.mul=function(o){var l=new s(null);return l.words=new Array(this.length+o.length),this.mulTo(o,l)},s.prototype.mulf=function(o){var l=new s(null);return l.words=new Array(this.length+o.length),z(this,o,l)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var l=o<0;l&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var f=0,g=0;g>=26,f+=m/67108864|0,f+=w>>>26,this.words[g]=w&67108863}return f!==0&&(this.words[g]=f,this.length++),l?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var l=O(o);if(l.length===0)return new s(1);for(var f=this,g=0;g=0);var l=o%26,f=(o-l)/26,g=67108863>>>26-l<<26-l,m;if(l!==0){var w=0;for(m=0;m>>26-l}w&&(this.words[m]=w,this.length++)}if(f!==0){for(m=this.length-1;m>=0;m--)this.words[m+f]=this.words[m];for(m=0;m=0);var g;l?g=(l-l%26)/26:g=0;var m=o%26,w=Math.min((o-m)/26,this.length),_=67108863^67108863>>>m<w)for(this.length-=w,a=0;a=0&&(v!==0||a>=g);a--){var N=this.words[a]|0;this.words[a]=v<<26-m|N>>>m,v=N&_}return p&&v!==0&&(p.words[p.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,l,f){return n(this.negative===0),this.iushrn(o,l,f)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var l=o%26,f=(o-l)/26,g=1<=0);var l=o%26,f=(o-l)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(l!==0&&f++,this.length=Math.min(f,this.length),l!==0){var g=67108863^67108863>>>l<=67108864;l++)this.words[l]-=67108864,l===this.length-1?this.words[l+1]=1:this.words[l+1]++;return this.length=Math.max(this.length,l+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var l=0;l>26)-(p/67108864|0),this.words[m+f]=w&67108863}for(;m>26,this.words[m+f]=w&67108863;if(_===0)return this._strip();for(n(_===-1),_=0,m=0;m>26,this.words[m]=w&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,l){var f=this.length-o.length,g=this.clone(),m=o,w=m.words[m.length-1]|0,_=this._countBits(w);f=26-_,f!==0&&(m=m.ushln(f),g.iushln(f),w=m.words[m.length-1]|0);var p=g.length-m.length,a;if(l!=="mod"){a=new s(null),a.length=p+1,a.words=new Array(a.length);for(var v=0;v=0;I--){var $=(g.words[m.length+I]|0)*67108864+(g.words[m.length+I-1]|0);for($=Math.min($/w|0,67108863),g._ishlnsubmul(m,$,I);g.negative!==0;)$--,g.negative=0,g._ishlnsubmul(m,1,I),g.isZero()||(g.negative^=1);a&&(a.words[I]=$)}return a&&a._strip(),g._strip(),l!=="div"&&f!==0&&g.iushrn(f),{div:a||null,mod:g}},s.prototype.divmod=function(o,l,f){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var g,m,w;return this.negative!==0&&o.negative===0?(w=this.neg().divmod(o,l),l!=="mod"&&(g=w.div.neg()),l!=="div"&&(m=w.mod.neg(),f&&m.negative!==0&&m.iadd(o)),{div:g,mod:m}):this.negative===0&&o.negative!==0?(w=this.divmod(o.neg(),l),l!=="mod"&&(g=w.div.neg()),{div:g,mod:w.mod}):this.negative&o.negative?(w=this.neg().divmod(o.neg(),l),l!=="div"&&(m=w.mod.neg(),f&&m.negative!==0&&m.isub(o)),{div:w.div,mod:m}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?l==="div"?{div:this.divn(o.words[0]),mod:null}:l==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,l)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var l=this.divmod(o);if(l.mod.isZero())return l.div;var f=l.div.negative!==0?l.mod.isub(o):l.mod,g=o.ushrn(1),m=o.andln(1),w=f.cmp(g);return w<0||m===1&&w===0?l.div:l.div.negative!==0?l.div.isubn(1):l.div.iaddn(1)},s.prototype.modrn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var f=(1<<26)%o,g=0,m=this.length-1;m>=0;m--)g=(f*g+(this.words[m]|0))%o;return l?-g:g},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var l=o<0;l&&(o=-o),n(o<=67108863);for(var f=0,g=this.length-1;g>=0;g--){var m=(this.words[g]|0)+f*67108864;this.words[g]=m/o|0,f=m%o}return this._strip(),l?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var l=this,f=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var g=new s(1),m=new s(0),w=new s(0),_=new s(1),p=0;l.isEven()&&f.isEven();)l.iushrn(1),f.iushrn(1),++p;for(var a=f.clone(),v=l.clone();!l.isZero();){for(var N=0,I=1;!(l.words[0]&I)&&N<26;++N,I<<=1);if(N>0)for(l.iushrn(N);N-- >0;)(g.isOdd()||m.isOdd())&&(g.iadd(a),m.isub(v)),g.iushrn(1),m.iushrn(1);for(var $=0,ze=1;!(f.words[0]&ze)&&$<26;++$,ze<<=1);if($>0)for(f.iushrn($);$-- >0;)(w.isOdd()||_.isOdd())&&(w.iadd(a),_.isub(v)),w.iushrn(1),_.iushrn(1);l.cmp(f)>=0?(l.isub(f),g.isub(w),m.isub(_)):(f.isub(l),w.isub(g),_.isub(m))}return{a:w,b:_,gcd:f.iushln(p)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var l=this,f=o.clone();l.negative!==0?l=l.umod(o):l=l.clone();for(var g=new s(1),m=new s(0),w=f.clone();l.cmpn(1)>0&&f.cmpn(1)>0;){for(var _=0,p=1;!(l.words[0]&p)&&_<26;++_,p<<=1);if(_>0)for(l.iushrn(_);_-- >0;)g.isOdd()&&g.iadd(w),g.iushrn(1);for(var a=0,v=1;!(f.words[0]&v)&&a<26;++a,v<<=1);if(a>0)for(f.iushrn(a);a-- >0;)m.isOdd()&&m.iadd(w),m.iushrn(1);l.cmp(f)>=0?(l.isub(f),g.isub(m)):(f.isub(l),m.isub(g))}var N;return l.cmpn(1)===0?N=g:N=m,N.cmpn(0)<0&&N.iadd(o),N},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var l=this.clone(),f=o.clone();l.negative=0,f.negative=0;for(var g=0;l.isEven()&&f.isEven();g++)l.iushrn(1),f.iushrn(1);do{for(;l.isEven();)l.iushrn(1);for(;f.isEven();)f.iushrn(1);var m=l.cmp(f);if(m<0){var w=l;l=f,f=w}else if(m===0||f.cmpn(1)===0)break;l.isub(f)}while(!0);return f.iushln(g)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var l=o%26,f=(o-l)/26,g=1<>>26,_&=67108863,this.words[w]=_}return m!==0&&(this.words[w]=m,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var l=o<0;if(this.negative!==0&&!l)return-1;if(this.negative===0&&l)return 1;this._strip();var f;if(this.length>1)f=1;else{l&&(o=-o),n(o<=67108863,"Number is too big");var g=this.words[0]|0;f=g===o?0:go.length)return 1;if(this.length=0;f--){var g=this.words[f]|0,m=o.words[f]|0;if(g!==m){gm&&(l=1);break}}return l},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new H(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var C={k256:null,p224:null,p192:null,p25519:null};function P(b,o){this.name=b,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},P.prototype.ireduce=function(o){var l=o,f;do this.split(l,this.tmp),l=this.imulK(l),l=l.iadd(this.tmp),f=l.bitLength();while(f>this.n);var g=f0?l.isub(this.p):l.strip!==void 0?l.strip():l._strip(),l},P.prototype.split=function(o,l){o.iushrn(this.n,0,l)},P.prototype.imulK=function(o){return o.imul(this.k)};function J(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(J,P),J.prototype.split=function(o,l){for(var f=4194303,g=Math.min(o.length,9),m=0;m>>22,w=_}w>>>=22,o.words[m-10]=w,w===0&&o.length>10?o.length-=10:o.length-=9},J.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var l=0,f=0;f>>=26,o.words[f]=m,l=g}return l!==0&&(o.words[o.length++]=l),o},s._prime=function(o){if(C[o])return C[o];var l;if(o==="k256")l=new J;else if(o==="p224")l=new We;else if(o==="p192")l=new Qe;else if(o==="p25519")l=new Y;else throw new Error("Unknown prime "+o);return C[o]=l,l};function H(b){if(typeof b=="string"){var o=s._prime(b);this.m=o.p,this.prime=o}else n(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}H.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},H.prototype._verify2=function(o,l){n((o.negative|l.negative)===0,"red works only with positives"),n(o.red&&o.red===l.red,"red works only with red numbers")},H.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(y(o,o.umod(this.m)._forceRed(this)),o)},H.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},H.prototype.add=function(o,l){this._verify2(o,l);var f=o.add(l);return f.cmp(this.m)>=0&&f.isub(this.m),f._forceRed(this)},H.prototype.iadd=function(o,l){this._verify2(o,l);var f=o.iadd(l);return f.cmp(this.m)>=0&&f.isub(this.m),f},H.prototype.sub=function(o,l){this._verify2(o,l);var f=o.sub(l);return f.cmpn(0)<0&&f.iadd(this.m),f._forceRed(this)},H.prototype.isub=function(o,l){this._verify2(o,l);var f=o.isub(l);return f.cmpn(0)<0&&f.iadd(this.m),f},H.prototype.shl=function(o,l){return this._verify1(o),this.imod(o.ushln(l))},H.prototype.imul=function(o,l){return this._verify2(o,l),this.imod(o.imul(l))},H.prototype.mul=function(o,l){return this._verify2(o,l),this.imod(o.mul(l))},H.prototype.isqr=function(o){return this.imul(o,o.clone())},H.prototype.sqr=function(o){return this.mul(o,o)},H.prototype.sqrt=function(o){if(o.isZero())return o.clone();var l=this.m.andln(3);if(n(l%2===1),l===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(o,f)}for(var g=this.m.subn(1),m=0;!g.isZero()&&g.andln(1)===0;)m++,g.iushrn(1);n(!g.isZero());var w=new s(1).toRed(this),_=w.redNeg(),p=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new s(2*a*a).toRed(this);this.pow(a,p).cmp(_)!==0;)a.redIAdd(_);for(var v=this.pow(a,g),N=this.pow(o,g.addn(1).iushrn(1)),I=this.pow(o,g),$=m;I.cmp(w)!==0;){for(var ze=I,G=0;ze.cmp(w)!==0;G++)ze=ze.redSqr();n(G<$);var Z=this.pow(v,new s(1).iushln($-G-1));N=N.redMul(Z),v=Z.redSqr(),I=I.redMul(v),$=G}return N},H.prototype.invm=function(o){var l=o._invmp(this.m);return l.negative!==0?(l.negative=0,this.imod(l).redNeg()):this.imod(l)},H.prototype.pow=function(o,l){if(l.isZero())return new s(1).toRed(this);if(l.cmpn(1)===0)return o.clone();var f=4,g=new Array(1<=0;m--){for(var v=l.words[m],N=a-1;N>=0;N--){var I=v>>N&1;if(w!==g[0]&&(w=this.sqr(w)),I===0&&_===0){p=0;continue}_<<=1,_|=I,p++,!(p!==f&&(m!==0||N!==0))&&(w=this.mul(w,g[_]),p=0,_=0)}a=26}return w},H.prototype.convertTo=function(o){var l=o.umod(this.m);return l===o?l.clone():l},H.prototype.convertFrom=function(o){var l=o.clone();return l.red=null,l},s.mont=function(o){return new q(o)};function q(b){H.call(this,b),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(q,H),q.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},q.prototype.convertFrom=function(o){var l=this.imod(o.mul(this.rinv));return l.red=null,l},q.prototype.imul=function(o,l){if(o.isZero()||l.isZero())return o.words[0]=0,o.length=1,o;var f=o.imul(l),g=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=f.isub(g).iushrn(this.shift),w=m;return m.cmp(this.m)>=0?w=m.isub(this.m):m.cmpn(0)<0&&(w=m.iadd(this.m)),w._forceRed(this)},q.prototype.mul=function(o,l){if(o.isZero()||l.isZero())return new s(0)._forceRed(this);var f=o.mul(l),g=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=f.isub(g).iushrn(this.shift),w=m;return m.cmp(this.m)>=0?w=m.isub(this.m):m.cmpn(0)<0&&(w=m.iadd(this.m)),w._forceRed(this)},q.prototype.invm=function(o){var l=this.imod(o._invmp(this.m).mul(this.r2));return l._forceRed(this)}})(t,T)})(Us);var un=Us.exports,Sr={},St={};Object.defineProperty(St,"__esModule",{value:!0});St.errorValues=St.standardErrorCodes=void 0;St.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};St.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var dn={},hn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=St,r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(E,M=r){if(E&&Number.isInteger(E)){const k=E.toString();if(y(e.errorValues,k))return e.errorValues[k].message;if(d(E))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return M}t.getMessageFromCode=n;function i(E){if(!Number.isInteger(E))return!1;const M=E.toString();return!!(e.errorValues[M]||d(E))}t.isValidCode=i;function s(E){var M;if(typeof E=="number")return E;if(c(E))return(M=E.code)!==null&&M!==void 0?M:E.errorCode}t.getErrorCode=s;function c(E){return typeof E=="object"&&E!==null&&(typeof E.code=="number"||typeof E.errorCode=="number")}function u(E,{shouldIncludeStack:M=!1}={}){const k={};if(E&&typeof E=="object"&&!Array.isArray(E)&&y(E,"code")&&i(E.code)){const x=E;k.code=x.code,x.message&&typeof x.message=="string"?(k.message=x.message,y(x,"data")&&(k.data=x.data)):(k.message=n(k.code),k.data={originalError:h(E)})}else k.code=e.standardErrorCodes.rpc.internal,k.message=S(E,"message")?E.message:r,k.data={originalError:h(E)};return M&&(k.stack=S(E,"stack")?E.stack:void 0),k}t.serialize=u;function d(E){return E>=-32099&&E<=-32e3}function h(E){return E&&typeof E=="object"&&!Array.isArray(E)?Object.assign({},E):E}function y(E,M){return Object.prototype.hasOwnProperty.call(E,M)}function S(E,M){return typeof E=="object"&&E!==null&&M in E&&typeof E[M]=="string"}})(hn);Object.defineProperty(dn,"__esModule",{value:!0});dn.standardErrors=void 0;const He=St,na=hn;dn.standardErrors={rpc:{parse:t=>rt(He.standardErrorCodes.rpc.parse,t),invalidRequest:t=>rt(He.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>rt(He.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>rt(He.standardErrorCodes.rpc.methodNotFound,t),internal:t=>rt(He.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return rt(e,t)},invalidInput:t=>rt(He.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>rt(He.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>rt(He.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>rt(He.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>rt(He.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>rt(He.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>Wt(He.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>Wt(He.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>Wt(He.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>Wt(He.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>Wt(He.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>Wt(He.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new oa(e,r,n)}}};function rt(t,e){const[r,n]=sa(e);return new ia(t,r||(0,na.getMessageFromCode)(t),n)}function Wt(t,e){const[r,n]=sa(e);return new oa(t,r||(0,na.getMessageFromCode)(t),n)}function sa(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}let ia=class extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}},oa=class extends ia{constructor(e,r,n){if(!Fc(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}};function Fc(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}var fn={},cr={};Object.defineProperty(cr,"__esModule",{value:!0});cr.isErrorResponse=void 0;function Hc(t){return t.errorMessage!==void 0}cr.isErrorResponse=Hc;var lr={};Object.defineProperty(lr,"__esModule",{value:!0});lr.LIB_VERSION=void 0;lr.LIB_VERSION="3.9.3";Object.defineProperty(fn,"__esModule",{value:!0});fn.serializeError=void 0;const Uc=cr,Vc=lr,Wc=St,zc=hn;function qc(t,e){const r=(0,zc.serialize)(Jc(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Vc.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=Gc(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}fn.serializeError=qc;function Jc(t){return typeof t=="string"?{message:t,code:Wc.standardErrorCodes.rpc.internal}:(0,Uc.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function Gc(t,e){const r=t==null?void 0:t.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=t.serializeError=t.getMessageFromCode=t.getErrorCode=void 0;const e=St;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});const r=dn;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=fn;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=hn;Object.defineProperty(t,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(Sr);var De={};Object.defineProperty(De,"__esModule",{value:!0});De.ProviderType=De.RegExpString=De.IntNumber=De.BigIntString=De.AddressString=De.HexString=De.OpaqueType=void 0;function Mr(){return t=>t}De.OpaqueType=Mr;De.HexString=Mr();De.AddressString=Mr();De.BigIntString=Mr();function Zc(t){return Math.floor(t)}De.IntNumber=Zc;De.RegExpString=Mr();var Vi;(function(t){t.CoinbaseWallet="CoinbaseWallet",t.MetaMask="MetaMask",t.Unselected=""})(Vi||(De.ProviderType=Vi={}));var Qc=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(A,"__esModule",{value:!0});A.isMobileWeb=A.getLocation=A.isInIFrame=A.createQrUrl=A.getFavicon=A.range=A.isBigNumber=A.ensureParsedJSONObject=A.ensureBN=A.ensureRegExpString=A.ensureIntNumber=A.ensureBuffer=A.ensureAddressString=A.ensureEvenLengthHexString=A.ensureHexString=A.isHexString=A.prepend0x=A.strip0x=A.has0xPrefix=A.hexStringFromIntNumber=A.intNumberFromHexString=A.bigIntStringFromBN=A.hexStringFromBuffer=A.hexStringToUint8Array=A.uint8ArrayToHex=A.randomBytesHex=void 0;const Rt=Qc(un),Ht=Sr,ot=De,aa=/^[0-9]*$/,ca=/^[a-f0-9]*$/;function Kc(t){return la(crypto.getRandomValues(new Uint8Array(t)))}A.randomBytesHex=Kc;function la(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}A.uint8ArrayToHex=la;function Xc(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}A.hexStringToUint8Array=Xc;function Yc(t,e=!1){const r=t.toString("hex");return(0,ot.HexString)(e?`0x${r}`:r)}A.hexStringFromBuffer=Yc;function el(t){return(0,ot.BigIntString)(t.toString(10))}A.bigIntStringFromBN=el;function tl(t){return(0,ot.IntNumber)(new Rt.default(Rr(t,!1),16).toNumber())}A.intNumberFromHexString=tl;function rl(t){return(0,ot.HexString)(`0x${new Rt.default(t).toString(16)}`)}A.hexStringFromIntNumber=rl;function Vs(t){return t.startsWith("0x")||t.startsWith("0X")}A.has0xPrefix=Vs;function gn(t){return Vs(t)?t.slice(2):t}A.strip0x=gn;function ua(t){return Vs(t)?`0x${t.slice(2)}`:`0x${t}`}A.prepend0x=ua;function kr(t){if(typeof t!="string")return!1;const e=gn(t).toLowerCase();return ca.test(e)}A.isHexString=kr;function da(t,e=!1){if(typeof t=="string"){const r=gn(t).toLowerCase();if(ca.test(r))return(0,ot.HexString)(e?`0x${r}`:r)}throw Ht.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}A.ensureHexString=da;function Rr(t,e=!1){let r=da(t,!1);return r.length%2===1&&(r=(0,ot.HexString)(`0${r}`)),e?(0,ot.HexString)(`0x${r}`):r}A.ensureEvenLengthHexString=Rr;function nl(t){if(typeof t=="string"){const e=gn(t).toLowerCase();if(kr(e)&&e.length===40)return(0,ot.AddressString)(ua(e))}throw Ht.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}A.ensureAddressString=nl;function sl(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(kr(t)){const e=Rr(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw Ht.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}A.ensureBuffer=sl;function ha(t){if(typeof t=="number"&&Number.isInteger(t))return(0,ot.IntNumber)(t);if(typeof t=="string"){if(aa.test(t))return(0,ot.IntNumber)(Number(t));if(kr(t))return(0,ot.IntNumber)(new Rt.default(Rr(t,!1),16).toNumber())}throw Ht.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}A.ensureIntNumber=ha;function il(t){if(t instanceof RegExp)return(0,ot.RegExpString)(t.toString());throw Ht.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}A.ensureRegExpString=il;function ol(t){if(t!==null&&(Rt.default.isBN(t)||fa(t)))return new Rt.default(t.toString(10),10);if(typeof t=="number")return new Rt.default(ha(t));if(typeof t=="string"){if(aa.test(t))return new Rt.default(t,10);if(kr(t))return new Rt.default(Rr(t,!1),16)}throw Ht.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}A.ensureBN=ol;function al(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw Ht.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}A.ensureParsedJSONObject=al;function fa(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}A.isBigNumber=fa;function cl(t,e){return Array.from({length:e-t},(r,n)=>t+n)}A.range=cl;function ll(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}A.getFavicon=ll;function ul(t,e,r,n,i,s){const c=n?"parent-id":"id",u=new URLSearchParams({[c]:t,secret:e,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${u}`}A.createQrUrl=ul;function ga(){try{return window.frameElement!==null}catch{return!1}}A.isInIFrame=ga;function dl(){try{return ga()&&window.top?window.top.location:window.location}catch{return window.location}}A.getLocation=dl;function hl(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}A.isMobileWeb=hl;var pn={};Object.defineProperty(pn,"__esModule",{value:!0});pn.ScopedLocalStorage=void 0;class fl{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}pn.ScopedLocalStorage=fl;var rr={},Ir={},Cr={},ur={};Object.defineProperty(ur,"__esModule",{value:!0});ur.EVENTS=void 0;ur.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var it={};Object.defineProperty(it,"__esModule",{value:!0});it.RelayAbstract=it.APP_VERSION_KEY=it.LOCAL_STORAGE_ADDRESSES_KEY=it.WALLET_USER_NAME_KEY=void 0;const Wi=Sr;it.WALLET_USER_NAME_KEY="walletUsername";it.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";it.APP_VERSION_KEY="AppVersion";class gl{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Wi.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Wi.serializeError)(s,e.method);return i})}}it.RelayAbstract=gl;var dr={};Object.defineProperty(dr,"__esModule",{value:!0});dr.Session=void 0;const zi=Oc,qi=A,Ji="session:id",Gi="session:secret",Zi="session:linked";class Ws{constructor(e,r,n,i){this._storage=e,this._id=r||(0,qi.randomBytesHex)(16),this._secret=n||(0,qi.randomBytesHex)(32),this._key=new zi.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(Ji),n=e.getItem(Zi),i=e.getItem(Gi);return r&&i?new Ws(e,r,i,n==="1"):null}static hash(e){return new zi.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(Ji,this._id),this._storage.setItem(Gi,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Zi,this._linked?"1":"0")}}dr.Session=Ws;var mn={},vn={};Object.defineProperty(vn,"__esModule",{value:!0});vn.Cipher=void 0;const Wr=A;class pl{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,Wr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,c=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(e)),u=16,d=c.slice(c.byteLength-u),h=c.slice(0,c.byteLength-u),y=new Uint8Array(d),S=new Uint8Array(h),E=new Uint8Array([...n,...y,...S]);return(0,Wr.uint8ArrayToHex)(E)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,Wr.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),c=(0,Wr.hexStringToUint8Array)(e),u=c.slice(0,12),d=c.slice(12,28),h=c.slice(28),y=new Uint8Array([...h,...d]),S={name:"AES-GCM",iv:new Uint8Array(u)};try{const E=await window.crypto.subtle.decrypt(S,s,y),M=new TextDecoder;n(M.decode(E))}catch(E){i(E)}})()})}}vn.Cipher=pl;var wn={};Object.defineProperty(wn,"__esModule",{value:!0});wn.WalletLinkHTTP=void 0;class ml{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(e=n==null?void 0:n.filter(c=>c.event==="Web3Response").map(c=>({type:"Event",sessionId:this.sessionId,eventId:c.id,event:c.event,data:c.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}wn.WalletLinkHTTP=ml;var nr={};Object.defineProperty(nr,"__esModule",{value:!0});nr.WalletLinkWebSocket=nr.ConnectionState=void 0;var Kt;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(Kt||(nr.ConnectionState=Kt={}));class vl{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Kt.CONNECTING),i.onclose=s=>{var c;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(c=this.connectionStateListener)===null||c===void 0||c.call(this,Kt.DISCONNECTED)},i.onopen=s=>{var c;e(),(c=this.connectionStateListener)===null||c===void 0||c.call(this,Kt.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(d=>this.sendData(d)),this.pendingData=[])},i.onmessage=s=>{var c,u;if(s.data==="h")(c=this.incomingDataListener)===null||c===void 0||c.call(this,{type:"Heartbeat"});else try{const d=JSON.parse(s.data);(u=this.incomingDataListener)===null||u===void 0||u.call(this,d)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Kt.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}nr.WalletLinkWebSocket=vl;Object.defineProperty(mn,"__esModule",{value:!0});mn.WalletLinkConnection=void 0;const zt=De,wl=vn,ht=ur,Qi=it,qt=dr,yl=wn,zr=nr,Ki=1e4,bl=6e4;class _l{constructor({session:e,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,zt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=u=>{if(!u)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",h=>u.JsonRpcUrl&&this.handleChainUpdated(h,u.JsonRpcUrl)]]).forEach((h,y)=>{const S=u[y];S!==void 0&&h(S)})},this.handleDestroyed=u=>{var d,h;u==="1"&&((d=this.listener)===null||d===void 0||d.resetAndReload(),(h=this.diagnostic)===null||h===void 0||h.log(ht.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:qt.Session.hash(this.session.id)}))},this.handleAccountUpdated=async u=>{var d,h;try{const y=await this.cipher.decrypt(u);(d=this.listener)===null||d===void 0||d.accountUpdated(y)}catch{(h=this.diagnostic)===null||h===void 0||h.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(u,d)=>{var h,y;try{const S=await this.cipher.decrypt(d);(h=this.listener)===null||h===void 0||h.metadataUpdated(u,S)}catch{(y=this.diagnostic)===null||y===void 0||y.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:u})}},this.handleWalletUsernameUpdated=async u=>{this.handleMetadataUpdated(Qi.WALLET_USER_NAME_KEY,u)},this.handleAppVersionUpdated=async u=>{this.handleMetadataUpdated(Qi.APP_VERSION_KEY,u)},this.handleChainUpdated=async(u,d)=>{var h,y;try{const S=await this.cipher.decrypt(u),E=await this.cipher.decrypt(d);(h=this.listener)===null||h===void 0||h.chainUpdated(S,E)}catch{(y=this.diagnostic)===null||y===void 0||y.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=e,this.cipher=new wl.Cipher(e.secret),this.diagnostic=i,this.listener=n;const c=new zr.WalletLinkWebSocket(`${r}/rpc`,s);c.setConnectionStateListener(async u=>{var d;(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.CONNECTED_STATE_CHANGE,{state:u,sessionIdHash:qt.Session.hash(e.id)});let h=!1;switch(u){case zr.ConnectionState.DISCONNECTED:if(!this.destroyed){const y=async()=>{await new Promise(S=>setTimeout(S,5e3)),this.destroyed||c.connect().catch(()=>{y()})};y()}break;case zr.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),h=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Ki),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case zr.ConnectionState.CONNECTING:break}this.connected!==h&&(this.connected=h)}),c.setIncomingDataListener(u=>{var d,h,y;switch(u.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const S=u.type==="IsLinkedOK"?u.linked:void 0;(d=this.diagnostic)===null||d===void 0||d.log(ht.EVENTS.LINKED,{sessionIdHash:qt.Session.hash(e.id),linked:S,type:u.type,onlineGuests:u.onlineGuests}),this.linked=S||u.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(h=this.diagnostic)===null||h===void 0||h.log(ht.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:qt.Session.hash(e.id),metadata_keys:u&&u.metadata?Object.keys(u.metadata):void 0}),this.handleSessionMetadataUpdated(u.metadata);break}case"Event":{this.handleIncomingEvent(u);break}}u.id!==void 0&&((y=this.requestResolutions.get(u.id))===null||y===void 0||y(u))}),this.ws=c,this.http=new yl.WalletLinkHTTP(r,e.id,e.key)}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(ht.EVENTS.STARTED_CONNECTING,{sessionIdHash:qt.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var e;this.destroyed=!0,this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(ht.EVENTS.DISCONNECTED,{sessionIdHash:qt.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r,n;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(e)}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r,n;if(!(e.type!=="Event"||e.event!=="Web3Response"))try{const i=await this.cipher.decrypt(e.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(ht.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){const n={type:"SetSessionConfig",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const c=await this.makeRequest(s);if(c.type==="Fail")throw new Error(c.error||"failed to publish event");return c.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Ki*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=bl){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((s,c)=>{i=window.setTimeout(()=>{c(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,c=>{clearTimeout(i),s(c),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const e={type:"IsLinked",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,zt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}mn.WalletLinkConnection=_l;var Ar={},Nr={},zs={};Object.defineProperty(zs,"__esModule",{value:!0});zs.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var El=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.injectCssReset=void 0;const Sl=El(zs);function Ml(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(Sl.default)),document.documentElement.appendChild(t)}Nr.injectCssReset=Ml;var yn={},bn={};function pa(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}ma.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=wt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=K.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=K.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,c=this.moduleCount-1;c>0;c-=2)for(c==6&&c--;;){for(var u=0;u<2;u++)if(this.modules[n][c-u]==null){var d=!1;s>>i&1)==1);var h=K.getMask(e,n,c-u);h&&(d=!d),this.modules[n][c-u]=d,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};wt.PAD0=236;wt.PAD1=17;wt.createData=function(t,e,r){for(var n=vt.getRSBlocks(t,e),i=new va,s=0;su*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+u*8+")");for(i.getLengthInBits()+4<=u*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=u*8||(i.put(wt.PAD0,8),i.getLengthInBits()>=u*8));)i.put(wt.PAD1,8);return wt.createBytes(i,n)};wt.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),c=new Array(e.length),u=0;u=0?M.get(k):0}}for(var x=0,y=0;y=0;)e^=K.G15<=0;)e^=K.G18<>>=1;return e},getPatternPosition:function(t){return K.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Mt.PATTERN000:return(e+r)%2==0;case Mt.PATTERN001:return e%2==0;case Mt.PATTERN010:return r%3==0;case Mt.PATTERN011:return(e+r)%3==0;case Mt.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Mt.PATTERN101:return e*r%2+e*r%3==0;case Mt.PATTERN110:return(e*r%2+e*r%3)%2==0;case Mt.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new Xt([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)t-=255;return Fe.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Ue=0;Ue<8;Ue++)Fe.EXP_TABLE[Ue]=1<>>7-t%8&1)==1},put:function(t,e){for(var r=0;r>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var vs=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function wa(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(d){switch(d){case"L":return It.L;case"M":return It.M;case"Q":return It.Q;case"H":return It.H;default:throw new Error("Unknwon error correction level: "+d)}}function n(d,h){for(var y=i(d),S=1,E=0,M=0,k=vs.length;M<=k;M++){var x=vs[M];if(!x)throw new Error("Content too long: expected "+E+" but got "+y);switch(h){case"L":E=x[0];break;case"M":E=x[1];break;case"Q":E=x[2];break;case"H":E=x[3];break;default:throw new Error("Unknwon error correction level: "+h)}if(y<=E)break;S++}if(S>vs.length)throw new Error("Content too long");return S}function i(d){var h=encodeURI(d).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return h.length+(h.length!=d?3:0)}var s=this.options.content,c=n(s,this.options.ecl),u=r(this.options.ecl);this.qrcode=new wt(c,u),this.qrcode.addData(s),this.qrcode.make()}wa.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r -`:"",c=e.width,u=e.height,d=r.length,h=c/(d+2*e.padding),y=u/(d+2*e.padding),S=typeof e.join<"u"?!!e.join:!1,E=typeof e.swap<"u"?!!e.swap:!1,M=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,k=typeof e.predefined<"u"?!!e.predefined:!1,x=k?i+''+s:"",O=i+''+s,B="",L="",R=0;R'+s:B+=i+''+s}}S&&(B=i+'');let H="";if(this.options.image!==void 0&&this.options.image.svg){const b=c*this.options.image.width/100,o=u*this.options.image.height/100,l=c/2-b/2,f=u/2-o/2;H+=``,H+=this.options.image.svg+s,H+=""}var q="";switch(t.container){case"svg":M&&(q+=''+s),q+=''+s,q+=x+O+B,q+=H,q+="";break;case"svg-viewbox":M&&(q+=''+s),q+=''+s,q+=x+O+B,q+=H,q+="";break;case"g":q+=''+s,q+=x+O+B,q+=H,q+="";break;default:q+=(x+O+B+H).replace(/^\s+/,"");break}return q};var Al=wa,Nl=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Mn,"__esModule",{value:!0});Mn.QRCode=void 0;const Ll=Ke,eo=an,Tl=Nl(Al),xl=t=>{const[e,r]=(0,eo.useState)("");return(0,eo.useEffect)(()=>{var n,i;const s=new Tl.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),c=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${c}`)},[t.bgColor,t.content,t.fgColor,t.height,t.image,t.width]),e?(0,Ll.h)("img",{src:e,alt:"QR Code"}):null};Mn.QRCode=xl;var kn={},qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var Pl=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(kn,"__esModule",{value:!0});kn.Spinner=void 0;const Jr=Ke,$l=Pl(qs),Ol=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,Jr.h)("div",{class:"-cbwsdk-spinner"},(0,Jr.h)("style",null,$l.default),(0,Jr.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Jr.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};kn.Spinner=Ol;var Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var ya=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sr,"__esModule",{value:!0});sr.CoinbaseWalletSteps=sr.ConnectContent=void 0;const Dt=ya(Lr),V=Ke,Bl=A,Dl=lr,jl=_n,Fl=En,Hl=Sn,Ul=Mn,Vl=kn,Wl=ya(Js),ws={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:ba},zl=t=>t==="light"?"#FFFFFF":"#0A0B0D";function ql(t){const{theme:e}=t,r=(0,Bl.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),n=ws.steps;return(0,V.h)("div",{"data-testid":"connect-content",className:(0,Dt.default)("-cbwsdk-connect-content",e)},(0,V.h)("style",null,Wl.default),(0,V.h)("div",{className:"-cbwsdk-connect-content-header"},(0,V.h)("h2",{className:(0,Dt.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with our mobile app"),t.onCancel&&(0,V.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,V.h)(jl.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,V.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,V.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,V.h)(Jl,{title:ws.title,description:ws.description,theme:e})),(0,V.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,V.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,V.h)(Ul.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,V.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:Dl.LIB_VERSION}),(0,V.h)("input",{type:"hidden",value:r})),(0,V.h)(n,{theme:e}),!t.isConnected&&(0,V.h)("div",{"data-testid":"connecting-spinner",className:(0,Dt.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,V.h)(Vl.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,V.h)("p",null,"Connecting...")))))}sr.ConnectContent=ql;function Jl({title:t,description:e,theme:r}){return(0,V.h)("div",{className:(0,Dt.default)("-cbwsdk-connect-item",r)},(0,V.h)("div",null,(0,V.h)(Fl.CoinbaseWalletRound,null)),(0,V.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,V.h)("h3",{className:"-cbwsdk-connect-item-title"},t),(0,V.h)("p",{className:"-cbwsdk-connect-item-description"},e)))}function ba({theme:t}){return(0,V.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,V.h)("li",{className:(0,Dt.default)("-cbwsdk-wallet-steps-item",t)},(0,V.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,V.h)("li",{className:(0,Dt.default)("-cbwsdk-wallet-steps-item",t)},(0,V.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,V.h)("span",null,"Tap ",(0,V.h)("strong",null,"Scan")," "),(0,V.h)("span",{className:(0,Dt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,V.h)(Hl.QRCodeIcon,{fill:zl(t)})))))}sr.CoinbaseWalletSteps=ba;var Rn={},In={};Object.defineProperty(In,"__esModule",{value:!0});In.ArrowLeftIcon=void 0;const to=Ke;function Gl(t){return(0,to.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,to.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}In.ArrowLeftIcon=Gl;var Cn={};Object.defineProperty(Cn,"__esModule",{value:!0});Cn.LaptopIcon=void 0;const ys=Ke;function Zl(t){return(0,ys.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,ys.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,ys.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Cn.LaptopIcon=Zl;var An={};Object.defineProperty(An,"__esModule",{value:!0});An.SafeIcon=void 0;const ro=Ke;function Ql(t){return(0,ro.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,ro.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}An.SafeIcon=Ql;var Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var _a=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.TryExtensionContent=void 0;const Nt=_a(Lr),Be=Ke,bs=an,Kl=In,Xl=Cn,Yl=An,eu=_a(Gs);function tu({theme:t}){const[e,r]=(0,bs.useState)(!1),n=(0,bs.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,bs.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,Be.h)("div",{class:(0,Nt.default)("-cbwsdk-try-extension",t)},(0,Be.h)("style",null,eu.default),(0,Be.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Be.h)("h3",{class:(0,Nt.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,Be.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,Be.h)("button",{class:(0,Nt.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,Be.h)("div",null,!e&&(0,Be.h)(Kl.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,Be.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,Be.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,Be.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Be.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Be.h)("span",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Be.h)(Xl.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Be.h)("div",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,Be.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,Be.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,Be.h)("span",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,Be.h)(Yl.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,Be.h)("div",{class:(0,Nt.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Rn.TryExtensionContent=tu;var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Ea=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bn,"__esModule",{value:!0});bn.ConnectDialog=void 0;const _s=Ea(Lr),Lt=Ke,Es=an,ru=sr,nu=Rn,su=Ea(Zs),iu=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,Es.useState)(!e),[s,c]=(0,Es.useState)(!e);(0,Es.useEffect)(()=>{const d=[window.setTimeout(()=>{c(!e)},10)];return e?i(!1):d.push(window.setTimeout(()=>{i(!0)},360)),()=>{d.forEach(window.clearTimeout)}},[e]);const u=r?"dark":"light";return(0,Lt.h)("div",{class:(0,_s.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Lt.h)("style",null,su.default),(0,Lt.h)("div",{class:(0,_s.default)("-cbwsdk-connect-dialog-backdrop",u,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Lt.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Lt.h)("div",{class:(0,_s.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,Lt.h)(ru.ConnectContent,{theme:u,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,Lt.h)(nu.TryExtensionContent,{theme:u}))))};bn.ConnectDialog=iu;Object.defineProperty(yn,"__esModule",{value:!0});yn.LinkFlow=void 0;const Ss=Ke,ou=bn;class au{constructor(e){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render()}setConnected(e){this.connected!==e&&(this.connected=e,this.render())}setChainId(e){this.chainId!==e&&(this.chainId=e,this.render())}detach(){var e;this.root&&((0,Ss.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,Ss.render)((0,Ss.h)(ou.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}yn.LinkFlow=au;var Qs={},Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=T&&T.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Lr),n=Ke,i=an,s=e(Ks),c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",u="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class d{constructor(E){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=E.darkMode}attach(E){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",E.appendChild(this.root),this.render()}presentItem(E){const M=this.nextItemKey++;return this.items.set(M,E),this.render(),()=>{this.items.delete(M),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([E,M])=>(0,n.h)(t.SnackbarInstance,Object.assign({},M,{key:E}))))),this.root)}}t.Snackbar=d;const h=S=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},S.children));t.SnackbarContainer=h;const y=({autoExpand:S,message:E,menuItems:M})=>{const[k,x]=(0,i.useState)(!0),[O,B]=(0,i.useState)(S??!1);(0,i.useEffect)(()=>{const R=[window.setTimeout(()=>{x(!1)},1),window.setTimeout(()=>{B(!0)},1e4)];return()=>{R.forEach(window.clearTimeout)}});const L=()=>{B(!O)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",k&&"-cbwsdk-snackbar-instance-hidden",O&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:L},(0,n.h)("img",{src:c,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},E),(0,n.h)("div",{class:"-gear-container"},!O&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:u,class:"-gear-icon",title:"Expand"}))),M&&M.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},M.map((R,z)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",R.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:R.onClick,key:z},(0,n.h)("svg",{width:R.svgWidth,height:R.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":R.defaultFillRule,"clip-rule":R.defaultClipRule,d:R.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",R.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},R.info)))))};t.SnackbarInstance=y})(Qs);Object.defineProperty(Ar,"__esModule",{value:!0});Ar.WalletLinkRelayUI=void 0;const cu=Nr,lu=yn,uu=Qs;class du{constructor(e){this.standalone=null,this.attached=!1,this.snackbar=new uu.Snackbar({darkMode:e.darkMode}),this.linkFlow=new lu.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,cu.injectCssReset)()}setConnected(e){this.linkFlow.setConnected(e)}setChainId(e){this.linkFlow.setChainId(e)}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}Ar.WalletLinkRelayUI=du;Object.defineProperty(Cr,"__esModule",{value:!0});Cr.WalletLinkRelay=void 0;const Jt=Sr,hu=De,Q=A,Tt=ur,no=it,kt=dr,fu=mn,xt=cr,gu=Ar;class Et extends no.RelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=c=>{var u;this.isLinked=c;const d=this.storage.getItem(no.LOCAL_STORAGE_ADDRESSES_KEY);if(c&&(this.session.linked=c),this.isUnlinkedErrorState=!1,d){const h=d.split(" "),y=this.storage.getItem("IsStandaloneSigning")==="true";if(h[0]!==""&&!c&&this.session.linked&&!y){this.isUnlinkedErrorState=!0;const S=this.getSessionIdHash();(u=this.diagnostic)===null||u===void 0||u.log(Tt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:S})}}},this.metadataUpdated=(c,u)=>{this.storage.setItem(c,u)},this.chainUpdated=(c,u)=>{this.chainCallbackParams.chainId===c&&this.chainCallbackParams.jsonRpcUrl===u||(this.chainCallbackParams={chainId:c,jsonRpcUrl:u},this.chainCallback&&this.chainCallback(c,u))},this.accountUpdated=c=>{this.accountsCallback&&this.accountsCallback([c]),Et.accountRequestCallbackIds.size>0&&(Array.from(Et.accountRequestCallbackIds.values()).forEach(u=>{const d={type:"WEB3_RESPONSE",id:u,response:{method:"requestEthereumAccounts",result:[c]}};this.invokeCallback(Object.assign(Object.assign({},d),{id:u}))}),Et.accountRequestCallbackIds.clear())},this.connectedUpdated=c=>{this.ui.setConnected(c)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const e=kt.Session.load(this.storage)||new kt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new fu.WalletLinkConnection({session:e,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:c}=this.options,u=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:c,session:e});return i.connect(),{session:e,ui:u,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{var e,r;const n=this.ui.isStandalone();(e=this.diagnostic)===null||e===void 0||e.log(Tt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=kt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(Tt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:kt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:c,connection:u}=this.subscribe();this._session=s,this.connection=u,this.ui=c,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Tt.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Q.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Q.hexStringFromBuffer)(e,!0),signature:(0,Q.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Q.bigIntStringFromBN)(e.weiValue),data:(0,Q.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,Q.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Q.bigIntStringFromBN)(e.weiValue),data:(0,Q.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Q.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,Q.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,Q.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,Q.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Q.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getQRCodeUrl(){return(0,Q.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,Q.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,c),r==null||r()};return{promise:new Promise((c,u)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,d=>{if(r==null||r(),(0,xt.isErrorResponse)(d))return u(new Error(d.errorMessage));c(d)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e,this.ui instanceof gu.WalletLinkRelayUI&&this.ui.setChainId(e)}publishWeb3RequestEvent(e,r){var n;const i={type:"WEB3_REQUEST",id:e,request:r},s=kt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Tt.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?kt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(c=>{var u;(u=this.diagnostic)===null||u===void 0||u.log(Tt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?kt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(c=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:c.message}})})}publishWeb3RequestCanceledEvent(e){const r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(Tt.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Et.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Et.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const c=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Jt.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:c,errorCode:i}})}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Q.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,c)=>{if(this.relayEventManager.callbacks.set(r,u=>{if(this.ui.hideRequestEthereumAccounts(),(0,xt.isErrorResponse)(u))return c(new Error(u.errorMessage));s(u)}),this.ui.inlineAccountsResponse()){const u=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:d}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:u})}else{const u=Jt.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(u)})}Et.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:"selectProvider",params:{providerOptions:e}},n=(0,Q.randomBytesHex)(8),i=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,c)},s=new Promise((c,u)=>{this.relayEventManager.callbacks.set(n,y=>{if((0,xt.isErrorResponse)(y))return u(new Error(y.errorMessage));c(y)});const d=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:hu.ProviderType.Unselected}})},h=y=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:y}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:h,onCancel:d,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,c){const u={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:c}};let d=null;const h=(0,Q.randomBytesHex)(8),y=E=>{this.publishWeb3RequestCanceledEvent(h),this.handleErrorResponse(h,u.method,E),d==null||d()};this.ui.inlineWatchAsset()||(d=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:y,onResetConnection:this.resetAndReload}));const S=new Promise((E,M)=>{this.relayEventManager.callbacks.set(h,O=>{if(d==null||d(),(0,xt.isErrorResponse)(O))return M(new Error(O.errorMessage));E(O)});const k=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:h,response:{method:"watchAsset",result:!1}})},x=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:h,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:x,onCancel:k,type:e,address:r,symbol:n,decimals:i,image:s,chainId:c}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(h,u)});return{cancel:y,promise:S}}addEthereumChain(e,r,n,i,s,c){const u={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:c}};let d=null;const h=(0,Q.randomBytesHex)(8),y=E=>{this.publishWeb3RequestCanceledEvent(h),this.handleErrorResponse(h,u.method,E),d==null||d()};return this.ui.inlineAddEthereumChain(e)||(d=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:y,onResetConnection:this.resetAndReload})),{promise:new Promise((E,M)=>{this.relayEventManager.callbacks.set(h,O=>{if(d==null||d(),(0,xt.isErrorResponse)(O))return M(new Error(O.errorMessage));E(O)});const k=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:h,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},x=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:h,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:O}}})};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:k,onApprove:x,chainId:u.params.chainId,rpcUrls:u.params.rpcUrls,blockExplorerUrls:u.params.blockExplorerUrls,chainName:u.params.chainName,iconUrls:u.params.iconUrls,nativeCurrency:u.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(h,u)}),cancel:y}}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,Q.randomBytesHex)(8),s=u=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,u)};return{promise:new Promise((u,d)=>{this.relayEventManager.callbacks.set(i,S=>{if((0,xt.isErrorResponse)(S)&&S.errorCode)return d(Jt.standardErrors.provider.custom({code:S.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,xt.isErrorResponse)(S))return d(new Error(S.errorMessage));u(S)});const h=S=>{var E;if(S){const M=(E=(0,Jt.getErrorCode)(S))!==null&&E!==void 0?E:Jt.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",S instanceof Error?S:Jt.standardErrors.provider.unsupportedChain(e),M)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},y=S=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:S}}})};this.ui.switchEthereumChain({onCancel:h,onApprove:y,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return kt.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}Cr.WalletLinkRelay=Et;Et.accountRequestCallbackIds=new Set;var Tr={},Nn={},Sa={};(function(t){var e=T&&T.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s);var u=Object.getOwnPropertyDescriptor(i,s);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,c,u)}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=T&&T.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Qs,t)})(Sa);var Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Ma=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nn,"__esModule",{value:!0});Nn.RedirectDialog=void 0;const pu=Ma(Lr),mt=Ke,mu=Nr,vu=Sa,wu=Ma(Xs);class yu{constructor(){this.root=null}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,mu.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,mt.render)(null,this.root),e&&(0,mt.render)((0,mt.h)(bu,Object.assign({},e,{onDismiss:()=>{this.clear()}})),this.root))}}Nn.RedirectDialog=yu;const bu=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,mt.h)(vu.SnackbarContainer,{darkMode:r},(0,mt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,mt.h)("style",null,wu.default),(0,mt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,mt.h)("div",{class:(0,pu.default)("-cbwsdk-redirect-dialog-box",s)},(0,mt.h)("p",null,t),(0,mt.h)("button",{onClick:n},e))))};Object.defineProperty(Tr,"__esModule",{value:!0});Tr.MobileRelayUI=void 0;const _u=Nn;class Eu{constructor(e){this.attached=!1,this.darkMode=!1,this.redirectDialog=new _u.RedirectDialog,this.darkMode=e.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(e){}redirectToCoinbaseWallet(e){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),e&&r.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}Tr.MobileRelayUI=Eu;Object.defineProperty(Ir,"__esModule",{value:!0});Ir.MobileRelay=void 0;const Su=A,Mu=Cr,ku=Tr;class Ru extends Mu.WalletLinkRelay{constructor(e){var r;super(e),this._enableMobileWalletLink=(r=e.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const e=(0,Su.getLocation)();e.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(e.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(e,r){if(super.publishWeb3RequestEvent(e,r),!(this._enableMobileWalletLink&&this.ui instanceof ku.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(e){super.handleWeb3ResponseMessage(e)}connectAndSignIn(e){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:e.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:e.statement,resources:e.resources}})}}Ir.MobileRelay=Ru;const Iu=Bc,Cu=un;function ka(t){return Buffer.allocUnsafe(t).fill(0)}function Ra(t,e,r){const n=ka(e);return t=Ln(t),r?t.length"u")throw new Error("Not an array?");if(r=La(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(pt(t,e[s]));if(r==="dynamic"){var c=pt("uint256",e.length);i.unshift(c)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([pt("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,jt.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Yt(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return jt.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Yt(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=Pt(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(t.startsWith("int")){if(r=Yt(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=Pt(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=so(t),n=Pt(e),n<0)throw new Error("Supplied ufixed is negative");return pt("uint256",n.mul(new Ot(2).pow(new Ot(r[1]))))}else if(t.startsWith("fixed"))return r=so(t),pt("int256",Pt(e).mul(new Ot(2).pow(new Ot(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function xu(t){return t==="string"||t==="bytes"||La(t)==="dynamic"}function Pu(t){return t.lastIndexOf("]")===t.length-1}function $u(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var c=Na(t[s]),u=e[s],d=pt(c,u);xu(c)?(r.push(pt("uint256",i)),n.push(d),i+=d.length):r.push(d)}return Buffer.concat(r.concat(n))}function Ta(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(jt.setLengthRight(u,r))}else if(c.startsWith("uint")){if(r=Yt(c),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=Pt(u),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(c.startsWith("int")){if(r=Yt(c),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=Pt(u),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+c)}return Buffer.concat(i)}function Ou(t,e){return jt.keccak(Ta(t,e))}var Bu={rawEncode:$u,solidityPack:Ta,soliditySHA3:Ou};const lt=Aa,yr=Bu,xa={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Ms={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const c=(u,d,h)=>{if(r[d]!==void 0)return["bytes32",h==null?"0x0000000000000000000000000000000000000000000000000000000000000000":lt.keccak(this.encodeData(d,h,r,n))];if(h===void 0)throw new Error(`missing value for field ${u} of type ${d}`);if(d==="bytes")return["bytes32",lt.keccak(h)];if(d==="string")return typeof h=="string"&&(h=Buffer.from(h,"utf8")),["bytes32",lt.keccak(h)];if(d.lastIndexOf("]")===d.length-1){const y=d.slice(0,d.lastIndexOf("[")),S=h.map(E=>c(u,y,E));return["bytes32",lt.keccak(yr.rawEncode(S.map(([E])=>E),S.map(([,E])=>E)))]}return[d,h]};for(const u of r[t]){const[d,h]=c(u.name,u.type,e[u.name]);i.push(d),s.push(h)}}else for(const c of r[t]){let u=e[c.name];if(u!==void 0)if(c.type==="bytes")i.push("bytes32"),u=lt.keccak(u),s.push(u);else if(c.type==="string")i.push("bytes32"),typeof u=="string"&&(u=Buffer.from(u,"utf8")),u=lt.keccak(u),s.push(u);else if(r[c.type]!==void 0)i.push("bytes32"),u=lt.keccak(this.encodeData(c.type,u,r,n)),s.push(u);else{if(c.type.lastIndexOf("]")===c.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(c.type),s.push(u)}}return yr.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:c,type:u})=>u+" "+c).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return lt.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return lt.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in xa.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),lt.keccak(Buffer.concat(n))}};var Du={TYPED_MESSAGE_SCHEMA:xa,TypedDataUtils:Ms,hashForSignTypedDataLegacy:function(t){return ju(t.data)},hashForSignTypedData_v3:function(t){return Ms.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return Ms.hash(t.data)}};function ju(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?lt.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return yr.soliditySHA3(["bytes32","bytes32"],[yr.soliditySHA3(new Array(t.length).fill("string"),i),yr.soliditySHA3(n,r)])}var ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.filterFromParam=ir.FilterPolyfill=void 0;const Qt=De,Je=A,Fu=5*60*1e3,$t={jsonrpc:"2.0",id:0};class Hu{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Qt.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=e}async newFilter(e){const r=Pa(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Je.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,Je.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.info(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,Je.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,Je.intNumberFromHexString)(e);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,Je.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Gr())}async getFilterLogs(e){const r=(0,Je.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},$t),{method:"eth_getLogs",params:[io(n)]})):Gr()}makeFilterId(){return(0,Qt.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.info(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return Gr();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return Zr();console.info(`Fetching logs from ${n} to ${s} for filter ${e}`);const c=await this.sendAsyncPromise(Object.assign(Object.assign({},$t),{method:"eth_getLogs",params:[io(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(c.result)){const u=c.result.map(h=>(0,Je.intNumberFromHexString)(h.blockNumber||"0x0")),d=Math.max(...u);if(d&&d>n){const h=(0,Qt.IntNumber)(d+1);console.info(`Moving cursor position for filter (${e}) from ${n} to ${h}`),this.cursors.set(e,h)}}return c}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return Gr();const n=await this.getCurrentBlockHeight();if(r>n)return Zr();console.info(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,Je.range)(r,n+1).map(c=>this.getBlockHashByNumber((0,Qt.IntNumber)(c))))).filter(c=>!!c),s=(0,Qt.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},$t),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(Zr())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${e}) timed out`),this.deleteFilter(e)},Fu);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const e=new Date;if(e.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=e;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},$t),{method:"eth_blockNumber",params:[]}));return(0,Je.intNumberFromHexString)((0,Je.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},$t),{method:"eth_getBlockByNumber",params:[(0,Je.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Je.ensureHexString)(r.result.hash):null}}ir.FilterPolyfill=Hu;function Pa(t){return{fromBlock:oo(t.fromBlock),toBlock:oo(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}ir.filterFromParam=Pa;function io(t){const e={fromBlock:ao(t.fromBlock),toBlock:ao(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function oo(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Qt.IntNumber)(0);if((0,Je.isHexString)(t))return(0,Je.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function ao(t){return t==="latest"?t:(0,Je.hexStringFromIntNumber)(t)}function Gr(){return Object.assign(Object.assign({},$t),{error:{code:-32e3,message:"filter not found"}})}function Zr(){return Object.assign(Object.assign({},$t),{result:[]})}var Tn={},$a={},xn={},Ys=Uu;function Uu(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const co=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i{e.errorFirst?n.push(function(c,u){if(e.multiArgs){const d=new Array(arguments.length-1);for(let h=1;h{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=c=>typeof c=="string"?i===c:c.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):co(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?co(s,e):s}return n},xr={},Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});const Wu=ta;function lo(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function zu(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([c]=r),c instanceof Error)throw c;const u=new Error(`Unhandled error.${c?` (${c.message})`:""}`);throw u.context=c,u}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")lo(s,this,r);else{const c=s.length,u=zu(s);for(let d=0;dt+e,uo=["sync","latest"];class Ku extends Gu.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*Zu,this._usePastBlocks=e.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){uo.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return uo.map(e=>this.listenerCount(e)).reduce(Qu)}_shouldUseNewBlock(e){const r=this._currentBlock;if(!r)return!0;const n=ho(e),i=ho(r);return this._usePastBlocks&&ni}_newPotentialLatest(e){this._shouldUseNewBlock(e)&&this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}xr.BaseBlockTracker=Ku;function ho(t){return Number.parseInt(t,16)}var Oa={},Ba={},Ve={};class Da extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...c}=e,{path:u}=e,d=u.length===0?i:`At path: ${u.join(".")} -- ${i}`;super(s??d),s!=null&&(this.cause=d),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function Xu(t){return at(t)&&typeof t[Symbol.iterator]=="function"}function at(t){return typeof t=="object"&&t!=null}function fo(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function je(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Yu(t){const{done:e,value:r}=t.next();return e?void 0:r}function ed(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:c}=r,{refinement:u,message:d=`Expected a value of type \`${c}\`${u?` with refinement \`${u}\``:""}, but received: \`${je(n)}\``}=t;return{value:n,type:c,refinement:u,key:i[i.length-1],path:i,branch:s,...t,message:d}}function*Os(t,e,r,n){Xu(t)||(t=[t]);for(const i of t){const s=ed(i,e,r,n);s&&(yield s)}}function*ei(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:c=!1}=r,u={path:n,branch:i};if(s&&(t=e.coercer(t,u),c&&e.type!=="type"&&at(e.schema)&&at(t)&&!Array.isArray(t)))for(const h in t)e.schema[h]===void 0&&delete t[h];let d="valid";for(const h of e.validator(t,u))h.explanation=r.message,d="not_valid",yield[h,void 0];for(let[h,y,S]of e.entries(t,u)){const E=ei(y,S,{path:h===void 0?n:[...n,h],branch:h===void 0?i:[...i,y],coerce:s,mask:c,message:r.message});for(const M of E)M[0]?(d=M[0].refinement!=null?"not_refined":"not_valid",yield[M[0],void 0]):s&&(y=M[1],h===void 0?t=y:t instanceof Map?t.set(h,y):t instanceof Set?t.add(y):at(t)&&(y!==void 0||h in t)&&(t[h]=y))}if(d!=="not_valid")for(const h of e.refiner(t,u))h.explanation=r.message,d="not_refined",yield[h,void 0];d==="valid"&&(yield[void 0,t])}class ee{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:c=d=>d,entries:u=function*(){}}=e;this.type=r,this.schema=n,this.entries=u,this.coercer=c,i?this.validator=(d,h)=>{const y=i(d,h);return Os(y,h,this,d)}:this.validator=()=>[],s?this.refiner=(d,h)=>{const y=s(d,h);return Os(y,h,this,d)}:this.refiner=()=>[]}assert(e,r){return ja(e,this,r)}create(e,r){return Fa(e,this,r)}is(e){return ti(e,this)}mask(e,r){return Ha(e,this,r)}validate(e,r={}){return hr(e,this,r)}}function ja(t,e,r){const n=hr(t,e,{message:r});if(n[0])throw n[0]}function Fa(t,e,r){const n=hr(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Ha(t,e,r){const n=hr(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function ti(t,e){return!hr(t,e)[0]}function hr(t,e,r={}){const n=ei(t,e,r),i=Yu(n);return i[0]?[new Da(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function td(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Or(n):$r(n)}function Xe(t,e){return new ee({type:t,schema:null,validator:e})}function rd(t,e){return new ee({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function nd(t){return new ee({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function sd(t){let e;return new ee({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function id(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return Or(n);default:return $r(n)}}function od(t){const e=t instanceof ee,r=e?{...t.schema}:{...t};for(const n in r)r[n]=Ua(r[n]);return e&&t.type==="type"?Or(r):$r(r)}function ad(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];switch(t.type){case"type":return Or(n);default:return $r(n)}}function cd(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Xe(t,e)}function ld(){return Xe("any",()=>!0)}function ud(t){return new ee({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${je(e)}`}})}function dd(){return Xe("bigint",t=>typeof t=="bigint")}function hd(){return Xe("boolean",t=>typeof t=="boolean")}function fd(){return Xe("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${je(t)}`)}function gd(t){const e={},r=t.map(n=>je(n)).join();for(const n of t)e[n]=n;return new ee({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${je(n)}`}})}function pd(){return Xe("func",t=>typeof t=="function"||`Expected a function, but received: ${je(t)}`)}function md(t){return Xe("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${je(e)}`)}function vd(){return Xe("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${je(t)}`)}function wd(t){return new ee({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function yd(t){const e=je(t),r=typeof t;return new ee({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${je(n)}`}})}function bd(t,e){return new ee({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${je(r)}`}})}function ri(){return Xe("never",()=>!1)}function _d(t){return new ee({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function Ed(){return Xe("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${je(t)}`)}function $r(t){const e=t?Object.keys(t):[],r=ri();return new ee({type:"object",schema:t||null,*entries(n){if(t&&at(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return at(n)||`Expected an object, but received: ${je(n)}`},coercer(n){return at(n)?{...n}:n}})}function Ua(t){return new ee({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Sd(t,e){return new ee({type:"record",schema:null,*entries(r){if(at(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return at(r)||`Expected an object, but received: ${je(r)}`}})}function Md(){return Xe("regexp",t=>t instanceof RegExp)}function kd(t){return new ee({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${je(e)}`}})}function Va(){return Xe("string",t=>typeof t=="string"||`Expected a string, but received: ${je(t)}`)}function Rd(t){const e=ri();return new ee({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;ir.type).join(" | ");return new ee({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...c]=ei(r,s,n),[u]=c;if(u[0])for(const[d]of c)d&&i.push(d);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${je(r)}`,...i]}})}function Wa(){return Xe("unknown",()=>!0)}function ni(t,e,r){return new ee({...t,coercer:(n,i)=>ti(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function Cd(t,e,r={}){return ni(t,Wa(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&fo(n)&&fo(i)){const s={...n};let c=!1;for(const u in i)s[u]===void 0&&(s[u]=i[u],c=!0);if(c)return s}return n})}function Ad(t){return ni(t,Va(),e=>e.trim())}function Nd(t){return Ut(t,"empty",e=>{const r=za(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function za(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Ld(t,e,r={}){const{exclusive:n}=r;return Ut(t,"max",i=>n?in?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function xd(t){return Ut(t,"nonempty",e=>za(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function Pd(t,e){return Ut(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function $d(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return Ut(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:c}=s;return e<=c&&c<=r||`${n} with a size ${i} but received one with a size of \`${c}\``}else{const{length:c}=s;return e<=c&&c<=r||`${n} with a length ${i} but received one with a length of \`${c}\``}})}function Ut(t,e,r){return new ee({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),c=Os(s,i,t,n);for(const u of c)yield{...u,refinement:e}}})}const Od=Object.freeze(Object.defineProperty({__proto__:null,Struct:ee,StructError:Da,any:ld,array:ud,assert:ja,assign:td,bigint:dd,boolean:hd,coerce:ni,create:Fa,date:fd,defaulted:Cd,define:Xe,deprecated:rd,dynamic:nd,empty:Nd,enums:gd,func:pd,instance:md,integer:vd,intersection:wd,is:ti,lazy:sd,literal:yd,map:bd,mask:Ha,max:Ld,min:Td,never:ri,nonempty:xd,nullable:_d,number:Ed,object:$r,omit:id,optional:Ua,partial:od,pattern:Pd,pick:ad,record:Sd,refine:Ut,regexp:Md,set:kd,size:$d,string:Va,struct:cd,trimmed:Ad,tuple:Rd,type:Or,union:Id,unknown:Wa,validate:hr},Symbol.toStringTag,{value:"Module"})),Vt=Hs(Od);Object.defineProperty(Ve,"__esModule",{value:!0});Ve.assertExhaustive=Ve.assertStruct=Ve.assert=Ve.AssertionError=void 0;const Bd=Vt;function Dd(t){return typeof t=="object"&&t!==null&&"message"in t}function jd(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function Fd(t){const e=Dd(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function qa(t,e){return jd(t)?new t({message:e}):t({message:e})}class si extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}Ve.AssertionError=si;function Hd(t,e="Assertion failed.",r=si){if(!t)throw e instanceof Error?e:qa(r,e)}Ve.assert=Hd;function Ud(t,e,r="Assertion failed",n=si){try{(0,Bd.assert)(t,e)}catch(i){throw qa(n,`${r}: ${Fd(i)}.`)}}Ve.assertStruct=Ud;function Vd(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}Ve.assertExhaustive=Vd;var Br={};Object.defineProperty(Br,"__esModule",{value:!0});Br.base64=void 0;const Wd=Vt,zd=Ve,qd=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let c;s==="base64"?c=String.raw`[A-Za-z0-9+\/]`:((0,zd.assert)(s==="base64url"),c=String.raw`[-_A-Za-z0-9]`);let u;return i?u=new RegExp(`^(?:${c}{4})*(?:${c}{3}=|${c}{2}==)?$`,"u"):u=new RegExp(`^(?:${c}{4})*(?:${c}{2,3}|${c}{3}=|${c}{2}==)?$`,"u"),(0,Wd.pattern)(t,u)};Br.base64=qd;var W={},Dr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=Vt,r=Ve;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(h){return(0,e.is)(h,t.HexStruct)}t.isHexString=n;function i(h){return(0,e.is)(h,t.StrictHexStruct)}t.isStrictHexString=i;function s(h){(0,r.assert)(n(h),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function c(h){(0,r.assert)(i(h),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=c;function u(h){return h.startsWith("0x")?h:h.startsWith("0X")?`0x${h.substring(2)}`:`0x${h}`}t.add0x=u;function d(h){return h.startsWith("0x")||h.startsWith("0X")?h.substring(2):h}t.remove0x=d})(Dr);Object.defineProperty(W,"__esModule",{value:!0});W.createDataView=W.concatBytes=W.valueToBytes=W.stringToBytes=W.numberToBytes=W.signedBigIntToBytes=W.bigIntToBytes=W.hexToBytes=W.bytesToString=W.bytesToNumber=W.bytesToSignedBigInt=W.bytesToBigInt=W.bytesToHex=W.assertIsBytes=W.isBytes=void 0;const tt=Ve,Bs=Dr,go=48,po=58,mo=87;function Jd(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const Gd=Jd();function ii(t){return t instanceof Uint8Array}W.isBytes=ii;function fr(t){(0,tt.assert)(ii(t),"Value must be a Uint8Array.")}W.assertIsBytes=fr;function Ja(t){if(fr(t),t.length===0)return"0x";const e=Gd(),r=new Array(t.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return Pn(e)}W.bigIntToBytes=Za;function Xd(t,e){(0,tt.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function Yd(t,e){(0,tt.assert)(typeof t=="bigint","Value must be a bigint."),(0,tt.assert)(typeof e=="number","Byte length must be a number."),(0,tt.assert)(e>0,"Byte length must be greater than 0."),(0,tt.assert)(Xd(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i>=BigInt(8);return n.reverse()}W.signedBigIntToBytes=Yd;function Qa(t){(0,tt.assert)(typeof t=="number","Value must be a number."),(0,tt.assert)(t>=0,"Value must be a non-negative number."),(0,tt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return Pn(e)}W.numberToBytes=Qa;function Ka(t){return(0,tt.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}W.stringToBytes=Ka;function Xa(t){if(typeof t=="bigint")return Za(t);if(typeof t=="number")return Qa(t);if(typeof t=="string")return t.startsWith("0x")?Pn(t):Ka(t);if(ii(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}W.valueToBytes=Xa;function eh(t){const e=new Array(t.length);let r=0;for(let i=0;ie.call(r,n,i,this))}get(e){return Ge(this,ct,"f").get(e)}has(e){return Ge(this,ct,"f").has(e)}keys(){return Ge(this,ct,"f").keys()}values(){return Ge(this,ct,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}or.FrozenMap=oi;class ai{constructor(e){ft.set(this,void 0),tc(this,ft,new Set(e),"f"),Object.freeze(this)}get size(){return Ge(this,ft,"f").size}[(ft=new WeakMap,Symbol.iterator)](){return Ge(this,ft,"f")[Symbol.iterator]()}entries(){return Ge(this,ft,"f").entries()}forEach(e,r){return Ge(this,ft,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return Ge(this,ft,"f").has(e)}keys(){return Ge(this,ft,"f").keys()}values(){return Ge(this,ft,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}or.FrozenSet=ai;Object.freeze(oi);Object.freeze(oi.prototype);Object.freeze(ai);Object.freeze(ai.prototype);var rc={};Object.defineProperty(rc,"__esModule",{value:!0});var nc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.getJsonSize=t.isValidJson=t.JsonStruct=t.UnsafeJsonStruct=void 0;const e=Vt,r=Ve,n=()=>(0,e.define)("finite number",C=>(0,e.is)(C,(0,e.number)())&&Number.isFinite(C));t.UnsafeJsonStruct=(0,e.union)([(0,e.literal)(null),(0,e.boolean)(),n(),(0,e.string)(),(0,e.array)((0,e.lazy)(()=>t.UnsafeJsonStruct)),(0,e.record)((0,e.string)(),(0,e.lazy)(()=>t.UnsafeJsonStruct))]),t.JsonStruct=(0,e.define)("Json",(C,P)=>{function J(We,Qe){const H=[...Qe.validator(We,P)];return H.length>0?H:!0}try{const We=J(C,t.UnsafeJsonStruct);return We!==!0?We:J(JSON.parse(JSON.stringify(C)),t.UnsafeJsonStruct)}catch(We){return We instanceof RangeError?"Circular reference detected":!1}});function i(C){return(0,e.is)(C,t.JsonStruct)}t.isValidJson=i;function s(C){(0,r.assertStruct)(C,t.JsonStruct,"Invalid JSON value");const P=JSON.stringify(C);return new TextEncoder().encode(P).byteLength}t.getJsonSize=s,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function c(C){return(0,e.is)(C,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=c;function u(C,P){(0,r.assertStruct)(C,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",P)}t.assertIsJsonRpcNotification=u;function d(C){return(0,e.is)(C,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=d;function h(C,P){(0,r.assertStruct)(C,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",P)}t.assertIsJsonRpcRequest=h,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function y(C){return(0,e.is)(C,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=y;function S(C,P){(0,r.assertStruct)(C,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",P)}t.assertIsPendingJsonRpcResponse=S;function E(C){return(0,e.is)(C,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=E;function M(C,P){(0,r.assertStruct)(C,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",P)}t.assertIsJsonRpcResponse=M;function k(C){return(0,e.is)(C,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=k;function x(C,P){(0,r.assertStruct)(C,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",P)}t.assertIsJsonRpcSuccess=x;function O(C){return(0,e.is)(C,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=O;function B(C,P){(0,r.assertStruct)(C,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",P)}t.assertIsJsonRpcFailure=B;function L(C){return(0,e.is)(C,t.JsonRpcErrorStruct)}t.isJsonRpcError=L;function R(C,P){(0,r.assertStruct)(C,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",P)}t.assertIsJsonRpcError=R;function z(C){const{permitEmptyString:P,permitFractions:J,permitNull:We}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},C);return Y=>!!(typeof Y=="number"&&(J||Number.isInteger(Y))||typeof Y=="string"&&(P||Y.length>0)||We&&Y===null)}t.getJsonRpcIdValidator=z})(nc);var sc={};Object.defineProperty(sc,"__esModule",{value:!0});var ar={},hh=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ar,"__esModule",{value:!0});ar.createModuleLogger=ar.createProjectLogger=void 0;const fh=hh(Tc),gh=(0,fh.default)("metamask");function ph(t){return gh.extend(t)}ar.createProjectLogger=ph;function mh(t,e){return t.extend(e)}ar.createModuleLogger=mh;var ic={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(h){return Array.isArray(h)&&h.length>0}t.isNonEmptyArray=e;function r(h){return h==null}t.isNullOrUndefined=r;function n(h){return!!h&&typeof h=="object"&&!Array.isArray(h)}t.isObject=n;const i=(h,y)=>Object.hasOwnProperty.call(h,y);t.hasProperty=i,function(h){h[h.Null=4]="Null",h[h.Comma=1]="Comma",h[h.Wrapper=1]="Wrapper",h[h.True=4]="True",h[h.False=5]="False",h[h.Quote=1]="Quote",h[h.Colon=1]="Colon",h[h.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(h){if(typeof h!="object"||h===null)return!1;try{let y=h;for(;Object.getPrototypeOf(y)!==null;)y=Object.getPrototypeOf(y);return Object.getPrototypeOf(h)===y}catch{return!1}}t.isPlainObject=s;function c(h){return h.charCodeAt(0)<=127}t.isASCII=c;function u(h){var y;return h.split("").reduce((E,M)=>c(M)?E+1:E+2,0)+((y=h.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&y!==void 0?y:[]).length}t.calculateStringSize=u;function d(h){return h.toString().length}t.calculateNumberSize=d})(ic);var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.hexToBigInt=bt.hexToNumber=bt.bigIntToHex=bt.numberToHex=void 0;const er=Ve,_r=Dr,vh=t=>((0,er.assert)(typeof t=="number","Value must be a number."),(0,er.assert)(t>=0,"Value must be a non-negative number."),(0,er.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,_r.add0x)(t.toString(16)));bt.numberToHex=vh;const wh=t=>((0,er.assert)(typeof t=="bigint","Value must be a bigint."),(0,er.assert)(t>=0,"Value must be a non-negative bigint."),(0,_r.add0x)(t.toString(16)));bt.bigIntToHex=wh;const yh=t=>{(0,_r.assertIsHexString)(t);const e=parseInt(t,16);return(0,er.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};bt.hexToNumber=yh;const bh=t=>((0,_r.assertIsHexString)(t),BigInt((0,_r.add0x)(t)));bt.hexToBigInt=bh;var oc={};Object.defineProperty(oc,"__esModule",{value:!0});var ac={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,c)=>{if(!e(s))throw new Error(`"${c}" must be a non-negative integer. Received: "${s}".`)};function n(s,c){return r(s,"count"),s*c}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(ac);var cc={};Object.defineProperty(cc,"__esModule",{value:!0});var lc={},Ds={exports:{}};const _h="2.0.0",uc=256,Eh=Number.MAX_SAFE_INTEGER||9007199254740991,Sh=16,Mh=uc-6,kh=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Bn={MAX_LENGTH:uc,MAX_SAFE_COMPONENT_LENGTH:Sh,MAX_SAFE_BUILD_LENGTH:Mh,MAX_SAFE_INTEGER:Eh,RELEASE_TYPES:kh,SEMVER_SPEC_VERSION:_h,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},Rh={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},ks={};const Ih=typeof Rh=="object"&&ks&&ks.NODE_DEBUG&&/\bsemver\b/i.test(ks.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var Dn=Ih;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Bn,s=Dn;e=t.exports={};const c=e.re=[],u=e.safeRe=[],d=e.src=[],h=e.t={};let y=0;const S="[a-zA-Z0-9-]",E=[["\\s",1],["\\d",i],[S,n]],M=x=>{for(const[O,B]of E)x=x.split(`${O}*`).join(`${O}{0,${B}}`).split(`${O}+`).join(`${O}{1,${B}}`);return x},k=(x,O,B)=>{const L=M(O),R=y++;s(x,R,O),h[x]=R,d[R]=O,c[R]=new RegExp(O,B?"g":void 0),u[R]=new RegExp(L,B?"g":void 0)};k("NUMERICIDENTIFIER","0|[1-9]\\d*"),k("NUMERICIDENTIFIERLOOSE","\\d+"),k("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${S}*`),k("MAINVERSION",`(${d[h.NUMERICIDENTIFIER]})\\.(${d[h.NUMERICIDENTIFIER]})\\.(${d[h.NUMERICIDENTIFIER]})`),k("MAINVERSIONLOOSE",`(${d[h.NUMERICIDENTIFIERLOOSE]})\\.(${d[h.NUMERICIDENTIFIERLOOSE]})\\.(${d[h.NUMERICIDENTIFIERLOOSE]})`),k("PRERELEASEIDENTIFIER",`(?:${d[h.NUMERICIDENTIFIER]}|${d[h.NONNUMERICIDENTIFIER]})`),k("PRERELEASEIDENTIFIERLOOSE",`(?:${d[h.NUMERICIDENTIFIERLOOSE]}|${d[h.NONNUMERICIDENTIFIER]})`),k("PRERELEASE",`(?:-(${d[h.PRERELEASEIDENTIFIER]}(?:\\.${d[h.PRERELEASEIDENTIFIER]})*))`),k("PRERELEASELOOSE",`(?:-?(${d[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[h.PRERELEASEIDENTIFIERLOOSE]})*))`),k("BUILDIDENTIFIER",`${S}+`),k("BUILD",`(?:\\+(${d[h.BUILDIDENTIFIER]}(?:\\.${d[h.BUILDIDENTIFIER]})*))`),k("FULLPLAIN",`v?${d[h.MAINVERSION]}${d[h.PRERELEASE]}?${d[h.BUILD]}?`),k("FULL",`^${d[h.FULLPLAIN]}$`),k("LOOSEPLAIN",`[v=\\s]*${d[h.MAINVERSIONLOOSE]}${d[h.PRERELEASELOOSE]}?${d[h.BUILD]}?`),k("LOOSE",`^${d[h.LOOSEPLAIN]}$`),k("GTLT","((?:<|>)?=?)"),k("XRANGEIDENTIFIERLOOSE",`${d[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),k("XRANGEIDENTIFIER",`${d[h.NUMERICIDENTIFIER]}|x|X|\\*`),k("XRANGEPLAIN",`[v=\\s]*(${d[h.XRANGEIDENTIFIER]})(?:\\.(${d[h.XRANGEIDENTIFIER]})(?:\\.(${d[h.XRANGEIDENTIFIER]})(?:${d[h.PRERELEASE]})?${d[h.BUILD]}?)?)?`),k("XRANGEPLAINLOOSE",`[v=\\s]*(${d[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[h.XRANGEIDENTIFIERLOOSE]})(?:${d[h.PRERELEASELOOSE]})?${d[h.BUILD]}?)?)?`),k("XRANGE",`^${d[h.GTLT]}\\s*${d[h.XRANGEPLAIN]}$`),k("XRANGELOOSE",`^${d[h.GTLT]}\\s*${d[h.XRANGEPLAINLOOSE]}$`),k("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),k("COERCE",`${d[h.COERCEPLAIN]}(?:$|[^\\d])`),k("COERCEFULL",d[h.COERCEPLAIN]+`(?:${d[h.PRERELEASE]})?(?:${d[h.BUILD]})?(?:$|[^\\d])`),k("COERCERTL",d[h.COERCE],!0),k("COERCERTLFULL",d[h.COERCEFULL],!0),k("LONETILDE","(?:~>?)"),k("TILDETRIM",`(\\s*)${d[h.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",k("TILDE",`^${d[h.LONETILDE]}${d[h.XRANGEPLAIN]}$`),k("TILDELOOSE",`^${d[h.LONETILDE]}${d[h.XRANGEPLAINLOOSE]}$`),k("LONECARET","(?:\\^)"),k("CARETTRIM",`(\\s*)${d[h.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",k("CARET",`^${d[h.LONECARET]}${d[h.XRANGEPLAIN]}$`),k("CARETLOOSE",`^${d[h.LONECARET]}${d[h.XRANGEPLAINLOOSE]}$`),k("COMPARATORLOOSE",`^${d[h.GTLT]}\\s*(${d[h.LOOSEPLAIN]})$|^$`),k("COMPARATOR",`^${d[h.GTLT]}\\s*(${d[h.FULLPLAIN]})$|^$`),k("COMPARATORTRIM",`(\\s*)${d[h.GTLT]}\\s*(${d[h.LOOSEPLAIN]}|${d[h.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",k("HYPHENRANGE",`^\\s*(${d[h.XRANGEPLAIN]})\\s+-\\s+(${d[h.XRANGEPLAIN]})\\s*$`),k("HYPHENRANGELOOSE",`^\\s*(${d[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[h.XRANGEPLAINLOOSE]})\\s*$`),k("STAR","(<|>)?=?\\s*\\*"),k("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),k("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ds,Ds.exports);var jr=Ds.exports;const Ch=Object.freeze({loose:!0}),Ah=Object.freeze({}),Nh=t=>t?typeof t!="object"?Ch:t:Ah;var ci=Nh;const wo=/^[0-9]+$/,dc=(t,e)=>{const r=wo.test(t),n=wo.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:tdc(e,t);var hc={compareIdentifiers:dc,rcompareIdentifiers:Lh};const Qr=Dn,{MAX_LENGTH:yo,MAX_SAFE_INTEGER:Kr}=Bn,{safeRe:bo,t:_o}=jr,Th=ci,{compareIdentifiers:Gt}=hc;let xh=class gt{constructor(e,r){if(r=Th(r),e instanceof gt){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>yo)throw new TypeError(`version is longer than ${yo} characters`);Qr("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?bo[_o.LOOSE]:bo[_o.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Kr||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Kr||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Kr||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Gt(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Ze=xh;const Eo=Ze,Ph=(t,e,r=!1)=>{if(t instanceof Eo)return t;try{return new Eo(t,e)}catch(n){if(!r)return null;throw n}};var gr=Ph;const $h=gr,Oh=(t,e)=>{const r=$h(t,e);return r?r.version:null};var Bh=Oh;const Dh=gr,jh=(t,e)=>{const r=Dh(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var Fh=jh;const So=Ze,Hh=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new So(t instanceof So?t.version:t,r).inc(e,n,i).version}catch{return null}};var Uh=Hh;const Mo=gr,Vh=(t,e)=>{const r=Mo(t,null,!0),n=Mo(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,c=s?r:n,u=s?n:r,d=!!c.prerelease.length;if(!!u.prerelease.length&&!d)return!u.patch&&!u.minor?"major":c.patch?"patch":c.minor?"minor":"major";const y=d?"pre":"";return r.major!==n.major?y+"major":r.minor!==n.minor?y+"minor":r.patch!==n.patch?y+"patch":"prerelease"};var Wh=Vh;const zh=Ze,qh=(t,e)=>new zh(t,e).major;var Jh=qh;const Gh=Ze,Zh=(t,e)=>new Gh(t,e).minor;var Qh=Zh;const Kh=Ze,Xh=(t,e)=>new Kh(t,e).patch;var Yh=Xh;const ef=gr,tf=(t,e)=>{const r=ef(t,e);return r&&r.prerelease.length?r.prerelease:null};var rf=tf;const ko=Ze,nf=(t,e,r)=>new ko(t,r).compare(new ko(e,r));var ut=nf;const sf=ut,of=(t,e,r)=>sf(e,t,r);var af=of;const cf=ut,lf=(t,e)=>cf(t,e,!0);var uf=lf;const Ro=Ze,df=(t,e,r)=>{const n=new Ro(t,r),i=new Ro(e,r);return n.compare(i)||n.compareBuild(i)};var li=df;const hf=li,ff=(t,e)=>t.sort((r,n)=>hf(r,n,e));var gf=ff;const pf=li,mf=(t,e)=>t.sort((r,n)=>pf(n,r,e));var vf=mf;const wf=ut,yf=(t,e,r)=>wf(t,e,r)>0;var jn=yf;const bf=ut,_f=(t,e,r)=>bf(t,e,r)<0;var ui=_f;const Ef=ut,Sf=(t,e,r)=>Ef(t,e,r)===0;var fc=Sf;const Mf=ut,kf=(t,e,r)=>Mf(t,e,r)!==0;var gc=kf;const Rf=ut,If=(t,e,r)=>Rf(t,e,r)>=0;var di=If;const Cf=ut,Af=(t,e,r)=>Cf(t,e,r)<=0;var hi=Af;const Nf=fc,Lf=gc,Tf=jn,xf=di,Pf=ui,$f=hi,Of=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return Nf(t,r,n);case"!=":return Lf(t,r,n);case">":return Tf(t,r,n);case">=":return xf(t,r,n);case"<":return Pf(t,r,n);case"<=":return $f(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var pc=Of;const Bf=Ze,Df=gr,{safeRe:Xr,t:Yr}=jr,jf=(t,e)=>{if(t instanceof Bf)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?Xr[Yr.COERCEFULL]:Xr[Yr.COERCE]);else{const d=e.includePrerelease?Xr[Yr.COERCERTLFULL]:Xr[Yr.COERCERTL];let h;for(;(h=d.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||h.index+h[0].length!==r.index+r[0].length)&&(r=h),d.lastIndex=h.index+h[1].length+h[2].length;d.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",c=e.includePrerelease&&r[5]?`-${r[5]}`:"",u=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Df(`${n}.${i}.${s}${c}${u}`,e)};var Ff=jf;class Hf{constructor(){this.max=1e3,this.map=new Map}get(e){const r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}}var Uf=Hf,Rs,Io;function dt(){if(Io)return Rs;Io=1;const t=/\s+/g;class e{constructor(l,f){if(f=i(f),l instanceof e)return l.loose===!!f.loose&&l.includePrerelease===!!f.includePrerelease?l:new e(l.raw,f);if(l instanceof s)return this.raw=l.value,this.set=[[l]],this.formatted=void 0,this;if(this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease,this.raw=l.trim().replace(t," "),this.set=this.raw.split("||").map(g=>this.parseRange(g.trim())).filter(g=>g.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const g=this.set[0];if(this.set=this.set.filter(m=>!x(m[0])),this.set.length===0)this.set=[g];else if(this.set.length>1){for(const m of this.set)if(m.length===1&&O(m[0])){this.set=[m];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let l=0;l0&&(this.formatted+="||");const f=this.set[l];for(let g=0;g0&&(this.formatted+=" "),this.formatted+=f[g].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(l){const g=((this.options.includePrerelease&&M)|(this.options.loose&&k))+":"+l,m=n.get(g);if(m)return m;const w=this.options.loose,_=w?d[h.HYPHENRANGELOOSE]:d[h.HYPHENRANGE];l=l.replace(_,q(this.options.includePrerelease)),c("hyphen replace",l),l=l.replace(d[h.COMPARATORTRIM],y),c("comparator trim",l),l=l.replace(d[h.TILDETRIM],S),c("tilde trim",l),l=l.replace(d[h.CARETTRIM],E),c("caret trim",l);let p=l.split(" ").map(I=>L(I,this.options)).join(" ").split(/\s+/).map(I=>H(I,this.options));w&&(p=p.filter(I=>(c("loose invalid filter",I,this.options),!!I.match(d[h.COMPARATORLOOSE])))),c("range list",p);const a=new Map,v=p.map(I=>new s(I,this.options));for(const I of v){if(x(I))return[I];a.set(I.value,I)}a.size>1&&a.has("")&&a.delete("");const N=[...a.values()];return n.set(g,N),N}intersects(l,f){if(!(l instanceof e))throw new TypeError("a Range is required");return this.set.some(g=>B(g,f)&&l.set.some(m=>B(m,f)&&g.every(w=>m.every(_=>w.intersects(_,f)))))}test(l){if(!l)return!1;if(typeof l=="string")try{l=new u(l,this.options)}catch{return!1}for(let f=0;fo.value==="<0.0.0-0",O=o=>o.value==="",B=(o,l)=>{let f=!0;const g=o.slice();let m=g.pop();for(;f&&g.length;)f=g.every(w=>m.intersects(w,l)),m=g.pop();return f},L=(o,l)=>(c("comp",o,l),o=P(o,l),c("caret",o),o=z(o,l),c("tildes",o),o=We(o,l),c("xrange",o),o=Y(o,l),c("stars",o),o),R=o=>!o||o.toLowerCase()==="x"||o==="*",z=(o,l)=>o.trim().split(/\s+/).map(f=>C(f,l)).join(" "),C=(o,l)=>{const f=l.loose?d[h.TILDELOOSE]:d[h.TILDE];return o.replace(f,(g,m,w,_,p)=>{c("tilde",o,g,m,w,_,p);let a;return R(m)?a="":R(w)?a=`>=${m}.0.0 <${+m+1}.0.0-0`:R(_)?a=`>=${m}.${w}.0 <${m}.${+w+1}.0-0`:p?(c("replaceTilde pr",p),a=`>=${m}.${w}.${_}-${p} <${m}.${+w+1}.0-0`):a=`>=${m}.${w}.${_} <${m}.${+w+1}.0-0`,c("tilde return",a),a})},P=(o,l)=>o.trim().split(/\s+/).map(f=>J(f,l)).join(" "),J=(o,l)=>{c("caret",o,l);const f=l.loose?d[h.CARETLOOSE]:d[h.CARET],g=l.includePrerelease?"-0":"";return o.replace(f,(m,w,_,p,a)=>{c("caret",o,m,w,_,p,a);let v;return R(w)?v="":R(_)?v=`>=${w}.0.0${g} <${+w+1}.0.0-0`:R(p)?w==="0"?v=`>=${w}.${_}.0${g} <${w}.${+_+1}.0-0`:v=`>=${w}.${_}.0${g} <${+w+1}.0.0-0`:a?(c("replaceCaret pr",a),w==="0"?_==="0"?v=`>=${w}.${_}.${p}-${a} <${w}.${_}.${+p+1}-0`:v=`>=${w}.${_}.${p}-${a} <${w}.${+_+1}.0-0`:v=`>=${w}.${_}.${p}-${a} <${+w+1}.0.0-0`):(c("no pr"),w==="0"?_==="0"?v=`>=${w}.${_}.${p}${g} <${w}.${_}.${+p+1}-0`:v=`>=${w}.${_}.${p}${g} <${w}.${+_+1}.0-0`:v=`>=${w}.${_}.${p} <${+w+1}.0.0-0`),c("caret return",v),v})},We=(o,l)=>(c("replaceXRanges",o,l),o.split(/\s+/).map(f=>Qe(f,l)).join(" ")),Qe=(o,l)=>{o=o.trim();const f=l.loose?d[h.XRANGELOOSE]:d[h.XRANGE];return o.replace(f,(g,m,w,_,p,a)=>{c("xRange",o,g,m,w,_,p,a);const v=R(w),N=v||R(_),I=N||R(p),$=I;return m==="="&&$&&(m=""),a=l.includePrerelease?"-0":"",v?m===">"||m==="<"?g="<0.0.0-0":g="*":m&&$?(N&&(_=0),p=0,m===">"?(m=">=",N?(w=+w+1,_=0,p=0):(_=+_+1,p=0)):m==="<="&&(m="<",N?w=+w+1:_=+_+1),m==="<"&&(a="-0"),g=`${m+w}.${_}.${p}${a}`):N?g=`>=${w}.0.0${a} <${+w+1}.0.0-0`:I&&(g=`>=${w}.${_}.0${a} <${w}.${+_+1}.0-0`),c("xRange return",g),g})},Y=(o,l)=>(c("replaceStars",o,l),o.trim().replace(d[h.STAR],"")),H=(o,l)=>(c("replaceGTE0",o,l),o.trim().replace(d[l.includePrerelease?h.GTE0PRE:h.GTE0],"")),q=o=>(l,f,g,m,w,_,p,a,v,N,I,$)=>(R(g)?f="":R(m)?f=`>=${g}.0.0${o?"-0":""}`:R(w)?f=`>=${g}.${m}.0${o?"-0":""}`:_?f=`>=${f}`:f=`>=${f}${o?"-0":""}`,R(v)?a="":R(N)?a=`<${+v+1}.0.0-0`:R(I)?a=`<${v}.${+N+1}.0-0`:$?a=`<=${v}.${N}.${I}-${$}`:o?a=`<${v}.${N}.${+I+1}-0`:a=`<=${a}`,`${f} ${a}`.trim()),b=(o,l,f)=>{for(let g=0;g0){const m=o[g].semver;if(m.major===l.major&&m.minor===l.minor&&m.patch===l.patch)return!0}return!1}return!0};return Rs}var Is,Co;function Fn(){if(Co)return Is;Co=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(y,S){if(S=r(S),y instanceof e){if(y.loose===!!S.loose)return y;y=y.value}y=y.trim().split(/\s+/).join(" "),c("comparator",y,S),this.options=S,this.loose=!!S.loose,this.parse(y),this.semver===t?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(y){const S=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],E=y.match(S);if(!E)throw new TypeError(`Invalid comparator: ${y}`);this.operator=E[1]!==void 0?E[1]:"",this.operator==="="&&(this.operator=""),E[2]?this.semver=new u(E[2],this.options.loose):this.semver=t}toString(){return this.value}test(y){if(c("Comparator.test",y,this.options.loose),this.semver===t||y===t)return!0;if(typeof y=="string")try{y=new u(y,this.options)}catch{return!1}return s(y,this.operator,this.semver,this.options)}intersects(y,S){if(!(y instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new d(y.value,S).test(this.value):y.operator===""?y.value===""?!0:new d(this.value,S).test(y.semver):(S=r(S),S.includePrerelease&&(this.value==="<0.0.0-0"||y.value==="<0.0.0-0")||!S.includePrerelease&&(this.value.startsWith("<0.0.0")||y.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&y.operator.startsWith(">")||this.operator.startsWith("<")&&y.operator.startsWith("<")||this.semver.version===y.semver.version&&this.operator.includes("=")&&y.operator.includes("=")||s(this.semver,"<",y.semver,S)&&this.operator.startsWith(">")&&y.operator.startsWith("<")||s(this.semver,">",y.semver,S)&&this.operator.startsWith("<")&&y.operator.startsWith(">")))}}Is=e;const r=ci,{safeRe:n,t:i}=jr,s=pc,c=Dn,u=Ze,d=dt();return Is}const Vf=dt(),Wf=(t,e,r)=>{try{e=new Vf(e,r)}catch{return!1}return e.test(t)};var Hn=Wf;const zf=dt(),qf=(t,e)=>new zf(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Jf=qf;const Gf=Ze,Zf=dt(),Qf=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Zf(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||i.compare(c)===-1)&&(n=c,i=new Gf(n,r))}),n};var Kf=Qf;const Xf=Ze,Yf=dt(),e0=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Yf(e,r)}catch{return null}return t.forEach(c=>{s.test(c)&&(!n||i.compare(c)===1)&&(n=c,i=new Xf(n,r))}),n};var t0=e0;const Cs=Ze,r0=dt(),Ao=jn,n0=(t,e)=>{t=new r0(t,e);let r=new Cs("0.0.0");if(t.test(r)||(r=new Cs("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{const u=new Cs(c.semver.version);switch(c.operator){case">":u.prerelease.length===0?u.patch++:u.prerelease.push(0),u.raw=u.format();case"":case">=":(!s||Ao(u,s))&&(s=u);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${c.operator}`)}}),s&&(!r||Ao(r,s))&&(r=s)}return r&&t.test(r)?r:null};var s0=n0;const i0=dt(),o0=(t,e)=>{try{return new i0(t,e).range||"*"}catch{return null}};var a0=o0;const c0=Ze,mc=Fn(),{ANY:l0}=mc,u0=dt(),d0=Hn,No=jn,Lo=ui,h0=hi,f0=di,g0=(t,e,r,n)=>{t=new c0(t,n),e=new u0(e,n);let i,s,c,u,d;switch(r){case">":i=No,s=h0,c=Lo,u=">",d=">=";break;case"<":i=Lo,s=f0,c=No,u="<",d="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(d0(t,e,n))return!1;for(let h=0;h{M.semver===l0&&(M=new mc(">=0.0.0")),S=S||M,E=E||M,i(M.semver,S.semver,n)?S=M:c(M.semver,E.semver,n)&&(E=M)}),S.operator===u||S.operator===d||(!E.operator||E.operator===u)&&s(t,E.semver))return!1;if(E.operator===d&&c(t,E.semver))return!1}return!0};var fi=g0;const p0=fi,m0=(t,e,r)=>p0(t,e,">",r);var v0=m0;const w0=fi,y0=(t,e,r)=>w0(t,e,"<",r);var b0=y0;const To=dt(),_0=(t,e,r)=>(t=new To(t,r),e=new To(e,r),t.intersects(e,r));var E0=_0;const S0=Hn,M0=ut;var k0=(t,e,r)=>{const n=[];let i=null,s=null;const c=t.sort((y,S)=>M0(y,S,r));for(const y of c)S0(y,e,r)?(s=y,i||(i=y)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const u=[];for(const[y,S]of n)y===S?u.push(y):!S&&y===c[0]?u.push("*"):S?y===c[0]?u.push(`<=${S}`):u.push(`${y} - ${S}`):u.push(`>=${y}`);const d=u.join(" || "),h=typeof e.raw=="string"?e.raw:String(e);return d.length{if(t===e)return!0;t=new xo(t,r),e=new xo(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const c=C0(i,s,r);if(n=n||c!==null,c)continue e}if(n)return!1}return!0},I0=[new gi(">=0.0.0-0")],Po=[new gi(">=0.0.0")],C0=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===As){if(e.length===1&&e[0].semver===As)return!0;r.includePrerelease?t=I0:t=Po}if(e.length===1&&e[0].semver===As){if(r.includePrerelease)return!0;e=Po}const n=new Set;let i,s;for(const M of t)M.operator===">"||M.operator===">="?i=$o(i,M,r):M.operator==="<"||M.operator==="<="?s=Oo(s,M,r):n.add(M.semver);if(n.size>1)return null;let c;if(i&&s){if(c=pi(i.semver,s.semver,r),c>0)return null;if(c===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const M of n){if(i&&!mr(M,String(i),r)||s&&!mr(M,String(s),r))return null;for(const k of e)if(!mr(M,String(k),r))return!1;return!0}let u,d,h,y,S=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,E=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;S&&S.prerelease.length===1&&s.operator==="<"&&S.prerelease[0]===0&&(S=!1);for(const M of e){if(y=y||M.operator===">"||M.operator===">=",h=h||M.operator==="<"||M.operator==="<=",i){if(E&&M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===E.major&&M.semver.minor===E.minor&&M.semver.patch===E.patch&&(E=!1),M.operator===">"||M.operator===">="){if(u=$o(i,M,r),u===M&&u!==i)return!1}else if(i.operator===">="&&!mr(i.semver,String(M),r))return!1}if(s){if(S&&M.semver.prerelease&&M.semver.prerelease.length&&M.semver.major===S.major&&M.semver.minor===S.minor&&M.semver.patch===S.patch&&(S=!1),M.operator==="<"||M.operator==="<="){if(d=Oo(s,M,r),d===M&&d!==s)return!1}else if(s.operator==="<="&&!mr(s.semver,String(M),r))return!1}if(!M.operator&&(s||i)&&c!==0)return!1}return!(i&&h&&!s&&c!==0||s&&y&&!i&&c!==0||E||S)},$o=(t,e,r)=>{if(!t)return e;const n=pi(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Oo=(t,e,r)=>{if(!t)return e;const n=pi(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var A0=R0;const Ns=jr,Bo=Bn,N0=Ze,Do=hc,L0=gr,T0=Bh,x0=Fh,P0=Uh,$0=Wh,O0=Jh,B0=Qh,D0=Yh,j0=rf,F0=ut,H0=af,U0=uf,V0=li,W0=gf,z0=vf,q0=jn,J0=ui,G0=fc,Z0=gc,Q0=di,K0=hi,X0=pc,Y0=Ff,e1=Fn(),t1=dt(),r1=Hn,n1=Jf,s1=Kf,i1=t0,o1=s0,a1=a0,c1=fi,l1=v0,u1=b0,d1=E0,h1=k0,f1=A0;var g1={parse:L0,valid:T0,clean:x0,inc:P0,diff:$0,major:O0,minor:B0,patch:D0,prerelease:j0,compare:F0,rcompare:H0,compareLoose:U0,compareBuild:V0,sort:W0,rsort:z0,gt:q0,lt:J0,eq:G0,neq:Z0,gte:Q0,lte:K0,cmp:X0,coerce:Y0,Comparator:e1,Range:t1,satisfies:r1,toComparators:n1,maxSatisfying:s1,minSatisfying:i1,minVersion:o1,validRange:a1,outside:c1,gtr:l1,ltr:u1,intersects:d1,simplifyRange:h1,subset:f1,SemVer:N0,re:Ns.re,src:Ns.src,tokens:Ns.t,SEMVER_SPEC_VERSION:Bo.SEMVER_SPEC_VERSION,RELEASE_TYPES:Bo.RELEASE_TYPES,compareIdentifiers:Do.compareIdentifiers,rcompareIdentifiers:Do.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=g1,r=Vt,n=Ve;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",S=>(0,e.valid)(S)===null?`Expected SemVer version, got "${S}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",S=>(0,e.validRange)(S)===null?`Expected SemVer range, got "${S}"`:!0);function i(S){return(0,r.is)(S,t.VersionStruct)}t.isValidSemVerVersion=i;function s(S){return(0,r.is)(S,t.VersionRangeStruct)}t.isValidSemVerRange=s;function c(S){(0,n.assertStruct)(S,t.VersionStruct)}t.assertIsSemVerVersion=c;function u(S){(0,n.assertStruct)(S,t.VersionRangeStruct)}t.assertIsSemVerRange=u;function d(S,E){return(0,e.gt)(S,E)}t.gtVersion=d;function h(S,E){return(0,e.gtr)(S,E)}t.gtRange=h;function y(S,E){return(0,e.satisfies)(S,E,{includePrerelease:!0})}t.satisfiesVersionRange=y})(lc);(function(t){var e=T&&T.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s);var u=Object.getOwnPropertyDescriptor(i,s);(!u||("get"in u?!i.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,c,u)}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=T&&T.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ve,t),r(Br,t),r(W,t),r($n,t),r(yt,t),r(or,t),r(rc,t),r(Dr,t),r(nc,t),r(sc,t),r(ar,t),r(ic,t),r(bt,t),r(oc,t),r(ac,t),r(cc,t),r(lc,t)})(Ba);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Ba;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Oa);var vc=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xn,"__esModule",{value:!0});xn.PollingBlockTracker=void 0;const p1=vc(Ys),m1=vc(Vu),v1=xr,jo=Oa,Fo=(0,jo.createModuleLogger)(jo.projectLogger,"polling-block-tracker"),w1=(0,p1.default)(),y1=1e3;class b1 extends v1.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},e),{blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval})),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*y1,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=Ho(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: -${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Ho(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:w1(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),Fo("Making request",e);const r=await(0,m1.default)(n=>this._provider.sendAsync(e,n))();if(Fo("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: -${r.error.message}`);return r.result}}xn.PollingBlockTracker=b1;function Ho(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var Un={},_1=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Un,"__esModule",{value:!0});Un.SubscribeBlockTracker=void 0;const E1=_1(Ys),S1=xr,M1=(0,E1.default)();class k1 extends S1.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:M1(),method:e,params:r,jsonrpc:"2.0"},(s,c)=>{s?i(s):n(c.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}Un.SubscribeBlockTracker=k1;(function(t){var e=T&&T.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=T&&T.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(xn,t),r(Un,t)})($a);var mi={},Vn={},Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.getUniqueId=void 0;const wc=4294967295;let Ls=Math.floor(Math.random()*wc);function R1(){return Ls=(Ls+1)%wc,Ls}Fr.getUniqueId=R1;Object.defineProperty(Vn,"__esModule",{value:!0});Vn.createIdRemapMiddleware=void 0;const I1=Fr;function C1(){return(t,e,r,n)=>{const i=t.id,s=I1.getUniqueId();t.id=s,e.id=s,r(c=>{t.id=i,e.id=i,c()})}}Vn.createIdRemapMiddleware=C1;var Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.createAsyncMiddleware=void 0;function A1(t){return async(e,r,n,i)=>{let s;const c=new Promise(y=>{s=y});let u=null,d=!1;const h=async()=>{d=!0,n(y=>{u=y,s()}),await c};try{await t(e,r,h),d?(await c,u(null)):i(null)}catch(y){u?u(y):i(y)}}}Wn.createAsyncMiddleware=A1;var zn={};Object.defineProperty(zn,"__esModule",{value:!0});zn.createScaffoldMiddleware=void 0;function N1(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}zn.createScaffoldMiddleware=N1;var Hr={},vi={};Object.defineProperty(vi,"__esModule",{value:!0});const L1=ta;function Uo(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function T1(t){const e=t.length,r=new Array(e);for(let n=0;n0&&([c]=r),c instanceof Error)throw c;const u=new Error(`Unhandled error.${c?` (${c.message})`:""}`);throw u.context=c,u}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")Uo(s,this,r);else{const c=s.length,u=T1(s);for(let d=0;d"u"&&(n=_c()),js(t,"",0,[],void 0,0,n);var i;try{Bt.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Sc(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ft.length!==0;){var s=Ft.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function tr(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),Ft.push([n,r,e,i])):Bt.push([e,r,t]):(n[r]=t,Ft.push([n,r,e]))}function js(t,e,r,n,i,s,c){s+=1;var u;if(typeof t=="object"&&t!==null){for(u=0;uc.depthLimit){tr(sn,t,e,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){tr(sn,t,e,i);return}if(n.push(t),Array.isArray(t))for(u=0;ue?1:0}function Ec(t,e,r,n){typeof n>"u"&&(n=_c());var i=Fs(t,"",0,[],void 0,0,n)||t,s;try{Bt.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Sc(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ft.length!==0;){var c=Ft.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function Fs(t,e,r,n,i,s,c){s+=1;var u;if(typeof t=="object"&&t!==null){for(u=0;uc.depthLimit){tr(sn,t,e,i);return}if(typeof c.edgesLimit<"u"&&r+1>c.edgesLimit){tr(sn,t,e,i);return}if(n.push(t),Array.isArray(t))for(u=0;u0)for(var n=0;n=1e3&&t<=4999}function j1(t,e){if(e!=="[Circular]")return e}var wi={},At={};Object.defineProperty(At,"__esModule",{value:!0});At.errorValues=At.errorCodes=void 0;At.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};At.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=At,r=Ct,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:c(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function c(E,M=i){if(Number.isInteger(E)){const k=E.toString();if(S(e.errorValues,k))return e.errorValues[k].message;if(h(E))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return M}t.getMessageFromCode=c;function u(E){if(!Number.isInteger(E))return!1;const M=E.toString();return!!(e.errorValues[M]||h(E))}t.isValidCode=u;function d(E,{fallbackError:M=s,shouldIncludeStack:k=!1}={}){var x,O;if(!M||!Number.isInteger(M.code)||typeof M.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(E instanceof r.EthereumRpcError)return E.serialize();const B={};if(E&&typeof E=="object"&&!Array.isArray(E)&&S(E,"code")&&u(E.code)){const R=E;B.code=R.code,R.message&&typeof R.message=="string"?(B.message=R.message,S(R,"data")&&(B.data=R.data)):(B.message=c(B.code),B.data={originalError:y(E)})}else{B.code=M.code;const R=(x=E)===null||x===void 0?void 0:x.message;B.message=R&&typeof R=="string"?R:M.message,B.data={originalError:y(E)}}const L=(O=E)===null||O===void 0?void 0:O.stack;return k&&E&&L&&typeof L=="string"&&(B.stack=L),B}t.serializeError=d;function h(E){return E>=-32099&&E<=-32e3}function y(E){return E&&typeof E=="object"&&!Array.isArray(E)?Object.assign({},E):E}function S(E,M){return Object.prototype.hasOwnProperty.call(E,M)}})(wi);var qn={};Object.defineProperty(qn,"__esModule",{value:!0});qn.ethErrors=void 0;const yi=Ct,kc=wi,qe=At;qn.ethErrors={rpc:{parse:t=>nt(qe.errorCodes.rpc.parse,t),invalidRequest:t=>nt(qe.errorCodes.rpc.invalidRequest,t),invalidParams:t=>nt(qe.errorCodes.rpc.invalidParams,t),methodNotFound:t=>nt(qe.errorCodes.rpc.methodNotFound,t),internal:t=>nt(qe.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return nt(e,t)},invalidInput:t=>nt(qe.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>nt(qe.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>nt(qe.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>nt(qe.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>nt(qe.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>nt(qe.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>vr(qe.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>vr(qe.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>vr(qe.errorCodes.provider.unsupportedMethod,t),disconnected:t=>vr(qe.errorCodes.provider.disconnected,t),chainDisconnected:t=>vr(qe.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new yi.EthereumProviderError(e,r,n)}}};function nt(t,e){const[r,n]=Rc(e);return new yi.EthereumRpcError(t,r||kc.getMessageFromCode(t),n)}function vr(t,e){const[r,n]=Rc(e);return new yi.EthereumProviderError(t,r||kc.getMessageFromCode(t),n)}function Rc(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=Ct;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=wi;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=qn;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=At;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(yc);var F1=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hr,"__esModule",{value:!0});Hr.JsonRpcEngine=void 0;const H1=F1(vi),st=yc;class _t extends H1.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,c,u]=await _t._runAllMiddleware(e,r,this._middleware);return c?(await _t._runReturnHandlers(u),i(s)):n(async d=>{try{await _t._runReturnHandlers(u)}catch(h){return d(h)}return d()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const c=new st.EthereumRpcError(st.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(c,{id:void 0,jsonrpc:"2.0",error:c})}if(typeof e.method!="string"){const c=new st.EthereumRpcError(st.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(c,{id:e.id,jsonrpc:"2.0",error:c})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(c){s=c}return s&&(delete i.result,i.error||(i.error=st.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await _t._runAllMiddleware(e,r,this._middleware);if(_t._checkForCompletion(e,r,i),await _t._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,c=!1;for(const u of n)if([s,c]=await _t._runMiddleware(e,r,u,i),c)break;return[s,c,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const c=d=>{const h=d||r.error;h&&(r.error=st.serializeError(h)),s([h,!0])},u=d=>{r.error?c(r.error):(d&&(typeof d!="function"&&c(new st.EthereumRpcError(st.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof d}" for request: -${Ts(e)}`,{request:e})),i.push(d)),s([null,!1]))};try{n(e,r,u,c)}catch(d){c(d)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new st.EthereumRpcError(st.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: -${Ts(e)}`,{request:e});if(!n)throw new st.EthereumRpcError(st.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: -${Ts(e)}`,{request:e})}}Hr.JsonRpcEngine=_t;function Ts(t){return JSON.stringify(t,null,2)}var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.mergeMiddleware=void 0;const U1=Hr;function V1(t){const e=new U1.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}Jn.mergeMiddleware=V1;(function(t){var e=T&&T.__createBinding||(Object.create?function(n,i,s,c){c===void 0&&(c=s),Object.defineProperty(n,c,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,c){c===void 0&&(c=s),n[c]=i[s]}),r=T&&T.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(Vn,t),r(Wn,t),r(zn,t),r(Fr,t),r(Hr,t),r(Jn,t)})(mi);var Ic={},bi={};const _i=Hs(xc);var Gn={};Object.defineProperty(Gn,"__esModule",{value:!0});var Vo=_i,W1=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return Vo.__awaiter(this,void 0,void 0,function(){var r,n,i;return Vo.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();Gn.default=W1;Object.defineProperty(bi,"__esModule",{value:!0});var Wo=_i,z1=Gn,q1=function(){function t(){this._semaphore=new z1.default(1)}return t.prototype.acquire=function(){return Wo.__awaiter(this,void 0,void 0,function(){var e,r;return Wo.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();bi.default=q1;var Zn={};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.withTimeout=void 0;var en=_i;function J1(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return en.__awaiter(n,void 0,void 0,function(){var c,u,d;return en.__generator(this,function(h){switch(h.label){case 0:return c=!1,setTimeout(function(){c=!0,s(r)},e),[4,t.acquire()];case 1:return u=h.sent(),c?(d=Array.isArray(u)?u[1]:u,d()):i(u),[2]}})})})},runExclusive:function(i){return en.__awaiter(this,void 0,void 0,function(){var s,c;return en.__generator(this,function(u){switch(u.label){case 0:s=function(){},u.label=1;case 1:return u.trys.push([1,,7,8]),[4,this.acquire()];case 2:return c=u.sent(),Array.isArray(c)?(s=c[1],[4,i(c[0])]):[3,4];case 3:return[2,u.sent()];case 4:return s=c,[4,i()];case 5:return[2,u.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}Zn.withTimeout=J1;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=bi;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=Gn;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Zn;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(Ic);var G1=Q1,Z1=Object.prototype.hasOwnProperty;function Q1(){for(var t={},e=0;efunction(...i){const s=e.promiseModule;return new s((c,u)=>{e.multiArgs?i.push((...h)=>{e.errorFirst?h[0]?u(h):(h.shift(),c(h)):c(h)}):e.errorFirst?i.push((h,y)=>{h?u(h):c(y)}):i.push(c),Reflect.apply(t,this===r?n:this,i)})},qo=new WeakMap;var tg=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(c,u)=>{let d=qo.get(c);if(d||(d={},qo.set(c,d)),u in d)return d[u];const h=k=>typeof k=="string"||typeof u=="symbol"?u===k:k.test(u),y=Reflect.getOwnPropertyDescriptor(c,u),S=y===void 0||y.writable||y.configurable,M=(e.include?e.include.some(h):!e.exclude.some(h))&&S;return d[u]=M,M},i=new WeakMap,s=new Proxy(t,{apply(c,u,d){const h=i.get(c);if(h)return Reflect.apply(h,u,d);const y=e.excludeMain?c:zo(c,e,s,c);return i.set(c,y),Reflect.apply(y,u,d)},get(c,u){const d=c[u];if(!n(c,u)||d===Function.prototype[u])return d;const h=i.get(d);if(h)return h;if(typeof d=="function"){const y=zo(d,e,s,c);return i.set(d,y),y}return d}});return s};const rg=Pr.default;let ng=class extends rg{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var Ei=ng;const sg=Ei;let ig=class extends sg{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var og=ig,Vr={minBlockRef:ag,maxBlockRef:cg,sortBlockRefs:Si,bnToHex:lg,blockRefIsNumber:ug,hexToInt:on,incrementHexInt:dg,intToHex:Cc,unsafeRandomBytes:hg};function ag(...t){return Si(t)[0]}function cg(...t){const e=Si(t);return e[e.length-1]}function Si(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:on(e)-on(r))}function lg(t){return"0x"+t.toString(16)}function ug(t){return t&&!["earliest","latest","pending"].includes(t)}function on(t){return t==null?t:Number.parseInt(t,16)}function dg(t){if(t==null)return t;const e=on(t);return Cc(e+1)}function Cc(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function hg(t){let e="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=vg(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=mg(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),u=(await this._fetchLogs(s)).filter(d=>this.matchLog(d));this.addResults(u)}async _fetchLogs(e){return await gg(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(tn(this.params.fromBlock)>=tn(e.blockNumber)||wg(this.params.toBlock)&&tn(this.params.toBlock)<=tn(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let c=e.topics[s];if(!c)return!1;c=c.toLowerCase();let u=Array.isArray(i)?i:[i];return u.includes(null)?!0:(u=u.map(y=>y.toLowerCase()),u.includes(c))})}};var bg=yg,Mi=_g;async function _g({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=Go(e),s=Go(r)-n+1,c=Array(s).fill().map((d,h)=>n+h).map(Eg);let u=await Promise.all(c.map(d=>Mg(t,"eth_getBlockByNumber",[d,!1])));return u=u.filter(d=>d!==null),u}function Go(t){return t==null?t:Number.parseInt(t,16)}function Eg(t){return t==null?t:"0x"+t.toString(16)}function Sg(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function Mg(t,e,r){for(let n=0;n<3;n++)try{return await Sg(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const kg=Ei,Rg=Mi,{incrementHexInt:Ig}=Vr;let Cg=class extends kg{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=Ig(e),c=(await Rg({provider:this.provider,fromBlock:i,toBlock:n})).map(u=>u.hash);this.addResults(c)}};var Ag=Cg;const Ng=Ei,Lg=Mi,{incrementHexInt:Tg}=Vr;let xg=class extends Ng{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=Tg(e),i=await Lg({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const c of i)s.push(...c.transactions);this.addResults(s)}};var Pg=xg;const $g=Ic.Mutex,{createAsyncMiddleware:Og,createScaffoldMiddleware:Bg}=mi,Dg=bg,jg=Ag,Fg=Pg,{intToHex:Ac,hexToInt:xs}=Vr;var Hg=Ug;function Ug({blockTracker:t,provider:e}){let r=0,n={};const i=new $g,s=Vg({mutex:i}),c=Bg({eth_newFilter:s(Ps(d)),eth_newBlockFilter:s(Ps(h)),eth_newPendingTransactionFilter:s(Ps(y)),eth_uninstallFilter:s(nn(M)),eth_getFilterChanges:s(nn(S)),eth_getFilterLogs:s(nn(E))}),u=async({oldBlock:L,newBlock:R})=>{if(n.length===0)return;const z=await i.acquire();try{await Promise.all(Zt(n).map(async C=>{try{await C.update({oldBlock:L,newBlock:R})}catch(P){console.error(P)}}))}catch(C){console.error(C)}z()};return c.newLogFilter=d,c.newBlockFilter=h,c.newPendingTransactionFilter=y,c.uninstallFilter=M,c.getFilterChanges=S,c.getFilterLogs=E,c.destroy=()=>{O()},c;async function d(L){const R=new Dg({provider:e,params:L});return await k(R),R}async function h(){const L=new jg({provider:e});return await k(L),L}async function y(){const L=new Fg({provider:e});return await k(L),L}async function S(L){const R=xs(L),z=n[R];if(!z)throw new Error(`No filter for index "${R}"`);return z.getChangesAndClear()}async function E(L){const R=xs(L),z=n[R];if(!z)throw new Error(`No filter for index "${R}"`);let C=[];return z.type==="log"&&(C=z.getAllResults()),C}async function M(L){const R=xs(L),C=!!n[R];return C&&await x(R),C}async function k(L){const R=Zt(n).length,z=await t.getLatestBlock();await L.initialize({currentBlock:z}),r++,n[r]=L,L.id=r,L.idHex=Ac(r);const C=Zt(n).length;return B({prevFilterCount:R,newFilterCount:C}),r}async function x(L){const R=Zt(n).length;delete n[L];const z=Zt(n).length;B({prevFilterCount:R,newFilterCount:z})}async function O(){const L=Zt(n).length;n={},B({prevFilterCount:L,newFilterCount:0})}function B({prevFilterCount:L,newFilterCount:R}){if(L===0&&R>0){t.on("sync",u);return}if(L>0&&R===0){t.removeListener("sync",u);return}}}function Ps(t){return nn(async(...e)=>{const r=await t(...e);return Ac(r.id)})}function nn(t){return Og(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function Vg({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function Zt(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const Wg=Pr.default,{createAsyncMiddleware:Zo,createScaffoldMiddleware:zg}=mi,qg=Hg,{unsafeRandomBytes:Jg,incrementHexInt:Gg}=Vr,Zg=Mi;var Qg=Kg;function Kg({blockTracker:t,provider:e}){const r={},n=qg({blockTracker:t,provider:e});let i=!1;const s=new Wg,c=zg({eth_subscribe:Zo(u),eth_unsubscribe:Zo(d)});return c.destroy=y,{events:s,middleware:c};async function u(S,E){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const M=S.params[0],k=Jg(16);let x;switch(M){case"newHeads":x=O({subId:k});break;case"logs":const L=S.params[1],R=await n.newLogFilter(L);x=B({subId:k,filter:R});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${M}"`)}r[k]=x,E.result=k;return;function O({subId:L}){const R={type:M,destroy:async()=>{t.removeListener("sync",R.update)},update:async({oldBlock:z,newBlock:C})=>{const P=C,J=Gg(z);(await Zg({provider:e,fromBlock:J,toBlock:P})).map(Xg).filter(Y=>Y!==null).forEach(Y=>{h(L,Y)})}};return t.on("sync",R.update),R}function B({subId:L,filter:R}){return R.on("update",C=>h(L,C)),{type:M,destroy:async()=>await n.uninstallFilter(R.idHex)}}}async function d(S,E){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const M=S.params[0],k=r[M];if(!k){E.result=!1;return}delete r[M],await k.destroy(),E.result=!0}function h(S,E){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:S,result:E}})}function y(){s.removeAllListeners();for(const S in r)r[S].destroy(),delete r[S];i=!0}}function Xg(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(Tn,"__esModule",{value:!0});Tn.SubscriptionManager=void 0;const Yg=$a,ep=Qg,Qo=()=>{};class tp{constructor(e){const r=new Yg.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=ep({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,Qo,Qo),r}destroy(){this.subscriptionMiddleware.destroy()}}Tn.SubscriptionManager=tp;var Nc=T&&T.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(rr,"__esModule",{value:!0});rr.CoinbaseWalletProvider=void 0;const rp=Nc(un),np=Dc,U=Sr,j=A,sp=Ir,Ko=it,rn=dr,Ye=cr,$s=Nc(Du),wr=ur,ip=ir,op=Tn,Xo="DefaultChainId",Yo="DefaultJsonRpcUrl";class ap extends np.EventEmitter{constructor(e){var r,n;super(),this._filterPolyfill=new ip.FilterPolyfill(this),this._subscriptionManager=new op.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl;const i=this.getChainId(),s=(0,j.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const c=this._storage.getItem(Ko.LOCAL_STORAGE_ADDRESSES_KEY);if(c){const u=c.split(" ");u[0]!==""&&(this._addresses=u.map(d=>(0,j.ensureAddressString)(d)),this.emit("accountsChanged",u))}this._subscriptionManager.events.on("notification",u=>{this.emit("message",{type:u.method,data:u.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",u=>{var d;if(!(u.origin!==location.origin||u.source!==window)&&u.data.type==="walletLinkMessage"&&u.data.data.action==="dappChainSwitched"){const h=u.data.data.chainId,y=(d=u.data.data.jsonRpcUrl)!==null&&d!==void 0?d:this.jsonRpcUrl;this.updateProviderInfo(y,Number(h))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,j.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Yo))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(Yo,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(Xo,r.toString(10)),((0,j.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,c){const d=await(await this.initializeRelay()).watchAsset(e,r,n,i,s,c==null?void 0:c.toString()).promise;return(0,Ye.isErrorResponse)(d)?!1:!!d.result}async addEthereumChain(e,r,n,i,s,c){var u,d;if((0,j.ensureIntNumber)(e)===this.getChainId())return!1;const h=await this.initializeRelay(),y=h.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!y&&await h.requestEthereumAccounts().promise;const S=await h.addEthereumChain(e.toString(),r,s,n,i,c).promise;return(0,Ye.isErrorResponse)(S)?!1:(((u=S.result)===null||u===void 0?void 0:u.isApproved)===!0&&this.updateProviderInfo(r[0],e),((d=S.result)===null||d===void 0?void 0:d.isApproved)===!0)}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,Ye.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===U.standardErrorCodes.provider.unsupportedChain?U.standardErrors.provider.unsupportedChain():U.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(wr.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?rn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,U.serializeError)(i,e)})}catch(n){throw(0,U.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],c={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(c).then(u=>u.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,U.serializeError)(n,e)})}catch(n){return Promise.reject((0,U.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,U.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,U.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw U.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw U.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw U.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){const n=await(await this.initializeRelay()).scanQRCode((0,j.ensureRegExpString)(e)).promise;if((0,Ye.isErrorResponse)(n))throw(0,U.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,U.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(e,r){const i=await(await this.initializeRelay()).genericRequest(e,r).promise;if((0,Ye.isErrorResponse)(i))throw(0,U.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,U.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(e){var r;(r=this.diagnostic)===null||r===void 0||r.log(wr.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?rn.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof sp.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(e).promise,(0,Ye.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?U.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(e){const n=await(await this.initializeRelay()).selectProvider(e).promise;if((0,Ye.isErrorResponse)(n))throw(0,U.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,U.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,j.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Ko.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(u=>r(Object.assign(Object.assign({},u),{id:e.id}))).catch(u=>n(u));return}const c=this._handleSubscriptionMethods(e);if(c!==void 0){c.then(u=>r({jsonrpc:"2.0",id:e.id,result:u.result})).catch(u=>n(u));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl).catch(s=>{var c;throw(s.code===U.standardErrorCodes.rpc.methodNotFound||s.code===U.standardErrorCodes.rpc.methodNotSupported)&&((c=this.diagnostic)===null||c===void 0||c.log(wr.EVENTS.METHOD_NOT_IMPLEMENTED,{method:e.method,sessionIdHash:this._relay?rn.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,j.ensureAddressString)(e);return this._addresses.map(i=>(0,j.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(wr.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,j.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,j.ensureAddressString)(e.to):null,i=e.value!=null?(0,j.ensureBN)(e.value):new rp.default(0),s=e.data?(0,j.ensureBuffer)(e.data):Buffer.alloc(0),c=e.nonce!=null?(0,j.ensureIntNumber)(e.nonce):null,u=e.gasPrice!=null?(0,j.ensureBN)(e.gasPrice):null,d=e.maxFeePerGas!=null?(0,j.ensureBN)(e.maxFeePerGas):null,h=e.maxPriorityFeePerGas!=null?(0,j.ensureBN)(e.maxPriorityFeePerGas):null,y=e.gas!=null?(0,j.ensureBN)(e.gas):null,S=e.chainId?(0,j.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:c,gasPriceInWei:u,maxFeePerGas:d,maxPriorityFeePerGas:h,gasLimit:y,chainId:S}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw U.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw U.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{const c=await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise;if((0,Ye.isErrorResponse)(c))throw new Error(c.errorMessage);return{jsonrpc:"2.0",id:0,result:c.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?U.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise;if((0,Ye.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,j.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(Xo);if(!e)return(0,j.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,j.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(wr.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?rn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,Ye.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?U.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,j.ensureAddressString)(e[0]),n=(0,j.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,j.ensureBuffer)(e[0]),n=(0,j.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,j.ensureBuffer)(e[0]),n=(0,j.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,j.ensureBuffer)(e[0]),n=(0,j.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,Ye.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?U.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,j.ensureBuffer)(e[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,Ye.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,Ye.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?U.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,j.ensureParsedJSONObject)(e[0]),n=(0,j.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=$s.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,j.ensureAddressString)(e[0]),n=(0,j.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=$s.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,j.ensureAddressString)(e[0]),n=(0,j.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=$s.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,s;const c=e[0];if(((r=c.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!c.chainName||c.chainName.trim()==="")throw U.standardErrors.rpc.invalidParams("chainName is a required field");if(!c.nativeCurrency)throw U.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const u=parseInt(c.chainId,16);return await this.addEthereumChain(u,(n=c.rpcUrls)!==null&&n!==void 0?n:[],(i=c.blockExplorerUrls)!==null&&i!==void 0?i:[],c.chainName,(s=c.iconUrls)!==null&&s!==void 0?s:[],c.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw U.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw U.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw U.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw U.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:c,decimals:u}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,u,c,n)}}_eth_uninstallFilter(e){const r=(0,j.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const r=(0,j.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,j.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}rr.CoinbaseWalletProvider=ap;var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.RelayEventManager=void 0;const cp=A;class lp{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,cp.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}Qn.RelayEventManager=lp;Object.defineProperty(br,"__esModule",{value:!0});br.CoinbaseWalletSDK=void 0;const up=cn,dp=ln,ea=A,hp=pn,fp=rr,gp=Ir,pp=Tr,mp=Qn,vp=Ar,wp=Cr,Lc=lr;class Kn{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||dp.LINK_API_URL;typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const c=new URL(s),u=`${c.protocol}//${c.host}`;if(this._storage=new hp.ScopedLocalStorage(`-walletlink:${u}`),this._storage.setItem("version",Kn.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new mp.RelayEventManager;const d=(0,ea.isMobileWeb)(),h=e.uiConstructor||(S=>d?new pp.MobileRelayUI(S):new vp.WalletLinkRelayUI(S)),y={linkAPIUrl:s,version:Lc.LIB_VERSION,darkMode:!!e.darkMode,headlessMode:!!e.headlessMode,uiConstructor:h,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:e.enableMobileWalletLink};this._relay=d?new gp.MobileRelay(y):new wp.WalletLinkRelay(y),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI()}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new fp.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,ea.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,up.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}br.CoinbaseWalletSDK=Kn;Kn.VERSION=Lc.LIB_VERSION;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=br,r=rr;var n=br;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=rr;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(ra);const yp=Pc(ra),Pp=Object.freeze(Object.defineProperty({__proto__:null,default:yp},Symbol.toStringTag,{value:"Module"}));export{Pp as i}; diff --git a/buddybook/assets/index-CRce2FXR.js b/buddybook/assets/index-CRce2FXR.js new file mode 100644 index 0000000..9a30e0e --- /dev/null +++ b/buddybook/assets/index-CRce2FXR.js @@ -0,0 +1,7 @@ +import{E as xo,f as Q,j as Zr,p as ii,q as su,r as ou,h as au}from"./index-Cye4tEiE.js";import{r as Ws,i as vt}from"./inherits_browser-DKXdsDax.js";import{p as cu,a as lu}from"./hooks.module-D0gf0yJl.js";import{e as si}from"./events-EbrwmdBG.js";const uu=Object.freeze(Object.defineProperty({__proto__:null,EventEmitter:xo,default:xo},Symbol.toStringTag,{value:"Module"}));var ac={},hn={},oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.walletLogo=void 0;const hu=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};oi.walletLogo=hu;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.LINK_API_URL=void 0;ai.LINK_API_URL="https://www.walletlink.org";var q={},Vs={exports:{}};Vs.exports;(function(e){(function(t,r){function n(S,o){if(!S)throw new Error(o||"Assertion failed")}function i(S,o){S.super_=o;var u=function(){};u.prototype=o.prototype,S.prototype=new u,S.prototype.constructor=S}function s(S,o,u){if(s.isBN(S))return S;this.negative=0,this.words=null,this.length=0,this.red=null,S!==null&&((o==="le"||o==="be")&&(u=o,o=10),this._init(S||0,o||10,u||"be"))}typeof t=="object"?t.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=Ws.Buffer}catch{}s.isBN=function(o){return o instanceof s?!0:o!==null&&typeof o=="object"&&o.constructor.wordSize===s.wordSize&&Array.isArray(o.words)},s.max=function(o,u){return o.cmp(u)>0?o:u},s.min=function(o,u){return o.cmp(u)<0?o:u},s.prototype._init=function(o,u,f){if(typeof o=="number")return this._initNumber(o,u,f);if(typeof o=="object")return this._initArray(o,u,f);u==="hex"&&(u=16),n(u===(u|0)&&u>=2&&u<=36),o=o.toString().replace(/\s+/g,"");var p=0;o[0]==="-"&&(p++,this.negative=1),p=0;p-=3)E=o[p]|o[p-1]<<8|o[p-2]<<16,this.words[v]|=E<>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);else if(f==="le")for(p=0,v=0;p>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);return this._strip()};function l(S,o){var u=S.charCodeAt(o);if(u>=48&&u<=57)return u-48;if(u>=65&&u<=70)return u-55;if(u>=97&&u<=102)return u-87;n(!1,"Invalid character in "+S)}function d(S,o,u){var f=l(S,u);return u-1>=o&&(f|=l(S,u-1)<<4),f}s.prototype._parseHex=function(o,u,f){this.length=Math.ceil((o.length-u)/6),this.words=new Array(this.length);for(var p=0;p=u;p-=2)k=d(o,u,p)<=18?(v-=18,E+=1,this.words[E]|=k>>>26):v+=8;else{var g=o.length-u;for(p=g%2===0?u+1:u;p=18?(v-=18,E+=1,this.words[E]|=k>>>26):v+=8}this._strip()};function h(S,o,u,f){for(var p=0,v=0,E=Math.min(S.length,u),k=o;k=49?v=g-49+10:g>=17?v=g-17+10:v=g,n(g>=0&&v1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=R}catch{s.prototype.inspect=R}else s.prototype.inspect=R;function R(){return(this.red?""}var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],x=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(o,u){o=o||10,u=u|0||1;var f;if(o===16||o==="hex"){f="";for(var p=0,v=0,E=0;E>>24-p&16777215,p+=2,p>=26&&(p-=26,E--),v!==0||E!==this.length-1?f=y[6-g.length]+g+f:f=g+f}for(v!==0&&(f=v.toString(16)+f);f.length%u!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}if(o===(o|0)&&o>=2&&o<=36){var c=C[o],w=x[o];f="";var U=this.clone();for(U.negative=0;!U.isZero();){var H=U.modrn(w).toString(o);U=U.idivn(w),U.isZero()?f=H+f:f=y[c-H.length]+H+f}for(this.isZero()&&(f="0"+f);f.length%u!==0;)f="0"+f;return this.negative!==0&&(f="-"+f),f}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var o=this.words[0];return this.length===2?o+=this.words[1]*67108864:this.length===3&&this.words[2]===1?o+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-o:o},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(o,u){return this.toArrayLike(a,o,u)}),s.prototype.toArray=function(o,u){return this.toArrayLike(Array,o,u)};var B=function(o,u){return o.allocUnsafe?o.allocUnsafe(u):new o(u)};s.prototype.toArrayLike=function(o,u,f){this._strip();var p=this.byteLength(),v=f||Math.max(1,p);n(p<=v,"byte array longer than desired length"),n(v>0,"Requested array length <= 0");var E=B(o,v),k=u==="le"?"LE":"BE";return this["_toArrayLike"+k](E,p),E},s.prototype._toArrayLikeLE=function(o,u){for(var f=0,p=0,v=0,E=0;v>8&255),f>16&255),E===6?(f>24&255),p=0,E=0):(p=k>>>24,E+=2)}if(f=0&&(o[f--]=k>>8&255),f>=0&&(o[f--]=k>>16&255),E===6?(f>=0&&(o[f--]=k>>24&255),p=0,E=0):(p=k>>>24,E+=2)}if(f>=0)for(o[f--]=p;f>=0;)o[f--]=0},Math.clz32?s.prototype._countBits=function(o){return 32-Math.clz32(o)}:s.prototype._countBits=function(o){var u=o,f=0;return u>=4096&&(f+=13,u>>>=13),u>=64&&(f+=7,u>>>=7),u>=8&&(f+=4,u>>>=4),u>=2&&(f+=2,u>>>=2),f+u},s.prototype._zeroBits=function(o){if(o===0)return 26;var u=o,f=0;return u&8191||(f+=13,u>>>=13),u&127||(f+=7,u>>>=7),u&15||(f+=4,u>>>=4),u&3||(f+=2,u>>>=2),u&1||f++,f},s.prototype.bitLength=function(){var o=this.words[this.length-1],u=this._countBits(o);return(this.length-1)*26+u};function O(S){for(var o=new Array(S.bitLength()),u=0;u>>p&1}return o}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var o=0,u=0;uo.length?this.clone().ior(o):o.clone().ior(this)},s.prototype.uor=function(o){return this.length>o.length?this.clone().iuor(o):o.clone().iuor(this)},s.prototype.iuand=function(o){var u;this.length>o.length?u=o:u=this;for(var f=0;fo.length?this.clone().iand(o):o.clone().iand(this)},s.prototype.uand=function(o){return this.length>o.length?this.clone().iuand(o):o.clone().iuand(this)},s.prototype.iuxor=function(o){var u,f;this.length>o.length?(u=this,f=o):(u=o,f=this);for(var p=0;po.length?this.clone().ixor(o):o.clone().ixor(this)},s.prototype.uxor=function(o){return this.length>o.length?this.clone().iuxor(o):o.clone().iuxor(this)},s.prototype.inotn=function(o){n(typeof o=="number"&&o>=0);var u=Math.ceil(o/26)|0,f=o%26;this._expand(u),f>0&&u--;for(var p=0;p0&&(this.words[p]=~this.words[p]&67108863>>26-f),this._strip()},s.prototype.notn=function(o){return this.clone().inotn(o)},s.prototype.setn=function(o,u){n(typeof o=="number"&&o>=0);var f=o/26|0,p=o%26;return this._expand(f+1),u?this.words[f]=this.words[f]|1<o.length?(f=this,p=o):(f=o,p=this);for(var v=0,E=0;E>>26;for(;v!==0&&E>>26;if(this.length=f.length,v!==0)this.words[this.length]=v,this.length++;else if(f!==this)for(;Eo.length?this.clone().iadd(o):o.clone().iadd(this)},s.prototype.isub=function(o){if(o.negative!==0){o.negative=0;var u=this.iadd(o);return o.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(o),this.negative=1,this._normSign();var f=this.cmp(o);if(f===0)return this.negative=0,this.length=1,this.words[0]=0,this;var p,v;f>0?(p=this,v=o):(p=o,v=this);for(var E=0,k=0;k>26,this.words[k]=u&67108863;for(;E!==0&&k>26,this.words[k]=u&67108863;if(E===0&&k>>26,U=g&67108863,H=Math.min(c,o.length-1),V=Math.max(0,c-S.length+1);V<=H;V++){var A=c-V|0;p=S.words[A]|0,v=o.words[V]|0,E=p*v+U,w+=E/67108864|0,U=E&67108863}u.words[c]=U|0,g=w|0}return g!==0?u.words[c]=g|0:u.length--,u._strip()}var T=function(o,u,f){var p=o.words,v=u.words,E=f.words,k=0,g,c,w,U=p[0]|0,H=U&8191,V=U>>>13,A=p[1]|0,I=A&8191,$=A>>>13,K=p[2]|0,G=K&8191,b=K>>>13,_=p[3]|0,P=_&8191,j=_>>>13,ue=p[4]|0,J=ue&8191,Y=ue>>>13,at=p[5]|0,he=at&8191,pe=at>>>13,Ht=p[6]|0,ge=Ht&8191,de=Ht>>>13,xt=p[7]|0,fe=xt&8191,le=xt>>>13,nt=p[8]|0,ce=nt&8191,me=nt>>>13,wr=p[9]|0,ve=wr&8191,be=wr>>>13,_r=v[0]|0,we=_r&8191,_e=_r>>>13,yr=v[1]|0,ye=yr&8191,Ee=yr>>>13,Er=v[2]|0,Se=Er&8191,Re=Er>>>13,Sr=v[3]|0,Me=Sr&8191,ke=Sr>>>13,Rr=v[4]|0,Ce=Rr&8191,Ie=Rr>>>13,Mr=v[5]|0,xe=Mr&8191,Ae=Mr>>>13,kr=v[6]|0,Te=kr&8191,Ne=kr>>>13,Cr=v[7]|0,Le=Cr&8191,Oe=Cr>>>13,Ir=v[8]|0,Pe=Ir&8191,$e=Ir>>>13,xr=v[9]|0,Be=xr&8191,De=xr>>>13;f.negative=o.negative^u.negative,f.length=19,g=Math.imul(H,we),c=Math.imul(H,_e),c=c+Math.imul(V,we)|0,w=Math.imul(V,_e);var Ut=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,g=Math.imul(I,we),c=Math.imul(I,_e),c=c+Math.imul($,we)|0,w=Math.imul($,_e),g=g+Math.imul(H,ye)|0,c=c+Math.imul(H,Ee)|0,c=c+Math.imul(V,ye)|0,w=w+Math.imul(V,Ee)|0;var Wt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(Wt>>>26)|0,Wt&=67108863,g=Math.imul(G,we),c=Math.imul(G,_e),c=c+Math.imul(b,we)|0,w=Math.imul(b,_e),g=g+Math.imul(I,ye)|0,c=c+Math.imul(I,Ee)|0,c=c+Math.imul($,ye)|0,w=w+Math.imul($,Ee)|0,g=g+Math.imul(H,Se)|0,c=c+Math.imul(H,Re)|0,c=c+Math.imul(V,Se)|0,w=w+Math.imul(V,Re)|0;var Vt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(Vt>>>26)|0,Vt&=67108863,g=Math.imul(P,we),c=Math.imul(P,_e),c=c+Math.imul(j,we)|0,w=Math.imul(j,_e),g=g+Math.imul(G,ye)|0,c=c+Math.imul(G,Ee)|0,c=c+Math.imul(b,ye)|0,w=w+Math.imul(b,Ee)|0,g=g+Math.imul(I,Se)|0,c=c+Math.imul(I,Re)|0,c=c+Math.imul($,Se)|0,w=w+Math.imul($,Re)|0,g=g+Math.imul(H,Me)|0,c=c+Math.imul(H,ke)|0,c=c+Math.imul(V,Me)|0,w=w+Math.imul(V,ke)|0;var zt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(zt>>>26)|0,zt&=67108863,g=Math.imul(J,we),c=Math.imul(J,_e),c=c+Math.imul(Y,we)|0,w=Math.imul(Y,_e),g=g+Math.imul(P,ye)|0,c=c+Math.imul(P,Ee)|0,c=c+Math.imul(j,ye)|0,w=w+Math.imul(j,Ee)|0,g=g+Math.imul(G,Se)|0,c=c+Math.imul(G,Re)|0,c=c+Math.imul(b,Se)|0,w=w+Math.imul(b,Re)|0,g=g+Math.imul(I,Me)|0,c=c+Math.imul(I,ke)|0,c=c+Math.imul($,Me)|0,w=w+Math.imul($,ke)|0,g=g+Math.imul(H,Ce)|0,c=c+Math.imul(H,Ie)|0,c=c+Math.imul(V,Ce)|0,w=w+Math.imul(V,Ie)|0;var qt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(qt>>>26)|0,qt&=67108863,g=Math.imul(he,we),c=Math.imul(he,_e),c=c+Math.imul(pe,we)|0,w=Math.imul(pe,_e),g=g+Math.imul(J,ye)|0,c=c+Math.imul(J,Ee)|0,c=c+Math.imul(Y,ye)|0,w=w+Math.imul(Y,Ee)|0,g=g+Math.imul(P,Se)|0,c=c+Math.imul(P,Re)|0,c=c+Math.imul(j,Se)|0,w=w+Math.imul(j,Re)|0,g=g+Math.imul(G,Me)|0,c=c+Math.imul(G,ke)|0,c=c+Math.imul(b,Me)|0,w=w+Math.imul(b,ke)|0,g=g+Math.imul(I,Ce)|0,c=c+Math.imul(I,Ie)|0,c=c+Math.imul($,Ce)|0,w=w+Math.imul($,Ie)|0,g=g+Math.imul(H,xe)|0,c=c+Math.imul(H,Ae)|0,c=c+Math.imul(V,xe)|0,w=w+Math.imul(V,Ae)|0;var Jt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(Jt>>>26)|0,Jt&=67108863,g=Math.imul(ge,we),c=Math.imul(ge,_e),c=c+Math.imul(de,we)|0,w=Math.imul(de,_e),g=g+Math.imul(he,ye)|0,c=c+Math.imul(he,Ee)|0,c=c+Math.imul(pe,ye)|0,w=w+Math.imul(pe,Ee)|0,g=g+Math.imul(J,Se)|0,c=c+Math.imul(J,Re)|0,c=c+Math.imul(Y,Se)|0,w=w+Math.imul(Y,Re)|0,g=g+Math.imul(P,Me)|0,c=c+Math.imul(P,ke)|0,c=c+Math.imul(j,Me)|0,w=w+Math.imul(j,ke)|0,g=g+Math.imul(G,Ce)|0,c=c+Math.imul(G,Ie)|0,c=c+Math.imul(b,Ce)|0,w=w+Math.imul(b,Ie)|0,g=g+Math.imul(I,xe)|0,c=c+Math.imul(I,Ae)|0,c=c+Math.imul($,xe)|0,w=w+Math.imul($,Ae)|0,g=g+Math.imul(H,Te)|0,c=c+Math.imul(H,Ne)|0,c=c+Math.imul(V,Te)|0,w=w+Math.imul(V,Ne)|0;var Gt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(Gt>>>26)|0,Gt&=67108863,g=Math.imul(fe,we),c=Math.imul(fe,_e),c=c+Math.imul(le,we)|0,w=Math.imul(le,_e),g=g+Math.imul(ge,ye)|0,c=c+Math.imul(ge,Ee)|0,c=c+Math.imul(de,ye)|0,w=w+Math.imul(de,Ee)|0,g=g+Math.imul(he,Se)|0,c=c+Math.imul(he,Re)|0,c=c+Math.imul(pe,Se)|0,w=w+Math.imul(pe,Re)|0,g=g+Math.imul(J,Me)|0,c=c+Math.imul(J,ke)|0,c=c+Math.imul(Y,Me)|0,w=w+Math.imul(Y,ke)|0,g=g+Math.imul(P,Ce)|0,c=c+Math.imul(P,Ie)|0,c=c+Math.imul(j,Ce)|0,w=w+Math.imul(j,Ie)|0,g=g+Math.imul(G,xe)|0,c=c+Math.imul(G,Ae)|0,c=c+Math.imul(b,xe)|0,w=w+Math.imul(b,Ae)|0,g=g+Math.imul(I,Te)|0,c=c+Math.imul(I,Ne)|0,c=c+Math.imul($,Te)|0,w=w+Math.imul($,Ne)|0,g=g+Math.imul(H,Le)|0,c=c+Math.imul(H,Oe)|0,c=c+Math.imul(V,Le)|0,w=w+Math.imul(V,Oe)|0;var Zt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,g=Math.imul(ce,we),c=Math.imul(ce,_e),c=c+Math.imul(me,we)|0,w=Math.imul(me,_e),g=g+Math.imul(fe,ye)|0,c=c+Math.imul(fe,Ee)|0,c=c+Math.imul(le,ye)|0,w=w+Math.imul(le,Ee)|0,g=g+Math.imul(ge,Se)|0,c=c+Math.imul(ge,Re)|0,c=c+Math.imul(de,Se)|0,w=w+Math.imul(de,Re)|0,g=g+Math.imul(he,Me)|0,c=c+Math.imul(he,ke)|0,c=c+Math.imul(pe,Me)|0,w=w+Math.imul(pe,ke)|0,g=g+Math.imul(J,Ce)|0,c=c+Math.imul(J,Ie)|0,c=c+Math.imul(Y,Ce)|0,w=w+Math.imul(Y,Ie)|0,g=g+Math.imul(P,xe)|0,c=c+Math.imul(P,Ae)|0,c=c+Math.imul(j,xe)|0,w=w+Math.imul(j,Ae)|0,g=g+Math.imul(G,Te)|0,c=c+Math.imul(G,Ne)|0,c=c+Math.imul(b,Te)|0,w=w+Math.imul(b,Ne)|0,g=g+Math.imul(I,Le)|0,c=c+Math.imul(I,Oe)|0,c=c+Math.imul($,Le)|0,w=w+Math.imul($,Oe)|0,g=g+Math.imul(H,Pe)|0,c=c+Math.imul(H,$e)|0,c=c+Math.imul(V,Pe)|0,w=w+Math.imul(V,$e)|0;var Kt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(Kt>>>26)|0,Kt&=67108863,g=Math.imul(ve,we),c=Math.imul(ve,_e),c=c+Math.imul(be,we)|0,w=Math.imul(be,_e),g=g+Math.imul(ce,ye)|0,c=c+Math.imul(ce,Ee)|0,c=c+Math.imul(me,ye)|0,w=w+Math.imul(me,Ee)|0,g=g+Math.imul(fe,Se)|0,c=c+Math.imul(fe,Re)|0,c=c+Math.imul(le,Se)|0,w=w+Math.imul(le,Re)|0,g=g+Math.imul(ge,Me)|0,c=c+Math.imul(ge,ke)|0,c=c+Math.imul(de,Me)|0,w=w+Math.imul(de,ke)|0,g=g+Math.imul(he,Ce)|0,c=c+Math.imul(he,Ie)|0,c=c+Math.imul(pe,Ce)|0,w=w+Math.imul(pe,Ie)|0,g=g+Math.imul(J,xe)|0,c=c+Math.imul(J,Ae)|0,c=c+Math.imul(Y,xe)|0,w=w+Math.imul(Y,Ae)|0,g=g+Math.imul(P,Te)|0,c=c+Math.imul(P,Ne)|0,c=c+Math.imul(j,Te)|0,w=w+Math.imul(j,Ne)|0,g=g+Math.imul(G,Le)|0,c=c+Math.imul(G,Oe)|0,c=c+Math.imul(b,Le)|0,w=w+Math.imul(b,Oe)|0,g=g+Math.imul(I,Pe)|0,c=c+Math.imul(I,$e)|0,c=c+Math.imul($,Pe)|0,w=w+Math.imul($,$e)|0,g=g+Math.imul(H,Be)|0,c=c+Math.imul(H,De)|0,c=c+Math.imul(V,Be)|0,w=w+Math.imul(V,De)|0;var Qt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,g=Math.imul(ve,ye),c=Math.imul(ve,Ee),c=c+Math.imul(be,ye)|0,w=Math.imul(be,Ee),g=g+Math.imul(ce,Se)|0,c=c+Math.imul(ce,Re)|0,c=c+Math.imul(me,Se)|0,w=w+Math.imul(me,Re)|0,g=g+Math.imul(fe,Me)|0,c=c+Math.imul(fe,ke)|0,c=c+Math.imul(le,Me)|0,w=w+Math.imul(le,ke)|0,g=g+Math.imul(ge,Ce)|0,c=c+Math.imul(ge,Ie)|0,c=c+Math.imul(de,Ce)|0,w=w+Math.imul(de,Ie)|0,g=g+Math.imul(he,xe)|0,c=c+Math.imul(he,Ae)|0,c=c+Math.imul(pe,xe)|0,w=w+Math.imul(pe,Ae)|0,g=g+Math.imul(J,Te)|0,c=c+Math.imul(J,Ne)|0,c=c+Math.imul(Y,Te)|0,w=w+Math.imul(Y,Ne)|0,g=g+Math.imul(P,Le)|0,c=c+Math.imul(P,Oe)|0,c=c+Math.imul(j,Le)|0,w=w+Math.imul(j,Oe)|0,g=g+Math.imul(G,Pe)|0,c=c+Math.imul(G,$e)|0,c=c+Math.imul(b,Pe)|0,w=w+Math.imul(b,$e)|0,g=g+Math.imul(I,Be)|0,c=c+Math.imul(I,De)|0,c=c+Math.imul($,Be)|0,w=w+Math.imul($,De)|0;var Yt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(Yt>>>26)|0,Yt&=67108863,g=Math.imul(ve,Se),c=Math.imul(ve,Re),c=c+Math.imul(be,Se)|0,w=Math.imul(be,Re),g=g+Math.imul(ce,Me)|0,c=c+Math.imul(ce,ke)|0,c=c+Math.imul(me,Me)|0,w=w+Math.imul(me,ke)|0,g=g+Math.imul(fe,Ce)|0,c=c+Math.imul(fe,Ie)|0,c=c+Math.imul(le,Ce)|0,w=w+Math.imul(le,Ie)|0,g=g+Math.imul(ge,xe)|0,c=c+Math.imul(ge,Ae)|0,c=c+Math.imul(de,xe)|0,w=w+Math.imul(de,Ae)|0,g=g+Math.imul(he,Te)|0,c=c+Math.imul(he,Ne)|0,c=c+Math.imul(pe,Te)|0,w=w+Math.imul(pe,Ne)|0,g=g+Math.imul(J,Le)|0,c=c+Math.imul(J,Oe)|0,c=c+Math.imul(Y,Le)|0,w=w+Math.imul(Y,Oe)|0,g=g+Math.imul(P,Pe)|0,c=c+Math.imul(P,$e)|0,c=c+Math.imul(j,Pe)|0,w=w+Math.imul(j,$e)|0,g=g+Math.imul(G,Be)|0,c=c+Math.imul(G,De)|0,c=c+Math.imul(b,Be)|0,w=w+Math.imul(b,De)|0;var Xt=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(Xt>>>26)|0,Xt&=67108863,g=Math.imul(ve,Me),c=Math.imul(ve,ke),c=c+Math.imul(be,Me)|0,w=Math.imul(be,ke),g=g+Math.imul(ce,Ce)|0,c=c+Math.imul(ce,Ie)|0,c=c+Math.imul(me,Ce)|0,w=w+Math.imul(me,Ie)|0,g=g+Math.imul(fe,xe)|0,c=c+Math.imul(fe,Ae)|0,c=c+Math.imul(le,xe)|0,w=w+Math.imul(le,Ae)|0,g=g+Math.imul(ge,Te)|0,c=c+Math.imul(ge,Ne)|0,c=c+Math.imul(de,Te)|0,w=w+Math.imul(de,Ne)|0,g=g+Math.imul(he,Le)|0,c=c+Math.imul(he,Oe)|0,c=c+Math.imul(pe,Le)|0,w=w+Math.imul(pe,Oe)|0,g=g+Math.imul(J,Pe)|0,c=c+Math.imul(J,$e)|0,c=c+Math.imul(Y,Pe)|0,w=w+Math.imul(Y,$e)|0,g=g+Math.imul(P,Be)|0,c=c+Math.imul(P,De)|0,c=c+Math.imul(j,Be)|0,w=w+Math.imul(j,De)|0;var er=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(er>>>26)|0,er&=67108863,g=Math.imul(ve,Ce),c=Math.imul(ve,Ie),c=c+Math.imul(be,Ce)|0,w=Math.imul(be,Ie),g=g+Math.imul(ce,xe)|0,c=c+Math.imul(ce,Ae)|0,c=c+Math.imul(me,xe)|0,w=w+Math.imul(me,Ae)|0,g=g+Math.imul(fe,Te)|0,c=c+Math.imul(fe,Ne)|0,c=c+Math.imul(le,Te)|0,w=w+Math.imul(le,Ne)|0,g=g+Math.imul(ge,Le)|0,c=c+Math.imul(ge,Oe)|0,c=c+Math.imul(de,Le)|0,w=w+Math.imul(de,Oe)|0,g=g+Math.imul(he,Pe)|0,c=c+Math.imul(he,$e)|0,c=c+Math.imul(pe,Pe)|0,w=w+Math.imul(pe,$e)|0,g=g+Math.imul(J,Be)|0,c=c+Math.imul(J,De)|0,c=c+Math.imul(Y,Be)|0,w=w+Math.imul(Y,De)|0;var tr=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(tr>>>26)|0,tr&=67108863,g=Math.imul(ve,xe),c=Math.imul(ve,Ae),c=c+Math.imul(be,xe)|0,w=Math.imul(be,Ae),g=g+Math.imul(ce,Te)|0,c=c+Math.imul(ce,Ne)|0,c=c+Math.imul(me,Te)|0,w=w+Math.imul(me,Ne)|0,g=g+Math.imul(fe,Le)|0,c=c+Math.imul(fe,Oe)|0,c=c+Math.imul(le,Le)|0,w=w+Math.imul(le,Oe)|0,g=g+Math.imul(ge,Pe)|0,c=c+Math.imul(ge,$e)|0,c=c+Math.imul(de,Pe)|0,w=w+Math.imul(de,$e)|0,g=g+Math.imul(he,Be)|0,c=c+Math.imul(he,De)|0,c=c+Math.imul(pe,Be)|0,w=w+Math.imul(pe,De)|0;var rs=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(rs>>>26)|0,rs&=67108863,g=Math.imul(ve,Te),c=Math.imul(ve,Ne),c=c+Math.imul(be,Te)|0,w=Math.imul(be,Ne),g=g+Math.imul(ce,Le)|0,c=c+Math.imul(ce,Oe)|0,c=c+Math.imul(me,Le)|0,w=w+Math.imul(me,Oe)|0,g=g+Math.imul(fe,Pe)|0,c=c+Math.imul(fe,$e)|0,c=c+Math.imul(le,Pe)|0,w=w+Math.imul(le,$e)|0,g=g+Math.imul(ge,Be)|0,c=c+Math.imul(ge,De)|0,c=c+Math.imul(de,Be)|0,w=w+Math.imul(de,De)|0;var ns=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(ns>>>26)|0,ns&=67108863,g=Math.imul(ve,Le),c=Math.imul(ve,Oe),c=c+Math.imul(be,Le)|0,w=Math.imul(be,Oe),g=g+Math.imul(ce,Pe)|0,c=c+Math.imul(ce,$e)|0,c=c+Math.imul(me,Pe)|0,w=w+Math.imul(me,$e)|0,g=g+Math.imul(fe,Be)|0,c=c+Math.imul(fe,De)|0,c=c+Math.imul(le,Be)|0,w=w+Math.imul(le,De)|0;var is=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(is>>>26)|0,is&=67108863,g=Math.imul(ve,Pe),c=Math.imul(ve,$e),c=c+Math.imul(be,Pe)|0,w=Math.imul(be,$e),g=g+Math.imul(ce,Be)|0,c=c+Math.imul(ce,De)|0,c=c+Math.imul(me,Be)|0,w=w+Math.imul(me,De)|0;var ss=(k+g|0)+((c&8191)<<13)|0;k=(w+(c>>>13)|0)+(ss>>>26)|0,ss&=67108863,g=Math.imul(ve,Be),c=Math.imul(ve,De),c=c+Math.imul(be,Be)|0,w=Math.imul(be,De);var os=(k+g|0)+((c&8191)<<13)|0;return k=(w+(c>>>13)|0)+(os>>>26)|0,os&=67108863,E[0]=Ut,E[1]=Wt,E[2]=Vt,E[3]=zt,E[4]=qt,E[5]=Jt,E[6]=Gt,E[7]=Zt,E[8]=Kt,E[9]=Qt,E[10]=Yt,E[11]=Xt,E[12]=er,E[13]=tr,E[14]=rs,E[15]=ns,E[16]=is,E[17]=ss,E[18]=os,k!==0&&(E[19]=k,f.length++),f};Math.imul||(T=M);function N(S,o,u){u.negative=o.negative^S.negative,u.length=S.length+o.length;for(var f=0,p=0,v=0;v>>26)|0,p+=E>>>26,E&=67108863}u.words[v]=k,f=E,E=p}return f!==0?u.words[v]=f:u.length--,u._strip()}function D(S,o,u){return N(S,o,u)}s.prototype.mulTo=function(o,u){var f,p=this.length+o.length;return this.length===10&&o.length===10?f=T(this,o,u):p<63?f=M(this,o,u):p<1024?f=N(this,o,u):f=D(this,o,u),f},s.prototype.mul=function(o){var u=new s(null);return u.words=new Array(this.length+o.length),this.mulTo(o,u)},s.prototype.mulf=function(o){var u=new s(null);return u.words=new Array(this.length+o.length),D(this,o,u)},s.prototype.imul=function(o){return this.clone().mulTo(o,this)},s.prototype.imuln=function(o){var u=o<0;u&&(o=-o),n(typeof o=="number"),n(o<67108864);for(var f=0,p=0;p>=26,f+=v/67108864|0,f+=E>>>26,this.words[p]=E&67108863}return f!==0&&(this.words[p]=f,this.length++),u?this.ineg():this},s.prototype.muln=function(o){return this.clone().imuln(o)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(o){var u=O(o);if(u.length===0)return new s(1);for(var f=this,p=0;p=0);var u=o%26,f=(o-u)/26,p=67108863>>>26-u<<26-u,v;if(u!==0){var E=0;for(v=0;v>>26-u}E&&(this.words[v]=E,this.length++)}if(f!==0){for(v=this.length-1;v>=0;v--)this.words[v+f]=this.words[v];for(v=0;v=0);var p;u?p=(u-u%26)/26:p=0;var v=o%26,E=Math.min((o-v)/26,this.length),k=67108863^67108863>>>v<E)for(this.length-=E,c=0;c=0&&(w!==0||c>=p);c--){var U=this.words[c]|0;this.words[c]=w<<26-v|U>>>v,w=U&k}return g&&w!==0&&(g.words[g.length++]=w),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(o,u,f){return n(this.negative===0),this.iushrn(o,u,f)},s.prototype.shln=function(o){return this.clone().ishln(o)},s.prototype.ushln=function(o){return this.clone().iushln(o)},s.prototype.shrn=function(o){return this.clone().ishrn(o)},s.prototype.ushrn=function(o){return this.clone().iushrn(o)},s.prototype.testn=function(o){n(typeof o=="number"&&o>=0);var u=o%26,f=(o-u)/26,p=1<=0);var u=o%26,f=(o-u)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=f)return this;if(u!==0&&f++,this.length=Math.min(f,this.length),u!==0){var p=67108863^67108863>>>u<=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},s.prototype.isubn=function(o){if(n(typeof o=="number"),n(o<67108864),o<0)return this.iaddn(-o);if(this.negative!==0)return this.negative=0,this.iaddn(o),this.negative=1,this;if(this.words[0]-=o,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u>26)-(g/67108864|0),this.words[v+f]=E&67108863}for(;v>26,this.words[v+f]=E&67108863;if(k===0)return this._strip();for(n(k===-1),k=0,v=0;v>26,this.words[v]=E&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(o,u){var f=this.length-o.length,p=this.clone(),v=o,E=v.words[v.length-1]|0,k=this._countBits(E);f=26-k,f!==0&&(v=v.ushln(f),p.iushln(f),E=v.words[v.length-1]|0);var g=p.length-v.length,c;if(u!=="mod"){c=new s(null),c.length=g+1,c.words=new Array(c.length);for(var w=0;w=0;H--){var V=(p.words[v.length+H]|0)*67108864+(p.words[v.length+H-1]|0);for(V=Math.min(V/E|0,67108863),p._ishlnsubmul(v,V,H);p.negative!==0;)V--,p.negative=0,p._ishlnsubmul(v,1,H),p.isZero()||(p.negative^=1);c&&(c.words[H]=V)}return c&&c._strip(),p._strip(),u!=="div"&&f!==0&&p.iushrn(f),{div:c||null,mod:p}},s.prototype.divmod=function(o,u,f){if(n(!o.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var p,v,E;return this.negative!==0&&o.negative===0?(E=this.neg().divmod(o,u),u!=="mod"&&(p=E.div.neg()),u!=="div"&&(v=E.mod.neg(),f&&v.negative!==0&&v.iadd(o)),{div:p,mod:v}):this.negative===0&&o.negative!==0?(E=this.divmod(o.neg(),u),u!=="mod"&&(p=E.div.neg()),{div:p,mod:E.mod}):this.negative&o.negative?(E=this.neg().divmod(o.neg(),u),u!=="div"&&(v=E.mod.neg(),f&&v.negative!==0&&v.isub(o)),{div:E.div,mod:v}):o.length>this.length||this.cmp(o)<0?{div:new s(0),mod:this}:o.length===1?u==="div"?{div:this.divn(o.words[0]),mod:null}:u==="mod"?{div:null,mod:new s(this.modrn(o.words[0]))}:{div:this.divn(o.words[0]),mod:new s(this.modrn(o.words[0]))}:this._wordDiv(o,u)},s.prototype.div=function(o){return this.divmod(o,"div",!1).div},s.prototype.mod=function(o){return this.divmod(o,"mod",!1).mod},s.prototype.umod=function(o){return this.divmod(o,"mod",!0).mod},s.prototype.divRound=function(o){var u=this.divmod(o);if(u.mod.isZero())return u.div;var f=u.div.negative!==0?u.mod.isub(o):u.mod,p=o.ushrn(1),v=o.andln(1),E=f.cmp(p);return E<0||v===1&&E===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},s.prototype.modrn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var f=(1<<26)%o,p=0,v=this.length-1;v>=0;v--)p=(f*p+(this.words[v]|0))%o;return u?-p:p},s.prototype.modn=function(o){return this.modrn(o)},s.prototype.idivn=function(o){var u=o<0;u&&(o=-o),n(o<=67108863);for(var f=0,p=this.length-1;p>=0;p--){var v=(this.words[p]|0)+f*67108864;this.words[p]=v/o|0,f=v%o}return this._strip(),u?this.ineg():this},s.prototype.divn=function(o){return this.clone().idivn(o)},s.prototype.egcd=function(o){n(o.negative===0),n(!o.isZero());var u=this,f=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var p=new s(1),v=new s(0),E=new s(0),k=new s(1),g=0;u.isEven()&&f.isEven();)u.iushrn(1),f.iushrn(1),++g;for(var c=f.clone(),w=u.clone();!u.isZero();){for(var U=0,H=1;!(u.words[0]&H)&&U<26;++U,H<<=1);if(U>0)for(u.iushrn(U);U-- >0;)(p.isOdd()||v.isOdd())&&(p.iadd(c),v.isub(w)),p.iushrn(1),v.iushrn(1);for(var V=0,A=1;!(f.words[0]&A)&&V<26;++V,A<<=1);if(V>0)for(f.iushrn(V);V-- >0;)(E.isOdd()||k.isOdd())&&(E.iadd(c),k.isub(w)),E.iushrn(1),k.iushrn(1);u.cmp(f)>=0?(u.isub(f),p.isub(E),v.isub(k)):(f.isub(u),E.isub(p),k.isub(v))}return{a:E,b:k,gcd:f.iushln(g)}},s.prototype._invmp=function(o){n(o.negative===0),n(!o.isZero());var u=this,f=o.clone();u.negative!==0?u=u.umod(o):u=u.clone();for(var p=new s(1),v=new s(0),E=f.clone();u.cmpn(1)>0&&f.cmpn(1)>0;){for(var k=0,g=1;!(u.words[0]&g)&&k<26;++k,g<<=1);if(k>0)for(u.iushrn(k);k-- >0;)p.isOdd()&&p.iadd(E),p.iushrn(1);for(var c=0,w=1;!(f.words[0]&w)&&c<26;++c,w<<=1);if(c>0)for(f.iushrn(c);c-- >0;)v.isOdd()&&v.iadd(E),v.iushrn(1);u.cmp(f)>=0?(u.isub(f),p.isub(v)):(f.isub(u),v.isub(p))}var U;return u.cmpn(1)===0?U=p:U=v,U.cmpn(0)<0&&U.iadd(o),U},s.prototype.gcd=function(o){if(this.isZero())return o.abs();if(o.isZero())return this.abs();var u=this.clone(),f=o.clone();u.negative=0,f.negative=0;for(var p=0;u.isEven()&&f.isEven();p++)u.iushrn(1),f.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;f.isEven();)f.iushrn(1);var v=u.cmp(f);if(v<0){var E=u;u=f,f=E}else if(v===0||f.cmpn(1)===0)break;u.isub(f)}while(!0);return f.iushln(p)},s.prototype.invm=function(o){return this.egcd(o).a.umod(o)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(o){return this.words[0]&o},s.prototype.bincn=function(o){n(typeof o=="number");var u=o%26,f=(o-u)/26,p=1<>>26,k&=67108863,this.words[E]=k}return v!==0&&(this.words[E]=v,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(o){var u=o<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this._strip();var f;if(this.length>1)f=1;else{u&&(o=-o),n(o<=67108863,"Number is too big");var p=this.words[0]|0;f=p===o?0:po.length)return 1;if(this.length=0;f--){var p=this.words[f]|0,v=o.words[f]|0;if(p!==v){pv&&(u=1);break}}return u},s.prototype.gtn=function(o){return this.cmpn(o)===1},s.prototype.gt=function(o){return this.cmp(o)===1},s.prototype.gten=function(o){return this.cmpn(o)>=0},s.prototype.gte=function(o){return this.cmp(o)>=0},s.prototype.ltn=function(o){return this.cmpn(o)===-1},s.prototype.lt=function(o){return this.cmp(o)===-1},s.prototype.lten=function(o){return this.cmpn(o)<=0},s.prototype.lte=function(o){return this.cmp(o)<=0},s.prototype.eqn=function(o){return this.cmpn(o)===0},s.prototype.eq=function(o){return this.cmp(o)===0},s.red=function(o){return new X(o)},s.prototype.toRed=function(o){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),o.convertTo(this)._forceRed(o)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(o){return this.red=o,this},s.prototype.forceRed=function(o){return n(!this.red,"Already a number in reduction context"),this._forceRed(o)},s.prototype.redAdd=function(o){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,o)},s.prototype.redIAdd=function(o){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,o)},s.prototype.redSub=function(o){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,o)},s.prototype.redISub=function(o){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,o)},s.prototype.redShl=function(o){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,o)},s.prototype.redMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.mul(this,o)},s.prototype.redIMul=function(o){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,o),this.red.imul(this,o)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(o){return n(this.red&&!o.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,o)};var L={k256:null,p224:null,p192:null,p25519:null};function F(S,o){this.name=S,this.p=new s(o,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var o=new s(null);return o.words=new Array(Math.ceil(this.n/13)),o},F.prototype.ireduce=function(o){var u=o,f;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),f=u.bitLength();while(f>this.n);var p=f0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},F.prototype.split=function(o,u){o.iushrn(this.n,0,u)},F.prototype.imulK=function(o){return o.imul(this.k)};function W(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(W,F),W.prototype.split=function(o,u){for(var f=4194303,p=Math.min(o.length,9),v=0;v>>22,E=k}E>>>=22,o.words[v-10]=E,E===0&&o.length>10?o.length-=10:o.length-=9},W.prototype.imulK=function(o){o.words[o.length]=0,o.words[o.length+1]=0,o.length+=2;for(var u=0,f=0;f>>=26,o.words[f]=v,u=p}return u!==0&&(o.words[o.length++]=u),o},s._prime=function(o){if(L[o])return L[o];var u;if(o==="k256")u=new W;else if(o==="p224")u=new te;else if(o==="p192")u=new Z;else if(o==="p25519")u=new z;else throw new Error("Unknown prime "+o);return L[o]=u,u};function X(S){if(typeof S=="string"){var o=s._prime(S);this.m=o.p,this.prime=o}else n(S.gtn(1),"modulus must be greater than 1"),this.m=S,this.prime=null}X.prototype._verify1=function(o){n(o.negative===0,"red works only with positives"),n(o.red,"red works only with red numbers")},X.prototype._verify2=function(o,u){n((o.negative|u.negative)===0,"red works only with positives"),n(o.red&&o.red===u.red,"red works only with red numbers")},X.prototype.imod=function(o){return this.prime?this.prime.ireduce(o)._forceRed(this):(m(o,o.umod(this.m)._forceRed(this)),o)},X.prototype.neg=function(o){return o.isZero()?o.clone():this.m.sub(o)._forceRed(this)},X.prototype.add=function(o,u){this._verify2(o,u);var f=o.add(u);return f.cmp(this.m)>=0&&f.isub(this.m),f._forceRed(this)},X.prototype.iadd=function(o,u){this._verify2(o,u);var f=o.iadd(u);return f.cmp(this.m)>=0&&f.isub(this.m),f},X.prototype.sub=function(o,u){this._verify2(o,u);var f=o.sub(u);return f.cmpn(0)<0&&f.iadd(this.m),f._forceRed(this)},X.prototype.isub=function(o,u){this._verify2(o,u);var f=o.isub(u);return f.cmpn(0)<0&&f.iadd(this.m),f},X.prototype.shl=function(o,u){return this._verify1(o),this.imod(o.ushln(u))},X.prototype.imul=function(o,u){return this._verify2(o,u),this.imod(o.imul(u))},X.prototype.mul=function(o,u){return this._verify2(o,u),this.imod(o.mul(u))},X.prototype.isqr=function(o){return this.imul(o,o.clone())},X.prototype.sqr=function(o){return this.mul(o,o)},X.prototype.sqrt=function(o){if(o.isZero())return o.clone();var u=this.m.andln(3);if(n(u%2===1),u===3){var f=this.m.add(new s(1)).iushrn(2);return this.pow(o,f)}for(var p=this.m.subn(1),v=0;!p.isZero()&&p.andln(1)===0;)v++,p.iushrn(1);n(!p.isZero());var E=new s(1).toRed(this),k=E.redNeg(),g=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);this.pow(c,g).cmp(k)!==0;)c.redIAdd(k);for(var w=this.pow(c,p),U=this.pow(o,p.addn(1).iushrn(1)),H=this.pow(o,p),V=v;H.cmp(E)!==0;){for(var A=H,I=0;A.cmp(E)!==0;I++)A=A.redSqr();n(I=0;v--){for(var w=u.words[v],U=c-1;U>=0;U--){var H=w>>U&1;if(E!==p[0]&&(E=this.sqr(E)),H===0&&k===0){g=0;continue}k<<=1,k|=H,g++,!(g!==f&&(v!==0||U!==0))&&(E=this.mul(E,p[k]),g=0,k=0)}c=26}return E},X.prototype.convertTo=function(o){var u=o.umod(this.m);return u===o?u.clone():u},X.prototype.convertFrom=function(o){var u=o.clone();return u.red=null,u},s.mont=function(o){return new ne(o)};function ne(S){X.call(this,S),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(ne,X),ne.prototype.convertTo=function(o){return this.imod(o.ushln(this.shift))},ne.prototype.convertFrom=function(o){var u=this.imod(o.mul(this.rinv));return u.red=null,u},ne.prototype.imul=function(o,u){if(o.isZero()||u.isZero())return o.words[0]=0,o.length=1,o;var f=o.imul(u),p=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=f.isub(p).iushrn(this.shift),E=v;return v.cmp(this.m)>=0?E=v.isub(this.m):v.cmpn(0)<0&&(E=v.iadd(this.m)),E._forceRed(this)},ne.prototype.mul=function(o,u){if(o.isZero()||u.isZero())return new s(0)._forceRed(this);var f=o.mul(u),p=f.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=f.isub(p).iushrn(this.shift),E=v;return v.cmp(this.m)>=0?E=v.isub(this.m):v.cmpn(0)<0&&(E=v.iadd(this.m)),E._forceRed(this)},ne.prototype.invm=function(o){var u=this.imod(o._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(e,Q)})(Vs);var ci=Vs.exports,gn={},Nt={};Object.defineProperty(Nt,"__esModule",{value:!0});Nt.errorValues=Nt.standardErrorCodes=void 0;Nt.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};Nt.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var li={},ui={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Nt,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(y,C=r){if(y&&Number.isInteger(y)){const x=y.toString();if(m(t.errorValues,x))return t.errorValues[x].message;if(d(y))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return C}e.getMessageFromCode=n;function i(y){if(!Number.isInteger(y))return!1;const C=y.toString();return!!(t.errorValues[C]||d(y))}e.isValidCode=i;function s(y){var C;if(typeof y=="number")return y;if(a(y))return(C=y.code)!==null&&C!==void 0?C:y.errorCode}e.getErrorCode=s;function a(y){return typeof y=="object"&&y!==null&&(typeof y.code=="number"||typeof y.errorCode=="number")}function l(y,{shouldIncludeStack:C=!1}={}){const x={};if(y&&typeof y=="object"&&!Array.isArray(y)&&m(y,"code")&&i(y.code)){const B=y;x.code=B.code,B.message&&typeof B.message=="string"?(x.message=B.message,m(B,"data")&&(x.data=B.data)):(x.message=n(x.code),x.data={originalError:h(y)})}else x.code=t.standardErrorCodes.rpc.internal,x.message=R(y,"message")?y.message:r,x.data={originalError:h(y)};return C&&(x.stack=R(y,"stack")?y.stack:void 0),x}e.serialize=l;function d(y){return y>=-32099&&y<=-32e3}function h(y){return y&&typeof y=="object"&&!Array.isArray(y)?Object.assign({},y):y}function m(y,C){return Object.prototype.hasOwnProperty.call(y,C)}function R(y,C){return typeof y=="object"&&y!==null&&C in y&&typeof y[C]=="string"}})(ui);Object.defineProperty(li,"__esModule",{value:!0});li.standardErrors=void 0;const Ge=Nt,cc=ui;li.standardErrors={rpc:{parse:e=>ct(Ge.standardErrorCodes.rpc.parse,e),invalidRequest:e=>ct(Ge.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>ct(Ge.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>ct(Ge.standardErrorCodes.rpc.methodNotFound,e),internal:e=>ct(Ge.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return ct(t,e)},invalidInput:e=>ct(Ge.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>ct(Ge.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>ct(Ge.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>ct(Ge.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>ct(Ge.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>ct(Ge.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>Ar(Ge.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>Ar(Ge.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>Ar(Ge.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>Ar(Ge.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>Ar(Ge.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>Ar(Ge.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new hc(t,r,n)}}};function ct(e,t){const[r,n]=lc(t);return new uc(e,r||(0,cc.getMessageFromCode)(e),n)}function Ar(e,t){const[r,n]=lc(t);return new hc(e,r||(0,cc.getMessageFromCode)(e),n)}function lc(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}let uc=class extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}},hc=class extends uc{constructor(t,r,n){if(!du(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}};function du(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}var hi={},Kr={};Object.defineProperty(Kr,"__esModule",{value:!0});Kr.isErrorResponse=void 0;function fu(e){return e.errorMessage!==void 0}Kr.isErrorResponse=fu;var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.LIB_VERSION=void 0;Qr.LIB_VERSION="3.9.3";Object.defineProperty(hi,"__esModule",{value:!0});hi.serializeError=void 0;const pu=Kr,gu=Qr,mu=Nt,vu=ui;function bu(e,t){const r=(0,vu.serialize)(wu(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",gu.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=_u(r.data,t);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}hi.serializeError=bu;function wu(e){return typeof e=="string"?{message:e,code:mu.standardErrorCodes.rpc.internal}:(0,pu.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function _u(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=e.serializeError=e.getMessageFromCode=e.getErrorCode=void 0;const t=Nt;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});const r=li;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}});const n=hi;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return n.serializeError}});const i=ui;Object.defineProperty(e,"getErrorCode",{enumerable:!0,get:function(){return i.getErrorCode}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}})})(gn);var Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.ProviderType=Ve.RegExpString=Ve.IntNumber=Ve.BigIntString=Ve.AddressString=Ve.HexString=Ve.OpaqueType=void 0;function mn(){return e=>e}Ve.OpaqueType=mn;Ve.HexString=mn();Ve.AddressString=mn();Ve.BigIntString=mn();function yu(e){return Math.floor(e)}Ve.IntNumber=yu;Ve.RegExpString=mn();var Ao;(function(e){e.CoinbaseWallet="CoinbaseWallet",e.MetaMask="MetaMask",e.Unselected=""})(Ao||(Ve.ProviderType=Ao={}));var Eu=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(q,"__esModule",{value:!0});q.isMobileWeb=q.getLocation=q.isInIFrame=q.createQrUrl=q.getFavicon=q.range=q.isBigNumber=q.ensureParsedJSONObject=q.ensureBN=q.ensureRegExpString=q.ensureIntNumber=q.ensureBuffer=q.ensureAddressString=q.ensureEvenLengthHexString=q.ensureHexString=q.isHexString=q.prepend0x=q.strip0x=q.has0xPrefix=q.hexStringFromIntNumber=q.intNumberFromHexString=q.bigIntStringFromBN=q.hexStringFromBuffer=q.hexStringToUint8Array=q.uint8ArrayToHex=q.randomBytesHex=void 0;const $t=Eu(ci),pr=gn,dt=Ve,dc=/^[0-9]*$/,fc=/^[a-f0-9]*$/;function Su(e){return pc(crypto.getRandomValues(new Uint8Array(e)))}q.randomBytesHex=Su;function pc(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}q.uint8ArrayToHex=pc;function Ru(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}q.hexStringToUint8Array=Ru;function Mu(e,t=!1){const r=e.toString("hex");return(0,dt.HexString)(t?`0x${r}`:r)}q.hexStringFromBuffer=Mu;function ku(e){return(0,dt.BigIntString)(e.toString(10))}q.bigIntStringFromBN=ku;function Cu(e){return(0,dt.IntNumber)(new $t.default(bn(e,!1),16).toNumber())}q.intNumberFromHexString=Cu;function Iu(e){return(0,dt.HexString)(`0x${new $t.default(e).toString(16)}`)}q.hexStringFromIntNumber=Iu;function zs(e){return e.startsWith("0x")||e.startsWith("0X")}q.has0xPrefix=zs;function di(e){return zs(e)?e.slice(2):e}q.strip0x=di;function gc(e){return zs(e)?`0x${e.slice(2)}`:`0x${e}`}q.prepend0x=gc;function vn(e){if(typeof e!="string")return!1;const t=di(e).toLowerCase();return fc.test(t)}q.isHexString=vn;function mc(e,t=!1){if(typeof e=="string"){const r=di(e).toLowerCase();if(fc.test(r))return(0,dt.HexString)(t?`0x${r}`:r)}throw pr.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}q.ensureHexString=mc;function bn(e,t=!1){let r=mc(e,!1);return r.length%2===1&&(r=(0,dt.HexString)(`0${r}`)),t?(0,dt.HexString)(`0x${r}`):r}q.ensureEvenLengthHexString=bn;function xu(e){if(typeof e=="string"){const t=di(e).toLowerCase();if(vn(t)&&t.length===40)return(0,dt.AddressString)(gc(t))}throw pr.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}q.ensureAddressString=xu;function Au(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(vn(e)){const t=bn(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw pr.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}q.ensureBuffer=Au;function vc(e){if(typeof e=="number"&&Number.isInteger(e))return(0,dt.IntNumber)(e);if(typeof e=="string"){if(dc.test(e))return(0,dt.IntNumber)(Number(e));if(vn(e))return(0,dt.IntNumber)(new $t.default(bn(e,!1),16).toNumber())}throw pr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}q.ensureIntNumber=vc;function Tu(e){if(e instanceof RegExp)return(0,dt.RegExpString)(e.toString());throw pr.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}q.ensureRegExpString=Tu;function Nu(e){if(e!==null&&($t.default.isBN(e)||bc(e)))return new $t.default(e.toString(10),10);if(typeof e=="number")return new $t.default(vc(e));if(typeof e=="string"){if(dc.test(e))return new $t.default(e,10);if(vn(e))return new $t.default(bn(e,!1),16)}throw pr.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}q.ensureBN=Nu;function Lu(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw pr.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}q.ensureParsedJSONObject=Lu;function bc(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}q.isBigNumber=bc;function Ou(e,t){return Array.from({length:t-e},(r,n)=>e+n)}q.range=Ou;function Pu(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}q.getFavicon=Pu;function $u(e,t,r,n,i,s){const a=n?"parent-id":"id",l=new URLSearchParams({[a]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${l}`}q.createQrUrl=$u;function wc(){try{return window.frameElement!==null}catch{return!1}}q.isInIFrame=wc;function Bu(){try{return wc()&&window.top?window.top.location:window.location}catch{return window.location}}q.getLocation=Bu;function Du(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}q.isMobileWeb=Du;var fi={};Object.defineProperty(fi,"__esModule",{value:!0});fi.ScopedLocalStorage=void 0;class Fu{constructor(t){this.scope=t}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(t){return`${this.scope}:${t}`}}fi.ScopedLocalStorage=Fu;var Ur={};const ju=Zr(uu);var wn={},_n={},Yr={};Object.defineProperty(Yr,"__esModule",{value:!0});Yr.EVENTS=void 0;Yr.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",METHOD_NOT_IMPLEMENTED:"walletlink_sdk.method_not_implemented",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ht={};Object.defineProperty(ht,"__esModule",{value:!0});ht.RelayAbstract=ht.APP_VERSION_KEY=ht.LOCAL_STORAGE_ADDRESSES_KEY=ht.WALLET_USER_NAME_KEY=void 0;const To=gn;ht.WALLET_USER_NAME_KEY="walletUsername";ht.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";ht.APP_VERSION_KEY="AppVersion";class Hu{async makeEthereumJSONRPCRequest(t,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw To.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,To.serializeError)(s,t.method);return i})}}ht.RelayAbstract=Hu;var Xr={},_c={exports:{}},Ps={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(e,t){var r=ii,n=r.Buffer;function i(a,l){for(var d in a)l[d]=a[d]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(i(r,t),t.Buffer=s);function s(a,l,d){return n(a,l,d)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(a,l,d){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,l,d)},s.alloc=function(a,l,d){if(typeof a!="number")throw new TypeError("Argument must be a number");var h=n(a);return l!==void 0?typeof d=="string"?h.fill(l,d):h.fill(l):h.fill(0),h},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(a)}})(Ps,Ps.exports);var jt=Ps.exports,yc=jt.Buffer;function pi(e,t){this._block=yc.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}pi.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=yc.from(e,t));for(var r=this._block,n=this._blockSize,i=e.length,s=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s};pi.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var en=pi,Uu=vt,Ec=en,Wu=jt.Buffer,Vu=[1518500249,1859775393,-1894007588,-899497514],zu=new Array(80);function yn(){this.init(),this._w=zu,Ec.call(this,64,56)}Uu(yn,Ec);yn.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function qu(e){return e<<5|e>>>27}function Ju(e){return e<<30|e>>>2}function Gu(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}yn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,l=0;l<16;++l)t[l]=e.readInt32BE(l*4);for(;l<80;++l)t[l]=t[l-3]^t[l-8]^t[l-14]^t[l-16];for(var d=0;d<80;++d){var h=~~(d/20),m=qu(r)+Gu(h,n,i,s)+a+t[d]+Vu[h]|0;a=s,s=i,i=Ju(n),n=r,r=m}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};yn.prototype._hash=function(){var e=Wu.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Zu=yn,Ku=vt,Sc=en,Qu=jt.Buffer,Yu=[1518500249,1859775393,-1894007588,-899497514],Xu=new Array(80);function En(){this.init(),this._w=Xu,Sc.call(this,64,56)}Ku(En,Sc);En.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function eh(e){return e<<1|e>>>31}function th(e){return e<<5|e>>>27}function rh(e){return e<<30|e>>>2}function nh(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}En.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,l=0;l<16;++l)t[l]=e.readInt32BE(l*4);for(;l<80;++l)t[l]=eh(t[l-3]^t[l-8]^t[l-14]^t[l-16]);for(var d=0;d<80;++d){var h=~~(d/20),m=th(r)+nh(h,n,i,s)+a+t[d]+Yu[h]|0;a=s,s=i,i=rh(n),n=r,r=m}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0};En.prototype._hash=function(){var e=Qu.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var ih=En,sh=vt,Rc=en,oh=jt.Buffer,ah=[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],ch=new Array(64);function Sn(){this.init(),this._w=ch,Rc.call(this,64,56)}sh(Sn,Rc);Sn.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function lh(e,t,r){return r^e&(t^r)}function uh(e,t,r){return e&t|r&(e|t)}function hh(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function dh(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function fh(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function ph(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Sn.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,a=this._e|0,l=this._f|0,d=this._g|0,h=this._h|0,m=0;m<16;++m)t[m]=e.readInt32BE(m*4);for(;m<64;++m)t[m]=ph(t[m-2])+t[m-7]+fh(t[m-15])+t[m-16]|0;for(var R=0;R<64;++R){var y=h+dh(a)+lh(a,l,d)+ah[R]+t[R]|0,C=hh(r)+uh(r,n,i)|0;h=d,d=l,l=a,a=s+y|0,s=i,i=n,n=r,r=y+C|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=l+this._f|0,this._g=d+this._g|0,this._h=h+this._h|0};Sn.prototype._hash=function(){var e=oh.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var Mc=Sn,gh=vt,mh=Mc,vh=en,bh=jt.Buffer,wh=new Array(64);function gi(){this.init(),this._w=wh,vh.call(this,64,56)}gh(gi,mh);gi.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};gi.prototype._hash=function(){var e=bh.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var _h=gi,yh=vt,kc=en,Eh=jt.Buffer,No=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],Sh=new Array(160);function Rn(){this.init(),this._w=Sh,kc.call(this,128,112)}yh(Rn,kc);Rn.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Lo(e,t,r){return r^e&(t^r)}function Oo(e,t,r){return e&t|r&(e|t)}function Po(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function $o(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Rh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Mh(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function kh(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Ch(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function qe(e,t){return e>>>0>>0?1:0}Rn.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,a=this._eh|0,l=this._fh|0,d=this._gh|0,h=this._hh|0,m=this._al|0,R=this._bl|0,y=this._cl|0,C=this._dl|0,x=this._el|0,B=this._fl|0,O=this._gl|0,M=this._hl|0,T=0;T<32;T+=2)t[T]=e.readInt32BE(T*4),t[T+1]=e.readInt32BE(T*4+4);for(;T<160;T+=2){var N=t[T-30],D=t[T-15*2+1],L=Rh(N,D),F=Mh(D,N);N=t[T-2*2],D=t[T-2*2+1];var W=kh(N,D),te=Ch(D,N),Z=t[T-7*2],z=t[T-7*2+1],X=t[T-16*2],ne=t[T-16*2+1],S=F+z|0,o=L+Z+qe(S,F)|0;S=S+te|0,o=o+W+qe(S,te)|0,S=S+ne|0,o=o+X+qe(S,ne)|0,t[T]=o,t[T+1]=S}for(var u=0;u<160;u+=2){o=t[u],S=t[u+1];var f=Oo(r,n,i),p=Oo(m,R,y),v=Po(r,m),E=Po(m,r),k=$o(a,x),g=$o(x,a),c=No[u],w=No[u+1],U=Lo(a,l,d),H=Lo(x,B,O),V=M+g|0,A=h+k+qe(V,M)|0;V=V+H|0,A=A+U+qe(V,H)|0,V=V+w|0,A=A+c+qe(V,w)|0,V=V+S|0,A=A+o+qe(V,S)|0;var I=E+p|0,$=v+f+qe(I,E)|0;h=d,M=O,d=l,O=B,l=a,B=x,x=C+V|0,a=s+A+qe(x,C)|0,s=i,C=y,i=n,y=R,n=r,R=m,m=V+I|0,r=A+$+qe(m,V)|0}this._al=this._al+m|0,this._bl=this._bl+R|0,this._cl=this._cl+y|0,this._dl=this._dl+C|0,this._el=this._el+x|0,this._fl=this._fl+B|0,this._gl=this._gl+O|0,this._hl=this._hl+M|0,this._ah=this._ah+r+qe(this._al,m)|0,this._bh=this._bh+n+qe(this._bl,R)|0,this._ch=this._ch+i+qe(this._cl,y)|0,this._dh=this._dh+s+qe(this._dl,C)|0,this._eh=this._eh+a+qe(this._el,x)|0,this._fh=this._fh+l+qe(this._fl,B)|0,this._gh=this._gh+d+qe(this._gl,O)|0,this._hh=this._hh+h+qe(this._hl,M)|0};Rn.prototype._hash=function(){var e=Eh.allocUnsafe(64);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var Cc=Rn,Ih=vt,xh=Cc,Ah=en,Th=jt.Buffer,Nh=new Array(160);function mi(){this.init(),this._w=Nh,Ah.call(this,128,112)}Ih(mi,xh);mi.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};mi.prototype._hash=function(){var e=Th.allocUnsafe(48);function t(r,n,i){e.writeInt32BE(r,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Lh=mi,gr=_c.exports=function(t){t=t.toLowerCase();var r=gr[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};gr.sha=Zu;gr.sha1=ih;gr.sha224=_h;gr.sha256=Mc;gr.sha384=Lh;gr.sha512=Cc;var Oh=_c.exports;Object.defineProperty(Xr,"__esModule",{value:!0});Xr.Session=void 0;const Bo=Oh,Do=q,Fo="session:id",jo="session:secret",Ho="session:linked";class qs{constructor(t,r,n,i){this._storage=t,this._id=r||(0,Do.randomBytesHex)(16),this._secret=n||(0,Do.randomBytesHex)(32),this._key=new Bo.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(t){const r=t.getItem(Fo),n=t.getItem(Ho),i=t.getItem(jo);return r&&i?new qs(t,r,i,n==="1"):null}static hash(t){return new Bo.sha256().update(t).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Fo,this._id),this._storage.setItem(jo,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ho,this._linked?"1":"0")}}Xr.Session=qs;var vi={},bi={};Object.defineProperty(bi,"__esModule",{value:!0});bi.Cipher=void 0;const jn=q;class Ph{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,jn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,s.encode(t)),l=16,d=a.slice(a.byteLength-l),h=a.slice(0,a.byteLength-l),m=new Uint8Array(d),R=new Uint8Array(h),y=new Uint8Array([...n,...m,...R]);return(0,jn.uint8ArrayToHex)(y)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const s=await crypto.subtle.importKey("raw",(0,jn.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,jn.hexStringToUint8Array)(t),l=a.slice(0,12),d=a.slice(12,28),h=a.slice(28),m=new Uint8Array([...h,...d]),R={name:"AES-GCM",iv:new Uint8Array(l)};try{const y=await window.crypto.subtle.decrypt(R,s,m),C=new TextDecoder;n(C.decode(y))}catch(y){i(y)}})()})}}bi.Cipher=Ph;var wi={};Object.defineProperty(wi,"__esModule",{value:!0});wi.WalletLinkHTTP=void 0;class $h{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const s=(t=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(s),s}throw new Error(`Check unseen events failed: ${r.status}`)}}wi.WalletLinkHTTP=$h;var Wr={};Object.defineProperty(Wr,"__esModule",{value:!0});Wr.WalletLinkWebSocket=Wr.ConnectionState=void 0;var Br;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(Br||(Wr.ConnectionState=Br={}));class Bh{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(s){r(s);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Br.CONNECTING),i.onclose=s=>{var a;this.clearWebSocket(),r(new Error(`websocket error ${s.code}: ${s.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Br.DISCONNECTED)},i.onopen=s=>{var a;t(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Br.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(d=>this.sendData(d)),this.pendingData=[])},i.onmessage=s=>{var a,l;if(s.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const d=JSON.parse(s.data);(l=this.incomingDataListener)===null||l===void 0||l.call(this,d)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,Br.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}Wr.WalletLinkWebSocket=Bh;Object.defineProperty(vi,"__esModule",{value:!0});vi.WalletLinkConnection=void 0;const Tr=Ve,Dh=bi,_t=Yr,Uo=ht,Nr=Xr,Fh=wi,Hn=Wr,Wo=1e4,jh=6e4;class Hh{constructor({session:t,linkAPIUrl:r,listener:n,diagnostic:i,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Tr.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=l=>{if(!l)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",h=>l.JsonRpcUrl&&this.handleChainUpdated(h,l.JsonRpcUrl)]]).forEach((h,m)=>{const R=l[m];R!==void 0&&h(R)})},this.handleDestroyed=l=>{var d,h;l==="1"&&((d=this.listener)===null||d===void 0||d.resetAndReload(),(h=this.diagnostic)===null||h===void 0||h.log(_t.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:this.isDestroyed,sessionIdHash:Nr.Session.hash(this.session.id)}))},this.handleAccountUpdated=async l=>{var d,h;try{const m=await this.cipher.decrypt(l);(d=this.listener)===null||d===void 0||d.accountUpdated(m)}catch{(h=this.diagnostic)===null||h===void 0||h.log(_t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}},this.handleMetadataUpdated=async(l,d)=>{var h,m;try{const R=await this.cipher.decrypt(d);(h=this.listener)===null||h===void 0||h.metadataUpdated(l,R)}catch{(m=this.diagnostic)===null||m===void 0||m.log(_t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:l})}},this.handleWalletUsernameUpdated=async l=>{this.handleMetadataUpdated(Uo.WALLET_USER_NAME_KEY,l)},this.handleAppVersionUpdated=async l=>{this.handleMetadataUpdated(Uo.APP_VERSION_KEY,l)},this.handleChainUpdated=async(l,d)=>{var h,m;try{const R=await this.cipher.decrypt(l),y=await this.cipher.decrypt(d);(h=this.listener)===null||h===void 0||h.chainUpdated(R,y)}catch{(m=this.diagnostic)===null||m===void 0||m.log(_t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}},this.session=t,this.cipher=new Dh.Cipher(t.secret),this.diagnostic=i,this.listener=n;const a=new Hn.WalletLinkWebSocket(`${r}/rpc`,s);a.setConnectionStateListener(async l=>{var d;(d=this.diagnostic)===null||d===void 0||d.log(_t.EVENTS.CONNECTED_STATE_CHANGE,{state:l,sessionIdHash:Nr.Session.hash(t.id)});let h=!1;switch(l){case Hn.ConnectionState.DISCONNECTED:if(!this.destroyed){const m=async()=>{await new Promise(R=>setTimeout(R,5e3)),this.destroyed||a.connect().catch(()=>{m()})};m()}break;case Hn.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),h=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Wo),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Hn.ConnectionState.CONNECTING:break}this.connected!==h&&(this.connected=h)}),a.setIncomingDataListener(l=>{var d,h,m;switch(l.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const R=l.type==="IsLinkedOK"?l.linked:void 0;(d=this.diagnostic)===null||d===void 0||d.log(_t.EVENTS.LINKED,{sessionIdHash:Nr.Session.hash(t.id),linked:R,type:l.type,onlineGuests:l.onlineGuests}),this.linked=R||l.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{(h=this.diagnostic)===null||h===void 0||h.log(_t.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Nr.Session.hash(t.id),metadata_keys:l&&l.metadata?Object.keys(l.metadata):void 0}),this.handleSessionMetadataUpdated(l.metadata);break}case"Event":{this.handleIncomingEvent(l);break}}l.id!==void 0&&((m=this.requestResolutions.get(l.id))===null||m===void 0||m(l))}),this.ws=a,this.http=new Fh.WalletLinkHTTP(r,t.id,t.key)}connect(){var t;if(this.destroyed)throw new Error("instance is destroyed");(t=this.diagnostic)===null||t===void 0||t.log(_t.EVENTS.STARTED_CONNECTING,{sessionIdHash:Nr.Session.hash(this.session.id)}),this.ws.connect()}destroy(){var t;this.destroyed=!0,this.ws.disconnect(),(t=this.diagnostic)===null||t===void 0||t.log(_t.EVENTS.DISCONNECTED,{sessionIdHash:Nr.Session.hash(this.session.id)}),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r,n;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.connectedUpdated(t)}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r,n;if(!(t.type!=="Event"||t.event!=="Web3Response"))try{const i=await this.cipher.decrypt(t.data),s=JSON.parse(i);if(s.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(s)}catch{(n=this.diagnostic)===null||n===void 0||n.log(_t.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,Tr.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:(0,Tr.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(s);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Wo*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=jh){const n=t.id;this.sendData(t);let i;return Promise.race([new Promise((s,a)=>{i=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},r)}),new Promise(s=>{this.requestResolutions.set(n,a=>{clearTimeout(i),s(a),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,Tr.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authentcate")}sendIsLinked(){const t={type:"IsLinked",id:(0,Tr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,Tr.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}vi.WalletLinkConnection=Hh;var Mn={},kn={},Js={};Object.defineProperty(Js,"__esModule",{value:!0});Js.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Uh=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(kn,"__esModule",{value:!0});kn.injectCssReset=void 0;const Wh=Uh(Js);function Vh(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Wh.default)),document.documentElement.appendChild(e)}kn.injectCssReset=Vh;var _i={};const tt=Zr(cu);var yi={};function Ic(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}xc.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,r=this.parsedData.length;t=7&&this.setupTypeNumber(e),this.dataCache==null&&(this.dataCache=kt.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var r=-1;r<=7;r++)if(!(e+r<=-1||this.moduleCount<=e+r))for(var n=-1;n<=7;n++)t+n<=-1||this.moduleCount<=t+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[e+r][t+n]=!0:this.modules[e+r][t+n]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=je.getLostPoint(this);(r==0||e>n)&&(e=n,t=r)}return t},createMovieClip:function(e,t,r){var n=e.createEmptyMovieClip(t,r),i=1;this.make();for(var s=0;s>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!e&&(t>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(e,t){for(var r=this.errorCorrectLevel<<3|t,n=je.getBCHTypeInfo(r),i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!e&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var r=-1,n=this.moduleCount-1,i=7,s=0,a=this.moduleCount-1;a>0;a-=2)for(a==6&&a--;;){for(var l=0;l<2;l++)if(this.modules[n][a-l]==null){var d=!1;s>>i&1)==1);var h=je.getMask(t,n,a-l);h&&(d=!d),this.modules[n][a-l]=d,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};kt.PAD0=236;kt.PAD1=17;kt.createData=function(e,t,r){for(var n=Mt.getRSBlocks(e,t),i=new Ac,s=0;sl*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+l*8+")");for(i.getLengthInBits()+4<=l*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=l*8||(i.put(kt.PAD0,8),i.getLengthInBits()>=l*8));)i.put(kt.PAD1,8);return kt.createBytes(i,n)};kt.createBytes=function(e,t){for(var r=0,n=0,i=0,s=new Array(t.length),a=new Array(t.length),l=0;l=0?C.get(x):0}}for(var B=0,m=0;m=0;)t^=je.G15<=0;)t^=je.G18<>>=1;return t},getPatternPosition:function(e){return je.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,r){switch(e){case Ot.PATTERN000:return(t+r)%2==0;case Ot.PATTERN001:return t%2==0;case Ot.PATTERN010:return r%3==0;case Ot.PATTERN011:return(t+r)%3==0;case Ot.PATTERN100:return(Math.floor(t/2)+Math.floor(r/3))%2==0;case Ot.PATTERN101:return t*r%2+t*r%3==0;case Ot.PATTERN110:return(t*r%2+t*r%3)%2==0;case Ot.PATTERN111:return(t*r%3+(t+r)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new Dr([1],0),r=0;r5&&(r+=3+s-5)}for(var n=0;n=256;)e-=255;return Je.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var Ze=0;Ze<8;Ze++)Je.EXP_TABLE[Ze]=1<>>7-e%8&1)==1},put:function(e,t){for(var r=0;r>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var as=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function Tc(e){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof e=="string"&&(e={content:e}),e)for(var t in e)this.options[t]=e[t];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(d){switch(d){case"L":return Bt.L;case"M":return Bt.M;case"Q":return Bt.Q;case"H":return Bt.H;default:throw new Error("Unknwon error correction level: "+d)}}function n(d,h){for(var m=i(d),R=1,y=0,C=0,x=as.length;C<=x;C++){var B=as[C];if(!B)throw new Error("Content too long: expected "+y+" but got "+m);switch(h){case"L":y=B[0];break;case"M":y=B[1];break;case"Q":y=B[2];break;case"H":y=B[3];break;default:throw new Error("Unknwon error correction level: "+h)}if(m<=y)break;R++}if(R>as.length)throw new Error("Content too long");return R}function i(d){var h=encodeURI(d).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return h.length+(h.length!=d?3:0)}var s=this.options.content,a=n(s,this.options.ecl),l=r(this.options.ecl);this.qrcode=new kt(a,l),this.qrcode.addData(s),this.qrcode.make()}Tc.prototype.svg=function(e){var t=this.options||{},r=this.qrcode.modules;typeof e>"u"&&(e={container:t.container||"svg"});for(var n=typeof t.pretty<"u"?!!t.pretty:!0,i=n?" ":"",s=n?`\r +`:"",a=t.width,l=t.height,d=r.length,h=a/(d+2*t.padding),m=l/(d+2*t.padding),R=typeof t.join<"u"?!!t.join:!1,y=typeof t.swap<"u"?!!t.swap:!1,C=typeof t.xmlDeclaration<"u"?!!t.xmlDeclaration:!0,x=typeof t.predefined<"u"?!!t.predefined:!1,B=x?i+''+s:"",O=i+''+s,M="",T="",N=0;N'+s:M+=i+''+s}}R&&(M=i+'');let X="";if(this.options.image!==void 0&&this.options.image.svg){const S=a*this.options.image.width/100,o=l*this.options.image.height/100,u=a/2-S/2,f=l/2-o/2;X+=``,X+=this.options.image.svg+s,X+=""}var ne="";switch(e.container){case"svg":C&&(ne+=''+s),ne+=''+s,ne+=B+O+M,ne+=X,ne+="";break;case"svg-viewbox":C&&(ne+=''+s),ne+=''+s,ne+=B+O+M,ne+=X,ne+="";break;case"g":ne+=''+s,ne+=B+O+M,ne+=X,ne+="";break;default:ne+=(B+O+M+X).replace(/^\s+/,"");break}return ne};var Zh=Tc,Kh=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ki,"__esModule",{value:!0});ki.QRCode=void 0;const Qh=tt,qo=Ei,Yh=Kh(Zh),Xh=e=>{const[t,r]=(0,qo.useState)("");return(0,qo.useEffect)(()=>{var n,i;const s=new Yh.default({content:e.content,background:e.bgColor||"#ffffff",color:e.fgColor||"#000000",container:"svg",ecl:"M",width:(n=e.width)!==null&&n!==void 0?n:256,height:(i=e.height)!==null&&i!==void 0?i:256,padding:0,image:e.image}),a=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${a}`)},[e.bgColor,e.content,e.fgColor,e.height,e.image,e.width]),t?(0,Qh.h)("img",{src:t,alt:"QR Code"}):null};ki.QRCode=Xh;var Ci={},Gs={};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var ed=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ci,"__esModule",{value:!0});Ci.Spinner=void 0;const Wn=tt,td=ed(Gs),rd=e=>{var t;const r=(t=e.size)!==null&&t!==void 0?t:64,n=e.color||"#000";return(0,Wn.h)("div",{class:"-cbwsdk-spinner"},(0,Wn.h)("style",null,td.default),(0,Wn.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,Wn.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Ci.Spinner=rd;var Zs={};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var Nc=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Vr,"__esModule",{value:!0});Vr.CoinbaseWalletSteps=Vr.ConnectContent=void 0;const hr=Nc(Cn),oe=tt,nd=q,id=Qr,sd=Si,od=Ri,ad=Mi,cd=ki,ld=Ci,ud=Nc(Zs),cs={title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",steps:Lc},hd=e=>e==="light"?"#FFFFFF":"#0A0B0D";function dd(e){const{theme:t}=e,r=(0,nd.createQrUrl)(e.sessionId,e.sessionSecret,e.linkAPIUrl,e.isParentConnection,e.version,e.chainId),n=cs.steps;return(0,oe.h)("div",{"data-testid":"connect-content",className:(0,hr.default)("-cbwsdk-connect-content",t)},(0,oe.h)("style",null,ud.default),(0,oe.h)("div",{className:"-cbwsdk-connect-content-header"},(0,oe.h)("h2",{className:(0,hr.default)("-cbwsdk-connect-content-heading",t)},"Scan to connect with our mobile app"),e.onCancel&&(0,oe.h)("button",{type:"button",className:"-cbwsdk-cancel-button",onClick:e.onCancel},(0,oe.h)(sd.CloseIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,oe.h)("div",{className:"-cbwsdk-connect-content-layout"},(0,oe.h)("div",{className:"-cbwsdk-connect-content-column-left"},(0,oe.h)(fd,{title:cs.title,description:cs.description,theme:t})),(0,oe.h)("div",{className:"-cbwsdk-connect-content-column-right"},(0,oe.h)("div",{className:"-cbwsdk-connect-content-qr-wrapper"},(0,oe.h)(cd.QRCode,{content:r,width:200,height:200,fgColor:"#000",bgColor:"transparent"}),(0,oe.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:id.LIB_VERSION}),(0,oe.h)("input",{type:"hidden",value:r})),(0,oe.h)(n,{theme:t}),!e.isConnected&&(0,oe.h)("div",{"data-testid":"connecting-spinner",className:(0,hr.default)("-cbwsdk-connect-content-qr-connecting",t)},(0,oe.h)(ld.Spinner,{size:36,color:t==="dark"?"#FFF":"#000"}),(0,oe.h)("p",null,"Connecting...")))))}Vr.ConnectContent=dd;function fd({title:e,description:t,theme:r}){return(0,oe.h)("div",{className:(0,hr.default)("-cbwsdk-connect-item",r)},(0,oe.h)("div",null,(0,oe.h)(od.CoinbaseWalletRound,null)),(0,oe.h)("div",{className:"-cbwsdk-connect-item-copy-wrapper"},(0,oe.h)("h3",{className:"-cbwsdk-connect-item-title"},e),(0,oe.h)("p",{className:"-cbwsdk-connect-item-description"},t)))}function Lc({theme:e}){return(0,oe.h)("ol",{className:"-cbwsdk-wallet-steps"},(0,oe.h)("li",{className:(0,hr.default)("-cbwsdk-wallet-steps-item",e)},(0,oe.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,oe.h)("li",{className:(0,hr.default)("-cbwsdk-wallet-steps-item",e)},(0,oe.h)("div",{className:"-cbwsdk-wallet-steps-item-wrapper"},(0,oe.h)("span",null,"Tap ",(0,oe.h)("strong",null,"Scan")," "),(0,oe.h)("span",{className:(0,hr.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",e)},(0,oe.h)(ad.QRCodeIcon,{fill:hd(e)})))))}Vr.CoinbaseWalletSteps=Lc;var Ii={},xi={};Object.defineProperty(xi,"__esModule",{value:!0});xi.ArrowLeftIcon=void 0;const Jo=tt;function pd(e){return(0,Jo.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},e),(0,Jo.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}xi.ArrowLeftIcon=pd;var Ai={};Object.defineProperty(Ai,"__esModule",{value:!0});Ai.LaptopIcon=void 0;const ls=tt;function gd(e){return(0,ls.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,ls.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,ls.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Ai.LaptopIcon=gd;var Ti={};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.SafeIcon=void 0;const Go=tt;function md(e){return(0,Go.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},e),(0,Go.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Ti.SafeIcon=md;var Ks={};Object.defineProperty(Ks,"__esModule",{value:!0});Ks.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var Oc=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ii,"__esModule",{value:!0});Ii.TryExtensionContent=void 0;const rr=Oc(Cn),We=tt,us=Ei,vd=xi,bd=Ai,wd=Ti,_d=Oc(Ks);function yd({theme:e}){const[t,r]=(0,us.useState)(!1),n=(0,us.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,us.useCallback)(()=>{t?window.location.reload():(n(),r(!0))},[n,t]);return(0,We.h)("div",{class:(0,rr.default)("-cbwsdk-try-extension",e)},(0,We.h)("style",null,_d.default),(0,We.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,We.h)("h3",{class:(0,rr.default)("-cbwsdk-try-extension-heading",e)},"Or try the Coinbase Wallet browser extension"),(0,We.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,We.h)("button",{class:(0,rr.default)("-cbwsdk-try-extension-cta",e),onClick:i},t?"Refresh":"Install"),(0,We.h)("div",null,!t&&(0,We.h)(vd.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:e==="light"?"#0052FF":"#588AF5"})))),(0,We.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,We.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,We.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,We.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,We.h)("span",{class:(0,rr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,We.h)(bd.LaptopIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,We.h)("div",{class:(0,rr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Connect with dapps with just one click on your desktop browser")),(0,We.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,We.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,We.h)("span",{class:(0,rr.default)("-cbwsdk-try-extension-list-item-icon",e)},(0,We.h)(wd.SafeIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,We.h)("div",{class:(0,rr.default)("-cbwsdk-try-extension-list-item-copy",e)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}Ii.TryExtensionContent=yd;var Qs={};Object.defineProperty(Qs,"__esModule",{value:!0});Qs.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var Pc=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(yi,"__esModule",{value:!0});yi.ConnectDialog=void 0;const hs=Pc(Cn),nr=tt,ds=Ei,Ed=Vr,Sd=Ii,Rd=Pc(Qs),Md=e=>{const{isOpen:t,darkMode:r}=e,[n,i]=(0,ds.useState)(!t),[s,a]=(0,ds.useState)(!t);(0,ds.useEffect)(()=>{const d=[window.setTimeout(()=>{a(!t)},10)];return t?i(!1):d.push(window.setTimeout(()=>{i(!0)},360)),()=>{d.forEach(window.clearTimeout)}},[t]);const l=r?"dark":"light";return(0,nr.h)("div",{class:(0,hs.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,nr.h)("style",null,Rd.default),(0,nr.h)("div",{class:(0,hs.default)("-cbwsdk-connect-dialog-backdrop",l,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,nr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,nr.h)("div",{class:(0,hs.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},e.connectDisabled?null:(0,nr.h)(Ed.ConnectContent,{theme:l,version:e.version,sessionId:e.sessionId,sessionSecret:e.sessionSecret,linkAPIUrl:e.linkAPIUrl,isConnected:e.isConnected,isParentConnection:e.isParentConnection,chainId:e.chainId,onCancel:e.onCancel}),(0,nr.h)(Sd.TryExtensionContent,{theme:l}))))};yi.ConnectDialog=Md;Object.defineProperty(_i,"__esModule",{value:!0});_i.LinkFlow=void 0;const fs=tt,kd=yi;class Cd{constructor(t){this.connected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=t.darkMode,this.version=t.version,this.sessionId=t.sessionId,this.sessionSecret=t.sessionSecret,this.linkAPIUrl=t.linkAPIUrl,this.isParentConnection=t.isParentConnection}attach(t){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",t.appendChild(this.root),this.render()}setConnected(t){this.connected!==t&&(this.connected=t,this.render())}setChainId(t){this.chainId!==t&&(this.chainId=t,this.render())}detach(){var t;this.root&&((0,fs.render)(null,this.root),(t=this.root.parentElement)===null||t===void 0||t.removeChild(this.root))}setConnectDisabled(t){this.connectDisabled=t}open(t){this.isOpen=!0,this.onCancel=t.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){this.root&&(0,fs.render)((0,fs.h)(kd.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.connected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)}}_i.LinkFlow=Cd;var Ys={},Xs={};Object.defineProperty(Xs,"__esModule",{value:!0});Xs.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=Q&&Q.__importDefault||function(R){return R&&R.__esModule?R:{default:R}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(Cn),n=tt,i=Ei,s=t(Xs),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",l="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class d{constructor(y){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=y.darkMode}attach(y){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",y.appendChild(this.root),this.render()}presentItem(y){const C=this.nextItemKey++;return this.items.set(C,y),this.render(),()=>{this.items.delete(C),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([y,C])=>(0,n.h)(e.SnackbarInstance,Object.assign({},C,{key:y}))))),this.root)}}e.Snackbar=d;const h=R=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},R.children));e.SnackbarContainer=h;const m=({autoExpand:R,message:y,menuItems:C})=>{const[x,B]=(0,i.useState)(!0),[O,M]=(0,i.useState)(R??!1);(0,i.useEffect)(()=>{const N=[window.setTimeout(()=>{B(!1)},1),window.setTimeout(()=>{M(!0)},1e4)];return()=>{N.forEach(window.clearTimeout)}});const T=()=>{M(!O)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",x&&"-cbwsdk-snackbar-instance-hidden",O&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:T},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},y),(0,n.h)("div",{class:"-gear-container"},!O&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:l,class:"-gear-icon",title:"Expand"}))),C&&C.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},C.map((N,D)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",N.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:N.onClick,key:D},(0,n.h)("svg",{width:N.svgWidth,height:N.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":N.defaultFillRule,"clip-rule":N.defaultClipRule,d:N.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",N.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},N.info)))))};e.SnackbarInstance=m})(Ys);Object.defineProperty(Mn,"__esModule",{value:!0});Mn.WalletLinkRelayUI=void 0;const Id=kn,xd=_i,Ad=Ys;class Td{constructor(t){this.standalone=null,this.attached=!1,this.snackbar=new Ad.Snackbar({darkMode:t.darkMode}),this.linkFlow=new xd.LinkFlow({darkMode:t.darkMode,version:t.version,sessionId:t.session.id,sessionSecret:t.session.secret,linkAPIUrl:t.linkAPIUrl,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,Id.injectCssReset)()}setConnected(t){this.linkFlow.setConnected(t)}setChainId(t){this.linkFlow.setChainId(t)}setConnectDisabled(t){this.linkFlow.setConnectDisabled(t)}addEthereumChain(){}watchAsset(){}switchEthereumChain(){}requestEthereumAccounts(t){this.linkFlow.open({onCancel:t.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(t){this.standalone=t}isStandalone(){var t;return(t=this.standalone)!==null&&t!==void 0?t:!1}}Mn.WalletLinkRelayUI=Td;Object.defineProperty(_n,"__esModule",{value:!0});_n.WalletLinkRelay=void 0;const Lr=gn,Nd=Ve,Fe=q,ir=Yr,Zo=ht,Pt=Xr,Ld=vi,sr=Kr,Od=Mn;class Tt extends Zo.RelayAbstract{constructor(t){var r;super(),this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{var l;this.isLinked=a;const d=this.storage.getItem(Zo.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this.session.linked=a),this.isUnlinkedErrorState=!1,d){const h=d.split(" "),m=this.storage.getItem("IsStandaloneSigning")==="true";if(h[0]!==""&&!a&&this.session.linked&&!m){this.isUnlinkedErrorState=!0;const R=this.getSessionIdHash();(l=this.diagnostic)===null||l===void 0||l.log(ir.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:R})}}},this.metadataUpdated=(a,l)=>{this.storage.setItem(a,l)},this.chainUpdated=(a,l)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===l||(this.chainCallbackParams={chainId:a,jsonRpcUrl:l},this.chainCallback&&this.chainCallback(a,l))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),Tt.accountRequestCallbackIds.size>0&&(Array.from(Tt.accountRequestCallbackIds.values()).forEach(l=>{const d={type:"WEB3_RESPONSE",id:l,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},d),{id:l}))}),Tt.accountRequestCallbackIds.clear())},this.connectedUpdated=a=>{this.ui.setConnected(a)},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage,this.options=t;const{session:n,ui:i,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this._reloadOnDisconnect=(r=t.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){const t=Pt.Session.load(this.storage)||new Pt.Session(this.storage).save(),{linkAPIUrl:r,diagnostic:n}=this,i=new Ld.WalletLinkConnection({session:t,linkAPIUrl:r,diagnostic:n,listener:this}),{version:s,darkMode:a}=this.options,l=this.options.uiConstructor({linkAPIUrl:r,version:s,darkMode:a,session:t});return i.connect(),{session:t,ui:l,connection:i}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{var t,r;const n=this.ui.isStandalone();(t=this.diagnostic)===null||t===void 0||t.log(ir.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const i=Pt.Session.load(this.storage);if((i==null?void 0:i.id)===this._session.id?this.storage.clear():i&&((r=this.diagnostic)===null||r===void 0||r.log(ir.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Pt.Session.hash(i.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0);const{session:s,ui:a,connection:l}=this.subscribe();this._session=s,this.connection=l,this.ui=a,n&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.options.headlessMode||this.attachUI()}).catch(t=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(ir.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${t}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}get session(){return this._session}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,Fe.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,Fe.hexStringFromBuffer)(t,!0),signature:(0,Fe.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Fe.bigIntStringFromBN)(t.weiValue),data:(0,Fe.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,Fe.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,Fe.bigIntStringFromBN)(t.weiValue),data:(0,Fe.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,Fe.bigIntStringFromBN)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,Fe.bigIntStringFromBN)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,Fe.bigIntStringFromBN)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,Fe.bigIntStringFromBN)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,Fe.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getQRCodeUrl(){return(0,Fe.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,Fe.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,a),r==null||r()};return{promise:new Promise((a,l)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,d=>{if(r==null||r(),(0,sr.isErrorResponse)(d))return l(new Error(d.errorMessage));a(d)}),this.ui.isStandalone()?this.sendRequestStandalone(n,t):this.publishWeb3RequestEvent(n,t)}),cancel:i}}setConnectDisabled(t){this.ui.setConnectDisabled(t)}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t,this.ui instanceof Od.WalletLinkRelayUI&&this.ui.setChainId(t)}publishWeb3RequestEvent(t,r){var n;const i={type:"WEB3_REQUEST",id:t,request:r},s=Pt.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(ir.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Pt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.publishEvent("Web3Request",i,!0).then(a=>{var l;(l=this.diagnostic)===null||l===void 0||l.log(ir.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${r.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Pt.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})}).catch(a=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i.id,response:{method:r.method,errorMessage:a.message}})})}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){var r;const{response:n}=t;if((r=this.diagnostic)===null||r===void 0||r.log(ir.EVENTS.WEB3_RESPONSE,{eventId:t.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),n.method==="requestEthereumAccounts"){Tt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},t),{id:i}))),Tt.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n,i){var s;const a=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Lr.getMessageFromCode)(i);this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:a,errorCode:i}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Fe.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,t.method,s)};return{promise:new Promise((s,a)=>{if(this.relayEventManager.callbacks.set(r,l=>{if(this.ui.hideRequestEthereumAccounts(),(0,sr.isErrorResponse)(l))return a(new Error(l.errorMessage));s(l)}),this.ui.inlineAccountsResponse()){const l=d=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r,response:{method:"requestEthereumAccounts",result:d}})};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:l})}else{const l=Lr.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(l)})}Tt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,t)}),cancel:n}}selectProvider(t){const r={method:"selectProvider",params:{providerOptions:t}},n=(0,Fe.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,a)},s=new Promise((a,l)=>{this.relayEventManager.callbacks.set(n,m=>{if((0,sr.isErrorResponse)(m))return l(new Error(m.errorMessage));a(m)});const d=m=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:Nd.ProviderType.Unselected}})},h=m=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n,response:{method:"selectProvider",result:m}})};this.ui.selectProvider&&this.ui.selectProvider({onApprove:h,onCancel:d,providerOptions:t})});return{cancel:i,promise:s}}watchAsset(t,r,n,i,s,a){const l={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:i,image:s},chainId:a}};let d=null;const h=(0,Fe.randomBytesHex)(8),m=y=>{this.publishWeb3RequestCanceledEvent(h),this.handleErrorResponse(h,l.method,y),d==null||d()};this.ui.inlineWatchAsset()||(d=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:m,onResetConnection:this.resetAndReload}));const R=new Promise((y,C)=>{this.relayEventManager.callbacks.set(h,O=>{if(d==null||d(),(0,sr.isErrorResponse)(O))return C(new Error(O.errorMessage));y(O)});const x=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:h,response:{method:"watchAsset",result:!1}})},B=()=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:h,response:{method:"watchAsset",result:!0}})};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:B,onCancel:x,type:t,address:r,symbol:n,decimals:i,image:s,chainId:a}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(h,l)});return{cancel:m,promise:R}}addEthereumChain(t,r,n,i,s,a){const l={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:a}};let d=null;const h=(0,Fe.randomBytesHex)(8),m=y=>{this.publishWeb3RequestCanceledEvent(h),this.handleErrorResponse(h,l.method,y),d==null||d()};return this.ui.inlineAddEthereumChain(t)||(d=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:m,onResetConnection:this.resetAndReload})),{promise:new Promise((y,C)=>{this.relayEventManager.callbacks.set(h,O=>{if(d==null||d(),(0,sr.isErrorResponse)(O))return C(new Error(O.errorMessage));y(O)});const x=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:h,response:{method:"addEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},B=O=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:h,response:{method:"addEthereumChain",result:{isApproved:!0,rpcUrl:O}}})};this.ui.inlineAddEthereumChain(t)&&this.ui.addEthereumChain({onCancel:x,onApprove:B,chainId:l.params.chainId,rpcUrls:l.params.rpcUrls,blockExplorerUrls:l.params.blockExplorerUrls,chainName:l.params.chainName,iconUrls:l.params.iconUrls,nativeCurrency:l.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(t)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(h,l)}),cancel:m}}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},i=(0,Fe.randomBytesHex)(8),s=l=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,l)};return{promise:new Promise((l,d)=>{this.relayEventManager.callbacks.set(i,R=>{if((0,sr.isErrorResponse)(R)&&R.errorCode)return d(Lr.standardErrors.provider.custom({code:R.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,sr.isErrorResponse)(R))return d(new Error(R.errorMessage));l(R)});const h=R=>{var y;if(R){const C=(y=(0,Lr.getErrorCode)(R))!==null&&y!==void 0?y:Lr.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,"switchEthereumChain",R instanceof Error?R:Lr.standardErrors.provider.unsupportedChain(t),C)}else this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!1,rpcUrl:""}}})},m=R=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:i,response:{method:"switchEthereumChain",result:{isApproved:!0,rpcUrl:R}}})};this.ui.switchEthereumChain({onCancel:h,onApprove:m,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(t){return this.ui.inlineAddEthereumChain(t)}getSessionIdHash(){return Pt.Session.hash(this._session.id)}sendRequestStandalone(t,r){const n=s=>{this.handleErrorResponse(t,r.method,s)},i=s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:s})};switch(r.method){case"signEthereumMessage":this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case"signEthereumTransaction":this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"submitEthereumTransaction":this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case"ethereumAddressFromSignedMessage":this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}}_n.WalletLinkRelay=Tt;Tt.accountRequestCallbackIds=new Set;var In={},Ni={},$c={};(function(e){var t=Q&&Q.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var l=Object.getOwnPropertyDescriptor(i,s);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,l)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=Q&&Q.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ys,e)})($c);var eo={};Object.defineProperty(eo,"__esModule",{value:!0});eo.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Bc=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ni,"__esModule",{value:!0});Ni.RedirectDialog=void 0;const Pd=Bc(Cn),Rt=tt,$d=kn,Bd=$c,Dd=Bc(eo);class Fd{constructor(){this.root=null}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,$d.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Rt.render)(null,this.root),t&&(0,Rt.render)((0,Rt.h)(jd,Object.assign({},t,{onDismiss:()=>{this.clear()}})),this.root))}}Ni.RedirectDialog=Fd;const jd=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:i})=>{const s=r?"dark":"light";return(0,Rt.h)(Bd.SnackbarContainer,{darkMode:r},(0,Rt.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Rt.h)("style",null,Dd.default),(0,Rt.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Rt.h)("div",{class:(0,Pd.default)("-cbwsdk-redirect-dialog-box",s)},(0,Rt.h)("p",null,e),(0,Rt.h)("button",{onClick:n},t))))};Object.defineProperty(In,"__esModule",{value:!0});In.MobileRelayUI=void 0;const Hd=Ni;class Ud{constructor(t){this.attached=!1,this.darkMode=!1,this.redirectDialog=new Hd.RedirectDialog,this.darkMode=t.darkMode}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}setConnected(t){}redirectToCoinbaseWallet(t){const r=new URL("https://go.cb-w.com/walletlink");r.searchParams.append("redirect_url",window.location.href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",darkMode:this.darkMode,onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}hideRequestEthereumAccounts(){this.redirectDialog.clear()}requestEthereumAccounts(){}addEthereumChain(){}watchAsset(){}selectProvider(){}switchEthereumChain(){}signEthereumMessage(){}signEthereumTransaction(){}submitEthereumTransaction(){}ethereumAddressFromSignedMessage(){}reloadUI(){}setStandalone(){}setConnectDisabled(){}inlineAccountsResponse(){return!1}inlineAddEthereumChain(){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}isStandalone(){return!1}}In.MobileRelayUI=Ud;Object.defineProperty(wn,"__esModule",{value:!0});wn.MobileRelay=void 0;const Wd=q,Vd=_n,zd=In;class qd extends Vd.WalletLinkRelay{constructor(t){var r;super(t),this._enableMobileWalletLink=(r=t.enableMobileWalletLink)!==null&&r!==void 0?r:!1}requestEthereumAccounts(){return this._enableMobileWalletLink?super.requestEthereumAccounts():{promise:new Promise(()=>{const t=(0,Wd.getLocation)();t.href=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(t.href)}`}),cancel:()=>{}}}publishWeb3RequestEvent(t,r){if(super.publishWeb3RequestEvent(t,r),!(this._enableMobileWalletLink&&this.ui instanceof zd.MobileRelayUI))return;let n=!1;switch(r.method){case"requestEthereumAccounts":case"connectAndSignIn":n=!0,this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());break;case"switchEthereumChain":return;default:n=!0,this.ui.openCoinbaseWalletDeeplink();break}n&&window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0})}handleWeb3ResponseMessage(t){super.handleWeb3ResponseMessage(t)}connectAndSignIn(t){if(!this._enableMobileWalletLink)throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");return this.sendRequest({method:"connectAndSignIn",params:{appName:this.appName,appLogoUrl:this.appLogoUrl,domain:window.location.hostname,aud:window.location.href,version:"1",type:"eip4361",nonce:t.nonce,iat:new Date().toISOString(),chainId:`eip155:${this.dappDefaultChain}`,statement:t.statement,resources:t.resources}})}}wn.MobileRelay=qd;var $s={exports:{}},Dc=si.EventEmitter,ps,Ko;function Jd(){if(Ko)return ps;Ko=1;function e(x,B){var O=Object.keys(x);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(x);B&&(M=M.filter(function(T){return Object.getOwnPropertyDescriptor(x,T).enumerable})),O.push.apply(O,M)}return O}function t(x){for(var B=1;B0?this.tail.next=M:this.head=M,this.tail=M,++this.length}},{key:"unshift",value:function(O){var M={data:O,next:this.head};this.length===0&&(this.tail=M),this.head=M,++this.length}},{key:"shift",value:function(){if(this.length!==0){var O=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,O}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(O){if(this.length===0)return"";for(var M=this.head,T=""+M.data;M=M.next;)T+=O+M.data;return T}},{key:"concat",value:function(O){if(this.length===0)return h.alloc(0);for(var M=h.allocUnsafe(O>>>0),T=this.head,N=0;T;)C(T.data,M,N),N+=T.data.length,T=T.next;return M}},{key:"consume",value:function(O,M){var T;return OD.length?D.length:O;if(L===D.length?N+=D:N+=D.slice(0,O),O-=L,O===0){L===D.length?(++T,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=D.slice(L));break}++T}return this.length-=T,N}},{key:"_getBuffer",value:function(O){var M=h.allocUnsafe(O),T=this.head,N=1;for(T.data.copy(M),O-=T.data.length;T=T.next;){var D=T.data,L=O>D.length?D.length:O;if(D.copy(M,M.length-O,0,L),O-=L,O===0){L===D.length?(++N,T.next?this.head=T.next:this.head=this.tail=null):(this.head=T,T.data=D.slice(L));break}++N}return this.length-=N,M}},{key:y,value:function(O,M){return R(this,t(t({},M),{},{depth:0,customInspect:!1}))}}]),x}(),ps}var or={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};function Gd(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,or.nextTick(Bs,this,e)):or.nextTick(Bs,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(s){!t&&s?r._writableState?r._writableState.errorEmitted?or.nextTick(Xn,r):(r._writableState.errorEmitted=!0,or.nextTick(Qo,r,s)):or.nextTick(Qo,r,s):t?(or.nextTick(Xn,r),t(s)):or.nextTick(Xn,r)}),this)}function Qo(e,t){Bs(e,t),Xn(e)}function Xn(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Zd(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Bs(e,t){e.emit("error",t)}function Kd(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Fc={destroy:Gd,undestroy:Zd,errorOrDestroy:Kd},mr={};function Qd(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var jc={};function pt(e,t,r){r||(r=Error);function n(s,a,l){return typeof t=="string"?t:t(s,a,l)}var i=function(s){Qd(a,s);function a(l,d,h){return s.call(this,n(l,d,h))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=e,jc[e]=i}function Yo(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function Yd(e,t,r){return e.substr(0,t.length)===t}function Xd(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function ef(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}pt("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);pt("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&Yd(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var i;if(Xd(e," argument"))i="The ".concat(e," ").concat(n," ").concat(Yo(t,"type"));else{var s=ef(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(s," ").concat(n," ").concat(Yo(t,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);pt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");pt("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});pt("ERR_STREAM_PREMATURE_CLOSE","Premature close");pt("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});pt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");pt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");pt("ERR_STREAM_WRITE_AFTER_END","write after end");pt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);pt("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);pt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");mr.codes=jc;var tf=mr.codes.ERR_INVALID_OPT_VALUE;function rf(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function nf(e,t,r,n){var i=rf(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new tf(s,i)}return Math.floor(i)}return e.objectMode?16:16*1024}var Hc={getHighWaterMark:nf},sf=of;function of(e,t){if(gs("noDeprecation"))return e;var r=!1;function n(){if(!r){if(gs("throwDeprecation"))throw new Error(t);gs("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function gs(e){try{if(!globalThis.localStorage)return!1}catch{return!1}var t=globalThis.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var ms,Xo;function Uc(){if(Xo)return ms;Xo=1;var e={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};ms=Z;function t(A){var I=this;this.next=null,this.entry=null,this.finish=function(){V(I,A)}}var r;Z.WritableState=W;var n={deprecate:sf},i=Dc,s=ii.Buffer,a=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function l(A){return s.from(A)}function d(A){return s.isBuffer(A)||A instanceof a}var h=Fc,m=Hc,R=m.getHighWaterMark,y=mr.codes,C=y.ERR_INVALID_ARG_TYPE,x=y.ERR_METHOD_NOT_IMPLEMENTED,B=y.ERR_MULTIPLE_CALLBACK,O=y.ERR_STREAM_CANNOT_PIPE,M=y.ERR_STREAM_DESTROYED,T=y.ERR_STREAM_NULL_VALUES,N=y.ERR_STREAM_WRITE_AFTER_END,D=y.ERR_UNKNOWN_ENCODING,L=h.errorOrDestroy;vt(Z,i);function F(){}function W(A,I,$){r=r||zr(),A=A||{},typeof $!="boolean"&&($=I instanceof r),this.objectMode=!!A.objectMode,$&&(this.objectMode=this.objectMode||!!A.writableObjectMode),this.highWaterMark=R(this,A,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var K=A.decodeStrings===!1;this.decodeStrings=!K,this.defaultEncoding=A.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(G){p(I,G)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=A.emitClose!==!1,this.autoDestroy=!!A.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}W.prototype.getBuffer=function(){for(var I=this.bufferedRequest,$=[];I;)$.push(I),I=I.next;return $},function(){try{Object.defineProperty(W.prototype,"buffer",{get:n.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var te;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(te=Function.prototype[Symbol.hasInstance],Object.defineProperty(Z,Symbol.hasInstance,{value:function(I){return te.call(this,I)?!0:this!==Z?!1:I&&I._writableState instanceof W}})):te=function(I){return I instanceof this};function Z(A){r=r||zr();var I=this instanceof r;if(!I&&!te.call(Z,this))return new Z(A);this._writableState=new W(A,this,I),this.writable=!0,A&&(typeof A.write=="function"&&(this._write=A.write),typeof A.writev=="function"&&(this._writev=A.writev),typeof A.destroy=="function"&&(this._destroy=A.destroy),typeof A.final=="function"&&(this._final=A.final)),i.call(this)}Z.prototype.pipe=function(){L(this,new O)};function z(A,I){var $=new N;L(A,$),e.nextTick(I,$)}function X(A,I,$,K){var G;return $===null?G=new T:typeof $!="string"&&!I.objectMode&&(G=new C("chunk",["string","Buffer"],$)),G?(L(A,G),e.nextTick(K,G),!1):!0}Z.prototype.write=function(A,I,$){var K=this._writableState,G=!1,b=!K.objectMode&&d(A);return b&&!s.isBuffer(A)&&(A=l(A)),typeof I=="function"&&($=I,I=null),b?I="buffer":I||(I=K.defaultEncoding),typeof $!="function"&&($=F),K.ending?z(this,$):(b||X(this,K,A,$))&&(K.pendingcb++,G=S(this,K,b,A,I,$)),G},Z.prototype.cork=function(){this._writableState.corked++},Z.prototype.uncork=function(){var A=this._writableState;A.corked&&(A.corked--,!A.writing&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&k(this,A))},Z.prototype.setDefaultEncoding=function(I){if(typeof I=="string"&&(I=I.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((I+"").toLowerCase())>-1))throw new D(I);return this._writableState.defaultEncoding=I,this},Object.defineProperty(Z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ne(A,I,$){return!A.objectMode&&A.decodeStrings!==!1&&typeof I=="string"&&(I=s.from(I,$)),I}Object.defineProperty(Z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function S(A,I,$,K,G,b){if(!$){var _=ne(I,K,G);K!==_&&($=!0,G="buffer",K=_)}var P=I.objectMode?1:K.length;I.length+=P;var j=I.length>5===6?2:M>>4===14?3:M>>3===30?4:M>>6===2?-1:-2}function a(M,T,N){var D=T.length-1;if(D=0?(L>0&&(M.lastNeed=L-1),L):--D=0?(L>0&&(M.lastNeed=L-2),L):--D=0?(L>0&&(L===2?L=0:M.lastNeed=L-3),L):0))}function l(M,T,N){if((T[0]&192)!==128)return M.lastNeed=0,"�";if(M.lastNeed>1&&T.length>1){if((T[1]&192)!==128)return M.lastNeed=1,"�";if(M.lastNeed>2&&T.length>2&&(T[2]&192)!==128)return M.lastNeed=2,"�"}}function d(M){var T=this.lastTotal-this.lastNeed,N=l(this,M);if(N!==void 0)return N;if(this.lastNeed<=M.length)return M.copy(this.lastChar,T,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,T,0,M.length),this.lastNeed-=M.length}function h(M,T){var N=a(this,M,T);if(!this.lastNeed)return M.toString("utf8",T);this.lastTotal=N;var D=M.length-(N-this.lastNeed);return M.copy(this.lastChar,0,D),M.toString("utf8",T,D)}function m(M){var T=M&&M.length?this.write(M):"";return this.lastNeed?T+"�":T}function R(M,T){if((M.length-T)%2===0){var N=M.toString("utf16le",T);if(N){var D=N.charCodeAt(N.length-1);if(D>=55296&&D<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],N.slice(0,-1)}return N}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",T,M.length-1)}function y(M){var T=M&&M.length?this.write(M):"";if(this.lastNeed){var N=this.lastTotal-this.lastNeed;return T+this.lastChar.toString("utf16le",0,N)}return T}function C(M,T){var N=(M.length-T)%3;return N===0?M.toString("base64",T):(this.lastNeed=3-N,this.lastTotal=3,N===1?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",T,M.length-N))}function x(M){var T=M&&M.length?this.write(M):"";return this.lastNeed?T+this.lastChar.toString("base64",0,3-this.lastNeed):T}function B(M){return M.toString(this.encoding)}function O(M){return M&&M.length?this.write(M):""}return bs}var na=mr.codes.ERR_STREAM_PREMATURE_CLOSE;function af(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof _!="string"&&!J.objectMode&&Object.getPrototypeOf(_)!==i.prototype&&(_=a(_)),j)J.endEmitted?F(b,new T):ne(b,J,_,!0);else if(J.ended)F(b,new O);else{if(J.destroyed)return!1;J.reading=!1,J.decoder&&!P?(_=J.decoder.write(_),J.objectMode||_.length!==0?ne(b,J,_,!1):k(b,J)):ne(b,J,_,!1)}else j||(J.reading=!1,k(b,J))}return!J.ended&&(J.length=o?b=o:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function f(b,_){return b<=0||_.length===0&&_.ended?0:_.objectMode?1:b!==b?_.flowing&&_.length?_.buffer.head.data.length:_.length:(b>_.highWaterMark&&(_.highWaterMark=u(b)),b<=_.length?b:_.ended?_.length:(_.needReadable=!0,0))}z.prototype.read=function(b){h("read",b),b=parseInt(b,10);var _=this._readableState,P=b;if(b!==0&&(_.emittedReadable=!1),b===0&&_.needReadable&&((_.highWaterMark!==0?_.length>=_.highWaterMark:_.length>0)||_.ended))return h("read: emitReadable",_.length,_.ended),_.length===0&&_.ended?$(this):v(this),null;if(b=f(b,_),b===0&&_.ended)return _.length===0&&$(this),null;var j=_.needReadable;h("need readable",j),(_.length===0||_.length-b<_.highWaterMark)&&(j=!0,h("length less than watermark",j)),_.ended||_.reading?(j=!1,h("reading or ended",j)):j&&(h("do read"),_.reading=!0,_.sync=!0,_.length===0&&(_.needReadable=!0),this._read(_.highWaterMark),_.sync=!1,_.reading||(b=f(P,_)));var ue;return b>0?ue=I(b,_):ue=null,ue===null?(_.needReadable=_.length<=_.highWaterMark,b=0):(_.length-=b,_.awaitDrain=0),_.length===0&&(_.ended||(_.needReadable=!0),P!==b&&_.ended&&$(this)),ue!==null&&this.emit("data",ue),ue};function p(b,_){if(h("onEofChunk"),!_.ended){if(_.decoder){var P=_.decoder.end();P&&P.length&&(_.buffer.push(P),_.length+=_.objectMode?1:P.length)}_.ended=!0,_.sync?v(b):(_.needReadable=!1,_.emittedReadable||(_.emittedReadable=!0,E(b)))}}function v(b){var _=b._readableState;h("emitReadable",_.needReadable,_.emittedReadable),_.needReadable=!1,_.emittedReadable||(h("emitReadable",_.flowing),_.emittedReadable=!0,e.nextTick(E,b))}function E(b){var _=b._readableState;h("emitReadable_",_.destroyed,_.length,_.ended),!_.destroyed&&(_.length||_.ended)&&(b.emit("readable"),_.emittedReadable=!1),_.needReadable=!_.flowing&&!_.ended&&_.length<=_.highWaterMark,A(b)}function k(b,_){_.readingMore||(_.readingMore=!0,e.nextTick(g,b,_))}function g(b,_){for(;!_.reading&&!_.ended&&(_.length<_.highWaterMark||_.flowing&&_.length===0);){var P=_.length;if(h("maybeReadMore read 0"),b.read(0),P===_.length)break}_.readingMore=!1}z.prototype._read=function(b){F(this,new M("_read()"))},z.prototype.pipe=function(b,_){var P=this,j=this._readableState;switch(j.pipesCount){case 0:j.pipes=b;break;case 1:j.pipes=[j.pipes,b];break;default:j.pipes.push(b);break}j.pipesCount+=1,h("pipe count=%d opts=%j",j.pipesCount,_);var ue=(!_||_.end!==!1)&&b!==e.stdout&&b!==e.stderr,J=ue?at:le;j.endEmitted?e.nextTick(J):P.once("end",J),b.on("unpipe",Y);function Y(nt,ce){h("onunpipe"),nt===P&&ce&&ce.hasUnpiped===!1&&(ce.hasUnpiped=!0,Ht())}function at(){h("onend"),b.end()}var he=c(P);b.on("drain",he);var pe=!1;function Ht(){h("cleanup"),b.removeListener("close",xt),b.removeListener("finish",fe),b.removeListener("drain",he),b.removeListener("error",de),b.removeListener("unpipe",Y),P.removeListener("end",at),P.removeListener("end",le),P.removeListener("data",ge),pe=!0,j.awaitDrain&&(!b._writableState||b._writableState.needDrain)&&he()}P.on("data",ge);function ge(nt){h("ondata");var ce=b.write(nt);h("dest.write",ce),ce===!1&&((j.pipesCount===1&&j.pipes===b||j.pipesCount>1&&G(j.pipes,b)!==-1)&&!pe&&(h("false write response, pause",j.awaitDrain),j.awaitDrain++),P.pause())}function de(nt){h("onerror",nt),le(),b.removeListener("error",de),r(b,"error")===0&&F(b,nt)}te(b,"error",de);function xt(){b.removeListener("finish",fe),le()}b.once("close",xt);function fe(){h("onfinish"),b.removeListener("close",xt),le()}b.once("finish",fe);function le(){h("unpipe"),P.unpipe(b)}return b.emit("pipe",P),j.flowing||(h("pipe resume"),P.resume()),b};function c(b){return function(){var P=b._readableState;h("pipeOnDrain",P.awaitDrain),P.awaitDrain&&P.awaitDrain--,P.awaitDrain===0&&r(b,"data")&&(P.flowing=!0,A(b))}}z.prototype.unpipe=function(b){var _=this._readableState,P={hasUnpiped:!1};if(_.pipesCount===0)return this;if(_.pipesCount===1)return b&&b!==_.pipes?this:(b||(b=_.pipes),_.pipes=null,_.pipesCount=0,_.flowing=!1,b&&b.emit("unpipe",this,P),this);if(!b){var j=_.pipes,ue=_.pipesCount;_.pipes=null,_.pipesCount=0,_.flowing=!1;for(var J=0;J0,j.flowing!==!1&&this.resume()):b==="readable"&&!j.endEmitted&&!j.readableListening&&(j.readableListening=j.needReadable=!0,j.flowing=!1,j.emittedReadable=!1,h("on readable",j.length,j.reading),j.length?v(this):j.reading||e.nextTick(U,this)),P},z.prototype.addListener=z.prototype.on,z.prototype.removeListener=function(b,_){var P=n.prototype.removeListener.call(this,b,_);return b==="readable"&&e.nextTick(w,this),P},z.prototype.removeAllListeners=function(b){var _=n.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&e.nextTick(w,this),_};function w(b){var _=b._readableState;_.readableListening=b.listenerCount("readable")>0,_.resumeScheduled&&!_.paused?_.flowing=!0:b.listenerCount("data")>0&&b.resume()}function U(b){h("readable nexttick read 0"),b.read(0)}z.prototype.resume=function(){var b=this._readableState;return b.flowing||(h("resume"),b.flowing=!b.readableListening,H(this,b)),b.paused=!1,this};function H(b,_){_.resumeScheduled||(_.resumeScheduled=!0,e.nextTick(V,b,_))}function V(b,_){h("resume",_.reading),_.reading||b.read(0),_.resumeScheduled=!1,b.emit("resume"),A(b),_.flowing&&!_.reading&&b.read(0)}z.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function A(b){var _=b._readableState;for(h("flow",_.flowing);_.flowing&&b.read()!==null;);}z.prototype.wrap=function(b){var _=this,P=this._readableState,j=!1;b.on("end",function(){if(h("wrapped end"),P.decoder&&!P.ended){var Y=P.decoder.end();Y&&Y.length&&_.push(Y)}_.push(null)}),b.on("data",function(Y){if(h("wrapped data"),P.decoder&&(Y=P.decoder.write(Y)),!(P.objectMode&&Y==null)&&!(!P.objectMode&&(!Y||!Y.length))){var at=_.push(Y);at||(j=!0,b.pause())}});for(var ue in b)this[ue]===void 0&&typeof b[ue]=="function"&&(this[ue]=function(at){return function(){return b[at].apply(b,arguments)}}(ue));for(var J=0;J=_.length?(_.decoder?P=_.buffer.join(""):_.buffer.length===1?P=_.buffer.first():P=_.buffer.concat(_.length),_.buffer.clear()):P=_.buffer.consume(b,_.decoder),P}function $(b){var _=b._readableState;h("endReadable",_.endEmitted),_.endEmitted||(_.ended=!0,e.nextTick(K,_,b))}function K(b,_){if(h("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,_.readable=!1,_.emit("end"),b.autoDestroy)){var P=_._writableState;(!P||P.autoDestroy&&P.finished)&&_.destroy()}}typeof Symbol=="function"&&(z.from=function(b,_){return L===void 0&&(L=hf()),L(z,b,_)});function G(b,_){for(var P=0,j=b.length;P0;return Sf(a,d,h,function(m){i||(i=m),m&&s.forEach(la),!d&&(s.forEach(la),n(i))})});return t.reduce(Rf)}var Cf=kf;(function(e,t){t=e.exports=Vc(),t.Stream=t,t.Readable=t,t.Writable=Uc(),t.Duplex=zr(),t.Transform=zc,t.PassThrough=bf,t.finished=to,t.pipeline=Cf})($s,$s.exports);var Gc=$s.exports;const{Transform:If}=Gc;var xf=e=>class Zc extends If{constructor(r,n,i,s,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=a,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Zc(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Af}=Gc;var Tf=e=>class Kc extends Af{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(a){s=a}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Kc(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Nf=xf,Lf=Tf;var Of=function(e){const t=Nf(e),r=Lf(e);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,i);case"keccak256":return new t(1088,512,null,256,i);case"keccak384":return new t(832,768,null,384,i);case"keccak512":return new t(576,1024,null,512,i);case"sha3-224":return new t(1152,448,6,224,i);case"sha3-256":return new t(1088,512,6,256,i);case"sha3-384":return new t(832,768,6,384,i);case"sha3-512":return new t(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},Qc={};const ua=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Qc.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],m=e[8]^e[18]^e[28]^e[38]^e[48],R=e[9]^e[19]^e[29]^e[39]^e[49];let y=m^(i<<1|s>>>31),C=R^(s<<1|i>>>31);const x=e[0]^y,B=e[1]^C,O=e[10]^y,M=e[11]^C,T=e[20]^y,N=e[21]^C,D=e[30]^y,L=e[31]^C,F=e[40]^y,W=e[41]^C;y=r^(a<<1|l>>>31),C=n^(l<<1|a>>>31);const te=e[2]^y,Z=e[3]^C,z=e[12]^y,X=e[13]^C,ne=e[22]^y,S=e[23]^C,o=e[32]^y,u=e[33]^C,f=e[42]^y,p=e[43]^C;y=i^(d<<1|h>>>31),C=s^(h<<1|d>>>31);const v=e[4]^y,E=e[5]^C,k=e[14]^y,g=e[15]^C,c=e[24]^y,w=e[25]^C,U=e[34]^y,H=e[35]^C,V=e[44]^y,A=e[45]^C;y=a^(m<<1|R>>>31),C=l^(R<<1|m>>>31);const I=e[6]^y,$=e[7]^C,K=e[16]^y,G=e[17]^C,b=e[26]^y,_=e[27]^C,P=e[36]^y,j=e[37]^C,ue=e[46]^y,J=e[47]^C;y=d^(r<<1|n>>>31),C=h^(n<<1|r>>>31);const Y=e[8]^y,at=e[9]^C,he=e[18]^y,pe=e[19]^C,Ht=e[28]^y,ge=e[29]^C,de=e[38]^y,xt=e[39]^C,fe=e[48]^y,le=e[49]^C,nt=x,ce=B,me=M<<4|O>>>28,wr=O<<4|M>>>28,ve=T<<3|N>>>29,be=N<<3|T>>>29,_r=L<<9|D>>>23,we=D<<9|L>>>23,_e=F<<18|W>>>14,yr=W<<18|F>>>14,ye=te<<1|Z>>>31,Ee=Z<<1|te>>>31,Er=X<<12|z>>>20,Se=z<<12|X>>>20,Re=ne<<10|S>>>22,Sr=S<<10|ne>>>22,Me=u<<13|o>>>19,ke=o<<13|u>>>19,Rr=f<<2|p>>>30,Ce=p<<2|f>>>30,Ie=E<<30|v>>>2,Mr=v<<30|E>>>2,xe=k<<6|g>>>26,Ae=g<<6|k>>>26,kr=w<<11|c>>>21,Te=c<<11|w>>>21,Ne=U<<15|H>>>17,Cr=H<<15|U>>>17,Le=A<<29|V>>>3,Oe=V<<29|A>>>3,Ir=I<<28|$>>>4,Pe=$<<28|I>>>4,$e=G<<23|K>>>9,xr=K<<23|G>>>9,Be=b<<25|_>>>7,De=_<<25|b>>>7,Ut=P<<21|j>>>11,Wt=j<<21|P>>>11,Vt=J<<24|ue>>>8,zt=ue<<24|J>>>8,qt=Y<<27|at>>>5,Jt=at<<27|Y>>>5,Gt=he<<20|pe>>>12,Zt=pe<<20|he>>>12,Kt=ge<<7|Ht>>>25,Qt=Ht<<7|ge>>>25,Yt=de<<8|xt>>>24,Xt=xt<<8|de>>>24,er=fe<<14|le>>>18,tr=le<<14|fe>>>18;e[0]=nt^~Er&kr,e[1]=ce^~Se&Te,e[10]=Ir^~Gt&ve,e[11]=Pe^~Zt&be,e[20]=ye^~xe&Be,e[21]=Ee^~Ae&De,e[30]=qt^~me&Re,e[31]=Jt^~wr&Sr,e[40]=Ie^~$e&Kt,e[41]=Mr^~xr&Qt,e[2]=Er^~kr&Ut,e[3]=Se^~Te&Wt,e[12]=Gt^~ve&Me,e[13]=Zt^~be&ke,e[22]=xe^~Be&Yt,e[23]=Ae^~De&Xt,e[32]=me^~Re&Ne,e[33]=wr^~Sr&Cr,e[42]=$e^~Kt&_r,e[43]=xr^~Qt&we,e[4]=kr^~Ut&er,e[5]=Te^~Wt&tr,e[14]=ve^~Me&Le,e[15]=be^~ke&Oe,e[24]=Be^~Yt&_e,e[25]=De^~Xt&yr,e[34]=Re^~Ne&Vt,e[35]=Sr^~Cr&zt,e[44]=Kt^~_r&Rr,e[45]=Qt^~we&Ce,e[6]=Ut^~er&nt,e[7]=Wt^~tr&ce,e[16]=Me^~Le&Ir,e[17]=ke^~Oe&Pe,e[26]=Yt^~_e&ye,e[27]=Xt^~yr&Ee,e[36]=Ne^~Vt&qt,e[37]=Cr^~zt&Jt,e[46]=_r^~Rr&Ie,e[47]=we^~Ce&Mr,e[8]=er^~nt&Er,e[9]=tr^~ce&Se,e[18]=Le^~Ir&Gt,e[19]=Oe^~Pe&Zt,e[28]=_e^~ye&xe,e[29]=yr^~Ee&Ae,e[38]=Vt^~qt&me,e[39]=zt^~Jt&wr,e[48]=Rr^~Ie&$e,e[49]=Ce^~Mr&xr,e[0]^=ua[t*2],e[1]^=ua[t*2+1]}};const ti=Qc;function tn(){this.state=[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],this.blockSize=null,this.count=0,this.squeezing=!1}tn.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};tn.prototype.absorb=function(e){for(let t=0;t>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(ti.p1600(this.state),this.count=0);return t};tn.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var Pf=tn,$f=Of(Pf);const Bf=$f,Df=ci;function Yc(e){return Buffer.allocUnsafe(e).fill(0)}function Xc(e,t,r){const n=Yc(t);return e=Pi(e),r?e.length"u")throw new Error("Not an array?");if(r=il(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);i=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(s in t)i.push(St(e,t[s]));if(r==="dynamic"){var a=St("uint256",t.length);i.unshift(a)}return Buffer.concat(i)}else{if(e==="bytes")return t=new Buffer(t),i=Buffer.concat([St("uint256",t.length),t]),t.length%32!==0&&(i=Buffer.concat([i,dr.zeros(32-t.length%32)])),i;if(e.startsWith("bytes")){if(r=Fr(e),r<1||r>32)throw new Error("Invalid bytes width: "+r);return dr.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=Fr(e),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=ar(t),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(Buffer,"be",32)}else if(e.startsWith("int")){if(r=Fr(e),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=ar(t),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(e.startsWith("ufixed")){if(r=ha(e),n=ar(t),n<0)throw new Error("Supplied ufixed is negative");return St("uint256",n.mul(new lr(2).pow(new lr(r[1]))))}else if(e.startsWith("fixed"))return r=ha(e),St("int256",ar(t).mul(new lr(2).pow(new lr(r[1]))))}throw new Error("Unsupported or invalid type: "+e)}function Wf(e){return e==="string"||e==="bytes"||il(e)==="dynamic"}function Vf(e){return e.lastIndexOf("]")===e.length-1}function zf(e,t){var r=[],n=[],i=32*e.length;for(var s in e){var a=nl(e[s]),l=t[s],d=St(a,l);Wf(a)?(r.push(St("uint256",i)),n.push(d),i+=d.length):r.push(d)}return Buffer.concat(r.concat(n))}function sl(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s32)throw new Error("Invalid bytes width: "+r);i.push(dr.setLengthRight(l,r))}else if(a.startsWith("uint")){if(r=Fr(a),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);if(n=ar(l),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(a.startsWith("int")){if(r=Fr(a),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);if(n=ar(l),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(i)}function qf(e,t){return dr.keccak(sl(e,t))}var Jf={rawEncode:zf,solidityPack:sl,soliditySHA3:qf};const mt=rl,un=Jf,ol={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Ss={encodeData(e,t,r,n=!0){const i=["bytes32"],s=[this.hashType(e,r)];if(n){const a=(l,d,h)=>{if(r[d]!==void 0)return["bytes32",h==null?"0x0000000000000000000000000000000000000000000000000000000000000000":mt.keccak(this.encodeData(d,h,r,n))];if(h===void 0)throw new Error(`missing value for field ${l} of type ${d}`);if(d==="bytes")return["bytes32",mt.keccak(h)];if(d==="string")return typeof h=="string"&&(h=Buffer.from(h,"utf8")),["bytes32",mt.keccak(h)];if(d.lastIndexOf("]")===d.length-1){const m=d.slice(0,d.lastIndexOf("[")),R=h.map(y=>a(l,m,y));return["bytes32",mt.keccak(un.rawEncode(R.map(([y])=>y),R.map(([,y])=>y)))]}return[d,h]};for(const l of r[e]){const[d,h]=a(l.name,l.type,t[l.name]);i.push(d),s.push(h)}}else for(const a of r[e]){let l=t[a.name];if(l!==void 0)if(a.type==="bytes")i.push("bytes32"),l=mt.keccak(l),s.push(l);else if(a.type==="string")i.push("bytes32"),typeof l=="string"&&(l=Buffer.from(l,"utf8")),l=mt.keccak(l),s.push(l);else if(r[a.type]!==void 0)i.push("bytes32"),l=mt.keccak(this.encodeData(a.type,l,r,n)),s.push(l);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(a.type),s.push(l)}}return un.rawEncode(i,s)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(i=>i!==e);n=[e].concat(n.sort());for(const i of n){if(!t[i])throw new Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:a,type:l})=>l+" "+a).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const i of this.findTypeDependencies(n.type,t,r))!r.includes(i)&&r.push(i);return r},hashStruct(e,t,r,n=!0){return mt.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return mt.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in ol.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),mt.keccak(Buffer.concat(n))}};var Gf={TYPED_MESSAGE_SCHEMA:ol,TypedDataUtils:Ss,hashForSignTypedDataLegacy:function(e){return Zf(e.data)},hashForSignTypedData_v3:function(e){return Ss.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return Ss.hash(e.data)}};function Zf(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(s){return s.type==="bytes"?mt.toBuffer(s.value):s.value}),n=e.map(function(s){return s.type}),i=e.map(function(s){if(!s.name)throw t;return s.type+" "+s.name});return un.soliditySHA3(["bytes32","bytes32"],[un.soliditySHA3(new Array(e.length).fill("string"),i),un.soliditySHA3(n,r)])}var qr={};Object.defineProperty(qr,"__esModule",{value:!0});qr.filterFromParam=qr.FilterPolyfill=void 0;const $r=Ve,Ye=q,Kf=5*60*1e3,cr={jsonrpc:"2.0",id:0};class Qf{constructor(t){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,$r.IntNumber)(1),this.REQUEST_THROTTLE_INTERVAL=1e3,this.lastFetchTimestamp=new Date(0),this.resolvers=[],this.provider=t}async newFilter(t){const r=al(t),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.info(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,Ye.hexStringFromIntNumber)(n)}async newBlockFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.blockFilters.add(t),this.setFilterTimeout(t),(0,Ye.hexStringFromIntNumber)(t)}async newPendingTransactionFilter(){const t=this.makeFilterId(),r=await this.setInitialCursorPosition(t,"latest");return console.info(`Installing new block filter (${t}) with initial cursor position:`,r),this.pendingTransactionFilters.add(t),this.setFilterTimeout(t),(0,Ye.hexStringFromIntNumber)(t)}uninstallFilter(t){const r=(0,Ye.intNumberFromHexString)(t);return console.info(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(t){const r=(0,Ye.intNumberFromHexString)(t);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(Vn())}async getFilterLogs(t){const r=(0,Ye.intNumberFromHexString)(t),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},cr),{method:"eth_getLogs",params:[da(n)]})):Vn()}makeFilterId(){return(0,$r.IntNumber)(++this.nextFilterId)}sendAsyncPromise(t){return new Promise((r,n)=>{this.provider.sendAsync(t,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(t){console.info(`Deleting filter (${t})`),this.logFilters.delete(t),this.blockFilters.delete(t),this.pendingTransactionFilters.delete(t),this.cursors.delete(t),this.timeouts.delete(t)}async getLogFilterChanges(t){const r=this.logFilters.get(t),n=this.cursors.get(t);if(!n||!r)return Vn();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>Number(r.toBlock))return zn();console.info(`Fetching logs from ${n} to ${s} for filter ${t}`);const a=await this.sendAsyncPromise(Object.assign(Object.assign({},cr),{method:"eth_getLogs",params:[da(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(a.result)){const l=a.result.map(h=>(0,Ye.intNumberFromHexString)(h.blockNumber||"0x0")),d=Math.max(...l);if(d&&d>n){const h=(0,$r.IntNumber)(d+1);console.info(`Moving cursor position for filter (${t}) from ${n} to ${h}`),this.cursors.set(t,h)}}return a}async getBlockFilterChanges(t){const r=this.cursors.get(t);if(!r)return Vn();const n=await this.getCurrentBlockHeight();if(r>n)return zn();console.info(`Fetching blocks from ${r} to ${n} for filter (${t})`);const i=(await Promise.all((0,Ye.range)(r,n+1).map(a=>this.getBlockHashByNumber((0,$r.IntNumber)(a))))).filter(a=>!!a),s=(0,$r.IntNumber)(r+i.length);return console.info(`Moving cursor position for filter (${t}) from ${r} to ${s}`),this.cursors.set(t,s),Object.assign(Object.assign({},cr),{result:i})}async getPendingTransactionFilterChanges(t){return Promise.resolve(zn())}async setInitialCursorPosition(t,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(t,i),i}setFilterTimeout(t){const r=this.timeouts.get(t);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.info(`Filter (${t}) timed out`),this.deleteFilter(t)},Kf);this.timeouts.set(t,n)}async getCurrentBlockHeight(){const t=new Date;if(t.getTime()-this.lastFetchTimestamp.getTime()>this.REQUEST_THROTTLE_INTERVAL){this.lastFetchTimestamp=t;const r=await this._getCurrentBlockHeight();this.currentBlockHeight=r,this.resolvers.forEach(n=>n(r)),this.resolvers=[]}return this.currentBlockHeight?this.currentBlockHeight:new Promise(r=>this.resolvers.push(r))}async _getCurrentBlockHeight(){const{result:t}=await this.sendAsyncPromise(Object.assign(Object.assign({},cr),{method:"eth_blockNumber",params:[]}));return(0,Ye.intNumberFromHexString)((0,Ye.ensureHexString)(t))}async getBlockHashByNumber(t){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},cr),{method:"eth_getBlockByNumber",params:[(0,Ye.hexStringFromIntNumber)(t),!1]}));return r.result&&typeof r.result.hash=="string"?(0,Ye.ensureHexString)(r.result.hash):null}}qr.FilterPolyfill=Qf;function al(e){return{fromBlock:fa(e.fromBlock),toBlock:fa(e.toBlock),addresses:e.address===void 0?null:Array.isArray(e.address)?e.address:[e.address],topics:e.topics||[]}}qr.filterFromParam=al;function da(e){const t={fromBlock:pa(e.fromBlock),toBlock:pa(e.toBlock),topics:e.topics};return e.addresses!==null&&(t.address=e.addresses),t}function fa(e){if(e===void 0||e==="latest"||e==="pending")return"latest";if(e==="earliest")return(0,$r.IntNumber)(0);if((0,Ye.isHexString)(e))return(0,Ye.intNumberFromHexString)(e);throw new Error(`Invalid block option: ${String(e)}`)}function pa(e){return e==="latest"?e:(0,Ye.hexStringFromIntNumber)(e)}function Vn(){return Object.assign(Object.assign({},cr),{error:{code:-32e3,message:"filter not found"}})}function zn(){return Object.assign(Object.assign({},cr),{result:[]})}var $i={},cl={},Bi={},ro=Yf;function Yf(e){e=e||{};var t=e.max||Number.MAX_SAFE_INTEGER,r=typeof e.start<"u"?e.start:Math.floor(Math.random()*t);return function(){return r=r%t,r++}}const ga=(e,t)=>function(){const r=t.promiseModule,n=new Array(arguments.length);for(let i=0;i{t.errorFirst?n.push(function(a,l){if(t.multiArgs){const d=new Array(arguments.length-1);for(let h=1;h{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const r=i=>{const s=a=>typeof a=="string"?i===a:a.test(i);return t.include?t.include.some(s):!t.exclude.some(s)};let n;typeof e=="function"?n=function(){return t.excludeMain?e.apply(this,arguments):ga(e,t).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(e));for(const i in e){const s=e[i];n[i]=typeof s=="function"&&r(i)?ga(s,t):s}return n},xn={},An={};Object.defineProperty(An,"__esModule",{value:!0});const e0=si;function ma(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function t0(e){const t=e.length,r=new Array(t);for(let n=0;n0&&([a]=r),a instanceof Error)throw a;const l=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw l.context=a,l}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")ma(s,this,r);else{const a=s.length,l=t0(s);for(let d=0;de+t,va=["sync","latest"];class a0 extends i0.default{constructor(t){super(),this._blockResetDuration=t.blockResetDuration||20*s0,this._usePastBlocks=t.usePastBlocks||!1,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(t){return t?super.removeAllListeners(t):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(t){va.includes(t)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return va.map(t=>this.listenerCount(t)).reduce(o0)}_shouldUseNewBlock(t){const r=this._currentBlock;if(!r)return!0;const n=ba(t),i=ba(r);return this._usePastBlocks&&ni}_newPotentialLatest(t){this._shouldUseNewBlock(t)&&this._setCurrentBlock(t)}_setCurrentBlock(t){const r=this._currentBlock;this._currentBlock=t,this.emit("latest",t),this.emit("sync",{oldBlock:r,newBlock:t})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}xn.BaseBlockTracker=a0;function ba(e){return Number.parseInt(e,16)}var ll={},ul={},Ke={};class hl extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...a}=t,{path:l}=t,d=l.length===0?i:`At path: ${l.join(".")} -- ${i}`;super(s??d),s!=null&&(this.cause=d),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function c0(e){return ft(e)&&typeof e[Symbol.iterator]=="function"}function ft(e){return typeof e=="object"&&e!=null}function wa(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function ze(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function l0(e){const{done:t,value:r}=e.next();return t?void 0:r}function u0(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:l,message:d=`Expected a value of type \`${a}\`${l?` with refinement \`${l}\``:""}, but received: \`${ze(n)}\``}=e;return{value:n,type:a,refinement:l,key:i[i.length-1],path:i,branch:s,...e,message:d}}function*Ds(e,t,r,n){c0(e)||(e=[e]);for(const i of e){const s=u0(i,t,r,n);s&&(yield s)}}function*no(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,l={path:n,branch:i};if(s&&(e=t.coercer(e,l),a&&t.type!=="type"&&ft(t.schema)&&ft(e)&&!Array.isArray(e)))for(const h in e)t.schema[h]===void 0&&delete e[h];let d="valid";for(const h of t.validator(e,l))h.explanation=r.message,d="not_valid",yield[h,void 0];for(let[h,m,R]of t.entries(e,l)){const y=no(m,R,{path:h===void 0?n:[...n,h],branch:h===void 0?i:[...i,m],coerce:s,mask:a,message:r.message});for(const C of y)C[0]?(d=C[0].refinement!=null?"not_refined":"not_valid",yield[C[0],void 0]):s&&(m=C[1],h===void 0?e=m:e instanceof Map?e.set(h,m):e instanceof Set?e.add(m):ft(e)&&(m!==void 0||h in e)&&(e[h]=m))}if(d!=="not_valid")for(const h of t.refiner(e,l))h.explanation=r.message,d="not_refined",yield[h,void 0];d==="valid"&&(yield[void 0,e])}class Ue{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:a=d=>d,entries:l=function*(){}}=t;this.type=r,this.schema=n,this.entries=l,this.coercer=a,i?this.validator=(d,h)=>{const m=i(d,h);return Ds(m,h,this,d)}:this.validator=()=>[],s?this.refiner=(d,h)=>{const m=s(d,h);return Ds(m,h,this,d)}:this.refiner=()=>[]}assert(t,r){return dl(t,this,r)}create(t,r){return fl(t,this,r)}is(t){return io(t,this)}mask(t,r){return pl(t,this,r)}validate(t,r={}){return rn(t,this,r)}}function dl(e,t,r){const n=rn(e,t,{message:r});if(n[0])throw n[0]}function fl(e,t,r){const n=rn(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function pl(e,t,r){const n=rn(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function io(e,t){return!rn(e,t)[0]}function rn(e,t,r={}){const n=no(e,t,r),i=l0(n);return i[0]?[new hl(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function h0(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Nn(n):Tn(n)}function rt(e,t){return new Ue({type:e,schema:null,validator:t})}function d0(e,t){return new Ue({...e,refiner:(r,n)=>r===void 0||e.refiner(r,n),validator(r,n){return r===void 0?!0:(t(r,n),e.validator(r,n))}})}function f0(e){return new Ue({type:"dynamic",schema:null,*entries(t,r){yield*e(t,r).entries(t,r)},validator(t,r){return e(t,r).validator(t,r)},coercer(t,r){return e(t,r).coercer(t,r)},refiner(t,r){return e(t,r).refiner(t,r)}})}function p0(e){let t;return new Ue({type:"lazy",schema:null,*entries(r,n){t??(t=e()),yield*t.entries(r,n)},validator(r,n){return t??(t=e()),t.validator(r,n)},coercer(r,n){return t??(t=e()),t.coercer(r,n)},refiner(r,n){return t??(t=e()),t.refiner(r,n)}})}function g0(e,t){const{schema:r}=e,n={...r};for(const i of t)delete n[i];switch(e.type){case"type":return Nn(n);default:return Tn(n)}}function m0(e){const t=e instanceof Ue,r=t?{...e.schema}:{...e};for(const n in r)r[n]=gl(r[n]);return t&&e.type==="type"?Nn(r):Tn(r)}function v0(e,t){const{schema:r}=e,n={};for(const i of t)n[i]=r[i];switch(e.type){case"type":return Nn(n);default:return Tn(n)}}function b0(e,t){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),rt(e,t)}function w0(){return rt("any",()=>!0)}function _0(e){return new Ue({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${ze(t)}`}})}function y0(){return rt("bigint",e=>typeof e=="bigint")}function E0(){return rt("boolean",e=>typeof e=="boolean")}function S0(){return rt("date",e=>e instanceof Date&&!isNaN(e.getTime())||`Expected a valid \`Date\` object, but received: ${ze(e)}`)}function R0(e){const t={},r=e.map(n=>ze(n)).join();for(const n of e)t[n]=n;return new Ue({type:"enums",schema:t,validator(n){return e.includes(n)||`Expected one of \`${r}\`, but received: ${ze(n)}`}})}function M0(){return rt("func",e=>typeof e=="function"||`Expected a function, but received: ${ze(e)}`)}function k0(e){return rt("instance",t=>t instanceof e||`Expected a \`${e.name}\` instance, but received: ${ze(t)}`)}function C0(){return rt("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${ze(e)}`)}function I0(e){return new Ue({type:"intersection",schema:null,*entries(t,r){for(const n of e)yield*n.entries(t,r)},*validator(t,r){for(const n of e)yield*n.validator(t,r)},*refiner(t,r){for(const n of e)yield*n.refiner(t,r)}})}function x0(e){const t=ze(e),r=typeof e;return new Ue({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${ze(n)}`}})}function A0(e,t){return new Ue({type:"map",schema:null,*entries(r){if(e&&t&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,e],yield[n,i,t]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${ze(r)}`}})}function so(){return rt("never",()=>!1)}function T0(e){return new Ue({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function N0(){return rt("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${ze(e)}`)}function Tn(e){const t=e?Object.keys(e):[],r=so();return new Ue({type:"object",schema:e||null,*entries(n){if(e&&ft(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return ft(n)||`Expected an object, but received: ${ze(n)}`},coercer(n){return ft(n)?{...n}:n}})}function gl(e){return new Ue({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function L0(e,t){return new Ue({type:"record",schema:null,*entries(r){if(ft(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return ft(r)||`Expected an object, but received: ${ze(r)}`}})}function O0(){return rt("regexp",e=>e instanceof RegExp)}function P0(e){return new Ue({type:"set",schema:null,*entries(t){if(e&&t instanceof Set)for(const r of t)yield[r,r,e]},coercer(t){return t instanceof Set?new Set(t):t},validator(t){return t instanceof Set||`Expected a \`Set\` object, but received: ${ze(t)}`}})}function ml(){return rt("string",e=>typeof e=="string"||`Expected a string, but received: ${ze(e)}`)}function $0(e){const t=so();return new Ue({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;ir.type).join(" | ");return new Ue({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...a]=no(r,s,n),[l]=a;if(l[0])for(const[d]of a)d&&i.push(d);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${ze(r)}`,...i]}})}function vl(){return rt("unknown",()=>!0)}function oo(e,t,r){return new Ue({...e,coercer:(n,i)=>io(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}function D0(e,t,r={}){return oo(e,vl(),n=>{const i=typeof t=="function"?t():t;if(n===void 0)return i;if(!r.strict&&wa(n)&&wa(i)){const s={...n};let a=!1;for(const l in i)s[l]===void 0&&(s[l]=i[l],a=!0);if(a)return s}return n})}function F0(e){return oo(e,ml(),t=>t.trim())}function j0(e){return vr(e,"empty",t=>{const r=bl(t);return r===0||`Expected an empty ${e.type} but received one with a size of \`${r}\``})}function bl(e){return e instanceof Map||e instanceof Set?e.size:e.length}function H0(e,t,r={}){const{exclusive:n}=r;return vr(e,"max",i=>n?in?i>t:i>=t||`Expected a ${e.type} greater than ${n?"":"or equal to "}${t} but received \`${i}\``)}function W0(e){return vr(e,"nonempty",t=>bl(t)>0||`Expected a nonempty ${e.type} but received an empty one`)}function V0(e,t){return vr(e,"pattern",r=>t.test(r)||`Expected a ${e.type} matching \`/${t.source}/\` but received "${r}"`)}function z0(e,t,r=t){const n=`Expected a ${e.type}`,i=t===r?`of \`${t}\``:`between \`${t}\` and \`${r}\``;return vr(e,"size",s=>{if(typeof s=="number"||s instanceof Date)return t<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:a}=s;return t<=a&&a<=r||`${n} with a size ${i} but received one with a size of \`${a}\``}else{const{length:a}=s;return t<=a&&a<=r||`${n} with a length ${i} but received one with a length of \`${a}\``}})}function vr(e,t,r){return new Ue({...e,*refiner(n,i){yield*e.refiner(n,i);const s=r(n,i),a=Ds(s,i,e,n);for(const l of a)yield{...l,refinement:t}}})}const q0=Object.freeze(Object.defineProperty({__proto__:null,Struct:Ue,StructError:hl,any:w0,array:_0,assert:dl,assign:h0,bigint:y0,boolean:E0,coerce:oo,create:fl,date:S0,defaulted:D0,define:rt,deprecated:d0,dynamic:f0,empty:j0,enums:R0,func:M0,instance:k0,integer:C0,intersection:I0,is:io,lazy:p0,literal:x0,map:A0,mask:pl,max:H0,min:U0,never:so,nonempty:W0,nullable:T0,number:N0,object:Tn,omit:g0,optional:gl,partial:m0,pattern:V0,pick:v0,record:L0,refine:vr,regexp:O0,set:P0,size:z0,string:ml,struct:b0,trimmed:F0,tuple:$0,type:Nn,union:B0,unknown:vl,validate:rn},Symbol.toStringTag,{value:"Module"})),br=Zr(q0);Object.defineProperty(Ke,"__esModule",{value:!0});Ke.assertExhaustive=Ke.assertStruct=Ke.assert=Ke.AssertionError=void 0;const J0=br;function G0(e){return typeof e=="object"&&e!==null&&"message"in e}function Z0(e){var t,r;return typeof((r=(t=e==null?void 0:e.prototype)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.name)=="string"}function K0(e){const t=G0(e)?e.message:String(e);return t.endsWith(".")?t.slice(0,-1):t}function wl(e,t){return Z0(e)?new e({message:t}):e({message:t})}class ao extends Error{constructor(t){super(t.message),this.code="ERR_ASSERTION"}}Ke.AssertionError=ao;function Q0(e,t="Assertion failed.",r=ao){if(!e)throw t instanceof Error?t:wl(r,t)}Ke.assert=Q0;function Y0(e,t,r="Assertion failed",n=ao){try{(0,J0.assert)(e,t)}catch(i){throw wl(n,`${r}: ${K0(i)}.`)}}Ke.assertStruct=Y0;function X0(e){throw new Error("Invalid branch reached. Should be detected during compilation.")}Ke.assertExhaustive=X0;var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.base64=void 0;const e1=br,t1=Ke,r1=(e,t={})=>{var r,n;const i=(r=t.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=t.characterSet)!==null&&n!==void 0?n:"base64";let a;s==="base64"?a=String.raw`[A-Za-z0-9+\/]`:((0,t1.assert)(s==="base64url"),a=String.raw`[-_A-Za-z0-9]`);let l;return i?l=new RegExp(`^(?:${a}{4})*(?:${a}{3}=|${a}{2}==)?$`,"u"):l=new RegExp(`^(?:${a}{4})*(?:${a}{2,3}|${a}{3}=|${a}{2}==)?$`,"u"),(0,e1.pattern)(e,l)};Ln.base64=r1;var ae={},On={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.remove0x=e.add0x=e.assertIsStrictHexString=e.assertIsHexString=e.isStrictHexString=e.isHexString=e.StrictHexStruct=e.HexStruct=void 0;const t=br,r=Ke;e.HexStruct=(0,t.pattern)((0,t.string)(),/^(?:0x)?[0-9a-f]+$/iu),e.StrictHexStruct=(0,t.pattern)((0,t.string)(),/^0x[0-9a-f]+$/iu);function n(h){return(0,t.is)(h,e.HexStruct)}e.isHexString=n;function i(h){return(0,t.is)(h,e.StrictHexStruct)}e.isStrictHexString=i;function s(h){(0,r.assert)(n(h),"Value must be a hexadecimal string.")}e.assertIsHexString=s;function a(h){(0,r.assert)(i(h),'Value must be a hexadecimal string, starting with "0x".')}e.assertIsStrictHexString=a;function l(h){return h.startsWith("0x")?h:h.startsWith("0X")?`0x${h.substring(2)}`:`0x${h}`}e.add0x=l;function d(h){return h.startsWith("0x")||h.startsWith("0X")?h.substring(2):h}e.remove0x=d})(On);Object.defineProperty(ae,"__esModule",{value:!0});ae.createDataView=ae.concatBytes=ae.valueToBytes=ae.stringToBytes=ae.numberToBytes=ae.signedBigIntToBytes=ae.bigIntToBytes=ae.hexToBytes=ae.bytesToString=ae.bytesToNumber=ae.bytesToSignedBigInt=ae.bytesToBigInt=ae.bytesToHex=ae.assertIsBytes=ae.isBytes=void 0;const ot=Ke,Fs=On,_a=48,ya=58,Ea=87;function n1(){const e=[];return()=>{if(e.length===0)for(let t=0;t<256;t++)e.push(t.toString(16).padStart(2,"0"));return e}}const i1=n1();function co(e){return e instanceof Uint8Array}ae.isBytes=co;function nn(e){(0,ot.assert)(co(e),"Value must be a Uint8Array.")}ae.assertIsBytes=nn;function _l(e){if(nn(e),e.length===0)return"0x";const t=i1(),r=new Array(e.length);for(let n=0;n=BigInt(0),"Value must be a non-negative bigint.");const t=e.toString(16);return Di(t)}ae.bigIntToBytes=El;function c1(e,t){(0,ot.assert)(t>0);const r=e>>BigInt(31);return!((~e&r)+(e&~r)>>BigInt(t*8+-1))}function l1(e,t){(0,ot.assert)(typeof e=="bigint","Value must be a bigint."),(0,ot.assert)(typeof t=="number","Byte length must be a number."),(0,ot.assert)(t>0,"Byte length must be greater than 0."),(0,ot.assert)(c1(e,t),"Byte length is too small to represent the given value.");let r=e;const n=new Uint8Array(t);for(let i=0;i>=BigInt(8);return n.reverse()}ae.signedBigIntToBytes=l1;function Sl(e){(0,ot.assert)(typeof e=="number","Value must be a number."),(0,ot.assert)(e>=0,"Value must be a non-negative number."),(0,ot.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToBytes` instead.");const t=e.toString(16);return Di(t)}ae.numberToBytes=Sl;function Rl(e){return(0,ot.assert)(typeof e=="string","Value must be a string."),new TextEncoder().encode(e)}ae.stringToBytes=Rl;function Ml(e){if(typeof e=="bigint")return El(e);if(typeof e=="number")return Sl(e);if(typeof e=="string")return e.startsWith("0x")?Di(e):Rl(e);if(co(e))return e;throw new TypeError(`Unsupported value type: "${typeof e}".`)}ae.valueToBytes=Ml;function u1(e){const t=new Array(e.length);let r=0;for(let i=0;it.call(r,n,i,this))}get(t){return Xe(this,gt,"f").get(t)}has(t){return Xe(this,gt,"f").has(t)}keys(){return Xe(this,gt,"f").keys()}values(){return Xe(this,gt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([t,r])=>`${String(t)} => ${String(r)}`).join(", ")} `:""}}`}}Jr.FrozenMap=lo;class uo{constructor(t){yt.set(this,void 0),Il(this,yt,new Set(t),"f"),Object.freeze(this)}get size(){return Xe(this,yt,"f").size}[(yt=new WeakMap,Symbol.iterator)](){return Xe(this,yt,"f")[Symbol.iterator]()}entries(){return Xe(this,yt,"f").entries()}forEach(t,r){return Xe(this,yt,"f").forEach((n,i,s)=>t.call(r,n,i,this))}has(t){return Xe(this,yt,"f").has(t)}keys(){return Xe(this,yt,"f").keys()}values(){return Xe(this,yt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(t=>String(t)).join(", ")} `:""}}`}}Jr.FrozenSet=uo;Object.freeze(lo);Object.freeze(lo.prototype);Object.freeze(uo);Object.freeze(uo.prototype);var xl={};Object.defineProperty(xl,"__esModule",{value:!0});var Al={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getJsonRpcIdValidator=e.assertIsJsonRpcError=e.isJsonRpcError=e.assertIsJsonRpcFailure=e.isJsonRpcFailure=e.assertIsJsonRpcSuccess=e.isJsonRpcSuccess=e.assertIsJsonRpcResponse=e.isJsonRpcResponse=e.assertIsPendingJsonRpcResponse=e.isPendingJsonRpcResponse=e.JsonRpcResponseStruct=e.JsonRpcFailureStruct=e.JsonRpcSuccessStruct=e.PendingJsonRpcResponseStruct=e.assertIsJsonRpcRequest=e.isJsonRpcRequest=e.assertIsJsonRpcNotification=e.isJsonRpcNotification=e.JsonRpcNotificationStruct=e.JsonRpcRequestStruct=e.JsonRpcParamsStruct=e.JsonRpcErrorStruct=e.JsonRpcIdStruct=e.JsonRpcVersionStruct=e.jsonrpc2=e.getJsonSize=e.isValidJson=e.JsonStruct=e.UnsafeJsonStruct=void 0;const t=br,r=Ke,n=()=>(0,t.define)("finite number",L=>(0,t.is)(L,(0,t.number)())&&Number.isFinite(L));e.UnsafeJsonStruct=(0,t.union)([(0,t.literal)(null),(0,t.boolean)(),n(),(0,t.string)(),(0,t.array)((0,t.lazy)(()=>e.UnsafeJsonStruct)),(0,t.record)((0,t.string)(),(0,t.lazy)(()=>e.UnsafeJsonStruct))]),e.JsonStruct=(0,t.define)("Json",(L,F)=>{function W(te,Z){const X=[...Z.validator(te,F)];return X.length>0?X:!0}try{const te=W(L,e.UnsafeJsonStruct);return te!==!0?te:W(JSON.parse(JSON.stringify(L)),e.UnsafeJsonStruct)}catch(te){return te instanceof RangeError?"Circular reference detected":!1}});function i(L){return(0,t.is)(L,e.JsonStruct)}e.isValidJson=i;function s(L){(0,r.assertStruct)(L,e.JsonStruct,"Invalid JSON value");const F=JSON.stringify(L);return new TextEncoder().encode(F).byteLength}e.getJsonSize=s,e.jsonrpc2="2.0",e.JsonRpcVersionStruct=(0,t.literal)(e.jsonrpc2),e.JsonRpcIdStruct=(0,t.nullable)((0,t.union)([(0,t.number)(),(0,t.string)()])),e.JsonRpcErrorStruct=(0,t.object)({code:(0,t.integer)(),message:(0,t.string)(),data:(0,t.optional)(e.JsonStruct),stack:(0,t.optional)((0,t.string)())}),e.JsonRpcParamsStruct=(0,t.optional)((0,t.union)([(0,t.record)((0,t.string)(),e.JsonStruct),(0,t.array)(e.JsonStruct)])),e.JsonRpcRequestStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,method:(0,t.string)(),params:e.JsonRpcParamsStruct}),e.JsonRpcNotificationStruct=(0,t.omit)(e.JsonRpcRequestStruct,["id"]);function a(L){return(0,t.is)(L,e.JsonRpcNotificationStruct)}e.isJsonRpcNotification=a;function l(L,F){(0,r.assertStruct)(L,e.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",F)}e.assertIsJsonRpcNotification=l;function d(L){return(0,t.is)(L,e.JsonRpcRequestStruct)}e.isJsonRpcRequest=d;function h(L,F){(0,r.assertStruct)(L,e.JsonRpcRequestStruct,"Invalid JSON-RPC request",F)}e.assertIsJsonRpcRequest=h,e.PendingJsonRpcResponseStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:(0,t.optional)((0,t.unknown)()),error:(0,t.optional)(e.JsonRpcErrorStruct)}),e.JsonRpcSuccessStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,result:e.JsonStruct}),e.JsonRpcFailureStruct=(0,t.object)({id:e.JsonRpcIdStruct,jsonrpc:e.JsonRpcVersionStruct,error:e.JsonRpcErrorStruct}),e.JsonRpcResponseStruct=(0,t.union)([e.JsonRpcSuccessStruct,e.JsonRpcFailureStruct]);function m(L){return(0,t.is)(L,e.PendingJsonRpcResponseStruct)}e.isPendingJsonRpcResponse=m;function R(L,F){(0,r.assertStruct)(L,e.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",F)}e.assertIsPendingJsonRpcResponse=R;function y(L){return(0,t.is)(L,e.JsonRpcResponseStruct)}e.isJsonRpcResponse=y;function C(L,F){(0,r.assertStruct)(L,e.JsonRpcResponseStruct,"Invalid JSON-RPC response",F)}e.assertIsJsonRpcResponse=C;function x(L){return(0,t.is)(L,e.JsonRpcSuccessStruct)}e.isJsonRpcSuccess=x;function B(L,F){(0,r.assertStruct)(L,e.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",F)}e.assertIsJsonRpcSuccess=B;function O(L){return(0,t.is)(L,e.JsonRpcFailureStruct)}e.isJsonRpcFailure=O;function M(L,F){(0,r.assertStruct)(L,e.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",F)}e.assertIsJsonRpcFailure=M;function T(L){return(0,t.is)(L,e.JsonRpcErrorStruct)}e.isJsonRpcError=T;function N(L,F){(0,r.assertStruct)(L,e.JsonRpcErrorStruct,"Invalid JSON-RPC error",F)}e.assertIsJsonRpcError=N;function D(L){const{permitEmptyString:F,permitFractions:W,permitNull:te}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},L);return z=>!!(typeof z=="number"&&(W||Number.isInteger(z))||typeof z=="string"&&(F||z.length>0)||te&&z===null)}e.getJsonRpcIdValidator=D})(Al);var Tl={};Object.defineProperty(Tl,"__esModule",{value:!0});var Gr={},E1=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gr,"__esModule",{value:!0});Gr.createModuleLogger=Gr.createProjectLogger=void 0;const S1=E1(su),R1=(0,S1.default)("metamask");function M1(e){return R1.extend(e)}Gr.createProjectLogger=M1;function k1(e,t){return e.extend(t)}Gr.createModuleLogger=k1;var Nl={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateNumberSize=e.calculateStringSize=e.isASCII=e.isPlainObject=e.ESCAPE_CHARACTERS_REGEXP=e.JsonSize=e.hasProperty=e.isObject=e.isNullOrUndefined=e.isNonEmptyArray=void 0;function t(h){return Array.isArray(h)&&h.length>0}e.isNonEmptyArray=t;function r(h){return h==null}e.isNullOrUndefined=r;function n(h){return!!h&&typeof h=="object"&&!Array.isArray(h)}e.isObject=n;const i=(h,m)=>Object.hasOwnProperty.call(h,m);e.hasProperty=i,function(h){h[h.Null=4]="Null",h[h.Comma=1]="Comma",h[h.Wrapper=1]="Wrapper",h[h.True=4]="True",h[h.False=5]="False",h[h.Quote=1]="Quote",h[h.Colon=1]="Colon",h[h.Date=24]="Date"}(e.JsonSize||(e.JsonSize={})),e.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(h){if(typeof h!="object"||h===null)return!1;try{let m=h;for(;Object.getPrototypeOf(m)!==null;)m=Object.getPrototypeOf(m);return Object.getPrototypeOf(h)===m}catch{return!1}}e.isPlainObject=s;function a(h){return h.charCodeAt(0)<=127}e.isASCII=a;function l(h){var m;return h.split("").reduce((y,C)=>a(C)?y+1:y+2,0)+((m=h.match(e.ESCAPE_CHARACTERS_REGEXP))!==null&&m!==void 0?m:[]).length}e.calculateStringSize=l;function d(h){return h.toString().length}e.calculateNumberSize=d})(Nl);var It={};Object.defineProperty(It,"__esModule",{value:!0});It.hexToBigInt=It.hexToNumber=It.bigIntToHex=It.numberToHex=void 0;const jr=Ke,fn=On,C1=e=>((0,jr.assert)(typeof e=="number","Value must be a number."),(0,jr.assert)(e>=0,"Value must be a non-negative number."),(0,jr.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,fn.add0x)(e.toString(16)));It.numberToHex=C1;const I1=e=>((0,jr.assert)(typeof e=="bigint","Value must be a bigint."),(0,jr.assert)(e>=0,"Value must be a non-negative bigint."),(0,fn.add0x)(e.toString(16)));It.bigIntToHex=I1;const x1=e=>{(0,fn.assertIsHexString)(e);const t=parseInt(e,16);return(0,jr.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `hexToBigInt` instead."),t};It.hexToNumber=x1;const A1=e=>((0,fn.assertIsHexString)(e),BigInt((0,fn.add0x)(e)));It.hexToBigInt=A1;var Ll={};Object.defineProperty(Ll,"__esModule",{value:!0});var Ol={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.timeSince=e.inMilliseconds=e.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(e.Duration||(e.Duration={}));const t=s=>Number.isInteger(s)&&s>=0,r=(s,a)=>{if(!t(s))throw new Error(`"${a}" must be a non-negative integer. Received: "${s}".`)};function n(s,a){return r(s,"count"),s*a}e.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}e.timeSince=i})(Ol);var Pl={};Object.defineProperty(Pl,"__esModule",{value:!0});var $l={},js={exports:{}};const T1="2.0.0",Bl=256,N1=Number.MAX_SAFE_INTEGER||9007199254740991,L1=16,O1=Bl-6,P1=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Hi={MAX_LENGTH:Bl,MAX_SAFE_COMPONENT_LENGTH:L1,MAX_SAFE_BUILD_LENGTH:O1,MAX_SAFE_INTEGER:N1,RELEASE_TYPES:P1,SEMVER_SPEC_VERSION:T1,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},$1={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},Rs={};const B1=typeof $1=="object"&&Rs&&Rs.NODE_DEBUG&&/\bsemver\b/i.test(Rs.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Ui=B1;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=Hi,s=Ui;t=e.exports={};const a=t.re=[],l=t.safeRe=[],d=t.src=[],h=t.t={};let m=0;const R="[a-zA-Z0-9-]",y=[["\\s",1],["\\d",i],[R,n]],C=B=>{for(const[O,M]of y)B=B.split(`${O}*`).join(`${O}{0,${M}}`).split(`${O}+`).join(`${O}{1,${M}}`);return B},x=(B,O,M)=>{const T=C(O),N=m++;s(B,N,O),h[B]=N,d[N]=O,a[N]=new RegExp(O,M?"g":void 0),l[N]=new RegExp(T,M?"g":void 0)};x("NUMERICIDENTIFIER","0|[1-9]\\d*"),x("NUMERICIDENTIFIERLOOSE","\\d+"),x("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${R}*`),x("MAINVERSION",`(${d[h.NUMERICIDENTIFIER]})\\.(${d[h.NUMERICIDENTIFIER]})\\.(${d[h.NUMERICIDENTIFIER]})`),x("MAINVERSIONLOOSE",`(${d[h.NUMERICIDENTIFIERLOOSE]})\\.(${d[h.NUMERICIDENTIFIERLOOSE]})\\.(${d[h.NUMERICIDENTIFIERLOOSE]})`),x("PRERELEASEIDENTIFIER",`(?:${d[h.NUMERICIDENTIFIER]}|${d[h.NONNUMERICIDENTIFIER]})`),x("PRERELEASEIDENTIFIERLOOSE",`(?:${d[h.NUMERICIDENTIFIERLOOSE]}|${d[h.NONNUMERICIDENTIFIER]})`),x("PRERELEASE",`(?:-(${d[h.PRERELEASEIDENTIFIER]}(?:\\.${d[h.PRERELEASEIDENTIFIER]})*))`),x("PRERELEASELOOSE",`(?:-?(${d[h.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[h.PRERELEASEIDENTIFIERLOOSE]})*))`),x("BUILDIDENTIFIER",`${R}+`),x("BUILD",`(?:\\+(${d[h.BUILDIDENTIFIER]}(?:\\.${d[h.BUILDIDENTIFIER]})*))`),x("FULLPLAIN",`v?${d[h.MAINVERSION]}${d[h.PRERELEASE]}?${d[h.BUILD]}?`),x("FULL",`^${d[h.FULLPLAIN]}$`),x("LOOSEPLAIN",`[v=\\s]*${d[h.MAINVERSIONLOOSE]}${d[h.PRERELEASELOOSE]}?${d[h.BUILD]}?`),x("LOOSE",`^${d[h.LOOSEPLAIN]}$`),x("GTLT","((?:<|>)?=?)"),x("XRANGEIDENTIFIERLOOSE",`${d[h.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),x("XRANGEIDENTIFIER",`${d[h.NUMERICIDENTIFIER]}|x|X|\\*`),x("XRANGEPLAIN",`[v=\\s]*(${d[h.XRANGEIDENTIFIER]})(?:\\.(${d[h.XRANGEIDENTIFIER]})(?:\\.(${d[h.XRANGEIDENTIFIER]})(?:${d[h.PRERELEASE]})?${d[h.BUILD]}?)?)?`),x("XRANGEPLAINLOOSE",`[v=\\s]*(${d[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[h.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[h.XRANGEIDENTIFIERLOOSE]})(?:${d[h.PRERELEASELOOSE]})?${d[h.BUILD]}?)?)?`),x("XRANGE",`^${d[h.GTLT]}\\s*${d[h.XRANGEPLAIN]}$`),x("XRANGELOOSE",`^${d[h.GTLT]}\\s*${d[h.XRANGEPLAINLOOSE]}$`),x("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),x("COERCE",`${d[h.COERCEPLAIN]}(?:$|[^\\d])`),x("COERCEFULL",d[h.COERCEPLAIN]+`(?:${d[h.PRERELEASE]})?(?:${d[h.BUILD]})?(?:$|[^\\d])`),x("COERCERTL",d[h.COERCE],!0),x("COERCERTLFULL",d[h.COERCEFULL],!0),x("LONETILDE","(?:~>?)"),x("TILDETRIM",`(\\s*)${d[h.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",x("TILDE",`^${d[h.LONETILDE]}${d[h.XRANGEPLAIN]}$`),x("TILDELOOSE",`^${d[h.LONETILDE]}${d[h.XRANGEPLAINLOOSE]}$`),x("LONECARET","(?:\\^)"),x("CARETTRIM",`(\\s*)${d[h.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",x("CARET",`^${d[h.LONECARET]}${d[h.XRANGEPLAIN]}$`),x("CARETLOOSE",`^${d[h.LONECARET]}${d[h.XRANGEPLAINLOOSE]}$`),x("COMPARATORLOOSE",`^${d[h.GTLT]}\\s*(${d[h.LOOSEPLAIN]})$|^$`),x("COMPARATOR",`^${d[h.GTLT]}\\s*(${d[h.FULLPLAIN]})$|^$`),x("COMPARATORTRIM",`(\\s*)${d[h.GTLT]}\\s*(${d[h.LOOSEPLAIN]}|${d[h.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",x("HYPHENRANGE",`^\\s*(${d[h.XRANGEPLAIN]})\\s+-\\s+(${d[h.XRANGEPLAIN]})\\s*$`),x("HYPHENRANGELOOSE",`^\\s*(${d[h.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[h.XRANGEPLAINLOOSE]})\\s*$`),x("STAR","(<|>)?=?\\s*\\*"),x("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),x("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(js,js.exports);var Pn=js.exports;const D1=Object.freeze({loose:!0}),F1=Object.freeze({}),j1=e=>e?typeof e!="object"?D1:e:F1;var ho=j1;const Ra=/^[0-9]+$/,Dl=(e,t)=>{const r=Ra.test(e),n=Ra.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:eDl(t,e);var Fl={compareIdentifiers:Dl,rcompareIdentifiers:H1};const qn=Ui,{MAX_LENGTH:Ma,MAX_SAFE_INTEGER:Jn}=Hi,{safeRe:ka,t:Ca}=Pn,U1=ho,{compareIdentifiers:Or}=Fl;let W1=class Et{constructor(t,r){if(r=U1(r),t instanceof Et){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ma)throw new TypeError(`version is longer than ${Ma} characters`);qn("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?ka[Ca.LOOSE]:ka[Ca.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Jn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Jn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Jn||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),Or(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var et=W1;const Ia=et,V1=(e,t,r=!1)=>{if(e instanceof Ia)return e;try{return new Ia(e,t)}catch(n){if(!r)return null;throw n}};var sn=V1;const z1=sn,q1=(e,t)=>{const r=z1(e,t);return r?r.version:null};var J1=q1;const G1=sn,Z1=(e,t)=>{const r=G1(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};var K1=Z1;const xa=et,Q1=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new xa(e instanceof xa?e.version:e,r).inc(t,n,i).version}catch{return null}};var Y1=Q1;const Aa=sn,X1=(e,t)=>{const r=Aa(e,null,!0),n=Aa(t,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,a=s?r:n,l=s?n:r,d=!!a.prerelease.length;if(!!l.prerelease.length&&!d)return!l.patch&&!l.minor?"major":a.patch?"patch":a.minor?"minor":"major";const m=d?"pre":"";return r.major!==n.major?m+"major":r.minor!==n.minor?m+"minor":r.patch!==n.patch?m+"patch":"prerelease"};var ep=X1;const tp=et,rp=(e,t)=>new tp(e,t).major;var np=rp;const ip=et,sp=(e,t)=>new ip(e,t).minor;var op=sp;const ap=et,cp=(e,t)=>new ap(e,t).patch;var lp=cp;const up=sn,hp=(e,t)=>{const r=up(e,t);return r&&r.prerelease.length?r.prerelease:null};var dp=hp;const Ta=et,fp=(e,t,r)=>new Ta(e,r).compare(new Ta(t,r));var bt=fp;const pp=bt,gp=(e,t,r)=>pp(t,e,r);var mp=gp;const vp=bt,bp=(e,t)=>vp(e,t,!0);var wp=bp;const Na=et,_p=(e,t,r)=>{const n=new Na(e,r),i=new Na(t,r);return n.compare(i)||n.compareBuild(i)};var fo=_p;const yp=fo,Ep=(e,t)=>e.sort((r,n)=>yp(r,n,t));var Sp=Ep;const Rp=fo,Mp=(e,t)=>e.sort((r,n)=>Rp(n,r,t));var kp=Mp;const Cp=bt,Ip=(e,t,r)=>Cp(e,t,r)>0;var Wi=Ip;const xp=bt,Ap=(e,t,r)=>xp(e,t,r)<0;var po=Ap;const Tp=bt,Np=(e,t,r)=>Tp(e,t,r)===0;var jl=Np;const Lp=bt,Op=(e,t,r)=>Lp(e,t,r)!==0;var Hl=Op;const Pp=bt,$p=(e,t,r)=>Pp(e,t,r)>=0;var go=$p;const Bp=bt,Dp=(e,t,r)=>Bp(e,t,r)<=0;var mo=Dp;const Fp=jl,jp=Hl,Hp=Wi,Up=go,Wp=po,Vp=mo,zp=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return Fp(e,r,n);case"!=":return jp(e,r,n);case">":return Hp(e,r,n);case">=":return Up(e,r,n);case"<":return Wp(e,r,n);case"<=":return Vp(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var Ul=zp;const qp=et,Jp=sn,{safeRe:Gn,t:Zn}=Pn,Gp=(e,t)=>{if(e instanceof qp)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Gn[Zn.COERCEFULL]:Gn[Zn.COERCE]);else{const d=t.includePrerelease?Gn[Zn.COERCERTLFULL]:Gn[Zn.COERCERTL];let h;for(;(h=d.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||h.index+h[0].length!==r.index+r[0].length)&&(r=h),d.lastIndex=h.index+h[1].length+h[2].length;d.lastIndex=-1}if(r===null)return null;const n=r[2],i=r[3]||"0",s=r[4]||"0",a=t.includePrerelease&&r[5]?`-${r[5]}`:"",l=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Jp(`${n}.${i}.${s}${a}${l}`,t)};var Zp=Gp;class Kp{constructor(){this.max=1e3,this.map=new Map}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){const i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}}var Qp=Kp,Ms,La;function wt(){if(La)return Ms;La=1;const e=/\s+/g;class t{constructor(u,f){if(f=i(f),u instanceof t)return u.loose===!!f.loose&&u.includePrerelease===!!f.includePrerelease?u:new t(u.raw,f);if(u instanceof s)return this.raw=u.value,this.set=[[u]],this.formatted=void 0,this;if(this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease,this.raw=u.trim().replace(e," "),this.set=this.raw.split("||").map(p=>this.parseRange(p.trim())).filter(p=>p.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const p=this.set[0];if(this.set=this.set.filter(v=>!B(v[0])),this.set.length===0)this.set=[p];else if(this.set.length>1){for(const v of this.set)if(v.length===1&&O(v[0])){this.set=[v];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let u=0;u0&&(this.formatted+="||");const f=this.set[u];for(let p=0;p0&&(this.formatted+=" "),this.formatted+=f[p].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(u){const p=((this.options.includePrerelease&&C)|(this.options.loose&&x))+":"+u,v=n.get(p);if(v)return v;const E=this.options.loose,k=E?d[h.HYPHENRANGELOOSE]:d[h.HYPHENRANGE];u=u.replace(k,ne(this.options.includePrerelease)),a("hyphen replace",u),u=u.replace(d[h.COMPARATORTRIM],m),a("comparator trim",u),u=u.replace(d[h.TILDETRIM],R),a("tilde trim",u),u=u.replace(d[h.CARETTRIM],y),a("caret trim",u);let g=u.split(" ").map(H=>T(H,this.options)).join(" ").split(/\s+/).map(H=>X(H,this.options));E&&(g=g.filter(H=>(a("loose invalid filter",H,this.options),!!H.match(d[h.COMPARATORLOOSE])))),a("range list",g);const c=new Map,w=g.map(H=>new s(H,this.options));for(const H of w){if(B(H))return[H];c.set(H.value,H)}c.size>1&&c.has("")&&c.delete("");const U=[...c.values()];return n.set(p,U),U}intersects(u,f){if(!(u instanceof t))throw new TypeError("a Range is required");return this.set.some(p=>M(p,f)&&u.set.some(v=>M(v,f)&&p.every(E=>v.every(k=>E.intersects(k,f)))))}test(u){if(!u)return!1;if(typeof u=="string")try{u=new l(u,this.options)}catch{return!1}for(let f=0;fo.value==="<0.0.0-0",O=o=>o.value==="",M=(o,u)=>{let f=!0;const p=o.slice();let v=p.pop();for(;f&&p.length;)f=p.every(E=>v.intersects(E,u)),v=p.pop();return f},T=(o,u)=>(a("comp",o,u),o=F(o,u),a("caret",o),o=D(o,u),a("tildes",o),o=te(o,u),a("xrange",o),o=z(o,u),a("stars",o),o),N=o=>!o||o.toLowerCase()==="x"||o==="*",D=(o,u)=>o.trim().split(/\s+/).map(f=>L(f,u)).join(" "),L=(o,u)=>{const f=u.loose?d[h.TILDELOOSE]:d[h.TILDE];return o.replace(f,(p,v,E,k,g)=>{a("tilde",o,p,v,E,k,g);let c;return N(v)?c="":N(E)?c=`>=${v}.0.0 <${+v+1}.0.0-0`:N(k)?c=`>=${v}.${E}.0 <${v}.${+E+1}.0-0`:g?(a("replaceTilde pr",g),c=`>=${v}.${E}.${k}-${g} <${v}.${+E+1}.0-0`):c=`>=${v}.${E}.${k} <${v}.${+E+1}.0-0`,a("tilde return",c),c})},F=(o,u)=>o.trim().split(/\s+/).map(f=>W(f,u)).join(" "),W=(o,u)=>{a("caret",o,u);const f=u.loose?d[h.CARETLOOSE]:d[h.CARET],p=u.includePrerelease?"-0":"";return o.replace(f,(v,E,k,g,c)=>{a("caret",o,v,E,k,g,c);let w;return N(E)?w="":N(k)?w=`>=${E}.0.0${p} <${+E+1}.0.0-0`:N(g)?E==="0"?w=`>=${E}.${k}.0${p} <${E}.${+k+1}.0-0`:w=`>=${E}.${k}.0${p} <${+E+1}.0.0-0`:c?(a("replaceCaret pr",c),E==="0"?k==="0"?w=`>=${E}.${k}.${g}-${c} <${E}.${k}.${+g+1}-0`:w=`>=${E}.${k}.${g}-${c} <${E}.${+k+1}.0-0`:w=`>=${E}.${k}.${g}-${c} <${+E+1}.0.0-0`):(a("no pr"),E==="0"?k==="0"?w=`>=${E}.${k}.${g}${p} <${E}.${k}.${+g+1}-0`:w=`>=${E}.${k}.${g}${p} <${E}.${+k+1}.0-0`:w=`>=${E}.${k}.${g} <${+E+1}.0.0-0`),a("caret return",w),w})},te=(o,u)=>(a("replaceXRanges",o,u),o.split(/\s+/).map(f=>Z(f,u)).join(" ")),Z=(o,u)=>{o=o.trim();const f=u.loose?d[h.XRANGELOOSE]:d[h.XRANGE];return o.replace(f,(p,v,E,k,g,c)=>{a("xRange",o,p,v,E,k,g,c);const w=N(E),U=w||N(k),H=U||N(g),V=H;return v==="="&&V&&(v=""),c=u.includePrerelease?"-0":"",w?v===">"||v==="<"?p="<0.0.0-0":p="*":v&&V?(U&&(k=0),g=0,v===">"?(v=">=",U?(E=+E+1,k=0,g=0):(k=+k+1,g=0)):v==="<="&&(v="<",U?E=+E+1:k=+k+1),v==="<"&&(c="-0"),p=`${v+E}.${k}.${g}${c}`):U?p=`>=${E}.0.0${c} <${+E+1}.0.0-0`:H&&(p=`>=${E}.${k}.0${c} <${E}.${+k+1}.0-0`),a("xRange return",p),p})},z=(o,u)=>(a("replaceStars",o,u),o.trim().replace(d[h.STAR],"")),X=(o,u)=>(a("replaceGTE0",o,u),o.trim().replace(d[u.includePrerelease?h.GTE0PRE:h.GTE0],"")),ne=o=>(u,f,p,v,E,k,g,c,w,U,H,V)=>(N(p)?f="":N(v)?f=`>=${p}.0.0${o?"-0":""}`:N(E)?f=`>=${p}.${v}.0${o?"-0":""}`:k?f=`>=${f}`:f=`>=${f}${o?"-0":""}`,N(w)?c="":N(U)?c=`<${+w+1}.0.0-0`:N(H)?c=`<${w}.${+U+1}.0-0`:V?c=`<=${w}.${U}.${H}-${V}`:o?c=`<${w}.${U}.${+H+1}-0`:c=`<=${c}`,`${f} ${c}`.trim()),S=(o,u,f)=>{for(let p=0;p0){const v=o[p].semver;if(v.major===u.major&&v.minor===u.minor&&v.patch===u.patch)return!0}return!1}return!0};return Ms}var ks,Oa;function Vi(){if(Oa)return ks;Oa=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(m,R){if(R=r(R),m instanceof t){if(m.loose===!!R.loose)return m;m=m.value}m=m.trim().split(/\s+/).join(" "),a("comparator",m,R),this.options=R,this.loose=!!R.loose,this.parse(m),this.semver===e?this.value="":this.value=this.operator+this.semver.version,a("comp",this)}parse(m){const R=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],y=m.match(R);if(!y)throw new TypeError(`Invalid comparator: ${m}`);this.operator=y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new l(y[2],this.options.loose):this.semver=e}toString(){return this.value}test(m){if(a("Comparator.test",m,this.options.loose),this.semver===e||m===e)return!0;if(typeof m=="string")try{m=new l(m,this.options)}catch{return!1}return s(m,this.operator,this.semver,this.options)}intersects(m,R){if(!(m instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new d(m.value,R).test(this.value):m.operator===""?m.value===""?!0:new d(this.value,R).test(m.semver):(R=r(R),R.includePrerelease&&(this.value==="<0.0.0-0"||m.value==="<0.0.0-0")||!R.includePrerelease&&(this.value.startsWith("<0.0.0")||m.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&m.operator.startsWith(">")||this.operator.startsWith("<")&&m.operator.startsWith("<")||this.semver.version===m.semver.version&&this.operator.includes("=")&&m.operator.includes("=")||s(this.semver,"<",m.semver,R)&&this.operator.startsWith(">")&&m.operator.startsWith("<")||s(this.semver,">",m.semver,R)&&this.operator.startsWith("<")&&m.operator.startsWith(">")))}}ks=t;const r=ho,{safeRe:n,t:i}=Pn,s=Ul,a=Ui,l=et,d=wt();return ks}const Yp=wt(),Xp=(e,t,r)=>{try{t=new Yp(t,r)}catch{return!1}return t.test(e)};var zi=Xp;const eg=wt(),tg=(e,t)=>new eg(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var rg=tg;const ng=et,ig=wt(),sg=(e,t,r)=>{let n=null,i=null,s=null;try{s=new ig(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!n||i.compare(a)===-1)&&(n=a,i=new ng(n,r))}),n};var og=sg;const ag=et,cg=wt(),lg=(e,t,r)=>{let n=null,i=null,s=null;try{s=new cg(t,r)}catch{return null}return e.forEach(a=>{s.test(a)&&(!n||i.compare(a)===1)&&(n=a,i=new ag(n,r))}),n};var ug=lg;const Cs=et,hg=wt(),Pa=Wi,dg=(e,t)=>{e=new hg(e,t);let r=new Cs("0.0.0");if(e.test(r)||(r=new Cs("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n{const l=new Cs(a.semver.version);switch(a.operator){case">":l.prerelease.length===0?l.patch++:l.prerelease.push(0),l.raw=l.format();case"":case">=":(!s||Pa(l,s))&&(s=l);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),s&&(!r||Pa(r,s))&&(r=s)}return r&&e.test(r)?r:null};var fg=dg;const pg=wt(),gg=(e,t)=>{try{return new pg(e,t).range||"*"}catch{return null}};var mg=gg;const vg=et,Wl=Vi(),{ANY:bg}=Wl,wg=wt(),_g=zi,$a=Wi,Ba=po,yg=mo,Eg=go,Sg=(e,t,r,n)=>{e=new vg(e,n),t=new wg(t,n);let i,s,a,l,d;switch(r){case">":i=$a,s=yg,a=Ba,l=">",d=">=";break;case"<":i=Ba,s=Eg,a=$a,l="<",d="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(_g(e,t,n))return!1;for(let h=0;h{C.semver===bg&&(C=new Wl(">=0.0.0")),R=R||C,y=y||C,i(C.semver,R.semver,n)?R=C:a(C.semver,y.semver,n)&&(y=C)}),R.operator===l||R.operator===d||(!y.operator||y.operator===l)&&s(e,y.semver))return!1;if(y.operator===d&&a(e,y.semver))return!1}return!0};var vo=Sg;const Rg=vo,Mg=(e,t,r)=>Rg(e,t,">",r);var kg=Mg;const Cg=vo,Ig=(e,t,r)=>Cg(e,t,"<",r);var xg=Ig;const Da=wt(),Ag=(e,t,r)=>(e=new Da(e,r),t=new Da(t,r),e.intersects(t,r));var Tg=Ag;const Ng=zi,Lg=bt;var Og=(e,t,r)=>{const n=[];let i=null,s=null;const a=e.sort((m,R)=>Lg(m,R,r));for(const m of a)Ng(m,t,r)?(s=m,i||(i=m)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const l=[];for(const[m,R]of n)m===R?l.push(m):!R&&m===a[0]?l.push("*"):R?m===a[0]?l.push(`<=${R}`):l.push(`${m} - ${R}`):l.push(`>=${m}`);const d=l.join(" || "),h=typeof t.raw=="string"?t.raw:String(t);return d.length{if(e===t)return!0;e=new Fa(e,r),t=new Fa(t,r);let n=!1;e:for(const i of e.set){for(const s of t.set){const a=Bg(i,s,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},$g=[new bo(">=0.0.0-0")],ja=[new bo(">=0.0.0")],Bg=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Is){if(t.length===1&&t[0].semver===Is)return!0;r.includePrerelease?e=$g:e=ja}if(t.length===1&&t[0].semver===Is){if(r.includePrerelease)return!0;t=ja}const n=new Set;let i,s;for(const C of e)C.operator===">"||C.operator===">="?i=Ha(i,C,r):C.operator==="<"||C.operator==="<="?s=Ua(s,C,r):n.add(C.semver);if(n.size>1)return null;let a;if(i&&s){if(a=wo(i.semver,s.semver,r),a>0)return null;if(a===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const C of n){if(i&&!an(C,String(i),r)||s&&!an(C,String(s),r))return null;for(const x of t)if(!an(C,String(x),r))return!1;return!0}let l,d,h,m,R=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,y=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;R&&R.prerelease.length===1&&s.operator==="<"&&R.prerelease[0]===0&&(R=!1);for(const C of t){if(m=m||C.operator===">"||C.operator===">=",h=h||C.operator==="<"||C.operator==="<=",i){if(y&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===y.major&&C.semver.minor===y.minor&&C.semver.patch===y.patch&&(y=!1),C.operator===">"||C.operator===">="){if(l=Ha(i,C,r),l===C&&l!==i)return!1}else if(i.operator===">="&&!an(i.semver,String(C),r))return!1}if(s){if(R&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===R.major&&C.semver.minor===R.minor&&C.semver.patch===R.patch&&(R=!1),C.operator==="<"||C.operator==="<="){if(d=Ua(s,C,r),d===C&&d!==s)return!1}else if(s.operator==="<="&&!an(s.semver,String(C),r))return!1}if(!C.operator&&(s||i)&&a!==0)return!1}return!(i&&h&&!s&&a!==0||s&&m&&!i&&a!==0||y||R)},Ha=(e,t,r)=>{if(!e)return t;const n=wo(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Ua=(e,t,r)=>{if(!e)return t;const n=wo(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};var Dg=Pg;const xs=Pn,Wa=Hi,Fg=et,Va=Fl,jg=sn,Hg=J1,Ug=K1,Wg=Y1,Vg=ep,zg=np,qg=op,Jg=lp,Gg=dp,Zg=bt,Kg=mp,Qg=wp,Yg=fo,Xg=Sp,em=kp,tm=Wi,rm=po,nm=jl,im=Hl,sm=go,om=mo,am=Ul,cm=Zp,lm=Vi(),um=wt(),hm=zi,dm=rg,fm=og,pm=ug,gm=fg,mm=mg,vm=vo,bm=kg,wm=xg,_m=Tg,ym=Og,Em=Dg;var Sm={parse:jg,valid:Hg,clean:Ug,inc:Wg,diff:Vg,major:zg,minor:qg,patch:Jg,prerelease:Gg,compare:Zg,rcompare:Kg,compareLoose:Qg,compareBuild:Yg,sort:Xg,rsort:em,gt:tm,lt:rm,eq:nm,neq:im,gte:sm,lte:om,cmp:am,coerce:cm,Comparator:lm,Range:um,satisfies:hm,toComparators:dm,maxSatisfying:fm,minSatisfying:pm,minVersion:gm,validRange:mm,outside:vm,gtr:bm,ltr:wm,intersects:_m,simplifyRange:ym,subset:Em,SemVer:Fg,re:xs.re,src:xs.src,tokens:xs.t,SEMVER_SPEC_VERSION:Wa.SEMVER_SPEC_VERSION,RELEASE_TYPES:Wa.RELEASE_TYPES,compareIdentifiers:Va.compareIdentifiers,rcompareIdentifiers:Va.rcompareIdentifiers};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.satisfiesVersionRange=e.gtRange=e.gtVersion=e.assertIsSemVerRange=e.assertIsSemVerVersion=e.isValidSemVerRange=e.isValidSemVerVersion=e.VersionRangeStruct=e.VersionStruct=void 0;const t=Sm,r=br,n=Ke;e.VersionStruct=(0,r.refine)((0,r.string)(),"Version",R=>(0,t.valid)(R)===null?`Expected SemVer version, got "${R}"`:!0),e.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",R=>(0,t.validRange)(R)===null?`Expected SemVer range, got "${R}"`:!0);function i(R){return(0,r.is)(R,e.VersionStruct)}e.isValidSemVerVersion=i;function s(R){return(0,r.is)(R,e.VersionRangeStruct)}e.isValidSemVerRange=s;function a(R){(0,n.assertStruct)(R,e.VersionStruct)}e.assertIsSemVerVersion=a;function l(R){(0,n.assertStruct)(R,e.VersionRangeStruct)}e.assertIsSemVerRange=l;function d(R,y){return(0,t.gt)(R,y)}e.gtVersion=d;function h(R,y){return(0,t.gtr)(R,y)}e.gtRange=h;function m(R,y){return(0,t.satisfies)(R,y,{includePrerelease:!0})}e.satisfiesVersionRange=m})($l);(function(e){var t=Q&&Q.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var l=Object.getOwnPropertyDescriptor(i,s);(!l||("get"in l?!i.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,l)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=Q&&Q.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ke,e),r(Ln,e),r(ae,e),r(Fi,e),r(Ct,e),r(Jr,e),r(xl,e),r(On,e),r(Al,e),r(Tl,e),r(Gr,e),r(Nl,e),r(It,e),r(Ll,e),r(Ol,e),r(Pl,e),r($l,e)})(ul);(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createModuleLogger=e.projectLogger=void 0;const t=ul;Object.defineProperty(e,"createModuleLogger",{enumerable:!0,get:function(){return t.createModuleLogger}}),e.projectLogger=(0,t.createProjectLogger)("eth-block-tracker")})(ll);var Vl=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.PollingBlockTracker=void 0;const Rm=Vl(ro),Mm=Vl(Xf),km=xn,za=ll,qa=(0,za.createModuleLogger)(za.projectLogger,"polling-block-tracker"),Cm=(0,Rm.default)(),Im=1e3;class xm extends km.BaseBlockTracker{constructor(t={}){var r;if(!t.provider)throw new Error("PollingBlockTracker - no provider specified.");super(Object.assign(Object.assign({},t),{blockResetDuration:(r=t.blockResetDuration)!==null&&r!==void 0?r:t.pollingInterval})),this._provider=t.provider,this._pollingInterval=t.pollingInterval||20*Im,this._retryTimeout=t.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=t.keepEventLoopActive===void 0?!0:t.keepEventLoopActive,this._setSkipCacheFlag=t.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var t;this._isRunning;)try{await this._updateLatestBlock();const r=Ja(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block: +${(t=r.stack)!==null&&t!==void 0?t:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Ja(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const t=await this._fetchLatestBlock();this._newPotentialLatest(t)}async _fetchLatestBlock(){const t={jsonrpc:"2.0",id:Cm(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(t.skipCache=!0),qa("Making request",t);const r=await(0,Mm.default)(n=>this._provider.sendAsync(t,n))();if(qa("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: +${r.error.message}`);return r.result}}Bi.PollingBlockTracker=xm;function Ja(e,t){return new Promise(r=>{const n=setTimeout(r,e);n.unref&&t&&n.unref()})}var qi={},Am=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qi,"__esModule",{value:!0});qi.SubscribeBlockTracker=void 0;const Tm=Am(ro),Nm=xn,Lm=(0,Tm.default)();class Om extends Nm.BaseBlockTracker{constructor(t={}){if(!t.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(t),this._provider=t.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const t=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(t)}catch(t){this.emit("error",t)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(t){this.emit("error",t)}}_call(t,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:Lm(),method:t,params:r,jsonrpc:"2.0"},(s,a)=>{s?i(s):n(a.result)})})}_handleSubData(t,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}qi.SubscribeBlockTracker=Om;(function(e){var t=Q&&Q.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=Q&&Q.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Bi,e),r(qi,e)})(cl);var _o={},Ji={},$n={};Object.defineProperty($n,"__esModule",{value:!0});$n.getUniqueId=void 0;const zl=4294967295;let As=Math.floor(Math.random()*zl);function Pm(){return As=(As+1)%zl,As}$n.getUniqueId=Pm;Object.defineProperty(Ji,"__esModule",{value:!0});Ji.createIdRemapMiddleware=void 0;const $m=$n;function Bm(){return(e,t,r,n)=>{const i=e.id,s=$m.getUniqueId();e.id=s,t.id=s,r(a=>{e.id=i,t.id=i,a()})}}Ji.createIdRemapMiddleware=Bm;var Gi={};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.createAsyncMiddleware=void 0;function Dm(e){return async(t,r,n,i)=>{let s;const a=new Promise(m=>{s=m});let l=null,d=!1;const h=async()=>{d=!0,n(m=>{l=m,s()}),await a};try{await e(t,r,h),d?(await a,l(null)):i(null)}catch(m){l?l(m):i(m)}}}Gi.createAsyncMiddleware=Dm;var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.createScaffoldMiddleware=void 0;function Fm(e){return(t,r,n,i)=>{const s=e[t.method];return s===void 0?n():typeof s=="function"?s(t,r,n,i):(r.result=s,i())}}Zi.createScaffoldMiddleware=Fm;var Bn={},yo={};Object.defineProperty(yo,"__esModule",{value:!0});const jm=si;function Ga(e,t,r){try{Reflect.apply(e,t,r)}catch(n){setTimeout(()=>{throw n})}}function Hm(e){const t=e.length,r=new Array(t);for(let n=0;n0&&([a]=r),a instanceof Error)throw a;const l=new Error(`Unhandled error.${a?` (${a.message})`:""}`);throw l.context=a,l}const s=i[t];if(s===void 0)return!1;if(typeof s=="function")Ga(s,this,r);else{const a=s.length,l=Hm(s);for(let d=0;d"u"&&(n=Gl()),Hs(e,"",0,[],void 0,0,n);var i;try{ur.length===0?i=JSON.stringify(e,t,r):i=JSON.stringify(e,Kl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;fr.length!==0;){var s=fr.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Hr(e,t,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:e}),fr.push([n,r,t,i])):ur.push([t,r,e]):(n[r]=e,fr.push([n,r,t]))}function Hs(e,t,r,n,i,s,a){s+=1;var l;if(typeof e=="object"&&e!==null){for(l=0;la.depthLimit){Hr(ri,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Hr(ri,e,t,i);return}if(n.push(e),Array.isArray(e))for(l=0;lt?1:0}function Zl(e,t,r,n){typeof n>"u"&&(n=Gl());var i=Us(e,"",0,[],void 0,0,n)||e,s;try{ur.length===0?s=JSON.stringify(i,t,r):s=JSON.stringify(i,Kl(t),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;fr.length!==0;){var a=fr.pop();a.length===4?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}}return s}function Us(e,t,r,n,i,s,a){s+=1;var l;if(typeof e=="object"&&e!==null){for(l=0;la.depthLimit){Hr(ri,e,t,i);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){Hr(ri,e,t,i);return}if(n.push(e),Array.isArray(e))for(l=0;l0)for(var n=0;n=1e3&&e<=4999}function Gm(e,t){if(t!=="[Circular]")return t}var Eo={},Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.errorValues=Ft.errorCodes=void 0;Ft.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Ft.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeError=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Ft,r=Dt,n=t.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:a(n)};e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function a(y,C=i){if(Number.isInteger(y)){const x=y.toString();if(R(t.errorValues,x))return t.errorValues[x].message;if(h(y))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return C}e.getMessageFromCode=a;function l(y){if(!Number.isInteger(y))return!1;const C=y.toString();return!!(t.errorValues[C]||h(y))}e.isValidCode=l;function d(y,{fallbackError:C=s,shouldIncludeStack:x=!1}={}){var B,O;if(!C||!Number.isInteger(C.code)||typeof C.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(y instanceof r.EthereumRpcError)return y.serialize();const M={};if(y&&typeof y=="object"&&!Array.isArray(y)&&R(y,"code")&&l(y.code)){const N=y;M.code=N.code,N.message&&typeof N.message=="string"?(M.message=N.message,R(N,"data")&&(M.data=N.data)):(M.message=a(M.code),M.data={originalError:m(y)})}else{M.code=C.code;const N=(B=y)===null||B===void 0?void 0:B.message;M.message=N&&typeof N=="string"?N:C.message,M.data={originalError:m(y)}}const T=(O=y)===null||O===void 0?void 0:O.stack;return x&&y&&T&&typeof T=="string"&&(M.stack=T),M}e.serializeError=d;function h(y){return y>=-32099&&y<=-32e3}function m(y){return y&&typeof y=="object"&&!Array.isArray(y)?Object.assign({},y):y}function R(y,C){return Object.prototype.hasOwnProperty.call(y,C)}})(Eo);var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.ethErrors=void 0;const So=Dt,Yl=Eo,Qe=Ft;Ki.ethErrors={rpc:{parse:e=>lt(Qe.errorCodes.rpc.parse,e),invalidRequest:e=>lt(Qe.errorCodes.rpc.invalidRequest,e),invalidParams:e=>lt(Qe.errorCodes.rpc.invalidParams,e),methodNotFound:e=>lt(Qe.errorCodes.rpc.methodNotFound,e),internal:e=>lt(Qe.errorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return lt(t,e)},invalidInput:e=>lt(Qe.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>lt(Qe.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>lt(Qe.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>lt(Qe.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>lt(Qe.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>lt(Qe.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>cn(Qe.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>cn(Qe.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>cn(Qe.errorCodes.provider.unsupportedMethod,e),disconnected:e=>cn(Qe.errorCodes.provider.disconnected,e),chainDisconnected:e=>cn(Qe.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new So.EthereumProviderError(t,r,n)}}};function lt(e,t){const[r,n]=Xl(t);return new So.EthereumRpcError(e,r||Yl.getMessageFromCode(e),n)}function cn(e,t){const[r,n]=Xl(t);return new So.EthereumProviderError(e,r||Yl.getMessageFromCode(e),n)}function Xl(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMessageFromCode=e.serializeError=e.EthereumProviderError=e.EthereumRpcError=e.ethErrors=e.errorCodes=void 0;const t=Dt;Object.defineProperty(e,"EthereumRpcError",{enumerable:!0,get:function(){return t.EthereumRpcError}}),Object.defineProperty(e,"EthereumProviderError",{enumerable:!0,get:function(){return t.EthereumProviderError}});const r=Eo;Object.defineProperty(e,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(e,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=Ki;Object.defineProperty(e,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Ft;Object.defineProperty(e,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(ql);var Zm=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Bn,"__esModule",{value:!0});Bn.JsonRpcEngine=void 0;const Km=Zm(yo),ut=ql;class At extends Km.default{constructor(){super(),this._middleware=[]}push(t){this._middleware.push(t)}handle(t,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(t)?r?this._handleBatch(t,r):this._handleBatch(t):r?this._handle(t,r):this._promiseHandle(t)}asMiddleware(){return async(t,r,n,i)=>{try{const[s,a,l]=await At._runAllMiddleware(t,r,this._middleware);return a?(await At._runReturnHandlers(l),i(s)):n(async d=>{try{await At._runReturnHandlers(l)}catch(h){return d(h)}return d()})}catch(s){return i(s)}}}async _handleBatch(t,r){try{const n=await Promise.all(t.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(t){return new Promise(r=>{this._handle(t,(n,i)=>{r(i)})})}async _handle(t,r){if(!t||Array.isArray(t)||typeof t!="object"){const a=new ut.EthereumRpcError(ut.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof t}`,{request:t});return r(a,{id:void 0,jsonrpc:"2.0",error:a})}if(typeof t.method!="string"){const a=new ut.EthereumRpcError(ut.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof t.method}`,{request:t});return r(a,{id:t.id,jsonrpc:"2.0",error:a})}const n=Object.assign({},t),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(a){s=a}return s&&(delete i.result,i.error||(i.error=ut.serializeError(s))),r(s,i)}async _processRequest(t,r){const[n,i,s]=await At._runAllMiddleware(t,r,this._middleware);if(At._checkForCompletion(t,r,i),await At._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(t,r,n){const i=[];let s=null,a=!1;for(const l of n)if([s,a]=await At._runMiddleware(t,r,l,i),a)break;return[s,a,i.reverse()]}static _runMiddleware(t,r,n,i){return new Promise(s=>{const a=d=>{const h=d||r.error;h&&(r.error=ut.serializeError(h)),s([h,!0])},l=d=>{r.error?a(r.error):(d&&(typeof d!="function"&&a(new ut.EthereumRpcError(ut.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof d}" for request: +${Ts(t)}`,{request:t})),i.push(d)),s([null,!1]))};try{n(t,r,l,a)}catch(d){a(d)}})}static async _runReturnHandlers(t){for(const r of t)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(t,r,n){if(!("result"in r)&&!("error"in r))throw new ut.EthereumRpcError(ut.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: +${Ts(t)}`,{request:t});if(!n)throw new ut.EthereumRpcError(ut.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: +${Ts(t)}`,{request:t})}}Bn.JsonRpcEngine=At;function Ts(e){return JSON.stringify(e,null,2)}var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.mergeMiddleware=void 0;const Qm=Bn;function Ym(e){const t=new Qm.JsonRpcEngine;return e.forEach(r=>t.push(r)),t.asMiddleware()}Qi.mergeMiddleware=Ym;(function(e){var t=Q&&Q.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),r=Q&&Q.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(Ji,e),r(Gi,e),r(Zi,e),r($n,e),r(Bn,e),r(Qi,e)})(_o);var eu={},Ro={};const Mo=Zr(ou);var Yi={};Object.defineProperty(Yi,"__esModule",{value:!0});var Za=Mo,Xm=function(){function e(t){if(this._maxConcurrency=t,this._queue=[],t<=0)throw new Error("semaphore must be initialized to a positive value");this._value=t}return e.prototype.acquire=function(){var t=this,r=this.isLocked(),n=new Promise(function(i){return t._queue.push(i)});return r||this._dispatch(),n},e.prototype.runExclusive=function(t){return Za.__awaiter(this,void 0,void 0,function(){var r,n,i;return Za.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,t(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},e.prototype.isLocked=function(){return this._value<=0},e.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var t=this._currentReleaser;this._currentReleaser=void 0,t()}},e.prototype._dispatch=function(){var t=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,t._value++,t._dispatch())},r([this._value--,this._currentReleaser])}},e}();Yi.default=Xm;Object.defineProperty(Ro,"__esModule",{value:!0});var Ka=Mo,ev=Yi,tv=function(){function e(){this._semaphore=new ev.default(1)}return e.prototype.acquire=function(){return Ka.__awaiter(this,void 0,void 0,function(){var t,r;return Ka.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return t=n.sent(),r=t[1],[2,r]}})})},e.prototype.runExclusive=function(t){return this._semaphore.runExclusive(function(){return t()})},e.prototype.isLocked=function(){return this._semaphore.isLocked()},e.prototype.release=function(){this._semaphore.release()},e}();Ro.default=tv;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.withTimeout=void 0;var Kn=Mo;function rv(e,t,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return Kn.__awaiter(n,void 0,void 0,function(){var a,l,d;return Kn.__generator(this,function(h){switch(h.label){case 0:return a=!1,setTimeout(function(){a=!0,s(r)},t),[4,e.acquire()];case 1:return l=h.sent(),a?(d=Array.isArray(l)?l[1]:l,d()):i(l),[2]}})})})},runExclusive:function(i){return Kn.__awaiter(this,void 0,void 0,function(){var s,a;return Kn.__generator(this,function(l){switch(l.label){case 0:s=function(){},l.label=1;case 1:return l.trys.push([1,,7,8]),[4,this.acquire()];case 2:return a=l.sent(),Array.isArray(a)?(s=a[1],[4,i(a[0])]):[3,4];case 3:return[2,l.sent()];case 4:return s=a,[4,i()];case 5:return[2,l.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){e.release()},isLocked:function(){return e.isLocked()}}}Xi.withTimeout=rv;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.withTimeout=e.Semaphore=e.Mutex=void 0;var t=Ro;Object.defineProperty(e,"Mutex",{enumerable:!0,get:function(){return t.default}});var r=Yi;Object.defineProperty(e,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=Xi;Object.defineProperty(e,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(eu);var nv=sv,iv=Object.prototype.hasOwnProperty;function sv(){for(var e={},t=0;tfunction(...i){const s=t.promiseModule;return new s((a,l)=>{t.multiArgs?i.push((...h)=>{t.errorFirst?h[0]?l(h):(h.shift(),a(h)):a(h)}):t.errorFirst?i.push((h,m)=>{h?l(h):a(m)}):i.push(a),Reflect.apply(e,this===r?n:this,i)})},Ya=new WeakMap;var uv=(e,t)=>{t={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...t};const r=typeof e;if(!(e!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":r}\``);const n=(a,l)=>{let d=Ya.get(a);if(d||(d={},Ya.set(a,d)),l in d)return d[l];const h=x=>typeof x=="string"||typeof l=="symbol"?l===x:x.test(l),m=Reflect.getOwnPropertyDescriptor(a,l),R=m===void 0||m.writable||m.configurable,C=(t.include?t.include.some(h):!t.exclude.some(h))&&R;return d[l]=C,C},i=new WeakMap,s=new Proxy(e,{apply(a,l,d){const h=i.get(a);if(h)return Reflect.apply(h,l,d);const m=t.excludeMain?a:Qa(a,t,s,a);return i.set(a,m),Reflect.apply(m,l,d)},get(a,l){const d=a[l];if(!n(a,l)||d===Function.prototype[l])return d;const h=i.get(d);if(h)return h;if(typeof d=="function"){const m=Qa(d,t,s,a);return i.set(d,m),m}return d}});return s};const hv=An.default;let dv=class extends hv{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(t){this.updates=this.updates.concat(t),t.forEach(r=>this.emit("update",r))}addInitialResults(t){}getChangesAndClear(){const t=this.updates;return this.updates=[],t}};var ko=dv;const fv=ko;let pv=class extends fv{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(t){this.allResults=this.allResults.concat(t),super.addResults(t)}addInitialResults(t){this.allResults=this.allResults.concat(t),super.addInitialResults(t)}getAllResults(){return this.allResults}};var gv=pv,Fn={minBlockRef:mv,maxBlockRef:vv,sortBlockRefs:Co,bnToHex:bv,blockRefIsNumber:wv,hexToInt:ni,incrementHexInt:_v,intToHex:tu,unsafeRandomBytes:yv};function mv(...e){return Co(e)[0]}function vv(...e){const t=Co(e);return t[t.length-1]}function Co(e){return e.sort((t,r)=>t==="latest"||r==="earliest"?1:r==="latest"||t==="earliest"?-1:ni(t)-ni(r))}function bv(e){return"0x"+e.toString(16)}function wv(e){return e&&!["earliest","latest","pending"].includes(e)}function ni(e){return e==null?e:Number.parseInt(e,16)}function _v(e){if(e==null)return e;const t=ni(e);return tu(t+1)}function tu(e){if(e==null)return e;let t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function yv(e){let t="0x";for(let r=0;rn.toLowerCase()))}async initialize({currentBlock:t}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=t),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=kv(this.params.toBlock,t),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:t,newBlock:r}){const n=r;let i;t?i=Mv(t):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),l=(await this._fetchLogs(s)).filter(d=>this.matchLog(d));this.addResults(l)}async _fetchLogs(t){return await Sv(n=>this.ethQuery.getLogs(t,n))()}matchLog(t){if(Qn(this.params.fromBlock)>=Qn(t.blockNumber)||Cv(this.params.toBlock)&&Qn(this.params.toBlock)<=Qn(t.blockNumber))return!1;const r=t.address&&t.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let a=t.topics[s];if(!a)return!1;a=a.toLowerCase();let l=Array.isArray(i)?i:[i];return l.includes(null)?!0:(l=l.map(m=>m.toLowerCase()),l.includes(a))})}};var xv=Iv,Io=Av;async function Av({provider:e,fromBlock:t,toBlock:r}){t||(t=r);const n=ec(t),s=ec(r)-n+1,a=Array(s).fill().map((d,h)=>n+h).map(Tv);let l=await Promise.all(a.map(d=>Lv(e,"eth_getBlockByNumber",[d,!1])));return l=l.filter(d=>d!==null),l}function ec(e){return e==null?e:Number.parseInt(e,16)}function Tv(e){return e==null?e:"0x"+e.toString(16)}function Nv(e,t){return new Promise((r,n)=>{e.sendAsync(t,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function Lv(e,t,r){for(let n=0;n<3;n++)try{return await Nv(e,{id:1,jsonrpc:"2.0",method:t,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}return null}const Ov=ko,Pv=Io,{incrementHexInt:$v}=Fn;let Bv=class extends Ov{constructor({provider:t,params:r}){super(),this.type="block",this.provider=t}async update({oldBlock:t,newBlock:r}){const n=r,i=$v(t),a=(await Pv({provider:this.provider,fromBlock:i,toBlock:n})).map(l=>l.hash);this.addResults(a)}};var Dv=Bv;const Fv=ko,jv=Io,{incrementHexInt:Hv}=Fn;let Uv=class extends Fv{constructor({provider:t}){super(),this.type="tx",this.provider=t}async update({oldBlock:t}){const r=t,n=Hv(t),i=await jv({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const a of i)s.push(...a.transactions);this.addResults(s)}};var Wv=Uv;const Vv=eu.Mutex,{createAsyncMiddleware:zv,createScaffoldMiddleware:qv}=_o,Jv=xv,Gv=Dv,Zv=Wv,{intToHex:ru,hexToInt:Ns}=Fn;var Kv=Qv;function Qv({blockTracker:e,provider:t}){let r=0,n={};const i=new Vv,s=Yv({mutex:i}),a=qv({eth_newFilter:s(Ls(d)),eth_newBlockFilter:s(Ls(h)),eth_newPendingTransactionFilter:s(Ls(m)),eth_uninstallFilter:s(ei(C)),eth_getFilterChanges:s(ei(R)),eth_getFilterLogs:s(ei(y))}),l=async({oldBlock:T,newBlock:N})=>{if(n.length===0)return;const D=await i.acquire();try{await Promise.all(Pr(n).map(async L=>{try{await L.update({oldBlock:T,newBlock:N})}catch(F){console.error(F)}}))}catch(L){console.error(L)}D()};return a.newLogFilter=d,a.newBlockFilter=h,a.newPendingTransactionFilter=m,a.uninstallFilter=C,a.getFilterChanges=R,a.getFilterLogs=y,a.destroy=()=>{O()},a;async function d(T){const N=new Jv({provider:t,params:T});return await x(N),N}async function h(){const T=new Gv({provider:t});return await x(T),T}async function m(){const T=new Zv({provider:t});return await x(T),T}async function R(T){const N=Ns(T),D=n[N];if(!D)throw new Error(`No filter for index "${N}"`);return D.getChangesAndClear()}async function y(T){const N=Ns(T),D=n[N];if(!D)throw new Error(`No filter for index "${N}"`);let L=[];return D.type==="log"&&(L=D.getAllResults()),L}async function C(T){const N=Ns(T),L=!!n[N];return L&&await B(N),L}async function x(T){const N=Pr(n).length,D=await e.getLatestBlock();await T.initialize({currentBlock:D}),r++,n[r]=T,T.id=r,T.idHex=ru(r);const L=Pr(n).length;return M({prevFilterCount:N,newFilterCount:L}),r}async function B(T){const N=Pr(n).length;delete n[T];const D=Pr(n).length;M({prevFilterCount:N,newFilterCount:D})}async function O(){const T=Pr(n).length;n={},M({prevFilterCount:T,newFilterCount:0})}function M({prevFilterCount:T,newFilterCount:N}){if(T===0&&N>0){e.on("sync",l);return}if(T>0&&N===0){e.removeListener("sync",l);return}}}function Ls(e){return ei(async(...t)=>{const r=await e(...t);return ru(r.id)})}function ei(e){return zv(async(t,r)=>{const n=await e.apply(null,t.params);r.result=n})}function Yv({mutex:e}){return t=>async(r,n,i,s)=>{(await e.acquire())(),t(r,n,i,s)}}function Pr(e,t){const r=[];for(let n in e)r.push(e[n]);return r}const Xv=An.default,{createAsyncMiddleware:tc,createScaffoldMiddleware:eb}=_o,tb=Kv,{unsafeRandomBytes:rb,incrementHexInt:nb}=Fn,ib=Io;var sb=ob;function ob({blockTracker:e,provider:t}){const r={},n=tb({blockTracker:e,provider:t});let i=!1;const s=new Xv,a=eb({eth_subscribe:tc(l),eth_unsubscribe:tc(d)});return a.destroy=m,{events:s,middleware:a};async function l(R,y){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const C=R.params[0],x=rb(16);let B;switch(C){case"newHeads":B=O({subId:x});break;case"logs":const T=R.params[1],N=await n.newLogFilter(T);B=M({subId:x,filter:N});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${C}"`)}r[x]=B,y.result=x;return;function O({subId:T}){const N={type:C,destroy:async()=>{e.removeListener("sync",N.update)},update:async({oldBlock:D,newBlock:L})=>{const F=L,W=nb(D);(await ib({provider:t,fromBlock:W,toBlock:F})).map(ab).filter(z=>z!==null).forEach(z=>{h(T,z)})}};return e.on("sync",N.update),N}function M({subId:T,filter:N}){return N.on("update",L=>h(T,L)),{type:C,destroy:async()=>await n.uninstallFilter(N.idHex)}}}async function d(R,y){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const C=R.params[0],x=r[C];if(!x){y.result=!1;return}delete r[C],await x.destroy(),y.result=!0}function h(R,y){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:R,result:y}})}function m(){s.removeAllListeners();for(const R in r)r[R].destroy(),delete r[R];i=!0}}function ab(e){return e==null?null:{hash:e.hash,parentHash:e.parentHash,sha3Uncles:e.sha3Uncles,miner:e.miner,stateRoot:e.stateRoot,transactionsRoot:e.transactionsRoot,receiptsRoot:e.receiptsRoot,logsBloom:e.logsBloom,difficulty:e.difficulty,number:e.number,gasLimit:e.gasLimit,gasUsed:e.gasUsed,nonce:e.nonce,mixHash:e.mixHash,timestamp:e.timestamp,extraData:e.extraData}}Object.defineProperty($i,"__esModule",{value:!0});$i.SubscriptionManager=void 0;const cb=cl,lb=sb,rc=()=>{};class ub{constructor(t){const r=new cb.PollingBlockTracker({provider:t,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=lb({blockTracker:r,provider:t});this.events=n,this.subscriptionMiddleware=i}async handleRequest(t){const r={};return await this.subscriptionMiddleware(t,r,rc,rc),r}destroy(){this.subscriptionMiddleware.destroy()}}$i.SubscriptionManager=ub;var nu=Q&&Q.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.CoinbaseWalletProvider=void 0;const hb=nu(ci),db=ju,se=gn,re=q,fb=wn,nc=ht,Yn=Xr,it=Kr,Os=nu(Gf),ln=Yr,pb=qr,gb=$i,ic="DefaultChainId",sc="DefaultJsonRpcUrl";class mb extends db.EventEmitter{constructor(t){var r,n;super(),this._filterPolyfill=new pb.FilterPolyfill(this),this._subscriptionManager=new gb.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=t.chainId,this._jsonRpcUrlFromOpts=t.jsonRpcUrl,this._overrideIsMetaMask=t.overrideIsMetaMask,this._relayProvider=t.relayProvider,this._storage=t.storage,this._relayEventManager=t.relayEventManager,this.diagnostic=t.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=t.qrUrl;const i=this.getChainId(),s=(0,re.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const a=this._storage.getItem(nc.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const l=a.split(" ");l[0]!==""&&(this._addresses=l.map(d=>(0,re.ensureAddressString)(d)),this.emit("accountsChanged",l))}this._subscriptionManager.events.on("notification",l=>{this.emit("message",{type:l.method,data:l.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",l=>{var d;if(!(l.origin!==location.origin||l.source!==window)&&l.data.type==="walletLinkMessage"&&l.data.data.action==="dappChainSwitched"){const h=l.data.data.chainId,m=(d=l.data.data.jsonRpcUrl)!==null&&d!==void 0?d:this.jsonRpcUrl;this.updateProviderInfo(m,Number(h))}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,re.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(sc))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(sc,t)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(t,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=t),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(t,r){this.jsonRpcUrl=t;const n=this.getChainId();this._storage.setItem(ic,r.toString(10)),((0,re.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,i,s,a){const d=await(await this.initializeRelay()).watchAsset(t,r,n,i,s,a==null?void 0:a.toString()).promise;return(0,it.isErrorResponse)(d)?!1:!!d.result}async addEthereumChain(t,r,n,i,s,a){var l,d;if((0,re.ensureIntNumber)(t)===this.getChainId())return!1;const h=await this.initializeRelay(),m=h.inlineAddEthereumChain(t.toString());!this._isAuthorized()&&!m&&await h.requestEthereumAccounts().promise;const R=await h.addEthereumChain(t.toString(),r,s,n,i,a).promise;return(0,it.isErrorResponse)(R)?!1:(((l=R.result)===null||l===void 0?void 0:l.isApproved)===!0&&this.updateProviderInfo(r[0],t),((d=R.result)===null||d===void 0?void 0:d.isApproved)===!0)}async switchEthereumChain(t){const n=await(await this.initializeRelay()).switchEthereumChain(t.toString(10),this.selectedAddress||void 0).promise;if((0,it.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===se.standardErrorCodes.provider.unsupportedChain?se.standardErrors.provider.unsupportedChain():se.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,t)}setAppInfo(t,r){this.initializeRelay().then(n=>n.setAppInfo(t,r))}async enable(){var t;return(t=this.diagnostic)===null||t===void 0||t.log(ln.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Yn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send("eth_requestAccounts")}async close(){(await this.initializeRelay()).resetAndReload()}send(t,r){try{const n=this._send(t,r);if(n instanceof Promise)return n.catch(i=>{throw(0,se.serializeError)(i,t)})}catch(n){throw(0,se.serializeError)(n,t)}}_send(t,r){if(typeof t=="string"){const i=t,s=Array.isArray(r)?r:r!==void 0?[r]:[],a={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(a).then(l=>l.result)}if(typeof r=="function"){const i=t,s=r;return this._sendAsync(i,s)}if(Array.isArray(t))return t.map(s=>this._sendRequest(s));const n=t;return this._sendRequest(n)}async sendAsync(t,r){try{return this._sendAsync(t,r).catch(n=>{throw(0,se.serializeError)(n,t)})}catch(n){return Promise.reject((0,se.serializeError)(n,t))}}async _sendAsync(t,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(t)){const i=r;this._sendMultipleRequestsAsync(t).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(t).then(i=>n(null,i)).catch(i=>n(i,null))}async request(t){try{return this._request(t).catch(r=>{throw(0,se.serializeError)(r,t.method)})}catch(r){return Promise.reject((0,se.serializeError)(r,t.method))}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw se.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw se.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw se.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(t){const n=await(await this.initializeRelay()).scanQRCode((0,re.ensureRegExpString)(t)).promise;if((0,it.isErrorResponse)(n))throw(0,se.serializeError)(n.errorMessage,"scanQRCode");if(typeof n.result!="string")throw(0,se.serializeError)("result was not a string","scanQRCode");return n.result}async genericRequest(t,r){const i=await(await this.initializeRelay()).genericRequest(t,r).promise;if((0,it.isErrorResponse)(i))throw(0,se.serializeError)(i.errorMessage,"generic");if(typeof i.result!="string")throw(0,se.serializeError)("result was not a string","generic");return i.result}async connectAndSignIn(t){var r;(r=this.diagnostic)===null||r===void 0||r.log(ln.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::connectAndSignIn",sessionIdHash:this._relay?Yn.Session.hash(this._relay.session.id):void 0});let n;try{const s=await this.initializeRelay();if(!(s instanceof fb.MobileRelay))throw new Error("connectAndSignIn is only supported on mobile");if(n=await s.connectAndSignIn(t).promise,(0,it.isErrorResponse)(n))throw new Error(n.errorMessage)}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied account authorization"):s}if(!n.result)throw new Error("accounts received is empty");const{accounts:i}=n.result;return this._setAddresses(i),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),n.result}async selectProvider(t){const n=await(await this.initializeRelay()).selectProvider(t).promise;if((0,it.isErrorResponse)(n))throw(0,se.serializeError)(n.errorMessage,"selectProvider");if(typeof n.result!="string")throw(0,se.serializeError)("result was not a string","selectProvider");return n.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(t){const r={jsonrpc:"2.0",id:t.id},{method:n}=t;if(r.result=this._handleSynchronousMethods(t),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(t,r){if(!Array.isArray(t))throw new Error("addresses is not an array");const n=t.map(i=>(0,re.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(nc.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(t);if(i!==void 0)return r({jsonrpc:"2.0",id:t.id,result:i});const s=this._handleAsynchronousFilterMethods(t);if(s!==void 0){s.then(l=>r(Object.assign(Object.assign({},l),{id:t.id}))).catch(l=>n(l));return}const a=this._handleSubscriptionMethods(t);if(a!==void 0){a.then(l=>r({jsonrpc:"2.0",id:t.id,result:l.result})).catch(l=>n(l));return}}catch(i){return n(i)}this._handleAsynchronousMethods(t).then(i=>i&&r(Object.assign(Object.assign({},i),{id:t.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(t){return Promise.all(t.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"eth_uninstallFilter":return this._eth_uninstallFilter(n);case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"cbWallet_arbitrary":return this._cbwallet_arbitrary(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(t,this.jsonRpcUrl).catch(s=>{var a;throw(s.code===se.standardErrorCodes.rpc.methodNotFound||s.code===se.standardErrorCodes.rpc.methodNotSupported)&&((a=this.diagnostic)===null||a===void 0||a.log(ln.EVENTS.METHOD_NOT_IMPLEMENTED,{method:t.method,sessionIdHash:this._relay?Yn.Session.hash(this._relay.session.id):void 0})),s})}_handleAsynchronousFilterMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_newFilter":return this._eth_newFilter(n);case"eth_newBlockFilter":return this._eth_newBlockFilter();case"eth_newPendingTransactionFilter":return this._eth_newPendingTransactionFilter();case"eth_getFilterChanges":return this._eth_getFilterChanges(n);case"eth_getFilterLogs":return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(t){switch(t.method){case"eth_subscribe":case"eth_unsubscribe":return this._subscriptionManager.handleRequest(t)}}_isKnownAddress(t){try{const r=(0,re.ensureAddressString)(t);return this._addresses.map(i=>(0,re.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(t){var r;if(!this._isKnownAddress(t))throw(r=this.diagnostic)===null||r===void 0||r.log(ln.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,re.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,re.ensureAddressString)(t.to):null,i=t.value!=null?(0,re.ensureBN)(t.value):new hb.default(0),s=t.data?(0,re.ensureBuffer)(t.data):Buffer.alloc(0),a=t.nonce!=null?(0,re.ensureIntNumber)(t.nonce):null,l=t.gasPrice!=null?(0,re.ensureBN)(t.gasPrice):null,d=t.maxFeePerGas!=null?(0,re.ensureBN)(t.maxFeePerGas):null,h=t.maxPriorityFeePerGas!=null?(0,re.ensureBN)(t.maxPriorityFeePerGas):null,m=t.gas!=null?(0,re.ensureBN)(t.gas):null,R=t.chainId?(0,re.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:a,gasPriceInWei:l,maxFeePerGas:d,maxPriorityFeePerGas:h,gasLimit:m,chainId:R}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw se.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw se.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,i){this._ensureKnownAddress(r);try{const a=await(await this.initializeRelay()).signEthereumMessage(t,r,n,i).promise;if((0,it.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(t,r,n){const s=await(await this.initializeRelay()).ethereumAddressFromSignedMessage(t,r,n).promise;if((0,it.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,re.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(ic);if(!t)return(0,re.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(t,10);return(0,re.ensureIntNumber)(r)}async _eth_requestAccounts(){var t;if((t=this.diagnostic)===null||t===void 0||t.log(ln.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Yn.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{if(r=await(await this.initializeRelay()).requestEthereumAccounts().promise,(0,it.isErrorResponse)(r))throw new Error(r.errorMessage)}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,re.ensureBuffer)(t[0]),n=(0,re.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signEthereumTransaction(r).promise;if((0,it.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,re.ensureBuffer)(t[0]),i=await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise;if((0,it.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const i=await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;if((0,it.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?se.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,re.ensureParsedJSONObject)(t[0]),n=(0,re.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const i=Os.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Os.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,re.ensureAddressString)(t[0]),n=(0,re.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const i=Os.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(t){const r=t[0],n=t[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(t){var r,n,i,s;const a=t[0];if(((r=a.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw se.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw se.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const l=parseInt(a.chainId,16);return await this.addEthereumChain(l,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(i=a.blockExplorerUrls)!==null&&i!==void 0?i:[],a.chainName,(s=a.iconUrls)!==null&&s!==void 0?s:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw se.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw se.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw se.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw se.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:a,decimals:l}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,l,a,n)}}_eth_uninstallFilter(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(t){const r=t[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(t){const r=(0,re.ensureHexString)(t[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(t=>(t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),t.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=t,t))}}Ur.CoinbaseWalletProvider=mb;var es={};Object.defineProperty(es,"__esModule",{value:!0});es.RelayEventManager=void 0;const vb=q;class bb{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,vb.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}es.RelayEventManager=bb;Object.defineProperty(hn,"__esModule",{value:!0});hn.CoinbaseWalletSDK=void 0;const wb=oi,_b=ai,oc=q,yb=fi,Eb=Ur,Sb=wn,Rb=In,Mb=es,kb=Mn,Cb=_n,iu=Qr;class ts{constructor(t){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=t.linkAPIUrl||_b.LINK_API_URL;typeof t.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=t.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=t.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=t.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this._diagnosticLogger=t.diagnosticLogger,this._reloadOnDisconnect=(i=t.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),l=`${a.protocol}//${a.host}`;if(this._storage=new yb.ScopedLocalStorage(`-walletlink:${l}`),this._storage.setItem("version",ts.VERSION),this.walletExtension||this.coinbaseBrowser)return;this._relayEventManager=new Mb.RelayEventManager;const d=(0,oc.isMobileWeb)(),h=t.uiConstructor||(R=>d?new Rb.MobileRelayUI(R):new kb.WalletLinkRelayUI(R)),m={linkAPIUrl:s,version:iu.LIB_VERSION,darkMode:!!t.darkMode,headlessMode:!!t.headlessMode,uiConstructor:h,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect,enableMobileWalletLink:t.enableMobileWalletLink};this._relay=d?new Sb.MobileRelay(m):new Cb.WalletLinkRelay(m),this.setAppInfo(t.appName,t.appLogoUrl),!t.headlessMode&&this._relay.attachUI()}makeWeb3Provider(t="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(t,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return t||s.setConnectDisabled(!0),new Eb.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:t,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(t,r){var n;this._appName=t||"DApp",this._appLogoUrl=r||(0,oc.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var t;const r=this===null||this===void 0?void 0:this.walletExtension;r?r.close():(t=this._relay)===null||t===void 0||t.resetAndReload()}getQrUrl(){var t,r;return(r=(t=this._relay)===null||t===void 0?void 0:t.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(t,r=240){return(0,wb.walletLogo)(t,r)}get walletExtension(){var t;return(t=window.coinbaseWalletExtension)!==null&&t!==void 0?t:window.walletLinkExtension}get coinbaseBrowser(){var t,r;try{const n=(t=window.ethereum)!==null&&t!==void 0?t:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(t){return typeof t.isCipher=="boolean"&&t.isCipher}}hn.CoinbaseWalletSDK=ts;ts.VERSION=iu.LIB_VERSION;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletProvider=e.CoinbaseWalletSDK=void 0;const t=hn,r=Ur;var n=hn;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=Ur;Object.defineProperty(e,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),e.default=t.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=t.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=t.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(ac);const Ib=au(ac),Wb=Object.freeze(Object.defineProperty({__proto__:null,default:Ib},Symbol.toStringTag,{value:"Module"}));export{Wb as i}; diff --git a/buddybook/assets/index-Cr-ON-_S.js b/buddybook/assets/index-Cr-ON-_S.js deleted file mode 100644 index ed0c33d..0000000 --- a/buddybook/assets/index-Cr-ON-_S.js +++ /dev/null @@ -1,2 +0,0 @@ -import{k as m,c as q,e as k,t as F,n as Ye,i as Je,I as Ze,s as B,B as xe,a as G,b as en,d as N,f as V}from"./index-Gmp6KMX1.js";const nn=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,tn=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function an(e){const{domain:n={},message:t,primaryType:i}=e,r={EIP712Domain:un({domain:n}),...e.types};on({domain:n,message:t,primaryType:i,types:r});const a=["0x1901"];return n&&a.push(sn({domain:n,types:r})),i!=="EIP712Domain"&&a.push($({data:t,primaryType:i,types:r})),m(q(a))}function sn({domain:e,types:n}){return $({data:e,primaryType:"EIP712Domain",types:n})}function $({data:e,primaryType:n,types:t}){const i=K({data:e,primaryType:n,types:t});return m(i)}function K({data:e,primaryType:n,types:t}){const i=[{type:"bytes32"}],r=[cn({primaryType:n,types:t})];for(const a of t[n]){const[u,l]=Q({types:t,name:a.name,type:a.type,value:e[a.name]});i.push(u),r.push(l)}return k(i,r)}function cn({primaryType:e,types:n}){const t=F(rn({primaryType:e,types:n}));return m(t)}function rn({primaryType:e,types:n}){let t="";const i=X({primaryType:e,types:n});i.delete(e);const r=[e,...Array.from(i).sort()];for(const a of r)t+=`${a}(${n[a].map(({name:u,type:l})=>`${l} ${u}`).join(",")})`;return t}function X({primaryType:e,types:n},t=new Set){const i=e.match(/^\w*/u),r=i==null?void 0:i[0];if(t.has(r)||n[r]===void 0)return t;t.add(r);for(const a of n[r])X({primaryType:a.type,types:n},t);return t}function Q({types:e,name:n,type:t,value:i}){if(e[t]!==void 0)return[{type:"bytes32"},m(K({data:i,primaryType:t,types:e}))];if(t==="bytes")return i=`0x${(i.length%2?"0":"")+i.slice(2)}`,[{type:"bytes32"},m(i)];if(t==="string")return[{type:"bytes32"},m(F(i))];if(t.lastIndexOf("]")===t.length-1){const r=t.slice(0,t.lastIndexOf("[")),a=i.map(u=>Q({name:n,type:r,types:e,value:u}));return[{type:"bytes32"},m(k(a.map(([u])=>u),a.map(([,u])=>u)))]}return[{type:t},i]}function on(e){const{domain:n,message:t,primaryType:i,types:r}=e,a=(u,l)=>{for(const f of u){const{name:v,type:g}=f,h=l[v],p=g.match(tn);if(p&&(typeof h=="number"||typeof h=="bigint")){const[M,S,L]=p;Ye(h,{signed:S==="int",size:Number.parseInt(L)/8})}if(g==="address"&&typeof h=="string"&&!Je(h))throw new Ze({address:h});const C=g.match(nn);if(C){const[M,S]=C;if(S&&B(h)!==Number.parseInt(S))throw new xe({expectedSize:Number.parseInt(S),givenSize:B(h)})}const D=r[g];D&&a(D,h)}};r.EIP712Domain&&n&&a(r.EIP712Domain,n),i!=="EIP712Domain"&&a(r[i],t)}function un({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},typeof(e==null?void 0:e.chainId)=="number"&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}const dn=`Ethereum Signed Message: -`;function ln(e){const n=typeof e=="string"?G(e):typeof e.raw=="string"?e.raw:en(e.raw),t=G(`${dn}${B(n)}`);return q([t,n])}function fn(e,n){return m(ln(e),n)}const gn=()=>"9.1.0",hn=e=>e.toString(16).padStart(2,"0"),En=e=>{const n=new Uint8Array(e/2);return window.crypto.getRandomValues(n),Array.from(n,hn).join("")},_n=()=>typeof window<"u"?En(10):new Date().getTime().toString(36);class w{}w.makeRequest=(e,n)=>({id:_n(),method:e,params:n,env:{sdkVersion:gn()}});w.makeResponse=(e,n,t)=>({id:e,success:!0,version:t,data:n});w.makeErrorResponse=(e,n,t)=>({id:e,success:!1,error:n,version:t});var E;(function(e){e.sendTransactions="sendTransactions",e.rpcCall="rpcCall",e.getChainInfo="getChainInfo",e.getSafeInfo="getSafeInfo",e.getTxBySafeTxHash="getTxBySafeTxHash",e.getSafeBalances="getSafeBalances",e.signMessage="signMessage",e.signTypedMessage="signTypedMessage",e.getEnvironmentInfo="getEnvironmentInfo",e.getOffChainSignature="getOffChainSignature",e.requestAddressBook="requestAddressBook",e.wallet_getPermissions="wallet_getPermissions",e.wallet_requestPermissions="wallet_requestPermissions"})(E||(E={}));var H;(function(e){e.requestAddressBook="requestAddressBook"})(H||(H={}));class yn{constructor(n=null,t=!1){this.allowedOrigins=null,this.callbacks=new Map,this.debugMode=!1,this.isServer=typeof window>"u",this.isValidMessage=({origin:i,data:r,source:a})=>{const u=!r,l=!this.isServer&&a===window.parent,f=typeof r.version<"u"&&parseInt(r.version.split(".")[0]),v=typeof f=="number"&&f>=1;let g=!0;return Array.isArray(this.allowedOrigins)&&(g=this.allowedOrigins.find(h=>h.test(i))!==void 0),!u&&l&&v&&g},this.logIncomingMessage=i=>{console.info(`Safe Apps SDK v1: A message was received from origin ${i.origin}. `,i.data)},this.onParentMessage=i=>{this.isValidMessage(i)&&(this.debugMode&&this.logIncomingMessage(i),this.handleIncomingMessage(i.data))},this.handleIncomingMessage=i=>{const{id:r}=i,a=this.callbacks.get(r);a&&(a(i),this.callbacks.delete(r))},this.send=(i,r)=>{const a=w.makeRequest(i,r);if(this.isServer)throw new Error("Window doesn't exist");return window.parent.postMessage(a,"*"),new Promise((u,l)=>{this.callbacks.set(a.id,f=>{if(!f.success){l(new Error(f.error));return}u(f)})})},this.allowedOrigins=n,this.debugMode=t,this.isServer||window.addEventListener("message",this.onParentMessage)}}const z=e=>typeof e=="object"&&e!=null&&"domain"in e&&"types"in e&&"message"in e;var Tn={},y={},T={},j=N&&N.__awaiter||function(e,n,t,i){function r(a){return a instanceof t?a:new t(function(u){u(a)})}return new(t||(t=Promise))(function(a,u){function l(g){try{v(i.next(g))}catch(h){u(h)}}function f(g){try{v(i.throw(g))}catch(h){u(h)}}function v(g){g.done?a(g.value):r(g.value).then(l,f)}v((i=i.apply(e,n||[])).next())})};Object.defineProperty(T,"__esModule",{value:!0});T.getData=T.fetchData=T.stringifyQuery=T.insertParams=void 0;const vn=e=>typeof e=="object"&&e!==null&&"code"in e&&"message"in e;function In(e,n,t){return e.replace(new RegExp(`\\{${n}\\}`,"g"),t)}function An(e,n){return n?Object.keys(n).reduce((t,i)=>In(t,i,String(n[i])),e):e}T.insertParams=An;function mn(e){if(!e)return"";const n=new URLSearchParams;Object.keys(e).forEach(i=>{e[i]!=null&&n.append(i,String(e[i]))});const t=n.toString();return t?`?${t}`:""}T.stringifyQuery=mn;function Y(e){return j(this,void 0,void 0,function*(){let n;try{n=yield e.json()}catch{n={}}if(!e.ok){const t=vn(n)?`CGW error - ${n.code}: ${n.message}`:`CGW error - status ${e.statusText}`;throw new Error(t)}return n})}function Sn(e,n,t,i,r){return j(this,void 0,void 0,function*(){const a=Object.assign({"Content-Type":"application/json"},i),u={method:n??"POST",headers:a};r&&(u.credentials=r),t!=null&&(u.body=typeof t=="string"?t:JSON.stringify(t));const l=yield fetch(e,u);return Y(l)})}T.fetchData=Sn;function On(e,n,t){return j(this,void 0,void 0,function*(){const i={method:"GET"};n&&(i.headers=Object.assign(Object.assign({},n),{"Content-Type":"application/json"})),t&&(i.credentials=t);const r=yield fetch(e,i);return Y(r)})}T.getData=On;Object.defineProperty(y,"__esModule",{value:!0});y.getEndpoint=y.deleteEndpoint=y.putEndpoint=y.postEndpoint=void 0;const O=T;function P(e,n,t,i){const r=(0,O.insertParams)(n,t),a=(0,O.stringifyQuery)(i);return`${e}${r}${a}`}function Nn(e,n,t){const i=P(e,n,t==null?void 0:t.path,t==null?void 0:t.query);return(0,O.fetchData)(i,"POST",t==null?void 0:t.body,t==null?void 0:t.headers,t==null?void 0:t.credentials)}y.postEndpoint=Nn;function bn(e,n,t){const i=P(e,n,t==null?void 0:t.path,t==null?void 0:t.query);return(0,O.fetchData)(i,"PUT",t==null?void 0:t.body,t==null?void 0:t.headers,t==null?void 0:t.credentials)}y.putEndpoint=bn;function pn(e,n,t){const i=P(e,n,t==null?void 0:t.path,t==null?void 0:t.query);return(0,O.fetchData)(i,"DELETE",t==null?void 0:t.body,t==null?void 0:t.headers,t==null?void 0:t.credentials)}y.deleteEndpoint=pn;function Cn(e,n,t,i){if(i)return(0,O.getData)(i,void 0,t==null?void 0:t.credentials);const r=P(e,n,t==null?void 0:t.path,t==null?void 0:t.query);return(0,O.getData)(r,t==null?void 0:t.headers,t==null?void 0:t.credentials)}y.getEndpoint=Cn;var R={};Object.defineProperty(R,"__esModule",{value:!0});R.DEFAULT_BASE_URL=void 0;R.DEFAULT_BASE_URL="https://safe-client.safe.global";var J={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ImplementationVersionState=void 0,function(n){n.UP_TO_DATE="UP_TO_DATE",n.OUTDATED="OUTDATED",n.UNKNOWN="UNKNOWN"}(e.ImplementationVersionState||(e.ImplementationVersionState={}))})(J);var Z={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SafeAppSocialPlatforms=e.SafeAppFeatures=e.SafeAppAccessPolicyTypes=void 0,function(n){n.NoRestrictions="NO_RESTRICTIONS",n.DomainAllowlist="DOMAIN_ALLOWLIST"}(e.SafeAppAccessPolicyTypes||(e.SafeAppAccessPolicyTypes={})),function(n){n.BATCHED_TRANSACTIONS="BATCHED_TRANSACTIONS"}(e.SafeAppFeatures||(e.SafeAppFeatures={})),function(n){n.TWITTER="TWITTER",n.GITHUB="GITHUB",n.DISCORD="DISCORD"}(e.SafeAppSocialPlatforms||(e.SafeAppSocialPlatforms={}))})(Z);var x={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.LabelValue=e.StartTimeValue=e.DurationType=e.DetailedExecutionInfoType=e.TransactionListItemType=e.ConflictType=e.TransactionInfoType=e.SettingsInfoType=e.TransactionTokenType=e.TransferDirection=e.TransactionStatus=e.Operation=void 0,function(n){n[n.CALL=0]="CALL",n[n.DELEGATE=1]="DELEGATE"}(e.Operation||(e.Operation={})),function(n){n.AWAITING_CONFIRMATIONS="AWAITING_CONFIRMATIONS",n.AWAITING_EXECUTION="AWAITING_EXECUTION",n.CANCELLED="CANCELLED",n.FAILED="FAILED",n.SUCCESS="SUCCESS"}(e.TransactionStatus||(e.TransactionStatus={})),function(n){n.INCOMING="INCOMING",n.OUTGOING="OUTGOING",n.UNKNOWN="UNKNOWN"}(e.TransferDirection||(e.TransferDirection={})),function(n){n.ERC20="ERC20",n.ERC721="ERC721",n.NATIVE_COIN="NATIVE_COIN"}(e.TransactionTokenType||(e.TransactionTokenType={})),function(n){n.SET_FALLBACK_HANDLER="SET_FALLBACK_HANDLER",n.ADD_OWNER="ADD_OWNER",n.REMOVE_OWNER="REMOVE_OWNER",n.SWAP_OWNER="SWAP_OWNER",n.CHANGE_THRESHOLD="CHANGE_THRESHOLD",n.CHANGE_IMPLEMENTATION="CHANGE_IMPLEMENTATION",n.ENABLE_MODULE="ENABLE_MODULE",n.DISABLE_MODULE="DISABLE_MODULE",n.SET_GUARD="SET_GUARD",n.DELETE_GUARD="DELETE_GUARD"}(e.SettingsInfoType||(e.SettingsInfoType={})),function(n){n.TRANSFER="Transfer",n.SETTINGS_CHANGE="SettingsChange",n.CUSTOM="Custom",n.CREATION="Creation",n.SWAP_ORDER="SwapOrder",n.TWAP_ORDER="TwapOrder",n.SWAP_TRANSFER="SwapTransfer"}(e.TransactionInfoType||(e.TransactionInfoType={})),function(n){n.NONE="None",n.HAS_NEXT="HasNext",n.END="End"}(e.ConflictType||(e.ConflictType={})),function(n){n.TRANSACTION="TRANSACTION",n.LABEL="LABEL",n.CONFLICT_HEADER="CONFLICT_HEADER",n.DATE_LABEL="DATE_LABEL"}(e.TransactionListItemType||(e.TransactionListItemType={})),function(n){n.MULTISIG="MULTISIG",n.MODULE="MODULE"}(e.DetailedExecutionInfoType||(e.DetailedExecutionInfoType={})),function(n){n.AUTO="AUTO",n.LIMIT_DURATION="LIMIT_DURATION"}(e.DurationType||(e.DurationType={})),function(n){n.AT_MINING_TIME="AT_MINING_TIME",n.AT_EPOCH="AT_EPOCH"}(e.StartTimeValue||(e.StartTimeValue={})),function(n){n.Queued="Queued",n.Next="Next"}(e.LabelValue||(e.LabelValue={}))})(x);var ee={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.FEATURES=e.GAS_PRICE_TYPE=e.RPC_AUTHENTICATION=void 0,function(n){n.API_KEY_PATH="API_KEY_PATH",n.NO_AUTHENTICATION="NO_AUTHENTICATION",n.UNKNOWN="UNKNOWN"}(e.RPC_AUTHENTICATION||(e.RPC_AUTHENTICATION={})),function(n){n.ORACLE="ORACLE",n.FIXED="FIXED",n.FIXED_1559="FIXED1559",n.UNKNOWN="UNKNOWN"}(e.GAS_PRICE_TYPE||(e.GAS_PRICE_TYPE={})),function(n){n.ERC721="ERC721",n.SAFE_APPS="SAFE_APPS",n.CONTRACT_INTERACTION="CONTRACT_INTERACTION",n.DOMAIN_LOOKUP="DOMAIN_LOOKUP",n.SPENDING_LIMIT="SPENDING_LIMIT",n.EIP1559="EIP1559",n.SAFE_TX_GAS_OPTIONAL="SAFE_TX_GAS_OPTIONAL",n.TX_SIMULATION="TX_SIMULATION",n.EIP1271="EIP1271"}(e.FEATURES||(e.FEATURES={}))})(ee);var ne={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TokenType=void 0,function(n){n.ERC20="ERC20",n.ERC721="ERC721",n.NATIVE_TOKEN="NATIVE_TOKEN"}(e.TokenType||(e.TokenType={}))})(ne);var te={};Object.defineProperty(te,"__esModule",{value:!0});var ie={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ConfirmationViewTypes=void 0,function(n){n.COW_SWAP_ORDER="COW_SWAP_ORDER",n.COW_SWAP_TWAP_ORDER="COW_SWAP_TWAP_ORDER"}(e.ConfirmationViewTypes||(e.ConfirmationViewTypes={}))})(ie);var ae={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SafeMessageStatus=e.SafeMessageListItemType=void 0,function(n){n.DATE_LABEL="DATE_LABEL",n.MESSAGE="MESSAGE"}(e.SafeMessageListItemType||(e.SafeMessageListItemType={})),function(n){n.NEEDS_CONFIRMATION="NEEDS_CONFIRMATION",n.CONFIRMED="CONFIRMED"}(e.SafeMessageStatus||(e.SafeMessageStatus={}))})(ae);var se={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DeviceType=void 0,function(n){n.ANDROID="ANDROID",n.IOS="IOS",n.WEB="WEB"}(e.DeviceType||(e.DeviceType={}))})(se);var ce={};Object.defineProperty(ce,"__esModule",{value:!0});(function(e){var n=N&&N.__createBinding||(Object.create?function(s,c,o,d){d===void 0&&(d=o);var A=Object.getOwnPropertyDescriptor(c,o);(!A||("get"in A?!c.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return c[o]}}),Object.defineProperty(s,d,A)}:function(s,c,o,d){d===void 0&&(d=o),s[d]=c[o]}),t=N&&N.__exportStar||function(s,c){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(c,o)&&n(c,s,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.deleteAccount=e.getAccount=e.createAccount=e.verifyAuth=e.getAuthNonce=e.getContract=e.getSafeOverviews=e.unsubscribeAll=e.unsubscribeSingle=e.registerRecoveryModule=e.deleteRegisteredEmail=e.getRegisteredEmail=e.verifyEmail=e.resendEmailVerificationCode=e.changeEmail=e.registerEmail=e.unregisterDevice=e.unregisterSafe=e.registerDevice=e.getDelegates=e.confirmSafeMessage=e.proposeSafeMessage=e.getSafeMessage=e.getSafeMessages=e.getDecodedData=e.getMasterCopies=e.getSafeApps=e.getChainConfig=e.getChainsConfig=e.getConfirmationView=e.proposeTransaction=e.getNonces=e.postSafeGasEstimation=e.deleteTransaction=e.getTransactionDetails=e.getTransactionQueue=e.getTransactionHistory=e.getCollectiblesPage=e.getCollectibles=e.getAllOwnedSafes=e.getOwnedSafes=e.getFiatCurrencies=e.getBalances=e.getMultisigTransactions=e.getModuleTransactions=e.getIncomingTransfers=e.getSafeInfo=e.getRelayCount=e.relayTransaction=e.setBaseUrl=void 0,e.putAccountDataSettings=e.getAccountDataSettings=e.getAccountDataTypes=void 0;const i=y,r=R;t(J,e),t(Z,e),t(x,e),t(ee,e),t(ne,e),t(te,e),t(ie,e),t(ae,e),t(se,e),t(ce,e);let a=r.DEFAULT_BASE_URL;const u=s=>{a=s};e.setBaseUrl=u;function l(s,c){return(0,i.postEndpoint)(a,"/v1/chains/{chainId}/relay",{path:{chainId:s},body:c})}e.relayTransaction=l;function f(s,c){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/relay/{address}",{path:{chainId:s,address:c}})}e.getRelayCount=f;function v(s,c){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}",{path:{chainId:s,address:c}})}e.getSafeInfo=v;function g(s,c,o,d){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}/incoming-transfers/",{path:{chainId:s,address:c},query:o},d)}e.getIncomingTransfers=g;function h(s,c,o,d){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}/module-transactions/",{path:{chainId:s,address:c},query:o},d)}e.getModuleTransactions=h;function p(s,c,o,d){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}/multisig-transactions/",{path:{chainId:s,address:c},query:o},d)}e.getMultisigTransactions=p;function C(s,c,o="usd",d={}){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}/balances/{currency}",{path:{chainId:s,address:c,currency:o},query:d})}e.getBalances=C;function D(){return(0,i.getEndpoint)(a,"/v1/balances/supported-fiat-codes")}e.getFiatCurrencies=D;function M(s,c){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/owners/{address}/safes",{path:{chainId:s,address:c}})}e.getOwnedSafes=M;function S(s){return(0,i.getEndpoint)(a,"/v1/owners/{address}/safes",{path:{address:s}})}e.getAllOwnedSafes=S;function L(s,c,o={}){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:s,address:c},query:o})}e.getCollectibles=L;function ue(s,c,o={},d){return(0,i.getEndpoint)(a,"/v2/chains/{chainId}/safes/{address}/collectibles",{path:{chainId:s,address:c},query:o},d)}e.getCollectiblesPage=ue;function de(s,c,o={},d){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/transactions/history",{path:{chainId:s,safe_address:c},query:o},d)}e.getTransactionHistory=de;function le(s,c,o={},d){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/transactions/queued",{path:{chainId:s,safe_address:c},query:o},d)}e.getTransactionQueue=le;function fe(s,c){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/transactions/{transactionId}",{path:{chainId:s,transactionId:c}})}e.getTransactionDetails=fe;function ge(s,c,o){return(0,i.deleteEndpoint)(a,"/v1/chains/{chainId}/transactions/{safeTxHash}",{path:{chainId:s,safeTxHash:c},body:{signature:o}})}e.deleteTransaction=ge;function he(s,c,o){return(0,i.postEndpoint)(a,"/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations",{path:{chainId:s,safe_address:c},body:o})}e.postSafeGasEstimation=he;function Ee(s,c){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/nonces",{path:{chainId:s,safe_address:c}})}e.getNonces=Ee;function _e(s,c,o){return(0,i.postEndpoint)(a,"/v1/chains/{chainId}/transactions/{safe_address}/propose",{path:{chainId:s,safe_address:c},body:o})}e.proposeTransaction=_e;function ye(s,c,o,d){return(0,i.postEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/views/transaction-confirmation",{path:{chainId:s,safe_address:c},body:{data:o,to:d}})}e.getConfirmationView=ye;function Te(s){return(0,i.getEndpoint)(a,"/v1/chains",{query:s})}e.getChainsConfig=Te;function ve(s){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}",{path:{chainId:s}})}e.getChainConfig=ve;function Ie(s,c={}){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safe-apps",{path:{chainId:s},query:c})}e.getSafeApps=Ie;function Ae(s){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/about/master-copies",{path:{chainId:s}})}e.getMasterCopies=Ae;function me(s,c,o){return(0,i.postEndpoint)(a,"/v1/chains/{chainId}/data-decoder",{path:{chainId:s},body:{data:c,to:o}})}e.getDecodedData=me;function Se(s,c,o){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:s,safe_address:c},query:{}},o)}e.getSafeMessages=Se;function Oe(s,c){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/messages/{message_hash}",{path:{chainId:s,message_hash:c}})}e.getSafeMessage=Oe;function Ne(s,c,o){return(0,i.postEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/messages",{path:{chainId:s,safe_address:c},body:o})}e.proposeSafeMessage=Ne;function be(s,c,o){return(0,i.postEndpoint)(a,"/v1/chains/{chainId}/messages/{message_hash}/signatures",{path:{chainId:s,message_hash:c},body:o})}e.confirmSafeMessage=be;function pe(s,c={}){return(0,i.getEndpoint)(a,"/v2/chains/{chainId}/delegates",{path:{chainId:s},query:c})}e.getDelegates=pe;function Ce(s){return(0,i.postEndpoint)(a,"/v1/register/notifications",{body:s})}e.registerDevice=Ce;function De(s,c,o){return(0,i.deleteEndpoint)(a,"/v1/chains/{chainId}/notifications/devices/{uuid}/safes/{safe_address}",{path:{chainId:s,safe_address:c,uuid:o}})}e.unregisterSafe=De;function we(s,c){return(0,i.deleteEndpoint)(a,"/v1/chains/{chainId}/notifications/devices/{uuid}",{path:{chainId:s,uuid:c}})}e.unregisterDevice=we;function Pe(s,c,o,d){return(0,i.postEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/emails",{path:{chainId:s,safe_address:c},body:o,headers:d})}e.registerEmail=Pe;function Re(s,c,o,d,A){return(0,i.putEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:s,safe_address:c,signer:o},body:d,headers:A})}e.changeEmail=Re;function Me(s,c,o){return(0,i.postEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify-resend",{path:{chainId:s,safe_address:c,signer:o},body:""})}e.resendEmailVerificationCode=Me;function Le(s,c,o,d){return(0,i.putEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify",{path:{chainId:s,safe_address:c,signer:o},body:d})}e.verifyEmail=Le;function Be(s,c,o,d){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:s,safe_address:c,signer:o},headers:d})}e.getRegisteredEmail=Be;function He(s,c,o,d){return(0,i.deleteEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}",{path:{chainId:s,safe_address:c,signer:o},headers:d})}e.deleteRegisteredEmail=He;function Ue(s,c,o){return(0,i.postEndpoint)(a,"/v1/chains/{chainId}/safes/{safe_address}/recovery",{path:{chainId:s,safe_address:c},body:o})}e.registerRecoveryModule=Ue;function je(s){return(0,i.deleteEndpoint)(a,"/v1/subscriptions",{query:s})}e.unsubscribeSingle=je;function Ge(s){return(0,i.deleteEndpoint)(a,"/v1/subscriptions/all",{query:s})}e.unsubscribeAll=Ge;function Ve(s,c){return(0,i.getEndpoint)(a,"/v1/safes",{query:Object.assign(Object.assign({},c),{safes:s.join(",")})})}e.getSafeOverviews=Ve;function We(s,c){return(0,i.getEndpoint)(a,"/v1/chains/{chainId}/contracts/{contractAddress}",{path:{chainId:s,contractAddress:c}})}e.getContract=We;function qe(){return(0,i.getEndpoint)(a,"/v1/auth/nonce",{credentials:"include"})}e.getAuthNonce=qe;function ke(s){return(0,i.postEndpoint)(a,"/v1/auth/verify",{body:s,credentials:"include"})}e.verifyAuth=ke;function Fe(s){return(0,i.postEndpoint)(a,"/v1/accounts",{body:s,credentials:"include"})}e.createAccount=Fe;function $e(s){return(0,i.getEndpoint)(a,"/v1/accounts/{address}",{path:{address:s},credentials:"include"})}e.getAccount=$e;function Ke(s){return(0,i.deleteEndpoint)(a,"/v1/accounts/{address}",{path:{address:s},credentials:"include"})}e.deleteAccount=Ke;function Xe(){return(0,i.getEndpoint)(a,"/v1/accounts/data-types")}e.getAccountDataTypes=Xe;function Qe(s){return(0,i.getEndpoint)(a,"/v1/accounts/{address}/data-settings",{path:{address:s},credentials:"include"})}e.getAccountDataSettings=Qe;function ze(s,c){return(0,i.putEndpoint)(a,"/v1/accounts/{address}/data-settings",{path:{address:s},body:c,credentials:"include"})}e.putAccountDataSettings=ze})(Tn);class Dn{constructor(n){this.communicator=n}async getBySafeTxHash(n){if(!n)throw new Error("Invalid safeTxHash");return(await this.communicator.send(E.getTxBySafeTxHash,{safeTxHash:n})).data}async signMessage(n){const t={message:n};return(await this.communicator.send(E.signMessage,t)).data}async signTypedMessage(n){if(!z(n))throw new Error("Invalid typed data");return(await this.communicator.send(E.signTypedMessage,{typedData:n})).data}async send({txs:n,params:t}){if(!n||!n.length)throw new Error("No transactions were passed");const i={txs:n,params:t};return(await this.communicator.send(E.sendTransactions,i)).data}}const _={eth_call:"eth_call",eth_gasPrice:"eth_gasPrice",eth_getLogs:"eth_getLogs",eth_getBalance:"eth_getBalance",eth_getCode:"eth_getCode",eth_getBlockByHash:"eth_getBlockByHash",eth_getBlockByNumber:"eth_getBlockByNumber",eth_getStorageAt:"eth_getStorageAt",eth_getTransactionByHash:"eth_getTransactionByHash",eth_getTransactionReceipt:"eth_getTransactionReceipt",eth_getTransactionCount:"eth_getTransactionCount",eth_estimateGas:"eth_estimateGas",safe_setSettings:"safe_setSettings"},I={defaultBlockParam:(e="latest")=>e,returnFullTxObjectParam:(e=!1)=>e,blockNumberToHex:e=>Number.isInteger(e)?`0x${e.toString(16)}`:e};class wn{constructor(n){this.communicator=n,this.call=this.buildRequest({call:_.eth_call,formatters:[null,I.defaultBlockParam]}),this.getBalance=this.buildRequest({call:_.eth_getBalance,formatters:[null,I.defaultBlockParam]}),this.getCode=this.buildRequest({call:_.eth_getCode,formatters:[null,I.defaultBlockParam]}),this.getStorageAt=this.buildRequest({call:_.eth_getStorageAt,formatters:[null,I.blockNumberToHex,I.defaultBlockParam]}),this.getPastLogs=this.buildRequest({call:_.eth_getLogs}),this.getBlockByHash=this.buildRequest({call:_.eth_getBlockByHash,formatters:[null,I.returnFullTxObjectParam]}),this.getBlockByNumber=this.buildRequest({call:_.eth_getBlockByNumber,formatters:[I.blockNumberToHex,I.returnFullTxObjectParam]}),this.getTransactionByHash=this.buildRequest({call:_.eth_getTransactionByHash}),this.getTransactionReceipt=this.buildRequest({call:_.eth_getTransactionReceipt}),this.getTransactionCount=this.buildRequest({call:_.eth_getTransactionCount,formatters:[null,I.defaultBlockParam]}),this.getGasPrice=this.buildRequest({call:_.eth_gasPrice}),this.getEstimateGas=t=>this.buildRequest({call:_.eth_estimateGas})([t]),this.setSafeSettings=this.buildRequest({call:_.safe_setSettings})}buildRequest(n){const{call:t,formatters:i}=n;return async r=>{i&&Array.isArray(r)&&i.forEach((l,f)=>{l&&(r[f]=l(r[f]))});const a={call:t,params:r||[]};return(await this.communicator.send(E.rpcCall,a)).data}}}const Pn="0x1626ba7e",Rn="0x20c13b0b",U=4001;class b extends Error{constructor(n,t,i){super(n),this.code=t,this.data=i,Object.setPrototypeOf(this,b.prototype)}}class re{constructor(n){this.communicator=n}async getPermissions(){return(await this.communicator.send(E.wallet_getPermissions,void 0)).data}async requestPermissions(n){if(!this.isPermissionRequestValid(n))throw new b("Permissions request is invalid",U);try{return(await this.communicator.send(E.wallet_requestPermissions,n)).data}catch{throw new b("Permissions rejected",U)}}isPermissionRequestValid(n){return n.every(t=>typeof t=="object"?Object.keys(t).every(i=>!!Object.values(H).includes(i)):!1)}}const W=(e,n)=>n.some(t=>t.parentCapability===e),Mn=()=>(e,n,t)=>{const i=t.value;return t.value=async function(){const r=new re(this.communicator);let a=await r.getPermissions();if(W(n,a)||(a=await r.requestPermissions([{[n]:{}}])),!W(n,a))throw new b("Permissions rejected",U);return i.apply(this)},t};var Ln=function(e,n,t,i){var r=arguments.length,a=r<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,t):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(e,n,t,i);else for(var l=e.length-1;l>=0;l--)(u=e[l])&&(a=(r<3?u(a):r>3?u(n,t,a):u(n,t))||a);return r>3&&a&&Object.defineProperty(n,t,a),a};class oe{constructor(n){this.communicator=n}async getChainInfo(){return(await this.communicator.send(E.getChainInfo,void 0)).data}async getInfo(){return(await this.communicator.send(E.getSafeInfo,void 0)).data}async experimental_getBalances({currency:n="usd"}={}){return(await this.communicator.send(E.getSafeBalances,{currency:n})).data}async check1271Signature(n,t="0x"){const i=await this.getInfo(),r=V({abi:[{constant:!1,inputs:[{name:"_dataHash",type:"bytes32"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[n,t]}),a={call:_.eth_call,params:[{to:i.safeAddress,data:r},"latest"]};try{return(await this.communicator.send(E.rpcCall,a)).data.slice(0,10).toLowerCase()===Pn}catch{return!1}}async check1271SignatureBytes(n,t="0x"){const i=await this.getInfo(),r=V({abi:[{constant:!1,inputs:[{name:"_data",type:"bytes"},{name:"_signature",type:"bytes"}],name:"isValidSignature",outputs:[{name:"",type:"bytes4"}],payable:!1,stateMutability:"nonpayable",type:"function"}],functionName:"isValidSignature",args:[n,t]}),a={call:_.eth_call,params:[{to:i.safeAddress,data:r},"latest"]};try{return(await this.communicator.send(E.rpcCall,a)).data.slice(0,10).toLowerCase()===Rn}catch{return!1}}calculateMessageHash(n){return fn(n)}calculateTypedMessageHash(n){const t=typeof n.domain.chainId=="object"?n.domain.chainId.toNumber():Number(n.domain.chainId);let i=n.primaryType;if(!i){const r=Object.values(n.types),a=Object.keys(n.types).filter(u=>r.every(l=>l.every(({type:f})=>f.replace("[","").replace("]","")!==u)));if(a.length===0||a.length>1)throw new Error("Please specify primaryType");i=a[0]}return an({message:n.message,domain:{...n.domain,chainId:t,verifyingContract:n.domain.verifyingContract,salt:n.domain.salt},types:n.types,primaryType:i})}async getOffChainSignature(n){return(await this.communicator.send(E.getOffChainSignature,n)).data}async isMessageSigned(n,t="0x"){let i;if(typeof n=="string"&&(i=async()=>{const r=this.calculateMessageHash(n);return await this.isMessageHashSigned(r,t)}),z(n)&&(i=async()=>{const r=this.calculateTypedMessageHash(n);return await this.isMessageHashSigned(r,t)}),i)return await i();throw new Error("Invalid message type")}async isMessageHashSigned(n,t="0x"){const i=[this.check1271Signature.bind(this),this.check1271SignatureBytes.bind(this)];for(const r of i)if(await r(n,t))return!0;return!1}async getEnvironmentInfo(){return(await this.communicator.send(E.getEnvironmentInfo,void 0)).data}async requestAddressBook(){return(await this.communicator.send(E.requestAddressBook,void 0)).data}}Ln([Mn()],oe.prototype,"requestAddressBook",null);class Hn{constructor(n={}){const{allowedDomains:t=null,debug:i=!1}=n;this.communicator=new yn(t,i),this.eth=new wn(this.communicator),this.txs=new Dn(this.communicator),this.safe=new oe(this.communicator),this.wallet=new re(this.communicator)}}export{w as MessageFormatter,E as Methods,_ as RPC_CALLS,H as RestrictedMethods,Hn as default,gn as getSDKVersion,z as isObjectEIP712TypedData}; diff --git a/buddybook/assets/index-DQCSip5A.css b/buddybook/assets/index-CwoEHhxw.css similarity index 100% rename from buddybook/assets/index-DQCSip5A.css rename to buddybook/assets/index-CwoEHhxw.css diff --git a/buddybook/assets/index-Cye4tEiE.js b/buddybook/assets/index-Cye4tEiE.js new file mode 100644 index 0000000..4b9c0ae --- /dev/null +++ b/buddybook/assets/index-Cye4tEiE.js @@ -0,0 +1,4272 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B6MMxlAs.js","assets/hooks.module-D0gf0yJl.js","assets/index-CRce2FXR.js","assets/inherits_browser-DKXdsDax.js","assets/events-EbrwmdBG.js","assets/index-c_vQ90mY.js","assets/index.es-BocJIoGE.js"])))=>i.map(i=>d[i]); +var nu=Object.defineProperty;var Bs=o=>{throw TypeError(o)};var ru=(o,et,tt)=>et in o?nu(o,et,{enumerable:!0,configurable:!0,writable:!0,value:tt}):o[et]=tt;var Ct=(o,et,tt)=>ru(o,typeof et!="symbol"?et+"":et,tt),is=(o,et,tt)=>et.has(o)||Bs("Cannot "+tt);var Mt=(o,et,tt)=>(is(o,et,"read from private field"),tt?tt.call(o):et.get(o)),fn=(o,et,tt)=>et.has(o)?Bs("Cannot add the same private member more than once"):et instanceof WeakSet?et.add(o):et.set(o,tt),un=(o,et,tt,nt)=>(is(o,et,"write to private field"),nt?nt.call(o,tt):et.set(o,tt),tt),gn=(o,et,tt)=>(is(o,et,"access private method"),tt);var br=(o,et,tt,nt)=>({set _(rt){un(o,et,rt,tt)},get _(){return Mt(o,et,nt)}});function _mergeNamespaces(o,et){for(var tt=0;ttnt[rt]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}(function(){const et=document.createElement("link").relList;if(et&&et.supports&&et.supports("modulepreload"))return;for(const rt of document.querySelectorAll('link[rel="modulepreload"]'))nt(rt);new MutationObserver(rt=>{for(const ot of rt)if(ot.type==="childList")for(const it of ot.addedNodes)it.tagName==="LINK"&&it.rel==="modulepreload"&&nt(it)}).observe(document,{childList:!0,subtree:!0});function tt(rt){const ot={};return rt.integrity&&(ot.integrity=rt.integrity),rt.referrerPolicy&&(ot.referrerPolicy=rt.referrerPolicy),rt.crossOrigin==="use-credentials"?ot.credentials="include":rt.crossOrigin==="anonymous"?ot.credentials="omit":ot.credentials="same-origin",ot}function nt(rt){if(rt.ep)return;rt.ep=!0;const ot=tt(rt);fetch(rt.href,ot)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function getDefaultExportFromCjs(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function getAugmentedNamespace(o){if(o.__esModule)return o;var et=o.default;if(typeof et=="function"){var tt=function nt(){return this instanceof nt?Reflect.construct(et,arguments,this.constructor):et.apply(this,arguments)};tt.prototype=et.prototype}else tt={};return Object.defineProperty(tt,"__esModule",{value:!0}),Object.keys(o).forEach(function(nt){var rt=Object.getOwnPropertyDescriptor(o,nt);Object.defineProperty(tt,nt,rt.get?rt:{enumerable:!0,get:function(){return o[nt]}})}),tt}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var l$4=Symbol.for("react.element"),n$5=Symbol.for("react.portal"),p$6=Symbol.for("react.fragment"),q$6=Symbol.for("react.strict_mode"),r$5=Symbol.for("react.profiler"),t$4=Symbol.for("react.provider"),u$3=Symbol.for("react.context"),v$5=Symbol.for("react.forward_ref"),w$4=Symbol.for("react.suspense"),x$2=Symbol.for("react.memo"),y$3=Symbol.for("react.lazy"),z$3=Symbol.iterator;function A$2(o){return o===null||typeof o!="object"?null:(o=z$3&&o[z$3]||o["@@iterator"],typeof o=="function"?o:null)}var B$2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$2=Object.assign,D$2={};function E$2(o,et,tt){this.props=o,this.context=et,this.refs=D$2,this.updater=tt||B$2}E$2.prototype.isReactComponent={};E$2.prototype.setState=function(o,et){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,et,"setState")};E$2.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function F$1(){}F$1.prototype=E$2.prototype;function G$2(o,et,tt){this.props=o,this.context=et,this.refs=D$2,this.updater=tt||B$2}var H$2=G$2.prototype=new F$1;H$2.constructor=G$2;C$2(H$2,E$2.prototype);H$2.isPureReactComponent=!0;var I$2=Array.isArray,J$1=Object.prototype.hasOwnProperty,K$2={current:null},L$2={key:!0,ref:!0,__self:!0,__source:!0};function M$2(o,et,tt){var nt,rt={},ot=null,it=null;if(et!=null)for(nt in et.ref!==void 0&&(it=et.ref),et.key!==void 0&&(ot=""+et.key),et)J$1.call(et,nt)&&!L$2.hasOwnProperty(nt)&&(rt[nt]=et[nt]);var st=arguments.length-2;if(st===1)rt.children=tt;else if(10)throw new Error("Invalid string. Length must be a multiple of 4");var tt=o.indexOf("=");tt===-1&&(tt=et);var nt=tt===et?0:4-tt%4;return[tt,nt]}function byteLength(o){var et=getLens(o),tt=et[0],nt=et[1];return(tt+nt)*3/4-nt}function _byteLength(o,et,tt){return(et+tt)*3/4-tt}function toByteArray(o){var et,tt=getLens(o),nt=tt[0],rt=tt[1],ot=new Arr(_byteLength(o,nt,rt)),it=0,st=rt>0?nt-4:nt,at;for(at=0;at>16&255,ot[it++]=et>>8&255,ot[it++]=et&255;return rt===2&&(et=revLookup[o.charCodeAt(at)]<<2|revLookup[o.charCodeAt(at+1)]>>4,ot[it++]=et&255),rt===1&&(et=revLookup[o.charCodeAt(at)]<<10|revLookup[o.charCodeAt(at+1)]<<4|revLookup[o.charCodeAt(at+2)]>>2,ot[it++]=et>>8&255,ot[it++]=et&255),ot}function tripletToBase64(o){return lookup[o>>18&63]+lookup[o>>12&63]+lookup[o>>6&63]+lookup[o&63]}function encodeChunk(o,et,tt){for(var nt,rt=[],ot=et;otst?st:it+ot));return nt===1?(et=o[tt-1],rt.push(lookup[et>>2]+lookup[et<<4&63]+"==")):nt===2&&(et=(o[tt-2]<<8)+o[tt-1],rt.push(lookup[et>>10]+lookup[et>>4&63]+lookup[et<<2&63]+"=")),rt.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ieee754.read=function(o,et,tt,nt,rt){var ot,it,st=rt*8-nt-1,at=(1<>1,lt=-7,dt=tt?rt-1:0,ht=tt?-1:1,pt=o[et+dt];for(dt+=ht,ot=pt&(1<<-lt)-1,pt>>=-lt,lt+=st;lt>0;ot=ot*256+o[et+dt],dt+=ht,lt-=8);for(it=ot&(1<<-lt)-1,ot>>=-lt,lt+=nt;lt>0;it=it*256+o[et+dt],dt+=ht,lt-=8);if(ot===0)ot=1-ct;else{if(ot===at)return it?NaN:(pt?-1:1)*(1/0);it=it+Math.pow(2,nt),ot=ot-ct}return(pt?-1:1)*it*Math.pow(2,ot-nt)};ieee754.write=function(o,et,tt,nt,rt,ot){var it,st,at,ct=ot*8-rt-1,lt=(1<>1,ht=rt===23?Math.pow(2,-24)-Math.pow(2,-77):0,pt=nt?0:ot-1,mt=nt?1:-1,ft=et<0||et===0&&1/et<0?1:0;for(et=Math.abs(et),isNaN(et)||et===1/0?(st=isNaN(et)?1:0,it=lt):(it=Math.floor(Math.log(et)/Math.LN2),et*(at=Math.pow(2,-it))<1&&(it--,at*=2),it+dt>=1?et+=ht/at:et+=ht*Math.pow(2,1-dt),et*at>=2&&(it++,at/=2),it+dt>=lt?(st=0,it=lt):it+dt>=1?(st=(et*at-1)*Math.pow(2,rt),it=it+dt):(st=et*Math.pow(2,dt-1)*Math.pow(2,rt),it=0));rt>=8;o[tt+pt]=st&255,pt+=mt,st/=256,rt-=8);for(it=it<0;o[tt+pt]=it&255,pt+=mt,it/=256,ct-=8);o[tt+pt-mt]|=ft*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(o){const et=base64Js,tt=ieee754,nt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=st,o.SlowBuffer=xt,o.INSPECT_MAX_BYTES=50;const rt=2147483647;o.kMaxLength=rt,st.TYPED_ARRAY_SUPPORT=ot(),!st.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ot(){try{const It=new Uint8Array(1),St={foo:function(){return 42}};return Object.setPrototypeOf(St,Uint8Array.prototype),Object.setPrototypeOf(It,St),It.foo()===42}catch{return!1}}Object.defineProperty(st.prototype,"parent",{enumerable:!0,get:function(){if(st.isBuffer(this))return this.buffer}}),Object.defineProperty(st.prototype,"offset",{enumerable:!0,get:function(){if(st.isBuffer(this))return this.byteOffset}});function it(It){if(It>rt)throw new RangeError('The value "'+It+'" is invalid for option "size"');const St=new Uint8Array(It);return Object.setPrototypeOf(St,st.prototype),St}function st(It,St,At){if(typeof It=="number"){if(typeof St=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return dt(It)}return at(It,St,At)}st.poolSize=8192;function at(It,St,At){if(typeof It=="string")return ht(It,St);if(ArrayBuffer.isView(It))return mt(It);if(It==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof It);if(In(It,ArrayBuffer)||It&&In(It.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(In(It,SharedArrayBuffer)||It&&In(It.buffer,SharedArrayBuffer)))return ft(It,St,At);if(typeof It=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const jt=It.valueOf&&It.valueOf();if(jt!=null&&jt!==It)return st.from(jt,St,At);const Kt=yt(It);if(Kt)return Kt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof It[Symbol.toPrimitive]=="function")return st.from(It[Symbol.toPrimitive]("string"),St,At);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof It)}st.from=function(It,St,At){return at(It,St,At)},Object.setPrototypeOf(st.prototype,Uint8Array.prototype),Object.setPrototypeOf(st,Uint8Array);function ct(It){if(typeof It!="number")throw new TypeError('"size" argument must be of type number');if(It<0)throw new RangeError('The value "'+It+'" is invalid for option "size"')}function lt(It,St,At){return ct(It),It<=0?it(It):St!==void 0?typeof At=="string"?it(It).fill(St,At):it(It).fill(St):it(It)}st.alloc=function(It,St,At){return lt(It,St,At)};function dt(It){return ct(It),it(It<0?0:gt(It)|0)}st.allocUnsafe=function(It){return dt(It)},st.allocUnsafeSlow=function(It){return dt(It)};function ht(It,St){if((typeof St!="string"||St==="")&&(St="utf8"),!st.isEncoding(St))throw new TypeError("Unknown encoding: "+St);const At=vt(It,St)|0;let jt=it(At);const Kt=jt.write(It,St);return Kt!==At&&(jt=jt.slice(0,Kt)),jt}function pt(It){const St=It.length<0?0:gt(It.length)|0,At=it(St);for(let jt=0;jt=rt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+rt.toString(16)+" bytes");return It|0}function xt(It){return+It!=It&&(It=0),st.alloc(+It)}st.isBuffer=function(St){return St!=null&&St._isBuffer===!0&&St!==st.prototype},st.compare=function(St,At){if(In(St,Uint8Array)&&(St=st.from(St,St.offset,St.byteLength)),In(At,Uint8Array)&&(At=st.from(At,At.offset,At.byteLength)),!st.isBuffer(St)||!st.isBuffer(At))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(St===At)return 0;let jt=St.length,Kt=At.length;for(let rn=0,sn=Math.min(jt,Kt);rnKt.length?(st.isBuffer(sn)||(sn=st.from(sn)),sn.copy(Kt,rn)):Uint8Array.prototype.set.call(Kt,sn,rn);else if(st.isBuffer(sn))sn.copy(Kt,rn);else throw new TypeError('"list" argument must be an Array of Buffers');rn+=sn.length}return Kt};function vt(It,St){if(st.isBuffer(It))return It.length;if(ArrayBuffer.isView(It)||In(It,ArrayBuffer))return It.byteLength;if(typeof It!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof It);const At=It.length,jt=arguments.length>2&&arguments[2]===!0;if(!jt&&At===0)return 0;let Kt=!1;for(;;)switch(St){case"ascii":case"latin1":case"binary":return At;case"utf8":case"utf-8":return ln(It).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return At*2;case"hex":return At>>>1;case"base64":return mn(It).length;default:if(Kt)return jt?-1:ln(It).length;St=(""+St).toLowerCase(),Kt=!0}}st.byteLength=vt;function bt(It,St,At){let jt=!1;if((St===void 0||St<0)&&(St=0),St>this.length||((At===void 0||At>this.length)&&(At=this.length),At<=0)||(At>>>=0,St>>>=0,At<=St))return"";for(It||(It="utf8");;)switch(It){case"hex":return qt(this,St,At);case"utf8":case"utf-8":return zt(this,St,At);case"ascii":return Ht(this,St,At);case"latin1":case"binary":return Ut(this,St,At);case"base64":return Bt(this,St,At);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lt(this,St,At);default:if(jt)throw new TypeError("Unknown encoding: "+It);It=(It+"").toLowerCase(),jt=!0}}st.prototype._isBuffer=!0;function Et(It,St,At){const jt=It[St];It[St]=It[At],It[At]=jt}st.prototype.swap16=function(){const St=this.length;if(St%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let At=0;AtAt&&(St+=" ... "),""},nt&&(st.prototype[nt]=st.prototype.inspect),st.prototype.compare=function(St,At,jt,Kt,rn){if(In(St,Uint8Array)&&(St=st.from(St,St.offset,St.byteLength)),!st.isBuffer(St))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof St);if(At===void 0&&(At=0),jt===void 0&&(jt=St?St.length:0),Kt===void 0&&(Kt=0),rn===void 0&&(rn=this.length),At<0||jt>St.length||Kt<0||rn>this.length)throw new RangeError("out of range index");if(Kt>=rn&&At>=jt)return 0;if(Kt>=rn)return-1;if(At>=jt)return 1;if(At>>>=0,jt>>>=0,Kt>>>=0,rn>>>=0,this===St)return 0;let sn=rn-Kt,xn=jt-At;const Rn=Math.min(sn,xn),vn=this.slice(Kt,rn),An=St.slice(At,jt);for(let bn=0;bn2147483647?At=2147483647:At<-2147483648&&(At=-2147483648),At=+At,Pn(At)&&(At=Kt?0:It.length-1),At<0&&(At=It.length+At),At>=It.length){if(Kt)return-1;At=It.length-1}else if(At<0)if(Kt)At=0;else return-1;if(typeof St=="string"&&(St=st.from(St,jt)),st.isBuffer(St))return St.length===0?-1:kt(It,St,At,jt,Kt);if(typeof St=="number")return St=St&255,typeof Uint8Array.prototype.indexOf=="function"?Kt?Uint8Array.prototype.indexOf.call(It,St,At):Uint8Array.prototype.lastIndexOf.call(It,St,At):kt(It,[St],At,jt,Kt);throw new TypeError("val must be string, number or Buffer")}function kt(It,St,At,jt,Kt){let rn=1,sn=It.length,xn=St.length;if(jt!==void 0&&(jt=String(jt).toLowerCase(),jt==="ucs2"||jt==="ucs-2"||jt==="utf16le"||jt==="utf-16le")){if(It.length<2||St.length<2)return-1;rn=2,sn/=2,xn/=2,At/=2}function Rn(An,bn){return rn===1?An[bn]:An.readUInt16BE(bn*rn)}let vn;if(Kt){let An=-1;for(vn=At;vnsn&&(At=sn-xn),vn=At;vn>=0;vn--){let An=!0;for(let bn=0;bnKt&&(jt=Kt)):jt=Kt;const rn=St.length;jt>rn/2&&(jt=rn/2);let sn;for(sn=0;sn>>0,isFinite(jt)?(jt=jt>>>0,Kt===void 0&&(Kt="utf8")):(Kt=jt,jt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const rn=this.length-At;if((jt===void 0||jt>rn)&&(jt=rn),St.length>0&&(jt<0||At<0)||At>this.length)throw new RangeError("Attempt to write outside buffer bounds");Kt||(Kt="utf8");let sn=!1;for(;;)switch(Kt){case"hex":return Tt(this,St,At,jt);case"utf8":case"utf-8":return Rt(this,St,At,jt);case"ascii":case"latin1":case"binary":return Pt(this,St,At,jt);case"base64":return $t(this,St,At,jt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ot(this,St,At,jt);default:if(sn)throw new TypeError("Unknown encoding: "+Kt);Kt=(""+Kt).toLowerCase(),sn=!0}},st.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Bt(It,St,At){return St===0&&At===It.length?et.fromByteArray(It):et.fromByteArray(It.slice(St,At))}function zt(It,St,At){At=Math.min(It.length,At);const jt=[];let Kt=St;for(;Kt239?4:rn>223?3:rn>191?2:1;if(Kt+xn<=At){let Rn,vn,An,bn;switch(xn){case 1:rn<128&&(sn=rn);break;case 2:Rn=It[Kt+1],(Rn&192)===128&&(bn=(rn&31)<<6|Rn&63,bn>127&&(sn=bn));break;case 3:Rn=It[Kt+1],vn=It[Kt+2],(Rn&192)===128&&(vn&192)===128&&(bn=(rn&15)<<12|(Rn&63)<<6|vn&63,bn>2047&&(bn<55296||bn>57343)&&(sn=bn));break;case 4:Rn=It[Kt+1],vn=It[Kt+2],An=It[Kt+3],(Rn&192)===128&&(vn&192)===128&&(An&192)===128&&(bn=(rn&15)<<18|(Rn&63)<<12|(vn&63)<<6|An&63,bn>65535&&bn<1114112&&(sn=bn))}}sn===null?(sn=65533,xn=1):sn>65535&&(sn-=65536,jt.push(sn>>>10&1023|55296),sn=56320|sn&1023),jt.push(sn),Kt+=xn}return Yt(jt)}const Ft=4096;function Yt(It){const St=It.length;if(St<=Ft)return String.fromCharCode.apply(String,It);let At="",jt=0;for(;jtjt)&&(At=jt);let Kt="";for(let rn=St;rnjt&&(St=jt),At<0?(At+=jt,At<0&&(At=0)):At>jt&&(At=jt),AtAt)throw new RangeError("Trying to access beyond buffer length")}st.prototype.readUintLE=st.prototype.readUIntLE=function(St,At,jt){St=St>>>0,At=At>>>0,jt||Zt(St,At,this.length);let Kt=this[St],rn=1,sn=0;for(;++sn>>0,At=At>>>0,jt||Zt(St,At,this.length);let Kt=this[St+--At],rn=1;for(;At>0&&(rn*=256);)Kt+=this[St+--At]*rn;return Kt},st.prototype.readUint8=st.prototype.readUInt8=function(St,At){return St=St>>>0,At||Zt(St,1,this.length),this[St]},st.prototype.readUint16LE=st.prototype.readUInt16LE=function(St,At){return St=St>>>0,At||Zt(St,2,this.length),this[St]|this[St+1]<<8},st.prototype.readUint16BE=st.prototype.readUInt16BE=function(St,At){return St=St>>>0,At||Zt(St,2,this.length),this[St]<<8|this[St+1]},st.prototype.readUint32LE=st.prototype.readUInt32LE=function(St,At){return St=St>>>0,At||Zt(St,4,this.length),(this[St]|this[St+1]<<8|this[St+2]<<16)+this[St+3]*16777216},st.prototype.readUint32BE=st.prototype.readUInt32BE=function(St,At){return St=St>>>0,At||Zt(St,4,this.length),this[St]*16777216+(this[St+1]<<16|this[St+2]<<8|this[St+3])},st.prototype.readBigUInt64LE=En(function(St){St=St>>>0,Vt(St,"offset");const At=this[St],jt=this[St+7];(At===void 0||jt===void 0)&&en(St,this.length-8);const Kt=At+this[++St]*2**8+this[++St]*2**16+this[++St]*2**24,rn=this[++St]+this[++St]*2**8+this[++St]*2**16+jt*2**24;return BigInt(Kt)+(BigInt(rn)<>>0,Vt(St,"offset");const At=this[St],jt=this[St+7];(At===void 0||jt===void 0)&&en(St,this.length-8);const Kt=At*2**24+this[++St]*2**16+this[++St]*2**8+this[++St],rn=this[++St]*2**24+this[++St]*2**16+this[++St]*2**8+jt;return(BigInt(Kt)<>>0,At=At>>>0,jt||Zt(St,At,this.length);let Kt=this[St],rn=1,sn=0;for(;++sn=rn&&(Kt-=Math.pow(2,8*At)),Kt},st.prototype.readIntBE=function(St,At,jt){St=St>>>0,At=At>>>0,jt||Zt(St,At,this.length);let Kt=At,rn=1,sn=this[St+--Kt];for(;Kt>0&&(rn*=256);)sn+=this[St+--Kt]*rn;return rn*=128,sn>=rn&&(sn-=Math.pow(2,8*At)),sn},st.prototype.readInt8=function(St,At){return St=St>>>0,At||Zt(St,1,this.length),this[St]&128?(255-this[St]+1)*-1:this[St]},st.prototype.readInt16LE=function(St,At){St=St>>>0,At||Zt(St,2,this.length);const jt=this[St]|this[St+1]<<8;return jt&32768?jt|4294901760:jt},st.prototype.readInt16BE=function(St,At){St=St>>>0,At||Zt(St,2,this.length);const jt=this[St+1]|this[St]<<8;return jt&32768?jt|4294901760:jt},st.prototype.readInt32LE=function(St,At){return St=St>>>0,At||Zt(St,4,this.length),this[St]|this[St+1]<<8|this[St+2]<<16|this[St+3]<<24},st.prototype.readInt32BE=function(St,At){return St=St>>>0,At||Zt(St,4,this.length),this[St]<<24|this[St+1]<<16|this[St+2]<<8|this[St+3]},st.prototype.readBigInt64LE=En(function(St){St=St>>>0,Vt(St,"offset");const At=this[St],jt=this[St+7];(At===void 0||jt===void 0)&&en(St,this.length-8);const Kt=this[St+4]+this[St+5]*2**8+this[St+6]*2**16+(jt<<24);return(BigInt(Kt)<>>0,Vt(St,"offset");const At=this[St],jt=this[St+7];(At===void 0||jt===void 0)&&en(St,this.length-8);const Kt=(At<<24)+this[++St]*2**16+this[++St]*2**8+this[++St];return(BigInt(Kt)<>>0,At||Zt(St,4,this.length),tt.read(this,St,!0,23,4)},st.prototype.readFloatBE=function(St,At){return St=St>>>0,At||Zt(St,4,this.length),tt.read(this,St,!1,23,4)},st.prototype.readDoubleLE=function(St,At){return St=St>>>0,At||Zt(St,8,this.length),tt.read(this,St,!0,52,8)},st.prototype.readDoubleBE=function(St,At){return St=St>>>0,At||Zt(St,8,this.length),tt.read(this,St,!1,52,8)};function Qt(It,St,At,jt,Kt,rn){if(!st.isBuffer(It))throw new TypeError('"buffer" argument must be a Buffer instance');if(St>Kt||StIt.length)throw new RangeError("Index out of range")}st.prototype.writeUintLE=st.prototype.writeUIntLE=function(St,At,jt,Kt){if(St=+St,At=At>>>0,jt=jt>>>0,!Kt){const xn=Math.pow(2,8*jt)-1;Qt(this,St,At,jt,xn,0)}let rn=1,sn=0;for(this[At]=St&255;++sn>>0,jt=jt>>>0,!Kt){const xn=Math.pow(2,8*jt)-1;Qt(this,St,At,jt,xn,0)}let rn=jt-1,sn=1;for(this[At+rn]=St&255;--rn>=0&&(sn*=256);)this[At+rn]=St/sn&255;return At+jt},st.prototype.writeUint8=st.prototype.writeUInt8=function(St,At,jt){return St=+St,At=At>>>0,jt||Qt(this,St,At,1,255,0),this[At]=St&255,At+1},st.prototype.writeUint16LE=st.prototype.writeUInt16LE=function(St,At,jt){return St=+St,At=At>>>0,jt||Qt(this,St,At,2,65535,0),this[At]=St&255,this[At+1]=St>>>8,At+2},st.prototype.writeUint16BE=st.prototype.writeUInt16BE=function(St,At,jt){return St=+St,At=At>>>0,jt||Qt(this,St,At,2,65535,0),this[At]=St>>>8,this[At+1]=St&255,At+2},st.prototype.writeUint32LE=st.prototype.writeUInt32LE=function(St,At,jt){return St=+St,At=At>>>0,jt||Qt(this,St,At,4,4294967295,0),this[At+3]=St>>>24,this[At+2]=St>>>16,this[At+1]=St>>>8,this[At]=St&255,At+4},st.prototype.writeUint32BE=st.prototype.writeUInt32BE=function(St,At,jt){return St=+St,At=At>>>0,jt||Qt(this,St,At,4,4294967295,0),this[At]=St>>>24,this[At+1]=St>>>16,this[At+2]=St>>>8,this[At+3]=St&255,At+4};function Nt(It,St,At,jt,Kt){Dt(St,jt,Kt,It,At,7);let rn=Number(St&BigInt(4294967295));It[At++]=rn,rn=rn>>8,It[At++]=rn,rn=rn>>8,It[At++]=rn,rn=rn>>8,It[At++]=rn;let sn=Number(St>>BigInt(32)&BigInt(4294967295));return It[At++]=sn,sn=sn>>8,It[At++]=sn,sn=sn>>8,It[At++]=sn,sn=sn>>8,It[At++]=sn,At}function Gt(It,St,At,jt,Kt){Dt(St,jt,Kt,It,At,7);let rn=Number(St&BigInt(4294967295));It[At+7]=rn,rn=rn>>8,It[At+6]=rn,rn=rn>>8,It[At+5]=rn,rn=rn>>8,It[At+4]=rn;let sn=Number(St>>BigInt(32)&BigInt(4294967295));return It[At+3]=sn,sn=sn>>8,It[At+2]=sn,sn=sn>>8,It[At+1]=sn,sn=sn>>8,It[At]=sn,At+8}st.prototype.writeBigUInt64LE=En(function(St,At=0){return Nt(this,St,At,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeBigUInt64BE=En(function(St,At=0){return Gt(this,St,At,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeIntLE=function(St,At,jt,Kt){if(St=+St,At=At>>>0,!Kt){const Rn=Math.pow(2,8*jt-1);Qt(this,St,At,jt,Rn-1,-Rn)}let rn=0,sn=1,xn=0;for(this[At]=St&255;++rn>0)-xn&255;return At+jt},st.prototype.writeIntBE=function(St,At,jt,Kt){if(St=+St,At=At>>>0,!Kt){const Rn=Math.pow(2,8*jt-1);Qt(this,St,At,jt,Rn-1,-Rn)}let rn=jt-1,sn=1,xn=0;for(this[At+rn]=St&255;--rn>=0&&(sn*=256);)St<0&&xn===0&&this[At+rn+1]!==0&&(xn=1),this[At+rn]=(St/sn>>0)-xn&255;return At+jt},st.prototype.writeInt8=function(St,At,jt){return St=+St,At=At>>>0,jt||Qt(this,St,At,1,127,-128),St<0&&(St=255+St+1),this[At]=St&255,At+1},st.prototype.writeInt16LE=function(St,At,jt){return St=+St,At=At>>>0,jt||Qt(this,St,At,2,32767,-32768),this[At]=St&255,this[At+1]=St>>>8,At+2},st.prototype.writeInt16BE=function(St,At,jt){return St=+St,At=At>>>0,jt||Qt(this,St,At,2,32767,-32768),this[At]=St>>>8,this[At+1]=St&255,At+2},st.prototype.writeInt32LE=function(St,At,jt){return St=+St,At=At>>>0,jt||Qt(this,St,At,4,2147483647,-2147483648),this[At]=St&255,this[At+1]=St>>>8,this[At+2]=St>>>16,this[At+3]=St>>>24,At+4},st.prototype.writeInt32BE=function(St,At,jt){return St=+St,At=At>>>0,jt||Qt(this,St,At,4,2147483647,-2147483648),St<0&&(St=4294967295+St+1),this[At]=St>>>24,this[At+1]=St>>>16,this[At+2]=St>>>8,this[At+3]=St&255,At+4},st.prototype.writeBigInt64LE=En(function(St,At=0){return Nt(this,St,At,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),st.prototype.writeBigInt64BE=En(function(St,At=0){return Gt(this,St,At,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function nn(It,St,At,jt,Kt,rn){if(At+jt>It.length)throw new RangeError("Index out of range");if(At<0)throw new RangeError("Index out of range")}function Wt(It,St,At,jt,Kt){return St=+St,At=At>>>0,Kt||nn(It,St,At,4),tt.write(It,St,At,jt,23,4),At+4}st.prototype.writeFloatLE=function(St,At,jt){return Wt(this,St,At,!0,jt)},st.prototype.writeFloatBE=function(St,At,jt){return Wt(this,St,At,!1,jt)};function hn(It,St,At,jt,Kt){return St=+St,At=At>>>0,Kt||nn(It,St,At,8),tt.write(It,St,At,jt,52,8),At+8}st.prototype.writeDoubleLE=function(St,At,jt){return hn(this,St,At,!0,jt)},st.prototype.writeDoubleBE=function(St,At,jt){return hn(this,St,At,!1,jt)},st.prototype.copy=function(St,At,jt,Kt){if(!st.isBuffer(St))throw new TypeError("argument should be a Buffer");if(jt||(jt=0),!Kt&&Kt!==0&&(Kt=this.length),At>=St.length&&(At=St.length),At||(At=0),Kt>0&&Kt=this.length)throw new RangeError("Index out of range");if(Kt<0)throw new RangeError("sourceEnd out of bounds");Kt>this.length&&(Kt=this.length),St.length-At>>0,jt=jt===void 0?this.length:jt>>>0,St||(St=0);let rn;if(typeof St=="number")for(rn=At;rn2**32?Kt=tn(String(At)):typeof At=="bigint"&&(Kt=String(At),(At>BigInt(2)**BigInt(32)||At<-(BigInt(2)**BigInt(32)))&&(Kt=tn(Kt)),Kt+="n"),jt+=` It must be ${St}. Received ${Kt}`,jt},RangeError);function tn(It){let St="",At=It.length;const jt=It[0]==="-"?1:0;for(;At>=jt+4;At-=3)St=`_${It.slice(At-3,At)}${St}`;return`${It.slice(0,At)}${St}`}function _t(It,St,At){Vt(St,"offset"),(It[St]===void 0||It[St+At]===void 0)&&en(St,It.length-(At+1))}function Dt(It,St,At,jt,Kt,rn){if(It>At||It= 0${sn} and < 2${sn} ** ${(rn+1)*8}${sn}`:xn=`>= -(2${sn} ** ${(rn+1)*8-1}${sn}) and < 2 ** ${(rn+1)*8-1}${sn}`,new Xt.ERR_OUT_OF_RANGE("value",xn,It)}_t(jt,Kt,rn)}function Vt(It,St){if(typeof It!="number")throw new Xt.ERR_INVALID_ARG_TYPE(St,"number",It)}function en(It,St,At){throw Math.floor(It)!==It?(Vt(It,At),new Xt.ERR_OUT_OF_RANGE("offset","an integer",It)):St<0?new Xt.ERR_BUFFER_OUT_OF_BOUNDS:new Xt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${St}`,It)}const an=/[^+/0-9A-Za-z-_]/g;function dn(It){if(It=It.split("=")[0],It=It.trim().replace(an,""),It.length<2)return"";for(;It.length%4!==0;)It=It+"=";return It}function ln(It,St){St=St||1/0;let At;const jt=It.length;let Kt=null;const rn=[];for(let sn=0;sn55295&&At<57344){if(!Kt){if(At>56319){(St-=3)>-1&&rn.push(239,191,189);continue}else if(sn+1===jt){(St-=3)>-1&&rn.push(239,191,189);continue}Kt=At;continue}if(At<56320){(St-=3)>-1&&rn.push(239,191,189),Kt=At;continue}At=(Kt-55296<<10|At-56320)+65536}else Kt&&(St-=3)>-1&&rn.push(239,191,189);if(Kt=null,At<128){if((St-=1)<0)break;rn.push(At)}else if(At<2048){if((St-=2)<0)break;rn.push(At>>6|192,At&63|128)}else if(At<65536){if((St-=3)<0)break;rn.push(At>>12|224,At>>6&63|128,At&63|128)}else if(At<1114112){if((St-=4)<0)break;rn.push(At>>18|240,At>>12&63|128,At>>6&63|128,At&63|128)}else throw new Error("Invalid code point")}return rn}function pn(It){const St=[];for(let At=0;At>8,Kt=At%256,rn.push(Kt),rn.push(jt);return rn}function mn(It){return et.toByteArray(dn(It))}function wn(It,St,At,jt){let Kt;for(Kt=0;Kt=St.length||Kt>=It.length);++Kt)St[Kt+At]=It[Kt];return Kt}function In(It,St){return It instanceof St||It!=null&&It.constructor!=null&&It.constructor.name!=null&&It.constructor.name===St.name}function Pn(It){return It!==It}const yn=function(){const It="0123456789abcdef",St=new Array(256);for(let At=0;At<16;++At){const jt=At*16;for(let Kt=0;Kt<16;++Kt)St[jt+Kt]=It[At]+It[Kt]}return St}();function En(It){return typeof BigInt>"u"?on:It}function on(){throw new Error("BigInt not supported")}})(buffer$2);var reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(o){function et(Ut,qt){var Lt=Ut.length;Ut.push(qt);e:for(;0>>1,Qt=Ut[Zt];if(0>>1;Ztrt(nn,Lt))Wtrt(hn,nn)?(Ut[Zt]=hn,Ut[Wt]=Lt,Zt=Wt):(Ut[Zt]=nn,Ut[Gt]=Lt,Zt=Gt);else if(Wtrt(hn,Lt))Ut[Zt]=hn,Ut[Wt]=Lt,Zt=Wt;else break e}}return qt}function rt(Ut,qt){var Lt=Ut.sortIndex-qt.sortIndex;return Lt!==0?Lt:Ut.id-qt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var ot=performance;o.unstable_now=function(){return ot.now()}}else{var it=Date,st=it.now();o.unstable_now=function(){return it.now()-st}}var at=[],ct=[],lt=1,dt=null,ht=3,pt=!1,mt=!1,ft=!1,yt=typeof setTimeout=="function"?setTimeout:null,gt=typeof clearTimeout=="function"?clearTimeout:null,xt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function vt(Ut){for(var qt=tt(ct);qt!==null;){if(qt.callback===null)nt(ct);else if(qt.startTime<=Ut)nt(ct),qt.sortIndex=qt.expirationTime,et(at,qt);else break;qt=tt(ct)}}function bt(Ut){if(ft=!1,vt(Ut),!mt)if(tt(at)!==null)mt=!0,Yt(Et);else{var qt=tt(ct);qt!==null&&Ht(bt,qt.startTime-Ut)}}function Et(Ut,qt){mt=!1,ft&&(ft=!1,gt(Tt),Tt=-1),pt=!0;var Lt=ht;try{for(vt(qt),dt=tt(at);dt!==null&&(!(dt.expirationTime>qt)||Ut&&!$t());){var Zt=dt.callback;if(typeof Zt=="function"){dt.callback=null,ht=dt.priorityLevel;var Qt=Zt(dt.expirationTime<=qt);qt=o.unstable_now(),typeof Qt=="function"?dt.callback=Qt:dt===tt(at)&&nt(at),vt(qt)}else nt(at);dt=tt(at)}if(dt!==null)var Nt=!0;else{var Gt=tt(ct);Gt!==null&&Ht(bt,Gt.startTime-qt),Nt=!1}return Nt}finally{dt=null,ht=Lt,pt=!1}}var wt=!1,kt=null,Tt=-1,Rt=5,Pt=-1;function $t(){return!(o.unstable_now()-PtUt||125Zt?(Ut.sortIndex=Lt,et(ct,Ut),tt(at)===null&&Ut===tt(ct)&&(ft?(gt(Tt),Tt=-1):ft=!0,Ht(bt,Lt-Zt))):(Ut.sortIndex=Qt,et(at,Ut),mt||pt||(mt=!0,Yt(Et))),Ut},o.unstable_shouldYield=$t,o.unstable_wrapCallback=function(Ut){var qt=ht;return function(){var Lt=ht;ht=qt;try{return Ut.apply(this,arguments)}finally{ht=Lt}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var aa=reactExports,ca$1=schedulerExports;function p$4(o){for(var et="https://reactjs.org/docs/error-decoder.html?invariant="+o,tt=1;tt"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la={},ma={};function oa(o){return ja.call(ma,o)?!0:ja.call(la,o)?!1:ka.test(o)?ma[o]=!0:(la[o]=!0,!1)}function pa(o,et,tt,nt){if(tt!==null&&tt.type===0)return!1;switch(typeof et){case"function":case"symbol":return!0;case"boolean":return nt?!1:tt!==null?!tt.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function qa(o,et,tt,nt){if(et===null||typeof et>"u"||pa(o,et,tt,nt))return!0;if(nt)return!1;if(tt!==null)switch(tt.type){case 3:return!et;case 4:return et===!1;case 5:return isNaN(et);case 6:return isNaN(et)||1>et}return!1}function v$4(o,et,tt,nt,rt,ot,it){this.acceptsBooleans=et===2||et===3||et===4,this.attributeName=nt,this.attributeNamespace=rt,this.mustUseProperty=tt,this.propertyName=o,this.type=et,this.sanitizeURL=ot,this.removeEmptyString=it}var z$2={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){z$2[o]=new v$4(o,0,!1,o,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var et=o[0];z$2[et]=new v$4(et,1,!1,o[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(o){z$2[o]=new v$4(o,2,!1,o.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){z$2[o]=new v$4(o,2,!1,o,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){z$2[o]=new v$4(o,3,!1,o.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(o){z$2[o]=new v$4(o,3,!0,o,null,!1,!1)});["capture","download"].forEach(function(o){z$2[o]=new v$4(o,4,!1,o,null,!1,!1)});["cols","rows","size","span"].forEach(function(o){z$2[o]=new v$4(o,6,!1,o,null,!1,!1)});["rowSpan","start"].forEach(function(o){z$2[o]=new v$4(o,5,!1,o.toLowerCase(),null,!1,!1)});var ra$1=/[\-:]([a-z])/g;function sa(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var et=o.replace(ra$1,sa);z$2[et]=new v$4(et,1,!1,o,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var et=o.replace(ra$1,sa);z$2[et]=new v$4(et,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(o){var et=o.replace(ra$1,sa);z$2[et]=new v$4(et,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(o){z$2[o]=new v$4(o,1,!1,o.toLowerCase(),null,!1,!1)});z$2.xlinkHref=new v$4("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(o){z$2[o]=new v$4(o,1,!1,o.toLowerCase(),null,!0,!0)});function ta(o,et,tt,nt){var rt=z$2.hasOwnProperty(et)?z$2[et]:null;(rt!==null?rt.type!==0:nt||!(2st||rt[it]!==ot[st]){var at=` +`+rt[it].replace(" at new "," at ");return o.displayName&&at.includes("")&&(at=at.replace("",o.displayName)),at}while(1<=it&&0<=st);break}}}finally{Na=!1,Error.prepareStackTrace=tt}return(o=o?o.displayName||o.name:"")?Ma(o):""}function Pa(o){switch(o.tag){case 5:return Ma(o.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return o=Oa(o.type,!1),o;case 11:return o=Oa(o.type.render,!1),o;case 1:return o=Oa(o.type,!0),o;default:return""}}function Qa(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case Ca:return(o.displayName||"Context")+".Consumer";case Ba:return(o._context.displayName||"Context")+".Provider";case Da:var et=o.render;return o=o.displayName,o||(o=et.displayName||et.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case Ga:return et=o.displayName||null,et!==null?et:Qa(o.type)||"Memo";case Ha:et=o._payload,o=o._init;try{return Qa(o(et))}catch{}}return null}function Ra(o){var et=o.type;switch(o.tag){case 24:return"Cache";case 9:return(et.displayName||"Context")+".Consumer";case 10:return(et._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=et.render,o=o.displayName||o.name||"",et.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return et;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(et);case 8:return et===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof et=="function")return et.displayName||et.name||null;if(typeof et=="string")return et}return null}function Sa(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ta(o){var et=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(et==="checkbox"||et==="radio")}function Ua(o){var et=Ta(o)?"checked":"value",tt=Object.getOwnPropertyDescriptor(o.constructor.prototype,et),nt=""+o[et];if(!o.hasOwnProperty(et)&&typeof tt<"u"&&typeof tt.get=="function"&&typeof tt.set=="function"){var rt=tt.get,ot=tt.set;return Object.defineProperty(o,et,{configurable:!0,get:function(){return rt.call(this)},set:function(it){nt=""+it,ot.call(this,it)}}),Object.defineProperty(o,et,{enumerable:tt.enumerable}),{getValue:function(){return nt},setValue:function(it){nt=""+it},stopTracking:function(){o._valueTracker=null,delete o[et]}}}}function Va(o){o._valueTracker||(o._valueTracker=Ua(o))}function Wa(o){if(!o)return!1;var et=o._valueTracker;if(!et)return!0;var tt=et.getValue(),nt="";return o&&(nt=Ta(o)?o.checked?"true":"false":o.value),o=nt,o!==tt?(et.setValue(o),!0):!1}function Xa(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function Ya(o,et){var tt=et.checked;return A$1({},et,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:tt??o._wrapperState.initialChecked})}function Za(o,et){var tt=et.defaultValue==null?"":et.defaultValue,nt=et.checked!=null?et.checked:et.defaultChecked;tt=Sa(et.value!=null?et.value:tt),o._wrapperState={initialChecked:nt,initialValue:tt,controlled:et.type==="checkbox"||et.type==="radio"?et.checked!=null:et.value!=null}}function ab(o,et){et=et.checked,et!=null&&ta(o,"checked",et,!1)}function bb(o,et){ab(o,et);var tt=Sa(et.value),nt=et.type;if(tt!=null)nt==="number"?(tt===0&&o.value===""||o.value!=tt)&&(o.value=""+tt):o.value!==""+tt&&(o.value=""+tt);else if(nt==="submit"||nt==="reset"){o.removeAttribute("value");return}et.hasOwnProperty("value")?cb$1(o,et.type,tt):et.hasOwnProperty("defaultValue")&&cb$1(o,et.type,Sa(et.defaultValue)),et.checked==null&&et.defaultChecked!=null&&(o.defaultChecked=!!et.defaultChecked)}function db(o,et,tt){if(et.hasOwnProperty("value")||et.hasOwnProperty("defaultValue")){var nt=et.type;if(!(nt!=="submit"&&nt!=="reset"||et.value!==void 0&&et.value!==null))return;et=""+o._wrapperState.initialValue,tt||et===o.value||(o.value=et),o.defaultValue=et}tt=o.name,tt!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,tt!==""&&(o.name=tt)}function cb$1(o,et,tt){(et!=="number"||Xa(o.ownerDocument)!==o)&&(tt==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+tt&&(o.defaultValue=""+tt))}var eb=Array.isArray;function fb(o,et,tt,nt){if(o=o.options,et){et={};for(var rt=0;rt"+et.valueOf().toString()+"",et=mb.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;et.firstChild;)o.appendChild(et.firstChild)}});function ob(o,et){if(et){var tt=o.firstChild;if(tt&&tt===o.lastChild&&tt.nodeType===3){tt.nodeValue=et;return}}o.textContent=et}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(o){qb.forEach(function(et){et=et+o.charAt(0).toUpperCase()+o.substring(1),pb[et]=pb[o]})});function rb(o,et,tt){return et==null||typeof et=="boolean"||et===""?"":tt||typeof et!="number"||et===0||pb.hasOwnProperty(o)&&pb[o]?(""+et).trim():et+"px"}function sb(o,et){o=o.style;for(var tt in et)if(et.hasOwnProperty(tt)){var nt=tt.indexOf("--")===0,rt=rb(tt,et[tt],nt);tt==="float"&&(tt="cssFloat"),nt?o.setProperty(tt,rt):o[tt]=rt}}var tb=A$1({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(o,et){if(et){if(tb[o]&&(et.children!=null||et.dangerouslySetInnerHTML!=null))throw Error(p$4(137,o));if(et.dangerouslySetInnerHTML!=null){if(et.children!=null)throw Error(p$4(60));if(typeof et.dangerouslySetInnerHTML!="object"||!("__html"in et.dangerouslySetInnerHTML))throw Error(p$4(61))}if(et.style!=null&&typeof et.style!="object")throw Error(p$4(62))}}function vb(o,et){if(o.indexOf("-")===-1)return typeof et.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var yb=null,zb=null,Ab=null;function Bb(o){if(o=Cb(o)){if(typeof yb!="function")throw Error(p$4(280));var et=o.stateNode;et&&(et=Db(et),yb(o.stateNode,o.type,et))}}function Eb(o){zb?Ab?Ab.push(o):Ab=[o]:zb=o}function Fb(){if(zb){var o=zb,et=Ab;if(Ab=zb=null,Bb(o),et)for(o=0;o>>=0,o===0?32:31-(pc(o)/qc|0)|0}var rc=64,sc=4194304;function tc(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function uc(o,et){var tt=o.pendingLanes;if(tt===0)return 0;var nt=0,rt=o.suspendedLanes,ot=o.pingedLanes,it=tt&268435455;if(it!==0){var st=it&~rt;st!==0?nt=tc(st):(ot&=it,ot!==0&&(nt=tc(ot)))}else it=tt&~rt,it!==0?nt=tc(it):ot!==0&&(nt=tc(ot));if(nt===0)return 0;if(et!==0&&et!==nt&&!(et&rt)&&(rt=nt&-nt,ot=et&-et,rt>=ot||rt===16&&(ot&4194240)!==0))return et;if(nt&4&&(nt|=tt&16),et=o.entangledLanes,et!==0)for(o=o.entanglements,et&=nt;0tt;tt++)et.push(o);return et}function Ac(o,et,tt){o.pendingLanes|=et,et!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,et=31-oc(et),o[et]=tt}function Bc(o,et){var tt=o.pendingLanes&~et;o.pendingLanes=et,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=et,o.mutableReadLanes&=et,o.entangledLanes&=et,et=o.entanglements;var nt=o.eventTimes;for(o=o.expirationTimes;0=be$1),ee$1=" ",fe$1=!1;function ge$1(o,et){switch(o){case"keyup":return $d.indexOf(et.keyCode)!==-1;case"keydown":return et.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he$1(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ie$1=!1;function je$1(o,et){switch(o){case"compositionend":return he$1(et);case"keypress":return et.which!==32?null:(fe$1=!0,ee$1);case"textInput":return o=et.data,o===ee$1&&fe$1?null:o;default:return null}}function ke$1(o,et){if(ie$1)return o==="compositionend"||!ae$1&&ge$1(o,et)?(o=nd(),md=ld=kd=null,ie$1=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(et.ctrlKey||et.altKey||et.metaKey)||et.ctrlKey&&et.altKey){if(et.char&&1=et)return{node:tt,offset:et-o};o=nt}e:{for(;tt;){if(tt.nextSibling){tt=tt.nextSibling;break e}tt=tt.parentNode}tt=void 0}tt=Je(tt)}}function Le$1(o,et){return o&&et?o===et?!0:o&&o.nodeType===3?!1:et&&et.nodeType===3?Le$1(o,et.parentNode):"contains"in o?o.contains(et):o.compareDocumentPosition?!!(o.compareDocumentPosition(et)&16):!1:!1}function Me$1(){for(var o=window,et=Xa();et instanceof o.HTMLIFrameElement;){try{var tt=typeof et.contentWindow.location.href=="string"}catch{tt=!1}if(tt)o=et.contentWindow;else break;et=Xa(o.document)}return et}function Ne$1(o){var et=o&&o.nodeName&&o.nodeName.toLowerCase();return et&&(et==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||et==="textarea"||o.contentEditable==="true")}function Oe$1(o){var et=Me$1(),tt=o.focusedElem,nt=o.selectionRange;if(et!==tt&&tt&&tt.ownerDocument&&Le$1(tt.ownerDocument.documentElement,tt)){if(nt!==null&&Ne$1(tt)){if(et=nt.start,o=nt.end,o===void 0&&(o=et),"selectionStart"in tt)tt.selectionStart=et,tt.selectionEnd=Math.min(o,tt.value.length);else if(o=(et=tt.ownerDocument||document)&&et.defaultView||window,o.getSelection){o=o.getSelection();var rt=tt.textContent.length,ot=Math.min(nt.start,rt);nt=nt.end===void 0?ot:Math.min(nt.end,rt),!o.extend&&ot>nt&&(rt=nt,nt=ot,ot=rt),rt=Ke(tt,ot);var it=Ke(tt,nt);rt&&it&&(o.rangeCount!==1||o.anchorNode!==rt.node||o.anchorOffset!==rt.offset||o.focusNode!==it.node||o.focusOffset!==it.offset)&&(et=et.createRange(),et.setStart(rt.node,rt.offset),o.removeAllRanges(),ot>nt?(o.addRange(et),o.extend(it.node,it.offset)):(et.setEnd(it.node,it.offset),o.addRange(et)))}}for(et=[],o=tt;o=o.parentNode;)o.nodeType===1&&et.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof tt.focus=="function"&&tt.focus(),tt=0;tt=document.documentMode,Qe=null,Re$1=null,Se$1=null,Te$1=!1;function Ue(o,et,tt){var nt=tt.window===tt?tt.document:tt.nodeType===9?tt:tt.ownerDocument;Te$1||Qe==null||Qe!==Xa(nt)||(nt=Qe,"selectionStart"in nt&&Ne$1(nt)?nt={start:nt.selectionStart,end:nt.selectionEnd}:(nt=(nt.ownerDocument&&nt.ownerDocument.defaultView||window).getSelection(),nt={anchorNode:nt.anchorNode,anchorOffset:nt.anchorOffset,focusNode:nt.focusNode,focusOffset:nt.focusOffset}),Se$1&&Ie(Se$1,nt)||(Se$1=nt,nt=oe$1(Re$1,"onSelect"),0Tf||(o.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G$1(o,et){Tf++,Sf[Tf]=o.current,o.current=et}var Vf={},H$1=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(o,et){var tt=o.type.contextTypes;if(!tt)return Vf;var nt=o.stateNode;if(nt&&nt.__reactInternalMemoizedUnmaskedChildContext===et)return nt.__reactInternalMemoizedMaskedChildContext;var rt={},ot;for(ot in tt)rt[ot]=et[ot];return nt&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=et,o.__reactInternalMemoizedMaskedChildContext=rt),rt}function Zf(o){return o=o.childContextTypes,o!=null}function $f(){E$1(Wf),E$1(H$1)}function ag(o,et,tt){if(H$1.current!==Vf)throw Error(p$4(168));G$1(H$1,et),G$1(Wf,tt)}function bg(o,et,tt){var nt=o.stateNode;if(et=et.childContextTypes,typeof nt.getChildContext!="function")return tt;nt=nt.getChildContext();for(var rt in nt)if(!(rt in et))throw Error(p$4(108,Ra(o)||"Unknown",rt));return A$1({},tt,nt)}function cg(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Vf,Xf=H$1.current,G$1(H$1,o),G$1(Wf,Wf.current),!0}function dg(o,et,tt){var nt=o.stateNode;if(!nt)throw Error(p$4(169));tt?(o=bg(o,et,Xf),nt.__reactInternalMemoizedMergedChildContext=o,E$1(Wf),E$1(H$1),G$1(H$1,o)):E$1(Wf),G$1(Wf,tt)}var eg=null,fg=!1,gg=!1;function hg(o){eg===null?eg=[o]:eg.push(o)}function ig(o){fg=!0,hg(o)}function jg(){if(!gg&&eg!==null){gg=!0;var o=0,et=C$1;try{var tt=eg;for(C$1=1;o>=it,rt-=it,rg=1<<32-oc(et)+rt|tt<Tt?(Rt=kt,kt=null):Rt=kt.sibling;var Pt=ht(gt,kt,vt[Tt],bt);if(Pt===null){kt===null&&(kt=Rt);break}o&&kt&&Pt.alternate===null&&et(gt,kt),xt=ot(Pt,xt,Tt),wt===null?Et=Pt:wt.sibling=Pt,wt=Pt,kt=Rt}if(Tt===vt.length)return tt(gt,kt),I$1&&tg(gt,Tt),Et;if(kt===null){for(;TtTt?(Rt=kt,kt=null):Rt=kt.sibling;var $t=ht(gt,kt,Pt.value,bt);if($t===null){kt===null&&(kt=Rt);break}o&&kt&&$t.alternate===null&&et(gt,kt),xt=ot($t,xt,Tt),wt===null?Et=$t:wt.sibling=$t,wt=$t,kt=Rt}if(Pt.done)return tt(gt,kt),I$1&&tg(gt,Tt),Et;if(kt===null){for(;!Pt.done;Tt++,Pt=vt.next())Pt=dt(gt,Pt.value,bt),Pt!==null&&(xt=ot(Pt,xt,Tt),wt===null?Et=Pt:wt.sibling=Pt,wt=Pt);return I$1&&tg(gt,Tt),Et}for(kt=nt(gt,kt);!Pt.done;Tt++,Pt=vt.next())Pt=pt(kt,gt,Tt,Pt.value,bt),Pt!==null&&(o&&Pt.alternate!==null&&kt.delete(Pt.key===null?Tt:Pt.key),xt=ot(Pt,xt,Tt),wt===null?Et=Pt:wt.sibling=Pt,wt=Pt);return o&&kt.forEach(function(Ot){return et(gt,Ot)}),I$1&&tg(gt,Tt),Et}function yt(gt,xt,vt,bt){if(typeof vt=="object"&&vt!==null&&vt.type===ya&&vt.key===null&&(vt=vt.props.children),typeof vt=="object"&&vt!==null){switch(vt.$$typeof){case va:e:{for(var Et=vt.key,wt=xt;wt!==null;){if(wt.key===Et){if(Et=vt.type,Et===ya){if(wt.tag===7){tt(gt,wt.sibling),xt=rt(wt,vt.props.children),xt.return=gt,gt=xt;break e}}else if(wt.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===Ha&&Ng(Et)===wt.type){tt(gt,wt.sibling),xt=rt(wt,vt.props),xt.ref=Lg(gt,wt,vt),xt.return=gt,gt=xt;break e}tt(gt,wt);break}else et(gt,wt);wt=wt.sibling}vt.type===ya?(xt=Tg(vt.props.children,gt.mode,bt,vt.key),xt.return=gt,gt=xt):(bt=Rg(vt.type,vt.key,vt.props,null,gt.mode,bt),bt.ref=Lg(gt,xt,vt),bt.return=gt,gt=bt)}return it(gt);case wa:e:{for(wt=vt.key;xt!==null;){if(xt.key===wt)if(xt.tag===4&&xt.stateNode.containerInfo===vt.containerInfo&&xt.stateNode.implementation===vt.implementation){tt(gt,xt.sibling),xt=rt(xt,vt.children||[]),xt.return=gt,gt=xt;break e}else{tt(gt,xt);break}else et(gt,xt);xt=xt.sibling}xt=Sg(vt,gt.mode,bt),xt.return=gt,gt=xt}return it(gt);case Ha:return wt=vt._init,yt(gt,xt,wt(vt._payload),bt)}if(eb(vt))return mt(gt,xt,vt,bt);if(Ka(vt))return ft(gt,xt,vt,bt);Mg(gt,vt)}return typeof vt=="string"&&vt!==""||typeof vt=="number"?(vt=""+vt,xt!==null&&xt.tag===6?(tt(gt,xt.sibling),xt=rt(xt,vt),xt.return=gt,gt=xt):(tt(gt,xt),xt=Qg(vt,gt.mode,bt),xt.return=gt,gt=xt),it(gt)):tt(gt,xt)}return yt}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(o){var et=Wg.current;E$1(Wg),o._currentValue=et}function bh(o,et,tt){for(;o!==null;){var nt=o.alternate;if((o.childLanes&et)!==et?(o.childLanes|=et,nt!==null&&(nt.childLanes|=et)):nt!==null&&(nt.childLanes&et)!==et&&(nt.childLanes|=et),o===tt)break;o=o.return}}function ch(o,et){Xg=o,Zg=Yg=null,o=o.dependencies,o!==null&&o.firstContext!==null&&(o.lanes&et&&(dh=!0),o.firstContext=null)}function eh(o){var et=o._currentValue;if(Zg!==o)if(o={context:o,memoizedValue:et,next:null},Yg===null){if(Xg===null)throw Error(p$4(308));Yg=o,Xg.dependencies={lanes:0,firstContext:o}}else Yg=Yg.next=o;return et}var fh=null;function gh(o){fh===null?fh=[o]:fh.push(o)}function hh(o,et,tt,nt){var rt=et.interleaved;return rt===null?(tt.next=tt,gh(et)):(tt.next=rt.next,rt.next=tt),et.interleaved=tt,ih(o,nt)}function ih(o,et){o.lanes|=et;var tt=o.alternate;for(tt!==null&&(tt.lanes|=et),tt=o,o=o.return;o!==null;)o.childLanes|=et,tt=o.alternate,tt!==null&&(tt.childLanes|=et),tt=o,o=o.return;return tt.tag===3?tt.stateNode:null}var jh=!1;function kh(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(o,et){o=o.updateQueue,et.updateQueue===o&&(et.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function mh(o,et){return{eventTime:o,lane:et,tag:0,payload:null,callback:null,next:null}}function nh(o,et,tt){var nt=o.updateQueue;if(nt===null)return null;if(nt=nt.shared,K$1&2){var rt=nt.pending;return rt===null?et.next=et:(et.next=rt.next,rt.next=et),nt.pending=et,ih(o,tt)}return rt=nt.interleaved,rt===null?(et.next=et,gh(nt)):(et.next=rt.next,rt.next=et),nt.interleaved=et,ih(o,tt)}function oh(o,et,tt){if(et=et.updateQueue,et!==null&&(et=et.shared,(tt&4194240)!==0)){var nt=et.lanes;nt&=o.pendingLanes,tt|=nt,et.lanes=tt,Cc(o,tt)}}function ph(o,et){var tt=o.updateQueue,nt=o.alternate;if(nt!==null&&(nt=nt.updateQueue,tt===nt)){var rt=null,ot=null;if(tt=tt.firstBaseUpdate,tt!==null){do{var it={eventTime:tt.eventTime,lane:tt.lane,tag:tt.tag,payload:tt.payload,callback:tt.callback,next:null};ot===null?rt=ot=it:ot=ot.next=it,tt=tt.next}while(tt!==null);ot===null?rt=ot=et:ot=ot.next=et}else rt=ot=et;tt={baseState:nt.baseState,firstBaseUpdate:rt,lastBaseUpdate:ot,shared:nt.shared,effects:nt.effects},o.updateQueue=tt;return}o=tt.lastBaseUpdate,o===null?tt.firstBaseUpdate=et:o.next=et,tt.lastBaseUpdate=et}function qh(o,et,tt,nt){var rt=o.updateQueue;jh=!1;var ot=rt.firstBaseUpdate,it=rt.lastBaseUpdate,st=rt.shared.pending;if(st!==null){rt.shared.pending=null;var at=st,ct=at.next;at.next=null,it===null?ot=ct:it.next=ct,it=at;var lt=o.alternate;lt!==null&&(lt=lt.updateQueue,st=lt.lastBaseUpdate,st!==it&&(st===null?lt.firstBaseUpdate=ct:st.next=ct,lt.lastBaseUpdate=at))}if(ot!==null){var dt=rt.baseState;it=0,lt=ct=at=null,st=ot;do{var ht=st.lane,pt=st.eventTime;if((nt&ht)===ht){lt!==null&&(lt=lt.next={eventTime:pt,lane:0,tag:st.tag,payload:st.payload,callback:st.callback,next:null});e:{var mt=o,ft=st;switch(ht=et,pt=tt,ft.tag){case 1:if(mt=ft.payload,typeof mt=="function"){dt=mt.call(pt,dt,ht);break e}dt=mt;break e;case 3:mt.flags=mt.flags&-65537|128;case 0:if(mt=ft.payload,ht=typeof mt=="function"?mt.call(pt,dt,ht):mt,ht==null)break e;dt=A$1({},dt,ht);break e;case 2:jh=!0}}st.callback!==null&&st.lane!==0&&(o.flags|=64,ht=rt.effects,ht===null?rt.effects=[st]:ht.push(st))}else pt={eventTime:pt,lane:ht,tag:st.tag,payload:st.payload,callback:st.callback,next:null},lt===null?(ct=lt=pt,at=dt):lt=lt.next=pt,it|=ht;if(st=st.next,st===null){if(st=rt.shared.pending,st===null)break;ht=st,st=ht.next,ht.next=null,rt.lastBaseUpdate=ht,rt.shared.pending=null}}while(!0);if(lt===null&&(at=dt),rt.baseState=at,rt.firstBaseUpdate=ct,rt.lastBaseUpdate=lt,et=rt.shared.interleaved,et!==null){rt=et;do it|=rt.lane,rt=rt.next;while(rt!==et)}else ot===null&&(rt.shared.lanes=0);rh|=it,o.lanes=it,o.memoizedState=dt}}function sh(o,et,tt){if(o=et.effects,et.effects=null,o!==null)for(et=0;ettt?tt:4,o(!0);var nt=Gh.transition;Gh.transition={};try{o(!1),et()}finally{C$1=tt,Gh.transition=nt}}function wi(){return Uh().memoizedState}function xi(o,et,tt){var nt=yi(o);if(tt={lane:nt,action:tt,hasEagerState:!1,eagerState:null,next:null},zi(o))Ai(et,tt);else if(tt=hh(o,et,tt,nt),tt!==null){var rt=R();gi(tt,o,nt,rt),Bi(tt,et,nt)}}function ii(o,et,tt){var nt=yi(o),rt={lane:nt,action:tt,hasEagerState:!1,eagerState:null,next:null};if(zi(o))Ai(et,rt);else{var ot=o.alternate;if(o.lanes===0&&(ot===null||ot.lanes===0)&&(ot=et.lastRenderedReducer,ot!==null))try{var it=et.lastRenderedState,st=ot(it,tt);if(rt.hasEagerState=!0,rt.eagerState=st,He(st,it)){var at=et.interleaved;at===null?(rt.next=rt,gh(et)):(rt.next=at.next,at.next=rt),et.interleaved=rt;return}}catch{}finally{}tt=hh(o,et,rt,nt),tt!==null&&(rt=R(),gi(tt,o,nt,rt),Bi(tt,et,nt))}}function zi(o){var et=o.alternate;return o===M$1||et!==null&&et===M$1}function Ai(o,et){Jh=Ih=!0;var tt=o.pending;tt===null?et.next=et:(et.next=tt.next,tt.next=et),o.pending=et}function Bi(o,et,tt){if(tt&4194240){var nt=et.lanes;nt&=o.pendingLanes,tt|=nt,et.lanes=tt,Cc(o,tt)}}var Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(o,et){return Th().memoizedState=[o,et===void 0?null:et],o},useContext:eh,useEffect:mi,useImperativeHandle:function(o,et,tt){return tt=tt!=null?tt.concat([o]):null,ki(4194308,4,pi.bind(null,et,o),tt)},useLayoutEffect:function(o,et){return ki(4194308,4,o,et)},useInsertionEffect:function(o,et){return ki(4,2,o,et)},useMemo:function(o,et){var tt=Th();return et=et===void 0?null:et,o=o(),tt.memoizedState=[o,et],o},useReducer:function(o,et,tt){var nt=Th();return et=tt!==void 0?tt(et):et,nt.memoizedState=nt.baseState=et,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:et},nt.queue=o,o=o.dispatch=xi.bind(null,M$1,o),[nt.memoizedState,o]},useRef:function(o){var et=Th();return o={current:o},et.memoizedState=o},useState:hi,useDebugValue:ri,useDeferredValue:function(o){return Th().memoizedState=o},useTransition:function(){var o=hi(!1),et=o[0];return o=vi.bind(null,o[1]),Th().memoizedState=o,[et,o]},useMutableSource:function(){},useSyncExternalStore:function(o,et,tt){var nt=M$1,rt=Th();if(I$1){if(tt===void 0)throw Error(p$4(407));tt=tt()}else{if(tt=et(),Q$1===null)throw Error(p$4(349));Hh&30||di(nt,et,tt)}rt.memoizedState=tt;var ot={value:tt,getSnapshot:et};return rt.queue=ot,mi(ai.bind(null,nt,ot,o),[o]),nt.flags|=2048,bi(9,ci.bind(null,nt,ot,tt,et),void 0,null),tt},useId:function(){var o=Th(),et=Q$1.identifierPrefix;if(I$1){var tt=sg,nt=rg;tt=(nt&~(1<<32-oc(nt)-1)).toString(32)+tt,et=":"+et+"R"+tt,tt=Kh++,0<\/script>",o=o.removeChild(o.firstChild)):typeof nt.is=="string"?o=it.createElement(tt,{is:nt.is}):(o=it.createElement(tt),tt==="select"&&(it=o,nt.multiple?it.multiple=!0:nt.size&&(it.size=nt.size))):o=it.createElementNS(o,tt),o[Of]=et,o[Pf]=nt,zj(o,et,!1,!1),et.stateNode=o;e:{switch(it=vb(tt,nt),tt){case"dialog":D$1("cancel",o),D$1("close",o),rt=nt;break;case"iframe":case"object":case"embed":D$1("load",o),rt=nt;break;case"video":case"audio":for(rt=0;rtGj&&(et.flags|=128,nt=!0,Dj(ot,!1),et.lanes=4194304)}else{if(!nt)if(o=Ch(it),o!==null){if(et.flags|=128,nt=!0,tt=o.updateQueue,tt!==null&&(et.updateQueue=tt,et.flags|=4),Dj(ot,!0),ot.tail===null&&ot.tailMode==="hidden"&&!it.alternate&&!I$1)return S$1(et),null}else 2*B$1()-ot.renderingStartTime>Gj&&tt!==1073741824&&(et.flags|=128,nt=!0,Dj(ot,!1),et.lanes=4194304);ot.isBackwards?(it.sibling=et.child,et.child=it):(tt=ot.last,tt!==null?tt.sibling=it:et.child=it,ot.last=it)}return ot.tail!==null?(et=ot.tail,ot.rendering=et,ot.tail=et.sibling,ot.renderingStartTime=B$1(),et.sibling=null,tt=L$1.current,G$1(L$1,nt?tt&1|2:tt&1),et):(S$1(et),null);case 22:case 23:return Hj(),nt=et.memoizedState!==null,o!==null&&o.memoizedState!==null!==nt&&(et.flags|=8192),nt&&et.mode&1?fj&1073741824&&(S$1(et),et.subtreeFlags&6&&(et.flags|=8192)):S$1(et),null;case 24:return null;case 25:return null}throw Error(p$4(156,et.tag))}function Ij(o,et){switch(wg(et),et.tag){case 1:return Zf(et.type)&&$f(),o=et.flags,o&65536?(et.flags=o&-65537|128,et):null;case 3:return zh(),E$1(Wf),E$1(H$1),Eh(),o=et.flags,o&65536&&!(o&128)?(et.flags=o&-65537|128,et):null;case 5:return Bh(et),null;case 13:if(E$1(L$1),o=et.memoizedState,o!==null&&o.dehydrated!==null){if(et.alternate===null)throw Error(p$4(340));Ig()}return o=et.flags,o&65536?(et.flags=o&-65537|128,et):null;case 19:return E$1(L$1),null;case 4:return zh(),null;case 10:return ah(et.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U$1=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V$2=null;function Lj(o,et){var tt=o.ref;if(tt!==null)if(typeof tt=="function")try{tt(null)}catch(nt){W$1(o,et,nt)}else tt.current=null}function Mj(o,et,tt){try{tt()}catch(nt){W$1(o,et,nt)}}var Nj=!1;function Oj(o,et){if(Cf=dd,o=Me$1(),Ne$1(o)){if("selectionStart"in o)var tt={start:o.selectionStart,end:o.selectionEnd};else e:{tt=(tt=o.ownerDocument)&&tt.defaultView||window;var nt=tt.getSelection&&tt.getSelection();if(nt&&nt.rangeCount!==0){tt=nt.anchorNode;var rt=nt.anchorOffset,ot=nt.focusNode;nt=nt.focusOffset;try{tt.nodeType,ot.nodeType}catch{tt=null;break e}var it=0,st=-1,at=-1,ct=0,lt=0,dt=o,ht=null;t:for(;;){for(var pt;dt!==tt||rt!==0&&dt.nodeType!==3||(st=it+rt),dt!==ot||nt!==0&&dt.nodeType!==3||(at=it+nt),dt.nodeType===3&&(it+=dt.nodeValue.length),(pt=dt.firstChild)!==null;)ht=dt,dt=pt;for(;;){if(dt===o)break t;if(ht===tt&&++ct===rt&&(st=it),ht===ot&&++lt===nt&&(at=it),(pt=dt.nextSibling)!==null)break;dt=ht,ht=dt.parentNode}dt=pt}tt=st===-1||at===-1?null:{start:st,end:at}}else tt=null}tt=tt||{start:0,end:0}}else tt=null;for(Df={focusedElem:o,selectionRange:tt},dd=!1,V$2=et;V$2!==null;)if(et=V$2,o=et.child,(et.subtreeFlags&1028)!==0&&o!==null)o.return=et,V$2=o;else for(;V$2!==null;){et=V$2;try{var mt=et.alternate;if(et.flags&1024)switch(et.tag){case 0:case 11:case 15:break;case 1:if(mt!==null){var ft=mt.memoizedProps,yt=mt.memoizedState,gt=et.stateNode,xt=gt.getSnapshotBeforeUpdate(et.elementType===et.type?ft:Ci(et.type,ft),yt);gt.__reactInternalSnapshotBeforeUpdate=xt}break;case 3:var vt=et.stateNode.containerInfo;vt.nodeType===1?vt.textContent="":vt.nodeType===9&&vt.documentElement&&vt.removeChild(vt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$4(163))}}catch(bt){W$1(et,et.return,bt)}if(o=et.sibling,o!==null){o.return=et.return,V$2=o;break}V$2=et.return}return mt=Nj,Nj=!1,mt}function Pj(o,et,tt){var nt=et.updateQueue;if(nt=nt!==null?nt.lastEffect:null,nt!==null){var rt=nt=nt.next;do{if((rt.tag&o)===o){var ot=rt.destroy;rt.destroy=void 0,ot!==void 0&&Mj(et,tt,ot)}rt=rt.next}while(rt!==nt)}}function Qj(o,et){if(et=et.updateQueue,et=et!==null?et.lastEffect:null,et!==null){var tt=et=et.next;do{if((tt.tag&o)===o){var nt=tt.create;tt.destroy=nt()}tt=tt.next}while(tt!==et)}}function Rj(o){var et=o.ref;if(et!==null){var tt=o.stateNode;switch(o.tag){case 5:o=tt;break;default:o=tt}typeof et=="function"?et(o):et.current=o}}function Sj(o){var et=o.alternate;et!==null&&(o.alternate=null,Sj(et)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(et=o.stateNode,et!==null&&(delete et[Of],delete et[Pf],delete et[of],delete et[Qf],delete et[Rf])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Tj(o){return o.tag===5||o.tag===3||o.tag===4}function Uj(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Tj(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Vj(o,et,tt){var nt=o.tag;if(nt===5||nt===6)o=o.stateNode,et?tt.nodeType===8?tt.parentNode.insertBefore(o,et):tt.insertBefore(o,et):(tt.nodeType===8?(et=tt.parentNode,et.insertBefore(o,tt)):(et=tt,et.appendChild(o)),tt=tt._reactRootContainer,tt!=null||et.onclick!==null||(et.onclick=Bf));else if(nt!==4&&(o=o.child,o!==null))for(Vj(o,et,tt),o=o.sibling;o!==null;)Vj(o,et,tt),o=o.sibling}function Wj(o,et,tt){var nt=o.tag;if(nt===5||nt===6)o=o.stateNode,et?tt.insertBefore(o,et):tt.appendChild(o);else if(nt!==4&&(o=o.child,o!==null))for(Wj(o,et,tt),o=o.sibling;o!==null;)Wj(o,et,tt),o=o.sibling}var X$1=null,Xj=!1;function Yj(o,et,tt){for(tt=tt.child;tt!==null;)Zj(o,et,tt),tt=tt.sibling}function Zj(o,et,tt){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,tt)}catch{}switch(tt.tag){case 5:U$1||Lj(tt,et);case 6:var nt=X$1,rt=Xj;X$1=null,Yj(o,et,tt),X$1=nt,Xj=rt,X$1!==null&&(Xj?(o=X$1,tt=tt.stateNode,o.nodeType===8?o.parentNode.removeChild(tt):o.removeChild(tt)):X$1.removeChild(tt.stateNode));break;case 18:X$1!==null&&(Xj?(o=X$1,tt=tt.stateNode,o.nodeType===8?Kf(o.parentNode,tt):o.nodeType===1&&Kf(o,tt),bd(o)):Kf(X$1,tt.stateNode));break;case 4:nt=X$1,rt=Xj,X$1=tt.stateNode.containerInfo,Xj=!0,Yj(o,et,tt),X$1=nt,Xj=rt;break;case 0:case 11:case 14:case 15:if(!U$1&&(nt=tt.updateQueue,nt!==null&&(nt=nt.lastEffect,nt!==null))){rt=nt=nt.next;do{var ot=rt,it=ot.destroy;ot=ot.tag,it!==void 0&&(ot&2||ot&4)&&Mj(tt,et,it),rt=rt.next}while(rt!==nt)}Yj(o,et,tt);break;case 1:if(!U$1&&(Lj(tt,et),nt=tt.stateNode,typeof nt.componentWillUnmount=="function"))try{nt.props=tt.memoizedProps,nt.state=tt.memoizedState,nt.componentWillUnmount()}catch(st){W$1(tt,et,st)}Yj(o,et,tt);break;case 21:Yj(o,et,tt);break;case 22:tt.mode&1?(U$1=(nt=U$1)||tt.memoizedState!==null,Yj(o,et,tt),U$1=nt):Yj(o,et,tt);break;default:Yj(o,et,tt)}}function ak(o){var et=o.updateQueue;if(et!==null){o.updateQueue=null;var tt=o.stateNode;tt===null&&(tt=o.stateNode=new Kj),et.forEach(function(nt){var rt=bk.bind(null,o,nt);tt.has(nt)||(tt.add(nt),nt.then(rt,rt))})}}function ck(o,et){var tt=et.deletions;if(tt!==null)for(var nt=0;ntrt&&(rt=it),nt&=~ot}if(nt=rt,nt=B$1()-nt,nt=(120>nt?120:480>nt?480:1080>nt?1080:1920>nt?1920:3e3>nt?3e3:4320>nt?4320:1960*lk(nt/1960))-nt,10o?16:o,wk===null)var nt=!1;else{if(o=wk,wk=null,xk=0,K$1&6)throw Error(p$4(331));var rt=K$1;for(K$1|=4,V$2=o.current;V$2!==null;){var ot=V$2,it=ot.child;if(V$2.flags&16){var st=ot.deletions;if(st!==null){for(var at=0;atB$1()-fk?Kk(o,0):rk|=tt),Dk(o,et)}function Yk(o,et){et===0&&(o.mode&1?(et=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):et=1);var tt=R();o=ih(o,et),o!==null&&(Ac(o,et,tt),Dk(o,tt))}function uj(o){var et=o.memoizedState,tt=0;et!==null&&(tt=et.retryLane),Yk(o,tt)}function bk(o,et){var tt=0;switch(o.tag){case 13:var nt=o.stateNode,rt=o.memoizedState;rt!==null&&(tt=rt.retryLane);break;case 19:nt=o.stateNode;break;default:throw Error(p$4(314))}nt!==null&&nt.delete(et),Yk(o,tt)}var Vk;Vk=function(o,et,tt){if(o!==null)if(o.memoizedProps!==et.pendingProps||Wf.current)dh=!0;else{if(!(o.lanes&tt)&&!(et.flags&128))return dh=!1,yj(o,et,tt);dh=!!(o.flags&131072)}else dh=!1,I$1&&et.flags&1048576&&ug(et,ng,et.index);switch(et.lanes=0,et.tag){case 2:var nt=et.type;ij(o,et),o=et.pendingProps;var rt=Yf(et,H$1.current);ch(et,tt),rt=Nh(null,et,nt,o,rt,tt);var ot=Sh();return et.flags|=1,typeof rt=="object"&&rt!==null&&typeof rt.render=="function"&&rt.$$typeof===void 0?(et.tag=1,et.memoizedState=null,et.updateQueue=null,Zf(nt)?(ot=!0,cg(et)):ot=!1,et.memoizedState=rt.state!==null&&rt.state!==void 0?rt.state:null,kh(et),rt.updater=Ei,et.stateNode=rt,rt._reactInternals=et,Ii(et,nt,o,tt),et=jj(null,et,nt,!0,ot,tt)):(et.tag=0,I$1&&ot&&vg(et),Xi(null,et,rt,tt),et=et.child),et;case 16:nt=et.elementType;e:{switch(ij(o,et),o=et.pendingProps,rt=nt._init,nt=rt(nt._payload),et.type=nt,rt=et.tag=Zk(nt),o=Ci(nt,o),rt){case 0:et=cj(null,et,nt,o,tt);break e;case 1:et=hj(null,et,nt,o,tt);break e;case 11:et=Yi(null,et,nt,o,tt);break e;case 14:et=$i(null,et,nt,Ci(nt.type,o),tt);break e}throw Error(p$4(306,nt,""))}return et;case 0:return nt=et.type,rt=et.pendingProps,rt=et.elementType===nt?rt:Ci(nt,rt),cj(o,et,nt,rt,tt);case 1:return nt=et.type,rt=et.pendingProps,rt=et.elementType===nt?rt:Ci(nt,rt),hj(o,et,nt,rt,tt);case 3:e:{if(kj(et),o===null)throw Error(p$4(387));nt=et.pendingProps,ot=et.memoizedState,rt=ot.element,lh(o,et),qh(et,nt,null,tt);var it=et.memoizedState;if(nt=it.element,ot.isDehydrated)if(ot={element:nt,isDehydrated:!1,cache:it.cache,pendingSuspenseBoundaries:it.pendingSuspenseBoundaries,transitions:it.transitions},et.updateQueue.baseState=ot,et.memoizedState=ot,et.flags&256){rt=Ji(Error(p$4(423)),et),et=lj(o,et,nt,tt,rt);break e}else if(nt!==rt){rt=Ji(Error(p$4(424)),et),et=lj(o,et,nt,tt,rt);break e}else for(yg=Lf(et.stateNode.containerInfo.firstChild),xg=et,I$1=!0,zg=null,tt=Vg(et,null,nt,tt),et.child=tt;tt;)tt.flags=tt.flags&-3|4096,tt=tt.sibling;else{if(Ig(),nt===rt){et=Zi(o,et,tt);break e}Xi(o,et,nt,tt)}et=et.child}return et;case 5:return Ah(et),o===null&&Eg(et),nt=et.type,rt=et.pendingProps,ot=o!==null?o.memoizedProps:null,it=rt.children,Ef(nt,rt)?it=null:ot!==null&&Ef(nt,ot)&&(et.flags|=32),gj(o,et),Xi(o,et,it,tt),et.child;case 6:return o===null&&Eg(et),null;case 13:return oj(o,et,tt);case 4:return yh(et,et.stateNode.containerInfo),nt=et.pendingProps,o===null?et.child=Ug(et,null,nt,tt):Xi(o,et,nt,tt),et.child;case 11:return nt=et.type,rt=et.pendingProps,rt=et.elementType===nt?rt:Ci(nt,rt),Yi(o,et,nt,rt,tt);case 7:return Xi(o,et,et.pendingProps,tt),et.child;case 8:return Xi(o,et,et.pendingProps.children,tt),et.child;case 12:return Xi(o,et,et.pendingProps.children,tt),et.child;case 10:e:{if(nt=et.type._context,rt=et.pendingProps,ot=et.memoizedProps,it=rt.value,G$1(Wg,nt._currentValue),nt._currentValue=it,ot!==null)if(He(ot.value,it)){if(ot.children===rt.children&&!Wf.current){et=Zi(o,et,tt);break e}}else for(ot=et.child,ot!==null&&(ot.return=et);ot!==null;){var st=ot.dependencies;if(st!==null){it=ot.child;for(var at=st.firstContext;at!==null;){if(at.context===nt){if(ot.tag===1){at=mh(-1,tt&-tt),at.tag=2;var ct=ot.updateQueue;if(ct!==null){ct=ct.shared;var lt=ct.pending;lt===null?at.next=at:(at.next=lt.next,lt.next=at),ct.pending=at}}ot.lanes|=tt,at=ot.alternate,at!==null&&(at.lanes|=tt),bh(ot.return,tt,et),st.lanes|=tt;break}at=at.next}}else if(ot.tag===10)it=ot.type===et.type?null:ot.child;else if(ot.tag===18){if(it=ot.return,it===null)throw Error(p$4(341));it.lanes|=tt,st=it.alternate,st!==null&&(st.lanes|=tt),bh(it,tt,et),it=ot.sibling}else it=ot.child;if(it!==null)it.return=ot;else for(it=ot;it!==null;){if(it===et){it=null;break}if(ot=it.sibling,ot!==null){ot.return=it.return,it=ot;break}it=it.return}ot=it}Xi(o,et,rt.children,tt),et=et.child}return et;case 9:return rt=et.type,nt=et.pendingProps.children,ch(et,tt),rt=eh(rt),nt=nt(rt),et.flags|=1,Xi(o,et,nt,tt),et.child;case 14:return nt=et.type,rt=Ci(nt,et.pendingProps),rt=Ci(nt.type,rt),$i(o,et,nt,rt,tt);case 15:return bj(o,et,et.type,et.pendingProps,tt);case 17:return nt=et.type,rt=et.pendingProps,rt=et.elementType===nt?rt:Ci(nt,rt),ij(o,et),et.tag=1,Zf(nt)?(o=!0,cg(et)):o=!1,ch(et,tt),Gi(et,nt,rt),Ii(et,nt,rt,tt),jj(null,et,nt,!0,o,tt);case 19:return xj(o,et,tt);case 22:return dj(o,et,tt)}throw Error(p$4(156,et.tag))};function Fk(o,et){return ac(o,et)}function $k(o,et,tt,nt){this.tag=o,this.key=tt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=et,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=nt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(o,et,tt,nt){return new $k(o,et,tt,nt)}function aj(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Zk(o){if(typeof o=="function")return aj(o)?1:0;if(o!=null){if(o=o.$$typeof,o===Da)return 11;if(o===Ga)return 14}return 2}function Pg(o,et){var tt=o.alternate;return tt===null?(tt=Bg(o.tag,et,o.key,o.mode),tt.elementType=o.elementType,tt.type=o.type,tt.stateNode=o.stateNode,tt.alternate=o,o.alternate=tt):(tt.pendingProps=et,tt.type=o.type,tt.flags=0,tt.subtreeFlags=0,tt.deletions=null),tt.flags=o.flags&14680064,tt.childLanes=o.childLanes,tt.lanes=o.lanes,tt.child=o.child,tt.memoizedProps=o.memoizedProps,tt.memoizedState=o.memoizedState,tt.updateQueue=o.updateQueue,et=o.dependencies,tt.dependencies=et===null?null:{lanes:et.lanes,firstContext:et.firstContext},tt.sibling=o.sibling,tt.index=o.index,tt.ref=o.ref,tt}function Rg(o,et,tt,nt,rt,ot){var it=2;if(nt=o,typeof o=="function")aj(o)&&(it=1);else if(typeof o=="string")it=5;else e:switch(o){case ya:return Tg(tt.children,rt,ot,et);case za:it=8,rt|=8;break;case Aa:return o=Bg(12,tt,et,rt|2),o.elementType=Aa,o.lanes=ot,o;case Ea:return o=Bg(13,tt,et,rt),o.elementType=Ea,o.lanes=ot,o;case Fa:return o=Bg(19,tt,et,rt),o.elementType=Fa,o.lanes=ot,o;case Ia:return pj(tt,rt,ot,et);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case Ba:it=10;break e;case Ca:it=9;break e;case Da:it=11;break e;case Ga:it=14;break e;case Ha:it=16,nt=null;break e}throw Error(p$4(130,o==null?o:typeof o,""))}return et=Bg(it,tt,et,rt),et.elementType=o,et.type=nt,et.lanes=ot,et}function Tg(o,et,tt,nt){return o=Bg(7,o,nt,et),o.lanes=tt,o}function pj(o,et,tt,nt){return o=Bg(22,o,nt,et),o.elementType=Ia,o.lanes=tt,o.stateNode={isHidden:!1},o}function Qg(o,et,tt){return o=Bg(6,o,null,et),o.lanes=tt,o}function Sg(o,et,tt){return et=Bg(4,o.children!==null?o.children:[],o.key,et),et.lanes=tt,et.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},et}function al(o,et,tt,nt,rt){this.tag=et,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=nt,this.onRecoverableError=rt,this.mutableSourceEagerHydrationData=null}function bl(o,et,tt,nt,rt,ot,it,st,at){return o=new al(o,et,tt,st,at),et===1?(et=1,ot===!0&&(et|=8)):et=0,ot=Bg(3,null,null,et),o.current=ot,ot.stateNode=o,ot.memoizedState={element:nt,isDehydrated:tt,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(ot),o}function cl(o,et,tt){var nt=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(o){console.error(o)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs(reactDomExports);var createRoot,m$5=reactDomExports;createRoot=m$5.createRoot,m$5.hydrateRoot;const version$8="2.21.44";let errorConfig={getDocsUrl:({docsBaseUrl:o,docsPath:et="",docsSlug:tt})=>et?`${o??"https://viem.sh"}${et}${tt?`#${tt}`:""}`:void 0,version:`viem@${version$8}`},BaseError$3=class Ss extends Error{constructor(et,tt={}){var st;const nt=(()=>{var at;return tt.cause instanceof Ss?tt.cause.details:(at=tt.cause)!=null&&at.message?tt.cause.message:tt.details})(),rt=tt.cause instanceof Ss&&tt.cause.docsPath||tt.docsPath,ot=(st=errorConfig.getDocsUrl)==null?void 0:st.call(errorConfig,{...tt,docsPath:rt}),it=[et||"An error occurred.","",...tt.metaMessages?[...tt.metaMessages,""]:[],...ot?[`Docs: ${ot}`]:[],...nt?[`Details: ${nt}`]:[],...errorConfig.version?[`Version: ${errorConfig.version}`]:[]].join(` +`);super(it,tt.cause?{cause:tt.cause}:void 0),Object.defineProperty(this,"details",{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,"metaMessages",{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,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=nt,this.docsPath=rt,this.metaMessages=tt.metaMessages,this.name=tt.name??this.name,this.shortMessage=et,this.version=version$8}walk(et){return walk(this,et)}};function walk(o,et){return et!=null&&et(o)?o:o&&typeof o=="object"&&"cause"in o&&o.cause!==void 0?walk(o.cause,et):et?null:o}class IntegerOutOfRangeError extends BaseError$3{constructor({max:et,min:tt,signed:nt,size:rt,value:ot}){super(`Number "${ot}" is not in safe ${rt?`${rt*8}-bit ${nt?"signed":"unsigned"} `:""}integer range ${et?`(${tt} to ${et})`:`(above ${tt})`}`,{name:"IntegerOutOfRangeError"})}}class InvalidBytesBooleanError extends BaseError$3{constructor(et){super(`Bytes value "${et}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class SizeOverflowError extends BaseError$3{constructor({givenSize:et,maxSize:tt}){super(`Size cannot exceed ${tt} bytes. Given size: ${et} bytes.`,{name:"SizeOverflowError"})}}class SliceOffsetOutOfBoundsError extends BaseError$3{constructor({offset:et,position:tt,size:nt}){super(`Slice ${tt==="start"?"starting":"ending"} at offset "${et}" is out-of-bounds (size: ${nt}).`,{name:"SliceOffsetOutOfBoundsError"})}}class SizeExceedsPaddingSizeError extends BaseError$3{constructor({size:et,targetSize:tt,type:nt}){super(`${nt.charAt(0).toUpperCase()}${nt.slice(1).toLowerCase()} size (${et}) exceeds padding size (${tt}).`,{name:"SizeExceedsPaddingSizeError"})}}class InvalidBytesLengthError extends BaseError$3{constructor({size:et,targetSize:tt,type:nt}){super(`${nt.charAt(0).toUpperCase()}${nt.slice(1).toLowerCase()} is expected to be ${tt} ${nt} long, but is ${et} ${nt} long.`,{name:"InvalidBytesLengthError"})}}function pad(o,{dir:et,size:tt=32}={}){return typeof o=="string"?padHex(o,{dir:et,size:tt}):padBytes(o,{dir:et,size:tt})}function padHex(o,{dir:et,size:tt=32}={}){if(tt===null)return o;const nt=o.replace("0x","");if(nt.length>tt*2)throw new SizeExceedsPaddingSizeError({size:Math.ceil(nt.length/2),targetSize:tt,type:"hex"});return`0x${nt[et==="right"?"padEnd":"padStart"](tt*2,"0")}`}function padBytes(o,{dir:et,size:tt=32}={}){if(tt===null)return o;if(o.length>tt)throw new SizeExceedsPaddingSizeError({size:o.length,targetSize:tt,type:"bytes"});const nt=new Uint8Array(tt);for(let rt=0;rt=charCodeMap.zero&&o<=charCodeMap.nine)return o-charCodeMap.zero;if(o>=charCodeMap.A&&o<=charCodeMap.F)return o-(charCodeMap.A-10);if(o>=charCodeMap.a&&o<=charCodeMap.f)return o-(charCodeMap.a-10)}function hexToBytes$3(o,et={}){let tt=o;et.size&&(assertSize(tt,{size:et.size}),tt=pad(tt,{dir:"right",size:et.size}));let nt=tt.slice(2);nt.length%2&&(nt=`0${nt}`);const rt=nt.length/2,ot=new Uint8Array(rt);for(let it=0,st=0;itet)throw new SizeOverflowError({givenSize:size$2(o),maxSize:et})}function hexToBigInt(o,et={}){const{signed:tt}=et;et.size&&assertSize(o,{size:et.size});const nt=BigInt(o);if(!tt)return nt;const rt=(o.length-2)/2,ot=(1n<et.toString(16).padStart(2,"0"));function toHex(o,et={}){return typeof o=="number"||typeof o=="bigint"?numberToHex(o,et):typeof o=="string"?stringToHex(o,et):typeof o=="boolean"?boolToHex(o,et):bytesToHex$4(o,et)}function boolToHex(o,et={}){const tt=`0x${Number(o)}`;return typeof et.size=="number"?(assertSize(tt,{size:et.size}),pad(tt,{size:et.size})):tt}function bytesToHex$4(o,et={}){let tt="";for(let rt=0;rtot||rtformatAbiParam(tt,{includeName:et})).join(et?", ":","):""}function formatAbiParam(o,{includeName:et}){return o.type.startsWith("tuple")?`(${formatAbiParams(o.components,{includeName:et})})${o.type.slice(5)}`:o.type+(et&&o.name?` ${o.name}`:"")}class AbiConstructorNotFoundError extends BaseError$3{constructor({docsPath:et}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` +`),{docsPath:et,name:"AbiConstructorNotFoundError"})}}class AbiConstructorParamsNotFoundError extends BaseError$3{constructor({docsPath:et}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` +`),{docsPath:et,name:"AbiConstructorParamsNotFoundError"})}}class AbiDecodingDataSizeTooSmallError extends BaseError$3{constructor({data:et,params:tt,size:nt}){super([`Data size of ${nt} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${formatAbiParams(tt,{includeName:!0})})`,`Data: ${et} (${nt} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=et,this.params=tt,this.size=nt}}class AbiDecodingZeroDataError extends BaseError$3{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class AbiEncodingArrayLengthMismatchError extends BaseError$3{constructor({expectedLength:et,givenLength:tt,type:nt}){super([`ABI encoding array length mismatch for type ${nt}.`,`Expected length: ${et}`,`Given length: ${tt}`].join(` +`),{name:"AbiEncodingArrayLengthMismatchError"})}}class AbiEncodingBytesSizeMismatchError extends BaseError$3{constructor({expectedSize:et,value:tt}){super(`Size of bytes "${tt}" (bytes${size$2(tt)}) does not match expected size (bytes${et}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class AbiEncodingLengthMismatchError extends BaseError$3{constructor({expectedLength:et,givenLength:tt}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${et}`,`Given length (values): ${tt}`].join(` +`),{name:"AbiEncodingLengthMismatchError"})}}class AbiErrorSignatureNotFoundError extends BaseError$3{constructor(et,{docsPath:tt}){super([`Encoded error signature "${et}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${et}.`].join(` +`),{docsPath:tt,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=et}}class AbiFunctionNotFoundError extends BaseError$3{constructor(et,{docsPath:tt}={}){super([`Function ${et?`"${et}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:tt,name:"AbiFunctionNotFoundError"})}}class AbiFunctionOutputsNotFoundError extends BaseError$3{constructor(et,{docsPath:tt}){super([`Function "${et}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:tt,name:"AbiFunctionOutputsNotFoundError"})}}class AbiItemAmbiguityError extends BaseError$3{constructor(et,tt){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${et.type}\` in \`${formatAbiItem$1(et.abiItem)}\`, and`,`\`${tt.type}\` in \`${formatAbiItem$1(tt.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class BytesSizeMismatchError extends BaseError$3{constructor({expectedSize:et,givenSize:tt}){super(`Expected bytes${et}, got bytes${tt}.`,{name:"BytesSizeMismatchError"})}}class InvalidAbiEncodingTypeError extends BaseError$3{constructor(et,{docsPath:tt}){super([`Type "${et}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:tt,name:"InvalidAbiEncodingType"})}}class InvalidAbiDecodingTypeError extends BaseError$3{constructor(et,{docsPath:tt}){super([`Type "${et}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:tt,name:"InvalidAbiDecodingType"})}}class InvalidArrayError extends BaseError$3{constructor(et){super([`Value "${et}" is not a valid array.`].join(` +`),{name:"InvalidArrayError"})}}class InvalidDefinitionTypeError extends BaseError$3{constructor(et){super([`"${et}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` +`),{name:"InvalidDefinitionTypeError"})}}function concat$3(o){return typeof o[0]=="string"?concatHex(o):concatBytes$3(o)}function concatBytes$3(o){let et=0;for(const rt of o)et+=rt.length;const tt=new Uint8Array(et);let nt=0;for(const rt of o)tt.set(rt,nt),nt+=rt.length;return tt}function concatHex(o){return`0x${o.reduce((et,tt)=>et+tt.replace("0x",""),"")}`}class InvalidAddressError extends BaseError$3{constructor({address:et}){super(`Address "${et}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class LruMap extends Map{constructor(et){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=et}get(et){const tt=super.get(et);return super.has(et)&&tt!==void 0&&(this.delete(et),super.set(et,tt)),tt}set(et,tt){if(super.set(et,tt),this.maxSize&&this.size>this.maxSize){const nt=this.keys().next().value;nt&&this.delete(nt)}return this}}function number$4(o){if(!Number.isSafeInteger(o)||o<0)throw new Error(`positive integer expected, not ${o}`)}function isBytes$3(o){return o instanceof Uint8Array||o!=null&&typeof o=="object"&&o.constructor.name==="Uint8Array"}function bytes$1(o,...et){if(!isBytes$3(o))throw new Error("Uint8Array expected");if(et.length>0&&!et.includes(o.length))throw new Error(`Uint8Array expected of length ${et}, not of length=${o.length}`)}function hash$1(o){if(typeof o!="function"||typeof o.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$4(o.outputLen),number$4(o.blockLen)}function exists$1(o,et=!0){if(o.destroyed)throw new Error("Hash instance has been destroyed");if(et&&o.finished)throw new Error("Hash#digest() has already been called")}function output$1(o,et){bytes$1(o);const tt=et.outputLen;if(o.length>_32n&U32_MASK64)}:{h:Number(o>>_32n&U32_MASK64)|0,l:Number(o&U32_MASK64)|0}}function split$1(o,et=!1){let tt=new Uint32Array(o.length),nt=new Uint32Array(o.length);for(let rt=0;rtBigInt(o>>>0)<<_32n|BigInt(et>>>0),shrSH=(o,et,tt)=>o>>>tt,shrSL=(o,et,tt)=>o<<32-tt|et>>>tt,rotrSH=(o,et,tt)=>o>>>tt|et<<32-tt,rotrSL=(o,et,tt)=>o<<32-tt|et>>>tt,rotrBH=(o,et,tt)=>o<<64-tt|et>>>tt-32,rotrBL=(o,et,tt)=>o>>>tt-32|et<<64-tt,rotr32H=(o,et)=>et,rotr32L=(o,et)=>o,rotlSH=(o,et,tt)=>o<>>32-tt,rotlSL=(o,et,tt)=>et<>>32-tt,rotlBH=(o,et,tt)=>et<>>64-tt,rotlBL=(o,et,tt)=>o<>>64-tt;function add(o,et,tt,nt){const rt=(et>>>0)+(nt>>>0);return{h:o+tt+(rt/2**32|0)|0,l:rt|0}}const add3L=(o,et,tt)=>(o>>>0)+(et>>>0)+(tt>>>0),add3H=(o,et,tt,nt)=>et+tt+nt+(o/2**32|0)|0,add4L=(o,et,tt,nt)=>(o>>>0)+(et>>>0)+(tt>>>0)+(nt>>>0),add4H=(o,et,tt,nt,rt)=>et+tt+nt+rt+(o/2**32|0)|0,add5L=(o,et,tt,nt,rt)=>(o>>>0)+(et>>>0)+(tt>>>0)+(nt>>>0)+(rt>>>0),add5H=(o,et,tt,nt,rt,ot)=>et+tt+nt+rt+ot+(o/2**32|0)|0,u64={fromBig,split:split$1,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH,rotlSL,rotlBH,rotlBL,add,add3L,add3H,add4L,add4H,add5H,add5L},crypto$2=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32$1=o=>new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)),createView$1=o=>new DataView(o.buffer,o.byteOffset,o.byteLength),rotr=(o,et)=>o<<32-et|o>>>et,isLE$1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,byteSwap=o=>o<<24&4278190080|o<<8&16711680|o>>>8&65280|o>>>24&255;function byteSwap32(o){for(let et=0;etet.toString(16).padStart(2,"0"));function bytesToHex$3(o){bytes$1(o);let et="";for(let tt=0;tto().update(toBytes$2(nt)).digest(),tt=o();return et.outputLen=tt.outputLen,et.blockLen=tt.blockLen,et.create=()=>o(),et}function wrapXOFConstructorWithOpts(o){const et=(nt,rt)=>o(rt).update(toBytes$2(nt)).digest(),tt=o({});return et.outputLen=tt.outputLen,et.blockLen=tt.blockLen,et.create=nt=>o(nt),et}function randomBytes$1(o=32){if(crypto$2&&typeof crypto$2.getRandomValues=="function")return crypto$2.getRandomValues(new Uint8Array(o));if(crypto$2&&typeof crypto$2.randomBytes=="function")return crypto$2.randomBytes(o);throw new Error("crypto.getRandomValues must be defined")}const SHA3_PI=[],SHA3_ROTL=[],_SHA3_IOTA=[],_0n$7=BigInt(0),_1n$9=BigInt(1),_2n$6=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let o=0,et=_1n$9,tt=1,nt=0;o<24;o++){[tt,nt]=[nt,(2*tt+3*nt)%5],SHA3_PI.push(2*(5*nt+tt)),SHA3_ROTL.push((o+1)*(o+2)/2%64);let rt=_0n$7;for(let ot=0;ot<7;ot++)et=(et<<_1n$9^(et>>_7n)*_0x71n)%_256n,et&_2n$6&&(rt^=_1n$9<<(_1n$9<tt>32?rotlBH(o,et,tt):rotlSH(o,et,tt),rotlL=(o,et,tt)=>tt>32?rotlBL(o,et,tt):rotlSL(o,et,tt);function keccakP(o,et=24){const tt=new Uint32Array(10);for(let nt=24-et;nt<24;nt++){for(let it=0;it<10;it++)tt[it]=o[it]^o[it+10]^o[it+20]^o[it+30]^o[it+40];for(let it=0;it<10;it+=2){const st=(it+8)%10,at=(it+2)%10,ct=tt[at],lt=tt[at+1],dt=rotlH(ct,lt,1)^tt[st],ht=rotlL(ct,lt,1)^tt[st+1];for(let pt=0;pt<50;pt+=10)o[it+pt]^=dt,o[it+pt+1]^=ht}let rt=o[2],ot=o[3];for(let it=0;it<24;it++){const st=SHA3_ROTL[it],at=rotlH(rt,ot,st),ct=rotlL(rt,ot,st),lt=SHA3_PI[it];rt=o[lt],ot=o[lt+1],o[lt]=at,o[lt+1]=ct}for(let it=0;it<50;it+=10){for(let st=0;st<10;st++)tt[st]=o[it+st];for(let st=0;st<10;st++)o[it+st]^=~tt[(st+2)%10]&tt[(st+4)%10]}o[0]^=SHA3_IOTA_H[nt],o[1]^=SHA3_IOTA_L[nt]}tt.fill(0)}class Keccak extends Hash{constructor(et,tt,nt,rt=!1,ot=24){if(super(),this.blockLen=et,this.suffix=tt,this.outputLen=nt,this.enableXOF=rt,this.rounds=ot,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number$4(nt),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32$1(this.state)}keccak(){isLE$1||byteSwap32(this.state32),keccakP(this.state32,this.rounds),isLE$1||byteSwap32(this.state32),this.posOut=0,this.pos=0}update(et){exists$1(this);const{blockLen:tt,state:nt}=this;et=toBytes$2(et);const rt=et.length;for(let ot=0;ot=nt&&this.keccak();const it=Math.min(nt-this.posOut,ot-rt);et.set(tt.subarray(this.posOut,this.posOut+it),rt),this.posOut+=it,rt+=it}return et}xofInto(et){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(et)}xof(et){return number$4(et),this.xofInto(new Uint8Array(et))}digestInto(et){if(output$1(et,this),this.finished)throw new Error("digest() was already called");return this.writeInto(et),this.destroy(),et}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(et){const{blockLen:tt,suffix:nt,outputLen:rt,rounds:ot,enableXOF:it}=this;return et||(et=new Keccak(tt,nt,rt,it,ot)),et.state32.set(this.state32),et.pos=this.pos,et.posOut=this.posOut,et.finished=this.finished,et.rounds=ot,et.suffix=nt,et.outputLen=rt,et.enableXOF=it,et.destroyed=this.destroyed,et}}const gen=(o,et,tt)=>wrapConstructor(()=>new Keccak(et,o,tt)),sha3_224=gen(6,144,224/8),sha3_256=gen(6,136,256/8),sha3_384=gen(6,104,384/8),sha3_512=gen(6,72,512/8),keccak_224=gen(1,144,224/8),keccak_256=gen(1,136,256/8),keccak_384=gen(1,104,384/8),keccak_512=gen(1,72,512/8),genShake=(o,et,tt)=>wrapXOFConstructorWithOpts((nt={})=>new Keccak(et,o,nt.dkLen===void 0?tt:nt.dkLen,!0)),shake128=genShake(31,168,128/8),shake256=genShake(31,136,256/8),sha3$2=Object.freeze(Object.defineProperty({__proto__:null,Keccak,keccakP,keccak_224,keccak_256,keccak_384,keccak_512,sha3_224,sha3_256,sha3_384,sha3_512,shake128,shake256},Symbol.toStringTag,{value:"Module"}));function keccak256$1(o,et){const tt=et||"hex",nt=keccak_256(isHex(o,{strict:!1})?toBytes$3(o):o);return tt==="bytes"?nt:toHex(nt)}const checksumAddressCache=new LruMap(8192);function checksumAddress(o,et){if(checksumAddressCache.has(`${o}.${et}`))return checksumAddressCache.get(`${o}.${et}`);const tt=et?`${et}${o.toLowerCase()}`:o.substring(2).toLowerCase(),nt=keccak256$1(stringToBytes(tt),"bytes"),rt=(et?tt.substring(`${et}0x`.length):tt).split("");for(let it=0;it<40;it+=2)nt[it>>1]>>4>=8&&rt[it]&&(rt[it]=rt[it].toUpperCase()),(nt[it>>1]&15)>=8&&rt[it+1]&&(rt[it+1]=rt[it+1].toUpperCase());const ot=`0x${rt.join("")}`;return checksumAddressCache.set(`${o}.${et}`,ot),ot}function getAddress(o,et){if(!isAddress(o,{strict:!1}))throw new InvalidAddressError({address:o});return checksumAddress(o,et)}const addressRegex=/^0x[a-fA-F0-9]{40}$/,isAddressCache=new LruMap(8192);function isAddress(o,et){const{strict:tt=!0}=et??{},nt=`${o}.${tt}`;if(isAddressCache.has(nt))return isAddressCache.get(nt);const rt=addressRegex.test(o)?o.toLowerCase()===o?!0:tt?checksumAddress(o)===o:!0:!1;return isAddressCache.set(nt,rt),rt}function slice(o,et,tt,{strict:nt}={}){return isHex(o,{strict:!1})?sliceHex(o,et,tt,{strict:nt}):sliceBytes(o,et,tt,{strict:nt})}function assertStartOffset(o,et){if(typeof et=="number"&&et>0&&et>size$2(o)-1)throw new SliceOffsetOutOfBoundsError({offset:et,position:"start",size:size$2(o)})}function assertEndOffset(o,et,tt){if(typeof et=="number"&&typeof tt=="number"&&size$2(o)!==tt-et)throw new SliceOffsetOutOfBoundsError({offset:tt,position:"end",size:size$2(o)})}function sliceBytes(o,et,tt,{strict:nt}={}){assertStartOffset(o,et);const rt=o.slice(et,tt);return nt&&assertEndOffset(rt,et,tt),rt}function sliceHex(o,et,tt,{strict:nt}={}){assertStartOffset(o,et);const rt=`0x${o.replace("0x","").slice((et??0)*2,(tt??o.length)*2)}`;return nt&&assertEndOffset(rt,et,tt),rt}function encodeAbiParameters(o,et){if(o.length!==et.length)throw new AbiEncodingLengthMismatchError({expectedLength:o.length,givenLength:et.length});const tt=prepareParams({params:o,values:et}),nt=encodeParams(tt);return nt.length===0?"0x":nt}function prepareParams({params:o,values:et}){const tt=[];for(let nt=0;nt0?concat$3([st,it]):st}}if(rt)return{dynamic:!0,encoded:it}}return{dynamic:!1,encoded:concat$3(ot.map(({encoded:it})=>it))}}function encodeBytes(o,{param:et}){const[,tt]=et.type.split("bytes"),nt=size$2(o);if(!tt){let rt=o;return nt%32!==0&&(rt=padHex(rt,{dir:"right",size:Math.ceil((o.length-2)/2/32)*32})),{dynamic:!0,encoded:concat$3([padHex(numberToHex(nt,{size:32})),rt])}}if(nt!==Number.parseInt(tt))throw new AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(tt),value:o});return{dynamic:!1,encoded:padHex(o,{dir:"right"})}}function encodeBool(o){if(typeof o!="boolean")throw new BaseError$3(`Invalid boolean value: "${o}" (type: ${typeof o}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:padHex(boolToHex(o))}}function encodeNumber(o,{signed:et}){return{dynamic:!1,encoded:numberToHex(o,{size:32,signed:et})}}function encodeString(o){const et=stringToHex(o),tt=Math.ceil(size$2(et)/32),nt=[];for(let rt=0;rtrt))}}function getArrayComponents(o){const et=o.match(/^(.*)\[(\d+)?\]$/);return et?[et[2]?Number(et[2]):null,et[1]]:void 0}const docsPath$2="/docs/contract/encodeDeployData";function encodeDeployData(o){const{abi:et,args:tt,bytecode:nt}=o;if(!tt||tt.length===0)return nt;const rt=et.find(it=>"type"in it&&it.type==="constructor");if(!rt)throw new AbiConstructorNotFoundError({docsPath:docsPath$2});if(!("inputs"in rt))throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$2});if(!rt.inputs||rt.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$2});const ot=encodeAbiParameters(rt.inputs,tt);return concatHex([nt,ot])}function parseAccount(o){return typeof o=="string"?{address:o,type:"json-rpc"}:o}class AccountNotFoundError extends BaseError$3{constructor({docsPath:et}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` +`),{docsPath:et,docsSlug:"account",name:"AccountNotFoundError"})}}const scriptRel="modulepreload",assetsURL=function(o){return"/"+o},seen={},__vitePreload=function(et,tt,nt){let rt=Promise.resolve();if(tt&&tt.length>0){document.getElementsByTagName("link");const it=document.querySelector("meta[property=csp-nonce]"),st=(it==null?void 0:it.nonce)||(it==null?void 0:it.getAttribute("nonce"));rt=Promise.allSettled(tt.map(at=>{if(at=assetsURL(at),at in seen)return;seen[at]=!0;const ct=at.endsWith(".css"),lt=ct?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${at}"]${lt}`))return;const dt=document.createElement("link");if(dt.rel=ct?"stylesheet":scriptRel,ct||(dt.as="script"),dt.crossOrigin="",dt.href=at,st&&dt.setAttribute("nonce",st),document.head.appendChild(dt),ct)return new Promise((ht,pt)=>{dt.addEventListener("load",ht),dt.addEventListener("error",()=>pt(new Error(`Unable to preload CSS for ${at}`)))})}))}function ot(it){const st=new Event("vite:preloadError",{cancelable:!0});if(st.payload=it,window.dispatchEvent(st),!st.defaultPrevented)throw it}return rt.then(it=>{for(const st of it||[])st.status==="rejected"&&ot(st.reason);return et().catch(ot)})};class NegativeOffsetError extends BaseError$3{constructor({offset:et}){super(`Offset \`${et}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class PositionOutOfBoundsError extends BaseError$3{constructor({length:et,position:tt}){super(`Position \`${tt}\` is out of bounds (\`0 < position < ${et}\`).`,{name:"PositionOutOfBoundsError"})}}class RecursiveReadLimitExceededError extends BaseError$3{constructor({count:et,limit:tt}){super(`Recursive read limit of \`${tt}\` exceeded (recursive read count: \`${et}\`).`,{name:"RecursiveReadLimitExceededError"})}}const staticCursor={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(o){if(o<0||o>this.bytes.length-1)throw new PositionOutOfBoundsError({length:this.bytes.length,position:o})},decrementPosition(o){if(o<0)throw new NegativeOffsetError({offset:o});const et=this.position-o;this.assertPosition(et),this.position=et},getReadCount(o){return this.positionReadCount.get(o||this.position)||0},incrementPosition(o){if(o<0)throw new NegativeOffsetError({offset:o});const et=this.position+o;this.assertPosition(et),this.position=et},inspectByte(o){const et=o??this.position;return this.assertPosition(et),this.bytes[et]},inspectBytes(o,et){const tt=et??this.position;return this.assertPosition(tt+o-1),this.bytes.subarray(tt,tt+o)},inspectUint8(o){const et=o??this.position;return this.assertPosition(et),this.bytes[et]},inspectUint16(o){const et=o??this.position;return this.assertPosition(et+1),this.dataView.getUint16(et)},inspectUint24(o){const et=o??this.position;return this.assertPosition(et+2),(this.dataView.getUint16(et)<<8)+this.dataView.getUint8(et+2)},inspectUint32(o){const et=o??this.position;return this.assertPosition(et+3),this.dataView.getUint32(et)},pushByte(o){this.assertPosition(this.position),this.bytes[this.position]=o,this.position++},pushBytes(o){this.assertPosition(this.position+o.length-1),this.bytes.set(o,this.position),this.position+=o.length},pushUint8(o){this.assertPosition(this.position),this.bytes[this.position]=o,this.position++},pushUint16(o){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,o),this.position+=2},pushUint24(o){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,o>>8),this.dataView.setUint8(this.position+2,o&255),this.position+=3},pushUint32(o){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,o),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const o=this.inspectByte();return this.position++,o},readBytes(o,et){this.assertReadLimit(),this._touch();const tt=this.inspectBytes(o);return this.position+=et??o,tt},readUint8(){this.assertReadLimit(),this._touch();const o=this.inspectUint8();return this.position+=1,o},readUint16(){this.assertReadLimit(),this._touch();const o=this.inspectUint16();return this.position+=2,o},readUint24(){this.assertReadLimit(),this._touch();const o=this.inspectUint24();return this.position+=3,o},readUint32(){this.assertReadLimit(),this._touch();const o=this.inspectUint32();return this.position+=4,o},get remaining(){return this.bytes.length-this.position},setPosition(o){const et=this.position;return this.assertPosition(o),this.position=o,()=>this.position=et},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const o=this.getReadCount();this.positionReadCount.set(this.position,o+1),o>0&&this.recursiveReadCount++}};function createCursor(o,{recursiveReadLimit:et=8192}={}){const tt=Object.create(staticCursor);return tt.bytes=o,tt.dataView=new DataView(o.buffer,o.byteOffset,o.byteLength),tt.positionReadCount=new Map,tt.recursiveReadLimit=et,tt}function toRlp(o,et="hex"){const tt=getEncodable(o),nt=createCursor(new Uint8Array(tt.length));return tt.encode(nt),et==="hex"?bytesToHex$4(nt.bytes):nt.bytes}function getEncodable(o){return Array.isArray(o)?getEncodableList(o.map(et=>getEncodable(et))):getEncodableBytes(o)}function getEncodableList(o){const et=o.reduce((rt,ot)=>rt+ot.length,0),tt=getSizeOfLength(et);return{length:et<=55?1+et:1+tt+et,encode(rt){et<=55?rt.pushByte(192+et):(rt.pushByte(247+tt),tt===1?rt.pushUint8(et):tt===2?rt.pushUint16(et):tt===3?rt.pushUint24(et):rt.pushUint32(et));for(const{encode:ot}of o)ot(rt)}}}function getEncodableBytes(o){const et=typeof o=="string"?hexToBytes$3(o):o,tt=getSizeOfLength(et.length);return{length:et.length===1&&et[0]<128?1:et.length<=55?1+et.length:1+tt+et.length,encode(rt){et.length===1&&et[0]<128?rt.pushBytes(et):et.length<=55?(rt.pushByte(128+et.length),rt.pushBytes(et)):(rt.pushByte(183+tt),tt===1?rt.pushUint8(et.length):tt===2?rt.pushUint16(et.length):tt===3?rt.pushUint24(et.length):rt.pushUint32(et.length),rt.pushBytes(et))}}}function getSizeOfLength(o){if(o<2**8)return 1;if(o<2**16)return 2;if(o<2**24)return 3;if(o<2**32)return 4;throw new BaseError$3("Length is too large.")}class ChainDoesNotSupportContract extends BaseError$3{constructor({blockNumber:et,chain:tt,contract:nt}){super(`Chain "${tt.name}" does not support contract "${nt.name}".`,{metaMessages:["This could be due to any of the following:",...et&&nt.blockCreated&&nt.blockCreated>et?[`- The contract "${nt.name}" was not deployed until block ${nt.blockCreated} (current block ${et}).`]:[`- The chain does not have the contract "${nt.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class ClientChainNotConfiguredError extends BaseError$3{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class InvalidChainIdError extends BaseError$3{constructor({chainId:et}){super(typeof et=="number"?`Chain ID "${et}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const etherUnits={gwei:9,wei:18},gweiUnits={ether:-9,wei:9},weiUnits={ether:-18,gwei:-9};function formatUnits(o,et){let tt=o.toString();const nt=tt.startsWith("-");nt&&(tt=tt.slice(1)),tt=tt.padStart(et,"0");let[rt,ot]=[tt.slice(0,tt.length-et),tt.slice(tt.length-et)];return ot=ot.replace(/(0+)$/,""),`${nt?"-":""}${rt||"0"}${ot?`.${ot}`:""}`}function formatGwei(o,et="wei"){return formatUnits(o,gweiUnits[et])}class ExecutionRevertedError extends BaseError$3{constructor({cause:et,message:tt}={}){var rt;const nt=(rt=tt==null?void 0:tt.replace("execution reverted: ",""))==null?void 0:rt.replace("execution reverted","");super(`Execution reverted ${nt?`with reason: ${nt}`:"for an unknown reason"}.`,{cause:et,name:"ExecutionRevertedError"})}}Object.defineProperty(ExecutionRevertedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ExecutionRevertedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class FeeCapTooHighError extends BaseError$3{constructor({cause:et,maxFeePerGas:tt}={}){super(`The fee cap (\`maxFeePerGas\`${tt?` = ${formatGwei(tt)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:et,name:"FeeCapTooHighError"})}}Object.defineProperty(FeeCapTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class FeeCapTooLowError extends BaseError$3{constructor({cause:et,maxFeePerGas:tt}={}){super(`The fee cap (\`maxFeePerGas\`${tt?` = ${formatGwei(tt)}`:""} gwei) cannot be lower than the block base fee.`,{cause:et,name:"FeeCapTooLowError"})}}Object.defineProperty(FeeCapTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class NonceTooHighError extends BaseError$3{constructor({cause:et,nonce:tt}={}){super(`Nonce provided for the transaction ${tt?`(${tt}) `:""}is higher than the next one expected.`,{cause:et,name:"NonceTooHighError"})}}Object.defineProperty(NonceTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class NonceTooLowError extends BaseError$3{constructor({cause:et,nonce:tt}={}){super([`Nonce provided for the transaction ${tt?`(${tt}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` +`),{cause:et,name:"NonceTooLowError"})}}Object.defineProperty(NonceTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class NonceMaxValueError extends BaseError$3{constructor({cause:et,nonce:tt}={}){super(`Nonce provided for the transaction ${tt?`(${tt}) `:""}exceeds the maximum allowed nonce.`,{cause:et,name:"NonceMaxValueError"})}}Object.defineProperty(NonceMaxValueError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class InsufficientFundsError extends BaseError$3{constructor({cause:et}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` +`),{cause:et,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(InsufficientFundsError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class IntrinsicGasTooHighError extends BaseError$3{constructor({cause:et,gas:tt}={}){super(`The amount of gas ${tt?`(${tt}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:et,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(IntrinsicGasTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class IntrinsicGasTooLowError extends BaseError$3{constructor({cause:et,gas:tt}={}){super(`The amount of gas ${tt?`(${tt}) `:""}provided for the transaction is too low.`,{cause:et,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(IntrinsicGasTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class TransactionTypeNotSupportedError extends BaseError$3{constructor({cause:et}){super("The transaction type is not supported for this chain.",{cause:et,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(TransactionTypeNotSupportedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class TipAboveFeeCapError extends BaseError$3{constructor({cause:et,maxPriorityFeePerGas:tt,maxFeePerGas:nt}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${tt?` = ${formatGwei(tt)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${nt?` = ${formatGwei(nt)} gwei`:""}).`].join(` +`),{cause:et,name:"TipAboveFeeCapError"})}}Object.defineProperty(TipAboveFeeCapError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class UnknownNodeError extends BaseError$3{constructor({cause:et}){super(`An error occurred while executing: ${et==null?void 0:et.shortMessage}`,{cause:et,name:"UnknownNodeError"})}}function formatEther(o,et="wei"){return formatUnits(o,etherUnits[et])}function prettyPrint(o){const et=Object.entries(o).map(([nt,rt])=>rt===void 0||rt===!1?null:[nt,rt]).filter(Boolean),tt=et.reduce((nt,[rt])=>Math.max(nt,rt.length),0);return et.map(([nt,rt])=>` ${`${nt}:`.padEnd(tt+1)} ${rt}`).join(` +`)}class FeeConflictError extends BaseError$3{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` +`),{name:"FeeConflictError"})}}class InvalidLegacyVError extends BaseError$3{constructor({v:et}){super(`Invalid \`v\` value "${et}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class InvalidSerializableTransactionError extends BaseError$3{constructor({transaction:et}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",prettyPrint(et),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class InvalidStorageKeySizeError extends BaseError$3{constructor({storageKey:et}){super(`Size for storage key "${et}" is invalid. Expected 32 bytes. Got ${Math.floor((et.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}const stringify$2=(o,et,tt)=>JSON.stringify(o,(nt,rt)=>typeof rt=="bigint"?rt.toString():rt,tt),getContractAddress=o=>o,getUrl=o=>o;class HttpRequestError extends BaseError$3{constructor({body:et,cause:tt,details:nt,headers:rt,status:ot,url:it}){super("HTTP request failed.",{cause:tt,details:nt,metaMessages:[ot&&`Status: ${ot}`,`URL: ${getUrl(it)}`,et&&`Request body: ${stringify$2(et)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=et,this.headers=rt,this.status=ot,this.url=it}}class RpcRequestError extends BaseError$3{constructor({body:et,error:tt,url:nt}){super("RPC Request failed.",{cause:tt,details:tt.message,metaMessages:[`URL: ${getUrl(nt)}`,`Request body: ${stringify$2(et)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=tt.code}}let TimeoutError$4=class extends BaseError$3{constructor({body:et,url:tt}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${getUrl(tt)}`,`Request body: ${stringify$2(et)}`],name:"TimeoutError"})}};const unknownErrorCode=-1;class RpcError extends BaseError$3{constructor(et,{code:tt,docsPath:nt,metaMessages:rt,name:ot,shortMessage:it}){super(it,{cause:et,docsPath:nt,metaMessages:rt||(et==null?void 0:et.metaMessages),name:ot||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=ot||et.name,this.code=et instanceof RpcRequestError?et.code:tt??unknownErrorCode}}class ProviderRpcError extends RpcError{constructor(et,tt){super(et,tt),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=tt.data}}class ParseRpcError extends RpcError{constructor(et){super(et,{code:ParseRpcError.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(ParseRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class InvalidRequestRpcError extends RpcError{constructor(et){super(et,{code:InvalidRequestRpcError.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(InvalidRequestRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class MethodNotFoundRpcError extends RpcError{constructor(et,{method:tt}={}){super(et,{code:MethodNotFoundRpcError.code,name:"MethodNotFoundRpcError",shortMessage:`The method${tt?` "${tt}"`:""} does not exist / is not available.`})}}Object.defineProperty(MethodNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class InvalidParamsRpcError extends RpcError{constructor(et){super(et,{code:InvalidParamsRpcError.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` +`)})}}Object.defineProperty(InvalidParamsRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class InternalRpcError extends RpcError{constructor(et){super(et,{code:InternalRpcError.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(InternalRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class InvalidInputRpcError extends RpcError{constructor(et){super(et,{code:InvalidInputRpcError.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` +`)})}}Object.defineProperty(InvalidInputRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ResourceNotFoundRpcError extends RpcError{constructor(et){super(et,{code:ResourceNotFoundRpcError.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ResourceNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ResourceUnavailableRpcError extends RpcError{constructor(et){super(et,{code:ResourceUnavailableRpcError.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ResourceUnavailableRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class TransactionRejectedRpcError extends RpcError{constructor(et){super(et,{code:TransactionRejectedRpcError.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(TransactionRejectedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class MethodNotSupportedRpcError extends RpcError{constructor(et,{method:tt}={}){super(et,{code:MethodNotSupportedRpcError.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${tt?` "${tt}"`:""} is not implemented.`})}}Object.defineProperty(MethodNotSupportedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class LimitExceededRpcError extends RpcError{constructor(et){super(et,{code:LimitExceededRpcError.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(LimitExceededRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class JsonRpcVersionUnsupportedError extends RpcError{constructor(et){super(et,{code:JsonRpcVersionUnsupportedError.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(JsonRpcVersionUnsupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class UserRejectedRequestError extends ProviderRpcError{constructor(et){super(et,{code:UserRejectedRequestError.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(UserRejectedRequestError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class UnauthorizedProviderError extends ProviderRpcError{constructor(et){super(et,{code:UnauthorizedProviderError.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(UnauthorizedProviderError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class UnsupportedProviderMethodError extends ProviderRpcError{constructor(et,{method:tt}={}){super(et,{code:UnsupportedProviderMethodError.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${tt?` " ${tt}"`:""}.`})}}Object.defineProperty(UnsupportedProviderMethodError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ProviderDisconnectedError extends ProviderRpcError{constructor(et){super(et,{code:ProviderDisconnectedError.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ProviderDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class ChainDisconnectedError extends ProviderRpcError{constructor(et){super(et,{code:ChainDisconnectedError.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(ChainDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class SwitchChainError extends ProviderRpcError{constructor(et){super(et,{code:SwitchChainError.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(SwitchChainError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class UnknownRpcError extends RpcError{constructor(et){super(et,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function getNodeError(o,et){const tt=(o.details||"").toLowerCase(),nt=o instanceof BaseError$3?o.walk(rt=>(rt==null?void 0:rt.code)===ExecutionRevertedError.code):o;return nt instanceof BaseError$3?new ExecutionRevertedError({cause:o,message:nt.details}):ExecutionRevertedError.nodeMessage.test(tt)?new ExecutionRevertedError({cause:o,message:o.details}):FeeCapTooHighError.nodeMessage.test(tt)?new FeeCapTooHighError({cause:o,maxFeePerGas:et==null?void 0:et.maxFeePerGas}):FeeCapTooLowError.nodeMessage.test(tt)?new FeeCapTooLowError({cause:o,maxFeePerGas:et==null?void 0:et.maxFeePerGas}):NonceTooHighError.nodeMessage.test(tt)?new NonceTooHighError({cause:o,nonce:et==null?void 0:et.nonce}):NonceTooLowError.nodeMessage.test(tt)?new NonceTooLowError({cause:o,nonce:et==null?void 0:et.nonce}):NonceMaxValueError.nodeMessage.test(tt)?new NonceMaxValueError({cause:o,nonce:et==null?void 0:et.nonce}):InsufficientFundsError.nodeMessage.test(tt)?new InsufficientFundsError({cause:o}):IntrinsicGasTooHighError.nodeMessage.test(tt)?new IntrinsicGasTooHighError({cause:o,gas:et==null?void 0:et.gas}):IntrinsicGasTooLowError.nodeMessage.test(tt)?new IntrinsicGasTooLowError({cause:o,gas:et==null?void 0:et.gas}):TransactionTypeNotSupportedError.nodeMessage.test(tt)?new TransactionTypeNotSupportedError({cause:o}):TipAboveFeeCapError.nodeMessage.test(tt)?new TipAboveFeeCapError({cause:o,maxFeePerGas:et==null?void 0:et.maxFeePerGas,maxPriorityFeePerGas:et==null?void 0:et.maxPriorityFeePerGas}):new UnknownNodeError({cause:o})}function extract$1(o,{format:et}){if(!et)return{};const tt={};function nt(ot){const it=Object.keys(ot);for(const st of it)st in o&&(tt[st]=o[st]),ot[st]&&typeof ot[st]=="object"&&!Array.isArray(ot[st])&&nt(ot[st])}const rt=et(o||{});return nt(rt),tt}function defineFormatter(o,et){return({exclude:tt,format:nt})=>({exclude:tt,format:rt=>{const ot=et(rt);if(tt)for(const it of tt)delete ot[it];return{...ot,...nt(rt)}},type:o})}const rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function formatTransactionRequest(o){const et={};return typeof o.authorizationList<"u"&&(et.authorizationList=formatAuthorizationList$1(o.authorizationList)),typeof o.accessList<"u"&&(et.accessList=o.accessList),typeof o.blobVersionedHashes<"u"&&(et.blobVersionedHashes=o.blobVersionedHashes),typeof o.blobs<"u"&&(typeof o.blobs[0]!="string"?et.blobs=o.blobs.map(tt=>bytesToHex$4(tt)):et.blobs=o.blobs),typeof o.data<"u"&&(et.data=o.data),typeof o.from<"u"&&(et.from=o.from),typeof o.gas<"u"&&(et.gas=numberToHex(o.gas)),typeof o.gasPrice<"u"&&(et.gasPrice=numberToHex(o.gasPrice)),typeof o.maxFeePerBlobGas<"u"&&(et.maxFeePerBlobGas=numberToHex(o.maxFeePerBlobGas)),typeof o.maxFeePerGas<"u"&&(et.maxFeePerGas=numberToHex(o.maxFeePerGas)),typeof o.maxPriorityFeePerGas<"u"&&(et.maxPriorityFeePerGas=numberToHex(o.maxPriorityFeePerGas)),typeof o.nonce<"u"&&(et.nonce=numberToHex(o.nonce)),typeof o.to<"u"&&(et.to=o.to),typeof o.type<"u"&&(et.type=rpcTransactionType[o.type]),typeof o.value<"u"&&(et.value=numberToHex(o.value)),et}function formatAuthorizationList$1(o){return o.map(et=>({address:et.contractAddress,r:et.r,s:et.s,chainId:numberToHex(et.chainId),nonce:numberToHex(et.nonce),...typeof et.yParity<"u"?{yParity:numberToHex(et.yParity)}:{},...typeof et.v<"u"&&typeof et.yParity>"u"?{v:numberToHex(et.v)}:{}}))}function getAction$1(o,et,tt){const nt=o[et.name];if(typeof nt=="function")return nt;const rt=o[tt];return typeof rt=="function"?rt:ot=>et(o,ot)}const maxUint256=2n**256n-1n;function assertRequest(o){const{account:et,gasPrice:tt,maxFeePerGas:nt,maxPriorityFeePerGas:rt,to:ot}=o,it=et?parseAccount(et):void 0;if(it&&!isAddress(it.address))throw new InvalidAddressError({address:it.address});if(ot&&!isAddress(ot))throw new InvalidAddressError({address:ot});if(typeof tt<"u"&&(typeof nt<"u"||typeof rt<"u"))throw new FeeConflictError;if(nt&&nt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:nt});if(rt&&nt&&rt>nt)throw new TipAboveFeeCapError({maxFeePerGas:nt,maxPriorityFeePerGas:rt})}const transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function formatTransaction(o){const et={...o,blockHash:o.blockHash?o.blockHash:null,blockNumber:o.blockNumber?BigInt(o.blockNumber):null,chainId:o.chainId?hexToNumber$2(o.chainId):void 0,gas:o.gas?BigInt(o.gas):void 0,gasPrice:o.gasPrice?BigInt(o.gasPrice):void 0,maxFeePerBlobGas:o.maxFeePerBlobGas?BigInt(o.maxFeePerBlobGas):void 0,maxFeePerGas:o.maxFeePerGas?BigInt(o.maxFeePerGas):void 0,maxPriorityFeePerGas:o.maxPriorityFeePerGas?BigInt(o.maxPriorityFeePerGas):void 0,nonce:o.nonce?hexToNumber$2(o.nonce):void 0,to:o.to?o.to:null,transactionIndex:o.transactionIndex?Number(o.transactionIndex):null,type:o.type?transactionType[o.type]:void 0,typeHex:o.type?o.type:void 0,value:o.value?BigInt(o.value):void 0,v:o.v?BigInt(o.v):void 0};return o.authorizationList&&(et.authorizationList=formatAuthorizationList(o.authorizationList)),et.yParity=(()=>{if(o.yParity)return Number(o.yParity);if(typeof et.v=="bigint"){if(et.v===0n||et.v===27n)return 0;if(et.v===1n||et.v===28n)return 1;if(et.v>=35n)return et.v%2n===0n?1:0}})(),et.type==="legacy"&&(delete et.accessList,delete et.maxFeePerBlobGas,delete et.maxFeePerGas,delete et.maxPriorityFeePerGas,delete et.yParity),et.type==="eip2930"&&(delete et.maxFeePerBlobGas,delete et.maxFeePerGas,delete et.maxPriorityFeePerGas),et.type==="eip1559"&&delete et.maxFeePerBlobGas,et}const defineTransaction=defineFormatter("transaction",formatTransaction);function formatAuthorizationList(o){return o.map(et=>({contractAddress:et.address,chainId:Number(et.chainId),nonce:Number(et.nonce),r:et.r,s:et.s,yParity:Number(et.yParity)}))}function formatBlock(o){var tt;const et=(tt=o.transactions)==null?void 0:tt.map(nt=>typeof nt=="string"?nt:formatTransaction(nt));return{...o,baseFeePerGas:o.baseFeePerGas?BigInt(o.baseFeePerGas):null,blobGasUsed:o.blobGasUsed?BigInt(o.blobGasUsed):void 0,difficulty:o.difficulty?BigInt(o.difficulty):void 0,excessBlobGas:o.excessBlobGas?BigInt(o.excessBlobGas):void 0,gasLimit:o.gasLimit?BigInt(o.gasLimit):void 0,gasUsed:o.gasUsed?BigInt(o.gasUsed):void 0,hash:o.hash?o.hash:null,logsBloom:o.logsBloom?o.logsBloom:null,nonce:o.nonce?o.nonce:null,number:o.number?BigInt(o.number):null,size:o.size?BigInt(o.size):void 0,timestamp:o.timestamp?BigInt(o.timestamp):void 0,transactions:et,totalDifficulty:o.totalDifficulty?BigInt(o.totalDifficulty):null}}const defineBlock=defineFormatter("block",formatBlock);class AccountStateConflictError extends BaseError$3{constructor({address:et}){super(`State for account "${et}" is set multiple times.`,{name:"AccountStateConflictError"})}}class StateAssignmentConflictError extends BaseError$3{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function prettyStateMapping(o){return o.reduce((et,{slot:tt,value:nt})=>`${et} ${tt}: ${nt} +`,"")}function prettyStateOverride(o){return o.reduce((et,{address:tt,...nt})=>{let rt=`${et} ${tt}: +`;return nt.nonce&&(rt+=` nonce: ${nt.nonce} +`),nt.balance&&(rt+=` balance: ${nt.balance} +`),nt.code&&(rt+=` code: ${nt.code} +`),nt.state&&(rt+=` state: +`,rt+=prettyStateMapping(nt.state)),nt.stateDiff&&(rt+=` stateDiff: +`,rt+=prettyStateMapping(nt.stateDiff)),rt},` State Override: +`).slice(0,-1)}function serializeStateMapping(o){if(!(!o||o.length===0))return o.reduce((et,{slot:tt,value:nt})=>{if(tt.length!==66)throw new InvalidBytesLengthError({size:tt.length,targetSize:66,type:"hex"});if(nt.length!==66)throw new InvalidBytesLengthError({size:nt.length,targetSize:66,type:"hex"});return et[tt]=nt,et},{})}function serializeAccountStateOverride(o){const{balance:et,nonce:tt,state:nt,stateDiff:rt,code:ot}=o,it={};if(ot!==void 0&&(it.code=ot),et!==void 0&&(it.balance=numberToHex(et)),tt!==void 0&&(it.nonce=numberToHex(tt)),nt!==void 0&&(it.state=serializeStateMapping(nt)),rt!==void 0){if(it.state)throw new StateAssignmentConflictError;it.stateDiff=serializeStateMapping(rt)}return it}function serializeStateOverride(o){if(!o)return;const et={};for(const{address:tt,...nt}of o){if(!isAddress(tt,{strict:!1}))throw new InvalidAddressError({address:tt});if(et[tt])throw new AccountStateConflictError({address:tt});et[tt]=serializeAccountStateOverride(nt)}return et}async function getBalance$1(o,{address:et,blockNumber:tt,blockTag:nt="latest"}){const rt=tt?numberToHex(tt):void 0,ot=await o.request({method:"eth_getBalance",params:[et,rt||nt]});return BigInt(ot)}function blobsToCommitments(o){const{kzg:et}=o,tt=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),nt=typeof o.blobs[0]=="string"?o.blobs.map(ot=>hexToBytes$3(ot)):o.blobs,rt=[];for(const ot of nt)rt.push(Uint8Array.from(et.blobToKzgCommitment(ot)));return tt==="bytes"?rt:rt.map(ot=>bytesToHex$4(ot))}function blobsToProofs(o){const{kzg:et}=o,tt=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),nt=typeof o.blobs[0]=="string"?o.blobs.map(it=>hexToBytes$3(it)):o.blobs,rt=typeof o.commitments[0]=="string"?o.commitments.map(it=>hexToBytes$3(it)):o.commitments,ot=[];for(let it=0;itbytesToHex$4(it))}function setBigUint64$1(o,et,tt,nt){if(typeof o.setBigUint64=="function")return o.setBigUint64(et,tt,nt);const rt=BigInt(32),ot=BigInt(4294967295),it=Number(tt>>rt&ot),st=Number(tt&ot),at=nt?4:0,ct=nt?0:4;o.setUint32(et+at,it,nt),o.setUint32(et+ct,st,nt)}const Chi=(o,et,tt)=>o&et^~o&tt,Maj=(o,et,tt)=>o&et^o&tt^et&tt;class HashMD extends Hash{constructor(et,tt,nt,rt){super(),this.blockLen=et,this.outputLen=tt,this.padOffset=nt,this.isLE=rt,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(et),this.view=createView$1(this.buffer)}update(et){exists$1(this);const{view:tt,buffer:nt,blockLen:rt}=this;et=toBytes$2(et);const ot=et.length;for(let it=0;itrt-it&&(this.process(nt,0),it=0);for(let dt=it;dtlt.length)throw new Error("_sha2: outputLen bigger than state");for(let dt=0;dt>>3,ft=rotr(pt,17)^rotr(pt,19)^pt>>>10;SHA256_W[dt]=ft+SHA256_W[dt-7]+mt+SHA256_W[dt-16]|0}let{A:nt,B:rt,C:ot,D:it,E:st,F:at,G:ct,H:lt}=this;for(let dt=0;dt<64;dt++){const ht=rotr(st,6)^rotr(st,11)^rotr(st,25),pt=lt+ht+Chi(st,at,ct)+SHA256_K[dt]+SHA256_W[dt]|0,ft=(rotr(nt,2)^rotr(nt,13)^rotr(nt,22))+Maj(nt,rt,ot)|0;lt=ct,ct=at,at=st,st=it+pt|0,it=ot,ot=rt,rt=nt,nt=pt+ft|0}nt=nt+this.A|0,rt=rt+this.B|0,ot=ot+this.C|0,it=it+this.D|0,st=st+this.E|0,at=at+this.F|0,ct=ct+this.G|0,lt=lt+this.H|0,this.set(nt,rt,ot,it,st,at,ct,lt)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const sha256$2=wrapConstructor(()=>new SHA256);function sha256$1(o,et){return sha256$2(isHex(o,{strict:!1})?toBytes$3(o):o)}function commitmentToVersionedHash(o){const{commitment:et,version:tt=1}=o,nt=o.to??(typeof et=="string"?"hex":"bytes"),rt=sha256$1(et);return rt.set([tt],0),nt==="bytes"?rt:bytesToHex$4(rt)}function commitmentsToVersionedHashes(o){const{commitments:et,version:tt}=o,nt=o.to??(typeof et[0]=="string"?"hex":"bytes"),rt=[];for(const ot of et)rt.push(commitmentToVersionedHash({commitment:ot,to:nt,version:tt}));return rt}const blobsPerTransaction=6,bytesPerFieldElement=32,fieldElementsPerBlob=4096,bytesPerBlob=bytesPerFieldElement*fieldElementsPerBlob,maxBytesPerTransaction=bytesPerBlob*blobsPerTransaction-1-1*fieldElementsPerBlob*blobsPerTransaction,versionedHashVersionKzg=1;class BlobSizeTooLargeError extends BaseError$3{constructor({maxSize:et,size:tt}){super("Blob size is too large.",{metaMessages:[`Max: ${et} bytes`,`Given: ${tt} bytes`],name:"BlobSizeTooLargeError"})}}class EmptyBlobError extends BaseError$3{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class InvalidVersionedHashSizeError extends BaseError$3{constructor({hash:et,size:tt}){super(`Versioned hash "${et}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${tt}`],name:"InvalidVersionedHashSizeError"})}}class InvalidVersionedHashVersionError extends BaseError$3{constructor({hash:et,version:tt}){super(`Versioned hash "${et}" version is invalid.`,{metaMessages:[`Expected: ${versionedHashVersionKzg}`,`Received: ${tt}`],name:"InvalidVersionedHashVersionError"})}}function toBlobs(o){const et=o.to??(typeof o.data=="string"?"hex":"bytes"),tt=typeof o.data=="string"?hexToBytes$3(o.data):o.data,nt=size$2(tt);if(!nt)throw new EmptyBlobError;if(nt>maxBytesPerTransaction)throw new BlobSizeTooLargeError({maxSize:maxBytesPerTransaction,size:nt});const rt=[];let ot=!0,it=0;for(;ot;){const st=createCursor(new Uint8Array(bytesPerBlob));let at=0;for(;atst.bytes):rt.map(st=>bytesToHex$4(st.bytes))}function toBlobSidecars(o){const{data:et,kzg:tt,to:nt}=o,rt=o.blobs??toBlobs({data:et,to:nt}),ot=o.commitments??blobsToCommitments({blobs:rt,kzg:tt,to:nt}),it=o.proofs??blobsToProofs({blobs:rt,commitments:ot,kzg:tt,to:nt}),st=[];for(let at=0;at1||tt[0]>1)throw new InvalidBytesBooleanError(tt);return!!tt[0]}function bytesToNumber$1(o,et={}){typeof et.size<"u"&&assertSize(o,{size:et.size});const tt=bytesToHex$4(o,et);return hexToNumber$2(tt,et)}function bytesToString(o,et={}){let tt=o;return typeof et.size<"u"&&(assertSize(tt,{size:et.size}),tt=trim$1(tt,{dir:"right"})),new TextDecoder().decode(tt)}function decodeAbiParameters(o,et){const tt=typeof et=="string"?hexToBytes$3(et):et,nt=createCursor(tt);if(size$2(tt)===0&&o.length>0)throw new AbiDecodingZeroDataError;if(size$2(et)&&size$2(et)<32)throw new AbiDecodingDataSizeTooSmallError({data:typeof et=="string"?et:bytesToHex$4(et),params:o,size:size$2(et)});let rt=0;const ot=[];for(let it=0;it48?bytesToBigInt(rt,{signed:tt}):bytesToNumber$1(rt,{signed:tt}),32]}function decodeTuple(o,et,{staticPosition:tt}){const nt=et.components.length===0||et.components.some(({name:it})=>!it),rt=nt?[]:{};let ot=0;if(hasDynamicChild(et)){const it=bytesToNumber$1(o.readBytes(sizeOfOffset)),st=tt+it;for(let at=0;atkeccak256$1(toBytes$3(o));function hashSignature(o){return hash(o)}const version$7="1.0.6";let BaseError$2=class ks extends Error{constructor(et,tt={}){var it;const nt=tt.cause instanceof ks?tt.cause.details:(it=tt.cause)!=null&&it.message?tt.cause.message:tt.details,rt=tt.cause instanceof ks&&tt.cause.docsPath||tt.docsPath,ot=[et||"An error occurred.","",...tt.metaMessages?[...tt.metaMessages,""]:[],...rt?[`Docs: https://abitype.dev${rt}`]:[],...nt?[`Details: ${nt}`]:[],`Version: abitype@${version$7}`].join(` +`);super(ot),Object.defineProperty(this,"details",{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,"metaMessages",{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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),tt.cause&&(this.cause=tt.cause),this.details=nt,this.docsPath=rt,this.metaMessages=tt.metaMessages,this.shortMessage=et}};function execTyped(o,et){const tt=o.exec(et);return tt==null?void 0:tt.groups}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,isTupleRegex=/^\(.+?\).*?$/,tupleRegex=/^tuple(?(\[(\d*)\])*)$/;function formatAbiParameter(o){let et=o.type;if(tupleRegex.test(o.type)&&"components"in o){et="(";const tt=o.components.length;for(let rt=0;rt[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function isErrorSignature(o){return errorSignatureRegex.test(o)}function execErrorSignature(o){return execTyped(errorSignatureRegex,o)}const eventSignatureRegex=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function isEventSignature(o){return eventSignatureRegex.test(o)}function execEventSignature(o){return execTyped(eventSignatureRegex,o)}const functionSignatureRegex=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function isFunctionSignature(o){return functionSignatureRegex.test(o)}function execFunctionSignature(o){return execTyped(functionSignatureRegex,o)}const structSignatureRegex=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function isStructSignature(o){return structSignatureRegex.test(o)}function execStructSignature(o){return execTyped(structSignatureRegex,o)}const constructorSignatureRegex=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function isConstructorSignature(o){return constructorSignatureRegex.test(o)}function execConstructorSignature(o){return execTyped(constructorSignatureRegex,o)}const fallbackSignatureRegex=/^fallback\(\) external(?:\s(?payable{1}))?$/;function isFallbackSignature(o){return fallbackSignatureRegex.test(o)}const receiveSignatureRegex=/^receive\(\) external payable$/;function isReceiveSignature(o){return receiveSignatureRegex.test(o)}const eventModifiers=new Set(["indexed"]),functionModifiers=new Set(["calldata","memory","storage"]);class UnknownTypeError extends BaseError$2{constructor({type:et}){super("Unknown type.",{metaMessages:[`Type "${et}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class UnknownSolidityTypeError extends BaseError$2{constructor({type:et}){super("Unknown type.",{metaMessages:[`Type "${et}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class InvalidParameterError extends BaseError$2{constructor({param:et}){super("Invalid ABI parameter.",{details:et}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class SolidityProtectedKeywordError extends BaseError$2{constructor({param:et,name:tt}){super("Invalid ABI parameter.",{details:et,metaMessages:[`"${tt}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class InvalidModifierError extends BaseError$2{constructor({param:et,type:tt,modifier:nt}){super("Invalid ABI parameter.",{details:et,metaMessages:[`Modifier "${nt}" not allowed${tt?` in "${tt}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class InvalidFunctionModifierError extends BaseError$2{constructor({param:et,type:tt,modifier:nt}){super("Invalid ABI parameter.",{details:et,metaMessages:[`Modifier "${nt}" not allowed${tt?` in "${tt}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${nt}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class InvalidAbiTypeParameterError extends BaseError$2{constructor({abiParameter:et}){super("Invalid ABI parameter.",{details:JSON.stringify(et,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}let InvalidSignatureError$1=class extends BaseError$2{constructor({signature:et,type:tt}){super(`Invalid ${tt} signature.`,{details:et}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};class UnknownSignatureError extends BaseError$2{constructor({signature:et}){super("Unknown signature.",{details:et}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class InvalidStructSignatureError extends BaseError$2{constructor({signature:et}){super("Invalid struct signature.",{details:et,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class CircularReferenceError extends BaseError$2{constructor({type:et}){super("Circular reference detected.",{metaMessages:[`Struct "${et}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class InvalidParenthesisError extends BaseError$2{constructor({current:et,depth:tt}){super("Unbalanced parentheses.",{metaMessages:[`"${et.trim()}" has too many ${tt>0?"opening":"closing"} parentheses.`],details:`Depth "${tt}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function getParameterCacheKey(o,et){return et?`${et}:${o}`:o}const parameterCache=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function parseSignature(o,et={}){if(isFunctionSignature(o)){const tt=execFunctionSignature(o);if(!tt)throw new InvalidSignatureError$1({signature:o,type:"function"});const nt=splitParameters(tt.parameters),rt=[],ot=nt.length;for(let st=0;st[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,abiParameterWithTupleRegex=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,dynamicIntegerRegex=/^u?int$/;function parseAbiParameter(o,et){var dt,ht;const tt=getParameterCacheKey(o,et==null?void 0:et.type);if(parameterCache.has(tt))return parameterCache.get(tt);const nt=isTupleRegex.test(o),rt=execTyped(nt?abiParameterWithTupleRegex:abiParameterWithoutTupleRegex,o);if(!rt)throw new InvalidParameterError({param:o});if(rt.name&&isSolidityKeyword(rt.name))throw new SolidityProtectedKeywordError({param:o,name:rt.name});const ot=rt.name?{name:rt.name}:{},it=rt.modifier==="indexed"?{indexed:!0}:{},st=(et==null?void 0:et.structs)??{};let at,ct={};if(nt){at="tuple";const pt=splitParameters(rt.type),mt=[],ft=pt.length;for(let yt=0;yt[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function resolveStructs(o,et,tt=new Set){const nt=[],rt=o.length;for(let ot=0;ot{const et=typeof o=="string"?o:formatAbiItem(o);return normalizeSignature$1(et)};function toSignatureHash(o){return hashSignature(toSignature(o))}const toEventSelector=toSignatureHash,toFunctionSelector=o=>slice(toSignatureHash(o),0,4);function getAbiItem(o){const{abi:et,args:tt=[],name:nt}=o,rt=isHex(nt,{strict:!1}),ot=et.filter(st=>rt?st.type==="function"?toFunctionSelector(st)===nt:st.type==="event"?toEventSelector(st)===nt:!1:"name"in st&&st.name===nt);if(ot.length===0)return;if(ot.length===1)return ot[0];let it;for(const st of ot){if(!("inputs"in st))continue;if(!tt||tt.length===0){if(!st.inputs||st.inputs.length===0)return st;continue}if(!st.inputs||st.inputs.length===0||st.inputs.length!==tt.length)continue;if(tt.every((ct,lt)=>{const dt="inputs"in st&&st.inputs[lt];return dt?isArgOfType(ct,dt):!1})){if(it&&"inputs"in it&&it.inputs){const ct=getAmbiguousTypes(st.inputs,it.inputs,tt);if(ct)throw new AbiItemAmbiguityError({abiItem:st,type:ct[0]},{abiItem:it,type:ct[1]})}it=st}}return it||ot[0]}function isArgOfType(o,et){const tt=typeof o,nt=et.type;switch(nt){case"address":return isAddress(o,{strict:!1});case"bool":return tt==="boolean";case"function":return tt==="string";case"string":return tt==="string";default:return nt==="tuple"&&"components"in et?Object.values(et.components).every((rt,ot)=>isArgOfType(Object.values(o)[ot],rt)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(nt)?tt==="number"||tt==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(nt)?tt==="string"||o instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(nt)?Array.isArray(o)&&o.every(rt=>isArgOfType(rt,{...et,type:nt.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function getAmbiguousTypes(o,et,tt){for(const nt in o){const rt=o[nt],ot=et[nt];if(rt.type==="tuple"&&ot.type==="tuple"&&"components"in rt&&"components"in ot)return getAmbiguousTypes(rt.components,ot.components,tt[nt]);const it=[rt.type,ot.type];if(it.includes("address")&&it.includes("bytes20")?!0:it.includes("address")&&it.includes("string")?isAddress(tt[nt],{strict:!1}):it.includes("address")&&it.includes("bytes")?isAddress(tt[nt],{strict:!1}):!1)return it}}const docsPath$1="/docs/contract/decodeFunctionResult";function decodeFunctionResult(o){const{abi:et,args:tt,functionName:nt,data:rt}=o;let ot=et[0];if(nt){const st=getAbiItem({abi:et,args:tt,name:nt});if(!st)throw new AbiFunctionNotFoundError(nt,{docsPath:docsPath$1});ot=st}if(ot.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$1});if(!ot.outputs)throw new AbiFunctionOutputsNotFoundError(ot.name,{docsPath:docsPath$1});const it=decodeAbiParameters(ot.outputs,rt);if(it&&it.length>1)return it;if(it&&it.length===1)return it[0]}const docsPath="/docs/contract/encodeFunctionData";function prepareEncodeFunctionData(o){const{abi:et,args:tt,functionName:nt}=o;let rt=et[0];if(nt){const ot=getAbiItem({abi:et,args:tt,name:nt});if(!ot)throw new AbiFunctionNotFoundError(nt,{docsPath});rt=ot}if(rt.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath});return{abi:[rt],functionName:toFunctionSelector(formatAbiItem$1(rt))}}function encodeFunctionData(o){const{args:et}=o,{abi:tt,functionName:nt}=(()=>{var st;return o.abi.length===1&&((st=o.functionName)!=null&&st.startsWith("0x"))?o:prepareEncodeFunctionData(o)})(),rt=tt[0],ot=nt,it="inputs"in rt&&rt.inputs?encodeAbiParameters(rt.inputs,et??[]):void 0;return concatHex([ot,it??"0x"])}function getChainContractAddress({blockNumber:o,chain:et,contract:tt}){var rt;const nt=(rt=et==null?void 0:et.contracts)==null?void 0:rt[tt];if(!nt)throw new ChainDoesNotSupportContract({chain:et,contract:{name:tt}});if(o&&nt.blockCreated&&nt.blockCreated>o)throw new ChainDoesNotSupportContract({blockNumber:o,chain:et,contract:{name:tt,blockCreated:nt.blockCreated}});return nt.address}const panicReasons={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function decodeErrorResult(o){const{abi:et,data:tt}=o,nt=slice(tt,0,4);if(nt==="0x")throw new AbiDecodingZeroDataError;const ot=[...et||[],solidityError,solidityPanic].find(it=>it.type==="error"&&nt===toFunctionSelector(formatAbiItem$1(it)));if(!ot)throw new AbiErrorSignatureNotFoundError(nt,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:ot,args:"inputs"in ot&&ot.inputs&&ot.inputs.length>0?decodeAbiParameters(ot.inputs,slice(tt,4)):void 0,errorName:ot.name}}function formatAbiItemWithArgs({abiItem:o,args:et,includeFunctionName:tt=!0,includeName:nt=!1}){if("name"in o&&"inputs"in o&&o.inputs)return`${tt?o.name:""}(${o.inputs.map((rt,ot)=>`${nt&&rt.name?`${rt.name}: `:""}${typeof et[ot]=="object"?stringify$2(et[ot]):et[ot]}`).join(", ")})`}class CallExecutionError extends BaseError$3{constructor(et,{account:tt,docsPath:nt,chain:rt,data:ot,gas:it,gasPrice:st,maxFeePerGas:at,maxPriorityFeePerGas:ct,nonce:lt,to:dt,value:ht,stateOverride:pt}){var yt;const mt=tt?parseAccount(tt):void 0;let ft=prettyPrint({from:mt==null?void 0:mt.address,to:dt,value:typeof ht<"u"&&`${formatEther(ht)} ${((yt=rt==null?void 0:rt.nativeCurrency)==null?void 0:yt.symbol)||"ETH"}`,data:ot,gas:it,gasPrice:typeof st<"u"&&`${formatGwei(st)} gwei`,maxFeePerGas:typeof at<"u"&&`${formatGwei(at)} gwei`,maxPriorityFeePerGas:typeof ct<"u"&&`${formatGwei(ct)} gwei`,nonce:lt});pt&&(ft+=` +${prettyStateOverride(pt)}`),super(et.shortMessage,{cause:et,docsPath:nt,metaMessages:[...et.metaMessages?[...et.metaMessages," "]:[],"Raw Call Arguments:",ft].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=et}}class ContractFunctionExecutionError extends BaseError$3{constructor(et,{abi:tt,args:nt,contractAddress:rt,docsPath:ot,functionName:it,sender:st}){const at=getAbiItem({abi:tt,args:nt,name:it}),ct=at?formatAbiItemWithArgs({abiItem:at,args:nt,includeFunctionName:!1,includeName:!1}):void 0,lt=at?formatAbiItem$1(at,{includeName:!0}):void 0,dt=prettyPrint({address:rt&&getContractAddress(rt),function:lt,args:ct&&ct!=="()"&&`${[...Array((it==null?void 0:it.length)??0).keys()].map(()=>" ").join("")}${ct}`,sender:st});super(et.shortMessage||`An unknown error occurred while executing the contract function "${it}".`,{cause:et,docsPath:ot,metaMessages:[...et.metaMessages?[...et.metaMessages," "]:[],dt&&"Contract Call:",dt].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{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,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=tt,this.args=nt,this.cause=et,this.contractAddress=rt,this.functionName=it,this.sender=st}}class ContractFunctionRevertedError extends BaseError$3{constructor({abi:et,data:tt,functionName:nt,message:rt}){let ot,it,st,at;if(tt&&tt!=="0x")try{it=decodeErrorResult({abi:et,data:tt});const{abiItem:lt,errorName:dt,args:ht}=it;if(dt==="Error")at=ht[0];else if(dt==="Panic"){const[pt]=ht;at=panicReasons[pt]}else{const pt=lt?formatAbiItem$1(lt,{includeName:!0}):void 0,mt=lt&&ht?formatAbiItemWithArgs({abiItem:lt,args:ht,includeFunctionName:!1,includeName:!1}):void 0;st=[pt?`Error: ${pt}`:"",mt&&mt!=="()"?` ${[...Array((dt==null?void 0:dt.length)??0).keys()].map(()=>" ").join("")}${mt}`:""]}}catch(lt){ot=lt}else rt&&(at=rt);let ct;ot instanceof AbiErrorSignatureNotFoundError&&(ct=ot.signature,st=[`Unable to decode signature "${ct}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${ct}.`]),super(at&&at!=="execution reverted"||ct?[`The contract function "${nt}" reverted with the following ${ct?"signature":"reason"}:`,at||ct].join(` +`):`The contract function "${nt}" reverted.`,{cause:ot,metaMessages:st,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=it,this.reason=at,this.signature=ct}}class ContractFunctionZeroDataError extends BaseError$3{constructor({functionName:et}){super(`The contract function "${et}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${et}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class CounterfactualDeploymentFailedError extends BaseError$3{constructor({factory:et}){super(`Deployment for counterfactual contract call failed${et?` for factory "${et}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class RawContractError extends BaseError$3{constructor({data:et,message:tt}){super(tt||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=et}}function isNullUniversalResolverError(o,et){var nt,rt,ot,it,st,at;if(!(o instanceof BaseError$3))return!1;const tt=o.walk(ct=>ct instanceof ContractFunctionRevertedError);return tt instanceof ContractFunctionRevertedError?!!(((nt=tt.data)==null?void 0:nt.errorName)==="ResolverNotFound"||((rt=tt.data)==null?void 0:rt.errorName)==="ResolverWildcardNotSupported"||((ot=tt.data)==null?void 0:ot.errorName)==="ResolverNotContract"||((it=tt.data)==null?void 0:it.errorName)==="ResolverError"||((st=tt.data)==null?void 0:st.errorName)==="HttpError"||(at=tt.reason)!=null&&at.includes("Wildcard on non-extended resolvers is not supported")||et==="reverse"&&tt.reason===panicReasons[50]):!1}function encodedLabelToLabelhash(o){if(o.length!==66||o.indexOf("[")!==0||o.indexOf("]")!==65)return null;const et=`0x${o.slice(1,65)}`;return isHex(et)?et:null}function namehash(o){let et=new Uint8Array(32).fill(0);if(!o)return bytesToHex$4(et);const tt=o.split(".");for(let nt=tt.length-1;nt>=0;nt-=1){const rt=encodedLabelToLabelhash(tt[nt]),ot=rt?toBytes$3(rt):keccak256$1(stringToBytes(tt[nt]),"bytes");et=keccak256$1(concat$3([et,ot]),"bytes")}return bytesToHex$4(et)}function encodeLabelhash(o){return`[${o.slice(2)}]`}function labelhash(o){const et=new Uint8Array(32).fill(0);return o?encodedLabelToLabelhash(o)||keccak256$1(stringToBytes(o)):bytesToHex$4(et)}function packetToBytes(o){const et=o.replace(/^\.|\.$/gm,"");if(et.length===0)return new Uint8Array(1);const tt=new Uint8Array(stringToBytes(et).byteLength+2);let nt=0;const rt=et.split(".");for(let ot=0;ot255&&(it=stringToBytes(encodeLabelhash(labelhash(rt[ot])))),tt[nt]=it.length,tt.set(it,nt+1),nt+=it.length+1}return tt.byteLength!==nt+1?tt.slice(0,nt+1):tt}const EXECUTION_REVERTED_ERROR_CODE=3;function getContractError(o,{abi:et,address:tt,args:nt,docsPath:rt,functionName:ot,sender:it}){const{code:st,data:at,message:ct,shortMessage:lt}=o instanceof RawContractError?o:o instanceof BaseError$3?o.walk(ht=>"data"in ht)||o.walk():{},dt=o instanceof AbiDecodingZeroDataError?new ContractFunctionZeroDataError({functionName:ot}):[EXECUTION_REVERTED_ERROR_CODE,InternalRpcError.code].includes(st)&&(at||ct||lt)?new ContractFunctionRevertedError({abi:et,data:typeof at=="object"?at.data:at,functionName:ot,message:lt??ct}):o;return new ContractFunctionExecutionError(dt,{abi:et,args:nt,contractAddress:tt,docsPath:rt,functionName:ot,sender:it})}const aggregate3Signature="0x82ad56cb",deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";function getCallError(o,{docsPath:et,...tt}){const nt=(()=>{const rt=getNodeError(o,tt);return rt instanceof UnknownNodeError?o:rt})();return new CallExecutionError(nt,{docsPath:et,...tt})}function withResolvers(){let o=()=>{},et=()=>{};return{promise:new Promise((nt,rt)=>{o=nt,et=rt}),resolve:o,reject:et}}const schedulerCache=new Map;function createBatchScheduler({fn:o,id:et,shouldSplitBatch:tt,wait:nt=0,sort:rt}){const ot=async()=>{const lt=at();it();const dt=lt.map(({args:ht})=>ht);dt.length!==0&&o(dt).then(ht=>{rt&&Array.isArray(ht)&&ht.sort(rt);for(let pt=0;pt{for(let pt=0;ptschedulerCache.delete(et),st=()=>at().map(({args:lt})=>lt),at=()=>schedulerCache.get(et)||[],ct=lt=>schedulerCache.set(et,[...at(),lt]);return{flush:it,async schedule(lt){const{promise:dt,resolve:ht,reject:pt}=withResolvers();return(tt==null?void 0:tt([...st(),lt]))&&ot(),at().length>0?(ct({args:lt,resolve:ht,reject:pt}),dt):(ct({args:lt,resolve:ht,reject:pt}),setTimeout(ot,nt),dt)}}}async function call(o,et){var $t,Ot,Bt,zt;const{account:tt=o.account,batch:nt=!!(($t=o.batch)!=null&&$t.multicall),blockNumber:rt,blockTag:ot="latest",accessList:it,blobs:st,code:at,data:ct,factory:lt,factoryData:dt,gas:ht,gasPrice:pt,maxFeePerBlobGas:mt,maxFeePerGas:ft,maxPriorityFeePerGas:yt,nonce:gt,to:xt,value:vt,stateOverride:bt,...Et}=et,wt=tt?parseAccount(tt):void 0;if(at&&(lt||dt))throw new BaseError$3("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(at&&xt)throw new BaseError$3("Cannot provide both `code` & `to` as parameters.");const kt=at&&ct,Tt=lt&&dt&&xt&&ct,Rt=kt||Tt,Pt=kt?toDeploylessCallViaBytecodeData({code:at,data:ct}):Tt?toDeploylessCallViaFactoryData({data:ct,factory:lt,factoryData:dt,to:xt}):ct;try{assertRequest(et);const Yt=(rt?numberToHex(rt):void 0)||ot,Ht=serializeStateOverride(bt),Ut=(zt=(Bt=(Ot=o.chain)==null?void 0:Ot.formatters)==null?void 0:Bt.transactionRequest)==null?void 0:zt.format,Lt=(Ut||formatTransactionRequest)({...extract$1(Et,{format:Ut}),from:wt==null?void 0:wt.address,accessList:it,blobs:st,data:Pt,gas:ht,gasPrice:pt,maxFeePerBlobGas:mt,maxFeePerGas:ft,maxPriorityFeePerGas:yt,nonce:gt,to:Rt?void 0:xt,value:vt});if(nt&&shouldPerformMulticall({request:Lt})&&!Ht)try{return await scheduleMulticall(o,{...Lt,blockNumber:rt,blockTag:ot})}catch(Qt){if(!(Qt instanceof ClientChainNotConfiguredError)&&!(Qt instanceof ChainDoesNotSupportContract))throw Qt}const Zt=await o.request({method:"eth_call",params:Ht?[Lt,Yt,Ht]:[Lt,Yt]});return Zt==="0x"?{data:void 0}:{data:Zt}}catch(Ft){const Yt=getRevertErrorData(Ft),{offchainLookup:Ht,offchainLookupSignature:Ut}=await __vitePreload(async()=>{const{offchainLookup:qt,offchainLookupSignature:Lt}=await import("./ccip-DqOSmZ6J.js");return{offchainLookup:qt,offchainLookupSignature:Lt}},[]);if(o.ccipRead!==!1&&(Yt==null?void 0:Yt.slice(0,10))===Ut&&xt)return{data:await Ht(o,{data:Yt,to:xt})};throw Rt&&(Yt==null?void 0:Yt.slice(0,10))==="0x101bb98d"?new CounterfactualDeploymentFailedError({factory:lt}):getCallError(Ft,{...et,account:wt,chain:o.chain})}}function shouldPerformMulticall({request:o}){const{data:et,to:tt,...nt}=o;return!(!et||et.startsWith(aggregate3Signature)||!tt||Object.values(nt).filter(rt=>typeof rt<"u").length>0)}async function scheduleMulticall(o,et){var ft;const{batchSize:tt=1024,wait:nt=0}=typeof((ft=o.batch)==null?void 0:ft.multicall)=="object"?o.batch.multicall:{},{blockNumber:rt,blockTag:ot="latest",data:it,multicallAddress:st,to:at}=et;let ct=st;if(!ct){if(!o.chain)throw new ClientChainNotConfiguredError;ct=getChainContractAddress({blockNumber:rt,chain:o.chain,contract:"multicall3"})}const dt=(rt?numberToHex(rt):void 0)||ot,{schedule:ht}=createBatchScheduler({id:`${o.uid}.${dt}`,wait:nt,shouldSplitBatch(yt){return yt.reduce((xt,{data:vt})=>xt+(vt.length-2),0)>tt*2},fn:async yt=>{const gt=yt.map(bt=>({allowFailure:!0,callData:bt.data,target:bt.to})),xt=encodeFunctionData({abi:multicall3Abi,args:[gt],functionName:"aggregate3"}),vt=await o.request({method:"eth_call",params:[{data:xt,to:ct},dt]});return decodeFunctionResult({abi:multicall3Abi,args:[gt],functionName:"aggregate3",data:vt||"0x"})}}),[{returnData:pt,success:mt}]=await ht({data:it,to:at});if(!mt)throw new RawContractError({data:pt});return pt==="0x"?{data:void 0}:{data:pt}}function toDeploylessCallViaBytecodeData(o){const{code:et,data:tt}=o;return encodeDeployData({abi:parseAbi(["constructor(bytes, bytes)"]),bytecode:deploylessCallViaBytecodeBytecode,args:[et,tt]})}function toDeploylessCallViaFactoryData(o){const{data:et,factory:tt,factoryData:nt,to:rt}=o;return encodeDeployData({abi:parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:deploylessCallViaFactoryBytecode,args:[rt,et,tt,nt]})}function getRevertErrorData(o){var tt;if(!(o instanceof BaseError$3))return;const et=o.walk();return typeof(et==null?void 0:et.data)=="object"?(tt=et.data)==null?void 0:tt.data:et.data}async function readContract$1(o,et){const{abi:tt,address:nt,args:rt,functionName:ot,...it}=et,st=encodeFunctionData({abi:tt,args:rt,functionName:ot});try{const{data:at}=await getAction$1(o,call,"call")({...it,data:st,to:nt});return decodeFunctionResult({abi:tt,args:rt,functionName:ot,data:at||"0x"})}catch(at){throw getContractError(at,{abi:tt,address:nt,args:rt,docsPath:"/docs/contract/readContract",functionName:ot})}}async function getEnsAddress$1(o,{blockNumber:et,blockTag:tt,coinType:nt,name:rt,gatewayUrls:ot,strict:it,universalResolverAddress:st}){let at=st;if(!at){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");at=getChainContractAddress({blockNumber:et,chain:o.chain,contract:"ensUniversalResolver"})}try{const ct=encodeFunctionData({abi:addressResolverAbi,functionName:"addr",...nt!=null?{args:[namehash(rt),BigInt(nt)]}:{args:[namehash(rt)]}}),lt={address:at,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex(packetToBytes(rt)),ct],blockNumber:et,blockTag:tt},dt=getAction$1(o,readContract$1,"readContract"),ht=ot?await dt({...lt,args:[...lt.args,ot]}):await dt(lt);if(ht[0]==="0x")return null;const pt=decodeFunctionResult({abi:addressResolverAbi,args:nt!=null?[namehash(rt),BigInt(nt)]:void 0,functionName:"addr",data:ht[0]});return pt==="0x"||trim$1(pt)==="0x00"?null:pt}catch(ct){if(it)throw ct;if(isNullUniversalResolverError(ct,"resolve"))return null;throw ct}}class EnsAvatarInvalidMetadataError extends BaseError$3{constructor({data:et}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(et)}`],name:"EnsAvatarInvalidMetadataError"})}}class EnsAvatarInvalidNftUriError extends BaseError$3{constructor({reason:et}){super(`ENS NFT avatar URI is invalid. ${et}`,{name:"EnsAvatarInvalidNftUriError"})}}class EnsAvatarUriResolutionError extends BaseError$3{constructor({uri:et}){super(`Unable to resolve ENS avatar URI "${et}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class EnsAvatarUnsupportedNamespaceError extends BaseError$3{constructor({namespace:et}){super(`ENS NFT avatar namespace "${et}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const networkRegex=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,ipfsHashRegex=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,base64Regex=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dataURIRegex=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function isImageUri(o){try{const et=await fetch(o,{method:"HEAD"});if(et.status===200){const tt=et.headers.get("content-type");return tt==null?void 0:tt.startsWith("image/")}return!1}catch(et){return typeof et=="object"&&typeof et.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(tt=>{const nt=new Image;nt.onload=()=>{tt(!0)},nt.onerror=()=>{tt(!1)},nt.src=o})}}function getGateway(o,et){return o?o.endsWith("/")?o.slice(0,-1):o:et}function resolveAvatarUri({uri:o,gatewayUrls:et}){const tt=base64Regex.test(o);if(tt)return{uri:o,isOnChain:!0,isEncoded:tt};const nt=getGateway(et==null?void 0:et.ipfs,"https://ipfs.io"),rt=getGateway(et==null?void 0:et.arweave,"https://arweave.net"),ot=o.match(networkRegex),{protocol:it,subpath:st,target:at,subtarget:ct=""}=(ot==null?void 0:ot.groups)||{},lt=it==="ipns:/"||st==="ipns/",dt=it==="ipfs:/"||st==="ipfs/"||ipfsHashRegex.test(o);if(o.startsWith("http")&&!lt&&!dt){let pt=o;return et!=null&&et.arweave&&(pt=o.replace(/https:\/\/arweave.net/g,et==null?void 0:et.arweave)),{uri:pt,isOnChain:!1,isEncoded:!1}}if((lt||dt)&&at)return{uri:`${nt}/${lt?"ipns":"ipfs"}/${at}${ct}`,isOnChain:!1,isEncoded:!1};if(it==="ar:/"&&at)return{uri:`${rt}/${at}${ct||""}`,isOnChain:!1,isEncoded:!1};let ht=o.replace(dataURIRegex,"");if(ht.startsWith("rt.json());return await parseAvatarUri({gatewayUrls:o,uri:getJsonImage(tt)})}catch{throw new EnsAvatarUriResolutionError({uri:et})}}async function parseAvatarUri({gatewayUrls:o,uri:et}){const{uri:tt,isOnChain:nt}=resolveAvatarUri({uri:et,gatewayUrls:o});if(nt||await isImageUri(tt))return tt;throw new EnsAvatarUriResolutionError({uri:et})}function parseNftUri(o){let et=o;et.startsWith("did:nft:")&&(et=et.replace("did:nft:","").replace(/_/g,"/"));const[tt,nt,rt]=et.split("/"),[ot,it]=tt.split(":"),[st,at]=nt.split(":");if(!ot||ot.toLowerCase()!=="eip155")throw new EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!it)throw new EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!at)throw new EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!rt)throw new EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!st)throw new EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(it),namespace:st.toLowerCase(),contractAddress:at,tokenID:rt}}async function getNftTokenUri(o,{nft:et}){if(et.namespace==="erc721")return readContract$1(o,{address:et.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(et.tokenID)]});if(et.namespace==="erc1155")return readContract$1(o,{address:et.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(et.tokenID)]});throw new EnsAvatarUnsupportedNamespaceError({namespace:et.namespace})}async function parseAvatarRecord(o,{gatewayUrls:et,record:tt}){return/eip155:/i.test(tt)?parseNftAvatarUri(o,{gatewayUrls:et,record:tt}):parseAvatarUri({uri:tt,gatewayUrls:et})}async function parseNftAvatarUri(o,{gatewayUrls:et,record:tt}){const nt=parseNftUri(tt),rt=await getNftTokenUri(o,{nft:nt}),{uri:ot,isOnChain:it,isEncoded:st}=resolveAvatarUri({uri:rt,gatewayUrls:et});if(it&&(ot.includes("data:application/json;base64,")||ot.startsWith("{"))){const ct=st?atob(ot.replace("data:application/json;base64,","")):ot,lt=JSON.parse(ct);return parseAvatarUri({uri:getJsonImage(lt),gatewayUrls:et})}let at=nt.tokenID;return nt.namespace==="erc1155"&&(at=at.replace("0x","").padStart(64,"0")),getMetadataAvatarUri({gatewayUrls:et,uri:ot.replace(/(?:0x)?{id}/,at)})}async function getEnsText(o,{blockNumber:et,blockTag:tt,name:nt,key:rt,gatewayUrls:ot,strict:it,universalResolverAddress:st}){let at=st;if(!at){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");at=getChainContractAddress({blockNumber:et,chain:o.chain,contract:"ensUniversalResolver"})}try{const ct={address:at,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex(packetToBytes(nt)),encodeFunctionData({abi:textResolverAbi,functionName:"text",args:[namehash(nt),rt]})],blockNumber:et,blockTag:tt},lt=getAction$1(o,readContract$1,"readContract"),dt=ot?await lt({...ct,args:[...ct.args,ot]}):await lt(ct);if(dt[0]==="0x")return null;const ht=decodeFunctionResult({abi:textResolverAbi,functionName:"text",data:dt[0]});return ht===""?null:ht}catch(ct){if(it)throw ct;if(isNullUniversalResolverError(ct,"resolve"))return null;throw ct}}async function getEnsAvatar$1(o,{blockNumber:et,blockTag:tt,assetGatewayUrls:nt,name:rt,gatewayUrls:ot,strict:it,universalResolverAddress:st}){const at=await getAction$1(o,getEnsText,"getEnsText")({blockNumber:et,blockTag:tt,key:"avatar",name:rt,universalResolverAddress:st,gatewayUrls:ot,strict:it});if(!at)return null;try{return await parseAvatarRecord(o,{record:at,gatewayUrls:nt})}catch{return null}}async function getEnsName$1(o,{address:et,blockNumber:tt,blockTag:nt,gatewayUrls:rt,strict:ot,universalResolverAddress:it}){let st=it;if(!st){if(!o.chain)throw new Error("client chain not configured. universalResolverAddress is required.");st=getChainContractAddress({blockNumber:tt,chain:o.chain,contract:"ensUniversalResolver"})}const at=`${et.toLowerCase().substring(2)}.addr.reverse`;try{const ct={address:st,abi:universalResolverReverseAbi,functionName:"reverse",args:[toHex(packetToBytes(at))],blockNumber:tt,blockTag:nt},lt=getAction$1(o,readContract$1,"readContract"),[dt,ht]=rt?await lt({...ct,args:[...ct.args,rt]}):await lt(ct);return et.toLowerCase()!==ht.toLowerCase()?null:dt}catch(ct){if(ot)throw ct;if(isNullUniversalResolverError(ct,"reverse"))return null;throw ct}}const promiseCache$1=new Map,responseCache=new Map;function getCache(o){const et=(rt,ot)=>({clear:()=>ot.delete(rt),get:()=>ot.get(rt),set:it=>ot.set(rt,it)}),tt=et(o,promiseCache$1),nt=et(o,responseCache);return{clear:()=>{tt.clear(),nt.clear()},promise:tt,response:nt}}async function withCache(o,{cacheKey:et,cacheTime:tt=Number.POSITIVE_INFINITY}){const nt=getCache(et),rt=nt.response.get();if(rt&&tt>0&&new Date().getTime()-rt.created.getTime()`blockNumber.${o}`;async function getBlockNumber$1(o,{cacheTime:et=o.cacheTime}={}){const tt=await withCache(()=>o.request({method:"eth_blockNumber"}),{cacheKey:cacheKey(o.uid),cacheTime:et});return BigInt(tt)}function formatLog(o,{args:et,eventName:tt}={}){return{...o,blockHash:o.blockHash?o.blockHash:null,blockNumber:o.blockNumber?BigInt(o.blockNumber):null,logIndex:o.logIndex?Number(o.logIndex):null,transactionHash:o.transactionHash?o.transactionHash:null,transactionIndex:o.transactionIndex?Number(o.transactionIndex):null,...tt?{args:et,eventName:tt}:{}}}const receiptStatuses={"0x0":"reverted","0x1":"success"};function formatTransactionReceipt(o){const et={...o,blockNumber:o.blockNumber?BigInt(o.blockNumber):null,contractAddress:o.contractAddress?o.contractAddress:null,cumulativeGasUsed:o.cumulativeGasUsed?BigInt(o.cumulativeGasUsed):null,effectiveGasPrice:o.effectiveGasPrice?BigInt(o.effectiveGasPrice):null,gasUsed:o.gasUsed?BigInt(o.gasUsed):null,logs:o.logs?o.logs.map(tt=>formatLog(tt)):null,to:o.to?o.to:null,transactionIndex:o.transactionIndex?hexToNumber$2(o.transactionIndex):null,status:o.status?receiptStatuses[o.status]:null,type:o.type?transactionType[o.type]||o.type:null};return o.blobGasPrice&&(et.blobGasPrice=BigInt(o.blobGasPrice)),o.blobGasUsed&&(et.blobGasUsed=BigInt(o.blobGasUsed)),et}const defineTransactionReceipt=defineFormatter("transactionReceipt",formatTransactionReceipt);async function multicall$1(o,et){var yt;const{allowFailure:tt=!0,batchSize:nt,blockNumber:rt,blockTag:ot,multicallAddress:it,stateOverride:st}=et,at=et.contracts,ct=nt??(typeof((yt=o.batch)==null?void 0:yt.multicall)=="object"&&o.batch.multicall.batchSize||1024);let lt=it;if(!lt){if(!o.chain)throw new Error("client chain not configured. multicallAddress is required.");lt=getChainContractAddress({blockNumber:rt,chain:o.chain,contract:"multicall3"})}const dt=[[]];let ht=0,pt=0;for(let gt=0;gt0&&pt>ct&&dt[ht].length>0&&(ht++,pt=(wt.length-2)/2,dt[ht]=[]),dt[ht]=[...dt[ht],{allowFailure:!0,callData:wt,target:vt}]}catch(wt){const kt=getContractError(wt,{abi:xt,address:vt,args:bt,docsPath:"/docs/contract/multicall",functionName:Et});if(!tt)throw kt;dt[ht]=[...dt[ht],{allowFailure:!0,callData:"0x",target:vt}]}}const mt=await Promise.allSettled(dt.map(gt=>getAction$1(o,readContract$1,"readContract")({abi:multicall3Abi,address:lt,args:[gt],blockNumber:rt,blockTag:ot,functionName:"aggregate3",stateOverride:st}))),ft=[];for(let gt=0;gtlistenersCache.get(o)||[],ot=()=>{const lt=rt();listenersCache.set(o,lt.filter(dt=>dt.id!==nt))},it=()=>{const lt=cleanupCache.get(o);rt().length===1&<&<(),ot()},st=rt();if(listenersCache.set(o,[...st,{id:nt,fns:et}]),st&&st.length>0)return it;const at={};for(const lt in et)at[lt]=(...dt)=>{var pt,mt;const ht=rt();if(ht.length!==0)for(const ft of ht)(mt=(pt=ft.fns)[lt])==null||mt.call(pt,...dt)};const ct=tt(at);return typeof ct=="function"&&cleanupCache.set(o,ct),it}async function wait$1(o){return new Promise(et=>setTimeout(et,o))}function poll(o,{emitOnBegin:et,initialWaitTime:tt,interval:nt}){let rt=!0;const ot=()=>rt=!1;return(async()=>{let st;et&&(st=await o({unpoll:ot}));const at=await(tt==null?void 0:tt(st))??nt;await wait$1(at);const ct=async()=>{rt&&(await o({unpoll:ot}),await wait$1(nt),ct())};ct()})(),ot}function watchBlockNumber$1(o,{emitOnBegin:et=!1,emitMissed:tt=!1,onBlockNumber:nt,onError:rt,poll:ot,pollingInterval:it=o.pollingInterval}){const st=typeof ot<"u"?ot:!(o.transport.type==="webSocket"||o.transport.type==="fallback"&&o.transport.transports[0].config.type==="webSocket");let at;return st?(()=>{const dt=stringify$2(["watchBlockNumber",o.uid,et,tt,it]);return observe(dt,{onBlockNumber:nt,onError:rt},ht=>poll(async()=>{var pt;try{const mt=await getAction$1(o,getBlockNumber$1,"getBlockNumber")({cacheTime:0});if(at){if(mt===at)return;if(mt-at>1&&tt)for(let ft=at+1n;ftat)&&(ht.onBlockNumber(mt,at),at=mt)}catch(mt){(pt=ht.onError)==null||pt.call(ht,mt)}},{emitOnBegin:et,interval:it}))})():(()=>{const dt=stringify$2(["watchBlockNumber",o.uid,et,tt]);return observe(dt,{onBlockNumber:nt,onError:rt},ht=>{let pt=!0,mt=()=>pt=!1;return(async()=>{try{const ft=(()=>{if(o.transport.type==="fallback"){const gt=o.transport.transports.find(xt=>xt.config.type==="webSocket");return gt?gt.value:o.transport}return o.transport})(),{unsubscribe:yt}=await ft.subscribe({params:["newHeads"],onData(gt){var vt;if(!pt)return;const xt=hexToBigInt((vt=gt.result)==null?void 0:vt.number);ht.onBlockNumber(xt,at),at=xt},onError(gt){var xt;(xt=ht.onError)==null||xt.call(ht,gt)}});mt=yt,pt||mt()}catch(ft){rt==null||rt(ft)}})(),()=>mt()})})()}const promiseCache=new LruMap(8192);function withDedupe(o,{enabled:et=!0,id:tt}){if(!et||!tt)return o();if(promiseCache.get(tt))return promiseCache.get(tt);const nt=o().finally(()=>promiseCache.delete(tt));return promiseCache.set(tt,nt),nt}function withRetry(o,{delay:et=100,retryCount:tt=2,shouldRetry:nt=()=>!0}={}){return new Promise((rt,ot)=>{const it=async({count:st=0}={})=>{const at=async({error:ct})=>{const lt=typeof et=="function"?et({count:st,error:ct}):et;lt&&await wait$1(lt),it({count:st+1})};try{const ct=await o();rt(ct)}catch(ct){if(st{const{dedupe:rt=!1,retryDelay:ot=150,retryCount:it=3,uid:st}={...et,...nt},at=rt?keccak256$1(stringToHex(`${st}.${stringify$2(tt)}`)):void 0;return withDedupe(()=>withRetry(async()=>{try{return await o(tt)}catch(ct){const lt=ct;switch(lt.code){case ParseRpcError.code:throw new ParseRpcError(lt);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(lt);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(lt,{method:tt.method});case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(lt);case InternalRpcError.code:throw new InternalRpcError(lt);case InvalidInputRpcError.code:throw new InvalidInputRpcError(lt);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(lt);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(lt);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(lt);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(lt,{method:tt.method});case LimitExceededRpcError.code:throw new LimitExceededRpcError(lt);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(lt);case UserRejectedRequestError.code:throw new UserRejectedRequestError(lt);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(lt);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(lt);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(lt);case ChainDisconnectedError.code:throw new ChainDisconnectedError(lt);case SwitchChainError.code:throw new SwitchChainError(lt);case 5e3:throw new UserRejectedRequestError(lt);default:throw ct instanceof BaseError$3?ct:new UnknownRpcError(lt)}}},{delay:({count:ct,error:lt})=>{var dt;if(lt&< instanceof HttpRequestError){const ht=(dt=lt==null?void 0:lt.headers)==null?void 0:dt.get("Retry-After");if(ht!=null&&ht.match(/\d/))return Number.parseInt(ht)*1e3}return~~(1<shouldRetry(ct)}),{enabled:rt,id:at})}}function shouldRetry(o){return"code"in o&&typeof o.code=="number"?o.code===-1||o.code===LimitExceededRpcError.code||o.code===InternalRpcError.code:o instanceof HttpRequestError&&o.status?o.status===403||o.status===408||o.status===413||o.status===429||o.status===500||o.status===502||o.status===503||o.status===504:!0}function defineChain(o){return{formatters:void 0,fees:void 0,serializers:void 0,...o}}function withTimeout(o,{errorInstance:et=new Error("timed out"),timeout:tt,signal:nt}){return new Promise((rt,ot)=>{(async()=>{let it;try{const st=new AbortController;tt>0&&(it=setTimeout(()=>{nt?st.abort():ot(et)},tt)),rt(await o({signal:(st==null?void 0:st.signal)||null}))}catch(st){(st==null?void 0:st.name)==="AbortError"&&ot(et),ot(st)}finally{clearTimeout(it)}})()})}function createIdStore(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const idCache=createIdStore();function getHttpRpcClient(o,et={}){return{async request(tt){var dt;const{body:nt,onRequest:rt=et.onRequest,onResponse:ot=et.onResponse,timeout:it=et.timeout??1e4}=tt,st={...et.fetchOptions??{},...tt.fetchOptions??{}},{headers:at,method:ct,signal:lt}=st;try{const ht=await withTimeout(async({signal:mt})=>{const ft={...st,body:Array.isArray(nt)?stringify$2(nt.map(vt=>({jsonrpc:"2.0",id:vt.id??idCache.take(),...vt}))):stringify$2({jsonrpc:"2.0",id:nt.id??idCache.take(),...nt}),headers:{"Content-Type":"application/json",...at},method:ct||"POST",signal:lt||(it>0?mt:null)},yt=new Request(o,ft),gt=await(rt==null?void 0:rt(yt,ft))??{...ft,url:o};return await fetch(gt.url??o,gt)},{errorInstance:new TimeoutError$4({body:nt,url:o}),timeout:it,signal:!0});ot&&await ot(ht);let pt;if((dt=ht.headers.get("Content-Type"))!=null&&dt.startsWith("application/json"))pt=await ht.json();else{pt=await ht.text();try{pt=JSON.parse(pt||"{}")}catch(mt){if(ht.ok)throw mt;pt={error:pt}}}if(!ht.ok)throw new HttpRequestError({body:nt,details:stringify$2(pt.error)||ht.statusText,headers:ht.headers,status:ht.status,url:o});return pt}catch(ht){throw ht instanceof HttpRequestError||ht instanceof TimeoutError$4?ht:new HttpRequestError({body:nt,cause:ht,url:o})}}}}function assertTransactionEIP7702(o){const{authorizationList:et}=o;if(et)for(const tt of et){const{contractAddress:nt,chainId:rt}=tt;if(!isAddress(nt))throw new InvalidAddressError({address:nt});if(rt<0)throw new InvalidChainIdError({chainId:rt})}assertTransactionEIP1559(o)}function assertTransactionEIP4844(o){const{blobVersionedHashes:et}=o;if(et){if(et.length===0)throw new EmptyBlobError;for(const tt of et){const nt=size$2(tt),rt=hexToNumber$2(slice(tt,0,1));if(nt!==32)throw new InvalidVersionedHashSizeError({hash:tt,size:nt});if(rt!==versionedHashVersionKzg)throw new InvalidVersionedHashVersionError({hash:tt,version:rt})}}assertTransactionEIP1559(o)}function assertTransactionEIP1559(o){const{chainId:et,maxPriorityFeePerGas:tt,maxFeePerGas:nt,to:rt}=o;if(et<=0)throw new InvalidChainIdError({chainId:et});if(rt&&!isAddress(rt))throw new InvalidAddressError({address:rt});if(nt&&nt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:nt});if(tt&&nt&&tt>nt)throw new TipAboveFeeCapError({maxFeePerGas:nt,maxPriorityFeePerGas:tt})}function assertTransactionEIP2930(o){const{chainId:et,maxPriorityFeePerGas:tt,gasPrice:nt,maxFeePerGas:rt,to:ot}=o;if(et<=0)throw new InvalidChainIdError({chainId:et});if(ot&&!isAddress(ot))throw new InvalidAddressError({address:ot});if(tt||rt)throw new BaseError$3("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(nt&&nt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:nt})}function assertTransactionLegacy(o){const{chainId:et,maxPriorityFeePerGas:tt,gasPrice:nt,maxFeePerGas:rt,to:ot}=o;if(ot&&!isAddress(ot))throw new InvalidAddressError({address:ot});if(typeof et<"u"&&et<=0)throw new InvalidChainIdError({chainId:et});if(tt||rt)throw new BaseError$3("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(nt&&nt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:nt})}function serializeAuthorizationList(o){if(!o||o.length===0)return[];const et=[];for(const tt of o){const{contractAddress:nt,chainId:rt,nonce:ot,...it}=tt;et.push([rt?toHex(rt):"0x",nt,ot?toHex(ot):"0x",...toYParitySignatureArray({},it)])}return et}function serializeAccessList(o){if(!o||o.length===0)return[];const et=[];for(let tt=0;tt"u"||typeof pt>"u")){const vt=typeof o.blobs[0]=="string"?o.blobs:o.blobs.map(wt=>bytesToHex$4(wt)),bt=o.kzg,Et=blobsToCommitments({blobs:vt,kzg:bt});if(typeof ht>"u"&&(ht=commitmentsToVersionedHashes({commitments:Et})),typeof pt>"u"){const wt=blobsToProofs({blobs:vt,commitments:Et,kzg:bt});pt=toBlobSidecars({blobs:vt,commitments:Et,proofs:wt})}}const mt=serializeAccessList(lt),ft=[toHex(tt),rt?toHex(rt):"0x",ct?toHex(ct):"0x",at?toHex(at):"0x",nt?toHex(nt):"0x",ot??"0x",it?toHex(it):"0x",dt??"0x",mt,st?toHex(st):"0x",ht??[],...toYParitySignatureArray(o,et)],yt=[],gt=[],xt=[];if(pt)for(let vt=0;vt{if(et.v>=35n)return(et.v-35n)/2n>0?et.v:27n+(et.v===35n?0n:1n);if(tt>0)return BigInt(tt*2)+BigInt(35n+et.v-27n);const pt=27n+(et.v===27n?0n:1n);if(et.v!==pt)throw new InvalidLegacyVError({v:et.v});return pt})(),dt=trim$1(et.r),ht=trim$1(et.s);ct=[...ct,toHex(lt),dt==="0x00"?"0x":dt,ht==="0x00"?"0x":ht]}else tt>0&&(ct=[...ct,toHex(tt),"0x","0x"]);return toRlp(ct)}function toYParitySignatureArray(o,et){const tt=et??o,{v:nt,yParity:rt}=tt;if(typeof tt.r>"u")return[];if(typeof tt.s>"u")return[];if(typeof nt>"u"&&typeof rt>"u")return[];const ot=trim$1(tt.r),it=trim$1(tt.s);return[typeof rt=="number"?rt?toHex(1):"0x":nt===0n?"0x":nt===1n?toHex(1):nt===27n?"0x":toHex(1),ot==="0x00"?"0x":ot,it==="0x00"?"0x":it]}async function signMessage$1(o,{account:et=o.account,message:tt}){if(!et)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const nt=parseAccount(et);if(nt.signMessage)return nt.signMessage({message:tt});const rt=typeof tt=="string"?stringToHex(tt):tt.raw instanceof Uint8Array?toHex(tt.raw):tt.raw;return o.request({method:"personal_sign",params:[rt,nt.address]},{retryCount:0})}class HMAC extends Hash{constructor(et,tt){super(),this.finished=!1,this.destroyed=!1,hash$1(et);const nt=toBytes$2(tt);if(this.iHash=et.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const rt=this.blockLen,ot=new Uint8Array(rt);ot.set(nt.length>rt?et.create().update(nt).digest():nt);for(let it=0;itnew HMAC(o,et).update(tt).digest();hmac.create=(o,et)=>new HMAC(o,et);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$6=BigInt(0),_1n$8=BigInt(1),_2n$5=BigInt(2);function isBytes$2(o){return o instanceof Uint8Array||o!=null&&typeof o=="object"&&o.constructor.name==="Uint8Array"}function abytes(o){if(!isBytes$2(o))throw new Error("Uint8Array expected")}function abool(o,et){if(typeof et!="boolean")throw new Error(`${o} must be valid boolean, got "${et}".`)}const hexes$1=Array.from({length:256},(o,et)=>et.toString(16).padStart(2,"0"));function bytesToHex$2(o){abytes(o);let et="";for(let tt=0;tt=asciis._0&&o<=asciis._9)return o-asciis._0;if(o>=asciis._A&&o<=asciis._F)return o-(asciis._A-10);if(o>=asciis._a&&o<=asciis._f)return o-(asciis._a-10)}function hexToBytes$2(o){if(typeof o!="string")throw new Error("hex string expected, got "+typeof o);const et=o.length,tt=et/2;if(et%2)throw new Error("padded hex string expected, got unpadded hex of length "+et);const nt=new Uint8Array(tt);for(let rt=0,ot=0;rttypeof o=="bigint"&&_0n$6<=o;function inRange(o,et,tt){return isPosBig(o)&&isPosBig(et)&&isPosBig(tt)&&et<=o&&o_0n$6;o>>=_1n$8,et+=1);return et}function bitGet(o,et){return o>>BigInt(et)&_1n$8}function bitSet(o,et,tt){return o|(tt?_1n$8:_0n$6)<(_2n$5<new Uint8Array(o),u8fr=o=>Uint8Array.from(o);function createHmacDrbg(o,et,tt){if(typeof o!="number"||o<2)throw new Error("hashLen must be a number");if(typeof et!="number"||et<2)throw new Error("qByteLen must be a number");if(typeof tt!="function")throw new Error("hmacFn must be a function");let nt=u8n(o),rt=u8n(o),ot=0;const it=()=>{nt.fill(1),rt.fill(0),ot=0},st=(...dt)=>tt(rt,nt,...dt),at=(dt=u8n())=>{rt=st(u8fr([0]),dt),nt=st(),dt.length!==0&&(rt=st(u8fr([1]),dt),nt=st())},ct=()=>{if(ot++>=1e3)throw new Error("drbg: tried 1000 values");let dt=0;const ht=[];for(;dt{it(),at(dt);let pt;for(;!(pt=ht(ct()));)at();return it(),pt}}const validatorFns={bigint:o=>typeof o=="bigint",function:o=>typeof o=="function",boolean:o=>typeof o=="boolean",string:o=>typeof o=="string",stringOrUint8Array:o=>typeof o=="string"||isBytes$2(o),isSafeInteger:o=>Number.isSafeInteger(o),array:o=>Array.isArray(o),field:(o,et)=>et.Fp.isValid(o),hash:o=>typeof o=="function"&&Number.isSafeInteger(o.outputLen)};function validateObject(o,et,tt={}){const nt=(rt,ot,it)=>{const st=validatorFns[ot];if(typeof st!="function")throw new Error(`Invalid validator "${ot}", expected function`);const at=o[rt];if(!(it&&at===void 0)&&!st(at,o))throw new Error(`Invalid param ${String(rt)}=${at} (${typeof at}), expected ${ot}`)};for(const[rt,ot]of Object.entries(et))nt(rt,ot,!1);for(const[rt,ot]of Object.entries(tt))nt(rt,ot,!0);return o}const notImplemented=()=>{throw new Error("not implemented")};function memoized(o){const et=new WeakMap;return(tt,...nt)=>{const rt=et.get(tt);if(rt!==void 0)return rt;const ot=o(tt,...nt);return et.set(tt,ot),ot}}const ut=Object.freeze(Object.defineProperty({__proto__:null,aInRange,abool,abytes,bitGet,bitLen,bitMask,bitSet,bytesToHex:bytesToHex$2,bytesToNumberBE,bytesToNumberLE,concatBytes:concatBytes$1,createHmacDrbg,ensureBytes:ensureBytes$1,equalBytes:equalBytes$1,hexToBytes:hexToBytes$2,hexToNumber:hexToNumber$1,inRange,isBytes:isBytes$2,memoized,notImplemented,numberToBytesBE,numberToBytesLE,numberToHexUnpadded:numberToHexUnpadded$1,numberToVarBytesBE,utf8ToBytes:utf8ToBytes$2,validateObject},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$5=BigInt(0),_1n$7=BigInt(1),_2n$4=BigInt(2),_3n$3=BigInt(3),_4n=BigInt(4),_5n$1=BigInt(5),_8n$3=BigInt(8);BigInt(9);BigInt(16);function mod$1(o,et){const tt=o%et;return tt>=_0n$5?tt:et+tt}function pow(o,et,tt){if(tt<=_0n$5||et<_0n$5)throw new Error("Expected power/modulo > 0");if(tt===_1n$7)return _0n$5;let nt=_1n$7;for(;et>_0n$5;)et&_1n$7&&(nt=nt*o%tt),o=o*o%tt,et>>=_1n$7;return nt}function pow2$1(o,et,tt){let nt=o;for(;et-- >_0n$5;)nt*=nt,nt%=tt;return nt}function invert$1(o,et){if(o===_0n$5||et<=_0n$5)throw new Error(`invert: expected positive integers, got n=${o} mod=${et}`);let tt=mod$1(o,et),nt=et,rt=_0n$5,ot=_1n$7;for(;tt!==_0n$5;){const st=nt/tt,at=nt%tt,ct=rt-ot*st;nt=tt,tt=at,rt=ot,ot=ct}if(nt!==_1n$7)throw new Error("invert: does not exist");return mod$1(rt,et)}function tonelliShanks(o){const et=(o-_1n$7)/_2n$4;let tt,nt,rt;for(tt=o-_1n$7,nt=0;tt%_2n$4===_0n$5;tt/=_2n$4,nt++);for(rt=_2n$4;rt(mod$1(o,et)&_1n$7)===_1n$7,FIELD_FIELDS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField(o){const et={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},tt=FIELD_FIELDS.reduce((nt,rt)=>(nt[rt]="function",nt),et);return validateObject(o,tt)}function FpPow(o,et,tt){if(tt<_0n$5)throw new Error("Expected power > 0");if(tt===_0n$5)return o.ONE;if(tt===_1n$7)return et;let nt=o.ONE,rt=et;for(;tt>_0n$5;)tt&_1n$7&&(nt=o.mul(nt,rt)),rt=o.sqr(rt),tt>>=_1n$7;return nt}function FpInvertBatch(o,et){const tt=new Array(et.length),nt=et.reduce((ot,it,st)=>o.is0(it)?ot:(tt[st]=ot,o.mul(ot,it)),o.ONE),rt=o.inv(nt);return et.reduceRight((ot,it,st)=>o.is0(it)?ot:(tt[st]=o.mul(ot,tt[st]),o.mul(ot,it)),rt),tt}function nLength(o,et){const tt=et!==void 0?et:o.toString(2).length,nt=Math.ceil(tt/8);return{nBitLength:tt,nByteLength:nt}}function Field$1(o,et,tt=!1,nt={}){if(o<=_0n$5)throw new Error(`Expected Field ORDER > 0, got ${o}`);const{nBitLength:rt,nByteLength:ot}=nLength(o,et);if(ot>2048)throw new Error("Field lengths over 2048 bytes are not supported");const it=FpSqrt(o),st=Object.freeze({ORDER:o,BITS:rt,BYTES:ot,MASK:bitMask(rt),ZERO:_0n$5,ONE:_1n$7,create:at=>mod$1(at,o),isValid:at=>{if(typeof at!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof at}`);return _0n$5<=at&&atat===_0n$5,isOdd:at=>(at&_1n$7)===_1n$7,neg:at=>mod$1(-at,o),eql:(at,ct)=>at===ct,sqr:at=>mod$1(at*at,o),add:(at,ct)=>mod$1(at+ct,o),sub:(at,ct)=>mod$1(at-ct,o),mul:(at,ct)=>mod$1(at*ct,o),pow:(at,ct)=>FpPow(st,at,ct),div:(at,ct)=>mod$1(at*invert$1(ct,o),o),sqrN:at=>at*at,addN:(at,ct)=>at+ct,subN:(at,ct)=>at-ct,mulN:(at,ct)=>at*ct,inv:at=>invert$1(at,o),sqrt:nt.sqrt||(at=>it(st,at)),invertBatch:at=>FpInvertBatch(st,at),cmov:(at,ct,lt)=>lt?ct:at,toBytes:at=>tt?numberToBytesLE(at,ot):numberToBytesBE(at,ot),fromBytes:at=>{if(at.length!==ot)throw new Error(`Fp.fromBytes: expected ${ot}, got ${at.length}`);return tt?bytesToNumberLE(at):bytesToNumberBE(at)}});return Object.freeze(st)}function getFieldBytesLength(o){if(typeof o!="bigint")throw new Error("field order must be bigint");const et=o.toString(2).length;return Math.ceil(et/8)}function getMinHashLength(o){const et=getFieldBytesLength(o);return et+Math.ceil(et/2)}function mapHashToField(o,et,tt=!1){const nt=o.length,rt=getFieldBytesLength(et),ot=getMinHashLength(et);if(nt<16||nt1024)throw new Error(`expected ${ot}-1024 bytes of input, got ${nt}`);const it=tt?bytesToNumberBE(o):bytesToNumberLE(o),st=mod$1(it,et-_1n$7)+_1n$7;return tt?numberToBytesLE(st,rt):numberToBytesBE(st,rt)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$4=BigInt(0),_1n$6=BigInt(1),pointPrecomputes$1=new WeakMap,pointWindowSizes=new WeakMap;function wNAF(o,et){const tt=(ot,it)=>{const st=it.negate();return ot?st:it},nt=ot=>{if(!Number.isSafeInteger(ot)||ot<=0||ot>et)throw new Error(`Wrong window size=${ot}, should be [1..${et}]`)},rt=ot=>{nt(ot);const it=Math.ceil(et/ot)+1,st=2**(ot-1);return{windows:it,windowSize:st}};return{constTimeNegate:tt,unsafeLadder(ot,it){let st=o.ZERO,at=ot;for(;it>_0n$4;)it&_1n$6&&(st=st.add(at)),at=at.double(),it>>=_1n$6;return st},precomputeWindow(ot,it){const{windows:st,windowSize:at}=rt(it),ct=[];let lt=ot,dt=lt;for(let ht=0;ht>=mt,gt>ct&&(gt-=pt,st+=_1n$6);const xt=yt,vt=yt+Math.abs(gt)-1,bt=ft%2!==0,Et=gt<0;gt===0?dt=dt.add(tt(bt,it[xt])):lt=lt.add(tt(Et,it[vt]))}return{p:lt,f:dt}},wNAFCached(ot,it,st){const at=pointWindowSizes.get(ot)||1;let ct=pointPrecomputes$1.get(ot);return ct||(ct=this.precomputeWindow(ot,at),at!==1&&pointPrecomputes$1.set(ot,st(ct))),this.wNAF(at,ct,it)},setWindowSize(ot,it){nt(it),pointWindowSizes.set(ot,it),pointPrecomputes$1.delete(ot)}}}function pippenger(o,et,tt,nt){if(!Array.isArray(tt)||!Array.isArray(nt)||nt.length!==tt.length)throw new Error("arrays of points and scalars must have equal length");nt.forEach((lt,dt)=>{if(!et.isValid(lt))throw new Error(`wrong scalar at index ${dt}`)}),tt.forEach((lt,dt)=>{if(!(lt instanceof o))throw new Error(`wrong point at index ${dt}`)});const rt=bitLen(BigInt(tt.length)),ot=rt>12?rt-3:rt>4?rt-2:rt?2:1,it=(1<=0;lt-=ot){st.fill(o.ZERO);for(let ht=0;ht>BigInt(lt)&BigInt(it));st[mt]=st[mt].add(tt[ht])}let dt=o.ZERO;for(let ht=st.length-1,pt=o.ZERO;ht>0;ht--)pt=pt.add(st[ht]),dt=dt.add(pt);if(ct=ct.add(dt),lt!==0)for(let ht=0;ht{const{Err:tt}=DER;if(o<0||o>256)throw new tt("tlv.encode: wrong tag");if(et.length&1)throw new tt("tlv.encode: unpadded data");const nt=et.length/2,rt=numberToHexUnpadded$1(nt);if(rt.length/2&128)throw new tt("tlv.encode: long form length too big");const ot=nt>127?numberToHexUnpadded$1(rt.length/2|128):"";return`${numberToHexUnpadded$1(o)}${ot}${rt}${et}`},decode(o,et){const{Err:tt}=DER;let nt=0;if(o<0||o>256)throw new tt("tlv.encode: wrong tag");if(et.length<2||et[nt++]!==o)throw new tt("tlv.decode: wrong tlv");const rt=et[nt++],ot=!!(rt&128);let it=0;if(!ot)it=rt;else{const at=rt&127;if(!at)throw new tt("tlv.decode(long): indefinite length not supported");if(at>4)throw new tt("tlv.decode(long): byte length is too big");const ct=et.subarray(nt,nt+at);if(ct.length!==at)throw new tt("tlv.decode: length bytes not complete");if(ct[0]===0)throw new tt("tlv.decode(long): zero leftmost byte");for(const lt of ct)it=it<<8|lt;if(nt+=at,it<128)throw new tt("tlv.decode(long): not minimal encoding")}const st=et.subarray(nt,nt+it);if(st.length!==it)throw new tt("tlv.decode: wrong value length");return{v:st,l:et.subarray(nt+it)}}},_int:{encode(o){const{Err:et}=DER;if(o<_0n$3)throw new et("integer: negative integers are not allowed");let tt=numberToHexUnpadded$1(o);if(Number.parseInt(tt[0],16)&8&&(tt="00"+tt),tt.length&1)throw new et("unexpected assertion");return tt},decode(o){const{Err:et}=DER;if(o[0]&128)throw new et("Invalid signature integer: negative");if(o[0]===0&&!(o[1]&128))throw new et("Invalid signature integer: unnecessary leading zero");return b2n(o)}},toSig(o){const{Err:et,_int:tt,_tlv:nt}=DER,rt=typeof o=="string"?h2b(o):o;abytes(rt);const{v:ot,l:it}=nt.decode(48,rt);if(it.length)throw new et("Invalid signature: left bytes after parsing");const{v:st,l:at}=nt.decode(2,ot),{v:ct,l:lt}=nt.decode(2,at);if(lt.length)throw new et("Invalid signature: left bytes after parsing");return{r:tt.decode(st),s:tt.decode(ct)}},hexFromSig(o){const{_tlv:et,_int:tt}=DER,nt=`${et.encode(2,tt.encode(o.r))}${et.encode(2,tt.encode(o.s))}`;return et.encode(48,nt)}},_0n$3=BigInt(0),_1n$5=BigInt(1);BigInt(2);const _3n$2=BigInt(3);BigInt(4);function weierstrassPoints(o){const et=validatePointOpts(o),{Fp:tt}=et,nt=Field$1(et.n,et.nBitLength),rt=et.toBytes||((ft,yt,gt)=>{const xt=yt.toAffine();return concatBytes$1(Uint8Array.from([4]),tt.toBytes(xt.x),tt.toBytes(xt.y))}),ot=et.fromBytes||(ft=>{const yt=ft.subarray(1),gt=tt.fromBytes(yt.subarray(0,tt.BYTES)),xt=tt.fromBytes(yt.subarray(tt.BYTES,2*tt.BYTES));return{x:gt,y:xt}});function it(ft){const{a:yt,b:gt}=et,xt=tt.sqr(ft),vt=tt.mul(xt,ft);return tt.add(tt.add(vt,tt.mul(ft,yt)),gt)}if(!tt.eql(tt.sqr(et.Gy),it(et.Gx)))throw new Error("bad generator point: equation left != right");function st(ft){return inRange(ft,_1n$5,et.n)}function at(ft){const{allowedPrivateKeyLengths:yt,nByteLength:gt,wrapPrivateKey:xt,n:vt}=et;if(yt&&typeof ft!="bigint"){if(isBytes$2(ft)&&(ft=bytesToHex$2(ft)),typeof ft!="string"||!yt.includes(ft.length))throw new Error("Invalid key");ft=ft.padStart(gt*2,"0")}let bt;try{bt=typeof ft=="bigint"?ft:bytesToNumberBE(ensureBytes$1("private key",ft,gt))}catch{throw new Error(`private key must be ${gt} bytes, hex or bigint, not ${typeof ft}`)}return xt&&(bt=mod$1(bt,vt)),aInRange("private key",bt,_1n$5,vt),bt}function ct(ft){if(!(ft instanceof ht))throw new Error("ProjectivePoint expected")}const lt=memoized((ft,yt)=>{const{px:gt,py:xt,pz:vt}=ft;if(tt.eql(vt,tt.ONE))return{x:gt,y:xt};const bt=ft.is0();yt==null&&(yt=bt?tt.ONE:tt.inv(vt));const Et=tt.mul(gt,yt),wt=tt.mul(xt,yt),kt=tt.mul(vt,yt);if(bt)return{x:tt.ZERO,y:tt.ZERO};if(!tt.eql(kt,tt.ONE))throw new Error("invZ was invalid");return{x:Et,y:wt}}),dt=memoized(ft=>{if(ft.is0()){if(et.allowInfinityPoint&&!tt.is0(ft.py))return;throw new Error("bad point: ZERO")}const{x:yt,y:gt}=ft.toAffine();if(!tt.isValid(yt)||!tt.isValid(gt))throw new Error("bad point: x or y not FE");const xt=tt.sqr(gt),vt=it(yt);if(!tt.eql(xt,vt))throw new Error("bad point: equation left != right");if(!ft.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class ht{constructor(yt,gt,xt){if(this.px=yt,this.py=gt,this.pz=xt,yt==null||!tt.isValid(yt))throw new Error("x required");if(gt==null||!tt.isValid(gt))throw new Error("y required");if(xt==null||!tt.isValid(xt))throw new Error("z required");Object.freeze(this)}static fromAffine(yt){const{x:gt,y:xt}=yt||{};if(!yt||!tt.isValid(gt)||!tt.isValid(xt))throw new Error("invalid affine point");if(yt instanceof ht)throw new Error("projective point not allowed");const vt=bt=>tt.eql(bt,tt.ZERO);return vt(gt)&&vt(xt)?ht.ZERO:new ht(gt,xt,tt.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(yt){const gt=tt.invertBatch(yt.map(xt=>xt.pz));return yt.map((xt,vt)=>xt.toAffine(gt[vt])).map(ht.fromAffine)}static fromHex(yt){const gt=ht.fromAffine(ot(ensureBytes$1("pointHex",yt)));return gt.assertValidity(),gt}static fromPrivateKey(yt){return ht.BASE.multiply(at(yt))}static msm(yt,gt){return pippenger(ht,nt,yt,gt)}_setWindowSize(yt){mt.setWindowSize(this,yt)}assertValidity(){dt(this)}hasEvenY(){const{y:yt}=this.toAffine();if(tt.isOdd)return!tt.isOdd(yt);throw new Error("Field doesn't support isOdd")}equals(yt){ct(yt);const{px:gt,py:xt,pz:vt}=this,{px:bt,py:Et,pz:wt}=yt,kt=tt.eql(tt.mul(gt,wt),tt.mul(bt,vt)),Tt=tt.eql(tt.mul(xt,wt),tt.mul(Et,vt));return kt&&Tt}negate(){return new ht(this.px,tt.neg(this.py),this.pz)}double(){const{a:yt,b:gt}=et,xt=tt.mul(gt,_3n$2),{px:vt,py:bt,pz:Et}=this;let wt=tt.ZERO,kt=tt.ZERO,Tt=tt.ZERO,Rt=tt.mul(vt,vt),Pt=tt.mul(bt,bt),$t=tt.mul(Et,Et),Ot=tt.mul(vt,bt);return Ot=tt.add(Ot,Ot),Tt=tt.mul(vt,Et),Tt=tt.add(Tt,Tt),wt=tt.mul(yt,Tt),kt=tt.mul(xt,$t),kt=tt.add(wt,kt),wt=tt.sub(Pt,kt),kt=tt.add(Pt,kt),kt=tt.mul(wt,kt),wt=tt.mul(Ot,wt),Tt=tt.mul(xt,Tt),$t=tt.mul(yt,$t),Ot=tt.sub(Rt,$t),Ot=tt.mul(yt,Ot),Ot=tt.add(Ot,Tt),Tt=tt.add(Rt,Rt),Rt=tt.add(Tt,Rt),Rt=tt.add(Rt,$t),Rt=tt.mul(Rt,Ot),kt=tt.add(kt,Rt),$t=tt.mul(bt,Et),$t=tt.add($t,$t),Rt=tt.mul($t,Ot),wt=tt.sub(wt,Rt),Tt=tt.mul($t,Pt),Tt=tt.add(Tt,Tt),Tt=tt.add(Tt,Tt),new ht(wt,kt,Tt)}add(yt){ct(yt);const{px:gt,py:xt,pz:vt}=this,{px:bt,py:Et,pz:wt}=yt;let kt=tt.ZERO,Tt=tt.ZERO,Rt=tt.ZERO;const Pt=et.a,$t=tt.mul(et.b,_3n$2);let Ot=tt.mul(gt,bt),Bt=tt.mul(xt,Et),zt=tt.mul(vt,wt),Ft=tt.add(gt,xt),Yt=tt.add(bt,Et);Ft=tt.mul(Ft,Yt),Yt=tt.add(Ot,Bt),Ft=tt.sub(Ft,Yt),Yt=tt.add(gt,vt);let Ht=tt.add(bt,wt);return Yt=tt.mul(Yt,Ht),Ht=tt.add(Ot,zt),Yt=tt.sub(Yt,Ht),Ht=tt.add(xt,vt),kt=tt.add(Et,wt),Ht=tt.mul(Ht,kt),kt=tt.add(Bt,zt),Ht=tt.sub(Ht,kt),Rt=tt.mul(Pt,Yt),kt=tt.mul($t,zt),Rt=tt.add(kt,Rt),kt=tt.sub(Bt,Rt),Rt=tt.add(Bt,Rt),Tt=tt.mul(kt,Rt),Bt=tt.add(Ot,Ot),Bt=tt.add(Bt,Ot),zt=tt.mul(Pt,zt),Yt=tt.mul($t,Yt),Bt=tt.add(Bt,zt),zt=tt.sub(Ot,zt),zt=tt.mul(Pt,zt),Yt=tt.add(Yt,zt),Ot=tt.mul(Bt,Yt),Tt=tt.add(Tt,Ot),Ot=tt.mul(Ht,Yt),kt=tt.mul(Ft,kt),kt=tt.sub(kt,Ot),Ot=tt.mul(Ft,Bt),Rt=tt.mul(Ht,Rt),Rt=tt.add(Rt,Ot),new ht(kt,Tt,Rt)}subtract(yt){return this.add(yt.negate())}is0(){return this.equals(ht.ZERO)}wNAF(yt){return mt.wNAFCached(this,yt,ht.normalizeZ)}multiplyUnsafe(yt){aInRange("scalar",yt,_0n$3,et.n);const gt=ht.ZERO;if(yt===_0n$3)return gt;if(yt===_1n$5)return this;const{endo:xt}=et;if(!xt)return mt.unsafeLadder(this,yt);let{k1neg:vt,k1:bt,k2neg:Et,k2:wt}=xt.splitScalar(yt),kt=gt,Tt=gt,Rt=this;for(;bt>_0n$3||wt>_0n$3;)bt&_1n$5&&(kt=kt.add(Rt)),wt&_1n$5&&(Tt=Tt.add(Rt)),Rt=Rt.double(),bt>>=_1n$5,wt>>=_1n$5;return vt&&(kt=kt.negate()),Et&&(Tt=Tt.negate()),Tt=new ht(tt.mul(Tt.px,xt.beta),Tt.py,Tt.pz),kt.add(Tt)}multiply(yt){const{endo:gt,n:xt}=et;aInRange("scalar",yt,_1n$5,xt);let vt,bt;if(gt){const{k1neg:Et,k1:wt,k2neg:kt,k2:Tt}=gt.splitScalar(yt);let{p:Rt,f:Pt}=this.wNAF(wt),{p:$t,f:Ot}=this.wNAF(Tt);Rt=mt.constTimeNegate(Et,Rt),$t=mt.constTimeNegate(kt,$t),$t=new ht(tt.mul($t.px,gt.beta),$t.py,$t.pz),vt=Rt.add($t),bt=Pt.add(Ot)}else{const{p:Et,f:wt}=this.wNAF(yt);vt=Et,bt=wt}return ht.normalizeZ([vt,bt])[0]}multiplyAndAddUnsafe(yt,gt,xt){const vt=ht.BASE,bt=(wt,kt)=>kt===_0n$3||kt===_1n$5||!wt.equals(vt)?wt.multiplyUnsafe(kt):wt.multiply(kt),Et=bt(this,gt).add(bt(yt,xt));return Et.is0()?void 0:Et}toAffine(yt){return lt(this,yt)}isTorsionFree(){const{h:yt,isTorsionFree:gt}=et;if(yt===_1n$5)return!0;if(gt)return gt(ht,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:yt,clearCofactor:gt}=et;return yt===_1n$5?this:gt?gt(ht,this):this.multiplyUnsafe(et.h)}toRawBytes(yt=!0){return abool("isCompressed",yt),this.assertValidity(),rt(ht,this,yt)}toHex(yt=!0){return abool("isCompressed",yt),bytesToHex$2(this.toRawBytes(yt))}}ht.BASE=new ht(et.Gx,et.Gy,tt.ONE),ht.ZERO=new ht(tt.ZERO,tt.ONE,tt.ZERO);const pt=et.nBitLength,mt=wNAF(ht,et.endo?Math.ceil(pt/2):pt);return{CURVE:et,ProjectivePoint:ht,normPrivateKeyToScalar:at,weierstrassEquation:it,isWithinCurveOrder:st}}function validateOpts$2(o){const et=validateBasic(o);return validateObject(et,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...et})}function weierstrass$1(o){const et=validateOpts$2(o),{Fp:tt,n:nt}=et,rt=tt.BYTES+1,ot=2*tt.BYTES+1;function it(zt){return mod$1(zt,nt)}function st(zt){return invert$1(zt,nt)}const{ProjectivePoint:at,normPrivateKeyToScalar:ct,weierstrassEquation:lt,isWithinCurveOrder:dt}=weierstrassPoints({...et,toBytes(zt,Ft,Yt){const Ht=Ft.toAffine(),Ut=tt.toBytes(Ht.x),qt=concatBytes$1;return abool("isCompressed",Yt),Yt?qt(Uint8Array.from([Ft.hasEvenY()?2:3]),Ut):qt(Uint8Array.from([4]),Ut,tt.toBytes(Ht.y))},fromBytes(zt){const Ft=zt.length,Yt=zt[0],Ht=zt.subarray(1);if(Ft===rt&&(Yt===2||Yt===3)){const Ut=bytesToNumberBE(Ht);if(!inRange(Ut,_1n$5,tt.ORDER))throw new Error("Point is not on curve");const qt=lt(Ut);let Lt;try{Lt=tt.sqrt(qt)}catch(Nt){const Gt=Nt instanceof Error?": "+Nt.message:"";throw new Error("Point is not on curve"+Gt)}const Zt=(Lt&_1n$5)===_1n$5;return(Yt&1)===1!==Zt&&(Lt=tt.neg(Lt)),{x:Ut,y:Lt}}else if(Ft===ot&&Yt===4){const Ut=tt.fromBytes(Ht.subarray(0,tt.BYTES)),qt=tt.fromBytes(Ht.subarray(tt.BYTES,2*tt.BYTES));return{x:Ut,y:qt}}else throw new Error(`Point of length ${Ft} was invalid. Expected ${rt} compressed bytes or ${ot} uncompressed bytes`)}}),ht=zt=>bytesToHex$2(numberToBytesBE(zt,et.nByteLength));function pt(zt){const Ft=nt>>_1n$5;return zt>Ft}function mt(zt){return pt(zt)?it(-zt):zt}const ft=(zt,Ft,Yt)=>bytesToNumberBE(zt.slice(Ft,Yt));class yt{constructor(Ft,Yt,Ht){this.r=Ft,this.s=Yt,this.recovery=Ht,this.assertValidity()}static fromCompact(Ft){const Yt=et.nByteLength;return Ft=ensureBytes$1("compactSignature",Ft,Yt*2),new yt(ft(Ft,0,Yt),ft(Ft,Yt,2*Yt))}static fromDER(Ft){const{r:Yt,s:Ht}=DER.toSig(ensureBytes$1("DER",Ft));return new yt(Yt,Ht)}assertValidity(){aInRange("r",this.r,_1n$5,nt),aInRange("s",this.s,_1n$5,nt)}addRecoveryBit(Ft){return new yt(this.r,this.s,Ft)}recoverPublicKey(Ft){const{r:Yt,s:Ht,recovery:Ut}=this,qt=wt(ensureBytes$1("msgHash",Ft));if(Ut==null||![0,1,2,3].includes(Ut))throw new Error("recovery id invalid");const Lt=Ut===2||Ut===3?Yt+et.n:Yt;if(Lt>=tt.ORDER)throw new Error("recovery id 2 or 3 invalid");const Zt=Ut&1?"03":"02",Qt=at.fromHex(Zt+ht(Lt)),Nt=st(Lt),Gt=it(-qt*Nt),nn=it(Ht*Nt),Wt=at.BASE.multiplyAndAddUnsafe(Qt,Gt,nn);if(!Wt)throw new Error("point at infinify");return Wt.assertValidity(),Wt}hasHighS(){return pt(this.s)}normalizeS(){return this.hasHighS()?new yt(this.r,it(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes$2(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes$2(this.toCompactHex())}toCompactHex(){return ht(this.r)+ht(this.s)}}const gt={isValidPrivateKey(zt){try{return ct(zt),!0}catch{return!1}},normPrivateKeyToScalar:ct,randomPrivateKey:()=>{const zt=getMinHashLength(et.n);return mapHashToField(et.randomBytes(zt),et.n)},precompute(zt=8,Ft=at.BASE){return Ft._setWindowSize(zt),Ft.multiply(BigInt(3)),Ft}};function xt(zt,Ft=!0){return at.fromPrivateKey(zt).toRawBytes(Ft)}function vt(zt){const Ft=isBytes$2(zt),Yt=typeof zt=="string",Ht=(Ft||Yt)&&zt.length;return Ft?Ht===rt||Ht===ot:Yt?Ht===2*rt||Ht===2*ot:zt instanceof at}function bt(zt,Ft,Yt=!0){if(vt(zt))throw new Error("first arg must be private key");if(!vt(Ft))throw new Error("second arg must be public key");return at.fromHex(Ft).multiply(ct(zt)).toRawBytes(Yt)}const Et=et.bits2int||function(zt){const Ft=bytesToNumberBE(zt),Yt=zt.length*8-et.nBitLength;return Yt>0?Ft>>BigInt(Yt):Ft},wt=et.bits2int_modN||function(zt){return it(Et(zt))},kt=bitMask(et.nBitLength);function Tt(zt){return aInRange(`num < 2^${et.nBitLength}`,zt,_0n$3,kt),numberToBytesBE(zt,et.nByteLength)}function Rt(zt,Ft,Yt=Pt){if(["recovered","canonical"].some(Xt=>Xt in Yt))throw new Error("sign() legacy options not supported");const{hash:Ht,randomBytes:Ut}=et;let{lowS:qt,prehash:Lt,extraEntropy:Zt}=Yt;qt==null&&(qt=!0),zt=ensureBytes$1("msgHash",zt),validateSigVerOpts(Yt),Lt&&(zt=ensureBytes$1("prehashed msgHash",Ht(zt)));const Qt=wt(zt),Nt=ct(Ft),Gt=[Tt(Nt),Tt(Qt)];if(Zt!=null&&Zt!==!1){const Xt=Zt===!0?Ut(tt.BYTES):Zt;Gt.push(ensureBytes$1("extraEntropy",Xt))}const nn=concatBytes$1(...Gt),Wt=Qt;function hn(Xt){const Jt=Et(Xt);if(!dt(Jt))return;const tn=st(Jt),_t=at.BASE.multiply(Jt).toAffine(),Dt=it(_t.x);if(Dt===_0n$3)return;const Vt=it(tn*it(Wt+Dt*Nt));if(Vt===_0n$3)return;let en=(_t.x===Dt?0:2)|Number(_t.y&_1n$5),an=Vt;return qt&&pt(Vt)&&(an=mt(Vt),en^=1),new yt(Dt,an,en)}return{seed:nn,k2sig:hn}}const Pt={lowS:et.lowS,prehash:!1},$t={lowS:et.lowS,prehash:!1};function Ot(zt,Ft,Yt=Pt){const{seed:Ht,k2sig:Ut}=Rt(zt,Ft,Yt),qt=et;return createHmacDrbg(qt.hash.outputLen,qt.nByteLength,qt.hmac)(Ht,Ut)}at.BASE._setWindowSize(8);function Bt(zt,Ft,Yt,Ht=$t){var _t;const Ut=zt;if(Ft=ensureBytes$1("msgHash",Ft),Yt=ensureBytes$1("publicKey",Yt),"strict"in Ht)throw new Error("options.strict was renamed to lowS");validateSigVerOpts(Ht);const{lowS:qt,prehash:Lt}=Ht;let Zt,Qt;try{if(typeof Ut=="string"||isBytes$2(Ut))try{Zt=yt.fromDER(Ut)}catch(Dt){if(!(Dt instanceof DER.Err))throw Dt;Zt=yt.fromCompact(Ut)}else if(typeof Ut=="object"&&typeof Ut.r=="bigint"&&typeof Ut.s=="bigint"){const{r:Dt,s:Vt}=Ut;Zt=new yt(Dt,Vt)}else throw new Error("PARSE");Qt=at.fromHex(Yt)}catch(Dt){if(Dt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(qt&&Zt.hasHighS())return!1;Lt&&(Ft=et.hash(Ft));const{r:Nt,s:Gt}=Zt,nn=wt(Ft),Wt=st(Gt),hn=it(nn*Wt),Xt=it(Nt*Wt),Jt=(_t=at.BASE.multiplyAndAddUnsafe(Qt,hn,Xt))==null?void 0:_t.toAffine();return Jt?it(Jt.x)===Nt:!1}return{CURVE:et,getPublicKey:xt,getSharedSecret:bt,sign:Ot,verify:Bt,ProjectivePoint:at,Signature:yt,utils:gt}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(o){return{hash:o,hmac:(et,...tt)=>hmac(o,et,concatBytes$2(...tt)),randomBytes:randomBytes$1}}function createCurve(o,et){const tt=nt=>weierstrass$1({...o,...getHash(nt)});return Object.freeze({...tt(et),create:tt})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n$4=BigInt(1),_2n$3=BigInt(2),divNearest$1=(o,et)=>(o+et/_2n$3)/et;function sqrtMod$1(o){const et=secp256k1P,tt=BigInt(3),nt=BigInt(6),rt=BigInt(11),ot=BigInt(22),it=BigInt(23),st=BigInt(44),at=BigInt(88),ct=o*o*o%et,lt=ct*ct*o%et,dt=pow2$1(lt,tt,et)*lt%et,ht=pow2$1(dt,tt,et)*lt%et,pt=pow2$1(ht,_2n$3,et)*ct%et,mt=pow2$1(pt,rt,et)*pt%et,ft=pow2$1(mt,ot,et)*mt%et,yt=pow2$1(ft,st,et)*ft%et,gt=pow2$1(yt,at,et)*yt%et,xt=pow2$1(gt,st,et)*ft%et,vt=pow2$1(xt,tt,et)*lt%et,bt=pow2$1(vt,it,et)*mt%et,Et=pow2$1(bt,nt,et)*ct%et,wt=pow2$1(Et,_2n$3,et);if(!Fp$1.eql(Fp$1.sqr(wt),o))throw new Error("Cannot find square root");return wt}const Fp$1=Field$1(secp256k1P,void 0,void 0,{sqrt:sqrtMod$1}),secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp:Fp$1,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:o=>{const et=secp256k1N,tt=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),nt=-_1n$4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),rt=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ot=tt,it=BigInt("0x100000000000000000000000000000000"),st=divNearest$1(ot*o,et),at=divNearest$1(-nt*o,et);let ct=mod$1(o-st*tt-at*rt,et),lt=mod$1(-st*nt-at*ot,et);const dt=ct>it,ht=lt>it;if(dt&&(ct=et-ct),ht&&(lt=et-lt),ct>it||lt>it)throw new Error("splitScalar: Endomorphism failed, k="+o);return{k1neg:dt,k1:ct,k2neg:ht,k2:lt}}}},sha256$2);BigInt(0);secp256k1.ProjectivePoint;function getAction(o,et,tt){const nt=o[et.name];if(typeof nt=="function")return nt;const rt=o[tt];return typeof rt=="function"?rt:ot=>et(o,ot)}const version$6="2.14.4",getVersion$1=()=>`@wagmi/core@${version$6}`;var __classPrivateFieldGet$1=function(o,et,tt,nt){if(tt==="a"&&!nt)throw new TypeError("Private accessor was defined without a getter");if(typeof et=="function"?o!==et||!nt:!et.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return tt==="m"?nt:tt==="a"?nt.call(o):nt?nt.value:et.get(o)},_BaseError_instances,_BaseError_walk;let BaseError$1=class As extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return getVersion$1()}constructor(et,tt={}){var ot;super(),_BaseError_instances.add(this),Object.defineProperty(this,"details",{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,"metaMessages",{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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const nt=tt.cause instanceof As?tt.cause.details:(ot=tt.cause)!=null&&ot.message?tt.cause.message:tt.details,rt=tt.cause instanceof As&&tt.cause.docsPath||tt.docsPath;this.message=[et||"An error occurred.","",...tt.metaMessages?[...tt.metaMessages,""]:[],...rt?[`Docs: ${this.docsBaseUrl}${rt}.html${tt.docsSlug?`#${tt.docsSlug}`:""}`]:[],...nt?[`Details: ${nt}`]:[],`Version: ${this.version}`].join(` +`),tt.cause&&(this.cause=tt.cause),this.details=nt,this.docsPath=rt,this.metaMessages=tt.metaMessages,this.shortMessage=et}walk(et){return __classPrivateFieldGet$1(this,_BaseError_instances,"m",_BaseError_walk).call(this,this,et)}};_BaseError_instances=new WeakSet,_BaseError_walk=function o(et,tt){return tt!=null&&tt(et)?et:et.cause?__classPrivateFieldGet$1(this,_BaseError_instances,"m",o).call(this,et.cause,tt):et};class ChainNotConfiguredError extends BaseError$1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ConnectorAlreadyConnectedError extends BaseError$1{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ConnectorNotConnectedError extends BaseError$1{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class ConnectorAccountNotFoundError extends BaseError$1{constructor({address:et,connector:tt}){super(`Account "${et}" not found for connector "${tt.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class ConnectorChainMismatchError extends BaseError$1{constructor({connectionChainId:et,connectorChainId:tt}){super(`The current chain of the connector (id: ${tt}) does not match the connection's chain (id: ${et}).`,{metaMessages:[`Current Chain ID: ${tt}`,`Expected Chain ID: ${et}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class ConnectorUnavailableReconnectingError extends BaseError$1{constructor({connector:et}){super(`Connector "${et.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function connect$1(o,et){var nt;let tt;if(typeof et.connector=="function"?tt=o._internal.connectors.setup(et.connector):tt=et.connector,tt.uid===o.state.current)throw new ConnectorAlreadyConnectedError;try{o.setState(it=>({...it,status:"connecting"})),tt.emitter.emit("message",{type:"connecting"});const rt=await tt.connect({chainId:et.chainId}),ot=rt.accounts;return tt.emitter.off("connect",o._internal.events.connect),tt.emitter.on("change",o._internal.events.change),tt.emitter.on("disconnect",o._internal.events.disconnect),await((nt=o.storage)==null?void 0:nt.setItem("recentConnectorId",tt.id)),o.setState(it=>({...it,connections:new Map(it.connections).set(tt.uid,{accounts:ot,chainId:rt.chainId,connector:tt}),current:tt.uid,status:"connected"})),{accounts:ot,chainId:rt.chainId}}catch(rt){throw o.setState(ot=>({...ot,status:ot.current?"connected":"disconnected"})),rt}}const size$1=256;let index$3=size$1,buffer$1;function uid$1(o=11){if(!buffer$1||index$3+o>size$1*2){buffer$1="",index$3=0;for(let et=0;et{const xt=gt(yt);for(const bt in mt)delete xt[bt];const vt={...yt,...xt};return Object.assign(vt,{extend:ft(vt)})}}return Object.assign(mt,{extend:ft(mt)})}function createTransport({key:o,name:et,request:tt,retryCount:nt=3,retryDelay:rt=150,timeout:ot,type:it},st){const at=uid$1();return{config:{key:o,name:et,request:tt,retryCount:nt,retryDelay:rt,timeout:ot,type:it},request:buildRequest(tt,{retryCount:nt,retryDelay:rt,uid:at}),value:st}}function custom(o,et={}){const{key:tt="custom",name:nt="Custom Provider",retryDelay:rt}=et;return({retryCount:ot})=>createTransport({key:tt,name:nt,request:o.request.bind(o),retryCount:et.retryCount??ot,retryDelay:rt,type:"custom"})}class UrlRequiredError extends BaseError$3{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function http(o,et={}){const{batch:tt,fetchOptions:nt,key:rt="http",name:ot="HTTP JSON-RPC",onFetchRequest:it,onFetchResponse:st,retryDelay:at}=et;return({chain:ct,retryCount:lt,timeout:dt})=>{const{batchSize:ht=1e3,wait:pt=0}=typeof tt=="object"?tt:{},mt=et.retryCount??lt,ft=dt??et.timeout??1e4,yt=ct==null?void 0:ct.rpcUrls.default.http[0];if(!yt)throw new UrlRequiredError;const gt=getHttpRpcClient(yt,{fetchOptions:nt,onRequest:it,onResponse:st,timeout:ft});return createTransport({key:rt,name:ot,async request({method:xt,params:vt}){const bt={method:xt,params:vt},{schedule:Et}=createBatchScheduler({id:yt,wait:pt,shouldSplitBatch(Rt){return Rt.length>ht},fn:Rt=>gt.request({body:Rt}),sort:(Rt,Pt)=>Rt.id-Pt.id}),wt=async Rt=>tt?Et(Rt):[await gt.request({body:Rt})],[{error:kt,result:Tt}]=await wt(bt);if(kt)throw new RpcRequestError({body:bt,error:kt,url:yt});return Tt},retryCount:mt,retryDelay:at,timeout:ft,type:"http"},{fetchOptions:nt,url:yt})}}async function getConnectorClient(o,et={}){let tt;if(et.connector){const{connector:ct}=et;if(o.state.status==="reconnecting"&&!ct.getAccounts&&!ct.getChainId)throw new ConnectorUnavailableReconnectingError({connector:ct});const[lt,dt]=await Promise.all([ct.getAccounts(),ct.getChainId()]);tt={accounts:lt,chainId:dt,connector:ct}}else tt=o.state.connections.get(o.state.current);if(!tt)throw new ConnectorNotConnectedError;const nt=et.chainId??tt.chainId,rt=await tt.connector.getChainId();if(rt!==tt.chainId)throw new ConnectorChainMismatchError({connectionChainId:tt.chainId,connectorChainId:rt});const ot=tt.connector;if(ot.getClient)return ot.getClient({chainId:nt});const it=parseAccount(et.account??tt.accounts[0]);if(it.address=getAddress(it.address),et.account&&!tt.accounts.some(ct=>ct.toLowerCase()===it.address.toLowerCase()))throw new ConnectorAccountNotFoundError({address:it.address,connector:ot});const st=o.chains.find(ct=>ct.id===nt),at=await tt.connector.getProvider({chainId:nt});return createClient({account:it,chain:st,name:"Connector Client",transport:ct=>custom(at)({...ct,retryCount:0})})}async function disconnect(o,et={}){var rt,ot;let tt;if(et.connector)tt=et.connector;else{const{connections:it,current:st}=o.state,at=it.get(st);tt=at==null?void 0:at.connector}const nt=o.state.connections;tt&&(await tt.disconnect(),tt.emitter.off("change",o._internal.events.change),tt.emitter.off("disconnect",o._internal.events.disconnect),tt.emitter.on("connect",o._internal.events.connect),nt.delete(tt.uid)),o.setState(it=>{if(nt.size===0)return{...it,connections:new Map,current:null,status:"disconnected"};const st=nt.values().next().value;return{...it,connections:new Map(nt),current:st.connector.uid}});{const it=o.state.current;if(!it)return;const st=(rt=o.state.connections.get(it))==null?void 0:rt.connector;if(!st)return;await((ot=o.storage)==null?void 0:ot.setItem("recentConnectorId",st.id))}}function getUnit(o){return typeof o=="number"?o:o==="wei"?0:Math.abs(weiUnits[o])}function getAccount(o){const et=o.state.current,tt=o.state.connections.get(et),nt=tt==null?void 0:tt.accounts,rt=nt==null?void 0:nt[0],ot=o.chains.find(st=>st.id===(tt==null?void 0:tt.chainId)),it=o.state.status;switch(it){case"connected":return{address:rt,addresses:nt,chain:ot,chainId:tt==null?void 0:tt.chainId,connector:tt==null?void 0:tt.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:it};case"reconnecting":return{address:rt,addresses:nt,chain:ot,chainId:tt==null?void 0:tt.chainId,connector:tt==null?void 0:tt.connector,isConnected:!!rt,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:it};case"connecting":return{address:rt,addresses:nt,chain:ot,chainId:tt==null?void 0:tt.chainId,connector:tt==null?void 0:tt.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:it};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:it}}}async function multicall(o,et){const{allowFailure:tt=!0,chainId:nt,contracts:rt,...ot}=et,it=o.getClient({chainId:nt});return getAction(it,multicall$1,"multicall")({allowFailure:tt,contracts:rt,...ot})}function readContract(o,et){const{chainId:tt,...nt}=et,rt=o.getClient({chainId:tt});return getAction(rt,readContract$1,"readContract")(nt)}async function readContracts(o,et){var st;const{allowFailure:tt=!0,blockNumber:nt,blockTag:rt,...ot}=et,it=et.contracts;try{const at={};for(const[ht,pt]of it.entries()){const mt=pt.chainId??o.state.chainId;at[mt]||(at[mt]=[]),(st=at[mt])==null||st.push({contract:pt,index:ht})}const ct=()=>Object.entries(at).map(([ht,pt])=>multicall(o,{...ot,allowFailure:tt,blockNumber:nt,blockTag:rt,chainId:Number.parseInt(ht),contracts:pt.map(({contract:mt})=>mt)})),lt=(await Promise.all(ct())).flat(),dt=Object.values(at).flatMap(ht=>ht.map(({index:pt})=>pt));return lt.reduce((ht,pt,mt)=>(ht&&(ht[dt[mt]]=pt),ht),[])}catch(at){if(at instanceof ContractFunctionExecutionError)throw at;const ct=()=>it.map(lt=>readContract(o,{...lt,blockNumber:nt,blockTag:rt}));return tt?(await Promise.allSettled(ct())).map(lt=>lt.status==="fulfilled"?{result:lt.value,status:"success"}:{error:lt.reason,result:void 0,status:"failure"}):await Promise.all(ct())}}async function getBalance(o,et){const{address:tt,blockNumber:nt,blockTag:rt,chainId:ot,token:it,unit:st="ether"}=et;if(it)try{return await getTokenBalance(o,{balanceAddress:tt,chainId:ot,symbolType:"string",tokenAddress:it})}catch(ht){if(ht.name==="ContractFunctionExecutionError"){const pt=await getTokenBalance(o,{balanceAddress:tt,chainId:ot,symbolType:"bytes32",tokenAddress:it}),mt=hexToString(trim$1(pt.symbol,{dir:"right"}));return{...pt,symbol:mt}}throw ht}const at=o.getClient({chainId:ot}),lt=await getAction(at,getBalance$1,"getBalance")(nt?{address:tt,blockNumber:nt}:{address:tt,blockTag:rt}),dt=o.chains.find(ht=>ht.id===ot)??at.chain;return{decimals:dt.nativeCurrency.decimals,formatted:formatUnits(lt,getUnit(st)),symbol:dt.nativeCurrency.symbol,value:lt}}async function getTokenBalance(o,et){const{balanceAddress:tt,chainId:nt,symbolType:rt,tokenAddress:ot,unit:it}=et,st={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:rt}]}],address:ot},[at,ct,lt]=await readContracts(o,{allowFailure:!1,contracts:[{...st,functionName:"balanceOf",args:[tt],chainId:nt},{...st,functionName:"decimals",chainId:nt},{...st,functionName:"symbol",chainId:nt}]}),dt=formatUnits(at??"0",getUnit(it??ct));return{decimals:ct,formatted:dt,symbol:lt,value:at}}function getBlockNumber(o,et={}){const{chainId:tt,...nt}=et,rt=o.getClient({chainId:tt});return getAction(rt,getBlockNumber$1,"getBlockNumber")(nt)}function getChainId(o){return o.state.chainId}function deepEqual(o,et){if(o===et)return!0;if(o&&et&&typeof o=="object"&&typeof et=="object"){if(o.constructor!==et.constructor)return!1;let tt,nt;if(Array.isArray(o)&&Array.isArray(et)){if(tt=o.length,tt!==et.length)return!1;for(nt=tt;nt--!==0;)if(!deepEqual(o[nt],et[nt]))return!1;return!0}if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===et.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===et.toString();const rt=Object.keys(o);if(tt=rt.length,tt!==Object.keys(et).length)return!1;for(nt=tt;nt--!==0;)if(!Object.prototype.hasOwnProperty.call(et,rt[nt]))return!1;for(nt=tt;nt--!==0;){const ot=rt[nt];if(ot&&!deepEqual(o[ot],et[ot]))return!1}return!0}return o!==o&&et!==et}let previousChains=[];function getChains(o){const et=o.chains;return deepEqual(previousChains,et)?previousChains:(previousChains=et,et)}let previousConnections=[];function getConnections(o){const et=[...o.state.connections.values()];return o.state.status==="reconnecting"||deepEqual(previousConnections,et)?previousConnections:(previousConnections=et,et)}let previousConnectors=[];function getConnectors(o){const et=o.connectors;return deepEqual(previousConnectors,et)?previousConnectors:(previousConnectors=et,et)}function getEnsAddress(o,et){const{chainId:tt,...nt}=et,rt=o.getClient({chainId:tt});return getAction(rt,getEnsAddress$1,"getEnsAddress")(nt)}function getEnsAvatar(o,et){const{chainId:tt,...nt}=et,rt=o.getClient({chainId:tt});return getAction(rt,getEnsAvatar$1,"getEnsAvatar")(nt)}function getEnsName(o,et){const{chainId:tt,...nt}=et,rt=o.getClient({chainId:tt});return getAction(rt,getEnsName$1,"getEnsName")(nt)}let isReconnecting=!1;async function reconnect(o,et={}){var ct,lt;if(isReconnecting)return[];isReconnecting=!0,o.setState(dt=>({...dt,status:dt.current?"reconnecting":"connecting"}));const tt=[];if((ct=et.connectors)!=null&&ct.length)for(const dt of et.connectors){let ht;typeof dt=="function"?ht=o._internal.connectors.setup(dt):ht=dt,tt.push(ht)}else tt.push(...o.connectors);let nt;try{nt=await((lt=o.storage)==null?void 0:lt.getItem("recentConnectorId"))}catch{}const rt={};for(const[,dt]of o.state.connections)rt[dt.connector.id]=1;nt&&(rt[nt]=0);const ot=Object.keys(rt).length>0?[...tt].sort((dt,ht)=>(rt[dt.id]??10)-(rt[ht.id]??10)):tt;let it=!1;const st=[],at=[];for(const dt of ot){const ht=await dt.getProvider().catch(()=>{});if(!ht||at.some(ft=>ft===ht)||!await dt.isAuthorized())continue;const mt=await dt.connect({isReconnecting:!0}).catch(()=>null);mt&&(dt.emitter.off("connect",o._internal.events.connect),dt.emitter.on("change",o._internal.events.change),dt.emitter.on("disconnect",o._internal.events.disconnect),o.setState(ft=>{const yt=new Map(it?ft.connections:new Map).set(dt.uid,{accounts:mt.accounts,chainId:mt.chainId,connector:dt});return{...ft,current:it?ft.current:dt.uid,connections:yt}}),st.push({accounts:mt.accounts,chainId:mt.chainId,connector:dt}),at.push(ht),it=!0)}return(o.state.status==="reconnecting"||o.state.status==="connecting")&&(it?o.setState(dt=>({...dt,status:"connected"})):o.setState(dt=>({...dt,connections:new Map,current:null,status:"disconnected"}))),isReconnecting=!1,st}async function signMessage(o,et){const{account:tt,connector:nt,...rt}=et;let ot;return typeof tt=="object"&&tt.type==="local"?ot=o.getClient():ot=await getConnectorClient(o,{account:tt,connector:nt}),getAction(ot,signMessage$1,"signMessage")({...rt,...tt?{account:tt}:{}})}class ProviderNotFoundError extends BaseError$1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class SwitchChainNotSupportedError extends BaseError$1{constructor({connector:et}){super(`"${et.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function switchChain(o,et){var it;const{addEthereumChainParameter:tt,chainId:nt}=et,rt=o.state.connections.get(((it=et.connector)==null?void 0:it.uid)??o.state.current);if(rt){const st=rt.connector;if(!st.switchChain)throw new SwitchChainNotSupportedError({connector:st});return await st.switchChain({addEthereumChainParameter:tt,chainId:nt})}const ot=o.chains.find(st=>st.id===nt);if(!ot)throw new ChainNotConfiguredError;return o.setState(st=>({...st,chainId:nt})),ot}function watchAccount(o,et){const{onChange:tt}=et;return o.subscribe(()=>getAccount(o),tt,{equalityFn(nt,rt){const{connector:ot,...it}=nt,{connector:st,...at}=rt;return deepEqual(it,at)&&(ot==null?void 0:ot.id)===(st==null?void 0:st.id)&&(ot==null?void 0:ot.uid)===(st==null?void 0:st.uid)}})}function watchBlockNumber(o,et){const{syncConnectedChain:tt=o._internal.syncConnectedChain,...nt}=et;let rt;const ot=at=>{rt&&rt();const ct=o.getClient({chainId:at});return rt=getAction(ct,watchBlockNumber$1,"watchBlockNumber")(nt),rt},it=ot(et.chainId);let st;return tt&&!et.chainId&&(st=o.subscribe(({chainId:at})=>at,async at=>ot(at))),()=>{it==null||it(),st==null||st()}}function watchChainId(o,et){const{onChange:tt}=et;return o.subscribe(nt=>nt.chainId,tt)}function watchConnections(o,et){const{onChange:tt}=et;return o.subscribe(()=>getConnections(o),tt,{equalityFn:deepEqual})}function watchConnectors(o,et){const{onChange:tt}=et;return o._internal.connectors.subscribe((nt,rt)=>{tt(Object.values(nt),rt)})}function createConnector(o){return o}const supportsSimulationIdRegex=/(rabby|trustwallet)/;injected.type="injected";function injected(o={}){const{shimDisconnect:et=!0,unstable_shimAsyncInject:tt}=o;function nt(){const at=o.target;if(typeof at=="function"){const ct=at();if(ct)return ct}return typeof at=="object"?at:typeof at=="string"?{...targetMap[at]??{id:at,name:`${at[0].toUpperCase()}${at.slice(1)}`,provider:`is${at[0].toUpperCase()}${at.slice(1)}`}}:{id:"injected",name:"Injected",provider(ct){return ct==null?void 0:ct.ethereum}}}let rt,ot,it,st;return at=>({get icon(){return nt().icon},get id(){return nt().id},get name(){return nt().name},get supportsSimulation(){return supportsSimulationIdRegex.test(this.id.toLowerCase())},type:injected.type,async setup(){const ct=await this.getProvider();ct!=null&&ct.on&&o.target&&(it||(it=this.onConnect.bind(this),ct.on("connect",it)),rt||(rt=this.onAccountsChanged.bind(this),ct.on("accountsChanged",rt)))},async connect({chainId:ct,isReconnecting:lt}={}){var pt,mt,ft,yt,gt,xt;const dt=await this.getProvider();if(!dt)throw new ProviderNotFoundError;let ht=[];if(lt)ht=await this.getAccounts().catch(()=>[]);else if(et)try{ht=(yt=(ft=(mt=(pt=(await dt.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:pt.caveats)==null?void 0:mt[0])==null?void 0:ft.value)==null?void 0:yt.map(bt=>getAddress(bt)),ht.length>0&&(ht=await this.getAccounts())}catch(vt){const bt=vt;if(bt.code===UserRejectedRequestError.code)throw new UserRejectedRequestError(bt);if(bt.code===ResourceUnavailableRpcError.code)throw bt}try{!(ht!=null&&ht.length)&&!lt&&(ht=(await dt.request({method:"eth_requestAccounts"})).map(Et=>getAddress(Et))),it&&(dt.removeListener("connect",it),it=void 0),rt||(rt=this.onAccountsChanged.bind(this),dt.on("accountsChanged",rt)),ot||(ot=this.onChainChanged.bind(this),dt.on("chainChanged",ot)),st||(st=this.onDisconnect.bind(this),dt.on("disconnect",st));let vt=await this.getChainId();if(ct&&vt!==ct){const bt=await this.switchChain({chainId:ct}).catch(Et=>{if(Et.code===UserRejectedRequestError.code)throw Et;return{id:vt}});vt=(bt==null?void 0:bt.id)??vt}return et&&await((gt=at.storage)==null?void 0:gt.removeItem(`${this.id}.disconnected`)),o.target||await((xt=at.storage)==null?void 0:xt.setItem("injected.connected",!0)),{accounts:ht,chainId:vt}}catch(vt){const bt=vt;throw bt.code===UserRejectedRequestError.code?new UserRejectedRequestError(bt):bt.code===ResourceUnavailableRpcError.code?new ResourceUnavailableRpcError(bt):bt}},async disconnect(){var lt,dt;const ct=await this.getProvider();if(!ct)throw new ProviderNotFoundError;ot&&(ct.removeListener("chainChanged",ot),ot=void 0),st&&(ct.removeListener("disconnect",st),st=void 0),it||(it=this.onConnect.bind(this),ct.on("connect",it));try{await withTimeout(()=>ct.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}et&&await((lt=at.storage)==null?void 0:lt.setItem(`${this.id}.disconnected`,!0)),o.target||await((dt=at.storage)==null?void 0:dt.removeItem("injected.connected"))},async getAccounts(){const ct=await this.getProvider();if(!ct)throw new ProviderNotFoundError;return(await ct.request({method:"eth_accounts"})).map(dt=>getAddress(dt))},async getChainId(){const ct=await this.getProvider();if(!ct)throw new ProviderNotFoundError;const lt=await ct.request({method:"eth_chainId"});return Number(lt)},async getProvider(){if(typeof window>"u")return;let ct;const lt=nt();return typeof lt.provider=="function"?ct=lt.provider(window):typeof lt.provider=="string"?ct=findProvider(window,lt.provider):ct=lt.provider,ct&&!ct.removeListener&&("off"in ct&&typeof ct.off=="function"?ct.removeListener=ct.off:ct.removeListener=()=>{}),ct},async isAuthorized(){var ct,lt;try{if(et&&await((ct=at.storage)==null?void 0:ct.getItem(`${this.id}.disconnected`))||!o.target&&!await((lt=at.storage)==null?void 0:lt.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(tt!==void 0&&tt!==!1){const mt=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",mt),!!await this.getProvider()),ft=typeof tt=="number"?tt:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(gt=>window.addEventListener("ethereum#initialized",()=>gt(mt()),{once:!0}))]:[],new Promise(gt=>setTimeout(()=>gt(mt()),ft))]))return!0}throw new ProviderNotFoundError}return!!(await withRetry(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:ct,chainId:lt}){var mt,ft,yt,gt;const dt=await this.getProvider();if(!dt)throw new ProviderNotFoundError;const ht=at.chains.find(xt=>xt.id===lt);if(!ht)throw new SwitchChainError(new ChainNotConfiguredError);const pt=new Promise(xt=>{const vt=bt=>{"chainId"in bt&&bt.chainId===lt&&(at.emitter.off("change",vt),xt())};at.emitter.on("change",vt)});try{return await Promise.all([dt.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(lt)}]}).then(async()=>{await this.getChainId()===lt&&at.emitter.emit("change",{chainId:lt})}),pt]),ht}catch(xt){const vt=xt;if(vt.code===4902||((ft=(mt=vt==null?void 0:vt.data)==null?void 0:mt.originalError)==null?void 0:ft.code)===4902)try{const{default:bt,...Et}=ht.blockExplorers??{};let wt;ct!=null&&ct.blockExplorerUrls?wt=ct.blockExplorerUrls:bt&&(wt=[bt.url,...Object.values(Et).map(Rt=>Rt.url)]);let kt;(yt=ct==null?void 0:ct.rpcUrls)!=null&&yt.length?kt=ct.rpcUrls:kt=[((gt=ht.rpcUrls.default)==null?void 0:gt.http[0])??""];const Tt={blockExplorerUrls:wt,chainId:numberToHex(lt),chainName:(ct==null?void 0:ct.chainName)??ht.name,iconUrls:ct==null?void 0:ct.iconUrls,nativeCurrency:(ct==null?void 0:ct.nativeCurrency)??ht.nativeCurrency,rpcUrls:kt};return await Promise.all([dt.request({method:"wallet_addEthereumChain",params:[Tt]}).then(async()=>{if(await this.getChainId()===lt)at.emitter.emit("change",{chainId:lt});else throw new UserRejectedRequestError(new Error("User rejected switch after adding network."))}),pt]),ht}catch(bt){throw new UserRejectedRequestError(bt)}throw vt.code===UserRejectedRequestError.code?new UserRejectedRequestError(vt):new SwitchChainError(vt)}},async onAccountsChanged(ct){var lt;if(ct.length===0)this.onDisconnect();else if(at.emitter.listenerCount("connect")){const dt=(await this.getChainId()).toString();this.onConnect({chainId:dt}),et&&await((lt=at.storage)==null?void 0:lt.removeItem(`${this.id}.disconnected`))}else at.emitter.emit("change",{accounts:ct.map(dt=>getAddress(dt))})},onChainChanged(ct){const lt=Number(ct);at.emitter.emit("change",{chainId:lt})},async onConnect(ct){const lt=await this.getAccounts();if(lt.length===0)return;const dt=Number(ct.chainId);at.emitter.emit("connect",{accounts:lt,chainId:dt});const ht=await this.getProvider();ht&&(it&&(ht.removeListener("connect",it),it=void 0),rt||(rt=this.onAccountsChanged.bind(this),ht.on("accountsChanged",rt)),ot||(ot=this.onChainChanged.bind(this),ht.on("chainChanged",ot)),st||(st=this.onDisconnect.bind(this),ht.on("disconnect",st)))},async onDisconnect(ct){const lt=await this.getProvider();ct&&ct.code===1013&<&&(await this.getAccounts()).length||(at.emitter.emit("disconnect"),lt&&(ot&&(lt.removeListener("chainChanged",ot),ot=void 0),st&&(lt.removeListener("disconnect",st),st=void 0),it||(it=this.onConnect.bind(this),lt.on("connect",it))))}})}const targetMap={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(o){return o!=null&&o.coinbaseWalletExtension?o.coinbaseWalletExtension:findProvider(o,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(o){return findProvider(o,et=>{if(!et.isMetaMask||et.isBraveWallet&&!et._events&&!et._state)return!1;const tt=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const nt of tt)if(et[nt])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(o){var et,tt;return(et=o==null?void 0:o.phantom)!=null&&et.ethereum?(tt=o.phantom)==null?void 0:tt.ethereum:findProvider(o,"isPhantom")}}};function findProvider(o,et){function tt(rt){return typeof et=="function"?et(rt):typeof et=="string"?rt[et]:!0}const nt=o.ethereum;if(nt!=null&&nt.providers)return nt.providers.find(rt=>tt(rt));if(nt&&tt(nt))return nt}function requestProviders(o){if(typeof window>"u")return;const et=tt=>o(tt.detail);return window.addEventListener("eip6963:announceProvider",et),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",et)}function createStore$1(){const o=new Set;let et=[];const tt=()=>requestProviders(rt=>{et.some(({info:ot})=>ot.uuid===rt.info.uuid)||(et=[...et,rt],o.forEach(ot=>ot(et,{added:[rt]})))});let nt=tt();return{_listeners(){return o},clear(){o.forEach(rt=>rt([],{removed:[...et]})),et=[]},destroy(){this.clear(),o.clear(),nt==null||nt()},findProvider({rdns:rt}){return et.find(ot=>ot.info.rdns===rt)},getProviders(){return et},reset(){this.clear(),nt==null||nt(),nt=tt()},subscribe(rt,{emitImmediately:ot}={}){return o.add(rt),ot&&rt(et,{added:et}),()=>o.delete(rt)}}}const subscribeWithSelectorImpl=o=>(et,tt,nt)=>{const rt=nt.subscribe;return nt.subscribe=(it,st,at)=>{let ct=it;if(st){const lt=(at==null?void 0:at.equalityFn)||Object.is;let dt=it(nt.getState());ct=ht=>{const pt=it(ht);if(!lt(dt,pt)){const mt=dt;st(dt=pt,mt)}},at!=null&&at.fireImmediately&&st(dt,dt)}return rt(ct)},o(et,tt,nt)},subscribeWithSelector=subscribeWithSelectorImpl;function createJSONStorage(o,et){let tt;try{tt=o()}catch{return}return{getItem:rt=>{var ot;const it=at=>at===null?null:JSON.parse(at,void 0),st=(ot=tt.getItem(rt))!=null?ot:null;return st instanceof Promise?st.then(it):it(st)},setItem:(rt,ot)=>tt.setItem(rt,JSON.stringify(ot,void 0)),removeItem:rt=>tt.removeItem(rt)}}const toThenable=o=>et=>{try{const tt=o(et);return tt instanceof Promise?tt:{then(nt){return toThenable(nt)(tt)},catch(nt){return this}}}catch(tt){return{then(nt){return this},catch(nt){return toThenable(nt)(tt)}}}},persistImpl=(o,et)=>(tt,nt,rt)=>{let ot={storage:createJSONStorage(()=>localStorage),partialize:ft=>ft,version:0,merge:(ft,yt)=>({...yt,...ft}),...et},it=!1;const st=new Set,at=new Set;let ct=ot.storage;if(!ct)return o((...ft)=>{console.warn(`[zustand persist middleware] Unable to update item '${ot.name}', the given storage is currently unavailable.`),tt(...ft)},nt,rt);const lt=()=>{const ft=ot.partialize({...nt()});return ct.setItem(ot.name,{state:ft,version:ot.version})},dt=rt.setState;rt.setState=(ft,yt)=>{dt(ft,yt),lt()};const ht=o((...ft)=>{tt(...ft),lt()},nt,rt);rt.getInitialState=()=>ht;let pt;const mt=()=>{var ft,yt;if(!ct)return;it=!1,st.forEach(xt=>{var vt;return xt((vt=nt())!=null?vt:ht)});const gt=((yt=ot.onRehydrateStorage)==null?void 0:yt.call(ot,(ft=nt())!=null?ft:ht))||void 0;return toThenable(ct.getItem.bind(ct))(ot.name).then(xt=>{if(xt)if(typeof xt.version=="number"&&xt.version!==ot.version){if(ot.migrate)return[!0,ot.migrate(xt.state,xt.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,xt.state];return[!1,void 0]}).then(xt=>{var vt;const[bt,Et]=xt;if(pt=ot.merge(Et,(vt=nt())!=null?vt:ht),tt(pt,!0),bt)return lt()}).then(()=>{gt==null||gt(pt,void 0),pt=nt(),it=!0,at.forEach(xt=>xt(pt))}).catch(xt=>{gt==null||gt(void 0,xt)})};return rt.persist={setOptions:ft=>{ot={...ot,...ft},ft.storage&&(ct=ft.storage)},clearStorage:()=>{ct==null||ct.removeItem(ot.name)},getOptions:()=>ot,rehydrate:()=>mt(),hasHydrated:()=>it,onHydrate:ft=>(st.add(ft),()=>{st.delete(ft)}),onFinishHydration:ft=>(at.add(ft),()=>{at.delete(ft)})},ot.skipHydration||mt(),pt||ht},persist=persistImpl,createStoreImpl=o=>{let et;const tt=new Set,nt=(ct,lt)=>{const dt=typeof ct=="function"?ct(et):ct;if(!Object.is(dt,et)){const ht=et;et=lt??(typeof dt!="object"||dt===null)?dt:Object.assign({},et,dt),tt.forEach(pt=>pt(et,ht))}},rt=()=>et,st={setState:nt,getState:rt,getInitialState:()=>at,subscribe:ct=>(tt.add(ct),()=>tt.delete(ct))},at=et=o(nt,rt,st);return st},createStore=o=>o?createStoreImpl(o):createStoreImpl;var eventemitter3={exports:{}};(function(o){var et=Object.prototype.hasOwnProperty,tt="~";function nt(){}Object.create&&(nt.prototype=Object.create(null),new nt().__proto__||(tt=!1));function rt(at,ct,lt){this.fn=at,this.context=ct,this.once=lt||!1}function ot(at,ct,lt,dt,ht){if(typeof lt!="function")throw new TypeError("The listener must be a function");var pt=new rt(lt,dt||at,ht),mt=tt?tt+ct:ct;return at._events[mt]?at._events[mt].fn?at._events[mt]=[at._events[mt],pt]:at._events[mt].push(pt):(at._events[mt]=pt,at._eventsCount++),at}function it(at,ct){--at._eventsCount===0?at._events=new nt:delete at._events[ct]}function st(){this._events=new nt,this._eventsCount=0}st.prototype.eventNames=function(){var ct=[],lt,dt;if(this._eventsCount===0)return ct;for(dt in lt=this._events)et.call(lt,dt)&&ct.push(tt?dt.slice(1):dt);return Object.getOwnPropertySymbols?ct.concat(Object.getOwnPropertySymbols(lt)):ct},st.prototype.listeners=function(ct){var lt=tt?tt+ct:ct,dt=this._events[lt];if(!dt)return[];if(dt.fn)return[dt.fn];for(var ht=0,pt=dt.length,mt=new Array(pt);ht{let rt=nt;return(rt==null?void 0:rt.__type)==="bigint"&&(rt=BigInt(rt.value)),(rt==null?void 0:rt.__type)==="Map"&&(rt=new Map(rt.value)),(et==null?void 0:et(tt,rt))??rt})}function getReferenceKey(o,et){return o.slice(0,et).join(".")||"."}function getCutoff(o,et){const{length:tt}=o;for(let nt=0;nt{let it=ot;return typeof it=="bigint"&&(it={__type:"bigint",value:ot.toString()}),it instanceof Map&&(it={__type:"Map",value:Array.from(ot.entries())}),(et==null?void 0:et(rt,it))??it},nt),tt??void 0)}function createStorage(o){const{deserialize:et=deserialize$1,key:tt="wagmi",serialize:nt=serialize$1,storage:rt=noopStorage}=o;function ot(it){return it instanceof Promise?it.then(st=>st).catch(()=>null):it}return{...rt,key:tt,async getItem(it,st){const at=rt.getItem(`${tt}.${it}`),ct=await ot(at);return ct?et(ct)??null:st??null},async setItem(it,st){const at=`${tt}.${it}`;st===null?await ot(rt.removeItem(at)):await ot(rt.setItem(at,nt(st)))},async removeItem(it){await ot(rt.removeItem(`${tt}.${it}`))}}}const noopStorage={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},size=256;let index$2=size,buffer;function uid(o=11){if(!buffer||index$2+o>size*2){buffer="",index$2=0;for(let et=0;etot.chains),at=createStore(()=>{const Et=[],wt=new Set;for(const kt of ot.connectors??[]){const Tt=ct(kt);Et.push(Tt),!rt&&Tt.rdns&&wt.add(Tt.rdns)}if(!rt&&it){const kt=it.getProviders();for(const Tt of kt)wt.has(Tt.info.rdns)||Et.push(ct(lt(Tt)))}return Et});function ct(Et){var Tt;const wt=createEmitter(uid()),kt={...Et({emitter:wt,chains:st.getState(),storage:tt,transports:ot.transports}),emitter:wt,uid:wt.uid};return wt.on("connect",vt),(Tt=kt.setup)==null||Tt.call(kt),kt}function lt(Et){const{info:wt}=Et,kt=Et.provider;return injected({target:{...wt,id:wt.rdns,provider:kt}})}const dt=new Map;function ht(Et={}){const wt=Et.chainId??yt.getState().chainId,kt=st.getState().find(Rt=>Rt.id===wt);if(Et.chainId&&!kt)throw new ChainNotConfiguredError;{const Rt=dt.get(yt.getState().chainId);if(Rt&&!kt)return Rt;if(!kt)throw new ChainNotConfiguredError}{const Rt=dt.get(wt);if(Rt)return Rt}let Tt;if(ot.client)Tt=ot.client({chain:kt});else{const Rt=kt.id,Pt=st.getState().map(Bt=>Bt.id),$t={},Ot=Object.entries(ot);for(const[Bt,zt]of Ot)if(!(Bt==="chains"||Bt==="client"||Bt==="connectors"||Bt==="transports"))if(typeof zt=="object")if(Rt in zt)$t[Bt]=zt[Rt];else{if(Pt.some(Yt=>Yt in zt))continue;$t[Bt]=zt}else $t[Bt]=zt;Tt=createClient({...$t,chain:kt,batch:$t.batch??{multicall:!0},transport:Bt=>ot.transports[Rt]({...Bt,connectors:at})})}return dt.set(wt,Tt),Tt}function pt(){return{chainId:st.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let mt;const ft="0.0.0-canary-";version$6.startsWith(ft)?mt=Number.parseInt(version$6.replace(ft,"")):mt=Number.parseInt(version$6.split(".")[0]??"0");const yt=createStore(subscribeWithSelector(tt?persist(pt,{migrate(Et,wt){if(wt===mt)return Et;const kt=pt(),Tt=gt(Et,kt.chainId);return{...kt,chainId:Tt}},name:"store",partialize(Et){return{connections:{__type:"Map",value:Array.from(Et.connections.entries()).map(([wt,kt])=>{const{id:Tt,name:Rt,type:Pt,uid:$t}=kt.connector;return[wt,{...kt,connector:{id:Tt,name:Rt,type:Pt,uid:$t}}]})},chainId:Et.chainId,current:Et.current}},merge(Et,wt){typeof Et=="object"&&Et&&"status"in Et&&delete Et.status;const kt=gt(Et,wt.chainId);return{...wt,...Et,chainId:kt}},skipHydration:rt,storage:tt,version:mt}):pt));yt.setState(pt());function gt(Et,wt){return Et&&typeof Et=="object"&&"chainId"in Et&&typeof Et.chainId=="number"&&st.getState().some(kt=>kt.id===Et.chainId)?Et.chainId:wt}nt&&yt.subscribe(({connections:Et,current:wt})=>{var kt;return wt?(kt=Et.get(wt))==null?void 0:kt.chainId:void 0},Et=>{if(st.getState().some(kt=>kt.id===Et))return yt.setState(kt=>({...kt,chainId:Et??kt.chainId}))}),it==null||it.subscribe(Et=>{const wt=new Set,kt=new Set;for(const Rt of at.getState())wt.add(Rt.id),Rt.rdns&&kt.add(Rt.rdns);const Tt=[];for(const Rt of Et){if(kt.has(Rt.info.rdns))continue;const Pt=ct(lt(Rt));wt.has(Pt.id)||Tt.push(Pt)}tt&&!yt.persist.hasHydrated()||at.setState(Rt=>[...Rt,...Tt],!0)});function xt(Et){yt.setState(wt=>{const kt=wt.connections.get(Et.uid);return kt?{...wt,connections:new Map(wt.connections).set(Et.uid,{accounts:Et.accounts??kt.accounts,chainId:Et.chainId??kt.chainId,connector:kt.connector})}:wt})}function vt(Et){yt.getState().status==="connecting"||yt.getState().status==="reconnecting"||yt.setState(wt=>{const kt=at.getState().find(Tt=>Tt.uid===Et.uid);return kt?(kt.emitter.listenerCount("connect")&&kt.emitter.off("connect",xt),kt.emitter.listenerCount("change")||kt.emitter.on("change",xt),kt.emitter.listenerCount("disconnect")||kt.emitter.on("disconnect",bt),{...wt,connections:new Map(wt.connections).set(Et.uid,{accounts:Et.accounts,chainId:Et.chainId,connector:kt}),current:Et.uid,status:"connected"}):wt})}function bt(Et){yt.setState(wt=>{const kt=wt.connections.get(Et.uid);if(kt){const Rt=kt.connector;Rt.emitter.listenerCount("change")&&kt.connector.emitter.off("change",xt),Rt.emitter.listenerCount("disconnect")&&kt.connector.emitter.off("disconnect",bt),Rt.emitter.listenerCount("connect")||kt.connector.emitter.on("connect",vt)}if(wt.connections.delete(Et.uid),wt.connections.size===0)return{...wt,connections:new Map,current:null,status:"disconnected"};const Tt=wt.connections.values().next().value;return{...wt,connections:new Map(wt.connections),current:Tt.connector.uid}})}return{get chains(){return st.getState()},get connectors(){return at.getState()},storage:tt,getClient:ht,get state(){return yt.getState()},setState(Et){let wt;typeof Et=="function"?wt=Et(yt.getState()):wt=Et;const kt=pt();typeof wt!="object"&&(wt=kt),Object.keys(kt).some(Rt=>!(Rt in wt))&&(wt=kt),yt.setState(wt,!0)},subscribe(Et,wt,kt){return yt.subscribe(Et,wt,kt?{...kt,fireImmediately:kt.emitImmediately}:void 0)},_internal:{mipd:it,store:yt,ssr:!!rt,syncConnectedChain:nt,transports:ot.transports,chains:{setState(Et){const wt=typeof Et=="function"?Et(st.getState()):Et;if(wt.length!==0)return st.setState(wt,!0)},subscribe(Et){return st.subscribe(Et)}},connectors:{providerDetailToConnector:lt,setup:ct,setState(Et){return at.setState(typeof Et=="function"?Et(at.getState()):Et,!0)},subscribe(Et){return at.subscribe(Et)}},events:{change:xt,connect:vt,disconnect:bt}}}}function hydrate(o,et){const{initialState:tt,reconnectOnMount:nt}=et;return tt&&!o._internal.store.persist.hasHydrated()&&o.setState({...tt,chainId:o.chains.some(rt=>rt.id===tt.chainId)?tt.chainId:o.chains[0].id,connections:nt?tt.connections:new Map,status:nt?"reconnecting":"disconnected"}),{async onMount(){o._internal.ssr&&(await o._internal.store.persist.rehydrate(),o._internal.mipd&&o._internal.connectors.setState(rt=>{var at;const ot=new Set;for(const ct of rt??[])ct.rdns&&ot.add(ct.rdns);const it=[],st=((at=o._internal.mipd)==null?void 0:at.getProviders())??[];for(const ct of st){if(ot.has(ct.info.rdns))continue;const lt=o._internal.connectors.providerDetailToConnector(ct),dt=o._internal.connectors.setup(lt);it.push(dt)}return[...rt,...it]})),nt?reconnect(o):o.storage&&o.setState(rt=>({...rt,connections:new Map}))}}}function extractRpcUrls(o){var ot,it,st;const{chain:et}=o,tt=et.rpcUrls.default.http[0];if(!o.transports)return[tt];const nt=(it=(ot=o.transports)==null?void 0:ot[et.id])==null?void 0:it.call(ot,{chain:et});return(((st=nt==null?void 0:nt.value)==null?void 0:st.transports)||[nt]).map(({value:at})=>(at==null?void 0:at.url)||tt)}function Hydrate(o){const{children:et,config:tt,initialState:nt,reconnectOnMount:rt=!0}=o,{onMount:ot}=hydrate(tt,{initialState:nt,reconnectOnMount:rt});tt._internal.ssr||ot();const it=reactExports.useRef(!0);return reactExports.useEffect(()=>{if(it.current&&tt._internal.ssr)return ot(),()=>{it.current=!1}},[]),et}const WagmiContext=reactExports.createContext(void 0);function WagmiProvider(o){const{children:et,config:tt}=o,nt={value:tt};return reactExports.createElement(Hydrate,o,reactExports.createElement(WagmiContext.Provider,nt,et))}const version$5="2.12.29",getVersion=()=>`wagmi@${version$5}`;class BaseError extends BaseError$1{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return getVersion()}}class WagmiProviderNotFoundError extends BaseError{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function useConfig(o={}){const et=o.config??reactExports.useContext(WagmiContext);if(!et)throw new WagmiProviderNotFoundError;return et}function watchChains(o,et){const{onChange:tt}=et;return o._internal.chains.subscribe((nt,rt)=>{tt(nt,rt)})}var withSelector={exports:{}},withSelector_production_min={},shim={exports:{}},useSyncExternalStoreShim_production_min={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var e$2=reactExports;function h$4(o,et){return o===et&&(o!==0||1/o===1/et)||o!==o&&et!==et}var k$3=typeof Object.is=="function"?Object.is:h$4,l$2=e$2.useState,m$4=e$2.useEffect,n$3=e$2.useLayoutEffect,p$3=e$2.useDebugValue;function q$4(o,et){var tt=et(),nt=l$2({inst:{value:tt,getSnapshot:et}}),rt=nt[0].inst,ot=nt[1];return n$3(function(){rt.value=tt,rt.getSnapshot=et,r$4(rt)&&ot({inst:rt})},[o,tt,et]),m$4(function(){return r$4(rt)&&ot({inst:rt}),o(function(){r$4(rt)&&ot({inst:rt})})},[o]),p$3(tt),tt}function r$4(o){var et=o.getSnapshot;o=o.value;try{var tt=et();return!k$3(o,tt)}catch{return!0}}function t$3(o,et){return et()}var u$2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t$3:q$4;useSyncExternalStoreShim_production_min.useSyncExternalStore=e$2.useSyncExternalStore!==void 0?e$2.useSyncExternalStore:u$2;shim.exports=useSyncExternalStoreShim_production_min;var shimExports=shim.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var h$3=reactExports,n$2=shimExports;function p$2(o,et){return o===et&&(o!==0||1/o===1/et)||o!==o&&et!==et}var q$3=typeof Object.is=="function"?Object.is:p$2,r$3=n$2.useSyncExternalStore,t$2=h$3.useRef,u$1=h$3.useEffect,v$3=h$3.useMemo,w$3=h$3.useDebugValue;withSelector_production_min.useSyncExternalStoreWithSelector=function(o,et,tt,nt,rt){var ot=t$2(null);if(ot.current===null){var it={hasValue:!1,value:null};ot.current=it}else it=ot.current;ot=v$3(function(){function at(pt){if(!ct){if(ct=!0,lt=pt,pt=nt(pt),rt!==void 0&&it.hasValue){var mt=it.value;if(rt(mt,pt))return dt=mt}return dt=pt}if(mt=dt,q$3(lt,pt))return mt;var ft=nt(pt);return rt!==void 0&&rt(mt,ft)?mt:(lt=pt,dt=ft)}var ct=!1,lt,dt,ht=tt===void 0?null:tt;return[function(){return at(et())},ht===null?void 0:function(){return at(ht())}]},[et,tt,nt,rt]);var st=r$3(o,ot[0],ot[1]);return u$1(function(){it.hasValue=!0,it.value=st},[st]),w$3(st),st};withSelector.exports=withSelector_production_min;var withSelectorExports=withSelector.exports;const isPlainObject$4=o=>typeof o=="object"&&!Array.isArray(o);function useSyncExternalStoreWithTracked(o,et,tt=et,nt=deepEqual){const rt=reactExports.useRef([]),ot=withSelectorExports.useSyncExternalStoreWithSelector(o,et,tt,it=>it,(it,st)=>{if(isPlainObject$4(it)&&isPlainObject$4(st)&&rt.current.length){for(const at of rt.current)if(!nt(it[at],st[at]))return!1;return!0}return nt(it,st)});return reactExports.useMemo(()=>{if(isPlainObject$4(ot)){const it={...ot};let st={};for(const[at,ct]of Object.entries(it))st={...st,[at]:{configurable:!1,enumerable:!0,get:()=>(rt.current.includes(at)||rt.current.push(at),ct)}};return Object.defineProperties(it,st),it}return ot},[ot])}function useAccount(o={}){const et=useConfig(o);return useSyncExternalStoreWithTracked(tt=>watchAccount(et,{onChange:tt}),()=>getAccount(et))}function useAccountEffect(o={}){const{onConnect:et,onDisconnect:tt}=o,nt=useConfig(o);reactExports.useEffect(()=>watchAccount(nt,{onChange(rt,ot){if((ot.status==="reconnecting"||ot.status==="connecting"&&ot.address===void 0)&&rt.status==="connected"){const{address:it,addresses:st,chain:at,chainId:ct,connector:lt}=rt,dt=ot.status==="reconnecting"||ot.status===void 0;et==null||et({address:it,addresses:st,chain:at,chainId:ct,connector:lt,isReconnected:dt})}else ot.status==="connected"&&rt.status==="disconnected"&&(tt==null||tt())}}),[nt,et,tt])}var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(o){return this.listeners.add(o),this.onSubscribe(),()=>{this.listeners.delete(o),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$4(){}function functionalUpdate(o,et){return typeof o=="function"?o(et):o}function isValidTimeout(o){return typeof o=="number"&&o>=0&&o!==1/0}function timeUntilStale(o,et){return Math.max(o+(et||0)-Date.now(),0)}function resolveStaleTime(o,et){return typeof o=="function"?o(et):o}function resolveEnabled(o,et){return typeof o=="function"?o(et):o}function matchQuery(o,et){const{type:tt="all",exact:nt,fetchStatus:rt,predicate:ot,queryKey:it,stale:st}=o;if(it){if(nt){if(et.queryHash!==hashQueryKeyByOptions(it,et.options))return!1}else if(!partialMatchKey(et.queryKey,it))return!1}if(tt!=="all"){const at=et.isActive();if(tt==="active"&&!at||tt==="inactive"&&at)return!1}return!(typeof st=="boolean"&&et.isStale()!==st||rt&&rt!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(o,et){const{exact:tt,status:nt,predicate:rt,mutationKey:ot}=o;if(ot){if(!et.options.mutationKey)return!1;if(tt){if(hashKey(et.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(et.options.mutationKey,ot))return!1}return!(nt&&et.state.status!==nt||rt&&!rt(et))}function hashQueryKeyByOptions(o,et){return((et==null?void 0:et.queryKeyHashFn)||hashKey)(o)}function hashKey(o){return JSON.stringify(o,(et,tt)=>isPlainObject$3(tt)?Object.keys(tt).sort().reduce((nt,rt)=>(nt[rt]=tt[rt],nt),{}):tt)}function partialMatchKey(o,et){return o===et?!0:typeof o!=typeof et?!1:o&&et&&typeof o=="object"&&typeof et=="object"?!Object.keys(et).some(tt=>!partialMatchKey(o[tt],et[tt])):!1}function replaceEqualDeep(o,et){if(o===et)return o;const tt=isPlainArray(o)&&isPlainArray(et);if(tt||isPlainObject$3(o)&&isPlainObject$3(et)){const nt=tt?o:Object.keys(o),rt=nt.length,ot=tt?et:Object.keys(et),it=ot.length,st=tt?[]:{};let at=0;for(let ct=0;ct{setTimeout(et,o)})}function replaceData(o,et,tt){return typeof tt.structuralSharing=="function"?tt.structuralSharing(o,et):tt.structuralSharing!==!1?replaceEqualDeep(o,et):et}function addToEnd(o,et,tt=0){const nt=[...o,et];return tt&&nt.length>tt?nt.slice(1):nt}function addToStart(o,et,tt=0){const nt=[et,...o];return tt&&nt.length>tt?nt.slice(0,-1):nt}var skipToken=Symbol();function ensureQueryFn(o,et){return!o.queryFn&&(et!=null&&et.initialPromise)?()=>et.initialPromise:!o.queryFn||o.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${o.queryHash}'`)):o.queryFn}var Sr,lr,jr,Ds,FocusManager=(Ds=class extends Subscribable{constructor(){super();fn(this,Sr);fn(this,lr);fn(this,jr);un(this,jr,et=>{if(!isServer&&window.addEventListener){const tt=()=>et();return window.addEventListener("visibilitychange",tt,!1),()=>{window.removeEventListener("visibilitychange",tt)}}})}onSubscribe(){Mt(this,lr)||this.setEventListener(Mt(this,jr))}onUnsubscribe(){var et;this.hasListeners()||((et=Mt(this,lr))==null||et.call(this),un(this,lr,void 0))}setEventListener(et){var tt;un(this,jr,et),(tt=Mt(this,lr))==null||tt.call(this),un(this,lr,et(nt=>{typeof nt=="boolean"?this.setFocused(nt):this.onFocus()}))}setFocused(et){Mt(this,Sr)!==et&&(un(this,Sr,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(tt=>{tt(et)})}isFocused(){var et;return typeof Mt(this,Sr)=="boolean"?Mt(this,Sr):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},Sr=new WeakMap,lr=new WeakMap,jr=new WeakMap,Ds),focusManager=new FocusManager,Or,ur,Mr,Fs,OnlineManager=(Fs=class extends Subscribable{constructor(){super();fn(this,Or,!0);fn(this,ur);fn(this,Mr);un(this,Mr,et=>{if(!isServer&&window.addEventListener){const tt=()=>et(!0),nt=()=>et(!1);return window.addEventListener("online",tt,!1),window.addEventListener("offline",nt,!1),()=>{window.removeEventListener("online",tt),window.removeEventListener("offline",nt)}}})}onSubscribe(){Mt(this,ur)||this.setEventListener(Mt(this,Mr))}onUnsubscribe(){var et;this.hasListeners()||((et=Mt(this,ur))==null||et.call(this),un(this,ur,void 0))}setEventListener(et){var tt;un(this,Mr,et),(tt=Mt(this,ur))==null||tt.call(this),un(this,ur,et(this.setOnline.bind(this)))}setOnline(et){Mt(this,Or)!==et&&(un(this,Or,et),this.listeners.forEach(nt=>{nt(et)}))}isOnline(){return Mt(this,Or)}},Or=new WeakMap,ur=new WeakMap,Mr=new WeakMap,Fs),onlineManager=new OnlineManager;function pendingThenable(){let o,et;const tt=new Promise((rt,ot)=>{o=rt,et=ot});tt.status="pending",tt.catch(()=>{});function nt(rt){Object.assign(tt,rt),delete tt.resolve,delete tt.reject}return tt.resolve=rt=>{nt({status:"fulfilled",value:rt}),o(rt)},tt.reject=rt=>{nt({status:"rejected",reason:rt}),et(rt)},tt}function defaultRetryDelay(o){return Math.min(1e3*2**o,3e4)}function canFetch(o){return(o??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(o){super("CancelledError"),this.revert=o==null?void 0:o.revert,this.silent=o==null?void 0:o.silent}};function isCancelledError(o){return o instanceof CancelledError}function createRetryer(o){let et=!1,tt=0,nt=!1,rt;const ot=pendingThenable(),it=ft=>{var yt;nt||(ht(new CancelledError(ft)),(yt=o.abort)==null||yt.call(o))},st=()=>{et=!0},at=()=>{et=!1},ct=()=>focusManager.isFocused()&&(o.networkMode==="always"||onlineManager.isOnline())&&o.canRun(),lt=()=>canFetch(o.networkMode)&&o.canRun(),dt=ft=>{var yt;nt||(nt=!0,(yt=o.onSuccess)==null||yt.call(o,ft),rt==null||rt(),ot.resolve(ft))},ht=ft=>{var yt;nt||(nt=!0,(yt=o.onError)==null||yt.call(o,ft),rt==null||rt(),ot.reject(ft))},pt=()=>new Promise(ft=>{var yt;rt=gt=>{(nt||ct())&&ft(gt)},(yt=o.onPause)==null||yt.call(o)}).then(()=>{var ft;rt=void 0,nt||(ft=o.onContinue)==null||ft.call(o)}),mt=()=>{if(nt)return;let ft;const yt=tt===0?o.initialPromise:void 0;try{ft=yt??o.fn()}catch(gt){ft=Promise.reject(gt)}Promise.resolve(ft).then(dt).catch(gt=>{var wt;if(nt)return;const xt=o.retry??(isServer?0:3),vt=o.retryDelay??defaultRetryDelay,bt=typeof vt=="function"?vt(tt,gt):vt,Et=xt===!0||typeof xt=="number"&&ttct()?void 0:pt()).then(()=>{et?ht(gt):mt()})})};return{promise:ot,cancel:it,continue:()=>(rt==null||rt(),ot),cancelRetry:st,continueRetry:at,canStart:lt,start:()=>(lt()?mt():pt().then(mt),ot)}}function createNotifyManager(){let o=[],et=0,tt=st=>{st()},nt=st=>{st()},rt=st=>setTimeout(st,0);const ot=st=>{et?o.push(st):rt(()=>{tt(st)})},it=()=>{const st=o;o=[],st.length&&rt(()=>{nt(()=>{st.forEach(at=>{tt(at)})})})};return{batch:st=>{let at;et++;try{at=st()}finally{et--,et||it()}return at},batchCalls:st=>(...at)=>{ot(()=>{st(...at)})},schedule:ot,setNotifyFunction:st=>{tt=st},setBatchNotifyFunction:st=>{nt=st},setScheduler:st=>{rt=st}}}var notifyManager=createNotifyManager(),kr,Us,Removable=(Us=class{constructor(){fn(this,kr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&un(this,kr,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(o){this.gcTime=Math.max(this.gcTime||0,o??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Mt(this,kr)&&(clearTimeout(Mt(this,kr)),un(this,kr,void 0))}},kr=new WeakMap,Us),Br,Dr,Un,$n,no,Ar,Hn,tr,zs,Query=(zs=class extends Removable{constructor(et){super();fn(this,Hn);fn(this,Br);fn(this,Dr);fn(this,Un);fn(this,$n);fn(this,no);fn(this,Ar);un(this,Ar,!1),un(this,no,et.defaultOptions),this.setOptions(et.options),this.observers=[],un(this,Un,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,un(this,Br,getDefaultState$1(this.options)),this.state=et.state??Mt(this,Br),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Mt(this,$n))==null?void 0:et.promise}setOptions(et){this.options={...Mt(this,no),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Mt(this,Un).remove(this)}setData(et,tt){const nt=replaceData(this.state.data,et,this.options);return gn(this,Hn,tr).call(this,{data:nt,type:"success",dataUpdatedAt:tt==null?void 0:tt.updatedAt,manual:tt==null?void 0:tt.manual}),nt}setState(et,tt){gn(this,Hn,tr).call(this,{type:"setState",state:et,setStateOptions:tt})}cancel(et){var nt,rt;const tt=(nt=Mt(this,$n))==null?void 0:nt.promise;return(rt=Mt(this,$n))==null||rt.cancel(et),tt?tt.then(noop$4).catch(noop$4):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Mt(this,Br))}isActive(){return this.observers.some(et=>resolveEnabled(et.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(et=>et.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(et=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,et)}onFocus(){var tt;const et=this.observers.find(nt=>nt.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(tt=Mt(this,$n))==null||tt.continue()}onOnline(){var tt;const et=this.observers.find(nt=>nt.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(tt=Mt(this,$n))==null||tt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Mt(this,Un).notify({type:"observerAdded",query:this,observer:et}))}removeObserver(et){this.observers.includes(et)&&(this.observers=this.observers.filter(tt=>tt!==et),this.observers.length||(Mt(this,$n)&&(Mt(this,Ar)?Mt(this,$n).cancel({revert:!0}):Mt(this,$n).cancelRetry()),this.scheduleGc()),Mt(this,Un).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||gn(this,Hn,tr).call(this,{type:"invalidate"})}fetch(et,tt){var at,ct,lt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(tt!=null&&tt.cancelRefetch))this.cancel({silent:!0});else if(Mt(this,$n))return Mt(this,$n).continueRetry(),Mt(this,$n).promise}if(et&&this.setOptions(et),!this.options.queryFn){const dt=this.observers.find(ht=>ht.options.queryFn);dt&&this.setOptions(dt.options)}const nt=new AbortController,rt=dt=>{Object.defineProperty(dt,"signal",{enumerable:!0,get:()=>(un(this,Ar,!0),nt.signal)})},ot=()=>{const dt=ensureQueryFn(this.options,tt),ht={queryKey:this.queryKey,meta:this.meta};return rt(ht),un(this,Ar,!1),this.options.persister?this.options.persister(dt,ht,this):dt(ht)},it={fetchOptions:tt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};rt(it),(at=this.options.behavior)==null||at.onFetch(it,this),un(this,Dr,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=it.fetchOptions)==null?void 0:ct.meta))&&gn(this,Hn,tr).call(this,{type:"fetch",meta:(lt=it.fetchOptions)==null?void 0:lt.meta});const st=dt=>{var ht,pt,mt,ft;isCancelledError(dt)&&dt.silent||gn(this,Hn,tr).call(this,{type:"error",error:dt}),isCancelledError(dt)||((pt=(ht=Mt(this,Un).config).onError)==null||pt.call(ht,dt,this),(ft=(mt=Mt(this,Un).config).onSettled)==null||ft.call(mt,this.state.data,dt,this)),this.scheduleGc()};return un(this,$n,createRetryer({initialPromise:tt==null?void 0:tt.initialPromise,fn:it.fetchFn,abort:nt.abort.bind(nt),onSuccess:dt=>{var ht,pt,mt,ft;if(dt===void 0){st(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(dt)}catch(yt){st(yt);return}(pt=(ht=Mt(this,Un).config).onSuccess)==null||pt.call(ht,dt,this),(ft=(mt=Mt(this,Un).config).onSettled)==null||ft.call(mt,dt,this.state.error,this),this.scheduleGc()},onError:st,onFail:(dt,ht)=>{gn(this,Hn,tr).call(this,{type:"failed",failureCount:dt,error:ht})},onPause:()=>{gn(this,Hn,tr).call(this,{type:"pause"})},onContinue:()=>{gn(this,Hn,tr).call(this,{type:"continue"})},retry:it.options.retry,retryDelay:it.options.retryDelay,networkMode:it.options.networkMode,canRun:()=>!0})),Mt(this,$n).start()}},Br=new WeakMap,Dr=new WeakMap,Un=new WeakMap,$n=new WeakMap,no=new WeakMap,Ar=new WeakMap,Hn=new WeakSet,tr=function(et){const tt=nt=>{switch(et.type){case"failed":return{...nt,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...nt,fetchStatus:"paused"};case"continue":return{...nt,fetchStatus:"fetching"};case"fetch":return{...nt,...fetchState(nt.data,this.options),fetchMeta:et.meta??null};case"success":return{...nt,data:et.data,dataUpdateCount:nt.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const rt=et.error;return isCancelledError(rt)&&rt.revert&&Mt(this,Dr)?{...Mt(this,Dr),fetchStatus:"idle"}:{...nt,error:rt,errorUpdateCount:nt.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:nt.fetchFailureCount+1,fetchFailureReason:rt,fetchStatus:"idle",status:"error"};case"invalidate":return{...nt,isInvalidated:!0};case"setState":return{...nt,...et.state}}};this.state=tt(this.state),notifyManager.batch(()=>{this.observers.forEach(nt=>{nt.onQueryUpdate()}),Mt(this,Un).notify({query:this,type:"updated",action:et})})},zs);function fetchState(o,et){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(et.networkMode)?"fetching":"paused",...o===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(o){const et=typeof o.initialData=="function"?o.initialData():o.initialData,tt=et!==void 0,nt=tt?typeof o.initialDataUpdatedAt=="function"?o.initialDataUpdatedAt():o.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:tt?nt??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:tt?"success":"pending",fetchStatus:"idle"}}var Wn,Vs,QueryCache=(Vs=class extends Subscribable{constructor(et={}){super();fn(this,Wn);this.config=et,un(this,Wn,new Map)}build(et,tt,nt){const rt=tt.queryKey,ot=tt.queryHash??hashQueryKeyByOptions(rt,tt);let it=this.get(ot);return it||(it=new Query({cache:this,queryKey:rt,queryHash:ot,options:et.defaultQueryOptions(tt),state:nt,defaultOptions:et.getQueryDefaults(rt)}),this.add(it)),it}add(et){Mt(this,Wn).has(et.queryHash)||(Mt(this,Wn).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const tt=Mt(this,Wn).get(et.queryHash);tt&&(et.destroy(),tt===et&&Mt(this,Wn).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Mt(this,Wn).get(et)}getAll(){return[...Mt(this,Wn).values()]}find(et){const tt={exact:!0,...et};return this.getAll().find(nt=>matchQuery(tt,nt))}findAll(et={}){const tt=this.getAll();return Object.keys(et).length>0?tt.filter(nt=>matchQuery(et,nt)):tt}notify(et){notifyManager.batch(()=>{this.listeners.forEach(tt=>{tt(et)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onOnline()})})}},Wn=new WeakMap,Vs),Gn,jn,Rr,qn,ar,Hs,Mutation=(Hs=class extends Removable{constructor(et){super();fn(this,qn);fn(this,Gn);fn(this,jn);fn(this,Rr);this.mutationId=et.mutationId,un(this,jn,et.mutationCache),un(this,Gn,[]),this.state=et.state||getDefaultState(),this.setOptions(et.options),this.scheduleGc()}setOptions(et){this.options=et,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(et){Mt(this,Gn).includes(et)||(Mt(this,Gn).push(et),this.clearGcTimeout(),Mt(this,jn).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){un(this,Gn,Mt(this,Gn).filter(tt=>tt!==et)),this.scheduleGc(),Mt(this,jn).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Mt(this,Gn).length||(this.state.status==="pending"?this.scheduleGc():Mt(this,jn).remove(this))}continue(){var et;return((et=Mt(this,Rr))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var rt,ot,it,st,at,ct,lt,dt,ht,pt,mt,ft,yt,gt,xt,vt,bt,Et,wt,kt;un(this,Rr,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(Tt,Rt)=>{gn(this,qn,ar).call(this,{type:"failed",failureCount:Tt,error:Rt})},onPause:()=>{gn(this,qn,ar).call(this,{type:"pause"})},onContinue:()=>{gn(this,qn,ar).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Mt(this,jn).canRun(this)}));const tt=this.state.status==="pending",nt=!Mt(this,Rr).canStart();try{if(!tt){gn(this,qn,ar).call(this,{type:"pending",variables:et,isPaused:nt}),await((ot=(rt=Mt(this,jn).config).onMutate)==null?void 0:ot.call(rt,et,this));const Rt=await((st=(it=this.options).onMutate)==null?void 0:st.call(it,et));Rt!==this.state.context&&gn(this,qn,ar).call(this,{type:"pending",context:Rt,variables:et,isPaused:nt})}const Tt=await Mt(this,Rr).start();return await((ct=(at=Mt(this,jn).config).onSuccess)==null?void 0:ct.call(at,Tt,et,this.state.context,this)),await((dt=(lt=this.options).onSuccess)==null?void 0:dt.call(lt,Tt,et,this.state.context)),await((pt=(ht=Mt(this,jn).config).onSettled)==null?void 0:pt.call(ht,Tt,null,this.state.variables,this.state.context,this)),await((ft=(mt=this.options).onSettled)==null?void 0:ft.call(mt,Tt,null,et,this.state.context)),gn(this,qn,ar).call(this,{type:"success",data:Tt}),Tt}catch(Tt){try{throw await((gt=(yt=Mt(this,jn).config).onError)==null?void 0:gt.call(yt,Tt,et,this.state.context,this)),await((vt=(xt=this.options).onError)==null?void 0:vt.call(xt,Tt,et,this.state.context)),await((Et=(bt=Mt(this,jn).config).onSettled)==null?void 0:Et.call(bt,void 0,Tt,this.state.variables,this.state.context,this)),await((kt=(wt=this.options).onSettled)==null?void 0:kt.call(wt,void 0,Tt,et,this.state.context)),Tt}finally{gn(this,qn,ar).call(this,{type:"error",error:Tt})}}finally{Mt(this,jn).runNext(this)}}},Gn=new WeakMap,jn=new WeakMap,Rr=new WeakMap,qn=new WeakSet,ar=function(et){const tt=nt=>{switch(et.type){case"failed":return{...nt,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...nt,isPaused:!0};case"continue":return{...nt,isPaused:!1};case"pending":return{...nt,context:et.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:et.isPaused,status:"pending",variables:et.variables,submittedAt:Date.now()};case"success":return{...nt,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...nt,data:void 0,error:et.error,failureCount:nt.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=tt(this.state),notifyManager.batch(()=>{Mt(this,Gn).forEach(nt=>{nt.onMutationUpdate(et)}),Mt(this,jn).notify({mutation:this,type:"updated",action:et})})},Hs);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fn,ro,Ws,MutationCache=(Ws=class extends Subscribable{constructor(et={}){super();fn(this,Fn);fn(this,ro);this.config=et,un(this,Fn,new Map),un(this,ro,Date.now())}build(et,tt,nt){const rt=new Mutation({mutationCache:this,mutationId:++br(this,ro)._,options:et.defaultMutationOptions(tt),state:nt});return this.add(rt),rt}add(et){const tt=scopeFor(et),nt=Mt(this,Fn).get(tt)??[];nt.push(et),Mt(this,Fn).set(tt,nt),this.notify({type:"added",mutation:et})}remove(et){var nt;const tt=scopeFor(et);if(Mt(this,Fn).has(tt)){const rt=(nt=Mt(this,Fn).get(tt))==null?void 0:nt.filter(ot=>ot!==et);rt&&(rt.length===0?Mt(this,Fn).delete(tt):Mt(this,Fn).set(tt,rt))}this.notify({type:"removed",mutation:et})}canRun(et){var nt;const tt=(nt=Mt(this,Fn).get(scopeFor(et)))==null?void 0:nt.find(rt=>rt.state.status==="pending");return!tt||tt===et}runNext(et){var nt;const tt=(nt=Mt(this,Fn).get(scopeFor(et)))==null?void 0:nt.find(rt=>rt!==et&&rt.state.isPaused);return(tt==null?void 0:tt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}getAll(){return[...Mt(this,Fn).values()].flat()}find(et){const tt={exact:!0,...et};return this.getAll().find(nt=>matchMutation(tt,nt))}findAll(et={}){return this.getAll().filter(tt=>matchMutation(et,tt))}notify(et){notifyManager.batch(()=>{this.listeners.forEach(tt=>{tt(et)})})}resumePausedMutations(){const et=this.getAll().filter(tt=>tt.state.isPaused);return notifyManager.batch(()=>Promise.all(et.map(tt=>tt.continue().catch(noop$4))))}},Fn=new WeakMap,ro=new WeakMap,Ws);function scopeFor(o){var et;return((et=o.options.scope)==null?void 0:et.id)??String(o.mutationId)}function infiniteQueryBehavior(o){return{onFetch:(et,tt)=>{var lt,dt,ht,pt,mt;const nt=et.options,rt=(ht=(dt=(lt=et.fetchOptions)==null?void 0:lt.meta)==null?void 0:dt.fetchMore)==null?void 0:ht.direction,ot=((pt=et.state.data)==null?void 0:pt.pages)||[],it=((mt=et.state.data)==null?void 0:mt.pageParams)||[];let st={pages:[],pageParams:[]},at=0;const ct=async()=>{let ft=!1;const yt=vt=>{Object.defineProperty(vt,"signal",{enumerable:!0,get:()=>(et.signal.aborted?ft=!0:et.signal.addEventListener("abort",()=>{ft=!0}),et.signal)})},gt=ensureQueryFn(et.options,et.fetchOptions),xt=async(vt,bt,Et)=>{if(ft)return Promise.reject();if(bt==null&&vt.pages.length)return Promise.resolve(vt);const wt={queryKey:et.queryKey,pageParam:bt,direction:Et?"backward":"forward",meta:et.options.meta};yt(wt);const kt=await gt(wt),{maxPages:Tt}=et.options,Rt=Et?addToStart:addToEnd;return{pages:Rt(vt.pages,kt,Tt),pageParams:Rt(vt.pageParams,bt,Tt)}};if(rt&&ot.length){const vt=rt==="backward",bt=vt?getPreviousPageParam:getNextPageParam,Et={pages:ot,pageParams:it},wt=bt(nt,Et);st=await xt(Et,wt,vt)}else{const vt=o??ot.length;do{const bt=at===0?it[0]??nt.initialPageParam:getNextPageParam(nt,st);if(at>0&&bt==null)break;st=await xt(st,bt),at++}while(at{var ft,yt;return(yt=(ft=et.options).persister)==null?void 0:yt.call(ft,ct,{queryKey:et.queryKey,meta:et.options.meta,signal:et.signal},tt)}:et.fetchFn=ct}}}function getNextPageParam(o,{pages:et,pageParams:tt}){const nt=et.length-1;return et.length>0?o.getNextPageParam(et[nt],et,tt[nt],tt):void 0}function getPreviousPageParam(o,{pages:et,pageParams:tt}){var nt;return et.length>0?(nt=o.getPreviousPageParam)==null?void 0:nt.call(o,et[0],et,tt[0],tt):void 0}var Nn,dr,hr,Fr,Ur,pr,zr,Vr,Gs,QueryClient=(Gs=class{constructor(o={}){fn(this,Nn);fn(this,dr);fn(this,hr);fn(this,Fr);fn(this,Ur);fn(this,pr);fn(this,zr);fn(this,Vr);un(this,Nn,o.queryCache||new QueryCache),un(this,dr,o.mutationCache||new MutationCache),un(this,hr,o.defaultOptions||{}),un(this,Fr,new Map),un(this,Ur,new Map),un(this,pr,0)}mount(){br(this,pr)._++,Mt(this,pr)===1&&(un(this,zr,focusManager.subscribe(async o=>{o&&(await this.resumePausedMutations(),Mt(this,Nn).onFocus())})),un(this,Vr,onlineManager.subscribe(async o=>{o&&(await this.resumePausedMutations(),Mt(this,Nn).onOnline())})))}unmount(){var o,et;br(this,pr)._--,Mt(this,pr)===0&&((o=Mt(this,zr))==null||o.call(this),un(this,zr,void 0),(et=Mt(this,Vr))==null||et.call(this),un(this,Vr,void 0))}isFetching(o){return Mt(this,Nn).findAll({...o,fetchStatus:"fetching"}).length}isMutating(o){return Mt(this,dr).findAll({...o,status:"pending"}).length}getQueryData(o){var tt;const et=this.defaultQueryOptions({queryKey:o});return(tt=Mt(this,Nn).get(et.queryHash))==null?void 0:tt.state.data}ensureQueryData(o){const et=this.getQueryData(o.queryKey);if(et===void 0)return this.fetchQuery(o);{const tt=this.defaultQueryOptions(o),nt=Mt(this,Nn).build(this,tt);return o.revalidateIfStale&&nt.isStaleByTime(resolveStaleTime(tt.staleTime,nt))&&this.prefetchQuery(tt),Promise.resolve(et)}}getQueriesData(o){return Mt(this,Nn).findAll(o).map(({queryKey:et,state:tt})=>{const nt=tt.data;return[et,nt]})}setQueryData(o,et,tt){const nt=this.defaultQueryOptions({queryKey:o}),rt=Mt(this,Nn).get(nt.queryHash),ot=rt==null?void 0:rt.state.data,it=functionalUpdate(et,ot);if(it!==void 0)return Mt(this,Nn).build(this,nt).setData(it,{...tt,manual:!0})}setQueriesData(o,et,tt){return notifyManager.batch(()=>Mt(this,Nn).findAll(o).map(({queryKey:nt})=>[nt,this.setQueryData(nt,et,tt)]))}getQueryState(o){var tt;const et=this.defaultQueryOptions({queryKey:o});return(tt=Mt(this,Nn).get(et.queryHash))==null?void 0:tt.state}removeQueries(o){const et=Mt(this,Nn);notifyManager.batch(()=>{et.findAll(o).forEach(tt=>{et.remove(tt)})})}resetQueries(o,et){const tt=Mt(this,Nn),nt={type:"active",...o};return notifyManager.batch(()=>(tt.findAll(o).forEach(rt=>{rt.reset()}),this.refetchQueries(nt,et)))}cancelQueries(o={},et={}){const tt={revert:!0,...et},nt=notifyManager.batch(()=>Mt(this,Nn).findAll(o).map(rt=>rt.cancel(tt)));return Promise.all(nt).then(noop$4).catch(noop$4)}invalidateQueries(o={},et={}){return notifyManager.batch(()=>{if(Mt(this,Nn).findAll(o).forEach(nt=>{nt.invalidate()}),o.refetchType==="none")return Promise.resolve();const tt={...o,type:o.refetchType??o.type??"active"};return this.refetchQueries(tt,et)})}refetchQueries(o={},et){const tt={...et,cancelRefetch:(et==null?void 0:et.cancelRefetch)??!0},nt=notifyManager.batch(()=>Mt(this,Nn).findAll(o).filter(rt=>!rt.isDisabled()).map(rt=>{let ot=rt.fetch(void 0,tt);return tt.throwOnError||(ot=ot.catch(noop$4)),rt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(nt).then(noop$4)}fetchQuery(o){const et=this.defaultQueryOptions(o);et.retry===void 0&&(et.retry=!1);const tt=Mt(this,Nn).build(this,et);return tt.isStaleByTime(resolveStaleTime(et.staleTime,tt))?tt.fetch(et):Promise.resolve(tt.state.data)}prefetchQuery(o){return this.fetchQuery(o).then(noop$4).catch(noop$4)}fetchInfiniteQuery(o){return o.behavior=infiniteQueryBehavior(o.pages),this.fetchQuery(o)}prefetchInfiniteQuery(o){return this.fetchInfiniteQuery(o).then(noop$4).catch(noop$4)}ensureInfiniteQueryData(o){return o.behavior=infiniteQueryBehavior(o.pages),this.ensureQueryData(o)}resumePausedMutations(){return onlineManager.isOnline()?Mt(this,dr).resumePausedMutations():Promise.resolve()}getQueryCache(){return Mt(this,Nn)}getMutationCache(){return Mt(this,dr)}getDefaultOptions(){return Mt(this,hr)}setDefaultOptions(o){un(this,hr,o)}setQueryDefaults(o,et){Mt(this,Fr).set(hashKey(o),{queryKey:o,defaultOptions:et})}getQueryDefaults(o){const et=[...Mt(this,Fr).values()];let tt={};return et.forEach(nt=>{partialMatchKey(o,nt.queryKey)&&(tt={...tt,...nt.defaultOptions})}),tt}setMutationDefaults(o,et){Mt(this,Ur).set(hashKey(o),{mutationKey:o,defaultOptions:et})}getMutationDefaults(o){const et=[...Mt(this,Ur).values()];let tt={};return et.forEach(nt=>{partialMatchKey(o,nt.mutationKey)&&(tt={...tt,...nt.defaultOptions})}),tt}defaultQueryOptions(o){if(o._defaulted)return o;const et={...Mt(this,hr).queries,...this.getQueryDefaults(o.queryKey),...o,_defaulted:!0};return et.queryHash||(et.queryHash=hashQueryKeyByOptions(et.queryKey,et)),et.refetchOnReconnect===void 0&&(et.refetchOnReconnect=et.networkMode!=="always"),et.throwOnError===void 0&&(et.throwOnError=!!et.suspense),!et.networkMode&&et.persister&&(et.networkMode="offlineFirst"),et.enabled!==!0&&et.queryFn===skipToken&&(et.enabled=!1),et}defaultMutationOptions(o){return o!=null&&o._defaulted?o:{...Mt(this,hr).mutations,...(o==null?void 0:o.mutationKey)&&this.getMutationDefaults(o.mutationKey),...o,_defaulted:!0}}clear(){Mt(this,Nn).clear(),Mt(this,dr).clear()}},Nn=new WeakMap,dr=new WeakMap,hr=new WeakMap,Fr=new WeakMap,Ur=new WeakMap,pr=new WeakMap,zr=new WeakMap,Vr=new WeakMap,Gs),Mn,Sn,oo,On,_r,Hr,fr,Kn,io,Wr,Gr,Tr,Ir,mr,qr,Tn,to,Rs,_s,Ts,Is,Ps,Ls,Ns,Ql,qs,QueryObserver=(qs=class extends Subscribable{constructor(et,tt){super();fn(this,Tn);fn(this,Mn);fn(this,Sn);fn(this,oo);fn(this,On);fn(this,_r);fn(this,Hr);fn(this,fr);fn(this,Kn);fn(this,io);fn(this,Wr);fn(this,Gr);fn(this,Tr);fn(this,Ir);fn(this,mr);fn(this,qr,new Set);this.options=tt,un(this,Mn,et),un(this,Kn,null),un(this,fr,pendingThenable()),this.options.experimental_prefetchInRender||Mt(this,fr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(tt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Mt(this,Sn).addObserver(this),shouldFetchOnMount(Mt(this,Sn),this.options)?gn(this,Tn,to).call(this):this.updateResult(),gn(this,Tn,Is).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Mt(this,Sn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Mt(this,Sn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,gn(this,Tn,Ps).call(this),gn(this,Tn,Ls).call(this),Mt(this,Sn).removeObserver(this)}setOptions(et,tt){const nt=this.options,rt=Mt(this,Sn);if(this.options=Mt(this,Mn).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Mt(this,Sn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");gn(this,Tn,Ns).call(this),Mt(this,Sn).setOptions(this.options),nt._defaulted&&!shallowEqualObjects(this.options,nt)&&Mt(this,Mn).getQueryCache().notify({type:"observerOptionsUpdated",query:Mt(this,Sn),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Mt(this,Sn),rt,this.options,nt)&&gn(this,Tn,to).call(this),this.updateResult(tt),ot&&(Mt(this,Sn)!==rt||resolveEnabled(this.options.enabled,Mt(this,Sn))!==resolveEnabled(nt.enabled,Mt(this,Sn))||resolveStaleTime(this.options.staleTime,Mt(this,Sn))!==resolveStaleTime(nt.staleTime,Mt(this,Sn)))&&gn(this,Tn,Rs).call(this);const it=gn(this,Tn,_s).call(this);ot&&(Mt(this,Sn)!==rt||resolveEnabled(this.options.enabled,Mt(this,Sn))!==resolveEnabled(nt.enabled,Mt(this,Sn))||it!==Mt(this,mr))&&gn(this,Tn,Ts).call(this,it)}getOptimisticResult(et){const tt=Mt(this,Mn).getQueryCache().build(Mt(this,Mn),et),nt=this.createResult(tt,et);return shouldAssignObserverCurrentProperties(this,nt)&&(un(this,On,nt),un(this,Hr,this.options),un(this,_r,Mt(this,Sn).state)),nt}getCurrentResult(){return Mt(this,On)}trackResult(et,tt){const nt={};return Object.keys(et).forEach(rt=>{Object.defineProperty(nt,rt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(rt),tt==null||tt(rt),et[rt])})}),nt}trackProp(et){Mt(this,qr).add(et)}getCurrentQuery(){return Mt(this,Sn)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const tt=Mt(this,Mn).defaultQueryOptions(et),nt=Mt(this,Mn).getQueryCache().build(Mt(this,Mn),tt);return nt.fetch().then(()=>this.createResult(nt,tt))}fetch(et){return gn(this,Tn,to).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Mt(this,On)))}createResult(et,tt){var Tt;const nt=Mt(this,Sn),rt=this.options,ot=Mt(this,On),it=Mt(this,_r),st=Mt(this,Hr),ct=et!==nt?et.state:Mt(this,oo),{state:lt}=et;let dt={...lt},ht=!1,pt;if(tt._optimisticResults){const Rt=this.hasListeners(),Pt=!Rt&&shouldFetchOnMount(et,tt),$t=Rt&&shouldFetchOptionally(et,nt,tt,rt);(Pt||$t)&&(dt={...dt,...fetchState(lt.data,et.options)}),tt._optimisticResults==="isRestoring"&&(dt.fetchStatus="idle")}let{error:mt,errorUpdatedAt:ft,status:yt}=dt;if(tt.select&&dt.data!==void 0)if(ot&&dt.data===(it==null?void 0:it.data)&&tt.select===Mt(this,io))pt=Mt(this,Wr);else try{un(this,io,tt.select),pt=tt.select(dt.data),pt=replaceData(ot==null?void 0:ot.data,pt,tt),un(this,Wr,pt),un(this,Kn,null)}catch(Rt){un(this,Kn,Rt)}else pt=dt.data;if(tt.placeholderData!==void 0&&pt===void 0&&yt==="pending"){let Rt;if(ot!=null&&ot.isPlaceholderData&&tt.placeholderData===(st==null?void 0:st.placeholderData))Rt=ot.data;else if(Rt=typeof tt.placeholderData=="function"?tt.placeholderData((Tt=Mt(this,Gr))==null?void 0:Tt.state.data,Mt(this,Gr)):tt.placeholderData,tt.select&&Rt!==void 0)try{Rt=tt.select(Rt),un(this,Kn,null)}catch(Pt){un(this,Kn,Pt)}Rt!==void 0&&(yt="success",pt=replaceData(ot==null?void 0:ot.data,Rt,tt),ht=!0)}Mt(this,Kn)&&(mt=Mt(this,Kn),pt=Mt(this,Wr),ft=Date.now(),yt="error");const gt=dt.fetchStatus==="fetching",xt=yt==="pending",vt=yt==="error",bt=xt&>,Et=pt!==void 0,kt={status:yt,fetchStatus:dt.fetchStatus,isPending:xt,isSuccess:yt==="success",isError:vt,isInitialLoading:bt,isLoading:bt,data:pt,dataUpdatedAt:dt.dataUpdatedAt,error:mt,errorUpdatedAt:ft,failureCount:dt.fetchFailureCount,failureReason:dt.fetchFailureReason,errorUpdateCount:dt.errorUpdateCount,isFetched:dt.dataUpdateCount>0||dt.errorUpdateCount>0,isFetchedAfterMount:dt.dataUpdateCount>ct.dataUpdateCount||dt.errorUpdateCount>ct.errorUpdateCount,isFetching:gt,isRefetching:gt&&!xt,isLoadingError:vt&&!Et,isPaused:dt.fetchStatus==="paused",isPlaceholderData:ht,isRefetchError:vt&&Et,isStale:isStale(et,tt),refetch:this.refetch,promise:Mt(this,fr)};if(this.options.experimental_prefetchInRender){const Rt=Ot=>{kt.status==="error"?Ot.reject(kt.error):kt.data!==void 0&&Ot.resolve(kt.data)},Pt=()=>{const Ot=un(this,fr,kt.promise=pendingThenable());Rt(Ot)},$t=Mt(this,fr);switch($t.status){case"pending":et.queryHash===nt.queryHash&&Rt($t);break;case"fulfilled":(kt.status==="error"||kt.data!==$t.value)&&Pt();break;case"rejected":(kt.status!=="error"||kt.error!==$t.reason)&&Pt();break}}return kt}updateResult(et){const tt=Mt(this,On),nt=this.createResult(Mt(this,Sn),this.options);if(un(this,_r,Mt(this,Sn).state),un(this,Hr,this.options),Mt(this,_r).data!==void 0&&un(this,Gr,Mt(this,Sn)),shallowEqualObjects(nt,tt))return;un(this,On,nt);const rt={},ot=()=>{if(!tt)return!0;const{notifyOnChangeProps:it}=this.options,st=typeof it=="function"?it():it;if(st==="all"||!st&&!Mt(this,qr).size)return!0;const at=new Set(st??Mt(this,qr));return this.options.throwOnError&&at.add("error"),Object.keys(Mt(this,On)).some(ct=>{const lt=ct;return Mt(this,On)[lt]!==tt[lt]&&at.has(lt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(rt.listeners=!0),gn(this,Tn,Ql).call(this,{...rt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&gn(this,Tn,Is).call(this)}},Mn=new WeakMap,Sn=new WeakMap,oo=new WeakMap,On=new WeakMap,_r=new WeakMap,Hr=new WeakMap,fr=new WeakMap,Kn=new WeakMap,io=new WeakMap,Wr=new WeakMap,Gr=new WeakMap,Tr=new WeakMap,Ir=new WeakMap,mr=new WeakMap,qr=new WeakMap,Tn=new WeakSet,to=function(et){gn(this,Tn,Ns).call(this);let tt=Mt(this,Sn).fetch(this.options,et);return et!=null&&et.throwOnError||(tt=tt.catch(noop$4)),tt},Rs=function(){gn(this,Tn,Ps).call(this);const et=resolveStaleTime(this.options.staleTime,Mt(this,Sn));if(isServer||Mt(this,On).isStale||!isValidTimeout(et))return;const nt=timeUntilStale(Mt(this,On).dataUpdatedAt,et)+1;un(this,Tr,setTimeout(()=>{Mt(this,On).isStale||this.updateResult()},nt))},_s=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Mt(this,Sn)):this.options.refetchInterval)??!1},Ts=function(et){gn(this,Tn,Ls).call(this),un(this,mr,et),!(isServer||resolveEnabled(this.options.enabled,Mt(this,Sn))===!1||!isValidTimeout(Mt(this,mr))||Mt(this,mr)===0)&&un(this,Ir,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&gn(this,Tn,to).call(this)},Mt(this,mr)))},Is=function(){gn(this,Tn,Rs).call(this),gn(this,Tn,Ts).call(this,gn(this,Tn,_s).call(this))},Ps=function(){Mt(this,Tr)&&(clearTimeout(Mt(this,Tr)),un(this,Tr,void 0))},Ls=function(){Mt(this,Ir)&&(clearInterval(Mt(this,Ir)),un(this,Ir,void 0))},Ns=function(){const et=Mt(this,Mn).getQueryCache().build(Mt(this,Mn),this.options);if(et===Mt(this,Sn))return;const tt=Mt(this,Sn);un(this,Sn,et),un(this,oo,et.state),this.hasListeners()&&(tt==null||tt.removeObserver(this),et.addObserver(this))},Ql=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(tt=>{tt(Mt(this,On))}),Mt(this,Mn).getQueryCache().notify({query:Mt(this,Sn),type:"observerResultsUpdated"})})},qs);function shouldLoadOnMount(o,et){return resolveEnabled(et.enabled,o)!==!1&&o.state.data===void 0&&!(o.state.status==="error"&&et.retryOnMount===!1)}function shouldFetchOnMount(o,et){return shouldLoadOnMount(o,et)||o.state.data!==void 0&&shouldFetchOn(o,et,et.refetchOnMount)}function shouldFetchOn(o,et,tt){if(resolveEnabled(et.enabled,o)!==!1){const nt=typeof tt=="function"?tt(o):tt;return nt==="always"||nt!==!1&&isStale(o,et)}return!1}function shouldFetchOptionally(o,et,tt,nt){return(o!==et||resolveEnabled(nt.enabled,o)===!1)&&(!tt.suspense||o.state.status!=="error")&&isStale(o,tt)}function isStale(o,et){return resolveEnabled(et.enabled,o)!==!1&&o.isStaleByTime(resolveStaleTime(et.staleTime,o))}function shouldAssignObserverCurrentProperties(o,et){return!shallowEqualObjects(o.getCurrentResult(),et)}var gr,yr,Bn,rr,sr,Yo,$s,Ks,MutationObserver$1=(Ks=class extends Subscribable{constructor(tt,nt){super();fn(this,sr);fn(this,gr);fn(this,yr);fn(this,Bn);fn(this,rr);un(this,gr,tt),this.setOptions(nt),this.bindMethods(),gn(this,sr,Yo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(tt){var rt;const nt=this.options;this.options=Mt(this,gr).defaultMutationOptions(tt),shallowEqualObjects(this.options,nt)||Mt(this,gr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Mt(this,Bn),observer:this}),nt!=null&&nt.mutationKey&&this.options.mutationKey&&hashKey(nt.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((rt=Mt(this,Bn))==null?void 0:rt.state.status)==="pending"&&Mt(this,Bn).setOptions(this.options)}onUnsubscribe(){var tt;this.hasListeners()||(tt=Mt(this,Bn))==null||tt.removeObserver(this)}onMutationUpdate(tt){gn(this,sr,Yo).call(this),gn(this,sr,$s).call(this,tt)}getCurrentResult(){return Mt(this,yr)}reset(){var tt;(tt=Mt(this,Bn))==null||tt.removeObserver(this),un(this,Bn,void 0),gn(this,sr,Yo).call(this),gn(this,sr,$s).call(this)}mutate(tt,nt){var rt;return un(this,rr,nt),(rt=Mt(this,Bn))==null||rt.removeObserver(this),un(this,Bn,Mt(this,gr).getMutationCache().build(Mt(this,gr),this.options)),Mt(this,Bn).addObserver(this),Mt(this,Bn).execute(tt)}},gr=new WeakMap,yr=new WeakMap,Bn=new WeakMap,rr=new WeakMap,sr=new WeakSet,Yo=function(){var nt;const tt=((nt=Mt(this,Bn))==null?void 0:nt.state)??getDefaultState();un(this,yr,{...tt,isPending:tt.status==="pending",isSuccess:tt.status==="success",isError:tt.status==="error",isIdle:tt.status==="idle",mutate:this.mutate,reset:this.reset})},$s=function(tt){notifyManager.batch(()=>{var nt,rt,ot,it,st,at,ct,lt;if(Mt(this,rr)&&this.hasListeners()){const dt=Mt(this,yr).variables,ht=Mt(this,yr).context;(tt==null?void 0:tt.type)==="success"?((rt=(nt=Mt(this,rr)).onSuccess)==null||rt.call(nt,tt.data,dt,ht),(it=(ot=Mt(this,rr)).onSettled)==null||it.call(ot,tt.data,null,dt,ht)):(tt==null?void 0:tt.type)==="error"&&((at=(st=Mt(this,rr)).onError)==null||at.call(st,tt.error,dt,ht),(lt=(ct=Mt(this,rr)).onSettled)==null||lt.call(ct,void 0,tt.error,dt,ht))}this.listeners.forEach(dt=>{dt(Mt(this,yr))})})},Ks);function hashFn(o){return JSON.stringify(o,(et,tt)=>isPlainObject$2(tt)?Object.keys(tt).sort().reduce((nt,rt)=>(nt[rt]=tt[rt],nt),{}):typeof tt=="bigint"?tt.toString():tt)}function isPlainObject$2(o){if(!hasObjectPrototype(o))return!1;const et=o.constructor;if(typeof et>"u")return!0;const tt=et.prototype;return!(!hasObjectPrototype(tt)||!tt.hasOwnProperty("isPrototypeOf"))}function hasObjectPrototype(o){return Object.prototype.toString.call(o)==="[object Object]"}function filterQueryOptions(o){const{_defaulted:et,behavior:tt,gcTime:nt,initialData:rt,initialDataUpdatedAt:ot,maxPages:it,meta:st,networkMode:at,queryFn:ct,queryHash:lt,queryKey:dt,queryKeyHashFn:ht,retry:pt,retryDelay:mt,structuralSharing:ft,getPreviousPageParam:yt,getNextPageParam:gt,initialPageParam:xt,_optimisticResults:vt,enabled:bt,notifyOnChangeProps:Et,placeholderData:wt,refetchInterval:kt,refetchIntervalInBackground:Tt,refetchOnMount:Rt,refetchOnReconnect:Pt,refetchOnWindowFocus:$t,retryOnMount:Ot,select:Bt,staleTime:zt,suspense:Ft,throwOnError:Yt,config:Ht,connector:Ut,query:qt,...Lt}=o;return Lt}function connectMutationOptions(o){return{mutationFn(et){return connect$1(o,et)},mutationKey:["connect"]}}function disconnectMutationOptions(o){return{mutationFn(et){return disconnect(o,et)},mutationKey:["disconnect"]}}function getBalanceQueryOptions(o,et={}){return{async queryFn({queryKey:tt}){const{address:nt,scopeKey:rt,...ot}=tt[1];if(!nt)throw new Error("address is required");return await getBalance(o,{...ot,address:nt})??null},queryKey:getBalanceQueryKey(et)}}function getBalanceQueryKey(o={}){return["balance",filterQueryOptions(o)]}function getBlockNumberQueryOptions(o,et={}){return{gcTime:0,async queryFn({queryKey:tt}){const{scopeKey:nt,...rt}=tt[1];return await getBlockNumber(o,rt)??null},queryKey:getBlockNumberQueryKey(et)}}function getBlockNumberQueryKey(o={}){return["blockNumber",filterQueryOptions(o)]}function getEnsAddressQueryOptions(o,et={}){return{async queryFn({queryKey:tt}){const{name:nt,scopeKey:rt,...ot}=tt[1];if(!nt)throw new Error("name is required");return getEnsAddress(o,{...ot,name:nt})},queryKey:getEnsAddressQueryKey(et)}}function getEnsAddressQueryKey(o={}){return["ensAddress",filterQueryOptions(o)]}function getEnsAvatarQueryOptions(o,et={}){return{async queryFn({queryKey:tt}){const{name:nt,scopeKey:rt,...ot}=tt[1];if(!nt)throw new Error("name is required");return getEnsAvatar(o,{...ot,name:nt})},queryKey:getEnsAvatarQueryKey(et)}}function getEnsAvatarQueryKey(o={}){return["ensAvatar",filterQueryOptions(o)]}function getEnsNameQueryOptions(o,et={}){return{async queryFn({queryKey:tt}){const{address:nt,scopeKey:rt,...ot}=tt[1];if(!nt)throw new Error("address is required");return getEnsName(o,{...ot,address:nt})},queryKey:getEnsNameQueryKey(et)}}function getEnsNameQueryKey(o={}){return["ensName",filterQueryOptions(o)]}function signMessageMutationOptions(o){return{mutationFn(et){return signMessage(o,et)},mutationKey:["signMessage"]}}function switchChainMutationOptions(o){return{mutationFn(et){return switchChain(o,et)},mutationKey:["switchChain"]}}var QueryClientContext=reactExports.createContext(void 0),useQueryClient=o=>{const et=reactExports.useContext(QueryClientContext);if(!et)throw new Error("No QueryClient set, use QueryClientProvider to set one");return et},QueryClientProvider=({client:o,children:et})=>(reactExports.useEffect(()=>(o.mount(),()=>{o.unmount()}),[o]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:o,children:et})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let o=!1;return{clearReset:()=>{o=!1},reset:()=>{o=!0},isReset:()=>o}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(o,et){return typeof o=="function"?o(...et):!!o}function noop$3(){}var ensurePreventErrorBoundaryRetry=(o,et)=>{(o.suspense||o.throwOnError||o.experimental_prefetchInRender)&&(et.isReset()||(o.retryOnMount=!1))},useClearResetErrorBoundary=o=>{reactExports.useEffect(()=>{o.clearReset()},[o])},getHasError=({result:o,errorResetBoundary:et,throwOnError:tt,query:nt})=>o.isError&&!et.isReset()&&!o.isFetching&&nt&&shouldThrowError(tt,[o.error,nt]),ensureSuspenseTimers=o=>{o.suspense&&(o.staleTime===void 0&&(o.staleTime=1e3),typeof o.gcTime=="number"&&(o.gcTime=Math.max(o.gcTime,1e3)))},willFetch=(o,et)=>o.isLoading&&o.isFetching&&!et,shouldSuspend=(o,et)=>(o==null?void 0:o.suspense)&&et.isPending,fetchOptimistic=(o,et,tt)=>et.fetchOptimistic(o).catch(()=>{tt.clearReset()});function useBaseQuery(o,et,tt){var lt,dt,ht,pt,mt;const nt=useQueryClient(),rt=useIsRestoring(),ot=useQueryErrorResetBoundary(),it=nt.defaultQueryOptions(o);(dt=(lt=nt.getDefaultOptions().queries)==null?void 0:lt._experimental_beforeQuery)==null||dt.call(lt,it),it._optimisticResults=rt?"isRestoring":"optimistic",ensureSuspenseTimers(it),ensurePreventErrorBoundaryRetry(it,ot),useClearResetErrorBoundary(ot);const st=!nt.getQueryCache().get(it.queryHash),[at]=reactExports.useState(()=>new et(nt,it)),ct=at.getOptimisticResult(it);if(reactExports.useSyncExternalStore(reactExports.useCallback(ft=>{const yt=rt?()=>{}:at.subscribe(notifyManager.batchCalls(ft));return at.updateResult(),yt},[at,rt]),()=>at.getCurrentResult(),()=>at.getCurrentResult()),reactExports.useEffect(()=>{at.setOptions(it,{listeners:!1})},[it,at]),shouldSuspend(it,ct))throw fetchOptimistic(it,at,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:it.throwOnError,query:nt.getQueryCache().get(it.queryHash)}))throw ct.error;if((pt=(ht=nt.getDefaultOptions().queries)==null?void 0:ht._experimental_afterQuery)==null||pt.call(ht,it,ct),it.experimental_prefetchInRender&&!isServer&&willFetch(ct,rt)){const ft=st?fetchOptimistic(it,at,ot):(mt=nt.getQueryCache().get(it.queryHash))==null?void 0:mt.promise;ft==null||ft.catch(noop$3).finally(()=>{at.updateResult()})}return it.notifyOnChangeProps?ct:at.trackResult(ct)}function useQuery$1(o,et){return useBaseQuery(o,QueryObserver)}function useMutation(o,et){const tt=useQueryClient(),[nt]=reactExports.useState(()=>new MutationObserver$1(tt,o));reactExports.useEffect(()=>{nt.setOptions(o)},[nt,o]);const rt=reactExports.useSyncExternalStore(reactExports.useCallback(it=>nt.subscribe(notifyManager.batchCalls(it)),[nt]),()=>nt.getCurrentResult(),()=>nt.getCurrentResult()),ot=reactExports.useCallback((it,st)=>{nt.mutate(it,st).catch(noop$3)},[nt]);if(rt.error&&shouldThrowError(nt.options.throwOnError,[rt.error]))throw rt.error;return{...rt,mutate:ot,mutateAsync:rt.mutate}}function useQuery(o){const et=useQuery$1({...o,queryKeyHashFn:hashFn});return et.queryKey=o.queryKey,et}function useChainId(o={}){const et=useConfig(o);return reactExports.useSyncExternalStore(tt=>watchChainId(et,{onChange:tt}),()=>getChainId(et),()=>getChainId(et))}function useBalance(o={}){const{address:et,query:tt={}}=o,nt=useConfig(o),rt=useChainId({config:nt}),ot=getBalanceQueryOptions(nt,{...o,chainId:o.chainId??rt}),it=!!(et&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useWatchBlockNumber(o={}){const{enabled:et=!0,onBlockNumber:tt,config:nt,...rt}=o,ot=useConfig(o),it=useChainId({config:ot}),st=o.chainId??it;reactExports.useEffect(()=>{if(et&&tt)return watchBlockNumber(ot,{...rt,chainId:st,onBlockNumber:tt})},[st,ot,et,tt,rt.onError,rt.emitMissed,rt.emitOnBegin,rt.poll,rt.pollingInterval,rt.syncConnectedChain])}function useBlockNumber(o={}){const{query:et={},watch:tt}=o,nt=useConfig(o),rt=useQueryClient(),ot=useChainId({config:nt}),it=o.chainId??ot,st=getBlockNumberQueryOptions(nt,{...o,chainId:it});return useWatchBlockNumber({config:o.config,chainId:o.chainId,...typeof tt=="object"?tt:{},enabled:!!((et.enabled??!0)&&(typeof tt=="object"?tt.enabled:tt)),onBlockNumber(at){rt.setQueryData(st.queryKey,at)}}),useQuery({...et,...st})}function useChains$1(o={}){const et=useConfig(o);return reactExports.useSyncExternalStore(tt=>watchChains(et,{onChange:tt}),()=>getChains(et),()=>getChains(et))}function useConnectors$1(o={}){const et=useConfig(o);return reactExports.useSyncExternalStore(tt=>watchConnectors(et,{onChange:tt}),()=>getConnectors(et),()=>getConnectors(et))}function useConnect$1(o={}){const{mutation:et}=o,tt=useConfig(o),nt=connectMutationOptions(tt),{mutate:rt,mutateAsync:ot,...it}=useMutation({...et,...nt});return reactExports.useEffect(()=>tt.subscribe(({status:st})=>st,(st,at)=>{at==="connected"&&st==="disconnected"&&it.reset()}),[tt,it.reset]),{...it,connect:rt,connectAsync:ot,connectors:useConnectors$1({config:tt})}}function useConnections(o={}){const et=useConfig(o);return reactExports.useSyncExternalStore(tt=>watchConnections(et,{onChange:tt}),()=>getConnections(et),()=>getConnections(et))}function useDisconnect(o={}){const{mutation:et}=o,tt=useConfig(o),nt=disconnectMutationOptions(tt),{mutate:rt,mutateAsync:ot,...it}=useMutation({...et,...nt});return{...it,connectors:useConnections({config:tt}).map(st=>st.connector),disconnect:rt,disconnectAsync:ot}}function useEnsAddress(o={}){const{name:et,query:tt={}}=o,nt=useConfig(o),rt=useChainId({config:nt}),ot=getEnsAddressQueryOptions(nt,{...o,chainId:o.chainId??rt}),it=!!(et&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useEnsAvatar(o={}){const{name:et,query:tt={}}=o,nt=useConfig(o),rt=useChainId({config:nt}),ot=getEnsAvatarQueryOptions(nt,{...o,chainId:o.chainId??rt}),it=!!(et&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useEnsName(o={}){const{address:et,query:tt={}}=o,nt=useConfig(o),rt=useChainId({config:nt}),ot=getEnsNameQueryOptions(nt,{...o,chainId:o.chainId??rt}),it=!!(et&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useSignMessage(o={}){const{mutation:et}=o,tt=useConfig(o),nt=signMessageMutationOptions(tt),{mutate:rt,mutateAsync:ot,...it}=useMutation({...et,...nt});return{...it,signMessage:rt,signMessageAsync:ot}}function useSwitchChain(o={}){const{mutation:et}=o,tt=useConfig(o),nt=switchChainMutationOptions(tt),{mutate:rt,mutateAsync:ot,...it}=useMutation({...et,...nt});return{...it,chains:useChains$1({config:tt}),switchChain:rt,switchChainAsync:ot}}const contracts={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters={block:defineBlock({format(o){var tt;return{transactions:(tt=o.transactions)==null?void 0:tt.map(nt=>{if(typeof nt=="string")return nt;const rt=formatTransaction(nt);return rt.typeHex==="0x7e"&&(rt.isSystemTx=nt.isSystemTx,rt.mint=nt.mint?hexToBigInt(nt.mint):void 0,rt.sourceHash=nt.sourceHash,rt.type="deposit"),rt}),stateRoot:o.stateRoot}}}),transaction:defineTransaction({format(o){const et={};return o.type==="0x7e"&&(et.isSystemTx=o.isSystemTx,et.mint=o.mint?hexToBigInt(o.mint):void 0,et.sourceHash=o.sourceHash,et.type="deposit"),et}}),transactionReceipt:defineTransactionReceipt({format(o){return{l1GasPrice:o.l1GasPrice?hexToBigInt(o.l1GasPrice):null,l1GasUsed:o.l1GasUsed?hexToBigInt(o.l1GasUsed):null,l1Fee:o.l1Fee?hexToBigInt(o.l1Fee):null,l1FeeScalar:o.l1FeeScalar?Number(o.l1FeeScalar):null}}})};function serializeTransaction(o,et){return isDeposit(o)?serializeTransactionDeposit(o):serializeTransaction$1(o,et)}const serializers={transaction:serializeTransaction};function serializeTransactionDeposit(o){assertTransactionDeposit(o);const{sourceHash:et,data:tt,from:nt,gas:rt,isSystemTx:ot,mint:it,to:st,value:at}=o,ct=[et,nt,st??"0x",it?toHex(it):"0x",at?toHex(at):"0x",rt?toHex(rt):"0x",ot?"0x1":"0x",tt??"0x"];return concatHex(["0x7e",toRlp(ct)])}function isDeposit(o){return o.type==="deposit"||typeof o.sourceHash<"u"}function assertTransactionDeposit(o){const{from:et,to:tt}=o;if(et&&!isAddress(et))throw new InvalidAddressError({address:et});if(tt&&!isAddress(tt))throw new InvalidAddressError({address:tt})}const chainConfig={contracts,formatters,serializers},arbitrum=defineChain({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),mainnet=defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),sourceId=1,optimism=defineChain({...chainConfig,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...chainConfig.contracts,disputeGameFactory:{[sourceId]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[sourceId]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[sourceId]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[sourceId]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId}),polygon=defineChain({id:137,name:"Polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});coinbaseWallet.type="coinbaseWallet";function coinbaseWallet(o={}){return o.version==="3"||o.headlessMode?version3(o):version4(o)}function version4(o){let et,tt,nt,rt,ot;return it=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",supportsSimulation:!0,type:coinbaseWallet.type,async connect({chainId:st}={}){try{const at=await this.getProvider(),ct=(await at.request({method:"eth_requestAccounts"})).map(dt=>getAddress(dt));nt||(nt=this.onAccountsChanged.bind(this),at.on("accountsChanged",nt)),rt||(rt=this.onChainChanged.bind(this),at.on("chainChanged",rt)),ot||(ot=this.onDisconnect.bind(this),at.on("disconnect",ot));let lt=await this.getChainId();if(st&<!==st){const dt=await this.switchChain({chainId:st}).catch(ht=>{if(ht.code===UserRejectedRequestError.code)throw ht;return{id:lt}});lt=(dt==null?void 0:dt.id)??lt}return{accounts:ct,chainId:lt}}catch(at){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(at.message)?new UserRejectedRequestError(at):at}},async disconnect(){var at;const st=await this.getProvider();nt&&(st.removeListener("accountsChanged",nt),nt=void 0),rt&&(st.removeListener("chainChanged",rt),rt=void 0),ot&&(st.removeListener("disconnect",ot),ot=void 0),st.disconnect(),(at=st.close)==null||at.call(st)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(at=>getAddress(at))},async getChainId(){const at=await(await this.getProvider()).request({method:"eth_chainId"});return Number(at)},async getProvider(){if(!tt){const st=await(async()=>{const at=await __vitePreload(()=>import("./index-B6MMxlAs.js"),__vite__mapDeps([0,1]));return typeof at.CoinbaseWalletSDK!="function"&&typeof at.default=="function"?at.default:at.CoinbaseWalletSDK})();et=new st({...o,appChainIds:it.chains.map(at=>at.id)}),tt=et.makeWeb3Provider({...o,options:o.preference??"all"})}return tt},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:st,chainId:at}){var dt,ht,pt,mt;const ct=it.chains.find(ft=>ft.id===at);if(!ct)throw new SwitchChainError(new ChainNotConfiguredError);const lt=await this.getProvider();try{return await lt.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(ct.id)}]}),ct}catch(ft){if(ft.code===4902)try{let yt;st!=null&&st.blockExplorerUrls?yt=st.blockExplorerUrls:yt=(dt=ct.blockExplorers)!=null&&dt.default.url?[(ht=ct.blockExplorers)==null?void 0:ht.default.url]:[];let gt;(pt=st==null?void 0:st.rpcUrls)!=null&&pt.length?gt=st.rpcUrls:gt=[((mt=ct.rpcUrls.default)==null?void 0:mt.http[0])??""];const xt={blockExplorerUrls:yt,chainId:numberToHex(at),chainName:(st==null?void 0:st.chainName)??ct.name,iconUrls:st==null?void 0:st.iconUrls,nativeCurrency:(st==null?void 0:st.nativeCurrency)??ct.nativeCurrency,rpcUrls:gt};return await lt.request({method:"wallet_addEthereumChain",params:[xt]}),ct}catch(yt){throw new UserRejectedRequestError(yt)}throw new SwitchChainError(ft)}},onAccountsChanged(st){st.length===0?this.onDisconnect():it.emitter.emit("change",{accounts:st.map(at=>getAddress(at))})},onChainChanged(st){const at=Number(st);it.emitter.emit("change",{chainId:at})},async onDisconnect(st){it.emitter.emit("disconnect");const at=await this.getProvider();nt&&(at.removeListener("accountsChanged",nt),nt=void 0),rt&&(at.removeListener("chainChanged",rt),rt=void 0),ot&&(at.removeListener("disconnect",ot),ot=void 0)}})}function version3(o){let tt,nt,rt,ot,it;return st=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:coinbaseWallet.type,async connect({chainId:at}={}){try{const ct=await this.getProvider(),lt=(await ct.request({method:"eth_requestAccounts"})).map(ht=>getAddress(ht));rt||(rt=this.onAccountsChanged.bind(this),ct.on("accountsChanged",rt)),ot||(ot=this.onChainChanged.bind(this),ct.on("chainChanged",ot)),it||(it=this.onDisconnect.bind(this),ct.on("disconnect",it));let dt=await this.getChainId();if(at&&dt!==at){const ht=await this.switchChain({chainId:at}).catch(pt=>{if(pt.code===UserRejectedRequestError.code)throw pt;return{id:dt}});dt=(ht==null?void 0:ht.id)??dt}return{accounts:lt,chainId:dt}}catch(ct){throw/(user closed modal|accounts received is empty|user denied account)/i.test(ct.message)?new UserRejectedRequestError(ct):ct}},async disconnect(){const at=await this.getProvider();rt&&(at.removeListener("accountsChanged",rt),rt=void 0),ot&&(at.removeListener("chainChanged",ot),ot=void 0),it&&(at.removeListener("disconnect",it),it=void 0),at.disconnect(),at.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(ct=>getAddress(ct))},async getChainId(){const ct=await(await this.getProvider()).request({method:"eth_chainId"});return Number(ct)},async getProvider(){var at;if(!nt){const ct=await(async()=>{const{default:mt}=await __vitePreload(async()=>{const{default:ft}=await import("./index-CRce2FXR.js").then(yt=>yt.i);return{default:ft}},__vite__mapDeps([2,3,1,4]));return typeof mt!="function"&&typeof mt.default=="function"?mt.default:mt})();tt=new ct({...o,reloadOnDisconnect:!1});const lt=(at=tt.walletExtension)==null?void 0:at.getChainId(),dt=st.chains.find(mt=>o.chainId?mt.id===o.chainId:mt.id===lt)||st.chains[0],ht=o.chainId||(dt==null?void 0:dt.id),pt=o.jsonRpcUrl||(dt==null?void 0:dt.rpcUrls.default.http[0]);nt=tt.makeWeb3Provider(pt,ht)}return nt},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:at,chainId:ct}){var ht,pt,mt,ft;const lt=st.chains.find(yt=>yt.id===ct);if(!lt)throw new SwitchChainError(new ChainNotConfiguredError);const dt=await this.getProvider();try{return await dt.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(lt.id)}]}),lt}catch(yt){if(yt.code===4902)try{let gt;at!=null&&at.blockExplorerUrls?gt=at.blockExplorerUrls:gt=(ht=lt.blockExplorers)!=null&&ht.default.url?[(pt=lt.blockExplorers)==null?void 0:pt.default.url]:[];let xt;(mt=at==null?void 0:at.rpcUrls)!=null&&mt.length?xt=at.rpcUrls:xt=[((ft=lt.rpcUrls.default)==null?void 0:ft.http[0])??""];const vt={blockExplorerUrls:gt,chainId:numberToHex(ct),chainName:(at==null?void 0:at.chainName)??lt.name,iconUrls:at==null?void 0:at.iconUrls,nativeCurrency:(at==null?void 0:at.nativeCurrency)??lt.nativeCurrency,rpcUrls:xt};return await dt.request({method:"wallet_addEthereumChain",params:[vt]}),lt}catch(gt){throw new UserRejectedRequestError(gt)}throw new SwitchChainError(yt)}},onAccountsChanged(at){at.length===0?this.onDisconnect():st.emitter.emit("change",{accounts:at.map(ct=>getAddress(ct))})},onChainChanged(at){const ct=Number(at);st.emitter.emit("change",{chainId:ct})},async onDisconnect(at){st.emitter.emit("disconnect");const ct=await this.getProvider();rt&&(ct.removeListener("accountsChanged",rt),rt=void 0),ot&&(ct.removeListener("chainChanged",ot),ot=void 0),it&&(ct.removeListener("disconnect",it),it=void 0)}})}safe.type="safe";function safe(o={}){const{shimDisconnect:et=!1}=o;let tt,nt;return rt=>({id:"safe",name:"Safe",type:safe.type,async connect(){var at;const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;const it=await this.getAccounts(),st=await this.getChainId();return nt||(nt=this.onDisconnect.bind(this),ot.on("disconnect",nt)),et&&await((at=rt.storage)==null?void 0:at.removeItem("safe.disconnected")),{accounts:it,chainId:st}},async disconnect(){var it;const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;nt&&(ot.removeListener("disconnect",nt),nt=void 0),et&&await((it=rt.storage)==null?void 0:it.setItem("safe.disconnected",!0))},async getAccounts(){const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;return(await ot.request({method:"eth_accounts"})).map(getAddress)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!tt){const{default:it}=await __vitePreload(async()=>{const{default:lt}=await import("./index-BA4zS8rk.js");return{default:lt}},[]),st=new it(o),at=await withTimeout(()=>st.safe.getInfo(),{timeout:o.unstable_getInfoTimeout??10});if(!at)throw new Error("Could not load Safe information");const ct=await(async()=>{const lt=await __vitePreload(()=>import("./index-c_vQ90mY.js").then(dt=>dt.i),__vite__mapDeps([5,4]));return typeof lt.SafeAppProvider!="function"&&typeof lt.default.SafeAppProvider=="function"?lt.default.SafeAppProvider:lt.SafeAppProvider})();tt=new ct(at,st)}return tt}},async getChainId(){const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;return Number(ot.chainId)},async isAuthorized(){var ot;try{return et&&await((ot=rt.storage)==null?void 0:ot.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){rt.emitter.emit("disconnect")}})}walletConnect.type="walletConnect";function walletConnect(o){const et=o.isNewChainsStale??!0;let tt,nt;const rt="eip155";let ot,it,st,at,ct,lt;return dt=>({id:"walletConnect",name:"WalletConnect",type:walletConnect.type,async setup(){const ht=await this.getProvider().catch(()=>null);ht&&(st||(st=this.onConnect.bind(this),ht.on("connect",st)),ct||(ct=this.onSessionDelete.bind(this),ht.on("session_delete",ct)))},async connect({chainId:ht,...pt}={}){var mt,ft;try{const yt=await this.getProvider();if(!yt)throw new ProviderNotFoundError;at||(at=this.onDisplayUri,yt.on("display_uri",at));let gt=ht;if(!gt){const Et=await((mt=dt.storage)==null?void 0:mt.getItem("state"))??{};dt.chains.some(kt=>kt.id===Et.chainId)?gt=Et.chainId:gt=(ft=dt.chains[0])==null?void 0:ft.id}if(!gt)throw new Error("No chains found on connector.");const xt=await this.isChainsStale();if(yt.session&&xt&&await yt.disconnect(),!yt.session||xt){const Et=dt.chains.filter(wt=>wt.id!==gt).map(wt=>wt.id);await yt.connect({optionalChains:[gt,...Et],..."pairingTopic"in pt?{pairingTopic:pt.pairingTopic}:{}}),this.setRequestedChainsIds(dt.chains.map(wt=>wt.id))}const vt=(await yt.enable()).map(Et=>getAddress(Et)),bt=await this.getChainId();return at&&(yt.removeListener("display_uri",at),at=void 0),st&&(yt.removeListener("connect",st),st=void 0),ot||(ot=this.onAccountsChanged.bind(this),yt.on("accountsChanged",ot)),it||(it=this.onChainChanged.bind(this),yt.on("chainChanged",it)),lt||(lt=this.onDisconnect.bind(this),yt.on("disconnect",lt)),ct||(ct=this.onSessionDelete.bind(this),yt.on("session_delete",ct)),{accounts:vt,chainId:bt}}catch(yt){throw/(user rejected|connection request reset)/i.test(yt==null?void 0:yt.message)?new UserRejectedRequestError(yt):yt}},async disconnect(){const ht=await this.getProvider();try{await(ht==null?void 0:ht.disconnect())}catch(pt){if(!/No matching key/i.test(pt.message))throw pt}finally{it&&(ht==null||ht.removeListener("chainChanged",it),it=void 0),lt&&(ht==null||ht.removeListener("disconnect",lt),lt=void 0),st||(st=this.onConnect.bind(this),ht==null||ht.on("connect",st)),ot&&(ht==null||ht.removeListener("accountsChanged",ot),ot=void 0),ct&&(ht==null||ht.removeListener("session_delete",ct),ct=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(pt=>getAddress(pt))},async getProvider({chainId:ht}={}){var mt;async function pt(){const ft=dt.chains.map(gt=>gt.id);if(!ft.length)return;const{EthereumProvider:yt}=await __vitePreload(async()=>{const{EthereumProvider:gt}=await import("./index.es-BocJIoGE.js");return{EthereumProvider:gt}},__vite__mapDeps([6,4,3]));return await yt.init({...o,disableProviderPing:!0,optionalChains:ft,projectId:o.projectId,rpcMap:Object.fromEntries(dt.chains.map(gt=>{const[xt]=extractRpcUrls({chain:gt,transports:dt.transports});return[gt.id,xt]})),showQrModal:o.showQrModal??!0})}return tt||(nt||(nt=pt()),tt=await nt,tt==null||tt.events.setMaxListeners(Number.POSITIVE_INFINITY)),ht&&await((mt=this.switchChain)==null?void 0:mt.call(this,{chainId:ht})),tt},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[ht,pt]=await Promise.all([this.getAccounts(),this.getProvider()]);return ht.length?await this.isChainsStale()&&pt.session?(await pt.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:ht,chainId:pt}){var yt,gt,xt;const mt=await this.getProvider();if(!mt)throw new ProviderNotFoundError;const ft=dt.chains.find(vt=>vt.id===pt);if(!ft)throw new SwitchChainError(new ChainNotConfiguredError);try{await Promise.all([new Promise(bt=>{const Et=({chainId:wt})=>{wt===pt&&(dt.emitter.off("change",Et),bt())};dt.emitter.on("change",Et)}),mt.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(pt)}]})]);const vt=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...vt,pt]),ft}catch(vt){const bt=vt;if(/(user rejected)/i.test(bt.message))throw new UserRejectedRequestError(bt);try{let Et;ht!=null&&ht.blockExplorerUrls?Et=ht.blockExplorerUrls:Et=(yt=ft.blockExplorers)!=null&&yt.default.url?[(gt=ft.blockExplorers)==null?void 0:gt.default.url]:[];let wt;(xt=ht==null?void 0:ht.rpcUrls)!=null&&xt.length?wt=ht.rpcUrls:wt=[...ft.rpcUrls.default.http];const kt={blockExplorerUrls:Et,chainId:numberToHex(pt),chainName:(ht==null?void 0:ht.chainName)??ft.name,iconUrls:ht==null?void 0:ht.iconUrls,nativeCurrency:(ht==null?void 0:ht.nativeCurrency)??ft.nativeCurrency,rpcUrls:wt};await mt.request({method:"wallet_addEthereumChain",params:[kt]});const Tt=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...Tt,pt]),ft}catch(Et){throw new UserRejectedRequestError(Et)}}},onAccountsChanged(ht){ht.length===0?this.onDisconnect():dt.emitter.emit("change",{accounts:ht.map(pt=>getAddress(pt))})},onChainChanged(ht){const pt=Number(ht);dt.emitter.emit("change",{chainId:pt})},async onConnect(ht){const pt=Number(ht.chainId),mt=await this.getAccounts();dt.emitter.emit("connect",{accounts:mt,chainId:pt})},async onDisconnect(ht){this.setRequestedChainsIds([]),dt.emitter.emit("disconnect");const pt=await this.getProvider();ot&&(pt.removeListener("accountsChanged",ot),ot=void 0),it&&(pt.removeListener("chainChanged",it),it=void 0),lt&&(pt.removeListener("disconnect",lt),lt=void 0),ct&&(pt.removeListener("session_delete",ct),ct=void 0),st||(st=this.onConnect.bind(this),pt.on("connect",st))},onDisplayUri(ht){dt.emitter.emit("message",{type:"display_uri",data:ht})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var pt,mt,ft;return tt?((ft=(mt=(pt=tt.session)==null?void 0:pt.namespaces[rt])==null?void 0:mt.accounts)==null?void 0:ft.map(yt=>Number.parseInt(yt.split(":")[1]||"")))??[]:[]},async getRequestedChainsIds(){var ht;return await((ht=dt.storage)==null?void 0:ht.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!et)return!1;const ht=dt.chains.map(ft=>ft.id),pt=this.getNamespaceChainsIds();if(pt.length&&!pt.some(ft=>ht.includes(ft)))return!1;const mt=await this.getRequestedChainsIds();return!ht.every(ft=>mt.includes(ft))},async setRequestedChainsIds(ht){var pt;await((pt=dt.storage)==null?void 0:pt.setItem(this.requestedChainsStorageKey,ht))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var define_process_default$3={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},__spreadArray$1=function(o,et,tt){for(var nt=0,rt=et.length,ot;nt"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ReactNativeInfo:typeof navigator<"u"?parseUserAgent(navigator.userAgent):getNodeVersion()}function matchUserAgent(o){return o!==""&&userAgentRules.reduce(function(et,tt){var nt=tt[0],rt=tt[1];if(et)return et;var ot=rt.exec(o);return!!ot&&[nt,ot]},!1)}function parseUserAgent(o){var et=matchUserAgent(o);if(!et)return null;var tt=et[0],nt=et[1];if(tt==="searchbot")return new BotInfo;var rt=nt[1]&&nt[1].split(".").join("_").split("_").slice(0,3);rt?rt.length=0;st--)(it=o[st])&&(ot=(rt<3?it(ot):rt>3?it(et,tt,ot):it(et,tt))||ot);return rt>3&&ot&&Object.defineProperty(et,tt,ot),ot}function __param(o,et){return function(tt,nt){et(tt,nt,o)}}function __esDecorate(o,et,tt,nt,rt,ot){function it(gt){if(gt!==void 0&&typeof gt!="function")throw new TypeError("Function expected");return gt}for(var st=nt.kind,at=st==="getter"?"get":st==="setter"?"set":"value",ct=!et&&o?nt.static?o:o.prototype:null,lt=et||(ct?Object.getOwnPropertyDescriptor(ct,nt.name):{}),dt,ht=!1,pt=tt.length-1;pt>=0;pt--){var mt={};for(var ft in nt)mt[ft]=ft==="access"?{}:nt[ft];for(var ft in nt.access)mt.access[ft]=nt.access[ft];mt.addInitializer=function(gt){if(ht)throw new TypeError("Cannot add initializers after decoration has completed");ot.push(it(gt||null))};var yt=(0,tt[pt])(st==="accessor"?{get:lt.get,set:lt.set}:lt[at],mt);if(st==="accessor"){if(yt===void 0)continue;if(yt===null||typeof yt!="object")throw new TypeError("Object expected");(dt=it(yt.get))&&(lt.get=dt),(dt=it(yt.set))&&(lt.set=dt),(dt=it(yt.init))&&rt.unshift(dt)}else(dt=it(yt))&&(st==="field"?rt.unshift(dt):lt[at]=dt)}ct&&Object.defineProperty(ct,nt.name,lt),ht=!0}function __runInitializers(o,et,tt){for(var nt=arguments.length>2,rt=0;rt0&&ot[ot.length-1])&&(ct[0]===6||ct[0]===2)){tt=0;continue}if(ct[0]===3&&(!ot||ct[1]>ot[0]&&ct[1]=o.length&&(o=void 0),{value:o&&o[nt++],done:!o}}};throw new TypeError(et?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(o,et){var tt=typeof Symbol=="function"&&o[Symbol.iterator];if(!tt)return o;var nt=tt.call(o),rt,ot=[],it;try{for(;(et===void 0||et-- >0)&&!(rt=nt.next()).done;)ot.push(rt.value)}catch(st){it={error:st}}finally{try{rt&&!rt.done&&(tt=nt.return)&&tt.call(nt)}finally{if(it)throw it.error}}return ot}function __spread(){for(var o=[],et=0;et1||at(pt,ft)})},mt&&(rt[pt]=mt(rt[pt])))}function at(pt,mt){try{ct(nt[pt](mt))}catch(ft){ht(ot[0][3],ft)}}function ct(pt){pt.value instanceof __await?Promise.resolve(pt.value.v).then(lt,dt):ht(ot[0][2],pt)}function lt(pt){at("next",pt)}function dt(pt){at("throw",pt)}function ht(pt,mt){pt(mt),ot.shift(),ot.length&&at(ot[0][0],ot[0][1])}}function __asyncDelegator(o){var et,tt;return et={},nt("next"),nt("throw",function(rt){throw rt}),nt("return"),et[Symbol.iterator]=function(){return this},et;function nt(rt,ot){et[rt]=o[rt]?function(it){return(tt=!tt)?{value:__await(o[rt](it)),done:!1}:ot?ot(it):it}:ot}}function __asyncValues(o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var et=o[Symbol.asyncIterator],tt;return et?et.call(o):(o=typeof __values=="function"?__values(o):o[Symbol.iterator](),tt={},nt("next"),nt("throw"),nt("return"),tt[Symbol.asyncIterator]=function(){return this},tt);function nt(ot){tt[ot]=o[ot]&&function(it){return new Promise(function(st,at){it=o[ot](it),rt(st,at,it.done,it.value)})}}function rt(ot,it,st,at){Promise.resolve(at).then(function(ct){ot({value:ct,done:st})},it)}}function __makeTemplateObject(o,et){return Object.defineProperty?Object.defineProperty(o,"raw",{value:et}):o.raw=et,o}var __setModuleDefault=Object.create?function(o,et){Object.defineProperty(o,"default",{enumerable:!0,value:et})}:function(o,et){o.default=et},ownKeys=function(o){return ownKeys=Object.getOwnPropertyNames||function(et){var tt=[];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(tt[tt.length]=nt);return tt},ownKeys(o)};function __importStar(o){if(o&&o.__esModule)return o;var et={};if(o!=null)for(var tt=ownKeys(o),nt=0;nt"u"||define_process_env_default$1===void 0?defaultEnvironment:"production",createDefinition=function(o){return{isEnabled:function(et){return o.some(function(tt){return!!et[tt]})}}},featureDefinitions={measureLayout:createDefinition(["layout","layoutId","drag"]),animation:createDefinition(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:createDefinition(["exit"]),drag:createDefinition(["drag","dragControls"]),focus:createDefinition(["whileFocus"]),hover:createDefinition(["whileHover","onHoverStart","onHoverEnd"]),tap:createDefinition(["whileTap","onTap","onTapStart","onTapCancel"]),pan:createDefinition(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:createDefinition(["whileInView","onViewportEnter","onViewportLeave"])};function loadFeatures(o){for(var et in o)o[et]!==null&&(et==="projectionNodeConstructor"?featureDefinitions.projectionNodeConstructor=o[et]:featureDefinitions[et].Component=o[et])}var invariant$1=function(){},LazyContext=reactExports.createContext({strict:!1}),featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length;function useFeatures(o,et,tt){var nt=[],rt=reactExports.useContext(LazyContext);if(!et)return null;env$1!=="production"&&tt&&rt.strict;for(var ot=0;ot"u")return et;var tt=new Map;return new Proxy(et,{get:function(nt,rt){return tt.has(rt)||tt.set(rt,et(rt)),tt.get(rt)}})}var lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function isSVGComponent(o){return typeof o!="string"||o.includes("-")?!1:!!(lowercaseSVGElements.indexOf(o)>-1||/[A-Z]/.test(o))}var scaleCorrectors={};function addScaleCorrector(o){Object.assign(scaleCorrectors,o)}var transformAxes=["","X","Y","Z"],order$1=["translate","scale","rotate","skew"],transformProps=["transformPerspective","x","y","z"];order$1.forEach(function(o){return transformAxes.forEach(function(et){return transformProps.push(o+et)})});function sortTransformProps(o,et){return transformProps.indexOf(o)-transformProps.indexOf(et)}var transformPropSet=new Set(transformProps);function isTransformProp(o){return transformPropSet.has(o)}var transformOriginProps=new Set(["originX","originY","originZ"]);function isTransformOriginProp(o){return transformOriginProps.has(o)}function isForcedMotionValue(o,et){var tt=et.layout,nt=et.layoutId;return isTransformProp(o)||isTransformOriginProp(o)||(tt||nt!==void 0)&&(!!scaleCorrectors[o]||o==="opacity")}var isMotionValue=function(o){return!!(o!==null&&typeof o=="object"&&o.getVelocity)},translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function buildTransform(o,et,tt,nt){var rt=o.transform,ot=o.transformKeys,it=et.enableHardwareAcceleration,st=it===void 0?!0:it,at=et.allowTransformNone,ct=at===void 0?!0:at,lt="";ot.sort(sortTransformProps);for(var dt=!1,ht=ot.length,pt=0;pttt=>Math.max(Math.min(tt,et),o),sanitize=o=>o%1?Number(o.toFixed(5)):o,floatRegex=/(-)?([\d]*\.?[\d])+/g,colorRegex=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,singleColorRegex=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function isString(o){return typeof o=="string"}const number$3={test:o=>typeof o=="number",parse:parseFloat,transform:o=>o},alpha=Object.assign(Object.assign({},number$3),{transform:clamp$2(0,1)}),scale=Object.assign(Object.assign({},number$3),{default:1}),createUnitType=o=>({test:et=>isString(et)&&et.endsWith(o)&&et.split(" ").length===1,parse:parseFloat,transform:et=>`${et}${o}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage=Object.assign(Object.assign({},percent),{parse:o=>percent.parse(o)/100,transform:o=>percent.transform(o*100)}),isColorString=(o,et)=>tt=>!!(isString(tt)&&singleColorRegex.test(tt)&&tt.startsWith(o)||et&&Object.prototype.hasOwnProperty.call(tt,et)),splitColor=(o,et,tt)=>nt=>{if(!isString(nt))return nt;const[rt,ot,it,st]=nt.match(floatRegex);return{[o]:parseFloat(rt),[et]:parseFloat(ot),[tt]:parseFloat(it),alpha:st!==void 0?parseFloat(st):1}},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:o,saturation:et,lightness:tt,alpha:nt=1})=>"hsla("+Math.round(o)+", "+percent.transform(sanitize(et))+", "+percent.transform(sanitize(tt))+", "+sanitize(alpha.transform(nt))+")"},clampRgbUnit=clamp$2(0,255),rgbUnit=Object.assign(Object.assign({},number$3),{transform:o=>Math.round(clampRgbUnit(o))}),rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:o,green:et,blue:tt,alpha:nt=1})=>"rgba("+rgbUnit.transform(o)+", "+rgbUnit.transform(et)+", "+rgbUnit.transform(tt)+", "+sanitize(alpha.transform(nt))+")"};function parseHex(o){let et="",tt="",nt="",rt="";return o.length>5?(et=o.substr(1,2),tt=o.substr(3,2),nt=o.substr(5,2),rt=o.substr(7,2)):(et=o.substr(1,1),tt=o.substr(2,1),nt=o.substr(3,1),rt=o.substr(4,1),et+=et,tt+=tt,nt+=nt,rt+=rt),{red:parseInt(et,16),green:parseInt(tt,16),blue:parseInt(nt,16),alpha:rt?parseInt(rt,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},color$1={test:o=>rgba.test(o)||hex.test(o)||hsla.test(o),parse:o=>rgba.test(o)?rgba.parse(o):hsla.test(o)?hsla.parse(o):hex.parse(o),transform:o=>isString(o)?o:o.hasOwnProperty("red")?rgba.transform(o):hsla.transform(o)},colorToken="${c}",numberToken="${n}";function test(o){var et,tt,nt,rt;return isNaN(o)&&isString(o)&&((tt=(et=o.match(floatRegex))===null||et===void 0?void 0:et.length)!==null&&tt!==void 0?tt:0)+((rt=(nt=o.match(colorRegex))===null||nt===void 0?void 0:nt.length)!==null&&rt!==void 0?rt:0)>0}function analyse$1(o){typeof o=="number"&&(o=`${o}`);const et=[];let tt=0;const nt=o.match(colorRegex);nt&&(tt=nt.length,o=o.replace(colorRegex,colorToken),et.push(...nt.map(color$1.parse)));const rt=o.match(floatRegex);return rt&&(o=o.replace(floatRegex,numberToken),et.push(...rt.map(number$3.parse))),{values:et,numColors:tt,tokenised:o}}function parse$4(o){return analyse$1(o).values}function createTransformer(o){const{values:et,numColors:tt,tokenised:nt}=analyse$1(o),rt=et.length;return ot=>{let it=nt;for(let st=0;sttypeof o=="number"?0:o;function getAnimatableNone$1(o){const et=parse$4(o);return createTransformer(o)(et.map(convertNumbersToZero))}const complex={test,parse:parse$4,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(o){let[et,tt]=o.slice(0,-1).split("(");if(et==="drop-shadow")return o;const[nt]=tt.match(floatRegex)||[];if(!nt)return o;const rt=tt.replace(nt,"");let ot=maxDefaults.has(et)?1:0;return nt!==tt&&(ot*=100),et+"("+ot+rt+")"}const functionRegex=/([a-z-]*)\(.*?\)/g,filter$1=Object.assign(Object.assign({},complex),{getAnimatableNone:o=>{const et=o.match(functionRegex);return et?et.map(applyDefaultFilter).join(" "):o}});var int=__assign(__assign({},number$3),{transform:Math.round}),numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(o,et,tt,nt){var rt,ot=o.style,it=o.vars,st=o.transform,at=o.transformKeys,ct=o.transformOrigin;at.length=0;var lt=!1,dt=!1,ht=!0;for(var pt in et){var mt=et[pt];if(isCSSVariable$1(pt)){it[pt]=mt;continue}var ft=numberValueTypes[pt],yt=getValueAsType(mt,ft);if(isTransformProp(pt)){if(lt=!0,st[pt]=yt,at.push(pt),!ht)continue;mt!==((rt=ft.default)!==null&&rt!==void 0?rt:0)&&(ht=!1)}else isTransformOriginProp(pt)?(ct[pt]=yt,dt=!0):ot[pt]=yt}lt?ot.transform=buildTransform(o,tt,ht,nt):nt?ot.transform=nt({},""):!et.transform&&ot.transform&&(ot.transform="none"),dt&&(ot.transformOrigin=buildTransformOrigin(ct))}var createHtmlRenderState=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function copyRawValuesOnly(o,et,tt){for(var nt in et)!isMotionValue(et[nt])&&!isForcedMotionValue(nt,tt)&&(o[nt]=et[nt])}function useInitialMotionValues(o,et,tt){var nt=o.transformTemplate;return reactExports.useMemo(function(){var rt=createHtmlRenderState();buildHTMLStyles(rt,et,{enableHardwareAcceleration:!tt},nt);var ot=rt.vars,it=rt.style;return __assign(__assign({},ot),it)},[et])}function useStyle(o,et,tt){var nt=o.style||{},rt={};return copyRawValuesOnly(rt,nt,o),Object.assign(rt,useInitialMotionValues(o,et,tt)),o.transformValues&&(rt=o.transformValues(rt)),rt}function useHTMLProps(o,et,tt){var nt={},rt=useStyle(o,et,tt);return o.drag&&o.dragListener!==!1&&(nt.draggable=!1,rt.userSelect=rt.WebkitUserSelect=rt.WebkitTouchCallout="none",rt.touchAction=o.drag===!0?"none":"pan-".concat(o.drag==="x"?"y":"x")),nt.style=rt,nt}var validMotionProps=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover","whileInView","onViewportEnter","onViewportLeave","viewport","layoutScroll"]);function isValidMotionProp(o){return validMotionProps.has(o)}var shouldForward=function(o){return!isValidMotionProp(o)};function loadExternalIsValidProp(o){o&&(shouldForward=function(et){return et.startsWith("on")?!isValidMotionProp(et):o(et)})}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch{}function filterProps(o,et,tt){var nt={};for(var rt in o)(shouldForward(rt)||tt===!0&&isValidMotionProp(rt)||!et&&!isValidMotionProp(rt)||o.draggable&&rt.startsWith("onDrag"))&&(nt[rt]=o[rt]);return nt}function calcOrigin$1(o,et,tt){return typeof o=="string"?o:px.transform(et+tt*o)}function calcSVGTransformOrigin(o,et,tt){var nt=calcOrigin$1(et,o.x,o.width),rt=calcOrigin$1(tt,o.y,o.height);return"".concat(nt," ").concat(rt)}var camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(o,et,tt,nt,rt){tt===void 0&&(tt=1),nt===void 0&&(nt=0),o.pathLength=1;var ot=camelKeys;o[ot.offset]=px.transform(-nt);var it=px.transform(et),st=px.transform(tt);o[ot.array]="".concat(it," ").concat(st)}function buildSVGAttrs(o,et,tt,nt){var rt=et.attrX,ot=et.attrY,it=et.originX,st=et.originY,at=et.pathLength,ct=et.pathSpacing,lt=ct===void 0?1:ct,dt=et.pathOffset,ht=dt===void 0?0:dt,pt=__rest(et,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]);buildHTMLStyles(o,pt,tt,nt),o.attrs=o.style,o.style={};var mt=o.attrs,ft=o.style,yt=o.dimensions;mt.transform&&(yt&&(ft.transform=mt.transform),delete mt.transform),yt&&(it!==void 0||st!==void 0||ft.transform)&&(ft.transformOrigin=calcSVGTransformOrigin(yt,it!==void 0?it:.5,st!==void 0?st:.5)),rt!==void 0&&(mt.x=rt),ot!==void 0&&(mt.y=ot),at!==void 0&&buildSVGPath(mt,at,lt,ht)}var createSvgRenderState=function(){return __assign(__assign({},createHtmlRenderState()),{attrs:{}})};function useSVGProps(o,et){var tt=reactExports.useMemo(function(){var rt=createSvgRenderState();return buildSVGAttrs(rt,et,{enableHardwareAcceleration:!1},o.transformTemplate),__assign(__assign({},rt.attrs),{style:__assign({},rt.style)})},[et]);if(o.style){var nt={};copyRawValuesOnly(nt,o.style,o),tt.style=__assign(__assign({},nt),tt.style)}return tt}function createUseRender(o){o===void 0&&(o=!1);var et=function(tt,nt,rt,ot,it,st){var at=it.latestValues,ct=isSVGComponent(tt)?useSVGProps:useHTMLProps,lt=ct(nt,at,st),dt=filterProps(nt,typeof tt=="string",o),ht=__assign(__assign(__assign({},dt),lt),{ref:ot});return rt&&(ht["data-projection-id"]=rt),reactExports.createElement(tt,ht)};return et}var CAMEL_CASE_PATTERN=/([a-z])([A-Z])/g,REPLACE_TEMPLATE="$1-$2",camelToDash=function(o){return o.replace(CAMEL_CASE_PATTERN,REPLACE_TEMPLATE).toLowerCase()};function renderHTML(o,et,tt,nt){var rt=et.style,ot=et.vars;Object.assign(o.style,rt,nt&&nt.getProjectionStyles(tt));for(var it in ot)o.style.setProperty(it,ot[it])}var camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function renderSVG(o,et,tt,nt){renderHTML(o,et,void 0,nt);for(var rt in et.attrs)o.setAttribute(camelCaseAttributes.has(rt)?rt:camelToDash(rt),et.attrs[rt])}function scrapeMotionValuesFromProps$1(o){var et=o.style,tt={};for(var nt in et)(isMotionValue(et[nt])||isForcedMotionValue(nt,o))&&(tt[nt]=et[nt]);return tt}function scrapeMotionValuesFromProps(o){var et=scrapeMotionValuesFromProps$1(o);for(var tt in o)if(isMotionValue(o[tt])){var nt=tt==="x"||tt==="y"?"attr"+tt.toUpperCase():tt;et[nt]=o[tt]}return et}function isAnimationControls(o){return typeof o=="object"&&typeof o.start=="function"}var isKeyframesTarget=function(o){return Array.isArray(o)},isCustomValue=function(o){return!!(o&&typeof o=="object"&&o.mix&&o.toValue)},resolveFinalValueInKeyframes=function(o){return isKeyframesTarget(o)?o[o.length-1]||0:o};function resolveMotionValue(o){var et=isMotionValue(o)?o.get():o;return isCustomValue(et)?et.toValue():et}function makeState(o,et,tt,nt){var rt=o.scrapeMotionValuesFromProps,ot=o.createRenderState,it=o.onMount,st={latestValues:makeLatestValues(et,tt,nt,rt),renderState:ot()};return it&&(st.mount=function(at){return it(et,at,st)}),st}var makeUseVisualState=function(o){return function(et,tt){var nt=reactExports.useContext(MotionContext),rt=reactExports.useContext(PresenceContext);return tt?makeState(o,et,nt,rt):useConstant(function(){return makeState(o,et,nt,rt)})}};function makeLatestValues(o,et,tt,nt){var rt={},ot=(tt==null?void 0:tt.initial)===!1,it=nt(o);for(var st in it)rt[st]=resolveMotionValue(it[st]);var at=o.initial,ct=o.animate,lt=checkIfControllingVariants(o),dt=checkIfVariantNode(o);et&&dt&&!lt&&o.inherit!==!1&&(at??(at=et.initial),ct??(ct=et.animate));var ht=ot||at===!1,pt=ht?ct:at;if(pt&&typeof pt!="boolean"&&!isAnimationControls(pt)){var mt=Array.isArray(pt)?pt:[pt];mt.forEach(function(ft){var yt=resolveVariantFromProps(o,ft);if(yt){var gt=yt.transitionEnd;yt.transition;var xt=__rest(yt,["transitionEnd","transition"]);for(var vt in xt){var bt=xt[vt];if(Array.isArray(bt)){var Et=ht?bt.length-1:0;bt=bt[Et]}bt!==null&&(rt[vt]=bt)}for(var vt in gt)rt[vt]=gt[vt]}})}return rt}var svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:function(o,et,tt){var nt=tt.renderState,rt=tt.latestValues;try{nt.dimensions=typeof et.getBBox=="function"?et.getBBox():et.getBoundingClientRect()}catch{nt.dimensions={x:0,y:0,width:0,height:0}}buildSVGAttrs(nt,rt,{enableHardwareAcceleration:!1},o.transformTemplate),renderSVG(et,nt)}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(o,et,tt,nt,rt){var ot=et.forwardMotionProps,it=ot===void 0?!1:ot,st=isSVGComponent(o)?svgMotionConfig:htmlMotionConfig;return __assign(__assign({},st),{preloadedFeatures:tt,useRender:createUseRender(it),createVisualElement:nt,projectionNodeConstructor:rt,Component:o})}var AnimationType;(function(o){o.Animate="animate",o.Hover="whileHover",o.Tap="whileTap",o.Drag="whileDrag",o.Focus="whileFocus",o.InView="whileInView",o.Exit="exit"})(AnimationType||(AnimationType={}));function addDomEvent(o,et,tt,nt){return nt===void 0&&(nt={passive:!0}),o.addEventListener(et,tt,nt),function(){return o.removeEventListener(et,tt)}}function useDomEvent(o,et,tt,nt){reactExports.useEffect(function(){var rt=o.current;if(tt&&rt)return addDomEvent(rt,et,tt,nt)},[o,et,tt,nt])}function useFocusGesture(o){var et=o.whileFocus,tt=o.visualElement,nt=function(){var ot;(ot=tt.animationState)===null||ot===void 0||ot.setActive(AnimationType.Focus,!0)},rt=function(){var ot;(ot=tt.animationState)===null||ot===void 0||ot.setActive(AnimationType.Focus,!1)};useDomEvent(tt,"focus",et?nt:void 0),useDomEvent(tt,"blur",et?rt:void 0)}function isMouseEvent(o){return typeof PointerEvent<"u"&&o instanceof PointerEvent?o.pointerType==="mouse":o instanceof MouseEvent}function isTouchEvent(o){var et=!!o.touches;return et}function filterPrimaryPointer(o){return function(et){var tt=et instanceof MouseEvent,nt=!tt||tt&&et.button===0;nt&&o(et)}}var defaultPagePoint={pageX:0,pageY:0};function pointFromTouch(o,et){et===void 0&&(et="page");var tt=o.touches[0]||o.changedTouches[0],nt=tt||defaultPagePoint;return{x:nt[et+"X"],y:nt[et+"Y"]}}function pointFromMouse(o,et){return et===void 0&&(et="page"),{x:o[et+"X"],y:o[et+"Y"]}}function extractEventInfo(o,et){return et===void 0&&(et="page"),{point:isTouchEvent(o)?pointFromTouch(o,et):pointFromMouse(o,et)}}var wrapHandler=function(o,et){et===void 0&&(et=!1);var tt=function(nt){return o(nt,extractEventInfo(nt))};return et?filterPrimaryPointer(tt):tt},supportsPointerEvents=function(){return isBrowser$3&&window.onpointerdown===null},supportsTouchEvents=function(){return isBrowser$3&&window.ontouchstart===null},supportsMouseEvents=function(){return isBrowser$3&&window.onmousedown===null},mouseEventNames={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},touchEventNames={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function getPointerEventName(o){return supportsPointerEvents()?o:supportsTouchEvents()?touchEventNames[o]:supportsMouseEvents()?mouseEventNames[o]:o}function addPointerEvent(o,et,tt,nt){return addDomEvent(o,getPointerEventName(et),wrapHandler(tt,et==="pointerdown"),nt)}function usePointerEvent(o,et,tt,nt){return useDomEvent(o,getPointerEventName(et),tt&&wrapHandler(tt,et==="pointerdown"),nt)}function createLock(o){var et=null;return function(){var tt=function(){et=null};return et===null?(et=o,tt):!1}}var globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(o){var et=!1;if(o==="y")et=globalVerticalLock();else if(o==="x")et=globalHorizontalLock();else{var tt=globalHorizontalLock(),nt=globalVerticalLock();tt&&nt?et=function(){tt(),nt()}:(tt&&tt(),nt&&nt())}return et}function isDragActive(){var o=getGlobalLock(!0);return o?(o(),!1):!0}function createHoverEvent(o,et,tt){return function(nt,rt){var ot;!isMouseEvent(nt)||isDragActive()||((ot=o.animationState)===null||ot===void 0||ot.setActive(AnimationType.Hover,et),tt==null||tt(nt,rt))}}function useHoverGesture(o){var et=o.onHoverStart,tt=o.onHoverEnd,nt=o.whileHover,rt=o.visualElement;usePointerEvent(rt,"pointerenter",et||nt?createHoverEvent(rt,!0,et):void 0,{passive:!et}),usePointerEvent(rt,"pointerleave",tt||nt?createHoverEvent(rt,!1,tt):void 0,{passive:!tt})}var isNodeOrChild=function(o,et){return et?o===et?!0:isNodeOrChild(o,et.parentElement):!1};function useUnmountEffect(o){return reactExports.useEffect(function(){return function(){return o()}},[])}const clamp$1=(o,et,tt)=>Math.min(Math.max(tt,o),et),safeMin=.001,minDuration=.01,maxDuration=10,minDamping=.05,maxDamping=1;function findSpring({duration:o=800,bounce:et=.25,velocity:tt=0,mass:nt=1}){let rt,ot,it=1-et;it=clamp$1(minDamping,maxDamping,it),o=clamp$1(minDuration,maxDuration,o/1e3),it<1?(rt=ct=>{const lt=ct*it,dt=lt*o,ht=lt-tt,pt=calcAngularFreq(ct,it),mt=Math.exp(-dt);return safeMin-ht/pt*mt},ot=ct=>{const dt=ct*it*o,ht=dt*tt+tt,pt=Math.pow(it,2)*Math.pow(ct,2)*o,mt=Math.exp(-dt),ft=calcAngularFreq(Math.pow(ct,2),it);return(-rt(ct)+safeMin>0?-1:1)*((ht-pt)*mt)/ft}):(rt=ct=>{const lt=Math.exp(-ct*o),dt=(ct-tt)*o+1;return-safeMin+lt*dt},ot=ct=>{const lt=Math.exp(-ct*o),dt=(tt-ct)*(o*o);return lt*dt});const st=5/o,at=approximateRoot(rt,ot,st);if(o=o*1e3,isNaN(at))return{stiffness:100,damping:10,duration:o};{const ct=Math.pow(at,2)*nt;return{stiffness:ct,damping:it*2*Math.sqrt(nt*ct),duration:o}}}const rootIterations=12;function approximateRoot(o,et,tt){let nt=tt;for(let rt=1;rto[tt]!==void 0)}function getSpringOptions(o){let et=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},o);if(!isSpringType(o,physicsKeys)&&isSpringType(o,durationKeys)){const tt=findSpring(o);et=Object.assign(Object.assign(Object.assign({},et),tt),{velocity:0,mass:1}),et.isResolvedFromDuration=!0}return et}function spring(o){var{from:et=0,to:tt=1,restSpeed:nt=2,restDelta:rt}=o,ot=__rest(o,["from","to","restSpeed","restDelta"]);const it={done:!1,value:et};let{stiffness:st,damping:at,mass:ct,velocity:lt,duration:dt,isResolvedFromDuration:ht}=getSpringOptions(ot),pt=zero$1,mt=zero$1;function ft(){const yt=lt?-(lt/1e3):0,gt=tt-et,xt=at/(2*Math.sqrt(st*ct)),vt=Math.sqrt(st/ct)/1e3;if(rt===void 0&&(rt=Math.min(Math.abs(tt-et)/100,.4)),xt<1){const bt=calcAngularFreq(vt,xt);pt=Et=>{const wt=Math.exp(-xt*vt*Et);return tt-wt*((yt+xt*vt*gt)/bt*Math.sin(bt*Et)+gt*Math.cos(bt*Et))},mt=Et=>{const wt=Math.exp(-xt*vt*Et);return xt*vt*wt*(Math.sin(bt*Et)*(yt+xt*vt*gt)/bt+gt*Math.cos(bt*Et))-wt*(Math.cos(bt*Et)*(yt+xt*vt*gt)-bt*gt*Math.sin(bt*Et))}}else if(xt===1)pt=bt=>tt-Math.exp(-vt*bt)*(gt+(yt+vt*gt)*bt);else{const bt=vt*Math.sqrt(xt*xt-1);pt=Et=>{const wt=Math.exp(-xt*vt*Et),kt=Math.min(bt*Et,300);return tt-wt*((yt+xt*vt*gt)*Math.sinh(kt)+bt*gt*Math.cosh(kt))/bt}}}return ft(),{next:yt=>{const gt=pt(yt);if(ht)it.done=yt>=dt;else{const xt=mt(yt)*1e3,vt=Math.abs(xt)<=nt,bt=Math.abs(tt-gt)<=rt;it.done=vt&&bt}return it.value=it.done?tt:gt,it},flipTarget:()=>{lt=-lt,[et,tt]=[tt,et],ft()}}}spring.needsInterpolation=(o,et)=>typeof o=="string"||typeof et=="string";const zero$1=o=>0,progress=(o,et,tt)=>{const nt=et-o;return nt===0?1:(tt-o)/nt},mix=(o,et,tt)=>-tt*o+tt*et+o;function hueToRgb(o,et,tt){return tt<0&&(tt+=1),tt>1&&(tt-=1),tt<1/6?o+(et-o)*6*tt:tt<1/2?et:tt<2/3?o+(et-o)*(2/3-tt)*6:o}function hslaToRgba({hue:o,saturation:et,lightness:tt,alpha:nt}){o/=360,et/=100,tt/=100;let rt=0,ot=0,it=0;if(!et)rt=ot=it=tt;else{const st=tt<.5?tt*(1+et):tt+et-tt*et,at=2*tt-st;rt=hueToRgb(at,st,o+1/3),ot=hueToRgb(at,st,o),it=hueToRgb(at,st,o-1/3)}return{red:Math.round(rt*255),green:Math.round(ot*255),blue:Math.round(it*255),alpha:nt}}const mixLinearColor=(o,et,tt)=>{const nt=o*o,rt=et*et;return Math.sqrt(Math.max(0,tt*(rt-nt)+nt))},colorTypes=[hex,rgba,hsla],getColorType=o=>colorTypes.find(et=>et.test(o)),mixColor=(o,et)=>{let tt=getColorType(o),nt=getColorType(et),rt=tt.parse(o),ot=nt.parse(et);tt===hsla&&(rt=hslaToRgba(rt),tt=rgba),nt===hsla&&(ot=hslaToRgba(ot),nt=rgba);const it=Object.assign({},rt);return st=>{for(const at in it)at!=="alpha"&&(it[at]=mixLinearColor(rt[at],ot[at],st));return it.alpha=mix(rt.alpha,ot.alpha,st),tt.transform(it)}},isNum=o=>typeof o=="number",combineFunctions=(o,et)=>tt=>et(o(tt)),pipe$1=(...o)=>o.reduce(combineFunctions);function getMixer(o,et){return isNum(o)?tt=>mix(o,et,tt):color$1.test(o)?mixColor(o,et):mixComplex(o,et)}const mixArray=(o,et)=>{const tt=[...o],nt=tt.length,rt=o.map((ot,it)=>getMixer(ot,et[it]));return ot=>{for(let it=0;it{const tt=Object.assign(Object.assign({},o),et),nt={};for(const rt in tt)o[rt]!==void 0&&et[rt]!==void 0&&(nt[rt]=getMixer(o[rt],et[rt]));return rt=>{for(const ot in nt)tt[ot]=nt[ot](rt);return tt}};function analyse(o){const et=complex.parse(o),tt=et.length;let nt=0,rt=0,ot=0;for(let it=0;it{const tt=complex.createTransformer(et),nt=analyse(o),rt=analyse(et);return nt.numHSL===rt.numHSL&&nt.numRGB===rt.numRGB&&nt.numNumbers>=rt.numNumbers?pipe$1(mixArray(nt.parsed,rt.parsed),tt):it=>`${it>0?et:o}`},mixNumber=(o,et)=>tt=>mix(o,et,tt);function detectMixerFactory(o){if(typeof o=="number")return mixNumber;if(typeof o=="string")return color$1.test(o)?mixColor:mixComplex;if(Array.isArray(o))return mixArray;if(typeof o=="object")return mixObject}function createMixers(o,et,tt){const nt=[],rt=tt||detectMixerFactory(o[0]),ot=o.length-1;for(let it=0;ittt(progress(o,et,nt))}function slowInterpolate(o,et){const tt=o.length,nt=tt-1;return rt=>{let ot=0,it=!1;if(rt<=o[0]?it=!0:rt>=o[nt]&&(ot=nt-1,it=!0),!it){let at=1;for(;atrt||at===nt);at++);ot=at-1}const st=progress(o[ot],o[ot+1],rt);return et[ot](st)}}function interpolate(o,et,{clamp:tt=!0,ease:nt,mixer:rt}={}){const ot=o.length;invariant$1(ot===et.length),invariant$1(!nt||!Array.isArray(nt)||nt.length===ot-1),o[0]>o[ot-1]&&(o=[].concat(o),et=[].concat(et),o.reverse(),et.reverse());const it=createMixers(et,nt,rt),st=ot===2?fastInterpolate(o,it):slowInterpolate(o,it);return tt?at=>st(clamp$1(o[0],o[ot-1],at)):st}const reverseEasing=o=>et=>1-o(1-et),mirrorEasing=o=>et=>et<=.5?o(2*et)/2:(2-o(2*(1-et)))/2,createExpoIn=o=>et=>Math.pow(et,o),createBackIn=o=>et=>et*et*((o+1)*et-o),createAnticipate=o=>{const et=createBackIn(o);return tt=>(tt*=2)<1?.5*et(tt):.5*(2-Math.pow(2,-10*(tt-1)))},DEFAULT_OVERSHOOT_STRENGTH=1.525,BOUNCE_FIRST_THRESHOLD=4/11,BOUNCE_SECOND_THRESHOLD=8/11,BOUNCE_THIRD_THRESHOLD=9/10,linear=o=>o,easeIn=createExpoIn(2),easeOut=reverseEasing(easeIn),easeInOut=mirrorEasing(easeIn),circIn=o=>1-Math.sin(Math.acos(o)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backIn=createBackIn(DEFAULT_OVERSHOOT_STRENGTH),backOut=reverseEasing(backIn),backInOut=mirrorEasing(backIn),anticipate=createAnticipate(DEFAULT_OVERSHOOT_STRENGTH),ca=4356/361,cb=35442/1805,cc=16061/1805,bounceOut=o=>{if(o===1||o===0)return o;const et=o*o;return oo<.5?.5*(1-bounceOut(1-o*2)):.5*bounceOut(o*2-1)+.5;function defaultEasing(o,et){return o.map(()=>et||easeInOut).splice(0,o.length-1)}function defaultOffset(o){const et=o.length;return o.map((tt,nt)=>nt!==0?nt/(et-1):0)}function convertOffsetToTimes(o,et){return o.map(tt=>tt*et)}function keyframes$1({from:o=0,to:et=1,ease:tt,offset:nt,duration:rt=300}){const ot={done:!1,value:o},it=Array.isArray(et)?et:[o,et],st=convertOffsetToTimes(nt&&nt.length===it.length?nt:defaultOffset(it),rt);function at(){return interpolate(st,it,{ease:Array.isArray(tt)?tt:defaultEasing(it,tt)})}let ct=at();return{next:lt=>(ot.value=ct(lt),ot.done=lt>=rt,ot),flipTarget:()=>{it.reverse(),ct=at()}}}function decay({velocity:o=0,from:et=0,power:tt=.8,timeConstant:nt=350,restDelta:rt=.5,modifyTarget:ot}){const it={done:!1,value:et};let st=tt*o;const at=et+st,ct=ot===void 0?at:ot(at);return ct!==at&&(st=ct-et),{next:lt=>{const dt=-st*Math.exp(-lt/nt);return it.done=!(dt>rt||dt<-rt),it.value=it.done?ct:ct+dt,it},flipTarget:()=>{}}}const types$3={keyframes:keyframes$1,spring,decay};function detectAnimationFromOptions(o){if(Array.isArray(o.to))return keyframes$1;if(types$3[o.type])return types$3[o.type];const et=new Set(Object.keys(o));return et.has("ease")||et.has("duration")&&!et.has("dampingRatio")?keyframes$1:et.has("dampingRatio")||et.has("stiffness")||et.has("mass")||et.has("damping")||et.has("restSpeed")||et.has("restDelta")?spring:keyframes$1}const defaultTimestep=1/60*1e3,getCurrentTime=typeof performance<"u"?()=>performance.now():()=>Date.now(),onNextFrame=typeof window<"u"?o=>window.requestAnimationFrame(o):o=>setTimeout(()=>o(getCurrentTime()),defaultTimestep);function createRenderStep(o){let et=[],tt=[],nt=0,rt=!1,ot=!1;const it=new WeakSet,st={schedule:(at,ct=!1,lt=!1)=>{const dt=lt&&rt,ht=dt?et:tt;return ct&&it.add(at),ht.indexOf(at)===-1&&(ht.push(at),dt&&rt&&(nt=et.length)),at},cancel:at=>{const ct=tt.indexOf(at);ct!==-1&&tt.splice(ct,1),it.delete(at)},process:at=>{if(rt){ot=!0;return}if(rt=!0,[et,tt]=[tt,et],tt.length=0,nt=et.length,nt)for(let ct=0;ct(o[et]=createRenderStep(()=>runNextFrame=!0),o),{}),sync=stepsOrder.reduce((o,et)=>{const tt=steps[et];return o[et]=(nt,rt=!1,ot=!1)=>(runNextFrame||startLoop(),tt.schedule(nt,rt,ot)),o},{}),cancelSync=stepsOrder.reduce((o,et)=>(o[et]=steps[et].cancel,o),{}),flushSync=stepsOrder.reduce((o,et)=>(o[et]=()=>steps[et].process(frame),o),{}),processStep=o=>steps[o].process(frame),processFrame=o=>{runNextFrame=!1,frame.delta=useDefaultElapsed?defaultTimestep:Math.max(Math.min(o-frame.timestamp,maxElapsed),1),frame.timestamp=o,isProcessing=!0,stepsOrder.forEach(processStep),isProcessing=!1,runNextFrame&&(useDefaultElapsed=!1,onNextFrame(processFrame))},startLoop=()=>{runNextFrame=!0,useDefaultElapsed=!0,isProcessing||onNextFrame(processFrame)},getFrameData=()=>frame;function loopElapsed(o,et,tt=0){return o-et-tt}function reverseElapsed(o,et,tt=0,nt=!0){return nt?loopElapsed(et+-o,et,tt):et-(o-et)+tt}function hasRepeatDelayElapsed(o,et,tt,nt){return nt?o>=et+tt:o<=-tt}const framesync=o=>{const et=({delta:tt})=>o(tt);return{start:()=>sync.update(et,!0),stop:()=>cancelSync.update(et)}};function animate$1(o){var et,tt,{from:nt,autoplay:rt=!0,driver:ot=framesync,elapsed:it=0,repeat:st=0,repeatType:at="loop",repeatDelay:ct=0,onPlay:lt,onStop:dt,onComplete:ht,onRepeat:pt,onUpdate:mt}=o,ft=__rest(o,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:yt}=ft,gt,xt=0,vt=ft.duration,bt,Et=!1,wt=!0,kt;const Tt=detectAnimationFromOptions(ft);!((tt=(et=Tt).needsInterpolation)===null||tt===void 0)&&tt.call(et,nt,yt)&&(kt=interpolate([0,100],[nt,yt],{clamp:!1}),nt=0,yt=100);const Rt=Tt(Object.assign(Object.assign({},ft),{from:nt,to:yt}));function Pt(){xt++,at==="reverse"?(wt=xt%2===0,it=reverseElapsed(it,vt,ct,wt)):(it=loopElapsed(it,vt,ct),at==="mirror"&&Rt.flipTarget()),Et=!1,pt&&pt()}function $t(){gt.stop(),ht&&ht()}function Ot(zt){if(wt||(zt=-zt),it+=zt,!Et){const Ft=Rt.next(Math.max(0,it));bt=Ft.value,kt&&(bt=kt(bt)),Et=wt?Ft.done:it<=0}mt==null||mt(bt),Et&&(xt===0&&(vt??(vt=it)),xt{dt==null||dt(),gt.stop()}}}function velocityPerSecond(o,et){return et?o*(1e3/et):0}function inertia({from:o=0,velocity:et=0,min:tt,max:nt,power:rt=.8,timeConstant:ot=750,bounceStiffness:it=500,bounceDamping:st=10,restDelta:at=1,modifyTarget:ct,driver:lt,onUpdate:dt,onComplete:ht,onStop:pt}){let mt;function ft(vt){return tt!==void 0&&vtnt}function yt(vt){return tt===void 0?nt:nt===void 0||Math.abs(tt-vt){var Et;dt==null||dt(bt),(Et=vt.onUpdate)===null||Et===void 0||Et.call(vt,bt)},onComplete:ht,onStop:pt}))}function xt(vt){gt(Object.assign({type:"spring",stiffness:it,damping:st,restDelta:at},vt))}if(ft(o))xt({from:o,velocity:et,to:yt(o)});else{let vt=rt*et+o;typeof ct<"u"&&(vt=ct(vt));const bt=yt(vt),Et=bt===tt?-1:1;let wt,kt;const Tt=Rt=>{wt=kt,kt=Rt,et=velocityPerSecond(Rt-wt,getFrameData().delta),(Et===1&&Rt>bt||Et===-1&&Rtmt==null?void 0:mt.stop()}}const isPoint=o=>o.hasOwnProperty("x")&&o.hasOwnProperty("y"),isPoint3D=o=>isPoint(o)&&o.hasOwnProperty("z"),distance1D=(o,et)=>Math.abs(o-et);function distance(o,et){if(isNum(o)&&isNum(et))return distance1D(o,et);if(isPoint(o)&&isPoint(et)){const tt=distance1D(o.x,et.x),nt=distance1D(o.y,et.y),rt=isPoint3D(o)&&isPoint3D(et)?distance1D(o.z,et.z):0;return Math.sqrt(Math.pow(tt,2)+Math.pow(nt,2)+Math.pow(rt,2))}}const a=(o,et)=>1-3*et+3*o,b$3=(o,et)=>3*et-6*o,c$2=o=>3*o,calcBezier=(o,et,tt)=>((a(et,tt)*o+b$3(et,tt))*o+c$2(et))*o,getSlope=(o,et,tt)=>3*a(et,tt)*o*o+2*b$3(et,tt)*o+c$2(et),subdivisionPrecision=1e-7,subdivisionMaxIterations=10;function binarySubdivide(o,et,tt,nt,rt){let ot,it,st=0;do it=et+(tt-et)/2,ot=calcBezier(it,nt,rt)-o,ot>0?tt=it:et=it;while(Math.abs(ot)>subdivisionPrecision&&++st=newtonMinSlope?newtonRaphsonIterate(it,dt,o,tt):ht===0?dt:binarySubdivide(it,st,st+kSampleStepSize,o,tt)}return it=>it===0||it===1?it:calcBezier(ot(it),et,nt)}function useTapGesture(o){var et=o.onTap,tt=o.onTapStart,nt=o.onTapCancel,rt=o.whileTap,ot=o.visualElement,it=et||tt||nt||rt,st=reactExports.useRef(!1),at=reactExports.useRef(null),ct={passive:!(tt||et||nt||mt)};function lt(){var ft;(ft=at.current)===null||ft===void 0||ft.call(at),at.current=null}function dt(){var ft;return lt(),st.current=!1,(ft=ot.animationState)===null||ft===void 0||ft.setActive(AnimationType.Tap,!1),!isDragActive()}function ht(ft,yt){dt()&&(isNodeOrChild(ot.getInstance(),ft.target)?et==null||et(ft,yt):nt==null||nt(ft,yt))}function pt(ft,yt){dt()&&(nt==null||nt(ft,yt))}function mt(ft,yt){var gt;lt(),!st.current&&(st.current=!0,at.current=pipe$1(addPointerEvent(window,"pointerup",ht,ct),addPointerEvent(window,"pointercancel",pt,ct)),(gt=ot.animationState)===null||gt===void 0||gt.setActive(AnimationType.Tap,!0),tt==null||tt(ft,yt))}usePointerEvent(ot,"pointerdown",it?mt:void 0,ct),useUnmountEffect(lt)}var warned=new Set;function warnOnce$1(o,et,tt){warned.has(et)||(console.warn(et),warned.add(et))}var observerCallbacks=new WeakMap,observers$1=new WeakMap,fireObserverCallback=function(o){var et;(et=observerCallbacks.get(o.target))===null||et===void 0||et(o)},fireAllObserverCallbacks=function(o){o.forEach(fireObserverCallback)};function initIntersectionObserver(o){var et=o.root,tt=__rest(o,["root"]),nt=et||document;observers$1.has(nt)||observers$1.set(nt,{});var rt=observers$1.get(nt),ot=JSON.stringify(tt);return rt[ot]||(rt[ot]=new IntersectionObserver(fireAllObserverCallbacks,__assign({root:et},tt))),rt[ot]}function observeIntersection(o,et,tt){var nt=initIntersectionObserver(et);return observerCallbacks.set(o,tt),nt.observe(o),function(){observerCallbacks.delete(o),nt.unobserve(o)}}function useViewport(o){var et=o.visualElement,tt=o.whileInView,nt=o.onViewportEnter,rt=o.onViewportLeave,ot=o.viewport,it=ot===void 0?{}:ot,st=reactExports.useRef({hasEnteredView:!1,isInView:!1}),at=!!(tt||nt||rt);it.once&&st.current.hasEnteredView&&(at=!1);var ct=typeof IntersectionObserver>"u"?useMissingIntersectionObserver:useIntersectionObserver;ct(at,st.current,et,it)}var thresholdNames={some:0,all:1};function useIntersectionObserver(o,et,tt,nt){var rt=nt.root,ot=nt.margin,it=nt.amount,st=it===void 0?"some":it,at=nt.once;reactExports.useEffect(function(){if(o){var ct={root:rt==null?void 0:rt.current,rootMargin:ot,threshold:typeof st=="number"?st:thresholdNames[st]},lt=function(dt){var ht,pt=dt.isIntersecting;if(et.isInView!==pt&&(et.isInView=pt,!(at&&!pt&&et.hasEnteredView))){pt&&(et.hasEnteredView=!0),(ht=tt.animationState)===null||ht===void 0||ht.setActive(AnimationType.InView,pt);var mt=tt.getProps(),ft=pt?mt.onViewportEnter:mt.onViewportLeave;ft==null||ft(dt)}};return observeIntersection(tt.getInstance(),ct,lt)}},[o,rt,ot,st])}function useMissingIntersectionObserver(o,et,tt,nt){var rt=nt.fallback,ot=rt===void 0?!0:rt;reactExports.useEffect(function(){!o||!ot||(env$1!=="production"&&warnOnce$1(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(function(){var it;et.hasEnteredView=!0;var st=tt.getProps().onViewportEnter;st==null||st(null),(it=tt.animationState)===null||it===void 0||it.setActive(AnimationType.InView,!0)}))},[o])}var makeRenderlessComponent=function(o){return function(et){return o(et),null}},gestureAnimations={inView:makeRenderlessComponent(useViewport),tap:makeRenderlessComponent(useTapGesture),focus:makeRenderlessComponent(useFocusGesture),hover:makeRenderlessComponent(useHoverGesture)},counter=0,incrementId=function(){return counter++},useId$1=function(){return useConstant(incrementId)};function usePresence$1(){var o=reactExports.useContext(PresenceContext);if(o===null)return[!0,null];var et=o.isPresent,tt=o.onExitComplete,nt=o.register,rt=useId$1();reactExports.useEffect(function(){return nt(rt)},[]);var ot=function(){return tt==null?void 0:tt(rt)};return!et&&tt?[!1,ot]:[!0]}function shallowCompare(o,et){if(!Array.isArray(et))return!1;var tt=et.length;if(tt!==o.length)return!1;for(var nt=0;nt-1&&o.splice(tt,1)}var SubscriptionManager$1=function(){function o(){this.subscriptions=[]}return o.prototype.add=function(et){var tt=this;return addUniqueItem(this.subscriptions,et),function(){return removeItem(tt.subscriptions,et)}},o.prototype.notify=function(et,tt,nt){var rt=this.subscriptions.length;if(rt)if(rt===1)this.subscriptions[0](et,tt,nt);else for(var ot=0;otxt&&$t,Yt=Array.isArray(Pt)?Pt:[Pt],Ht=Yt.reduce(ot,{});Ot===!1&&(Ht={});var Ut=Rt.prevResolvedValues,qt=Ut===void 0?{}:Ut,Lt=__assign(__assign({},qt),Ht),Zt=function(nn){Ft=!0,yt.delete(nn),Rt.needsAnimating[nn]=!0};for(var Qt in Lt){var Nt=Ht[Qt],Gt=qt[Qt];gt.hasOwnProperty(Qt)||(Nt!==Gt?isKeyframesTarget(Nt)&&isKeyframesTarget(Gt)?!shallowCompare(Nt,Gt)||zt?Zt(Qt):Rt.protectedKeys[Qt]=!0:Nt!==void 0?Zt(Qt):yt.add(Qt):Nt!==void 0&&yt.has(Qt)?Zt(Qt):Rt.protectedKeys[Qt]=!0)}Rt.prevProp=Pt,Rt.prevResolvedValues=Ht,Rt.isActive&&(gt=__assign(__assign({},gt),Ht)),rt&&o.blockInitialAnimation&&(Ft=!1),Ft&&!Bt&&ft.push.apply(ft,__spreadArray([],__read(Yt.map(function(nn){return{animation:nn,options:__assign({type:Tt},lt)}})),!1))},bt=0;bt=3;if(!(!pt&&!mt)){var ft=ht.point,yt=getFrameData().timestamp;rt.history.push(__assign(__assign({},ft),{timestamp:yt}));var gt=rt.handlers,xt=gt.onStart,vt=gt.onMove;pt||(xt&&xt(rt.lastMoveEvent,ht),rt.startEvent=rt.lastMoveEvent),vt&&vt(rt.lastMoveEvent,ht)}}},this.handlePointerMove=function(ht,pt){if(rt.lastMoveEvent=ht,rt.lastMoveEventInfo=transformPoint(pt,rt.transformPagePoint),isMouseEvent(ht)&&ht.buttons===0){rt.handlePointerUp(ht,pt);return}sync.update(rt.updatePoint,!0)},this.handlePointerUp=function(ht,pt){rt.end();var mt=rt.handlers,ft=mt.onEnd,yt=mt.onSessionEnd,gt=getPanInfo(transformPoint(pt,rt.transformPagePoint),rt.history);rt.startEvent&&ft&&ft(ht,gt),yt&&yt(ht,gt)},!(isTouchEvent(et)&&et.touches.length>1)){this.handlers=tt,this.transformPagePoint=it;var st=extractEventInfo(et),at=transformPoint(st,this.transformPagePoint),ct=at.point,lt=getFrameData().timestamp;this.history=[__assign(__assign({},ct),{timestamp:lt})];var dt=tt.onSessionStart;dt&&dt(et,getPanInfo(at,this.history)),this.removeListeners=pipe$1(addPointerEvent(window,"pointermove",this.handlePointerMove),addPointerEvent(window,"pointerup",this.handlePointerUp),addPointerEvent(window,"pointercancel",this.handlePointerUp))}}return o.prototype.updateHandlers=function(et){this.handlers=et},o.prototype.end=function(){this.removeListeners&&this.removeListeners(),cancelSync.update(this.updatePoint)},o}();function transformPoint(o,et){return et?{point:et(o.point)}:o}function subtractPoint(o,et){return{x:o.x-et.x,y:o.y-et.y}}function getPanInfo(o,et){var tt=o.point;return{point:tt,delta:subtractPoint(tt,lastDevicePoint(et)),offset:subtractPoint(tt,startDevicePoint(et)),velocity:getVelocity(et,.1)}}function startDevicePoint(o){return o[0]}function lastDevicePoint(o){return o[o.length-1]}function getVelocity(o,et){if(o.length<2)return{x:0,y:0};for(var tt=o.length-1,nt=null,rt=lastDevicePoint(o);tt>=0&&(nt=o[tt],!(rt.timestamp-nt.timestamp>secondsToMilliseconds(et)));)tt--;if(!nt)return{x:0,y:0};var ot=(rt.timestamp-nt.timestamp)/1e3;if(ot===0)return{x:0,y:0};var it={x:(rt.x-nt.x)/ot,y:(rt.y-nt.y)/ot};return it.x===1/0&&(it.x=0),it.y===1/0&&(it.y=0),it}function calcLength(o){return o.max-o.min}function isNear(o,et,tt){return et===void 0&&(et=0),tt===void 0&&(tt=.01),distance(o,et)rt&&(o=tt?mix(rt,o,tt.max):Math.min(o,rt)),o}function calcRelativeAxisConstraints(o,et,tt){return{min:et!==void 0?o.min+et:void 0,max:tt!==void 0?o.max+tt-(o.max-o.min):void 0}}function calcRelativeConstraints(o,et){var tt=et.top,nt=et.left,rt=et.bottom,ot=et.right;return{x:calcRelativeAxisConstraints(o.x,nt,ot),y:calcRelativeAxisConstraints(o.y,tt,rt)}}function calcViewportAxisConstraints(o,et){var tt,nt=et.min-o.min,rt=et.max-o.max;return et.max-et.minnt?tt=progress(et.min,et.max-nt,o.min):nt>rt&&(tt=progress(o.min,o.max-rt,et.min)),clamp$1(0,1,tt)}function rebaseAxisConstraints(o,et){var tt={};return et.min!==void 0&&(tt.min=et.min-o.min),et.max!==void 0&&(tt.max=et.max-o.min),tt}var defaultElastic=.35;function resolveDragElastic(o){return o===void 0&&(o=defaultElastic),o===!1?o=0:o===!0&&(o=defaultElastic),{x:resolveAxisElastic(o,"left","right"),y:resolveAxisElastic(o,"top","bottom")}}function resolveAxisElastic(o,et,tt){return{min:resolvePointElastic(o,et),max:resolvePointElastic(o,tt)}}function resolvePointElastic(o,et){var tt;return typeof o=="number"?o:(tt=o[et])!==null&&tt!==void 0?tt:0}var createAxisDelta=function(){return{translate:0,scale:1,origin:0,originPoint:0}},createDelta=function(){return{x:createAxisDelta(),y:createAxisDelta()}},createAxis=function(){return{min:0,max:0}},createBox=function(){return{x:createAxis(),y:createAxis()}};function eachAxis(o){return[o("x"),o("y")]}function convertBoundingBoxToBox(o){var et=o.top,tt=o.left,nt=o.right,rt=o.bottom;return{x:{min:tt,max:nt},y:{min:et,max:rt}}}function convertBoxToBoundingBox(o){var et=o.x,tt=o.y;return{top:tt.min,right:et.max,bottom:tt.max,left:et.min}}function transformBoxPoints(o,et){if(!et)return o;var tt=et({x:o.left,y:o.top}),nt=et({x:o.right,y:o.bottom});return{top:tt.y,left:tt.x,bottom:nt.y,right:nt.x}}function isIdentityScale(o){return o===void 0||o===1}function hasScale(o){var et=o.scale,tt=o.scaleX,nt=o.scaleY;return!isIdentityScale(et)||!isIdentityScale(tt)||!isIdentityScale(nt)}function hasTransform(o){return hasScale(o)||hasTranslate(o.x)||hasTranslate(o.y)||o.z||o.rotate||o.rotateX||o.rotateY}function hasTranslate(o){return o&&o!=="0%"}function scalePoint(o,et,tt){var nt=o-tt,rt=et*nt;return tt+rt}function applyPointDelta(o,et,tt,nt,rt){return rt!==void 0&&(o=scalePoint(o,rt,nt)),scalePoint(o,tt,nt)+et}function applyAxisDelta(o,et,tt,nt,rt){et===void 0&&(et=0),tt===void 0&&(tt=1),o.min=applyPointDelta(o.min,et,tt,nt,rt),o.max=applyPointDelta(o.max,et,tt,nt,rt)}function applyBoxDelta(o,et){var tt=et.x,nt=et.y;applyAxisDelta(o.x,tt.translate,tt.scale,tt.originPoint),applyAxisDelta(o.y,nt.translate,nt.scale,nt.originPoint)}function applyTreeDeltas(o,et,tt,nt){var rt,ot;nt===void 0&&(nt=!1);var it=tt.length;if(it){et.x=et.y=1;for(var st,at,ct=0;ctet?tt="y":Math.abs(o.x)>et&&(tt="x"),tt}function useDrag(o){var et=o.dragControls,tt=o.visualElement,nt=useConstant(function(){return new VisualElementDragControls(tt)});reactExports.useEffect(function(){return et&&et.subscribe(nt)},[nt,et]),reactExports.useEffect(function(){return nt.addListeners()},[nt])}function usePanGesture(o){var et=o.onPan,tt=o.onPanStart,nt=o.onPanEnd,rt=o.onPanSessionStart,ot=o.visualElement,it=et||tt||nt||rt,st=reactExports.useRef(null),at=reactExports.useContext(MotionConfigContext).transformPagePoint,ct={onSessionStart:rt,onStart:tt,onMove:et,onEnd:function(dt,ht){st.current=null,nt&&nt(dt,ht)}};reactExports.useEffect(function(){st.current!==null&&st.current.updateHandlers(ct)});function lt(dt){st.current=new PanSession(dt,ct,{transformPagePoint:at})}usePointerEvent(ot,"pointerdown",it&<),useUnmountEffect(function(){return st.current&&st.current.end()})}var drag={pan:makeRenderlessComponent(usePanGesture),drag:makeRenderlessComponent(useDrag)},names$1=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function createLifecycles(){var o=names$1.map(function(){return new SubscriptionManager$1}),et={},tt={clearAllListeners:function(){return o.forEach(function(nt){return nt.clear()})},updatePropListeners:function(nt){names$1.forEach(function(rt){var ot,it="on"+rt,st=nt[it];(ot=et[rt])===null||ot===void 0||ot.call(et),st&&(et[rt]=tt[it](st))})}};return o.forEach(function(nt,rt){tt["on"+names$1[rt]]=function(ot){return nt.add(ot)},tt["notify"+names$1[rt]]=function(){for(var ot=[],it=0;it=0?window.pageYOffset:null,ct=convertChangedValueTypes(et,o,st);return ot.length&&ot.forEach(function(lt){var dt=__read(lt,2),ht=dt[0],pt=dt[1];o.getValue(ht).set(pt)}),o.syncRender(),at!==null&&window.scrollTo({top:at}),{target:ct,transitionEnd:nt}}else return{target:et,transitionEnd:nt}};function unitConversion(o,et,tt,nt){return hasPositionalKey(et)?checkAndConvertChangedValueTypes(o,et,tt,nt):{target:et,transitionEnd:nt}}var parseDomVariant=function(o,et,tt,nt){var rt=resolveCSSVariables(o,et,nt);return et=rt.target,nt=rt.transitionEnd,unitConversion(o,et,tt,nt)};function getComputedStyle$1(o){return window.getComputedStyle(o)}var htmlConfig={treeType:"dom",readValueFromInstance:function(o,et){if(isTransformProp(et)){var tt=getDefaultValueType(et);return tt&&tt.default||0}else{var nt=getComputedStyle$1(o);return(isCSSVariable$1(et)?nt.getPropertyValue(et):nt[et])||0}},sortNodePosition:function(o,et){return o.compareDocumentPosition(et)&2?1:-1},getBaseTarget:function(o,et){var tt;return(tt=o.style)===null||tt===void 0?void 0:tt[et]},measureViewportBox:function(o,et){var tt=et.transformPagePoint;return measureViewportBox(o,tt)},resetTransform:function(o,et,tt){var nt=tt.transformTemplate;et.style.transform=nt?nt({},""):"none",o.scheduleRender()},restoreTransform:function(o,et){o.style.transform=et.style.transform},removeValueFromRenderState:function(o,et){var tt=et.vars,nt=et.style;delete tt[o],delete nt[o]},makeTargetAnimatable:function(o,et,tt,nt){var rt=tt.transformValues;nt===void 0&&(nt=!0);var ot=et.transition,it=et.transitionEnd,st=__rest(et,["transition","transitionEnd"]),at=getOrigin(st,ot||{},o);if(rt&&(it&&(it=rt(it)),st&&(st=rt(st)),at&&(at=rt(at))),nt){checkTargetForNewValues(o,st,at);var ct=parseDomVariant(o,st,at,it);it=ct.transitionEnd,st=ct.target}return __assign({transition:ot,transitionEnd:it},st)},scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,build:function(o,et,tt,nt,rt){o.isVisible!==void 0&&(et.style.visibility=o.isVisible?"visible":"hidden"),buildHTMLStyles(et,tt,nt,rt.transformTemplate)},render:renderHTML},htmlVisualElement=visualElement(htmlConfig),svgVisualElement=visualElement(__assign(__assign({},htmlConfig),{getBaseTarget:function(o,et){return o[et]},readValueFromInstance:function(o,et){var tt;return isTransformProp(et)?((tt=getDefaultValueType(et))===null||tt===void 0?void 0:tt.default)||0:(et=camelCaseAttributes.has(et)?et:camelToDash(et),o.getAttribute(et))},scrapeMotionValuesFromProps,build:function(o,et,tt,nt,rt){buildSVGAttrs(et,tt,nt,rt.transformTemplate)},render:renderSVG})),createDomVisualElement=function(o,et){return isSVGComponent(o)?svgVisualElement(et,{enableHardwareAcceleration:!1}):htmlVisualElement(et,{enableHardwareAcceleration:!0})};function pixelsToPercent(o,et){return et.max===et.min?0:o/(et.max-et.min)*100}var correctBorderRadius={correct:function(o,et){if(!et.target)return o;if(typeof o=="string")if(px.test(o))o=parseFloat(o);else return o;var tt=pixelsToPercent(o,et.target.x),nt=pixelsToPercent(o,et.target.y);return"".concat(tt,"% ").concat(nt,"%")}},varToken="_$css",correctBoxShadow={correct:function(o,et){var tt=et.treeScale,nt=et.projectionDelta,rt=o,ot=o.includes("var("),it=[];ot&&(o=o.replace(cssVariableRegex,function(ft){return it.push(ft),varToken}));var st=complex.parse(o);if(st.length>5)return rt;var at=complex.createTransformer(o),ct=typeof st[0]!="number"?1:0,lt=nt.x.scale*tt.x,dt=nt.y.scale*tt.y;st[0+ct]/=lt,st[1+ct]/=dt;var ht=mix(lt,dt,.5);typeof st[2+ct]=="number"&&(st[2+ct]/=ht),typeof st[3+ct]=="number"&&(st[3+ct]/=ht);var pt=at(st);if(ot){var mt=0;pt=pt.replace(varToken,function(){var ft=it[mt];return mt++,ft})}return pt}},MeasureLayoutWithContext=function(o){__extends(et,o);function et(){return o!==null&&o.apply(this,arguments)||this}return et.prototype.componentDidMount=function(){var tt=this,nt=this.props,rt=nt.visualElement,ot=nt.layoutGroup,it=nt.switchLayoutGroup,st=nt.layoutId,at=rt.projection;addScaleCorrector(defaultScaleCorrectors),at&&(ot!=null&&ot.group&&ot.group.add(at),it!=null&&it.register&&st&&it.register(at),at.root.didUpdate(),at.addEventListener("animationComplete",function(){tt.safeToRemove()}),at.setOptions(__assign(__assign({},at.options),{onExitComplete:function(){return tt.safeToRemove()}}))),globalProjectionState.hasEverUpdated=!0},et.prototype.getSnapshotBeforeUpdate=function(tt){var nt=this,rt=this.props,ot=rt.layoutDependency,it=rt.visualElement,st=rt.drag,at=rt.isPresent,ct=it.projection;return ct&&(ct.isPresent=at,st||tt.layoutDependency!==ot||ot===void 0?ct.willUpdate():this.safeToRemove(),tt.isPresent!==at&&(at?ct.promote():ct.relegate()||sync.postRender(function(){var lt;!((lt=ct.getStack())===null||lt===void 0)&<.members.length||nt.safeToRemove()}))),null},et.prototype.componentDidUpdate=function(){var tt=this.props.visualElement.projection;tt&&(tt.root.didUpdate(),!tt.currentAnimation&&tt.isLead()&&this.safeToRemove())},et.prototype.componentWillUnmount=function(){var tt=this.props,nt=tt.visualElement,rt=tt.layoutGroup,ot=tt.switchLayoutGroup,it=nt.projection;it&&(it.scheduleCheckAfterUnmount(),rt!=null&&rt.group&&rt.group.remove(it),ot!=null&&ot.deregister&&ot.deregister(it))},et.prototype.safeToRemove=function(){var tt=this.props.safeToRemove;tt==null||tt()},et.prototype.render=function(){return null},et}(React.Component);function MeasureLayout(o){var et=__read(usePresence$1(),2),tt=et[0],nt=et[1],rt=reactExports.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,__assign({},o,{layoutGroup:rt,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:tt,safeToRemove:nt}))}var defaultScaleCorrectors={borderRadius:__assign(__assign({},correctBorderRadius),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},layoutFeatures={measureLayout:MeasureLayout};function animate(o,et,tt){tt===void 0&&(tt={});var nt=isMotionValue(o)?o:motionValue(o);return startAnimation("",nt,et,tt),{stop:function(){return nt.stop()},isAnimating:function(){return nt.isAnimating()}}}var borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=function(o){return typeof o=="string"?parseFloat(o):o},isPx=function(o){return typeof o=="number"||px.test(o)};function mixValues(o,et,tt,nt,rt,ot){var it,st,at,ct;rt?(o.opacity=mix(0,(it=tt.opacity)!==null&&it!==void 0?it:1,easeCrossfadeIn(nt)),o.opacityExit=mix((st=et.opacity)!==null&&st!==void 0?st:1,0,easeCrossfadeOut(nt))):ot&&(o.opacity=mix((at=et.opacity)!==null&&at!==void 0?at:1,(ct=tt.opacity)!==null&&ct!==void 0?ct:1,nt));for(var lt=0;ltet?1:tt(progress(o,et,nt))}}function copyAxisInto(o,et){o.min=et.min,o.max=et.max}function copyBoxInto(o,et){copyAxisInto(o.x,et.x),copyAxisInto(o.y,et.y)}function removePointDelta(o,et,tt,nt,rt){return o-=et,o=scalePoint(o,1/tt,nt),rt!==void 0&&(o=scalePoint(o,1/rt,nt)),o}function removeAxisDelta(o,et,tt,nt,rt,ot,it){if(et===void 0&&(et=0),tt===void 0&&(tt=1),nt===void 0&&(nt=.5),ot===void 0&&(ot=o),it===void 0&&(it=o),percent.test(et)){et=parseFloat(et);var st=mix(it.min,it.max,et/100);et=st-it.min}if(typeof et=="number"){var at=mix(ot.min,ot.max,nt);o===ot&&(at-=et),o.min=removePointDelta(o.min,et,tt,at,rt),o.max=removePointDelta(o.max,et,tt,at,rt)}}function removeAxisTransforms(o,et,tt,nt,rt){var ot=__read(tt,3),it=ot[0],st=ot[1],at=ot[2];removeAxisDelta(o,et[it],et[st],et[at],et.scale,nt,rt)}var xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(o,et,tt,nt){removeAxisTransforms(o.x,et,xKeys,tt==null?void 0:tt.x,nt==null?void 0:nt.x),removeAxisTransforms(o.y,et,yKeys,tt==null?void 0:tt.y,nt==null?void 0:nt.y)}function isAxisDeltaZero(o){return o.translate===0&&o.scale===1}function isDeltaZero(o){return isAxisDeltaZero(o.x)&&isAxisDeltaZero(o.y)}function boxEquals(o,et){return o.x.min===et.x.min&&o.x.max===et.x.max&&o.y.min===et.y.min&&o.y.max===et.y.max}var NodeStack=function(){function o(){this.members=[]}return o.prototype.add=function(et){addUniqueItem(this.members,et),et.scheduleRender()},o.prototype.remove=function(et){if(removeItem(this.members,et),et===this.prevLead&&(this.prevLead=void 0),et===this.lead){var tt=this.members[this.members.length-1];tt&&this.promote(tt)}},o.prototype.relegate=function(et){var tt=this.members.findIndex(function(it){return et===it});if(tt===0)return!1;for(var nt,rt=tt;rt>=0;rt--){var ot=this.members[rt];if(ot.isPresent!==!1){nt=ot;break}}return nt?(this.promote(nt),!0):!1},o.prototype.promote=function(et,tt){var nt,rt=this.lead;if(et!==rt&&(this.prevLead=rt,this.lead=et,et.show(),rt)){rt.instance&&rt.scheduleRender(),et.scheduleRender(),et.resumeFrom=rt,tt&&(et.resumeFrom.preserveOpacity=!0),rt.snapshot&&(et.snapshot=rt.snapshot,et.snapshot.latestValues=rt.animationValues||rt.latestValues,et.snapshot.isShared=!0),!((nt=et.root)===null||nt===void 0)&&nt.isUpdating&&(et.isLayoutDirty=!0);var ot=et.options.crossfade;ot===!1&&rt.hide()}},o.prototype.exitAnimationComplete=function(){this.members.forEach(function(et){var tt,nt,rt,ot,it;(nt=(tt=et.options).onExitComplete)===null||nt===void 0||nt.call(tt),(it=(rt=et.resumingFrom)===null||rt===void 0?void 0:(ot=rt.options).onExitComplete)===null||it===void 0||it.call(ot)})},o.prototype.scheduleRender=function(){this.members.forEach(function(et){et.instance&&et.scheduleRender(!1)})},o.prototype.removeLeadSnapshot=function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)},o}(),identityProjection="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function buildProjectionTransform(o,et,tt){var nt=o.x.translate/et.x,rt=o.y.translate/et.y,ot="translate3d(".concat(nt,"px, ").concat(rt,"px, 0) ");if(ot+="scale(".concat(1/et.x,", ").concat(1/et.y,") "),tt){var it=tt.rotate,st=tt.rotateX,at=tt.rotateY;it&&(ot+="rotate(".concat(it,"deg) ")),st&&(ot+="rotateX(".concat(st,"deg) ")),at&&(ot+="rotateY(".concat(at,"deg) "))}var ct=o.x.scale*et.x,lt=o.y.scale*et.y;return ot+="scale(".concat(ct,", ").concat(lt,")"),ot===identityProjection?"none":ot}var compareByDepth=function(o,et){return o.depth-et.depth},FlatTree=function(){function o(){this.children=[],this.isDirty=!1}return o.prototype.add=function(et){addUniqueItem(this.children,et),this.isDirty=!0},o.prototype.remove=function(et){removeItem(this.children,et),this.isDirty=!0},o.prototype.forEach=function(et){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(et)},o}(),animationTarget=1e3;function createProjectionNode(o){var et=o.attachResizeListener,tt=o.defaultParent,nt=o.measureScroll,rt=o.checkIsScrollRoot,ot=o.resetTransform;return function(){function it(st,at,ct){var lt=this;at===void 0&&(at={}),ct===void 0&&(ct=tt==null?void 0:tt()),this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=function(){lt.isUpdating&&(lt.isUpdating=!1,lt.clearAllSnapshots())},this.updateProjection=function(){lt.nodes.forEach(resolveTargetDelta),lt.nodes.forEach(calcProjection)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=st,this.latestValues=at,this.root=ct?ct.root||ct:this,this.path=ct?__spreadArray(__spreadArray([],__read(ct.path),!1),[ct],!1):[],this.parent=ct,this.depth=ct?ct.depth+1:0,st&&this.root.registerPotentialNode(st,this);for(var dt=0;dt=0;nt--)if(o.path[nt].instance){tt=o.path[nt];break}var rt=tt&&tt!==o.root?tt.instance:document,ot=rt.querySelector('[data-projection-id="'.concat(et,'"]'));ot&&o.mount(ot,!0)}function roundAxis(o){o.min=Math.round(o.min),o.max=Math.round(o.max)}function roundBox(o){roundAxis(o.x),roundAxis(o.y)}var DocumentProjectionNode=createProjectionNode({attachResizeListener:function(o,et){return addDomEvent(o,"resize",et)},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}},checkIsScrollRoot:function(){return!0}}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:function(o){return{x:o.scrollLeft,y:o.scrollTop}},defaultParent:function(){if(!rootProjectionNode.current){var o=new DocumentProjectionNode(0,{});o.mount(window),o.setOptions({layoutScroll:!0}),rootProjectionNode.current=o}return rootProjectionNode.current},resetTransform:function(o,et){o.style.transform=et??"none"},checkIsScrollRoot:function(o){return window.getComputedStyle(o).position==="fixed"}}),featureBundle=__assign(__assign(__assign(__assign({},animations),gestureAnimations),drag),layoutFeatures),motion=createMotionProxy(function(o,et){return createDomMotionConfig(o,et,featureBundle,createDomVisualElement,HTMLProjectionNode)});function useIsMounted$1(){var o=reactExports.useRef(!1);return useIsomorphicLayoutEffect$3(function(){return o.current=!0,function(){o.current=!1}},[]),o}function useForceUpdate(){var o=useIsMounted$1(),et=__read(reactExports.useState(0),2),tt=et[0],nt=et[1],rt=reactExports.useCallback(function(){o.current&&nt(tt+1)},[tt]),ot=reactExports.useCallback(function(){return sync.postRender(rt)},[rt]);return[ot,tt]}var PresenceChild=function(o){var et=o.children,tt=o.initial,nt=o.isPresent,rt=o.onExitComplete,ot=o.custom,it=o.presenceAffectsLayout,st=useConstant(newChildrenMap),at=useId$1(),ct=reactExports.useMemo(function(){return{id:at,initial:tt,isPresent:nt,custom:ot,onExitComplete:function(lt){var dt,ht;st.set(lt,!0);try{for(var pt=__values(st.values()),mt=pt.next();!mt.done;mt=pt.next()){var ft=mt.value;if(!ft)return}}catch(yt){dt={error:yt}}finally{try{mt&&!mt.done&&(ht=pt.return)&&ht.call(pt)}finally{if(dt)throw dt.error}}rt==null||rt()},register:function(lt){return st.set(lt,!1),function(){return st.delete(lt)}}}},it?void 0:[nt]);return reactExports.useMemo(function(){st.forEach(function(lt,dt){return st.set(dt,!1)})},[nt]),reactExports.useEffect(function(){!nt&&!st.size&&(rt==null||rt())},[nt]),reactExports.createElement(PresenceContext.Provider,{value:ct},et)};function newChildrenMap(){return new Map}var getChildKey=function(o){return o.key||""};function updateChildLookup(o,et){o.forEach(function(tt){var nt=getChildKey(tt);et.set(nt,tt)})}function onlyElements(o){var et=[];return reactExports.Children.forEach(o,function(tt){reactExports.isValidElement(tt)&&et.push(tt)}),et}var AnimatePresence=function(o){var et=o.children,tt=o.custom,nt=o.initial,rt=nt===void 0?!0:nt,ot=o.onExitComplete,it=o.exitBeforeEnter,st=o.presenceAffectsLayout,at=st===void 0?!0:st,ct=__read(useForceUpdate(),1),lt=ct[0],dt=reactExports.useContext(LayoutGroupContext).forceRender;dt&&(lt=dt);var ht=useIsMounted$1(),pt=onlyElements(et),mt=pt,ft=new Set,yt=reactExports.useRef(mt),gt=reactExports.useRef(new Map).current,xt=reactExports.useRef(!0);if(useIsomorphicLayoutEffect$3(function(){xt.current=!1,updateChildLookup(pt,gt),yt.current=mt}),useUnmountEffect(function(){xt.current=!0,gt.clear(),ft.clear()}),xt.current)return reactExports.createElement(reactExports.Fragment,null,mt.map(function(Tt){return reactExports.createElement(PresenceChild,{key:getChildKey(Tt),isPresent:!0,initial:rt?void 0:!1,presenceAffectsLayout:at},Tt)}));mt=__spreadArray([],__read(mt),!1);for(var vt=yt.current.map(getChildKey),bt=pt.map(getChildKey),Et=vt.length,wt=0;wt1&&console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour."),reactExports.createElement(reactExports.Fragment,null,ft.size?mt:mt.map(function(Tt){return reactExports.cloneElement(Tt)}))};function MotionConfig(o){var et=o.children,tt=o.isValidProp,nt=__rest(o,["children","isValidProp"]);tt&&loadExternalIsValidProp(tt),nt=__assign(__assign({},reactExports.useContext(MotionConfigContext)),nt),nt.isStatic=useConstant(function(){return nt.isStatic});var rt=reactExports.useMemo(function(){return nt},[JSON.stringify(nt.transition),nt.transformPagePoint,nt.reducedMotion]);return reactExports.createElement(MotionConfigContext.Provider,{value:rt},et)}var reactIs$2={exports:{}},reactIs_production_min$1={};/** + * @license React + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var b$2=Symbol.for("react.element"),c$1=Symbol.for("react.portal"),d$2=Symbol.for("react.fragment"),e$1=Symbol.for("react.strict_mode"),f$1=Symbol.for("react.profiler"),g$2=Symbol.for("react.provider"),h$2=Symbol.for("react.context"),k$2=Symbol.for("react.server_context"),l$1=Symbol.for("react.forward_ref"),m$3=Symbol.for("react.suspense"),n$1=Symbol.for("react.suspense_list"),p$1=Symbol.for("react.memo"),q$2=Symbol.for("react.lazy"),t$1=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");function v$2(o){if(typeof o=="object"&&o!==null){var et=o.$$typeof;switch(et){case b$2:switch(o=o.type,o){case d$2:case f$1:case e$1:case m$3:case n$1:return o;default:switch(o=o&&o.$$typeof,o){case k$2:case h$2:case l$1:case q$2:case p$1:case g$2:return o;default:return et}}case c$1:return et}}}reactIs_production_min$1.ContextConsumer=h$2;reactIs_production_min$1.ContextProvider=g$2;reactIs_production_min$1.Element=b$2;reactIs_production_min$1.ForwardRef=l$1;reactIs_production_min$1.Fragment=d$2;reactIs_production_min$1.Lazy=q$2;reactIs_production_min$1.Memo=p$1;reactIs_production_min$1.Portal=c$1;reactIs_production_min$1.Profiler=f$1;reactIs_production_min$1.StrictMode=e$1;reactIs_production_min$1.Suspense=m$3;reactIs_production_min$1.SuspenseList=n$1;reactIs_production_min$1.isAsyncMode=function(){return!1};reactIs_production_min$1.isConcurrentMode=function(){return!1};reactIs_production_min$1.isContextConsumer=function(o){return v$2(o)===h$2};reactIs_production_min$1.isContextProvider=function(o){return v$2(o)===g$2};reactIs_production_min$1.isElement=function(o){return typeof o=="object"&&o!==null&&o.$$typeof===b$2};reactIs_production_min$1.isForwardRef=function(o){return v$2(o)===l$1};reactIs_production_min$1.isFragment=function(o){return v$2(o)===d$2};reactIs_production_min$1.isLazy=function(o){return v$2(o)===q$2};reactIs_production_min$1.isMemo=function(o){return v$2(o)===p$1};reactIs_production_min$1.isPortal=function(o){return v$2(o)===c$1};reactIs_production_min$1.isProfiler=function(o){return v$2(o)===f$1};reactIs_production_min$1.isStrictMode=function(o){return v$2(o)===e$1};reactIs_production_min$1.isSuspense=function(o){return v$2(o)===m$3};reactIs_production_min$1.isSuspenseList=function(o){return v$2(o)===n$1};reactIs_production_min$1.isValidElementType=function(o){return typeof o=="string"||typeof o=="function"||o===d$2||o===f$1||o===e$1||o===m$3||o===n$1||o===t$1||typeof o=="object"&&o!==null&&(o.$$typeof===q$2||o.$$typeof===p$1||o.$$typeof===g$2||o.$$typeof===h$2||o.$$typeof===l$1||o.$$typeof===u||o.getModuleId!==void 0)};reactIs_production_min$1.typeOf=v$2;reactIs$2.exports=reactIs_production_min$1;var reactIsExports$1=reactIs$2.exports;function stylis_min(o){function et(Qt,Nt,Gt,nn,Wt){for(var hn=0,Xt=0,Jt=0,tn=0,_t,Dt,Vt=0,en=0,an,dn=an=_t=0,ln=0,pn=0,kn=0,mn=0,wn=Gt.length,In=wn-1,Pn,yn="",En="",on="",It="",St;ln_t)&&(mn=(yn=yn.replace(" ",":")).length),0nn&&(nn=(Nt=Nt.trim()).charCodeAt(0)),nn){case 38:return Nt.replace(gt,"$1"+Qt.trim());case 58:return Qt.trim()+Nt.replace(gt,"$1"+Qt.trim());default:if(0<1*Gt&&0Xt.charCodeAt(8))break;case 115:Wt=Wt.replace(Xt,"-webkit-"+Xt)+";"+Wt;break;case 207:case 102:Wt=Wt.replace(Xt,"-webkit-"+(102Gt.charCodeAt(0)&&(Gt=Gt.trim()),Zt=Gt,Gt=[Zt],01?et-1:0),nt=1;nt0?" Args: "+tt.join(", "):""))}var j=function(){function o(tt){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=tt}var et=o.prototype;return et.indexOfGroup=function(tt){for(var nt=0,rt=0;rt=this.groupSizes.length){for(var rt=this.groupSizes,ot=rt.length,it=ot;tt>=it;)(it<<=1)<0&&D(16,""+tt);this.groupSizes=new Uint32Array(it),this.groupSizes.set(rt),this.length=it;for(var st=ot;st=this.length||this.groupSizes[tt]===0)return nt;for(var rt=this.groupSizes[tt],ot=this.indexOfGroup(tt),it=ot+rt,st=ot;st=k&&(k=et+1),T.set(o,et),x.set(et,o)},M="style["+N+'][data-styled-version="5.3.11"]',G=new RegExp("^"+N+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),L=function(o,et,tt){for(var nt,rt=tt.split(","),ot=0,it=rt.length;ot=0;ct--){var lt=at[ct];if(lt&<.nodeType===1&<.hasAttribute(N))return lt}}(tt),ot=rt!==void 0?rt.nextSibling:null;nt.setAttribute(N,"active"),nt.setAttribute("data-styled-version","5.3.11");var it=Y();return it&&nt.setAttribute("nonce",it),tt.insertBefore(nt,ot),nt},H=function(){function o(tt){var nt=this.element=q(tt);nt.appendChild(document.createTextNode("")),this.sheet=function(rt){if(rt.sheet)return rt.sheet;for(var ot=document.styleSheets,it=0,st=ot.length;it=0){var rt=document.createTextNode(nt),ot=this.nodes[tt];return this.element.insertBefore(rt,ot||null),this.length++,!0}return!1},et.deleteRule=function(tt){this.element.removeChild(this.nodes[tt]),this.length--},et.getRule=function(tt){return tt0&&(dt+=ht+",")}),ot+=""+ct+lt+'{content:"'+dt+`"}/*!sc*/ +`}}}return ot}(this)},o}(),Z=/(a)(d)/gi,K=function(o){return String.fromCharCode(o+(o>25?39:97))};function Q(o){var et,tt="";for(et=Math.abs(o);et>52;et=et/52|0)tt=K(et%52)+tt;return(K(et%52)+tt).replace(Z,"$1-$2")}var ee=function(o,et){for(var tt=et.length;tt;)o=33*o^et.charCodeAt(--tt);return o},te=function(o){return ee(5381,o)};function ne(o){for(var et=0;et>>0);if(!tt.hasNameForId(rt,st)){var at=nt(it,"."+st,void 0,rt);tt.insertRules(rt,st,at)}ot.push(st),this.staticRulesId=st}else{for(var ct=this.rules.length,lt=ee(this.baseHash,nt.hash),dt="",ht=0;ht>>0);if(!tt.hasNameForId(rt,yt)){var gt=nt(dt,"."+yt,void 0,rt);tt.insertRules(rt,yt,gt)}ot.push(yt)}}return ot.join(" ")},o}(),se=/^\s*\/\/.*$/gm,ie=[":","[",".","#"];function ae(o){var et,tt,nt,rt,ot=w$1,it=ot.options,st=it===void 0?w$1:it,at=ot.plugins,ct=at===void 0?S:at,lt=new stylis_min(st),dt=[],ht=function(ft){function yt(gt){if(gt)try{ft(gt+"}")}catch{}}return function(gt,xt,vt,bt,Et,wt,kt,Tt,Rt,Pt){switch(gt){case 1:if(Rt===0&&xt.charCodeAt(0)===64)return ft(xt+";"),"";break;case 2:if(Tt===0)return xt+"/*|*/";break;case 3:switch(Tt){case 102:case 112:return ft(vt[0]+xt),"";default:return xt+(Pt===0?"/*|*/":"")}case-2:xt.split("/*|*/}").forEach(yt)}}}(function(ft){dt.push(ft)}),pt=function(ft,yt,gt){return yt===0&&ie.indexOf(gt[tt.length])!==-1||gt.match(rt)?ft:"."+et};function mt(ft,yt,gt,xt){xt===void 0&&(xt="&");var vt=ft.replace(se,""),bt=yt&>?gt+" "+yt+" { "+vt+" }":vt;return et=xt,tt=yt,nt=new RegExp("\\"+tt+"\\b","g"),rt=new RegExp("(\\"+tt+"\\b){2,}"),lt(gt||!yt?"":yt,bt)}return lt.use([].concat(ct,[function(ft,yt,gt){ft===2&>.length&>[0].lastIndexOf(tt)>0&&(gt[0]=gt[0].replace(nt,pt))},ht,function(ft){if(ft===-2){var yt=dt;return dt=[],yt}}])),mt.hash=ct.length?ct.reduce(function(ft,yt){return yt.name||D(15),ee(ft,yt.name)},5381).toString():"",mt}var ce=React.createContext();ce.Consumer;var le=React.createContext(),de=(le.Consumer,new X),he=ae();function pe(){return reactExports.useContext(ce)||de}function fe(){return reactExports.useContext(le)||he}var ye=function(){function o(et,tt){var nt=this;this.inject=function(rt,ot){ot===void 0&&(ot=he);var it=nt.name+ot.hash;rt.hasNameForId(nt.id,it)||rt.insertRules(nt.id,it,ot(nt.rules,it,"@keyframes"))},this.toString=function(){return D(12,String(nt.name))},this.name=et,this.id="sc-keyframes-"+et,this.rules=tt}return o.prototype.getName=function(et){return et===void 0&&(et=he),this.name+et.hash},o}(),ve=/([A-Z])/,ge=/([A-Z])/g,Se=/^ms-/,we=function(o){return"-"+o.toLowerCase()};function Ee(o){return ve.test(o)?o.replace(ge,we).replace(Se,"-ms-"):o}var be=function(o){return o==null||o===!1||o===""};function _e(o,et,tt,nt){if(Array.isArray(o)){for(var rt,ot=[],it=0,st=o.length;it1?et-1:0),nt=1;nt?@[\\\]^`{|}~-]+/g,De=/(^-|-$)/g;function je(o){return o.replace(Re,"-").replace(De,"")}var Te=function(o){return Q(te(o)>>>0)};function xe(o){return typeof o=="string"&&!0}var ke=function(o){return typeof o=="function"||typeof o=="object"&&o!==null&&!Array.isArray(o)},Ve=function(o){return o!=="__proto__"&&o!=="constructor"&&o!=="prototype"};function Be(o,et,tt){var nt=o[tt];ke(et)&&ke(nt)?ze(nt,et):o[tt]=et}function ze(o){for(var et=arguments.length,tt=new Array(et>1?et-1:0),nt=1;nt=0||(Pt[Tt]=wt[Tt]);return Pt}(et,["componentId"]),Et=vt&&vt+"-"+(xe(xt)?xt:je(b(xt)));return Ye(xt,y$1({},bt,{attrs:ht,componentId:Et}),tt)},Object.defineProperty(mt,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(xt){this._foldedDefaultProps=nt?ze({},o.defaultProps,xt):xt}}),Object.defineProperty(mt,"toString",{value:function(){return"."+mt.styledComponentId}}),rt&&m$1(mt,o,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),mt}var qe=function(o){return function et(tt,nt,rt){if(rt===void 0&&(rt=w$1),!reactIsExports$1.isValidElementType(nt))return D(1,String(nt));var ot=function(){return tt(nt,rt,Ae.apply(void 0,arguments))};return ot.withConfig=function(it){return et(tt,nt,y$1({},rt,{},it))},ot.attrs=function(it){return et(tt,nt,y$1({},rt,{attrs:Array.prototype.concat(rt.attrs,it).filter(Boolean)}))},ot}(Ye,o)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(o){qe[o]=qe(o)});function We(o){for(var et=arguments.length,tt=new Array(et>1?et-1:0),nt=1;nt>--at&1}const dt=31,ht=2**dt,pt=ht>>>1,mt=pt>>1,ft=ht-1;let yt=0;for(let Et=0;Et1;){let Pt=wt+kt>>>1;Et>>1|lt(),Tt=Tt<<1^pt,Rt=(Rt^pt)<<1|pt|1;xt=Tt,vt=1+Rt-Tt}let bt=nt-4;return gt.map(Et=>{switch(Et-bt){case 3:return bt+65792+(o[st++]<<16|o[st++]<<8|o[st++]);case 2:return bt+256+(o[st++]<<8|o[st++]);case 1:return bt+o[st++];default:return Et-1}})}function read_payload(o){let et=0;return()=>o[et++]}function read_compressed_payload(o){return read_payload(decode_arithmetic(unsafe_atob(o)))}function unsafe_atob(o){let et=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((rt,ot)=>et[rt.charCodeAt(0)]=ot);let tt=o.length,nt=new Uint8Array(6*tt>>3);for(let rt=0,ot=0,it=0,st=0;rt=8&&(nt[ot++]=st>>(it-=8));return nt}function signed(o){return o&1?~o>>1:o>>1}function read_deltas(o,et){let tt=Array(o);for(let nt=0,rt=0;nt{let et=read_sorted(o);if(et.length)return et})}function read_mapped(o){let et=[];for(;;){let tt=o();if(tt==0)break;et.push(read_linear_table(tt,o))}for(;;){let tt=o()-1;if(tt<0)break;et.push(read_replacement_table(tt,o))}return et.flat()}function read_array_while(o){let et=[];for(;;){let tt=o(et.length);if(!tt)break;et.push(tt)}return et}function read_transposed(o,et,tt){let nt=Array(o).fill().map(()=>[]);for(let rt=0;rtnt[it].push(ot));return nt}function read_linear_table(o,et){let tt=1+et(),nt=et(),rt=read_array_while(et);return read_transposed(rt.length,1+o,et).flatMap((it,st)=>{let[at,...ct]=it;return Array(rt[st]).fill().map((lt,dt)=>{let ht=dt*nt;return[at+dt*tt,ct.map(pt=>pt+ht)]})})}function read_replacement_table(o,et){let tt=1+et();return read_transposed(tt,1+o,et).map(rt=>[rt[0],rt.slice(1)])}function read_trie(o){let et=[],tt=read_sorted(o);return rt(nt([]),[]),et;function nt(ot){let it=o(),st=read_array_while(()=>{let at=read_sorted(o).map(ct=>tt[ct]);if(at.length)return nt(at)});return{S:it,B:st,Q:ot}}function rt({S:ot,B:it},st,at){if(!(ot&4&&at===st[st.length-1])){ot&2&&(at=st[st.length-1]),ot&1&&et.push(st);for(let ct of it)for(let lt of ct.Q)rt(ct,[...st,lt],at)}}}function hex_cp(o){return o.toString(16).toUpperCase().padStart(2,"0")}function quote_cp(o){return`{${hex_cp(o)}}`}function explode_cp(o){let et=[];for(let tt=0,nt=o.length;tt>24&255}function unpack_cp(o){return o&16777215}let SHIFTED_RANK,EXCLUSIONS,DECOMP,RECOMP;function init$1(){let o=read_compressed_payload(COMPRESSED);SHIFTED_RANK=new Map(read_sorted_arrays(o).flatMap((et,tt)=>et.map(nt=>[nt,tt+1<<24]))),EXCLUSIONS=new Set(read_sorted(o)),DECOMP=new Map,RECOMP=new Map;for(let[et,tt]of read_mapped(o)){if(!EXCLUSIONS.has(et)&&tt.length==2){let[nt,rt]=tt,ot=RECOMP.get(nt);ot||(ot=new Map,RECOMP.set(nt,ot)),ot.set(rt,et)}DECOMP.set(et,tt.reverse())}}function is_hangul(o){return o>=S0&&o=L0&&o=V0&&etT0&&et0&&rt(T0+ct)}else{let it=DECOMP.get(ot);it?tt.push(...it):rt(ot)}if(!tt.length)break;ot=tt.pop()}if(nt&&et.length>1){let ot=unpack_cc(et[0]);for(let it=1;it0&&rt>=it)it==0?(et.push(nt,...tt),tt.length=0,nt=st):tt.push(st),rt=it;else{let at=compose_pair(nt,st);at>=0?nt=at:rt==0&&it==0?(et.push(nt),nt=st):(tt.push(st),rt=it)}}return nt>=0&&et.push(nt,...tt),et}function nfd(o){return decomposed(o).map(unpack_cp)}function nfc(o){return composed_from_decomposed(decomposed(o))}const HYPHEN=45,STOP_CH=".",FE0F=65039,UNIQUE_PH=1,Array_from=o=>Array.from(o);function group_has_cp(o,et){return o.P.has(et)||o.Q.has(et)}class Emoji extends Array{get is_emoji(){return!0}}let MAPPED,IGNORED,CM,NSM,ESCAPE,GROUPS,WHOLE_VALID,WHOLE_MAP,VALID,EMOJI_LIST,EMOJI_ROOT;function init(){if(MAPPED)return;let o=read_compressed_payload(COMPRESSED$1);const et=()=>read_sorted(o),tt=()=>new Set(et()),nt=(lt,dt)=>dt.forEach(ht=>lt.add(ht));MAPPED=new Map(read_mapped(o)),IGNORED=tt(),CM=et(),NSM=new Set(et().map(lt=>CM[lt])),CM=new Set(CM),ESCAPE=tt(),tt();let rt=read_sorted_arrays(o),ot=o();const it=()=>{let lt=new Set;return et().forEach(dt=>nt(lt,rt[dt])),nt(lt,et()),lt};GROUPS=read_array_while(lt=>{let dt=read_array_while(o).map(ht=>ht+96);if(dt.length){let ht=lt>=ot;dt[0]-=32,dt=str_from_cps(dt),ht&&(dt=`Restricted[${dt}]`);let pt=it(),mt=it(),ft=!o();return{N:dt,P:pt,Q:mt,M:ft,R:ht}}}),WHOLE_VALID=tt(),WHOLE_MAP=new Map;let st=et().concat(Array_from(WHOLE_VALID)).sort((lt,dt)=>lt-dt);st.forEach((lt,dt)=>{let ht=o(),pt=st[dt]=ht?st[dt-ht]:{V:[],M:new Map};pt.V.push(lt),WHOLE_VALID.has(lt)||WHOLE_MAP.set(lt,pt)});for(let{V:lt,M:dt}of new Set(WHOLE_MAP.values())){let ht=[];for(let mt of lt){let ft=GROUPS.filter(gt=>group_has_cp(gt,mt)),yt=ht.find(({G:gt})=>ft.some(xt=>gt.has(xt)));yt||(yt={G:new Set,V:[]},ht.push(yt)),yt.V.push(mt),nt(yt.G,ft)}let pt=ht.flatMap(mt=>Array_from(mt.G));for(let{G:mt,V:ft}of ht){let yt=new Set(pt.filter(gt=>!mt.has(gt)));for(let gt of ft)dt.set(gt,yt)}}VALID=new Set;let at=new Set;const ct=lt=>VALID.has(lt)?at.add(lt):VALID.add(lt);for(let lt of GROUPS){for(let dt of lt.P)ct(dt);for(let dt of lt.Q)ct(dt)}for(let lt of VALID)!WHOLE_MAP.has(lt)&&!at.has(lt)&&WHOLE_MAP.set(lt,UNIQUE_PH);nt(VALID,nfd(VALID)),EMOJI_LIST=read_trie(o).map(lt=>Emoji.from(lt)).sort(compare_arrays),EMOJI_ROOT=new Map;for(let lt of EMOJI_LIST){let dt=[EMOJI_ROOT];for(let ht of lt){let pt=dt.map(mt=>{let ft=mt.get(ht);return ft||(ft=new Map,mt.set(ht,ft)),ft});ht===FE0F?dt.push(...pt):dt=pt}for(let ht of dt)ht.V=lt}}function quoted_cp(o){return(should_escape(o)?"":`${bidi_qq(safe_str_from_cps([o]))} `)+quote_cp(o)}function bidi_qq(o){return`"${o}"‎`}function check_label_extension(o){if(o.length>=4&&o[2]==HYPHEN&&o[3]==HYPHEN)throw new Error(`invalid label extension: "${str_from_cps(o.slice(0,4))}"`)}function check_leading_underscore(o){for(let tt=o.lastIndexOf(95);tt>0;)if(o[--tt]!==95)throw new Error("underscore allowed only at start")}function check_fenced(o){let et=o[0],tt=FENCED.get(et);if(tt)throw error_placement(`leading ${tt}`);let nt=o.length,rt=-1;for(let ot=1;otet&&(et>>=1,o=[...o.slice(0,et),8230,...o.slice(-et)]);let rt=0,ot=o.length;for(let it=0;it{let ot=explode_cp(rt),it={input:ot,offset:nt};nt+=ot.length+1;try{let st=it.tokens=tokens_from_str(ot,et,tt),at=st.length,ct;if(!at)throw new Error("empty label");let lt=it.output=st.flat();if(check_leading_underscore(lt),!(it.emoji=at>1||st[0].is_emoji)&<.every(ht=>ht<128))check_label_extension(lt),ct="ASCII";else{let ht=st.flatMap(pt=>pt.is_emoji?[]:pt);if(!ht.length)ct="Emoji";else{if(CM.has(lt[0]))throw error_placement("leading combining mark");for(let ft=1;ftit.has(st)):Array_from(it),!tt.length)return}else nt.push(rt)}if(tt){for(let rt of tt)if(nt.every(ot=>group_has_cp(rt,ot)))throw new Error(`whole-script confusable: ${o.N}/${rt.N}`)}}function determine_group(o){let et=GROUPS;for(let tt of o){let nt=et.filter(rt=>group_has_cp(rt,tt));if(!nt.length)throw GROUPS.some(rt=>group_has_cp(rt,tt))?error_group_member(et[0],tt):error_disallowed(tt);if(et=nt,nt.length==1)break}return et}function flatten$1(o){return o.map(({input:et,error:tt,output:nt})=>{if(tt){let rt=tt.message;throw new Error(o.length==1?rt:`Invalid label ${bidi_qq(safe_str_from_cps(et,63))}: ${rt}`)}return str_from_cps(nt)}).join(STOP_CH)}function error_disallowed(o){return new Error(`disallowed character: ${quoted_cp(o)}`)}function error_group_member(o,et){let tt=quoted_cp(et),nt=GROUPS.find(rt=>rt.P.has(et));return nt&&(tt=`${nt.N} ${tt}`),new Error(`illegal mixture: ${o.N} + ${tt}`)}function error_placement(o){return new Error(`illegal placement: ${o}`)}function check_group(o,et){for(let tt of et)if(!group_has_cp(o,tt))throw error_group_member(o,tt);if(o.M){let tt=nfd(et);for(let nt=1,rt=tt.length;ntNSM_MAX)throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(tt.slice(nt-1,ot)))} (${ot-nt}/${NSM_MAX})`);nt=ot}}}function tokens_from_str(o,et,tt){let nt=[],rt=[];for(o=o.slice().reverse();o.length;){let ot=consume_emoji_reversed(o);if(ot)rt.length&&(nt.push(et(rt)),rt=[]),nt.push(tt(ot));else{let it=o.pop();if(VALID.has(it))rt.push(it);else{let st=MAPPED.get(it);if(st)rt.push(...st);else if(!IGNORED.has(it))throw error_disallowed(it)}}}return rt.length&&nt.push(et(rt)),nt}function filter_fe0f(o){return o.filter(et=>et!=FE0F)}function consume_emoji_reversed(o,et){let tt=EMOJI_ROOT,nt,rt=o.length;for(;rt&&(tt=tt.get(o[--rt]),!!tt);){let{V:ot}=tt;ot&&(nt=ot,o.length=rt)}return nt}const[SHA512_Kh,SHA512_Kl]=u64.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(o=>BigInt(o))),SHA512_W_H=new Uint32Array(80),SHA512_W_L=new Uint32Array(80);class SHA512 extends HashMD{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(){const{Ah:et,Al:tt,Bh:nt,Bl:rt,Ch:ot,Cl:it,Dh:st,Dl:at,Eh:ct,El:lt,Fh:dt,Fl:ht,Gh:pt,Gl:mt,Hh:ft,Hl:yt}=this;return[et,tt,nt,rt,ot,it,st,at,ct,lt,dt,ht,pt,mt,ft,yt]}set(et,tt,nt,rt,ot,it,st,at,ct,lt,dt,ht,pt,mt,ft,yt){this.Ah=et|0,this.Al=tt|0,this.Bh=nt|0,this.Bl=rt|0,this.Ch=ot|0,this.Cl=it|0,this.Dh=st|0,this.Dl=at|0,this.Eh=ct|0,this.El=lt|0,this.Fh=dt|0,this.Fl=ht|0,this.Gh=pt|0,this.Gl=mt|0,this.Hh=ft|0,this.Hl=yt|0}process(et,tt){for(let vt=0;vt<16;vt++,tt+=4)SHA512_W_H[vt]=et.getUint32(tt),SHA512_W_L[vt]=et.getUint32(tt+=4);for(let vt=16;vt<80;vt++){const bt=SHA512_W_H[vt-15]|0,Et=SHA512_W_L[vt-15]|0,wt=u64.rotrSH(bt,Et,1)^u64.rotrSH(bt,Et,8)^u64.shrSH(bt,Et,7),kt=u64.rotrSL(bt,Et,1)^u64.rotrSL(bt,Et,8)^u64.shrSL(bt,Et,7),Tt=SHA512_W_H[vt-2]|0,Rt=SHA512_W_L[vt-2]|0,Pt=u64.rotrSH(Tt,Rt,19)^u64.rotrBH(Tt,Rt,61)^u64.shrSH(Tt,Rt,6),$t=u64.rotrSL(Tt,Rt,19)^u64.rotrBL(Tt,Rt,61)^u64.shrSL(Tt,Rt,6),Ot=u64.add4L(kt,$t,SHA512_W_L[vt-7],SHA512_W_L[vt-16]),Bt=u64.add4H(Ot,wt,Pt,SHA512_W_H[vt-7],SHA512_W_H[vt-16]);SHA512_W_H[vt]=Bt|0,SHA512_W_L[vt]=Ot|0}let{Ah:nt,Al:rt,Bh:ot,Bl:it,Ch:st,Cl:at,Dh:ct,Dl:lt,Eh:dt,El:ht,Fh:pt,Fl:mt,Gh:ft,Gl:yt,Hh:gt,Hl:xt}=this;for(let vt=0;vt<80;vt++){const bt=u64.rotrSH(dt,ht,14)^u64.rotrSH(dt,ht,18)^u64.rotrBH(dt,ht,41),Et=u64.rotrSL(dt,ht,14)^u64.rotrSL(dt,ht,18)^u64.rotrBL(dt,ht,41),wt=dt&pt^~dt&ft,kt=ht&mt^~ht&yt,Tt=u64.add5L(xt,Et,kt,SHA512_Kl[vt],SHA512_W_L[vt]),Rt=u64.add5H(Tt,gt,bt,wt,SHA512_Kh[vt],SHA512_W_H[vt]),Pt=Tt|0,$t=u64.rotrSH(nt,rt,28)^u64.rotrBH(nt,rt,34)^u64.rotrBH(nt,rt,39),Ot=u64.rotrSL(nt,rt,28)^u64.rotrBL(nt,rt,34)^u64.rotrBL(nt,rt,39),Bt=nt&ot^nt&st^ot&st,zt=rt&it^rt&at^it&at;gt=ft|0,xt=yt|0,ft=pt|0,yt=mt|0,pt=dt|0,mt=ht|0,{h:dt,l:ht}=u64.add(ct|0,lt|0,Rt|0,Pt|0),ct=st|0,lt=at|0,st=ot|0,at=it|0,ot=nt|0,it=rt|0;const Ft=u64.add3L(Pt,Ot,zt);nt=u64.add3H(Ft,Rt,$t,Bt),rt=Ft|0}({h:nt,l:rt}=u64.add(this.Ah|0,this.Al|0,nt|0,rt|0)),{h:ot,l:it}=u64.add(this.Bh|0,this.Bl|0,ot|0,it|0),{h:st,l:at}=u64.add(this.Ch|0,this.Cl|0,st|0,at|0),{h:ct,l:lt}=u64.add(this.Dh|0,this.Dl|0,ct|0,lt|0),{h:dt,l:ht}=u64.add(this.Eh|0,this.El|0,dt|0,ht|0),{h:pt,l:mt}=u64.add(this.Fh|0,this.Fl|0,pt|0,mt|0),{h:ft,l:yt}=u64.add(this.Gh|0,this.Gl|0,ft|0,yt|0),{h:gt,l:xt}=u64.add(this.Hh|0,this.Hl|0,gt|0,xt|0),this.set(nt,rt,ot,it,st,at,ct,lt,dt,ht,pt,mt,ft,yt,gt,xt)}roundClean(){SHA512_W_H.fill(0),SHA512_W_L.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)}}const sha512=wrapConstructor(()=>new SHA512);function normalize$3(o){return ens_normalize(o)}normalize$3.parseError=o=>o;function normalize$2(o){return normalize$3(o)}function debounce$1(o,et,tt){var nt,rt,ot,it,st;et==null&&(et=100);function at(){var lt=Date.now()-it;lt=0?nt=setTimeout(at,et-lt):(nt=null,tt||(st=o.apply(ot,rt),ot=rt=null))}var ct=function(){ot=this,rt=arguments,it=Date.now();var lt=tt&&!nt;return nt||(nt=setTimeout(at,et)),lt&&(st=o.apply(ot,rt),ot=rt=null),st};return ct.clear=function(){nt&&(clearTimeout(nt),nt=null)},ct.flush=function(){nt&&(st=o.apply(ot,rt),ot=rt=null,clearTimeout(nt),nt=null)},ct}debounce$1.debounce=debounce$1;var debounce_1=debounce$1;const createDebounce=getDefaultExportFromCjs(debounce_1);function useMeasure(o){let{debounce:et,scroll:tt,polyfill:nt,offsetSize:rt}=o===void 0?{debounce:0,scroll:!1,offsetSize:!1}:o;const ot=nt||(typeof window>"u"?class{}:window.ResizeObserver);if(!ot)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[it,st]=reactExports.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),at=reactExports.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:it}),ct=et?typeof et=="number"?et:et.scroll:null,lt=et?typeof et=="number"?et:et.resize:null,dt=reactExports.useRef(!1);reactExports.useEffect(()=>(dt.current=!0,()=>void(dt.current=!1)));const[ht,pt,mt]=reactExports.useMemo(()=>{const xt=()=>{if(!at.current.element)return;const{left:vt,top:bt,width:Et,height:wt,bottom:kt,right:Tt,x:Rt,y:Pt}=at.current.element.getBoundingClientRect(),$t={left:vt,top:bt,width:Et,height:wt,bottom:kt,right:Tt,x:Rt,y:Pt};at.current.element instanceof HTMLElement&&rt&&($t.height=at.current.element.offsetHeight,$t.width=at.current.element.offsetWidth),Object.freeze($t),dt.current&&!areBoundsEqual(at.current.lastBounds,$t)&&st(at.current.lastBounds=$t)};return[xt,lt?createDebounce(xt,lt):xt,ct?createDebounce(xt,ct):xt]},[st,rt,ct,lt]);function ft(){at.current.scrollContainers&&(at.current.scrollContainers.forEach(xt=>xt.removeEventListener("scroll",mt,!0)),at.current.scrollContainers=null),at.current.resizeObserver&&(at.current.resizeObserver.disconnect(),at.current.resizeObserver=null)}function yt(){at.current.element&&(at.current.resizeObserver=new ot(mt),at.current.resizeObserver.observe(at.current.element),tt&&at.current.scrollContainers&&at.current.scrollContainers.forEach(xt=>xt.addEventListener("scroll",mt,{capture:!0,passive:!0})))}const gt=xt=>{!xt||xt===at.current.element||(ft(),at.current.element=xt,at.current.scrollContainers=findScrollContainers(xt),yt())};return useOnWindowScroll(mt,!!tt),useOnWindowResize(pt),reactExports.useEffect(()=>{ft(),yt()},[tt,mt,pt]),reactExports.useEffect(()=>ft,[]),[gt,it,ht]}function useOnWindowResize(o){reactExports.useEffect(()=>{const et=o;return window.addEventListener("resize",et),()=>void window.removeEventListener("resize",et)},[o])}function useOnWindowScroll(o,et){reactExports.useEffect(()=>{if(et){const tt=o;return window.addEventListener("scroll",tt,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",tt,!0)}},[o,et])}function findScrollContainers(o){const et=[];if(!o||o===document.body)return et;const{overflow:tt,overflowX:nt,overflowY:rt}=window.getComputedStyle(o);return[tt,nt,rt].some(ot=>ot==="auto"||ot==="scroll")&&et.push(o),[...et,...findScrollContainers(o.parentElement)]}const keys$1=["x","y","top","bottom","left","right","width","height"],areBoundsEqual=(o,et)=>keys$1.every(tt=>o[tt]===et[tt]);var MapShim=function(){if(typeof Map<"u")return Map;function o(et,tt){var nt=-1;return et.some(function(rt,ot){return rt[0]===tt?(nt=ot,!0):!1}),nt}return function(){function et(){this.__entries__=[]}return Object.defineProperty(et.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),et.prototype.get=function(tt){var nt=o(this.__entries__,tt),rt=this.__entries__[nt];return rt&&rt[1]},et.prototype.set=function(tt,nt){var rt=o(this.__entries__,tt);~rt?this.__entries__[rt][1]=nt:this.__entries__.push([tt,nt])},et.prototype.delete=function(tt){var nt=this.__entries__,rt=o(nt,tt);~rt&&nt.splice(rt,1)},et.prototype.has=function(tt){return!!~o(this.__entries__,tt)},et.prototype.clear=function(){this.__entries__.splice(0)},et.prototype.forEach=function(tt,nt){nt===void 0&&(nt=null);for(var rt=0,ot=this.__entries__;rt0},o.prototype.connect_=function(){!isBrowser$2||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},o.prototype.disconnect_=function(){!isBrowser$2||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},o.prototype.onTransitionEnd_=function(et){var tt=et.propertyName,nt=tt===void 0?"":tt,rt=transitionKeys.some(function(ot){return!!~nt.indexOf(ot)});rt&&this.refresh()},o.getInstance=function(){return this.instance_||(this.instance_=new o),this.instance_},o.instance_=null,o}(),defineConfigurable=function(o,et){for(var tt=0,nt=Object.keys(et);tt"u"||!(Element instanceof Object))){if(!(et instanceof getWindowOf(et).Element))throw new TypeError('parameter 1 is not of type "Element".');var tt=this.observations_;tt.has(et)||(tt.set(et,new ResizeObservation(et)),this.controller_.addObserver(this),this.controller_.refresh())}},o.prototype.unobserve=function(et){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(et instanceof getWindowOf(et).Element))throw new TypeError('parameter 1 is not of type "Element".');var tt=this.observations_;tt.has(et)&&(tt.delete(et),tt.size||this.controller_.removeObserver(this))}},o.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},o.prototype.gatherActive=function(){var et=this;this.clearActive(),this.observations_.forEach(function(tt){tt.isActive()&&et.activeObservations_.push(tt)})},o.prototype.broadcastActive=function(){if(this.hasActive()){var et=this.callbackCtx_,tt=this.activeObservations_.map(function(nt){return new ResizeObserverEntry(nt.target,nt.broadcastRect())});this.callback_.call(et,tt,et),this.clearActive()}},o.prototype.clearActive=function(){this.activeObservations_.splice(0)},o.prototype.hasActive=function(){return this.activeObservations_.length>0},o}(),observers=typeof WeakMap<"u"?new WeakMap:new MapShim,ResizeObserver$1=function(){function o(et){if(!(this instanceof o))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var tt=ResizeObserverController.getInstance(),nt=new ResizeObserverSPI(et,tt,this);observers.set(this,nt)}return o}();["observe","unobserve","disconnect"].forEach(function(o){ResizeObserver$1.prototype[o]=function(){var et;return(et=observers.get(this))[o].apply(et,arguments)}});var index$1=function(){return typeof global$1.ResizeObserver<"u"?global$1.ResizeObserver:ResizeObserver$1}(),browser$1={},canPromise$1=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},qrcode={},utils$2={};let toSJISFunction;const CODEWORDS_COUNT=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];utils$2.getSymbolSize=function(et){if(!et)throw new Error('"version" cannot be null or undefined');if(et<1||et>40)throw new Error('"version" should be in range from 1 to 40');return et*4+17};utils$2.getSymbolTotalCodewords=function(et){return CODEWORDS_COUNT[et]};utils$2.getBCHDigit=function(o){let et=0;for(;o!==0;)et++,o>>>=1;return et};utils$2.setToSJISFunction=function(et){if(typeof et!="function")throw new Error('"toSJISFunc" is not a valid function.');toSJISFunction=et};utils$2.isKanjiModeEnabled=function(){return typeof toSJISFunction<"u"};utils$2.toSJIS=function(et){return toSJISFunction(et)};var errorCorrectionLevel={};(function(o){o.L={bit:1},o.M={bit:0},o.Q={bit:3},o.H={bit:2};function et(tt){if(typeof tt!="string")throw new Error("Param is not a string");switch(tt.toLowerCase()){case"l":case"low":return o.L;case"m":case"medium":return o.M;case"q":case"quartile":return o.Q;case"h":case"high":return o.H;default:throw new Error("Unknown EC Level: "+tt)}}o.isValid=function(nt){return nt&&typeof nt.bit<"u"&&nt.bit>=0&&nt.bit<4},o.from=function(nt,rt){if(o.isValid(nt))return nt;try{return et(nt)}catch{return rt}}})(errorCorrectionLevel);function BitBuffer$1(){this.buffer=[],this.length=0}BitBuffer$1.prototype={get:function(o){const et=Math.floor(o/8);return(this.buffer[et]>>>7-o%8&1)===1},put:function(o,et){for(let tt=0;tt>>et-tt-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const et=Math.floor(this.length/8);this.buffer.length<=et&&this.buffer.push(0),o&&(this.buffer[et]|=128>>>this.length%8),this.length++}};var bitBuffer=BitBuffer$1;function BitMatrix$1(o){if(!o||o<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=o,this.data=new Uint8Array(o*o),this.reservedBit=new Uint8Array(o*o)}BitMatrix$1.prototype.set=function(o,et,tt,nt){const rt=o*this.size+et;this.data[rt]=tt,nt&&(this.reservedBit[rt]=!0)};BitMatrix$1.prototype.get=function(o,et){return this.data[o*this.size+et]};BitMatrix$1.prototype.xor=function(o,et,tt){this.data[o*this.size+et]^=tt};BitMatrix$1.prototype.isReserved=function(o,et){return this.reservedBit[o*this.size+et]};var bitMatrix=BitMatrix$1,alignmentPattern={};(function(o){const et=utils$2.getSymbolSize;o.getRowColCoords=function(nt){if(nt===1)return[];const rt=Math.floor(nt/7)+2,ot=et(nt),it=ot===145?26:Math.ceil((ot-13)/(2*rt-2))*2,st=[ot-7];for(let at=1;at=0&&rt<=7},o.from=function(rt){return o.isValid(rt)?parseInt(rt,10):void 0},o.getPenaltyN1=function(rt){const ot=rt.size;let it=0,st=0,at=0,ct=null,lt=null;for(let dt=0;dt=5&&(it+=et.N1+(st-5)),ct=pt,st=1),pt=rt.get(ht,dt),pt===lt?at++:(at>=5&&(it+=et.N1+(at-5)),lt=pt,at=1)}st>=5&&(it+=et.N1+(st-5)),at>=5&&(it+=et.N1+(at-5))}return it},o.getPenaltyN2=function(rt){const ot=rt.size;let it=0;for(let st=0;st=10&&(st===1488||st===93)&&it++,at=at<<1&2047|rt.get(lt,ct),lt>=10&&(at===1488||at===93)&&it++}return it*et.N3},o.getPenaltyN4=function(rt){let ot=0;const it=rt.data.length;for(let at=0;at=0;){const it=ot[0];for(let at=0;at0){const ot=new Uint8Array(this.degree);return ot.set(nt,rt),ot}return nt};var reedSolomonEncoder=ReedSolomonEncoder$1,version$4={},mode$1={},versionCheck={};versionCheck.isValid=function(et){return!isNaN(et)&&et>=1&&et<=40};var regex={};const numeric="[0-9]+",alphanumeric="[A-Z $%*+\\-./:]+";let kanji="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";kanji=kanji.replace(/u/g,"\\u");const byte="(?:(?![A-Z0-9 $%*+\\-./:]|"+kanji+`)(?:.|[\r +]))+`;regex.KANJI=new RegExp(kanji,"g");regex.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");regex.BYTE=new RegExp(byte,"g");regex.NUMERIC=new RegExp(numeric,"g");regex.ALPHANUMERIC=new RegExp(alphanumeric,"g");const TEST_KANJI=new RegExp("^"+kanji+"$"),TEST_NUMERIC=new RegExp("^"+numeric+"$"),TEST_ALPHANUMERIC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");regex.testKanji=function(et){return TEST_KANJI.test(et)};regex.testNumeric=function(et){return TEST_NUMERIC.test(et)};regex.testAlphanumeric=function(et){return TEST_ALPHANUMERIC.test(et)};(function(o){const et=versionCheck,tt=regex;o.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},o.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},o.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},o.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},o.MIXED={bit:-1},o.getCharCountIndicator=function(ot,it){if(!ot.ccBits)throw new Error("Invalid mode: "+ot);if(!et.isValid(it))throw new Error("Invalid version: "+it);return it>=1&&it<10?ot.ccBits[0]:it<27?ot.ccBits[1]:ot.ccBits[2]},o.getBestModeForData=function(ot){return tt.testNumeric(ot)?o.NUMERIC:tt.testAlphanumeric(ot)?o.ALPHANUMERIC:tt.testKanji(ot)?o.KANJI:o.BYTE},o.toString=function(ot){if(ot&&ot.id)return ot.id;throw new Error("Invalid mode")},o.isValid=function(ot){return ot&&ot.bit&&ot.ccBits};function nt(rt){if(typeof rt!="string")throw new Error("Param is not a string");switch(rt.toLowerCase()){case"numeric":return o.NUMERIC;case"alphanumeric":return o.ALPHANUMERIC;case"kanji":return o.KANJI;case"byte":return o.BYTE;default:throw new Error("Unknown mode: "+rt)}}o.from=function(ot,it){if(o.isValid(ot))return ot;try{return nt(ot)}catch{return it}}})(mode$1);(function(o){const et=utils$2,tt=errorCorrectionCode,nt=errorCorrectionLevel,rt=mode$1,ot=versionCheck,it=7973,st=et.getBCHDigit(it);function at(ht,pt,mt){for(let ft=1;ft<=40;ft++)if(pt<=o.getCapacity(ft,mt,ht))return ft}function ct(ht,pt){return rt.getCharCountIndicator(ht,pt)+4}function lt(ht,pt){let mt=0;return ht.forEach(function(ft){const yt=ct(ft.mode,pt);mt+=yt+ft.getBitsLength()}),mt}function dt(ht,pt){for(let mt=1;mt<=40;mt++)if(lt(ht,mt)<=o.getCapacity(mt,pt,rt.MIXED))return mt}o.from=function(pt,mt){return ot.isValid(pt)?parseInt(pt,10):mt},o.getCapacity=function(pt,mt,ft){if(!ot.isValid(pt))throw new Error("Invalid QR Code version");typeof ft>"u"&&(ft=rt.BYTE);const yt=et.getSymbolTotalCodewords(pt),gt=tt.getTotalCodewordsCount(pt,mt),xt=(yt-gt)*8;if(ft===rt.MIXED)return xt;const vt=xt-ct(ft,pt);switch(ft){case rt.NUMERIC:return Math.floor(vt/10*3);case rt.ALPHANUMERIC:return Math.floor(vt/11*2);case rt.KANJI:return Math.floor(vt/13);case rt.BYTE:default:return Math.floor(vt/8)}},o.getBestVersionForData=function(pt,mt){let ft;const yt=nt.from(mt,nt.M);if(Array.isArray(pt)){if(pt.length>1)return dt(pt,yt);if(pt.length===0)return 1;ft=pt[0]}else ft=pt;return at(ft.mode,ft.getLength(),yt)},o.getEncodedBits=function(pt){if(!ot.isValid(pt)||pt<7)throw new Error("Invalid QR Code version");let mt=pt<<12;for(;et.getBCHDigit(mt)-st>=0;)mt^=it<=0;)rt^=G15<0&&(nt=this.data.substr(tt),rt=parseInt(nt,10),et.put(rt,ot*3+1))};var numericData=NumericData;const Mode$3=mode$1,ALPHA_NUM_CHARS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function AlphanumericData(o){this.mode=Mode$3.ALPHANUMERIC,this.data=o}AlphanumericData.getBitsLength=function(et){return 11*Math.floor(et/2)+6*(et%2)};AlphanumericData.prototype.getLength=function(){return this.data.length};AlphanumericData.prototype.getBitsLength=function(){return AlphanumericData.getBitsLength(this.data.length)};AlphanumericData.prototype.write=function(et){let tt;for(tt=0;tt+2<=this.data.length;tt+=2){let nt=ALPHA_NUM_CHARS.indexOf(this.data[tt])*45;nt+=ALPHA_NUM_CHARS.indexOf(this.data[tt+1]),et.put(nt,11)}this.data.length%2&&et.put(ALPHA_NUM_CHARS.indexOf(this.data[tt]),6)};var alphanumericData=AlphanumericData;const Mode$2=mode$1;function ByteData(o){this.mode=Mode$2.BYTE,typeof o=="string"?this.data=new TextEncoder().encode(o):this.data=new Uint8Array(o)}ByteData.getBitsLength=function(et){return et*8};ByteData.prototype.getLength=function(){return this.data.length};ByteData.prototype.getBitsLength=function(){return ByteData.getBitsLength(this.data.length)};ByteData.prototype.write=function(o){for(let et=0,tt=this.data.length;et=33088&&tt<=40956)tt-=33088;else if(tt>=57408&&tt<=60351)tt-=49472;else throw new Error("Invalid SJIS character: "+this.data[et]+` +Make sure your charset is UTF-8`);tt=(tt>>>8&255)*192+(tt&255),o.put(tt,13)}};var kanjiData=KanjiData,dijkstra={exports:{}};(function(o){var et={single_source_shortest_paths:function(tt,nt,rt){var ot={},it={};it[nt]=0;var st=et.PriorityQueue.make();st.push(nt,0);for(var at,ct,lt,dt,ht,pt,mt,ft,yt;!st.empty();){at=st.pop(),ct=at.value,dt=at.cost,ht=tt[ct]||{};for(lt in ht)ht.hasOwnProperty(lt)&&(pt=ht[lt],mt=dt+pt,ft=it[lt],yt=typeof it[lt]>"u",(yt||ft>mt)&&(it[lt]=mt,st.push(lt,mt),ot[lt]=ct))}if(typeof rt<"u"&&typeof it[rt]>"u"){var gt=["Could not find a path from ",nt," to ",rt,"."].join("");throw new Error(gt)}return ot},extract_shortest_path_from_predecessor_list:function(tt,nt){for(var rt=[],ot=nt;ot;)rt.push(ot),tt[ot],ot=tt[ot];return rt.reverse(),rt},find_path:function(tt,nt,rt){var ot=et.single_source_shortest_paths(tt,nt,rt);return et.extract_shortest_path_from_predecessor_list(ot,rt)},PriorityQueue:{make:function(tt){var nt=et.PriorityQueue,rt={},ot;tt=tt||{};for(ot in nt)nt.hasOwnProperty(ot)&&(rt[ot]=nt[ot]);return rt.queue=[],rt.sorter=tt.sorter||nt.default_sorter,rt},default_sorter:function(tt,nt){return tt.cost-nt.cost},push:function(tt,nt){var rt={value:tt,cost:nt};this.queue.push(rt),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};o.exports=et})(dijkstra);var dijkstraExports=dijkstra.exports;(function(o){const et=mode$1,tt=numericData,nt=alphanumericData,rt=byteData,ot=kanjiData,it=regex,st=utils$2,at=dijkstraExports;function ct(gt){return unescape(encodeURIComponent(gt)).length}function lt(gt,xt,vt){const bt=[];let Et;for(;(Et=gt.exec(vt))!==null;)bt.push({data:Et[0],index:Et.index,mode:xt,length:Et[0].length});return bt}function dt(gt){const xt=lt(it.NUMERIC,et.NUMERIC,gt),vt=lt(it.ALPHANUMERIC,et.ALPHANUMERIC,gt);let bt,Et;return st.isKanjiModeEnabled()?(bt=lt(it.BYTE,et.BYTE,gt),Et=lt(it.KANJI,et.KANJI,gt)):(bt=lt(it.BYTE_KANJI,et.BYTE,gt),Et=[]),xt.concat(vt,bt,Et).sort(function(kt,Tt){return kt.index-Tt.index}).map(function(kt){return{data:kt.data,mode:kt.mode,length:kt.length}})}function ht(gt,xt){switch(xt){case et.NUMERIC:return tt.getBitsLength(gt);case et.ALPHANUMERIC:return nt.getBitsLength(gt);case et.KANJI:return ot.getBitsLength(gt);case et.BYTE:return rt.getBitsLength(gt)}}function pt(gt){return gt.reduce(function(xt,vt){const bt=xt.length-1>=0?xt[xt.length-1]:null;return bt&&bt.mode===vt.mode?(xt[xt.length-1].data+=vt.data,xt):(xt.push(vt),xt)},[])}function mt(gt){const xt=[];for(let vt=0;vt=0&&st<=6&&(at===0||at===6)||at>=0&&at<=6&&(st===0||st===6)||st>=2&&st<=4&&at>=2&&at<=4?o.set(ot+st,it+at,!0,!0):o.set(ot+st,it+at,!1,!0))}}function setupTimingPattern(o){const et=o.size;for(let tt=8;tt>st&1)===1,o.set(rt,ot,it,!0),o.set(ot,rt,it,!0)}function setupFormatInfo(o,et,tt){const nt=o.size,rt=FormatInfo.getEncodedBits(et,tt);let ot,it;for(ot=0;ot<15;ot++)it=(rt>>ot&1)===1,ot<6?o.set(ot,8,it,!0):ot<8?o.set(ot+1,8,it,!0):o.set(nt-15+ot,8,it,!0),ot<8?o.set(8,nt-ot-1,it,!0):ot<9?o.set(8,15-ot-1+1,it,!0):o.set(8,15-ot-1,it,!0);o.set(nt-8,8,1,!0)}function setupData(o,et){const tt=o.size;let nt=-1,rt=tt-1,ot=7,it=0;for(let st=tt-1;st>0;st-=2)for(st===6&&st--;;){for(let at=0;at<2;at++)if(!o.isReserved(rt,st-at)){let ct=!1;it>>ot&1)===1),o.set(rt,st-at,ct),ot--,ot===-1&&(it++,ot=7)}if(rt+=nt,rt<0||tt<=rt){rt-=nt,nt=-nt;break}}}function createData(o,et,tt){const nt=new BitBuffer;tt.forEach(function(at){nt.put(at.mode.bit,4),nt.put(at.getLength(),Mode.getCharCountIndicator(at.mode,o)),at.write(nt)});const rt=Utils$1.getSymbolTotalCodewords(o),ot=ECCode.getTotalCodewordsCount(o,et),it=(rt-ot)*8;for(nt.getLengthInBits()+4<=it&&nt.put(0,4);nt.getLengthInBits()%8!==0;)nt.putBit(0);const st=(it-nt.getLengthInBits())/8;for(let at=0;at=7&&setupVersionInfo(at,et),setupData(at,it),isNaN(nt)&&(nt=MaskPattern.getBestMask(at,setupFormatInfo.bind(null,at,tt))),MaskPattern.applyMask(nt,at),setupFormatInfo(at,tt,nt),{modules:at,version:et,errorCorrectionLevel:tt,maskPattern:nt,segments:rt}}qrcode.create=function(et,tt){if(typeof et>"u"||et==="")throw new Error("No input text");let nt=ECLevel.M,rt,ot;return typeof tt<"u"&&(nt=ECLevel.from(tt.errorCorrectionLevel,ECLevel.M),rt=Version$1.from(tt.version),ot=MaskPattern.from(tt.maskPattern),tt.toSJISFunc&&Utils$1.setToSJISFunction(tt.toSJISFunc)),createSymbol(et,rt,nt,ot)};var canvas={},utils$1={};(function(o){function et(tt){if(typeof tt=="number"&&(tt=tt.toString()),typeof tt!="string")throw new Error("Color should be defined as hex string");let nt=tt.slice().replace("#","").split("");if(nt.length<3||nt.length===5||nt.length>8)throw new Error("Invalid hex color: "+tt);(nt.length===3||nt.length===4)&&(nt=Array.prototype.concat.apply([],nt.map(function(ot){return[ot,ot]}))),nt.length===6&&nt.push("F","F");const rt=parseInt(nt.join(""),16);return{r:rt>>24&255,g:rt>>16&255,b:rt>>8&255,a:rt&255,hex:"#"+nt.slice(0,6).join("")}}o.getOptions=function(nt){nt||(nt={}),nt.color||(nt.color={});const rt=typeof nt.margin>"u"||nt.margin===null||nt.margin<0?4:nt.margin,ot=nt.width&&nt.width>=21?nt.width:void 0,it=nt.scale||4;return{width:ot,scale:ot?4:it,margin:rt,color:{dark:et(nt.color.dark||"#000000ff"),light:et(nt.color.light||"#ffffffff")},type:nt.type,rendererOpts:nt.rendererOpts||{}}},o.getScale=function(nt,rt){return rt.width&&rt.width>=nt+rt.margin*2?rt.width/(nt+rt.margin*2):rt.scale},o.getImageWidth=function(nt,rt){const ot=o.getScale(nt,rt);return Math.floor((nt+rt.margin*2)*ot)},o.qrToImageData=function(nt,rt,ot){const it=rt.modules.size,st=rt.modules.data,at=o.getScale(it,ot),ct=Math.floor((it+ot.margin*2)*at),lt=ot.margin*at,dt=[ot.color.light,ot.color.dark];for(let ht=0;ht=lt&&pt>=lt&&ht"u"&&(!it||!it.getContext)&&(at=it,it=void 0),it||(ct=nt()),at=et.getOptions(at);const lt=et.getImageWidth(ot.modules.size,at),dt=ct.getContext("2d"),ht=dt.createImageData(lt,lt);return et.qrToImageData(ht.data,ot,at),tt(dt,ct,lt),dt.putImageData(ht,0,0),ct},o.renderToDataURL=function(ot,it,st){let at=st;typeof at>"u"&&(!it||!it.getContext)&&(at=it,it=void 0),at||(at={});const ct=o.render(ot,it,at),lt=at.type||"image/png",dt=at.rendererOpts||{};return ct.toDataURL(lt,dt.quality)}})(canvas);var svgTag={};const Utils=utils$1;function getColorAttrib(o,et){const tt=o.a/255,nt=et+'="'+o.hex+'"';return tt<1?nt+" "+et+'-opacity="'+tt.toFixed(2).slice(1)+'"':nt}function svgCmd(o,et,tt){let nt=o+et;return typeof tt<"u"&&(nt+=" "+tt),nt}function qrToPath(o,et,tt){let nt="",rt=0,ot=!1,it=0;for(let st=0;st0&&at>0&&o[st-1]||(nt+=ot?svgCmd("M",at+tt,.5+ct+tt):svgCmd("m",rt,0),rt=0,ot=!1),at+1':"",ct="',lt='viewBox="0 0 '+st+" "+st+'"',ht=''+at+ct+` +`;return typeof nt=="function"&&nt(null,ht),ht};const canPromise=canPromise$1,QRCode$2=qrcode,CanvasRenderer=canvas,SvgRenderer=svgTag;function renderCanvas(o,et,tt,nt,rt){const ot=[].slice.call(arguments,1),it=ot.length,st=typeof ot[it-1]=="function";if(!st&&!canPromise())throw new Error("Callback required as last argument");if(st){if(it<2)throw new Error("Too few arguments provided");it===2?(rt=tt,tt=et,et=nt=void 0):it===3&&(et.getContext&&typeof rt>"u"?(rt=nt,nt=void 0):(rt=nt,nt=tt,tt=et,et=void 0))}else{if(it<1)throw new Error("Too few arguments provided");return it===1?(tt=et,et=nt=void 0):it===2&&!et.getContext&&(nt=tt,tt=et,et=void 0),new Promise(function(at,ct){try{const lt=QRCode$2.create(tt,nt);at(o(lt,et,nt))}catch(lt){ct(lt)}})}try{const at=QRCode$2.create(tt,nt);rt(null,o(at,et,nt))}catch(at){rt(at)}}browser$1.create=QRCode$2.create;browser$1.toCanvas=renderCanvas.bind(null,CanvasRenderer.render);browser$1.toDataURL=renderCanvas.bind(null,CanvasRenderer.renderToDataURL);browser$1.toString=renderCanvas.bind(null,function(o,et,tt){return SvgRenderer.render(o,tt)});var PRE_ENTER=0,ENTERING=1,ENTERED=2,PRE_EXIT=3,EXITING=4,EXITED=5,UNMOUNTED=6,STATES=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],startOrEnd=function(et){return et?UNMOUNTED:EXITED},updateState=function(et,tt,nt,rt,ot){clearTimeout(rt.current),tt(et),nt.current=et,ot&&ot({state:STATES[et]})},useTransition=function(et){var tt=et===void 0?{}:et,nt=tt.enter,rt=nt===void 0?!0:nt,ot=tt.exit,it=ot===void 0?!0:ot,st=tt.preEnter,at=tt.preExit,ct=tt.timeout,lt=tt.initialEntered,dt=tt.mountOnEnter,ht=tt.unmountOnExit,pt=tt.onChange,mt=reactExports.useState(lt?ENTERED:startOrEnd(dt)),ft=mt[0],yt=mt[1],gt=reactExports.useRef(ft),xt=reactExports.useRef(),vt,bt;typeof ct=="object"?(vt=ct.enter,bt=ct.exit):vt=bt=ct;var Et=reactExports.useCallback(function(){var kt;switch(gt.current){case ENTERING:case PRE_ENTER:kt=ENTERED;break;case EXITING:case PRE_EXIT:kt=startOrEnd(ht);break}kt!==void 0&&updateState(kt,yt,gt,xt,pt)},[pt,ht]),wt=reactExports.useCallback(function(kt){var Tt=function Pt($t){switch(updateState($t,yt,gt,xt,pt),$t){case ENTERING:vt>=0&&(xt.current=setTimeout(Et,vt));break;case EXITING:bt>=0&&(xt.current=setTimeout(Et,bt));break;case PRE_ENTER:case PRE_EXIT:xt.current=setTimeout(function(){return Pt($t+1)},0);break}},Rt=gt.current<=ENTERED;typeof kt!="boolean"&&(kt=!Rt),kt?Rt||Tt(rt?st?PRE_ENTER:ENTERING:ENTERED):Rt&&Tt(it?at?PRE_EXIT:EXITING:startOrEnd(ht))},[Et,pt,rt,it,st,at,vt,bt,ht]);return reactExports.useEffect(function(){return function(){return clearTimeout(xt.current)}},[]),[STATES[ft],wt,Et]};const defaultConnectors=({app:o,walletConnectProjectId:et,coinbaseWalletPreference:tt})=>{const nt=o.name&&o.icon&&o.description&&o.url,rt=!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,ot=[];return rt&&ot.push(safe({allowedDomains:[/gnosis-safe.io$/,/app.safe.global$/]})),ot.push(injected({target:"metaMask"}),coinbaseWallet({appName:o.name,appLogoUrl:o.icon,overrideIsMetaMask:!1,preference:tt})),et&&ot.push(walletConnect({showQrModal:!1,projectId:et,metadata:nt?{name:o.name,description:o.description,url:o.url,icons:[o.icon]}:void 0})),ot};let globalAppName,globalAppIcon;const getAppName=()=>globalAppName,getAppIcon=()=>globalAppIcon,defaultConfig=({appName:o="ConnectKit",appIcon:et,appDescription:tt,appUrl:nt,walletConnectProjectId:rt,coinbaseWalletPreference:ot,chains:it=[mainnet,polygon,optimism,arbitrum],client:st,...at})=>{var ct,lt;globalAppName=o,et&&(globalAppIcon=et);const dt=(ct=at==null?void 0:at.transports)!==null&&ct!==void 0?ct:Object.fromEntries(it.map(mt=>[mt.id,http()])),ht=(lt=at==null?void 0:at.connectors)!==null&<!==void 0?lt:defaultConnectors({app:{name:o,icon:et,description:tt,url:nt},walletConnectProjectId:rt,coinbaseWalletPreference:ot});return{...at,chains:it,connectors:ht,transports:dt}},isWalletInstalled=o=>{if(typeof window>"u")return!1;const{ethereum:et}=window;return!!(et!=null&&et[`is${o}`]||et!=null&&et.providers&&(et!=null&&et.providers.find(tt=>tt==null?void 0:tt[`is${o}`])))},isFamily=()=>isWalletInstalled("Family"),isRainbow=()=>isWalletInstalled("Rainbow"),isZerion=()=>isWalletInstalled("Zerion"),Mock=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)"},children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.5611 8.12948C21.0082 7.90729 21.5007 7.79167 22 7.79167C22.4993 7.79167 22.9919 7.90729 23.439 8.12948L23.4408 8.1304L33.0387 12.9293C33.577 13.197 34.031 13.61 34.3478 14.121C34.6649 14.6323 34.833 15.2218 34.8333 15.8234V27.2595C34.833 27.8611 34.6649 28.4511 34.3478 28.9624C34.031 29.4733 33.578 29.8858 33.0398 30.1535L23.4411 34.9528C22.9919 35.1775 22.4963 35.2947 21.994 35.2947C21.4918 35.2947 20.9964 35.1777 20.5472 34.9529L10.9475 30.1531L10.9452 30.1519C10.4071 29.8808 9.95535 29.4646 9.6411 28.9504C9.32739 28.437 9.16312 27.8464 9.16673 27.2448L9.16675 27.2417L10.0004 27.2475H9.16673V27.2448V15.8239C9.16705 15.2223 9.33518 14.6322 9.65222 14.121C9.96906 13.61 10.4221 13.1976 10.9604 12.9298L20.5592 8.1304L20.5611 8.12948ZM21.3031 9.62267L11.8706 14.3389L22 19.4036L32.1294 14.3389L22.697 9.62267C22.4806 9.51531 22.2416 9.45905 22 9.45905C21.7585 9.45905 21.5194 9.51534 21.3031 9.62267ZM10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241ZM22.8337 33.3923L32.2967 28.6608C32.5576 28.5312 32.7772 28.3313 32.9308 28.0836C33.0844 27.836 33.1658 27.5504 33.166 27.259V15.8243C33.1659 15.7786 33.1639 15.7331 33.1599 15.6878L22.8337 20.8509V33.3923Z",fill:"url(#paint0_linear_3546_7073)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241Z",fill:"url(#paint1_linear_3546_7073)",fillOpacity:"0.3"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]})]})]}),Injected=({...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6505 3.64041C15.6501 3.64062 15.6497 3.64083 15.6493 3.64103L6.05165 8.43985L16.2501 13.5391L26.4484 8.43987L16.8508 3.64103C16.8504 3.64083 16.85 3.64063 16.8496 3.64043C16.6632 3.54806 16.458 3.5 16.25 3.5C16.042 3.5 15.8369 3.54806 15.6505 3.64041ZM28 10.4592L17.5001 15.7091L17.5 28.5205L27.248 23.6465L27.2508 23.6452C27.4757 23.5334 27.665 23.3611 27.7973 23.1477C27.9297 22.9342 27.9999 22.6881 28 22.4369V10.4592ZM15 28.527L15.0001 15.7091L4.50006 10.4591V22.4333C4.49831 22.6849 4.56687 22.9319 4.69807 23.1466C4.82896 23.3608 5.01696 23.5342 5.24095 23.6475C5.24148 23.6477 5.242 23.648 5.24253 23.6483L15 28.527ZM14.5207 31.0824L4.12104 25.8826L4.11759 25.8809C3.47681 25.558 2.93902 25.0625 2.56486 24.4502C2.19154 23.8394 1.99597 23.1365 2.00006 22.4207V10.0486C2.00044 9.33234 2.20062 8.62972 2.5781 8.021C2.95529 7.41274 3.49457 6.92167 4.13537 6.60291C4.13585 6.60267 4.13633 6.60243 4.13681 6.60219L14.534 1.40359L14.5368 1.40221C15.0692 1.13767 15.6556 1 16.25 1C16.8445 1 17.4309 1.13767 17.9633 1.40221L17.966 1.40358L28.3633 6.60219C28.3638 6.60245 28.3643 6.6027 28.3648 6.60295C29.0055 6.92171 29.5448 7.41276 29.922 8.021C30.2994 8.62973 30.4996 9.33168 30.5 10.0479V22.4376C30.4996 23.1538 30.2994 23.8565 29.922 24.4652C29.5448 25.0734 29.0056 25.5644 28.365 25.8831C28.3644 25.8834 28.3638 25.8837 28.3633 25.884L17.9664 31.0824C17.9663 31.0825 17.9665 31.0824 17.9664 31.0824C17.4316 31.3499 16.8415 31.4894 16.2435 31.4894C15.6455 31.4894 15.0554 31.3499 14.5207 31.0824C14.5205 31.0824 14.5208 31.0825 14.5207 31.0824Z",fill:"#CCCCCC"})}),WalletConnect=({background:o=!1,...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:o?{background:"var(--ck-brand-walletConnect)"}:void 0,children:jsxRuntimeExports.jsx("path",{d:"M9.58818 11.8556C13.1293 8.31442 18.8706 8.31442 22.4117 11.8556L22.8379 12.2818C23.015 12.4588 23.015 12.7459 22.8379 12.9229L21.3801 14.3808C21.2915 14.4693 21.148 14.4693 21.0595 14.3808L20.473 13.7943C18.0026 11.3239 13.9973 11.3239 11.5269 13.7943L10.8989 14.4223C10.8104 14.5109 10.6668 14.5109 10.5783 14.4223L9.12041 12.9645C8.94336 12.7875 8.94336 12.5004 9.12041 12.3234L9.58818 11.8556ZM25.4268 14.8706L26.7243 16.1682C26.9013 16.3452 26.9013 16.6323 26.7243 16.8093L20.8737 22.6599C20.6966 22.8371 20.4096 22.8371 20.2325 22.6599L16.0802 18.5076C16.0359 18.4634 15.9641 18.4634 15.9199 18.5076L11.7675 22.6599C11.5905 22.8371 11.3034 22.8371 11.1264 22.66C11.1264 22.66 11.1264 22.6599 11.1264 22.6599L5.27561 16.8092C5.09856 16.6322 5.09856 16.3451 5.27561 16.168L6.57313 14.8706C6.75019 14.6934 7.03726 14.6934 7.21431 14.8706L11.3668 19.023C11.411 19.0672 11.4828 19.0672 11.5271 19.023L15.6793 14.8706C15.8563 14.6934 16.1434 14.6934 16.3205 14.8706L20.473 19.023C20.5172 19.0672 20.589 19.0672 20.6332 19.023L24.7856 14.8706C24.9627 14.6935 25.2498 14.6935 25.4268 14.8706Z",fill:o?"white":"var(--ck-brand-walletConnect)"})}),MetaMask=({background:o=!1,...et})=>jsxRuntimeExports.jsxs("svg",{...et,style:o?{background:"linear-gradient(0deg, var(--ck-brand-metamask-12), var(--ck-brand-metamask-11))",borderRadius:"27.5%"}:void 0,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M27.2684 4.03027L17.5018 11.2841L19.3079 7.00442L27.2684 4.03027Z",fill:"var(--ck-brand-metamask-02)",stroke:"var(--ck-brand-metamask-02)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M4.7218 4.03027L14.4099 11.3528L12.6921 7.00442L4.7218 4.03027Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M23.7544 20.8438L21.1532 24.8289L26.7187 26.3602L28.3187 20.9321L23.7544 20.8438Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M3.69104 20.9321L5.28117 26.3602L10.8467 24.8289L8.24551 20.8438L3.69104 20.9321Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.5327 14.1108L8.98181 16.4568L14.5081 16.7022L14.3117 10.7637L10.5327 14.1108Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M21.4576 14.1111L17.6295 10.6953L17.5018 16.7025L23.0182 16.4571L21.4576 14.1111Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.8469 24.8292L14.1647 23.2096L11.2984 20.9717L10.8469 24.8292Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.8257 23.2096L21.1531 24.8292L20.6918 20.9717L17.8257 23.2096Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M21.1531 24.8296L17.8257 23.21L18.0906 25.3793L18.0612 26.2921L21.1531 24.8296Z",fill:"var(--ck-brand-metamask-06)",stroke:"var(--ck-brand-metamask-06)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.8469 24.8296L13.9388 26.2921L13.9192 25.3793L14.1647 23.21L10.8469 24.8296Z",fill:"var(--ck-brand-metamask-06)",stroke:"var(--ck-brand-metamask-06)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M13.9877 19.5389L11.2196 18.7242L13.1729 17.8311L13.9877 19.5389Z",fill:"var(--ck-brand-metamask-09)",stroke:"var(--ck-brand-metamask-09)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M18.0023 19.5389L18.8171 17.8311L20.7802 18.7242L18.0023 19.5389Z",fill:"var(--ck-brand-metamask-09)",stroke:"var(--ck-brand-metamask-09)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.8468 24.8289L11.3179 20.8438L8.24561 20.9321L10.8468 24.8289Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M20.6821 20.8438L21.1532 24.8289L23.7544 20.9321L20.6821 20.8438Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M23.0182 16.4565L17.5018 16.7019L18.0122 19.5387L18.827 17.8308L20.7902 18.7239L23.0182 16.4565Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M11.2198 18.7239L13.1829 17.8308L13.9878 19.5387L14.5081 16.7019L8.98181 16.4565L11.2198 18.7239Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M8.98181 16.4565L11.2983 20.9718L11.2198 18.7239L8.98181 16.4565Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M20.7901 18.7239L20.6919 20.9718L23.0181 16.4565L20.7901 18.7239Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M14.508 16.7021L13.9878 19.5389L14.6356 22.886L14.7828 18.4788L14.508 16.7021Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.5017 16.7021L17.2367 18.4689L17.3545 22.886L18.0121 19.5389L17.5017 16.7021Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M18.0121 19.5388L17.3545 22.886L17.8257 23.2099L20.6918 20.972L20.79 18.7241L18.0121 19.5388Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M11.2196 18.7241L11.2981 20.972L14.1644 23.2099L14.6355 22.886L13.9877 19.5388L11.2196 18.7241Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M18.0615 26.2917L18.0908 25.3788L17.8455 25.1628H14.145L13.9192 25.3788L13.9388 26.2917L10.8469 24.8291L11.9267 25.7126L14.1155 27.234H17.875L20.0736 25.7126L21.1533 24.8291L18.0615 26.2917Z",fill:"var(--ck-brand-metamask-07)",stroke:"var(--ck-brand-metamask-07)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.8258 23.2096L17.3546 22.8857H14.6357L14.1646 23.2096L13.9191 25.379L14.1449 25.163H17.8454L18.0907 25.379L17.8258 23.2096Z",fill:"var(--ck-brand-metamask-04)",stroke:"var(--ck-brand-metamask-04)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M27.6806 11.7552L28.5149 7.75041L27.2683 4.03027L17.8257 11.0387L21.4575 14.1109L26.591 15.6128L27.7296 14.2876L27.2389 13.9342L28.0241 13.2178L27.4156 12.7465L28.2007 12.1478L27.6806 11.7552Z",fill:"var(--ck-brand-metamask-05)",stroke:"var(--ck-brand-metamask-05)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M3.48486 7.75041L4.3192 11.7552L3.78916 12.1478L4.57441 12.7465L3.97566 13.2178L4.7609 13.9342L4.27012 14.2876L5.39892 15.6128L10.5325 14.1109L14.1644 11.0387L4.72164 4.03027L3.48486 7.75041Z",fill:"var(--ck-brand-metamask-05)",stroke:"var(--ck-brand-metamask-05)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M26.591 15.6122L21.4575 14.1104L23.0181 16.4564L20.6919 20.9716L23.7544 20.9323H28.3186L26.591 15.6122Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.5326 14.1104L5.39897 15.6122L3.69104 20.9323H8.24551L11.2982 20.9716L8.98168 16.4564L10.5326 14.1104Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.5018 16.7018L17.8258 11.0381L19.3177 7.00391H12.6921L14.1645 11.0381L14.5081 16.7018L14.6258 18.4883L14.6356 22.8856H17.3546L17.3742 18.4883L17.5018 16.7018Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"})]}),Coinbase=({background:o=!1,...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"10",fill:"var(--ck-brand-coinbaseWallet)"}),o&&jsxRuntimeExports.jsx("rect",{rx:"27%",width:"20",height:"20",fill:"var(--ck-brand-coinbaseWallet)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 17C13.8661 17 17.0001 13.866 17.0001 10C17.0001 6.13401 13.8661 3 10.0001 3C6.13413 3 3.00012 6.13401 3.00012 10C3.00012 13.866 6.13413 17 10.0001 17ZM8.25012 7.71429C7.95427 7.71429 7.71441 7.95414 7.71441 8.25V11.75C7.71441 12.0459 7.95427 12.2857 8.25012 12.2857H11.7501C12.046 12.2857 12.2858 12.0459 12.2858 11.75V8.25C12.2858 7.95414 12.046 7.71429 11.7501 7.71429H8.25012Z",fill:"white"})]}),Family=({...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{backgroundSize:"100% 100%",backgroundImage:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAABQGlDQ1BzUDNDAAB4nGNgYHyQk5xbzKLAwJCbV1IU5O6kEBEZpcD+iIGZQYSBk4GPQTYxubjAN9gthAEIihPLi5NLinIYUMC3awyMIPqybkZiXopc+xz3pvOzD4rlWyascy2VY8APuFJSi5OB9B8gVkkuKCphYGAEuoZBqbykAMR2AbJFkjMSU4DsCCBbpwjoQCC7BSSeDmHPALGTIOw1IHZRSJAzkH0AyFZIR2InIbFzc0qToW4AuZ4nNS80GEhzALEMQzFDAIMxgzMONWxgNc5AaMCgCAov9HAoTjM2gujicWJgYL33//9nVQYG9skMDH8n/P//e+H////8GBiYZzEwHBBB6G++z8Bgux/EQoh5AfkbzYHBtBUhpmHBwCDIxcBwoqIgsSgRLMQMxExpmQwMn5YzMPBGMjAIXwDqiQYAOQZcLsEClb4AAGmfSURBVHgB1b0J1G3HVR6497n3/98o6Q0anubBludJeAiTbYwd2gGC6UACBFZY7gVNB3CaJEB3VhbQhNW9OtDQkAYSIOkEGhJCGJrEBGzJkrEsT7Jky5JszXrSexqf3qw3/v891TXsvWvvferce/8nyabrvfPfc+rUqdq166u9d+06pwrP+/CHA3AI8RQRmqFxbyRliVdpcSQ9jj27IASwdAVHVxi7l65hcZAn6NlFdOOce4vCgB5Fc5iXdiN1abSFP1/2PrRoUtiYR/Oy9C9Tr7EwNVc4pwojTDFxC0CMI2nH8hwlhX4D5ZOvWwzy9cHlS8FlzhfwZNlyDN2pPlSXwT0VAtd7yTL8+SDuHOvCzzKdyOButIeuj6HfpTXtu8Ew3WD6NpjnALnFuI1IPB9GK0n5ZiCM9H4GyTJhLqAX1GHZMoJK70Etp0tK4nlhLqBfQF08CFnAgPrN8SHMz0N1YmjluYGwNKDnSeV5DEOnttHnpZ7fKBDyuWJWUHnKqWLUsgyaJ4WbjT2nDv56TCWL6gaw0vklrAv/vpD2mNcWrTpAI00+H9G0G5XWU/1gs8fBSCM1gMq/Y/d9BzD3WiqUpS4zQakyBkDQ6k7HQ5uZi4CgQepphJE66DiuC9PM57lcpsU1auA6Ul1Q1S399o6mF1qXFDq5NbyHqi7QoBmZ5wp8wdn+3G6o6qifRV0vQ3QtbxGwPUbT+RSXeEj/NiUyqQwP5BaIOw8Gl94HAwTKS0viXkk1fejeru02k2+jrNb1gE7d4GA7YwtEYYEtHyhN0HWh6/Q7AQV4bmidPwzDaF00rbpdGnHQqI+vh26LoPjNdQCi3XeAlL7zcaA6g5PYCDBqMup70xahvpK2DkMACmjVvc4904EFApL08dJgAAxVUX3OTEIlFcYYigooPi9fZ0nPtCj6fKPr+2MSD+fUARzNDBCJ0yBR9ZT6qjKC8jRImcxfvuf4b84pLXBdsG1bG94pLSL00i0taHpdP4rv6XnoOiut1aDSaCyYI3AV7aM29KAyc1QwNqSyZ5gHdEcM7kbyaAXfmOYg5vaF2MrQxCzFGFZ3Oj9dH98xPc263t0YQKAdPCA0CHxn1CDo+Z4ysSQvrovTPjkksHCdoLYDtOpCaY3AAZgvYBjABFShWdGfjs7VKcepugSiS3dK/6vt80HHUnVfalA4b2CHDROCG1uDmM87dd4Cgy5HiG1I2OB6uwEC9VhOhxosytZrSSAg2nU9dZ2wRT+MaB+mXwdtd7pD6qJA3ENtQCOxAYZ2d6M+Y3w2dQEL9rntQXXSAGOaO2f+zcACGZVwMRJZ5QtULxE+/OvKHAvTFhMs7bZx5XyOVNZg7kAxT0nkTkmNVNFunoRz6rZXKi4xxvR2YhoDm5ntJRxxroJhBMQtIHe+vj6e8muBTMwKJgFqg/eUV0/8aNWnWRfn/QBV/gDUrh2w0Un9PZMv063axEtfXxehn/JhgdNzHRoDQM2fWiU12Hb3OMyV0K3KeDAbadUA8AQsIDqVRqS1VndOOoCuWCBmIavgdE0MI/D2JCl61eAi7RSYWVWO1Rddp9QN7evQAnk5tJyRUgemknQ6rgMfyozyoNHqfTDo1PWAtkQWuhttxveB6lDqpWtQz7XG0HTqw8fNFF3mOWU+5eKcRNYSG6AN6qk2wNHZKWJPkgqQHstSFZxUpvOJZhTlNaHryQig828AwBFzoFQ0MQ8ziDOYMTGhJ6akhq+gnjGoYWjD8YBEQK0GFbrjAYyD2AAhd6KSFQNZQBCcOMDaTj1wfahjgjU5pB7U2B1UbcPqfCDJuC6qzYxWTPGR3xPTBqm9dD1R6gLAHdO2SSDaU6MJX/u+CA3XMWdES0edk6UzUr14nNDxs/QrfnPlANBSnmkKCsNTQ6gGk+r1A3uR47ykggrmibrWcRbQLOGGErEVqkRT6jjm2qtG5/MJAXwGwajApunhB0QODFrTtECd03VWwmk+1QqEobnBEjrTXkDOkjkBYUIgSHGmkyIaST/wCuCQnk4ETW2TBOSBSei1UkMDcJlFkBBPu0mhnwA6I3BO0nlMs574SrydoRt7Qe0A2VRRYDbjKIVRI6kpvpgcaJWjrkCnC8Wh50I3rkhhdT1RQJ5AZaIBNjZUdqOHDtSub2xEB+5YTpSQM2ApUk0PaA0wEF3Du/qBBcBE1Vnbn1wXAKtxuNzg6qCBrTtlp0FO5Zl0YMHMdeBfDUoteSe+ftxhVVov3TWPQNOv24bbIZ33SaOU81mU4h1pmBkdPEBE6rg6yLgIQAb1fvAbPF0UN5hY0b3GxI+AWYOXwTzRYCYglHN7TzPQgDoUM0QTUCUrSzEl4bCaGTOodhoDPEvr9Gwo5kp+tsOB71ZLpPpb6DYN7+qLyBpJaRwYDqiCrouugx8HxLqzNJ5BBbnutMYT4iUoCYNkBhWTCJrmoBU0heaJ/Or2BlUbMjWAgdww9aCAWOoQUnukMgjY8VgHEBM3g5qvCcAz6vxsZg0EkBIOmsfW5OCEKpGW2PMkM/fwdD51gJ4OAA71GfRmS2oAa9MOJxpIMkOpeJZiufGKqVFUNWSmiS2HKObKhJiuxw8AUMtnerDS5U2nOh6gdMD1YL5hFZYChfpbxwDa/scMBLYnRf1C6aCdgF55CAhMpmWx2vBm4Ad2LMNAnrTa1LW/RkVQvz0SqEmbzLDSOyOAI4E4CyqlTGYAYusz9tiG7uhX28/efQsNoFsJ7aTVIjNDwAkV2CsUxyCepgEIn9MzU8VII6mBTZxu0Mm4LxZgFk9HH9hOLoydEUNnGeCJjpAlQxo4zrB6C/TslkhodLYmWM1R60qgRjAdskq5CuiuYkB0pAZzoQVIqiHVAXPdZoE7axBg8AAraFDTL41ATVsyLRMPaAJz4k+HOJDURZr7+tiKsJZhM7AnwTIjzZN+14nvqdz19BsHjetprBH6iq0krWO8ES5OUouzAut7MQxs78qbagaAIV7hSR2+FwuDSBJPiTHTzsalgqY0us73FSgK07vCQG0OKsIDeQuyT0M1fC82clFjEwZ1aphQ8u9j3myKGFCr+gFJBRiRVtV0AiPhJtToDPTKJwvu5KGRupBUyx0T2EYO1VSCamumDjkDZUqxlA7VG1AHuEPtqr0YRiKHInSqhq0dtQ7WM+VO42DtlCylCdgzoT+QidFl4dLFmGw/0zQ3BvqNQM64i/HrDNqgXsrCOkcR9GA4uPc7FKiH73JQZtq3DNBQXQrMGsgGxJHQBOQVD/RScJVwWCUgWEEjhBYGBlHB1b5ij0Yqm+w1sTeBwIDk4bAN4AdTnZNqbFMycLWZNAUwEk1AQLDNT5PNL1PtSH+oSPbozUgDyYAqJliPfzU41sksYcnNklGm+509WQFNNjSoekDxykwRlLSm9KFAll18bIYBtbuRNsjjGDVucQIl//ZdHiCugRWWeZzUB4lc122OzMnqj0elVVEBHxRd1YbGxswSWneOPrRknjgJzQBeSQXEXlriC4jzgWAGi2xf8UBjU6zohaurcPnmzXDhpk2wfTrN6VJYiww4urYGz545HY8z8FQ8nl9fJ3VTGmad6ElgTnlP2FOAIICBUAEFaAFQzQ0w9r4e3IrXgyVYKEp4c6J902a4YssW2BXrcIGifT0mObJ2Fg6ePQvPpuP0aTg163MjBCqnF7o7GkwFMg0YLKTaMZCEZ5+8FUwMYgxBBniTGDPpap0Sz/PAkbr6aqR9T+T3ZYnvkfYdK6uwQoPztShNj6yvwcHI70OR/wfi71oocnKSNVDRmKklspuuLzRnV12H1L4I1P0K3mKesZoQLRAxwQCgvl0Itl49COKNIBLhBM5tJ+2Lbb+z9zUXScUgJRBHBqxgjVtByEcBeKxsVwBfGFmBsDsy7y07dsDrLjgfrti61fiijXoBG1Lc/pOn4LaDB+ELR4/CExHoE6h2bx6ksInCg8v0r3MAgDqZoDutsZs7HhBSJ8y9IsDO1RV4285d8MZI+1WRdmjQPhYeO3kSPnv4MNx97Dg8d/ZMAW/uOB3Z0oX2DBJkSVht7p5MFxYG0oaBtARWLcJ1wcD+4BA73Ap89a6d8NadO+G6bduk8y0KqaxHnj8Bdx45DPcePw6HI8iZ71nDTAqPOnLfFewEKLosZDv6LCIBtmfXjwCbQd0pHgplJJmDaT9Kt+MjHwk8KzaQ0NAYAPJvNicSgK1kLkeXpfCKiqu2NKu3ItleFpn4zgsvhOu3b4ctkwm8kHB6NovgOJLB/cCJE1k6BG50UDNxoQ5okMSz7rzae6HtzokAuaS7LoL37ZH2V5+3HbZON/w1mwlnorS668hR+EwE94PPP0/mRPWArIdgBl3F2xGMXz6HUA2PjqU0qAF3KGB/VaT5a3ftjkDeAdsi7QHOPSS+fz7Sfnuk/eHIdx6j5MkUoj0da3Tocx233vO9XsxGGUuE6n/n+vo3FLOpvDMCWrtl6mDASWMA671g4HYKzPE+S+gVksgrnQI0VKYmc+JvXroHXhGBPO06eDFDqmgCx588+SQ8dupUUUuIakDGDAABM1uKqEAsPmg2LWg0tCNKte+96kp4RQRFt6REWzakBrvv+PPwB/v3Z9Ok0A7i1eBJojqrCKJ1St1BNA2bUEDSOMTEF0VT4u9ccTm8MWrDTS8y35O34gtHj8EHn34q0r5WXHohmYAgIE6/ZxuA1qBOgF4nQK+HOljWM6UMaDZD+Bp33Xxz0CaHnhmc52NOYNbSeVWBd8VdywCQ7Ll3XXQRvOfii7JkaIWNSosxSCVb+2PPHYQ/fvIJksQo7wME9aAfQ0xATUJAsTETs1L811+4G755z55RbfJi0v6JSPtHDhwgW5VnRosZUj02QTSOJyKra3LzrcZn3x35/k2XXAI7VlfgpaT9yNnE9+ci7c/KmCWZSwLoBFqwYD4bO0MaNM76XtLMwIGaB8TpnREqS795mTvurltuCaJuQzBvvlW7y87wMWjT+aoyMzKQs6nRxQFGBfOUpNv2CIIkHb4q2msvBkOXZfDnjhyB33p0b2Za1j7Kfg5gvTnFi6EnWbJ+jwDu4G9dfjm8ddcu+HLSfmek/T/t2x8HjzOlaQqoxdMR9Dsiyk/bFzAngfM9V14B74yA/nLRnvL89KFD8B8j7Wtk+qUB4zowgIskzucB5HyNJHO6z+aKMT+CMrNC48MHA2iwgz8D6K4TG9hIZgEzCLg3sX0NNOqMBe6Oqu6HrrsWLo+j/40GPSgcY+BY4LTPxFH5P7/vfng+AmNKkpols6TDAuKJPFsAcX40MX7k5S+Di6IHwOcbXkKaOSTT41cfeih6SNbFF6xfudQ0VDdnAcN5UYj841dcD5cpvnvazoXmscGuj9sXTb5/8eBDcCJ1yA5zR0yS+GwC9qzPQD4DUCV1qCA+21vTQ3zxLVDT0XkwyygZ3bsWQC4eBOuLJjuT/bJTSsv2cpIS26YT+B8jIOaBOcw5ACzzwxLpfdqLIxj/yateCTsjLezDLrOWoUz6xCN1wNUcTxM+8cGdEcwfePnLDZiXpWEjNM9Lm9x/P3jttdF2n+aIRHv2HvFv5j/Vg/hfbP0p/Nj1L4dLI99btL0QmmHJuOS+/PFXviK6AKcZC0lIVCFZvDlm4goAzNt/+gDCKGITsymY2Vk5x6HbLoOYZv8Q0cyUsSuLz6eB3paKPWwaH/yxCIjdDhAA4yB8oWEsz+TT/tFIy7YotbJ/FoqfXA9icx1K14etUdP8wHXXRdpXR8v5ctCdQgLlD0RQbyVbMQsNHnhD0pQdTV4V03FTbKvUEa9wbkRd1osdxvJMwuSHIh+3RH5mUCczKJDQwzp/IJNYIRiBarCovEwcPE6rVG4k4BlCfmlHu4D8Sy/sh8xqi1Tf9111VXTUb5HWCvqAL++RQmrg74r2JKT3B/o+D/hEYkDxj2fAxOM7or1/6ZbN0lhfrqMfof2yrVvgu6++Kr8TAQQMkWpQ/L1pliIB5TuvuCLWdcuXnfYW3SlcRXzPcQqU5lVWsO/PdAp7nZPMgxluCnV4pG1JgIGETrf1K5R62rcQRUzNPE1+xB7ee8nF0c+5SzLVFQwNTmuwvxghjFy/OQ7s3hcHeOkLizRb1ZG0Tu8cYF80y7suvhjeSIPXVj4vEomjYYz2115wAXxDpC3RWKamifaYgGl/T/RkfG30j4/l81LS7vPX52+LfH9XpCthIwuTAFkay3Q8VN8/v5ZbDmhaDC1wdwMgq0FhzdD2EHnHFqDOygHbL2UgtXtlJYOCy9Ijz6B+5RysGmkBeyMNEUae4eu3RffbxXGKOvFWXm/MXoEeLki077lk8Py5gOFcaB4rj8+/Mfrvz4/2cT8rHbC8OlDAvCvOuL7z4osG+W2E9hdCcyten39LpP3S1U3lDUEynXhsVj+WAPNujFgIjEXKK3umDCaR3zdBaAE7hQ6UkR7Um1dQ3+LStk5ShcmX+LejykvA4AoxOMNYhdGCXqQ6Abtn6Q3LHbAgPvnA33fl5TCLo+9AhfDvt0Xa03sNPh9Ysuxl6Fg2bav8RNu3RA2TrvI3lUR3mtj45ssugy1q5u/FouNc+Qzu/LyIif82mnKJ1uyfCEraOiBrSZzGb4IxJZH1dQG2KlQjXq7pqvYO/Uph8QTwb5J2aaYnzf69Kc5E+RoGOg/+gJGggM00eft7meAZy9evjur7+jjb10dQJ2CvR4l37bbtMf78QVqfz5crjJX/hl074cpol84izcl0Sr9Xb9sGN+zeJWm/krTPK+/1ke/plYdEM7/fzC9KCZC1V0OeVBIZrEbnIINCbTvbN++GtrQBNhFUZqSi37CfwTuiAz+5YzJTcQnGkgTmY9DjvfSmZzY6uHRF5uPN0aY7G8GcfaKR9q+O6ppnE33ar/QB7vyrI5+TPbq2Pst1+Np43QLyV5pWH59ej/jr0aRLUrr40QO9C88vMhG20L71yVhMQeNUBzOZrxN7/Egvol+2oXMhGVTllcH0rsCbd9XB1DKAA1eWGRx6JKrE6MySdm+hNCPlJkm3ParB9HLQjmjbXRslNkC7cb5SoQWQFF5NLxYl2tNk1us03+ErS/uA38Eerzv/fNgZ+Z60S5bSYSg8BWuUZwuT4OI6j3C9iqjpHfyk8QNW8Zu+8k3S+YZoamzuJpaZDqCtwd4ouAFGvR+BEjMjFqVtSY80A/raHTvh9NpaNjW2OvtT/4LLw9/zYUEfW5i2Va4+ki39mgt2RNrX4U27d2fJt0g6Amyc5jAvrQYqzOlMzgmQbOmviTRnKd0HSay/jClvWllvhuDVu+1kzDdyQ//1lCGpB21upJ6WiHt7GmEzfaqiwgBo91h9T38q5cOoaYJDcoNKp6vg6bkhejwSU18f7U//OuY8UMwDzyIwLpMWRtLo+K+6KJlM6/CGSPsi8J4rzfk6WN7XT9nASqAlAueb3HjrNAaQdesIECZbusWYRBwvrJgcPBhEhwh1qW1oLUoLcPpsbqR3Oa7Zus2+orlMMOIYqKcOogwdfHPgs2ZzREVpid2i6Yrt2+DKaGpcFgcqPixdh69QuChO/FwaeZ7q4MMLpd0IHGXmedNg9Hn368PLIs83T8qSDcnlmIM1ksupLgRdMu2hQ2wsY8CJWnlnFcCfvDCxxXZOg5Mr4/RsNufnSEU5H6slMasPrmyowPb0ttKaHsGnrYehfLz7/a98BWyaTJqS8K9K8OSn8+Si++HXvUZo1/LmnGhXHb8lCJfOM7QvjQ0cC0gfdtx19BgNxIORXg0cm3P5rhBqvQfvcmAjgzCH2rKEVcgumEs2bR6kNwM2fQ5O/XFd+grQfA9hYBer7IRWbUMbApwo8WYIh0u3DT+d+qsEZg7ebEjh4q1bBvc3Srsx/RAA8RyedXlou9nPMbBQ27N5c563KFI6qDqotwiDbetyUgnUpE45A6uiw8iKlvy5ePksP3+wG4BeVezzSygepIqmltC00tql5xNDiQNry+LQeQ7UFXeKAYeGQUu8ZVTruaSFBenH6FgE2IV0NDr9WN4BRm4w/9Hauj5/LZUlPQmqHXFwuN6XGc8cJ5KvpA668jqP0OZANTmCRwC6HqJBXpbVKgPR4ktMZsfO6LIbY0aABpBhhOkuk7JiZTud1BXbWTSqpeq0iJBmXxsN55J2o+mXSQtz0hqgIcylKbQyGbFpwlhGMJBBtU2gzNjmla7y6wdxcIjsqXEfwQawcxojKqR+A4X606QqDyxYaPlXypzX880zVfHgT96NdG5wtRJllmVogkrw5/Ix74gEIddKEyXWQqg2dtBV9OmXCBtI+pKl3UhoDZxxUVqvQkbas4X3VnwrTQrJbzyjl9nSnbqVSC2B1zSEUZpraVO9ZpgRYnrWAvVqOQRqqMtQycIuDTUwhmvd+42QNBfjjGlpHNTPeomsymxJa/ldwgTxfWHs2WUat5UNwNDEOJfgeYwNXrQGS0IDQ2OJCmi54mmw5myNSD/5S3bCDkthvY43Y80WhgYAemZX1uXwRJjtD/ggiSrrytFUJS9Ntdb3g3zsicqfajSo7AgnWjakUV9OOiMo6Y3OjgtOKyiEaknuA7rGsDcd6apcHwZAddoE5jy7LMq9jdx8BNtpuYFawqiBfwFmq6eH8WLzvfTuD+Mnf4zc1wWBAjWG4C/Ubwh9EEB7kMivNkEALLAlU6xfIMfrQ2fOwrygwWKkMcVBsCCE0KDNSxmVN5Fd74V2A+j7Uvw825oBho1ygorXtGObJtN/VL76PuCweB1QlTsgtQHkwQCYCup7MJqMXzBbpKX0SQAYdGauc3BpMAyzPr6+Jt9FzqROdUGg1rs9GZshGHwyn6ZjBGu+lAWoSwHF7KjL2aaIQIXuP3lCAGEc8uAq54HrCmaws1aQ4FoX1X2fDUtIkZbqIS2dg6s8qvOA7lmwwJdrBa65aVs0jKQfpNW9YSRt0M+4zqo7aRPgUPntaWNBpNtM918tBExnVcW0tG+i8eDpM/myeMxC9p7NNNbQdSLXiX2Y2loHVwt+URTM7J9soQCgtkwL8PCxYzZ3lrrQICLYiqP8aUgc5rCTKMF3UXAA1M/qcnF4v2VqoEqLwdanNXtViXb5jkk8Fy9pcTytpFEAb3ouNPhCOy8BH47w3AHID/SDa191a3BtOmX9gX0nnidMlQ8VeACY41AJR6jxY9u7pTynLL7NGryZWDRiP73SVwqoawLnRbiB4xAeTUtYETe0lOW6hFYtVY8HJ0m1JNeSkxvJ8XyYt6LBgEpJHANULdl0owebdlAejv9ii8hGPSUtzEkHVnJL3Rp5SRZhPEsxl9x90xah/SxHDPgPDUHUCEWDB7jr0GGpOO/XUsZpYCS0frfHrO+dC6x77ph3OXSFmkcI5uWU+hJRaeWT6zP40tGjlWBVcZM5MyOoHti6Vs9YOmqcgF3HaSkL4xJSD/JETTcaEjXQwdWlBdRBy4/ELUqLjfLcuQGzT9voOIYVaNvItEGjOAN0V2xwYNHtxGj05Dx8/Hgcd52Bmiw4XLmX0EKbxRrYHYQxTquKgj3MwuEApJbLikS3PP1UW2L6YlABERxjW+USsz1t6PI22l9JNX101H99fOvFG7nm3wD23V2+9s/jgrRjecNIOWP0wkjeisd8H4iPqPjX7Bz+NrWFFgAtkOnnTMBKiw4f3L+/rBFNpq3BWAB5+V+RaPvpYGYo1Hc5Br0xhCaIZcX5YFe+LEtsdfCnjz1e1mv2EgOlzLoCaF/j+De4Hu4ldx+cNACwkhpUgxIgOK2Ol3vQAAo4oIzdw0baMPIcNs7DAqAvQ4dLq4OPF0VsUNEGS4ARgOs2ChbUrUOeDWDGYQkjH3v6aUCqgDYtZgrIjDcWnB6bPgxXS5TBoAO3KhChuurqCv8F1M+cOg23PPkUfOtVV7KWg3pSOaMlMmgm4zDeMFeBeHRgFm8eiAPUX/uvN8Itd98Ljzz9bHmJnAYdQHUCfW5Y0GKVC75OX4GAjgGI6pdGl3yetNLVl1wE3/yWr4L3//V3wJ6dO5qg5mphcKBs1FU/Y9pUxfPGR3oskU4/8sST0YlwHLZu2SQTI7LhKNTtLVodRM65/VT81NOq24l3nLITLOU9Dl54G4mxefPytIfKpIM/2/84vPuyS2HTpLG6KDa4xyBtiASHU0D9S8/pdk2ndzyyF3783/4ePPzMgbL1wuoq1YfBqlbsDB7AwXSa5cKLhWzceCqsMSztUF3n866k2H/4KPzGh2+Gm+66B37m7/4teMdrXmUpZyk6B+iDENrxnkYvqz74+OMZK2kfFiD8yC6yAAN7uXo6lM0DNk0Kxm3H6omEtAUwsi8aRUqXtdgrqvKn5t0EbjvwLHzi2WfhGy+9rPoudal8GhYzh/2ixdNimSRpCPgp7dNHjsBP/s5/gMfi6HnTls3QTTrgr9eFKUEDur3Y4cbDQMYtkR4b58uHgmVU1ygS0KwBR+Ixz8LF2ZS9Bw/Bz/z7P4Y/+MkPwIXnn2coCiOdOYTlu62ZA9BgJto+9tRTcMfBg9CtTq0NjTwwrGt56y9jqmljcaf5YTYNkiZBNhXQVLIAuSxAy4tts0rJ2wuThJ5EUP/SPXfDDbt25w9PTd6qsAANldaQ0uLvbIlrVaf08zt/eVtssCOwGsE8XZlGQE/iDVkCR9nwQWyxcnPcLvurGgyUFS9kKwoAMMsApO/30nINa2uwL0rrf/Whm+Gn/vb7hnVWPAdoyqMBDUGZE14ia1v+udOn4dfv/SL0Xfr6e5K1esDi/O1J89e9cJwLD6qQLQJMVZqk8HSebPAyJEAFcJbUNKuTpTP9TiKAJtMJPB5nDX/v4YfgR1/zWjOy1p0GWtKAJQHdN+mGnXLA2Q994V6YblqBlc2bIh0rmR7eT4VHzWIfkqQmWQ3a1Pr/Q/DbaeQ4GvnJFhRpu7wcn+od22wWB+y5k5+FW+970OQnPGAB4u61QmgkYsmsaWP6/t9H98IXo2t38+bV3DbscgoaxIRP3oexVtjZlp4W0CaH2BlhUEGZfqSK9iSlda8pNkiXiVxJ77hGSfDvHnwQrty2Hb7tqqsNogNn7mgzQlqBGHUicNJApU/k7z9yDFY2rWa7eZpWbsoSgF5L5IKdk1zAremDNsMcKXNDeInSChFOl5PlXPmFtF5cR1I7DeLTNlhpQ6J4/vjhozUrJYb1Ng/6RGNA32e6/edP3u34l3Eg+Cv33AMrqyswjeOrpM2hKwLH+J8DezawmhoIRuhUPljMmlFbq8FEMoeqzvI0JZQtEpAkXsZzUh1RVCdCp2m9iPUz8M/uvANu2L0brti2XTJHpdKQKiGMUi1rOr+Xzq4XiPaJHapLpkZaS3lazA1WU9zri7M+iATQqkyX5XnDHaf1vgNAm4e1OkPI6mLQp9WFjKBd6hwqoHl5NqzGdH5c9u7uijadRFCtr88smMGaFyw4vAbVNDNtehZVDgXmJ54/AT/56U+RwEuAnkRaJlmjyN7lAOKA6D0tMAR0K24KDZ7lc2r0uksnmvqwlObBGm+VkBmWiY5Xqz2cOXMWvufmm+DfvvNdcP35F9AmkZYo6fTEiWDfQm2/3O2AzDSD9Ppim+XdmEKdgSrbKBd7LZUle3SEYkblvLyNpKSSLns0YCsNbjytL9NlgQElNQOnjHOwbBQPdQHxkjDfibwJNOZB40vWRQlQwljZNVp2/3XWAS/X9cSJk/C9N90EZ2K61diRVnhsk9sIaG9G/R50FTS8G5h8Fui0g6Y5hc7c1IMk0lu5PtTVOHPvpzbraEQik6E/nRbTI1XgWLTb/v7Hb4UHjx6pPVcfjpONCaAB4b5Ckm9Z4zcDOm+yQwxjpuV9s9PCuVi2HS4b8WBNg/W8z3sFduZ+jW/FdYP82mnxHNI6OmIdNK25LnIfch3T/bQ7a+nENW1S8XkgNumsKefaQeJY7atGD475DH7pXJTggcOH4e/d9JG8WedqBHI6knTuJp3gSBcZNB3KzNCf/8EgroYpqFGwF0b1RR0U/SNTkYhkhvB+00XChdz5yzYDsBIonwDPnj0N33fLzfBPb/gq+JtXX2PVujNDRFqHBoCVamtpZt2oxT/Oe/uhbFzJEkBLAlMO+g7TkK7YkKI6rWHkBtKCq5BPjzpLvbBmbT9eLVb+kOTgvbtzW3WlA4ArqmVe6JccXbOZKqA7v3HfPvi5z34Wjsfx1OYo2FbjuCZJ5zJQ74rggerVYJdw0fb1qyiRcoxB3wkVhqfMS6cxABrXtQdVYHPv7aUiJbfiwpvStG5B5um1s/Czd3wWnj55Er7r5dfDedGW0iZIAMs548NWNKBOr86RmUEHsIQOxcyozvsuL2ySpTiZF1rFNqXPWMAN3NtI2kacviQuS4fmMb0AHRU/gDs6zR1QR2cV7sHMJsigo3s6sJobYi/H4+jZM/DnceLkf7/jzuzx2kxATho7gVkPTGWvcuqsUi7jF2AgtT1PNG3NhWYM0whY+VyjP5SlDMoItPai6oHA7P7tphORGskaOLO2Dr9y793wx48+Aj/+hhvgXXmd48qcAahYuIVKQ3A0GymtGhDZrMh7pPO0Kt3vOqG9NCC9P0CACE1mgJK6MB40gWGDaeflrdIiEYNQec03i2sVqRN38tyMUicu9L6OVDc2LTy4USdDa1boLD7zzDPwC5+7Ex46djSCeKVI5vg7mRavBsrYpjzBZoN0Iqz1GJC3iJfQeJdDp8fGRVCMqB8nltlEFv/lHY+ySHXeeWVSV2fn7eGeOnUK/sFtH4M3X3gRfHeU1u+4LC0yPjHdrSWB5VqBWDc0qywg27MyivbHBm1ysJkSiO7CgaDz9CDrGvdAXaOLgzlpfZqxMJJ3BXX1bBThwa634oPONjPUmThklU6SmkVgUHQEHQfz+1paV+NjTz4Bf/rww3BrnAVcjUJsS5TKCcjpSJIZp8WrUex3EiAde6CoDEQZ2LIlUDRkQ8DAkK0pND/B4i/BRb2PqMNSKGWJaGbeOJ8M7OzIR7OBZ1p+ay322LsOH4Q7Pvks7Nq0Cb7lqmuixL4Krt+xE7bweyCKaiEFhxI7aNpp8ANYJDX7oYsqq1+r16lV8lMj2spR+lbdze+8+EVpF8VBlYrlHBWJhSPsnWHPQpXQJR3PFmY3a+Jbj9U+cNXrnYT2gQVJAvEjcYLkxsf2ws37H4f90S2XgLs1zgGsxl82MVaS63SiwUzg7IY7+labWZXnGTF2j8LiHde70rih2TDV7uGepCdoGHCFoR1lR5t2pj3Bk786VnatW4Nj62vwOw98CX73/i/Ba3buhn90w1vgDbsvqiNrxUwPbFR08UieX/EKaNcRoW+L6QWroDoGCkAss+iLHlAdRvcwGArPSh89q0yKuWkBqixqgUp5BWyfIdrJHu0oF9GgCNVTRav29B2aF314QoNp4l8Wavprnk8+9QT89r33wL0HD8GZfj0DN5sWUwZx8WQkTxeqyZMwUDGoOiWohgzDSoYhL8zkBJ2bdzncyGIYjLejlCIOfCWpAar3gPPN7xbQQjRp0iNJ6TWoWy3vXtkEb9+zB959xVVw+bbzYOvU7ketgc2VNUKVkYEgHpcisrC6nGQQRINazZScB6qBUjD15iv28zINoOJ1lNYYAezNABbYtmrtvJstQhJX92jdgUHbp2xeUHygjh+g0q5DaERw3F+79DJ444UXw31Ru378ySfh9gPPwoEzp2ETSeTslovnub3JfVqkcjUltMYx5xCknaB5rhpd45TOp55BzaCYY0ZlWlwEqC48oJdlggKNPE47amUvCMCrdu2CvxHt57dGBq120/rJTbDMNLadizNMR6RBBw9AFHjp+WK/seYJkl0gaVwYr9A3KKZVeDv5RtLOS18lGLi6IzC1JZq0ZrruCuDZwigdPNW9LLnVXGc5VPzojqabPGmArdE2fsvFe+Ctl+yBY2tn4IuHDsGH9u+HLx47UvaLx/IFk3QiZRoZ/57vwFxRb+uKhaBxOORgc1CIMGSp//5uUJBIarAtpVpCppbjvws3b4YfuO56+Gu7L8r3+c0q8I/6iwaILT1l4oBGSQPnuwGG0Kt8mxnwCAohoKU1UqfR/dkIEh8C2nuhLRPqPTRpAXU60g3iuAikPVhSS2yFeadJwWreZN50ltRgAayBDfqaeMUvqp2/ugm+bs+l8DUR3HceOgD/5oEH4bkIcp223XnRMQGbKVuxHmqcxvih7RMoX4KjtAC9DxCKqYE4LE5G3iqa7dfEsbQo33dffS18xxVX5+18jUTW57XWVkUH27HBVaA0ElKjkfM+qA7lXtDGvN1mLSuHLpjy0XGnIdeqUBkJvt04Lc5J65WgScPI5tC18iquVQSe8QVaSCYR0NkJCmJN0/8cwChvXo+QvSkyEI0Rb4ua9g07d8EfRz/0H+57nFZUqsANHQg2mnWngpDOMVRXKig8tviSzo0fuiWZwT3APbxcl0LQi3+XSa5U/HNe9Fz85KtfBW+Jg76UfBbA+D39wSG430ERWrqWjRXJBYRgjewuI0kkMNh69I1M2xgdioA5WG4+Pf+uLdvWm7UcKhMABCXycr1ko1qVToPSXgbAI4JEYYmAVuLLuiwwCJtjO3/ftdfB1du3wa8/9CAcm/W84WWdETb2L/+xqo5BDXpQDvP5JyYHKoNbZ8T3cCQbrBlAVYzCk/IhQBxa74l+yZ97zevg2q3bq2sogJHQ5hdqJtzJW0HUpLRbJ35osaeNnletzVIJQEkr1zkVHca8Gr0HTg8uEN1G1CxoLq4o6t+guF7Kqnv1odDGg+L8YlJP2qthjgXNE1ASWl3Ly0hhKGR6dfH2iy6BK7Zug5+OHpEDZ8/mWWQ2c7Rg5NP0spVwQN8DaJsc4kWisQ+03HZa2rLNxSYGQEOKq/cJlE0UmNXx2Uuib/J/ffUb4OqtWwXM/QiY5V3cMGS0x1MLQ0H21sU8wma3ox4to3JXFcb1ogvZzRbAlaFB6wE8L8zrjc30uDBv3dSIxUmHZD4hMUrkS1fbMGutbC90xQ5HrPxXgsT4oYPjf2WjlMPP8cJDoO6njUx//g1vhH941+fhUHTN5o29lamErYqhh7Adh4jJYdxc5bmpj5BfY0JY6YagdpNlVQcsjOoL88npeX5k3v/5ujfl7SqCA7Ps5qWYKcwYntbrUM+Hn2WhSCdWbahsONMiHM8vOoogx0Wy8q9EQP4rAGBxE2rHEMFdUvNsXK5zN7/niI8elHRW9yQdHR1Ld/plMi7dvAV+IYL6A5//HDyfHOFsCmqLAEBwlalDmnFW5UubaPeyEr4pzH2XgxM2l8BqPUeABQJzGgD+WJzW3hPB3Dsga6kMYNWbzm8ecaH1y7NRWkJDxbKWLEkqB6xAyA6+vkqA+XyBNuJH9eNI/EbyCPayaht1M3tVwlDFSGU64g00KyhtElyxaCV15k8Q2ZGD2NRKg/KA8cotW+GHr3sZ/MJDD2QTlN/HblW9OFpxXvVH443JYfdVrg/o32GoAxEkRCbpnDYRev+VV8G74qh3RvyVjx6DVW0M5EWgboGMn5FBEBKQlaRm+rVG4YmXOmaszn+v4kYDLhGvicZzzMPFockbQcxBJYmLAGqMfZBMDuyabjvdETS4fZPoTkpkiCFhNn2C2jbfFN16Xzp+DP746afyhBroBQO5h5hCQMZvdWIsGHb4ybHpUjzGsXviECKi6POmWRkEfssll8rdwYaNAYy7bOA6WzJ47PCAkO3o8oEsyzOa9JFrkPNiawcY2GV/BUMFNO+HbU3A6glRTwhgqKPzx6lKW0q2MJwTGITgzBBqQ7HulPmhxeh/d821cMtzB+Bw3xfes7YIunbBncHgeuzeYFs3YRS0TArbOwYVTPZzP4vM6OEfvex62B0d7t7UGAAbykyWH1mbQzEPYHhuAzUUSSFtS/M1H2VNiI4kujs6d+jnx9K37p1zWlycdkA/A6Q8i4Zm7uz10zTWUF4ocOgd7+e1j1l2IKhz/RuP7ZMV+J+vfxX0eQfZWRlrkVoWM4qaUVNWh3fYanH5nXrjXJ4USVWnseug0Kk9ILdJktDRvnjz+RfAW3fstBUMbXNDshgisxmkh/ruyT/80g37rrCtU8oFWXjKLBHN5gtONh+oPj3kay2LPAtBO283nFY3Zn15B3X7gDSRekYzQ8kxPRWKlS8esADtpgijF8N0rOwkwvHzzXHi5TXbt8M9J54v73uI6w0sr5qmQgAzsYI4tKFReTcqb9BkI7OFRtgr1RbKyjzrsxm8N/ofJzQL6D9Pp6SGgWBya7d/UCUX26kt1QXELK2okYMbrVRgFy8I22KoO3cj4AbMkRczLbbSq9E+irnU0W8gs4C4xun5fWQ2O8AKFD43g/URAHuQ61WuUnHyNT/3XSjaOEpR+PZLL4e77v9iERSqg5VHEDS6ZfYwODMDcWCC1IkVIcy95Ic1XoM5AMggsDCgz+bGZdF2/oY4EBQprA5tZoxJZ31vDNj6XkuSAgNUg5pEmbz8wxKM/LPS4AttaNUxXtKgy7Fl6rZiQAfVGUVrsqKiNmKbuZoxEzCZqnWcA6g5AU0WtinlW/4LfcEB1inzBOqv3r0bLlxZhYNRAOYPQeT9GX7jztY7SAGqrEZbdbBsUGq5UkvgTqYGSee377oQtqaPIIP+LB2Mm24emD0zlr2WjpDaU+xFqIMOusZO2dHs1tMLRstX41jvdapzmOdHDnTn89Jj49rRhnw+llbFo7qHavwQlLEs0hnB2MEBqubTkhX8NcC4hg1Drcn5azxcsLIC3xy9HrM05upDNbnE1aILC0uLkMUv+EOVxmikcwDRDInYtHliNPT/mz17bCXCEMQtZkAjDnWcEqymyugliGtoMTPUr5zSm2qctndpPTGtc4ChzD7XtO5ap0V3L5/yC0n0joShHVUm5rrUtX7eVJONfZQMYSg8WjS2Qu8S6OWY33HRRfBvHtsLOOlLpx18V1d/gzIFw5zy7KZBriba3PDACvKbattnQG+NRL32vAvs5Ik2ORxj5klnVRTRB1Vz+oQaBB3NGKRGS+9Dd0oJyeCKPkmCMnUcnA0HG7B9XfHzQ9hY1rggr/rKXnnpCrlRsIKgY3OEHhETjNfm8HlqQamiF5LiyAoj0lyPn14dsXJB1ObHI3Y6Ze4FJbwG5bNpOBKmJoE/x0Ym6CrN3o1I1FVxNihIPAzUmSbOMyHYrEcFjA4BGpJf1KlSxYoZuQzj1cAqybsRCb1IDPm0sGR6nXaZMlxDy/MdGmbkAS91Ho378kxXPUHs6XBFDMqcd3+cTPMrOLCkwuuiR+y2o4dpJ1l6E3IseHzqXwplYqUlnRq1rMCriM5xaZnWKH6v2LRlkFayCENmhJFffW56Png6hs9l6sh2lKqoypeGxkGvL14P+hpPNXTpAG06TJpavPyMpZVztGXk5yhikNbRUYuiiSKPA9brA8mgvt6RASSozgADb9QYqNHdGhM62toRgUeRaUq8P3woC0R24dVdrtCqaHFV4qBcvh68D+0TDRpGIbMuHl4k9OVbNksluIB+RDpr4C8bWkJs8LwaELHZUdIRc9jNhUoasBpOL3KEKqnH+AKN61Zj4pxrXPD8vLRyHqrJkZtYOX+T1yC9KoryDVa5F7ind50BO7fJAMwAoxLcn7faJwV245mBJ52nwWGfPWRBFv0Z9GgYCscxwSFbUjCDEGqeY8xmKc1M6DMxPVyc3qijAoNmDljmhEa+LWAjjEvqUQZifTFJv/OLyn6uJgY/UtaHkI/vEIcEtK49sQDj4mtR5TaSFlx6+hAY5X4BhJga7JqmRkWZfOqaoIQl4lokzrsXGkcK50+nWRim9+YnQZfB4MGBK9CU5ezp5tt23r2XgRPql9wazGn5liyho4djhQcZyPdcviPXY20ZYAhkfz54hiUzYm04ig+6p2p9T/H5o1pwlQdoistip4Zx0Zry7lRaiVwi30Vp+TrU2V3UqMlx/N5KAQfS8g252syjFhe57VqdGRptRTxsC5eaxC+DwaRO0xp7PUvoOEwPk6pNQGEPsfqdEcwYQYfhV9+ukUKw0XI7aNWhP3+d36vDkBeD66YEp5tjQK51ACijfiA7ml1UoZohQNKqq2BnCnLDIwgUhm6JWgM0XgJHNbq0tefAIh1l0/K9IR0y1ymDXPvqKPtyzFOsobImAwGjBnGohGgrpkFpO4L6mrkGbW6ox4omD7Q8c5AbgiHU7WMLEY0bKgF2j5VQGhCDpdB/5lIWlOmFKHaMn+2HKzxocI+B2l+3znXP9irMlJdmvzITOkA9oWDcc7TgjEiNrvCFyK+DDt0qWHsVYKPkF5LW10yn82AucXnhHiGYOhaPAVDlxy8pM3o6GnSxJ4iYyLf1uzatxWf8uadUSg42Xg8INajX88tsALw9CHIOiA47wfGMsBhq2hRGJlawimNNpDpnYiszAhw4c8YkEGKCajMVWsxyVLTvIaiJhMqknBetDT1w2ynJVDJQkhTppKP3GNEDiIjttN5EW1EESxB1pJKKJXkD2NyKUmZXy0NVvhaX4r7p1HVQC3CoorraYbIZxhMrPDBcFEYb4dyCl7VHzq4De8sEzgFk3ZQCZWw8PcRoCnZQOC8IKIPKS1aLzoBK65uNVUKDG7AthwZFamwFlxiH9Jm2V9PdbC+iXo6KXXUpiQyqUibO5FDpLSEAyki2BIrbTzcTQlMkqLSoOWI6VWjGiVyiupTlFwIYkwP7KsgJ1IHfhR5r9OB+/fmisKDNdLGHzpxWu1yR10xWuwrVtSht28hEheZOsnriodanfjdYrtU9Sv+lo0dMVnodZzHtGrgQ6a3vIQw6pCETxqQ3DwRbElmBAt15Dp27bnFtDAXYiBnrdSNpTc92PdSnTzT2TmLnx6r6KnzH+h2UpMX6bjQzUh1sGnAeVZiBUVgGqBqwpDElmvujA3U69j7/PN1U5QGBG5mkOsAFw6Kg+Ffip/OaDsTBbXnt6CfN2MGjJ07YfCihMRPVvSwV6X6v2xOHNAVdOLTpzUlY+nTki+bGk7fu6Gl97Xs9joEWYOAC8gTMedTcHEsrrYbDDu4DWwyo0BBoYRleST4zF0zd9Bp3TSqDJUeK16BDm2asKuZAe53CHYcO5gUdDVhHtLjGoKePabSbBhGAsfGQDhrg+suHE7N1uOfIEXj1BTtECxtCAYxTnEEN/p76Ne6eMKTDS+rgpHIYvHlGQ/tOZcrJ6btCSUu3tAsLtaoOtaEZ52bGT2hScWj7hC5Hp9Vli6Zr8AD1M4VAZegkBvblDbwAMksK4qeHJhINPz24AgxNFVS0oQK/l3ooJObzew4fhsNnz8KmrZuBNWt5rBpgGi8BxgMX01x9NP/wZwdYkwfu/RDcrCpmoKRnbnrqCXgNAZrHKkiNItovDCnBFsGacfNqY55RElmtcWdEBADZ01Dqgwi23+iPZw0LJI3vqeKCd5qESGqmnZt3GD47SKsBBLXs/NupXsCjcn43lDulAnrvf0EJiwDW5Ajgx2IVzKF2QvMsBzXs+C/7HiNw86KanJXqlNJulqGhD4M4lX2lqV7YIU2NDiY9q3mkrZH/095H4ejaWT0e81ga/Dqa7L0W4+YF5eEQWxoa3+Pxd/z6+73WN4PdyDH2zaD/1m/ed4MbyXtuWqx1oLoGXy64Dx8kfn4QLUhAbbE/KNCKpFYdUoSbki0n19fhpiefzPtKopiHXusODYzABSr6NHC6eRXRBXCGrDL11g98JFto/+mTcOszT1WhCCPA5huuUF7rwRhG0Eg7Qi9wBVlKo3rfOfub6yc/SGDgOJQ0uLGjewFxG8nTHVy3vGKS1EXFq06Kgii0nX6kzduMBSudhwJSNLKAVwnS3K2IhA8/sR/2nnietmmuryWIpA6s+RXQCUDBla1De0sKHYEAowYl1M+XMO9PWDYj/92HH4L3XnZlZig6LonPODgGhhEilJrT9yWJZm4AA+QUiV1tSLZ/6/d7WnzoOo/3ngF/5oSXKq0OIhz0tWJa8YagVHXoARqRumCBGwKMaktUJWozE8DKFv54KE1x/+lje8uGUoQdmfhqcMJYCsr90vrca6nN6wcdklWPTCWhmB2JyNsPHoBPH3g2rxfM9rNIaEUTzFFVnhCDaWyrQjZ/RGNojsoBYNUE1MkHwTlaOhSfscUwn5ZPfdpRhqq0rV+X1uSlz/vWbWI+zRnJjc4C2vCzYqZkyd8aNuqi95fMbFM0yJyWO2575hm47dmnodu8iSQ0vaNNhRQPFZg6t+RaK4jJYfg1gvD6fmopzXx7lmzo1OOmUwiTKfzE7Z+EE2trw3EZDPHVbDgP7jGafLwTCbwCaVZVtF5FGIC8cZAnwHzLR6bAeNpuGN+65vRj9xalbeVtxGCNs68AKPOLhJBrYBh0QNUuGGyctB3/hNq+HbTJOnDqJPzs7Z/JGOmmK1kAajpaUleEk2nnNiQkK1NhegI9UMBKSRRgM4PSlrfRcbIyhSdOn4JfufcusZs6B2JU+TAjhIeoDo4Plr/eQtGVr7OBZD8SEbxoIxoQdEbtobI/669dtEXHDY+WPe7Tdy9aWvYu1WsHXKyTKKCAzfaoB4n8jhyadYM4Hr9ilQUTdaTrP3r0Edh76gR0ar9v+QwuI0pnVvFl5R2aejJm01/jtsMBeOuLSkGii+7S343l4vKHmph73GQ2hX5lFX4v2tJvu/ASeM/lVxq1xhNXKBnTj1J180JL60s+Ipn1OtGd6kUMZLAMFB2KhgeguFPobaQdBGKw7f0ATZni00JFy2ASpzZcHXgQHUGLTRDzA5VNwO7VIDbrkNdGcKibTQsoVHKR6sCSmf1I+vjQY4/Br3/x3gjm1bKpUPZwdCJsRKhKmSisq6apIxrrgBLAezkaDVSXX2UGQ2OmiRidXXeTDOrUA0/F6J/49Cfg8RPHW9pwKLFR52aZGRo3jJRGVQctIsTe6ZR/uhPpXJct6KoYaal4oz+7kYq8GGlV2XPpoLQTdHXRYpK0ledHp+IavOSIlsWH/ly1H4N5oorg86dPPg8/dfunIyYCdKvTMiCcVI9T0BkCmEkfng6pn9LBaOhcHUYuGDRob6OKZ/EfiUxmx2Ql2kfxOBxm8Hdu/At4MlZIqx7+1W0EXB+0jJMylQQPY3Tq4XSngQE0cKV7WHdq4nhxebmGx5EDGgduIP2yaXFeeqRBlJEWYNLXDtM4Wk3ueBoabOZ26kCKGxxT+n306BH4rg9/CA716xkXk2Q7J9OUJbRkCCQwa+sHVRY06Bs0v7s2NrLEMZPSuZ9w6RQSsdiiidBJlNCT1Uh8VC9PnTkD33PTX8ADRw4bKe3bwHTAxZ1R6OXReaGHpVpn3/vN0SVeJJh0xG5wjs5nbQ1F1YFR27rdaFpYKm3XTAsL6bA0DydcbBsBS22aWGHzQgRGsKaHP/ghxpluvwmBin8fPHwI3v+RG+GJU6cyFiarqxkbWUJrDcT0UaMHwhpAo0NhbXsfOhgBSTNoCY1Qu49Bo5bSkfhNqzDdvAqPxQr93QjqG/ftNSqJe3h+NNjyvStJ3Ejuvr7WYBYA53g1KGJpTGqbvR9GbWu1bI5W3Fj6jabFJdP6vMlkEoaWZwIOTZb6+ijV3fFRL//FfGfvRnDto9stS2k6WBN//Mn98L0f/gvYf+Y0TDYXLGTNnSSz0Aa1XRAHps4A7GBp8KEbfbCRUQUMqQP5pY8tOyWBaDfRrGJSr9y0CZ6brcP/8LFb4Ne+8Hk4G8/FAwJOUsOQeSKFg13ERjO6dLBOJFzQnc1LbLpn1sDDZQ5YMl1JixtIu3y+7WPgmlMdeCipARaqPxeUAJUsuO20kEpt+y9jG//AzTfCkX4WBdommCYMrK5kTGAyNzplP3tBKQV6c8QR3cCo9XIggneBYagP1BdPyug7u8LVtkeBE2WTFYtbhhFHjF6P5sc/v+sO+I8P3g8/+7avha+77AroqGdWVUOg1nWDOZpDh86ty6HB5cAMUD69yq3gRs7NkSnfaxHCBBpCUf1dIm2rks20dN2P01FeUIK6vFlHz6e6zpQrb0HAxq/xXiggJwR8dN9j8HOf+VR+BWKyGoG8aSUem/J4aiKejfoWpOSM5aW4YsLWOQ5U9ytGHJCVN8h89R0aFZFzLDM5qKa+q1slqNnxOmLNg5KQPB6g7K0C7Mejn/oHPvpheMeey+F7rn813HDRHtgeGSBVRD26tcQNANJqhdzhnBRj0KBqZE5jnsd2nq3zVhos3JlLqUeKxDeeW3qTG2jYA1TvvHmMykd3Wq0Ng9WGuh8PqkTnZ9bX4RNPPA6/f/+X4PY4A7geTc4E4mxukmROE27JA8ZChds56GxVG/G7JxnHlD40qleJK2G6kEdoMxGzQ14thboXAYRqKrD663jbsSlotdrHnjo7uwY3P/0k3BR79cvPuwDefeXV8O6rXgYv27ELNiW1BNbkgAXnOSgpHJRak0EQn2dSOjvBYEAwYMNyGkLS15dsFvVAk3fAdiO00vYqQlqcwMvCINU12WhZCyW7OQBPJmVtZmy6eqp/TTXo5MTZs7Dv2BH4yGOPwI3xeOLkiTj7F8dOEbwrEcRddgqsFqkcvRri0UD13jNrfmTgwiivREjC/GA3DZITBPvmfbkZ2Mxwb3MHrqn+4lg5+vOCgdk/XRo6/eu7AvY+MmEWzx+Obr2H4szib3/xbrjhwovh+197A3zd5VfDhgMDtkPTgXiWMDhJXc0SVVVss83HLsIqAixuAZ1WnczLW+LJYrB9oHzRXn4Lv+sH4gG8vc0dQX+VrUNo0Hd3lML/4vbb4AsHnoX1DsskSQTylFy1xWU7zWDOQJ6wZGZzIYCxjzletw2otmkxZKSNllpOV2cU5BoHta9fW2C1a/QX0HmwqOhR7qjLz9sE33jJ5fDeK6+BV+68EFYi+oMzM4x6GqW1SmLjV9amBzOqQ/uc/CyHQhyLDHMeWFLM40bSpj9iR6ajr5n02ZAmEzTxJdS6Iw68HABK0IfBcCCH1128B371ve+D+w8diJ6MffDnUcMenK1VIOf3NJyfGSwPeE2QodStLbwRjcjB7LEy/AwBbLycC3KJokBblWC9nVxCZdM/Mt0C8FfX2CO9btrD11xyKXzbZVfCe/ZcASsR7bNQN5rx1VwUcppOgVkDubMvJaEGt3CW69nBUDb5EUZonNM1wsj91j0Yzwtxflpt6HLaPCDsgPe8yRvk9sSLvD8gVp88DYbFdlb28wDkQVEY/yST8IaLL4W3xPb7wJveDB9/5in4w8cfgTuPxrmGSXm/pJPBH4A2NcoMZeE5GlSXOkg6biO91MPgdQAbP1w5qRVK9zbnvKwWybXKb/TdOkjanjiVlOE1286Dn3j5q+DtaR/DvgBY9jNUDB0DdvAHdyQjkbvqjyXah+48MqMKp3NupYrooIgiO4LUDdTdSldJg4oDnq817xeWlmhGereG+V2NDRnz8DYPdrJo6OUII7+ozBJjosRjJZqT74neqvdefgV8/MAz8MsP3RfnHU4W5QCVd0QARTZ+0X16pXgglPjnJEm5njZvclwYkYvcTSEM5IecZYEXKpMTE/JK6D384wjkb4/ejQumq4PdZf1Os5l/oTYoV00kCJEpzB645kDZyQTgfG1n30QikEEq/VMGEIqXUtdQCcAKtIIdFzfCRsKZZtsG0iJotMueNyqS6ShNljpzqLzocCAg+BwaUhpIe7KXk/dM4SPt9Z02rH/Lrt3wh08+Dr+59xE4lRJNwCjCIZi5HIc3w3AcxjfCYLHGEQib3o6NpQ3Mjp6uQxWA9rAj2lX/5JWvgW+95LKs/WYklc0Os6HSMSotGnGmsomU5kQJVIYydjWDU2C7us6lU77BcUP9emnirwchuLS+Zv63kRYdkynfMGhN3TtJCqIaFFKy4A+wgqRXxfAneEyxFNMVUG+N5sj7r7oO9mzaAv9blNbHs9dlonSLpxABYBykLBs8R1ph2krQAngrs0DgZmmuP60qpwhld6weLp6swK+//k3w6u3nZxNDwByUuaHALYAOlo4x2iSQe66+OwwCYuOX5tyQGQq2dTqcwxVY4t5G0uPwXFwX6l4mrZEWgpIlLKor+upileX5Ym3UOrbmZ3QI6sSbHTOlHWbBPvM3on39qvPPgx+9+/PwRHTzsWjX4GTpjKrTDYVUW6gN6IM6tWAOL4sQYKBua9paQ/SFJWamrSo2bYbfueGtAzDro2+B2REcWoeW6MGWbSkFhxtqhczNAGbRlnlYNJxZNpxD2mX6COLwRnNixj9cz/0rBgOtDwp8dF/zno8kmVvteu2W7fCrr78BLkoLmye1TFPLlhrukFWGLzo8jXw05z4HvJxjsyDX0quSUNb73Rzjf/N1b4IrN2+pYO7L0fcwvmWyVn3QALWTBmJzEyDlKwZsdEiSyhKvegO6f8OY8TsvVdp5sRr/ui9WBw4qa0vlxgNk02YDPMt173ivN1RddyBed8e1W7fBb0dPyBagtaB94wEqqylsrP+DqjDwywz+0IlEPyB4VW2lYFCMKVtUhNkMfj7azFdu3poBvM5gdpI5gxvqN7cayPPUod9mOf121FA4QLEmHWGABu6aGMwnYKDOFx0vVdrR9GDrxSc8bezrzQffTrzywqS5lTUdJr6haVP7roXazuuUJv1etmkr/PT1r8wCToN6gF0vPNER3sKnGmS2306ZI5HtbIdlWrlVtkhOYP5AHBi8e/fFUjEBtTv0xucMYgE4wGAHWi+5tdS4dss2KHYYGrFleRHUOJElFplMga6VoMCRAxZc4waePae8pV+GKoFd29kxMXVaSp037HG8Np2l0YFyeyAd6lltcmTJDOVYU3HfEv3W358+x5uVcVXGClHklbwZ3Noq1Yo1wuLXrRoZFdwSBUEbBMVESlskvyqqme+Mg4Je+ZhbPV8kQG+vPWKD+pUSdT5E0jt27C43mvyocAiidSiepjnrErX+2QYrFlzDBp49p7xFyhH9pUe6p+jJUCU9R31TFDYiSPQBVUiYNoDKd/DtF6yEZxD3wQqx74mAvnrTpgzoIJMMWDMUTJ1baAPaZ4g1PkiN1G8oPSrQILCLhP5InMK+cLqpAlnZzTPFjL53IFUMazKTy1MdQXeOH7z0Srgu2ut17epGPQjwQYMXB4leYNhoo5xLIypa1Xsdhluo40udE2+u2bwZvvviy9rjGA9saJsecg8aZkivzA5lelwQvV3/8NqXw2w2K4PEXm0wDgCGD9KrYNgsI6BfOChEWCClGOBU2z5K59dt2w7v2nWRVJQrpE0LPb3N6o7pbOBZ953BoRti12QVfvaKl0cpsBlkyznJQzMrEB898AMMnbLncsBLnD6AbnypR4BBXYJOE5l01epm+PHLrxWBMwsLvEtt7EBotQmDnto15w9qvBSPr9mxC752x84ipUN1OdbC69ziMkFjdKojszkRQrNSOgbliTrNyv7mZDt/Z5w4SSKhNdhoTW97Bo2FIKWWIPtGh+oDTRL7TVvPh//76lfBfzj8LNx04hjsWz9b3u7Ls2MBZEbFuQXqYBEWE8IsWCaElzAtAAE5WAQy4Gn/m0k8rooA/przt8P7d10KO+Lkx3oYd5kOMDZGQgDxG3DQryuke6mMVKX8Bkc8X8UJfOtFe+AThw/n5eOwo0y4QxIOB+MBqPc8G6QZr/zc54Khbiwl9yRmlJIU6R2NZOj3a+tw9XQFfv+Nb4Wt3VTUTFY7oLwZWiipopbqlGgHRfqrCfP5fGfvySCqYRsvwo+wgXnOeVTz1CUcVsV3xrFyWhdhIWGNfILVYPyrJSW3j0jSoDxNUCXuouB5qj+p4+8Lk+Rc6cpMXvo906/D++74FDwXZuo7w5RJZ8c22mMl5gcOC6fQ3tZtNDiZGhTz8vbIM3jHzj2wXfX+BGRjZsBiMGsKsEWCAk2vHkg/HVeqr9O1MgseKrCNlFV5oqNBbrtxCzSJs7QMgmOvATnXqdETmnkpAseEQQvQRlsqU3AWbHuMgVnzReKUlEZVJn9bkLUoS+oE8FCmx7/9kj3wm0/ui2OuXjZ6KjPPAIOGyVEIi4Te+PvQwVLcYnQVA8U266O58b7o2WBm8K+RyP1iMAdXDEtkRY6pL4M6v/mbpA5JZ1ZzvDa2dHpfgKOhiXdsly8NqYGH86VqcHUz5PT1HsC8hGCcA2G8OBEi+lcG51B/Nfh9xwOY3y6jpgfWNpAxFYH6XdHL8hv79kKYTgkYtOmm+WKBrkE34niY/4I/jkVaSBbDvoft0R56RRwQ9r2VBMbPOXi6hnmN0orLL3sqUAeSCtnzgUpCsHRmvsASQQM2OECrziQrbbFBD3Pq1ei4SBfVC1HycvJETK1BXvPAHCyvjaTW5wADIeTzHGsDqQO0EwTVBjKvEEr7vHr7edGWn8Dx7MIjW7qR2+CrtDmFjgO6qU6D+Q2kQ9ldl97ZSB/RejDLyDfUAYNm9Fw1PacOjCEtLVhjZQYqUwOUyTFWPak6g1gBTfZHYWIoE2PChXHpls/RpjP14/yDep46CpepAb3MABpcegYT09gSMqZdXB4Lg2okLXD0hlB6MmYSmfem83bAx44fIQnd1Rfecl4NaQIwt/GW+wSLM/FiRzhTAH11nOI2zApgZv9aDGMA9rA4GFCH2nNR1T+Fju7rdanB9fJWXKtAb37kaIMspWoV6JlWkbzBdQamP9g00ik4bbD1NnnoOLD5mijX0Xr1nO+AXGed91weUcCRa22embKo8Ku3xDmDo4cgKCeDBTAuTwRoQOveYIxUzlSLEBCq2NzI/s0tWw2TmPktuwwABlJkmdACtcRRRjMGOsWZX9daZsDM0b5RqQDhSHDEBKspWCoNaO+H4OOj19KbeaeaQOc94JeOYI0UhvwN7tx3njAn26WDaiCNIoMLrFJ618pqeVUiqK2RWw1l7A4vnapEGF1ON5DI45f5pXrefqSMEqgvXl09J6ZslHEe1PnHixWwDNUiTpsdxmsBMBRPrV/uREoG1AxV52U54B7XhLEnRkwxnT6UTmBkSytoHjQawJM/qFIYz/6cQO2e58O/sZeO5BHLApEJocDv2QudWN8S1PSa5or3pjhCxXyzxc7uBPJyrKrF/7Q0mFvbcwweh9yJmdZBIwZlZzfuWZ0+LKw18NZb1Q1wpKTUoDyv6MCaXKIRejVJ0UKj7jDObhupxvBeWKqvzA1Olw9IDa5T9aqtpjxRQgdrU+ZvS4OKFmpgdLENHdwTvSabDupd2HhUKhLmM/lcwqCXslSkc98pQ+MZnJPvWJwHRl+LFm1g0rPkZomu81BSHdTzHNcaW7SUSIvoMHLOEWO832ibeDDjgnTmmhHu7o7lsSi0AY3zSQmtk/j/bD9rpB420jyh84IDc3TOWKIFiEWNEFS+Bgyq4wiY6ab3agwGfT5/cB1jhLCxDjdicQyfUXTASF6Lgi5Paz7vixYJje2815K5YXo4M9S3nrseabDFEpoNdG1jtDgXw4H03Rice+861zAA7ghKrb1VG0LuKZu49y0W6jNmyarQaDDNrgatetCk+ajBF8bqBjC0+VWn4nGBLr8fo2MD8YvShpEbWpjla1eZo2trdqKLnsqbHcHGQ3sZA+/t0Ht1NVqLXxx//OTz0AxBnhyZcXzhodnwPl4B0WNiEHDeTRATysgSVRizbzApADAwL4LuFOpmcOmXeXndegpgYOJwXPNZeHFDZrcXKmhZe/DMaStZ+I5vUNSN5+6rVza6QYlS1EhmY8THNPcdP9rOQUmkpY6wgbTqWDRRwA0pC3QjyAtLT508XgYbxPBOV1uZMNLowXaUfM+lL8sKQ/2MyjEGNV0ufw8uDVIGCh97jx2SF7DkRSx+bn6zgarOSxsUb5nuFPaePAGAOK6FdMVb9+W6ZLrxL1YG+aLs9bH35EkzA6zbFlzcgkzPOXhADDp+UGCAAoDT62vwU7feCCfXzgy3yZhTzkCdAhg/awZyB+Ir77GCmz9h8p2Ega3rwLQbIEPpdGcj7b92+62wlhaQx9oRDajn0B/ghYPZ8ELFGbrdM3x95+GDwMtL4AtoeH6y8xH+nK+1NMJB4gLq07MZ3HX4kH3DDU2yHIQBYdigoxKW1TLMl8IAI+q1IcH4uP/wAbj38LPw2LGjAzBji3bXQoYOBOvShBYT7XOeZgQHCFQNRuf8WuYjRw7C3QefhYcjMMxWH1jrr/mnJ7n80W/wCHMOUOVKBR1f7z16GI6tr6sNmywP2sbDfNB3vicbZvq8JK1ycgt6u7wA40effdqCYQTUfC70BYB5HVR7DFoEekmsJzs8OBnY6Z3pvBfIU/vyB50373vEbJFhwI2OfvrtB4UrglogpjgvffVvUHXQr7wybXonsdueeAzOhBnc/PhDeaOeCdo3DXGMPGyTvGzABfn5cvnddW0q/dmTT+S94dHZIsVERpMPjuXr7rU/wZL80c6CNbzcslsTrff8n5/cF3vd2YpzsKAGaDBzpCcNJK0CA0uZQXq0z0rHAQUKtRfPegTDBx9/OK9r/JEnH8/7gzDQtQoXm9rTzWVjI16VG3D00VJ1tI0tDYm1ofSmPGlG7EQ0kW6NnTEtKP6XTz2e66K3zht83ADDjq95tdEwT8Nwh2Sa0V2fipL5o88+WRbEz4viE44oB6HTjyLVKTZoqoPCUVGO4FBd+w6DGQuY01cHaW+NTx08INKtpeI1R7TP1khhPtVpggWtJtnYs3T4vqhpYgmdAHHo7Jm8nvEzZ07BbU/vL4DohuobdB1QsUafa3taHbpqZnbP5cv30cWL1ugK3QnQ9xx6FvadeD7TfuDMGfjoE3ulM2pQG23uCYPaDmGePeeO0MjDXxvtAlbz3fLMk/BYHBAWCd3ROtKVIShMrlxo2tjGBOBBoQY16tZxD+pfUzhmwhKg03Zuv/3og1Fa9Haf584x2BXjpzmFIegOxSgNfKQ8AG0dfZnc0FNq+D945AHaT3ElRk7gDx59ANIaHQO6u6G0KwXU8oNli6mLodPfV52iU3XWHUoDuWweG+BPEu0rtNNYPP7r44/k+1NVP94vUH8W5VsQG829TPDmpD40r/QncumYRWz80eN7C16mE6h7lcMAoCBqDsCqe0c0nXeLKWZydbzKHMBK6UjgZw8fhk8ceNbaoyo76bnpYTWAMJILQQZY5gA7AOMgj9JJLrdTQAb1fRv9fjRK589GKVf2AynA+Pyh5+DmaHrkNJ0FtedfRx0MGuuj67FBa5UjbwJ4a85rEk37Sjw+9fST8JkDz5TOmGmfwO3x+rZYp6kCvv7WUuMBHQIzL5VdE9y9sCCNViWylU2ngKzOb33mqYiRg2WV/7RVCdvRhhEOc9Bo7EYYWTlp/AEDcAXsBOZJ2rh+WnYJ/cUv3Q1HkirvhpIGPXMBmpLLd0gtfX16VCdMYl6DEWGw/Vhi7snZGvzS3Z+j7cZou960oGC8+fN33Zk/4vS2aBMcmpOuIoM06K7pOW0nC5hBgRpq2Qmsa5G2n7/r9kxrJ7SXHVp/8Qt3wrGzpwX8GtiirbpGh/L8bPEch+0DFgbVvFC8zr9Q6DgUafs/vvSFrA0TXspq/938Rm0V7KJ0M7haUHBq0qJQIqXGbAfljesjqO8/cQx+66H7TQ9t2XVjzNJBC785nXNIIsLAK8DH7z98P+w9cTyrvdQJ80HnT0Vb+l/fd4+R5gLmDoZmEMAArEYC6mvFtk5dexOpc+VqcP72/V+CJ6LPP29sSkJkQttR74t26Z/sfUjS+kN3Ri/0/CBca00+b74Oy3UAMB4Wz7e0PevvP/IQ7Dt1qmw0lPZi6SZ1E07B05BAnNfoKtTldEe7HxLDVeaoDHSyfdjLUTeuX4V/F23pv4heD89QM2iBBjhgSAo6svw9n0fnmUkdKn1C/2f7HoV/dd+9tO902egmdcQJb0UWj9+4/4vRJNkvdqsxQbBhRvE5qVyhFRtp6DrofEKVnppfbGLw70eeeBx+6767YbJphWznKe3YOy3aJpog/9e9d8EHH3ukLBvAtndXXXrieXD0MG+D8x0HjXZ0fAcwGiXzvquSeaqOD0Us/OsoSDK/eb/vSfFwaKnG66Ogxp2AvB2Ylo6XVA30LqrYwwDGrgl8nW3CCnIGNw8MJxMyPSLBSSX+7BfugPuPHxEpzcAYmCKKud0yAFdpWGoaNY1qMIWlQdPx8LEj8M8+91k4neIJEJM8mJ3IICXFpy+R/6fPfBIeOHJ4KOXAaprW3uVeeosUVucizdSzvizmVwLzQ0ePwM/dcXve4zGbSStTorsjTVNAjvH3FyLfvxTt1Ck9K/ynQ0tQGTAC2MEjtoFrTCN18GCUtcNKVzvjo8ePwk9/7jMZE4nG6YRox44GhYwnICHJjKo49HjTeGWCO/CR0kVrJtJrOK3qRbr1qvuu7vF9pO/h73/qY/DUqeeNlOPKD4DtQO1tuGYcOHBpqaSkUwLzf3/bR+F4nA6ZrGySBU462ksvg2JSpF3aATVtpfBDH/8oPBif0w017WwjzgOzsSvBSmNtVmg7mQ8GQzqePPk8/Eik/XC0n7u8sWWL9kmW0NN4HItt+IGYfv/zxwywWl4Q7QnhJs3XwQK8C/Y+P5eWJBC6QbUvnT8daX//rTfDmSTwWCtOaTBoGlrkp+BPRFhLOjfi8Jq777ZmqTeSsMTJJzLKuDIfNvI6ZbQc2PraOqyfPQuzeKydOg07I/H/z9e/G1523gV1ERq1ao9fxXKMFEt9Za6W7hpszOj90V7+7ls+BIfixEnatndKG0VOaC89pDLSAoJ9JGx97Wykfy3vTb5ndTP8+298D1y6bbssnCOL6GClmd/h0DSHEdqZnZn+INURAE2hStEnjh+Dv3fLTXAg0lRoX420k4RTtCfez/pZoZtov2LTFvj1r3sXXHXe+WZpW1lkJkBzNasgRDqWV9w1B9zaPEudKAmDf/DJKNDiZFvexD7SzzvNdnkTe16irQ5OMsidLc2Se8BMB+rJjh/+4f8F5gXUDzHruDx1DaxeiSiAahvFcDLODP3Row/BVdu2wSsuuADqrBAMTQgYSl4ttb1fU2zkzrrlsrqNx3+JNvMPfvwWeD7Fpf2naQ/qTjZT76qGEW3TSWHHYqf8k0cehiu2b4NX7txR6Waed65DUaWEXufZYfWuTZiJphlrPT6yfx/8yMf/Eg5HbZGBvKlIuMmAdiKEAA4EiuRp+qM4lnlZBPT1519glKqx7xVfEYbnk86acVrbshZc0b8x/qZo7//EZ2+DgyxEEqBXqqmU7WfXuIXvAjBiXrUUKtBUI8wF9NiDgzgEh2eTRNs6DP61KEFujJWcxd/E3G3J3tNMhSG4NXM7BQ593emBlDIzjsXG/K0Hvgi/GAdJZ7ATIBdATCoglC9LQN0RE2mvw1NR69y0b1/+oPOa886D80Zo9+aQNkUMQBqAnlJ8+j0ZJdov3fU5+OV774aTKT7SvbKpRXsnTKu0E7CJiLUofv/8sUdz21x7/vmwPdEOli5PoxEg6toM7qE9eH0+8v1f3veFyPfPw6mYMG9kT6ZQcZFW2mUDUGIceheYs6PngTlHDUyOFEbeAA+ik/oq+vvyxXf169BC1oEWcEzmx/paND3Ws/nBZsjVm7fAT7z+q+Cdey6PDOkG664xGU1KcAh+bYOeiRLhtmefjgOjO2FvtN+K5yKZGKt5AiK7ubqJME73fl7ZMn9aH9X3bD3RT+bTWqrHGlweaf+ZN78Fvv7Sy/KAzK8IZNQ22DpgY9aQ9yzqch49fPqZZ+CffvqTcSr+tKO9uOk6nioeoT0RMiPaZ5n2tczzRPsroqT+4de8Hr7h0itz6WZrEGi76wy9CmsT/qXzNAP4mQNPwy/f8zl44Pnj0RNDAmS1emTy/t9KIxpTg8EdQIHcSWeDg3mA1jf79rIvZhlT/rDR2NIAvKQBr4Bd1rxbz4ydra1npiZw9BEcIca9bfdF8J3XvBzefdmVsGU6ta84wpCxqOpiJEk8PxE7zs3RNfSf47Tqrc8+lScdpnkWjcAgdudEADEaAtAq831enDuDOY0Loh3bn020z+CrL74Y3nfttfBNV12Vpd5gSVq0tOuLTL+yoY9Ge/fWOPv3+w8+CHcefC6q47Qh/JRUdOmIxW/bKdpHVKTQXkGd6M/AjnXoYn1eu2MnfMe1L4f3XH41bIt80qtc8a8Onu9a2xyPPLk9Avl3H7ov0n6gDFizRF6VafmJTHNP8kNDMAOYUT8BGnXB8r1hI9B9vPaeeyrt/EAIlVXaCB8MDivajJSmDhFohfZAA60C7JlIugRqZvY1ccD1jXuugG+/5jp4ZWR2KrQlJTSDS90C3HP4UDZl/mTvI/DM6VNlKpt8s8zQjtR0deRzvii4EJ4BrUUSaBFKBsdaAkcBxSw2YqpLH+m/aus2eOell8L7XnYdvCl2UNmPRPjW6JBQAH3Xc8/Bjfsehz999FF4+vQpmiyZin9cBq5Tol1UNEiDq2ar3CJQ8+ZNBdhr0jHT0sepPa7del7eb/19174MXnXBTuClxlvaUWMuCbG7Dz0Ht0Zf/QejAHni9IncCQvPiwDp2MRIbsWueGOA5ityfmn/9XTSVds5l58L6gSnAuKgpAEUya35mqHKgJYIboMgzW1upLWg7ar9UJpfJHZGcr6OrAQkSd0rEySBOAFhRkdibmJ4ktipEc6PDfrmCy+Ga7afBxdG9X5+sh+JgLWYz/FoXx6MnpO9cTbyzgiIw2tnyjsBNEvJEw1ZKrB7iyRbp2xOgkRFXf6rUVjq03OnTEeiN0vsdalHn4AdwZHqd0Es780XXQTXRFt195bNcEGincpKtuzRqJ0OnY60R8/F5yPtB8+cNTOs2Q+eNEukP7vjplUqi5mhGzV3HKwLs7DJpMxD9twk/s4GtJf6JNp3Rtpft+vC7InavXlzHCes5vXnUogp8uD4udjpHovmxF1RixyJnRrFB86TJVM5Ty5QZD851lFlBm1nB4DJdg7GxKjnDDcWQlxngKGSzYCGVhizo/meA3WGtTJDyAdW05NbLzO2nxWJvb4uUruAYpalSU8bsvRkk4vIMHqvU7OTXQX0ZCqDJlZx7O+UKVbdc1HLzGDrzp0V2Kb2wE6dcVb2CyHaWRsF3gXJ85JUbWrUTDcN7jKQJ9OqSQztRL+g2dPebjutZRI9zPvAZghpzcT7zHfZnaov30XrsZIMygotQhdpDn6Hp+NOyG0y6Spw2dRA6/bRAG4OBFth5N507gMNR7CVZ6yuS/dJdMoH4lyBQFvzpsqnDYUmHc009qUh+8QIZuiMVCRtbxF6JWmG6gZI4qK8utoViUHqLcejArLoTPVrEUKVq4BG6qBZgmA5WFp2swn00zhJQ2BIC75nLUQ7pga/vpfy+Ajtk05evUUBwRzaofFrQgC2eVghs/RLwOr7JB2TCRP5nrXKtPB9VjsrjPGdaJeX8h3txa9M8ZjukX0iLjkE4xoCBWapTwPMWgCN1ruEja0+ajLkxkKoi9xpUEvXjrf7AuJU2QQOJID0XWZiVqWRKazaZTMZ9qAAGCM0k9LV/bxRqWQUkNMLUwbAlXFo6qUrF4oECUGtA106dx7ERTDk1wQS7dRJQ+pM3AFZktPoVvY/UdKg0K20hjmQ7HwE80qlp320UQvRTdonpNozj0t5YdIX2jXfaYJM+J6Obg7tJIUHmlAdAzCjm53WUrpVJTkfB3MK87ek8NcmKS/oSAAQBhCoZRVwECAH0AwuwM62VPo0ui9xxUwJ4vrLwHKjKv0yS/W9FjUIZI8NmCXPcSbYZpjaQAXVaMvQnssk2vtUZho4VrNKz6AuTTv7wVu0E78r7Ypo075YtaVI6hbtSUqHzHfueL3srxdqHTiPIu6HtJP/3ggWJzw8sOvzmnjbHrgAtPPCdID4RZlpTwjSICr34I7AX6RRYQOafJH91KoiWVqTfZx/J50CBVTGUnrJ34AUrY2pQbsIzD54aZCL6/NC7kHVveTYZ6lXBiwh84D3Aay0g6IfLO2IDiScxA1ccQHtWvAgOl5pkms65HwTnV2QjhkE1OD4DoYW4bumXUtZHSevH+pnoKaFeo4D3jfqOicsb3IMCiJQA3diRQ1J7jwY6INdEQgnWU2D8BZFMiCbLZSH2WAueJsDrOo1IKZ8jIRGWwd5RpUpZCqpyvqWO1w2RZj4yQjtQeUFA1ygq8eARlyedqx2jOOXTT+gXQ1YBdx0rbvfwFyaR7t0QAAZ+Ml9UJ1X5aE6wQsFcwpTjbVmUBWVtHwyCupQJFpKlE0KxewQSJqTVOPGR8pUhFooDGBJgR1UicP54RDQAIBO5QV9XzO2PmJPVQ+sp1ReNjPSNfnaNY8g1A1FSL1L5waiGX2h2KAdXN0U0M11bYpyqfilaWfNwlqS8hCNw3wXcwWE/wGHgsTSrujmarBEVmlqvQCqr/nFBXMKZuNNqxhrvj5/c88wiWznTHxhEtLgShqXMFyaVzFZSYKgGbsMHU6CMYil8QXElZm2fjpXMqW4oQgkgW1+BmgyL6h+tSOivDq3iOZKru2QfM31CqoDapkRTI4cF1Q+NTGbbTJ2z0IGlKSu6ZaiGSzfmc+8KLmhnUAr5ikDGXGw4ZW0G8LAyGydt/hsTI5Bp9C/oma5cCApCwLKoOINgVoqAJJkhjpBg1WKo86EH2MbW2qAhglYiTRSgJlHlqq6Jyn0IxIbGBcQNANMvVnDBKKd0RKU1gJdd8VHLY1atNdzpElBHKWdfwLUzgdEOypeMFSlGZE1iGpXqhwaLWlpr+RZMGvaUfO9EV/4AnYFWBU/aBPEAZDBXfPvtJVoNKAd+fsGQGJCYG5nSwHNLKKuYHBbSxUQ8iruOOyGo3S5E7TMMw/XnmB/VTkCwlDjURAkibI2MqzO/3WdYJB3m3aFTAI5eoDDCO0WiyBodPtTiMQOoaLJPSwQDUMyxWxxJGnazMcgDhtSjsqjVNcxhdvNlbcURmN66+XwROtrf48yKPdUkRrY8uYUWN3AmBB7SW9xQYl0e4wCQV0oqSESQz/fArDPSC/sAa7uwRPD0ockMxfm9iscFINQeRkqregb3nQAtHVo0WzOcQjaUhFgyVnpINoNwGEIalO+ohNgfudjfqqOizAHS63rFib9L92bbjhTbLSWAU8thIWCrHOlgco2HD2jwQ1BD+Ra4qIWjIY2dUuBxdI9TKvlgDEQdJ1QgxqgaigCJPuv2YaeR7uyK5envUkwKAMGzFggKBAx7SLRg8qXaCeAByZg0Mw4LLFFO0e0OiBWSBth2IBUE2emTBymyxL6XAMDV65BEVh7jICaEykholV6uV0NKA2yprRoE1V/Rhg693F/Txfd6pRMuxoUV6nlM2gV0Cj9y017TqsEi87pXPhO+bQ6oBE+nP9GwLxEOHdAc8HB1boBbNR+WZYaGvgi/eYxcsT+QEePv4HtpMsyzXhwwNPuAMIheDJeGO3nQrce0M2lXZMHG6AdWvSPgNikASvUBnmeO5hTeGGA1gRsANg5WtMtEgSy0h/uOei7MsK4SoTlgTAmIXS80zZMrpSQcNGhnVkz9L8ItGs6WjT6eJ++QTt7c2paR7sZM+j7uDHacUFHWJTWPRZgfpiWdzKU/5Ey1e9D13rj0FdJUjo4aT2UDjZvW+nyE9QFC4eQB5RolEGllU3DlqhRNOtn1L3RJW7RyyVUQABomloZpx1REXj8pX0HjmbK19RaiAaemBnQ7Mod3ENFM+eNdWyQ2cltizUH7o+opLmlGW2nMGmpDYxbF4c0W9IVzTgfdy6PeWmnzDh9Ax0T6qyXTQtgO4GvVKD0qK8BqQJg03K5YGuueA4amrVMUPR48FJa3Umw0iVxaqTcphkkt1J2nbVUpKoGwDbNFG/GMTDkfYnoVL1KJ9kQzahyD5UHmndgylQ059lcrM/pduBidVr0g/OC9ADu+RbNiJYOVQ+NBXR8ZozKfcp78HJSMxNNqAuDwrWKtuLINYh6CtXzXnqbwlpVtfc4b1XVQXLfKXW95tLMZ452uRPCKF0wXqsB7fYe/yyg2WQ3ntaoJcUaQ3urvceq0alpbj3YxAU0y8ts87NvhWYayvuF29Cjpere2mroxjPB3RiIrbFnwOqnpbiyGGBNurmMFg2A42lg7Bl4cWmXPM+R9nk81+rPP78M7Yjzr1+E8P8B0szv+tLrxRwAAAAASUVORK5CYII=")'}}),Trust=({theme:o="light",...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"44",height:"44",fill:o==="light"?"var(--ck-brand-trust-02)":"var(--ck-brand-trust-02b)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.0246 11.8662C33.4096 11.8662 33.774 12.0243 34.0421 12.2925C34.3102 12.5675 34.4615 12.9387 34.4546 13.3168C34.3859 17.4143 34.2277 20.5493 33.9321 23.0312C33.6433 25.5131 33.2102 27.3556 32.5571 28.8475C32.1171 29.8443 31.574 30.6693 30.9346 31.3706C30.0752 32.2987 29.0921 32.9725 28.0196 33.6119C27.561 33.8861 27.0843 34.1568 26.5842 34.4408C25.5172 35.0468 24.3441 35.713 23.0146 36.6025C22.5333 36.9256 21.9077 36.9256 21.4265 36.6025C20.0766 35.7026 18.8879 35.0281 17.8112 34.4173C17.5718 34.2815 17.3379 34.1488 17.109 34.0175C15.8509 33.2887 14.7165 32.5943 13.7265 31.5906C13.0665 30.9306 12.4959 30.1262 12.0421 29.1706C11.4234 27.8918 11.004 26.345 10.6946 24.3443C10.2821 21.67 10.0759 18.1706 10.0002 13.3168C9.99336 12.9387 10.1377 12.5675 10.4059 12.2925C10.674 12.0243 11.0452 11.8662 11.4302 11.8662H12.0215C13.8433 11.8731 17.8652 11.6943 21.344 8.98559C21.8596 8.58683 22.5815 8.58683 23.0971 8.98559C26.5759 11.6943 30.5977 11.8731 32.4265 11.8662H33.0246ZM29.8277 27.9331C30.2746 27.0118 30.6459 25.74 30.9277 23.9112C31.2646 21.725 31.4709 18.755 31.5671 14.7125C29.4221 14.6506 25.7371 14.2381 22.224 11.8731C18.7109 14.2312 15.0259 14.6437 12.8877 14.7125C12.9633 18.0537 13.1146 20.6525 13.3552 22.6943C13.6302 25.0181 14.0221 26.5925 14.5102 27.6993C14.8333 28.435 15.1909 28.9643 15.6171 29.4318C16.1877 30.0575 16.9096 30.5731 17.8927 31.1643C18.3005 31.409 18.7502 31.6635 19.2396 31.9406C20.1116 32.4341 21.1099 32.9991 22.224 33.7081C23.3175 33.0107 24.3014 32.4515 25.1633 31.9616C25.4231 31.8139 25.6717 31.6725 25.909 31.5356C27.119 30.8412 28.0127 30.2637 28.6796 29.59C29.1265 29.1293 29.4909 28.6275 29.8277 27.9331Z",fill:o==="light"?"var(--ck-brand-trust-01)":"var(--ck-brand-trust-01b)"})]}),Argent=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"32",height:"32",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M18.3242 7.63647H13.6516C13.4955 7.63647 13.3704 7.76611 13.367 7.92726C13.2726 12.4568 10.9768 16.7559 7.02532 19.8009C6.89986 19.8976 6.87128 20.0792 6.963 20.21L9.69685 24.112C9.78986 24.2448 9.97107 24.2747 10.0986 24.1772C12.5694 22.2856 14.5567 20.0038 15.9879 17.4746C17.4191 20.0038 19.4065 22.2856 21.8773 24.1772C22.0047 24.2747 22.186 24.2448 22.2791 24.112L25.013 20.21C25.1045 20.0792 25.0759 19.8976 24.9506 19.8009C20.999 16.7559 18.7033 12.4568 18.609 7.92726C18.6056 7.76611 18.4803 7.63647 18.3242 7.63647Z",fill:"var(--ck-brand-argent)"})]}),ImToken=({...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:`linear-gradient( + 180deg, + var(--ck-brand-imtoken-01) 0%, + var(--ck-brand-imtoken-02) 100% + )`},children:jsxRuntimeExports.jsx("path",{d:"M26.8543 9.96509C27.5498 19.3857 21.4942 23.8384 16.0655 24.3132C11.0184 24.7546 6.26765 21.6534 5.85087 16.8885C5.50707 12.952 7.94004 11.2761 9.8516 11.109C11.8177 10.9367 13.4698 12.2925 13.6132 13.9342C13.7512 15.5125 12.7664 16.2308 12.0815 16.2906C11.5398 16.3381 10.8584 16.0093 10.7968 15.3032C10.7441 14.6965 10.9744 14.6138 10.9182 13.9693C10.8179 12.8219 9.81731 12.6882 9.26951 12.7357C8.60654 12.7937 7.40368 13.5675 7.5725 15.4949C7.7422 17.439 9.60628 18.9751 12.0498 18.7614C14.6868 18.531 16.5227 16.4779 16.6608 13.5983C16.6595 13.4458 16.6916 13.2948 16.7548 13.156L16.7557 13.1525C16.7841 13.0922 16.8174 13.0342 16.8551 12.9793C16.9113 12.8949 16.9835 12.8016 17.0767 12.6997C17.0775 12.697 17.0775 12.697 17.0793 12.697C17.147 12.6205 17.2288 12.5379 17.3211 12.4491C18.473 11.3623 22.6214 8.79916 26.5448 9.61074C26.6277 9.62851 26.7026 9.67262 26.7584 9.73649C26.8142 9.80035 26.8478 9.88054 26.8543 9.96509",fill:"white"})}),Frame=({...o})=>jsxRuntimeExports.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"32",height:"32",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M24.9055 15.8824V8.30065C24.9055 7.63399 24.3583 7.08497 23.6938 7.08497H16.1238C16.0456 7.08497 15.9805 7.05882 15.9153 7.00654L15.0033 6.0915C14.9511 6.03922 14.873 6 14.7948 6H7.21173C6.54723 6 6 6.53595 6 7.21569V14.7974C6 14.8758 6.02606 14.9412 6.07818 15.0065L6.99023 15.9216C7.04235 15.9739 7.08143 16.0523 7.08143 16.1307V23.7124C7.08143 24.3791 7.62866 24.9281 8.29316 24.9281H15.8762C15.9544 24.9281 16.0195 24.9542 16.0847 25.0065L16.9967 25.9216C17.0489 25.9739 17.127 26 17.2052 26H24.7883C25.4528 26 26 25.4641 26 24.7843V17.2026C26 17.1242 25.9739 17.0588 25.9218 16.9935L25.0098 16.0784C24.9446 16.0261 24.9055 15.9608 24.9055 15.8824ZM19.759 19.9346H12.241C12.1498 19.9346 12.0717 19.8562 12.0717 19.7647V12.2353C12.0717 12.1438 12.1498 12.0654 12.241 12.0654H19.759C19.8502 12.0654 19.9283 12.1438 19.9283 12.2353V19.7647C19.9414 19.8562 19.8632 19.9346 19.759 19.9346Z",fill:"#00D2BE"})]}),Rainbow=({round:o=!1,...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{backgroundSize:"100% 100%",backgroundImage:`url("${o?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF84XzU1NCkiPgo8bWFzayBpZD0ibWFzazBfOF81NTQiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIj4KPGNpcmNsZSBjeD0iNjAiIGN5PSI2MCIgcj0iNjAiIGZpbGw9IiNEOUQ5RDkiLz4KPC9tYXNrPgo8ZyBtYXNrPSJ1cmwoI21hc2swXzhfNTU0KSI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfOF81NTQpIi8+CjwvZz4KPHBhdGggZD0iTTI2LjY2NjcgNDEuNjY2N0gzMS42NjY3QzU3LjQ0IDQxLjY2NjcgNzguMzMzMyA2Mi41NiA3OC4zMzMzIDg4LjMzMzNWOTMuMzMzM0g4OC4zMzMzQzkxLjA5NDggOTMuMzMzMyA5My4zMzMzIDkxLjA5NDcgOTMuMzMzMyA4OC4zMzMzQzkzLjMzMzMgNTQuMjc1OCA2NS43MjQyIDI2LjY2NjcgMzEuNjY2NyAyNi42NjY3QzI4LjkwNTIgMjYuNjY2NyAyNi42NjY3IDI4LjkwNTIgMjYuNjY2NyAzMS42NjY3VjQxLjY2NjdaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfOF81NTQpIi8+CjxwYXRoIGQ9Ik04MCA4OC4zMzMzSDkzLjMzMzNDOTMuMzMzMyA5MS4wOTQ4IDkxLjA5NDcgOTMuMzMzMyA4OC4zMzMzIDkzLjMzMzNIODBWODguMzMzM1oiIGZpbGw9InVybCgjcGFpbnQyX2xpbmVhcl84XzU1NCkiLz4KPHBhdGggZD0iTTMxLjY2NjcgMjYuNjY2N0wzMS42NjY3IDQwSDI2LjY2NjdMMjYuNjY2NyAzMS42NjY3QzI2LjY2NjcgMjguOTA1MiAyOC45MDUyIDI2LjY2NjcgMzEuNjY2NyAyNi42NjY3WiIgZmlsbD0idXJsKCNwYWludDNfbGluZWFyXzhfNTU0KSIvPgo8cGF0aCBkPSJNMjYuNjY2NiA0MEgzMS42NjY2QzU4LjM2MDQgNDAgODAgNjEuNjM5NiA4MCA4OC4zMzMzVjkzLjMzMzNINjVWODguMzMzM0M2NSA2OS45MjM4IDUwLjA3NjEgNTUgMzEuNjY2NiA1NUgyNi42NjY2VjQwWiIgZmlsbD0idXJsKCNwYWludDRfcmFkaWFsXzhfNTU0KSIvPgo8cGF0aCBkPSJNNjYuNjY2NiA4OC4zMzMzSDgwVjkzLjMzMzNINjYuNjY2NlY4OC4zMzMzWiIgZmlsbD0idXJsKCNwYWludDVfbGluZWFyXzhfNTU0KSIvPgo8cGF0aCBkPSJNMjYuNjY2NiA1My4zMzMzTDI2LjY2NjYgNDBMMzEuNjY2NiA0MEwzMS42NjY2IDUzLjMzMzNIMjYuNjY2NloiIGZpbGw9InVybCgjcGFpbnQ2X2xpbmVhcl84XzU1NCkiLz4KPHBhdGggZD0iTTI2LjY2NjYgNjEuNjY2N0MyNi42NjY2IDY0LjQyODEgMjguOTA1MiA2Ni42NjY3IDMxLjY2NjYgNjYuNjY2N0M0My42MzI4IDY2LjY2NjcgNTMuMzMzMyA3Ni4zNjcyIDUzLjMzMzMgODguMzMzM0M1My4zMzMzIDkxLjA5NDcgNTUuNTcxOSA5My4zMzMzIDU4LjMzMzMgOTMuMzMzM0g2Ni42NjY2Vjg4LjMzMzNDNjYuNjY2NiA2OS4wMDM0IDUwLjk5NjYgNTMuMzMzMyAzMS42NjY2IDUzLjMzMzNIMjYuNjY2NlY2MS42NjY3WiIgZmlsbD0idXJsKCNwYWludDdfcmFkaWFsXzhfNTU0KSIvPgo8cGF0aCBkPSJNNTMuMzMzMyA4OC4zMzMzSDY2LjY2NjZWOTMuMzMzM0g1OC4zMzMzQzU1LjU3MTkgOTMuMzMzMyA1My4zMzMzIDkxLjA5NDggNTMuMzMzMyA4OC4zMzMzWiIgZmlsbD0idXJsKCNwYWludDhfcmFkaWFsXzhfNTU0KSIvPgo8cGF0aCBkPSJNMzEuNjY2NiA2Ni42NjY3QzI4LjkwNTIgNjYuNjY2NyAyNi42NjY2IDY0LjQyODEgMjYuNjY2NiA2MS42NjY3TDI2LjY2NjYgNTMuMzMzM0wzMS42NjY2IDUzLjMzMzNMMzEuNjY2NiA2Ni42NjY3WiIgZmlsbD0idXJsKCNwYWludDlfcmFkaWFsXzhfNTU0KSIvPgo8L2c+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfOF81NTQiIHgxPSI2MCIgeTE9IjAiIHgyPSI2MCIgeTI9IjEyMCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMTc0Mjk5Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAwMUU1OSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50MV9yYWRpYWxfOF81NTQiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzEuNjY2NyA4OC4zMzMzKSByb3RhdGUoLTkwKSBzY2FsZSg2MS42NjY3KSI+CjxzdG9wIG9mZnNldD0iMC43NzAyNzciIHN0b3AtY29sb3I9IiNGRjQwMDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjODc1NEM5Ii8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQyX2xpbmVhcl84XzU1NCIgeDE9Ijc5LjE2NjYiIHkxPSI5MC44MzMzIiB4Mj0iOTMuMzMzMyIgeTI9IjkwLjgzMzMiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGNDAwMCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM4NzU0QzkiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDNfbGluZWFyXzhfNTU0IiB4MT0iMjkuMTY2NyIgeTE9IjI2LjY2NjciIHgyPSIyOS4xNjY3IiB5Mj0iNDAuODMzMyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjODc1NEM5Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0ZGNDAwMCIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50NF9yYWRpYWxfOF81NTQiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzEuNjY2NiA4OC4zMzMzKSByb3RhdGUoLTkwKSBzY2FsZSg0OC4zMzMzKSI+CjxzdG9wIG9mZnNldD0iMC43MjM5MjkiIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQ1X2xpbmVhcl84XzU1NCIgeDE9IjY2LjY2NjYiIHkxPSI5MC44MzMzIiB4Mj0iODAiIHkyPSI5MC44MzMzIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQ2X2xpbmVhcl84XzU1NCIgeDE9IjI5LjE2NjYiIHkxPSI1My4zMzMzIiB4Mj0iMjkuMTY2NiIgeTI9IjQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ3X3JhZGlhbF84XzU1NCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgzMS42NjY2IDg4LjMzMzMpIHJvdGF0ZSgtOTApIHNjYWxlKDM1KSI+CjxzdG9wIG9mZnNldD0iMC41OTUxMyIgc3RvcC1jb2xvcj0iIzAwQUFGRiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMURBNDAiLz4KPC9yYWRpYWxHcmFkaWVudD4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDhfcmFkaWFsXzhfNTU0IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDUyLjUgOTAuODMzMykgc2NhbGUoMTQuMTY2NyAzNy43Nzc4KSI+CjxzdG9wIHN0b3AtY29sb3I9IiMwMEFBRkYiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDFEQTQwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ5X3JhZGlhbF84XzU1NCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyOS4xNjY2IDY3LjUpIHJvdGF0ZSgtOTApIHNjYWxlKDE0LjE2NjcgMjY4LjY0MikiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzhfNTU0Ij4KPHJlY3Qgd2lkdGg9IjEyMCIgaGVpZ2h0PSIxMjAiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNjJfMzI5KSIvPgo8cGF0aCBkPSJNMjAgMzhIMjZDNTYuOTI3OSAzOCA4MiA2My4wNzIxIDgyIDk0VjEwMEg5NEM5Ny4zMTM3IDEwMCAxMDAgOTcuMzEzNyAxMDAgOTRDMTAwIDUzLjEzMDkgNjYuODY5MSAyMCAyNiAyMEMyMi42ODYzIDIwIDIwIDIyLjY4NjMgMjAgMjZWMzhaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfNjJfMzI5KSIvPgo8cGF0aCBkPSJNODQgOTRIMTAwQzEwMCA5Ny4zMTM3IDk3LjMxMzcgMTAwIDk0IDEwMEg4NFY5NFoiIGZpbGw9InVybCgjcGFpbnQyX2xpbmVhcl82Ml8zMjkpIi8+CjxwYXRoIGQ9Ik0yNiAyMEwyNiAzNkgyMEwyMCAyNkMyMCAyMi42ODYzIDIyLjY4NjMgMjAgMjYgMjBaIiBmaWxsPSJ1cmwoI3BhaW50M19saW5lYXJfNjJfMzI5KSIvPgo8cGF0aCBkPSJNMjAgMzZIMjZDNTguMDMyNSAzNiA4NCA2MS45Njc1IDg0IDk0VjEwMEg2NlY5NEM2NiA3MS45MDg2IDQ4LjA5MTQgNTQgMjYgNTRIMjBWMzZaIiBmaWxsPSJ1cmwoI3BhaW50NF9yYWRpYWxfNjJfMzI5KSIvPgo8cGF0aCBkPSJNNjggOTRIODRWMTAwSDY4Vjk0WiIgZmlsbD0idXJsKCNwYWludDVfbGluZWFyXzYyXzMyOSkiLz4KPHBhdGggZD0iTTIwIDUyTDIwIDM2TDI2IDM2TDI2IDUySDIwWiIgZmlsbD0idXJsKCNwYWludDZfbGluZWFyXzYyXzMyOSkiLz4KPHBhdGggZD0iTTIwIDYyQzIwIDY1LjMxMzcgMjIuNjg2MyA2OCAyNiA2OEM0MC4zNTk0IDY4IDUyIDc5LjY0MDYgNTIgOTRDNTIgOTcuMzEzNyA1NC42ODYzIDEwMCA1OCAxMDBINjhWOTRDNjggNzAuODA0IDQ5LjE5NiA1MiAyNiA1MkgyMFY2MloiIGZpbGw9InVybCgjcGFpbnQ3X3JhZGlhbF82Ml8zMjkpIi8+CjxwYXRoIGQ9Ik01MiA5NEg2OFYxMDBINThDNTQuNjg2MyAxMDAgNTIgOTcuMzEzNyA1MiA5NFoiIGZpbGw9InVybCgjcGFpbnQ4X3JhZGlhbF82Ml8zMjkpIi8+CjxwYXRoIGQ9Ik0yNiA2OEMyMi42ODYzIDY4IDIwIDY1LjMxMzcgMjAgNjJMMjAgNTJMMjYgNTJMMjYgNjhaIiBmaWxsPSJ1cmwoI3BhaW50OV9yYWRpYWxfNjJfMzI5KSIvPgo8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDBfbGluZWFyXzYyXzMyOSIgeDE9IjYwIiB5MT0iMCIgeDI9IjYwIiB5Mj0iMTIwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiMxNzQyOTkiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDAxRTU5Ii8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQxX3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjYgOTQpIHJvdGF0ZSgtOTApIHNjYWxlKDc0KSI+CjxzdG9wIG9mZnNldD0iMC43NzAyNzciIHN0b3AtY29sb3I9IiNGRjQwMDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjODc1NEM5Ii8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQyX2xpbmVhcl82Ml8zMjkiIHgxPSI4MyIgeTE9Ijk3IiB4Mj0iMTAwIiB5Mj0iOTciIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGNDAwMCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM4NzU0QzkiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDNfbGluZWFyXzYyXzMyOSIgeDE9IjIzIiB5MT0iMjAiIHgyPSIyMyIgeTI9IjM3IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiM4NzU0QzkiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY0MDAwIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ0X3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjYgOTQpIHJvdGF0ZSgtOTApIHNjYWxlKDU4KSI+CjxzdG9wIG9mZnNldD0iMC43MjM5MjkiIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQ1X2xpbmVhcl82Ml8zMjkiIHgxPSI2OCIgeTE9Ijk3IiB4Mj0iODQiIHkyPSI5NyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjRkZGNzAwIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0ZGOTkwMSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50Nl9saW5lYXJfNjJfMzI5IiB4MT0iMjMiIHkxPSI1MiIgeDI9IjIzIiB5Mj0iMzYiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGRjcwMCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjk5MDEiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDdfcmFkaWFsXzYyXzMyOSIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyNiA5NCkgcm90YXRlKC05MCkgc2NhbGUoNDIpIj4KPHN0b3Agb2Zmc2V0PSIwLjU5NTEzIiBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50OF9yYWRpYWxfNjJfMzI5IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDUxIDk3KSBzY2FsZSgxNyA0NS4zMzMzKSI+CjxzdG9wIHN0b3AtY29sb3I9IiMwMEFBRkYiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDFEQTQwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ5X3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjMgNjkpIHJvdGF0ZSgtOTApIHNjYWxlKDE3IDMyMi4zNykiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo="}")`}}),Brave$1=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{rx:"27%",width:"88",height:"88",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M69.0892 28.2123L70.5781 24.5643L66.3594 20.1967C64.0763 17.9136 59.2123 19.2537 59.2123 19.2537L53.7031 13H34.2721L28.7381 19.2785C28.7381 19.2785 23.8741 17.9632 21.591 20.1967L17.3722 24.5395L18.8612 28.1875L17 33.5974L23.204 57.2472C24.4945 62.3097 25.3631 64.2702 29.011 66.8511L40.352 74.5441C41.4439 75.2142 42.784 76.3805 44 76.3805C45.216 76.3805 46.5561 75.2142 47.648 74.5441L58.989 66.8511C62.6369 64.2702 63.5055 62.3097 64.796 57.2472L71 33.5974L69.0892 28.2123Z",fill:"url(#paint0_linear_2183_5890)"}),jsxRuntimeExports.jsx("path",{d:"M57.6737 23.2739C57.6737 23.2739 64.796 31.8851 64.796 33.6967C64.796 35.5579 63.9026 36.0294 63.0092 36.9972L57.6737 42.705C57.1774 43.2013 56.1103 44.045 56.7307 45.5092C57.3511 46.9982 58.2197 48.8346 57.227 50.7206C56.2344 52.6314 54.4972 53.8971 53.3805 53.6985C51.7195 53.1594 50.1348 52.4088 48.6654 51.4651C47.7224 50.8447 44.6949 48.3382 44.6949 47.3704C44.6949 46.4026 47.8217 44.6406 48.4173 44.2932C48.9881 43.8961 51.6434 42.3575 51.693 41.7619C51.7427 41.1664 51.7427 41.0175 50.9485 39.5285C50.1544 38.0395 48.7647 36.0542 48.9632 34.7638C49.2114 33.4733 51.4449 32.7785 53.1075 32.1581L58.2445 30.2224C58.6415 30.0239 58.5423 29.8502 57.3511 29.7261C56.1599 29.6268 52.8097 29.1801 51.296 29.602C49.7822 30.0239 47.2509 30.6691 47.0028 31.0165C46.8042 31.364 46.6057 31.364 46.829 32.5551L48.2684 40.3722C48.3677 41.3649 48.5662 42.0349 47.5239 42.2831C46.432 42.5313 44.6204 42.9531 44 42.9531C43.3796 42.9531 41.5432 42.5313 40.4761 42.2831C39.409 42.0349 39.6075 41.3649 39.7316 40.3722C39.8309 39.3796 40.9228 33.7215 41.1461 32.5551C41.3943 31.364 41.171 31.364 40.9724 31.0165C40.7243 30.6691 38.1682 30.0239 36.6544 29.602C35.1654 29.1801 31.7904 29.6268 30.5993 29.7509C29.4081 29.8502 29.3088 29.9991 29.7059 30.2472L34.8428 32.1581C36.4807 32.7785 38.7638 33.4733 38.9871 34.7638C39.2353 36.079 37.8208 38.0395 37.0018 39.5285C36.1829 41.0175 36.2077 41.1664 36.2574 41.7619C36.307 42.3575 38.9871 43.8961 39.5331 44.2932C40.1287 44.6654 43.2555 46.4026 43.2555 47.3704C43.2555 48.3382 40.3024 50.8447 39.3097 51.4651C37.8404 52.4088 36.2557 53.1594 34.5947 53.6985C33.4779 53.8971 31.7408 52.6314 30.7233 50.7206C29.7307 48.8346 30.6241 46.9982 31.2197 45.5092C31.8401 44.0202 30.7978 43.2261 30.2767 42.705L24.9412 36.9972C24.0726 36.079 23.1792 35.5827 23.1792 33.7463C23.1792 31.9099 30.3015 23.3235 30.3015 23.3235L37.0763 24.4154C37.8704 24.4154 39.6324 23.7454 41.2454 23.1746C42.8585 22.6783 43.9752 22.6287 43.9752 22.6287C43.9752 22.6287 45.0671 22.6287 46.705 23.1746C48.3428 23.7206 50.08 24.4154 50.8741 24.4154C51.693 24.4154 57.6985 23.2491 57.6985 23.2491L57.6737 23.2739ZM52.3382 56.2298C52.7849 56.4779 52.512 57.0239 52.0901 57.3217L45.7868 62.2353C45.2904 62.7316 44.4963 63.4761 43.9752 63.4761C43.454 63.4761 42.6847 62.7316 42.1636 62.2353C40.0743 60.5717 37.9648 58.9337 35.8355 57.3217C35.4384 57.0239 35.1654 56.5028 35.5873 56.2298L39.3097 54.2445C40.7894 53.4618 42.3551 52.8539 43.9752 52.4329C44.3474 52.4329 46.705 53.2767 48.6158 54.2445L52.3382 56.2298Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M59.262 19.2785L53.7032 13H34.2721L28.7381 19.2785C28.7381 19.2785 23.8741 17.9632 21.591 20.1967C21.591 20.1967 28.0432 19.6259 30.2767 23.2491L37.126 24.4154C37.9201 24.4154 39.682 23.7454 41.2951 23.1746C42.9081 22.6783 44.0249 22.6287 44.0249 22.6287C44.0249 22.6287 45.1168 22.6287 46.7546 23.1746C48.3925 23.7206 50.1296 24.4154 50.9238 24.4154C51.7427 24.4154 57.7482 23.2491 57.7482 23.2491C59.9817 19.6259 66.4339 20.1967 66.4339 20.1967C64.1508 17.9136 59.2868 19.2537 59.2868 19.2537",fill:"url(#paint1_linear_2183_5890)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2183_5890",x1:"17",y1:"45.3241",x2:"71",y2:"45.3241",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.4",stopColor:"#FF5500"}),jsxRuntimeExports.jsx("stop",{offset:"0.6",stopColor:"#FF2000"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_2183_5890",x1:"22.4879",y1:"18.8219",x2:"66.4339",y2:"18.8219",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FF452A"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#FF2000"})]})]})]}),Crypto=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"white"},children:[jsxRuntimeExports.jsx("mask",{id:"mask0_2091_4394",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"13",y:"9",width:"62",height:"71",children:jsxRuntimeExports.jsx("path",{d:"M44 9L13 26.75V62.25L44 80L75 62.25V26.75L44 9ZM31.7577 24.3492H56.1513L59.0935 36.684H28.9307L31.7577 24.3492ZM41.5613 61.2993L36.2955 66.161H31.8427L20.6924 46.9369L28.8701 40.9079L36.0953 45.4627V53.6578L41.5552 58.8504V61.2993H41.5613ZM37.9759 53.1584L38.7888 45.4326L36.1256 38.5432H51.9229L49.3204 45.4326L50.0787 53.1283L44 53.1584H37.9759ZM56.2059 66.1069H51.8076L46.5419 61.2993V58.8564L52.0018 53.6638V45.4627L59.1421 40.8537L67.2955 46.9369L56.2059 66.1069Z",fill:"#002D74"})}),jsxRuntimeExports.jsxs("g",{mask:"url(#mask0_2091_4394)",children:[jsxRuntimeExports.jsx("rect",{y:"8",width:"44",height:"72",fill:"url(#paint0_linear_2091_4394)"}),jsxRuntimeExports.jsx("rect",{x:"88",y:"80",width:"44",height:"72",transform:"rotate(-180 88 80)",fill:"url(#paint1_linear_2091_4394)"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2091_4394",x1:"22",y1:"8",x2:"22",y2:"80",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#010935"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#142C70"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_2091_4394",x1:"110",y1:"80",x2:"110",y2:"152",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#010935"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#142C70"})]})]})]}),Ledger=({...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"black"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.2106 16H16V29.4577H19.2182V19.2182L37.2106 19.1011V16ZM37.3568 33.4073V54.6179H50.8146V51.3997H40.575L40.458 33.4073H37.3568ZM16 72.1714H37.2106V69.0703L19.2182 68.9533V58.7137H16V72.1714ZM50.9609 16H72.1714V29.4577H68.9533V19.2182L50.9609 19.1011V16ZM72.1714 72.1714H50.9609V69.0703L68.9533 68.9533V58.7137H72.1714V72.1714Z",fill:"white"})}),Steak=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"600",height:"600",viewBox:"0 0 600 600",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"black"},children:[jsxRuntimeExports.jsx("path",{d:"M470.747 209.191C462.305 192.354 448.646 178.695 431.808 170.253C413.337 161 389.233 161 341.006 161C331.236 161 307.916 161 300 161C292.084 161 268.728 161 258.994 161C210.856 161 186.662 161 168.191 170.253C151.354 178.69 137.7 192.35 129.27 209.191C119.999 227.662 120 251.767 120 299.976C120 348.185 119.999 372.308 129.27 390.778C137.7 407.619 151.354 421.279 168.191 429.716C186.662 438.97 210.784 438.97 258.994 438.97C268.764 438.97 292.084 438.97 300 438.97C307.916 438.97 331.272 438.97 341.006 438.97C389.144 438.97 413.337 438.97 431.808 429.716C448.646 421.274 462.305 407.616 470.747 390.778C480 372.308 480 348.203 480 299.976C480 251.749 480 227.662 470.747 209.191Z",fill:"#FFCEAA"}),jsxRuntimeExports.jsx("path",{d:"M218.557 350.342C216.323 345.957 212.922 342.274 208.729 339.698C204.536 337.121 199.713 335.752 194.791 335.741H166.747C163.876 335.755 161.041 336.37 158.422 337.548C155.804 338.725 153.462 340.439 151.547 342.577C149.632 344.716 148.186 347.232 147.303 349.964C146.42 352.696 146.12 355.582 146.422 358.437C147.385 367.476 148.954 374.34 151.575 379.564C157.629 391.573 167.378 401.323 179.388 407.377C188.195 411.798 201.674 413.26 222.444 413.742C225.415 413.812 228.353 413.109 230.97 411.702C233.587 410.295 235.793 408.232 237.373 405.715C238.953 403.199 239.852 400.315 239.982 397.346C240.113 394.378 239.47 391.427 238.116 388.781L218.557 350.342Z",fill:"#FF3B9A"}),jsxRuntimeExports.jsx("path",{d:"M180.618 312.563C189.852 312.562 198.95 310.335 207.14 306.071C215.33 301.806 222.371 295.63 227.668 288.066L254.856 249.253C259.761 242.25 262.839 234.134 263.81 225.64C264.782 217.146 263.616 208.545 260.419 200.616V200.384C258.913 196.555 256.409 193.2 253.167 190.666C249.925 188.133 246.064 186.514 241.985 185.978C209.732 186.085 190.726 186.887 179.405 192.575C167.37 198.586 157.611 208.339 151.592 220.37C146.725 230.247 145.227 258.007 144.87 280.507C144.797 284.698 145.56 288.862 147.114 292.754C148.668 296.647 150.983 300.191 153.923 303.179C156.863 306.167 160.369 308.539 164.236 310.156C168.103 311.774 172.254 312.604 176.445 312.599L180.618 312.563Z",fill:"#FF3B9A"}),jsxRuntimeExports.jsx("path",{d:"M449.702 220.356C443.655 208.365 433.909 198.639 421.906 192.614C409.89 186.588 389.262 186.053 353.337 186C304.664 186 289.528 242 279.134 256.834L248.556 300.497C243.645 307.51 240.729 315.725 240.12 324.266C239.511 332.806 241.231 341.352 245.098 348.991L267.758 393.813C270.842 399.931 275.578 405.063 281.43 408.627C287.282 412.191 294.016 414.045 300.867 413.978H301.49C309.495 413.978 334.171 413.978 342.283 413.978C385.072 413.978 408.713 413.977 421.906 407.381C433.914 401.331 443.66 391.58 449.702 379.568C456.317 366.374 456.316 342.787 456.316 299.944C456.316 257.101 456.317 233.621 449.702 220.356Z",fill:"#FF3B9A"})]}),Unstoppable=({...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"linear-gradient(180deg, #FED812 0%, #FFAF00 100%)"},children:jsxRuntimeExports.jsx("path",{d:"M47.4 43.7163C47.4 45.6251 45.8781 47.1714 44.0001 47.1714C42.1219 47.1714 40.6 45.6251 40.6 43.7163L40.6 -7H27L27 43.7163C27 53.2612 34.6106 61 44.0001 61C53.3882 61 61 53.2612 61 43.7163V-7H47.4V43.7163Z",fill:"#1F2129"})}),ONTO=({...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"white"},children:jsxRuntimeExports.jsx("path",{d:"M20 16L28.675 24.677C32.1885 21.8644 36.4154 20.0873 40.8816 19.545C45.348 19.0026 49.8769 19.7164 53.9604 21.6063C58.0438 23.4963 61.5207 26.4876 64.0005 30.2447C66.4804 34.0019 67.8653 38.3763 68 42.8772V43.5854V72L59.3367 63.3231C55.8263 66.1389 51.6014 67.9196 47.1361 68.4655C42.6708 69.0112 38.1419 68.3007 34.0577 66.4135C29.9734 64.5262 26.4956 61.537 24.0144 57.7813C21.5333 54.0255 20.1472 49.6521 20.0115 45.1515V44.4433L20 16ZM25.931 30.3311V44.4146C25.9323 47.7294 26.8335 50.9817 28.5384 53.8236C30.2432 56.6655 32.6875 58.9902 35.6101 60.5497C38.5328 62.1089 41.8238 62.8439 45.1313 62.6764C48.439 62.5087 51.639 61.4445 54.3894 59.5978L54.8611 59.2754L27.0873 31.4884L25.931 30.3311ZM33.6223 28.4022L33.1505 28.7304L60.9186 56.5117L62.069 57.6632V43.5854C62.0683 40.2717 61.1679 37.0204 59.464 34.179C57.7603 31.3377 55.3171 29.0132 52.3957 27.4539C49.4742 25.8946 46.1844 25.1592 42.8777 25.3262C39.5712 25.4933 36.372 26.5565 33.6223 28.4022Z",fill:"#23262F"})}),Slope=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"#6C67F1"},children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.6667 24.3696L34.8872 40.1864L24.0001 37.7402L37.3334 24.3696L48.4438 13.3798C49.268 12.5646 50.6667 13.1484 50.6667 14.3077V24.3696ZM37.3339 51.0358L50.6672 37.74V24.3694L35.2001 39.8737L37.3339 51.0358Z",fill:"url(#paint0_linear_2593_6077)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.3337 64.2947V50.9617L50.667 37.6284L55.7849 45.8435L55.9822 45.6463L64 50.9616L39.5582 75.2343C38.7347 76.0521 37.3336 75.4687 37.3336 74.3082V64.2949L37.3337 64.2947Z",fill:"url(#paint1_linear_2593_6077)"}),jsxRuntimeExports.jsx("path",{d:"M24 37.7405H32.573C35.202 37.7405 37.3333 39.8718 37.3333 42.5009V51.0359H28.7602C26.1313 51.0359 24 48.9046 24 46.2757V37.7405Z",fill:"#F1F0FF"}),jsxRuntimeExports.jsx("path",{d:"M50.6667 37.7405H59.2398C61.8688 37.7405 64 39.8718 64 42.5009V51.0359H55.4271C52.798 51.0359 50.6667 48.9046 50.6667 46.2757V37.7405Z",fill:"#F1F0FF"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2593_6077",x1:"37.3336",y1:"13",x2:"37.3336",y2:"51.0358",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#A8ADFF"}),jsxRuntimeExports.jsx("stop",{offset:"0.648556",stopColor:"white"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_2593_6077",x1:"50.6668",y1:"37.6284",x2:"50.6668",y2:"75.616",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.260784",stopColor:"#B6BAFF"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#E4E2FF"})]})]})]}),Safe=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"var(--ck-brand-safe)"},children:[jsxRuntimeExports.jsx("path",{d:"M68.7186 44H62.6472C60.8339 44 59.3646 45.4686 59.3646 47.281V56.0888C59.3646 57.9012 57.8952 59.3697 56.0819 59.3697H31.9278C30.1145 59.3697 28.6452 60.8383 28.6452 62.6507V68.719C28.6452 70.5314 30.1145 72 31.9278 72H57.48C59.2933 72 60.7417 70.5314 60.7417 68.719V63.8504C60.7417 62.038 62.2111 60.7524 64.0244 60.7524H68.7174C70.5307 60.7524 72 59.2838 72 57.4714V47.2429C72 45.4305 70.5307 44 68.7174 44H68.7186Z",fill:"#121312"}),jsxRuntimeExports.jsx("path",{d:"M28.6406 31.9308C28.6406 30.1162 30.1104 28.6458 31.9243 28.6458H56.0712C57.8851 28.6458 59.3548 27.1754 59.3548 25.3608V19.285C59.3548 17.4704 57.8851 16 56.0712 16H30.5245C28.7107 16 27.2409 17.4704 27.2409 19.285V23.9666C27.2409 25.7813 25.7711 27.2516 23.9572 27.2516H19.2837C17.4698 27.2516 16 28.722 16 30.5366V40.7888C16 42.6034 17.4759 44 19.2898 44H25.3631C27.177 44 28.6468 42.5296 28.6468 40.715L28.6406 31.932V31.9308Z",fill:"#121312"}),jsxRuntimeExports.jsx("path",{d:"M41.1004 37.6774H46.8995C48.7894 37.6774 50.3226 39.2117 50.3226 41.1004V46.8995C50.3226 48.7894 48.7882 50.3225 46.8995 50.3225H41.1004C39.2106 50.3225 37.6774 48.7882 37.6774 46.8995V41.1004C37.6774 39.2105 39.2118 37.6774 41.1004 37.6774V37.6774Z",fill:"#121312"})]}),Frontier=({...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"#CC703C"},children:jsxRuntimeExports.jsx("path",{d:"M63.6429 20L63.3645 20.7254L62.4521 23.0445L61.8461 24.5395C57.2427 35.7491 53.6629 41.0688 49.8557 41.0688C48.8938 41.0936 47.9371 40.9212 47.0465 40.5625C46.156 40.2038 45.3512 39.6667 44.6834 38.9852L44.1979 38.5518C42.9885 37.4538 42.4799 37.1831 41.3154 37.1832C40.7094 37.1832 39.6238 37.9435 38.2521 39.7303C36.4147 42.2912 34.8522 45.0327 33.59 47.9106L33.4353 48.2482L49.7645 48.2483L47.7312 52.4075H32.4845L32.4843 69.44L28 69.44L28.0001 20L63.6429 20ZM57.2889 24.1518L32.4843 24.1518L32.4843 40.6262C35.4564 35.5545 38.2816 33.0086 41.32 33.0086C42.3421 32.9765 43.3595 33.1534 44.3082 33.5284C45.2569 33.9034 46.1159 34.468 46.8311 35.1865L47.3323 35.6335C48.4611 36.6585 48.8956 36.8941 49.8604 36.8941C50.9211 36.8957 53.7433 32.4855 57.2889 24.1518Z",fill:"white"})}),Zerion=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"linear-gradient(120.22deg, #2962EF 0%, #255CE5 100%)"},children:[jsxRuntimeExports.jsx("path",{d:"M19.0864 22C17.5783 22 16.9973 23.8648 18.2628 24.6438L49.9199 43.732C50.709 44.2178 51.7614 44.0258 52.3048 43.2969L66.2236 25.024C67.17 23.7545 66.2138 22 64.5757 22H19.0864Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M68.8425 66C70.3503 66 70.9466 64.1252 69.6814 63.3464L38.015 44.2605C37.2259 43.7748 36.1989 43.991 35.6558 44.7198L21.7099 62.9891C20.7639 64.2582 21.7499 66 23.3877 66H68.8425Z",fill:"white"})]}),Phantom=({background:o=!1,...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:o?{background:"#AB9FF2"}:void 0,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.7425 57.0705C34.1942 62.3362 28.2483 69 20.3366 69C16.5965 69 13.0001 67.5093 13 61.0322C12.9997 44.5362 36.2555 19.0003 57.8334 19C70.1084 18.9998 75 27.2474 75 36.6136C75 48.6357 66.9442 62.3824 58.9368 62.3824C56.3955 62.3824 55.1487 61.031 55.1487 58.888C55.1487 58.3288 55.2442 57.7228 55.4365 57.0705C52.7029 61.5902 47.4285 65.7849 42.4896 65.7849C38.8933 65.7849 37.0713 63.5944 37.0713 60.5187C37.0713 59.4003 37.311 58.2357 37.7425 57.0705ZM53.7586 31.6834C51.8054 31.6868 50.4738 33.2938 50.478 35.5864C50.4822 37.879 51.8198 39.5273 53.7729 39.5241C55.6789 39.5208 57.0099 37.8679 57.0058 35.5752C57.0016 33.2827 55.6646 31.6802 53.7586 31.6834ZM64.1193 31.6725C62.1661 31.6759 60.8345 33.2829 60.8387 35.5755C60.8429 37.868 62.1798 39.5164 64.1336 39.5131C66.0396 39.5099 67.3706 37.8569 67.3664 35.5643C67.3622 33.2718 66.0253 31.6693 64.1193 31.6725Z",fill:o?"#ffffff":"currentColor"})}),PlaceHolder=()=>jsxRuntimeExports.jsx("div",{style:{width:80,height:80,background:"#555"}}),Dawn=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"88px",height:"88px",viewBox:"0 0 192 192",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"linearGradient-1",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#151515",offset:"0%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#232323",offset:"100%"})]}),jsxRuntimeExports.jsx("rect",{rx:"27%",id:"path-2",x:"0",y:"0",width:"192",height:"192"}),jsxRuntimeExports.jsxs("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"99.7051532%",id:"linearGradient-3",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#F3DC83",offset:"0%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#F9EEC8",offset:"100%"})]})]}),jsxRuntimeExports.jsx("g",{id:"Icons---Pixel-Fitted",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:jsxRuntimeExports.jsxs("g",{id:"Group",children:[jsxRuntimeExports.jsxs("g",{id:"Rectangle",children:[jsxRuntimeExports.jsx("use",{fill:"#232323",xlinkHref:"#path-2"}),jsxRuntimeExports.jsx("use",{fill:"url(#linearGradient-1)",xlinkHref:"#path-2"})]}),jsxRuntimeExports.jsx("path",{d:"M123.748399,157.001808 C115.293464,160.853955 105.89735,163 96,163 C86.1026503,163 76.7065363,160.853955 68.2516012,157.001808 Z M146.526595,140.002206 C144.677242,142.123986 142.696426,144.128189 140.59684,146.002121 L51.4031598,146.002121 C49.3035743,144.128189 47.3227581,142.123986 45.4734054,140.002206 Z M157.337411,122.999613 C155.955969,126.133404 154.34141,129.141319 152.515704,132.001388 L39.484296,132.001388 C37.6585895,129.141319 36.0440306,126.133404 34.662589,122.999613 Z M96,29 C133.003078,29 163,58.9969218 163,96 C163,103.706309 161.69895,111.108742 159.304524,117.999626 L32.6954763,117.999626 C30.3010496,111.108742 29,103.706309 29,96 C29,58.9969218 58.9969218,29 96,29 Z",id:"Combined-Shape",fill:"url(#linearGradient-3)"})]})})]}),InfinityWallet=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,version:"1.1",id:"e551690a-81c0-4880-9b93-334a37ce6796",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 1025 1025",children:[jsxRuntimeExports.jsx("style",{type:"text/css",children:` + .infinityWallet-st0{fill:url(#ID_InfinityWallet_1);} + .infinityWallet-st1{fill:url(#ID_InfinityWallet_2);} + .infinityWallet-st2{opacity:0.49;fill:url(#ID_InfinityWallet_3);enable-background:new;} + .infinityWallet-st3{opacity:0.49;fill:url(#ID_InfinityWallet_4);enable-background:new;} + .infinityWallet-st4{opacity:0.49;fill:url(#ID_InfinityWallet_5);enable-background:new;} + .infinityWallet-st5{fill:url(#ID_InfinityWallet_6);} + .infinityWallet-st6{opacity:0.49;fill:url(#ID_InfinityWallet_7);enable-background:new;} + .infinityWallet-st7{opacity:0.49;fill:url(#ID_InfinityWallet_8);enable-background:new;} + .infinityWallet-st8{opacity:0.49;fill:url(#ID_InfinityWallet_9);enable-background:new;} + `}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_1",gradientUnits:"userSpaceOnUse",x1:"512.5",y1:"1056.1801",x2:"512.5",y2:"317.03",gradientTransform:"matrix(1 0 0 -1 0 1260)",children:[jsxRuntimeExports.jsx("stop",{offset:"0",style:{stopColor:"#1D2643"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#12142C"}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st0",d:`M130,0H895c71.8,0,130,58.2,130,130V895c0,71.8-58.2,130-130,130H130C58.2,1025,0,966.8,0,895V130 + C0,58.2,58.2,0,130,0z`}),jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_2",gradientUnits:"userSpaceOnUse",x1:"326.0557",y1:"-1280.3162",x2:"326.0557",y2:"-296.3967",gradientTransform:"matrix(1 0 0 1 0 1474)",children:[jsxRuntimeExports.jsx("stop",{offset:"1.000000e-02",style:{stopColor:"#00BFE1"}}),jsxRuntimeExports.jsx("stop",{offset:"0.97",style:{stopColor:"#2738AB"}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st1",d:`M550.9,380.8c-0.7-2-2.4-3.4-4.4-3.9c-2.3-0.6-4.7,0-6.4,1.7l-13.4,13.4l-2.2,2.2L418.3,288.5 + c-40.2-40-105.2-40-145.4,0L121.7,439.9c-40,40.5-40,105.6,0,146.1l151.4,150.5c40.2,40,105.1,40,145.3,0l34.4-34.4 + c4.5-4.5,9.9-10.7,12.9-18.7c4.7-13.1,2.8-27.7-5.2-39.1c-1.5-2.2-3.2-4.2-5.1-6c-16.9-16.5-43.9-16.3-60.7,0.3l-37.2,37.1 + c-2.2,2.3-5,3.8-8.1,4.5c-2.9,0.7-6,0.5-8.8-0.6c-2.9-1-5.5-2.7-7.7-5L182.6,524.2c-2.3-2.3-3.9-5.2-4.6-8.4 + c-0.8-4-0.1-8.2,2.1-11.8l0.8-0.9L334,350.3c2.4-2.4,5.4-4,8.7-4.6c1-0.2,2.1-0.3,3.1-0.3c4.4-0.1,8.7,1.7,11.7,5l105.8,105.2 + l-5.3,5.3l-10.4,10.6c-1.7,1.7-2.3,4.1-1.7,6.4c0.5,2,2,3.7,3.9,4.4l95.7,11.7c8.2-0.1,14.8-6.7,15-15L550.9,380.8z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_3",gradientUnits:"userSpaceOnUse",x1:"137.7126",y1:"-935.1906",x2:"201.098",y2:"-882.1746",gradientTransform:"matrix(1 0 0 1 -0.94 1473.3899)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st2",d:"M181.4,522.9c-4.3-4.9-5.1-13.3-1.3-19c0,0-49.7,54.3-25.8,114.4l31.5,31.3l45.8-76.2L181.4,522.9z"}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_4",gradientUnits:"userSpaceOnUse",x1:"4132.3252",y1:"1674.2513",x2:"4102.1333",y2:"1717.0756",gradientTransform:"matrix(-1 0 0 -1 4515 2382.0898)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st3",d:`M336.4,677.7c56.1,51.6,117.9,22.9,117.9,22.9s8.1-7.5,11.4-17.4c-8.3-4-68.6-47.2-68.6-47.2l-35.6,35.6 + C348.6,687.1,336.4,677.7,336.4,677.7z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_5",gradientUnits:"userSpaceOnUse",x1:"4217.4238",y1:"2067.1885",x2:"4240.0796",y2:"2011.1337",gradientTransform:"matrix(-1 0 0 -1 4515 2382.0898)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st4",d:"M299.4,385c0,0,35.9-36.2,36-36c0,0,9.6-7.7,19.7-0.7c0,0-59.7-49.2-123.6-18.3l-18.6,18.7L299.4,385z"})]}),jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_6",gradientUnits:"userSpaceOnUse",x1:"698.9443",y1:"-1280.3162",x2:"698.9443",y2:"-296.3967",gradientTransform:"matrix(1 0 0 1 0 1474)",children:[jsxRuntimeExports.jsx("stop",{offset:"1.000000e-02",style:{stopColor:"#00BFE1"}}),jsxRuntimeExports.jsx("stop",{offset:"0.97",style:{stopColor:"#2738AB"}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st5",d:`M474.1,644.3c0.7,2,2.4,3.4,4.4,3.9c2.3,0.6,4.7,0,6.4-1.7l13.4-13.4l2.2-2.2l106.2,105.6 + c40.2,40,105.2,40,145.4,0l151.2-151.4c40-40.5,40-105.6,0-146.1L751.9,288.5c-40.2-40-105.1-40-145.3,0l-34.4,34.4 + c-4.5,4.5-9.9,10.7-12.9,18.7c-4.7,13.1-2.8,27.7,5.2,39.1c1.5,2.2,3.2,4.2,5.1,6c16.9,16.5,43.9,16.3,60.7-0.3l37.2-37.1 + c2.2-2.3,5-3.8,8.1-4.5c2.9-0.7,6-0.5,8.8,0.6c2.9,1,5.5,2.7,7.7,5l150.3,150.3c2.3,2.3,3.9,5.2,4.6,8.4c0.8,4,0.1,8.2-2.1,11.8 + l-0.8,0.9L691,674.5c-2.4,2.4-5.4,4-8.7,4.6c-1,0.2-2.1,0.3-3.1,0.3c-4.4,0.1-8.7-1.7-11.7-5L561.6,569.7l5.3-5.3l10.4-10.6 + c1.7-1.7,2.3-4.1,1.7-6.4c-0.5-2-2-3.7-3.9-4.4l-95.6-11.7c-8.2,0.1-14.8,6.7-15,15L474.1,644.3z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_7",gradientUnits:"userSpaceOnUse",x1:"3824.9182",y1:"1469.7789",x2:"3888.3037",y2:"1522.7949",gradientTransform:"matrix(-1 0 0 -1 4713.1299 1956.6599)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st6",d:"M843.6,502.2c4.3,4.9,5.1,13.3,1.3,19c0,0,49.7-54.3,25.8-114.4l-31.5-31.3l-45.8,76.2L843.6,502.2z"}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_8",gradientUnits:"userSpaceOnUse",x1:"445.1279",y1:"-730.6945",x2:"414.9359",y2:"-687.8702",gradientTransform:"matrix(1 0 0 1 197.19 1047.96)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st7",d:`M688.6,347.4c-56.1-51.6-117.9-22.9-117.9-22.9s-8.1,7.5-11.4,17.4c8.3,4,68.6,47.2,68.6,47.2l35.6-35.6 + C676.4,338,688.6,347.4,688.6,347.4z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_9",gradientUnits:"userSpaceOnUse",x1:"530.1512",y1:"-337.7953",x2:"552.8069",y2:"-393.8502",gradientTransform:"matrix(1 0 0 1 197.19 1047.96)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st8",d:"M725.5,640.1c0,0-35.9,36.2-36,36c0,0-9.6,7.7-19.7,0.7c0,0,59.7,49.2,123.6,18.3l18.6-18.7L725.5,640.1z"})]})]})]}),Rabby=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"#8697FF"},children:[jsxRuntimeExports.jsx("path",{d:"M76.2062 48.0657C78.7621 42.356 66.1267 26.404 54.0555 19.7581C46.4467 14.6095 38.5183 15.3169 36.9125 17.5775C33.3886 22.5385 48.5814 26.7423 58.742 31.6478C56.5579 32.5964 54.4996 34.2987 53.2893 36.4758C49.5013 32.3404 41.1872 28.7791 31.4315 31.6478C24.8574 33.5809 19.3937 38.1382 17.2821 45.0216C16.7689 44.7936 16.2009 44.6669 15.6032 44.6669C13.3176 44.6669 11.4648 46.5197 11.4648 48.8052C11.4648 51.0908 13.3176 52.9435 15.6032 52.9435C16.0268 52.9435 17.3514 52.6594 17.3514 52.6594L38.5183 52.8128C30.0532 66.2418 23.3634 68.2049 23.3634 70.5314C23.3634 72.8579 29.7643 72.2274 32.1678 71.3602C43.6732 67.2088 56.0306 54.2706 58.1511 50.5462C67.056 51.6572 74.5397 51.7886 76.2062 48.0657Z",fill:"url(#paint0_linear_60607_36577)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.65 31.6053C58.682 31.6193 58.7139 31.6332 58.7458 31.6471C59.2168 31.4616 59.1406 30.766 59.0113 30.2198C58.714 28.9643 53.5856 23.9001 48.7696 21.6318C42.1984 18.5367 37.3618 18.7007 36.6582 20.1307C37.9975 22.8695 44.1927 25.441 50.663 28.1266C53.3909 29.2589 56.1676 30.4114 58.65 31.6053Z",fill:"url(#paint1_linear_60607_36577)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4154 59.2247C49.0895 58.7182 47.592 58.2536 45.8898 57.8319C47.707 54.5801 48.0884 49.7663 46.3721 46.7226C43.9635 42.4512 40.9399 40.1777 33.9139 40.1777C30.0495 40.1777 19.6451 41.4794 19.4603 50.1648C19.441 51.0763 19.4599 51.9118 19.5259 52.68L38.5175 52.8176C35.9568 56.8798 33.5586 59.8928 31.4589 62.1841C33.9831 62.8309 36.0657 63.3738 37.9775 63.8722C39.7885 64.3443 41.4462 64.7764 43.1809 65.2191C45.8007 63.3102 48.2635 61.2288 50.4154 59.2247Z",fill:"url(#paint2_linear_60607_36577)"}),jsxRuntimeExports.jsx("path",{d:"M17.0296 51.7821C17.8058 58.38 21.5555 60.9657 29.2177 61.7309C36.8799 62.4961 41.2751 61.9828 47.1265 62.5151C52.0136 62.9598 56.3772 65.4502 57.996 64.5895C59.4529 63.815 58.6378 61.0167 56.6884 59.2214C54.1614 56.8943 50.6641 55.2763 44.5104 54.7021C45.7368 51.3443 45.3931 46.6362 43.4885 44.0748C40.7345 40.3711 35.6513 38.6967 29.2177 39.4282C22.4962 40.1926 16.0556 43.5018 17.0296 51.7821Z",fill:"url(#paint3_linear_60607_36577)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_60607_36577",x1:"30.666",y1:"43.0094",x2:"75.6558",y2:"55.7677",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_60607_36577",x1:"68.0842",y1:"42.1521",x2:"35.6221",y2:"9.60636",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#7258DC"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#797DEA",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint2_linear_60607_36577",x1:"51.3184",y1:"60.3591",x2:"20.1383",y2:"42.4347",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#7461EA"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#BFC2FF",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint3_linear_60607_36577",x1:"33.3531",y1:"42.6732",x2:"54.4308",y2:"69.4547",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"0.983895",stopColor:"#D5CEFF"})]})]})]}),TokenPocket=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"88px",height:"88px",viewBox:"0 0 88 88",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{x1:"107.511425%",y1:"50.0147427%",x2:"0.0459570557%",y2:"50.0147427%",id:"linearGradient-1",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FFFFFF",offset:"0%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#FFFFFF",stopOpacity:"0.3233",offset:"96.67%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#FFFFFF",stopOpacity:"0.3",offset:"100%"})]})}),jsxRuntimeExports.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:jsxRuntimeExports.jsxs("g",{id:"tokenpocket",fillRule:"nonzero",children:[jsxRuntimeExports.jsx("polygon",{fill:"#2980FE",points:"87.9604864 0 0 0 0 88 87.9604864 88"}),jsxRuntimeExports.jsxs("g",{transform:"translate(16.052385, 23.804688)",children:[jsxRuntimeExports.jsx("path",{d:"M19.6653508,13.8911953 L19.6784508,13.8911953 C19.6653508,13.8236484 19.6653508,13.7448437 19.6653508,13.6772969 L19.6653508,13.8911953 Z",fill:"#29AEFF"}),jsxRuntimeExports.jsx("path",{d:"M41.1271993,16.0301797 L29.2440711,16.0301797 L29.2440711,38.4205938 C29.2440711,39.4787422 30.0635659,40.3343359 31.0771712,40.3343359 L39.2940168,40.3343359 C40.3077044,40.3343359 41.1271993,39.4787422 41.1271993,38.4205938 L41.1271993,16.0301797 Z",fill:"#FFFFFF"}),jsxRuntimeExports.jsx("path",{d:"M23.5075248,0 L23.1085201,0 L1.83318241,0 C0.819494855,0 0,0.855507812 0,1.91374219 L0,9.68111719 C0,10.7393516 0.819494855,11.5948594 1.83318241,11.5948594 L6.82580355,11.5948594 L8.80996071,11.5948594 L8.80996071,13.8912813 L8.80996071,38.4768828 C8.80996071,39.5351172 9.62945557,40.390625 10.6430608,40.390625 L18.4502002,40.390625 C19.4638054,40.390625 20.2833003,39.5351172 20.2833003,38.4768828 L20.2833003,13.8912813 L20.2833003,13.6774688 L20.2833003,11.5948594 L22.2674574,11.5948594 L23.0761684,11.5948594 L23.4751731,11.5948594 C26.5376389,11.5948594 29.0285575,8.99447656 29.0285575,5.79742969 C29.0609093,2.60038281 26.5699906,0 23.5075248,0 Z",fill:"#FFFFFF"}),jsxRuntimeExports.jsx("path",{d:"M41.1381478,16.0301797 L41.1381478,31.6550781 C41.5479364,31.7563984 41.9684266,31.8352031 42.399783,31.90275 C43.0036819,31.9928125 43.6290664,32.0491016 44.2545332,32.0603594 C44.2868849,32.0603594 44.3192367,32.0603594 44.3623723,32.0603594 L44.3623723,19.6324219 C42.5615416,19.5085859 41.1381478,17.9438359 41.1381478,16.0301797 Z",fill:"url(#linearGradient-1)"}),jsxRuntimeExports.jsx("path",{d:"M44.5993714,0 C36.1237942,0 29.2440711,7.18205469 29.2440711,16.0301797 C29.2440711,23.6400312 34.3229635,30.0115234 41.1379832,31.6550781 L41.1379832,16.0301797 C41.1379832,14.0376328 42.6907839,12.4165937 44.5993714,12.4165937 C46.5080412,12.4165937 48.0608419,14.0376328 48.0608419,16.0301797 C48.0608419,17.7075078 46.9717493,19.1146484 45.483652,19.5198437 C45.2032703,19.5986484 44.9013209,19.6436797 44.5993714,19.6436797 L44.5993714,32.0603594 C44.9013209,32.0603594 45.1924864,32.0491016 45.483652,32.0378438 C53.5495229,31.5537578 59.9547666,24.5743438 59.9547666,16.0301797 C59.9655379,7.18205469 53.0858148,0 44.5993714,0 Z",fill:"#FFFFFF"}),jsxRuntimeExports.jsx("path",{d:"M44.5992891,32.0603594 L44.5992891,19.6436797 C44.5131001,19.6436797 44.4376127,19.6436797 44.3513414,19.6324219 L44.3513414,32.0603594 C44.4376127,32.0603594 44.523884,32.0603594 44.5992891,32.0603594 Z",fill:"#FFFFFF"})]})]})})]}),Talisman=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"82",height:"82",viewBox:"0 0 82 82",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"82",height:"82",rx:"12",fill:"#D5FF5C"}),jsxRuntimeExports.jsx("path",{d:"M35.04 55C35.04 58.2905 37.6887 60.9623 40.9703 60.9996C44.2519 60.9623 46.9006 58.2905 46.9006 55C46.9006 51.7096 44.2519 49.0377 40.9703 49.0004C37.6887 49.0377 35.04 51.7096 35.04 55Z",fill:"#FD4848"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.8544 44.6623C22.2462 45.9868 20.4553 46.4546 19.4248 45.4241L17.5356 43.5349C15.583 41.5823 12.4171 41.5823 10.4645 43.5349C8.51184 45.4875 8.51184 48.6534 10.4645 50.606L25.7391 65.8807C29.3942 70.2176 34.8595 72.9788 40.9703 72.9994C47.0811 72.9788 52.5464 70.2176 56.2014 65.8807L71.4761 50.606C73.4287 48.6534 73.4287 45.4875 71.4761 43.5349C69.5234 41.5823 66.3576 41.5823 64.4049 43.5349L62.5158 45.4241C61.4852 46.4546 59.6943 45.9868 59.0861 44.6623C58.9663 44.4013 58.901 44.1213 58.901 43.8341L58.901 20.9995C58.901 18.2381 56.6624 15.9995 53.901 15.9995C51.1396 15.9995 48.901 18.2381 48.901 20.9995L48.901 32.5568C48.901 33.5506 47.8829 34.2252 46.9353 33.9257C46.3356 33.7361 45.9023 33.1901 45.9023 32.5611L45.9023 13.9996C45.9023 11.2608 43.7004 9.03637 40.9703 9C38.2402 9.03637 36.0382 11.2608 36.0382 13.9996L36.0382 32.5611C36.0382 33.1901 35.605 33.7361 35.0052 33.9257C34.0576 34.2252 33.0395 33.5506 33.0395 32.5568L33.0396 20.9995C33.0396 18.2381 30.801 15.9995 28.0395 15.9995C25.2781 15.9995 23.0395 18.2381 23.0395 20.9995L23.0395 43.8341C23.0395 44.1213 22.9743 44.4013 22.8544 44.6623ZM40.9703 44.9999C32.1659 45.0525 25.0403 54.9997 25.0403 54.9997C25.0403 54.9997 32.1659 64.9469 40.9703 64.9995C49.7746 64.9469 56.9002 54.9997 56.9002 54.9997C56.9002 54.9997 49.7746 45.0525 40.9703 44.9999Z",fill:"#FD4848"})]}),OtherWallets=({...o})=>{const et={position:"relative",display:"flex",flexDirection:"column",gap:2},tt={position:"relative",display:"flex",gap:2},nt={width:"50%",overflow:"hidden",borderRadius:"27.5%"};return jsxRuntimeExports.jsxs("div",{style:et,...o,children:[jsxRuntimeExports.jsxs("div",{style:tt,children:[jsxRuntimeExports.jsx("div",{style:nt,children:jsxRuntimeExports.jsx(WalletConnect,{background:!0})}),jsxRuntimeExports.jsx("div",{style:nt,children:isZerion()?jsxRuntimeExports.jsx(Phantom,{}):jsxRuntimeExports.jsx(Zerion,{})})]}),jsxRuntimeExports.jsxs("div",{style:tt,children:[jsxRuntimeExports.jsx("div",{style:nt,children:isFamily()?jsxRuntimeExports.jsx(ImToken,{}):jsxRuntimeExports.jsx(Family,{})}),jsxRuntimeExports.jsx("div",{style:nt,children:isRainbow()?jsxRuntimeExports.jsx(Trust,{}):jsxRuntimeExports.jsx(Rainbow,{})})]})]})},Fordefi=({...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"88",height:"88",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_14298_75627)",children:[jsxRuntimeExports.jsx("path",{d:"M43.5075 62.5508H6V73.5954C6 79.2046 10.5379 83.7515 16.1357 83.7515H32.9997L43.5075 62.5508Z",fill:"#7994FF"}),jsxRuntimeExports.jsx("path",{d:"M6.00098 39.1016H76.2075L68.0567 55.4841H6.00098V39.1016Z",fill:"#486DFF"}),jsxRuntimeExports.jsx("path",{d:"M30.6398 12H6.09766V32.0282H89.8447V12H65.3025V26.9577H60.2423V12H35.7001V26.9577H30.6398V12Z",fill:"#5CD1FA"})]}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_14298_75627",children:jsxRuntimeExports.jsx("rect",{width:"84",height:"72",fill:"white",transform:"translate(6 12)"})})})]});var Logos={Mock,Injected,OtherWallets,WalletConnect,MetaMask,Coinbase,Family,Trust,Argent,ImToken,Rainbow,Crypto,Ledger,Brave:Brave$1,Steak,Unstoppable,ONTO,Slope,Safe,Frontier,Zerion,Phantom,PlaceHolder,Frame,Dawn,InfinityWallet,Rabby,Fordefi,TokenPocket,Talisman};const truncateRegex=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/,truncateEthAddress=(o,et="••••")=>{if(!o)return"";const tt=o.match(truncateRegex);return tt?`${tt[1]}${et}${tt[2]}`:o},truncateENSAddress=(o,et)=>o.length>et?o.replace(".eth","").slice(0,et)+"...":o,nFormatter=(o,et=2)=>{if(o<1e4)return o.toFixed(2);const tt=[{value:1,symbol:""},{value:1e3,symbol:"k"},{value:1e6,symbol:"m"},{value:1e9,symbol:"g"},{value:1e12,symbol:"t"},{value:1e15,symbol:"p"},{value:1e18,symbol:"e"}],nt=/\.0+$|(\.[0-9]*[1-9])0+$/;var rt=tt.slice().reverse().find(function(ot){return o>=ot.value});return rt?(o/rt.value).toFixed(et).replace(nt,"$1")+rt.symbol:"0"},detectBrowser=()=>{var o;const et=detect();return(o=et==null?void 0:et.name)!==null&&o!==void 0?o:""},detectOS=()=>{var o;const et=detect();return(o=et==null?void 0:et.os)!==null&&o!==void 0?o:""},isIOS=()=>detectOS().toLowerCase().includes("ios"),isAndroid=()=>detectOS().toLowerCase().includes("android"),isMobile=()=>isAndroid()||isIOS();function flattenChildren(o){return React.Children.toArray(o).reduce((tt,nt)=>nt.type===React.Fragment?tt.concat(flattenChildren(nt.props.children)):(tt.push(nt),tt),[])}const isWalletConnectConnector=o=>o==="walletConnect",isCoinbaseWalletConnector=o=>o==="coinbaseWalletSDK",isSafeConnector=o=>o==="safe",isInjectedConnector=o=>o==="injected",walletConfigs={mock:{icon:jsxRuntimeExports.jsx(Logos.Mock,{})},argent:{name:"Argent",icon:jsxRuntimeExports.jsx(Logos.Argent,{}),downloadUrls:{download:"https://connect.family.co/v0/download/argent",android:"https://play.google.com/store/apps/details?id=im.argent.contractwalletclient",ios:"https://apps.apple.com/app/argent/id1358741926"},getWalletConnectDeeplink:o=>isAndroid()?o:`https://argent.link/app/wc?uri=${encodeURIComponent(o)}`},"coinbaseWallet, coinbaseWalletSDK":{name:"Coinbase Wallet",shortName:"Coinbase",icon:jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0}),iconShape:"squircle",downloadUrls:{download:"https://connect.family.co/v0/download/coinbasewallet",website:"https://www.coinbase.com/wallet/getting-started-extension",android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/app/coinbase-wallet-store-crypto/id1278383455",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad"},getWalletConnectDeeplink:o=>`https://go.cb-w.com/wc?uri=${encodeURIComponent(o)}`},"com.coinbase.wallet":{name:"Coinbase Wallet",shortName:"Coinbase",icon:jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0}),iconShape:"circle",downloadUrls:{download:"https://connect.family.co/v0/download/coinbasewallet",website:"https://www.coinbase.com/wallet/getting-started-extension",android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/app/coinbase-wallet-store-crypto/id1278383455",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad"},getWalletConnectDeeplink:o=>`https://go.cb-w.com/wc?uri=${encodeURIComponent(o)}`},"com.crypto.wallet":{name:"Crypto.com",shortName:"Crypto"},dawn:{name:"Dawn Wallet",shortName:"Dawn",downloadUrls:{download:"https://apps.apple.com/us/app/dawn-ethereum-wallet/id1673143782",website:"https://www.dawnwallet.xyz/",ios:"https://apps.apple.com/us/app/dawn-ethereum-wallet/id1673143782"}},"co.family.wallet":{name:"Family",shortName:"Family",icon:jsxRuntimeExports.jsx(Logos.Family,{}),iconShape:"squircle",downloadUrls:{download:"https://connect.family.co/v0/download/family",website:"https://family.co",ios:"https://family.co/download"},getWalletConnectDeeplink:o=>isAndroid()?o:`familywallet://wc?uri=${encodeURIComponent(o)}`},frame:{name:"Frame",icon:jsxRuntimeExports.jsx(Logos.Frame,{}),iconShouldShrink:!0,downloadUrls:{download:"https://connect.family.co/v0/download/frame",website:"https://frame.sh",chrome:"https://chrome.google.com/webstore/detail/frame-companion/ldcoohedfbjoobcadoglnnmmfbdlmmhf",firefox:"https://addons.mozilla.org/en-US/firefox/addon/frame-extension",brave:"https://chrome.google.com/webstore/detail/frame-companion/ldcoohedfbjoobcadoglnnmmfbdlmmhf"},getWalletConnectDeeplink:o=>o},frontier:{name:"Frontier Wallet",shortName:"Frontier",icon:jsxRuntimeExports.jsx(Logos.Frontier,{}),downloadUrls:{download:"https://connect.family.co/v0/download/frontier",ios:"https://apps.apple.com/app/frontier-crypto-defi-wallet/id1482380988",android:"https://play.google.com/store/apps/details?id=com.frontierwallet",website:"https://frontier.xyz/",chrome:"https://chrome.google.com/webstore/detail/frontier-wallet/kppfdiipphfccemcignhifpjkapfbihd"},getWalletConnectDeeplink:o=>isAndroid()?o:`frontier://wc?uri=${encodeURIComponent(o)}`},injected:{name:"Browser Wallet",shortName:"Browser",icon:jsxRuntimeExports.jsx(Logos.Injected,{})},"metaMask, metaMask-io, io.metamask, io.metamask.mobile, metaMaskSDK":{name:"MetaMask",icon:jsxRuntimeExports.jsx(Logos.MetaMask,{}),iconConnector:jsxRuntimeExports.jsx(Logos.MetaMask,{}),iconShouldShrink:!0,downloadUrls:{download:"https://connect.family.co/v0/download/metamask",website:"https://metamask.io/download/",android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/app/metamask/id1438144202",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask/",brave:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm"},getWalletConnectDeeplink:o=>isAndroid()?o:`https://metamask.app.link/wc?uri=${encodeURIComponent(o)}`},"app.phantom":{name:"Phantom",iconShape:"squircle"},"me.rainbow":{name:"Rainbow Wallet",shortName:"Rainbow",icon:jsxRuntimeExports.jsx(Logos.Rainbow,{}),iconShape:"squircle",downloadUrls:{download:"https://connect.family.co/v0/download/rainbow",website:"https://rainbow.me/?utm_source=connectkit",android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Dconnectkit&utm_source=connectkit",ios:"https://apps.apple.com/app/rainbow-ethereum-wallet/id1457119021?pt=119997837&ct=connectkit&mt=8",chrome:"https://rainbow.me/extension?utm_source=connectkit",edge:"https://rainbow.me/extension?utm_source=connectkit",brave:"https://rainbow.me/extension?utm_source=connectkit"},getWalletConnectDeeplink:o=>isAndroid()?o:`https://rnbwapp.com/wc?uri=${encodeURIComponent(o)}&connector=connectkit`},"io.rabby":{name:"Rabby Wallet",shortName:"Rabby",downloadUrls:{website:"https://rabby.io",chrome:"https://chrome.google.com/webstore/detail/rabby-wallet/acmacodkjbdgmoleebolmdjonilkdbch"}},safe:{name:"Safe",icon:jsxRuntimeExports.jsx(Logos.Safe,{}),downloadUrls:{download:"https://connect.family.co/v0/download/safe",website:"https://safe.global/",ios:"https://apps.apple.com/app/id1515759131",android:"https://play.google.com/store/apps/details?id=io.gnosis.safe"},getWalletConnectDeeplink:o=>isAndroid()?o:`https://gnosis-safe.io/wc?uri=${encodeURIComponent(o)}`},"xyz.talisman":{name:"Talisman",shortName:"Talisman",iconShape:"squircle",downloadUrls:{download:"https://talisman.xyz/download",website:"https://talisman.xyz",chrome:"https://chrome.google.com/webstore/detail/talisman-polkadot-wallet/fijngjgcjhjmmpcmkeiomlglpeiijkld",firefox:"https://addons.mozilla.org/en-US/firefox/addon/talisman-wallet-extension/"}},"com.trustwallet.app":{name:"Trust Wallet",shortName:"Trust",icon:jsxRuntimeExports.jsx(Logos.Trust,{}),iconShouldShrink:!0,downloadUrls:{download:"https://connect.family.co/v0/download/trust",android:"https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp",ios:"https://apps.apple.com/app/trust-crypto-bitcoin-wallet/id1288339409"},getWalletConnectDeeplink(o){return isAndroid()?o:`https://link.trustwallet.com/wc?uri=${encodeURIComponent(o)}`}},infinityWallet:{name:"Infinity Wallet",icon:jsxRuntimeExports.jsx(Logos.InfinityWallet,{}),downloadUrls:{download:"https://connect.family.co/v0/download/infinityWallet",website:"https://infinitywallet.io/download",chrome:"https://infinitywallet.io/download",firefox:"https://infinitywallet.io/download",brave:"https://infinitywallet.io/download",edge:"https://infinitywallet.io/download"}},imToken:{name:"imToken",icon:jsxRuntimeExports.jsx(Logos.ImToken,{}),downloadUrls:{download:"https://connect.family.co/v0/download/imToken",android:"https://play.google.com/store/apps/details?id=im.token.app",ios:"https://itunes.apple.com/us/app/imtoken2/id1384798940"},getWalletConnectDeeplink:o=>`imtokenv2://wc?uri=${encodeURIComponent(o)}`},unstoppable:{name:"Unstoppable",icon:jsxRuntimeExports.jsx(Logos.Unstoppable,{}),downloadUrls:{download:"https://connect.family.co/v0/download/unstoppable",ios:"https://apps.apple.com/app/bank-bitcoin-wallet/id1447619907",android:"https://play.google.com/store/apps/details?id=io.horizontalsystems.bankwallet"},getWalletConnectDeeplink:o=>isAndroid()?o:`https://unstoppable.money/wc?uri=${encodeURIComponent(o)}`},onto:{name:"ONTO",icon:jsxRuntimeExports.jsx(Logos.ONTO,{}),downloadUrls:{download:"https://connect.family.co/v0/download/onto",ios:"https://apps.apple.com/app/onto-an-ontology-dapp/id1436009823",android:"https://play.google.com/store/apps/details?id=com.github.ontio.onto",website:"https://onto.app/en/download/"},getWalletConnectDeeplink:o=>isAndroid()?o:`https://onto.app/wc?uri=${encodeURIComponent(o)}`},steak:{name:"Steak",icon:jsxRuntimeExports.jsx(Logos.Steak,{}),downloadUrls:{download:"https://connect.family.co/v0/download/steak",android:"https://play.google.com/store/apps/details?id=fi.steakwallet.app",ios:"https://apps.apple.com/app/steakwallet/id1569375204",website:"https://steakwallet.fi/download"},getWalletConnectDeeplink:o=>isAndroid()?o:`https://links.steakwallet.fi/wc?uri=${encodeURIComponent(o)}`},ledger:{name:"Ledger Live",shortName:"Ledger",icon:jsxRuntimeExports.jsx(Logos.Ledger,{}),downloadUrls:{download:"https://connect.family.co/v0/download/ledger",website:"https://www.ledger.com/ledger-live/download#download-device-2",android:"https://play.google.com/store/apps/details?id=com.ledger.live",ios:"https://apps.apple.com/app/ledger-live-web3-wallet/id1361671700"},getWalletConnectDeeplink:o=>isAndroid()?o:`ledgerlive://wc?uri=${encodeURIComponent(o)}`,shouldDeeplinkDesktop:!0},zerion:{name:"Zerion",icon:jsxRuntimeExports.jsx(Logos.Zerion,{}),downloadUrls:{download:"https://connect.family.co/v0/download/zerion",ios:"https://apps.apple.com/app/apple-store/id1456732565",android:"https://play.google.com/store/apps/details?id=io.zerion.android",website:"https://zerion.io/"},getWalletConnectDeeplink:o=>isAndroid()?o:`https://app.zerion.io/wc?uri=${encodeURIComponent(o)}`},slope:{name:"Slope",icon:jsxRuntimeExports.jsx(Logos.Slope,{}),downloadUrls:{download:"https://connect.family.co/v0/download/slope",ios:"https://apps.apple.com/app/slope-wallet/id1574624530",android:"https://play.google.com/store/apps/details?id=com.wd.wallet",chrome:"https://chrome.google.com/webstore/detail/slope-wallet/pocmplpaccanhmnllbbkpgfliimjljgo",website:"https://slope.finance/"},getWalletConnectDeeplink:o=>isAndroid()?o:`https://slope.finance/app/wc?uri=${encodeURIComponent(o)}`},tokenPocket:{name:"TokenPocket Wallet",icon:jsxRuntimeExports.jsx(Logos.TokenPocket,{}),downloadUrls:{website:"https://www.tokenpocket.pro/en/download/app",download:"https://www.tokenpocket.pro/en/download/app",android:"https://play.google.com/store/apps/details?id=vip.mytokenpocket",ios:"https://apps.apple.com/us/app/tp-global-wallet/id6444625622",chrome:"https://chrome.google.com/webstore/detail/tokenpocket/mfgccjchihfkkindfppnaooecgfneiii"}},talisman:{name:"Talisman",icon:jsxRuntimeExports.jsx(Logos.Talisman,{}),downloadUrls:{download:"https://talisman.xyz/download",website:"https://talisman.xyz",chrome:"https://chrome.google.com/webstore/detail/talisman-polkadot-wallet/fijngjgcjhjmmpcmkeiomlglpeiijkld",firefox:"https://addons.mozilla.org/en-US/firefox/addon/talisman-wallet-extension/"}},walletConnect:{name:"Other Wallets",shortName:"Other",icon:jsxRuntimeExports.jsx(Logos.WalletConnect,{background:!0}),iconConnector:jsxRuntimeExports.jsx(Logos.OtherWallets,{}),iconShape:"square",getWalletConnectDeeplink:o=>o}};Object.keys(walletConfigs).reduce((o,et)=>{var tt,nt,rt,ot,it,st;const at=walletConfigs[et];if(!(at!=null&&at.getWalletConnectDeeplink))return o;const ct=et.split(",")[0].trim(),lt=(nt=(tt=at.name)===null||tt===void 0?void 0:tt.replace("Wallet","").replace(" ",""))!==null&&nt!==void 0?nt:ct[0].toUpperCase()+ct.slice(1),dt=injected({target:{id:ct,name:(ot=(rt=at.name)!==null&&rt!==void 0?rt:at.shortName)!==null&&ot!==void 0?ot:et,provider:pt=>{var mt;return(mt=pt==null?void 0:pt.ethereum)===null||mt===void 0?void 0:mt[`is${lt}`]}}}),ht=((st=(it=at.name)!==null&&it!==void 0?it:at.shortName)!==null&&st!==void 0?st:et).toLowerCase().replace(/(?:^|\s)\S/g,pt=>pt.toUpperCase()).replace(/\s/g,"").replace(/(?:^|\s)\S/g,pt=>pt.toLowerCase());return o[ht]=dt,o},{});const defaultLightTheme={font:{family:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji'"},text:{primary:{color:"#373737"},secondary:{color:"#999999",hover:{color:"#111111"}},error:"#FC6464",valid:"#32D74B"},buttons:{primary:{borderRadius:16,color:"#000373737000",background:"#FFFFFF",border:"#F0F0F0",hover:{color:"#000000",border:"#1A88F8"}},secondary:{borderRadius:16,background:"#F6F7F9",color:"#000000"}},navigation:{color:"#999999"},modal:{background:"#ffffff",divider:"#f7f6f8"},tooltips:{color:"#999999",background:"#ffffff",hover:{background:"#f6f7f9"}},overlay:{background:"rgba(0, 0, 0, 0.06)"},qrCode:{accentColor:"#F7F6F8"}},parseTheme=o=>o,userPrefersDarkMode=()=>typeof window>"u"?!1:window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;userPrefersDarkMode();const defaultTheme$1={connectKit:{options:{iconStyle:"light"},theme:{preferred:"dark",light:parseTheme(defaultLightTheme),dark:parseTheme(defaultLightTheme)}}};var styled=typeof qe.div=="function"?qe:qe.default;const hexToP3=o=>{const et=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(o);if(et==null)return o;const tt={r:parseInt(et[1],16),g:parseInt(et[2],16),b:parseInt(et[3],16)};return`color(display-p3 ${tt.r/255} ${tt.g/255} ${tt.b/255})`};var base$2={light:{"--ck-connectbutton-font-size":"15px","--ck-connectbutton-color":"#373737","--ck-connectbutton-background":"#F6F7F9","--ck-connectbutton-background-secondary":"#FFFFFF","--ck-connectbutton-hover-color":"#373737","--ck-connectbutton-hover-background":"#F0F2F5","--ck-connectbutton-active-color":"#373737","--ck-connectbutton-active-background":"#EAECF1","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#fff","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-background)","--ck-connectbutton-balance-hover-background":"#F6F7F9","--ck-connectbutton-balance-hover-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-hover-background)","--ck-connectbutton-balance-active-background":"#F0F2F5","--ck-connectbutton-balance-active-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-active-background)","--ck-primary-button-border-radius":"16px","--ck-primary-button-color":"#373737","--ck-primary-button-background":"#F6F7F9","--ck-primary-button-font-weight":"600","--ck-primary-button-hover-color":"#373737","--ck-primary-button-hover-background":"#F0F2F5","--ck-secondary-button-border-radius":"16px","--ck-secondary-button-color":"#373737","--ck-secondary-button-background":"#F6F7F9","--ck-tertiary-button-background":"#FFFFFF","--ck-secondary-button-hover-background":"#e0e4eb","--ck-modal-box-shadow":"0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-overlay-background":"rgba(71, 88, 107, 0.24)","--ck-body-color":"#373737","--ck-body-color-muted":"#999999","--ck-body-color-muted-hover":"#111111","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#F3F4F7","--ck-body-action-color":"#999999","--ck-body-divider":"#f7f6f8","--ck-body-divider-secondary":"rgba(0, 0, 0, 0.06)","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-siwe-border":"#F0F0F0","--ck-body-disclaimer-color":"#AAAAAB","--ck-body-disclaimer-link-color":"#838485","--ck-body-disclaimer-link-hover-color":"#000000","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0,0,0,0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#F5F7F9","--ck-qr-dot-color":"#000000","--ck-qr-border-color":"#f7f6f8","--ck-focus-color":"#1A88F8","--ck-spinner-color":"var(--ck-focus-color)","--ck-copytoclipboard-stroke":"#CCCCCC"},dark:{"--ck-connectbutton-font-size":"15px","--ck-connectbutton-color":"#ffffff","--ck-connectbutton-background":"#383838","--ck-connectbutton-background-secondary":"#282828","--ck-connectbutton-hover-background":"#404040","--ck-connectbutton-active-background":"#4D4D4D","--ck-connectbutton-balance-color":"#fff","--ck-connectbutton-balance-background":"#282828","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-background)","--ck-connectbutton-balance-hover-background":"#383838","--ck-connectbutton-balance-hover-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-hover-background)","--ck-connectbutton-balance-active-background":"#404040","--ck-connectbutton-balance-active-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-active-background)","--ck-primary-button-color":"#ffffff","--ck-primary-button-background":"#383838","--ck-primary-button-border-radius":"16px","--ck-primary-button-font-weight":"600","--ck-primary-button-hover-background":"#404040","--ck-primary-button-active-border-radius":"16px","--ck-secondary-button-color":"#ffffff","--ck-secondary-button-background":"#333333","--ck-secondary-button-hover-background":"#4D4D4D","--ck-tertiary-button-background":"#424242","--ck-focus-color":"#1A88F8","--ck-overlay-background":"rgba(0,0,0,0.4)","--ck-body-color":"#ffffff","--ck-body-color-muted":"rgba(255, 255, 255, 0.4)","--ck-body-color-muted-hover":"rgba(255, 255, 255, 0.8)","--ck-body-background":"#2B2B2B","--ck-body-background-transparent":"rgba(0,0,0,0)","--ck-body-background-secondary":"#333333","--ck-body-background-secondary-hover-background":"#4D4D4D","--ck-body-background-secondary-hover-outline":"#ffffff","--ck-body-background-tertiary":"#333333","--ck-body-action-color":"#808080","--ck-body-divider":"#383838","--ck-body-color-danger":"#FF4E4E","--ck-body-disclaimer-color":"#858585","--ck-body-disclaimer-link-color":"#ADADAD","--ck-body-disclaimer-link-hover-color":"#FFFFFF","--ck-modal-box-shadow":"0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-copytoclipboard-stroke":"#555555","--ck-tooltip-background":"#2B2B2B","--ck-tooltip-background-secondary":"#333333","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-dropdown-button-color":"#6C7381","--ck-spinner-color":"var(--ck-focus-color)","--ck-qr-dot-color":"#ffffff","--ck-qr-border-color":"#3d3d3d"}},web95={"--ck-font-family":"Lato","--ck-border-radius":"0px","--ck-connectbutton-color":"#373737","--ck-connectbutton-background":"linear-gradient(180deg, #F0F0EA 0%, #FFFFFF 50%, #F0F0EA 100%) 100% 100% / 200% 200%, #F5F5F1","--ck-connectbutton-box-shadow":" 0 0 0 1px #003C74, 2px 2px 0px rgba(255, 255, 255, 0.75), -2px -2px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 0px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-connectbutton-border-radius":"4.5px","--ck-connectbutton-hover-color":"#373737","--ck-connectbutton-hover-background":"linear-gradient(180deg, #F0F0EA 0%, #FFFFFF 50%, #F0F0EA 100%) 100% 0% / 200% 200%, #F5F5F1","--ck-connectbutton-active-background":"linear-gradient(180deg, #F0F0EA 0%, #FFFFFF 50%, #F0F0EA 100%) 100% 100% / 200% 200%, #F5F5F1","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#fff","--ck-connectbutton-balance-box-shadow":"0 0 0 1px #E4E7E7","--ck-connectbutton-balance-hover-box-shadow":"0 0 0 1px #d7dbdb","--ck-connectbutton-balance-active-box-shadow":"0 0 0 1px #bbc0c0","--ck-focus-color":"#1A88F8","--ck-overlay-background":"rgba(0, 127, 128, 0.8)","--ck-body-color":"#373737","--ck-body-color-muted":"#808080","--ck-body-color-muted-hover":"#111111","--ck-body-background":"#F0EDE2","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary-hover-background":"#FAFAFA","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-action-color":"#373737","--ck-body-color-danger":"#FC6464","--ck-body-color-valid":"#32D74B","--ck-body-divider":"#919B9C","--ck-body-divider-box-shadow":"0px 1px 0px #FBFBF8","--ck-primary-button-background":"linear-gradient(180deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-primary-button-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 0px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-primary-button-border-radius":"6px","--ck-primary-button-hover-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 5px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-primary-button-hover-border-radius":"6px","--ck-modal-heading-font-weight":400,"--ck-modal-box-shadow":` + inset 0px -3px 0px #0F37A9, + inset -2px 0px 0px #0F37A9, + inset 0px -4px 0px #0D5DDF, + inset -4px 0px 0px #0D5DDF, + inset 2px 0px 0px #0453DD, + inset 0px 2px 0px #044FD1, + inset 4px 0px 0px #4283EB, + inset 0px 4px 0px #4283EB + `,"--ck-modal-h1-font-weight":400,"--ck-secondary-button-color":"#373737","--ck-secondary-button-border-radius":"6px","--ck-secondary-button-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 0px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-secondary-button-background":"linear-gradient(180deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-secondary-button-hover-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 4px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-body-background-secondary":"rgba(0, 0, 0, 0.1)","--ck-body-background-tertiary":"linear-gradient(180deg, #FBFBFB 0%, #EFEFEE 100%)","--ck-tertiary-border-radius":"0px","--ck-tertiary-box-shadow":"inset 0 0 0 1px #919B9C, 1px 1px 2px rgba(0, 0, 0, 0.15), inset -2px -2px 0px #FFFFFF","--ck-body-button-text-align":"left","--ck-body-button-box-shadow":"0 2px 4px rgba(0, 0, 0, 0.05 )","--ck-body-disclaimer-background":"linear-gradient(180deg, #FBFBFB 0%, #EFEFEE 100%)","--ck-body-disclaimer-box-shadow":` + inset 0px -3px 0px #0F37A9, + inset -2px 0px 0px #0F37A9, + inset 0px -4px 0px #0D5DDF, + inset -4px 0px 0px #0D5DDF, + inset 2px 0px 0px #0453DD, + inset 4px 0px 0px #4283EB, + inset 0 1px 0 0 #919B9C`,"--ck-body-disclaimer-font-size":"14px","--ck-body-disclaimer-color":"#959594","--ck-body-disclaimer-link-color":"#626262","--ck-body-disclaimer-link-hover-color":"#000000","--ck-qr-dot-color":"#000000","--ck-qr-border-color":"#919B9C","--ck-qr-border-radius":"0","--ck-qr-background":"#FFFFFF","--ck-copytoclipboard-stroke":"rgba(55, 55, 55, 0.4)","--ck-tooltip-background":"linear-gradient(270deg, #F7F3E6 7.69%, #F5F7DA 100%)","--ck-tooltip-background-secondary":"#f6f7f9","--ck-tooltip-color":"#000000","--ck-tooltip-shadow":" 0 0 0 1.5px #2b2622, 0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px #A0A0A0, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-dropdown-button-background":"linear-gradient(180deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-dropdown-button-hover-background":"linear-gradient(0deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-dropdown-pending-color":"#ACA899","--ck-dropdown-active-color":"#FFFFFF","--ck-dropdown-active-static-color":"#ACA899","--ck-dropdown-active-background":"#3F69BF","--ck-dropdown-active-border-radius":"0","--ck-dropdown-active-inset":"-12px","--ck-dropdown-color":"#ACA899","--ck-dropdown-background":"#FFFFFF","--ck-dropdown-box-shadow":"inset 0 0 0 1px #ACA899, 2px 2px 7px rgba(0, 0, 0, 0.15)","--ck-dropdown-border-radius":"0","--ck-alert-color":"#ACA899","--ck-alert-background":"linear-gradient(180deg, #FBFBFB 0%, #EFEFEE 100%)","--ck-alert-box-shadow":"inset 0 0 0 1px #919B9C, 1px 1px 2px rgba(0, 0, 0, 0.15), inset -2px -2px 0px #FFFFFF","--ck-alert-border-radius":"0","--ck-recent-badge-border-radius":"32px","--ck-recent-badge-top-offset":"0px","--ck-graphic-primary-color":"#333333","--ck-graphic-primary-background":"#FFFFFF","--ck-graphic-compass-background":"#FFFFFF","--ck-siwe-border":"#919B9C"},retro={"--ck-font-family":'"SF Pro Rounded",ui-rounded,"Nunito",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"8px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-color":"#000000","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"-4px 4px 0px #000000, inset 0 0 0 2px #000000","--ck-connectbutton-border-radius":"8px","--ck-connectbutton-hover-background":"#F3EDE8","--ck-connectbutton-active-box-shadow":"0 0 0 0 #000000, inset 0 0 0 2px #000000","--ck-connectbutton-balance-color":"#000000","--ck-connectbutton-balance-background":"#F3EDE8","--ck-connectbutton-balance-box-shadow":"-4px 4px 0px #000000, inset 0 0 0 2px #000000","--ck-connectbutton-balance-hover-background":"#eee5dd","--ck-connectbutton-balance-connectbutton-box-shadow":"-4px 8px 0px -4px #000000, inset 0 0 0 2px #000000","--ck-connectbutton-balance-connectbutton-border-radius":"0px 8px 8px 0","--ck-primary-button-color":"#373737","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"inset 0 0 0 2px #000000, -4px 4px 0 0 #000000","--ck-primary-button-border-radius":"8px","--ck-primary-button-hover-background":"#F3EDE8","--ck-primary-button-hover-box-shadow":"inset 0 0 0 2px #000000, -0px 0px 0 0 #000000","--ck-secondary-button-border-radius":"8px","--ck-secondary-button-color":"#373737","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"-4px 4px 0 0 #000000, inset 0 0 0 2px #000000","--ck-secondary-button-hover-background":"#F3EDE8","--ck-secondary-button-hover-box-shadow":"0 0 0 0 #000000, inset 0 0 0 2px #000000","--ck-focus-color":"#3B99FC","--ck-overlay-background":"rgba(133, 120, 122, 0.8)","--ck-body-color":"#373737","--ck-body-color-muted":"rgba(0, 0, 0, 0.5)","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#EBE1D8","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"rgba(0,0,0,0.1)","--ck-body-background-secondary-hover-background":"#4D4D4D","--ck-body-background-secondary-hover-outline":"#373737","--ck-body-background-tertiary":"#ffffff","--ck-tertiary-border-radius":"8px","--ck-tertiary-box-shadow":"-4px 4px 0 0 #000000, inset 0 0 0 2px #000000","--ck-body-action-color":"#373737","--ck-body-divider":"#373737","--ck-body-color-danger":"#FF4E4E","--ck-body-disclaimer-background":"#E3D6C9","--ck-body-disclaimer-box-shadow":"-4px 4px 0 0 #000000, inset 2px 0 0 0 #000000, inset -2px 0 0 0 #000000, inset 0 -2px 0 0 #000000","--ck-body-disclaimer-font-weight":"500","--ck-body-disclaimer-color":"#888079","--ck-body-disclaimer-link-color":"#5B5650","--ck-body-disclaimer-link-hover-color":"#000000","--ck-modal-box-shadow":"-10px 10px 0px #000000, inset 0 0 0 2px #000000","--ck-copytoclipboard-stroke":"#555555","--ck-tooltip-border-radius":"8px","--ck-tooltip-color":"#373737","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#EBE1D8","--ck-tooltip-shadow":"-6px 6px 0 0 #000000, 0 0 0 2px #000000","--ck-spinner-color":"#1A88F8","--ck-dropdown-button-color":"#000","--ck-dropdown-button-box-shadow":"-2px 2px 0 2px #000000, 0 0 0 2px #000000","--ck-dropdown-button-background":"#ffffff","--ck-dropdown-button-hover-background":"#F3EDE8","--ck-dropdown-button-hover-box-shadow":"-2px 2px 0 0 #000000, 0 0 0 2px #000000","--ck-dropdown-pending-color":"rgba(0, 0, 0, 0.5)","--ck-dropdown-active-color":"#FFFFFF","--ck-dropdown-active-static-color":"rgba(0, 0, 0, 0.5)","--ck-dropdown-active-background":"#3B99FC","--ck-dropdown-active-box-shadow":"inset 0 0 0 2px #000000","--ck-dropdown-active-border-radius":"8px","--ck-dropdown-color":"rgba(0, 0, 0, 0.5)","--ck-dropdown-background":"#FFFFFF","--ck-dropdown-box-shadow":"-4px 4px 0 0 #000000, inset 0 0 0 2px #000000","--ck-dropdown-border-radius":"8px","--ck-alert-color":"rgba(0, 0, 0, 0.5)","--ck-alert-background":" #F5F5F5","--ck-alert-border-radius":"8px","--ck-qr-border-radius":"8px","--ck-qr-dot-color":"#000000","--ck-qr-border-color":"#000000","--ck-qr-background":"#ffffff","--ck-recent-badge-border-radius":"32px","--ck-recent-badge-box-shadow":"inset 0 0 0 2px currentColor","--ck-graphic-primary-color":"#000000","--ck-graphic-primary-background":"#ffffff","--ck-graphic-compass-background":"#FFFFFF","--ck-siwe-border":"#8E8985"},soft={"--ck-border-radius":"12px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-border-radius":"12px","--ck-connectbutton-color":"#414451","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-hover-background":"#F6F7F9","--ck-connectbutton-hover-box-shadow":"inset 0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#F6F7F9","--ck-connectbutton-balance-box-shadow":"none","--ck-connectbutton-balance-hover-background":"#f1f1f3","--ck-primary-button-border-radius":"12px","--ck-primary-button-color":"#414451","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-primary-button-hover-background":"#F6F7F9","--ck-primary-button-hover-box-shadow":"0 0 0 1px #D9DBDD, 0px 0 0 rgba(0, 0, 0, 0.02)","--ck-secondary-button-border-radius":"12px","--ck-secondary-button-color":"#414451","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-secondary-button-hover-background":"#F6F7F9","--ck-secondary-button-hover-box-shadow":"0 0 0 1px #D9DBDD, 0px 0 0 rgba(0, 0, 0, 0.02)","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 3px 16px rgba(0, 0, 0, 0.08)","--ck-body-color":"#414451","--ck-body-color-muted":"#9196A1","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#F6F8FA","--ck-tertiary-border-radius":"13px","--ck-tertiary-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-body-action-color":"#999999","--ck-body-divider":"#f7f6f8","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#F9FAFA","--ck-body-disclaimer-color":"#AFB1B6","--ck-body-disclaimer-link-color":"#787B84","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#E7E7E7","--ck-dropdown-color":"rgba(55, 55, 55, 0.4)","--ck-dropdown-box-shadow":"0px 2px 15px rgba(0, 0, 0, 0.15)","--ck-alert-color":"#9196A1","--ck-alert-background":"#F6F8FA","--ck-alert-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-alert-border-radius":"8px","--ck-qr-border-radius":"12px","--ck-qr-dot-color":"#2E3138","--ck-qr-border-color":"#E9EAEC","--ck-siwe-border":"#EAEBED"},midnight={"--ck-font-family":'"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"10px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-border-radius":"8px","--ck-connectbutton-color":"#ffffff","--ck-connectbutton-background":"#313235","--ck-connectbutton-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-connectbutton-hover-background":"#414144","--ck-connectbutton-active-background":"#4C4D4F","--ck-connectbutton-balance-color":"#ffffff","--ck-connectbutton-balance-background":"#1F2023","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px #313235","--ck-connectbutton-balance-hover-background":"#313235","--ck-connectbutton-balance-active-background":"#414144","--ck-primary-button-border-radius":"8px","--ck-primary-button-color":"#ffffff","--ck-primary-button-background":"rgba(255, 255, 255, 0.08)","--ck-primary-button-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-primary-button-hover-background":"rgba(255, 255, 255, 0.2)","--ck-secondary-button-border-radius":"8px","--ck-secondary-button-color":"#ffffff","--ck-secondary-button-background":"#363638","--ck-secondary-button-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-secondary-button-hover-background":"#3c3c3e","--ck-overlay-background":"rgba(0,0,0,0.4)","--ck-modal-box-shadow":"inset 0 0 0 1px #38393C, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-focus-color":"#1A88F8","--ck-body-color":"#ffffff","--ck-body-color-muted":"#8B8F97","--ck-body-color-muted-hover":"#ffffff","--ck-body-background":"#1F2023","--ck-body-background-transparent":"rgba(31, 32, 35, 0)","--ck-body-background-secondary":"#313235","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"rgba(255, 255, 255, 0.02)","--ck-body-background-tertiary":"#313235","--ck-tertiary-border-radius":"12px","--ck-tertiary-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.02)","--ck-body-action-color":"#8B8F97","--ck-body-divider":"rgba(255,255,255,0.1)","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#2B2D31","--ck-body-disclaimer-box-shadow":"none","--ck-body-disclaimer-color":"#808183","--ck-body-disclaimer-link-color":"#AAABAD","--ck-body-disclaimer-link-hover-color":"#ffffff","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-background":"#1F2023","--ck-tooltip-background-secondary":"#1F2023","--ck-tooltip-color":"#ffffff","--ck-tooltip-shadow":" 0 0 0 1px rgba(255, 255, 255, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#6C7381","--ck-dropdown-button-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-dropdown-button-background":"#313235","--ck-dropdown-pending-color":"#8B8F97","--ck-dropdown-active-color":"#FFF","--ck-dropdown-active-static-color":"#FFF","--ck-dropdown-active-background":"rgba(255, 255, 255, 0.07)","--ck-dropdown-color":"#8B8F97","--ck-dropdown-background":"#313235","--ck-dropdown-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.03)","--ck-dropdown-border-radius":"8px","--ck-alert-color":"#8B8F97","--ck-alert-background":"#404145","--ck-alert-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.02)","--ck-qr-border-radius":"12px","--ck-qr-dot-color":"#ffffff","--ck-qr-border-color":"rgba(255,255,255,0.1)","--ck-recent-badge-border-radius":"32px"},minimal$1={"--ck-font-family":'"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"0px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-border-radius":"0px","--ck-connectbutton-color":"#414451","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-connectbutton-hover-color":"#111","--ck-connectbutton-hover-box-shadow":"inset 0 0 0 1px #111","--ck-connectbutton-balance-color":"#111111","--ck-connectbutton-balance-background":"#F7F7F7","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px #F7F7F7","--ck-connectbutton-balance-hover-background":"#f1f1f3","--ck-connectbutton-balance-hover-box-shadow":"inset 0 0 0 1px #111","--ck-primary-button-border-radius":"0px","--ck-primary-button-color":"#111111","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-primary-button-hover-box-shadow":"inset 0 0 0 1px #111111","--ck-secondary-button-border-radius":"0px","--ck-secondary-button-color":"#111111","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-secondary-button-hover-box-shadow":"inset 0 0 0 1px #111111","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#E7E7E7","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 3px 16px rgba(0, 0, 0, 0.08)","--ck-body-color":"#111111","--ck-body-color-muted":"#A0A0A0","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#ffffff","--ck-tertiary-border-radius":"0px","--ck-tertiary-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-body-action-color":"#A0A0A0","--ck-body-divider":"#EBEBEB","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#FAFAFA","--ck-body-disclaimer-box-shadow":"inset 0 1px 0 0 #ECECEC","--ck-body-disclaimer-color":"#9D9D9D","--ck-body-disclaimer-link-color":"#6E6E6E","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-border-radius":"0px","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-active-border-radius":"0","--ck-dropdown-box-shadow":"0px 2px 15px rgba(0, 0, 0, 0.15)","--ck-dropdown-border-radius":"0","--ck-alert-color":"rgba(17, 17, 17, 0.4)","--ck-alert-background":"#fff","--ck-alert-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-alert-border-radius":"0","--ck-qr-border-radius":"0px","--ck-qr-dot-color":"#111111","--ck-qr-border-color":"#EBEBEB","--ck-modal-h1-font-weight":"400","--ck-modal-heading-font-weight":"400","--ck-primary-button-font-weight":"400","--ck-recent-badge-top-offset":"0px","--ck-siwe-border":"#EBEBEB"},rounded={"--ck-font-family":'"Nunito",ui-rounded,-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"24px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-font-weight":"700","--ck-connectbutton-border-radius":"14px","--ck-connectbutton-color":"#000000","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 2px #DFE4EC, 0 2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-hover-background":"#F9FAFB","--ck-connectbutton-balance-color":"#414451","--ck-connectbutton-balance-background":"#F9FAFB","--ck-connectbutton-balance-box-shadow":"0 2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-balance-hover-background":"#F5F7F9","--ck-connectbutton-balance-hover-box-shadow":"0 2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-balance-active-box-shadow":"0 0 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-active-background":"#F5F7F9","--ck-connectbutton-active-box-shadow":"inset 0 0 0 2px #CFD7E2, 0 0px 0 0 #CFD7E2, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-primary-button-border-radius":"18px","--ck-primary-button-color":"#000000","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -4px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-primary-button-hover-background":"#F5F7F9","--ck-primary-button-hover-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-secondary-button-border-radius":"16px","--ck-secondary-button-color":"#000000","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -4px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-secondary-button-hover-background":"#F5F7F9","--ck-secondary-button-hover-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 3px 16px rgba(0, 0, 0, 0.08)","--ck-body-color":"#000000","--ck-body-color-muted":"#93989F","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#ffffff","--ck-tertiary-border-radius":"22px","--ck-tertiary-box-shadow":"inset 0 0 0 2px #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-body-action-color":"#93989F","--ck-body-divider":"#DFE4EC","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#F9FAFB","--ck-body-disclaimer-font-size":"14px","--ck-body-disclaimer-font-weight":"700","--ck-body-disclaimer-color":"#959697","--ck-body-disclaimer-link-color":"#646464","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":" 0 0 0 2px #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 2px #DFE4EC, 0 2px 0 2px #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#F5F7F9","--ck-dropdown-pending-color":"#848D9A","--ck-dropdown-active-color":"#000000","--ck-dropdown-active-static-color":"#848D9A","--ck-dropdown-active-background":"#F5F7F9","--ck-dropdown-color":"#848D9A","--ck-dropdown-background":"#FFFFFF","--ck-dropdown-box-shadow":"0px 2px 15px rgba(0, 0, 0, 0.15)","--ck-dropdown-border-radius":"16px","--ck-alert-color":"#848D9A","--ck-alert-background":"#F5F7F9","--ck-qr-border-radius":"24px","--ck-qr-dot-color":"#111111","--ck-qr-border-color":"#DFE4EC","--ck-modal-h1-font-weight":"700","--ck-modal-heading-font-weight":"700","--ck-primary-button-font-weight":"700","--ck-recent-badge-box-shadow":"inset 0 0 0 2px currentColor","--ck-recent-badge-top-offset":"0px","--ck-siwe-border":"#DFE4EC"},nouns={"--ck-font-family":'"PT Root UI",ui-rounded,"Nunito",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"24px","--ck-connectbutton-font-size":"16px","--ck-connectbutton-font-weight":"700","--ck-connectbutton-border-radius":"10px","--ck-connectbutton-color":"#151C3B","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 1px #D6D8E1","--ck-connectbutton-hover-background":"#E9EBF3","--ck-connectbutton-hover-box-shadow":"inset 0 0 0 1px #D4D8E8","--ck-connectbutton-active-background":"#D4D8E8","--ck-connectbutton-active-box-shadow":"inset 0 0 0 1px #D4D8E8","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#F6F7F9","--ck-connectbutton-balance-box-shadow":"none","--ck-connectbutton-balance-hover-background":"#f1f1f3","--ck-primary-button-border-radius":"16px","--ck-primary-button-color":"#151C3B","--ck-primary-button-background":"#ffffff","--ck-primary-button-font-weight":"700","--ck-primary-button-hover-background":"#DEE1ED","--ck-secondary-button-border-radius":"16px","--ck-secondary-button-color":"#151C3B","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-font-weight":"700","--ck-secondary-button-hover-background":"#DEE1ED","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-overlay-background":"rgba(213, 215, 225, 0.8)","--ck-overlay-backdrop-filter":"blur(6px)","--ck-body-color":"#151C3B","--ck-body-color-muted":"#757A8E","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#F4F4F8","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#E9E9F1","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-tertiary":"#E9E9F1","--ck-tertiary-border-radius":"24px","--ck-body-action-color":"#79809C","--ck-body-divider":"#D9DBE3","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#F9FAFA","--ck-body-disclaimer-color":"#AFB1B6","--ck-body-disclaimer-link-color":"#787B84","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#79809C","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#DEE1ED","--ck-dropdown-button-hover-box-shadow":"0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-color":"#757A8E","--ck-dropdown-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-alert-color":"#9196A1","--ck-alert-background":"#F6F8FA","--ck-alert-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-alert-border-radius":"8px","--ck-qr-border-radius":"24px","--ck-qr-dot-color":"#000000","--ck-qr-background":"#ffffff","--ck-recent-badge-color":"#79809C","--ck-recent-badge-background":"#F4F4F8","--ck-recent-badge-box-shadow":"none","--ck-siwe-border":"#DFE4EC","--ck-graphic-primary-background":"#fff","--ck-graphic-compass-background":"#fff","--ck-graphic-primary-box-shadow":"0px 2.94737px 14.7368px rgba(0, 0, 0, 0.1)","--ck-graphic-compass-box-shadow":"0px 2px 9px rgba(0, 0, 0, 0.15)"},predefinedThemes={base:base$2,web95,retro,soft,midnight,minimal:minimal$1,rounded,nouns};const themeGlobals={default:{"--ck-font-family":`-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, + 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji', + 'Segoe UI Symbol'`,"--ck-border-radius":"20px","--ck-secondary-button-border-radius":"16px"},graphics:{light:{"--ck-graphic-wave-stop-01":"#E8F17D","--ck-graphic-wave-stop-02":"#A8ECDE","--ck-graphic-wave-stop-03":"#7AA1F2","--ck-graphic-wave-stop-04":"#DEA1E8","--ck-graphic-wave-stop-05":"#F46D98","--ck-graphic-scaniconwithlogos-01":"#4E4E4E","--ck-graphic-scaniconwithlogos-02":"#272727","--ck-graphic-scaniconwithlogos-03":"#F8D74A","--ck-graphic-scaniconwithlogos-04":"#F6F7F9","--ck-chain-ethereum-01":"#25292E","--ck-chain-ethereum-02":"#fff","--ck-chain-ethereum-03":"#DFE0E0"},dark:{"--ck-graphic-wave-stop-01":"#E8F17D","--ck-graphic-wave-stop-02":"#A8ECDE","--ck-graphic-wave-stop-03":"#7AA1F2","--ck-graphic-wave-stop-04":"#DEA1E8","--ck-graphic-wave-stop-05":"#F46D98","--ck-graphic-scaniconwithlogos-01":"#AFAFAF","--ck-graphic-scaniconwithlogos-02":"#696969","--ck-graphic-scaniconwithlogos-03":"#F8D74A","--ck-graphic-scaniconwithlogos-04":"#3D3D3D"}},ens:{light:{"--ck-ens-01-start":"#FF3B30","--ck-ens-01-stop":"#FF9500","--ck-ens-02-start":"#FF9500","--ck-ens-02-stop":"#FFCC00","--ck-ens-03-start":"#FFCC00","--ck-ens-03-stop":"#34C759","--ck-ens-04-start":"#5856D6","--ck-ens-04-stop":"#AF52DE","--ck-ens-05-start":"#5AC8FA","--ck-ens-05-stop":"#007AFF","--ck-ens-06-start":"#007AFF","--ck-ens-06-stop":"#5856D6","--ck-ens-07-start":"#5856D6","--ck-ens-07-stop":"#AF52DE","--ck-ens-08-start":"#AF52DE","--ck-ens-08-stop":"#FF2D55"},dark:{"--ck-ens-01-start":"#FF453A","--ck-ens-01-stop":"#FF9F0A","--ck-ens-02-start":"#FF9F0A","--ck-ens-02-stop":"#FFD60A","--ck-ens-03-start":"#FFD60A","--ck-ens-03-stop":"#32D74B","--ck-ens-04-start":"#32D74B","--ck-ens-04-stop":"#64D2FF","--ck-ens-05-start":"#64D2FF","--ck-ens-05-stop":"#0A84FF","--ck-ens-06-start":"#0A84FF","--ck-ens-06-stop":"#5E5CE6","--ck-ens-07-start":"#5E5CE6","--ck-ens-07-stop":"#BF5AF2","--ck-ens-08-start":"#BF5AF2","--ck-ens-08-stop":"#FF2D55"}},brand:{"--ck-family-brand":"#1A88F8","--ck-brand-walletConnect":"#3B99FC","--ck-brand-coinbaseWallet":"#0052FF","--ck-brand-metamask":"#f6851b","--ck-brand-metamask-01":"#F6851B","--ck-brand-metamask-02":"#E2761B","--ck-brand-metamask-03":"#CD6116","--ck-brand-metamask-04":"#161616","--ck-brand-metamask-05":"#763D16","--ck-brand-metamask-06":"#D7C1B3","--ck-brand-metamask-07":"#C0AD9E","--ck-brand-metamask-08":"#E4761B","--ck-brand-metamask-09":"#233447","--ck-brand-metamask-10":"#E4751F","--ck-brand-metamask-11":"#FEF5E7","--ck-brand-metamask-12":"#E3C8AB","--ck-brand-trust-01":"#3375BB","--ck-brand-trust-02":"#ffffff","--ck-brand-trust-01b":"#ffffff","--ck-brand-trust-02b":"#3375BB","--ck-brand-argent":"#f36a3d","--ck-brand-imtoken-01":"#11C4D1","--ck-brand-imtoken-02":"#0062AD","--ck-brand-safe":"#12FF80","--ck-brand-dawn":"#000000"}},themeColors={light:predefinedThemes.base.light,dark:predefinedThemes.base.dark,web95:predefinedThemes.web95,retro:predefinedThemes.retro,soft:predefinedThemes.soft,midnight:predefinedThemes.midnight,minimal:predefinedThemes.minimal,rounded:predefinedThemes.rounded,nouns:predefinedThemes.nouns},createCssVars=(o,et)=>Ae` + ${Object.keys(o).map(tt=>{const nt=o[tt];return nt&&`${tt}:${nt};`})} + `,createCssColors=(o,et)=>{const tt=et?" !important":"";return Ae` + ${Object.keys(o).map(nt=>{const rt=o[nt];return rt&&`${nt}:${rt}${tt};`})} + @supports (color: color(display-p3 1 1 1)) { + ${Object.keys(o).map(nt=>{const rt=o[nt];return`${nt}:${hexToP3(rt)}${tt};`})} + } + `},themes={default:createCssVars(themeGlobals.default),light:createCssColors(themeColors.light),dark:createCssColors(themeColors.dark),web95:createCssColors(themeColors.web95),retro:createCssColors(themeColors.retro),soft:createCssColors(themeColors.soft),midnight:createCssColors(themeColors.midnight),minimal:createCssColors(themeColors.minimal),rounded:createCssColors(themeColors.rounded),nouns:createCssColors(themeColors.nouns)},globals={brand:createCssVars(themeGlobals.brand),ensLight:createCssVars(themeGlobals.ens.light),ensDark:createCssVars(themeGlobals.ens.dark),graphicsLight:createCssVars(themeGlobals.graphics.light),graphicsDark:createCssVars(themeGlobals.graphics.dark)},globalsLight=Ae` + ${globals.brand} + ${globals.ensLight} + ${globals.graphicsLight} +`,globalsDark=Ae` + ${globals.brand} + ${globals.ensDark} + ${globals.graphicsDark} +`;let mode="auto";const ResetContainer=styled(motion.div)` + ${themes.default} + + ${o=>{switch(o.$useTheme){case"web95":return mode="light",themes.web95;case"retro":return mode="light",themes.retro;case"soft":return mode="light",themes.soft;case"midnight":return mode="dark",themes.midnight;case"minimal":return mode="light",themes.minimal;case"rounded":return mode="light",themes.rounded;case"nouns":return mode="light",themes.nouns;default:return o.$useMode==="light"?(mode="light",themes.light):o.$useMode==="dark"?(mode="dark",themes.dark):Ae` + @media (prefers-color-scheme: light) { + ${themes.light} + } + @media (prefers-color-scheme: dark) { + ${themes.dark} + } + `}}} + + ${o=>{switch(mode){case"light":return globalsLight;case"dark":return globalsDark;default:return Ae` + ${globalsLight} + @media (prefers-color-scheme: dark) { + ${globalsDark} + } + `}}} + + + ${o=>{var et;if(o.$customTheme&&o.$customTheme["--ck-accent-color"]&&["light","dark","auto","",void 0].includes(o.$useTheme)){const tt=o.$customTheme["--ck-accent-color"],nt=(et=o.$customTheme["--ck-accent-text-color"])!==null&&et!==void 0?et:"#ffffff";return{"--ck-accent-color":tt,"--ck-accent-text-color":nt,"--ck-secondary-button-background":tt,"--ck-secondary-button-hover-background":tt,"--ck-secondary-button-color":nt,"--ck-button-primary-color":nt,"--ck-focus-color":tt}}if(o.$customTheme)return createCssColors(o.$customTheme,!0)}} + + all: initial; + text-align: left; + text-direction: ltr; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-text-stroke: 0.001px transparent; + text-size-adjust: none; + font-size: 16px; + + button { + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); + -webkit-text-stroke: 0.001px transparent; + } + + &, + * { + font-family: var(--ck-font-family); + box-sizing: border-box; + outline: none; + border: none; + } + /* + @media (prefers-reduced-motion) { + * { + animation-duration: 60ms !important; + transition-duration: 60ms !important; + } + } + */ + img, + svg { + max-width: 100%; + } + strong { + font-weight: 600; + } + a:focus-visible, + button:focus-visible { + outline: 2px solid var(--ck-focus-color); + } +`,Portal$2=o=>{o={selector:"__CONNECTKIT__",...o};const{selector:et,children:tt}=o,nt=reactExports.useRef(null),[rt,ot]=reactExports.useState(!1);return reactExports.useEffect(()=>{const it="#"+et.replace(/^#/,"");if(nt.current=document.querySelector(it),!nt.current){const st=document.createElement("div");st.setAttribute("id",et),st.setAttribute("data-connectkit",`${CONNECTKIT_VERSION}`),document.body.appendChild(st),nt.current=st}ot(!0)},[et]),nt.current&&rt?reactDomExports.createPortal(tt,nt.current):null};var defaultTheme={mobileWidth:560};const ErrorMessage=styled(motion.div)` + z-index: -1; + pointer-events: auto; + position: absolute; + left: 50%; + transform: translateX(-50%); + width: var(--width); + top: 64px; + color: #fff; + font-size: 14px; + line-height: 20px; + font-weight: 500; + background: var(--ck-body-color-danger); + border-radius: 20px; + padding: 24px 46px 82px 24px; + transition: width var(--duration) var(--ease); + a { + font-weight: 700; + text-decoration: underline; + } + code { + font-size: 0.9em; + display: inline-block; + font-family: monospace; + margin: 1px; + padding: 0 4px; + border-radius: 8px; + font-weight: bold; + background: rgba(255, 255, 255, 0.1); + } +`,FadeIn=We` +from { opacity: 0; } + to { opacity: 1; } +`,FadeInScaleUp=We` +from { opacity: 0; transform: scale(0.85); } + to { opacity: 1; transform: scale(1); } +`,FadeInScaleDown=We` +from { opacity: 0; transform: scale(1.1); } + to { opacity: 1; transform: scale(1); } +`,FadeOut=We` +from { opacity: 1; } + to { opacity: 0; } +`,FadeOutScaleUp=We` +from { opacity: 1; transform: scale(1); } + to { opacity: 0; transform: scale(1.1); } +`,FadeOutScaleDown=We` +from { opacity: 1; transform: scale(1); } + to { opacity: 0; transform: scale(0.85); } +`,PageContent=styled(motion.div)` + max-width: 100%; + width: 295px; + padding-top: 48px; +`,TextWithHr=styled(motion.div)` + user-select: none; + position: relative; + display: block; + text-align: center; + color: var(--ck-body-color-muted); + font-size: 15px; + font-weight: 400; + line-height: 21px; + span { + z-index: 2; + position: relative; + display: inline-block; + user-select: none; + pointer-events: none; + padding: 0 14px; + background: var(--ck-body-background); + transition: background-color 200ms ease; + } + &:before { + z-index: 2; + content: ''; + position: absolute; + top: 50%; + left: 0; + right: 0; + height: 1px; + transform: translateY(-1px); + background: var(--ck-body-divider); + box-shadow: var(--ck-body-divider-box-shadow); + } +`,ModalHeading=styled(motion.div)` + z-index: 3; + pointer-events: none; + user-select: none; + position: absolute; + top: 25px; + left: 50%; + display: flex; + align-items: center; + justify-content: center; + height: 26px; + transform: translateX(-50%); + width: var(--width); + text-align: center; + font-size: 17px; + line-height: 20px; + font-weight: var(--ck-modal-heading-font-weight, 600); + color: var(--ck-body-color); + span { + display: inline-block; + } +`,ModalContentContainer=styled(motion.div)` + position: relative; + padding: 0; +`,ModalContent=styled(motion.div)` + left: 0; + right: 0; + text-align: center; + display: flex; + flex-direction: column; + gap: 12px; + padding: 0 0 16px; + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + display: block; + } +`,ModalH1=styled(motion.h1)` + margin: 0; + padding: 0; + line-height: ${o=>o.$small?20:22}px; + font-size: ${o=>o.$small?17:19}px; + font-weight: var(--ck-modal-h1-font-weight, 600); + color: ${o=>o.$error?"var(--ck-body-color-danger)":o.$valid?"var(--ck-body-color-valid)":"var(--ck-body-color)"}; + > svg { + position: relative; + top: -2px; + display: inline-block; + vertical-align: middle; + margin-right: 6px; + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + margin-bottom: 6px; + font-size: 17px; + } +`,ModalBody=styled.div` + font-size: 16px; + font-weight: 400; + line-height: 21px; + color: var(--ck-body-color-muted); + strong { + font-weight: 500; + color: var(--ck-body-color); + } +`;styled.div` + padding: 0 12px; + font-size: 13px; + font-weight: 400; + line-height: 16px; + color: var(--ck-body-color-muted); + strong { + font-weight: 500; + color: var(--ck-body-color); + } +`;const BackgroundOverlay=styled(motion.div)` + z-index: 1; + position: absolute; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: var(--ck-overlay-background, rgba(71, 88, 107, 0.24)); + backdrop-filter: ${o=>o.$blur?`blur(${o.$blur}px)`:"var(--ck-overlay-backdrop-filter, none)"}; + opacity: 0; + animation: ${o=>o.$active?FadeIn:FadeOut} 150ms ease-out + both; +`,BoxIn=We` + from{ opacity: 0; transform: scale(0.97); } + to{ opacity: 1; transform: scale(1); } +`,BoxOut=We` + from{ opacity: 1; transform: scale(1); } + to{ opacity: 0; transform: scale(0.97); } +`,MobileBoxIn=We` + from { transform: translate3d(0, 100%, 0); } + to { transform: translate3d(0, 0%, 0); } +`,MobileBoxOut=We` + from { opacity: 1; } + to { opacity: 0; } +`,BoxContainer=styled(motion.div)` + z-index: 2; + position: relative; + color: var(--ck-body-color); + + animation: 150ms ease both; + animation-name: ${BoxOut}; + &.active { + animation-name: ${BoxIn}; + } + + &:before { + content: ''; + position: absolute; + top: 0; + bottom: 0; + left: 50%; + width: var(--width); + height: var(--height); + transform: translateX(-50%); + backface-visibility: hidden; + transition: all 200ms ease; + border-radius: var(--ck-border-radius, 20px); + background: var(--ck-body-background); + box-shadow: var(--ck-modal-box-shadow); + } + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + animation-name: ${MobileBoxOut}; + animation-duration: 130ms; + animation-timing-function: ease; + + &.active { + animation-name: ${MobileBoxIn}; + animation-duration: 300ms; + animation-delay: 32ms; + animation-timing-function: cubic-bezier(0.15, 1.15, 0.6, 1); + } + + &:before { + width: 100%; + transition: 0ms height cubic-bezier(0.15, 1.15, 0.6, 1); + will-change: height; + } + } +`,ControllerContainer=styled(motion.div)` + z-index: 3; + position: absolute; + top: 0; + left: 50%; + height: 64px; + transform: translateX(-50%); + backface-visibility: hidden; + width: var(--width); + transition: 0.2s ease width; + pointer-events: auto; + //border-bottom: 1px solid var(--ck-body-divider); +`,InnerContainer$1=styled(motion.div)` + position: relative; + overflow: hidden; + height: var(--height); + transition: 0.2s ease height; + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + transition: 0ms height cubic-bezier(0.15, 1.15, 0.6, 1); + /* animation-delay: 34ms; */ + } +`,PageContainer=styled(motion.div)` + z-index: 2; + position: relative; + top: 0; + left: 50%; + margin-left: calc(var(--width) / -2); + width: var(--width); + /* left: 0; */ + /* width: 100%; */ + display: flex; + justify-content: center; + align-items: center; + transform-origin: center center; + animation: 200ms ease both; + + &.active { + animation-name: ${FadeInScaleDown}; + } + &.active-scale-up { + animation-name: ${FadeInScaleUp}; + } + &.exit-scale-down { + z-index: 1; + pointer-events: none; + position: absolute; + /* top: 0; */ + /* left: 0; */ + animation-name: ${FadeOutScaleDown}; + } + &.exit { + z-index: 1; + pointer-events: none; + position: absolute; + /* top: 0; */ + /* left: 0; */ + /* left: 50%; */ + /* transform: translateX(-50%); */ + animation-name: ${FadeOutScaleUp}; + animation-delay: 16.6667ms; + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + /* animation: 0ms ease both; */ + /* animation-delay: 35ms; */ + animation: 0ms cubic-bezier(0.15, 1.15, 0.6, 1) both; + + &.active { + animation-name: ${FadeIn}; + } + &.active-scale-up { + animation-name: ${FadeIn}; + } + &.exit-scale-down { + z-index: 3; + animation-name: ${FadeOut}; + } + &.exit { + z-index: 3; + animation-name: ${FadeOut}; + animation-delay: 0ms; + } + } +`,PageContents=styled(motion.div)` + margin: 0 auto; + width: fit-content; + padding: 29px 24px 24px; + backface-visibility: hidden; +`,ModalContainer=styled.div` + z-index: 2147483646; // z-index set one below max (2147483647) for if we wish to layer things ontop of the modal in a seperate Portal + position: fixed; + inset: 0; +`,CloseButton=styled(motion.button)` + z-index: 3; + cursor: pointer; + position: absolute; + top: 22px; + right: 17px; + width: 32px; + height: 32px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 16px; + padding: 0; + margin: 0; + color: var(--ck-body-action-color); + background: var(--ck-body-background); + transition: background-color 200ms ease, transform 100ms ease; + /* will-change: transform; */ + svg { + display: block; + } + + &:hover { + background: var(--ck-body-background-secondary); + } + &:active { + transform: scale(0.9); + } +`,SiweButton=styled(motion.button)` + z-index: 3; + position: absolute; + inset: 0; + width: 100%; // FireFox fix + display: flex; + align-items: center; + justify-content: center; + border-radius: 16px; + padding: 0; + margin: 0; + color: var(--ck-body-action-color); + background: var(--ck-body-background); + transition: background-color 200ms ease, transform 100ms ease; + /* will-change: transform; */ + svg { + display: block; + position: relative; + } + + &:enabled { + cursor: pointer; + &:hover { + background: var(--ck-body-background-secondary); + } + &:active { + transform: scale(0.9); + } + } +`,BackButton=styled(motion.button)` + z-index: 3; + position: absolute; + inset: 0; + width: 100%; // FireFox fix + display: flex; + align-items: center; + justify-content: center; + border-radius: 16px; + padding: 0; + margin: 0; + color: var(--ck-body-action-color); + background: var(--ck-body-background); + transition: background-color 200ms ease, transform 100ms ease; + /* will-change: transform; */ + svg { + display: block; + position: relative; + left: -1px; + } + + &:enabled { + cursor: pointer; + &:hover { + background: var(--ck-body-background-secondary); + } + &:active { + transform: scale(0.9); + } + } +`,InfoButton=styled(motion.button)` + z-index: 3; + position: absolute; + inset: 0; + width: 100%; // FireFox fix + transform: translateX(-1px); + display: flex; + align-items: center; + justify-content: center; + border-radius: 16px; + padding: 0; + margin: 0; + color: var(--ck-body-action-color); + background: var(--ck-body-background); + transition: background-color 200ms ease, transform 100ms ease; + /* will-change: transform; */ + svg { + display: block; + position: relative; + } + &:enabled { + cursor: pointer; + &:hover { + background: var(--ck-body-background-secondary); + } + &:active { + transform: scale(0.9); + } + } +`,Container$7=styled(motion.div)` + --ease: cubic-bezier(0.25, 0.1, 0.25, 1); + --duration: 200ms; + --transition: height var(--duration) var(--ease), + width var(--duration) var(--ease); + z-index: 3; + display: block; + pointer-events: none; + position: absolute; + left: 50%; + top: 50%; + width: 100%; + transform: translate3d(-50%, -50%, 0); + backface-visibility: hidden; + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + pointer-events: auto; + left: 0; + top: auto; + bottom: -5px; + transform: none; + ${BoxContainer} { + max-width: 448px; + margin: 0 auto; + &:before { + width: 100%; + border-radius: var(--ck-border-radius, 30px) + var(--ck-border-radius, 30px) 0 0; + } + } + ${PageContainer} { + left: 0; + right: 0; + margin: 0 auto; + width: auto; + } + ${PageContent} { + margin: 0 auto; + width: 100% !important; + } + ${ModalHeading} { + top: 29px; + } + ${ModalContent} { + gap: 12px; + } + ${ModalBody} { + margin: 0 auto; + max-width: 295px; + } + ${PageContents} { + width: 100%; + padding: 31px 24px; + } + ${ControllerContainer} { + width: 100%; + top: 4px; + border-bottom: 0; + } + ${CloseButton} { + right: 22px; + } + ${BackButton} { + top: -1px; + left: -3px; + } + ${InfoButton} { + top: -1px; + left: -3px; + svg { + width: 65%; + height: auto; + } + } + ${CloseButton}, + ${BackButton}, + ${InfoButton} { + // Quick hack for bigger tappable area on mobile + transform: scale(1.4) !important; + background: transparent !important; + svg { + transform: scale(0.8) !important; + } + } + } +`,Disclaimer=styled(motion.div)` + display: flex; + align-items: center; + justify-content: center; + margin: 16px -24px -24px -24px; + padding: 15px 40px 18px; + font-size: var(--ck-body-disclaimer-font-size, 13px); + font-weight: var(--ck-body-disclaimer-font-weight, 400); + text-align: center; + line-height: 19px; + color: var(--ck-body-disclaimer-color, var(--ck-body-color-muted, inherit)); + + & a { + color: var(--ck-body-disclaimer-link-color, inherit); + font-weight: var(--ck-body-disclaimer-font-weight, 400); + text-decoration: none; + transition: color 200ms ease; + &:hover { + color: var(--ck-body-disclaimer-link-hover-color, inherit); + } + } + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + margin: 24px -24px -26px -24px; + padding: 20px 42px 22px 42px; + } +`,DisclaimerBackground=styled(motion.div)` + pointer-events: all; + z-index: 9; + position: absolute; + bottom: 0; + left: 50%; + width: var(--width); + backface-visibility: hidden; + transform: translateX(-50%); + transform-origin: bottom center; + + border-radius: var(--ck-border-radius, 30px); + border-top-left-radius: 0; + border-top-right-radius: 0; + transition: width 200ms ease; + + background: var( + --ck-body-disclaimer-background, + var(--ck-body-background-secondary) + ); + box-shadow: var(--ck-body-disclaimer-box-shadow); + + ${Disclaimer} { + margin: 0 !important; + /* visibility: hidden; */ + } + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + border-radius: 0; + } +`,SignInTooltip=styled(motion.div)` + z-index: 2; + position: absolute; + top: 100%; + white-space: nowrap; + padding: 8px 16px; + color: #fff; + font-size: 13px; + line-height: 1.5; + background: #1a88f8; + border-radius: calc(var(--ck-border-radius) * 0.75); + transform: translateY(8px) translateX(-48px); + box-shadow: var(--ck-modal-box-shadow); + &:before { + content: ''; + position: absolute; + box-shadow: var(--shadow); + width: 18px; + height: 18px; + transform: translate(215%, -75%) rotate(45deg); + background: inherit; + border-radius: 3px 0 0 0; + } + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + transform: translateY(8px) translateX(-16px); + &:before { + transform: translate(40%, -75%) rotate(45deg); + } + } +`,useIsomorphicLayoutEffect$2=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function useLockBodyScroll(o){const[et,tt]=reactExports.useState(o),nt=useContext();return useIsomorphicLayoutEffect$2(()=>{var rt;if(!et)return;const ot={overflow:document.body.style.overflow,position:document.body.style.position,touchAction:document.body.style.touchAction,paddingRight:document.body.style.paddingRight},it=getComputedStyle(document.body),st=parseInt(it.marginRight)+parseInt(it.paddingRight)+parseInt(it.borderRight)+parseInt(it.marginLeft)+parseInt(it.paddingLeft)+parseInt(it.borderLeft),at=window.innerWidth-document.body.offsetWidth-st;return document.documentElement.style.setProperty("--ck-scrollbar-width",`${at}px`),document.body.style.overflow="hidden",document.body.style.position="relative",document.body.style.touchAction="none",!((rt=nt.options)===null||rt===void 0)&&rt.avoidLayoutShift&&(document.body.style.paddingRight=`${at}px`),()=>{var ct;document.documentElement.style.removeProperty("--ck-scrollbar-width"),document.body.style.overflow=ot.overflow,document.body.style.position=ot.position,document.body.style.touchAction=ot.touchAction,!((ct=nt.options)===null||ct===void 0)&&ct.avoidLayoutShift&&(document.body.style.paddingRight=ot.paddingRight)}},[et]),reactExports.useEffect(()=>{et!==o&&tt(o)},[o]),[et,tt]}const KEYCODE_TAB=9;function useFocusTrap(){const o=reactExports.useRef(null);function et(tt){if(o.current){var nt=o.current.querySelectorAll(` + a[href]:not(:disabled), + button:not(:disabled), + textarea:not(:disabled), + input[type="text"]:not(:disabled), + input[type="radio"]:not(:disabled), + input[type="checkbox"]:not(:disabled), + select:not(:disabled) + `),rt=nt[0],ot=nt[nt.length-1],it=tt.key==="Tab"||tt.keyCode===KEYCODE_TAB;it&&(tt.shiftKey?document.activeElement===rt&&(ot.focus(),tt.preventDefault()):document.activeElement===ot&&(rt.focus(),tt.preventDefault()))}}return reactExports.useEffect(()=>(o.current&&(o.current.addEventListener("keydown",et),o.current.focus({preventScroll:!0})),()=>{o.current&&o.current.removeEventListener("keydown",et)}),[]),o}function FocusTrap(o){const et=useFocusTrap();return reactExports.useEffect(()=>{et.current&&et.current.focus({preventScroll:!0})},[]),jsxRuntimeExports.jsx("div",{ref:et,tabIndex:0,children:o.children})}function usePrevious(o,et){const tt=reactExports.useRef({target:o,previous:et});return tt.current.target!==o&&(tt.current.previous=tt.current.target,tt.current.target=o),tt.current.previous}const Context$1=reactExports.createContext(null),ConnectKitThemeProvider=({children:o,theme:et="auto",mode:tt="auto",customTheme:nt})=>{const rt={theme:et,mode:tt,customTheme:nt};return reactExports.createElement(Context$1.Provider,{value:rt},jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o}))},useThemeContext=()=>{const o=React.useContext(Context$1);if(!o)throw Error("ConnectKitThemeProvider must be inside a Provider.");return o},ExternalLinkIcon=({...o})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{left:0,top:0},...o,children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 4C2.89543 4 2 4.89543 2 6V12C2 13.1046 2.89543 14 4 14H10C11.1046 14 12 13.1046 12 12V9.66667C12 9.11438 12.4477 8.66667 13 8.66667C13.5523 8.66667 14 9.11438 14 9.66667V12C14 14.2091 12.2091 16 10 16H4C1.79086 16 0 14.2091 0 12V6C0 3.79086 1.79086 2 4 2H6.33333C6.88562 2 7.33333 2.44772 7.33333 3C7.33333 3.55228 6.88562 4 6.33333 4H4Z",fill:"currentColor",fillOpacity:.3}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 1C9.5 0.447715 9.94772 0 10.5 0H15C15.5523 0 16 0.447715 16 1V5.5C16 6.05228 15.5523 6.5 15 6.5C14.4477 6.5 14 6.05228 14 5.5V3.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L12.5858 2H10.5C9.94772 2 9.5 1.55228 9.5 1Z",fill:"currentColor",fillOpacity:.3})]}),AlertIcon=({...o})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.81753 1.60122C7.39283 0.530035 8.46953 0 9.50409 0C10.5507 0 11.6022 0.539558 12.1805 1.59767L18.6047 13.3334C18.882 13.8283 19 14.3568 19 14.8622C19 16.5296 17.7949 18 15.9149 18H3.08514C1.20508 18 0 16.5296 0 14.8622C0 14.3454 0.131445 13.8172 0.405555 13.3379L6.81753 1.60122ZM9.50409 2C9.13355 2 8.77256 2.18675 8.57866 2.54907L8.57458 2.5567L2.14992 14.3166L2.144 14.3268C2.04638 14.4959 2 14.6817 2 14.8622C2 15.5497 2.43032 16 3.08514 16H15.9149C16.5697 16 17 15.5497 17 14.8622C17 14.6681 16.9554 14.4805 16.8588 14.309L16.8529 14.2986L10.4259 2.55741C10.2191 2.1792 9.86395 2 9.50409 2Z",fill:"currentColor"}),jsxRuntimeExports.jsx("path",{d:"M9.5 11.2297C9.01639 11.2297 8.7459 10.9419 8.72951 10.4186L8.60656 6.4157C8.59016 5.88372 8.95902 5.5 9.4918 5.5C10.0164 5.5 10.4016 5.89244 10.3852 6.42442L10.2623 10.4099C10.2377 10.9419 9.96721 11.2297 9.5 11.2297ZM9.5 14.5C8.95082 14.5 8.5 14.0901 8.5 13.5058C8.5 12.9215 8.95082 12.5116 9.5 12.5116C10.0492 12.5116 10.5 12.9128 10.5 13.5058C10.5 14.0988 10.041 14.5 9.5 14.5Z",fill:"currentColor"})]}),DisconnectIcon=({...o})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"15",height:"14",viewBox:"0 0 15 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{left:0,top:0},...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 0C1.79086 0 0 1.79086 0 4V10C0 12.2091 1.79086 14 4 14H6C6.55228 14 7 13.5523 7 13C7 12.4477 6.55228 12 6 12H4C2.89543 12 2 11.1046 2 10V4C2 2.89543 2.89543 2 4 2H6C6.55228 2 7 1.55228 7 1C7 0.447715 6.55228 0 6 0H4ZM11.7071 3.29289C11.3166 2.90237 10.6834 2.90237 10.2929 3.29289C9.90237 3.68342 9.90237 4.31658 10.2929 4.70711L11.5858 6H9.5H6C5.44772 6 5 6.44772 5 7C5 7.55228 5.44772 8 6 8H9.5H11.5858L10.2929 9.29289C9.90237 9.68342 9.90237 10.3166 10.2929 10.7071C10.6834 11.0976 11.3166 11.0976 11.7071 10.7071L14.7071 7.70711C15.0976 7.31658 15.0976 6.68342 14.7071 6.29289L11.7071 3.29289Z",fill:"currentColor",fillOpacity:"0.4"})}),TickIcon=({...o})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18ZM13.274 7.13324C13.6237 6.70579 13.5607 6.07577 13.1332 5.72604C12.7058 5.37632 12.0758 5.43932 11.726 5.86676L7.92576 10.5115L6.20711 8.79289C5.81658 8.40237 5.18342 8.40237 4.79289 8.79289C4.40237 9.18342 4.40237 9.81658 4.79289 10.2071L7.29289 12.7071C7.49267 12.9069 7.76764 13.0128 8.04981 12.9988C8.33199 12.9847 8.59505 12.8519 8.77396 12.6332L13.274 7.13324Z",fill:"currentColor"})}),RetryIconCircle=({...o})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16ZM24.5001 8.74263C25.0834 8.74263 25.5563 9.21551 25.5563 9.79883V14.5997C25.5563 15.183 25.0834 15.6559 24.5001 15.6559H19.6992C19.1159 15.6559 18.643 15.183 18.643 14.5997C18.643 14.0164 19.1159 13.5435 19.6992 13.5435H21.8378L20.071 11.8798C20.0632 11.8724 20.0555 11.865 20.048 11.8574C19.1061 10.915 17.8835 10.3042 16.5643 10.1171C15.2452 9.92999 13.9009 10.1767 12.7341 10.82C11.5674 11.4634 10.6413 12.4685 10.0955 13.684C9.54968 14.8994 9.41368 16.2593 9.70801 17.5588C10.0023 18.8583 10.711 20.0269 11.7273 20.8885C12.7436 21.7502 14.0124 22.2582 15.3425 22.336C16.6726 22.4138 17.9919 22.0572 19.1017 21.3199C19.5088 21.0495 19.8795 20.7333 20.2078 20.3793C20.6043 19.9515 21.2726 19.9262 21.7004 20.3228C22.1282 20.7194 22.1534 21.3876 21.7569 21.8154C21.3158 22.2912 20.8176 22.7161 20.2706 23.0795C18.7793 24.0702 17.0064 24.5493 15.2191 24.4448C13.4318 24.3402 11.7268 23.6576 10.3612 22.4998C8.9956 21.3419 8.0433 19.7716 7.6478 18.0254C7.2523 16.2793 7.43504 14.4519 8.16848 12.8186C8.90192 11.1854 10.1463 9.83471 11.7142 8.97021C13.282 8.10572 15.0884 7.77421 16.861 8.02565C18.6282 8.27631 20.2664 9.09278 21.5304 10.3525L23.4439 12.1544V9.79883C23.4439 9.21551 23.9168 8.74263 24.5001 8.74263Z",fill:"currentColor"})}),RetryIcon=({...o})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:[jsxRuntimeExports.jsx("path",{d:"M14.5 2V6H10.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M14 5.66537L10.9899 2.75871C10.0931 1.83853 8.92897 1.24216 7.6729 1.05947C6.41683 0.876774 5.13688 1.11765 4.02592 1.7458C2.91497 2.37395 2.0332 3.35534 1.5135 4.54208C0.993792 5.72883 0.864305 7.05663 1.14455 8.3254C1.42479 9.59418 2.09958 10.7352 3.06724 11.5765C4.03489 12.4178 5.24298 12.9138 6.50946 12.9898C7.77594 13.0657 9.03219 12.7176 10.0889 11.9977C10.4765 11.7337 10.8295 11.4249 11.142 11.0792",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),CopyToClipboardIcon$1=({...o})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:[jsxRuntimeExports.jsx("path",{d:"M14 9.5V7C14 5.89543 13.1046 5 12 5H7C5.89543 5 5 5.89543 5 7V12C5 13.1046 5.89543 14 7 14H9.5",stroke:"var(--ck-body-color-muted)",strokeWidth:"2"}),jsxRuntimeExports.jsx("rect",{x:"10",y:"10",width:"9",height:"9",rx:"2",stroke:"var(--ck-body-color-muted)",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M1 3L3 5L7 1",stroke:"var(--ck-body-color)",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]}),AuthIcon=({...o})=>jsxRuntimeExports.jsx("div",{...o,style:{zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",bottom:0,right:0,background:"#34C759",borderRadius:10,boxShadow:"0 0 0 1.5px var(--background)",width:10,height:10,...o==null?void 0:o.style},children:jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"6",height:"6",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M0.75 3L2.25 4.5L5.25 1.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})});var StatusState;(function(o){o.READY="ready",o.LOADING="loading",o.SUCCESS="success",o.REJECTED="rejected",o.ERROR="error"})(StatusState||(StatusState={}));const SIWEContext=reactExports.createContext(null),useSIWE=({onSignIn:o,onSignOut:et}={})=>{const tt=reactExports.useContext(SIWEContext);if(!tt)return{isSignedIn:!1,data:void 0,status:StatusState.ERROR,error:new Error("useSIWE hook must be inside a SIWEProvider."),isRejected:!1,isError:!0,isLoading:!1,isSuccess:!1,isReady:!1,reset:()=>{},signIn:()=>Promise.reject(),signOut:()=>Promise.reject()};const{session:nt,nonce:rt,status:ot,signOut:it,signIn:st,resetStatus:at}=tt,{address:ct,chainId:lt}=nt.data||{},dt=ct?StatusState.SUCCESS:nt.isLoading||rt.isLoading?StatusState.LOADING:ot,ht=dt===StatusState.LOADING,pt=dt===StatusState.SUCCESS,mt=dt===StatusState.REJECTED,ft=dt===StatusState.ERROR,yt=!ct||rt.isFetching||ht||pt,gt=()=>at(),xt=!!ct;return{isSignedIn:xt,data:xt?{address:ct,chainId:lt}:void 0,status:dt,error:nt.error||rt.error,isRejected:mt,isError:ft,isLoading:ht,isSuccess:pt,isReady:yt,signIn:async()=>{if(!xt){const vt=await st();vt&&(o==null||o(vt))}},signOut:async()=>{xt&&(await it(),et==null||et())},reset:gt}},arAE={connectWallet:"الاتصال بالمحفظة",disconnect:"قطع الاتصال",connected:"متصل",wrongNetwork:"شبكة خاطئة",switchNetworks:"تغيير الشبكات",chainNetwork:"شبكة {{ CHAIN }}",copyToClipboard:"نسخ إلى الحافظة",copyCode:"نسخ الكود",moreInformation:"مزيد من المعلومات",back:"عودة",close:"إغلاق",or:"أو",more:"المزيد",tryAgain:"حاول مجددًا",tryAgainQuestion:"هل نحاول مرة أخرى؟",dontHaveTheApp:"ليس لديك التطبيق؟",scanTheQRCode:"مسح رمز الاستجابة السريعة",useWalletConnectModal:"استخدم نموذج ولِيت‌كنيكت",useModal:"استخدم النموذج",installTheExtension:"تثبيت الإضافة",getWalletName:"الحصول على {{ CONNECTORNAME }}",otherWallets:"محافظ أخرى",learnMore:"تعرف على المزيد",getWallet:"الحصول على محفظة",approveInWallet:"الموافقة في المحفظة",confirmInWallet:"تأكيد في المحفظة",awaitingConfirmation:"بانتظار التأكيد",signIn:"تسجيل الدخول",signOut:"تسجيل الخروج",signedIn:"تم تسجيل الدخول",signedOut:"تم تسجيل الخروج",walletNotConnected:"المحفظة غير متصلة",warnings_walletSwitchingUnsupported:"عذرًا، لا تدعم محفظتك تغيير الشبكات من هذا التطبيق.",warnings_walletSwitchingUnsupportedResolve:"حاول تغيير الشبكات من داخل محفظتك بدلاً من ذلك.",warnings_chainUnsupported:"هذا التطبيق غير متوافق مع الشبكة المتصلة حاليًا.",warnings_chainUnsupportedResolve:"للمتابعة، قم بتغيير الشبكة أو قطع الاتصال.",onboardingScreen_heading:"الحصول على محفظة",onboardingScreen_h1:"ابدأ استكشاف الويب3",onboardingScreen_p:"تعتبر محفظتك بوابتك إلى عوالم إيثريوم، التكنولوجيا السحرية التي تمكن استكشاف الويب3.",onboardingScreen_ctaText:"اختر محفظتك الأولى",onboardingScreen_ctaUrl:"https://ethereum.org/ar/wallets/find-wallet/",aboutScreen_heading:"حول المحافظ",aboutScreen_a_h1:"حافظ على أصولك الرقمية",aboutScreen_a_p:"تمكنك المحافظ من إرسال واستقبال وتخزين والتفاعل مع الأصول الرقمية مثل NFTs ورموز إيثريوم الأخرى.",aboutScreen_b_h1:"وسيلة أفضل لتسجيل الدخول",aboutScreen_b_p:"في تطبيقات العصر الحديث، يمكن استخدام محفظتك كوسيلة سهلة لتسجيل الدخول بدلاً من الحاجة إلى تذكر كلمة مرور.",aboutScreen_c_h1:"استكشاف عالم الويب3",aboutScreen_c_p:"تعتبر محفظتك أداة أساسية تمكنك من استكشاف والمشاركة في عالم الويب3 الذي يتطور بسرعة.",aboutScreen_ctaText:"استزيد من المعرفة",aboutScreen_ctaUrl:"https://ethereum.org/ar/wallets/",connectorsScreen_heading:"الاتصال بالمحفظة",connectorsScreen_newcomer:"ليس لدي محفظة",connectorsScreen_h1:"ما هي المحافظ؟",connectorsScreen_p:"تُستخدم المحافظ لإرسال واستقبال وتخزين الأصول الرقمية. يمكنك الاتصال بمحفظة للتفاعل مع التطبيقات.",mobileConnectorsScreen_heading:"اختر محفظة",scanScreen_heading:"مسح باستخدام الهاتف",scanScreen_heading_withConnector:"مسح باستخدام {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`افتح محفظة تدعم ولِيت‌كنيكت + لبدء المسح.`,scanScreen_tooltip_default:"افتح {{ CONNECTORNAME }} على هاتفك للمسح",downloadAppScreen_heading:"الحصول على {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:`استخدم كاميرا هاتفك للمسح وتنزيله على نظامي iOS أو Android + +.`,downloadAppScreen_ios:"استخدم كاميرا هاتفك للمسح وتنزيله على نظام iOS.",downloadAppScreen_android:"استخدم كاميرا هاتفك للمسح وتنزيله على نظام Android.",injectionScreen_unavailable_h1:"المتصفح غير مدعوم",injectionScreen_unavailable_p:"لتوصيل محفظتك {{ CONNECTORSHORTNAME }}، قم بتثبيت الإضافة على متصفح {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"تثبيت {{ CONNECTORNAME }}",injectionScreen_install_p:"لتوصيل محفظتك {{ CONNECTORSHORTNAME }}، قم بتثبيت الإضافة على المتصفح.",injectionScreen_connecting_h1:"طلب الاتصال",injectionScreen_connecting_p:"افتح إضافة المتصفح {{ CONNECTORSHORTNAME }} لتوصيل محفظتك.",injectionScreen_connecting_injected_h1:"طلب الاتصال",injectionScreen_connecting_injected_p:"قبل الطلب من خلال محفظتك للاتصال بتطبيقنا.",injectionScreen_connected_h1:"الاتصال بالفعل",injectionScreen_connected_p:"من الآمن الآن إغلاق هذه النافذة المنبثقة.",injectionScreen_rejected_h1:"تم رفض الطلب",injectionScreen_rejected_p:"لقد قمت برفض الطلب. انقر أعلى للمحاولة مرة أخرى.",injectionScreen_failed_h1:"فشل الاتصال",injectionScreen_failed_p:"عذرًا، حدث خطأ ما. يُرجى المحاولة مرة أخرى للاتصال.",injectionScreen_notconnected_h1:"تسجيل الدخول إلى {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"للمتابعة، يُرجى تسجيل الدخول إلى إضافة {{ CONNECTORNAME }}.",profileScreen_heading:"متصل",switchNetworkScreen_heading:"تبديل الشبكات",signInWithEthereumScreen_tooltip:`أنت غير مسجل الدخول حاليًا إلى هذا التطبيق. +**سجل الدخول باستخدام إثيريوم** للمتابعة.`,signInWithEthereumScreen_signedOut_heading:"سجل الدخول باستخدام إثيريوم",signInWithEthereumScreen_signedOut_h1:`يود هذا التطبيق التحقق منك + كصاحب لهذه المحفظة.`,signInWithEthereumScreen_signedOut_p:"يرجى تأكيد طلب الرسالة في محفظتك للمتابعة.",signInWithEthereumScreen_signedOut_button:"سجل الدخول",signInWithEthereumScreen_signedIn_heading:"تم تسجيل الدخول باستخدام إثيريوم",signInWithEthereumScreen_signedIn_h1:"لقد قمت بتأكيد نفسك كصاحب لهذه المحفظة بنجاح.",signInWithEthereumScreen_signedIn_p:"سيتطلب تسجيل الخروج منك إعادة المصادقة مرة أخرى في المستقبل.",signInWithEthereumScreen_signedIn_button:"تسجيل الخروج"},enUS={connectWallet:"Connect Wallet",disconnect:"Disconnect",connected:"Connected",wrongNetwork:"Wrong Network",switchNetworks:"Switch Networks",chainNetwork:"{{ CHAIN }} Network",copyToClipboard:"Copy to Clipboard",copyCode:"Copy Code",moreInformation:"More Information",back:"Back",close:"Close",or:"or",more:"More",tryAgain:"Try Again",tryAgainQuestion:"Try Again?",dontHaveTheApp:"Don't have the app?",scanTheQRCode:"Scan the QR code",useWalletConnectModal:"Use WalletConnect Modal",useModal:"Use Modal",installTheExtension:"Install the Extension",getWalletName:"Get {{ CONNECTORNAME }}",otherWallets:"Other Wallets",learnMore:"Learn More",getWallet:"Get a Wallet",approveInWallet:"Approve in Wallet",confirmInWallet:"Confirm in Wallet",awaitingConfirmation:"Awaiting Confirmation",signIn:"Sign In",signOut:"Sign Out",signedIn:"Signed In",signedOut:"Signed Out",walletNotConnected:"Wallet Not Connected",warnings_walletSwitchingUnsupported:"Your wallet does not support switching networks from this app.",warnings_walletSwitchingUnsupportedResolve:"Try switching networks from within your wallet instead.",warnings_chainUnsupported:"This app does not support the current connected network.",warnings_chainUnsupportedResolve:"Switch or disconnect to continue.",onboardingScreen_heading:"Get a Wallet",onboardingScreen_h1:"Start Exploring Web3",onboardingScreen_p:"Your wallet is the gateway to all things Ethereum, the magical technology that makes it possible to explore web3.",onboardingScreen_ctaText:"Choose Your First Wallet",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"About Wallets",aboutScreen_a_h1:"For your digital assets",aboutScreen_a_p:"Wallets let you send, receive, store, and interact with digital assets like NFTs and other Ethereum tokens.",aboutScreen_b_h1:"A better way to login",aboutScreen_b_p:"With modern apps, your wallet can be used as an easy way to login, instead of having to remember a password.",aboutScreen_c_h1:"Explore the world of web3",aboutScreen_c_p:"Your wallet is an essential utility that lets you explore and participate in the fast evolving world of web3.",aboutScreen_ctaText:"Learn More",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Connect Wallet",connectorsScreen_newcomer:"I don’t have a wallet",connectorsScreen_h1:"What is a wallet?",connectorsScreen_p:"Wallets are used to send, receive, and store digital assets. Connecting a wallet lets you interact with apps.",mobileConnectorsScreen_heading:"Choose Wallet",scanScreen_heading:"Scan with Phone",scanScreen_heading_withConnector:"Scan with {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`Open a [WALLETCONNECTLOGO] WalletConnect +supported wallet to scan`,scanScreen_tooltip_default:`Open {{ CONNECTORNAME }} on +your mobile phone to scan`,downloadAppScreen_heading:"Get {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Scan with your phone camera to download on iOS or Android.",downloadAppScreen_ios:"Scan with your phone camera to download on iOS.",downloadAppScreen_android:"Scan with your phone camera to download Android.",injectionScreen_unavailable_h1:"Unsupported Browser",injectionScreen_unavailable_p:`To connect your {{ CONNECTORSHORTNAME }} wallet, +install the extension on {{ SUGGESTEDEXTENSIONBROWSER }}.`,injectionScreen_install_h1:"Install {{ CONNECTORNAME }}",injectionScreen_install_p:`To connect your {{ CONNECTORSHORTNAME }} wallet, +install the browser extension.`,injectionScreen_connecting_h1:"Requesting Connection",injectionScreen_connecting_p:`Open the {{ CONNECTORSHORTNAME }} browser +extension to connect your wallet.`,injectionScreen_connecting_injected_h1:"Requesting Connection",injectionScreen_connecting_injected_p:"Accept the request through your wallet to connect to this app.",injectionScreen_connected_h1:"Already Connected",injectionScreen_connected_p:"It is now okay to close this popup",injectionScreen_rejected_h1:"Request Cancelled",injectionScreen_rejected_p:`You cancelled the request. +Click above to try again.`,injectionScreen_failed_h1:"Connection Failed",injectionScreen_failed_p:`Sorry, something went wrong. +Please try connecting again.`,injectionScreen_notconnected_h1:"Login to {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"To continue, please login to your {{ CONNECTORNAME }} extension.",profileScreen_heading:"Connected",switchNetworkScreen_heading:"Switch Networks",signInWithEthereumScreen_tooltip:`You’re not signed in to this app. +**Sign In With Ethereum** to continue.`,signInWithEthereumScreen_signedOut_heading:"Sign In With Ethereum",signInWithEthereumScreen_signedOut_h1:`This app would like to verify you + as the owner of this wallet.`,signInWithEthereumScreen_signedOut_p:`Please sign the message request + in your wallet to continue.`,signInWithEthereumScreen_signedOut_button:"Sign In",signInWithEthereumScreen_signedIn_heading:"Signed In With Ethereum",signInWithEthereumScreen_signedIn_h1:`You successfully verified yourself + as the owner of this wallet.`,signInWithEthereumScreen_signedIn_p:`Signing out will require you to + authenticate again in the future.`,signInWithEthereumScreen_signedIn_button:"Sign Out"},eeEE={connectWallet:"Ühenda rahakott",disconnect:"Katkesta ühendus",connected:"Ühendatud",wrongNetwork:"Vale võrk",switchNetworks:"Vaheta võrke",chainNetwork:"{{ CHAIN }} Võrk",copyToClipboard:"Kopeeri lõikelauale",copyCode:"Kopeeri koodi",moreInformation:"Rohkem infot",back:"Tagasi",close:"Pane kinni",or:"või",more:"Rohkem",tryAgain:"Proovi uuesti",tryAgainQuestion:"Proovi uuesti?",dontHaveTheApp:"Kas teil pole rakendust?",scanTheQRCode:"Skaneeri QR-kood",useWalletConnectModal:"Kasuta WalletConnecti modalit",useModal:"Kasuta Modalit",installTheExtension:"Installi laiendust",getWalletName:"Hanki {{ CONNECTORNAME }}",otherWallets:"Teised rahakotid",learnMore:"Avasta rohkem",getWallet:"Lae alla rahakott",approveInWallet:"Kiita heaks rahakotis",confirmInWallet:"Kinnita rahakotis",awaitingConfirmation:"Kinnituse ootel",signIn:"Logi sisse",signOut:"Logi välja",signedIn:"Sisse logitud",signedOut:"Välja logitud",walletNotConnected:"Raakott pole ühendatud",warnings_walletSwitchingUnsupported:"Teie rahakott ei toeta võrgu vahetamist sellest rakendusest.",warnings_walletSwitchingUnsupportedResolve:"Proovige võrgu vahetamist teha oma rahakoti seest.",warnings_chainUnsupported:"See rakendus ei toeta praegu ühendatud võrku.",warnings_chainUnsupportedResolve:"Jätkamiseks vahetage või ühendage lahti.",onboardingScreen_heading:"Hankige rahakott",onboardingScreen_h1:"Alustage Web3 uurimist",onboardingScreen_p:"Teie rahakott on värav kõigele, mis puudutab Ethereumit, maagilist tehnoloogiat, mis võimaldab uurida Web3.",onboardingScreen_ctaText:"Valige oma esimene rahakott",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"Rahakottidest",aboutScreen_a_h1:"Teie digitaalsetele varadele",aboutScreen_a_p:"Rahakotid võimaldavad teil saata, vastu võtta, salvestada ja suhelda digitaalsete varadega nagu NFT-d ja teised Ethereumi tokenid.",aboutScreen_b_h1:"Parem viis sisse logimiseks",aboutScreen_b_p:"Kaasaegsete rakendustega saab teie rahakotti kasutada lihtsa sisselogimisviisina, ilma et peaksite meeles pidama parooli.",aboutScreen_c_h1:"Uurige Web3 maailma",aboutScreen_c_p:"Teie rahakott on oluline tööriist, mis võimaldab teil uurida ja osaleda kiiresti arenevas Web3 maailmas.",aboutScreen_ctaText:"Lisateavet saamiseks",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Ühendage rahakott",connectorsScreen_newcomer:"Mul pole rahakotti",connectorsScreen_h1:"Mis on rahakott?",connectorsScreen_p:"Rahakotte kasutatakse digitaalsete varade saatmiseks, vastuvõtmiseks ja salvestamiseks. Rahakoti ühendamine võimaldab teil rakendustega suhelda.",mobileConnectorsScreen_heading:"Valige rahakott",scanScreen_heading:"Skaneerige telefoni abil",scanScreen_heading_withConnector:"Skaneerige koos {{ CONNECTORNAME }}-ga",scanScreen_tooltip_walletConnect:`Ava [WALLETCONNECTLOGO] WalletConnect +toetatud rahakott skaneerimiseks`,scanScreen_tooltip_default:`Ava {{ CONNECTORNAME }} oma +mobiiltelefonil skaneerimiseks`,downloadAppScreen_heading:"Hankige {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Skaneerige oma telefoni kaameraga allalaadimiseks iOS-i või Androidi jaoks.",downloadAppScreen_ios:"Skaneerige oma telefoni kaameraga allalaadimiseks iOS-i jaoks.",downloadAppScreen_android:"Skaneerige oma telefoni kaameraga Androidi allalaadimiseks.",injectionScreen_unavailable_h1:"Toetuseta brauser",injectionScreen_unavailable_p:`Teie {{ CONNECTORSHORTNAME }} rahakoti ühendamiseks +installige laiendus {{ SUGGESTEDEXTENSIONBROWSER }}-le.`,injectionScreen_install_h1:"Installige {{ CONNECTORNAME }}",injectionScreen_install_p:`Teie {{ CONNECTORSHORTNAME }} rahakoti ühendamiseks +installige brauseri laiendus.`,injectionScreen_connecting_h1:"Ühenduse taotlemine",injectionScreen_connecting_p:`Ava {{ CONNECTORSHORTNAME }} brauseri +laiendus rahakoti ühendamiseks.`,injectionScreen_connecting_injected_h1:"Ühenduse taotlemine",injectionScreen_connecting_injected_p:"Nõustuge rakendusega ühendamiseks oma rahakotis.",injectionScreen_connected_h1:"Juba ühendatud",injectionScreen_connected_p:"Selle popup-i saab nüüd sulgeda",injectionScreen_rejected_h1:"Taotlus tühistatud",injectionScreen_rejected_p:`Tühistasite taotluse. +Klõpsake ülal, et uuesti proovida.`,injectionScreen_failed_h1:"Ühenduse loomine ebaõnnestus",injectionScreen_failed_p:`Vabandame, midagi läks valesti. +Proovige ühendust uuesti luua.`,injectionScreen_notconnected_h1:"Logige sisse {{ CONNECTORNAME }}-ga",injectionScreen_notconnected_p:"Jätkamiseks logige sisse oma {{ CONNECTORNAME }} laiendisse.",profileScreen_heading:"Ühendatud",switchNetworkScreen_heading:"Võrkude vahetamine",signInWithEthereumScreen_tooltip:`Te pole selle rakendusse sisse logitud. +**Logi sisse Ethereumiga** jätkamiseks.`,signInWithEthereumScreen_signedOut_heading:"Logi sisse Ethereumiga",signInWithEthereumScreen_signedOut_h1:`See rakendus soovib teid autentida + selle rahakoti omanikuna.`,signInWithEthereumScreen_signedOut_p:`Jätkamiseks allkirjastage sõnumipäring + oma rahakotis.`,signInWithEthereumScreen_signedOut_button:"Logi sisse",signInWithEthereumScreen_signedIn_heading:"Logi välja",signInWithEthereumScreen_signedIn_h1:`Olete edukalt autentinud end + selle rahakoti omanikuna.`,signInWithEthereumScreen_signedIn_p:`Välja logimine nõuab tulevikus + uuesti autentimist.`,signInWithEthereumScreen_signedIn_button:"Logi välja"},esES={connectWallet:"Conecta una cartera",disconnect:"Desconectar",connected:"Conectado",wrongNetwork:"Red incorrecta",switchNetworks:"Cambio de red",chainNetwork:"Red {{ CHAIN }}",copyToClipboard:"Copiar al portapapeles",copyCode:"Copiar código",moreInformation:"Más información",back:"Atrás",close:"Cerrar",or:"o",more:"Más",tryAgain:"Intentar de nuevo",tryAgainQuestion:"¿Intentar de nuevo?",dontHaveTheApp:"¿No tienes la aplicación?",scanTheQRCode:"Escanea el código QR",useWalletConnectModal:"Utilizar WalletConnect Modal",useModal:"Utilizar Modal",installTheExtension:"Instalar la extensión",getWalletName:"Obtén {{ CONNECTORNAME }}",otherWallets:"Otras carteras",learnMore:"Más información",getWallet:"Obtén una cartera",approveInWallet:"Aprobar en la cartera",confirmInWallet:"Confirmar en la cartera",awaitingConfirmation:"A la espera de confirmación",signIn:"Iniciar sesión",signOut:"Cerrar sesión",signedIn:"Sesión iniciada",signedOut:"Sesión cerrada",walletNotConnected:"Cartera no conectada",warnings_walletSwitchingUnsupported:"Tu cartera no permite cambiar de red desde esta aplicación.",warnings_walletSwitchingUnsupportedResolve:"Prueba a cambiar de red desde tu cartera.",warnings_chainUnsupported:"Esta aplicación no es compatible con la red conectada actualmente.",warnings_chainUnsupportedResolve:"Cambia o desconecta para continuar.",onboardingScreen_heading:"Obtén una cartera",onboardingScreen_h1:"Comienza a explorar la Web3",onboardingScreen_p:"Tu cartera es el portal de acceso a todo lo relacionado con Ethereum, la tecnología mágica que permite explorar la Web3.",onboardingScreen_ctaText:"Elige tu primera cartera",onboardingScreen_ctaUrl:"https://ethereum.org/es/wallets/find-wallet/",aboutScreen_heading:"Acerca de las carteras",aboutScreen_a_h1:"Para tus activos digitales",aboutScreen_a_p:"Las carteras te permiten enviar, recibir, almacenar e interactuar con activos digitales como los NFT y otros tokens de Ethereum.",aboutScreen_b_h1:"Una manera mejor de iniciar sesión",aboutScreen_b_p:"Con las aplicaciones modernas, puedes utilizar tu cartera para iniciar sesión fácilmente, en vez de tener que recordar una contraseña.",aboutScreen_c_h1:"Explora el mundo de la Web3",aboutScreen_c_p:"Tu cartera es una herramienta esencial que te permite explorar y participar en el mundo en rápida evolución de la Web3.",aboutScreen_ctaText:"Más información",aboutScreen_ctaUrl:"https://ethereum.org/es/wallets/",connectorsScreen_heading:"Conecta una cartera",connectorsScreen_newcomer:"No tengo una cartera",connectorsScreen_h1:"¿Qué es una cartera?",connectorsScreen_p:"Las carteras se utilizan para enviar, recibir y almacenar activos digitales. Si conectas una cartera, podrás interactuar con las aplicaciones.",mobileConnectorsScreen_heading:"Elige una cartera",scanScreen_heading:"Escanea con el teléfono",scanScreen_heading_withConnector:"Escanea con {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Abre una cartera compatible con WalletConnect [WALLETCONNECTLOGO] para escanear",scanScreen_tooltip_default:"Abre {{ CONNECTORNAME }} en tu teléfono móvil para escanear",downloadAppScreen_heading:"Obtén {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Escanea con la cámara de tu teléfono para descargarla en iOS o Android.",downloadAppScreen_ios:"Escanea con la cámara de tu teléfono para descargarla en iOS.",downloadAppScreen_android:"Escanea con la cámara de tu teléfono para descargarla en Android.",injectionScreen_unavailable_h1:"Navegador no compatible",injectionScreen_unavailable_p:"Para conectar tu cartera de {{ CONNECTORSHORTNAME }}, instala la extensión en {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Instala {{ CONNECTORNAME }}",injectionScreen_install_p:"Para conectar tu cartera de {{ CONNECTORSHORTNAME }}, instala la extensión del navegador.",injectionScreen_connecting_h1:"Solicitud de conexión",injectionScreen_connecting_p:"Abre la extensión del navegador de {{ CONNECTORSHORTNAME }} para conectar tu cartera.",injectionScreen_connecting_injected_h1:"Solicitud de conexión",injectionScreen_connecting_injected_p:"Acepta la solicitud a través de tu cartera para conectarte a esta aplicación.",injectionScreen_connected_h1:"Ya conectada",injectionScreen_connected_p:"Ya puedes cerrar esta ventana emergente",injectionScreen_rejected_h1:"Solicitud cancelada",injectionScreen_rejected_p:"Has cancelado la solicitud. Haz clic arriba para intentarlo de nuevo.",injectionScreen_failed_h1:"Error de conexión",injectionScreen_failed_p:"Lo sentimos, ha habido un problema. Intenta conectarte de nuevo.",injectionScreen_notconnected_h1:"Inicia sesión en {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Para continuar, inicia sesión en tu extensión de {{ CONNECTORNAME }}.",profileScreen_heading:"Conectado",switchNetworkScreen_heading:"Cambio de red",signInWithEthereumScreen_tooltip:`No has iniciado sesión en esta aplicación. +**Inicia sesión con Ethereum** para continuar.`,signInWithEthereumScreen_signedOut_heading:"Inicia sesión con Ethereum",signInWithEthereumScreen_signedOut_h1:"Esta aplicación desea verificar que eres el propietario de esta cartera.",signInWithEthereumScreen_signedOut_p:"Firma la solicitud de mensaje en tu cartera para continuar.",signInWithEthereumScreen_signedOut_button:"Iniciar sesión",signInWithEthereumScreen_signedIn_heading:"Sesión iniciada con Ethereum",signInWithEthereumScreen_signedIn_h1:"Te has verificado correctamente como propietario de esta cartera.",signInWithEthereumScreen_signedIn_p:"Si cierras la sesión, tendrás que volver a autenticarte más adelante.",signInWithEthereumScreen_signedIn_button:"Cerrar sesión"},faIR={connectWallet:"اتصال به کیف پول",disconnect:"قطع ارتباط",connected:"متصل شد",wrongNetwork:"شبکه نادرست",switchNetworks:"تغییر شبکه‌ها",chainNetwork:"{{ CHAIN }} شبکه",copyToClipboard:"کپی به کلیپ‌بورد",copyCode:"کپی کد",moreInformation:"اطلاعات بیشتر",back:"بازگشت",close:"بستن",or:"یا",more:"بیشتر",tryAgain:"تلاش دوباره",tryAgainQuestion:"آیا دوباره تلاش کنیم؟",dontHaveTheApp:"اپلیکیشن را ندارید؟",scanTheQRCode:"اسکن کیو‌آر کد",useWalletConnectModal:"استفاده از مودال والت‌‌کانکت",useModal:"استفاده از مودال",installTheExtension:"نصب افزونه",getWalletName:"دریافت {{ CONNECTORNAME }}",otherWallets:"کیف پول‌های دیگر",learnMore:"بیشتر بدانید",getWallet:"یک کیف پول دریافت کنید",approveInWallet:"در کیف پول تأیید کنید",confirmInWallet:"در کیف پول تأیید کنید",awaitingConfirmation:"در انتظار تأیید",signIn:"ورود",signOut:"خروج",signedIn:"وارد شده",signedOut:"خارج شده",walletNotConnected:"کیف پول متصل نیست",warnings_walletSwitchingUnsupported:"متاسفانه، کیف پول شما از تغییر شبکه در این برنامه پشتیبانی نمی‌کند.",warnings_walletSwitchingUnsupportedResolve:"بهتر است از داخل کیف پول خود تغییر شبکه دهید.",warnings_chainUnsupported:"این برنامه با شبکه‌ای که در حال حاضر متصل است، سازگاری ندارد.",warnings_chainUnsupportedResolve:"برای ادامه، شبکه را تغییر دهید یا اتصال را قطع کنید.",onboardingScreen_heading:"دریافت کیف پول",onboardingScreen_h1:"آغاز کاوش در وب3",onboardingScreen_p:"کیف پول شما دروازه‌ای است به دنیای اتریوم، فناوری جادویی که ممکن می‌سازد تا وب3 را کاوش کنید.",onboardingScreen_ctaText:"کیف پول نخست خود را انتخاب کنید",onboardingScreen_ctaUrl:"https://ethereum.org/fa/wallets/find-wallet/",aboutScreen_heading:"درباره کیف پول‌ها",aboutScreen_a_h1:"نگهبان دارایی‌های دیجیتالی شما",aboutScreen_a_p:"کیف پول‌ها به شما اجازه می‌دهند دارایی‌های دیجیتالی مانند ان‌اف‌تی و توکن‌های اتریومی دیگر را ارسال، دریافت، ذخیره و تعامل دهید.",aboutScreen_b_h1:"یک روش بهتر برای ورود",aboutScreen_b_p:"در برنامه‌های مدرن، کیف پول شما می‌تواند به عنوان یک راه ورود آسان به جای به یادآوری یک رمز عبور مورد استفاده قرار گیرد.",aboutScreen_c_h1:"جهان وب3 را کاوش کنید",aboutScreen_c_p:"کیف پول شما یک ابزار ضروری است که به شما اجازه می‌دهد جهان در حال تغییر سریع وب3 را کاوش و در آن شرکت کنید.",aboutScreen_ctaText:"دانش بیشتری بیافزایید",aboutScreen_ctaUrl:"https://ethereum.org/fa/wallets/",connectorsScreen_heading:"برقراری ارتباط با کیف پول",connectorsScreen_newcomer:"کیف پول ندارم",connectorsScreen_h1:"چیستی رمزگذاری کیف پول؟",connectorsScreen_p:"کیف پول‌ها برای ارسال، دریافت و نگهداری دارایی‌های دیجیتال استفاده می‌شوند. برقراری ارتباط با یک کیف پول به شما امکان تعامل با برنامه‌ها را می‌دهد.",mobileConnectorsScreen_heading:"انتخاب کیف پول",scanScreen_heading:"اسکن با گوشی",scanScreen_heading_withConnector:"اسکن با {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"یک کیف پول با پشتیبانی از والت‌‌کانکت را باز کنید تا اسکن را آغاز کنید",scanScreen_tooltip_default:"{{ CONNECTORNAME }} را روی گوشی خود باز کنید تا اسکن شود",downloadAppScreen_heading:"دریافت {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"از دوربین گوشی خود برای اسکن و دریافت نسخه iOS یا Android استفاده کنید.",downloadAppScreen_ios:"از دوربین گوشی خود برای دریافت نسخه iOS استفاده کنید.",downloadAppScreen_android:"از دوربین گوشی خود برای دریافت نسخه Android استفاده کنید.",injectionScreen_unavailable_h1:"مرورگر پشتیبانی نمی‌شود",injectionScreen_unavailable_p:"برای برقراری ارتباط با کیف پول {{ CONNECTORSHORTNAME }}، افزونه مرورگر را در {{ SUGGESTEDEXTENSIONBROWSER }} نصب کنید.",injectionScreen_install_h1:"نصب {{ CONNECTORNAME }}",injectionScreen_install_p:"برای برقراری ارتباط با کیف پول {{ CONNECTORSHORTNAME }}، افزونه مرورگر را نصب کنید.",injectionScreen_connecting_h1:"درخواست اتصال",injectionScreen_connecting_p:"افزونه مرورگر {{ CONNECTORSHORTNAME }} را باز کنید تا ارتباط با کیف پول ایجاد شود.",injectionScreen_connecting_injected_h1:"درخواست اتصال",injectionScreen_connecting_injected_p:"درخواست را از طریق کیف پول خود بپذیرید تا به این برنامه متصل شوید.",injectionScreen_connected_h1:"اتصال از قبل برقرار است",injectionScreen_connected_p:"اکنون می‌توانید این پنجره‌ی بازشو را ببندید.",injectionScreen_rejected_h1:"درخواست لغو شد",injectionScreen_rejected_p:"شما درخواست را لغو کرده‌اید. برای تلاش مجدد، بالا کلیک کنید.",injectionScreen_failed_h1:"ارتباط ناموفق",injectionScreen_failed_p:"متاسفانه، مشکلی بوجود آمد. لطفاً مجدداً اتصال برقرار کنید.",injectionScreen_notconnected_h1:"با ورود به {{ CONNECTORNAME }} وارد شوید",injectionScreen_notconnected_p:"برای ادامه، لطفاً وارد افزونه {{ CONNECTORNAME }} خود شوید.",profileScreen_heading:"اتصال‌ها",switchNetworkScreen_heading:"تغییر شبکه‌ها",signInWithEthereumScreen_tooltip:`شما در حال حاضر به این برنامه وارد نشده‌اید. +**با اتریوم وارد شوید** تا ادامه دهید.`,signInWithEthereumScreen_signedOut_heading:"با اتریوم وارد شوید",signInWithEthereumScreen_signedOut_h1:`این برنامه می‌خواهد هویت شما + به عنوان صاحب این کیف پول را تأیید کند.`,signInWithEthereumScreen_signedOut_p:"لطفاً درخواست پیام را در کیف پول خود تأیید کنید تا ادامه دهید.",signInWithEthereumScreen_signedOut_button:"با اتریوم وارد شوید",signInWithEthereumScreen_signedIn_heading:"با اتریوم وارد شده‌اید",signInWithEthereumScreen_signedIn_h1:"شما به عنوان صاحب این کیف پول هویت خود را با موفقیت تأیید کرده‌اید.",signInWithEthereumScreen_signedIn_p:"خروج از حساب کاربری شما در آینده نیاز به تأیید دوباره دارد.",signInWithEthereumScreen_signedIn_button:"خروج"},frFR={connectWallet:"Connecter le portefeuille",disconnect:"Déconnecter",connected:"Connecté",wrongNetwork:"Réseau incorrect",switchNetworks:"Changer de réseau",chainNetwork:"Réseau {{ CHAIN }}",copyToClipboard:"Copier dans le presse-papiers",copyCode:"Copier le code",moreInformation:"Plus d’informations",back:"Retour",close:"Fermer",or:"ou",more:"Plus",tryAgain:"Réessayer",tryAgainQuestion:"Réessayer ?",dontHaveTheApp:"Vous n’avez pas l’application ?",scanTheQRCode:"Scannez le code QR",useWalletConnectModal:"Utiliser la modale WalletConnect",useModal:"Utiliser la modale",installTheExtension:"Installer l’extension",getWalletName:"Obtenez {{ CONNECTORNAME }}",otherWallets:"Autres portefeuilles",learnMore:"En savoir plus",getWallet:"Obtenir un portefeuille",approveInWallet:"Approuver dans le portefeuille",confirmInWallet:"Confirmer dans le portefeuille",awaitingConfirmation:"En attente de confirmation",signIn:"Se connecter",signOut:"Se déconnecter",signedIn:"Connecté",signedOut:"Déconnecté",walletNotConnected:"Portefeuille non connecté",warnings_walletSwitchingUnsupported:"Votre portefeuille ne prend pas en charge le changement de réseau à partir de cette application.",warnings_walletSwitchingUnsupportedResolve:"Essayez plutôt de changer de réseau à partir de votre portefeuille.",warnings_chainUnsupported:"Cette application ne prend pas en charge le réseau connecté actuel.",warnings_chainUnsupportedResolve:"Changez ou déconnectez-vous pour continuer.",onboardingScreen_heading:"Obtenez un portefeuille",onboardingScreen_h1:"Commencez à explorer le Web3",onboardingScreen_p:"Votre portefeuille est la porte d'entrée vers tout ce qui concerne l'Ethereum, la technologie magique qui permet d'explorer le Web3.",onboardingScreen_ctaText:"Choisissez votre premier portefeuille",onboardingScreen_ctaUrl:"https://ethereum.org/fr/wallets/find-wallet/",aboutScreen_heading:"À propos des portefeuilles",aboutScreen_a_h1:"Pour vos actifs numériques",aboutScreen_a_p:"Les portefeuilles vous permettent d'envoyer, de recevoir, de stocker et d'interagir avec des actifs numériques tels que des NFT et d'autres jetons Ethereum.",aboutScreen_b_h1:"Une meilleure façon de se connecter",aboutScreen_b_p:"Avec les applications modernes, votre portefeuille peut s'utiliser pour vous connecter facilement, au lieu d'avoir à mémoriser un mot de passe.",aboutScreen_c_h1:"Explorez le monde du Web3",aboutScreen_c_p:"Votre portefeuille est un utilitaire essentiel qui vous permet d'explorer et de participer au monde en évolution rapide du Web3.",aboutScreen_ctaText:"En savoir plus",aboutScreen_ctaUrl:"https://ethereum.org/fr/wallets/",connectorsScreen_heading:"Connectez le portefeuille",connectorsScreen_newcomer:"Je n’ai pas de portefeuille",connectorsScreen_h1:"Qu’est-ce qu’un portefeuille ?",connectorsScreen_p:"Les portefeuilles s'utilisent pour envoyer, recevoir et stocker des actifs numériques. La connexion d'un portefeuille vous permet d'interagir avec les applications.",mobileConnectorsScreen_heading:"Choisissez le portefeuille",scanScreen_heading:"Scannez avec le téléphone",scanScreen_heading_withConnector:"Scannez avec {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Ouvrez un portefeuille pris en charge par WalletConnect [WALLETCONNECTLOGO] pour scanner",scanScreen_tooltip_default:"Ouvrez {{ CONNECTORNAME }} sur votre téléphone mobile pour scanner",downloadAppScreen_heading:"Obtenez {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Scannez avec l'appareil photo de votre téléphone pour le télécharger sur iOS ou Android.",downloadAppScreen_ios:"Scannez avec l'appareil photo de votre téléphone pour le télécharger sur iOS.",downloadAppScreen_android:"Scannez avec l'appareil photo de votre téléphone pour le télécharger sur Android.",injectionScreen_unavailable_h1:"Navigateur non pris en charge",injectionScreen_unavailable_p:"Pour connecter votre portefeuille {{ CONNECTORSHORTNAME }}, installez l’extension sur {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Installez {{ CONNECTORNAME }}",injectionScreen_install_p:"Pour connecter votre portefeuille {{ CONNECTORSHORTNAME }}, installez l’extension de navigateur.",injectionScreen_connecting_h1:"Demande de connexion",injectionScreen_connecting_p:"Ouvrez l’extension de navigateur {{ CONNECTORSHORTNAME }} pour connecter votre portefeuille.",injectionScreen_connecting_injected_h1:"Demande de connexion",injectionScreen_connecting_injected_p:"Acceptez la demande via votre portefeuille pour vous connecter à cette application.",injectionScreen_connected_h1:"Déjà connecté",injectionScreen_connected_p:"Vous pouvez maintenant fermer ce pop-up",injectionScreen_rejected_h1:"Demande annulée",injectionScreen_rejected_p:"Vous avez annulé la demande. Cliquez ci-dessus pour réessayer.",injectionScreen_failed_h1:"Échec de la connexion",injectionScreen_failed_p:"Malheureusement, un problème est survenu. Veuillez réessayer de vous connecter.",injectionScreen_notconnected_h1:"Connectez-vous à {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Pour continuer, veuillez vous connecter à votre extension {{ CONNECTORNAME }} .",profileScreen_heading:"Connecté",switchNetworkScreen_heading:"Changer de réseau",signInWithEthereumScreen_tooltip:`Vous n’êtes pas connecté à cette application. +**Connectez-vous avec Ethereum** pour continuer.`,signInWithEthereumScreen_signedOut_heading:"Connectez-vous avec Ethereum",signInWithEthereumScreen_signedOut_h1:"Cette application souhaite vérifier que vous êtes bien le propriétaire de ce portefeuille.",signInWithEthereumScreen_signedOut_p:"Veuillez signer la demande de message dans votre portefeuille pour continuer.",signInWithEthereumScreen_signedOut_button:"Se connecter",signInWithEthereumScreen_signedIn_heading:"Connecté avec Ethereum",signInWithEthereumScreen_signedIn_h1:"Vous avez réussi à vous identifier en tant que propriétaire de ce portefeuille.",signInWithEthereumScreen_signedIn_p:"La déconnexion vous obligera à vous authentifier à nouveau à l'avenir.",signInWithEthereumScreen_signedIn_button:"Se déconnecter"};var jaJP={connectWallet:"ウォレットの接続",disconnect:"切断",connected:"接続されました",wrongNetwork:"間違ったネットワーク",switchNetworks:"ネットワークの切り替え",chainNetwork:"{{ CHAIN }} ネットワーク",copyToClipboard:"クリップボードにコピー",copyCode:"コードをコピー",moreInformation:"詳細情報",back:"戻る",close:"閉じる",or:"または",more:"その他",tryAgain:"再試行",tryAgainQuestion:"もう一度試しますか?",dontHaveTheApp:"アプリをお持ちではありませんか?",scanTheQRCode:"QR コードをスキャン",useWalletConnectModal:"WalletConnect モーダルを使用",useModal:"モーダルを使用",installTheExtension:"拡張機能をインストール",getWalletName:"{{ CONNECTORNAME }} を取得",otherWallets:"その他のウォレット",learnMore:"詳細情報",getWallet:"ウォレットを入手",approveInWallet:"ウォレットで承認",confirmInWallet:"ウォレットで確認",awaitingConfirmation:"確認を待っています",signIn:"サインイン",signOut:"サインアウト",signedIn:"サインインしました",signedOut:"サインアウトしました",walletNotConnected:"ウォレットが接続されていません",warnings_walletSwitchingUnsupported:"お使いのウォレットは、このアプリからのネットワークの切り替えをサポートしていません。",warnings_walletSwitchingUnsupportedResolve:"代わりにウォレット内からネットワークを切り替えてみてください。",warnings_chainUnsupported:"このアプリは、現在接続されているネットワークをサポートしていません。",warnings_chainUnsupportedResolve:"切り替えるか切断して続行します。",onboardingScreen_heading:"ウォレットを入手",onboardingScreen_h1:"Web3 の探索を開始",onboardingScreen_p:"ウォレットは、web3 の探索を可能にする魔法のテクノロジーであるイーサリアムのすべてへのゲートウェイです。",onboardingScreen_ctaText:"最初のウォレットを選択してください",onboardingScreen_ctaUrl:"https://ethereum.org/ja/wallets/find-wallet/",aboutScreen_heading:"ウォレットについて",aboutScreen_a_h1:"デジタル資産用",aboutScreen_a_p:"ウォレットを使用すると、NFT やその他のイーサリアム トークンなどのデジタル資産を送信、受信、保存、および操作できます。",aboutScreen_b_h1:"より良いログイン方法",aboutScreen_b_p:"最新のアプリでは、パスワードを覚える必要がなく、ウォレットを簡単なログイン方法として使用できます。",aboutScreen_c_h1:"web3 の世界を探索",aboutScreen_c_p:"ウォレットは、急速に進化する web3 の世界を探索し、参加するために不可欠なユーティリティです。",aboutScreen_ctaText:"詳細情報",aboutScreen_ctaUrl:"https://ethereum.org/ja/wallets/",connectorsScreen_heading:"ウォレットの接続",connectorsScreen_newcomer:"ウォレットを持っていません",connectorsScreen_h1:"ウォレットとは何ですか?",connectorsScreen_p:"ウォレットは、デジタル資産の送信、受信、および保存に使用されます。 ウォレットを接続すると、アプリとやり取りできます。",mobileConnectorsScreen_heading:"ウォレットを選択",scanScreen_heading:"電話でスキャンする",scanScreen_heading_withConnector:"{{ CONNECTORNAME }}でスキャンする",scanScreen_tooltip_walletConnect:"[WALLETCONNECTLOGO] WalletConnect 対応の ウォレットを開いてスキャンします",scanScreen_tooltip_default:"携帯電話で {{ CONNECTORNAME }} を 開いてスキャンします",downloadAppScreen_heading:"{{ CONNECTORNAME }} を取得",downloadAppScreen_iosAndroid:"携帯電話のカメラでスキャンして、iOS または Android にダウンロードします。",downloadAppScreen_ios:"携帯電話のカメラでスキャンして、iOS にダウンロードします。",downloadAppScreen_android:"携帯電話のカメラでスキャンして、Android にダウンロードします。",injectionScreen_unavailable_h1:"サポートされていないブラウザ",injectionScreen_unavailable_p:"{{ CONNECTORSHORTNAME }} ウォレットを接続するには、{{ SUGGESTEDEXTENSIONBROWSER }} に拡張機能をインストールします。",injectionScreen_install_h1:"{{ CONNECTORNAME }} をインストール",injectionScreen_install_p:"{{ CONNECTORSHORTNAME }} ウォレットを接続するには、ブラウザ拡張機能をインストールします。",injectionScreen_connecting_h1:"接続を要求",injectionScreen_connecting_p:"{{ CONNECTORSHORTNAME }} ブラウザ拡張機能を 開いて、ウォレットを接続します。",injectionScreen_connecting_injected_h1:"接続を要求",injectionScreen_connecting_injected_p:"このアプリに接続するには、ウォレットを介して要求を受け入れます。",injectionScreen_connected_h1:"すでに接続済み",injectionScreen_connected_p:"このポップアップを閉じてもかまいません",injectionScreen_rejected_h1:"要求がキャンセルされました",injectionScreen_rejected_p:"要求をキャンセルしました。上をクリックしてもう一度お試しください。",injectionScreen_failed_h1:"接続に失敗しました",injectionScreen_failed_p:"申し訳ありませんが、問題が発生しました。もう一度接続してみてください。",injectionScreen_notconnected_h1:"{{ CONNECTORNAME }} にログイン",injectionScreen_notconnected_p:"続行するには、 {{ CONNECTORNAME }} 拡張機能にログインしてください。",profileScreen_heading:"接続されました",switchNetworkScreen_heading:"ネットワークの切り替え",signInWithEthereumScreen_tooltip:`このアプリにサインインしていません。 +続行するには、**イーサリアムでサインイン**してください。`,signInWithEthereumScreen_signedOut_heading:"イーサリアムでサインイン",signInWithEthereumScreen_signedOut_h1:"このアプリは、あなたがこのウォレットの 所有者であることを確認しようとしています。",signInWithEthereumScreen_signedOut_p:"続行するには、ウォレットで メッセージ リクエストに署名してください。",signInWithEthereumScreen_signedOut_button:"サインイン",signInWithEthereumScreen_signedIn_heading:"イーサリアムでサインインしました",signInWithEthereumScreen_signedIn_h1:"このウォレットの所有者であることが 正常に確認されました。",signInWithEthereumScreen_signedIn_p:"サインアウトすると、今後 再度認証する必要があります。",signInWithEthereumScreen_signedIn_button:"サインアウト"};const ptBR={connectWallet:"Conectar carteira",disconnect:"Desconectar",connected:"Conectado",wrongNetwork:"Rede incorreta",switchNetworks:"Alternar rede",chainNetwork:"Rede {{ CHAIN }}",copyToClipboard:"Copiar para a área de transferência",copyCode:"Copiar código",moreInformation:"Mais informações",back:"Voltar",close:"Fechar",or:"ou",more:"Mais",tryAgain:"Tentar novamente",tryAgainQuestion:"Tentar novamente?",dontHaveTheApp:"Não tem o aplicativo?",scanTheQRCode:"Escaneie o código QR",useWalletConnectModal:"Use o modal do WalletConnect",useModal:"Usar modal",installTheExtension:"Instale a extensão",getWalletName:"Obter {{ CONNECTORNAME }}",otherWallets:"Outras carteiras",learnMore:"Saiba mais",getWallet:"Obtenha uma carteira",approveInWallet:"Aprovar na carteira",confirmInWallet:"Confirmar na carteira",awaitingConfirmation:"Aguardando confirmação",signIn:"Entrar",signOut:"Sair",signedIn:"Conectado",signedOut:"Desconectado",walletNotConnected:"Carteira não conectada",warnings_walletSwitchingUnsupported:"A sua carteira não permite a troca de rede a partir deste aplicativo.",warnings_walletSwitchingUnsupportedResolve:"Tente trocar de rede de dentro da sua carteira.",warnings_chainUnsupported:"Este aplicativo não é compatível com a rede conectada.",warnings_chainUnsupportedResolve:"Altere a rede ou desconecte para continuar.",onboardingScreen_heading:"Obtenha uma carteira",onboardingScreen_h1:"Comece a explorar a Web3",onboardingScreen_p:"Sua carteira é a porta de entrada para todas as coisas Ethereum, a tecnologia mágica que torna possível explorar a web3.",onboardingScreen_ctaText:"Escolha sua primeira carteira",onboardingScreen_ctaUrl:"https://ethereum.org/pt-br/wallets/find-wallet/",aboutScreen_heading:"Sobre as carteiras",aboutScreen_a_h1:"Para seus ativos digitais",aboutScreen_a_p:"As carteiras permitem que você envie, receba, armazene e interaja com ativos digitais como NFTs e outros tokens Ethereum.",aboutScreen_b_h1:"Uma maneira melhor de fazer login",aboutScreen_b_p:"Com aplicativos modernos, sua carteira pode ser usada como uma maneira fácil de fazer login, em vez de ter que lembrar uma senha.",aboutScreen_c_h1:"Explore o mundo da Web3",aboutScreen_c_p:"Sua carteira é uma utilidade essencial que permite explorar e participar do mundo em rápida evolução da Web3.",aboutScreen_ctaText:"Saiba mais",aboutScreen_ctaUrl:"https://ethereum.org/pt-br/wallets/",connectorsScreen_heading:"Conectar carteira",connectorsScreen_newcomer:"Eu não tenho uma carteira",connectorsScreen_h1:"O que é uma carteira?",connectorsScreen_p:"As carteiras são usadas para enviar, receber e armazenar ativos digitais. A conexão de uma carteira permite que você interaja com aplicativos.",mobileConnectorsScreen_heading:"Escolha uma carteira",scanScreen_heading:"Escanear com o celular",scanScreen_heading_withConnector:"Escanear com o {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`Abra uma carteira compatível +com o WalletConnect [WALLETCONNECTLOGO] para escanear`,scanScreen_tooltip_default:`Abra o {{ CONNECTORNAME }} no +seu celular para escanear`,downloadAppScreen_heading:"Obter {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Escaneie com a câmera do seu celular para baixar no iOS ou Android.",downloadAppScreen_ios:"Escaneie com a câmera do seu celular para baixar no iOS.",downloadAppScreen_android:"Escaneie com a câmera do seu celular para baixar no Android.",injectionScreen_unavailable_h1:"Navegador não compatível",injectionScreen_unavailable_p:`Para conectar sua carteira {{ CONNECTORSHORTNAME }}, +instale a extensão no {{ SUGGESTEDEXTENSIONBROWSER }}.`,injectionScreen_install_h1:"Instalar {{ CONNECTORNAME }}",injectionScreen_install_p:`Para conectar sua carteira {{ CONNECTORSHORTNAME }}, +instale a extensão do navegador`,injectionScreen_connecting_h1:"Solicitando conexão",injectionScreen_connecting_p:`Abra a extensão do navegador do {{ CONNECTORSHORTNAME }} +para conectar a sua carteira.`,injectionScreen_connecting_injected_h1:"Solicitando conexão",injectionScreen_connecting_injected_p:"Aceite a solicitação por meio de sua carteira para se conectar a este aplicativo.",injectionScreen_connected_h1:"Já conectado",injectionScreen_connected_p:"Agora você já pode fechar esta janela",injectionScreen_rejected_h1:"Solicitação cancelada",injectionScreen_rejected_p:`Você cancelou a solicitação. +Clique acima para tentar novamente.`,injectionScreen_failed_h1:"A conexão falhou",injectionScreen_failed_p:`Desculpe, ocorreu um erro. +Por favor, tente conectar novamente.`,injectionScreen_notconnected_h1:"Faça login no {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Para continuar, faça login na sua extensão do {{ CONNECTORNAME }}.",profileScreen_heading:"Conectado",switchNetworkScreen_heading:"Alternar rede",signInWithEthereumScreen_tooltip:`Você não está conectado a este aplicativo. +**Entre com Ethereum** para continuar.`,signInWithEthereumScreen_signedOut_heading:"Entrar com Ethereum",signInWithEthereumScreen_signedOut_h1:`Este aplicativo gostaria de verificar você + como o proprietário desta carteira.`,signInWithEthereumScreen_signedOut_p:`Por favor, assine o pedido de mensagem + em sua carteira para continuar.`,signInWithEthereumScreen_signedOut_button:"Entrar",signInWithEthereumScreen_signedIn_heading:"Conectado com Ethereum",signInWithEthereumScreen_signedIn_h1:`Você se verificou com sucesso + como o proprietário desta carteira`,signInWithEthereumScreen_signedIn_p:`Se sair, será necessário que você + autentique novamente no futuro.`,signInWithEthereumScreen_signedIn_button:"Sair"},ruRU={connectWallet:"Подключить кошелек",disconnect:"Отключить",connected:"Подключена",wrongNetwork:"Неверная сеть",switchNetworks:"Переключение сети",chainNetwork:"Сеть {{ CHAIN }}",copyToClipboard:"Скопировать в буфер обмена",copyCode:"Скопировать код",moreInformation:"Больше информации",back:"Назад",close:"Закрыть",or:"или",more:"Еще",tryAgain:"Попробовать снова",tryAgainQuestion:"Попробовать снова?",dontHaveTheApp:"У вас нет приложения?",scanTheQRCode:"Отсканируйте QR-код",useWalletConnectModal:"Использовать окно WalletConnect",useModal:"Использовать модальное окно",installTheExtension:"Установить расширение",getWalletName:"Скачать {{ CONNECTORNAME }}",otherWallets:"Другие кошельки",learnMore:"Узнать больше",getWallet:"Завести кошелек",approveInWallet:"Подтвердите",confirmInWallet:"Подтвердите",awaitingConfirmation:"Ожидаем подтверждение",signIn:"Войти",signOut:"Выйти",signedIn:"Вошли",signedOut:"Вышли",walletNotConnected:"Кошелек не подключен",warnings_walletSwitchingUnsupported:"Ваш кошелек не поддерживает переключение сетей из этого приложения.",warnings_walletSwitchingUnsupportedResolve:"Попробуйте переключиться на другую сеть прямо в вашем кошельке.",warnings_chainUnsupported:"Это приложение не поддерживает текущую подключенную сеть.",warnings_chainUnsupportedResolve:"Для продолжения переключите сеть или отключите кошелек.",onboardingScreen_heading:"Завести кошелек",onboardingScreen_h1:"Начните исследовать веб3",onboardingScreen_p:"Ваш кошелек — это врата в мир Ethereum, волшебной технологии, которая позволяет исследовать веб3.",onboardingScreen_ctaText:"Выбрать свой первый кошелек",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"О кошельках",aboutScreen_a_h1:"Для ваших цифровых активов",aboutScreen_a_p:"Кошельки позволяют вам отправлять, получать, хранить и взаимодействовать с цифровыми активами, такими как NFT и другие токены Ethereum.",aboutScreen_b_h1:"Лучший способ входа",aboutScreen_b_p:"В современных приложениях ваш кошелек можно использовать как удобный способ входа без необходимости помнить пароль.",aboutScreen_c_h1:"Исследуйте мир веб3",aboutScreen_c_p:"Ваш кошелек - это неотъемлемый инструмент, который позволяет вам исследовать и участвовать в быстро развивающемся мире веб3.",aboutScreen_ctaText:"Узнать больше",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Подключение кошелька",connectorsScreen_newcomer:"У меня нет кошелька",connectorsScreen_h1:"Что такое кошелек?",connectorsScreen_p:"Кошельки используются для отправки, получения и хранения цифровых активов. Подключение кошелька позволяет вам взаимодействовать с приложениями.",mobileConnectorsScreen_heading:"Выберите кошелек",scanScreen_heading:"Сканирование с телефона",scanScreen_heading_withConnector:"Сканирование с помощью {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Откройте [WALLETCONNECTLOGO] поддерживаемый WalletConnect кошелек для сканирования",scanScreen_tooltip_default:"Откройте {{ CONNECTORNAME }} на вашем мобильном телефоне для сканирования",downloadAppScreen_heading:"Скачивание {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Отсканируйте камерой телефона для загрузки приложения на iOS или Android.",downloadAppScreen_ios:"Отсканируйте камерой телефона для загрузки приложения на iOS.",downloadAppScreen_android:"Сканируйте камерой телефона для загрузки приложения на Android.",injectionScreen_unavailable_h1:"Неподдерживаемый браузер",injectionScreen_unavailable_p:"Для подключения вашего кошелька {{ CONNECTORSHORTNAME }}, установите расширение для браузера {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Установите {{ CONNECTORNAME }}",injectionScreen_install_p:"Для подключения вашего кошелька {{ CONNECTORSHORTNAME }}, установите расширение для браузера.",injectionScreen_connecting_h1:"Запрос на подключение",injectionScreen_connecting_p:"Откройте расширение для браузера {{ CONNECTORSHORTNAME }} для подключения вашего кошелька.",injectionScreen_connecting_injected_h1:"Запрос на подключение",injectionScreen_connecting_injected_p:"Примите запрос в вашем кошельке, чтобы подключиться к приложению.",injectionScreen_connected_h1:"Уже подключен",injectionScreen_connected_p:"Можно закрыть это окно",injectionScreen_rejected_h1:"Запрос отменен",injectionScreen_rejected_p:`Вы отменили запрос. +Нажмите выше, чтобы попробовать снова.`,injectionScreen_failed_h1:"Сбой подключения",injectionScreen_failed_p:`Извините, что-то пошло не так. +Пожалуйста, попробуйте подключиться снова.`,injectionScreen_notconnected_h1:"Войдите в {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Для продолжения войдите в расширение {{ CONNECTORNAME }}.",profileScreen_heading:"Кошелек подключен",switchNetworkScreen_heading:"Переключение сетей",signInWithEthereumScreen_tooltip:`Вы не вошли в это приложение. +**Войдите с помощью Ethereum**, чтобы продолжить.`,signInWithEthereumScreen_signedOut_heading:"Войти с помощью Ethereum",signInWithEthereumScreen_signedOut_h1:`Это приложение хочет подтвердить вас + в качестве владельца этого кошелька.`,signInWithEthereumScreen_signedOut_p:`Пожалуйста, подпишите запрос на сообщение + в своем кошельке, чтобы продолжить.`,signInWithEthereumScreen_signedOut_button:"Войти",signInWithEthereumScreen_signedIn_heading:"Вошли с помощью Ethereum",signInWithEthereumScreen_signedIn_h1:`Вы успешно подтвердили себя + в качестве владельца этого кошелька.`,signInWithEthereumScreen_signedIn_p:`Выйти потребуется + повторная аутентификация в будущем.`,signInWithEthereumScreen_signedIn_button:"Выйти"},zhCN={connectWallet:"绑定钱包",disconnect:"解除绑定",connected:"已绑定",wrongNetwork:"错误网络",switchNetworks:"切换网络",chainNetwork:"{{ CHAIN }}网络",copyToClipboard:"复制到剪贴板",copyCode:"复制代码",moreInformation:"更多信息",back:"返回",close:"关闭",or:"或",more:"更多",tryAgain:"重试",tryAgainQuestion:"重试?",dontHaveTheApp:"没有该应用?",scanTheQRCode:"扫描二维码",useWalletConnectModal:"使用 WalletConnect 模态窗",useModal:"使用模态窗",installTheExtension:"安装扩展程序",getWalletName:"获取{{ CONNECTORNAME }}",otherWallets:"其他钱包",learnMore:"了解更多",getWallet:"获取钱包",approveInWallet:"在钱包中批准",confirmInWallet:"在钱包中确认",awaitingConfirmation:"等待确认",signIn:"登录",signOut:"登出",signedIn:"已登录",signedOut:"已登出",walletNotConnected:"钱包未绑定",warnings_walletSwitchingUnsupported:"您的钱包不支持从此应用切换网络。",warnings_walletSwitchingUnsupportedResolve:"请尝试从钱包中切换网络。",warnings_chainUnsupported:"此应用不支持当前连接的网络。",warnings_chainUnsupportedResolve:"请切换网络或断开连接以继续。",onboardingScreen_heading:"获取钱包",onboardingScreen_h1:"开始探索 Web3",onboardingScreen_p:"您的钱包是通往以太坊的一扇大门,而以太坊是探索 Web3 的一项神奇技术。",onboardingScreen_ctaText:"选择您的第一钱包",onboardingScreen_ctaUrl:"https://ethereum.org/zh/wallets/find-wallet/",aboutScreen_heading:"关于钱包",aboutScreen_a_h1:"对于您的数字资产",aboutScreen_a_p:"有了钱包,您可以发送、接收、存储数字资产及使用数字资产进行交互,例如 NFT 和其他以太坊通证等。",aboutScreen_b_h1:"更好的登录方式",aboutScreen_b_p:"使用现代应用,您的钱包可以用作简便的登录方法,而不必记住密码。",aboutScreen_c_h1:"探索 Web3 世界",aboutScreen_c_p:"您的钱包是一个重要的工具,可以让您探索并参与到快速发展的 Web3 世界。",aboutScreen_ctaText:"了解更多",aboutScreen_ctaUrl:"https://ethereum.org/zh/wallets/",connectorsScreen_heading:"绑定钱包",connectorsScreen_newcomer:"我没有钱包",connectorsScreen_h1:"什么是钱包?",connectorsScreen_p:"钱包可用于发送、接收和存储数字资产。通过绑定钱包,您可以与应用进行交互。",mobileConnectorsScreen_heading:"选择钱包",scanScreen_heading:"手机扫描",scanScreen_heading_withConnector:"手机扫描{{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"打开 [WALLETCONNECTLOGO] WalletConnect 支持的钱包进行扫描",scanScreen_tooltip_default:"打开您手机上的{{ CONNECTORNAME }} 进行扫描",downloadAppScreen_heading:"获取{{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"使用手机相机扫描以下载 iOS 或 Android 应用。",downloadAppScreen_ios:"使用手机相机扫描以下载 iOS 应用。",downloadAppScreen_android:"使用手机相机扫描以下载 Android 应用。",injectionScreen_unavailable_h1:"不支持的浏览器",injectionScreen_unavailable_p:"要绑定您的{{ CONNECTORSHORTNAME }}钱包,请在{{ SUGGESTEDEXTENSIONBROWSER }}上安装此扩展程序。",injectionScreen_install_h1:"安装{{ CONNECTORNAME }}",injectionScreen_install_p:"要绑定您的{{ CONNECTORSHORTNAME }}钱包,请安装此浏览器扩展程序。",injectionScreen_connecting_h1:"请求绑定",injectionScreen_connecting_p:"打开{{ CONNECTORSHORTNAME }}浏览器 扩展程序以绑定您的钱包。",injectionScreen_connecting_injected_h1:"请求绑定",injectionScreen_connecting_injected_p:"通过您的钱包接受请求,以绑定到此应用。",injectionScreen_connected_h1:"已绑定",injectionScreen_connected_p:"现在可以关闭此弹窗",injectionScreen_rejected_h1:"请求已取消",injectionScreen_rejected_p:"您已取消请求。点击上面可重试。",injectionScreen_failed_h1:"绑定失败",injectionScreen_failed_p:"抱歉,发生错误。请尝试重新绑定。",injectionScreen_notconnected_h1:"登录{{ CONNECTORNAME }}",injectionScreen_notconnected_p:"要继续,请登录到您的{{ CONNECTORNAME }}扩展程序。",profileScreen_heading:"已绑定",switchNetworkScreen_heading:"切换网络",signInWithEthereumScreen_tooltip:`您尚未登录到此应用。 +请选择**使用以太坊登录**以继续。`,signInWithEthereumScreen_signedOut_heading:"使用以太坊登录",signInWithEthereumScreen_signedOut_h1:"此应用希望验证您是 此钱包的所有者。",signInWithEthereumScreen_signedOut_p:"请签署钱包中的消息请求 以继续。",signInWithEthereumScreen_signedOut_button:"登录",signInWithEthereumScreen_signedIn_heading:"已使用以太坊登录",signInWithEthereumScreen_signedIn_h1:"您已成功验证自己 是此钱包的所有者。",signInWithEthereumScreen_signedIn_p:"登出后,将来您还需要 再次进行身份验证。",signInWithEthereumScreen_signedIn_button:"登出"},caAD={connectWallet:"Connecta la cartera",disconnect:"Desconnectar",connected:"Connectat",wrongNetwork:"Xarxa incorrecta",switchNetworks:"Canvi de xarxa",chainNetwork:"Xarxa {{ CHAIN }}",copyToClipboard:"Copia al portapapers",copyCode:"Copia codi",moreInformation:"Més informació",back:"Enrere",close:"Tanca",or:"o",more:"Més",tryAgain:"Torna-ho a intentar",tryAgainQuestion:"Tornar a intentar-ho?",dontHaveTheApp:"No tens l'aplicació?",scanTheQRCode:"Escaneja el codi QR",useWalletConnectModal:"Utilitza WalletConnect Modal",useModal:"Utilitza Modal",installTheExtension:"Instal·la l'extensió",getWalletName:"Obté {{ CONNECTORNAME }}",otherWallets:"Altres carteres",learnMore:"Més informació",getWallet:"Obté una cartera",approveInWallet:"Aprova a la cartera",confirmInWallet:"Confirma a la cartera",awaitingConfirmation:"Esperant confirmació",signIn:"Inicia sessió",signOut:"Tanca sessió",signedIn:"Sessió iniciada",signedOut:"Sessió tancada",walletNotConnected:"Cartera no connectada",warnings_walletSwitchingUnsupported:"La teva cartera no permet canviar de xarxa des d'aquesta aplicació.",warnings_walletSwitchingUnsupportedResolve:"Prova a canviar de xarxa des de la teva cartera.",warnings_chainUnsupported:"Aquesta aplicació no és compatible amb la xarxa connectada actualment.",warnings_chainUnsupportedResolve:"Canvia o desconnecta per continuar.",onboardingScreen_heading:"Obté una cartera",onboardingScreen_h1:"Comença a explorar la Web3",onboardingScreen_p:"La teva cartera és el portal d'accés a tot el relacionat amb Ethereum, la tecnologia màgica que permet explorar la Web3.",onboardingScreen_ctaText:"Tria la teva primera cartera",onboardingScreen_ctaUrl:"https://ethereum.org/es/wallets/find-wallet/",aboutScreen_heading:"Sobre les carteres",aboutScreen_a_h1:"Per als teus actius digitals",aboutScreen_a_p:"Les carteres et permeten enviar, rebre, emmagatzemar i interactuar amb actius digitals com els NFT i altres tokens d'Ethereum.",aboutScreen_b_h1:"Una manera millor d'iniciar sessió",aboutScreen_b_p:"Amb les aplicacions modernes, pots utilitzar la teva cartera per iniciar sessió fàcilment, en lloc de haver de recordar una contrasenya.",aboutScreen_c_h1:"Explora el món de la Web3",aboutScreen_c_p:"La teva cartera és una eina essencial que et permet explorar i participar en el món en ràpida evolució de la Web3.",aboutScreen_ctaText:"Més informació",aboutScreen_ctaUrl:"https://ethereum.org/es/wallets/",connectorsScreen_heading:"Connecta una cartera",connectorsScreen_newcomer:"No tinc una cartera",connectorsScreen_h1:"Què és una cartera?",connectorsScreen_p:"Les carteres s'utilitzen per enviar, rebre i emmagatzemar actius digitals. Si connectes una cartera, podràs interactuar amb les aplicacions.",mobileConnectorsScreen_heading:"Tria una cartera",scanScreen_heading:"Escaneja amb el telèfon",scanScreen_heading_withConnector:"Escaneja amb {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Obre una cartera compatible amb WalletConnect [WALLETCONNECTLOGO] per escanejar",scanScreen_tooltip_default:"Obre {{ CONNECTORNAME }} en el teu telèfon mòbil per escanejar",downloadAppScreen_heading:"Obté {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Escaneja amb la càmera del teu telèfon per descarregar-la en iOS o Android.",downloadAppScreen_ios:"Escaneja amb la càmera del teu telèfon per descarregar-la en iOS.",downloadAppScreen_android:"Escaneja amb la càmera del teu telèfon per descarregar-la en Android.",injectionScreen_unavailable_h1:"Navegador no compatible",injectionScreen_unavailable_p:"Per connectar la teva cartera de {{ CONNECTORSHORTNAME }}, instal·la l'extensió en {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Instal·la {{ CONNECTORNAME }}",injectionScreen_install_p:"Per connectar la teva cartera de {{ CONNECTORSHORTNAME }}, instal·la l'extensió del navegador.",injectionScreen_connecting_h1:"Sol·licitud de connexió",injectionScreen_connecting_p:"Obre l'extensió del navegador de {{ CONNECTORSHORTNAME }} per connectar la teva cartera.",injectionScreen_connecting_injected_h1:"Sol·licitud de connexió",injectionScreen_connecting_injected_p:"Accepta la sol·licitud a través de la teva cartera per connectar-te a aquesta aplicació.",injectionScreen_connected_h1:"Ja connectada",injectionScreen_connected_p:"Ja pots tancar aquesta finestra emergent",injectionScreen_rejected_h1:"Sol·licitud cancel·lada",injectionScreen_rejected_p:"Has cancel·lat la sol·licitud. Fes clic a dalt per tornar-ho a intentar.",injectionScreen_failed_h1:"Error de connexió",injectionScreen_failed_p:"Ho sentim, hi ha hagut un problema. Intenta connectar-te de nou.",injectionScreen_notconnected_h1:"Inicia sessió en {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Per continuar, inicia sessió en la teva extensió de {{ CONNECTORNAME }}.",profileScreen_heading:"Connectat",switchNetworkScreen_heading:"Canvi de xarxa",signInWithEthereumScreen_tooltip:`No has iniciat sessió en aquesta aplicació. +**Inicia sessió amb Ethereum** per continuar.`,signInWithEthereumScreen_signedOut_heading:"Inicia sessió amb Ethereum",signInWithEthereumScreen_signedOut_h1:"Aquesta aplicació vol verificar que ets el propietari d'aquesta cartera.",signInWithEthereumScreen_signedOut_p:"Signa la sol·licitud de missatge en la teva cartera per continuar.",signInWithEthereumScreen_signedOut_button:"Inicia sessió",signInWithEthereumScreen_signedIn_heading:"Sessió iniciada amb Ethereum",signInWithEthereumScreen_signedIn_h1:"T'has verificat correctament com a propietari d'aquesta cartera.",signInWithEthereumScreen_signedIn_p:"Si tanques la sessió, hauràs de tornar a autenticar-te més endavant.",signInWithEthereumScreen_signedIn_button:"Tanca sessió"},trTR={connectWallet:"Cüzdan Bağla",disconnect:"Bağlantıyı Kes",connected:"Bağlandı",wrongNetwork:"Yanlış Ağ",switchNetworks:"Ağ Değiştir",chainNetwork:"{{ CHAIN }} Ağı",copyToClipboard:"Panoya Kopyala",copyCode:"Kodu Kopyala",moreInformation:"Daha Fazla Bilgi",back:"Geri",close:"Kapat",or:"veya",more:"Daha Fazla",tryAgain:"Tekrar Dene",tryAgainQuestion:"Tekrar Dene?",dontHaveTheApp:"Uygulaman yok mu?",scanTheQRCode:"Karekodu tarat",useWalletConnectModal:"WalletConnect Modalini Kullan ",useModal:"Modal Kullan",installTheExtension:"Eklentiyi İndir",getWalletName:"{{ CONNECTORNAME }} Alın",otherWallets:"Diğer Cüzdanlar",learnMore:"Daha Fazlasını Öğren",getWallet:"Cüzdan Al",approveInWallet:"Cüzdanda Yetki Ver",confirmInWallet:"Cüzdanda Onayla",awaitingConfirmation:"Doğrulama Bekleniyor",signIn:"Giriş Yap",signOut:"Çıkış Yap",signedIn:"Giriş Yapıldı",signedOut:"Çıkış Yapıldı",walletNotConnected:"Cüzdan Bağlı Değil",warnings_walletSwitchingUnsupported:"Bu uygulamada ağ değiştirmeyi cüzdanın desteklemiyor.",warnings_walletSwitchingUnsupportedResolve:"Bunun yerine cüzdanınızdan ağları değiştirmeyi deneyin.",warnings_chainUnsupported:"Bu uygulama kullanmış olduğunuz ağı desteklemiyor.",warnings_chainUnsupportedResolve:"Devam etmek için ağ değiştir veya bağlantıyı kes.",onboardingScreen_heading:"Cüzdan Al",onboardingScreen_h1:"Web3'ü keşfetmeye başla",onboardingScreen_p:"Cüzdanınız, Web3'ü keşfetmeyi mümkün kılan sihirli teknoloji olan Ethereum'a açılan kapıdır.",onboardingScreen_ctaText:"İlk Cüzdanını Seç",onboardingScreen_ctaUrl:"https://ethereum.org/tr/wallets/find-wallet/",aboutScreen_heading:"Cüzdanlar Hakkında",aboutScreen_a_h1:"Dijital varlıkların için",aboutScreen_a_p:"Cüzdanlar, NFT'ler ve diğer Ethereum varlıkları gibi dijital varlıklar göndermenize, almanıza, saklamanıza ve bunlarla etkileşim kurmanıza olanak tanır.",aboutScreen_b_h1:"Giriş yapmanın daha iyi bir yolu",aboutScreen_b_p:"Modern uygulamalar ile parola hatırlamak yerine cüzdanınız ile kolayca giriş yapabilirsiniz.",aboutScreen_c_h1:"Web3 dünyasını keşfet",aboutScreen_c_p:"Cüzdanınız, hızla gelişen Web3 dünyasını keşfetmenizi ve bu dünyaya katılmanızı sağlayan temel bir yardımcı programdır.",aboutScreen_ctaText:"Daha Fazlasını Öğren",aboutScreen_ctaUrl:"https://ethereum.org/tr/wallets/",connectorsScreen_heading:"Cüzdan Bağla",connectorsScreen_newcomer:"Cüzdanım Yok",connectorsScreen_h1:"Cüzdan nedir?",connectorsScreen_p:"Cüzdanlar, dijital varlıkları göndermek, almak ve depolamak için kullanılır. Bir cüzdanı bağlamak, uygulamalarla etkileşime geçmenizi sağlar.",mobileConnectorsScreen_heading:"Cüzdan Seç",scanScreen_heading:"Telefon ile Tarat",scanScreen_heading_withConnector:"{{ CONNECTORNAME }} ile tarat",scanScreen_tooltip_walletConnect:`Desteklenen bir cüzdan taramak için + [WALLETCONNECTLOGO] WalletConnect uygulamasını aç`,scanScreen_tooltip_default:`Taramak için telefonunda + {{ CONNECTORNAME }} uygulamasını aç`,downloadAppScreen_heading:"{{ CONNECTORNAME }} İndir",downloadAppScreen_iosAndroid:"iOS ve Android'e indirmek için telefon kameran ile tarat.",downloadAppScreen_ios:"iOS'a indirmek için telefon kameran ile tarat.",downloadAppScreen_android:"Android'e indirmek için telefon kameran ile tarat.",injectionScreen_unavailable_h1:"Desteklenmeyen Tarayıcı",injectionScreen_unavailable_p:`{{ CONNECTORSHORTNAME }} cüzdanına bağlanmak için +{{ SUGGESTEDEXTENSIONBROWSER }} üzerinde indirmen gerekiyor.`,injectionScreen_install_h1:"{{ CONNECTORNAME }} İndir",injectionScreen_install_p:`{{ CONNECTORSHORTNAME }} cüzdanına bağlanmak için, +tarayıcı eklentisini indir.`,injectionScreen_connecting_h1:"Bağlantı İsteniyor.",injectionScreen_connecting_p:`Cüzdanını bağlamak için + tarayıcıdan {{ CONNECTORSHORTNAME }} uzantısını açın.`,injectionScreen_connecting_injected_h1:"Bağlantı İsteniyor.",injectionScreen_connecting_injected_p:"Bu uygulamaya bağlanmak için cüzdanına gelen isteği kabul et.",injectionScreen_connected_h1:"Zaten Bağlanmış",injectionScreen_connected_p:"Bu açılır pencereyi artık kapatabilirsin",injectionScreen_rejected_h1:"İstek iptal edildi.",injectionScreen_rejected_p:`İsteği iptal ettin. +Tekrar denemek için yukarıyı tıklayın.`,injectionScreen_failed_h1:"Bağlantı Başarısız",injectionScreen_failed_p:`Üzgünüz, bir şeyler ters gitti. +Lütfen daha sonra tekrar deneyin.`,injectionScreen_notconnected_h1:"{{ CONNECTORNAME }} ile giriş yap",injectionScreen_notconnected_p:"Devam etmek için, {{ CONNECTORNAME }} eklentisine giriş yapın.",profileScreen_heading:"Bağlandı",switchNetworkScreen_heading:"Ağ Değiştir",signInWithEthereumScreen_tooltip:`Bu uygulamada oturum açmadınız. + Devam etmek için **Ethereum İle Giriş Yap**.`,signInWithEthereumScreen_signedOut_heading:"Ethereum İle Giriş Yap",signInWithEthereumScreen_signedOut_h1:`Bu uygulama seni + bu cüzdanın sahibi olarak doğrulamak istiyor.`,signInWithEthereumScreen_signedOut_p:`Devam etmek için + cüzdanınızdaki isteği onaylayın.`,signInWithEthereumScreen_signedOut_button:"Giriş Yap",signInWithEthereumScreen_signedIn_heading:"Ethereum İle Giriş Yapıldı",signInWithEthereumScreen_signedIn_h1:`Bu cüzdanın sahibi olduğunu + başarıyla onayladın.`,signInWithEthereumScreen_signedIn_p:`Çıkış yaparsan ileride + tekrar giriş yapman gerekecek. `,signInWithEthereumScreen_signedIn_button:"Çıkış Yap"},viVN={connectWallet:"Kết nối ví",disconnect:"Ngắt kết nối",connected:"Đã kết nối",wrongNetwork:"Mạng không hỗ trợ",switchNetworks:"Đổi mạng",chainNetwork:"Mạng {{ CHAIN }}",copyToClipboard:"Sao chép",copyCode:"Sao chép mã",moreInformation:"Thêm thông tin",back:"Quay lại",close:"Đóng",or:"hoặc",more:"Thêm",tryAgain:"Thử lại",tryAgainQuestion:"Thử lại?",dontHaveTheApp:"Không có app?",scanTheQRCode:"Quét mã QR",useWalletConnectModal:"Dùng WalletConnect Modal",useModal:"Dùng Modal",installTheExtension:"Cài tiện ích",getWalletName:"Lấy {{ CONNECTORNAME }}",otherWallets:"Các ví khác",learnMore:"Xem thêm",getWallet:"Tạo một ví",approveInWallet:"Cấp quyền trong ví",confirmInWallet:"Xác nhận trong ví",awaitingConfirmation:"Đang chờ xác nhận",signIn:"Đăng nhập",signOut:"Đăng xuất",signedIn:"Đã đăng nhập",signedOut:"Đã đăng xuất",walletNotConnected:"Chưa kết nối ví",warnings_walletSwitchingUnsupported:"Ví của bạn không hỗ trợ đổi mạng từ ứng dụng.",warnings_walletSwitchingUnsupportedResolve:"Hãy thử đổi mạng từ phía ví của bạn.",warnings_chainUnsupported:"Ứng dụng này không hỗ trợ mạng hiện tại.",warnings_chainUnsupportedResolve:"Đổi hoặc ngắt kết nối để tiếp tục.",onboardingScreen_heading:"Tạo một ví",onboardingScreen_h1:"Bắt đầu khám khá Web3",onboardingScreen_p:"Ví của bạn là cổng giao tiếp mọi thứ trên Ethereum, công nghệ tuyệt vời giúp khám phá Web3.",onboardingScreen_ctaText:"Chọn ví đầu tiên của bạn",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"Giới thiệu các ví",aboutScreen_a_h1:"Cho tài sản số của bạn",aboutScreen_a_p:"Các ví để bạn gửi, nhận, lưu trữ, và tương tác với các tài sản điện tử như NFTs và các loại tiền Ethereum khác.",aboutScreen_b_h1:"Một cách tốt hơn để đăng nhập",aboutScreen_b_p:"Với các ứng dụng hiện đại, ví của bạn có thể dùng để đăng nhập dễ dàng thay vì phải nhớ tài khoản và mật khẩu.",aboutScreen_c_h1:"Khám phá thế giới Web3",aboutScreen_c_p:"Ví của bạn là một tiện ích thiết yếu cho phép bạn khám phá và tham gia vào thế giới web3 đang phát triển nhanh chóng.",aboutScreen_ctaText:"Tìm hiểu thêm",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Kết nối Ví",connectorsScreen_newcomer:"Tôi chưa có ví",connectorsScreen_h1:"Ví là gì?",connectorsScreen_p:"Ví dùng để gửi, nhận, và lưu trữ các tài sản điện tử. Kết nối với một ví giúp bạn tương tác với các ứng dụng.",mobileConnectorsScreen_heading:"Chọn ví",scanScreen_heading:"Scan bằng điện thoại",scanScreen_heading_withConnector:"Quét với {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`Mở một [WALLETCONNECTLOGO] mà WalletConnect + hỗ trợ để quét`,scanScreen_tooltip_default:`Mở {{ CONNECTORNAME }} trong +điện thoại của bạn để quét`,downloadAppScreen_heading:"Lấy {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Quét bằng camera trên điện thoại của bạn để tải về cho iOS hoặc Android.",downloadAppScreen_ios:"Quét bằng camera trên điện thoại ủa bạn để tải về cho iOS.",downloadAppScreen_android:"Quét bằng camera trên điện thoại ủa bạn để tải về cho Android.",injectionScreen_unavailable_h1:"Trình duyệt không được hỗ trợ",injectionScreen_unavailable_p:`Để kết nối ví {{ CONNECTORSHORTNAME }} của bạn, +cài đặt tiện ích trên {{ SUGGESTEDEXTENSIONBROWSER }}.`,injectionScreen_install_h1:"Cài {{ CONNECTORNAME }}",injectionScreen_install_p:`Để kết nối ví {{ CONNECTORSHORTNAME }}, +cài đặt tiện ích trên trình duyệt.`,injectionScreen_connecting_h1:"Đang yêu cầu kết nối",injectionScreen_connecting_p:`Mở tiện ích {{ CONNECTORSHORTNAME }} + trên trình duyệt để kết nối.`,injectionScreen_connecting_injected_h1:"Đang yêu cầu kết nối",injectionScreen_connecting_injected_p:"Đồng ý yêu cầu từ phía ví của bạn để kết nối ứng dụng này.",injectionScreen_connected_h1:"Đã kết nối",injectionScreen_connected_p:"Đã có thể đóng popup",injectionScreen_rejected_h1:"Đã hủy yêu cầu",injectionScreen_rejected_p:`Bạn vừa hủy yêu cầu. +Nhấn phía trên để thử lại.`,injectionScreen_failed_h1:"Kết nối không thành công",injectionScreen_failed_p:`Xin lỗi, có gì đó không đúng. +Vui lòng thử lại.`,injectionScreen_notconnected_h1:"Đăng nhập vào {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Để tiếp tục, vui lòng đăng nhập bằng tiện ích {{ CONNECTORNAME }}.",profileScreen_heading:"Đã kết nối",switchNetworkScreen_heading:"Đổi mạng",signInWithEthereumScreen_tooltip:`Bạn chưa đăng nhập vào ứng dụng. +**Đăng nhập qua Ethereum** để tiếp tục.`,signInWithEthereumScreen_signedOut_heading:"Đăng nhập qua Ethereum",signInWithEthereumScreen_signedOut_h1:`Ứng dụng này muốn xác nhận bạn + là chủ sở hữu của ví.`,signInWithEthereumScreen_signedOut_p:`Vui lòng ký tin nhắn yêu cầu + trên ví của bạn để tiếp tục.`,signInWithEthereumScreen_signedOut_button:"Đăng nhập",signInWithEthereumScreen_signedIn_heading:"Đăng nhập qua Ethereum",signInWithEthereumScreen_signedIn_h1:"Bạn đã xác nhận thành công.",signInWithEthereumScreen_signedIn_p:`Sau khi Đăng xuất bạn sẽ cần + xác nhận lại trong làn tiếp theo.`,signInWithEthereumScreen_signedIn_button:"Đăng xuất"},getLocale=o=>{switch(o){case"ee-EE":return eeEE;case"ar-AE":return arAE;case"es-ES":return esES;case"fa-IR":return faIR;case"fr-FR":return frFR;case"ja-JP":return jaJP;case"pt-BR":return ptBR;case"ru-RU":return ruRU;case"zh-CN":return zhCN;case"ca-AD":return caAD;case"tr-TR":return trTR;case"vi-VN":return viVN;default:return enUS}};function useLocales(o){var et,tt;const rt=(tt=(et=useContext().options)===null||et===void 0?void 0:et.language)!==null&&tt!==void 0?tt:"en-US",ot=reactExports.useMemo(()=>getLocale(rt),[rt]);if(!ot)return console.error(`Missing translations for: ${rt}`),`Missing translations for: ${rt}`;const it={};return Object.keys(ot).map(st=>{const at=ot[st];return it[st]=localize(at,o)}),it}const localize=(o,et)=>{let tt=o;return et&&Object.keys(et).forEach(nt=>{tt=tt.replace(new RegExp(`({{ ${nt} }})`,"g"),et[nt])}),replaceMarkdown(tt)},replaceMarkdown=o=>{let et=o;return et=et.split(` +`),et=et.map((tt,nt)=>jsxRuntimeExports.jsxs(React.Fragment,{children:[wrapTags(tt),nto.split(/(\*\*[^\*]*\*\*)/g).map((nt,rt)=>/(\*\*.*\*\*)/g.test(nt)?jsxRuntimeExports.jsx("strong",{children:nt.replace(/\*\*/g,"")},rt):`${nt}`).map(nt=>typeof nt=="string"?nt.split(/(\[WALLETCONNECTLOGO\])/g).map(rt=>rt==="[WALLETCONNECTLOGO]"?jsxRuntimeExports.jsx("span",{className:"ck-tt-logo",children:jsxRuntimeExports.jsx(Logos.WalletConnect,{})},rt):rt):nt),LOG_LEVEL={debug:10,info:20,warn:30,error:40,none:100},useIsoLayoutEffect=typeof window<"u"&&window.document&&window.document.createElement!==void 0?reactExports.useLayoutEffect:reactExports.useEffect,useFitText=({logLevel:o="info",maxFontSize:et=100,minFontSize:tt=20,onFinish:nt,onStart:rt,resolution:ot=5}={})=>{const it=LOG_LEVEL[o],st=reactExports.useCallback(()=>({calcKey:0,fontSize:et,fontSizePrev:tt,fontSizeMax:et,fontSizeMin:tt}),[et,tt]),at=reactExports.useRef(null),ct=reactExports.useRef(),lt=reactExports.useRef(!1),[dt,ht]=reactExports.useState(st),{calcKey:pt,fontSize:mt,fontSizeMax:ft,fontSizeMin:yt,fontSizePrev:gt}=dt;let xt=null;const[vt]=reactExports.useState(()=>new index$1(()=>{xt=window.requestAnimationFrame(()=>{lt.current||(rt&&rt(),lt.current=!0,ht({...st(),calcKey:pt+1}))})}));reactExports.useEffect(()=>(at.current&&vt.observe(at.current),()=>{xt&&window.cancelAnimationFrame(xt),vt.disconnect()}),[xt,vt]);const bt=at.current&&at.current.innerHTML;return reactExports.useEffect(()=>{pt===0||lt.current||(bt!==ct.current&&(rt&&rt(),ht({...st(),calcKey:pt+1})),ct.current=bt)},[pt,st,bt,rt]),useIsoLayoutEffect(()=>{if(pt===0)return;const Et=Math.abs(mt-gt)<=ot,wt=!!at.current&&(at.current.scrollHeight>at.current.offsetHeight||at.current.scrollWidth>at.current.offsetWidth),kt=wt&&mt===gt,Tt=mt>gt;if(Et){kt?(lt.current=!1,it<=LOG_LEVEL.info&&console.info(`[use-fit-text] reached \`minFontSize = ${tt}\` without fitting text`)):wt?ht({fontSize:Tt?gt:yt,fontSizeMax:ft,fontSizeMin:yt,fontSizePrev:gt,calcKey:pt}):(lt.current=!1,nt&&nt(mt));return}let Rt,Pt=ft,$t=yt;wt?(Rt=Tt?gt-mt:yt-mt,Pt=Math.min(ft,mt)):(Rt=Tt?ft-mt:gt-mt,$t=Math.max(yt,mt)),ht({calcKey:pt,fontSize:mt+Rt/2,fontSizeMax:Pt,fontSizeMin:$t,fontSizePrev:mt})},[pt,mt,ft,yt,gt,nt,at,ot]),{fontSize:mt,ref:at}},FitText=({children:o})=>{const[et,tt]=React.useState(!1),{fontSize:nt,ref:rt}=useFitText({logLevel:"none",maxFontSize:100,minFontSize:70,onStart:()=>tt(!0),onFinish:()=>tt(!0)});return jsxRuntimeExports.jsx("div",{ref:rt,style:{visibility:et?"visible":"hidden",fontSize:`${nt}%`,maxHeight:"100%",maxWidth:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:o})};FitText.displayName="FitText";function useConnectors(){const o=useConnectors$1();return o??[]}function useConnector(o,et){const tt=useConnectors();return o==="injected"&&et?tt.find(nt=>nt.id===o&&nt.name===et):o==="injected"?tt.find(nt=>nt.id===o&&nt.name.includes("Injected")):tt.find(nt=>nt.id===o)}function useWalletConnectConnector(){return useConnector("walletConnect")}const useWallet=o=>{const tt=useWallets().find(nt=>nt.id===o);return tt||null},useWallets=()=>{const o=useConnectors(),et=useContext();return o.map(nt=>{var rt,ot;const it=Object.keys(walletConfigs).find(at=>at.split(",").map(ct=>ct.trim()).indexOf(nt.id)!==-1),st={id:nt.id,name:(ot=(rt=nt.name)!==null&&rt!==void 0?rt:nt.id)!==null&&ot!==void 0?ot:nt.type,icon:jsxRuntimeExports.jsx("img",{src:nt.icon,alt:nt.name,width:"100%",height:"100%"}),connector:nt,iconShape:"squircle",isInstalled:nt.type==="mock"||nt.type==="injected"&&nt.id!=="metaMask"||isCoinbaseWalletConnector(nt.id)};if(it){const at=walletConfigs[it];return{...st,iconConnector:nt.icon?jsxRuntimeExports.jsx("img",{src:nt.icon,alt:nt.name,width:"100%",height:"100%"}):void 0,...at}}return st}).filter((nt,rt,ot)=>ot.findIndex(it=>it.id===nt.id)===rt).map(nt=>{var rt,ot;return nt.id==="walletConnect"?{...nt,name:((rt=et.options)===null||rt===void 0?void 0:rt.walletConnectName)||nt.name,shortName:((ot=et.options)===null||ot===void 0?void 0:ot.walletConnectName)||nt.shortName}:nt}).filter((nt,rt,ot)=>!(nt.id==="coinbaseWalletSDK"&&ot.find(it=>it.id==="com.coinbase.wallet"))).filter((nt,rt,ot)=>!((nt.id==="metaMaskSDK"||nt.id==="metaMask")&&ot.find(it=>it.id==="io.metamask"||it.id==="io.metamask.mobile"))).sort((nt,rt)=>{const ot=nt.isInstalled&&isInjectedConnector(nt.connector.type),it=rt.isInstalled&&isInjectedConnector(rt.connector.type);return ot&&!it?-1:!ot&&it?1:0}).sort((nt,rt)=>nt.id==="walletConnect"?1:rt.id==="walletConnect"?-1:0)},ProfileIcon=({isSignedIn:o})=>jsxRuntimeExports.jsxs("div",{style:{position:"relative"},children:[o?jsxRuntimeExports.jsx(AuthIcon,{style:{bottom:-1,right:-1}}):jsxRuntimeExports.jsx("div",{style:{zIndex:2,position:"absolute",top:-2,right:-2,background:"#1A88F8",borderRadius:8,boxShadow:"0 0 0 2px var(--ck-body-background)",width:8,height:8}}),jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{overflow:"visible"},children:[jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M16.5 16.775C14.8618 15.0649 12.5552 14 10 14C7.44477 14 5.13825 15.0649 3.5 16.775",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("circle",{cx:"10",cy:"8",r:"3",stroke:"currentColor",strokeWidth:"2"})]})]}),InfoIcon=({...o})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 11C20 15.9706 15.9706 20 11 20C6.02944 20 2 15.9706 2 11C2 6.02944 6.02944 2 11 2C15.9706 2 20 6.02944 20 11ZM22 11C22 17.0751 17.0751 22 11 22C4.92487 22 0 17.0751 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11ZM11.6445 12.7051C11.6445 13.1348 11.3223 13.4678 10.7744 13.4678C10.2266 13.4678 9.92578 13.1885 9.92578 12.6191V12.4795C9.92578 11.4268 10.4951 10.8574 11.2686 10.3203C12.2031 9.67578 12.665 9.32129 12.665 8.59082C12.665 7.76367 12.0205 7.21582 11.043 7.21582C10.3232 7.21582 9.80762 7.57031 9.45312 8.16113C9.38282 8.24242 9.32286 8.32101 9.2667 8.39461C9.04826 8.68087 8.88747 8.8916 8.40039 8.8916C8.0459 8.8916 7.66992 8.62305 7.66992 8.15039C7.66992 7.96777 7.70215 7.7959 7.75586 7.61328C8.05664 6.625 9.27051 5.75488 11.1182 5.75488C12.9336 5.75488 14.5234 6.71094 14.5234 8.50488C14.5234 9.7832 13.7822 10.417 12.7402 11.1045C11.999 11.5986 11.6445 11.9746 11.6445 12.5762V12.7051ZM11.9131 15.5625C11.9131 16.1855 11.376 16.6797 10.7529 16.6797C10.1299 16.6797 9.59277 16.1748 9.59277 15.5625C9.59277 14.9395 10.1191 14.4453 10.7529 14.4453C11.3867 14.4453 11.9131 14.9287 11.9131 15.5625Z",fill:"currentColor"})}),CloseIcon=({...o})=>jsxRuntimeExports.jsx(motion.svg,{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:jsxRuntimeExports.jsx("path",{d:"M1 13L13 1M1 1L13 13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),BackIcon=({...o})=>jsxRuntimeExports.jsx(motion.svg,{width:9,height:16,viewBox:"0 0 9 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:jsxRuntimeExports.jsx("path",{d:"M8 1L1 8L8 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),contentTransitionDuration=.22,contentVariants$2={initial:{zIndex:2,opacity:0},animate:{opacity:1,scale:1,transition:{duration:contentTransitionDuration*.75,delay:contentTransitionDuration*.25,ease:[.26,.08,.25,1]}},exit:{zIndex:1,opacity:0,pointerEvents:"none",position:"absolute",left:["50%","50%"],x:["-50%","-50%"],transition:{duration:contentTransitionDuration,ease:[.26,.08,.25,1]}}},Modal=({open:o,pages:et,pageId:tt,positionInside:nt,inline:rt,demo:ot,onClose:it,onBack:st,onInfo:at})=>{var ct,lt,dt,ht,pt,mt,ft,yt,gt,xt,vt,bt;const Et=useContext(),wt=useThemeContext(),kt=isMobile(),{isSignedIn:Tt,reset:Rt}=useSIWE(),Pt=useWallet((ct=Et.connector)===null||ct===void 0?void 0:ct.id),$t={name:Pt==null?void 0:Pt.name,shortName:(lt=Pt==null?void 0:Pt.shortName)!==null&<!==void 0?lt:Pt==null?void 0:Pt.name,icon:(dt=Pt==null?void 0:Pt.iconConnector)!==null&&dt!==void 0?dt:Pt==null?void 0:Pt.icon,iconShape:(ht=Pt==null?void 0:Pt.iconShape)!==null&&ht!==void 0?ht:"circle",iconShouldShrink:Pt==null?void 0:Pt.iconShouldShrink},Ot=useLocales({CONNECTORNAME:$t==null?void 0:$t.name}),[Bt,zt]=useTransition({timeout:160,preEnter:!0,mountOnEnter:!0,unmountOnExit:!0}),Ft=!(Bt==="exited"||Bt==="unmounted"),Yt=Bt==="preEnter"||Bt!=="exiting",Ht=Et.route===routes.CONNECTORS?0:Et.route===routes.DOWNLOAD?2:1,Ut=usePrevious(Ht,Ht);nt||useLockBodyScroll(Ft),usePrevious(tt,tt),reactExports.useEffect(()=>{zt(o),o&&Qt(void 0)},[o]);const[qt,Lt]=reactExports.useState({width:void 0,height:void 0}),[Zt,Qt]=reactExports.useState(void 0),Nt=Vt=>{const en={width:Vt==null?void 0:Vt.offsetWidth,height:Vt==null?void 0:Vt.offsetHeight};Lt({width:`${en==null?void 0:en.width}px`,height:`${en==null?void 0:en.height}px`})};let Gt;const nn=reactExports.useCallback(Vt=>{Vt&&(Xt.current=Vt,Qt(Zt!==void 0),clearTimeout(Gt),Gt=setTimeout(()=>Qt(!1),360),Nt(Vt))},[o,Zt]),{chain:Wt}=useAccount(),{switchChain:hn}=useSwitchChain(),Xt=reactExports.useRef(null);reactExports.useEffect(()=>{Xt.current&&Nt(Xt.current)},[Wt,hn,kt,Tt,Et.options,Et.resize]),reactExports.useEffect(()=>{if(!Ft){Lt({width:void 0,height:void 0});return}const Vt=en=>{en.key==="Escape"&&it&&it()};return document.addEventListener("keydown",Vt),()=>{document.removeEventListener("keydown",Vt)}},[Ft,it]);const Jt={"--height":qt.height,"--width":qt.width};function tn(){return Pt?!(!Pt.getWalletConnectDeeplink||Pt.isInstalled):!1}function _t(){var Vt;switch(Et.route){case routes.ABOUT:return Ot.aboutScreen_heading;case routes.CONNECT:return tn()?isWalletConnectConnector((Vt=Pt==null?void 0:Pt.connector)===null||Vt===void 0?void 0:Vt.id)?Ot.scanScreen_heading:Ot.scanScreen_heading_withConnector:$t==null?void 0:$t.name;case routes.CONNECTORS:return Ot.connectorsScreen_heading;case routes.MOBILECONNECTORS:return Ot.mobileConnectorsScreen_heading;case routes.DOWNLOAD:return Ot.downloadAppScreen_heading;case routes.ONBOARDING:return Ot.onboardingScreen_heading;case routes.PROFILE:return Ot.profileScreen_heading;case routes.SWITCHNETWORKS:return Ot.switchNetworkScreen_heading;case routes.SIGNINWITHETHEREUM:return Tt?Ot.signInWithEthereumScreen_signedIn_heading:Ot.signInWithEthereumScreen_signedOut_heading;default:return""}}const Dt=jsxRuntimeExports.jsx(ResetContainer,{$useTheme:(pt=ot==null?void 0:ot.theme)!==null&&pt!==void 0?pt:wt.theme,$useMode:(mt=ot==null?void 0:ot.mode)!==null&&mt!==void 0?mt:wt.mode,$customTheme:(ft=ot==null?void 0:ot.customTheme)!==null&&ft!==void 0?ft:wt.customTheme,children:jsxRuntimeExports.jsxs(ModalContainer,{role:"dialog",style:{pointerEvents:Yt?"auto":"none",position:nt?"absolute":void 0},children:[!rt&&jsxRuntimeExports.jsx(BackgroundOverlay,{$active:Yt,onClick:it,$blur:(yt=Et.options)===null||yt===void 0?void 0:yt.overlayBlur}),jsxRuntimeExports.jsxs(Container$7,{style:Jt,initial:!1,children:[jsxRuntimeExports.jsx("div",{style:{pointerEvents:Zt?"all":"none",position:"absolute",top:0,bottom:0,left:"50%",transform:"translateX(-50%)",width:"var(--width)",zIndex:9,transition:"width 200ms ease"}}),jsxRuntimeExports.jsxs(BoxContainer,{className:`${Yt&&"active"}`,children:[jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:((gt=Et.options)===null||gt===void 0?void 0:gt.disclaimer)&&Et.route===routes.CONNECTORS&&jsxRuntimeExports.jsx(DisclaimerBackground,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{delay:0,duration:.2,ease:[.25,.1,.25,1]},children:jsxRuntimeExports.jsx(Disclaimer,{children:jsxRuntimeExports.jsx("div",{children:(xt=Et.options)===null||xt===void 0?void 0:xt.disclaimer})})})}),jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:Et.errorMessage&&jsxRuntimeExports.jsxs(ErrorMessage,{initial:{y:"10%",x:"-50%"},animate:{y:"-100%"},exit:{y:"100%"},transition:{duration:.2,ease:"easeInOut"},children:[jsxRuntimeExports.jsx("span",{children:Et.errorMessage}),jsxRuntimeExports.jsx("div",{onClick:()=>Et.displayError(null),style:{position:"absolute",right:24,top:24,cursor:"pointer"},children:jsxRuntimeExports.jsx(CloseIcon,{})})]})}),jsxRuntimeExports.jsxs(ControllerContainer,{children:[it&&jsxRuntimeExports.jsx(CloseButton,{"aria-label":flattenChildren(Ot.close).toString(),onClick:it,children:jsxRuntimeExports.jsx(CloseIcon,{})}),jsxRuntimeExports.jsx("div",{style:{position:"absolute",top:23,left:20,width:32,height:32},children:jsxRuntimeExports.jsx(AnimatePresence,{children:st?jsxRuntimeExports.jsx(BackButton,{disabled:Zt,"aria-label":flattenChildren(Ot.back).toString(),onClick:st,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:kt?0:.1,delay:kt?.01:0},children:jsxRuntimeExports.jsx(BackIcon,{})},"backButton"):Et.route===routes.PROFILE&&Et.signInWithEthereum?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!Tt&&!(!((vt=Et.options)===null||vt===void 0)&&vt.hideTooltips)&&jsxRuntimeExports.jsx(motion.div,{style:{position:"absolute",inset:0,pointerEvents:"none"},initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1,transition:{delay:.5,duration:.2}},exit:{opacity:0,scale:.6,transition:{delay:0,duration:kt?0:.1}},children:jsxRuntimeExports.jsx(SignInTooltip,{children:Ot.signInWithEthereumScreen_tooltip})}),jsxRuntimeExports.jsx(SiweButton,{disabled:Zt,"aria-label":Ot.signInWithEthereumScreen_signedOut_heading,onClick:()=>{Rt(),Et.setRoute(routes.SIGNINWITHETHEREUM)},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:kt?0:.1,delay:kt?.01:0},children:jsxRuntimeExports.jsx(ProfileIcon,{isSignedIn:Tt})},"siweButton")]}):at&&!(!((bt=Et.options)===null||bt===void 0)&&bt.hideQuestionMarkCTA)&&jsxRuntimeExports.jsx(InfoButton,{disabled:Zt,"aria-label":flattenChildren(Ot.moreInformation).toString(),onClick:at,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:kt?0:.1,delay:kt?.01:0},children:jsxRuntimeExports.jsx(InfoIcon,{})},"infoButton")})})]}),jsxRuntimeExports.jsx(ModalHeading,{children:jsxRuntimeExports.jsx(AnimatePresence,{children:jsxRuntimeExports.jsx(motion.div,{style:{position:"absolute",top:0,bottom:0,left:52,right:52,display:"flex",justifyContent:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:kt?0:.17,delay:kt?.01:0},children:jsxRuntimeExports.jsx(FitText,{children:_t()})},`${Et.route}-${Tt?"signedIn":""}`)})}),jsxRuntimeExports.jsx(InnerContainer$1,{children:Object.keys(et).map(Vt=>{const en=et[Vt];return jsxRuntimeExports.jsx(Page,{open:Vt===tt,initial:!nt&&Bt!=="entered",enterAnim:Vt===tt?Ht>Ut?"active-scale-up":"active":"",exitAnim:Vt!==tt?Ht{const[st,at]=useTransition({timeout:400,preEnter:!0,initialEntered:et,mountOnEnter:!0,unmountOnExit:!0}),ct=!(st==="exited"||st==="unmounted"),lt=st==="preEnter"||st!=="exiting";return reactExports.useEffect(()=>{at(et)},[et]),ct?jsxRuntimeExports.jsx(PageContainer,{className:`${lt?ot:it}`,style:{animationDuration:tt?"0ms":void 0,animationDelay:tt?"0ms":void 0},children:o}):null},OrDivider=({children:o})=>{const et=useLocales();return jsxRuntimeExports.jsx(TextWithHr,{children:jsxRuntimeExports.jsx("span",{children:o??et.or})})},Graphic=styled(motion.div)` + position: relative; + margin: 16px auto 20px; + height: 190px; + max-width: 295px; + pointer-events: none; + user-select: none; + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + height: 200px; + max-width: 100%; + margin-bottom: 32px; + } +`,LogoGroup=styled(motion.div)` + position: absolute; + inset: 0; + z-index: 2; +`,graphicIn=We` + 0%{ + opacity:0; + transform:scale(0.9); + } + 100%{ + opacity:1; + transform:none; + } +`,GraphicBackground=styled(motion.div)` + z-index: 1; + position: absolute; + inset: 0; + top: -2px; + overflow: hidden; + &:before { + content: ''; + position: absolute; + inset: 0; + background: var(--ck-body-background); + background: radial-gradient( + closest-side, + var(--ck-body-background-transparent, transparent) 18.75%, + var(--ck-body-background) 100% + ); + background-size: 100%; + } + svg { + display: block; + width: 100%; + height: auto; + } + animation: ${graphicIn} 1000ms 100ms ease both; + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + animation: none; + } +`,logoIn=We` + 0%{ + opacity:0; + transform:scale(0) translateY(40%); + } + 100%{ + opacity:1; + transform:none; + } +`,LogoPosition=styled(motion.div)` + position: absolute; + inset: 0; + animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both; + animation-delay: inherit; +`,LogoInner=styled(motion.div)` + position: absolute; +`,LogoGraphic=styled(motion.div)` + position: relative; + overflow: hidden; + height: 58px; + width: 58px; + border-radius: 13.84px; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 2px 20px 0 rgba(0, 0, 0, 0.03); + + svg { + display: block; + width: 100%; + height: 100%; + } +`,float$1=We` + 0%,100%{ transform:none; } + 50%{ transform: translateY(-10%) } +`,FloatWrapper=styled(motion.div)` + position: relative; + animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both; + animation-name: ${float$1}; + animation-duration: 3600ms; +`,rotate=We` + 0%,100%{ transform:rotate(-3deg); } + 50%{ transform:rotate(3deg); } +`,RotateWrapper=styled(motion.div)` + position: relative; + animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both; + animation-name: ${rotate}; + animation-duration: 3200ms; +`,Logo$2=styled(motion.div)` + position: absolute; + inset: 0; + + animation: ${logoIn} 750ms cubic-bezier(0.19, 1, 0.22, 1) both; + &:nth-child(1){ z-index:2; animation-delay:0ms; } + &:nth-child(2){ z-index:1; animation-delay:60ms; } + &:nth-child(3){ z-index:1; animation-delay:30ms; } + &:nth-child(4){ z-index:1; animation-delay:90ms; } + &:nth-child(5){ z-index:1; animation-delay:120ms;} + + &:nth-child(1){ ${RotateWrapper}{ animation-delay:0ms; } } + &:nth-child(2){ ${RotateWrapper}{ animation-delay:-600ms; } } + &:nth-child(3){ ${RotateWrapper}{ animation-delay:-1200ms; } } + &:nth-child(4){ ${RotateWrapper}{ animation-delay:-1800ms; } } + &:nth-child(5){ ${RotateWrapper}{ animation-delay:-2400ms; } } + + &:nth-child(1){ ${FloatWrapper}{ animation-delay:-200ms; } } + &:nth-child(2){ ${FloatWrapper}{ animation-delay:-600ms; } } + &:nth-child(3){ ${FloatWrapper}{ animation-delay:-800ms; } } + &:nth-child(4){ ${FloatWrapper}{ animation-delay:-300ms; } } + &:nth-child(5){ ${FloatWrapper}{ animation-delay:-3200ms; } } + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + animation: none !important; + ${RotateWrapper},${FloatWrapper} { + animation: none !important; + } + } + + ${LogoInner} { + transform: translate(-50%, -50%); + } + + &:nth-child(1) ${LogoPosition} { + transform: translate(50%, 50%); + ${LogoGraphic} { + border-radius: 17.2px; + width: 72px; + height: 72px; + } + } + &:nth-child(2) ${LogoPosition} { + transform: translate(21%, 21.5%); + } + &:nth-child(3) ${LogoPosition} { + transform: translate(78%, 14%); + } + &:nth-child(4) ${LogoPosition} { + transform: translate(22.5%, 76%); + } + &:nth-child(5) ${LogoPosition} { + transform: translate(76%, 80%); + } +`;var wave=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"298",height:"188",viewBox:"0 0 298 188",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M1 55.2757L21.6438 46.0285C55.5896 30.8228 94.4104 30.8228 128.356 46.0286L169.644 64.5229C203.59 79.7287 242.41 79.7286 276.356 64.5229L297 55.2757M1 44.2118L21.6438 34.9646C55.5896 19.7589 94.4104 19.7589 128.356 34.9646L169.644 53.459C203.59 68.6647 242.41 68.6647 276.356 53.459L297 44.2118M1 33.1477L21.6438 23.9005C55.5896 8.69479 94.4104 8.69479 128.356 23.9005L169.644 42.3949C203.59 57.6006 242.41 57.6006 276.356 42.3949L297 33.1477M1 22.1477L21.6438 12.9005C55.5896 -2.30521 94.4104 -2.30521 128.356 12.9005L169.644 31.3949C203.59 46.6006 242.41 46.6006 276.356 31.3949L297 22.1477M1 66.3398L21.6438 57.0926C55.5896 41.8869 94.4104 41.8869 128.356 57.0926L169.644 75.587C203.59 90.7927 242.41 90.7927 276.356 75.587L297 66.3398M1 77.404L21.6438 68.1568C55.5896 52.9511 94.4104 52.9511 128.356 68.1569L169.644 86.6512C203.59 101.857 242.41 101.857 276.356 86.6512L297 77.404M1 88.4681L21.6438 79.2209C55.5896 64.0152 94.4104 64.0152 128.356 79.2209L169.644 97.7153C203.59 112.921 242.41 112.921 276.356 97.7153L297 88.4681M1 121.66L21.6438 112.413C55.5896 97.2075 94.4104 97.2075 128.356 112.413L169.644 130.908C203.59 146.113 242.41 146.113 276.356 130.908L297 121.66M1 110.596L21.6438 101.349C55.5896 86.1433 94.4104 86.1433 128.356 101.349L169.644 119.843C203.59 135.049 242.41 135.049 276.356 119.843L297 110.596M1 99.5321L21.6438 90.2849C55.5896 75.0792 94.4104 75.0792 128.356 90.2849L169.644 108.779C203.59 123.985 242.41 123.985 276.356 108.779L297 99.5321M1 132.724L21.6438 123.477C55.5896 108.271 94.4104 108.271 128.356 123.477L169.644 141.971C203.59 157.177 242.41 157.177 276.356 141.971L297 132.724M1 143.788L21.6438 134.541C55.5896 119.336 94.4104 119.336 128.356 134.541L169.644 153.036C203.59 168.241 242.41 168.241 276.356 153.036L297 143.788M1 154.853L21.6438 145.605C55.5896 130.4 94.4104 130.4 128.356 145.605L169.644 164.1C203.59 179.305 242.41 179.305 276.356 164.1L297 154.853M1 165.853L21.6438 156.605C55.5896 141.4 94.4104 141.4 128.356 156.605L169.644 175.1C203.59 190.305 242.41 190.305 276.356 175.1L297 165.853",stroke:"url(#paint0_linear_1094_2077)",strokeOpacity:"0.9",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1094_2077",x1:"1",y1:"112.587",x2:"297.034",y2:"79.6111",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-01)"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-02)",offset:"0.239583"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-03)",offset:"0.515625"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-04)",offset:"0.739583"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-05)",offset:"1"})]})})]});const SpinnerContainer$3=styled(motion.div)` + position: absolute; + right: 16px; + top: 0; + bottom: 0; + display: flex; + align-items: center; + justify-content: center; +`,Arrow=styled.svg` + --x: -3px; + --stroke-width: 2; + position: relative; + top: 1px; + left: -0.5px; + display: inline-block; + vertical-align: middle; + margin-left: 9px; + margin-right: 1px; + transition: all 100ms ease; + transform: translateX(var(--x, -3px)); + color: currentColor; + opacity: 0.4; +`,ArrowChevron=styled.path``,ArrowLine=styled.line` + transition: inherit; + transition-property: transform; + transform-origin: 90% 50%; + transform: scaleX(0.1); +`,DownloadArrow=styled.div` + display: inline-block; + vertical-align: middle; + position: relative; + margin-right: 6px; + color: currentColor; +`,DownloadArrowInner=styled.div` + transform: rotate(90deg); + ${Arrow} { + margin: 0 auto; + } +`,ButtonContainerInner=styled(motion.div)` + display: flex; + align-items: center; + justify-content: center; + inset: 0; + height: 100%; +`,ButtonContainer$1=styled.button` + + ${({disabled:o})=>o&&Ae` + cursor: not-allowed; + pointer-events: none; + ${InnerContainer} { + opacity: 0.4; + } + `} + + ${({$variant:o})=>{if(o==="primary")return Ae` + --color: var(--ck-primary-button-color, var(--ck-body-color)); + --background: var( + --ck-primary-button-background, + var(--ck-body-background-primary) + ); + --box-shadow: var(--ck-primary-button-box-shadow); + --border-radius: var(--ck-primary-button-border-radius); + --font-weight: var(--ck-primary-button-font-weight, 500); + + --hover-color: var(--ck-button-primary-hover-color, var(--color)); + --hover-background: var( + --ck-primary-button-hover-background, + var(--background) + ); + --hover-box-shadow: var( + --ck-primary-button-hover-box-shadow, + var(--box-shadow) + ); + --hover-border-radius: var( + --ck-primary-button-hover-border-radius, + var(--border-radius) + ); + --hover-font-weight: var( + --ck-primary-button-font-weight, + var(--font-weight) + ); + `;if(o==="secondary")return Ae` + --color: var(--ck-secondary-button-color, var(--ck-body-color)); + --background: var( + --ck-secondary-button-background, + var(--ck-body-background-secondary) + ); + --box-shadow: var(--ck-secondary-button-box-shadow); + --border-radius: var(--ck-secondary-button-border-radius); + --font-weight: var(--ck-secondary-button-font-weight, 500); + + --hover-color: var(--ck-secondary-button-hover-color, var(--color)); + --hover-background: var( + --ck-secondary-button-hover-background, + var(--background) + ); + --hover-box-shadow: var( + --ck-secondary-button-hover-box-shadow, + var(--box-shadow) + ); + --hover-border-radius: var( + --ck-secondary-button-hover-border-radius, + var(--border-radius) + ); + --hover-font-weight: var( + --ck-secondary-button-font-weight, + var(--font-weight) + ); + `;if(o==="tertiary")return Ae` + --color: var( + --ck-tertiary-button-color, + var(--ck-secondary-button-color) + ); + --background: var( + --ck-tertiary-button-background, + var(--ck-secondary-button-background) + ); + --box-shadow: var( + --ck-tertiary-button-box-shadow, + var(--ck-secondary-button-box-shadow) + ); + --border-radius: var( + --ck-tertiary-button-border-radius, + var(--ck-secondary-button-border-radius) + ); + --font-weight: var( + --ck-tertiary-button-font-weight, + var(--ck-secondary-button-font-weight) + ); + + --hover-color: var( + --button-tertiary-hover-color, + var(--ck-tertiary-button-color) + ); + --hover-background: var( + --ck-tertiary-button-hover-background, + var(--ck-tertiary-button-background) + ); + --hover-box-shadow: var( + --ck-tertiary-button-hover-box-shadow, + var(--ck-tertiary-button-box-shadow) + ); + --hover-border-radius: var( + --ck-tertiary-button-hover-border-radius, + var(--ck-tertiary-button-border-radius, var(--border-radius)) + ); + --hover-font-weight: var( + --ck-tertiary-button-font-weight, + var(--ck-secondary-button-font-weight) + ); + `}} + + appearance: none; + cursor: pointer; + user-select: none; + min-width: fit-content; + width: 100%; + display:block; + text-align: center; + height: 48px; + margin: 12px 0 0; + line-height: 48px; + padding: 0 4px; + font-size: 16px; + font-weight: var(--font-weight,500); + text-decoration: none; + white-space: nowrap; + transition: 100ms ease; + transition-property: box-shadow, background-color; + color: var(--color); + background: var(--background); + border-radius: var(--border-radius); + box-shadow: var(--box-shadow); + will-change: transform, box-shadow, background-color, color; + + ${DownloadArrow} { + ${Arrow} { + transform: translateX(0); + ${ArrowLine} { + transform: none; + } + ${ArrowChevron} { + } + } + } +} + + @media only screen and (min-width: ${defaultTheme.mobileWidth+1}px) { + &:hover, + &:focus-visible { + color: var(--ck-accent-text-color, var(--hover-color)); + background: var(--ck-accent-color, var(--hover-background)); + border-radius: var(--hover-border-radius); + box-shadow: var(--hover-box-shadow); + + ${Arrow} { + transform: translateX(0); + ${ArrowLine} { + transform: none; + } + ${ArrowChevron} { + } + } + ${DownloadArrow} { + ${Arrow} { + transform: translateX(var(--x)); + ${ArrowLine} { + transform: scaleX(0.1); + } + ${ArrowChevron} { + } + } + } + } + &:active { + box-shadow: var(--ck-secondary-button-active-box-shadow, var(--hover-box-shadow)); + } + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + transition: transform 100ms ease; + transform: scale(1); + font-size: 17px; + &:active { + } + } +`,InnerContainer=styled.div` + transform: translateZ(0); // Shifting fix + position: relative; + display: inline-block; + vertical-align: middle; + max-width: calc(100% - 42px); + transition: opacity 300ms ease; + /* + overflow: hidden; + text-overflow: ellipsis; + */ +`,IconContainer$4=styled(motion.div)` + position: relative; + display: inline-block; + vertical-align: middle; + max-width: 20px; + max-height: 20px; + margin: 0 10px; + &:first-child { + margin-left: 0; + } + &:last-child { + margin-right: 0; + } + ${o=>o.$rounded&&Ae` + overflow: hidden; + border-radius: 5px; + `} + svg { + display: block; + position: relative; + max-width: 100%; + height: auto; + } +`,Spin$1=We` + 0%{ transform: rotate(0deg); } + 100%{ transform: rotate(360deg); } +`,SpinnerContainer$2=styled(motion.div)` + display: flex; + align-items: center; + justify-content: center; + animation: ${Spin$1} 1s linear infinite; + svg { + display: block; + position: relative; + animation: ${Spin$1} 1s ease-in-out infinite; + } +`,transition$2={duration:.4,ease:[.175,.885,.32,.98]},Spinner$4=()=>jsxRuntimeExports.jsx(SpinnerContainer$2,{initial:{opacity:0,rotate:180},animate:{opacity:1,rotate:0},exit:{position:"absolute",opacity:0,rotate:-180,transition:{...transition$2}},transition:{...transition$2,delay:.2},children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeOpacity:"0.1",strokeWidth:"2.5"}),jsxRuntimeExports.jsx("path",{d:"M16 9C16 5.13401 12.866 2 9 2",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})]})}),transition$1={duration:.4,ease:[.175,.885,.32,.98]},Button$1=({children:o,variant:et="secondary",disabled:tt,icon:nt,iconPosition:rt="left",roundedIcon:ot,waiting:it,arrow:st,download:at,href:ct,style:lt,onClick:dt})=>{const ht=typeof o=="string"?o:flattenChildren(o).join(""),pt=typeof ct=="string"?ct:flattenChildren(ct).join("");return jsxRuntimeExports.jsx(ButtonContainer$1,{as:ct?"a":void 0,onClick:mt=>{!tt&&dt&&dt(mt)},href:pt,target:ct&&"_blank",rel:ct&&"noopener noreferrer",disabled:tt,$variant:et,style:lt,children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[jsxRuntimeExports.jsxs(ButtonContainerInner,{initial:{opacity:0,y:-10},animate:{opacity:1,y:-1},exit:{position:"absolute",opacity:0,y:10,transition:{...transition$1}},transition:{...transition$1,delay:.2},children:[nt&&rt==="left"&&jsxRuntimeExports.jsx(IconContainer$4,{$rounded:ot,children:nt}),at&&jsxRuntimeExports.jsx(DownloadArrow,{children:jsxRuntimeExports.jsx(DownloadArrowInner,{children:jsxRuntimeExports.jsxs(Arrow,{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx(ArrowLine,{stroke:"currentColor",x1:"1",y1:"6",x2:"12",y2:"6",strokeWidth:"var(--stroke-width)",strokeLinecap:"round"}),jsxRuntimeExports.jsx(ArrowChevron,{stroke:"currentColor",d:"M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314",strokeWidth:"var(--stroke-width)",strokeLinecap:"round"})]})})}),jsxRuntimeExports.jsx(InnerContainer,{style:{paddingLeft:st?6:0},children:jsxRuntimeExports.jsx(FitText,{children:o})}),nt&&rt==="right"&&jsxRuntimeExports.jsx(IconContainer$4,{$rounded:ot,children:nt}),st&&jsxRuntimeExports.jsxs(Arrow,{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx(ArrowLine,{stroke:"currentColor",x1:"1",y1:"6",x2:"12",y2:"6",strokeWidth:"2",strokeLinecap:"round"}),jsxRuntimeExports.jsx(ArrowChevron,{stroke:"currentColor",d:"M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314",strokeWidth:"2",strokeLinecap:"round"})]})]},ht),it&&jsxRuntimeExports.jsx(SpinnerContainer$3,{children:jsxRuntimeExports.jsx(Spinner$4,{})})]})})},Introduction=()=>{var o,et;const tt=useContext(),nt=useLocales({}),rt=(et=(o=tt.options)===null||o===void 0?void 0:o.walletOnboardingUrl)!==null&&et!==void 0?et:nt.onboardingScreen_ctaUrl;return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(Graphic,{children:[jsxRuntimeExports.jsxs(LogoGroup,{children:[jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.MetaMask,{background:!0})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.Trust,{})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.Argent,{})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.ImToken,{})})})})})})})]}),jsxRuntimeExports.jsx(GraphicBackground,{children:wave})]}),jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:18},children:[jsxRuntimeExports.jsx(ModalH1,{$small:!0,children:nt.onboardingScreen_h1}),jsxRuntimeExports.jsx(ModalBody,{children:nt.onboardingScreen_p})]}),jsxRuntimeExports.jsx(Button$1,{href:rt,arrow:!0,children:nt.onboardingScreen_ctaText})]})},imageHeight=208,ImageContainer$1=styled.div` + pointer-events: none; + user-select: none; + height: ${imageHeight}px; + padding: 0 0 12px; + display: flex; + align-items: center; + justify-content: center; + svg { + display: block; + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + display: none; + } +`,ImageContainerInner=styled(motion.div)``,MobileImageContainer=styled.div` + pointer-events: none; + user-select: none; + height: ${imageHeight}px; + padding: 0 0 12px; + display: none; + align-items: center; + justify-content: center; + svg { + display: block; + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + display: flex; + } +`,Slides=styled.div` + position: relative; +`,Slide=styled(motion.div)` + scroll-snap-type: x mandatory; + position: relative; + bottom: 0; + left: 0; + right: 0; + width: 100%; + padding: 0 4px 8px; + /* will-change: transform, opacity; */ + transition: 400ms 50ms cubic-bezier(0.16, 1, 0.3, 1); + transition-property: transform, opacity; + ${o=>!o.$active&&Ae` + pointer-events: none; + position: absolute; + opacity: 0; + transform: scale(0.95); + transition-duration: 300ms; + transition-delay: 0ms; + `} +`,Slider=styled.div` + --background: var(--ck-body-background-secondary); + --background-transparent: var(--ck-body-background-transparent, transparent); + position: relative; + padding: 0 0 4px; + border-radius: 16px; + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + margin: 0 -24px; + ${Slides} { + position: relative; + z-index: 3; + display: flex; + overflow: auto; + scroll-behavior: smooth; + scroll-snap-type: x mandatory; + margin-top: -${imageHeight}px; + padding-top: ${imageHeight}px; + -ms-overflow-style: none; /* Internet Explorer 10+ */ + scrollbar-width: none; /* Firefox */ + &::-webkit-scrollbar { + display: none; /* Safari and Chrome */ + } + } + ${Slide} { + position: relative; + opacity: 1; + transform: none; + flex-shrink: 0; + scroll-snap-align: start; + } + } +`,Dots=styled.div` + position: relative; + top: -1px; + display: flex; + justify-content: center; + pointer-events: auto; +`,Dot=styled.button` + display: flex; + align-items: center; + height: 28px; + padding: 2px; + background: none; + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + padding: 4px; + &:before { + transform: none !important; + } + } + &:before { + content: ''; + display: block; + width: 16px; + height: 3px; + opacity: 0.12; + border-radius: 4px; + background: var(--ck-accent-color, var(--ck-body-color)); + transition: transform 200ms ease, opacity 180ms ease; + } + ${o=>o.$active?Ae` + cursor: default; + &:before { + opacity: 1; + } + `:!o.disabled&&Ae` + cursor: pointer; + &:hover:before { + transform: scaleY(3.5); + } + &:active:before { + } + `} +`,pulseAnim={scale:[.9,1.25,1.6],opacity:[0,.11,0]},pulseTransition={ease:"linear",duration:2,repeat:1/0},Center=styled.div` + position: absolute; + left: 50%; + top: 50%; + transform: translateY(-50%) translateX(-50%); +`,spin=We` + from{ transform: rotate(0deg); } + to{ transform: rotate(360deg); } +`,SpinContainer=styled(motion.div)` + z-index: -1; + position: absolute; + inset: 0; + overflow: hidden; + border-radius: 100%; + animation: ${spin} 16s linear infinite; +`,BgLighten=styled(motion.div)` + overflow: hidden; + border-radius: inherit; + z-index: 0; + position: absolute; + inset: 0; + background: rgba(255, 255, 255, 0.1); +`,MainCircle=styled(motion.div)` + z-index: 2; + position: relative; + border-radius: 50%; + background: var(--ck-body-background); +`,MainCircleInner=styled(motion.div)` + position: absolute; + inset: 0; + display: flex; + align-items: center; + justify-content: center; + border-radius: 50%; +`,Compass=jsxRuntimeExports.jsxs("svg",{width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M17 34C26.3 34 34 26.2833 34 17C34 7.7 26.2833 0 16.9833 0C7.7 0 0 7.7 0 17C0 26.2833 7.71667 34 17 34ZM9.83333 25.6833C8.68333 26.2333 7.8 25.3333 8.33333 24.2L13.1667 14.3333C13.45 13.75 13.8167 13.3833 14.35 13.1333L24.1833 8.33333C25.4 7.75 26.25 8.65 25.6833 9.81667L20.8833 19.6667C20.6167 20.2 20.2333 20.6 19.6833 20.85L9.83333 25.6833ZM17.0167 19.1333C18.1833 19.1333 19.1333 18.1833 19.1333 17.0167C19.1333 15.85 18.1833 14.9167 17.0167 14.9167C15.8667 14.9167 14.9167 15.85 14.9167 17.0167C14.9167 18.1833 15.8667 19.1333 17.0167 19.1333Z",fill:"var(--ck-graphic-compass-color, var(--ck-body-color))"}),jsxRuntimeExports.jsx("path",{d:"M17 34C26.3 34 34 26.2833 34 17C34 7.7 26.2833 0 16.9833 0C7.7 0 0 7.7 0 17C0 26.2833 7.71667 34 17 34ZM9.83333 25.6833C8.68333 26.2333 7.8 25.3333 8.33333 24.2L13.1667 14.3333C13.45 13.75 13.8167 13.3833 14.35 13.1333L24.1833 8.33333C25.4 7.75 26.25 8.65 25.6833 9.81667L20.8833 19.6667C20.6167 20.2 20.2333 20.6 19.6833 20.85L9.83333 25.6833ZM17.0167 19.1333C18.1833 19.1333 19.1333 18.1833 19.1333 17.0167C19.1333 15.85 18.1833 14.9167 17.0167 14.9167C15.8667 14.9167 14.9167 15.85 14.9167 17.0167C14.9167 18.1833 15.8667 19.1333 17.0167 19.1333Z",fill:"url(#ck-compass-gradient)"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"ck-compass-gradient",x1:"17",y1:"0",x2:"17",y2:"34",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"rgba(0,0,0,0)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"rgba(0,0,0,0.05)"})]})})]}),Wallet=({inverted:o=!1})=>jsxRuntimeExports.jsxs("svg",{width:"58",height:"50",viewBox:"0 0 58 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.9332 20.3335V42.1113C57.9332 46.4069 54.451 49.8891 50.1555 49.8891H8.15546C3.85991 49.8891 0.377686 46.4069 0.377686 42.1113V25.0002V7.8891C0.377686 3.59355 3.85991 0.111328 8.15546 0.111328H47.0444C48.7626 0.111328 50.1555 1.50422 50.1555 3.22244C50.1555 4.94066 48.7626 6.33355 47.0443 6.33355H9.71102C7.9928 6.33355 6.59991 7.72644 6.59991 9.44466C6.59991 11.1629 7.9928 12.5558 9.71102 12.5558H50.1555C54.451 12.5558 57.9332 16.038 57.9332 20.3335ZM46.2667 34.3337C48.4145 34.3337 50.1556 32.5926 50.1556 30.4448C50.1556 28.297 48.4145 26.5559 46.2667 26.5559C44.1189 26.5559 42.3778 28.297 42.3778 30.4448C42.3778 32.5926 44.1189 34.3337 46.2667 34.3337Z",fill:o?"var(--ck-graphic-primary-color, var(--ck-body-background))":"var(--ck-graphic-primary-color, var(--ck-body-color))"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2501_7732",x1:"29.1555",y1:"0.111328",x2:"29.1555",y2:"49.8891",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:o?"var(--ck-body-color-muted)":"var(--ck-body-background-transparent, transparent)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:o?"var(--ck-body-color)":"var(--ck-body-background)"})]})})]}),Send=jsxRuntimeExports.jsx("svg",{width:"41",height:"41",viewBox:"0 0 41 41",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M35.4446 0.839914L2.14484 10.7065C0.0395033 11.3303 -0.632966 13.9786 0.919705 15.5313L7.9624 22.574C9.47585 24.0874 11.8661 24.273 13.5951 23.0114L25.2866 14.4797C25.5558 14.2832 25.9281 14.3121 26.1638 14.5478C26.3998 14.7838 26.4285 15.1567 26.2313 15.426L17.6874 27.0937C16.4213 28.8228 16.6052 31.2168 18.1206 32.7322L25.1811 39.7926C26.7337 41.3453 29.382 40.6728 30.0058 38.5675L39.8724 5.2677C40.6753 2.55794 38.1544 0.037024 35.4446 0.839914Z",fill:"var(--ck-graphic-secondary-color, white)"})}),Receive=jsxRuntimeExports.jsx("svg",{width:"38",height:"44",viewBox:"0 0 38 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 0.875C21.4853 0.875 23.5 2.88972 23.5 5.375V27.761L30.068 21.193C31.8254 19.4357 34.6746 19.4357 36.432 21.193C38.1893 22.9504 38.1893 25.7996 36.432 27.557L22.182 41.807C20.4246 43.5643 17.5754 43.5643 15.818 41.807L1.56802 27.557C-0.18934 25.7996 -0.18934 22.9504 1.56802 21.193C3.32538 19.4357 6.17462 19.4357 7.93198 21.193L14.5 27.761V5.375C14.5 2.88972 16.5147 0.875 19 0.875Z",fill:"var(--ck-graphic-secondary-color, white)"})}),Key$1=({...o})=>{var et;const tt=(et=o==null?void 0:o.id)!==null&&et!==void 0?et:"";return jsxRuntimeExports.jsxs("svg",{...o,width:"81",height:"81",viewBox:"0 0 81 81",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81 27C81 41.9117 68.9117 54 54 54C51.2722 54 48.6389 53.5955 46.1568 52.8432L36 63H27V72H18V81H4.5C2.01472 81 0 78.9853 0 76.5V64.864C0 63.6705 0.474103 62.5259 1.31802 61.682L28.1568 34.8432C27.4045 32.3611 27 29.7278 27 27C27 12.0883 39.0883 0 54 0C68.9117 0 81 12.0883 81 27ZM60.75 25.875C63.8566 25.875 66.375 23.3566 66.375 20.25C66.375 17.1434 63.8566 14.625 60.75 14.625C57.6434 14.625 55.125 17.1434 55.125 20.25C55.125 23.3566 57.6434 25.875 60.75 25.875Z",fill:`url(#${tt}paint0_linear_2509_6177)`}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81 27C81 41.9117 68.9117 54 54 54C51.2722 54 48.6389 53.5955 46.1568 52.8432L36 63H27V72H18V81H4.5C2.01472 81 0 78.9853 0 76.5V64.864C0 63.6705 0.474103 62.5259 1.31802 61.682L28.1568 34.8432C27.4045 32.3611 27 29.7278 27 27C27 12.0883 39.0883 0 54 0C68.9117 0 81 12.0883 81 27ZM60.75 25.875C63.8566 25.875 66.375 23.3566 66.375 20.25C66.375 17.1434 63.8566 14.625 60.75 14.625C57.6434 14.625 55.125 17.1434 55.125 20.25C55.125 23.3566 57.6434 25.875 60.75 25.875Z",fill:`url(#${tt}paint1_radial_2509_6177)`,fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.5658 51.2522C45.1527 50.6653 46.0151 50.4492 46.8095 50.6899C49.0823 51.3788 51.4958 51.75 54 51.75C67.6691 51.75 78.75 40.669 78.75 27C78.75 13.331 67.6691 2.25 54 2.25C40.331 2.25 29.25 13.331 29.25 27C29.25 29.5042 29.6212 31.9177 30.3101 34.1905C30.5508 34.9849 30.3347 35.8473 29.7478 36.4342L2.90901 63.273C2.48705 63.6949 2.25 64.2672 2.25 64.864V76.5C2.25 77.7426 3.25736 78.75 4.5 78.75H15.75V72C15.75 70.7574 16.7574 69.75 18 69.75H24.75V63C24.75 61.7574 25.7574 60.75 27 60.75H35.068L44.5658 51.2522ZM36 63H27V72H18V81H4.5C2.01472 81 0 78.9853 0 76.5V64.864C0 63.6705 0.474103 62.5259 1.31802 61.682L28.1568 34.8432C27.4045 32.3611 27 29.7278 27 27C27 12.0883 39.0883 0 54 0C68.9117 0 81 12.0883 81 27C81 41.9117 68.9117 54 54 54C51.2722 54 48.6389 53.5955 46.1568 52.8432L36 63ZM68.625 20.25C68.625 24.5992 65.0992 28.125 60.75 28.125C56.4008 28.125 52.875 24.5992 52.875 20.25C52.875 15.9008 56.4008 12.375 60.75 12.375C65.0992 12.375 68.625 15.9008 68.625 20.25ZM66.375 20.25C66.375 23.3566 63.8566 25.875 60.75 25.875C57.6434 25.875 55.125 23.3566 55.125 20.25C55.125 17.1434 57.6434 14.625 60.75 14.625C63.8566 14.625 66.375 17.1434 66.375 20.25Z",fill:"black",fillOpacity:"0.1"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.4205 47.5795C33.8598 48.0188 33.8598 48.7312 33.4205 49.1705L3.0455 79.5455C2.60616 79.9848 1.89384 79.9848 1.4545 79.5455C1.01517 79.1062 1.01517 78.3938 1.4545 77.9545L31.8295 47.5795C32.2688 47.1402 32.9812 47.1402 33.4205 47.5795Z",fill:"#A5A9AD"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:`${tt}paint0_linear_2509_6177`,x1:"72",y1:"5.625",x2:"2.25",y2:"78.75",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#D4DFE6"}),jsxRuntimeExports.jsx("stop",{offset:"0.0967282",stopColor:"#C6CACD"}),jsxRuntimeExports.jsx("stop",{offset:"0.526645",stopColor:"#BDBAC4"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#939CA1"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`${tt}paint1_radial_2509_6177`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(52.875 12.375) rotate(93.2705) scale(39.4392)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white"})]})]})]})},VitalikAddress=jsxRuntimeExports.jsxs("svg",{width:"131",height:"14",viewBox:"0 0 131 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M5.74805 13.2549C8.86816 13.2549 10.7227 10.6973 10.7227 6.63672C10.7227 2.57617 8.85059 0.0625 5.74805 0.0625C2.63672 0.0625 0.755859 2.59375 0.755859 6.64551C0.755859 10.7148 2.61914 13.2549 5.74805 13.2549ZM5.74805 11.4004C4.02539 11.4004 3.04102 9.64258 3.04102 6.63672C3.04102 3.68359 4.04297 1.91699 5.74805 1.91699C7.44434 1.91699 8.4375 3.6748 8.4375 6.64551C8.4375 9.65137 7.46191 11.4004 5.74805 11.4004Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M13.0869 13.1758C13.4561 13.1758 13.6934 13.0439 13.9658 12.6221L15.9697 9.66016H16.0137L18.0264 12.6572C18.2549 13.0088 18.4922 13.1758 18.8965 13.1758C19.4854 13.1758 19.9424 12.7891 19.9424 12.209C19.9424 11.9805 19.8633 11.7695 19.7051 11.541L17.376 8.28906L19.6963 5.16016C19.8896 4.90527 19.9688 4.68555 19.9688 4.43066C19.9688 3.88574 19.5381 3.49902 18.9229 3.49902C18.5361 3.49902 18.2988 3.6748 18.0176 4.10547L16.1191 6.95312H16.0752L14.1328 4.08789C13.8516 3.64844 13.6318 3.49902 13.2012 3.49902C12.6035 3.49902 12.1465 3.91211 12.1465 4.44824C12.1465 4.70312 12.2256 4.92285 12.3838 5.13379L14.7129 8.35059L12.3486 11.5498C12.1641 11.8135 12.0762 12.0156 12.0762 12.2705C12.0762 12.7979 12.498 13.1758 13.0869 13.1758Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M26.2441 13.2549C29.1445 13.2549 31.1924 11.7432 31.1924 9.57227C31.1924 7.9375 30.0146 6.68066 28.3184 6.3291V6.27637C29.7773 5.87207 30.7178 4.7998 30.7178 3.45508C30.7178 1.48633 28.8633 0.0625 26.2441 0.0625C23.625 0.0625 21.7617 1.49512 21.7617 3.44629C21.7617 4.80859 22.7109 5.88965 24.1699 6.27637V6.3291C22.4736 6.67188 21.3047 7.92871 21.3047 9.57227C21.3047 11.7344 23.335 13.2549 26.2441 13.2549ZM26.2441 5.55566C24.9258 5.55566 24.0029 4.78223 24.0029 3.6748C24.0029 2.55859 24.9258 1.77637 26.2441 1.77637C27.5537 1.77637 28.4854 2.5498 28.4854 3.6748C28.4854 4.78223 27.5537 5.55566 26.2441 5.55566ZM26.2441 11.5234C24.7236 11.5234 23.6514 10.6357 23.6514 9.40527C23.6514 8.1748 24.7236 7.28711 26.2441 7.28711C27.7646 7.28711 28.8369 8.16602 28.8369 9.40527C28.8369 10.6357 27.7646 11.5234 26.2441 11.5234Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M36.3164 13.1494C37.7578 13.1494 38.7598 12.4199 39.208 11.3477H39.252V12.0771C39.252 12.7891 39.7266 13.1758 40.3594 13.1758C40.9922 13.1758 41.4404 12.7803 41.4404 12.0771V1.29297C41.4404 0.554688 40.9834 0.141602 40.3418 0.141602C39.7002 0.141602 39.252 0.554688 39.252 1.29297V5.24805H39.1992C38.707 4.21973 37.6523 3.52539 36.3164 3.52539C33.9697 3.52539 32.4492 5.38867 32.4492 8.33301C32.4492 11.2949 33.9697 13.1494 36.3164 13.1494ZM36.9756 11.3564C35.5605 11.3564 34.6904 10.1963 34.6904 8.3418C34.6904 6.49609 35.5693 5.32715 36.9756 5.32715C38.3555 5.32715 39.2607 6.51367 39.2607 8.3418C39.2607 10.1875 38.3555 11.3564 36.9756 11.3564Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M44.0508 13.1494C44.6396 13.1494 44.9736 12.8594 45.1846 12.1738L46.0195 9.76562H50.7568L51.5918 12.1914C51.7939 12.8682 52.1367 13.1494 52.752 13.1494C53.4111 13.1494 53.8857 12.7188 53.8857 12.1035C53.8857 11.9014 53.8418 11.6992 53.7363 11.4092L50.0449 1.38965C49.7285 0.537109 49.2188 0.167969 48.3838 0.167969C47.5576 0.167969 47.0479 0.554688 46.7402 1.39844L43.0576 11.4092C42.9521 11.6816 42.9082 11.9277 42.9082 12.1035C42.9082 12.7451 43.3564 13.1494 44.0508 13.1494ZM46.5557 7.97266L48.3398 2.55859H48.4014L50.2031 7.97266H46.5557Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M60.1172 13.2549C62.8594 13.2549 64.8545 11.4004 64.8545 8.8252C64.8545 6.42578 63.1406 4.66797 60.6973 4.66797C58.9746 4.66797 57.709 5.54688 57.208 6.71582H57.1641V6.58398C57.208 3.66602 58.2275 1.89941 60.1436 1.89941C61.084 1.89941 61.7607 2.26855 62.3496 3.07715C62.7012 3.52539 62.9824 3.73633 63.4307 3.73633C64.0283 3.73633 64.3975 3.34082 64.3975 2.82227C64.3975 2.57617 64.3359 2.35645 64.1953 2.10156C63.5625 0.897461 62.0859 0.0537109 60.1523 0.0537109C56.9268 0.0537109 54.9932 2.57617 54.9932 6.80371C54.9932 8.24512 55.2305 9.45801 55.6963 10.4336C56.5752 12.2881 58.1396 13.2549 60.1172 13.2549ZM60.082 11.4092C58.667 11.4092 57.5508 10.293 57.5508 8.86914C57.5508 7.4541 58.6494 6.41699 60.1084 6.41699C61.5674 6.41699 62.6309 7.4541 62.6221 8.91309C62.6221 10.3018 61.4971 11.4092 60.082 11.4092Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M68.1328 8.83398C68.8447 8.83398 69.416 8.27148 69.416 7.55078C69.416 6.83008 68.8447 6.25879 68.1328 6.25879C67.4121 6.25879 66.8408 6.83008 66.8408 7.55078C66.8408 8.27148 67.4121 8.83398 68.1328 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M73.3359 8.83398C74.0479 8.83398 74.6191 8.27148 74.6191 7.55078C74.6191 6.83008 74.0479 6.25879 73.3359 6.25879C72.6152 6.25879 72.0439 6.83008 72.0439 7.55078C72.0439 8.27148 72.6152 8.83398 73.3359 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M78.5391 8.83398C79.251 8.83398 79.8223 8.27148 79.8223 7.55078C79.8223 6.83008 79.251 6.25879 78.5391 6.25879C77.8184 6.25879 77.2471 6.83008 77.2471 7.55078C77.2471 8.27148 77.8184 8.83398 78.5391 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M83.7422 8.83398C84.4541 8.83398 85.0254 8.27148 85.0254 7.55078C85.0254 6.83008 84.4541 6.25879 83.7422 6.25879C83.0215 6.25879 82.4502 6.83008 82.4502 7.55078C82.4502 8.27148 83.0215 8.83398 83.7422 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M92.2148 13.2549C94.957 13.2549 96.9521 11.4004 96.9521 8.8252C96.9521 6.42578 95.2383 4.66797 92.7949 4.66797C91.0723 4.66797 89.8066 5.54688 89.3057 6.71582H89.2617V6.58398C89.3057 3.66602 90.3252 1.89941 92.2412 1.89941C93.1816 1.89941 93.8584 2.26855 94.4473 3.07715C94.7988 3.52539 95.0801 3.73633 95.5283 3.73633C96.126 3.73633 96.4951 3.34082 96.4951 2.82227C96.4951 2.57617 96.4336 2.35645 96.293 2.10156C95.6602 0.897461 94.1836 0.0537109 92.25 0.0537109C89.0244 0.0537109 87.0908 2.57617 87.0908 6.80371C87.0908 8.24512 87.3281 9.45801 87.7939 10.4336C88.6729 12.2881 90.2373 13.2549 92.2148 13.2549ZM92.1797 11.4092C90.7646 11.4092 89.6484 10.293 89.6484 8.86914C89.6484 7.4541 90.7471 6.41699 92.2061 6.41699C93.665 6.41699 94.7285 7.4541 94.7197 8.91309C94.7197 10.3018 93.5947 11.4092 92.1797 11.4092Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M103.377 13.2549C106.497 13.2549 108.352 10.6973 108.352 6.63672C108.352 2.57617 106.479 0.0625 103.377 0.0625C100.266 0.0625 98.3848 2.59375 98.3848 6.64551C98.3848 10.7148 100.248 13.2549 103.377 13.2549ZM103.377 11.4004C101.654 11.4004 100.67 9.64258 100.67 6.63672C100.67 3.68359 101.672 1.91699 103.377 1.91699C105.073 1.91699 106.066 3.6748 106.066 6.64551C106.066 9.65137 105.091 11.4004 103.377 11.4004Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M117.167 13.1758C117.8 13.1758 118.248 12.7715 118.248 12.0596V10.5654H119.127C119.733 10.5654 120.094 10.1875 120.094 9.63379C120.094 9.08887 119.733 8.70215 119.136 8.70215H118.248V1.81152C118.248 0.756836 117.554 0.141602 116.385 0.141602C115.453 0.141602 114.899 0.52832 114.073 1.75879C112.553 3.99121 111.111 6.16211 110.224 7.75293C109.872 8.38574 109.731 8.79883 109.731 9.29102C109.731 10.0469 110.268 10.5654 111.085 10.5654H116.086V12.0596C116.086 12.7715 116.543 13.1758 117.167 13.1758ZM116.121 8.75488H111.788V8.69336C112.816 6.82129 114.073 4.92285 116.086 2.04004H116.121V8.75488Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M126.105 13.2549C128.918 13.2549 130.869 11.4355 130.869 8.78125C130.869 6.35547 129.138 4.6416 126.712 4.6416C125.438 4.6416 124.392 5.13379 123.855 5.9248H123.812L124.146 2.17188H129.27C129.85 2.17188 130.228 1.80273 130.228 1.24023C130.228 0.686523 129.85 0.317383 129.27 0.317383H123.803C122.81 0.317383 122.3 0.72168 122.221 1.72363L121.816 6.51367C121.808 6.56641 121.808 6.60156 121.808 6.6543C121.79 7.26953 122.15 7.78809 122.88 7.78809C123.398 7.78809 123.618 7.67383 124.146 7.14648C124.629 6.67188 125.323 6.34668 126.123 6.34668C127.617 6.34668 128.681 7.38379 128.681 8.84277C128.681 10.3457 127.617 11.4092 126.114 11.4092C124.893 11.4092 124.049 10.8027 123.618 9.77441C123.381 9.30859 123.091 9.12402 122.616 9.12402C122.019 9.12402 121.641 9.49316 121.641 10.082C121.641 10.4072 121.72 10.6709 121.843 10.9434C122.467 12.3232 124.154 13.2549 126.105 13.2549Z",fill:"var(--ck-body-color)"})]}),SlideOne=({layoutId:o})=>jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[jsxRuntimeExports.jsx(motion.div,{initial:{rotate:90,scale:.2,x:"100%"},animate:{rotate:0,scale:1,x:0},exit:{rotate:40,scale:.1,x:"70%"},style:{zIndex:4,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:76,height:76,background:"var(--ck-graphic-secondary-background, #6366F1)",borderRadius:"50%",boxShadow:"var(--ck-graphic-secondary-box-shadow, 0px 2px 10px rgba(99, 102, 241, 0.3))"},children:Receive}),jsxRuntimeExports.jsx(MainCircle,{layoutId:o,style:{position:"relative",zIndex:10,margin:"0 -8px",width:112,height:112},children:jsxRuntimeExports.jsxs(MainCircleInner,{style:{background:"var(--ck-graphic-primary-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-primary-box-shadow, 0px 3px 15px rgba(0, 0, 0, 0.1))"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[jsxRuntimeExports.jsx(BgLighten,{}),jsxRuntimeExports.jsx(motion.div,{style:{zIndex:2,position:"relative"},children:jsxRuntimeExports.jsx(Wallet,{})})]},"SlideOneInner")},o),jsxRuntimeExports.jsx(motion.div,{initial:{rotate:-90,scale:.2,x:"-100%"},animate:{rotate:0,scale:1,x:0},exit:{rotate:-40,scale:.1,x:"-70%"},style:{zIndex:4,position:"relative",width:76,height:76,background:"var(--ck-graphic-secondary-background, #3897FB)",borderRadius:"50%",boxShadow:"var(--ck-graphic-secondary-box-shadow, 0px 2px 10px rgba(56, 151, 251, 0.3))"},children:jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx("div",{style:{position:"relative",left:-2,top:3},children:Send})})})]}),SlideTwo=({layoutId:o})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{style:{position:"relative",left:-14},children:[jsxRuntimeExports.jsx(MainCircle,{layoutId:o,style:{zIndex:10,position:"absolute",left:15,top:12,width:32,height:32},children:jsxRuntimeExports.jsx(MainCircleInner,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{background:"var(--ck-graphic-primary-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-primary-box-shadow, 0px 2px 5px rgba(37, 41, 46, 0.16))"},children:jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Wallet,{})})},"SlideTwoInner")},o),jsxRuntimeExports.jsxs(motion.div,{initial:{scale:.2},animate:{scale:1},exit:{scale:.2},style:{zIndex:7,position:"relative",display:"flex",alignItems:"center",padding:"21px 56px",paddingRight:52,background:"var(--ck-graphic-primary-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-primary-box-shadow, 0px 2px 9px rgba(0, 0, 0, 0.07))",borderRadius:"var(--ck-border-radius, 16px)"},children:[jsxRuntimeExports.jsx(BgLighten,{}),jsxRuntimeExports.jsx("div",{style:{position:"relative",zIndex:2,top:1,left:1},children:VitalikAddress})]}),jsxRuntimeExports.jsx(motion.div,{style:{zIndex:8,position:"absolute",top:-16,right:-28},initial:{rotate:90,x:-70,scale:.4},animate:{rotate:0,x:0,scale:1},exit:{rotate:0,x:-70,scale:.4},children:jsxRuntimeExports.jsx(Key$1,{id:o})})]})}),SlideThree=({layoutId:o})=>{const et=Math.random();return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(motion.div,{style:{position:"relative"},children:[jsxRuntimeExports.jsxs(MainCircle,{layoutId:o,initial:{rotate:80},style:{zIndex:10,position:"relative",width:128,height:128},children:[jsxRuntimeExports.jsx(MainCircleInner,{initial:{opacity:0,rotate:100},animate:{opacity:1},exit:{opacity:0},style:{overflow:"hidden",background:`var(--ck-graphic-globe-background, radial-gradient( + 82.42% 82.42% at 50% 86.72%, + rgba(255, 255, 255, 0.2) 0%, + rgba(0, 0, 0, 0) 100% + ), + linear-gradient(180deg, #3897FB 0%, #5004F1 100%))`,boxShadow:"var(--ck-graphic-globe-box-shadow, 0px -6px 20px rgba(56, 151, 251, 0.23))"},children:jsxRuntimeExports.jsx(SpinContainer,{style:o?void 0:{animationPlayState:"paused"},children:jsxRuntimeExports.jsxs("svg",{width:"128",height:"128",viewBox:"0 0 128 128",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsx("circle",{cx:"30",cy:"141",r:"64",stroke:`url(#networkRadialA-${et})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"78.8515",cy:"131.123",r:"54.1005",transform:"rotate(-37.4016 78.8515 131.123)",stroke:`url(#networkRadialB-${et})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"63.6053",cy:"2.12794",r:"50.8338",transform:"rotate(134.702 63.6053 2.12794)",stroke:`url(#networkRadialC-${et})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"126.658",cy:"56.6577",r:"50.3433",transform:"rotate(-105 126.658 56.6577)",stroke:`url(#networkRadialD-${et})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"13.6619",cy:"18.9603",r:"46.0247",transform:"rotate(107.362 13.6619 18.9603)",stroke:`url(#networkRadialE-${et})`,strokeWidth:"3"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialA-${et}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(60.5 84) rotate(104.668) scale(77.0097)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialB-${et}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(96.1805 81.6717) rotate(97.125) scale(64.7443)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialC-${et}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(96.3816 -36.4455) rotate(114.614) scale(57.7177)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialD-${et}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(137.86 7.73234) rotate(92.3288) scale(62.743)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialE-${et}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(35.3203 -21.566) rotate(104.513) scale(54.8617)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]})]})]})})},"SlideThreeInner"),jsxRuntimeExports.jsxs(motion.div,{exit:{opacity:0},children:[jsxRuntimeExports.jsx(motion.div,{initial:o?void 0:{scale:1.1},animate:o?pulseAnim:void 0,transition:{...pulseTransition},style:{position:"absolute",inset:0,borderRadius:"50%",boxShadow:"0 0 0 2px var(--ck-graphic-globe-lines, rgba(126, 112, 243, 1))"}},"pulseA"),jsxRuntimeExports.jsx(motion.div,{initial:o?void 0:{scale:1.2,opacity:.25},animate:o?pulseAnim:void 0,transition:{...pulseTransition,delay:.5},style:{position:"absolute",inset:0,borderRadius:"50%",boxShadow:"0 0 0 2px var(--ck-graphic-globe-lines, rgba(126, 112, 243, 1))"}},"pulseB")]})]},o),jsxRuntimeExports.jsxs(motion.div,{initial:{rotate:-20,scale:.1,y:-10,x:-10},animate:{rotate:0,scale:1,y:0,x:0},exit:{zIndex:3,scale:.2,y:-25,x:15},style:{zIndex:12,borderRadius:"50%",position:"absolute",bottom:-4,right:-4,width:54,height:54,display:"flex",alignItems:"center",justifyContent:"center",padding:13,background:"var(--ck-graphic-compass-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-compass-box-shadow, 0px 2px 9px rgba(0, 0, 0, 0.15))"},children:[jsxRuntimeExports.jsx(BgLighten,{}),jsxRuntimeExports.jsx(motion.div,{style:{zIndex:2,position:"absolute"},initial:{rotate:-170},animate:{rotate:0},exit:{rotate:-180,transition:{duration:0}},transition:{type:"spring",stiffness:6,damping:.9,mass:.2},children:Compass})]})]},"SlideThree")})},About=()=>{var o,et;const tt=useLocales({}),nt=useContext(),rt=(et=(o=nt.options)===null||o===void 0?void 0:o.ethereumOnboardingUrl)!==null&&et!==void 0?et:tt.aboutScreen_ctaUrl,[ot,it]=reactExports.useState(!0),[st,at]=reactExports.useState(0),ct=reactExports.useRef(!1),lt=reactExports.useRef(0),dt=[.16,1,.3,1],ht=600;let pt;reactExports.useEffect(()=>()=>clearInterval(pt),[]);const mt=()=>{if(Et.current){const{overflow:Pt}=getComputedStyle(Et.current);return Pt!=="visible"}return!1},ft=Pt=>{it(!1),mt()?yt(Pt):at(Pt)},yt=Pt=>{if(Et.current){const{offsetWidth:$t}=Et.current;Et.current.scrollLeft=$t*Pt,setTimeout(()=>at(Pt),100)}},gt=()=>{if(!Et.current)return;const{offsetWidth:Pt,scrollLeft:$t}=Et.current,Ot=lt.current;lt.current=$t;const Bt=4;if(Ot-$t>-Bt&&Ot-$t{bt()},vt=()=>{const{offsetWidth:Pt,scrollLeft:$t}=Et.current,Ot=Math.round($t/Pt);at(Ot)},bt=()=>{ct.current=!0,clearTimeout(pt)},Et=reactExports.useRef(null);reactExports.useEffect(()=>{if(Et.current)return Et.current.addEventListener("scroll",gt),Et.current.addEventListener("touchmove",xt),Et.current.addEventListener("touchend",vt),()=>{Et.current&&(Et.current.removeEventListener("scroll",gt),Et.current.removeEventListener("touchmove",xt),Et.current.removeEventListener("touchend",vt))}},[Et]);const wt=[jsxRuntimeExports.jsx(SlideOne,{layoutId:"graphicCircle",duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideTwo,{layoutId:"graphicCircle",duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideThree,{layoutId:"graphicCircle",duration:ht,ease:dt})],kt=[jsxRuntimeExports.jsx(SlideOne,{duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideTwo,{duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideThree,{duration:ht,ease:dt})],Tt=(()=>{var Pt;switch((Pt=nt.options)===null||Pt===void 0?void 0:Pt.language){case"en-US":case"zh-CN":return 64;default:return 84}})(),Rt=[jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ModalH1,{style:{height:24},$small:!0,children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_a_h1})}),jsxRuntimeExports.jsx(ModalBody,{style:{height:Tt},children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_a_p})})]}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ModalH1,{style:{height:24},$small:!0,children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_b_h1})}),jsxRuntimeExports.jsx(ModalBody,{style:{height:Tt},children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_b_p})})]}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ModalH1,{style:{height:24},$small:!0,children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_c_h1})}),jsxRuntimeExports.jsx(ModalBody,{style:{height:Tt},children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_c_p})})]})];return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(Slider,{children:[jsxRuntimeExports.jsx(ImageContainer$1,{children:jsxRuntimeExports.jsx(MotionConfig,{transition:{duration:ht/1e3,ease:dt},children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,onExitComplete:()=>it(!0),children:wt.map((Pt,$t)=>st===$t&&jsxRuntimeExports.jsx(ImageContainerInner,{style:{position:"absolute"},children:Pt},$t))})})}),jsxRuntimeExports.jsx(Slides,{ref:Et,children:jsxRuntimeExports.jsx(AnimatePresence,{children:Rt.map((Pt,$t)=>jsxRuntimeExports.jsxs(Slide,{$active:st===$t,children:[jsxRuntimeExports.jsx(MobileImageContainer,{children:jsxRuntimeExports.jsx(MotionConfig,{transition:{duration:0},children:jsxRuntimeExports.jsx(ImageContainerInner,{children:kt[$t]})})}),jsxRuntimeExports.jsx(ModalContent,{style:{gap:8,paddingBottom:0},children:Pt})]},$t))})})]}),jsxRuntimeExports.jsx(OrDivider,{children:jsxRuntimeExports.jsx(Dots,{children:Rt.map((Pt,$t)=>jsxRuntimeExports.jsx(Dot,{$active:st===$t,onClick:()=>{bt(),ft($t)}},$t))})}),jsxRuntimeExports.jsx(Button$1,{href:rt,arrow:!0,children:tt.aboutScreen_ctaText})]})},Shimmer$1=We` + 0%{ transform: translate(-100%) rotate(-45deg); } + 100%{ transform: translate(100%) rotate(-80deg); } +`,InfoBox=styled.div` + padding: 24px 24px 28px; + border-radius: var(--ck-tertiary-border-radius, 24px); + box-shadow: var(--ck-tertiary-box-shadow, none); + background: var(--ck-body-background-tertiary); + ${ModalBody} { + max-width: none; + } +`,InfoBoxButtons=styled.div` + display: grid; + grid-template-columns: 1fr 1fr; + gap: 16px; + margin: 5px -8px -12px; + button { + } +`,LearnMoreContainer=styled(motion.div)` + text-align: center; + margin-top: 16px; + margin-bottom: -6px; +`,LearnMoreButton=styled(motion.button)` + appearance: none; + user-select: none; + cursor: pointer; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 10px; + height: 42px; + padding: 0 16px; + border-radius: 6px; + background: none; + color: var(--ck-body-color-muted); + font-size: 15px; + line-height: 18px; + font-weight: 500; + /* will-change: transform; */ + transition: color 200ms ease, transform 100ms ease; + svg { + transition: all 100ms ease-out; + display: block; + position: relative; + top: 2px; + left: 2px; + transform: translateZ(0px); + path, + circle { + transition: all 100ms ease-out; + } + path:last-of-type { + transform-origin: 0 0; + transform: scaleX(1.3) skewY(-12deg); + opacity: 0; + } + circle { + transform: translate(20%, -15%); + } + } + &:hover { + color: var(--ck-body-color-muted-hover); + svg { + path, + circle { + opacity: 1; + transform: none; + } + } + } + &:active { + transform: scale(0.96); + } +`;styled(motion.div)` + display: flex; + flex-direction: column; + gap: 12px; + padding: 0 0 16px; + overflow-y: scroll; + max-height: 20rem; + + &::-webkit-scrollbar { + display: none; + } +`;styled(motion.button)` + cursor: pointer; + user-select: none; + position: relative; + display: flex; + align-items: center; + padding: 0 20px; + width: 100%; + height: 64px; + font-size: 17px; + font-weight: var(--ck-primary-button-font-weight, 500); + line-height: 20px; + text-align: var(--ck-body-button-text-align, left); + transition: 180ms ease; + transition-property: background, color, box-shadow, transform, opacity; + will-change: transform, box-shadow, background-color, color, opacity; + + --fallback-color: var(--ck-primary-button-color); + --fallback-background: var(--ck-primary-button-background); + --fallback-box-shadow: var(--ck-primary-button-box-shadow); + --fallback-border-radius: var(--ck-primary-button-border-radius); + + --color: var(--ck-primary-button-color, var(--fallback-color)); + --background: var(--ck-primary-button-background, var(--fallback-background)); + --box-shadow: var(--ck-primary-button-box-shadow, var(--fallback-box-shadow)); + --border-radius: var( + --ck-primary-button-border-radius, + var(--fallback-border-radius) + ); + + --hover-color: var(--ck-primary-button-hover-color, var(--color)); + --hover-background: var( + --ck-primary-button-hover-background, + var(--background) + ); + --hover-box-shadow: var( + --ck-primary-button-hover-box-shadow, + var(--box-shadow) + ); + --hover-border-radius: var( + --ck-primary-button-hover-border-radius, + var(--border-radius) + ); + + --active-color: var(--ck-primary-button-active-color, var(--hover-color)); + --active-background: var( + --ck-primary-button-active-background, + var(--hover-background) + ); + --active-box-shadow: var( + --ck-primary-button-active-box-shadow, + var(--hover-box-shadow) + ); + --active-border-radius: var( + --ck-primary-button-active-border-radius, + var(--hover-border-radius) + ); + + color: var(--color); + background: var(--background); + box-shadow: var(--box-shadow); + border-radius: var(--border-radius); + + &:disabled { + transition: 180ms ease; + opacity: 0.4; + } + + --bg: var(--background); + &:not(:disabled) { + &:hover { + color: var(--hover-color); + background: var(--hover-background); + box-shadow: var(--hover-box-shadow); + border-radius: var(--hover-border-radius); + --bg: var(--hover-background, var(--background)); + } + &:focus-visible { + transition-duration: 100ms; + color: var(--hover-color); + background: var(--hover-background); + box-shadow: var(--hover-box-shadow); + border-radius: var(--hover-border-radius); + --bg: var(--hover-background, var(--background)); + } + &:active { + color: var(--active-color); + background: var(--active-background); + box-shadow: var(--active-box-shadow); + border-radius: var(--active-border-radius); + --bg: var(--active-background, var(--background)); + } + } +`;styled(motion.span)` + position: relative; + top: var(--ck-recent-badge-top-offset, 0.5px); + display: inline-block; + padding: 10px 7px; + line-height: 0; + font-size: 13px; + font-weight: 400; + border-radius: var(--ck-recent-badge-border-radius, var(--border-radius)); + color: var( + --ck-recent-badge-color, + var(--ck-accent-color, var(--ck-body-color-muted, currentColor)) + ); + background: var(--ck-recent-badge-background, transparent); + overflow: hidden; + span { + display: inline-block; + position: relative; + } + &:before { + z-index: 1; + content: ''; + position: absolute; + inset: 0; + opacity: 0.4; + box-shadow: var(--ck-recent-badge-box-shadow, inset 0 0 0 1px currentColor); + border-radius: inherit; + } + &:after { + z-index: 2; + content: ''; + position: absolute; + inset: -10%; + top: -110%; + aspect-ratio: 1/1; + opacity: 0.7; + background: linear-gradient( + 170deg, + transparent 10%, + var(--ck-recent-badge-background, var(--bg)) 50%, + transparent 90% + ); + animation: ${Shimmer$1} 2s linear infinite; + } +`;styled(motion.span)` + display: flex; + align-items: center; + gap: 9px; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding: 2px 0; + padding-right: 38px; +`;styled(motion.div)` + position: absolute; + right: 20px; + width: 32px; + height: 32px; + overflow: hidden; + svg, + img { + display: block; + position: relative; + pointer-events: none; + overflow: hidden; + border-radius: 27.5%; + width: 100%; + height: 100%; + } +`;var WalletIcon$1=({...o})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"20",height:"19",viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:[jsxRuntimeExports.jsx("path",{d:"M1.57568 4.60616C1.57568 2.69827 3.12234 1.15161 5.03023 1.15161H15.3939C17.3018 1.15161 18.8484 2.69826 18.8484 4.60616V10.3637C18.8484 12.2716 17.3018 13.8183 15.3939 13.8183H5.03023C3.12234 13.8183 1.57568 12.2716 1.57568 10.3637V4.60616Z",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M1 4.79293C1 2.435 3.31004 0.770014 5.54697 1.51566L12.4561 3.81869C13.8667 4.2889 14.8182 5.60901 14.8182 7.09596V13.6313C14.8182 15.9892 12.5081 17.6542 10.2712 16.9086L3.36212 14.6056C1.95149 14.1353 1 12.8152 1 11.3283V4.79293Z",fill:"var(--ck-body-background)",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("circle",{cx:"10.3863",cy:"10.1894",r:"1.32574",fill:"currentColor"})]});const Shimmer=We` + 0%{ transform: translate(-100%) rotate(-45deg); } + 100%{ transform: translate(100%) rotate(-80deg); } +`,ConnectorButton=styled(motion.button)` + display: block; + text-decoration: none; +`,ConnectorLabel=styled(motion.span)``,ConnectorIcon=styled(motion.div)``,styles={desktop:{ConnectorButton:Ae` + cursor: pointer; + user-select: none; + position: relative; + display: flex; + align-items: center; + padding: 0 20px; + width: 100%; + height: 64px; + font-size: 17px; + font-weight: var(--ck-primary-button-font-weight, 500); + line-height: 20px; + text-align: var(--ck-body-button-text-align, left); + transition: 180ms ease; + transition-property: background, color, box-shadow, transform, opacity; + will-change: transform, box-shadow, background-color, color, opacity; + + --fallback-color: var(--ck-primary-button-color); + --fallback-background: var(--ck-primary-button-background); + --fallback-box-shadow: var(--ck-primary-button-box-shadow); + --fallback-border-radius: var(--ck-primary-button-border-radius); + + --color: var(--ck-primary-button-color, var(--fallback-color)); + --background: var( + --ck-primary-button-background, + var(--fallback-background) + ); + --box-shadow: var( + --ck-primary-button-box-shadow, + var(--fallback-box-shadow) + ); + --border-radius: var( + --ck-primary-button-border-radius, + var(--fallback-border-radius) + ); + + --hover-color: var(--ck-primary-button-hover-color, var(--color)); + --hover-background: var( + --ck-primary-button-hover-background, + var(--background) + ); + --hover-box-shadow: var( + --ck-primary-button-hover-box-shadow, + var(--box-shadow) + ); + --hover-border-radius: var( + --ck-primary-button-hover-border-radius, + var(--border-radius) + ); + + --active-color: var(--ck-primary-button-active-color, var(--hover-color)); + --active-background: var( + --ck-primary-button-active-background, + var(--hover-background) + ); + --active-box-shadow: var( + --ck-primary-button-active-box-shadow, + var(--hover-box-shadow) + ); + --active-border-radius: var( + --ck-primary-button-active-border-radius, + var(--hover-border-radius) + ); + + color: var(--color); + background: var(--background); + box-shadow: var(--box-shadow); + border-radius: var(--border-radius); + + &:disabled { + transition: 180ms ease; + opacity: 0.4; + } + + --bg: var(--background); + &:not(:disabled) { + &:hover { + color: var(--hover-color); + background: var(--hover-background); + box-shadow: var(--hover-box-shadow); + border-radius: var(--hover-border-radius); + --bg: var(--hover-background, var(--background)); + } + &:focus-visible { + transition-duration: 100ms; + color: var(--hover-color); + background: var(--hover-background); + box-shadow: var(--hover-box-shadow); + border-radius: var(--hover-border-radius); + --bg: var(--hover-background, var(--background)); + } + &:active { + color: var(--active-color); + background: var(--active-background); + box-shadow: var(--active-box-shadow); + border-radius: var(--active-border-radius); + --bg: var(--active-background, var(--background)); + } + } + `,ConnectorLabel:Ae` + display: flex; + align-items: center; + gap: 9px; + width: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding: 2px 0; + padding-right: 38px; + `,ConnectorIcon:Ae` + position: absolute; + right: 20px; + width: 32px; + height: 32px; + overflow: hidden; + svg, + img { + display: block; + position: relative; + pointer-events: none; + overflow: hidden; + width: 100%; + height: 100%; + } + + &[data-shape='squircle'] { + border-radius: 22.5%; + } + &[data-shape='circle'] { + border-radius: 100%; + } + &[data-shape='square'] { + border-radius: 0; + } + `},mobile:{ConnectorButton:Ae` + text-align: center; + background: none; + max-width: 100%; + overflow: hidden; + `,ConnectorLabel:Ae` + display: block; + text-overflow: ellipsis; + max-width: 100%; + overflow: hidden; + padding: 10px 0 0; + color: var(--ck-body-color); + font-size: 13px; + line-height: 15px; + font-weight: 500; + opacity: 0.75; + `,ConnectorIcon:Ae` + position: relative; + margin: 0 auto; + width: 60px; + height: 60px; + overflow: hidden; + svg, + img { + display: block; + position: relative; + width: 100%; + height: auto; + } + &[data-small='true'] { + svg, + img { + transform: scale(0.8); + } + } + + &[data-shape='squircle'] { + border-radius: 22.5%; + &:before { + content: ''; + z-index: -1; + position: absolute; + inset: 0; + border-radius: inherit; + box-shadow: inset 0 0 0 1px var(--ck-body-background-tertiary); + } + } + &[data-shape='circle'] { + border-radius: 100%; + } + &[data-shape='square'] { + border-radius: 0; + } + `}},RecentlyUsedTag=styled(motion.span)` + position: relative; + top: var(--ck-recent-badge-top-offset, 0.5px); + display: inline-block; + padding: 10px 7px; + line-height: 0; + font-size: 13px; + font-weight: 400; + border-radius: var(--ck-recent-badge-border-radius, var(--border-radius)); + color: var( + --ck-recent-badge-color, + var(--ck-accent-color, var(--ck-body-color-muted, currentColor)) + ); + background: var(--ck-recent-badge-background, transparent); + overflow: hidden; + span { + display: inline-block; + position: relative; + } + &:before { + z-index: 1; + content: ''; + position: absolute; + inset: 0; + opacity: 0.4; + box-shadow: var(--ck-recent-badge-box-shadow, inset 0 0 0 1px currentColor); + border-radius: inherit; + } + &:after { + z-index: 2; + content: ''; + position: absolute; + inset: -10%; + top: -110%; + aspect-ratio: 1/1; + opacity: 0.7; + background: linear-gradient( + 170deg, + transparent 10%, + var(--ck-recent-badge-background, var(--bg)) 50%, + transparent 90% + ); + animation: ${Shimmer} 2s linear infinite; + } +`,ConnectorsContainer=styled.div` + transition: opacity 300ms ease; + min-width: fit-content; + + ${o=>o.$disabled&&Ae` + pointer-events: none; + opacity: 0.4; + `} + + ${o=>o.$mobile?Ae` + display: flex; + align-items: flex-start; + justify-content: space-around; + gap: 22px 6px; + //margin: 0px -10px -20px; + padding: 14px 0px 28px; + + ${ConnectorButton} { + flex-shrink: 0; + width: 80px; + ${styles.mobile.ConnectorButton} + ${ConnectorLabel} { + ${styles.mobile.ConnectorLabel} + ${RecentlyUsedTag} { + display: none; + width: fit-content; + margin: 0 auto; + } + } + ${ConnectorIcon} { + ${styles.mobile.ConnectorIcon} + } + } + `:Ae` + display: flex; + flex-direction: column; + gap: 12px; + + ${ConnectorButton} { + ${styles.desktop.ConnectorButton} + ${ConnectorLabel} { + ${styles.desktop.ConnectorLabel} + } + ${ConnectorIcon} { + ${styles.desktop.ConnectorIcon} + } + } + `} +`;function useChains(){var o;const et=useConfig();return((o=et==null?void 0:et.chains)!==null&&o!==void 0?o:[]).map(nt=>nt)}function useConnect({...o}={}){const et=useContext(),{connect:tt,connectAsync:nt,connectors:rt,...ot}=useConnect$1({...o,mutation:{...o.mutation,onError(it){it.message?it.message!=="User rejected request"&&et.log(it.message,it):et.log("Could not connect.",it)}}});return{connect:({connector:it,chainId:st,mutation:at})=>{var ct;return tt({connector:it,chainId:st??((ct=et.options)===null||ct===void 0?void 0:ct.initialChainId)},at)},connectAsync:async({connector:it,chainId:st,mutation:at})=>{var ct;return nt({connector:it,chainId:st??((ct=et.options)===null||ct===void 0?void 0:ct.initialChainId)},at)},connectors:rt,...ot}}function useWalletConnectUri({enabled:o}={enabled:!0}){const{log:et}=useContext(),[tt,nt]=reactExports.useState(void 0),rt=useWalletConnectConnector(),{isConnected:ot}=useAccount(),{connectAsync:it}=useConnect();return reactExports.useEffect(()=>{if(!o)return;async function st(dt){const{type:ht,data:pt}=dt;et("WC Message",ht,pt),ht==="display_uri"&&nt(pt)}async function at(){et("WC Disconnect"),rt&&ct(rt)}async function ct(dt){const ht=await it({connector:dt});return ht||!1}async function lt(dt){try{await ct(dt)}catch(ht){if(et("catch error"),et(ht),ht.code)switch(ht.code){case 4001:et("error.code - User rejected"),lt(dt);break;default:et("error.code - Unknown Error");break}else et("WalletConnect cannot connect.",ht)}}if(ot)nt(void 0);else{if(!rt||tt)return;if(rt&&!ot)return lt(rt),et("add wc listeners"),rt.emitter.on("message",st),rt.emitter.on("disconnect",at),()=>{et("remove wc listeners"),rt.emitter.off("message",st),rt.emitter.off("disconnect",at)}}},[o,rt,ot]),{uri:tt}}function useChainIsSupported(o){const{chains:et}=useConfig();return o?et.some(tt=>tt.id===o):!1}const Web3Context=React.createContext({connect:{getUri:()=>""},dapp:{chains:[]},account:void 0}),Web3ContextProvider=({enabled:o,children:et})=>{const{uri:tt}=useWalletConnectUri({enabled:o}),{address:nt,chain:rt}=useAccount(),ot=useChainIsSupported(rt==null?void 0:rt.id),it=useChains(),st={connect:{getUri:at=>tt},dapp:{chains:it},account:nt?{chain:rt,chainIsSupported:ot,address:nt}:void 0};return jsxRuntimeExports.jsx(Web3Context.Provider,{value:st,children:et})},useWeb3=()=>React.useContext(Web3Context);function useIsMobile(){const[o,et]=reactExports.useState(isMobile());return reactExports.useEffect(()=>{const tt=()=>{et(isMobile())};return window.addEventListener("resize",tt),()=>window.removeEventListener("resize",tt)},[]),o}const ScrollContainer=styled.div` + position: relative; +`,fadeIn=We` +0%{ opacity:0; } +100%{ opacity:1; } +`,MoreIndicator=styled.div` + z-index: 9; + position: absolute; + left: 0; + right: 0; + bottom: 0.75rem; + display: flex; + justify-content: center; + + transition: opacity 300ms ease; + + span { + cursor: pointer; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 0.25rem; + padding: 0.3075rem 0.9375rem 0.375rem; + border-radius: 6rem; + background: var(--ck-tooltip-background); + color: var(--ck-tooltip-color); + font-weight: 500; + font-size: 0.8125rem; + letter-spacing: -0.01rem; + box-shadow: var(--ck-tooltip-shadow); + animation: ${fadeIn} 300ms ease 1000ms both; + + transition: transform 100ms ease; + + &:hover { + transform: scale(1.02); + } + &:active { + transform: scale(0.98); + } + svg { + display: block; + transform: translateX(-0.1875rem); + } + } + + &.hide { + opacity: 0; + pointer-events: none; + } +`,ScrollAreaContainer=styled.div` + --bg: ${({$backgroundColor:o})=>o||"var(--ck-body-background)"}; + --fade-height: 1px; + position: relative; + z-index: 1; + + ${({$mobile:o,$height:et,$mobileDirection:tt})=>o&&tt==="horizontal"?Ae` + overflow-x: scroll; + margin: 0 -24px; + padding: 0 24px; + + &:before, + &:after { + pointer-events: none; + z-index: 10; + content: ''; + display: block; + position: sticky; + top: 0; + bottom: 0; + width: var(--fade-height); + background: var( + --ck-body-divider-secondary, + var(--ck-body-divider) + ); + box-shadow: var(--ck-body-divider-box-shadow); + transition: opacity 300ms ease; + } + &:before { + left: 0; + } + &:after { + right: 0; + } + + &.scroll-start { + &:before { + opacity: 0; + } + } + + &.scroll-end { + &:after { + opacity: 0; + } + } + `:Ae` + max-height: ${et?`${et}px`:"310px"}; + overflow-y: scroll; + padding: 0 10px; + margin: calc(var(--fade-height) * -1) -16px 0 -10px; + + &:before, + &:after { + pointer-events: none; + z-index: 10; + content: ''; + display: block; + position: sticky; + left: 0; + right: 0; + height: var(--fade-height); + background: var( + --ck-body-divider-secondary, + var(--ck-body-divider) + ); + box-shadow: var(--ck-body-divider-box-shadow); + transition: opacity 300ms ease; + } + &:before { + top: 0; + } + &:after { + bottom: 0; + } + + &.scroll-start { + &:before { + opacity: 0; + } + } + + &.scroll-end { + &:after { + opacity: 0; + } + } + `} + + &::-webkit-scrollbar { + width: 6px; + height: 6px; + } + &::-webkit-scrollbar-track { + background: transparent; + } + &::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0); + border-radius: 100px; + } + &:hover::-webkit-scrollbar-thumb { + background: var(--ck-body-color-muted); + } + &::-webkit-scrollbar-thumb:hover { + background: var(--ck-body-color-muted-hover); + } +`,ArrowDown=()=>jsxRuntimeExports.jsx("svg",{width:"11",height:"12",viewBox:"0 0 11 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.49438 1L5.49438 11M5.49438 11L9.5 7M5.49438 11L1.5 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),ScrollArea$2=({children:o,height:et,backgroundColor:tt,mobileDirection:nt})=>{const rt=reactExports.useRef(null),ot=reactExports.useRef(null),it=useIsMobile();return reactExports.useEffect(()=>{const st=rt.current;if(!st)return;st.scrollHeight>st.clientHeight&&ot.current&&ot.current.classList.remove("hide");const at=ct=>{const{scrollTop:lt,scrollHeight:dt,clientHeight:ht,scrollLeft:pt,scrollWidth:mt,clientWidth:ft}=ct.target;ot.current&<>0&&ot.current.classList.add("hide"),lt===0&&pt===0?st.classList.add("scroll-start"):st.classList.remove("scroll-start"),dt-lt===ht&&mt-pt===ft?st.classList.add("scroll-end"):st.classList.remove("scroll-end")};return st.addEventListener("scroll",at),at({target:st}),()=>{st.removeEventListener("scroll",at)}},[rt.current]),jsxRuntimeExports.jsxs(ScrollContainer,{children:[jsxRuntimeExports.jsx(ScrollAreaContainer,{ref:rt,$mobile:it,$height:et,$backgroundColor:tt,$mobileDirection:nt,children:o}),jsxRuntimeExports.jsx(MoreIndicator,{ref:ot,className:"hide",onClick:()=>{rt.current&&rt.current.scrollTo({top:rt.current.scrollHeight,behavior:"smooth"})},children:jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(ArrowDown,{})," More Available"]})})]})},AlertContainer=styled(motion.div)` + display: flex; + gap: 8px; + position: relative; + border-radius: 9px; + margin: 0 auto; + padding: 10px; + text-align: left; + font-size: 14px; + line-height: 17px; + font-weight: 400; + max-width: 260px; + min-width: 100%; + + border-radius: var(--ck-alert-border-radius, 12px); + color: var(--ck-alert-color, var(--ck-body-color-muted)); + background: var(--ck-alert-background, var(--ck-body-background-secondary)); + box-shadow: var(--ck-alert-box-shadow, var(--ck-body-box-shadow)); + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + padding: 16px; + font-size: 16px; + line-height: 21px; + border-radius: 24px; + text-align: center; + } + + ${o=>{if(o)return Ae` + color: #fff; + background: var(--ck-body-color-danger, red); + `}} +`,IconContainer$3=styled(motion.div)` + width: 24px; + height: 24px; + display: flex; + align-items: center; + justify-content: center; + svg { + display: block; + width: 100%; + height: auto; + } +`,Alert=({children:o,error:et,icon:tt})=>jsxRuntimeExports.jsxs(AlertContainer,{$error:et,children:[tt&&jsxRuntimeExports.jsx(IconContainer$3,{children:tt}),jsxRuntimeExports.jsx("div",{children:o})]});Alert.displayName="Alert";const useLastConnector=()=>{const{storage:o}=useConfig(),[et,tt]=reactExports.useState(null);return reactExports.useEffect(()=>{(async()=>{const ot=await(o==null?void 0:o.getItem("recentConnectorId"));tt(ot??"")})()},[]),{lastConnectorId:et,updateLastConnectorId:rt=>{o==null||o.setItem("recentConnectorId",rt)}}},ConnectorList=()=>{var o;const et=useContext(),tt=useIsMobile(),nt=useWallets(),{lastConnectorId:rt}=useLastConnector(),ot=!((o=et.options)===null||o===void 0)&&o.hideRecentBadge||rt==="walletConnect"?nt:[...nt.filter(it=>rt===it.connector.id),...nt.filter(it=>rt!==it.connector.id)];return jsxRuntimeExports.jsxs(ScrollArea$2,{mobileDirection:"horizontal",children:[ot.length===0&&jsxRuntimeExports.jsx(Alert,{error:!0,children:"No connectors found in ConnectKit config."}),ot.length>0&&jsxRuntimeExports.jsx(ConnectorsContainer,{$mobile:tt,$totalResults:ot.length,children:ot.map(it=>jsxRuntimeExports.jsx(ConnectorItem,{wallet:it,isRecent:it.id===rt},it.id))})]})},ConnectorItem=({wallet:o,isRecent:et})=>{var tt,nt,rt,ot;const{connect:{getUri:it}}=useWeb3(),st=it(),at=useIsMobile(),ct=useContext(),{connect:lt}=useConnect();let dt=!o.isInstalled&&at||o.shouldDeeplinkDesktop&&!at?(tt=o.getWalletConnectDeeplink)===null||tt===void 0?void 0:tt.call(o,st??""):void 0;const ht=at&&isWalletConnectConnector(o.id),pt=(detectBrowser()==="safari"||detectBrowser()==="ios")&&isCoinbaseWalletConnector(o.connector.id);return(ht||pt)&&(dt=void 0),jsxRuntimeExports.jsxs(ConnectorButton,{type:"button",as:dt?"a":void 0,href:dt||void 0,disabled:ct.route!==routes.CONNECTORS,onClick:dt?void 0:()=>{ht?ct.setRoute(routes.MOBILECONNECTORS):(pt&<({connector:o==null?void 0:o.connector}),ct.setRoute(routes.CONNECT),ct.setConnector({id:o.id}))},children:[jsxRuntimeExports.jsx(ConnectorIcon,{"data-small":o.iconShouldShrink,"data-shape":o.iconShape,children:(nt=o.iconConnector)!==null&&nt!==void 0?nt:o.icon}),jsxRuntimeExports.jsxs(ConnectorLabel,{children:[at&&(rt=o.shortName)!==null&&rt!==void 0?rt:o.name,!(!((ot=ct.options)===null||ot===void 0)&&ot.hideRecentBadge)&&et&&jsxRuntimeExports.jsx(RecentlyUsedTag,{children:jsxRuntimeExports.jsx("span",{children:"Recent"})})]})]})},Wallets=()=>{var o,et,tt,nt,rt;const ot=useContext(),it=useLocales({}),st=useIsMobile();return jsxRuntimeExports.jsxs(PageContent,{style:{width:312},children:[jsxRuntimeExports.jsx(ConnectorList,{}),st?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(InfoBox,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{padding:0,textAlign:"left"},children:[jsxRuntimeExports.jsx(ModalH1,{$small:!0,children:it.connectorsScreen_h1}),jsxRuntimeExports.jsx(ModalBody,{children:it.connectorsScreen_p})]}),jsxRuntimeExports.jsxs(InfoBoxButtons,{children:[!(!((o=ot.options)===null||o===void 0)&&o.hideQuestionMarkCTA)&&jsxRuntimeExports.jsx(Button$1,{variant:"tertiary",onClick:()=>ot.setRoute(routes.ABOUT),children:it.learnMore}),!(!((et=ot.options)===null||et===void 0)&&et.hideNoWalletCTA)&&jsxRuntimeExports.jsx(Button$1,{variant:"tertiary",onClick:()=>ot.setRoute(routes.ONBOARDING),children:it.getWallet})]})]})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!(!((tt=ot.options)===null||tt===void 0)&&tt.hideNoWalletCTA)&&jsxRuntimeExports.jsx(LearnMoreContainer,{children:jsxRuntimeExports.jsxs(LearnMoreButton,{onClick:()=>ot.setRoute(routes.ONBOARDING),children:[jsxRuntimeExports.jsx(WalletIcon$1,{})," ",it.connectorsScreen_newcomer]})})}),((nt=ot.options)===null||nt===void 0?void 0:nt.disclaimer)&&jsxRuntimeExports.jsx(Disclaimer,{style:{visibility:"hidden",pointerEvents:"none"},children:jsxRuntimeExports.jsx("div",{children:(rt=ot.options)===null||rt===void 0?void 0:rt.disclaimer})})]})},WalletItem=styled.div` + text-align: center; + transition: opacity 100ms ease; + opacity: ${o=>o.$waiting?.4:1}; +`,WalletIcon=styled.div` + z-index: 9; + position: relative; + margin: 0 auto 10px; + border-radius: 16px; + width: 60px; + height: 60px; + overflow: hidden; + background: rgba(0, 0, 0, 0.04); + ${o=>o.$outline&&` + &:before { + content: ''; + z-index: 2; + position: absolute; + inset: 0; + border-radius: inherit; + box-shadow: inset 0 0 0 1px var(--ck-body-background-tertiary); + }`} + svg { + display: block; + position: relative; + width: 100%; + height: auto; + } +`,WalletLabel=styled.div` + color: var(--ck-body-color); + font-size: 13px; + line-height: 15px; + font-weight: 500; + opacity: 0.75; +`,PulseKeyframes=We` + 0%,100% { opacity:1; } + 50% { opacity:0.5; } +`,WalletList=styled.div` + display: grid; + grid-template-columns: repeat(4, 1fr); + gap: 22px 8px; + margin: 0 -10px; + padding: 4px 0 0; + transition: opacity 300ms ease; + ${o=>o.$disabled&&Ae` + pointer-events: none; + opacity: 0.4; + ${WalletItem} { + animation: ${PulseKeyframes} 1s infinite ease-in-out; + } + `} +`,Container$6=styled.div``;function useWalletConnectModal(){const{log:o}=useContext(),{connectAsync:et,connectors:tt}=useConnect(),[nt,rt]=reactExports.useState(!1);return{isOpen:nt,open:async()=>{const ot=document.createElement("style");ot.innerHTML="w3m-modal, wcm-modal{ --wcm-z-index: 2147483647; --w3m-z-index:2147483647; }",document.head.appendChild(ot);const it=tt.find(st=>isWalletConnectConnector(st.id));if(it)try{const at=(await it.getProvider()).rpc.projectId,ct=walletConnect({projectId:at,showQrModal:!0});rt(!0);try{await et({connector:ct})}catch(lt){o("WalletConnect",lt)}rt(!1),document.head.removeChild(ot)}catch(st){o("Could not get WalletConnect provider",st)}else o("No WalletConnect connector available")}}}const IconContainer$2=styled(motion.div)` + transition: all 220ms cubic-bezier(0.175, 0.885, 0.32, 1.1); + display: flex; + align-items: center; + justify-content: center; + width: 16px; + svg { + display: block; + } + svg, + svg path, + svg rect { + transition: inherit; + } + svg path:first-child { + transform-origin: 50% 50%; + fill: var(--bg); + stroke: var(--color); + } + svg rect { + transform-origin: 53% 63%; + fill: var(--bg); + stroke: var(--color); + } + svg path:last-child { + opacity: 0; + stroke: var(--bg); + transform: translate(11.75px, 10px) rotate(90deg) scale(0.6); + } + ${o=>o.$clipboard?Ae` + --color: var(--ck-focus-color) !important; + --bg: var(--ck-body-background); + svg { + transition-delay: 0ms; + path:first-child { + opacity: 0; + transform: rotate(-90deg) scale(0.2); + } + rect { + rx: 10px; + fill: var(--color); + transform: rotate(-90deg) scale(1.45); + } + path:last-child { + transition-delay: 100ms; + opacity: 1; + transform: translate(7.75px, 9.5px); + } + } + `:Ae` + &:hover { + } + &:hover:active { + } + `} +`,CopyToClipboardIcon=({copied:o,small:et})=>jsxRuntimeExports.jsx(IconContainer$2,{$clipboard:o,children:jsxRuntimeExports.jsx(CopyToClipboardIcon$1,{style:{transform:et?"scale(1)":"translateX(3px) scale(1.5)",opacity:et||o?1:.3}})}),Container$5=styled.div` + --color: var(--ck-copytoclipboard-stroke); + --bg: var(--ck-body-background); + transition: all 220ms cubic-bezier(0.175, 0.885, 0.32, 1.1); + + cursor: pointer; + display: inline-flex; + align-items: center; + justify-content: center; + + ${o=>o.$disabled?Ae` + cursor: not-allowed; + opacity: 0.4; + `:Ae` + &:hover { + --color: var(--ck-body-color-muted); + } + `} +`,OffsetContainer=styled.div` + display: block; + position: relative; + transition: inherit; + svg { + position: absolute; + left: 100%; + display: block; + top: -1px; + margin: 0; + margin-left: 4px; + } +`,CopyToClipboard=({string:o,children:et,variant:tt})=>{const[nt,rt]=reactExports.useState(!1);let ot;const it=()=>{if(!o)return;const st=o.trim();navigator.clipboard&&navigator.clipboard.writeText(st),rt(!0),clearTimeout(ot),ot=setTimeout(()=>rt(!1),1e3)};return tt==="button"?jsxRuntimeExports.jsx(Button$1,{disabled:!o,onClick:it,icon:jsxRuntimeExports.jsx(CopyToClipboardIcon,{copied:nt}),children:et}):jsxRuntimeExports.jsx(Container$5,{onClick:it,$disabled:!o,children:jsxRuntimeExports.jsxs(OffsetContainer,{children:[et,jsxRuntimeExports.jsx(CopyToClipboardIcon,{copied:nt,small:!0})]})})},MoreIcon=jsxRuntimeExports.jsx("svg",{width:"60",height:"60",viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M30 42V19M19 30.5H42",stroke:"var(--ck-body-color-muted)",strokeWidth:"3",strokeLinecap:"round"})}),MobileConnectors=()=>{var o,et;const tt=useContext(),nt=useLocales(),{connect:{getUri:rt}}=useWeb3(),ot=rt(),{open:it,isOpen:st}=useWalletConnectModal(),at=useWallets(),ct=(o=Object.keys(walletConfigs).filter(dt=>{const ht=walletConfigs[dt];return!(at.find(pt=>pt.connector.id===dt)||!ht.getWalletConnectDeeplink)}))!==null&&o!==void 0?o:[],lt=dt=>{var ht;const pt=(ht=dt.getWalletConnectDeeplink)===null||ht===void 0?void 0:ht.call(dt,ot);pt&&(window.location.href=pt)};return jsxRuntimeExports.jsx(PageContent,{style:{width:312},children:jsxRuntimeExports.jsxs(Container$6,{children:[jsxRuntimeExports.jsx(ModalContent,{style:{paddingBottom:0},children:jsxRuntimeExports.jsx(ScrollArea$2,{height:340,children:jsxRuntimeExports.jsxs(WalletList,{$disabled:!ot,children:[ct.sort((dt,ht)=>{var pt,mt,ft,yt;const gt=walletConfigs[dt],xt=walletConfigs[ht],vt=(mt=(pt=gt.name)!==null&&pt!==void 0?pt:gt.shortName)!==null&&mt!==void 0?mt:dt,bt=(yt=(ft=xt.name)!==null&&ft!==void 0?ft:xt.shortName)!==null&&yt!==void 0?yt:ht;return vt.localeCompare(bt)}).filter(dt=>!(dt==="coinbaseWallet"||dt==="com.coinbase.wallet")).map((dt,ht)=>{const pt=walletConfigs[dt],{name:mt,shortName:ft,iconConnector:yt,icon:gt}=pt;return jsxRuntimeExports.jsxs(WalletItem,{onClick:()=>lt(pt),style:{animationDelay:`${ht*50}ms`},children:[jsxRuntimeExports.jsx(WalletIcon,{$outline:!0,children:yt??gt}),jsxRuntimeExports.jsx(WalletLabel,{children:ft??mt})]},ht)}),jsxRuntimeExports.jsxs(WalletItem,{onClick:it,$waiting:st,children:[jsxRuntimeExports.jsx(WalletIcon,{style:{background:"var(--ck-body-background-secondary)"},children:st?jsxRuntimeExports.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntimeExports.jsx("div",{style:{width:"50%"},children:jsxRuntimeExports.jsx(Spinner$4,{})})}):MoreIcon}),jsxRuntimeExports.jsx(WalletLabel,{children:nt.more})]})]})})}),((et=tt.options)===null||et===void 0?void 0:et.walletConnectCTA)!=="modal"&&jsxRuntimeExports.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:14,paddingTop:8},children:jsxRuntimeExports.jsx(CopyToClipboard,{variant:"button",string:ot,children:nt.copyToClipboard})})]})})},Content$1=styled(motion.div)` + display: flex; + flex-direction: column; + gap: 6px; + position: relative; + left: 0; + right: 0; + ${ModalContent} { + padding: 0 8px 32px; + gap: 12px; + } +`,dist$1=2,shakeKeyframes=We` + 0%{ transform:none; } + 25%{ transform:translateX(${dist$1}px); } + 50%{ transform:translateX(-${dist$1}px); } + 75%{ transform:translateX(${dist$1}px); } + 100%{ transform:none; } +`,outlineKeyframes=We` + 0%{ opacity:1; } + 100%{ opacity:0; } +`,Container$4=styled(motion.div)` + /* + background: var( + --ck-body-background + ); // To stop the overlay issue during transition for the squircle spinner + */ +`,ConnectingContainer=styled(motion.div)` + display: flex; + align-items: center; + justify-content: center; + margin: 10px auto 16px; + height: 120px; + //transform: scale(1.001); // fixes shifting issue between states +`,ConnectingAnimation=styled(motion.div)` + user-select: none; + position: relative; + --spinner-error-opacity: 0; + &:before { + content: ''; + position: absolute; + inset: 1px; + opacity: 0; + background: var(--ck-body-color-danger); + ${o=>o.$circle&&Ae` + inset: -5px; + border-radius: 50%; + background: none; + box-shadow: inset 0 0 0 3.5px var(--ck-body-color-danger); + `} + } + ${o=>o.$shake&&Ae` + animation: ${shakeKeyframes} 220ms ease-out both; + &:before { + animation: ${outlineKeyframes} 220ms ease-out 750ms both; + } + `} +`,RetryButton=styled(motion.button)` + z-index: 5; + appearance: none; + position: absolute; + right: 2px; + bottom: 2px; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + width: 32px; + height: 32px; + border-radius: 16px; + cursor: pointer; + overflow: hidden; + background: none; + + color: var(--ck-body-background); + transition: color 200ms ease; + box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.15); + + &:before { + z-index: 3; + content: ''; + position: absolute; + inset: 0; + opacity: 0; + transition: opacity 200ms ease; + background: var(--ck-body-color); + } + + &:hover:before { + opacity: 0.1; + } +`,RetryIconContainer=styled(motion.div)` + position: absolute; + inset: 0; + + &:before { + z-index: 1; + content: ''; + position: absolute; + inset: 3px; + border-radius: 16px; + background: conic-gradient( + from 90deg, + currentColor 10%, + var(--ck-body-color) 80% + ); + } + + svg { + z-index: 2; + display: block; + position: relative; + width: 100%; + height: 100%; + } +`,TooltipWindow=styled(motion.div)` + z-index: 2147483647; + position: fixed; + inset: 0; + pointer-events: none; +`,TooltipContainer=styled(motion.div)` + --shadow: var(--ck-tooltip-shadow); + z-index: 2147483647; + position: absolute; + top: 0; + left: 0; + display: flex; + gap: 8px; + width: fit-content; + align-items: center; + justify-content: center; + border-radius: var( + --ck-tooltip-border-radius, + ${o=>o.$size==="small"?11:14}px + ); + border-radius: ; + padding: 10px 16px 10px 12px; + font-size: 14px; + line-height: 19px; + font-weight: 500; + letter-spacing: -0.1px; + color: var(--ck-tooltip-color); + background: var(--ck-tooltip-background); + box-shadow: var(--shadow); + > span { + z-index: 3; + position: relative; + } + > div { + margin: -4px 0; // offset for icon + } + strong { + color: var(--ck-spinner-color); + } + + .ck-tt-logo { + display: inline-block; + vertical-align: text-bottom; + height: 1em; + width: 1.25em; + svg { + display: block; + height: 100%; + transform: translate(0.5px, -1px) scale(1.75); + } + } +`,TooltipTail=styled(motion.div)` + z-index: 2; + position: absolute; + display: flex; + align-items: center; + justify-content: center; + width: ${o=>o.$size==="small"?14:18}px; + right: 100%; + top: 0; + bottom: 0; + overflow: hidden; + &:before { + content: ''; + position: absolute; + box-shadow: var(--shadow); + width: ${o=>o.$size==="small"?14:18}px; + height: ${o=>o.$size==="small"?14:18}px; + transform: translate(75%, 0) rotate(45deg); + background: var(--ck-tooltip-background); + border-radius: ${o=>o.$size==="small"?2:3}px 0 0 0; + } +`,Tooltip=({children:o,message:et,open:tt,xOffset:nt=0,yOffset:rt=0,delay:ot})=>{var it;const st=useContext(),at=useThemeContext();if(!((it=st.options)===null||it===void 0)&&it.hideTooltips)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o});const[ct,lt]=reactExports.useState(!1),[dt,ht]=reactExports.useState(!1),[pt,mt]=reactExports.useState("small"),[ft,yt]=reactExports.useState(!1),[gt]=reactExports.useState(st.route),xt=reactExports.useRef(null),[vt,bt]=useMeasure({debounce:ft?0:220,offsetSize:!0,scroll:!0}),Et=()=>{let Tt=!1;const Rt=nt+bt.left+bt.width,Pt=rt+bt.top+bt.height*.5;return(Rt>window.innerWidth||Rt<0||Pt>window.innerHeight||Pt<0)&&(Tt=!0),Tt};return(typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect)(()=>{if(!xt.current||bt.top+bt.bottom+bt.left+bt.right+bt.height+bt.width===0)return;const Tt=nt+bt.left+bt.width,Rt=rt+bt.top+bt.height*.5;!ft&&Tt!==0&&Rt!==0&&yt(!0),xt.current.style.left=`${Tt}px`,xt.current.style.top=`${Rt}px`,mt(xt.current.offsetHeight<=40?"small":"large"),ht(Et())},[bt,tt,ct]),reactExports.useEffect(()=>{st.open||lt(!1)},[st.open]),reactExports.useEffect(()=>{lt(!!tt)},[tt]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(motion.div,{ref:vt,style:tt===void 0?{cursor:"help"}:{},onHoverStart:()=>lt(!0),onHoverEnd:()=>lt(!1),onClick:()=>lt(!1),children:o}),jsxRuntimeExports.jsx(Portal$2,{children:jsxRuntimeExports.jsx(AnimatePresence,{children:gt===st.route&&!dt&&ct&&jsxRuntimeExports.jsx(ResetContainer,{$useTheme:at.theme,$useMode:at.mode,$customTheme:at.customTheme,children:jsxRuntimeExports.jsx(TooltipWindow,{children:jsxRuntimeExports.jsxs(TooltipContainer,{role:"tooltip",$size:pt,ref:xt,initial:"collapsed",animate:ft?"open":{},exit:"collapsed",variants:{collapsed:{transformOrigin:"20px 50%",opacity:0,scale:.9,z:.01,y:"-50%",x:20,transition:{duration:.1}},open:{willChange:"opacity,transform",opacity:1,scale:1,z:.01,y:"-50%",x:20,transition:{ease:[.76,0,.24,1],duration:.15,delay:ot||.5}}},children:[et,jsxRuntimeExports.jsx(TooltipTail,{$size:pt})]})})})})})]})},LogoContainer$4=styled(motion.div)` + z-index: 4; + position: relative; + overflow: hidden; + svg { + z-index: 3; + position: relative; + display: block; + } +`,Logo$1=styled(motion.div)` + z-index: 2; + position: absolute; + overflow: hidden; + inset: 6px; + border-radius: 24px; + background: var(--ck-body-background); + svg, + img { + pointer-events: none; + display: block; + width: 100%; + height: 100%; + } +`,SpinnerContainer$1=styled(motion.div)` + position: absolute; + inset: 1px; + overflow: hidden; +`,Spinner$3=styled(motion.div)` + pointer-events: none; + user-select: none; + z-index: 1; + position: absolute; + inset: -25%; + &:before { + content: ''; + position: absolute; + inset: 0; + background: conic-gradient( + from -90deg, + transparent, + transparent, + transparent, + transparent, + transparent, + var(--ck-spinner-color) + ); + animation: rotateSpinner 1200ms linear infinite; + } + @keyframes rotateSpinner { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + } +`,SquircleSpinner=({logo:o,connecting:et=!0})=>jsxRuntimeExports.jsxs(LogoContainer$4,{transition:{duration:.5,ease:[.175,.885,.32,.98]},children:[jsxRuntimeExports.jsx(Logo$1,{children:o}),jsxRuntimeExports.jsx(SpinnerContainer$1,{children:jsxRuntimeExports.jsx(AnimatePresence,{children:et&&jsxRuntimeExports.jsx(Spinner$3,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:0}}},"Spinner")})}),jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"102",height:"102",viewBox:"0 0 102 102",fill:"none",children:[jsxRuntimeExports.jsx("rect",{x:"7.57895",y:"7.57895",width:"86.8421",height:"86.8421",rx:"19.2211",stroke:"black",strokeOpacity:"0.02",strokeWidth:"1.15789"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H102V102H0V0ZM7 38.284C7 27.5684 7 22.2106 9.01905 18.0892C10.9522 14.1431 14.1431 10.9522 18.0892 9.01905C22.2106 7 27.5684 7 38.284 7H63.716C74.4316 7 79.7894 7 83.9108 9.01905C87.8569 10.9522 91.0478 14.1431 92.9809 18.0892C95 22.2106 95 27.5684 95 38.284V63.716C95 74.4316 95 79.7894 92.9809 83.9108C91.0478 87.8569 87.8569 91.0478 83.9108 92.9809C79.7894 95 74.4316 95 63.716 95H38.284C27.5684 95 22.2106 95 18.0892 92.9809C14.1431 91.0478 10.9522 87.8569 9.01905 83.9108C7 79.7894 7 74.4316 7 63.716V38.284ZM41.5 0.5H41.4325C34.7246 0.499996 29.6023 0.499994 25.5104 0.823325C21.388 1.14906 18.1839 1.80986 15.3416 3.20227C10.0602 5.78959 5.78959 10.0602 3.20227 15.3416C1.80986 18.1839 1.14906 21.388 0.823325 25.5104C0.499994 29.6023 0.499996 34.7246 0.5 41.4325V41.5V55.5938C0.5 55.6808 0.507407 55.766 0.521624 55.849C0.507407 55.9319 0.5 56.0172 0.5 56.1042V60.5V60.5675C0.499996 67.2754 0.499994 72.3977 0.823325 76.4896C1.14906 80.612 1.80986 83.8161 3.20227 86.6584C5.78959 91.9398 10.0602 96.2104 15.3416 98.7977C18.1839 100.19 21.388 100.851 25.5104 101.177C29.6022 101.5 34.7244 101.5 41.432 101.5H41.4324H41.5H43.4227H60.5H60.5675H60.568C67.2756 101.5 72.3977 101.5 76.4896 101.177C80.612 100.851 83.8161 100.19 86.6584 98.7977C91.9398 96.2104 96.2104 91.9398 98.7977 86.6584C100.19 83.8161 100.851 80.612 101.177 76.4896C101.5 72.3978 101.5 67.2756 101.5 60.568V60.5676V60.5V41.5V41.4324V41.432C101.5 34.7244 101.5 29.6022 101.177 25.5104C100.851 21.388 100.19 18.1839 98.7977 15.3416C96.2104 10.0602 91.9398 5.78959 86.6584 3.20227C83.8161 1.80986 80.612 1.14906 76.4896 0.823325C72.3977 0.499994 67.2754 0.499996 60.5675 0.5H60.5H41.5ZM3.5 56.1042C3.5 56.0172 3.49259 55.9319 3.47838 55.849C3.49259 55.766 3.5 55.6808 3.5 55.5938V41.5C3.5 34.7112 3.50109 29.7068 3.814 25.7467C4.1256 21.8032 4.73946 19.0229 5.89635 16.6614C8.19077 11.9779 11.9779 8.19077 16.6614 5.89635C19.0229 4.73946 21.8032 4.1256 25.7467 3.814C29.7068 3.50109 34.7112 3.5 41.5 3.5H60.5C67.2888 3.5 72.2932 3.50109 76.2533 3.814C80.1968 4.1256 82.977 4.73946 85.3386 5.89635C90.022 8.19077 93.8092 11.9779 96.1036 16.6614C97.2605 19.0229 97.8744 21.8032 98.186 25.7467C98.4989 29.7068 98.5 34.7112 98.5 41.5V60.5C98.5 67.2888 98.4989 72.2932 98.186 76.2533C97.8744 80.1968 97.2605 82.9771 96.1036 85.3386C93.8092 90.022 90.022 93.8092 85.3386 96.1036C82.977 97.2605 80.1968 97.8744 76.2533 98.186C72.2932 98.4989 67.2888 98.5 60.5 98.5H43.4227H41.5C34.7112 98.5 29.7068 98.4989 25.7467 98.186C21.8032 97.8744 19.0229 97.2605 16.6614 96.1036C11.9779 93.8092 8.19077 90.022 5.89635 85.3386C4.73946 82.9771 4.1256 80.1968 3.814 76.2533C3.50109 72.2932 3.5 67.2888 3.5 60.5V56.1042Z",fill:"var(--ck-body-background)"})]})]}),BrowserIconContainer=styled(motion.div)` + display: flex; + align-items: center; + justify-content: center; + max-width: 32px; + max-height: 32px; + width: 100%; + height: 100%; + svg { + display: block; + width: 100%; + height: 100%; + } +`,Chrome=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("g",{filter:"url(#filter0_ii_927_5781)",children:jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_927_5781)",children:[jsxRuntimeExports.jsx("path",{d:"M1.58771 0V12.2727H6.06498L10.0002 5.45455H20.0002V0H1.58771Z",fill:"#DB4437"}),jsxRuntimeExports.jsx("path",{d:"M1.58771 0V12.2727H6.06498L10.0002 5.45455H20.0002V0H1.58771Z",fill:"url(#paint0_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M6.17038 12.2272L1.64538 4.46582L1.57947 4.57946L6.07265 12.284L6.17038 12.2272Z",fill:"black",fillOpacity:"0.15"}),jsxRuntimeExports.jsx("path",{d:"M0 20.0003H9.51932L13.9375 15.5821V12.273H6.0625L0 1.87305V20.0003Z",fill:"#0F9D58"}),jsxRuntimeExports.jsx("path",{d:"M0 20.0003H9.51932L13.9375 15.5821V12.273H6.0625L0 1.87305V20.0003Z",fill:"url(#paint1_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M13.8412 12.4208L13.7469 12.3662L9.38324 19.9969H9.51392L13.8435 12.4242L13.8412 12.4208Z",fill:"#263238",fillOpacity:"0.15"}),jsxRuntimeExports.jsx("path",{d:"M10.0006 5.45459L13.9381 12.2728L9.51996 20H20.0006V5.45459H10.0006Z",fill:"#FFCD40"}),jsxRuntimeExports.jsx("path",{d:"M10.0006 5.45459L13.9381 12.2728L9.51996 20H20.0006V5.45459H10.0006Z",fill:"url(#paint2_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M9.9996 5.45459L13.9371 12.2728L9.51892 20H19.9996V5.45459H9.9996Z",fill:"#FFCD40"}),jsxRuntimeExports.jsx("path",{d:"M9.9996 5.45459L13.9371 12.2728L9.51892 20H19.9996V5.45459H9.9996Z",fill:"url(#paint3_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M1.58691 0V12.2727H6.06419L9.99941 5.45455H19.9994V0H1.58691Z",fill:"#DB4437"}),jsxRuntimeExports.jsx("path",{d:"M1.58691 0V12.2727H6.06419L9.99941 5.45455H19.9994V0H1.58691Z",fill:"url(#paint4_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M10 5.45459V7.83527L18.9091 5.45459H10Z",fill:"url(#paint5_radial_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M0 19.9998H9.51932L11.9318 15.9089L13.9375 12.2726H6.0625L0 1.87256V19.9998Z",fill:"#0F9D58"}),jsxRuntimeExports.jsx("path",{d:"M0 19.9998H9.51932L12.1023 15.5112L13.9375 12.2726H6.0625L0 1.87256V19.9998Z",fill:"url(#paint6_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M1.58771 4.59668L8.09339 11.1012L6.06384 12.2728L1.58771 4.59668Z",fill:"url(#paint7_radial_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M9.52661 19.9884L11.9084 11.1021L13.938 12.2725L9.52661 19.9884Z",fill:"url(#paint8_radial_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M10.0003 14.5455C12.5107 14.5455 14.5458 12.5104 14.5458 10C14.5458 7.48966 12.5107 5.45459 10.0003 5.45459C7.48996 5.45459 5.4549 7.48966 5.4549 10C5.4549 12.5104 7.48996 14.5455 10.0003 14.5455Z",fill:"#F1F1F1"}),jsxRuntimeExports.jsx("path",{d:"M9.99995 13.6365C12.0083 13.6365 13.6363 12.0084 13.6363 10.0001C13.6363 7.99183 12.0083 6.36377 9.99995 6.36377C7.99164 6.36377 6.36359 7.99183 6.36359 10.0001C6.36359 12.0084 7.99164 13.6365 9.99995 13.6365Z",fill:"#4285F4"}),jsxRuntimeExports.jsx("path",{d:"M10.0003 5.34082C7.48899 5.34082 5.4549 7.37491 5.4549 9.88628V9.99991C5.4549 7.48855 7.48899 5.45446 10.0003 5.45446H20.0003V5.34082H10.0003Z",fill:"black",fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{d:"M13.9318 12.273C13.1455 13.6299 11.6818 14.5458 10 14.5458C8.31818 14.5458 6.85227 13.6299 6.06818 12.273H6.06364L0 1.87305V1.98668L6.06818 12.3867C6.85455 13.7435 8.31818 14.6594 10 14.6594C11.6818 14.6594 13.1455 13.7446 13.9318 12.3867H13.9375V12.273H13.9307H13.9318Z",fill:"white",fillOpacity:"0.1"}),jsxRuntimeExports.jsx("path",{opacity:"0.1",d:"M10.1133 5.45459C10.094 5.45459 10.0758 5.45686 10.0565 5.458C12.5406 5.48868 14.5452 7.50913 14.5452 10C14.5452 12.491 12.5406 14.5114 10.0565 14.5421C10.0758 14.5421 10.094 14.5455 10.1133 14.5455C12.6247 14.5455 14.6588 12.5114 14.6588 10C14.6588 7.48868 12.6247 5.45459 10.1133 5.45459Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M13.9769 12.4204C14.3632 11.7522 14.5871 10.9795 14.5871 10.1522C14.5874 9.68602 14.5157 9.22262 14.3746 8.77832C14.4826 9.16696 14.5451 9.57377 14.5451 9.99764C14.5451 10.8249 14.3212 11.5976 13.9348 12.2658L13.9371 12.2704L9.51892 19.9976H9.65074L13.9769 12.4204Z",fill:"white",fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{d:"M10 0.113636C15.5034 0.113636 19.9682 4.56023 20 10.0568C20 10.0375 20.0011 10.0193 20.0011 10C20.0011 4.47727 15.5239 0 10.0011 0C4.47841 0 0 4.47727 0 10C0 10.0193 0.00113639 10.0375 0.00113639 10.0568C0.0318182 4.56023 4.49659 0.113636 10 0.113636Z",fill:"white",fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{d:"M10 19.8865C15.5034 19.8865 19.9682 15.4399 20 9.94336C20 9.96268 20.0011 9.98086 20.0011 10.0002C20.0011 15.5229 15.5239 20.0002 10.0011 20.0002C4.47841 20.0002 0 15.5229 0 10.0002C0 9.98086 0.00113639 9.96268 0.00113639 9.94336C0.0318182 15.4399 4.49659 19.8865 10.0011 19.8865H10Z",fill:"black",fillOpacity:"0.15"})]})}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("filter",{id:"filter0_ii_927_5781",x:0,y:"-0.235294",width:20,height:"20.4706",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[jsxRuntimeExports.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),jsxRuntimeExports.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),jsxRuntimeExports.jsx("feOffset",{dy:"0.235294"}),jsxRuntimeExports.jsx("feGaussianBlur",{stdDeviation:"0.235294"}),jsxRuntimeExports.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:-1,k3:1}),jsxRuntimeExports.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_927_5781"}),jsxRuntimeExports.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),jsxRuntimeExports.jsx("feOffset",{dy:"-0.235294"}),jsxRuntimeExports.jsx("feGaussianBlur",{stdDeviation:"0.235294"}),jsxRuntimeExports.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:-1,k3:1}),jsxRuntimeExports.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in2:"effect1_innerShadow_927_5781",result:"effect2_innerShadow_927_5781"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5781",x1:"2.42521",y1:"7.61591",x2:"8.39112",y2:"4.13068",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#A52714",stopOpacity:"0.6"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#A52714",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_927_5781",x1:"11.6932",y1:"17.7844",x2:"5.06136",y2:"13.8981",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#055524",stopOpacity:"0.4"}),jsxRuntimeExports.jsx("stop",{offset:"0.33",stopColor:"#055524",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint2_linear_927_5781",x1:"12.9438",y1:"4.75004",x2:"14.6143",y2:"12.0569",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#EA6100",stopOpacity:"0.3"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#EA6100",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint3_linear_927_5781",x1:"12.9428",y1:"4.75004",x2:"14.6132",y2:"12.0569",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#EA6100",stopOpacity:"0.3"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#EA6100",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint4_linear_927_5781",x1:"2.42441",y1:"7.61591",x2:"8.39032",y2:"4.13068",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#A52714",stopOpacity:"0.6"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#A52714",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint5_radial_927_5781",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.56818 5.44891) scale(9.55455)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#3E2723",stopOpacity:"0.2"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#3E2723",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint6_linear_927_5781",x1:"11.6932",y1:"17.7839",x2:"5.06136",y2:"13.8976",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#055524",stopOpacity:"0.4"}),jsxRuntimeExports.jsx("stop",{offset:"0.33",stopColor:"#055524",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint7_radial_927_5781",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(1.57975 4.60463) scale(8.86818)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#3E2723",stopOpacity:"0.2"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#3E2723",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint8_radial_927_5781",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.97775 10.0157) scale(9.98523)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#263238",stopOpacity:"0.2"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#263238",stopOpacity:0})]}),jsxRuntimeExports.jsx("clipPath",{id:"clip0_927_5781",children:jsxRuntimeExports.jsx("rect",{width:20,height:20,rx:10,fill:"white"})})]})]}),FireFox=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_927_5847)",children:[jsxRuntimeExports.jsx("path",{d:"M19.011 6.71023C18.5898 5.69685 17.7355 4.60269 17.0665 4.25681C17.5436 5.18063 17.8747 6.17276 18.0481 7.19792L18.0499 7.21417C16.954 4.48315 15.0963 3.38023 13.5782 0.981835C13.5014 0.860539 13.4246 0.738994 13.3498 0.610696C13.3071 0.537418 13.2728 0.471393 13.2431 0.410621C13.1801 0.288713 13.1316 0.159878 13.0985 0.0267267C13.0985 0.0205825 13.0963 0.0146369 13.0923 0.0100242C13.0882 0.00541151 13.0826 0.00245454 13.0765 0.00171737C13.0705 7.85858e-05 13.0642 7.85858e-05 13.0582 0.00171737C13.057 0.00171737 13.055 0.00396821 13.0535 0.0044684C13.052 0.00496859 13.0487 0.00721943 13.0465 0.00821981L13.0502 0.00171737C10.6156 1.42725 9.78901 4.06574 9.71399 5.38624C8.74136 5.45292 7.81141 5.81121 7.04549 6.41437C6.96561 6.34671 6.88212 6.28343 6.79539 6.2248C6.57456 5.45174 6.56514 4.6336 6.76813 3.85566C5.87401 4.28877 5.07954 4.90279 4.43501 5.65884H4.43051C4.04636 5.17191 4.07337 3.5663 4.09538 3.23093C3.98174 3.2766 3.87326 3.33419 3.77176 3.40274C3.43264 3.64477 3.11562 3.91635 2.8244 4.2143C2.49255 4.55075 2.18946 4.91441 1.91831 5.30146V5.30296V5.3012C1.29521 6.18444 0.853213 7.18234 0.617826 8.23731L0.604821 8.30133C0.586564 8.38661 0.52079 8.81377 0.509535 8.90656C0.509535 8.91381 0.508035 8.92056 0.507285 8.92781C0.42244 9.36882 0.369864 9.81542 0.349976 10.2641V10.3141C0.354259 12.7396 1.26772 15.0754 2.91002 16.8604C4.55233 18.6454 6.80415 19.7498 9.22094 19.9556C11.6377 20.1615 14.0439 19.4538 15.9644 17.9723C17.8849 16.4908 19.1803 14.3431 19.5947 11.9532C19.6109 11.8282 19.6242 11.7044 19.6387 11.5781C19.8384 9.92791 19.6222 8.25404 19.01 6.70873L19.011 6.71023ZM7.83928 14.2981C7.88455 14.3198 7.92707 14.3433 7.97358 14.3641L7.98034 14.3684C7.93332 14.3458 7.8863 14.3224 7.83928 14.2981ZM18.0501 7.21692V7.20767L18.0519 7.21792L18.0501 7.21692Z",fill:"url(#paint0_linear_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M19.0109 6.71026C18.5898 5.69688 17.7354 4.60272 17.0664 4.25684C17.5435 5.18066 17.8746 6.17278 18.0481 7.19794V7.20719L18.0498 7.21745C18.797 9.35551 18.689 11.6997 17.7482 13.7599C16.6373 16.1435 13.9493 18.5867 9.7402 18.4667C5.19349 18.3379 1.18699 14.9629 0.439211 10.5437C0.30291 9.84668 0.439211 9.4933 0.507737 8.92684C0.414265 9.36685 0.362102 9.81463 0.351929 10.2643V10.3144C0.356212 12.7399 1.26967 15.0757 2.91198 16.8607C4.55429 18.6456 6.8061 19.7501 9.2229 19.9559C11.6397 20.1617 14.0458 19.4541 15.9664 17.9725C17.8869 16.491 19.1822 14.3434 19.5966 11.9535C19.6129 11.8284 19.6262 11.7046 19.6407 11.5783C19.8403 9.92819 19.6242 8.25431 19.0119 6.70901L19.0109 6.71026Z",fill:"url(#paint1_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M19.0109 6.71026C18.5898 5.69688 17.7354 4.60272 17.0664 4.25684C17.5435 5.18066 17.8746 6.17278 18.0481 7.19794V7.20719L18.0498 7.21745C18.797 9.35551 18.689 11.6997 17.7482 13.7599C16.6373 16.1435 13.9493 18.5867 9.7402 18.4667C5.19349 18.3379 1.18699 14.9629 0.439211 10.5437C0.30291 9.84668 0.439211 9.4933 0.507737 8.92684C0.414265 9.36685 0.362102 9.81463 0.351929 10.2643V10.3144C0.356212 12.7399 1.26967 15.0757 2.91198 16.8607C4.55429 18.6456 6.8061 19.7501 9.2229 19.9559C11.6397 20.1617 14.0458 19.4541 15.9664 17.9725C17.8869 16.491 19.1822 14.3434 19.5966 11.9535C19.6129 11.8284 19.6262 11.7046 19.6407 11.5783C19.8403 9.92819 19.6242 8.25431 19.0119 6.70901L19.0109 6.71026Z",fill:"url(#paint2_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M14.2993 7.84794C14.3203 7.8627 14.3398 7.87745 14.3595 7.89221C14.1161 7.46047 13.813 7.06519 13.4592 6.71802C10.4456 3.70439 12.6696 0.18557 13.0445 0.00550206L13.0483 0C10.6136 1.42553 9.78706 4.06402 9.71204 5.38452C9.82508 5.37677 9.93712 5.36726 10.0527 5.36726C10.9164 5.36893 11.7644 5.59929 12.5103 6.03492C13.2562 6.47055 13.8734 7.09592 14.2993 7.84744V7.84794Z",fill:"url(#paint3_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M10.0577 8.45061C10.0417 8.6917 9.18992 9.52326 8.89206 9.52326C6.13602 9.52326 5.68835 11.1906 5.68835 11.1906C5.8104 12.5947 6.78877 13.7516 7.97146 14.3618C8.02548 14.3898 8.08025 14.4151 8.13502 14.4399C8.22989 14.4819 8.32476 14.5207 8.41963 14.5564C8.82553 14.7 9.25065 14.7821 9.68085 14.7997C14.5127 15.0263 15.448 9.02257 11.9615 7.27942C12.7839 7.1724 13.6168 7.37463 14.2986 7.84688C13.8727 7.09536 13.2555 6.46999 12.5096 6.03436C11.7637 5.59873 10.9158 5.36837 10.052 5.3667C9.93695 5.3667 9.82441 5.3762 9.71136 5.38396C8.73874 5.45064 7.80879 5.80893 7.04286 6.41209C7.19067 6.53714 7.35748 6.7042 7.70886 7.05058C8.36661 7.69857 10.0535 8.36983 10.0572 8.44861L10.0577 8.45061Z",fill:"url(#paint4_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M10.0577 8.45061C10.0417 8.6917 9.18992 9.52326 8.89206 9.52326C6.13602 9.52326 5.68835 11.1906 5.68835 11.1906C5.8104 12.5947 6.78877 13.7516 7.97146 14.3618C8.02548 14.3898 8.08025 14.4151 8.13502 14.4399C8.22989 14.4819 8.32476 14.5207 8.41963 14.5564C8.82553 14.7 9.25065 14.7821 9.68085 14.7997C14.5127 15.0263 15.448 9.02257 11.9615 7.27942C12.7839 7.1724 13.6168 7.37463 14.2986 7.84688C13.8727 7.09536 13.2555 6.46999 12.5096 6.03436C11.7637 5.59873 10.9158 5.36837 10.052 5.3667C9.93695 5.3667 9.82441 5.3762 9.71136 5.38396C8.73874 5.45064 7.80879 5.80893 7.04286 6.41209C7.19067 6.53714 7.35748 6.7042 7.70886 7.05058C8.36661 7.69857 10.0535 8.36983 10.0572 8.44861L10.0577 8.45061Z",fill:"url(#paint5_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M6.59134 6.0923C6.66987 6.14231 6.73464 6.18583 6.79141 6.2251C6.57058 5.45204 6.56117 4.63389 6.76415 3.85596C5.87003 4.28907 5.07556 4.90308 4.43103 5.65913C4.4783 5.65788 5.88432 5.63262 6.59134 6.0923Z",fill:"url(#paint6_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M0.437567 10.5439C1.1856 14.963 5.19185 18.3393 9.73855 18.4668C13.9476 18.5859 16.6361 16.1425 17.7466 13.7601C18.6873 11.6998 18.7954 9.35569 18.0482 7.21762V7.20837C18.0482 7.20111 18.0467 7.19686 18.0482 7.19911L18.0499 7.21537C18.3938 9.46046 17.2519 11.6345 15.4665 13.1076L15.4609 13.1201C11.9821 15.9536 8.6534 14.8292 7.98064 14.3706C7.93363 14.348 7.88661 14.3246 7.83959 14.3003C5.81158 13.3309 4.97352 11.4842 5.15358 9.89862C4.67218 9.90573 4.19905 9.77307 3.79151 9.51672C3.38397 9.26038 3.05952 8.89134 2.85747 8.45433C3.38987 8.1282 3.99692 7.94382 4.62077 7.91878C5.24461 7.89374 5.86448 8.02887 6.42131 8.31128C7.56906 8.83225 8.87507 8.8836 10.0602 8.45433C10.0564 8.37555 8.36954 7.70405 7.71179 7.05631C7.36041 6.70993 7.1936 6.54312 7.04579 6.41782C6.96591 6.35016 6.88243 6.28688 6.7957 6.22825C6.73818 6.18898 6.6734 6.14647 6.59562 6.09545C5.88861 5.63578 4.48258 5.66104 4.43607 5.66229H4.43156C4.04742 5.17535 4.07443 3.56975 4.09644 3.23438C3.9828 3.28005 3.87431 3.33764 3.77282 3.40619C3.4337 3.64822 3.11667 3.91979 2.82546 4.21774C2.49242 4.55325 2.18808 4.91607 1.91562 5.3024V5.3039V5.30215C1.29252 6.18539 0.850521 7.18329 0.615133 8.23825C0.610381 8.25801 0.266002 9.76357 0.435816 10.5444L0.437567 10.5439Z",fill:"url(#paint7_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M13.459 6.71761C13.8128 7.06516 14.1159 7.46087 14.3593 7.89305C14.4126 7.93331 14.4624 7.97333 14.5046 8.01209C16.7022 10.0378 15.5508 12.9014 15.465 13.104C17.2502 11.6332 18.3911 9.45763 18.0485 7.21179C16.952 4.47826 15.0923 3.37535 13.5768 0.976952C13.5 0.855657 13.4232 0.734111 13.3484 0.605813C13.3057 0.532535 13.2714 0.466511 13.2417 0.405738C13.1787 0.283831 13.1302 0.154995 13.0971 0.0218439C13.0971 0.0156997 13.0949 0.0097541 13.0909 0.0051414C13.0868 0.000528701 13.0812 -0.00242828 13.0751 -0.00316545C13.0691 -0.00480423 13.0628 -0.00480423 13.0568 -0.00316545C13.0556 -0.00316545 13.0536 -0.000914601 13.0521 -0.000414413C13.0506 8.57743e-05 13.0473 0.00233662 13.0451 0.00333699C12.6702 0.181154 10.4466 3.70222 13.4602 6.71335L13.459 6.71761Z",fill:"url(#paint8_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M14.5043 8.01315C14.462 7.97439 14.4122 7.93437 14.359 7.8941C14.3392 7.87935 14.3197 7.86459 14.2987 7.84984C13.6169 7.37759 12.784 7.17536 11.9616 7.28238C15.4479 9.02553 14.5125 15.0278 9.68095 14.8027C9.25075 14.785 8.82562 14.703 8.41973 14.5594C8.32486 14.5238 8.22999 14.485 8.13512 14.4428C8.08035 14.4178 8.02558 14.3928 7.97156 14.3648L7.97831 14.369C8.65206 14.829 11.9798 15.9526 15.4586 13.1186L15.4641 13.1061C15.5509 12.9035 16.7023 10.0399 14.5038 8.01415L14.5043 8.01315Z",fill:"url(#paint9_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M5.68842 11.1892C5.68842 11.1892 6.13583 9.52179 8.89212 9.52179C9.18998 9.52179 10.0425 8.69023 10.0578 8.44914C8.8727 8.8784 7.56669 8.82706 6.41894 8.30608C5.86211 8.02367 5.24224 7.88855 4.61839 7.91359C3.99455 7.93863 3.3875 8.123 2.8551 8.44914C3.05715 8.88615 3.3816 9.25518 3.78914 9.51153C4.19668 9.76787 4.66981 9.90053 5.15121 9.89343C4.97165 11.4783 5.80946 13.3247 7.83722 14.2951C7.88249 14.3168 7.925 14.3403 7.97152 14.3611C6.78783 13.7496 5.81046 12.5932 5.68842 11.1899V11.1892Z",fill:"url(#paint10_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M19.0112 6.71023C18.59 5.69685 17.7357 4.60269 17.0667 4.25681C17.5438 5.18063 17.8749 6.17276 18.0483 7.19792L18.0501 7.21417C16.9542 4.48315 15.0965 3.38023 13.5784 0.981835C13.5016 0.860539 13.4249 0.738994 13.3501 0.610696C13.3073 0.537418 13.2731 0.471393 13.2433 0.410621C13.1803 0.288713 13.1318 0.159878 13.0987 0.0267267C13.0988 0.0205825 13.0966 0.0146369 13.0925 0.0100242C13.0884 0.00541151 13.0828 0.00245454 13.0767 0.00171737C13.0708 7.85859e-05 13.0644 7.85859e-05 13.0585 0.00171737C13.0572 0.00171737 13.0552 0.00396821 13.0537 0.0044684C13.0522 0.00496859 13.049 0.00721943 13.0467 0.00821981L13.0505 0.00171737C10.6158 1.42725 9.78925 4.06574 9.71422 5.38624C9.82726 5.37848 9.9393 5.36898 10.0548 5.36898C10.9186 5.37065 11.7666 5.60101 12.5125 6.03664C13.2584 6.47227 13.8756 7.09764 14.3014 7.84916C13.6196 7.37691 12.7868 7.17468 11.9643 7.2817C15.4506 9.02485 14.5153 15.0271 9.68371 14.802C9.25351 14.7843 8.82838 14.7023 8.42248 14.5587C8.32761 14.5232 8.23275 14.4843 8.13788 14.4421C8.08311 14.4171 8.02834 14.3921 7.97432 14.3641L7.98107 14.3684C7.93405 14.3458 7.88703 14.3224 7.84002 14.2981C7.88528 14.3198 7.9278 14.3433 7.97432 14.3641C6.79062 13.7524 5.81326 12.5959 5.69121 11.1929C5.69121 11.1929 6.13863 9.52554 8.89491 9.52554C9.19277 9.52554 10.0453 8.69398 10.0606 8.45289C10.0568 8.37411 8.36996 7.7026 7.71222 7.05486C7.36084 6.70848 7.19402 6.54167 7.04622 6.41637C6.96634 6.34871 6.88285 6.28543 6.79612 6.2268C6.57529 5.45374 6.56588 4.6356 6.76886 3.85766C5.87474 4.29077 5.08027 4.90479 4.43574 5.66084H4.43124C4.04709 5.17391 4.0741 3.5683 4.09611 3.23293C3.98247 3.2786 3.87399 3.33619 3.77249 3.40474C3.43337 3.64677 3.11635 3.91835 2.82514 4.2163C2.49328 4.55275 2.19019 4.91641 1.91905 5.30345V5.30496V5.30321C1.29595 6.18644 0.853946 7.18434 0.618558 8.23931L0.605554 8.30333C0.587297 8.38861 0.505516 8.82177 0.493762 8.91481C0.418959 9.36194 0.371188 9.81318 0.350708 10.2661V10.3161C0.354992 12.7416 1.26845 15.0774 2.91076 16.8624C4.55307 18.6474 6.80488 19.7518 9.22168 19.9576C11.6385 20.1635 14.0446 19.4558 15.9652 17.9743C17.8857 16.4928 19.181 14.3451 19.5954 11.9552C19.6117 11.8302 19.6249 11.7064 19.6394 11.5801C19.8391 9.92991 19.623 8.25604 19.0107 6.71073L19.0112 6.71023ZM18.0496 7.20817L18.0513 7.21842L18.0496 7.20817Z",fill:"url(#paint11_linear_927_5847)"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5847",x1:"17.728",y1:"3.09786",x2:"1.63621",y2:"18.6237",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.048",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.111",stopColor:"#FFE847"}),jsxRuntimeExports.jsx("stop",{offset:"0.225",stopColor:"#FFC830"}),jsxRuntimeExports.jsx("stop",{offset:"0.368",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.401",stopColor:"#FF8B16"}),jsxRuntimeExports.jsx("stop",{offset:"0.462",stopColor:"#FF672A"}),jsxRuntimeExports.jsx("stop",{offset:"0.534",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.705",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint1_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(17.1052 2.25108) scale(20.2076)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.129",stopColor:"#FFBD4F"}),jsxRuntimeExports.jsx("stop",{offset:"0.186",stopColor:"#FFAC31"}),jsxRuntimeExports.jsx("stop",{offset:"0.247",stopColor:"#FF9D17"}),jsxRuntimeExports.jsx("stop",{offset:"0.283",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.403",stopColor:"#FF563B"}),jsxRuntimeExports.jsx("stop",{offset:"0.467",stopColor:"#FF3750"}),jsxRuntimeExports.jsx("stop",{offset:"0.71",stopColor:"#F5156C"}),jsxRuntimeExports.jsx("stop",{offset:"0.782",stopColor:"#EB0878"}),jsxRuntimeExports.jsx("stop",{offset:"0.86",stopColor:"#E50080"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint2_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.6024 10.5042) scale(20.2076)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.3",stopColor:"#960E18"}),jsxRuntimeExports.jsx("stop",{offset:"0.351",stopColor:"#B11927",stopOpacity:"0.74"}),jsxRuntimeExports.jsx("stop",{offset:"0.435",stopColor:"#DB293D",stopOpacity:"0.343"}),jsxRuntimeExports.jsx("stop",{offset:"0.497",stopColor:"#F5334B",stopOpacity:"0.094"}),jsxRuntimeExports.jsx("stop",{offset:"0.53",stopColor:"#FF3750",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint3_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12.1034 -2.25084) scale(14.638)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.132",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.252",stopColor:"#FFDC3E"}),jsxRuntimeExports.jsx("stop",{offset:"0.506",stopColor:"#FF9D12"}),jsxRuntimeExports.jsx("stop",{offset:"0.526",stopColor:"#FF980E"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint4_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(7.35173 15.7558) scale(9.62111)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.353",stopColor:"#3A8EE6"}),jsxRuntimeExports.jsx("stop",{offset:"0.472",stopColor:"#5C79F0"}),jsxRuntimeExports.jsx("stop",{offset:"0.669",stopColor:"#9059FF"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#C139E6"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint5_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(10.5799 8.76923) rotate(-13.5916) scale(5.10194 5.97309)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.206",stopColor:"#9059FF",stopOpacity:0}),jsxRuntimeExports.jsx("stop",{offset:"0.278",stopColor:"#8C4FF3",stopOpacity:"0.064"}),jsxRuntimeExports.jsx("stop",{offset:"0.747",stopColor:"#7716A8",stopOpacity:"0.45"}),jsxRuntimeExports.jsx("stop",{offset:"0.975",stopColor:"#6E008B",stopOpacity:"0.6"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint6_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.35238 1.50057) scale(6.9226)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FFE226"}),jsxRuntimeExports.jsx("stop",{offset:"0.121",stopColor:"#FFDB27"}),jsxRuntimeExports.jsx("stop",{offset:"0.295",stopColor:"#FFC82A"}),jsxRuntimeExports.jsx("stop",{offset:"0.502",stopColor:"#FFA930"}),jsxRuntimeExports.jsx("stop",{offset:"0.732",stopColor:"#FF7E37"}),jsxRuntimeExports.jsx("stop",{offset:"0.792",stopColor:"#FF7139"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint7_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(14.8545 -3.00121) scale(29.5361)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.113",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.456",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.622",stopColor:"#FF5634"}),jsxRuntimeExports.jsx("stop",{offset:"0.716",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.904",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint8_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12.3996 -1.36343) rotate(83.976) scale(21.6445 14.2051)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.06",stopColor:"#FFE847"}),jsxRuntimeExports.jsx("stop",{offset:"0.168",stopColor:"#FFC830"}),jsxRuntimeExports.jsx("stop",{offset:"0.304",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.356",stopColor:"#FF8B16"}),jsxRuntimeExports.jsx("stop",{offset:"0.455",stopColor:"#FF672A"}),jsxRuntimeExports.jsx("stop",{offset:"0.57",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.737",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint9_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.35233 4.00165) scale(18.4369)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.137",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.48",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.592",stopColor:"#FF5634"}),jsxRuntimeExports.jsx("stop",{offset:"0.655",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.904",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint10_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(14.1041 5.00184) scale(20.1801)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.094",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.231",stopColor:"#FFE141"}),jsxRuntimeExports.jsx("stop",{offset:"0.509",stopColor:"#FFAF1E"}),jsxRuntimeExports.jsx("stop",{offset:"0.626",stopColor:"#FF980E"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint11_linear_927_5847",x1:"17.5331",y1:"3.01533",x2:"3.84302",y2:"16.708",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.167",stopColor:"#FFF44F",stopOpacity:"0.8"}),jsxRuntimeExports.jsx("stop",{offset:"0.266",stopColor:"#FFF44F",stopOpacity:"0.634"}),jsxRuntimeExports.jsx("stop",{offset:"0.489",stopColor:"#FFF44F",stopOpacity:"0.217"}),jsxRuntimeExports.jsx("stop",{offset:"0.6",stopColor:"#FFF44F",stopOpacity:0})]}),jsxRuntimeExports.jsx("clipPath",{id:"clip0_927_5847",children:jsxRuntimeExports.jsx("rect",{width:20,height:20,fill:"white"})})]})]}),Brave=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M17.2924 5.22043L17.7256 4.15905L16.4982 2.8883C15.8339 2.22404 14.4187 2.61393 14.4187 2.61393L12.8158 0.794434H7.16242L5.55231 2.62115C5.55231 2.62115 4.13715 2.23848 3.47289 2.8883L2.24545 4.15183L2.67866 5.21321L2.13715 6.78721L3.9422 13.6681C4.31765 15.141 4.57036 15.7114 5.63173 16.4623L8.93137 18.7006C9.24906 18.8955 9.63895 19.2349 9.99274 19.2349C10.3465 19.2349 10.7364 18.8955 11.0541 18.7006L14.3538 16.4623C15.4151 15.7114 15.6678 15.141 16.0433 13.6681L17.8483 6.78721L17.2924 5.22043Z",fill:"url(#paint0_linear_927_5861)"}),jsxRuntimeExports.jsx("path",{d:"M13.9711 3.78343C13.9711 3.78343 16.0433 6.28884 16.0433 6.81592C16.0433 7.35744 15.7834 7.49462 15.5234 7.77621L13.9711 9.43686C13.8267 9.58126 13.5162 9.82675 13.6967 10.2527C13.8772 10.686 14.1299 11.2203 13.8411 11.769C13.5523 12.3249 13.0469 12.6932 12.722 12.6354C12.2387 12.4786 11.7777 12.2602 11.3502 11.9856C11.0758 11.8051 10.1949 11.0758 10.1949 10.7943C10.1949 10.5127 11.1047 10 11.278 9.89895C11.444 9.78343 12.2166 9.33577 12.231 9.16249C12.2455 8.9892 12.2455 8.94588 12.0144 8.51267C11.7834 8.07946 11.379 7.50184 11.4368 7.12639C11.509 6.75094 12.1588 6.54877 12.6426 6.36827L14.1372 5.80509C14.2527 5.74733 14.2238 5.69679 13.8772 5.66068C13.5307 5.6318 12.5559 5.50184 12.1155 5.62458C11.6751 5.74733 10.9386 5.93505 10.8664 6.03614C10.8086 6.13722 10.7509 6.13722 10.8159 6.48379L11.2346 8.75816C11.2635 9.04697 11.3213 9.24191 11.018 9.31411C10.7003 9.38632 10.1733 9.50906 9.99276 9.50906C9.81225 9.50906 9.27796 9.38632 8.96749 9.31411C8.65702 9.24191 8.71478 9.04697 8.75088 8.75816C8.77976 8.46935 9.09745 6.82314 9.16243 6.48379C9.23464 6.13722 9.16965 6.13722 9.11189 6.03614C9.03969 5.93505 8.29601 5.74733 7.85558 5.62458C7.42236 5.50184 6.44041 5.6318 6.09384 5.66791C5.74727 5.69679 5.71839 5.74011 5.83391 5.81231L7.3285 6.36827C7.80503 6.54877 8.46929 6.75094 8.53428 7.12639C8.60648 7.50906 8.19493 8.07946 7.95666 8.51267C7.71839 8.94588 7.72561 8.9892 7.74005 9.16249C7.75449 9.33577 8.53428 9.78343 8.69312 9.89895C8.86641 10.0073 9.77615 10.5127 9.77615 10.7943C9.77615 11.0758 8.91695 11.8051 8.62814 11.9856C8.20063 12.2602 7.73957 12.4786 7.2563 12.6354C6.93139 12.6932 6.42597 12.3249 6.12994 11.769C5.84113 11.2203 6.10106 10.686 6.27435 10.2527C6.45485 9.81953 6.1516 9.58848 5.99998 9.43686L4.44763 7.77621C4.19493 7.50906 3.935 7.36466 3.935 6.83036C3.935 6.29606 6.0072 3.79787 6.0072 3.79787L7.97832 4.11556C8.20937 4.11556 8.722 3.92061 9.19132 3.75455C9.66063 3.61014 9.98554 3.5957 9.98554 3.5957C9.98554 3.5957 10.3032 3.5957 10.7798 3.75455C11.2563 3.91339 11.7617 4.11556 11.9928 4.11556C12.231 4.11556 13.9783 3.77621 13.9783 3.77621L13.9711 3.78343ZM12.4188 13.3719C12.5487 13.4441 12.4693 13.6029 12.3465 13.6896L10.5126 15.1192C10.3682 15.2636 10.1372 15.4802 9.98554 15.4802C9.83391 15.4802 9.61009 15.2636 9.45846 15.1192C8.8506 14.6351 8.23683 14.1586 7.61731 13.6896C7.50178 13.6029 7.42236 13.4513 7.54511 13.3719L8.62814 12.7943C9.05864 12.5665 9.51417 12.3897 9.98554 12.2672C10.0938 12.2672 10.7798 12.5127 11.3357 12.7943L12.4188 13.3719Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M14.4332 2.62115L12.8159 0.794434H7.16243L5.55232 2.62115C5.55232 2.62115 4.13716 2.23848 3.4729 2.8883C3.4729 2.8883 5.35016 2.72223 5.99998 3.77638L7.99276 4.11573C8.2238 4.11573 8.73644 3.92079 9.20575 3.75472C9.67507 3.61032 9.99998 3.59588 9.99998 3.59588C9.99998 3.59588 10.3177 3.59588 10.7942 3.75472C11.2707 3.91357 11.7761 4.11573 12.0072 4.11573C12.2455 4.11573 13.9928 3.77638 13.9928 3.77638C14.6426 2.72223 16.5198 2.8883 16.5198 2.8883C15.8556 2.22404 14.4404 2.61393 14.4404 2.61393",fill:"url(#paint1_linear_927_5861)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5861",x1:"2.13715",y1:"10.1991",x2:"17.8483",y2:"10.1991",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.4",stopColor:"#FF5500"}),jsxRuntimeExports.jsx("stop",{offset:"0.6",stopColor:"#FF2000"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_927_5861",x1:"3.73384",y1:"2.4883",x2:"16.5198",y2:"2.4883",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FF452A"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#FF2000"})]})]})]}),Edge=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_927_5865)",children:[jsxRuntimeExports.jsx("path",{d:"M18.0547 14.8828C17.7865 15.0222 17.5099 15.1448 17.2266 15.25C16.3293 15.584 15.3792 15.7533 14.4219 15.75C10.7266 15.75 7.50781 13.2109 7.50781 9.94531C7.51262 9.50803 7.63385 9.07993 7.85905 8.70506C8.08424 8.33019 8.40526 8.0221 8.78906 7.8125C5.44531 7.95312 4.58594 11.4375 4.58594 13.4766C4.58594 19.2578 9.90625 19.8359 11.0547 19.8359C11.6719 19.8359 12.6016 19.6562 13.1641 19.4766L13.2656 19.4453C15.4183 18.7014 17.2534 17.2465 18.4688 15.3203C18.5041 15.2618 18.5192 15.1933 18.5119 15.1253C18.5046 15.0574 18.4752 14.9937 18.4282 14.944C18.3812 14.8944 18.3192 14.8615 18.2518 14.8505C18.1843 14.8394 18.1151 14.8508 18.0547 14.8828Z",fill:"url(#paint0_linear_927_5865)"}),jsxRuntimeExports.jsx("path",{opacity:"0.35",d:"M18.0547 14.8828C17.7865 15.0222 17.5099 15.1448 17.2266 15.25C16.3293 15.584 15.3792 15.7533 14.4219 15.75C10.7266 15.75 7.50781 13.2109 7.50781 9.94531C7.51262 9.50803 7.63385 9.07993 7.85905 8.70506C8.08424 8.33019 8.40526 8.0221 8.78906 7.8125C5.44531 7.95312 4.58594 11.4375 4.58594 13.4766C4.58594 19.2578 9.90625 19.8359 11.0547 19.8359C11.6719 19.8359 12.6016 19.6562 13.1641 19.4766L13.2656 19.4453C15.4183 18.7014 17.2534 17.2465 18.4688 15.3203C18.5041 15.2618 18.5192 15.1933 18.5119 15.1253C18.5046 15.0574 18.4752 14.9937 18.4282 14.944C18.3812 14.8944 18.3192 14.8615 18.2518 14.8505C18.1843 14.8394 18.1151 14.8508 18.0547 14.8828Z",fill:"url(#paint1_radial_927_5865)"}),jsxRuntimeExports.jsx("path",{d:"M8.2578 18.8516C7.56239 18.4196 6.95961 17.854 6.48436 17.1875C5.94166 16.4447 5.56809 15.5921 5.38987 14.6896C5.21165 13.787 5.23311 12.8565 5.45272 11.9631C5.67234 11.0697 6.08479 10.2353 6.66115 9.51826C7.23751 8.80123 7.96379 8.21903 8.78905 7.8125C9.03905 7.69531 9.45311 7.49219 10.0078 7.5C10.3981 7.50302 10.7824 7.59627 11.1308 7.77245C11.4791 7.94864 11.7819 8.20299 12.0156 8.51562C12.3299 8.93835 12.5023 9.4498 12.5078 9.97656C12.5078 9.96094 14.4219 3.75781 6.2578 3.75781C2.82811 3.75781 0.00780015 7.00781 0.00780015 9.86719C-0.00584162 11.3776 0.317079 12.8721 0.953112 14.2422C1.99473 16.4602 3.81447 18.2185 6.06689 19.1834C8.3193 20.1483 10.8476 20.2526 13.1719 19.4766C12.3576 19.7337 11.4972 19.811 10.6501 19.7031C9.80297 19.5952 8.98941 19.3047 8.26561 18.8516H8.2578Z",fill:"url(#paint2_linear_927_5865)"}),jsxRuntimeExports.jsx("path",{opacity:"0.41",d:"M8.2578 18.8516C7.56239 18.4196 6.95961 17.854 6.48436 17.1875C5.94166 16.4447 5.56809 15.5921 5.38987 14.6896C5.21165 13.787 5.23311 12.8565 5.45272 11.9631C5.67234 11.0697 6.08479 10.2353 6.66115 9.51826C7.23751 8.80123 7.96379 8.21903 8.78905 7.8125C9.03905 7.69531 9.45311 7.49219 10.0078 7.5C10.3981 7.50302 10.7824 7.59627 11.1308 7.77245C11.4791 7.94864 11.7819 8.20299 12.0156 8.51562C12.3299 8.93835 12.5023 9.4498 12.5078 9.97656C12.5078 9.96094 14.4219 3.75781 6.2578 3.75781C2.82811 3.75781 0.00780015 7.00781 0.00780015 9.86719C-0.00584162 11.3776 0.317079 12.8721 0.953112 14.2422C1.99473 16.4602 3.81447 18.2185 6.06689 19.1834C8.3193 20.1483 10.8476 20.2526 13.1719 19.4766C12.3576 19.7337 11.4972 19.811 10.6501 19.7031C9.80297 19.5952 8.98941 19.3047 8.26561 18.8516H8.2578Z",fill:"url(#paint3_radial_927_5865)"}),jsxRuntimeExports.jsx("path",{d:"M11.9062 11.625C11.8359 11.7031 11.6406 11.8203 11.6406 12.0625C11.6406 12.2656 11.7734 12.4688 12.0156 12.6328C13.1328 13.4141 15.25 13.3047 15.2578 13.3047C16.0907 13.3041 16.9081 13.0802 17.625 12.6562C18.3467 12.2341 18.9456 11.6307 19.3622 10.9057C19.7788 10.1808 19.9986 9.35955 20 8.52344C20.0234 6.77344 19.375 5.60937 19.1172 5.09375C17.4531 1.85937 13.8828 4.89564e-08 10 4.89564e-08C7.37202 -0.00025981 4.84956 1.03398 2.97819 2.87904C1.10682 4.7241 0.0369559 7.23166 0 9.85938C0.0390625 7.00781 2.875 4.70312 6.25 4.70312C6.52344 4.70312 8.08594 4.72656 9.53125 5.48438C10.5466 5.98895 11.3875 6.78627 11.9453 7.77344C12.4219 8.60156 12.5078 9.65625 12.5078 10.0781C12.5078 10.5 12.2969 11.1172 11.8984 11.6328L11.9062 11.625Z",fill:"url(#paint4_radial_927_5865)"}),jsxRuntimeExports.jsx("path",{d:"M11.9062 11.625C11.8359 11.7031 11.6406 11.8203 11.6406 12.0625C11.6406 12.2656 11.7734 12.4688 12.0156 12.6328C13.1328 13.4141 15.25 13.3047 15.2578 13.3047C16.0907 13.3041 16.9081 13.0802 17.625 12.6562C18.3467 12.2341 18.9456 11.6307 19.3622 10.9057C19.7788 10.1808 19.9986 9.35955 20 8.52344C20.0234 6.77344 19.375 5.60937 19.1172 5.09375C17.4531 1.85937 13.8828 4.89564e-08 10 4.89564e-08C7.37202 -0.00025981 4.84956 1.03398 2.97819 2.87904C1.10682 4.7241 0.0369559 7.23166 0 9.85938C0.0390625 7.00781 2.875 4.70312 6.25 4.70312C6.52344 4.70312 8.08594 4.72656 9.53125 5.48438C10.5466 5.98895 11.3875 6.78627 11.9453 7.77344C12.4219 8.60156 12.5078 9.65625 12.5078 10.0781C12.5078 10.5 12.2969 11.1172 11.8984 11.6328L11.9062 11.625Z",fill:"url(#paint5_radial_927_5865)"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5865",x1:"4.58594",y1:"13.8281",x2:"18.5234",y2:"13.8281",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#0C59A4"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#114A8B"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint1_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12.2813 13.9332) scale(7.45313 7.08047)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.7",stopOpacity:0}),jsxRuntimeExports.jsx("stop",{offset:"0.9",stopOpacity:"0.5"}),jsxRuntimeExports.jsx("stop",{offset:1})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint2_linear_927_5865",x1:"11.9297",y1:"7.78125",x2:"3.23436",y2:"17.2578",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#1B9DE2"}),jsxRuntimeExports.jsx("stop",{offset:"0.2",stopColor:"#1595DF"}),jsxRuntimeExports.jsx("stop",{offset:"0.7",stopColor:"#0680D7"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#0078D4"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint3_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(5.51209 15.5419) rotate(-81.3844) scale(11.202 9.05011)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.8",stopOpacity:0}),jsxRuntimeExports.jsx("stop",{offset:"0.9",stopOpacity:"0.5"}),jsxRuntimeExports.jsx("stop",{offset:1})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint4_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(2.02266 3.69656) rotate(92.2906) scale(15.8251 33.7043)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#35C1F1"}),jsxRuntimeExports.jsx("stop",{offset:"0.1",stopColor:"#34C1ED"}),jsxRuntimeExports.jsx("stop",{offset:"0.2",stopColor:"#2FC2DF"}),jsxRuntimeExports.jsx("stop",{offset:"0.3",stopColor:"#2BC3D2"}),jsxRuntimeExports.jsx("stop",{offset:"0.7",stopColor:"#36C752"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint5_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(18.7547 6.03906) rotate(73.7398) scale(7.60156 6.18159)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#66EB6E"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#66EB6E",stopOpacity:0})]}),jsxRuntimeExports.jsx("clipPath",{id:"clip0_927_5865",children:jsxRuntimeExports.jsx("rect",{width:20,height:20,fill:"white"})})]})]});var browsers={Chrome,FireFox,Brave,Edge};const BrowserIcon=React.forwardRef(({browser:o},et)=>{const tt=o??detectBrowser();let nt;switch(tt){case"chrome":nt=browsers.Chrome;break;case"firefox":nt=browsers.FireFox;break;case"edge":nt=browsers.Edge;break}return nt?jsxRuntimeExports.jsx(BrowserIconContainer,{children:nt}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})});BrowserIcon.displayName="BrowserIcon";const LogoContainer$3=styled(motion.div)` + z-index: 4; + position: relative; + width: 100px; + height: 100px; + svg { + z-index: 3; + position: relative; + display: block; + } +`,Logo=styled(motion.div)` + z-index: 2; + position: absolute; + overflow: hidden; + inset: 6px; + border-radius: 50px; + background: var(--ck-body-background); + display: flex; + align-items: center; + justify-content: center; + svg, + img { + pointer-events: none; + display: block; + margin: 0 auto; + width: 100%; + height: 100%; + ${o=>o.$small&&Ae` + width: 85%; + height: 85%; + `} + } +`,SpinnerContainer=styled(motion.div)` + position: absolute; + inset: -5px; +`,ExpiringSpinner=styled(motion.div)` + pointer-events: none; + user-select: none; + z-index: 1; + position: absolute; + inset: -25%; + background: var(--ck-body-background); + div:first-child { + position: absolute; + left: 50%; + right: 0; + top: 0; + bottom: 0; + overflow: hidden; + &:before { + position: absolute; + content: ''; + inset: 0; + background: var(--ck-spinner-color); + transform-origin: 0% 50%; + animation: rotateExpiringSpinner 5000ms ease-in both; + } + } + div:last-child { + position: absolute; + left: 0; + right: 50%; + top: 0; + bottom: 0; + overflow: hidden; + &:before { + position: absolute; + content: ''; + inset: 0; + background: var(--ck-spinner-color); + transform-origin: 100% 50%; + animation: rotateExpiringSpinner 5000ms ease-out 5000ms both; + } + } + @keyframes rotateExpiringSpinner { + 0% { + transform: rotate(-180deg); + } + 100% { + transform: rotate(0deg); + } + } +`,Spinner$2=styled(motion.div)` + pointer-events: none; + user-select: none; + z-index: 1; + position: absolute; + inset: 0; + svg { + display: block; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + animation: rotateSpinner 1200ms linear infinite; + } + @keyframes rotateSpinner { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + } +`,CircleSpinner=({logo:o,smallLogo:et,connecting:tt=!0,unavailable:nt=!1,countdown:rt=!1})=>jsxRuntimeExports.jsxs(LogoContainer$3,{transition:{duration:.5,ease:[.175,.885,.32,.98]},children:[jsxRuntimeExports.jsx(Logo,{$small:!nt&&et,style:nt?{borderRadius:0}:void 0,children:o}),jsxRuntimeExports.jsx(SpinnerContainer,{children:jsxRuntimeExports.jsxs(AnimatePresence,{children:[tt&&jsxRuntimeExports.jsx(Spinner$2,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:rt?1:0}},children:jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"102",height:"102",viewBox:"0 0 102 102",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M52 100C24.3858 100 2 77.6142 2 50",stroke:"url(#paint0_linear_1943_4139)",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1943_4139",x1:"2",y1:"48.5",x2:"53",y2:"100",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-spinner-color)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-spinner-color)",stopOpacity:"0"})]})})]})},"Spinner"),rt&&jsxRuntimeExports.jsxs(ExpiringSpinner,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:[jsxRuntimeExports.jsx("div",{}),jsxRuntimeExports.jsx("div",{})]},"ExpiringSpinner")]})})]}),states$1={CONNECTED:"connected",CONNECTING:"connecting",EXPIRING:"expiring",FAILED:"failed",REJECTED:"rejected",NOTCONNECTED:"notconnected",UNAVAILABLE:"unavailable"},contentVariants$1={initial:{willChange:"transform,opacity",position:"relative",opacity:0,scale:.95},animate:{position:"relative",opacity:1,scale:1,transition:{ease:[.16,1,.3,1],duration:.4,delay:.05,position:{delay:0}}},exit:{position:"absolute",opacity:0,scale:.95,transition:{ease:[.16,1,.3,1],duration:.3}}},ConnectWithInjector=({switchConnectMethod:o,forceState:et})=>{var tt,nt,rt,ot,it,st,at,ct;const{connect:lt}=useConnect({mutation:{onMutate:$t=>{$t.connector?kt(states$1.CONNECTING):kt(states$1.UNAVAILABLE)},onError($t){console.error($t)},onSettled($t,Ot){if(Ot){if(gt(!0),setTimeout(()=>gt(!1),3500),Ot.code)switch(Ot.code){case-32002:kt(states$1.NOTCONNECTED);break;case 4001:kt(states$1.REJECTED);break;default:kt(states$1.FAILED);break}else if(Ot.message)switch(Ot.message){case"User rejected request":kt(states$1.REJECTED);break;default:kt(states$1.FAILED);break}}setTimeout(dt,100)}}}),{triggerResize:dt,connector:ht}=useContext(),pt=ht.id,mt=useWallet(pt),ft={name:mt==null?void 0:mt.name,shortName:(tt=mt==null?void 0:mt.shortName)!==null&&tt!==void 0?tt:mt==null?void 0:mt.name,icon:(nt=mt==null?void 0:mt.iconConnector)!==null&&nt!==void 0?nt:mt==null?void 0:mt.icon,iconShape:(rt=mt==null?void 0:mt.iconShape)!==null&&rt!==void 0?rt:"circle",iconShouldShrink:mt==null?void 0:mt.iconShouldShrink},[yt,gt]=reactExports.useState(!1);reactExports.useState(9);const vt=detectBrowser(),bt=(ot=mt==null?void 0:mt.downloadUrls)===null||ot===void 0?void 0:ot[vt],Et=mt!=null&&mt.downloadUrls?{name:Object.keys(mt==null?void 0:mt.downloadUrls)[0],label:((it=Object.keys(mt==null?void 0:mt.downloadUrls)[0])===null||it===void 0?void 0:it.charAt(0).toUpperCase())+((st=Object.keys(mt==null?void 0:mt.downloadUrls)[0])===null||st===void 0?void 0:st.slice(1)),url:mt==null?void 0:mt.downloadUrls[Object.keys(mt==null?void 0:mt.downloadUrls)[0]]}:void 0,[wt,kt]=reactExports.useState(et||(mt!=null&&mt.isInstalled?states$1.CONNECTING:states$1.UNAVAILABLE)),Tt=useLocales({CONNECTORNAME:ft.name,CONNECTORSHORTNAME:(at=ft.shortName)!==null&&at!==void 0?at:ft.name,SUGGESTEDEXTENSIONBROWSER:(ct=Et==null?void 0:Et.label)!==null&&ct!==void 0?ct:"your browser"}),Rt=async()=>{mt!=null&&mt.isInstalled&&(mt!=null&&mt.connector)?lt({connector:mt==null?void 0:mt.connector}):kt(states$1.UNAVAILABLE)};let Pt;return reactExports.useEffect(()=>{if(wt!==states$1.UNAVAILABLE)return Pt=setTimeout(Rt,600),()=>{clearTimeout(Pt)}},[]),mt?isWalletConnectConnector(mt==null?void 0:mt.connector.id)?jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(Container$4,{children:[jsxRuntimeExports.jsx(ModalHeading,{children:"Invalid State"}),jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsx(Alert,{children:"WalletConnect does not have an injection flow. This state should never happen."})})]})}):jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(Container$4,{children:[jsxRuntimeExports.jsx(ConnectingContainer,{children:jsxRuntimeExports.jsxs(ConnectingAnimation,{$shake:wt===states$1.FAILED||wt===states$1.REJECTED,$circle:ft.iconShape==="circle",children:[jsxRuntimeExports.jsx(AnimatePresence,{children:(wt===states$1.FAILED||wt===states$1.REJECTED)&&jsxRuntimeExports.jsx(RetryButton,{"aria-label":"Retry",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},whileTap:{scale:.9},transition:{duration:.1},onClick:Rt,children:jsxRuntimeExports.jsx(RetryIconContainer,{children:jsxRuntimeExports.jsx(Tooltip,{open:yt&&(wt===states$1.FAILED||wt===states$1.REJECTED),message:Tt.tryAgainQuestion,xOffset:-6,children:jsxRuntimeExports.jsx(RetryIconCircle,{})})})})}),ft.iconShape==="circle"?jsxRuntimeExports.jsx(CircleSpinner,{logo:wt===states$1.UNAVAILABLE?jsxRuntimeExports.jsx("div",{style:{transform:"scale(1.14)",position:"relative",width:"100%"},children:ft.icon}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ft.icon}),smallLogo:ft.iconShouldShrink,connecting:wt===states$1.CONNECTING,unavailable:wt===states$1.UNAVAILABLE}):jsxRuntimeExports.jsx(SquircleSpinner,{logo:wt===states$1.UNAVAILABLE?jsxRuntimeExports.jsx("div",{style:{transform:"scale(1.14)",position:"relative",width:"100%"},children:ft.icon}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ft.icon}),connecting:wt===states$1.CONNECTING})]})}),jsxRuntimeExports.jsx(ModalContentContainer,{children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[wt===states$1.FAILED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalH1,{$error:!0,children:[jsxRuntimeExports.jsx(AlertIcon,{}),Tt.injectionScreen_failed_h1]}),jsxRuntimeExports.jsx(ModalBody,{children:Tt.injectionScreen_failed_p})]})},states$1.FAILED),wt===states$1.REJECTED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:28},children:[jsxRuntimeExports.jsx(ModalH1,{children:Tt.injectionScreen_rejected_h1}),jsxRuntimeExports.jsx(ModalBody,{children:Tt.injectionScreen_rejected_p})]})},states$1.REJECTED),(wt===states$1.CONNECTING||wt===states$1.EXPIRING)&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:28},children:[jsxRuntimeExports.jsx(ModalH1,{children:mt.connector.id==="injected"?Tt.injectionScreen_connecting_injected_h1:Tt.injectionScreen_connecting_h1}),jsxRuntimeExports.jsx(ModalBody,{children:mt.connector.id==="injected"?Tt.injectionScreen_connecting_injected_p:Tt.injectionScreen_connecting_p})]})},states$1.CONNECTING),wt===states$1.CONNECTED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalH1,{$valid:!0,children:[jsxRuntimeExports.jsx(TickIcon,{})," ",Tt.injectionScreen_connected_h1]}),jsxRuntimeExports.jsx(ModalBody,{children:Tt.injectionScreen_connected_p})]})},states$1.CONNECTED),wt===states$1.NOTCONNECTED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalH1,{children:Tt.injectionScreen_notconnected_h1}),jsxRuntimeExports.jsx(ModalBody,{children:Tt.injectionScreen_notconnected_p})]})},states$1.NOTCONNECTED),wt===states$1.UNAVAILABLE&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:bt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:18},children:[jsxRuntimeExports.jsx(ModalH1,{children:Tt.injectionScreen_install_h1}),jsxRuntimeExports.jsx(ModalBody,{children:Tt.injectionScreen_install_p})]}),!mt.isInstalled&&bt&&jsxRuntimeExports.jsx(Button$1,{href:bt,icon:jsxRuntimeExports.jsx(BrowserIcon,{}),children:Tt.installTheExtension})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:12},children:[jsxRuntimeExports.jsx(ModalH1,{children:Tt.injectionScreen_unavailable_h1}),jsxRuntimeExports.jsx(ModalBody,{children:Tt.injectionScreen_unavailable_p})]}),!mt.isInstalled&&Et&&jsxRuntimeExports.jsxs(Button$1,{href:Et==null?void 0:Et.url,icon:jsxRuntimeExports.jsx(BrowserIcon,{browser:Et==null?void 0:Et.name}),children:["Install on ",Et==null?void 0:Et.label]})]})},states$1.UNAVAILABLE)]})})]})}):jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(Container$4,{children:[jsxRuntimeExports.jsx(ModalHeading,{children:"Invalid State"}),jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsx(Alert,{children:"No connectors match the id given. This state should never happen."})})]})})},QRCodeContainer=styled(motion.div)` + z-index: 3; + position: relative; + overflow: hidden; + height: 0; + padding-bottom: 100% !important; + display: flex; + align-items: center; + justify-content: center; + margin: 1px 0 2px; + border-radius: var(--ck-qr-border-radius, 24px); + background: var(--ck-qr-background, transparent); + box-shadow: 0 0 0 1px var(--ck-qr-border-color); + backface-visibility: hidden; + svg { + display: block; + max-width: 100%; + width: 100%; + height: auto; + } +`,QRCodeContent=styled(motion.div)` + position: absolute; + inset: 13px; + svg { + width: 100% !important; + height: auto !important; + } +`,PlaceholderKeyframes$2=We` + 0%{ background-position: 100% 0; } + 100%{ background-position: -100% 0; } +`,QRPlaceholder=styled(motion.div)` + --color: var(--ck-qr-dot-color); + --bg: var(--ck-qr-background, var(--ck-body-background)); + + position: absolute; + inset: 0; + display: flex; + align-items: center; + justify-content: center; + > div { + z-index: 4; + position: relative; + width: 28%; + height: 28%; + border-radius: 20px; + background: var(--bg); + box-shadow: 0 0 0 7px var(--bg); + } + > span { + z-index: 4; + position: absolute; + background: var(--color); + border-radius: 12px; + width: 13.25%; + height: 13.25%; + box-shadow: 0 0 0 4px var(--bg); + &:before { + content: ''; + position: absolute; + inset: 9px; + border-radius: 3px; + box-shadow: 0 0 0 4px var(--bg); + } + &:nth-child(1) { + top: 0; + left: 0; + } + &:nth-child(2) { + top: 0; + right: 0; + } + &:nth-child(3) { + bottom: 0; + left: 0; + } + } + &:before { + z-index: 3; + content: ''; + position: absolute; + inset: 0; + background: repeat; + background-size: 1.888% 1.888%; + background-image: radial-gradient(var(--color) 41%, transparent 41%); + } + &:after { + z-index: 5; + content: ''; + position: absolute; + inset: 0; + transform: scale(1.5) rotate(45deg); + background-image: linear-gradient( + 90deg, + rgba(255, 255, 255, 0) 50%, + rgba(255, 255, 255, 1), + rgba(255, 255, 255, 0) + ); + background-size: 200% 100%; + animation: ${PlaceholderKeyframes$2} 1000ms linear infinite both; + } +`,LogoContainer$2=styled(motion.div)` + z-index: 6; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + transform: translateY(50%) scale(0.9999); // Shifting fix +`,LogoIcon=styled(motion.div)` + z-index: 6; + position: absolute; + left: 50%; + overflow: hidden; + + transform: translate(-50%, -50%) scale(0.9999); // Shifting fix + + svg { + display: block; + position: relative; + width: 100%; + height: 100%; + } + + ${o=>o.$wcLogo?Ae` + width: 29%; + height: 20.5%; + `:Ae` + width: 28%; + height: 28%; + border-radius: 17px; + &:before { + pointer-events: none; + z-index: 2; + content: ''; + position: absolute; + inset: 0; + border-radius: inherit; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02); + } + `} +`,generateMatrix=(o,et)=>{const tt=Array.prototype.slice.call(browser$1.create(o,{errorCorrectionLevel:et}).modules.data,0),nt=Math.sqrt(tt.length);return tt.reduce((rt,ot,it)=>(it%nt===0?rt.push([ot]):rt[rt.length-1].push(ot))&&rt,[])};function QRCode$1({ecl:o="M",size:et=200,uri:tt,clearArea:nt=!1,image:rt,imageBackground:ot="transparent"}){const it=nt?76:0,st=et-10*2,at=reactExports.useMemo(()=>{const ct=[],lt=generateMatrix(tt,o),dt=st/lt.length;if([{x:0,y:0},{x:1,y:0},{x:0,y:1}].forEach(({x:yt,y:gt})=>{const xt=(lt.length-7)*dt*yt,vt=(lt.length-7)*dt*gt;for(let bt=0;bt<3;bt++)ct.push(jsxRuntimeExports.jsx("rect",{fill:bt%2!==0?"var(--ck-qr-background, var(--ck-body-background))":"var(--ck-qr-dot-color)",rx:(bt-2)*-5+(bt===0?2:3),ry:(bt-2)*-5+(bt===0?2:3),width:dt*(7-bt*2),height:dt*(7-bt*2),x:xt+dt*bt,y:vt+dt*bt},`${bt}-${yt}-${gt}`))}),rt){const yt=(lt.length-7)*dt*1,gt=(lt.length-7)*dt*1;ct.push(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("rect",{fill:ot,rx:-2*-5+2,ry:-2*-5+2,width:dt*(7-0*2),height:dt*(7-0*2),x:yt+dt*0,y:gt+dt*0}),jsxRuntimeExports.jsx("foreignObject",{width:dt*(7-0*2),height:dt*(7-0*2),x:yt+dt*0,y:gt+dt*0,children:jsxRuntimeExports.jsx("div",{style:{borderRadius:-2*-5+2,overflow:"hidden"},children:rt})})]}))}const pt=Math.floor((it+25)/dt),mt=lt.length/2-pt/2,ft=lt.length/2+pt/2-1;return lt.forEach((yt,gt)=>{yt.forEach((xt,vt)=>{lt[gt][vt]&&(gt<7&&vt<7||gt>lt.length-8&&vt<7||gt<7&&vt>lt.length-8||(rt||!(gt>mt&>mt&&vt{function tt(){et({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",tt),tt(),()=>window.removeEventListener("resize",tt)},[]),o}function CustomQRCode({value:o,image:et,imageBackground:tt,imagePosition:nt="center",tooltipMessage:rt}){const it=useWindowSize().width>920&&rt?jsxRuntimeExports.jsx(Tooltip,{xOffset:139,yOffset:5,delay:.1,message:rt,children:et}):et;return jsxRuntimeExports.jsx(QRCodeContainer,{children:jsxRuntimeExports.jsxs(QRCodeContent,{children:[et&&jsxRuntimeExports.jsx(LogoContainer$2,{children:jsxRuntimeExports.jsx(LogoIcon,{$wcLogo:nt!=="center",style:{background:nt==="center"?tt:void 0},children:it})}),jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:o?jsxRuntimeExports.jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute",inset:[0,0]},transition:{duration:.2},children:jsxRuntimeExports.jsx(QRCode$1,{uri:o,size:288,ecl:"M",clearArea:!!(nt==="center"&&et)})},o):jsxRuntimeExports.jsxs(QRPlaceholder,{initial:{opacity:.1},animate:{opacity:.1},exit:{opacity:0,position:"absolute",inset:[0,0]},transition:{duration:.2},children:[jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("div",{})]})})]})})}CustomQRCode.displayName="CustomQRCode";const IconContainer$1=styled(motion.div)` + position: relative; + display: flex; + align-items: center; + justify-content: center; + width: 47px; + height: 52px; + min-width: 47px; + min-height: 52px; + svg { + display: block; + max-width: 100%; + height: auto; + } +`,ScanIconWithLogos=({logo:o})=>{const et=[jsxRuntimeExports.jsx(Logos.MetaMask,{background:!0}),jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0}),jsxRuntimeExports.jsx(Logos.Crypto,{}),jsxRuntimeExports.jsx(Logos.ImToken,{}),jsxRuntimeExports.jsx(Logos.Argent,{}),jsxRuntimeExports.jsx(Logos.Trust,{})];return jsxRuntimeExports.jsx(IconContainer$1,{children:jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"47",height:"52",viewBox:"0 0 47 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{mask:"url(#gradient-mask)",children:[jsxRuntimeExports.jsx("path",{d:"M7 14.5C7 11.4624 9.46243 9 12.5 9H31.5C34.5376 9 37 11.4624 37 14.5V47H7V14.5Z",fill:"var(--ck-graphic-scaniconwithlogos-04)"}),o?jsxRuntimeExports.jsx("foreignObject",{x:"13",y:"21",width:"18",height:"18",rx:"5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:5},children:o})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("foreignObject",{x:"12",y:"15",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:et[0]})}),jsxRuntimeExports.jsx("foreignObject",{x:"23",y:"15",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:et[1]})}),jsxRuntimeExports.jsx("foreignObject",{x:"12",y:"26",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:et[2]})})}),jsxRuntimeExports.jsx("foreignObject",{x:"23",y:"26",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:et[3]})}),jsxRuntimeExports.jsx("foreignObject",{x:"12",y:"37",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:et[4]})}),jsxRuntimeExports.jsx("foreignObject",{x:"23",y:"37",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:et[5]})})]}),jsxRuntimeExports.jsx("path",{d:"M36 47V13.7143C36 11.1107 33.8893 9 31.2857 9H12.7143C10.1107 9 8 11.1107 8 13.7143V47",stroke:"url(#paint0_linear_924_12568)",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M15 10H29C29 11.1046 28.1046 12 27 12H17C15.8954 12 15 11.1046 15 10Z",fill:"var(--ck-graphic-scaniconwithlogos-01)"}),jsxRuntimeExports.jsx("rect",{x:"1",y:"47",width:"43",height:"5",fill:"var(--ck-tooltip-background)"}),jsxRuntimeExports.jsx("rect",{x:"22",y:"1",width:"24",height:"24",rx:"12",fill:"var(--ck-graphic-scaniconwithlogos-03)",stroke:"var(--ck-tooltip-background)",strokeWidth:"2"}),jsxRuntimeExports.jsx("rect",{x:"34.5",y:"10",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("rect",{x:"31",y:"10",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("rect",{x:"31",y:"13.5",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("rect",{x:"34.5",y:"13.5",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("path",{d:"M28.5 10.5V9C28.5 8.17157 29.1716 7.5 30 7.5H31.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M36.5 7.5L38 7.5C38.8284 7.5 39.5 8.17157 39.5 9L39.5 10.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M39.5 15.5L39.5 17C39.5 17.8284 38.8284 18.5 38 18.5L36.5 18.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M31.5 18.5L30 18.5C29.1716 18.5 28.5 17.8284 28.5 17L28.5 15.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_924_12568",x1:"22",y1:"8.2549",x2:"22",y2:"47",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-scaniconwithlogos-01)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-scaniconwithlogos-02)"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"linear-gradient-mask",x1:"47",y1:"42",x2:"47",y2:"47",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"black",stopOpacity:"0"})]}),jsxRuntimeExports.jsx("mask",{id:"gradient-mask",children:jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"47",height:"52",fill:"url(#linear-gradient-mask)"})})]})]})})},ConnectWithQRCode=({switchConnectMethod:o})=>{var et,tt,nt,rt,ot,it,st,at;const ct=useContext(),lt=ct.connector.id,dt=useWallet(ct.connector.id),{open:ht,isOpen:pt}=useWalletConnectModal(),{connect:{getUri:mt}}=useWeb3(),ft=mt(lt),yt=ft?(tt=(et=dt==null?void 0:dt.getWalletConnectDeeplink)===null||et===void 0?void 0:et.call(dt,ft))!==null&&tt!==void 0?tt:ft:void 0,gt=useLocales({CONNECTORNAME:dt==null?void 0:dt.name});if(!dt)return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Wallet not found ",ct.connector.id]});const xt=dt==null?void 0:dt.downloadUrls,vt={chrome:xt==null?void 0:xt.chrome,firefox:xt==null?void 0:xt.firefox,brave:xt==null?void 0:xt.brave,edge:xt==null?void 0:xt.edge,safari:xt==null?void 0:xt.safari};detectBrowser();const bt=xt&&Object.keys(xt).length!==0;vt&&(Object.keys(vt)[0],((nt=Object.keys(vt)[0])===null||nt===void 0?void 0:nt.charAt(0).toUpperCase())+((rt=Object.keys(vt)[0])===null||rt===void 0?void 0:rt.slice(1)),vt[Object.keys(vt)[0]]);const Et=isWalletConnectConnector(lt);return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:8,gap:14},children:[jsxRuntimeExports.jsx(CustomQRCode,{value:yt,image:dt==null?void 0:dt.icon,tooltipMessage:isWalletConnectConnector(lt)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScanIconWithLogos,{}),jsxRuntimeExports.jsx("span",{children:gt.scanScreen_tooltip_walletConnect})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScanIconWithLogos,{logo:dt==null?void 0:dt.icon}),jsxRuntimeExports.jsx("span",{children:gt.scanScreen_tooltip_default})]})}),Et?jsxRuntimeExports.jsx(OrDivider,{}):bt&&jsxRuntimeExports.jsx(OrDivider,{children:gt.dontHaveTheApp})]}),Et&&jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:14},children:[((ot=ct.options)===null||ot===void 0?void 0:ot.walletConnectCTA)!=="modal"&&jsxRuntimeExports.jsx(CopyToClipboard,{variant:"button",string:yt,children:((it=ct.options)===null||it===void 0?void 0:it.walletConnectCTA)==="link"?gt.copyToClipboard:gt.copyCode}),((st=ct.options)===null||st===void 0?void 0:st.walletConnectCTA)!=="link"&&jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(ExternalLinkIcon,{}),onClick:ht,disabled:pt,waiting:pt,children:((at=ct.options)===null||at===void 0?void 0:at.walletConnectCTA)==="modal"?gt.useWalletConnectModal:gt.useModal})]}),bt&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Button$1,{onClick:()=>{ct.setRoute(routes.DOWNLOAD)},download:!0,children:gt.getWalletName})})]})},states={QRCODE:"qrcode",INJECTOR:"injector"},ConnectUsing=()=>{const o=useContext(),et=useWallet(o.connector.id),tt=!(et!=null&&et.isInstalled)&&(et==null?void 0:et.getWalletConnectDeeplink),[nt,rt]=reactExports.useState(tt?states.QRCODE:states.INJECTOR);return reactExports.useEffect(()=>{const ot=async()=>{await(et==null?void 0:et.connector.getProvider())||(rt(states.QRCODE),setTimeout(o.triggerResize,10))};nt===states.INJECTOR&&ot()},[]),et?jsxRuntimeExports.jsxs(AnimatePresence,{children:[nt===states.QRCODE&&jsxRuntimeExports.jsx(motion.div,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$2,children:jsxRuntimeExports.jsx(ConnectWithQRCode,{switchConnectMethod:ot=>{rt(states.INJECTOR)}})},states.QRCODE),nt===states.INJECTOR&&jsxRuntimeExports.jsx(motion.div,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$2,children:jsxRuntimeExports.jsx(ConnectWithInjector,{switchConnectMethod:ot=>{rt(states.QRCODE)}})},states.INJECTOR)]}):jsxRuntimeExports.jsxs(Alert,{children:["Connector not found ",o.connector.id]})},DownloadApp=()=>{var o,et,tt;const nt=useContext(),rt=useWallet(nt.connector.id),ot=useLocales({CONNECTORNAME:rt==null?void 0:rt.name});if(!rt)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"Wallet not found"});const it={ios:(o=rt.downloadUrls)===null||o===void 0?void 0:o.ios,android:(et=rt.downloadUrls)===null||et===void 0?void 0:et.android,redirect:(tt=rt.downloadUrls)===null||tt===void 0?void 0:tt.download},st=it.ios&&it.android?ot.downloadAppScreen_iosAndroid:it.ios?ot.downloadAppScreen_ios:ot.downloadAppScreen_android;return jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:4,gap:14},children:[it.redirect&&jsxRuntimeExports.jsx(CustomQRCode,{value:it.redirect}),!it.redirect&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"No download link available"}),jsxRuntimeExports.jsx(ModalBody,{style:{fontSize:15,lineHeight:"20px",padding:"0 12px"},children:st})]})})},AvatarContainer=styled(motion.div)` + padding: 18px 0 20px; + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + padding: 16px 0 20px; + } +`,AvatarInner=styled(motion.div)` + position: relative; + display: inline-block; +`,ChainSelectorContainer=styled(motion.div)` + z-index: 3; + position: absolute; + bottom: 0px; + right: -16px; +`,BalanceContainer=styled(motion.div)` + position: relative; +`,Balance$1=styled(motion.div)` + position: relative; +`,PlaceholderKeyframes$1=We` + 0%{ background-position: 100% 0; } + 100%{ background-position: -100% 0; } +`,LoadingBalance=styled(motion.div)` + width: 25%; + margin: 0 auto; + position: relative; + overflow: hidden; + border-radius: 10px; + background: var(--ck-body-background-secondary); + inset: 0; + &:before { + z-index: 4; + content: ''; + position: absolute; + inset: 0; + background-image: linear-gradient( + 90deg, + var(--ck-body-background-transparent) 50%, + var(--ck-body-background), + var(--ck-body-background-transparent) + ); + opacity: 0.75; + background-size: 200% 100%; + animation: ${PlaceholderKeyframes$1} 1000ms linear infinite both; + } +`;function addressToNumber(o){return o.split("").map(et=>et.charCodeAt(0)).reduce((et,tt)=>et+tt)%100/100}const EnsAvatar=styled(motion.div)` + will-change: transform; // Needed for Safari + pointer-events: none; + user-select: none; + position: relative; + overflow: hidden; + margin: 0; + border-radius: ${o=>`${o.$radius}px`}; + width: ${o=>`${o.$size}px`}; + height: ${o=>`${o.$size}px`}; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); + &:before { + content: ''; + z-index: 1; + position: absolute; + inset: 0; + border-radius: inherit; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02); + } + ${o=>{if(o.$seed){const et=Math.ceil(addressToNumber(o.$seed)*8),tt=`0${et===0?1:et}`;return Ae` + background: var(--ck-ens-${tt}-start); + background: linear-gradient( + 180deg, + var(--ck-ens-${tt}-start) 0%, + var(--ck-ens-${tt}-stop) 100% + ); + `}}} +`,ImageContainer=styled(motion.img)` + display: block; + position: relative; + width: 100%; + height: 100%; + opacity: ${o=>o.$loaded?1:0}; + will-change: opacity; // Needed for Safari + transition: opacity 500ms ease; + transform: scale(1.01); // fixes background color bleeding +`;function useIsMounted(){const[o,et]=reactExports.useState(!1);return reactExports.useEffect(()=>et(!0),[]),o}const ensFallbackConfig=createConfig({chains:[mainnet],transports:{[mainnet.id]:http()}});function useEnsFallbackConfig(){return useChainIsSupported(1)?void 0:ensFallbackConfig}const Avatar=({address:o,name:et,size:tt=96,radius:nt=96})=>{var rt,ot,it;const st=useIsMounted(),at=useContext(),ct=reactExports.useRef(null),[lt,dt]=reactExports.useState(!0),ht=useEnsFallbackConfig(),{data:pt}=useEnsAddress({chainId:1,name:et,config:ht}),{data:mt}=useEnsName({chainId:1,address:(rt=o??pt)!==null&&rt!==void 0?rt:void 0,config:ht}),{data:ft}=useEnsAvatar({chainId:1,name:normalize$2(mt??""),config:ht}),yt={address:pt??o,name:mt??et,avatar:ft??void 0};return reactExports.useEffect(()=>{ct.current&&ct.current.complete&&ct.current.naturalHeight!==0||dt(!1)},[ft]),st?!((ot=at.options)===null||ot===void 0)&&ot.customAvatar?jsxRuntimeExports.jsx("div",{style:{width:tt,height:tt,borderRadius:nt,overflow:"hidden"},children:(it=at.options)===null||it===void 0?void 0:it.customAvatar({address:o??(yt==null?void 0:yt.address),ensName:et??(yt==null?void 0:yt.name),ensImage:yt==null?void 0:yt.avatar,size:tt,radius:nt})}):!yt.name||!yt.avatar?jsxRuntimeExports.jsx(ResetContainer,{style:{pointerEvents:"none"},children:jsxRuntimeExports.jsx(EnsAvatar,{$size:tt,$seed:yt.address,$radius:nt})}):jsxRuntimeExports.jsx(ResetContainer,{style:{pointerEvents:"none"},children:jsxRuntimeExports.jsx(EnsAvatar,{$size:tt,$seed:yt.address,$radius:nt,children:jsxRuntimeExports.jsx(ImageContainer,{ref:ct,src:yt.avatar,alt:yt.name,onLoad:()=>dt(!0),$loaded:lt})})}):jsxRuntimeExports.jsx("div",{style:{width:tt,height:tt,borderRadius:nt}})},KnownChain=({testnet:o,...et})=>jsxRuntimeExports.jsxs("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"black"},children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.5611 8.12948C21.0082 7.90729 21.5007 7.79167 22 7.79167C22.4993 7.79167 22.9919 7.90729 23.439 8.12948L23.4408 8.1304L33.0387 12.9293C33.577 13.197 34.031 13.61 34.3478 14.121C34.6649 14.6323 34.833 15.2218 34.8333 15.8234V27.2595C34.833 27.8611 34.6649 28.4511 34.3478 28.9624C34.031 29.4733 33.578 29.8858 33.0398 30.1535L23.4411 34.9528C22.9919 35.1775 22.4963 35.2947 21.994 35.2947C21.4918 35.2947 20.9964 35.1777 20.5472 34.9529L10.9475 30.1531L10.9452 30.1519C10.4071 29.8808 9.95535 29.4646 9.6411 28.9504C9.32739 28.437 9.16312 27.8464 9.16673 27.2448L9.16675 27.2417L10.0004 27.2475H9.16673V27.2448V15.8239C9.16705 15.2223 9.33518 14.6322 9.65222 14.121C9.96906 13.61 10.4221 13.1976 10.9604 12.9298L20.5592 8.1304L20.5611 8.12948ZM21.3031 9.62267L11.8706 14.3389L22 19.4036L32.1294 14.3389L22.697 9.62267C22.4806 9.51531 22.2416 9.45905 22 9.45905C21.7585 9.45905 21.5194 9.51534 21.3031 9.62267ZM10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241ZM22.8337 33.3923L32.2967 28.6608C32.5576 28.5312 32.7772 28.3313 32.9308 28.0836C33.0844 27.836 33.1658 27.5504 33.166 27.259V15.8243C33.1659 15.7786 33.1639 15.7331 33.1599 15.6878L22.8337 20.8509V33.3923Z",fill:"url(#paint0_linear_3546_7073)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241Z",fill:"url(#paint1_linear_3546_7073)",fillOpacity:"0.3"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]})]})]}),UnknownChain=({testnet:o,...et})=>jsxRuntimeExports.jsx(KnownChain,{testnet:!0,...et}),Ethereum=({testnet:o,...et})=>{let tt="var(--ck-chain-ethereum-01, #25292E)",nt="var(--ck-chain-ethereum-02, #ffffff)";return o&&(tt="linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)",nt="#fff"),jsxRuntimeExports.jsxs("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:tt},children:[jsxRuntimeExports.jsx("path",{d:"M21.9967 6.99621L21.7955 7.67987V27.5163L21.9967 27.7171L31.2044 22.2744L21.9967 6.99621Z",fill:nt}),jsxRuntimeExports.jsx("path",{d:"M21.9957 6.99621L12.7878 22.2744L21.9957 27.7171V18.0891V6.99621Z",fill:nt}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.9959 36.9996L21.9959 36.9997V36.9995L31.2091 24.0243L21.9959 29.4642L12.788 24.0243L21.9957 36.9993L21.9958 36.9997L21.9959 36.9996Z",fill:nt}),jsxRuntimeExports.jsx("path",{d:"M21.996 27.7181L31.2037 22.2753L21.996 18.09V27.7181Z",fill:nt}),jsxRuntimeExports.jsx("path",{d:"M12.7878 22.2753L21.9957 27.7181V18.09L12.7878 22.2753Z",fill:nt})]})},Polygon=({testnet:o,...et})=>jsxRuntimeExports.jsx("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#6F41D8"},children:jsxRuntimeExports.jsx("path",{d:"M29.0015 17.4529C28.4941 17.1572 27.8355 17.1572 27.2773 17.4529L23.3186 19.7271L20.6305 21.2094L16.6719 23.4822C16.1645 23.7792 15.5059 23.7792 14.9476 23.4822L11.8016 21.703C11.2943 21.4074 10.9395 20.8642 10.9395 20.2702V16.7612C10.9395 16.1686 11.2434 15.6255 11.8016 15.3285L14.8954 13.5988C15.4041 13.3018 16.0641 13.3018 16.6224 13.5988L19.7161 15.3285C20.2249 15.6255 20.5796 16.1686 20.5796 16.7612V19.0355L23.2678 17.5024V15.2295C23.2707 14.9343 23.1917 14.6441 23.0395 14.3911C22.8873 14.1381 22.6679 13.9324 22.4056 13.7968L16.6719 10.5353C16.1645 10.2382 15.5059 10.2382 14.9476 10.5353L9.11214 13.7968C8.84992 13.9324 8.63049 14.1381 8.47828 14.3911C8.32607 14.6441 8.24705 14.9343 8.25002 15.2295V21.802C8.25002 22.396 8.55389 22.9391 9.11214 23.2361L14.9476 26.4976C15.455 26.7932 16.115 26.7932 16.6719 26.4976L20.6305 24.2729L23.3186 22.7411L27.2773 20.5177C27.7846 20.2207 28.4433 20.2207 29.0015 20.5177L32.0966 22.2475C32.6054 22.5431 32.9588 23.0863 32.9588 23.6803V27.1893C32.9588 27.7819 32.6563 28.325 32.0966 28.622L29.0029 30.4013C28.4941 30.6983 27.8341 30.6983 27.2773 30.4013L24.1821 28.6715C23.6734 28.3745 23.3186 27.8314 23.3186 27.2387V24.9645L20.6305 26.4976V28.7705C20.6305 29.3631 20.9344 29.9076 21.4926 30.2032L27.3281 33.4647C27.8355 33.7617 28.4941 33.7617 29.0524 33.4647L34.8879 30.2032C35.3953 29.9076 35.75 29.3645 35.75 28.7705V22.198C35.753 21.9028 35.674 21.6126 35.5218 21.3596C35.3695 21.1066 35.1501 20.9009 34.8879 20.7653L29.0029 17.4529H29.0015Z",fill:"white"})}),Optimism=({testnet:o,...et})=>jsxRuntimeExports.jsxs("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#FF0420"},children:[jsxRuntimeExports.jsx("path",{d:"M15.5877 27.8473C14.2777 27.8473 13.2045 27.539 12.3679 26.9226C11.5422 26.2952 11.1294 25.4035 11.1294 24.2477C11.1294 24.0055 11.157 23.7082 11.212 23.356C11.3552 22.5634 11.5588 21.6112 11.823 20.4994C12.5715 17.4722 14.5034 15.9586 17.6187 15.9586C18.4664 15.9586 19.2259 16.1017 19.8974 16.3879C20.5689 16.663 21.0973 17.0814 21.4826 17.6428C21.8678 18.1932 22.0605 18.8537 22.0605 19.6242C22.0605 19.8554 22.033 20.1471 21.9779 20.4994C21.8128 21.4791 21.6146 22.4313 21.3835 23.356C20.9982 24.8641 20.3322 25.9924 19.3855 26.741C18.4388 27.4785 17.1729 27.8473 15.5877 27.8473ZM15.8189 25.4695C16.4354 25.4695 16.9582 25.2879 17.3876 24.9247C17.8279 24.5614 18.1416 24.0055 18.3287 23.257C18.5819 22.2222 18.7746 21.3195 18.9067 20.5489C18.9507 20.3178 18.9727 20.0811 18.9727 19.8389C18.9727 18.8372 18.4498 18.3363 17.4041 18.3363C16.7876 18.3363 16.2592 18.5179 15.8189 18.8812C15.3896 19.2445 15.0813 19.8004 14.8943 20.5489C14.6961 21.2865 14.4979 22.1892 14.2998 23.257C14.2557 23.477 14.2337 23.7082 14.2337 23.9504C14.2337 24.9632 14.7622 25.4695 15.8189 25.4695Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M22.8188 27.6815C22.6977 27.6815 22.6041 27.6429 22.5381 27.5659C22.483 27.4778 22.4665 27.3788 22.4885 27.2687L24.7672 16.5358C24.7892 16.4147 24.8498 16.3156 24.9489 16.2385C25.0479 16.1615 25.1525 16.1229 25.2626 16.1229H29.6548C30.8767 16.1229 31.8564 16.3761 32.5939 16.8825C33.3426 17.3889 33.7168 18.1209 33.7168 19.0786C33.7168 19.3538 33.6838 19.64 33.6177 19.9372C33.3426 21.2032 32.7867 22.1389 31.95 22.7443C31.1244 23.3498 29.9905 23.6525 28.5485 23.6525H26.3194L25.5598 27.2687C25.5377 27.3898 25.4772 27.4888 25.3782 27.5659C25.2791 27.6429 25.1745 27.6815 25.0645 27.6815H22.8188ZM28.6641 21.3738C29.1264 21.3738 29.5282 21.2472 29.8695 20.994C30.2217 20.7408 30.4529 20.3776 30.563 19.9042C30.596 19.717 30.6125 19.552 30.6125 19.4089C30.6125 19.0896 30.519 18.8474 30.3318 18.6823C30.1446 18.5062 29.8255 18.4182 29.3741 18.4182H27.3926L26.7652 21.3738H28.6641Z",fill:"white"})]}),Arbitrum=({testnet:o,...et})=>{const tt=o?"#ffffff":"#28A0F0",nt=o?"#ffffff":"#96BEDC";return jsxRuntimeExports.jsxs("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#2C364F"},children:[!o&&jsxRuntimeExports.jsx("path",{d:"M25.7948 20.5826L28.2683 16.3854L34.9355 26.7696L34.9386 28.7625L34.9168 15.0491C34.9011 14.7137 34.7231 14.407 34.4391 14.2261L22.4357 7.32182C22.1551 7.1838 21.7989 7.18546 21.5187 7.32618C21.4807 7.34524 21.4453 7.36576 21.4113 7.38835L21.3694 7.41467L9.71816 14.1664L9.67298 14.1871C9.61474 14.2137 9.55609 14.2479 9.50076 14.2872C9.27983 14.4456 9.1331 14.68 9.08564 14.9425C9.07859 14.9823 9.0732 15.023 9.07092 15.064L9.08916 26.239L15.2994 16.6138C16.0811 15.3376 17.7847 14.9262 19.3662 14.9488L21.2221 14.9977L10.2862 32.5356L11.5753 33.2778L22.6422 15.0155L27.5338 14.9977L16.4956 33.7209L21.0955 36.3668L21.6451 36.6827C21.8776 36.7772 22.1516 36.7819 22.386 36.6972L34.5581 29.6433L32.2309 30.9918L25.7948 20.5826ZM26.7384 34.175L22.0925 26.8829L24.9287 22.0702L31.0303 31.6876L26.7384 34.175Z",fill:"#2D374B"}),jsxRuntimeExports.jsx("path",{d:"M22.0924 26.8832L26.7385 34.1751L31.0302 31.6879L24.9286 22.0705L22.0924 26.8832Z",fill:tt}),jsxRuntimeExports.jsx("path",{d:"M34.9387 28.7627L34.9356 26.7698L28.2684 16.3856L25.7949 20.5828L32.2312 30.992L34.5584 29.6435C34.7866 29.4582 34.9248 29.1861 34.9393 28.8926L34.9387 28.7627Z",fill:tt}),jsxRuntimeExports.jsx("path",{d:"M7 30.642L10.2863 32.5356L21.2222 14.9976L19.3663 14.9487C17.785 14.9263 16.0814 15.3375 15.2995 16.6137L9.08927 26.239L7 29.449V30.642V30.642Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M27.534 14.9977L22.6423 15.0155L11.5754 33.2778L15.4437 35.5049L16.4955 33.7209L27.534 14.9977Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M37 14.9723C36.9592 13.9493 36.4052 13.013 35.5377 12.4677L23.377 5.47434C22.5187 5.04223 21.4466 5.04161 20.5868 5.47414C20.4852 5.52533 8.76078 12.3251 8.76078 12.3251C8.5985 12.4029 8.44224 12.4955 8.2953 12.6008C7.52081 13.156 7.0487 14.0186 7 14.9661V29.4492L9.08927 26.2392L9.07103 15.0639C9.07352 15.0231 9.0787 14.9827 9.08575 14.9431C9.133 14.6801 9.27994 14.4457 9.50086 14.2872C9.5562 14.2478 21.4806 7.34517 21.5186 7.32611C21.799 7.18538 22.155 7.18373 22.4356 7.32175L34.439 14.226C34.723 14.4069 34.901 14.7137 34.9167 15.049V28.8921C34.9022 29.1856 34.7862 29.4577 34.558 29.643L32.2308 30.9916L31.03 31.6875L26.7383 34.1747L22.3859 36.6969C22.1515 36.7817 21.8773 36.7769 21.645 36.6824L16.4955 33.7206L15.4435 35.5046L20.0713 38.169C20.2243 38.256 20.3607 38.3331 20.4726 38.3961C20.6458 38.4933 20.764 38.5582 20.8056 38.5785C21.1345 38.7383 21.6077 38.8311 22.0342 38.8311C22.4251 38.8311 22.8064 38.7594 23.1672 38.6181L35.8092 31.2971C36.5347 30.7348 36.9617 29.8869 37 28.9686V14.9723Z",fill:nt})]})},Telos=({testnet:o,...et})=>jsxRuntimeExports.jsx("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#571AFF"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.1834 8.14754C25.6606 8.23504 25.3644 8.50235 24.9216 9.28591C24.5651 9.91722 24.4762 10.0244 24.2024 10.1592L23.9832 10.2668L19.2967 10.286L14.6097 10.3057L14.3875 10.3902C13.7059 10.6492 13.6192 10.7135 11.6291 12.4407C9.72243 14.0953 9.64893 14.1723 9.59249 14.5836C9.54437 14.9362 9.78981 15.6327 10.5191 17.2143C11.2847 18.8737 11.2839 18.8641 10.7444 19.5256C10.2645 20.1136 10.2269 20.2588 10.2041 21.5915C10.1717 23.502 10.2487 27.6023 10.3222 27.8591C10.3572 27.9816 10.7908 29.204 11.2861 30.5755C11.7813 31.9471 12.4192 33.715 12.704 34.5038C13.4281 36.5107 13.4814 36.5986 14.0392 36.7237C14.3066 36.7837 14.3206 36.781 18.9677 35.7258C24.4395 34.4837 23.7264 34.709 25.0739 33.7968C29.8732 30.5475 29.7337 30.66 29.8969 29.9083C30.0583 29.1642 30.1082 29.1379 31.8267 28.8999C34.6122 28.5145 34.6328 28.5083 34.8831 28.0109C35.0182 27.7423 35.7786 23.3406 35.8136 22.6209C35.8504 21.8828 36.042 22.221 33.3816 18.3395C30.022 13.4382 30.2381 13.7777 30.2399 13.4041C30.2407 13.1735 30.3366 12.9736 31.3236 11.1418C31.8236 10.2134 32.2742 9.35241 32.3254 9.22904C32.5236 8.74691 32.4204 8.3921 32.0301 8.21622L31.8267 8.12391L29.1102 8.11822C27.6048 8.11516 26.2997 8.12829 26.1834 8.14754ZM30.0474 9.4876C30.5623 9.72297 30.5382 9.82447 29.5119 11.7398C28.4317 13.7558 28.3157 13.2711 30.7154 16.7707C31.639 18.1173 32.8076 19.8218 33.3124 20.5581C34.6844 22.5592 34.6048 22.1799 34.1831 24.6903C33.7858 27.0602 33.7792 27.0817 33.3759 27.282C33.1506 27.394 33.2276 27.3813 30.8493 27.7117C28.9147 27.9803 28.8543 28.017 28.6719 29.0338C28.5778 29.557 28.4606 29.8169 28.2243 30.0247C28.0808 30.1512 24.8682 32.368 23.9451 32.9778C23.2587 33.4311 23.6861 33.3152 17.7471 34.6574C17.1997 34.7812 16.4079 34.9632 15.987 35.0617C14.4588 35.4195 14.4299 35.4033 13.8804 33.8948C12.9188 31.2528 11.6811 27.7957 11.6194 27.5787C11.5534 27.3463 11.549 27.1202 11.549 24.059V20.7878L11.6501 20.5966C11.7056 20.4912 11.8671 20.2759 12.0088 20.118C12.8418 19.19 12.8383 19.1183 11.8601 16.9907C10.7663 14.612 10.6797 14.9992 12.697 13.2501C14.2418 11.91 14.3048 11.8593 14.5905 11.7237L14.8394 11.6055L19.6983 11.5854C23.5417 11.5692 24.5891 11.5543 24.7103 11.515C25.1465 11.3728 25.4086 11.1094 25.7975 10.4203C26.3851 9.38041 26.3111 9.40797 28.4597 9.41891C29.6996 9.42547 29.9332 9.43554 30.0474 9.4876Z",fill:"#F7F5FC"})}),Aurora=({testnet:o,...et})=>jsxRuntimeExports.jsx("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#6CD544"},children:jsxRuntimeExports.jsx("path",{d:"M22.0006 7.292C22.6198 7.29004 23.2271 7.46144 23.754 7.7868C24.2808 8.11216 24.706 8.57848 24.9816 9.133L34.3566 27.883C34.611 28.3912 34.7312 28.956 34.7058 29.5238C34.6805 30.0915 34.5103 30.6433 34.2116 31.1268C33.9129 31.6103 33.4956 32.0094 32.9992 32.2861C32.5028 32.5629 31.9439 32.7081 31.3756 32.708H12.6256C12.0573 32.7079 11.4985 32.5626 11.0023 32.2858C10.506 32.009 10.0888 31.6099 9.79022 31.1264C9.49163 30.6429 9.3216 30.0912 9.29628 29.5235C9.27096 28.9558 9.39119 28.3911 9.64556 27.883L19.0196 9.133C19.2951 8.57848 19.7203 8.11216 20.2472 7.7868C20.774 7.46144 21.3814 7.29004 22.0006 7.292ZM22.0006 5C20.9561 4.9999 19.9322 5.29059 19.0437 5.83952C18.1551 6.38846 17.4369 7.17394 16.9696 8.108L7.59456 26.858C7.16544 27.7156 6.96271 28.6687 7.00564 29.6268C7.04856 30.5848 7.33572 31.516 7.83982 32.3318C8.34392 33.1476 9.04823 33.821 9.88584 34.288C10.7235 34.755 11.6666 35.0001 12.6256 35H31.3756C32.3345 34.9999 33.2775 34.7547 34.1149 34.2876C34.9524 33.8206 35.6566 33.1472 36.1606 32.3314C36.6645 31.5156 36.9516 30.5845 36.9945 29.6265C37.0374 28.6686 36.8346 27.7156 36.4056 26.858L27.0316 8.108C26.5642 7.17394 25.846 6.38846 24.9574 5.83952C24.0689 5.29059 23.045 4.9999 22.0006 5Z",fill:"white"})}),Avalanche=({testnet:o,...et})=>jsxRuntimeExports.jsxs("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#E84142"},children:[jsxRuntimeExports.jsx("path",{d:"M11.0188 32.1528H15.4825C16.5334 32.1528 17.0589 32.1528 17.5278 32.023C18.042 31.8701 18.511 31.5991 18.9009 31.2261C19.2589 30.885 19.5173 30.4328 20.0269 29.5409L20.0272 29.5404L20.0422 29.5142L25.8314 19.2804C26.3456 18.3821 26.5999 17.93 26.7129 17.4554C26.8372 16.9412 26.8372 16.3988 26.7129 15.8847C26.6007 15.4136 26.3439 14.9648 25.8373 14.0798L25.8258 14.0597L23.56 10.1045C23.0911 9.27958 22.8538 8.86711 22.5543 8.71456C22.2323 8.55071 21.848 8.55071 21.526 8.71456C21.2265 8.86711 20.9892 9.27958 20.5202 10.1045L9.49892 29.5311C9.03561 30.3447 8.80392 30.7517 8.82089 31.0849C8.84349 31.4466 9.02994 31.7743 9.33507 31.9721C9.61756 32.1528 10.0809 32.1528 11.0188 32.1528Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M33.1506 32.1528H26.7547C25.8111 32.1528 25.3365 32.1528 25.0596 31.9721C24.7545 31.7743 24.5681 31.4411 24.5455 31.0794C24.5286 30.7486 24.7621 30.3456 25.2294 29.539L25.2295 29.5388L25.2404 29.5199L28.4328 24.0392C28.9018 23.2313 29.1391 22.8301 29.4329 22.6776C29.7548 22.5137 30.1336 22.5137 30.4555 22.6776C30.7472 22.8261 30.9744 23.2102 31.4241 23.9708L31.4248 23.9719L31.4613 24.0336L34.665 29.5143C34.6806 29.5413 34.696 29.5678 34.7113 29.5939L34.7113 29.594C35.1554 30.3603 35.382 30.7514 35.3657 31.0739C35.3486 31.4353 35.1566 31.7688 34.8515 31.9666C34.5689 32.1528 34.0942 32.1528 33.1506 32.1528Z",fill:"white"})]}),Celo=({testnet:o,...et})=>jsxRuntimeExports.jsx("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#FCFE72"},children:jsxRuntimeExports.jsx("path",{d:"M9 9H34.5183V18.112H30.3564C28.896 14.7687 25.6102 12.4171 21.777 12.4171C16.593 12.4171 12.3948 16.6422 12.3948 21.823C12.3948 27.0039 16.593 31.2654 21.777 31.2654C25.5373 31.2654 28.8231 28.9876 30.2829 25.7172H34.5178V34.682H9V9Z",fill:o?"#ffffff":"black"})}),Gnosis=({testnet:o,...et})=>jsxRuntimeExports.jsx("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#009CB4"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3439 11.8664C17.9374 6.53462 26.7953 6.74397 32.1271 12.3374C32.4738 12.7038 32.8075 13.0832 33.1084 13.4823L22 24.5972L10.8916 13.4823C11.1991 13.0832 11.5262 12.7038 11.8729 12.3374C12.0234 12.1804 12.1804 12.0234 12.3439 11.8664ZM30.6094 13.3972C28.3196 11.0944 25.271 9.83182 22 9.83182C18.729 9.83182 15.6804 11.0944 13.3907 13.3972L22 22.0066L30.6094 13.3972ZM33.9785 14.7446L31.7215 17.0016C33.5402 19.1801 33.2523 22.425 31.0738 24.2437C29.1636 25.84 26.3897 25.84 24.4794 24.2437L22 26.7231L19.5271 24.2502C17.3486 26.0689 14.1037 25.7811 12.285 23.6026C10.6888 21.6923 10.6888 18.9185 12.285 17.0082L11.1271 15.8502L10.028 14.7446C8.7 16.9297 8 19.4418 8 21.9998C8 29.7325 14.2673 35.9998 22 35.9998C29.7327 35.9998 36 29.7325 36 21.9998C36.0065 19.4418 35.3 16.9297 33.9785 14.7446ZM30.6486 18.0747C31.1392 18.7093 31.4075 19.4943 31.4075 20.299C31.4075 21.1037 31.1392 21.8887 30.6486 22.5233C29.4187 24.113 27.1355 24.4074 25.5458 23.1775L30.6486 18.0747ZM18.4542 23.1839C17.8196 23.6745 17.0346 23.9427 16.2299 23.9427C15.4252 23.9427 14.6467 23.6745 14.0056 23.1904C12.4159 21.9605 12.1215 19.6708 13.3514 18.0811L18.4542 23.1839Z",fill:"white"})}),Evmos=({testnet:o,...et})=>jsxRuntimeExports.jsx("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#2D2A25"},children:jsxRuntimeExports.jsx("path",{d:"M18.4916 12.6668C12.9416 14.806 12.4332 20.2846 10.8418 22.8432C9.23155 25.4322 5.54251 26.8607 6.04698 28.1801C6.55143 29.4994 10.2449 28.0824 13.1669 28.9242C16.0543 29.7561 20.0831 33.4862 25.633 31.3469C28.4603 30.2573 30.5076 28.0143 31.449 25.3574C31.5502 25.0723 31.361 24.7673 31.0606 24.7391C30.874 24.7215 30.6948 24.8196 30.6106 24.9877C29.759 26.6908 28.2981 28.0934 26.3864 28.8301C23.2303 30.0465 19.777 29.0915 17.6562 26.6961C17.1746 26.1522 16.7626 25.533 16.4374 24.8487C16.348 24.6603 16.2629 24.4689 16.1875 24.2708C16.1117 24.0728 16.0473 23.8735 15.9881 23.6732C17.6562 22.8925 19.5812 22.0656 21.7635 21.2246C23.903 20.3999 25.8505 19.731 27.5841 19.1958C28.7571 18.8341 29.8322 18.5331 30.8029 18.2871C30.8732 18.2695 30.9423 18.2519 31.0112 18.2347C31.158 18.1982 31.3088 18.2769 31.363 18.4186L31.364 18.4213C31.396 18.5053 31.4236 18.5898 31.4535 18.6743C31.6453 19.2196 31.7892 19.7706 31.8841 20.3229C31.9258 20.5645 32.1888 20.6961 32.4044 20.5799C33.2014 20.1504 33.9302 19.7314 34.5814 19.3283C37.0083 17.8276 38.3538 16.5549 38.0776 15.8336C37.802 15.1119 35.9541 15.0705 33.1503 15.5854C32.2593 15.7491 31.2716 15.9691 30.207 16.2416C30.0229 16.2886 29.8365 16.3375 29.6481 16.3877C28.7522 16.6262 27.8073 16.8995 26.8234 17.2053C24.9936 17.7744 23.0305 18.4561 21.0038 19.2372C19.1078 19.9682 17.3109 20.726 15.6629 21.4812C15.6428 18.2761 17.5725 15.2461 20.7286 14.0297C22.6399 13.293 24.6605 13.3533 26.4285 14.0473C26.6029 14.116 26.8015 14.0684 26.9291 13.9298C27.1331 13.7076 27.0706 13.3537 26.8053 13.2094C24.3353 11.8685 21.319 11.5771 18.4916 12.6668Z",fill:"#FAF1E4"})}),BinanceSmartChain=({testnet:o,...et})=>jsxRuntimeExports.jsxs("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#16181A"},children:[jsxRuntimeExports.jsx("path",{d:"M16.0445 19.6063L21.8705 13.7805L27.6996 19.6093L31.0896 16.2193L21.8705 7L12.6545 16.2163L16.0445 19.6063Z",fill:o?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M13.6505 21.9995L10.2606 18.6096L6.87046 21.9997L10.2604 25.3896L13.6505 21.9995Z",fill:o?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M16.0445 24.3937L21.8705 30.2195L27.6994 24.3909L31.0913 27.779L31.0896 27.7809L21.8705 37L12.6542 27.7839L12.6495 27.7792L16.0445 24.3937Z",fill:o?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M33.4808 25.3911L36.8709 22.001L33.481 18.6111L30.0909 22.0012L33.4808 25.3911Z",fill:o?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M25.3091 21.9982H25.3105L21.8705 18.5582L19.3283 21.1004H19.3281L19.0362 21.3926L18.4336 21.9951L18.4289 21.9999L18.4336 22.0048L21.8705 25.4418L25.3105 22.0018L25.3122 21.9999L25.3091 21.9982Z",fill:o?"#fff":"#F3BA2F"})]}),Canto=({testnet:o,...et})=>jsxRuntimeExports.jsx("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"white"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35 8V36H9L13.875 35.9998V31.0586H9V12.9412H13.875V8H35ZM17.9373 12.9414H30.1247V17.8826H17.9373V12.9414ZM30.1247 26.9414H17.9373V17.8826L13.0623 17.8828V26.9416L17.9373 26.9414V31.8826H30.1247V26.9414Z",fill:"#06FC99"})}),Fantom=({testnet:o,...et})=>jsxRuntimeExports.jsx("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#0911EF"},children:jsxRuntimeExports.jsx("path",{d:"M20.92 9.25864C21.5933 8.91379 22.6178 8.91379 23.2911 9.25864L30.1616 12.7775C30.5671 12.9852 30.7898 13.2947 30.8297 13.6142H30.8363V31.302C30.8274 31.6504 30.6025 31.9966 30.1616 32.2225L23.2911 35.7413C22.6178 36.0862 21.5933 36.0862 20.92 35.7413L14.0495 32.2225C13.6104 31.9976 13.3997 31.6489 13.3893 31.302C13.3883 31.2678 13.3881 31.2393 13.3891 31.2157L13.3891 13.7278C13.3884 13.7086 13.3883 13.6895 13.3889 13.6705L13.3893 13.6142L13.3924 13.6142C13.4229 13.2912 13.6355 12.9896 14.0495 12.7775L20.92 9.25864ZM29.7547 23.4821L23.2911 26.7926C22.6178 27.1374 21.5933 27.1374 20.92 26.7926L14.4706 23.4895V31.2669L20.92 34.5527C21.2842 34.7415 21.6622 34.9254 22.0318 34.9488L22.1056 34.9512C22.4907 34.9524 22.8646 34.7628 23.2438 34.5833L29.7547 31.2387V23.4821ZM11.3214 31.8437C11.3214 32.5212 11.4026 32.9667 11.5639 33.2806C11.6976 33.5407 11.8981 33.7394 12.2643 33.9813L12.2852 33.9951C12.3656 34.0476 12.4541 34.1026 12.5619 34.1672L12.689 34.2427L13.0792 34.4711L12.5195 35.3685L12.0827 35.1126L12.0093 35.0689C11.883 34.9932 11.7783 34.9284 11.6807 34.8645C10.637 34.1822 10.2478 33.4384 10.2401 31.8907L10.24 31.8437H11.3214ZM21.5647 18.7412C21.5147 18.7579 21.4678 18.7772 21.4251 18.7991L14.5546 22.318C14.5474 22.3216 14.5405 22.3253 14.534 22.3289L14.5281 22.3322L14.5389 22.3382L14.5546 22.3464L21.4251 25.8653C21.4678 25.8872 21.5147 25.9065 21.5647 25.9231V18.7412ZM22.6465 18.7412V25.9231C22.6965 25.9065 22.7433 25.8872 22.7861 25.8653L29.6566 22.3464C29.6638 22.3427 29.6707 22.3391 29.6772 22.3355L29.683 22.3322L29.6722 22.3262L29.6566 22.318L22.7861 18.7991C22.7433 18.7772 22.6965 18.7579 22.6465 18.7412ZM29.7547 14.8689L23.5915 18.0256L29.7547 21.1822V14.8689ZM14.4706 14.8763V21.1749L20.6195 18.0256L14.4706 14.8763ZM22.7861 10.1859C22.4288 10.0029 21.7824 10.0029 21.4251 10.1859L14.5546 13.7048C14.5474 13.7085 14.5405 13.7122 14.534 13.7158L14.5281 13.719L14.5389 13.725L14.5546 13.7333L21.4251 17.2522C21.7824 17.4352 22.4288 17.4352 22.7861 17.2522L29.6566 13.7333C29.6638 13.7296 29.6707 13.7259 29.6772 13.7223L29.683 13.719L29.6722 13.7131L29.6566 13.7048L22.7861 10.1859ZM31.7205 9.64552L32.1573 9.90132L32.2307 9.94503C32.357 10.0206 32.4616 10.0856 32.5593 10.1494C33.603 10.8317 33.9922 11.5756 33.9998 13.1231L34 13.1703H32.9186C32.9186 12.4926 32.8373 12.0472 32.6761 11.7334C32.5424 11.4733 32.3419 11.2745 31.9757 11.0327L31.9547 11.0189C31.8744 10.9664 31.7858 10.9113 31.6781 10.8466L31.551 10.7712L31.1608 10.5428L31.7205 9.64552Z",fill:"white"})}),Filecoin=({testnet:o,...et})=>jsxRuntimeExports.jsx("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#0090FF"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.75 19.3069L23.15 22.5069L28.85 23.3069L28.45 24.8069L22.85 24.0069C22.45 25.3069 22.25 26.7069 21.75 27.9069C21.25 29.3069 20.75 30.7069 20.15 32.0069C19.35 33.7069 17.95 34.9069 16.05 35.2069C14.95 35.4069 13.75 35.3069 12.85 34.6069C12.55 34.4069 12.25 34.0069 12.25 33.7069C12.25 33.3069 12.45 32.8069 12.75 32.6069C12.95 32.5069 13.45 32.6069 13.75 32.7069C14.05 33.0069 14.35 33.4069 14.55 33.8069C15.15 34.6069 15.95 34.7069 16.75 34.1069C17.65 33.3069 18.15 32.2069 18.45 31.1069C19.05 28.7069 19.65 26.4069 20.15 24.0069V23.6069L14.85 22.8069L15.05 21.3069L20.55 22.1069L21.25 19.0069L15.55 18.1069L15.75 16.5069L21.65 17.3069C21.85 16.7069 21.95 16.2069 22.15 15.7069C22.65 13.9069 23.15 12.1069 24.35 10.5069C25.55 8.90687 26.95 7.90687 29.05 8.00687C29.95 8.00687 30.85 8.30687 31.45 9.00687C31.55 9.10687 31.75 9.30687 31.75 9.50687C31.75 9.90687 31.75 10.4069 31.45 10.7069C31.05 11.0069 30.55 10.9069 30.15 10.5069C29.85 10.2069 29.65 9.90687 29.35 9.60687C28.75 8.80687 27.85 8.70687 27.15 9.40687C26.65 9.90687 26.15 10.6069 25.85 11.3069C25.15 13.4069 24.65 15.6069 23.95 17.8069L29.45 18.6069L29.05 20.1069L23.75 19.3069Z",fill:"white"})}),IoTeX=({testnet:o,...et})=>jsxRuntimeExports.jsxs("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#00D4D5"},children:[jsxRuntimeExports.jsx("path",{d:"M23.7136 6.875V14.3784L30.2284 10.6315L23.7136 6.875Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M30.2284 10.6316V18.135L36.7418 14.3785L30.2284 10.6316Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.8",d:"M23.7136 14.3784V21.8818L30.2284 18.1349L23.7136 14.3784ZM30.2284 18.1349V25.6383L36.7417 21.8818L30.2284 18.1349Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.8",d:"M23.7136 21.8817V29.385L30.2284 25.6382L23.7136 21.8817Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M30.2284 25.6382V33.1416L36.7418 29.3851L30.2284 25.6382Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.4",d:"M6.87537 14.1253V21.6287L13.3901 17.8722L6.87537 14.1253Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.2",d:"M15.0938 16.9153V24.4186L21.5975 20.6718L15.0938 16.9153Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.3",d:"M10.2648 21.6604V29.1638L16.7781 25.4073L10.2648 21.6604Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M14.5575 27.3226V34.826L21.0612 31.0695L14.5575 27.3226Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.7",d:"M23.66 30.5525V38.0572L30.1637 34.2993L23.66 30.5525Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M16.1786 13.2097V20.7145L22.6824 16.9676L16.1786 13.2097Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.8",d:"M23.7136 6.875V14.3784L17.1989 10.6315L23.7136 6.875Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.6",d:"M16.1786 10.0649V17.5669L9.66248 13.8104L16.1786 10.0649Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.6",d:"M22.6934 13.7775V21.2823L16.1786 17.5244L22.6934 13.7775Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.95",d:"M15.0635 16.9153V24.4186L8.54877 20.6718L15.0635 16.9153Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.6",d:"M23.7136 21.8817V29.385L17.2099 25.6382L23.7136 21.8817Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.55",d:"M10.2648 23.6295V31.1328L3.75 27.375L10.2648 23.6295Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M36.7418 14.3784V21.8818L30.2284 18.1349L36.7418 14.3784Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.95",d:"M30.2284 18.1362V25.6382L23.7136 21.8817L30.2284 18.1362Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M36.7418 21.8817V29.385L30.2284 25.6382L36.7418 21.8817Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.7",d:"M30.2284 25.6382V33.1416L23.7136 29.3851L30.2284 25.6382Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.4",d:"M22.2712 28.7651V36.2684L15.7579 32.5216L22.2712 28.7651Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M30.2284 10.6316V18.135L23.7136 14.3785L30.2284 10.6316Z",fill:"white"})]}),Metis=({testnet:o,...et})=>jsxRuntimeExports.jsx("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:o?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#2F3140"},children:jsxRuntimeExports.jsx("path",{d:"M37.5175 22.0531C37.4579 19.2923 36.6563 16.5985 35.1968 14.2542C33.7374 11.91 31.674 10.0017 29.223 8.72965C26.772 7.45759 24.0238 6.86863 21.2668 7.02455C18.5098 7.18047 15.8456 8.07553 13.5537 9.61582C11.2617 11.1561 9.42659 13.2849 8.24079 15.7787C7.05498 18.2725 6.56222 21.0396 6.81419 23.7895C7.06617 26.5394 8.05359 29.1708 9.67288 31.4076C11.2922 33.6444 13.4836 35.4042 16.0173 36.5023C16.7657 35.3775 17.3385 34.1453 17.716 32.848C18.0245 32.0632 18.3595 31.2913 18.7067 30.5446C19.5444 30.7955 20.4345 30.8143 21.282 30.5989C22.1295 30.3835 22.9026 29.942 23.5188 29.3215L23.5704 29.2699C22.8136 28.9884 21.9979 28.9032 21.1993 29.022C20.4006 29.1408 19.6451 29.4598 19.0029 29.9494C19.4276 29.0613 19.891 28.1997 20.3667 27.3632C21.189 27.6541 22.075 27.7156 22.9296 27.541C23.7842 27.3665 24.5751 26.9626 25.2175 26.3726L25.2692 26.3209C24.538 26.0116 23.7416 25.8885 22.9513 25.9626C22.1609 26.0368 21.4013 26.3058 20.7404 26.7456C21.216 25.9608 21.7053 25.1889 22.2203 24.468C23.0713 24.6915 23.9672 24.6777 24.811 24.4282C25.6547 24.1787 26.414 23.703 27.0066 23.0526L27.0453 23.001C26.3425 22.7718 25.5958 22.7106 24.8651 22.8224C24.1344 22.9341 23.4401 23.2157 22.838 23.6444C22.8767 23.5928 22.9283 23.5289 22.9664 23.4773C23.2749 23.0784 23.5969 22.6796 23.9177 22.2936C24.8969 21.9731 25.7703 21.3916 26.4436 20.6117C27.117 19.8318 27.5649 18.883 27.7391 17.8674L27.752 17.79H27.7391C26.7194 18.0552 25.7944 18.6007 25.0689 19.3648C24.3434 20.1288 23.8464 21.0808 23.6343 22.1129C23.3258 22.4859 23.0167 22.8603 22.7211 23.2449C22.9706 22.5925 23.0724 21.893 23.0191 21.1966C22.9657 20.5002 22.7586 19.8243 22.4126 19.2176L22.3739 19.2692C21.8489 19.9862 21.5326 20.8345 21.4599 21.7201C21.3873 22.6058 21.5611 23.4942 21.9621 24.2872C21.4729 24.9823 20.9972 25.6897 20.5467 26.4357C20.6918 25.6858 20.6542 24.9118 20.4369 24.1795C20.2196 23.4471 19.8291 22.7779 19.2985 22.2284L19.2727 22.2929C18.9445 23.1107 18.8477 24.0031 18.9929 24.8723C19.1382 25.7415 19.5199 26.5539 20.0962 27.2205C19.6457 28.0054 19.2211 28.816 18.8093 29.6524C18.9344 28.8712 18.8712 28.0715 18.6251 27.3196C18.3789 26.5677 17.9568 25.8855 17.3939 25.3295L17.3681 25.3941C17.0745 26.2514 17.0201 27.1724 17.2105 28.0583C17.401 28.9442 17.8292 29.7614 18.4492 30.4223C18.1774 31.0012 17.9219 31.5774 17.6773 32.1849C17.61 32.1231 17.5313 32.0751 17.4456 32.0435C17.0066 31.916 16.5867 31.7299 16.1974 31.4904C15.8754 31.2994 15.5337 31.144 15.1781 31.027C13.7886 30.5765 13.9945 29.9079 13.2756 28.5564C13.0416 28.2781 12.7931 28.0125 12.5309 27.7607C12.2876 27.603 12.0884 27.386 11.9519 27.1302C11.7934 26.8107 11.6931 26.4656 11.6557 26.1109C11.6514 25.9148 11.5858 25.7249 11.4681 25.5679C11.3504 25.4109 11.1864 25.2948 10.9993 25.2358C8.95338 24.5284 9.86728 21.8778 9.94406 21.5299C9.91262 21.08 9.81271 20.6375 9.64781 20.2178C9.63057 20.1632 9.61763 20.1073 9.60908 20.0506C9.55449 19.776 9.56444 19.4924 9.63813 19.2223C9.71183 18.9521 9.84726 18.7028 10.0338 18.4939C10.2784 18.2493 11.1277 17.8505 11.3078 17.6188C11.4879 17.387 11.6163 17.1295 11.797 16.9114C12.3687 16.3412 13.0291 15.8675 13.7526 15.509C14.3444 15.1876 14.4477 14.364 14.6787 14.1065C15.0647 13.6689 15.6565 13.6689 16.0941 13.283C16.3129 13.09 16.6377 12.9867 16.8415 12.7815C17.8692 11.8403 19.1644 11.2423 20.5474 11.0706C21.5064 10.9924 22.4717 11.0795 23.4012 11.3281C23.5358 11.3507 23.669 11.3809 23.8001 11.4185C25.9228 11.4959 28.4709 11.9328 29.397 12.8338C29.8555 13.2744 30.1961 13.8229 30.3877 14.4293C30.5382 14.8988 30.7456 15.3481 31.0054 15.7672L31.5714 16.6933C31.932 17.2773 32.0475 17.9801 31.8928 18.6489C31.7885 18.974 31.7795 19.3223 31.8669 19.6525C32.1655 20.1031 32.5152 20.5177 32.9093 20.8878C33.0658 21.0427 33.2382 21.1807 33.4236 21.2995C33.8592 21.5594 34.2802 21.8429 34.6848 22.1489C34.698 22.2729 34.6775 22.3982 34.6254 22.5115C34.5732 22.6247 34.4914 22.7218 34.3885 22.7924C34.0284 23.1137 33.3333 23.6159 33.3333 23.6159C33.3584 23.758 33.4016 23.8964 33.4617 24.0276C33.5643 24.2077 33.796 24.4911 33.7192 24.735C33.6424 24.9789 33.1403 25.1855 33.2816 25.4552C33.423 25.7386 33.7831 25.8154 33.6805 26.0729C33.5779 26.3175 33.0757 26.7524 33.1274 26.9352C33.179 27.1179 33.5908 28.8377 32.6382 29.1353C31.4592 29.3685 30.2627 29.5019 29.0614 29.5342C28.8675 29.5454 28.6797 29.6055 28.5155 29.709C28.3513 29.8125 28.216 29.956 28.1223 30.126C27.9399 30.4661 27.8222 30.837 27.7751 31.22C27.4275 32.5896 26.9671 33.928 26.3985 35.2215C26.3985 35.2215 26.3597 35.2989 26.3081 35.4144C26.1833 35.6687 26.1048 35.9432 26.0764 36.2251C26.1573 36.4321 26.2799 36.6204 26.4365 36.7782C26.519 36.8726 26.6271 36.9411 26.7477 36.9753C26.8683 37.0096 26.9962 37.0081 27.116 36.9711C30.1997 35.8965 32.8655 33.8757 34.7332 31.197C36.601 28.5182 37.5754 25.3182 37.5175 22.0531Z",fill:o?"#ffffff":"#00DACC"})});var Chains={UnknownChain,Ethereum,Polygon,Optimism,Arbitrum,Aurora,Avalanche,Celo,Telos,Gnosis,Evmos,BinanceSmartChain,Foundry:KnownChain,Sepolia:KnownChain,Taraxa:KnownChain,zkSync:KnownChain,Flare:KnownChain,Canto,Fantom,Filecoin,Metis,IoTeX};const chainConfigs=[{id:1,name:"Ethereum",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{}),rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]}}},{id:3,name:"Rinkeby",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0}),rpcUrls:{}},{id:4,name:"Ropsten",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:5,name:"Görli",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:42,name:"Kovan",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:10,name:"Optimism",logo:jsxRuntimeExports.jsx(Chains.Optimism,{})},{id:69,name:"Optimism Kovan",logo:jsxRuntimeExports.jsx(Chains.Optimism,{testnet:!0})},{id:420,name:"Optimism Goerli",logo:jsxRuntimeExports.jsx(Chains.Optimism,{testnet:!0})},{id:137,name:"Polygon",logo:jsxRuntimeExports.jsx(Chains.Polygon,{})},{id:80001,name:"Polygon Mumbai",logo:jsxRuntimeExports.jsx(Chains.Polygon,{testnet:!0})},{id:31337,name:"Hardhat",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:1337,name:"Localhost",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:42161,name:"Arbitrum",logo:jsxRuntimeExports.jsx(Chains.Arbitrum,{}),rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]}}},{id:421611,name:"Arbitrum Rinkeby",logo:jsxRuntimeExports.jsx(Chains.Arbitrum,{testnet:!0})},{id:421613,name:"Arbitrum Goerli",logo:jsxRuntimeExports.jsx(Chains.Arbitrum,{testnet:!0}),rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]}}},{id:40,name:"Telos",logo:jsxRuntimeExports.jsx(Chains.Telos,{})},{id:41,name:"Telos Testnet",logo:jsxRuntimeExports.jsx(Chains.Telos,{testnet:!0})},{id:1313161554,name:"Aurora",logo:jsxRuntimeExports.jsx(Chains.Aurora,{})},{id:1313161555,name:"Aurora Testnet",logo:jsxRuntimeExports.jsx(Chains.Aurora,{testnet:!0})},{id:43114,name:"Avalanche",logo:jsxRuntimeExports.jsx(Chains.Avalanche,{})},{id:43113,name:"Avalanche Fuji",logo:jsxRuntimeExports.jsx(Chains.Avalanche,{testnet:!0})},{id:31337,name:"Foundry",logo:jsxRuntimeExports.jsx(Chains.Foundry,{testnet:!0})},{id:100,name:"Gnosis",logo:jsxRuntimeExports.jsx(Chains.Gnosis,{})},{id:9001,name:"Evmos",logo:jsxRuntimeExports.jsx(Chains.Evmos,{})},{id:9e3,name:"Evmos Testnet",logo:jsxRuntimeExports.jsx(Chains.Evmos,{testnet:!0})},{id:56,name:"BNB Smart Chain",logo:jsxRuntimeExports.jsx(Chains.BinanceSmartChain,{})},{id:97,name:"Binance Smart Chain Testnet",logo:jsxRuntimeExports.jsx(Chains.BinanceSmartChain,{testnet:!0})},{id:11155111,name:"Sepolia",logo:jsxRuntimeExports.jsx(Chains.Sepolia,{})},{id:841,name:"Taraxa",logo:jsxRuntimeExports.jsx(Chains.Taraxa,{})},{id:842,name:"Taraxa Testnet",logo:jsxRuntimeExports.jsx(Chains.Taraxa,{testnet:!0})},{id:324,name:"zkSync",logo:jsxRuntimeExports.jsx(Chains.zkSync,{})},{id:280,name:"zkSync Testnet",logo:jsxRuntimeExports.jsx(Chains.zkSync,{testnet:!0})},{id:42220,name:"Celo",logo:jsxRuntimeExports.jsx(Chains.Celo,{})},{id:44787,name:"Celo Alfajores",logo:jsxRuntimeExports.jsx(Chains.Celo,{testnet:!0})},{id:7700,name:"Canto",logo:jsxRuntimeExports.jsx(Chains.Canto,{})},{id:250,name:"Fantom",logo:jsxRuntimeExports.jsx(Chains.Fantom,{})},{id:4002,name:"Fantom Testnet",logo:jsxRuntimeExports.jsx(Chains.Fantom,{testnet:!0})},{id:14,name:"Flare",logo:jsxRuntimeExports.jsx(Chains.Flare,{})},{id:114,name:"Coston2",logo:jsxRuntimeExports.jsx(Chains.Flare,{})},{id:314,name:"Filecoin",logo:jsxRuntimeExports.jsx(Chains.Filecoin,{})},{id:3141,name:"Filecoin Hyperspace",logo:jsxRuntimeExports.jsx(Chains.Filecoin,{testnet:!0})},{id:314159,name:"Filecoin Calibration",logo:jsxRuntimeExports.jsx(Chains.Filecoin,{testnet:!0})},{id:1088,name:"Metis",logo:jsxRuntimeExports.jsx(Chains.Metis,{})},{id:599,name:"Metis Goerli",logo:jsxRuntimeExports.jsx(Chains.Metis,{testnet:!0})},{id:4689,name:"IoTeX",logo:jsxRuntimeExports.jsx(Chains.IoTeX,{})},{id:4690,name:"IoTeX Testnet",logo:jsxRuntimeExports.jsx(Chains.IoTeX,{testnet:!0})}],SwitchNetworksContainer=styled.div` + display: flex; + flex-direction: column; + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + flex-direction: column-reverse; + } +`,ChainIcon=styled(motion.div)` + display: block; + position: relative; + border-radius: 12px; + overflow: hidden; + width: 24px; + height: 24px; + min-width: 24px; + min-height: 24px; + background: var(--ck-body-background); + svg { + border-radius: inherit; + display: block; + position: relative; + transform: translate3d(0, 0, 0); + width: 100%; + height: auto; + } + ${o=>o.$empty&&Ae` + display: flex; + align-items: center; + justify-content: center; + &:before { + content: '?'; + color: var(--ck-body-color-muted); + font-weight: bold; + font-family: var(--ck-font-family); + } + `} + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + border-radius: 16px; + width: 32px; + height: 32px; + } +`,ChainLogoContainer=styled(motion.div)` + position: relative; +`,ChainLogoSpinner=styled(motion.div)` + position: absolute; + inset: -6px; + animation: rotateSpinner 1200ms linear infinite; + pointer-events: none; + svg { + display: block; + position: relative; + transform: translate3d(0, 0, 0); + width: 100%; + height: auto; + } + @keyframes rotateSpinner { + 0% { + transform: rotate(0deg); + } + 100% { + transform: rotate(360deg); + } + } +`,ChainButtonContainer=styled.div` + position: relative; + margin: -8px -8px; + &:after { + border-radius: var(--border-radius, 0); + z-index: 2; + content: ''; + pointer-events: none; + position: absolute; + inset: 0 2px; + box-shadow: inset 0 16px 8px -12px var(--background, var(--ck-body-background)), + inset 0 -16px 8px -12px var(--background, var(--ck-body-background)); + } +`,ChainButtons=styled(motion.div)` + padding: 8px; + overflow-x: hidden; + overflow-y: auto; + max-height: 242px; + + -ms-overflow-style: none; /* Internet Explorer 10+ */ + scrollbar-width: none; /* Firefox */ + &::-webkit-scrollbar { + display: none; /* Safari and Chrome */ + } + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + padding: 8px 14px; + margin: 2px -2px 0; + max-height: 60vh; + } +`,ChainButton=styled(motion.button)` + appearance: none; + cursor: pointer; + user-select: none; + position: relative; + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + border-radius: 11px; + margin: 0 0 1px; + padding: 8px 0; + padding-right: 154px; + font-size: 15px; + line-height: 18px; + font-weight: 500; + text-decoration: none; + color: var(--ck-body-color); + background: none; + white-space: nowrap; + transition: transform 100ms ease, background-color 100ms ease; + transform: translateZ(0px); + &:before { + content: ''; + background: currentColor; + position: absolute; + z-index: -1; + inset: 0 var(--ck-dropdown-active-inset, -8px); + border-radius: var(--ck-dropdown-active-border-radius, 12px); + opacity: 0; + transition: opacity 180ms ease; + } + &:after { + content: ''; + position: absolute; + z-index: -1; + inset: 0 var(--ck-dropdown-active-inset, -8px); + border-radius: 12px; + opacity: 0; + transition: opacity 180ms ease; + outline: 2px solid var(--ck-focus-color); + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + font-size: 17px; + padding: 8px 0; + } + @media only screen and (min-width: ${defaultTheme.mobileWidth}px) { + &:hover { + &:before { + transition-duration: 80ms; + opacity: 0.05; + } + } + } + &:active { + transform: scale(0.99) translateZ(0px); + } + &:disabled { + //opacity: 0.4; + pointer-events: none; + } + &:focus-visible { + outline: none !important; + &:after { + opacity: 1; + } + } + ${o=>o.$variant==="secondary"&&Ae` + padding: 12px 4px; + margin: 0 0 8px; + &:last-child { + margin-bottom: 0; + } + &:before { + opacity: 0.05; + } + &:hover:before { + opacity: 0.1; + } + `} +`,ChainButtonStatus=styled(motion.div)` + position: absolute; + top: 0; + bottom: 0; + right: 0; + display: flex; + align-items: center; + justify-content: center; + + color: var(--ck-body-color-muted); + font-size: 15px; + line-height: 18px; + font-weight: 500; + padding-right: 4px; + span { + display: block; + position: relative; + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + font-size: 17px; + padding: 0; + } +`,ChainButtonBg=styled(motion.div)` + position: absolute; + z-index: -1; + inset: 0 var(--ck-dropdown-active-inset, -8px); + background: var(--ck-dropdown-active-background, rgba(26, 136, 248, 0.1)); + box-shadow var(--ck-dropdown-active-box-shadow); + border-radius: var(--ck-dropdown-active-border-radius, 12px); + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + inset: 0 var(--ck-dropdown-active-inset, -8px); + } +`,Spinner$1=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 16.75C2.69036 16.75 3.25 17.3096 3.25 18V19C3.25 26.5939 9.40609 32.75 17 32.75V35.25C8.02537 35.25 0.75 27.9746 0.75 19V18C0.75 17.3096 1.30964 16.75 2 16.75Z",fill:"url(#paint0_linear_1288_18701)"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1288_18701",x1:"2",y1:"19.4884",x2:"16.8752",y2:"33.7485",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-spinner-color)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-spinner-color)",stopOpacity:"0"})]})})]}),ChainSelectList=({variant:o})=>{const{connector:et,chain:tt}=useAccount(),{chains:nt,isPending:rt,switchChain:ot,error:it}=useSwitchChain(),[st,at]=reactExports.useState(void 0),ct=useLocales({}),lt=isMobile(),dt=(it==null?void 0:it.code)===4902,ht=dt||!ot,pt=ft=>{ot&&(at(ft),ot({chainId:ft}))},{triggerResize:mt}=useContext();return jsxRuntimeExports.jsxs(SwitchNetworksContainer,{style:{marginBottom:ot!==void 0?-8:0},children:[jsxRuntimeExports.jsx(ChainButtonContainer,{children:jsxRuntimeExports.jsx(ChainButtons,{children:nt.map(ft=>{var yt;const xt={...chainConfigs.find(vt=>vt.id===ft.id),...ft};return jsxRuntimeExports.jsxs(ChainButton,{$variant:o,disabled:ht||xt.id===(tt==null?void 0:tt.id)||rt&&st===xt.id,onClick:()=>pt==null?void 0:pt(xt.id),style:{opacity:ht&&xt.id!==(tt==null?void 0:tt.id)?.4:void 0},children:[jsxRuntimeExports.jsxs("span",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:12,color:xt.id===(tt==null?void 0:tt.id)?"var(--ck-dropdown-active-color, inherit)":"inherit"},children:[jsxRuntimeExports.jsxs(ChainLogoContainer,{children:[jsxRuntimeExports.jsx(ChainLogoSpinner,{initial:{opacity:0},animate:{opacity:rt&&st===xt.id?1:0},transition:{ease:[.76,0,.24,1],duration:.15,delay:.1},children:jsxRuntimeExports.jsx(motion.div,{animate:lt&&isCoinbaseWalletConnector(et==null?void 0:et.id)&&rt&&st===xt.id?{opacity:[1,0],transition:{delay:4,duration:3}}:{opacity:1},children:Spinner$1},`${xt==null?void 0:xt.id}-${xt==null?void 0:xt.name}`)}),jsxRuntimeExports.jsx(ChainIcon,{children:(yt=xt.logo)!==null&&yt!==void 0?yt:jsxRuntimeExports.jsx(Chains.UnknownChain,{})})]}),xt.name]}),o!=="secondary"&&jsxRuntimeExports.jsx(ChainButtonStatus,{children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,exitBeforeEnter:!0,children:[xt.id===(tt==null?void 0:tt.id)&&jsxRuntimeExports.jsx(motion.span,{style:{color:"var(--ck-dropdown-active-color, var(--ck-focus-color))",display:"block",position:"relative"},initial:{opacity:0,x:-4},animate:{opacity:1,x:0},exit:{opacity:0,x:4,transition:{duration:.1,delay:0}},transition:{ease:[.76,0,.24,1],duration:.3,delay:.2},children:ct.connected},"connectedText"),rt&&st===xt.id&&jsxRuntimeExports.jsx(motion.span,{style:{color:"var(--ck-dropdown-pending-color, inherit)",display:"block",position:"relative"},initial:{opacity:0,x:-4},animate:{opacity:1,x:0},exit:{opacity:0,x:4},transition:{ease:[.76,0,.24,1],duration:.3,delay:.1},children:jsxRuntimeExports.jsx(motion.span,{animate:lt&&isCoinbaseWalletConnector(et==null?void 0:et.id)&&{opacity:[1,0],transition:{delay:4,duration:4}},children:ct.approveInWallet})},"approveText")]})}),o==="secondary"?jsxRuntimeExports.jsx(ChainButtonBg,{initial:!1,animate:{opacity:xt.id===(tt==null?void 0:tt.id)?1:0},transition:{duration:.3,ease:"easeOut"}}):xt.id===(tt==null?void 0:tt.id)&&jsxRuntimeExports.jsx(ChainButtonBg,{layoutId:"activeChain",layout:"position",transition:{duration:.3,ease:"easeOut"}})]},`${xt==null?void 0:xt.id}-${xt==null?void 0:xt.name}`)})})}),jsxRuntimeExports.jsx(AnimatePresence,{children:dt&&jsxRuntimeExports.jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:[.76,0,.24,1],duration:.3},onAnimationStart:mt,onAnimationComplete:mt,children:jsxRuntimeExports.jsx("div",{style:{paddingTop:10,paddingBottom:8},children:jsxRuntimeExports.jsxs(Alert,{children:[ct.warnings_walletSwitchingUnsupported," ",ct.warnings_walletSwitchingUnsupportedResolve]})})})})]})},DropdownWindow=styled(motion.div)` + z-index: 2147483647; + position: fixed; + inset: 0; +`,DropdownOverlay=styled(motion.div)` + position: absolute; + inset: 0; +`,DropdownContainer=styled(motion.div)` + --shadow: 0px 2px 15px rgba(0, 0, 0, 0.15); + --background: var(--ck-dropdown-background, var(--ck-tooltip-background)); + --border-radius: var( + --ck-dropdown-border-radius, + var(--ck-tooltip-border-radius, 12px) + ); + + pointer-events: auto; + z-index: 2147483647; + position: absolute; + top: 0; + left: 0; + width: 100%; + max-width: fit-content; + padding: 14px 16px 16px; + color: var(--ck-dropdown-color, var(--ck-tooltip-color)); + background: var(--background); + box-shadow: var( + --ck-dropdown-box-shadow, + var(--ck-tooltip-shadow, var(--shadow)) + ); + border-radius: var(--border-radius); +`,DropdownHeading=styled(motion.div)` + padding: 0 0 6px; + font-size: 14px; + line-height: 20px; + font-weight: 400; + user-select: none; + color: var(--ck-dropdown-color, var(--ck-tooltip-color)); +`,ChainSelectDropdown=({children:o,open:et,onClose:tt,offsetX:nt=0,offsetY:rt=8})=>{var ot,it,st;const at=useContext(),ct=useThemeContext(),lt=useLocales(),[dt,ht]=reactExports.useState({x:0,y:0});useLockBodyScroll(et);const pt=reactExports.useRef(null);reactExports.useEffect(()=>{const wt=kt=>{var Tt,Rt,Pt;if(et&&(kt.key==="Escape"&&tt(),kt.key==="ArrowDown"||kt.key==="ArrowUp")){if(!pt.current)return;kt.preventDefault();const $t=(Tt=pt.current)===null||Tt===void 0?void 0:Tt.querySelectorAll(` + a[href]:not(:disabled), + button:not(:disabled), + textarea:not(:disabled), + input[type="text"]:not(:disabled), + input[type="radio"]:not(:disabled), + input[type="checkbox"]:not(:disabled), + select:not(:disabled) + `),Ot=$t[0],Bt=$t[$t.length-1];if(kt.key==="ArrowUp")if(document.activeElement===Ot)Bt.focus();else{let zt=(Rt=document==null?void 0:document.activeElement)===null||Rt===void 0?void 0:Rt.previousSibling;for(zt||(zt=Bt);zt.disabled;)zt=zt.previousSibling;zt.focus()}else if(document.activeElement===Bt)Ot.focus();else{let zt=(Pt=document==null?void 0:document.activeElement)===null||Pt===void 0?void 0:Pt.nextSibling;for(zt||(zt=Ot);zt.disabled;)zt=zt.nextSibling;zt.focus()}}};return document.addEventListener("keydown",wt),()=>{document.removeEventListener("keydown",wt)}},[et]);const mt=reactExports.useRef(null),ft=reactExports.useCallback(wt=>{wt&&(mt.current=wt,xt())},[et]),[yt,gt]=useMeasure({debounce:120,offsetSize:!0,scroll:!0}),xt=()=>{if(!mt.current||gt.top+gt.bottom+gt.left+gt.right+gt.height+gt.width===0)return;let wt=gt.left+nt,kt=gt.top+gt.height+rt;mt.current.style.left=`${wt}px`,mt.current.style.top=`${kt}px`};(typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect)(xt,[mt.current,gt,et]),reactExports.useEffect(xt,[et,mt.current]);const bt=tt,Et=tt;return reactExports.useEffect(()=>(xt(),window.addEventListener("scroll",bt),window.addEventListener("resize",Et),()=>{window.removeEventListener("scroll",bt),window.removeEventListener("resize",Et)}),[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{ref:yt,children:o}),jsxRuntimeExports.jsx(AnimatePresence,{children:et&&jsxRuntimeExports.jsx(Portal$2,{children:jsxRuntimeExports.jsx(ResetContainer,{$useTheme:(ot=ct.theme)!==null&&ot!==void 0?ot:at.theme,$useMode:(it=ct.mode)!==null&&it!==void 0?it:at.mode,$customTheme:(st=ct.customTheme)!==null&&st!==void 0?st:at.customTheme,children:jsxRuntimeExports.jsx(FocusTrap,{children:jsxRuntimeExports.jsxs(DropdownWindow,{ref:pt,children:[jsxRuntimeExports.jsx(DropdownOverlay,{onClick:tt}),jsxRuntimeExports.jsxs(DropdownContainer,{ref:ft,style:{left:dt.x,top:dt.y},initial:"collapsed",animate:"open",exit:"collapsed",variants:{collapsed:{transformOrigin:"0 0",opacity:0,scale:.96,z:.01,y:-4,x:0,transition:{duration:.1}},open:{transformOrigin:"0 0",willChange:"opacity,transform",opacity:1,scale:1,z:.01,y:0,x:0,transition:{ease:[.76,0,.24,1],duration:.15}}},children:[jsxRuntimeExports.jsx(DropdownHeading,{children:lt.switchNetworks}),jsxRuntimeExports.jsx(ChainSelectList,{})]})]})})})})})]})},ChainContainer=styled.div` + --bg: transparent; + --color: #333; + ${o=>typeof o.size=="string"?Ae` + --width: ${o.size}; + --height: ${o.size}; + `:Ae` + --width: ${o.size>=0?`${o.size}px`:"24px"}; + --height: ${o.size>=0?`${o.size}px`:"24px"}; + `}; + ${o=>typeof o.radius=="string"?Ae` + --radius: ${o.radius}; + `:Ae` + --radius: ${o.radius>=0?`${o.radius}px`:"24px"}; + `}; + display: block; + position: relative; + width: var(--width); + height: var(--height); + min-width: var(--width); + min-height: var(--height); + border-radius: var(--radius); + background: var(--ck-body-background-secondary); + pointer-events: none; + user-select: none; + svg { + display: block; + width: 100%; + height: auto; + } + > div { + display: flex; + align-items: center; + justify-content: center; + } +`,LogoContainer$1=styled(motion.div)` + display: block; + position: absolute; + inset: 0; + overflow: hidden; + border-radius: inherit; + user-select: none; + display: flex; + align-items: center; + justify-content: center; + svg { + display: block; + width: 100%; + height: auto; + } +`,Spin=We` + 0%{ transform: rotate(0deg); } + 100%{ transform: rotate(360deg); } +`,LoadingContainer=styled(motion.div)` + position: absolute; + inset: 0; + animation: ${Spin} 1s linear infinite; + svg { + display: block; + position: absolute; + inset: 0; + } +`,Unsupported=styled(motion.div)` + z-index: 2; + position: absolute; + top: 0; + right: 0; + width: 40%; + height: 40%; + min-width: 13px; + min-height: 13px; + color: var(--ck-body-color-danger, red); + svg { + display: block; + position: relative; + top: -30%; + right: -30%; + } +`,Spinner=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.3592 30.1654C10.0472 29.4491 8.85718 28.524 7.83713 27.424C6.81708 26.324 5.98425 25.0677 5.36889 23.7054C5.20157 23.335 5.05033 22.9567 4.91578 22.5717C4.51465 21.4237 4.26735 20.2308 4.17794 19.0239C4.16599 18.8626 4.13894 18.7041 4.09809 18.5507C3.85023 17.6197 3.09399 16.8738 2.11531 16.7999C0.975331 16.7138 -0.0310983 17.5702 0.0141657 18.7125C0.0223289 18.9185 0.0340286 19.1243 0.049253 19.3298C0.165374 20.8971 0.486545 22.4464 1.00749 23.9373C1.10424 24.2142 1.20764 24.4884 1.31755 24.7596C2.13617 26.7799 3.31595 28.6371 4.80146 30.239C6.28696 31.841 8.04998 33.1573 10.0029 34.1258C10.2651 34.2558 10.5307 34.3796 10.7995 34.4969C12.247 35.1287 13.7676 35.5656 15.3217 35.7995C15.5255 35.8301 15.7298 35.8573 15.9346 35.881C17.0703 36.0122 18.0001 35.0731 18.0001 33.9299C18.0001 32.9484 17.3133 32.1381 16.4036 31.8208C16.2537 31.7685 16.0977 31.7296 15.9377 31.7056C14.7411 31.5255 13.5702 31.1891 12.4556 30.7026C12.0818 30.5394 11.716 30.3601 11.3592 30.1654Z",fill:"url(#paint0_linear_1288_1870)"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1288_1870",x1:"2",y1:"19.4884",x2:"16.8752",y2:"33.7485",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-connectbutton-balance-color,currentColor)",stopOpacity:"0.7"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-connectbutton-balance-color,currentColor)",stopOpacity:"0"})]})})]}),Chain=({id:o,unsupported:et,radius:tt="50%",size:nt=24})=>{var rt;const ot=useChainIsSupported(o),it=et??!ot,st=chainConfigs.find(ct=>ct.id===o);return useIsMounted()?jsxRuntimeExports.jsx(ChainContainer,{size:nt,radius:tt,children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[it&&jsxRuntimeExports.jsx(Unsupported,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxRuntimeExports.jsxs("svg",{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M2.61317 11.2501H9.46246C10.6009 11.2501 11.3256 10.3506 11.3256 9.3549C11.3256 9.05145 11.255 8.73244 11.0881 8.43303L7.65903 2.14708C7.659 2.14702 7.65897 2.14696 7.65893 2.1469C7.65889 2.14682 7.65884 2.14673 7.65879 2.14664C7.31045 1.50746 6.6741 1.17871 6.04 1.17871C5.41478 1.17871 4.763 1.50043 4.41518 2.14968L0.993416 8.43476C0.828865 8.72426 0.75 9.04297 0.75 9.3549C0.75 10.3506 1.47471 11.2501 2.61317 11.2501Z",fill:"currentColor",stroke:"var(--ck-body-background, #fff)",strokeWidth:"1.5"}),jsxRuntimeExports.jsx("path",{d:"M6.03258 7.43916C5.77502 7.43916 5.63096 7.29153 5.62223 7.02311L5.55675 4.96973C5.54802 4.69684 5.74446 4.5 6.02821 4.5C6.3076 4.5 6.51277 4.70131 6.50404 4.9742L6.43856 7.01864C6.42546 7.29153 6.2814 7.43916 6.03258 7.43916ZM6.03258 9.11676C5.7401 9.11676 5.5 8.9065 5.5 8.60677C5.5 8.30704 5.7401 8.09678 6.03258 8.09678C6.32506 8.09678 6.56515 8.30256 6.56515 8.60677C6.56515 8.91097 6.32069 9.11676 6.03258 9.11676Z",fill:"white"})]})}),o?jsxRuntimeExports.jsx(LogoContainer$1,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:(rt=st==null?void 0:st.logo)!==null&&rt!==void 0?rt:jsxRuntimeExports.jsx(Chains.UnknownChain,{})},`${st==null?void 0:st.id}-${st==null?void 0:st.name}-${o}`):jsxRuntimeExports.jsx(LoadingContainer,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:Spinner},"loading")]})}):jsxRuntimeExports.jsx("div",{style:{width:nt,height:nt}})},Container$3=styled(motion.div)``,SwitchChainButton=styled(motion.button)` + --color: var( + --ck-dropdown-button-color, + var(--ck-button-primary-color, var(--ck-body-color)) + ); + --background: var( + --ck-dropdown-button-background, + var(--ck-secondary-button-background, var(--ck-body-background-secondary)) + ); + --box-shadow: var( + --ck-dropdown-button-box-shadow, + var( + --ck-secondary-button-box-shadow, + var(--ck-button-primary-box-shadow), + none + ) + ); + + --hover-color: var(--ck-dropdown-button-hover-color, var(--color)); + --hover-background: var( + --ck-dropdown-button-hover-background, + var(--background) + ); + --hover-box-shadow: var( + --ck-dropdown-button-hover-box-shadow, + var(--box-shadow) + ); + + --active-color: var(--ck-dropdown-button-active-color, var(--hover-color)); + --active-background: var( + --ck-dropdown-button-active-background, + var(--hover-background) + ); + --active-box-shadow: var( + --ck-dropdown-button-active-box-shadow, + var(--hover-box-shadow) + ); + + appearance: none; + user-select: none; + position: relative; + display: flex; + align-items: center; + justify-content: space-between; + border-radius: 15px; + width: 52px; + height: 30px; + padding: 2px 6px 2px 3px; + font-size: 16px; + line-height: 19px; + font-weight: 500; + text-decoration: none; + white-space: nowrap; + transform: translateZ(0px); + + transition: 100ms ease; + transition-property: transform, background-color, box-shadow, color; + + color: var(--color); + background: var(--background); + box-shadow: var(--box-shadow); + + svg { + position: relative; + display: block; + } + + ${o=>o.disabled?Ae` + width: auto; + padding: 3px; + position: relative; + left: -22px; + `:Ae` + cursor: pointer; + + @media only screen and (min-width: ${defaultTheme.mobileWidth+1}px) { + &:hover, + &:focus-visible { + color: var(--hover-color); + background: var(--hover-background); + box-shadow: var(--hover-box-shadow); + } + &:active { + color: var(--active-color); + background: var(--active-background); + box-shadow: var(--active-box-shadow); + } + } + `} +`,ChevronDown=({...o})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"11",height:"6",viewBox:"0 0 11 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:jsxRuntimeExports.jsx("path",{d:"M1.5 1L5.5 5L9.5 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),ChainSelector=()=>{const o=useContext(),[et,tt]=reactExports.useState(!1),{chain:nt}=useAccount(),{chains:rt}=useSwitchChain(),ot=useLocales({CHAIN:nt==null?void 0:nt.name}),it=isMobile()||(window==null?void 0:window.innerWidth){o.open||tt(!1)},[o.open]);const st=rt.length<=1;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Container$3,{children:jsxRuntimeExports.jsx(ChainSelectDropdown,{offsetX:-12,open:!it&&et,onClose:()=>tt(!1),children:jsxRuntimeExports.jsxs(SwitchChainButton,{"aria-label":flattenChildren(ot.switchNetworks).toString(),disabled:st,onClick:()=>{it?o.setRoute(routes.SWITCHNETWORKS):tt(!et)},children:[st?jsxRuntimeExports.jsx(Tooltip,{message:ot.chainNetwork,xOffset:-6,delay:.01,children:jsxRuntimeExports.jsx(Chain,{id:nt==null?void 0:nt.id})}):jsxRuntimeExports.jsx(Chain,{id:nt==null?void 0:nt.id}),!st&&jsxRuntimeExports.jsx(ChevronDown,{style:{top:1,left:-3}})]})})})})},Profile=({closeModal:o})=>{var et,tt,nt;const rt=useContext(),ot=useThemeContext(),it=useLocales(),{reset:st}=useConnect$1(),{disconnect:at}=useDisconnect(),{address:ct,isConnected:lt,connector:dt,chain:ht}=useAccount(),pt=useEnsFallbackConfig(),{data:mt}=useEnsName({chainId:1,address:ct,config:pt}),{data:ft}=useBalance({address:ct}),[yt,gt]=reactExports.useState(!1);reactExports.useEffect(()=>{lt||rt.setOpen(!1)},[lt]),reactExports.useEffect(()=>{if(yt)return o?o():rt.setOpen(!1),()=>{at(),st()}},[yt,at,st]);const xt=["web95","rounded","minimal"].includes((tt=(et=ot.theme)!==null&&et!==void 0?et:rt.theme)!==null&&tt!==void 0?tt:"")?"....":void 0;return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:22,gap:6},children:[jsxRuntimeExports.jsx(AvatarContainer,{children:jsxRuntimeExports.jsxs(AvatarInner,{children:[jsxRuntimeExports.jsx(ChainSelectorContainer,{children:jsxRuntimeExports.jsx(ChainSelector,{})}),jsxRuntimeExports.jsx(Avatar,{address:ct})]})}),jsxRuntimeExports.jsx(ModalH1,{children:jsxRuntimeExports.jsx(CopyToClipboard,{string:ct,children:mt??truncateEthAddress(ct,xt)})}),!((nt=rt==null?void 0:rt.options)===null||nt===void 0)&&nt.hideBalance?null:jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(BalanceContainer,{children:jsxRuntimeExports.jsxs(AnimatePresence,{exitBeforeEnter:!0,initial:!1,children:[ft&&jsxRuntimeExports.jsxs(Balance$1,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[nFormatter(Number(ft==null?void 0:ft.formatted))," ",ft==null?void 0:ft.symbol]},`chain-${ht==null?void 0:ht.id}`),!ft&&jsxRuntimeExports.jsx(LoadingBalance,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:" "})]})})})]}),!isSafeConnector(dt==null?void 0:dt.id)&&jsxRuntimeExports.jsx(Button$1,{onClick:()=>gt(!0),icon:jsxRuntimeExports.jsx(DisconnectIcon,{}),children:it.disconnect})]})},SwitchNetworks=()=>{const{reset:o}=useConnect$1(),{disconnect:et}=useDisconnect(),{connector:tt,chain:nt}=useAccount(),rt=useChainIsSupported(nt==null?void 0:nt.id),ot=useLocales({}),it=()=>{et(),o()};return jsxRuntimeExports.jsx(PageContent,{style:{width:278},children:jsxRuntimeExports.jsxs(ModalContent,{style:{padding:0,marginTop:-10},children:[!rt&&jsxRuntimeExports.jsxs(ModalBody,{children:[ot.warnings_chainUnsupported," ",ot.warnings_chainUnsupportedResolve]}),jsxRuntimeExports.jsx("div",{style:{padding:"6px 8px"},children:jsxRuntimeExports.jsx(ChainSelectList,{variant:"secondary"})}),!rt&&!isSafeConnector(tt==null?void 0:tt.id)&&jsxRuntimeExports.jsxs("div",{style:{paddingTop:12},children:[jsxRuntimeExports.jsx(OrDivider,{}),jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(DisconnectIcon,{}),variant:"secondary",onClick:it,children:ot.disconnect})]})]})})},spinKeyframes=We` + from{ transform: rotate(0deg); } + to{ transform: rotate(360deg); } +`,lineKeyframes=We` + from{ background-position: 0 0; } + to{ background-position: 100% 0; } +`,ContentContainer=styled.div` + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + margin: 5px auto 24px; + padding: 16px 16px; + border-radius: var(--ck-tertiary-border-radius, 24px); + box-shadow: var(--ck-tertiary-box-shadow, none); + background: var(--ck-body-background-tertiary); + } +`,LogoContainer=styled(motion.div)` + z-index: 2; + overflow: hidden; + position: relative; + display: flex; + align-items: center; + justify-content: center; + width: 52px; + height: 52px; + border-radius: 100%; + transition: inherit; + background: var(--ck-body-background-secondary); + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04); + svg, + img { + display: block; + width: 100%; + height: 100%; + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + width: 64px; + height: 64px; + } +`,StatusIcon=styled(motion.div)` + z-index: 2; + position: relative; + display: flex; + align-items: center; + justify-content: center; + width: 52px; + height: 52px; + color: currentColor; + border-radius: 100%; + transition: inherit; + svg { + z-index: 3; + position: relative; + transform: scale(0.89); + transition: inherit; + opacity: 0.5; + } + &:before { + z-index: 1; + content: ''; + position: absolute; + inset: 10px; + border-radius: inherit; + border: 1px dashed var(--border-color); + background: var(--ck-body-background); + transition: inherit; + animation: ${spinKeyframes} 10s linear infinite; + } + &:after { + z-index: 2; + content: ''; + position: absolute; + inset: 0; + border-radius: inherit; + background: #34c759; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04); + transform: scale(0); + transition: inherit; + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + width: 64px; + height: 64px; + svg { + transform: scale(1.1); + } + } +`,StatusGraphicBgSvg=styled(motion.svg)` + display: block; + position: relative; + margin: 0 auto; + transition: inherit; + overflow: visible; + rect { + stroke: var(--border-color); + rx: var(--ck-border-radius); + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + display: none; + } +`,StatusGraphic=styled(motion.div)` + --border-color: var(--ck-siwe-border, var(--ck-body-divider)); + --border-size: 0; + --border-style: dashed; + + user-select: none; + pointer-events: none; + position: relative; + display: flex; + align-items: center; + justify-content: center; + gap: 14px; + width: 100%; + margin: 12px auto; + padding: 42px 32px; + transition: all 320ms cubic-bezier(0.175, 0.885, 0.32, 1.1); + border: var(--border-size) var(--border-style) var(--border-color); + border-radius: var(--ck-border-radius); + + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + --border-size: 1px; + margin: 0 auto 20px; + padding: 38px 0; + gap: 18px; + + div { + // easier than wrapping in another styled component + padding-bottom: 10px; + } + } + + > div { + z-index: 2; + position: relative; + transition: inherit; + } + + &:before, + &:after { + z-index: 1; + content: ''; + position: absolute; + top: 50%; + left: 50%; + width: 120px; + height: 1px; + margin-left: -60px; + transition: inherit; + animation: ${lineKeyframes} 10s linear infinite; + background: linear-gradient( + 90deg, + var(--border-color), + var(--border-color) 50%, + transparent 50%, + transparent 100% + ); + background-size: 6px 1px; + } + + &:after { + background: var(--border-color); + transform: scaleX(0); + } + + ${({$connected:o})=>o&&Ae` + &:before { + opacity: 0; + } + &:after { + transform: none; + } + ${StatusGraphicBgSvg} { + rect { + stroke-dasharray: 0 0; + } + } + ${LogoContainer} { + transform: scale(0.62); + } + ${StatusIcon} { + svg { + transform: scale(1.5); + opacity: 1; + color: #fff; + } + &:before { + transform: scale(0); + } + &:after { + transform: scale(1); + } + } + @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { + --border-size: 1px; + --border-style: solid; + ${StatusIcon} { + svg { + transform: scale(1.75); + } + } + } + `}; +`,SIWEButton=({showSignOutButton:o,onSignIn:et,onSignOut:tt})=>{const nt=useIsMounted(),rt=useLocales(),{setOpen:ot}=useModal(),{isSignedIn:it,isReady:st,isLoading:at,isRejected:ct,isSuccess:lt,isError:dt,signIn:ht,signOut:pt,error:mt}=useSIWE({onSignIn:gt=>et==null?void 0:et(gt),onSignOut:()=>tt==null?void 0:tt()}),{address:ft}=useAccount();function yt(){return lt?rt.signedIn:ct?rt.tryAgain:at?rt.awaitingConfirmation:dt?mt??"Unknown Error":rt.signIn}return nt?o&&it?jsxRuntimeExports.jsx(Button$1,{style:{margin:0},onClick:pt,icon:jsxRuntimeExports.jsx(DisconnectIcon,{}),children:rt.signOut},"button"):ft?jsxRuntimeExports.jsx(Button$1,{style:{margin:0},arrow:it?!1:!at&&!ct,onClick:!at&&!lt?ht:void 0,disabled:at,waiting:at,icon:ct&&jsxRuntimeExports.jsx(motion.div,{initial:{rotate:-270},animate:{rotate:0},transition:{duration:1,ease:[.175,.885,.32,.98]},children:jsxRuntimeExports.jsx(RetryIcon,{style:{opacity:.4}})}),children:yt()},"button"):jsxRuntimeExports.jsx(Button$1,{style:{margin:0},onClick:()=>ot(!0),arrow:!0,children:rt.walletNotConnected},"button"):jsxRuntimeExports.jsx(Button$1,{style:{margin:0},disabled:!0},"loading")},LazyImage=({src:o,alt:et,width:tt,height:nt})=>{const rt=reactExports.useRef(null),[ot,it]=reactExports.useState(!0);return reactExports.useEffect(()=>{rt.current&&rt.current.complete&&rt.current.naturalHeight!==0||it(!1)},[o]),jsxRuntimeExports.jsx("div",{style:{width:tt,height:nt,background:"rgba(0,0,0,0.02)",boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.02)"},children:jsxRuntimeExports.jsx("img",{ref:rt,src:o,alt:et,width:tt,height:nt,onLoad:()=>it(!0),style:{transition:"opacity 0.2s ease",opacity:ot?1:0}})})},transition={duration:.2,ease:[.26,.08,.25,1]},copyTransition={duration:.16,ease:[.26,.08,.25,1]},SignInWithEthereum=()=>{var o,et;const tt=useContext(),{isSignedIn:nt,reset:rt}=useSIWE(),ot=isMobile(),[it,st]=reactExports.useState(nt?"signedIn":"signedOut"),at=useLocales({}),ct=it==="signedIn"?{heading:at.signInWithEthereumScreen_signedIn_heading,h1:at.signInWithEthereumScreen_signedIn_h1,p:at.signInWithEthereumScreen_signedIn_p,button:at.signInWithEthereumScreen_signedIn_button}:{heading:at.signInWithEthereumScreen_signedOut_heading,h1:at.signInWithEthereumScreen_signedOut_h1,p:at.signInWithEthereumScreen_signedOut_p,button:at.signInWithEthereumScreen_signedOut_button};reactExports.useEffect(()=>{nt&&st("signedIn")},[]),reactExports.useEffect(()=>{nt||st("signedOut")},[nt]);const{address:lt}=useAccount(),ht=(()=>{const mt={svg:null,default:null},ft=document.getElementsByTagName("link");return Array.from(ft).forEach(yt=>{(yt.getAttribute("rel")==="icon"||yt.getAttribute("rel")==="shortcut icon")&&yt.getAttribute("href")&&(yt.getAttribute("type")==="image/svg+xml"?mt.svg=yt.getAttribute("href"):mt.default=yt.getAttribute("href"))}),mt})(),pt=(et=(o=getAppIcon())!==null&&o!==void 0?o:ht.svg)!==null&&et!==void 0?et:ht.default;return jsxRuntimeExports.jsx(PageContent,{style:{width:278},children:jsxRuntimeExports.jsxs(ModalContent,{style:{padding:0,marginTop:-10},children:[jsxRuntimeExports.jsx(ContentContainer,{children:jsxRuntimeExports.jsx(AnimatePresence,{exitBeforeEnter:!0,children:jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{opacity:0,scale:.94},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.94},transition:copyTransition,children:jsxRuntimeExports.jsx(ModalBody,{style:{height:42},children:jsxRuntimeExports.jsx(FitText,{children:ct.h1})})},flattenChildren(ct.h1).toString())})}),jsxRuntimeExports.jsxs(StatusGraphic,{$connected:nt,children:[jsxRuntimeExports.jsx("div",{style:{position:"absolute",inset:0},children:jsxRuntimeExports.jsx(StatusGraphicBgSvg,{width:"262",height:"134",viewBox:"0 0 262 134",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx(motion.rect,{x:"0",y:"0",rx:"12",width:"262",height:"134",strokeDasharray:"3 3",animate:{strokeDashoffset:[0,-6]},transition:{duration:.4,ease:"linear",repeat:1/0}})})}),jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{opacity:0,x:50,scale:.8},animate:{opacity:1,x:0,scale:1},transition,children:jsxRuntimeExports.jsx(LogoContainer,{children:jsxRuntimeExports.jsx(Avatar,{address:lt,size:64})})},"avatarImage"),jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{scale:.6},animate:{scale:1},transition:{...transition},children:jsxRuntimeExports.jsx(StatusIcon,{children:jsxRuntimeExports.jsx(TickIcon,{})})},"tickIcon"),jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{opacity:0,x:-40,scale:.8},animate:{opacity:1,x:0,scale:1},transition:{...transition},children:jsxRuntimeExports.jsx(LogoContainer,{children:pt?jsxRuntimeExports.jsx(LazyImage,{src:pt,alt:"app"}):jsxRuntimeExports.jsx(Chains.UnknownChain,{})})},"appLogo")]},"status"),jsxRuntimeExports.jsx(AnimatePresence,{exitBeforeEnter:!0,children:jsxRuntimeExports.jsx(motion.div,{style:{paddingBottom:ot?24:12},initial:ot?!1:{opacity:0,scale:.94},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.94},transition:copyTransition,children:jsxRuntimeExports.jsx(ModalBody,{style:{height:42,marginTop:-1,marginBottom:-3},children:jsxRuntimeExports.jsx(FitText,{children:ct.p})})},flattenChildren(ct.p).toString())}),jsxRuntimeExports.jsx(SIWEButton,{showSignOutButton:it==="signedIn",onSignIn:()=>{setTimeout(()=>{tt.setOpen(!1)},1e3)}})]})})},customThemeDefault$1={},ConnectModal$1=({mode:o="auto",theme:et="auto",customTheme:tt=customThemeDefault$1,lang:nt="en-US"})=>{var rt;const ot=useContext(),{isConnected:it,chain:st}=useAccount(),at=useChainIsSupported(st==null?void 0:st.id),ct=!(!((rt=ot.options)===null||rt===void 0)&&rt.enforceSupportedChains&&it&&!at),lt=ct&&ot.route!==routes.CONNECTORS&&ot.route!==routes.PROFILE,dt=ct&&ot.route!==routes.PROFILE,ht=()=>{ot.route===routes.SIGNINWITHETHEREUM||ot.route===routes.SWITCHNETWORKS?ot.setRoute(routes.PROFILE):ot.route===routes.DOWNLOAD?ot.setRoute(routes.CONNECT):ot.setRoute(routes.CONNECTORS)},pt={onboarding:jsxRuntimeExports.jsx(Introduction,{}),about:jsxRuntimeExports.jsx(About,{}),download:jsxRuntimeExports.jsx(DownloadApp,{}),connectors:jsxRuntimeExports.jsx(Wallets,{}),mobileConnectors:jsxRuntimeExports.jsx(MobileConnectors,{}),connect:jsxRuntimeExports.jsx(ConnectUsing,{}),profile:jsxRuntimeExports.jsx(Profile,{}),switchNetworks:jsxRuntimeExports.jsx(SwitchNetworks,{}),signInWithEthereum:jsxRuntimeExports.jsx(SignInWithEthereum,{})};function mt(){ot.setOpen(!1)}return reactExports.useEffect(()=>{var ft;it?(ot.route!==routes.PROFILE||ot.route!==routes.SIGNINWITHETHEREUM)&&(ot.signInWithEthereum&&!(!((ft=ot.options)===null||ft===void 0)&&ft.disableSiweRedirect)?ot.setRoute(routes.SIGNINWITHETHEREUM):mt()):mt()},[it]),reactExports.useEffect(()=>ot.setMode(o),[o]),reactExports.useEffect(()=>ot.setTheme(et),[et]),reactExports.useEffect(()=>ot.setCustomTheme(tt),[tt]),reactExports.useEffect(()=>ot.setLang(nt),[nt]),reactExports.useEffect(()=>{const ft=getAppName();if(!ft||!ot.open)return;const yt=document.createElement("meta");return yt.setAttribute("property","og:title"),yt.setAttribute("content",ft),document.head.prepend(yt),()=>{document.head.removeChild(yt)}},[ot.open]),jsxRuntimeExports.jsx(ConnectKitThemeProvider,{theme:et,customTheme:tt,mode:o,children:jsxRuntimeExports.jsx(Modal,{open:ot.open,pages:pt,pageId:ot.route,onClose:ct?mt:void 0,onInfo:dt?()=>ot.setRoute(routes.ABOUT):void 0,onBack:lt?ht:void 0})})};function useGoogleFont(o){reactExports.useEffect(()=>{if(!o)return;o=o.replace(/ /g,"+");const et=document.createElement("link");et.href="https://fonts.googleapis.com",et.rel="preconnect";const tt=document.createElement("link");tt.href="https://fonts.gstatic.com",tt.rel="preconnect",tt.crossOrigin="true";const nt=document.createElement("link");return nt.href=`https://fonts.googleapis.com/css2?family=${o}:wght@400;500;600&display=swap`,nt.rel="stylesheet",document.head.appendChild(et),document.head.appendChild(tt),document.head.appendChild(nt),()=>{document.head.removeChild(et),document.head.removeChild(tt),document.head.removeChild(nt)}},[o])}function useThemeFont(o){var et;const nt=(et={web95:"Lato",retro:"Nunito",midnight:"Inter",minimal:"Inter",rounded:"Nunito"}[o])!==null&&et!==void 0?et:null;useGoogleFont(nt??"")}const useConnectCallback=({onConnect:o,onDisconnect:et})=>{useAccountEffect({onConnect:({address:tt,connector:nt,isReconnected:rt})=>{rt||o==null||o({address:tt,connectorId:nt==null?void 0:nt.id})},onDisconnect:()=>et==null?void 0:et()})},routes={ONBOARDING:"onboarding",ABOUT:"about",CONNECTORS:"connectors",MOBILECONNECTORS:"mobileConnectors",CONNECT:"connect",DOWNLOAD:"download",PROFILE:"profile",SWITCHNETWORKS:"switchNetworks",SIGNINWITHETHEREUM:"signInWithEthereum"},Context=reactExports.createContext(null),ConnectKitProvider=({children:o,theme:et="auto",mode:tt="auto",customTheme:nt,options:rt,onConnect:ot,onDisconnect:it,debugMode:st=!1})=>{var at,ct,lt,dt;if(!React.useContext(WagmiContext))throw Error("ConnectKitProvider must be within a WagmiProvider");if(React.useContext(Context))throw new Error("Multiple, nested usages of ConnectKitProvider detected. Please use only one.");useConnectCallback({onConnect:ot,onDisconnect:it});const ht=useChains(),pt=useConnector("injected"),mt={language:"en-US",hideBalance:!1,hideTooltips:!1,hideQuestionMarkCTA:!1,hideNoWalletCTA:!1,walletConnectCTA:"link",hideRecentBadge:!1,avoidLayoutShift:!0,embedGoogleFonts:!1,truncateLongENSAddress:!0,walletConnectName:void 0,reducedMotion:!1,disclaimer:null,bufferPolyfill:!0,customAvatar:void 0,initialChainId:(at=ht==null?void 0:ht[0])===null||at===void 0?void 0:at.id,enforceSupportedChains:!1,ethereumOnboardingUrl:void 0,walletOnboardingUrl:void 0,disableSiweRedirect:!1},ft=Object.assign({},mt,rt);typeof window<"u"&&ft.bufferPolyfill&&(window.Buffer=(ct=window.Buffer)!==null&&ct!==void 0?ct:buffer$2.Buffer);const[yt,gt]=reactExports.useState(et),[xt,vt]=reactExports.useState(tt),[bt,Et]=reactExports.useState(nt??{}),[wt,kt]=reactExports.useState("en-US"),[Tt,Rt]=reactExports.useState(!1),[Pt,$t]=reactExports.useState({id:""}),[Ot,Bt]=reactExports.useState(routes.CONNECTORS),[zt,Ft]=reactExports.useState(""),[Yt,Ht]=reactExports.useState(0);ft.embedGoogleFonts&&useThemeFont(et),reactExports.useEffect(()=>gt(et),[et]),reactExports.useEffect(()=>kt(ft.language||"en-US"),[ft.language]),reactExports.useEffect(()=>Ft(null),[Ot,Tt]);const{chain:Ut,isConnected:qt}=useAccount(),Lt=useChainIsSupported(Ut==null?void 0:Ut.id);reactExports.useEffect(()=>{qt&&ft.enforceSupportedChains&&!Lt&&(Rt(!0),Bt(routes.SWITCHNETWORKS))},[qt,Lt,Ut,Ot,Tt]),reactExports.useEffect(()=>{isFamily()&&(pt==null||pt.connect())},[pt]);const Zt=st?console.log:()=>{},Qt={theme:yt,setTheme:gt,mode:xt,setMode:vt,customTheme:nt,setCustomTheme:Et,lang:wt,setLang:kt,open:Tt,setOpen:Rt,route:Ot,setRoute:Bt,connector:Pt,setConnector:$t,signInWithEthereum:(dt=(lt=React.useContext(SIWEContext))===null||lt===void 0?void 0:lt.enabled)!==null&&dt!==void 0?dt:!1,onConnect:ot,options:ft,errorMessage:zt,debugMode:st,log:Zt,displayError:(Nt,Gt)=>{Ft(Nt),console.log("---------CONNECTKIT DEBUG---------"),console.log(Nt),Gt&&console.table(Gt),console.log("---------/CONNECTKIT DEBUG---------")},resize:Yt,triggerResize:()=>Ht(Nt=>Nt+1)};return reactExports.createElement(Context.Provider,{value:Qt},jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Web3ContextProvider,{enabled:Tt,children:jsxRuntimeExports.jsxs(Le,{theme:defaultTheme$1,children:[o,jsxRuntimeExports.jsx(ConnectModal$1,{lang:wt,theme:yt,mode:tt,customTheme:bt})]})})}))},useContext=()=>{const o=React.useContext(Context);if(!o)throw Error("ConnectKit Hook must be inside a Provider.");return o},safeRoutes={disconnected:[routes.CONNECTORS,routes.ABOUT,routes.ONBOARDING,routes.MOBILECONNECTORS,routes.ONBOARDING],connected:[routes.PROFILE,routes.SWITCHNETWORKS,routes.SIGNINWITHETHEREUM]},allRoutes=[...safeRoutes.connected,...safeRoutes.disconnected],useModal=({onConnect:o,onDisconnect:et}={})=>{const tt=useContext();useConnectCallback({onConnect:o,onDisconnect:et});const{isConnected:nt}=useAccount(),{signIn:rt}=useSIWE(),ot=()=>{tt.setOpen(!1)},it=()=>{tt.setOpen(!0)},st=at=>{let ct=at;allRoutes.includes(at)?nt?safeRoutes.connected.includes(at)||(ct=routes.PROFILE,tt.log(`Route ${at} is not a valid route when connected, navigating to ${ct} instead.`)):safeRoutes.disconnected.includes(at)||(ct=routes.CONNECTORS,tt.log(`Route ${at} is not a valid route when disconnected, navigating to ${ct} instead.`)):(ct=nt?routes.PROFILE:routes.CONNECTORS,tt.log(`Route ${at} is not a valid route, navigating to ${ct} instead.`)),tt.setRoute(ct),it()};return{open:tt.open,setOpen:at=>{at?st(nt?routes.PROFILE:routes.CONNECTORS):ot()},openAbout:()=>st(routes.ABOUT),openOnboarding:()=>st(routes.ONBOARDING),openProfile:()=>st(routes.PROFILE),openSwitchNetworks:()=>st(routes.SWITCHNETWORKS),openSIWE:at=>{st(routes.SIGNINWITHETHEREUM),at&&rt()}}},TextContainer=styled(motion.div)` + top: 0; + bottom: 0; + left: 0; + display: inline-flex; + align-items: center; + justify-content: center; + white-space: nowrap; +`;styled(motion.div)` + position: relative; + width: 24px; + height: 24px; + border-radius: 12px; + overflow: hidden; + svg { + display: block; + } +`;const IconContainer=styled(motion.div)` + pointer-events: none; + user-select: none; + position: relative; + width: 24px; + height: 24px; + margin-right: 8px; +`,UnsupportedNetworkContainer=styled(motion.div)` + z-index: 1; + position: absolute; + inset: 0; + display: flex; + align-items: center; + justify-content: center; + border-radius: 100%; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02); + background: var(--ck-body-color-danger, red); + color: #fff; + svg { + display: block; + position: relative; + top: -1px; + } +`,Container$2=styled(motion.div)` + display: flex; + align-items: center; + justify-content: flex-start; + position: relative; + height: 40px; + padding: 0; + line-height: 0; + letter-spacing: -0.2px; + font-size: var(--ck-connectbutton-font-size, 16px); + font-weight: var(--ck-connectbutton-font-weight, 500); + text-align: center; + transition: 100ms ease; + transition-property: color, background, box-shadow, border-radius; + + color: var(--color); + background: var(--background); + box-shadow: var(--box-shadow); + border-radius: var(--border-radius); + + &.primary { + --color: var(--ck-connectbutton-color); + --background: var(--ck-connectbutton-background); + --box-shadow: var(--ck-connectbutton-box-shadow); + --border-radius: var(--ck-connectbutton-border-radius, 12px); + + --hover-color: var(--ck-connectbutton-hover-color, var(--color)); + --hover-background: var( + --ck-connectbutton-hover-background, + var(--background) + ); + --hover-box-shadow: var( + --ck-connectbutton-hover-box-shadow, + var(--box-shadow) + ); + --hover-border-radius: var( + --ck-connectbutton-hover-border-radius, + var(--border-radius) + ); + + --active-color: var(--ck-connectbutton-active-color, var(--hover-color)); + --active-background: var( + --ck-connectbutton-active-background, + var(--hover-background) + ); + --active-box-shadow: var( + --ck-connectbutton-active-box-shadow, + var(--hover-box-shadow) + ); + --active-border-radius: var( + --ck-connectbutton-active-border-radius, + var(--hover-border-radius) + ); + } + &.secondary { + --color: var(--ck-connectbutton-balance-color); + --background: var(--ck-connectbutton-balance-background); + --box-shadow: var(--ck-connectbutton-balance-box-shadow); + --border-radius: var( + --ck-connectbutton-balance-border-radius, + var(--ck-connectbutton-border-radius, 12px) + ); + + --hover-color: var(--ck-connectbutton-balance-hover-color, var(--color)); + --hover-background: var( + --ck-connectbutton-balance-hover-background, + var(--background) + ); + --hover-box-shadow: var( + --ck-connectbutton-balance-hover-box-shadow, + var(--box-shadow) + ); + --hover-border-radius: var( + --ck-connectbutton-balance-hover-border-radius, + var(--border-radius) + ); + + --active-color: var( + --ck-connectbutton-balance-active-color, + var(--hover-color) + ); + --active-background: var( + --ck-connectbutton-balance-active-background, + var(--hover-background) + ); + --active-box-shadow: var( + --ck-connectbutton-balance-active-box-shadow, + var(--hover-box-shadow) + ); + --active-border-radius: var( + --ck-connectbutton-balance-active-border-radius, + var(--hover-border-radius) + ); + } +`,ThemeContainer=styled.button` + all: initial; + appearance: none; + user-select: none; + position: relative; + padding: 0; + margin: 0; + background: none; + border-radius: var(--ck-border-radius); + + &:disabled { + pointer-events: none; + opacity: 0.3; + } + + display: flex; + flex-wrap: nowrap; + background: none; + cursor: pointer; + * { + cursor: pointer; + } + &:hover { + ${Container$2} { + color: var(--hover-color, var(--color)); + background: var(--hover-background, var(--background)); + box-shadow: var(--hover-box-shadow, var(--box-shadow)); + border-radius: var(--hover-border-radius, var(--border-radius)); + } + } + &:active { + ${Container$2} { + color: var(--active-color, var(--hover-color, var(--color))); + background: var( + --active-background, + var(--hover-background, var(--background)) + ); + box-shadow: var( + --active-box-shadow, + var(--hover-box-shadow, var(--box-shadow)) + ); + border-radius: var( + --active-border-radius, + var(--hover-border-radius, var(--border-radius)) + ); + } + } + &:focus-visible { + outline: 2px solid var(--ck-family-brand); + } +`,ThemedButton=({children:o,variant:et="primary",autoSize:tt=!0,duration:nt=.3,style:rt})=>{const[ot,it]=useMeasure();return jsxRuntimeExports.jsx(Container$2,{className:et,initial:!1,animate:tt?{width:it.width>10?it.width:"auto"}:void 0,transition:{duration:nt,ease:[.25,1,.5,1],delay:.01},style:rt,children:jsxRuntimeExports.jsx("div",{ref:ot,style:{whiteSpace:"nowrap",width:"fit-content",position:"relative",padding:"0 12px"},children:o})})},Container$1=styled(motion.div)` + display: flex; + align-items: center; + justify-content: center; + gap: 8px; +`,PlaceholderKeyframes=We` + 0%,100%{ opacity: 0.1; transform: scale(0.75); } + 50%{ opacity: 0.75; transform: scale(1.2) } +`,PulseContainer=styled.div` + pointer-events: none; + user-select: none; + padding: 0 5px; + span { + display: inline-block; + vertical-align: middle; + margin: 0 2px; + width: 3px; + height: 3px; + border-radius: 4px; + background: currentColor; + animation: ${PlaceholderKeyframes} 1000ms ease infinite both; + } +`,Balance=({hideIcon:o,hideSymbol:et})=>{const tt=useIsMounted(),[nt,rt]=reactExports.useState(!0),{address:ot,chain:it}=useAccount();useChains();const st=useChainIsSupported(it==null?void 0:it.id),at=useQueryClient(),{data:ct}=useBlockNumber({watch:!0}),{data:lt,queryKey:dt}=useBalance({address:ot,chainId:it==null?void 0:it.id});reactExports.useEffect(()=>{(ct??0%5===0)&&at.invalidateQueries({queryKey:dt})},[ct,dt]);const ht=chainConfigs.find(mt=>mt.id===(it==null?void 0:it.id)),pt=`${!tt||(lt==null?void 0:lt.formatted)===void 0?"balance-loading":`balance-${ht==null?void 0:ht.id}-${lt==null?void 0:lt.formatted}`}`;return reactExports.useEffect(()=>{rt(!1)},[]),jsxRuntimeExports.jsx("div",{style:{position:"relative"},children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:jsxRuntimeExports.jsx(motion.div,{initial:(lt==null?void 0:lt.formatted)!==void 0&&nt?{opacity:1}:{opacity:0,position:"absolute",top:0,left:0,bottom:0},animate:{opacity:1,position:"relative"},exit:{opacity:0,position:"absolute",top:0,left:0,bottom:0},transition:{duration:.4,ease:[.25,1,.5,1],delay:.4},children:!ot||!tt||(lt==null?void 0:lt.formatted)===void 0?jsxRuntimeExports.jsxs(Container$1,{children:[!o&&jsxRuntimeExports.jsx(Chain,{id:it==null?void 0:it.id}),jsxRuntimeExports.jsx("span",{style:{minWidth:32},children:jsxRuntimeExports.jsxs(PulseContainer,{children:[jsxRuntimeExports.jsx("span",{style:{animationDelay:"0ms"}}),jsxRuntimeExports.jsx("span",{style:{animationDelay:"50ms"}}),jsxRuntimeExports.jsx("span",{style:{animationDelay:"100ms"}})]})})]}):st?jsxRuntimeExports.jsxs(Container$1,{children:[!o&&jsxRuntimeExports.jsx(Chain,{id:it==null?void 0:it.id}),jsxRuntimeExports.jsx("span",{style:{minWidth:32},children:nFormatter(Number(lt==null?void 0:lt.formatted))}),!et&&` ${lt==null?void 0:lt.symbol}`]}):jsxRuntimeExports.jsxs(Container$1,{children:[!o&&jsxRuntimeExports.jsx(Chain,{id:it==null?void 0:it.id}),jsxRuntimeExports.jsx("span",{style:{minWidth:32},children:"???"})]})},pt)})})},contentVariants={initial:{zIndex:2,opacity:0,x:"-100%"},animate:{opacity:1,x:.1,transition:{duration:.4,ease:[.25,1,.5,1]}},exit:{zIndex:1,opacity:0,x:"-100%",pointerEvents:"none",position:"absolute",transition:{duration:.4,ease:[.25,1,.5,1]}}},addressVariants={initial:{zIndex:2,opacity:0,x:"100%"},animate:{x:.2,opacity:1,transition:{duration:.4,ease:[.25,1,.5,1]}},exit:{zIndex:1,x:"100%",opacity:0,pointerEvents:"none",position:"absolute",transition:{duration:.4,ease:[.25,1,.5,1]}}},textVariants={initial:{opacity:0},animate:{opacity:1,transition:{duration:.3,ease:[.25,1,.5,1]}},exit:{position:"absolute",opacity:0,transition:{duration:.3,ease:[.25,1,.5,1]}}},ConnectButtonRenderer=({children:o})=>{const et=useIsMounted(),tt=useContext(),{open:nt,setOpen:rt}=useModal(),{address:ot,isConnected:it,chain:st}=useAccount(),at=useChainIsSupported(st==null?void 0:st.id),ct=useEnsFallbackConfig(),{data:lt}=useEnsName({chainId:1,address:ot,config:ct});function dt(){rt(!1)}function ht(){rt(!0),tt.setRoute(it?routes.PROFILE:routes.CONNECTORS)}return!o||!et?null:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o({show:ht,hide:dt,chain:st,unsupported:!at,isConnected:!!ot,isConnecting:nt,address:ot,truncatedAddress:ot?truncateEthAddress(ot):void 0,ensName:lt==null?void 0:lt.toString()})})};ConnectButtonRenderer.displayName="ConnectKitButton.Custom";function ConnectKitButtonInner({label:o,showAvatar:et,separator:tt}){var nt;const rt=useLocales({}),ot=useContext(),{isSignedIn:it}=useSIWE(),{address:st,chain:at}=useAccount(),ct=useChainIsSupported(at==null?void 0:at.id),lt=useEnsFallbackConfig(),{data:dt}=useEnsName({chainId:1,address:st,config:lt}),ht=rt.connectWallet;return jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:st?jsxRuntimeExports.jsxs(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:addressVariants,style:{height:40},children:[et&&jsxRuntimeExports.jsxs(IconContainer,{children:[jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[it&&jsxRuntimeExports.jsx(motion.div,{style:{zIndex:2,position:"absolute",bottom:0,right:0},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxRuntimeExports.jsx(AuthIcon,{})}),!ct&&jsxRuntimeExports.jsx(UnsupportedNetworkContainer,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxRuntimeExports.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M1.68831 13.5H12.0764C13.1026 13.5 13.7647 12.7197 13.7647 11.763C13.7647 11.4781 13.6985 11.1863 13.5462 10.9149L8.34225 1.37526C8.02445 0.791754 7.45505 0.5 6.88566 0.5C6.31627 0.5 5.73364 0.791754 5.42246 1.37526L0.225108 10.9217C0.0728291 11.1863 0 11.4781 0 11.763C0 12.7197 0.662083 13.5 1.68831 13.5ZM6.88566 8.8048C6.49503 8.8048 6.27655 8.5809 6.26331 8.1738L6.16399 5.0595C6.15075 4.64562 6.44869 4.34708 6.87904 4.34708C7.30278 4.34708 7.61396 4.6524 7.60071 5.06628L7.5014 8.16701C7.48154 8.5809 7.26305 8.8048 6.88566 8.8048ZM6.88566 11.3492C6.44207 11.3492 6.07792 11.0303 6.07792 10.5757C6.07792 10.1211 6.44207 9.80219 6.88566 9.80219C7.32926 9.80219 7.69341 10.1143 7.69341 10.5757C7.69341 11.0371 7.32264 11.3492 6.88566 11.3492Z",fill:"currentColor"})})})]}),jsxRuntimeExports.jsx(Avatar,{size:24,address:st})]}),jsxRuntimeExports.jsx("div",{style:{position:"relative",paddingRight:et?1:0},children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:dt?jsxRuntimeExports.jsx(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:textVariants,style:{position:dt?"relative":"absolute"},children:!((nt=ot.options)===null||nt===void 0)&&nt.truncateLongENSAddress?truncateENSAddress(dt,20):dt},"ckEnsName"):jsxRuntimeExports.jsxs(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:textVariants,style:{position:dt?"absolute":"relative"},children:[truncateEthAddress(st,tt)," "]},"ckTruncatedAddress")})})]},"connectedText"):jsxRuntimeExports.jsx(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants,style:{height:40},children:o||ht},"connectWalletText")})}function ConnectKitButton({label:o,showBalance:et=!1,showAvatar:tt=!0,theme:nt,mode:rt,customTheme:ot,onClick:it}){var st;const at=useIsMounted(),ct=useContext(),{isConnected:lt,address:dt,chain:ht}=useAccount(),pt=useChainIsSupported(ht==null?void 0:ht.id);function mt(){ct.setOpen(!0),ct.setRoute(lt?routes.PROFILE:routes.CONNECTORS)}const ft=["web95","rounded","minimal"].includes((st=nt??ct.theme)!==null&&st!==void 0?st:"")?"....":void 0;if(!at)return null;const yt=et&&pt,gt=dt&&yt;return jsxRuntimeExports.jsx(ResetContainer,{$useTheme:nt??ct.theme,$useMode:rt??ct.mode,$customTheme:ot??ct.customTheme,children:jsxRuntimeExports.jsxs(ThemeContainer,{onClick:()=>{it?it(mt):mt()},children:[yt&&jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:gt&&jsxRuntimeExports.jsx(motion.div,{initial:{opacity:0,x:"100%",width:0,marginRight:0},animate:{opacity:1,x:0,width:"auto",marginRight:-24,transition:{duration:.4,ease:[.25,1,.5,1]}},exit:{opacity:0,x:"100%",width:0,marginRight:0,transition:{duration:.4,ease:[.25,1,.5,1]}},children:jsxRuntimeExports.jsx(ThemedButton,{variant:"secondary",theme:nt??ct.theme,mode:rt??ct.mode,customTheme:ot??ct.customTheme,style:{overflow:"hidden"},children:jsxRuntimeExports.jsx(motion.div,{style:{paddingRight:24},children:jsxRuntimeExports.jsx(Balance,{hideSymbol:!0})})})},"balance")}),jsxRuntimeExports.jsx(ThemedButton,{theme:nt??ct.theme,mode:rt??ct.mode,customTheme:ot??ct.customTheme,style:yt&&et&&dt&&(nt==="retro"||ct.theme==="retro")?{boxShadow:"var(--ck-connectbutton-balance-connectbutton-box-shadow)",borderRadius:"var(--ck-connectbutton-balance-connectbutton-border-radius)",overflow:"hidden"}:{overflow:"hidden"},children:jsxRuntimeExports.jsx(ConnectKitButtonInner,{separator:ft,showAvatar:tt,label:o})})]})})}ConnectKitButton.Custom=ConnectButtonRenderer;const dist=8,shake=We` + 0%{ transform:none; } + 25%{ transform:translateX(${dist}px); } + 50%{ transform:translateX(-${dist}px); } + 75%{ transform:translateX(${dist}px); } + 100%{ transform:none; } +`,cursorIn=We` + 0%{ transform:translate(500%,100%); opacity:0; } + 60%{ transform:translate(25%,-20%); opacity:1; } + 70%{ transform:translate(25%,-20%); } + 85%{ transform:translate(25%,-20%) scale(0.9); } + 100%{ transform:translate(25%,-20%) scale(1); opacity:1; } +`;styled.div` + z-index: 2; + position: absolute; + top: 50%; + left: 50%; + width: 32px; + height: 32px; + border-radius: 50%; + background: rgba(0, 0, 0, 0.5); + box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4), 0 4px 6px rgba(0, 0, 0, 0.1); + opacity: 0; + &.play { + animation: ${cursorIn} 1300ms 200ms cubic-bezier(0.16, 1, 0.6, 1) both; + } +`;styled.div` + z-index: 1; + position: absolute; + inset: 0; + &.shake { + animation: ${shake} 300ms 100ms cubic-bezier(0.16, 1, 0.6, 1) both; + } +`;styled.div` + z-index: 1; + position: absolute; + inset: 0; + display: flex; + align-items: center; + justify-content: center; + &:before { + z-index: 9; + content: ''; + position: absolute; + inset: 0; + } +`;const CONNECTKIT_VERSION="1.8.2";/** + * @remix-run/router v1.21.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(o){for(var et=1;et"u")throw new Error(et)}function warning(o,et){if(!o){typeof console<"u"&&console.warn(et);try{throw new Error(et)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(o,et){return{usr:o.state,key:o.key,idx:et}}function createLocation(o,et,tt,nt){return tt===void 0&&(tt=null),_extends$2({pathname:typeof o=="string"?o:o.pathname,search:"",hash:""},typeof et=="string"?parsePath(et):et,{state:tt,key:et&&et.key||nt||createKey()})}function createPath(o){let{pathname:et="/",search:tt="",hash:nt=""}=o;return tt&&tt!=="?"&&(et+=tt.charAt(0)==="?"?tt:"?"+tt),nt&&nt!=="#"&&(et+=nt.charAt(0)==="#"?nt:"#"+nt),et}function parsePath(o){let et={};if(o){let tt=o.indexOf("#");tt>=0&&(et.hash=o.substr(tt),o=o.substr(0,tt));let nt=o.indexOf("?");nt>=0&&(et.search=o.substr(nt),o=o.substr(0,nt)),o&&(et.pathname=o)}return et}function getUrlBasedHistory(o,et,tt,nt){nt===void 0&&(nt={});let{window:rt=document.defaultView,v5Compat:ot=!1}=nt,it=rt.history,st=Action.Pop,at=null,ct=lt();ct==null&&(ct=0,it.replaceState(_extends$2({},it.state,{idx:ct}),""));function lt(){return(it.state||{idx:null}).idx}function dt(){st=Action.Pop;let yt=lt(),gt=yt==null?null:yt-ct;ct=yt,at&&at({action:st,location:ft.location,delta:gt})}function ht(yt,gt){st=Action.Push;let xt=createLocation(ft.location,yt,gt);ct=lt()+1;let vt=getHistoryState(xt,ct),bt=ft.createHref(xt);try{it.pushState(vt,"",bt)}catch(Et){if(Et instanceof DOMException&&Et.name==="DataCloneError")throw Et;rt.location.assign(bt)}ot&&at&&at({action:st,location:ft.location,delta:1})}function pt(yt,gt){st=Action.Replace;let xt=createLocation(ft.location,yt,gt);ct=lt();let vt=getHistoryState(xt,ct),bt=ft.createHref(xt);it.replaceState(vt,"",bt),ot&&at&&at({action:st,location:ft.location,delta:0})}function mt(yt){let gt=rt.location.origin!=="null"?rt.location.origin:rt.location.href,xt=typeof yt=="string"?yt:createPath(yt);return xt=xt.replace(/ $/,"%20"),invariant(gt,"No window.location.(origin|href) available to create URL for href: "+xt),new URL(xt,gt)}let ft={get action(){return st},get location(){return o(rt,it)},listen(yt){if(at)throw new Error("A history only accepts one active listener");return rt.addEventListener(PopStateEventType,dt),at=yt,()=>{rt.removeEventListener(PopStateEventType,dt),at=null}},createHref(yt){return et(rt,yt)},createURL:mt,encodeLocation(yt){let gt=mt(yt);return{pathname:gt.pathname,search:gt.search,hash:gt.hash}},push:ht,replace:pt,go(yt){return it.go(yt)}};return ft}var ResultType;(function(o){o.data="data",o.deferred="deferred",o.redirect="redirect",o.error="error"})(ResultType||(ResultType={}));function matchRoutes(o,et,tt){return tt===void 0&&(tt="/"),matchRoutesImpl(o,et,tt,!1)}function matchRoutesImpl(o,et,tt,nt){let rt=typeof et=="string"?parsePath(et):et,ot=stripBasename(rt.pathname||"/",tt);if(ot==null)return null;let it=flattenRoutes(o);rankRouteBranches(it);let st=null;for(let at=0;st==null&&at{let at={relativePath:st===void 0?ot.path||"":st,caseSensitive:ot.caseSensitive===!0,childrenIndex:it,route:ot};at.relativePath.startsWith("/")&&(invariant(at.relativePath.startsWith(nt),'Absolute route path "'+at.relativePath+'" nested under path '+('"'+nt+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),at.relativePath=at.relativePath.slice(nt.length));let ct=joinPaths([nt,at.relativePath]),lt=tt.concat(at);ot.children&&ot.children.length>0&&(invariant(ot.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+ct+'".')),flattenRoutes(ot.children,et,lt,ct)),!(ot.path==null&&!ot.index)&&et.push({path:ct,score:computeScore(ct,ot.index),routesMeta:lt})};return o.forEach((ot,it)=>{var st;if(ot.path===""||!((st=ot.path)!=null&&st.includes("?")))rt(ot,it);else for(let at of explodeOptionalSegments(ot.path))rt(ot,it,at)}),et}function explodeOptionalSegments(o){let et=o.split("/");if(et.length===0)return[];let[tt,...nt]=et,rt=tt.endsWith("?"),ot=tt.replace(/\?$/,"");if(nt.length===0)return rt?[ot,""]:[ot];let it=explodeOptionalSegments(nt.join("/")),st=[];return st.push(...it.map(at=>at===""?ot:[ot,at].join("/"))),rt&&st.push(...it),st.map(at=>o.startsWith("/")&&at===""?"/":at)}function rankRouteBranches(o){o.sort((et,tt)=>et.score!==tt.score?tt.score-et.score:compareIndexes(et.routesMeta.map(nt=>nt.childrenIndex),tt.routesMeta.map(nt=>nt.childrenIndex)))}const paramRe=/^:[\w-]+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=o=>o==="*";function computeScore(o,et){let tt=o.split("/"),nt=tt.length;return tt.some(isSplat)&&(nt+=splatPenalty),et&&(nt+=indexRouteValue),tt.filter(rt=>!isSplat(rt)).reduce((rt,ot)=>rt+(paramRe.test(ot)?dynamicSegmentValue:ot===""?emptySegmentValue:staticSegmentValue),nt)}function compareIndexes(o,et){return o.length===et.length&&o.slice(0,-1).every((nt,rt)=>nt===et[rt])?o[o.length-1]-et[et.length-1]:0}function matchRouteBranch(o,et,tt){let{routesMeta:nt}=o,rt={},ot="/",it=[];for(let st=0;st{let{paramName:ht,isOptional:pt}=lt;if(ht==="*"){let ft=st[dt]||"";it=ot.slice(0,ot.length-ft.length).replace(/(.)\/+$/,"$1")}const mt=st[dt];return pt&&!mt?ct[ht]=void 0:ct[ht]=(mt||"").replace(/%2F/g,"/"),ct},{}),pathname:ot,pathnameBase:it,pattern:o}}function compilePath(o,et,tt){et===void 0&&(et=!1),tt===void 0&&(tt=!0),warning(o==="*"||!o.endsWith("*")||o.endsWith("/*"),'Route path "'+o+'" will be treated as if it were '+('"'+o.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+o.replace(/\*$/,"/*")+'".'));let nt=[],rt="^"+o.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(it,st,at)=>(nt.push({paramName:st,isOptional:at!=null}),at?"/?([^\\/]+)?":"/([^\\/]+)"));return o.endsWith("*")?(nt.push({paramName:"*"}),rt+=o==="*"||o==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):tt?rt+="\\/*$":o!==""&&o!=="/"&&(rt+="(?:(?=\\/|$))"),[new RegExp(rt,et?void 0:"i"),nt]}function decodePath(o){try{return o.split("/").map(et=>decodeURIComponent(et).replace(/\//g,"%2F")).join("/")}catch(et){return warning(!1,'The URL path "'+o+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+et+").")),o}}function stripBasename(o,et){if(et==="/")return o;if(!o.toLowerCase().startsWith(et.toLowerCase()))return null;let tt=et.endsWith("/")?et.length-1:et.length,nt=o.charAt(tt);return nt&&nt!=="/"?null:o.slice(tt)||"/"}function resolvePath(o,et){et===void 0&&(et="/");let{pathname:tt,search:nt="",hash:rt=""}=typeof o=="string"?parsePath(o):o;return{pathname:tt?tt.startsWith("/")?tt:resolvePathname(tt,et):et,search:normalizeSearch(nt),hash:normalizeHash(rt)}}function resolvePathname(o,et){let tt=et.replace(/\/+$/,"").split("/");return o.split("/").forEach(rt=>{rt===".."?tt.length>1&&tt.pop():rt!=="."&&tt.push(rt)}),tt.length>1?tt.join("/"):"/"}function getInvalidPathError(o,et,tt,nt){return"Cannot include a '"+o+"' character in a manually specified "+("`to."+et+"` field ["+JSON.stringify(nt)+"]. Please separate it out to the ")+("`to."+tt+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function getPathContributingMatches(o){return o.filter((et,tt)=>tt===0||et.route.path&&et.route.path.length>0)}function getResolveToMatches(o,et){let tt=getPathContributingMatches(o);return et?tt.map((nt,rt)=>rt===tt.length-1?nt.pathname:nt.pathnameBase):tt.map(nt=>nt.pathnameBase)}function resolveTo(o,et,tt,nt){nt===void 0&&(nt=!1);let rt;typeof o=="string"?rt=parsePath(o):(rt=_extends$2({},o),invariant(!rt.pathname||!rt.pathname.includes("?"),getInvalidPathError("?","pathname","search",rt)),invariant(!rt.pathname||!rt.pathname.includes("#"),getInvalidPathError("#","pathname","hash",rt)),invariant(!rt.search||!rt.search.includes("#"),getInvalidPathError("#","search","hash",rt)));let ot=o===""||rt.pathname==="",it=ot?"/":rt.pathname,st;if(it==null)st=tt;else{let dt=et.length-1;if(!nt&&it.startsWith("..")){let ht=it.split("/");for(;ht[0]==="..";)ht.shift(),dt-=1;rt.pathname=ht.join("/")}st=dt>=0?et[dt]:"/"}let at=resolvePath(rt,st),ct=it&&it!=="/"&&it.endsWith("/"),lt=(ot||it===".")&&tt.endsWith("/");return!at.pathname.endsWith("/")&&(ct||lt)&&(at.pathname+="/"),at}const joinPaths=o=>o.join("/").replace(/\/\/+/g,"/"),normalizePathname=o=>o.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=o=>!o||o==="?"?"":o.startsWith("?")?o:"?"+o,normalizeHash=o=>!o||o==="#"?"":o.startsWith("#")?o:"#"+o;function isRouteErrorResponse(o){return o!=null&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.internal=="boolean"&&"data"in o}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/** + * React Router v6.28.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(o){for(var et=1;et{st.current=!0}),reactExports.useCallback(function(ct,lt){if(lt===void 0&&(lt={}),!st.current)return;if(typeof ct=="number"){nt.go(ct);return}let dt=resolveTo(ct,JSON.parse(it),ot,lt.relative==="path");o==null&&et!=="/"&&(dt.pathname=dt.pathname==="/"?et:joinPaths([et,dt.pathname])),(lt.replace?nt.replace:nt.push)(dt,lt.state,lt)},[et,nt,it,ot,o])}function useParams(){let{matches:o}=reactExports.useContext(RouteContext),et=o[o.length-1];return et?et.params:{}}function useResolvedPath(o,et){let{relative:tt}=et===void 0?{}:et,{future:nt}=reactExports.useContext(NavigationContext),{matches:rt}=reactExports.useContext(RouteContext),{pathname:ot}=useLocation(),it=JSON.stringify(getResolveToMatches(rt,nt.v7_relativeSplatPath));return reactExports.useMemo(()=>resolveTo(o,JSON.parse(it),ot,tt==="path"),[o,it,ot,tt])}function useRoutes(o,et){return useRoutesImpl(o,et)}function useRoutesImpl(o,et,tt,nt){useInRouterContext()||invariant(!1);let{navigator:rt}=reactExports.useContext(NavigationContext),{matches:ot}=reactExports.useContext(RouteContext),it=ot[ot.length-1],st=it?it.params:{};it&&it.pathname;let at=it?it.pathnameBase:"/";it&&it.route;let ct=useLocation(),lt;if(et){var dt;let yt=typeof et=="string"?parsePath(et):et;at==="/"||(dt=yt.pathname)!=null&&dt.startsWith(at)||invariant(!1),lt=yt}else lt=ct;let ht=lt.pathname||"/",pt=ht;if(at!=="/"){let yt=at.replace(/^\//,"").split("/");pt="/"+ht.replace(/^\//,"").split("/").slice(yt.length).join("/")}let mt=matchRoutes(o,{pathname:pt}),ft=_renderMatches(mt&&mt.map(yt=>Object.assign({},yt,{params:Object.assign({},st,yt.params),pathname:joinPaths([at,rt.encodeLocation?rt.encodeLocation(yt.pathname).pathname:yt.pathname]),pathnameBase:yt.pathnameBase==="/"?at:joinPaths([at,rt.encodeLocation?rt.encodeLocation(yt.pathnameBase).pathname:yt.pathnameBase])})),ot,tt,nt);return et&&ft?reactExports.createElement(LocationContext.Provider,{value:{location:_extends$1({pathname:"/",search:"",hash:"",state:null,key:"default"},lt),navigationType:Action.Pop}},ft):ft}function DefaultErrorComponent(){let o=useRouteError(),et=isRouteErrorResponse(o)?o.status+" "+o.statusText:o instanceof Error?o.message:JSON.stringify(o),tt=o instanceof Error?o.stack:null,rt={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},et),tt?reactExports.createElement("pre",{style:rt},tt):null,null)}const defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends reactExports.Component{constructor(et){super(et),this.state={location:et.location,revalidation:et.revalidation,error:et.error}}static getDerivedStateFromError(et){return{error:et}}static getDerivedStateFromProps(et,tt){return tt.location!==et.location||tt.revalidation!=="idle"&&et.revalidation==="idle"?{error:et.error,location:et.location,revalidation:et.revalidation}:{error:et.error!==void 0?et.error:tt.error,location:tt.location,revalidation:et.revalidation||tt.revalidation}}componentDidCatch(et,tt){console.error("React Router caught the following error during render",et,tt)}render(){return this.state.error!==void 0?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(o){let{routeContext:et,match:tt,children:nt}=o,rt=reactExports.useContext(DataRouterContext);return rt&&rt.static&&rt.staticContext&&(tt.route.errorElement||tt.route.ErrorBoundary)&&(rt.staticContext._deepestRenderedBoundaryId=tt.route.id),reactExports.createElement(RouteContext.Provider,{value:et},nt)}function _renderMatches(o,et,tt,nt){var rt;if(et===void 0&&(et=[]),tt===void 0&&(tt=null),nt===void 0&&(nt=null),o==null){var ot;if(!tt)return null;if(tt.errors)o=tt.matches;else if((ot=nt)!=null&&ot.v7_partialHydration&&et.length===0&&!tt.initialized&&tt.matches.length>0)o=tt.matches;else return null}let it=o,st=(rt=tt)==null?void 0:rt.errors;if(st!=null){let lt=it.findIndex(dt=>dt.route.id&&(st==null?void 0:st[dt.route.id])!==void 0);lt>=0||invariant(!1),it=it.slice(0,Math.min(it.length,lt+1))}let at=!1,ct=-1;if(tt&&nt&&nt.v7_partialHydration)for(let lt=0;lt=0?it=it.slice(0,ct+1):it=[it[0]];break}}}return it.reduceRight((lt,dt,ht)=>{let pt,mt=!1,ft=null,yt=null;tt&&(pt=st&&dt.route.id?st[dt.route.id]:void 0,ft=dt.route.errorElement||defaultErrorElement,at&&(ct<0&&ht===0?(mt=!0,yt=null):ct===ht&&(mt=!0,yt=dt.route.hydrateFallbackElement||null)));let gt=et.concat(it.slice(0,ht+1)),xt=()=>{let vt;return pt?vt=ft:mt?vt=yt:dt.route.Component?vt=reactExports.createElement(dt.route.Component,null):dt.route.element?vt=dt.route.element:vt=lt,reactExports.createElement(RenderedRoute,{match:dt,routeContext:{outlet:lt,matches:gt,isDataRoute:tt!=null},children:vt})};return tt&&(dt.route.ErrorBoundary||dt.route.errorElement||ht===0)?reactExports.createElement(RenderErrorBoundary,{location:tt.location,revalidation:tt.revalidation,component:ft,error:pt,children:xt(),routeContext:{outlet:null,matches:gt,isDataRoute:!0}}):xt()},null)}var DataRouterHook$1=function(o){return o.UseBlocker="useBlocker",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o}(DataRouterHook$1||{}),DataRouterStateHook$1=function(o){return o.UseBlocker="useBlocker",o.UseLoaderData="useLoaderData",o.UseActionData="useActionData",o.UseRouteError="useRouteError",o.UseNavigation="useNavigation",o.UseRouteLoaderData="useRouteLoaderData",o.UseMatches="useMatches",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o.UseRouteId="useRouteId",o}(DataRouterStateHook$1||{});function useDataRouterContext(o){let et=reactExports.useContext(DataRouterContext);return et||invariant(!1),et}function useDataRouterState(o){let et=reactExports.useContext(DataRouterStateContext);return et||invariant(!1),et}function useRouteContext(o){let et=reactExports.useContext(RouteContext);return et||invariant(!1),et}function useCurrentRouteId(o){let et=useRouteContext(),tt=et.matches[et.matches.length-1];return tt.route.id||invariant(!1),tt.route.id}function useRouteError(){var o;let et=reactExports.useContext(RouteErrorContext),tt=useDataRouterState(DataRouterStateHook$1.UseRouteError),nt=useCurrentRouteId(DataRouterStateHook$1.UseRouteError);return et!==void 0?et:(o=tt.errors)==null?void 0:o[nt]}function useNavigateStable(){let{router:o}=useDataRouterContext(DataRouterHook$1.UseNavigateStable),et=useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable),tt=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>{tt.current=!0}),reactExports.useCallback(function(rt,ot){ot===void 0&&(ot={}),tt.current&&(typeof rt=="number"?o.navigate(rt):o.navigate(rt,_extends$1({fromRouteId:et},ot)))},[o,et])}const alreadyWarned={};function warnOnce(o,et){alreadyWarned[et]||(alreadyWarned[et]=!0,console.warn(et))}const logDeprecation=(o,et,tt)=>warnOnce(o,"⚠️ React Router Future Flag Warning: "+et+". "+("You can use the `"+o+"` future flag to opt-in early. ")+("For more information, see "+tt+"."));function logV6DeprecationWarnings(o,et){o!=null&&o.v7_startTransition||logDeprecation("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(o!=null&&o.v7_relativeSplatPath)&&!et&&logDeprecation("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function Navigate(o){let{to:et,replace:tt,state:nt,relative:rt}=o;useInRouterContext()||invariant(!1);let{future:ot,static:it}=reactExports.useContext(NavigationContext),{matches:st}=reactExports.useContext(RouteContext),{pathname:at}=useLocation(),ct=useNavigate(),lt=resolveTo(et,getResolveToMatches(st,ot.v7_relativeSplatPath),at,rt==="path"),dt=JSON.stringify(lt);return reactExports.useEffect(()=>ct(JSON.parse(dt),{replace:tt,state:nt,relative:rt}),[ct,dt,rt,tt,nt]),null}function Route(o){invariant(!1)}function Router(o){let{basename:et="/",children:tt=null,location:nt,navigationType:rt=Action.Pop,navigator:ot,static:it=!1,future:st}=o;useInRouterContext()&&invariant(!1);let at=et.replace(/^\/*/,"/"),ct=reactExports.useMemo(()=>({basename:at,navigator:ot,static:it,future:_extends$1({v7_relativeSplatPath:!1},st)}),[at,st,ot,it]);typeof nt=="string"&&(nt=parsePath(nt));let{pathname:lt="/",search:dt="",hash:ht="",state:pt=null,key:mt="default"}=nt,ft=reactExports.useMemo(()=>{let yt=stripBasename(lt,at);return yt==null?null:{location:{pathname:yt,search:dt,hash:ht,state:pt,key:mt},navigationType:rt}},[at,lt,dt,ht,pt,mt,rt]);return ft==null?null:reactExports.createElement(NavigationContext.Provider,{value:ct},reactExports.createElement(LocationContext.Provider,{children:tt,value:ft}))}function Routes(o){let{children:et,location:tt}=o;return useRoutes(createRoutesFromChildren(et),tt)}new Promise(()=>{});function createRoutesFromChildren(o,et){et===void 0&&(et=[]);let tt=[];return reactExports.Children.forEach(o,(nt,rt)=>{if(!reactExports.isValidElement(nt))return;let ot=[...et,rt];if(nt.type===reactExports.Fragment){tt.push.apply(tt,createRoutesFromChildren(nt.props.children,ot));return}nt.type!==Route&&invariant(!1),!nt.props.index||!nt.props.children||invariant(!1);let it={id:nt.props.id||ot.join("-"),caseSensitive:nt.props.caseSensitive,element:nt.props.element,Component:nt.props.Component,index:nt.props.index,path:nt.props.path,loader:nt.props.loader,action:nt.props.action,errorElement:nt.props.errorElement,ErrorBoundary:nt.props.ErrorBoundary,hasErrorBoundary:nt.props.ErrorBoundary!=null||nt.props.errorElement!=null,shouldRevalidate:nt.props.shouldRevalidate,handle:nt.props.handle,lazy:nt.props.lazy};nt.props.children&&(it.children=createRoutesFromChildren(nt.props.children,ot)),tt.push(it)}),tt}/** + * React Router DOM v6.28.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function _extends(){return _extends=Object.assign?Object.assign.bind():function(o){for(var et=1;et=0)&&(tt[rt]=o[rt]);return tt}function isModifiedEvent(o){return!!(o.metaKey||o.altKey||o.ctrlKey||o.shiftKey)}function shouldProcessLinkClick(o,et){return o.button===0&&(!et||et==="_self")&&!isModifiedEvent(o)}const _excluded=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],REACT_ROUTER_VERSION="6";try{window.__reactRouterVersion=REACT_ROUTER_VERSION}catch{}const START_TRANSITION="startTransition",startTransitionImpl=React$1[START_TRANSITION];function BrowserRouter(o){let{basename:et,children:tt,future:nt,window:rt}=o,ot=reactExports.useRef();ot.current==null&&(ot.current=createBrowserHistory({window:rt,v5Compat:!0}));let it=ot.current,[st,at]=reactExports.useState({action:it.action,location:it.location}),{v7_startTransition:ct}=nt||{},lt=reactExports.useCallback(dt=>{ct&&startTransitionImpl?startTransitionImpl(()=>at(dt)):at(dt)},[at,ct]);return reactExports.useLayoutEffect(()=>it.listen(lt),[it,lt]),reactExports.useEffect(()=>logV6DeprecationWarnings(nt),[nt]),reactExports.createElement(Router,{basename:et,children:tt,location:st.location,navigationType:st.action,navigator:it,future:nt})}const isBrowser$1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ABSOLUTE_URL_REGEX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Link=reactExports.forwardRef(function(et,tt){let{onClick:nt,relative:rt,reloadDocument:ot,replace:it,state:st,target:at,to:ct,preventScrollReset:lt,viewTransition:dt}=et,ht=_objectWithoutPropertiesLoose(et,_excluded),{basename:pt}=reactExports.useContext(NavigationContext),mt,ft=!1;if(typeof ct=="string"&&ABSOLUTE_URL_REGEX.test(ct)&&(mt=ct,isBrowser$1))try{let vt=new URL(window.location.href),bt=ct.startsWith("//")?new URL(vt.protocol+ct):new URL(ct),Et=stripBasename(bt.pathname,pt);bt.origin===vt.origin&&Et!=null?ct=Et+bt.search+bt.hash:ft=!0}catch{}let yt=useHref(ct,{relative:rt}),gt=useLinkClickHandler(ct,{replace:it,state:st,target:at,preventScrollReset:lt,relative:rt,viewTransition:dt});function xt(vt){nt&&nt(vt),vt.defaultPrevented||gt(vt)}return reactExports.createElement("a",_extends({},ht,{href:mt||yt,onClick:ft||ot?nt:xt,ref:tt,target:at}))});var DataRouterHook;(function(o){o.UseScrollRestoration="useScrollRestoration",o.UseSubmit="useSubmit",o.UseSubmitFetcher="useSubmitFetcher",o.UseFetcher="useFetcher",o.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(o){o.UseFetcher="useFetcher",o.UseFetchers="useFetchers",o.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function useLinkClickHandler(o,et){let{target:tt,replace:nt,state:rt,preventScrollReset:ot,relative:it,viewTransition:st}=et===void 0?{}:et,at=useNavigate(),ct=useLocation(),lt=useResolvedPath(o,{relative:it});return reactExports.useCallback(dt=>{if(shouldProcessLinkClick(dt,tt)){dt.preventDefault();let ht=nt!==void 0?nt:createPath(ct)===createPath(lt);at(o,{replace:ht,state:rt,preventScrollReset:ot,relative:it,viewTransition:st})}},[ct,at,lt,nt,rt,tt,o,ot,it,st])}function setRef(o,et){typeof o=="function"?o(et):o!=null&&(o.current=et)}function composeRefs(...o){return et=>o.forEach(tt=>setRef(tt,et))}function useComposedRefs(...o){return reactExports.useCallback(composeRefs(...o),o)}var Slot=reactExports.forwardRef((o,et)=>{const{children:tt,...nt}=o,rt=reactExports.Children.toArray(tt),ot=rt.find(isSlottable);if(ot){const it=ot.props.children,st=rt.map(at=>at===ot?reactExports.Children.count(it)>1?reactExports.Children.only(null):reactExports.isValidElement(it)?it.props.children:null:at);return jsxRuntimeExports.jsx(SlotClone,{...nt,ref:et,children:reactExports.isValidElement(it)?reactExports.cloneElement(it,void 0,st):null})}return jsxRuntimeExports.jsx(SlotClone,{...nt,ref:et,children:tt})});Slot.displayName="Slot";var SlotClone=reactExports.forwardRef((o,et)=>{const{children:tt,...nt}=o;if(reactExports.isValidElement(tt)){const rt=getElementRef$1(tt);return reactExports.cloneElement(tt,{...mergeProps(nt,tt.props),ref:et?composeRefs(et,rt):rt})}return reactExports.Children.count(tt)>1?reactExports.Children.only(null):null});SlotClone.displayName="SlotClone";var Slottable=({children:o})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:o});function isSlottable(o){return reactExports.isValidElement(o)&&o.type===Slottable}function mergeProps(o,et){const tt={...et};for(const nt in et){const rt=o[nt],ot=et[nt];/^on[A-Z]/.test(nt)?rt&&ot?tt[nt]=(...st)=>{ot(...st),rt(...st)}:rt&&(tt[nt]=rt):nt==="style"?tt[nt]={...rt,...ot}:nt==="className"&&(tt[nt]=[rt,ot].filter(Boolean).join(" "))}return{...o,...tt}}function getElementRef$1(o){var nt,rt;let et=(nt=Object.getOwnPropertyDescriptor(o.props,"ref"))==null?void 0:nt.get,tt=et&&"isReactWarning"in et&&et.isReactWarning;return tt?o.ref:(et=(rt=Object.getOwnPropertyDescriptor(o,"ref"))==null?void 0:rt.get,tt=et&&"isReactWarning"in et&&et.isReactWarning,tt?o.props.ref:o.props.ref||o.ref)}function r$1(o){var et,tt,nt="";if(typeof o=="string"||typeof o=="number")nt+=o;else if(typeof o=="object")if(Array.isArray(o))for(et=0;ettypeof o=="boolean"?"".concat(o):o===0?"0":o,cx=clsx$1,cva=(o,et)=>tt=>{var nt;if((et==null?void 0:et.variants)==null)return cx(o,tt==null?void 0:tt.class,tt==null?void 0:tt.className);const{variants:rt,defaultVariants:ot}=et,it=Object.keys(rt).map(ct=>{const lt=tt==null?void 0:tt[ct],dt=ot==null?void 0:ot[ct];if(lt===null)return null;const ht=falsyToString(lt)||falsyToString(dt);return rt[ct][ht]}),st=tt&&Object.entries(tt).reduce((ct,lt)=>{let[dt,ht]=lt;return ht===void 0||(ct[dt]=ht),ct},{}),at=et==null||(nt=et.compoundVariants)===null||nt===void 0?void 0:nt.reduce((ct,lt)=>{let{class:dt,className:ht,...pt}=lt;return Object.entries(pt).every(mt=>{let[ft,yt]=mt;return Array.isArray(yt)?yt.includes({...ot,...st}[ft]):{...ot,...st}[ft]===yt})?[...ct,dt,ht]:ct},[]);return cx(o,it,at,tt==null?void 0:tt.class,tt==null?void 0:tt.className)};function r(o){var et,tt,nt="";if(typeof o=="string"||typeof o=="number")nt+=o;else if(typeof o=="object")if(Array.isArray(o)){var rt=o.length;for(et=0;et{const et=createClassMap(o),{conflictingClassGroups:tt,conflictingClassGroupModifiers:nt}=o;return{getClassGroupId:it=>{const st=it.split(CLASS_PART_SEPARATOR);return st[0]===""&&st.length!==1&&st.shift(),getGroupRecursive(st,et)||getGroupIdForArbitraryProperty(it)},getConflictingClassGroupIds:(it,st)=>{const at=tt[it]||[];return st&&nt[it]?[...at,...nt[it]]:at}}},getGroupRecursive=(o,et)=>{var it;if(o.length===0)return et.classGroupId;const tt=o[0],nt=et.nextPart.get(tt),rt=nt?getGroupRecursive(o.slice(1),nt):void 0;if(rt)return rt;if(et.validators.length===0)return;const ot=o.join(CLASS_PART_SEPARATOR);return(it=et.validators.find(({validator:st})=>st(ot)))==null?void 0:it.classGroupId},arbitraryPropertyRegex=/^\[(.+)\]$/,getGroupIdForArbitraryProperty=o=>{if(arbitraryPropertyRegex.test(o)){const et=arbitraryPropertyRegex.exec(o)[1],tt=et==null?void 0:et.substring(0,et.indexOf(":"));if(tt)return"arbitrary.."+tt}},createClassMap=o=>{const{theme:et,prefix:tt}=o,nt={nextPart:new Map,validators:[]};return getPrefixedClassGroupEntries(Object.entries(o.classGroups),tt).forEach(([ot,it])=>{processClassesRecursively(it,nt,ot,et)}),nt},processClassesRecursively=(o,et,tt,nt)=>{o.forEach(rt=>{if(typeof rt=="string"){const ot=rt===""?et:getPart(et,rt);ot.classGroupId=tt;return}if(typeof rt=="function"){if(isThemeGetter(rt)){processClassesRecursively(rt(nt),et,tt,nt);return}et.validators.push({validator:rt,classGroupId:tt});return}Object.entries(rt).forEach(([ot,it])=>{processClassesRecursively(it,getPart(et,ot),tt,nt)})})},getPart=(o,et)=>{let tt=o;return et.split(CLASS_PART_SEPARATOR).forEach(nt=>{tt.nextPart.has(nt)||tt.nextPart.set(nt,{nextPart:new Map,validators:[]}),tt=tt.nextPart.get(nt)}),tt},isThemeGetter=o=>o.isThemeGetter,getPrefixedClassGroupEntries=(o,et)=>et?o.map(([tt,nt])=>{const rt=nt.map(ot=>typeof ot=="string"?et+ot:typeof ot=="object"?Object.fromEntries(Object.entries(ot).map(([it,st])=>[et+it,st])):ot);return[tt,rt]}):o,createLruCache=o=>{if(o<1)return{get:()=>{},set:()=>{}};let et=0,tt=new Map,nt=new Map;const rt=(ot,it)=>{tt.set(ot,it),et++,et>o&&(et=0,nt=tt,tt=new Map)};return{get(ot){let it=tt.get(ot);if(it!==void 0)return it;if((it=nt.get(ot))!==void 0)return rt(ot,it),it},set(ot,it){tt.has(ot)?tt.set(ot,it):rt(ot,it)}}},IMPORTANT_MODIFIER="!",createParseClassName=o=>{const{separator:et,experimentalParseClassName:tt}=o,nt=et.length===1,rt=et[0],ot=et.length,it=st=>{const at=[];let ct=0,lt=0,dt;for(let yt=0;ytlt?dt-lt:void 0;return{modifiers:at,hasImportantModifier:pt,baseClassName:mt,maybePostfixModifierPosition:ft}};return tt?st=>tt({className:st,parseClassName:it}):it},sortModifiers=o=>{if(o.length<=1)return o;const et=[];let tt=[];return o.forEach(nt=>{nt[0]==="["?(et.push(...tt.sort(),nt),tt=[]):tt.push(nt)}),et.push(...tt.sort()),et},createConfigUtils=o=>({cache:createLruCache(o.cacheSize),parseClassName:createParseClassName(o),...createClassGroupUtils(o)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(o,et)=>{const{parseClassName:tt,getClassGroupId:nt,getConflictingClassGroupIds:rt}=et,ot=[],it=o.trim().split(SPLIT_CLASSES_REGEX);let st="";for(let at=it.length-1;at>=0;at-=1){const ct=it[at],{modifiers:lt,hasImportantModifier:dt,baseClassName:ht,maybePostfixModifierPosition:pt}=tt(ct);let mt=!!pt,ft=nt(mt?ht.substring(0,pt):ht);if(!ft){if(!mt){st=ct+(st.length>0?" "+st:st);continue}if(ft=nt(ht),!ft){st=ct+(st.length>0?" "+st:st);continue}mt=!1}const yt=sortModifiers(lt).join(":"),gt=dt?yt+IMPORTANT_MODIFIER:yt,xt=gt+ft;if(ot.includes(xt))continue;ot.push(xt);const vt=rt(ft,mt);for(let bt=0;bt0?" "+st:st)}return st};function twJoin(){let o=0,et,tt,nt="";for(;o{if(typeof o=="string")return o;let et,tt="";for(let nt=0;ntdt(lt),o());return tt=createConfigUtils(ct),nt=tt.cache.get,rt=tt.cache.set,ot=st,st(at)}function st(at){const ct=nt(at);if(ct)return ct;const lt=mergeClassList(at,tt);return rt(at,lt),lt}return function(){return ot(twJoin.apply(null,arguments))}}const fromTheme=o=>{const et=tt=>tt[o]||[];return et.isThemeGetter=!0,et},arbitraryValueRegex=/^\[(?:([a-z-]+):)?(.+)\]$/i,fractionRegex=/^\d+\/\d+$/,stringLengths=new Set(["px","full","screen"]),tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isLength=o=>isNumber(o)||stringLengths.has(o)||fractionRegex.test(o),isArbitraryLength=o=>getIsArbitraryValue(o,"length",isLengthOnly),isNumber=o=>!!o&&!Number.isNaN(Number(o)),isArbitraryNumber=o=>getIsArbitraryValue(o,"number",isNumber),isInteger$1=o=>!!o&&Number.isInteger(Number(o)),isPercent=o=>o.endsWith("%")&&isNumber(o.slice(0,-1)),isArbitraryValue=o=>arbitraryValueRegex.test(o),isTshirtSize=o=>tshirtUnitRegex.test(o),sizeLabels=new Set(["length","size","percentage"]),isArbitrarySize=o=>getIsArbitraryValue(o,sizeLabels,isNever),isArbitraryPosition=o=>getIsArbitraryValue(o,"position",isNever),imageLabels=new Set(["image","url"]),isArbitraryImage=o=>getIsArbitraryValue(o,imageLabels,isImage),isArbitraryShadow=o=>getIsArbitraryValue(o,"",isShadow),isAny=()=>!0,getIsArbitraryValue=(o,et,tt)=>{const nt=arbitraryValueRegex.exec(o);return nt?nt[1]?typeof et=="string"?nt[1]===et:et.has(nt[1]):tt(nt[2]):!1},isLengthOnly=o=>lengthUnitRegex.test(o)&&!colorFunctionRegex.test(o),isNever=()=>!1,isShadow=o=>shadowRegex.test(o),isImage=o=>imageRegex.test(o),getDefaultConfig=()=>{const o=fromTheme("colors"),et=fromTheme("spacing"),tt=fromTheme("blur"),nt=fromTheme("brightness"),rt=fromTheme("borderColor"),ot=fromTheme("borderRadius"),it=fromTheme("borderSpacing"),st=fromTheme("borderWidth"),at=fromTheme("contrast"),ct=fromTheme("grayscale"),lt=fromTheme("hueRotate"),dt=fromTheme("invert"),ht=fromTheme("gap"),pt=fromTheme("gradientColorStops"),mt=fromTheme("gradientColorStopPositions"),ft=fromTheme("inset"),yt=fromTheme("margin"),gt=fromTheme("opacity"),xt=fromTheme("padding"),vt=fromTheme("saturate"),bt=fromTheme("scale"),Et=fromTheme("sepia"),wt=fromTheme("skew"),kt=fromTheme("space"),Tt=fromTheme("translate"),Rt=()=>["auto","contain","none"],Pt=()=>["auto","hidden","clip","visible","scroll"],$t=()=>["auto",isArbitraryValue,et],Ot=()=>[isArbitraryValue,et],Bt=()=>["",isLength,isArbitraryLength],zt=()=>["auto",isNumber,isArbitraryValue],Ft=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Yt=()=>["solid","dashed","dotted","double","none"],Ht=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ut=()=>["start","end","center","between","around","evenly","stretch"],qt=()=>["","0",isArbitraryValue],Lt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Zt=()=>[isNumber,isArbitraryValue];return{cacheSize:500,separator:":",theme:{colors:[isAny],spacing:[isLength,isArbitraryLength],blur:["none","",isTshirtSize,isArbitraryValue],brightness:Zt(),borderColor:[o],borderRadius:["none","","full",isTshirtSize,isArbitraryValue],borderSpacing:Ot(),borderWidth:Bt(),contrast:Zt(),grayscale:qt(),hueRotate:Zt(),invert:qt(),gap:Ot(),gradientColorStops:[o],gradientColorStopPositions:[isPercent,isArbitraryLength],inset:$t(),margin:$t(),opacity:Zt(),padding:Ot(),saturate:Zt(),scale:Zt(),sepia:qt(),skew:Zt(),space:Ot(),translate:Ot()},classGroups:{aspect:[{aspect:["auto","square","video",isArbitraryValue]}],container:["container"],columns:[{columns:[isTshirtSize]}],"break-after":[{"break-after":Lt()}],"break-before":[{"break-before":Lt()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ft(),isArbitraryValue]}],overflow:[{overflow:Pt()}],"overflow-x":[{"overflow-x":Pt()}],"overflow-y":[{"overflow-y":Pt()}],overscroll:[{overscroll:Rt()}],"overscroll-x":[{"overscroll-x":Rt()}],"overscroll-y":[{"overscroll-y":Rt()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[ft]}],"inset-x":[{"inset-x":[ft]}],"inset-y":[{"inset-y":[ft]}],start:[{start:[ft]}],end:[{end:[ft]}],top:[{top:[ft]}],right:[{right:[ft]}],bottom:[{bottom:[ft]}],left:[{left:[ft]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",isInteger$1,isArbitraryValue]}],basis:[{basis:$t()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",isArbitraryValue]}],grow:[{grow:qt()}],shrink:[{shrink:qt()}],order:[{order:["first","last","none",isInteger$1,isArbitraryValue]}],"grid-cols":[{"grid-cols":[isAny]}],"col-start-end":[{col:["auto",{span:["full",isInteger$1,isArbitraryValue]},isArbitraryValue]}],"col-start":[{"col-start":zt()}],"col-end":[{"col-end":zt()}],"grid-rows":[{"grid-rows":[isAny]}],"row-start-end":[{row:["auto",{span:[isInteger$1,isArbitraryValue]},isArbitraryValue]}],"row-start":[{"row-start":zt()}],"row-end":[{"row-end":zt()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",isArbitraryValue]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",isArbitraryValue]}],gap:[{gap:[ht]}],"gap-x":[{"gap-x":[ht]}],"gap-y":[{"gap-y":[ht]}],"justify-content":[{justify:["normal",...Ut()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ut(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ut(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[xt]}],px:[{px:[xt]}],py:[{py:[xt]}],ps:[{ps:[xt]}],pe:[{pe:[xt]}],pt:[{pt:[xt]}],pr:[{pr:[xt]}],pb:[{pb:[xt]}],pl:[{pl:[xt]}],m:[{m:[yt]}],mx:[{mx:[yt]}],my:[{my:[yt]}],ms:[{ms:[yt]}],me:[{me:[yt]}],mt:[{mt:[yt]}],mr:[{mr:[yt]}],mb:[{mb:[yt]}],ml:[{ml:[yt]}],"space-x":[{"space-x":[kt]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[kt]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",isArbitraryValue,et]}],"min-w":[{"min-w":[isArbitraryValue,et,"min","max","fit"]}],"max-w":[{"max-w":[isArbitraryValue,et,"none","full","min","max","fit","prose",{screen:[isTshirtSize]},isTshirtSize]}],h:[{h:[isArbitraryValue,et,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[isArbitraryValue,et,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[isArbitraryValue,et,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[isArbitraryValue,et,"auto","min","max","fit"]}],"font-size":[{text:["base",isTshirtSize,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",isArbitraryNumber]}],"font-family":[{font:[isAny]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",isArbitraryValue]}],"line-clamp":[{"line-clamp":["none",isNumber,isArbitraryNumber]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",isLength,isArbitraryValue]}],"list-image":[{"list-image":["none",isArbitraryValue]}],"list-style-type":[{list:["none","disc","decimal",isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[o]}],"placeholder-opacity":[{"placeholder-opacity":[gt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[o]}],"text-opacity":[{"text-opacity":[gt]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Yt(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",isLength,isArbitraryLength]}],"underline-offset":[{"underline-offset":["auto",isLength,isArbitraryValue]}],"text-decoration-color":[{decoration:[o]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Ot()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryValue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[gt]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ft(),isArbitraryPosition]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",isArbitrarySize]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},isArbitraryImage]}],"bg-color":[{bg:[o]}],"gradient-from-pos":[{from:[mt]}],"gradient-via-pos":[{via:[mt]}],"gradient-to-pos":[{to:[mt]}],"gradient-from":[{from:[pt]}],"gradient-via":[{via:[pt]}],"gradient-to":[{to:[pt]}],rounded:[{rounded:[ot]}],"rounded-s":[{"rounded-s":[ot]}],"rounded-e":[{"rounded-e":[ot]}],"rounded-t":[{"rounded-t":[ot]}],"rounded-r":[{"rounded-r":[ot]}],"rounded-b":[{"rounded-b":[ot]}],"rounded-l":[{"rounded-l":[ot]}],"rounded-ss":[{"rounded-ss":[ot]}],"rounded-se":[{"rounded-se":[ot]}],"rounded-ee":[{"rounded-ee":[ot]}],"rounded-es":[{"rounded-es":[ot]}],"rounded-tl":[{"rounded-tl":[ot]}],"rounded-tr":[{"rounded-tr":[ot]}],"rounded-br":[{"rounded-br":[ot]}],"rounded-bl":[{"rounded-bl":[ot]}],"border-w":[{border:[st]}],"border-w-x":[{"border-x":[st]}],"border-w-y":[{"border-y":[st]}],"border-w-s":[{"border-s":[st]}],"border-w-e":[{"border-e":[st]}],"border-w-t":[{"border-t":[st]}],"border-w-r":[{"border-r":[st]}],"border-w-b":[{"border-b":[st]}],"border-w-l":[{"border-l":[st]}],"border-opacity":[{"border-opacity":[gt]}],"border-style":[{border:[...Yt(),"hidden"]}],"divide-x":[{"divide-x":[st]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[st]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[gt]}],"divide-style":[{divide:Yt()}],"border-color":[{border:[rt]}],"border-color-x":[{"border-x":[rt]}],"border-color-y":[{"border-y":[rt]}],"border-color-s":[{"border-s":[rt]}],"border-color-e":[{"border-e":[rt]}],"border-color-t":[{"border-t":[rt]}],"border-color-r":[{"border-r":[rt]}],"border-color-b":[{"border-b":[rt]}],"border-color-l":[{"border-l":[rt]}],"divide-color":[{divide:[rt]}],"outline-style":[{outline:["",...Yt()]}],"outline-offset":[{"outline-offset":[isLength,isArbitraryValue]}],"outline-w":[{outline:[isLength,isArbitraryLength]}],"outline-color":[{outline:[o]}],"ring-w":[{ring:Bt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[o]}],"ring-opacity":[{"ring-opacity":[gt]}],"ring-offset-w":[{"ring-offset":[isLength,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":[o]}],shadow:[{shadow:["","inner","none",isTshirtSize,isArbitraryShadow]}],"shadow-color":[{shadow:[isAny]}],opacity:[{opacity:[gt]}],"mix-blend":[{"mix-blend":[...Ht(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Ht()}],filter:[{filter:["","none"]}],blur:[{blur:[tt]}],brightness:[{brightness:[nt]}],contrast:[{contrast:[at]}],"drop-shadow":[{"drop-shadow":["","none",isTshirtSize,isArbitraryValue]}],grayscale:[{grayscale:[ct]}],"hue-rotate":[{"hue-rotate":[lt]}],invert:[{invert:[dt]}],saturate:[{saturate:[vt]}],sepia:[{sepia:[Et]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[tt]}],"backdrop-brightness":[{"backdrop-brightness":[nt]}],"backdrop-contrast":[{"backdrop-contrast":[at]}],"backdrop-grayscale":[{"backdrop-grayscale":[ct]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt]}],"backdrop-invert":[{"backdrop-invert":[dt]}],"backdrop-opacity":[{"backdrop-opacity":[gt]}],"backdrop-saturate":[{"backdrop-saturate":[vt]}],"backdrop-sepia":[{"backdrop-sepia":[Et]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[it]}],"border-spacing-x":[{"border-spacing-x":[it]}],"border-spacing-y":[{"border-spacing-y":[it]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",isArbitraryValue]}],duration:[{duration:Zt()}],ease:[{ease:["linear","in","out","in-out",isArbitraryValue]}],delay:[{delay:Zt()}],animate:[{animate:["none","spin","ping","pulse","bounce",isArbitraryValue]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[bt]}],"scale-x":[{"scale-x":[bt]}],"scale-y":[{"scale-y":[bt]}],rotate:[{rotate:[isInteger$1,isArbitraryValue]}],"translate-x":[{"translate-x":[Tt]}],"translate-y":[{"translate-y":[Tt]}],"skew-x":[{"skew-x":[wt]}],"skew-y":[{"skew-y":[wt]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",isArbitraryValue]}],accent:[{accent:["auto",o]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",isArbitraryValue]}],"caret-color":[{caret:[o]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Ot()}],"scroll-mx":[{"scroll-mx":Ot()}],"scroll-my":[{"scroll-my":Ot()}],"scroll-ms":[{"scroll-ms":Ot()}],"scroll-me":[{"scroll-me":Ot()}],"scroll-mt":[{"scroll-mt":Ot()}],"scroll-mr":[{"scroll-mr":Ot()}],"scroll-mb":[{"scroll-mb":Ot()}],"scroll-ml":[{"scroll-ml":Ot()}],"scroll-p":[{"scroll-p":Ot()}],"scroll-px":[{"scroll-px":Ot()}],"scroll-py":[{"scroll-py":Ot()}],"scroll-ps":[{"scroll-ps":Ot()}],"scroll-pe":[{"scroll-pe":Ot()}],"scroll-pt":[{"scroll-pt":Ot()}],"scroll-pr":[{"scroll-pr":Ot()}],"scroll-pb":[{"scroll-pb":Ot()}],"scroll-pl":[{"scroll-pl":Ot()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",isArbitraryValue]}],fill:[{fill:[o,"none"]}],"stroke-w":[{stroke:[isLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:[o,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},twMerge=createTailwindMerge(getDefaultConfig);function cn(...o){return twMerge(clsx(o))}const buttonVariants=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Button=reactExports.forwardRef(({className:o,variant:et,size:tt,asChild:nt=!1,...rt},ot)=>{const it=nt?Slot:"button";return jsxRuntimeExports.jsx(it,{className:cn("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50","min-h-[44px] px-4 py-2 md:min-h-[36px] md:px-3 md:py-1.5",buttonVariants({variant:et,size:tt,className:o})),ref:ot,...rt})});Button.displayName="Button";function alloc$2(o=0){return new Uint8Array(o)}function allocUnsafe(o=0){return new Uint8Array(o)}const N1$1=Math.pow(2,7),N2$1=Math.pow(2,14),N3$1=Math.pow(2,21),N4$1=Math.pow(2,28),N5$1=Math.pow(2,35),N6$1=Math.pow(2,42),N7$1=Math.pow(2,49),MSB$2=128,REST$2=127;function encodingLength$3(o){if(oNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function encodeUint8Array(o,et,tt=0){switch(encodingLength$3(o)){case 8:et[tt++]=o&255|MSB$2,o/=128;case 7:et[tt++]=o&255|MSB$2,o/=128;case 6:et[tt++]=o&255|MSB$2,o/=128;case 5:et[tt++]=o&255|MSB$2,o/=128;case 4:et[tt++]=o&255|MSB$2,o>>>=7;case 3:et[tt++]=o&255|MSB$2,o>>>=7;case 2:et[tt++]=o&255|MSB$2,o>>>=7;case 1:{et[tt++]=o&255,o>>>=7;break}default:throw new Error("unreachable")}return et}function encodeUint8ArrayList(o,et,tt=0){switch(encodingLength$3(o)){case 8:et.set(tt++,o&255|MSB$2),o/=128;case 7:et.set(tt++,o&255|MSB$2),o/=128;case 6:et.set(tt++,o&255|MSB$2),o/=128;case 5:et.set(tt++,o&255|MSB$2),o/=128;case 4:et.set(tt++,o&255|MSB$2),o>>>=7;case 3:et.set(tt++,o&255|MSB$2),o>>>=7;case 2:et.set(tt++,o&255|MSB$2),o>>>=7;case 1:{et.set(tt++,o&255),o>>>=7;break}default:throw new Error("unreachable")}return et}function decodeUint8Array(o,et){let tt=o[et],nt=0;if(nt+=tt&REST$2,tt>>31>0){const tt=~this.lo+1>>>0;let nt=~this.hi>>>0;return tt===0&&(nt=nt+1>>>0),-(tt+nt*4294967296)}return this.lo+this.hi*4294967296}toBigInt(et=!1){if(et)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){const tt=~this.lo+1>>>0;let nt=~this.hi>>>0;return tt===0&&(nt=nt+1>>>0),-(BigInt(tt)+(BigInt(nt)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(et=!1){return this.toBigInt(et).toString()}zzEncode(){const et=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^et)>>>0,this.lo=(this.lo<<1^et)>>>0,this}zzDecode(){const et=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^et)>>>0,this.hi=(this.hi>>>1^et)>>>0,this}length(){const et=this.lo,tt=(this.lo>>>28|this.hi<<4)>>>0,nt=this.hi>>>24;return nt===0?tt===0?et<16384?et<128?1:2:et<2097152?3:4:tt<16384?tt<128?5:6:tt<2097152?7:8:nt<128?9:10}static fromBigInt(et){if(et===0n)return zero;if(etMIN_SAFE_NUMBER_INTEGER)return this.fromNumber(Number(et));const tt=et<0n;tt&&(et=-et);let nt=et>>32n,rt=et-(nt<<32n);return tt&&(nt=~nt|0n,rt=~rt|0n,++rt>TWO_32&&(rt=0n,++nt>TWO_32&&(nt=0n))),new Er(Number(rt),Number(nt))}static fromNumber(et){if(et===0)return zero;const tt=et<0;tt&&(et=-et);let nt=et>>>0,rt=(et-nt)/4294967296>>>0;return tt&&(rt=~rt>>>0,nt=~nt>>>0,++nt>4294967295&&(nt=0,++rt>4294967295&&(rt=0))),new Er(nt,rt)}static from(et){return typeof et=="number"?Er.fromNumber(et):typeof et=="bigint"?Er.fromBigInt(et):typeof et=="string"?Er.fromBigInt(BigInt(et)):et.low!=null||et.high!=null?new Er(et.low>>>0,et.high>>>0):zero}};const zero=new LongBits$2(0,0);zero.toBigInt=function(){return 0n};zero.zzEncode=zero.zzDecode=function(){return this};zero.length=function(){return 1};const TWO_32=4294967296n;function length$1(o){let et=0,tt=0;for(let nt=0;nt191&&st<224?ot[it++]=(st&31)<<6|o[et++]&63:st>239&&st<365?(st=((st&7)<<18|(o[et++]&63)<<12|(o[et++]&63)<<6|o[et++]&63)-65536,ot[it++]=55296+(st>>10),ot[it++]=56320+(st&1023)):ot[it++]=(st&15)<<12|(o[et++]&63)<<6|o[et++]&63,it>8191&&((rt??(rt=[])).push(String.fromCharCode.apply(String,ot)),it=0);return rt!=null?(it>0&&rt.push(String.fromCharCode.apply(String,ot.slice(0,it))),rt.join("")):String.fromCharCode.apply(String,ot.slice(0,it))}function write$2(o,et,tt){const nt=tt;let rt,ot;for(let it=0;it>6|192,et[tt++]=rt&63|128):(rt&64512)===55296&&((ot=o.charCodeAt(it+1))&64512)===56320?(rt=65536+((rt&1023)<<10)+(ot&1023),++it,et[tt++]=rt>>18|240,et[tt++]=rt>>12&63|128,et[tt++]=rt>>6&63|128,et[tt++]=rt&63|128):(et[tt++]=rt>>12|224,et[tt++]=rt>>6&63|128,et[tt++]=rt&63|128);return tt-nt}function indexOutOfRange$1(o,et){return RangeError(`index out of range: ${o.pos} + ${et??1} > ${o.len}`)}function readFixed32End(o,et){return(o[et-4]|o[et-3]<<8|o[et-2]<<16|o[et-1]<<24)>>>0}class Uint8ArrayReader{constructor(et){Ct(this,"buf");Ct(this,"pos");Ct(this,"len");Ct(this,"_slice",Uint8Array.prototype.subarray);this.buf=et,this.pos=0,this.len=et.length}uint32(){let et=4294967295;if(et=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(et=(et|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(et=(et|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(et=(et|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(et=(et|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return et;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange$1(this,10);return et}int32(){return this.uint32()|0}sint32(){const et=this.uint32();return et>>>1^-(et&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw indexOutOfRange$1(this,4);return readFixed32End(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw indexOutOfRange$1(this,4);return readFixed32End(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw indexOutOfRange$1(this,4);const et=readFloatLE(this.buf,this.pos);return this.pos+=4,et}double(){if(this.pos+8>this.len)throw indexOutOfRange$1(this,4);const et=readDoubleLE(this.buf,this.pos);return this.pos+=8,et}bytes(){const et=this.uint32(),tt=this.pos,nt=this.pos+et;if(nt>this.len)throw indexOutOfRange$1(this,et);return this.pos+=et,tt===nt?new Uint8Array(0):this.buf.subarray(tt,nt)}string(){const et=this.bytes();return read$2(et,0,et.length)}skip(et){if(typeof et=="number"){if(this.pos+et>this.len)throw indexOutOfRange$1(this,et);this.pos+=et}else do if(this.pos>=this.len)throw indexOutOfRange$1(this);while(this.buf[this.pos++]&128);return this}skipType(et){switch(et){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(et=this.uint32()&7)!==4;)this.skipType(et);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${et} at offset ${this.pos}`)}return this}readLongVarint(){const et=new LongBits$2(0,0);let tt=0;if(this.len-this.pos>4){for(;tt<4;++tt)if(et.lo=(et.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return et;if(et.lo=(et.lo|(this.buf[this.pos]&127)<<28)>>>0,et.hi=(et.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return et;tt=0}else{for(;tt<3;++tt){if(this.pos>=this.len)throw indexOutOfRange$1(this);if(et.lo=(et.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return et}return et.lo=(et.lo|(this.buf[this.pos++]&127)<>>0,et}if(this.len-this.pos>4){for(;tt<5;++tt)if(et.hi=(et.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return et}else for(;tt<5;++tt){if(this.pos>=this.len)throw indexOutOfRange$1(this);if(et.hi=(et.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return et}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange$1(this,8);const et=readFixed32End(this.buf,this.pos+=4),tt=readFixed32End(this.buf,this.pos+=4);return new LongBits$2(et,tt)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){const et=decodeUint8Array(this.buf,this.pos);return this.pos+=encodingLength$3(et),et}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}}function createReader(o){return new Uint8ArrayReader(o instanceof Uint8Array?o:o.subarray())}function decodeMessage(o,et,tt){const nt=createReader(o);return et.decode(nt,void 0,tt)}function equals$2(o,et){if(o===et)return!0;if(o.byteLength!==et.byteLength)return!1;for(let tt=0;tt=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),nt=0;nt>>0,bt=new Uint8Array(vt);gt!==xt;){for(var Et=mt[gt],wt=0,kt=vt-1;(Et!==0||wt>>0,bt[kt]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=wt,gt++}for(var Tt=vt-yt;Tt!==vt&&bt[Tt]===0;)Tt++;for(var Rt=at.repeat(ft);Tt>>0,vt=new Uint8Array(xt);mt[ft];){var bt=tt[mt.charCodeAt(ft)];if(bt===255)return;for(var Et=0,wt=xt-1;(bt!==0||Et>>0,vt[wt]=bt%256>>>0,bt=bt/256>>>0;if(bt!==0)throw new Error("Non-zero carry");gt=Et,ft++}if(mt[ft]!==" "){for(var kt=xt-gt;kt!==xt&&vt[kt]===0;)kt++;for(var Tt=new Uint8Array(yt+(xt-kt)),Rt=yt;kt!==xt;)Tt[Rt++]=vt[kt++];return Tt}}}function pt(mt){var ft=ht(mt);if(ft)return ft;throw new Error(`Non-${et} character`)}return{encode:dt,decodeUnsafe:ht,decode:pt}}var src$1=base$1,_brrp__multiformats_scope_baseX=src$1;let Encoder$2=class{constructor(et,tt,nt){Ct(this,"name");Ct(this,"prefix");Ct(this,"baseEncode");this.name=et,this.prefix=tt,this.baseEncode=nt}encode(et){if(et instanceof Uint8Array)return`${this.prefix}${this.baseEncode(et)}`;throw Error("Unknown type, must be binary type")}},Decoder$2=class{constructor(et,tt,nt){Ct(this,"name");Ct(this,"prefix");Ct(this,"baseDecode");Ct(this,"prefixCodePoint");this.name=et,this.prefix=tt;const rt=tt.codePointAt(0);if(rt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=rt,this.baseDecode=nt}decode(et){if(typeof et=="string"){if(et.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(et)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(et.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(et){return or$2(this,et)}};class ComposedDecoder{constructor(et){Ct(this,"decoders");this.decoders=et}or(et){return or$2(this,et)}decode(et){const tt=et[0],nt=this.decoders[tt];if(nt!=null)return nt.decode(et);throw RangeError(`Unable to decode multibase string ${JSON.stringify(et)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}function or$2(o,et){return new ComposedDecoder({...o.decoders??{[o.prefix]:o},...et.decoders??{[et.prefix]:et}})}class Codec{constructor(et,tt,nt,rt){Ct(this,"name");Ct(this,"prefix");Ct(this,"baseEncode");Ct(this,"baseDecode");Ct(this,"encoder");Ct(this,"decoder");this.name=et,this.prefix=tt,this.baseEncode=nt,this.baseDecode=rt,this.encoder=new Encoder$2(et,tt,nt),this.decoder=new Decoder$2(et,tt,rt)}encode(et){return this.encoder.encode(et)}decode(et){return this.decoder.decode(et)}}function from$2({name:o,prefix:et,encode:tt,decode:nt}){return new Codec(o,et,tt,nt)}function baseX({name:o,prefix:et,alphabet:tt}){const{encode:nt,decode:rt}=_brrp__multiformats_scope_baseX(tt,o);return from$2({prefix:et,name:o,encode:nt,decode:ot=>coerce(rt(ot))})}function decode$a(o,et,tt,nt){const rt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$9(o,et,tt){const nt=et[et.length-1]==="=",rt=(1<tt;)it-=tt,ot+=et[rt&st>>it];if(it!==0&&(ot+=et[rt&st<(o[tt]=et,o),[]),alphabetCharsToBytes=alphabet.reduce((o,et,tt)=>{const nt=et.codePointAt(0);if(nt==null)throw new Error(`Invalid character: ${et}`);return o[nt]=tt,o},[]);function encode$8(o){return o.reduce((et,tt)=>(et+=alphabetBytesToChars[tt],et),"")}function decode$9(o){const et=[];for(const tt of o){const nt=tt.codePointAt(0);if(nt==null)throw new Error(`Invalid character: ${tt}`);const rt=alphabetCharsToBytes[nt];if(rt==null)throw new Error(`Non-base256emoji character: ${tt}`);et.push(rt)}return new Uint8Array(et)}const base256emoji=from$2({prefix:"🚀",name:"base256emoji",encode:encode$8,decode:decode$9}),base256emoji$1=Object.freeze(Object.defineProperty({__proto__:null,base256emoji},Symbol.toStringTag,{value:"Module"})),base32$2=rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper=rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad=rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper=rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex=rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper=rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad=rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper=rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z=rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$3=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$2,base32hex,base32hexpad,base32hexpadupper,base32hexupper,base32pad,base32padupper,base32upper,base32z},Symbol.toStringTag,{value:"Module"})),base36=baseX({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper=baseX({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$1=Object.freeze(Object.defineProperty({__proto__:null,base36,base36upper},Symbol.toStringTag,{value:"Module"})),base58btc=baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr=baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58=Object.freeze(Object.defineProperty({__proto__:null,base58btc,base58flickr},Symbol.toStringTag,{value:"Module"})),base64$2=rfc4648({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad=rfc4648({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url=rfc4648({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad=rfc4648({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$3=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$2,base64pad,base64url,base64urlpad},Symbol.toStringTag,{value:"Module"})),base8=rfc4648({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$1=Object.freeze(Object.defineProperty({__proto__:null,base8},Symbol.toStringTag,{value:"Module"})),identity$1=from$2({prefix:"\0",name:"identity",encode:o=>toString$9(o),decode:o=>fromString$1(o)}),identityBase=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$1},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var encode_1=encode$7,MSB$1=128,REST$1=127,MSBALL=~REST$1,INT=Math.pow(2,31);function encode$7(o,et,tt){et=et||[],tt=tt||0;for(var nt=tt;o>=INT;)et[tt++]=o&255|MSB$1,o/=128;for(;o&MSBALL;)et[tt++]=o&255|MSB$1,o>>>=7;return et[tt]=o|0,encode$7.bytes=tt-nt+1,et}var decode$8=read$1,MSB$1$1=128,REST$1$1=127;function read$1(o,nt){var tt=0,nt=nt||0,rt=0,ot=nt,it,st=o.length;do{if(ot>=st)throw read$1.bytes=0,new RangeError("Could not decode varint");it=o[ot++],tt+=rt<28?(it&REST$1$1)<=MSB$1$1);return read$1.bytes=ot-nt,tt}var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63),length=function(o){return ocreate$3(this.code,nt))}else throw Error("Unknown type, must be binary type")}}function sha(o){return async et=>new Uint8Array(await crypto.subtle.digest(o,et))}const sha256=from$1({name:"sha2-256",code:18,encode:sha("SHA-256")});function format(o,et){const{bytes:tt,version:nt}=o;switch(nt){case 0:return toStringV0(tt,baseCache(o),et??base58btc.encoder);default:return toStringV1(tt,baseCache(o),et??base32$2.encoder)}}const cache$1=new WeakMap;function baseCache(o){const et=cache$1.get(o);if(et==null){const tt=new Map;return cache$1.set(o,tt),tt}return et}var Qs;class CID{constructor(et,tt,nt,rt){Ct(this,"code");Ct(this,"version");Ct(this,"multihash");Ct(this,"bytes");Ct(this,"/");Ct(this,Qs,"CID");this.code=tt,this.version=et,this.multihash=nt,this.bytes=rt,this["/"]=rt}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{const{code:et,multihash:tt}=this;if(et!==DAG_PB_CODE)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(tt.code!==SHA_256_CODE)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return CID.createV0(tt)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{const{code:et,digest:tt}=this.multihash,nt=create$3(et,tt);return CID.createV1(this.code,nt)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(et){return CID.equals(this,et)}static equals(et,tt){const nt=tt;return nt!=null&&et.code===nt.code&&et.version===nt.version&&equals$1(et.multihash,nt.multihash)}toString(et){return format(this,et)}toJSON(){return{"/":format(this)}}link(){return this}[(Qs=Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom"))](){return`CID(${this.toString()})`}static asCID(et){if(et==null)return null;const tt=et;if(tt instanceof CID)return tt;if(tt["/"]!=null&&tt["/"]===tt.bytes||tt.asCID===tt){const{version:nt,code:rt,multihash:ot,bytes:it}=tt;return new CID(nt,rt,ot,it??encodeCID(nt,rt,ot.bytes))}else if(tt[cidSymbol]===!0){const{version:nt,multihash:rt,code:ot}=tt,it=decode$6(rt);return CID.create(nt,ot,it)}else return null}static create(et,tt,nt){if(typeof tt!="number")throw new Error("String codecs are no longer supported");if(!(nt.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(et){case 0:{if(tt!==DAG_PB_CODE)throw new Error(`Version 0 CID must use dag-pb (code: ${DAG_PB_CODE}) block encoding`);return new CID(et,tt,nt,nt.bytes)}case 1:{const rt=encodeCID(et,tt,nt.bytes);return new CID(et,tt,nt,rt)}default:throw new Error("Invalid version")}}static createV0(et){return CID.create(0,DAG_PB_CODE,et)}static createV1(et,tt){return CID.create(1,et,tt)}static decode(et){const[tt,nt]=CID.decodeFirst(et);if(nt.length!==0)throw new Error("Incorrect length");return tt}static decodeFirst(et){const tt=CID.inspectBytes(et),nt=tt.size-tt.multihashSize,rt=coerce(et.subarray(nt,nt+tt.multihashSize));if(rt.byteLength!==tt.multihashSize)throw new Error("Incorrect length");const ot=rt.subarray(tt.multihashSize-tt.digestSize),it=new Digest(tt.multihashCode,tt.digestSize,ot,rt);return[tt.version===0?CID.createV0(it):CID.createV1(tt.codec,it),et.subarray(tt.size)]}static inspectBytes(et){let tt=0;const nt=()=>{const[dt,ht]=decode$7(et.subarray(tt));return tt+=ht,dt};let rt=nt(),ot=DAG_PB_CODE;if(rt===18?(rt=0,tt=0):ot=nt(),rt!==0&&rt!==1)throw new RangeError(`Invalid CID version ${rt}`);const it=tt,st=nt(),at=nt(),ct=tt+at,lt=ct-it;return{version:rt,codec:ot,multihashCode:st,digestSize:at,multihashSize:lt,size:ct}}static parse(et,tt){const[nt,rt]=parseCIDtoBytes(et,tt),ot=CID.decode(rt);if(ot.version===0&&et[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache(ot).set(nt,et),ot}}function parseCIDtoBytes(o,et){switch(o[0]){case"Q":{const tt=et??base58btc;return[base58btc.prefix,tt.decode(`${base58btc.prefix}${o}`)]}case base58btc.prefix:{const tt=et??base58btc;return[base58btc.prefix,tt.decode(o)]}case base32$2.prefix:{const tt=et??base32$2;return[base32$2.prefix,tt.decode(o)]}case base36.prefix:{const tt=et??base36;return[base36.prefix,tt.decode(o)]}default:{if(et==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[o[0],et.decode(o)]}}}function toStringV0(o,et,tt){const{prefix:nt}=tt;if(nt!==base58btc.prefix)throw Error(`Cannot string encode V0 in ${tt.name} encoding`);const rt=et.get(nt);if(rt==null){const ot=tt.encode(o).slice(1);return et.set(nt,ot),ot}else return rt}function toStringV1(o,et,tt){const{prefix:nt}=tt,rt=et.get(nt);if(rt==null){const ot=tt.encode(o);return et.set(nt,ot),ot}else return rt}const DAG_PB_CODE=112,SHA_256_CODE=18;function encodeCID(o,et,tt){const nt=encodingLength$2(o),rt=nt+encodingLength$2(et),ot=new Uint8Array(rt+tt.byteLength);return encodeTo(o,ot,0),encodeTo(et,ot,nt),ot.set(tt,rt),ot}const cidSymbol=Symbol.for("@ipld/js-cid/CID"),bases={...identityBase,...base2$1,...base8$1,...base10$1,...base16$1,...base32$3,...base36$1,...base58,...base64$3,...base256emoji$1};function createCodec$1(o,et,tt,nt){return{name:o,prefix:et,encoder:{name:o,prefix:et,encode:tt},decoder:{decode:nt}}}const string$4=createCodec$1("utf8","u",o=>"u"+new TextDecoder("utf8").decode(o),o=>new TextEncoder().encode(o.substring(1))),ascii=createCodec$1("ascii","a",o=>{let et="a";for(let tt=0;tt{o=o.substring(1);const et=allocUnsafe(o.length);for(let tt=0;tt4096)return allocUnsafe(it);rt+it>8192&&(nt=allocUnsafe(8192),rt=0);const st=nt.subarray(rt,rt+=it);return rt&7&&(rt=(rt|7)+1),st}}let Op$1=class{constructor(et,tt,nt){Ct(this,"fn");Ct(this,"len");Ct(this,"next");Ct(this,"val");this.fn=et,this.len=tt,this.next=void 0,this.val=nt}};function noop$2(){}let State$1=class{constructor(et){Ct(this,"head");Ct(this,"tail");Ct(this,"len");Ct(this,"next");this.head=et.head,this.tail=et.tail,this.len=et.len,this.next=et.states}};const bufferPool=pool$1();function alloc$1(o){return globalThis.Buffer!=null?allocUnsafe(o):bufferPool(o)}class Uint8ArrayWriter{constructor(){Ct(this,"len");Ct(this,"head");Ct(this,"tail");Ct(this,"states");this.len=0,this.head=new Op$1(noop$2,0,0),this.tail=this.head,this.states=null}_push(et,tt,nt){return this.tail=this.tail.next=new Op$1(et,tt,nt),this.len+=tt,this}uint32(et){return this.len+=(this.tail=this.tail.next=new VarintOp$1((et=et>>>0)<128?1:et<16384?2:et<2097152?3:et<268435456?4:5,et)).len,this}int32(et){return et<0?this._push(writeVarint64$1,10,LongBits$2.fromNumber(et)):this.uint32(et)}sint32(et){return this.uint32((et<<1^et>>31)>>>0)}uint64(et){const tt=LongBits$2.fromBigInt(et);return this._push(writeVarint64$1,tt.length(),tt)}uint64Number(et){return this._push(encodeUint8Array,encodingLength$3(et),et)}uint64String(et){return this.uint64(BigInt(et))}int64(et){return this.uint64(et)}int64Number(et){return this.uint64Number(et)}int64String(et){return this.uint64String(et)}sint64(et){const tt=LongBits$2.fromBigInt(et).zzEncode();return this._push(writeVarint64$1,tt.length(),tt)}sint64Number(et){const tt=LongBits$2.fromNumber(et).zzEncode();return this._push(writeVarint64$1,tt.length(),tt)}sint64String(et){return this.sint64(BigInt(et))}bool(et){return this._push(writeByte$1,1,et?1:0)}fixed32(et){return this._push(writeFixed32$1,4,et>>>0)}sfixed32(et){return this.fixed32(et)}fixed64(et){const tt=LongBits$2.fromBigInt(et);return this._push(writeFixed32$1,4,tt.lo)._push(writeFixed32$1,4,tt.hi)}fixed64Number(et){const tt=LongBits$2.fromNumber(et);return this._push(writeFixed32$1,4,tt.lo)._push(writeFixed32$1,4,tt.hi)}fixed64String(et){return this.fixed64(BigInt(et))}sfixed64(et){return this.fixed64(et)}sfixed64Number(et){return this.fixed64Number(et)}sfixed64String(et){return this.fixed64String(et)}float(et){return this._push(writeFloatLE,4,et)}double(et){return this._push(writeDoubleLE,8,et)}bytes(et){const tt=et.length>>>0;return tt===0?this._push(writeByte$1,1,0):this.uint32(tt)._push(writeBytes$1,tt,et)}string(et){const tt=length$1(et);return tt!==0?this.uint32(tt)._push(write$2,tt,et):this._push(writeByte$1,1,0)}fork(){return this.states=new State$1(this),this.head=this.tail=new Op$1(noop$2,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op$1(noop$2,0,0),this.len=0),this}ldelim(){const et=this.head,tt=this.tail,nt=this.len;return this.reset().uint32(nt),nt!==0&&(this.tail.next=et.next,this.tail=tt,this.len+=nt),this}finish(){let et=this.head.next;const tt=alloc$1(this.len);let nt=0;for(;et!=null;)et.fn(et.val,tt,nt),nt+=et.len,et=et.next;return tt}}function writeByte$1(o,et,tt){et[tt]=o&255}function writeVarint32$1(o,et,tt){for(;o>127;)et[tt++]=o&127|128,o>>>=7;et[tt]=o}let VarintOp$1=class extends Op$1{constructor(tt,nt){super(writeVarint32$1,tt,nt);Ct(this,"next");this.next=void 0}};function writeVarint64$1(o,et,tt){for(;o.hi!==0;)et[tt++]=o.lo&127|128,o.lo=(o.lo>>>7|o.hi<<25)>>>0,o.hi>>>=7;for(;o.lo>127;)et[tt++]=o.lo&127|128,o.lo=o.lo>>>7;et[tt++]=o.lo}function writeFixed32$1(o,et,tt){et[tt]=o&255,et[tt+1]=o>>>8&255,et[tt+2]=o>>>16&255,et[tt+3]=o>>>24}function writeBytes$1(o,et,tt){et.set(o,tt)}globalThis.Buffer!=null&&(Uint8ArrayWriter.prototype.bytes=function(o){const et=o.length>>>0;return this.uint32(et),et>0&&this._push(writeBytesBuffer,et,o),this},Uint8ArrayWriter.prototype.string=function(o){const et=globalThis.Buffer.byteLength(o);return this.uint32(et),et>0&&this._push(writeStringBuffer$1,et,o),this});function writeBytesBuffer(o,et,tt){et.set(o,tt)}function writeStringBuffer$1(o,et,tt){o.length<40?write$2(o,et,tt):et.utf8Write!=null?et.utf8Write(o,tt):et.set(fromString(o),tt)}function createWriter(){return new Uint8ArrayWriter}function encodeMessage(o,et){const tt=createWriter();return et.encode(o,tt,{lengthDelimited:!1}),tt.finish()}var CODEC_TYPES;(function(o){o[o.VARINT=0]="VARINT",o[o.BIT64=1]="BIT64",o[o.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",o[o.START_GROUP=3]="START_GROUP",o[o.END_GROUP=4]="END_GROUP",o[o.BIT32=5]="BIT32"})(CODEC_TYPES||(CODEC_TYPES={}));function createCodec(o,et,tt,nt){return{name:o,type:et,encode:tt,decode:nt}}function enumeration(o){function et(rt){if(o[rt.toString()]==null)throw new Error("Invalid enum value");return o[rt]}const tt=function(ot,it){const st=et(ot);it.int32(st)},nt=function(ot){const it=ot.int32();return et(it)};return createCodec("enum",CODEC_TYPES.VARINT,tt,nt)}function message$1(o,et){return createCodec("message",CODEC_TYPES.LENGTH_DELIMITED,o,et)}class MaxLengthError extends Error{constructor(){super(...arguments);Ct(this,"code","ERR_MAX_LENGTH");Ct(this,"name","MaxLengthError")}}class MaxSizeError extends Error{constructor(){super(...arguments);Ct(this,"code","ERR_MAX_SIZE");Ct(this,"name","MaxSizeError")}}var RateLimitProof$4;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(nt.uint32(10),nt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(nt.uint32(18),nt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(nt.uint32(26),nt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(nt.uint32(34),nt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(nt.uint32(42),nt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(nt.uint32(50),nt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(nt.uint32(58),nt.bytes(tt.rlnIdentifier)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={proof:alloc$2(0),merkleRoot:alloc$2(0),epoch:alloc$2(0),shareX:alloc$2(0),shareY:alloc$2(0),nullifier:alloc$2(0),rlnIdentifier:alloc$2(0)},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(RateLimitProof$4||(RateLimitProof$4={}));var WakuMessage$4;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(nt.uint32(10),nt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(nt.uint32(18),nt.string(tt.contentTopic)),tt.version!=null&&(nt.uint32(24),nt.uint32(tt.version)),tt.timestamp!=null&&(nt.uint32(80),nt.sint64(tt.timestamp)),tt.meta!=null&&(nt.uint32(90),nt.bytes(tt.meta)),tt.rateLimitProof!=null&&(nt.uint32(170),RateLimitProof$4.codec().encode(tt.rateLimitProof,nt)),tt.ephemeral!=null&&(nt.uint32(248),nt.bool(tt.ephemeral)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st;const ot={payload:alloc$2(0),contentTopic:""},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$4.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(WakuMessage$4||(WakuMessage$4={}));var FilterRequest;(function(o){(function(tt){let nt;tt.codec=()=>(nt==null&&(nt=message$1((rt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),rt.contentTopic!=null&&rt.contentTopic!==""&&(ot.uint32(10),ot.string(rt.contentTopic)),it.lengthDelimited!==!1&&ot.ldelim()},(rt,ot,it={})=>{const st={contentTopic:""},at=ot==null?rt.len:rt.pos+ot;for(;rt.pos>>3){case 1:{st.contentTopic=rt.string();break}default:{rt.skipType(ct&7);break}}}return st})),nt),tt.encode=rt=>encodeMessage(rt,tt.codec()),tt.decode=(rt,ot)=>decodeMessage(rt,tt.codec(),ot)})(o.ContentFilter||(o.ContentFilter={}));let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.subscribe!=null&&tt.subscribe!==!1&&(nt.uint32(8),nt.bool(tt.subscribe)),tt.topic!=null&&tt.topic!==""&&(nt.uint32(18),nt.string(tt.topic)),tt.contentFilters!=null)for(const ot of tt.contentFilters)nt.uint32(26),o.ContentFilter.codec().encode(ot,nt);rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at;const ot={subscribe:!1,topic:"",contentFilters:[]},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.subscribe=tt.bool();break}case 2:{ot.topic=tt.string();break}case 3:{if(((st=rt.limits)==null?void 0:st.contentFilters)!=null&&ot.contentFilters.length===rt.limits.contentFilters)throw new MaxLengthError('Decode error - map field "contentFilters" had too many elements');ot.contentFilters.push(o.ContentFilter.codec().decode(tt,tt.uint32(),{limits:(at=rt.limits)==null?void 0:at.contentFilters$}));break}default:{tt.skipType(ct&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(FilterRequest||(FilterRequest={}));var MessagePush$1;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.messages!=null)for(const ot of tt.messages)nt.uint32(10),WakuMessage$3.codec().encode(ot,nt);rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at;const ot={messages:[]},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{if(((st=rt.limits)==null?void 0:st.messages)!=null&&ot.messages.length===rt.limits.messages)throw new MaxLengthError('Decode error - map field "messages" had too many elements');ot.messages.push(WakuMessage$3.codec().decode(tt,tt.uint32(),{limits:(at=rt.limits)==null?void 0:at.messages$}));break}default:{tt.skipType(ct&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(MessagePush$1||(MessagePush$1={}));var FilterRpc;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.requestId!=null&&tt.requestId!==""&&(nt.uint32(10),nt.string(tt.requestId)),tt.request!=null&&(nt.uint32(18),FilterRequest.codec().encode(tt.request,nt)),tt.push!=null&&(nt.uint32(26),MessagePush$1.codec().encode(tt.push,nt)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at;const ot={requestId:""},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.requestId=tt.string();break}case 2:{ot.request=FilterRequest.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.request});break}case 3:{ot.push=MessagePush$1.codec().decode(tt,tt.uint32(),{limits:(at=rt.limits)==null?void 0:at.push});break}default:{tt.skipType(ct&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(FilterRpc||(FilterRpc={}));var RateLimitProof$3;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(nt.uint32(10),nt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(nt.uint32(18),nt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(nt.uint32(26),nt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(nt.uint32(34),nt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(nt.uint32(42),nt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(nt.uint32(50),nt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(nt.uint32(58),nt.bytes(tt.rlnIdentifier)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={proof:alloc$2(0),merkleRoot:alloc$2(0),epoch:alloc$2(0),shareX:alloc$2(0),shareY:alloc$2(0),nullifier:alloc$2(0),rlnIdentifier:alloc$2(0)},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(RateLimitProof$3||(RateLimitProof$3={}));var WakuMessage$3;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(nt.uint32(10),nt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(nt.uint32(18),nt.string(tt.contentTopic)),tt.version!=null&&(nt.uint32(24),nt.uint32(tt.version)),tt.timestamp!=null&&(nt.uint32(80),nt.sint64(tt.timestamp)),tt.meta!=null&&(nt.uint32(90),nt.bytes(tt.meta)),tt.rateLimitProof!=null&&(nt.uint32(170),RateLimitProof$3.codec().encode(tt.rateLimitProof,nt)),tt.ephemeral!=null&&(nt.uint32(248),nt.bool(tt.ephemeral)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st;const ot={payload:alloc$2(0),contentTopic:""},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$3.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(WakuMessage$3||(WakuMessage$3={}));var TopicOnlyMessage;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.contentTopic!=null&&tt.contentTopic!==""&&(nt.uint32(18),nt.string(tt.contentTopic)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={contentTopic:""},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 2:{ot.contentTopic=tt.string();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(TopicOnlyMessage||(TopicOnlyMessage={}));var FilterSubscribeRequest;(function(o){let et;(function(rt){rt.SUBSCRIBER_PING="SUBSCRIBER_PING",rt.SUBSCRIBE="SUBSCRIBE",rt.UNSUBSCRIBE="UNSUBSCRIBE",rt.UNSUBSCRIBE_ALL="UNSUBSCRIBE_ALL"})(et=o.FilterSubscribeType||(o.FilterSubscribeType={}));let tt;(function(rt){rt[rt.SUBSCRIBER_PING=0]="SUBSCRIBER_PING",rt[rt.SUBSCRIBE=1]="SUBSCRIBE",rt[rt.UNSUBSCRIBE=2]="UNSUBSCRIBE",rt[rt.UNSUBSCRIBE_ALL=3]="UNSUBSCRIBE_ALL"})(tt||(tt={})),function(rt){rt.codec=()=>enumeration(tt)}(et=o.FilterSubscribeType||(o.FilterSubscribeType={}));let nt;o.codec=()=>(nt==null&&(nt=message$1((rt,ot,it={})=>{if(it.lengthDelimited!==!1&&ot.fork(),rt.requestId!=null&&rt.requestId!==""&&(ot.uint32(10),ot.string(rt.requestId)),rt.filterSubscribeType!=null&&tt[rt.filterSubscribeType]!==0&&(ot.uint32(16),o.FilterSubscribeType.codec().encode(rt.filterSubscribeType,ot)),rt.pubsubTopic!=null&&(ot.uint32(82),ot.string(rt.pubsubTopic)),rt.contentTopics!=null)for(const st of rt.contentTopics)ot.uint32(90),ot.string(st);it.lengthDelimited!==!1&&ot.ldelim()},(rt,ot,it={})=>{var ct;const st={requestId:"",filterSubscribeType:et.SUBSCRIBER_PING,contentTopics:[]},at=ot==null?rt.len:rt.pos+ot;for(;rt.pos>>3){case 1:{st.requestId=rt.string();break}case 2:{st.filterSubscribeType=o.FilterSubscribeType.codec().decode(rt);break}case 10:{st.pubsubTopic=rt.string();break}case 11:{if(((ct=it.limits)==null?void 0:ct.contentTopics)!=null&&st.contentTopics.length===it.limits.contentTopics)throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');st.contentTopics.push(rt.string());break}default:{rt.skipType(lt&7);break}}}return st})),nt),o.encode=rt=>encodeMessage(rt,o.codec()),o.decode=(rt,ot)=>decodeMessage(rt,o.codec(),ot)})(FilterSubscribeRequest||(FilterSubscribeRequest={}));var FilterSubscribeResponse$1;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.requestId!=null&&tt.requestId!==""&&(nt.uint32(10),nt.string(tt.requestId)),tt.statusCode!=null&&tt.statusCode!==0&&(nt.uint32(80),nt.uint32(tt.statusCode)),tt.statusDesc!=null&&(nt.uint32(90),nt.string(tt.statusDesc)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={requestId:"",statusCode:0},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.requestId=tt.string();break}case 10:{ot.statusCode=tt.uint32();break}case 11:{ot.statusDesc=tt.string();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(FilterSubscribeResponse$1||(FilterSubscribeResponse$1={}));var MessagePush;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.wakuMessage!=null&&(nt.uint32(10),WakuMessage$2.codec().encode(tt.wakuMessage,nt)),tt.pubsubTopic!=null&&(nt.uint32(18),nt.string(tt.pubsubTopic)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st;const ot={},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.wakuMessage=WakuMessage$2.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.wakuMessage});break}case 2:{ot.pubsubTopic=tt.string();break}default:{tt.skipType(at&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(MessagePush||(MessagePush={}));var RateLimitProof$2;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(nt.uint32(10),nt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(nt.uint32(18),nt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(nt.uint32(26),nt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(nt.uint32(34),nt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(nt.uint32(42),nt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(nt.uint32(50),nt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(nt.uint32(58),nt.bytes(tt.rlnIdentifier)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={proof:alloc$2(0),merkleRoot:alloc$2(0),epoch:alloc$2(0),shareX:alloc$2(0),shareY:alloc$2(0),nullifier:alloc$2(0),rlnIdentifier:alloc$2(0)},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(RateLimitProof$2||(RateLimitProof$2={}));var WakuMessage$2;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(nt.uint32(10),nt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(nt.uint32(18),nt.string(tt.contentTopic)),tt.version!=null&&(nt.uint32(24),nt.uint32(tt.version)),tt.timestamp!=null&&(nt.uint32(80),nt.sint64(tt.timestamp)),tt.meta!=null&&(nt.uint32(90),nt.bytes(tt.meta)),tt.rateLimitProof!=null&&(nt.uint32(170),RateLimitProof$2.codec().encode(tt.rateLimitProof,nt)),tt.ephemeral!=null&&(nt.uint32(248),nt.bool(tt.ephemeral)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st;const ot={payload:alloc$2(0),contentTopic:""},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$2.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(WakuMessage$2||(WakuMessage$2={}));var PushRequest;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.pubsubTopic!=null&&tt.pubsubTopic!==""&&(nt.uint32(10),nt.string(tt.pubsubTopic)),tt.message!=null&&(nt.uint32(18),WakuMessage$1.codec().encode(tt.message,nt)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st;const ot={pubsubTopic:""},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.pubsubTopic=tt.string();break}case 2:{ot.message=WakuMessage$1.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.message});break}default:{tt.skipType(at&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(PushRequest||(PushRequest={}));var PushResponse;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.isSuccess!=null&&tt.isSuccess!==!1&&(nt.uint32(8),nt.bool(tt.isSuccess)),tt.info!=null&&(nt.uint32(18),nt.string(tt.info)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={isSuccess:!1},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.isSuccess=tt.bool();break}case 2:{ot.info=tt.string();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(PushResponse||(PushResponse={}));var PushRpc$1;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.requestId!=null&&tt.requestId!==""&&(nt.uint32(10),nt.string(tt.requestId)),tt.request!=null&&(nt.uint32(18),PushRequest.codec().encode(tt.request,nt)),tt.response!=null&&(nt.uint32(26),PushResponse.codec().encode(tt.response,nt)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at;const ot={requestId:""},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.requestId=tt.string();break}case 2:{ot.request=PushRequest.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.request});break}case 3:{ot.response=PushResponse.codec().decode(tt,tt.uint32(),{limits:(at=rt.limits)==null?void 0:at.response});break}default:{tt.skipType(ct&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(PushRpc$1||(PushRpc$1={}));var RateLimitProof$1;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(nt.uint32(10),nt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(nt.uint32(18),nt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(nt.uint32(26),nt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(nt.uint32(34),nt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(nt.uint32(42),nt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(nt.uint32(50),nt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(nt.uint32(58),nt.bytes(tt.rlnIdentifier)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={proof:alloc$2(0),merkleRoot:alloc$2(0),epoch:alloc$2(0),shareX:alloc$2(0),shareY:alloc$2(0),nullifier:alloc$2(0),rlnIdentifier:alloc$2(0)},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(RateLimitProof$1||(RateLimitProof$1={}));var WakuMessage$1;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(nt.uint32(10),nt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(nt.uint32(18),nt.string(tt.contentTopic)),tt.version!=null&&(nt.uint32(24),nt.uint32(tt.version)),tt.timestamp!=null&&(nt.uint32(80),nt.sint64(tt.timestamp)),tt.meta!=null&&(nt.uint32(90),nt.bytes(tt.meta)),tt.rateLimitProof!=null&&(nt.uint32(170),RateLimitProof$1.codec().encode(tt.rateLimitProof,nt)),tt.ephemeral!=null&&(nt.uint32(248),nt.bool(tt.ephemeral)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st;const ot={payload:alloc$2(0),contentTopic:""},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$1.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(WakuMessage$1||(WakuMessage$1={}));var WakuMessageKeyValue;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.messageHash!=null&&(nt.uint32(10),nt.bytes(tt.messageHash)),tt.message!=null&&(nt.uint32(18),WakuMessage.codec().encode(tt.message,nt)),tt.pubsubTopic!=null&&(nt.uint32(26),nt.string(tt.pubsubTopic)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st;const ot={},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.messageHash=tt.bytes();break}case 2:{ot.message=WakuMessage.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.message});break}case 3:{ot.pubsubTopic=tt.string();break}default:{tt.skipType(at&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(WakuMessageKeyValue||(WakuMessageKeyValue={}));var StoreQueryRequest$1;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.requestId!=null&&tt.requestId!==""&&(nt.uint32(10),nt.string(tt.requestId)),tt.includeData!=null&&tt.includeData!==!1&&(nt.uint32(16),nt.bool(tt.includeData)),tt.pubsubTopic!=null&&(nt.uint32(82),nt.string(tt.pubsubTopic)),tt.contentTopics!=null)for(const ot of tt.contentTopics)nt.uint32(90),nt.string(ot);if(tt.timeStart!=null&&(nt.uint32(96),nt.sint64(tt.timeStart)),tt.timeEnd!=null&&(nt.uint32(104),nt.sint64(tt.timeEnd)),tt.messageHashes!=null)for(const ot of tt.messageHashes)nt.uint32(162),nt.bytes(ot);tt.paginationCursor!=null&&(nt.uint32(410),nt.bytes(tt.paginationCursor)),tt.paginationForward!=null&&tt.paginationForward!==!1&&(nt.uint32(416),nt.bool(tt.paginationForward)),tt.paginationLimit!=null&&(nt.uint32(424),nt.uint64(tt.paginationLimit)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at;const ot={requestId:"",includeData:!1,contentTopics:[],messageHashes:[],paginationForward:!1},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.requestId=tt.string();break}case 2:{ot.includeData=tt.bool();break}case 10:{ot.pubsubTopic=tt.string();break}case 11:{if(((st=rt.limits)==null?void 0:st.contentTopics)!=null&&ot.contentTopics.length===rt.limits.contentTopics)throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');ot.contentTopics.push(tt.string());break}case 12:{ot.timeStart=tt.sint64();break}case 13:{ot.timeEnd=tt.sint64();break}case 20:{if(((at=rt.limits)==null?void 0:at.messageHashes)!=null&&ot.messageHashes.length===rt.limits.messageHashes)throw new MaxLengthError('Decode error - map field "messageHashes" had too many elements');ot.messageHashes.push(tt.bytes());break}case 51:{ot.paginationCursor=tt.bytes();break}case 52:{ot.paginationForward=tt.bool();break}case 53:{ot.paginationLimit=tt.uint64();break}default:{tt.skipType(ct&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(StoreQueryRequest$1||(StoreQueryRequest$1={}));var StoreQueryResponse$1;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.requestId!=null&&tt.requestId!==""&&(nt.uint32(10),nt.string(tt.requestId)),tt.statusCode!=null&&(nt.uint32(80),nt.uint32(tt.statusCode)),tt.statusDesc!=null&&(nt.uint32(90),nt.string(tt.statusDesc)),tt.messages!=null)for(const ot of tt.messages)nt.uint32(162),WakuMessageKeyValue.codec().encode(ot,nt);tt.paginationCursor!=null&&(nt.uint32(410),nt.bytes(tt.paginationCursor)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at;const ot={requestId:"",messages:[]},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.requestId=tt.string();break}case 10:{ot.statusCode=tt.uint32();break}case 11:{ot.statusDesc=tt.string();break}case 20:{if(((st=rt.limits)==null?void 0:st.messages)!=null&&ot.messages.length===rt.limits.messages)throw new MaxLengthError('Decode error - map field "messages" had too many elements');ot.messages.push(WakuMessageKeyValue.codec().decode(tt,tt.uint32(),{limits:(at=rt.limits)==null?void 0:at.messages$}));break}case 51:{ot.paginationCursor=tt.bytes();break}default:{tt.skipType(ct&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(StoreQueryResponse$1||(StoreQueryResponse$1={}));var RateLimitProof;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(nt.uint32(10),nt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(nt.uint32(18),nt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(nt.uint32(26),nt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(nt.uint32(34),nt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(nt.uint32(42),nt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(nt.uint32(50),nt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(nt.uint32(58),nt.bytes(tt.rlnIdentifier)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={proof:alloc$2(0),merkleRoot:alloc$2(0),epoch:alloc$2(0),shareX:alloc$2(0),shareY:alloc$2(0),nullifier:alloc$2(0),rlnIdentifier:alloc$2(0)},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(RateLimitProof||(RateLimitProof={}));var WakuMessage;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(nt.uint32(10),nt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(nt.uint32(18),nt.string(tt.contentTopic)),tt.version!=null&&(nt.uint32(24),nt.uint32(tt.version)),tt.timestamp!=null&&(nt.uint32(80),nt.sint64(tt.timestamp)),tt.meta!=null&&(nt.uint32(90),nt.bytes(tt.meta)),tt.rateLimitProof!=null&&(nt.uint32(170),RateLimitProof.codec().encode(tt.rateLimitProof,nt)),tt.ephemeral!=null&&(nt.uint32(248),nt.bool(tt.ephemeral)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st;const ot={payload:alloc$2(0),contentTopic:""},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(WakuMessage||(WakuMessage={}));var PeerInfo;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.enr!=null&&(nt.uint32(10),nt.bytes(tt.enr)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.enr=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(PeerInfo||(PeerInfo={}));var PeerExchangeQuery;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.numPeers!=null&&(nt.uint32(8),nt.uint64(tt.numPeers)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.numPeers=tt.uint64();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(PeerExchangeQuery||(PeerExchangeQuery={}));var PeerExchangeResponse;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.peerInfos!=null)for(const ot of tt.peerInfos)nt.uint32(10),PeerInfo.codec().encode(ot,nt);rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at;const ot={peerInfos:[]},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{if(((st=rt.limits)==null?void 0:st.peerInfos)!=null&&ot.peerInfos.length===rt.limits.peerInfos)throw new MaxLengthError('Decode error - map field "peerInfos" had too many elements');ot.peerInfos.push(PeerInfo.codec().decode(tt,tt.uint32(),{limits:(at=rt.limits)==null?void 0:at.peerInfos$}));break}default:{tt.skipType(ct&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(PeerExchangeResponse||(PeerExchangeResponse={}));var PeerExchangeRPC$1;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.query!=null&&(nt.uint32(10),PeerExchangeQuery.codec().encode(tt.query,nt)),tt.response!=null&&(nt.uint32(18),PeerExchangeResponse.codec().encode(tt.response,nt)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at;const ot={},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.query=PeerExchangeQuery.codec().decode(tt,tt.uint32(),{limits:(st=rt.limits)==null?void 0:st.query});break}case 2:{ot.response=PeerExchangeResponse.codec().decode(tt,tt.uint32(),{limits:(at=rt.limits)==null?void 0:at.response});break}default:{tt.skipType(ct&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(PeerExchangeRPC$1||(PeerExchangeRPC$1={}));var WakuMetadataRequest;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.clusterId!=null&&(nt.uint32(8),nt.uint32(tt.clusterId)),tt.shards!=null)for(const ot of tt.shards)nt.uint32(16),nt.uint32(ot);rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st;const ot={shards:[]},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.clusterId=tt.uint32();break}case 2:{if(((st=rt.limits)==null?void 0:st.shards)!=null&&ot.shards.length===rt.limits.shards)throw new MaxLengthError('Decode error - map field "shards" had too many elements');ot.shards.push(tt.uint32());break}default:{tt.skipType(at&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(WakuMetadataRequest||(WakuMetadataRequest={}));var WakuMetadataResponse;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.clusterId!=null&&(nt.uint32(8),nt.uint32(tt.clusterId)),tt.shards!=null)for(const ot of tt.shards)nt.uint32(16),nt.uint32(ot);rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st;const ot={shards:[]},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.clusterId=tt.uint32();break}case 2:{if(((st=rt.limits)==null?void 0:st.shards)!=null&&ot.shards.length===rt.limits.shards)throw new MaxLengthError('Decode error - map field "shards" had too many elements');ot.shards.push(tt.uint32());break}default:{tt.skipType(at&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(WakuMetadataResponse||(WakuMetadataResponse={}));function isDefined(o){return!!o}function groupByContentTopic(o){const et=new Map;return o.forEach(tt=>{let nt=et.get(tt.contentTopic);nt||(et.set(tt.contentTopic,[]),nt=et.get(tt.contentTopic)),nt.push(tt)}),et}const FRAME_RATE=60;async function toAsyncIterator(o,et,tt){const nt=FRAME_RATE,rt=[];let ot;ot=await o.subscribeWithUnsubscribe(et,lt=>{rt.push(lt)});const it=Number.isInteger(tt==null?void 0:tt.timeoutMs),st=0,at=Date.now();async function*ct(){for(;;){if(it&&Date.now()-at>=st)return;await wait(nt);const lt=rt.shift();if(!ot&&rt.length===0)return lt;!lt&&ot||(yield lt)}}return{iterator:ct(),async stop(){ot&&(await ot(),ot=void 0)}}}function wait(o){return new Promise(et=>{setTimeout(et,o)})}const MB=1024**2,SIZE_CAP_IN_MB=1;async function isMessageSizeUnderCap(o,et){const tt=await o.toWire(et);return tt?isWireSizeUnderCap(tt):!1}const isWireSizeUnderCap=o=>o.length/MB<=SIZE_CAP_IN_MB;var Protocols;(function(o){o.Relay="relay",o.Store="store",o.LightPush="lightpush",o.Filter="filter"})(Protocols||(Protocols={}));var ProtocolError$1;(function(o){o.GENERIC_FAIL="Generic error",o.ENCODE_FAILED="Failed to encode",o.DECODE_FAILED="Failed to decode",o.EMPTY_PAYLOAD="Payload is empty",o.SIZE_TOO_BIG="Size is too big",o.TOPIC_NOT_CONFIGURED="Topic not configured",o.TOPIC_DECODER_MISMATCH="Topic decoder mismatch",o.INVALID_DECODER_TOPICS="Invalid decoder topics",o.NO_PEER_AVAILABLE="No peer available",o.NO_STREAM_AVAILABLE="No stream available",o.NO_RESPONSE="No response received",o.REMOTE_PEER_REJECTED="Remote peer rejected",o.REQUEST_TIMEOUT="Request timeout",o.RLN_IDENTITY_MISSING="Identity credentials are not set",o.RLN_MEMBERSHIP_INDEX="Membership index is not set",o.RLN_LIMIT_MISSING="User message limit is not set",o.RLN_PROOF_GENERATION="Proof generation failed"})(ProtocolError$1||(ProtocolError$1={}));var Tags;(function(o){o.BOOTSTRAP="bootstrap",o.PEER_EXCHANGE="peer-exchange",o.LOCAL="local-peer-cache"})(Tags||(Tags={}));var EPeersByDiscoveryEvents;(function(o){o.PEER_DISCOVERY_BOOTSTRAP="peer:discovery:bootstrap",o.PEER_DISCOVERY_PEER_EXCHANGE="peer:discovery:peer-exchange",o.PEER_CONNECT_BOOTSTRAP="peer:connected:bootstrap",o.PEER_CONNECT_PEER_EXCHANGE="peer:connected:peer-exchange"})(EPeersByDiscoveryEvents||(EPeersByDiscoveryEvents={}));var EConnectionStateEvents;(function(o){o.CONNECTION_STATUS="waku:connection"})(EConnectionStateEvents||(EConnectionStateEvents={}));const DNS_DISCOVERY_TAG="@waku/bootstrap",DEFAULT_CLUSTER_ID=1,DefaultShardInfo={clusterId:DEFAULT_CLUSTER_ID,shards:[0,1,2,3,4,5,6,7,8]},DefaultNetworkConfig=DefaultShardInfo;var HealthStatus;(function(o){o.Unhealthy="Unhealthy",o.MinimallyHealthy="MinimallyHealthy",o.SufficientlyHealthy="SufficientlyHealthy"})(HealthStatus||(HealthStatus={}));function toString$8(o,et="utf8"){const tt=BASES[et];if(tt==null)throw new Error(`Unsupported encoding "${et}"`);return tt.encoder.encode(o).substring(1)}function hexToBytes$1(o){if(typeof o=="string"){const et=o.replace(/^0x/i,"");return fromString(et.toLowerCase(),"base16")}return o}function numberToBytes(o){const et=new ArrayBuffer(8),tt=new DataView(et);return typeof o=="number"?tt.setFloat64(0,o,!1):tt.setBigInt64(0,o,!1),new Uint8Array(et)}const bytesToHex$1=o=>toString$8(o,"base16"),bytesToUtf8=o=>toString$8(o,"utf8"),utf8ToBytes$1=o=>fromString(o,"utf8");function concat$2(o,et){const tt=o.reduce((ot,it)=>ot+it.length,0),nt=new Uint8Array(tt);let rt=0;for(const ot of o)nt.set(ot,rt),rt+=ot.length;return nt}function isStaticSharding(o){return"clusterId"in o&&"shards"in o&&!("contentTopics"in o)}function isAutoSharding(o){return"contentTopics"in o}function derivePubsubTopicsFromNetworkConfig(o){if(isStaticSharding(o)){if(o.shards.length===0)throw new Error("Invalid shards configuration: please provide at least one shard");return shardInfoToPubsubTopics(o)}else if(isAutoSharding(o)){if(o.contentTopics.length===0)throw new Error("Invalid content topics configuration: please provide at least one content topic");return o.contentTopics.map(et=>contentTopicToPubsubTopic(et,o.clusterId))}else throw new Error("Unknown shard config. Please use ShardInfo or ContentTopicInfo")}const singleShardInfoToPubsubTopic=o=>{if(o.shard===void 0)throw new Error("Invalid shard");return`/waku/2/rs/${o.clusterId??DEFAULT_CLUSTER_ID}/${o.shard}`},shardInfoToPubsubTopics=o=>{if("contentTopics"in o&&o.contentTopics)return Array.from(new Set(o.contentTopics.map(et=>contentTopicToPubsubTopic(et,o.clusterId))));if("shards"in o){if(o.shards===void 0)throw new Error("Invalid shard");return Array.from(new Set(o.shards.map(et=>`/waku/2/rs/${o.clusterId??DEFAULT_CLUSTER_ID}/${et}`)))}else{if("application"in o&&"version"in o)return[contentTopicToPubsubTopic(`/${o.application}/${o.version}/default/default`,o.clusterId)];throw new Error("Missing required configuration in shard parameters")}},pubsubTopicToSingleShardInfo=o=>{const et=o.split("/");if(et.length!=6||et[1]!=="waku"||et[2]!=="2"||et[3]!=="rs")throw new Error("Invalid pubsub topic");const tt=parseInt(et[4]),nt=parseInt(et[5]);if(isNaN(tt)||isNaN(nt))throw new Error("Invalid clusterId or shard");return{clusterId:tt,shard:nt}},pubsubTopicsToShardInfo=o=>{const et=new Set,tt=new Set;for(const ot of o){const{clusterId:it,shard:st}=pubsubTopicToSingleShardInfo(ot);et.add(`${it}:${st}`),tt.add(it)}if(et.size===0)throw new Error("No valid pubsub topics provided");if(tt.size>1)throw new Error("Pubsub topics from multiple cluster IDs are not supported");const nt=tt.values().next().value,rt=Array.from(et).map(ot=>parseInt(ot.split(":")[1]));return{clusterId:nt,shards:rt}};function ensurePubsubTopicIsConfigured(o,et){if(!et.includes(o))throw new Error(`Pubsub topic ${o} has not been configured on this instance. Configured topics are: ${et}. Please update your configuration by passing in the topic during Waku node instantiation.`)}function ensureValidContentTopic(o){const et=o.split("/");if(et.length<5||et.length>6)throw Error("Content topic format is invalid");let tt=0;if(et.length==6){if(tt=parseInt(et[1]),isNaN(tt))throw new Error("Invalid generation field in content topic");if(tt>0)throw new Error("Generation greater than 0 is not supported")}const nt=et.splice(-4);if(nt[0].length==0)throw new Error("Application field cannot be empty");if(nt[1].length==0)throw new Error("Version field cannot be empty");if(nt[2].length==0)throw new Error("Topic name field cannot be empty");if(nt[3].length==0)throw new Error("Encoding field cannot be empty");return{generation:tt,application:nt[0],version:nt[1],topicName:nt[2],encoding:nt[3]}}function contentTopicToShardIndex(o,et=8){const{application:tt,version:nt}=ensureValidContentTopic(o),rt=sha256$2(concat$2([utf8ToBytes$1(tt),utf8ToBytes$1(nt)])),ot=new DataView(rt.buffer.slice(-8));return Number(ot.getBigUint64(0,!1)%BigInt(et))}function contentTopicToPubsubTopic(o,et=DEFAULT_CLUSTER_ID,tt=8){if(!o)throw Error("Content topic must be specified");const nt=contentTopicToShardIndex(o,tt);return`/waku/2/rs/${et}/${nt}`}function determinePubsubTopic(o,et){return typeof et=="string"?et:(et==null?void 0:et.shard)!==void 0?singleShardInfoToPubsubTopic(et):contentTopicToPubsubTopic(o,(et==null?void 0:et.clusterId)??DEFAULT_CLUSTER_ID)}const decodeRelayShard=o=>{if(o=new Uint8Array(o),o.length<3)throw new Error("Insufficient data");const et=new DataView(o.buffer),tt=et.getUint16(0),nt=[];if(o.length===130)for(let rt=0;rt<1024;rt++){const ot=Math.floor(rt/8)+2,it=7-rt%8;et.getUint8(ot)&1<=o.length)throw new Error("Unexpected end of data");nt.push(et.getUint16(it))}}return{clusterId:tt,shards:nt}},encodeRelayShard=o=>{const{clusterId:et,shards:tt}=o,nt=tt.length>=64?130:3+2*tt.length,rt=new ArrayBuffer(nt),ot=new DataView(rt);if(ot.setUint16(0,et),tt.length>=64)for(const it of tt){const st=Math.floor(it/8)+2,at=7-it%8;ot.setUint8(st,ot.getUint8(st)|1<tt.toString().includes("ws")||tt.toString().includes("wss"));if(!et)throw new Error("No ws multiaddr found in the given addresses");return et}var browser={exports:{}},ms$1,hasRequiredMs;function requireMs(){if(hasRequiredMs)return ms$1;hasRequiredMs=1;var o=1e3,et=o*60,tt=et*60,nt=tt*24,rt=nt*7,ot=nt*365.25;ms$1=function(lt,dt){dt=dt||{};var ht=typeof lt;if(ht==="string"&<.length>0)return it(lt);if(ht==="number"&&isFinite(lt))return dt.long?at(lt):st(lt);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(lt))};function it(lt){if(lt=String(lt),!(lt.length>100)){var dt=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(lt);if(dt){var ht=parseFloat(dt[1]),pt=(dt[2]||"ms").toLowerCase();switch(pt){case"years":case"year":case"yrs":case"yr":case"y":return ht*ot;case"weeks":case"week":case"w":return ht*rt;case"days":case"day":case"d":return ht*nt;case"hours":case"hour":case"hrs":case"hr":case"h":return ht*tt;case"minutes":case"minute":case"mins":case"min":case"m":return ht*et;case"seconds":case"second":case"secs":case"sec":case"s":return ht*o;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return ht;default:return}}}}function st(lt){var dt=Math.abs(lt);return dt>=nt?Math.round(lt/nt)+"d":dt>=tt?Math.round(lt/tt)+"h":dt>=et?Math.round(lt/et)+"m":dt>=o?Math.round(lt/o)+"s":lt+"ms"}function at(lt){var dt=Math.abs(lt);return dt>=nt?ct(lt,dt,nt,"day"):dt>=tt?ct(lt,dt,tt,"hour"):dt>=et?ct(lt,dt,et,"minute"):dt>=o?ct(lt,dt,o,"second"):lt+" ms"}function ct(lt,dt,ht,pt){var mt=dt>=ht*1.5;return Math.round(lt/ht)+" "+pt+(mt?"s":"")}return ms$1}function setup$1(o){tt.debug=tt,tt.default=tt,tt.coerce=at,tt.disable=ot,tt.enable=rt,tt.enabled=it,tt.humanize=requireMs(),tt.destroy=ct,Object.keys(o).forEach(lt=>{tt[lt]=o[lt]}),tt.names=[],tt.skips=[],tt.formatters={};function et(lt){let dt=0;for(let ht=0;ht{if(wt==="%%")return"%";bt++;const Tt=tt.formatters[kt];if(typeof Tt=="function"){const Rt=yt[bt];wt=Tt.call(gt,Rt),yt.splice(bt,1),bt--}return wt}),tt.formatArgs.call(gt,yt),(gt.log||tt.log).apply(gt,yt)}return ft.namespace=lt,ft.useColors=tt.useColors(),ft.color=tt.selectColor(lt),ft.extend=nt,ft.destroy=tt.destroy,Object.defineProperty(ft,"enabled",{enumerable:!0,configurable:!1,get:()=>ht!==null?ht:(pt!==tt.namespaces&&(pt=tt.namespaces,mt=tt.enabled(lt)),mt),set:yt=>{ht=yt}}),typeof tt.init=="function"&&tt.init(ft),ft}function nt(lt,dt){const ht=tt(this.namespace+(typeof dt>"u"?":":dt)+lt);return ht.log=this.log,ht}function rt(lt){tt.save(lt),tt.namespaces=lt,tt.names=[],tt.skips=[];let dt;const ht=(typeof lt=="string"?lt:"").split(/[\s,]+/),pt=ht.length;for(dt=0;dt"-"+dt)].join(",");return tt.enable(""),lt}function it(lt){if(lt[lt.length-1]==="*")return!0;let dt,ht;for(dt=0,ht=tt.skips.length;dt{let lt=!1;return()=>{lt||(lt=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),et.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function rt(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let lt;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(lt=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(lt[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ot(lt){if(lt[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+lt[0]+(this.useColors?"%c ":" ")+"+"+o.exports.humanize(this.diff),!this.useColors)return;const dt="color: "+this.color;lt.splice(1,0,dt,"color: inherit");let ht=0,pt=0;lt[0].replace(/%[a-zA-Z%]/g,mt=>{mt!=="%%"&&(ht++,mt==="%c"&&(pt=ht))}),lt.splice(pt,0,dt)}et.log=console.debug||console.log||(()=>{});function it(lt){try{lt?et.storage.setItem("debug",lt):et.storage.removeItem("debug")}catch{}}function st(){let lt;try{lt=et.storage.getItem("debug")}catch{}return!lt&&typeof tt<"u"&&"env"in tt&&(lt=nt.DEBUG),lt}function at(){try{return localStorage}catch{}}o.exports=common$1(et);const{formatters:ct}=o.exports;ct.j=function(lt){try{return JSON.stringify(lt)}catch(dt){return"[UnexpectedJSONParseError]: "+dt.message}}})(browser,browser.exports);var browserExports=browser.exports;const debug=getDefaultExportFromCjs(browserExports),APP_NAME="waku";let Logger$1=class Zo{constructor(et){Ct(this,"_info");Ct(this,"_warn");Ct(this,"_error");this._info=debug(Zo.createDebugNamespace("info",et)),this._warn=debug(Zo.createDebugNamespace("warn",et)),this._error=debug(Zo.createDebugNamespace("error",et))}static createDebugNamespace(et,tt){return tt?`${APP_NAME}:${et}:${tt}`:`${APP_NAME}:${et}`}get info(){return this._info}get warn(){return this._warn}get error(){return this._error}log(et,...tt){const nt=this[et];nt(...tt)}};const log$o=new Logger$1("message:version-0"),OneMillion=BigInt(1e6),Version=0;class DecodedMessage{constructor(et,tt){Ct(this,"pubsubTopic");Ct(this,"proto");this.pubsubTopic=et,this.proto=tt}get ephemeral(){return!!this.proto.ephemeral}get payload(){return this.proto.payload}get contentTopic(){return this.proto.contentTopic}get _rawTimestamp(){return this.proto.timestamp}get timestamp(){try{if(this.proto.timestamp){const et=this.proto.timestamp/OneMillion;return new Date(Number(et))}return}catch{return}}get meta(){return this.proto.meta}get version(){return this.proto.version??0}get rateLimitProof(){return this.proto.rateLimitProof}}let Encoder$1=class{constructor(et,tt=!1,nt,rt){Ct(this,"contentTopic");Ct(this,"ephemeral");Ct(this,"pubsubTopic");Ct(this,"metaSetter");if(this.contentTopic=et,this.ephemeral=tt,this.pubsubTopic=nt,this.metaSetter=rt,!et||et==="")throw new Error("Content topic must be specified")}async toWire(et){return WakuMessage$4.encode(await this.toProtoObj(et))}async toProtoObj(et){const tt=et.timestamp??new Date,nt={payload:et.payload,version:Version,contentTopic:this.contentTopic,timestamp:BigInt(tt.valueOf())*OneMillion,meta:void 0,rateLimitProof:et.rateLimitProof,ephemeral:this.ephemeral};if(this.metaSetter){const rt=this.metaSetter(nt);return{...nt,meta:rt}}return nt}};function createEncoder({pubsubTopic:o,pubsubTopicShardInfo:et,contentTopic:tt,ephemeral:nt,metaSetter:rt}){return new Encoder$1(tt,nt,determinePubsubTopic(tt,o??et),rt)}let Decoder$1=class{constructor(et,tt){Ct(this,"pubsubTopic");Ct(this,"contentTopic");if(this.pubsubTopic=et,this.contentTopic=tt,!tt||tt==="")throw new Error("Content topic must be specified")}fromWireToProtoObj(et){const tt=WakuMessage$4.decode(et);return Promise.resolve({payload:tt.payload,contentTopic:tt.contentTopic,version:tt.version??void 0,timestamp:tt.timestamp??void 0,meta:tt.meta??void 0,rateLimitProof:tt.rateLimitProof??void 0,ephemeral:tt.ephemeral??!1})}async fromProtoObj(et,tt){return tt.version??Version!==0?(log$o.error("Failed to decode due to incorrect version, expected:",Version,", actual:",tt.version),Promise.resolve(void 0)):new DecodedMessage(et,tt)}};function createDecoder(o,et){return new Decoder$1(determinePubsubTopic(o,et),o)}function isAsyncIterable$8(o){return o[Symbol.asyncIterator]!=null}function all$2(o){if(isAsyncIterable$8(o))return(async()=>{const tt=[];for await(const nt of o)tt.push(nt);return tt})();const et=[];for(const tt of o)et.push(tt);return et}function asUint8Array(o){return o}function concat$1(o,et){et==null&&(et=o.reduce((rt,ot)=>rt+ot.length,0));const tt=allocUnsafe(et);let nt=0;for(const rt of o)tt.set(rt,nt),nt+=rt.length;return tt}function equals(o,et){if(o===et)return!0;if(o.byteLength!==et.byteLength)return!1;for(let tt=0;tt0&&this.appendAll(et)}*[(Ys=symbol$1,Symbol.iterator)](){yield*this.bufs}get byteLength(){return this.length}append(...et){this.appendAll(et)}appendAll(et){let tt=0;for(const nt of et)if(nt instanceof Uint8Array)tt+=nt.byteLength,this.bufs.push(nt);else if(isUint8ArrayList(nt))tt+=nt.byteLength,this.bufs.push(...nt.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=tt}prepend(...et){this.prependAll(et)}prependAll(et){let tt=0;for(const nt of et.reverse())if(nt instanceof Uint8Array)tt+=nt.byteLength,this.bufs.unshift(nt);else if(isUint8ArrayList(nt))tt+=nt.byteLength,this.bufs.unshift(...nt.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=tt}get(et){const tt=findBufAndOffset(this.bufs,et);return tt.buf[tt.index]}set(et,tt){const nt=findBufAndOffset(this.bufs,et);nt.buf[nt.index]=tt}write(et,tt=0){if(et instanceof Uint8Array)for(let nt=0;nt0;)if(et>=this.bufs[0].byteLength)et-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(et),this.length-=et;break}}}slice(et,tt){const{bufs:nt,length:rt}=this._subList(et,tt);return concat$1(nt,rt)}subarray(et,tt){const{bufs:nt,length:rt}=this._subList(et,tt);return nt.length===1?nt[0]:concat$1(nt,rt)}sublist(et,tt){const{bufs:nt,length:rt}=this._subList(et,tt),ot=new Uint8ArrayList;return ot.length=rt,ot.bufs=[...nt],ot}_subList(et,tt){if(et=et??0,tt=tt??this.length,et<0&&(et=this.length+et),tt<0&&(tt=this.length+tt),et<0||tt>this.length)throw new RangeError("index is out of bounds");if(et===tt)return{bufs:[],length:0};if(et===0&&tt===this.length)return{bufs:this.bufs,length:this.length};const nt=[];let rt=0;for(let ot=0;ot=at)continue;const ct=et>=st&&etst&&tt<=at;if(ct&<){if(et===st&&tt===at){nt.push(it);break}const dt=et-st;nt.push(it.subarray(dt,dt+(tt-et)));break}if(ct){if(et===0){nt.push(it);continue}nt.push(it.subarray(et-st));continue}if(lt){if(tt===at){nt.push(it);break}nt.push(it.subarray(0,tt-st));break}nt.push(it)}return{bufs:nt,length:tt-et}}indexOf(et,tt=0){if(!isUint8ArrayList(et)&&!(et instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');const nt=et instanceof Uint8Array?et:et.subarray();if(tt=Number(tt??0),isNaN(tt)&&(tt=0),tt<0&&(tt=this.length+tt),tt<0&&(tt=0),et.length===0)return tt>this.length?this.length:tt;const rt=nt.byteLength;if(rt===0)throw new TypeError("search must be at least 1 byte long");const ot=256,it=new Int32Array(ot);for(let dt=0;dt=0;ht--){const pt=this.get(dt+ht);if(nt[ht]!==pt){lt=Math.max(1,ht-st[pt]);break}}if(lt===0)return dt}return-1}getInt8(et){const tt=this.subarray(et,et+1);return new DataView(tt.buffer,tt.byteOffset,tt.byteLength).getInt8(0)}setInt8(et,tt){const nt=allocUnsafe(1);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setInt8(0,tt),this.write(nt,et)}getInt16(et,tt){const nt=this.subarray(et,et+2);return new DataView(nt.buffer,nt.byteOffset,nt.byteLength).getInt16(0,tt)}setInt16(et,tt,nt){const rt=alloc$2(2);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setInt16(0,tt,nt),this.write(rt,et)}getInt32(et,tt){const nt=this.subarray(et,et+4);return new DataView(nt.buffer,nt.byteOffset,nt.byteLength).getInt32(0,tt)}setInt32(et,tt,nt){const rt=alloc$2(4);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setInt32(0,tt,nt),this.write(rt,et)}getBigInt64(et,tt){const nt=this.subarray(et,et+8);return new DataView(nt.buffer,nt.byteOffset,nt.byteLength).getBigInt64(0,tt)}setBigInt64(et,tt,nt){const rt=alloc$2(8);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setBigInt64(0,tt,nt),this.write(rt,et)}getUint8(et){const tt=this.subarray(et,et+1);return new DataView(tt.buffer,tt.byteOffset,tt.byteLength).getUint8(0)}setUint8(et,tt){const nt=allocUnsafe(1);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setUint8(0,tt),this.write(nt,et)}getUint16(et,tt){const nt=this.subarray(et,et+2);return new DataView(nt.buffer,nt.byteOffset,nt.byteLength).getUint16(0,tt)}setUint16(et,tt,nt){const rt=alloc$2(2);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setUint16(0,tt,nt),this.write(rt,et)}getUint32(et,tt){const nt=this.subarray(et,et+4);return new DataView(nt.buffer,nt.byteOffset,nt.byteLength).getUint32(0,tt)}setUint32(et,tt,nt){const rt=alloc$2(4);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setUint32(0,tt,nt),this.write(rt,et)}getBigUint64(et,tt){const nt=this.subarray(et,et+8);return new DataView(nt.buffer,nt.byteOffset,nt.byteLength).getBigUint64(0,tt)}setBigUint64(et,tt,nt){const rt=alloc$2(8);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setBigUint64(0,tt,nt),this.write(rt,et)}getFloat32(et,tt){const nt=this.subarray(et,et+4);return new DataView(nt.buffer,nt.byteOffset,nt.byteLength).getFloat32(0,tt)}setFloat32(et,tt,nt){const rt=alloc$2(4);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setFloat32(0,tt,nt),this.write(rt,et)}getFloat64(et,tt){const nt=this.subarray(et,et+8);return new DataView(nt.buffer,nt.byteOffset,nt.byteLength).getFloat64(0,tt)}setFloat64(et,tt,nt){const rt=alloc$2(8);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setFloat64(0,tt,nt),this.write(rt,et)}equals(et){if(et==null||!(et instanceof Uint8ArrayList)||et.bufs.length!==this.bufs.length)return!1;for(let tt=0;ttrt+ot.byteLength,0)),nt.length=tt,nt}}function isAsyncIterable$7(o){return o[Symbol.asyncIterator]!=null}const defaultEncoder=o=>{const et=encodingLength$3(o),tt=allocUnsafe(et);return encode$a(o,tt),defaultEncoder.bytes=et,tt};defaultEncoder.bytes=0;function encode$5(o,et){et=et??{};const tt=et.lengthEncoder??defaultEncoder;function*nt(rt){const ot=tt(rt.byteLength);ot instanceof Uint8Array?yield ot:yield*ot,rt instanceof Uint8Array?yield rt:yield*rt}return isAsyncIterable$7(o)?async function*(){for await(const rt of o)yield*nt(rt)}():function*(){for(const rt of o)yield*nt(rt)}()}encode$5.single=(o,et)=>{et=et??{};const tt=et.lengthEncoder??defaultEncoder;return new Uint8ArrayList(tt(o.byteLength),o)};let InvalidMessageLengthError$1=class extends Error{constructor(){super(...arguments);Ct(this,"name","InvalidMessageLengthError");Ct(this,"code","ERR_INVALID_MSG_LENGTH")}},InvalidDataLengthError$1=class extends Error{constructor(){super(...arguments);Ct(this,"name","InvalidDataLengthError");Ct(this,"code","ERR_MSG_DATA_TOO_LONG")}},InvalidDataLengthLengthError$1=class extends Error{constructor(){super(...arguments);Ct(this,"name","InvalidDataLengthLengthError");Ct(this,"code","ERR_MSG_LENGTH_TOO_LONG")}},UnexpectedEOFError$1=class extends Error{constructor(){super(...arguments);Ct(this,"name","UnexpectedEOFError");Ct(this,"code","ERR_UNEXPECTED_EOF")}};const MAX_LENGTH_LENGTH=8,MAX_DATA_LENGTH=1024*1024*4;var ReadMode;(function(o){o[o.LENGTH=0]="LENGTH",o[o.DATA=1]="DATA"})(ReadMode||(ReadMode={}));const defaultDecoder=o=>{const et=decode$b(o);return defaultDecoder.bytes=encodingLength$3(et),et};defaultDecoder.bytes=0;function decode$5(o,et){const tt=new Uint8ArrayList;let nt=ReadMode.LENGTH,rt=-1;const ot=(et==null?void 0:et.lengthDecoder)??defaultDecoder,it=(et==null?void 0:et.maxLengthLength)??MAX_LENGTH_LENGTH,st=(et==null?void 0:et.maxDataLength)??MAX_DATA_LENGTH;function*at(){for(;tt.byteLength>0;){if(nt===ReadMode.LENGTH)try{if(rt=ot(tt),rt<0)throw new InvalidMessageLengthError$1("Invalid message length");if(rt>st)throw new InvalidDataLengthError$1("Message length too long");const ct=ot.bytes;tt.consume(ct),(et==null?void 0:et.onLength)!=null&&et.onLength(rt),nt=ReadMode.DATA}catch(ct){if(ct instanceof RangeError){if(tt.byteLength>it)throw new InvalidDataLengthLengthError$1("Message length length too long");break}throw ct}if(nt===ReadMode.DATA){if(tt.byteLength0)throw new UnexpectedEOFError$1("Unexpected end of input")}():function*(){for(const ct of o)tt.append(ct),yield*at();if(tt.byteLength>0)throw new UnexpectedEOFError$1("Unexpected end of input")}()}decode$5.fromReader=(o,et)=>{let tt=1;const nt=async function*(){for(;;)try{const{done:ot,value:it}=await o.next(tt);if(ot===!0)return;it!=null&&(yield it)}catch(ot){if(ot.code==="ERR_UNDER_READ")return{done:!0,value:null};throw ot}finally{tt=1}}();return decode$5(nt,{...et??{},onLength:ot=>{tt=ot}})};function pDefer(){const o={};return o.promise=new Promise((et,tt)=>{o.resolve=et,o.reject=tt}),o}class FixedFIFO{constructor(et){Ct(this,"buffer");Ct(this,"mask");Ct(this,"top");Ct(this,"btm");Ct(this,"next");if(!(et>0)||et-1&et)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(et),this.mask=et-1,this.top=0,this.btm=0,this.next=null}push(et){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=et,this.top=this.top+1&this.mask,!0)}shift(){const et=this.buffer[this.btm];if(et!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,et}isEmpty(){return this.buffer[this.btm]===void 0}}class FIFO{constructor(et={}){Ct(this,"size");Ct(this,"hwm");Ct(this,"head");Ct(this,"tail");this.hwm=et.splitLimit??16,this.head=new FixedFIFO(this.hwm),this.tail=this.head,this.size=0}calculateSize(et){return(et==null?void 0:et.byteLength)!=null?et.byteLength:1}push(et){if((et==null?void 0:et.value)!=null&&(this.size+=this.calculateSize(et.value)),!this.head.push(et)){const tt=this.head;this.head=tt.next=new FixedFIFO(2*this.head.buffer.length),this.head.push(et)}}shift(){let et=this.tail.shift();if(et===void 0&&this.tail.next!=null){const tt=this.tail.next;this.tail.next=null,this.tail=tt,et=this.tail.shift()}return(et==null?void 0:et.value)!=null&&(this.size-=this.calculateSize(et.value)),et}isEmpty(){return this.head.isEmpty()}}let AbortError$a=class extends Error{constructor(tt,nt){super(tt??"The operation was aborted");Ct(this,"type");Ct(this,"code");this.type="aborted",this.code=nt??"ABORT_ERR"}};function pushable(o={}){return _pushable(tt=>{const nt=tt.shift();if(nt==null)return{done:!0};if(nt.error!=null)throw nt.error;return{done:nt.done===!0,value:nt.value}},o)}function _pushable(o,et){et=et??{};let tt=et.onEnd,nt=new FIFO,rt,ot,it,st=pDefer();const at=async()=>{try{return nt.isEmpty()?it?{done:!0}:await new Promise((yt,gt)=>{ot=xt=>{ot=null,nt.push(xt);try{yt(o(nt))}catch(vt){gt(vt)}return rt}}):o(nt)}finally{nt.isEmpty()&&queueMicrotask(()=>{st.resolve(),st=pDefer()})}},ct=yt=>ot!=null?ot(yt):(nt.push(yt),rt),lt=yt=>(nt=new FIFO,ot!=null?ot({error:yt}):(nt.push({error:yt}),rt)),dt=yt=>{if(it)return rt;if((et==null?void 0:et.objectMode)!==!0&&(yt==null?void 0:yt.byteLength)==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return ct({done:!1,value:yt})},ht=yt=>it?rt:(it=!0,yt!=null?lt(yt):ct({done:!0})),pt=()=>(nt=new FIFO,ht(),{done:!0}),mt=yt=>(ht(yt),{done:!0});if(rt={[Symbol.asyncIterator](){return this},next:at,return:pt,throw:mt,push:dt,end:ht,get readableLength(){return nt.size},onEmpty:async yt=>{const gt=yt==null?void 0:yt.signal;if(gt==null||gt.throwIfAborted(),nt.isEmpty())return;let xt,vt;gt!=null&&(xt=new Promise((bt,Et)=>{vt=()=>{Et(new AbortError$a)},gt.addEventListener("abort",vt)}));try{await Promise.race([st.promise,xt])}finally{vt!=null&>!=null&&(gt==null||gt.removeEventListener("abort",vt))}}},tt==null)return rt;const ft=rt;return rt={[Symbol.asyncIterator](){return this},next(){return ft.next()},throw(yt){return ft.throw(yt),tt!=null&&(tt(yt),tt=void 0),{done:!0}},return(){return ft.return(),tt!=null&&(tt(),tt=void 0),{done:!0}},push:dt,end(yt){return ft.end(yt),tt!=null&&(tt(yt),tt=void 0),rt},get readableLength(){return ft.readableLength},onEmpty:yt=>ft.onEmpty(yt)},rt}function isAsyncIterable$6(o){return o[Symbol.asyncIterator]!=null}function merge$2(...o){const et=[];for(const tt of o)isAsyncIterable$6(tt)||et.push(tt);return et.length===o.length?function*(){for(const tt of et)yield*tt}():async function*(){const tt=pushable({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(o.map(async nt=>{for await(const rt of nt)tt.push(rt)})),tt.end()}catch(nt){tt.end(nt)}}),yield*tt}()}function pipe(o,...et){if(o==null)throw new Error("Empty pipeline");if(isDuplex(o)){const nt=o;o=()=>nt.source}else if(isIterable(o)||isAsyncIterable$5(o)){const nt=o;o=()=>nt}const tt=[o,...et];if(tt.length>1&&isDuplex(tt[tt.length-1])&&(tt[tt.length-1]=tt[tt.length-1].sink),tt.length>2)for(let nt=1;nt{let et;for(;o.length>0;)et=o.shift()(et);return et},isAsyncIterable$5=o=>(o==null?void 0:o[Symbol.asyncIterator])!=null,isIterable=o=>(o==null?void 0:o[Symbol.iterator])!=null,isDuplex=o=>o==null?!1:o.sink!=null&&o.source!=null,duplexPipelineFn=o=>et=>{const tt=o.sink(et);if((tt==null?void 0:tt.then)!=null){const nt=pushable({objectMode:!0});tt.then(()=>{nt.end()},it=>{nt.end(it)});let rt;const ot=o.source;if(isAsyncIterable$5(ot))rt=async function*(){yield*ot,nt.end()};else if(isIterable(ot))rt=function*(){yield*ot,nt.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return merge$2(nt,rt())}return o.source};async function sortPeersByLatency(o,et){return et.length===0?[]:(await Promise.all(et.map(async rt=>{try{const ot=(await o.get(rt.id)).metadata.get("ping");if(!ot)return{peer:rt,ping:1/0};const it=Number(bytesToUtf8(ot));return{peer:rt,ping:it}}catch{return{peer:rt,ping:1/0}}}))).filter(rt=>rt!==null).sort((rt,ot)=>rt.ping-ot.ping).map(rt=>rt.peer)}async function getPeersForProtocol(o,et){const tt=[];return await o.forEach(nt=>{for(let rt=0;rtit.tags.has(Tags.BOOTSTRAP)).slice(0,tt);et>0&&et!it.tags.has(Tags.BOOTSTRAP));if(et===0)return[...nt,...rt];const ot=[...nt];for(;ot.length0;){const it=Math.floor(Math.random()*rt.length),st=rt.splice(it,1)[0];ot.push(st)}return ot}function selectOpenConnection(o){return o.filter(et=>et.status==="open").sort((et,tt)=>tt.timeline.open-et.timeline.open).at(0)}const STREAM_LOCK_KEY="consumed";class StreamManager{constructor(et,tt,nt){Ct(this,"multicodec");Ct(this,"getConnections");Ct(this,"addEventListener");Ct(this,"log");Ct(this,"ongoingCreation",new Set);Ct(this,"streamPool",new Map);Ct(this,"handlePeerUpdateStreamPool",et=>{const{peer:tt}=et.detail;!tt.protocols.includes(this.multicodec)||this.getOpenStreamForCodec(tt.id)||this.scheduleNewStream(tt)});this.multicodec=et,this.getConnections=tt,this.addEventListener=nt,this.log=new Logger$1(`stream-manager:${et}`),this.addEventListener("peer:update",this.handlePeerUpdateStreamPool)}async getStream(et){const tt=et.id.toString(),nt=this.streamPool.get(tt);nt&&(this.streamPool.delete(tt),await nt);let rt=this.getOpenStreamForCodec(et.id);return rt?(this.log.info(`Found existing stream peerId=${et.id.toString()} multicodec=${this.multicodec}`),this.lockStream(et.id.toString(),rt),rt):(rt=await this.createStream(et),this.lockStream(et.id.toString(),rt),rt)}async createStream(et,tt=0){const nt=this.getConnections(et.id),rt=selectOpenConnection(nt);if(!rt)throw new Error(`Failed to get a connection to the peer peerId=${et.id.toString()} multicodec=${this.multicodec}`);let ot,it;for(let st=0;stit.protocol===this.multicodec);if(!(!rt||["done","closed","closing"].includes(rt.writeStatus||"")||this.isStreamLocked(rt)))return rt}lockStream(et,tt){this.log.info(`Locking stream for peerId:${et} streamId:${tt.id}`),tt.metadata[STREAM_LOCK_KEY]=!0}isStreamLocked(et){return!!et.metadata[STREAM_LOCK_KEY]}}class BaseProtocol{constructor(et,tt,nt,rt){Ct(this,"multicodec");Ct(this,"components");Ct(this,"log");Ct(this,"pubsubTopics");Ct(this,"addLibp2pEventListener");Ct(this,"removeLibp2pEventListener");Ct(this,"streamManager");this.multicodec=et,this.components=tt,this.log=nt,this.pubsubTopics=rt,this.addLibp2pEventListener=tt.events.addEventListener.bind(tt.events),this.removeLibp2pEventListener=tt.events.removeEventListener.bind(tt.events),this.streamManager=new StreamManager(et,tt.connectionManager.getConnections.bind(tt.connectionManager),this.addLibp2pEventListener)}async getStream(et){return this.streamManager.getStream(et)}async allPeers(){return getPeersForProtocol(this.components.peerStore,[this.multicodec])}async connectedPeers(){return(await this.allPeers()).filter(tt=>this.components.connectionManager.getConnections(tt.id).length>0)}async getPeers({numPeers:et,maxBootstrapPeers:tt}={maxBootstrapPeers:0,numPeers:0}){const nt=await this.connectedPeers(),rt=filterPeersByDiscovery(nt,et,tt),ot=await sortPeersByLatency(this.components.peerStore,rt);return ot.length===0&&this.log.warn("No peers found. Ensure you have a connection to the network."),ot.length{log$n.error("Failed to register ",FilterCodecs.PUSH,ot)})}async subscribe(tt,nt,rt){const ot=await this.getStream(nt),it=FilterSubscribeRpc.createSubscribeRequest(tt,rt);let st;try{st=await pipe([it.encode()],encode$5,ot,decode$5,async dt=>await all$2(dt))}catch(dt){return log$n.error("Failed to send subscribe request",dt),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:nt.id}}}const{statusCode:at,requestId:ct,statusDesc:lt}=FilterSubscribeResponse.decode(st[0].slice());return at<200||at>=300?(log$n.error(`Filter subscribe request ${ct} failed with status code ${at}: ${lt}`),{failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:nt.id},success:null}):{failure:null,success:nt.id}}async unsubscribe(tt,nt,rt){let ot;try{ot=await this.getStream(nt)}catch(st){return log$n.error(`Failed to get a stream for remote peer${nt.id.toString()}`,st),{success:null,failure:{error:ProtocolError$1.NO_STREAM_AVAILABLE,peerId:nt.id}}}const it=FilterSubscribeRpc.createUnsubscribeRequest(tt,rt);try{await pipe([it.encode()],encode$5,ot.sink)}catch(st){return log$n.error("Failed to send unsubscribe request",st),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:nt.id}}}return{success:nt.id,failure:null}}async unsubscribeAll(tt,nt){const rt=await this.getStream(nt),ot=FilterSubscribeRpc.createUnsubscribeAllRequest(tt),it=await pipe([ot.encode()],encode$5,rt,decode$5,async lt=>await all$2(lt));if(!it||!it.length)return{failure:{error:ProtocolError$1.NO_RESPONSE,peerId:nt.id},success:null};const{statusCode:st,requestId:at,statusDesc:ct}=FilterSubscribeResponse.decode(it[0].slice());return st<200||st>=300?(log$n.error(`Filter unsubscribe all request ${at} failed with status code ${st}: ${ct}`),{failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:nt.id},success:null}):{failure:null,success:nt.id}}async ping(tt){let nt;try{nt=await this.getStream(tt)}catch(ct){return log$n.error(`Failed to get a stream for remote peer${tt.id.toString()}`,ct),{success:null,failure:{error:ProtocolError$1.NO_STREAM_AVAILABLE,peerId:tt.id}}}const rt=FilterSubscribeRpc.createSubscriberPingRequest();let ot;try{ot=await pipe([rt.encode()],encode$5,nt,decode$5,async ct=>await all$2(ct))}catch(ct){return log$n.error("Failed to send ping request",ct),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:tt.id}}}if(!ot||!ot.length)return{success:null,failure:{error:ProtocolError$1.NO_RESPONSE,peerId:tt.id}};const{statusCode:it,requestId:st,statusDesc:at}=FilterSubscribeResponse.decode(ot[0].slice());return it<200||it>=300?(log$n.error(`Filter ping request ${st} failed with status code ${it}: ${at}`),{success:null,failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:tt.id}}):{success:tt.id,failure:null}}onRequest(tt){const{connection:nt,stream:rt}=tt,{remotePeer:ot}=nt;log$n.info(`Received message from ${ot.toString()}`);try{pipe(rt,decode$5,async it=>{for await(const st of it){const at=FilterPushRpc.decode(st.slice()),{pubsubTopic:ct,wakuMessage:lt}=at;if(!lt){log$n.error("Received empty message");return}if(!ct){log$n.error("Pubsub topic missing from push message");return}await this.handleIncomingMessage(ct,lt,nt.remotePeer.toString())}}).then(()=>{log$n.info("Receiving pipe closed.")},async it=>{log$n.error(`Error with receiving pipe on peer:${nt.remotePeer.toString()} -- stream:${rt.id} -- protocol:${rt.protocol}: `,it)})}catch(it){log$n.error("Error decoding message",it)}}}class PushRpc{constructor(et){Ct(this,"proto");this.proto=et}static createRequest(et,tt){return new PushRpc({requestId:v4$2(),request:{message:et,pubsubTopic:tt},response:void 0})}static decode(et){const tt=PushRpc$1.decode(et);return new PushRpc(tt)}encode(){return PushRpc$1.encode(this.proto)}get query(){return this.proto.request}get response(){return this.proto.response}}const RLN_GENERATION_PREFIX_ERROR="could not generate rln-v2 proof",isRLNResponseError=o=>o?o.includes(RLN_GENERATION_PREFIX_ERROR):!1,matchRLNErrorMessage=o=>{const et={[ProtocolError$1.RLN_IDENTITY_MISSING]:ProtocolError$1.RLN_IDENTITY_MISSING,[ProtocolError$1.RLN_MEMBERSHIP_INDEX]:ProtocolError$1.RLN_MEMBERSHIP_INDEX,[ProtocolError$1.RLN_LIMIT_MISSING]:ProtocolError$1.RLN_LIMIT_MISSING},tt=o.toLowerCase();for(const nt in et)if(tt.includes(nt.toLowerCase()))return et[nt];return ProtocolError$1.RLN_PROOF_GENERATION},log$m=new Logger$1("light-push"),LightPushCodec="/vac/waku/lightpush/2.0.0-beta1";class LightPushCore extends BaseProtocol{constructor(tt,nt){super(LightPushCodec,nt.components,log$m,tt);Ct(this,"pubsubTopics");this.pubsubTopics=tt}async preparePushMessage(tt,nt){try{if(!nt.payload||nt.payload.length===0)return log$m.error("Failed to send waku light push: payload is empty"),{query:null,error:ProtocolError$1.EMPTY_PAYLOAD};if(!await isMessageSizeUnderCap(tt,nt))return log$m.error("Failed to send waku light push: message is bigger than 1MB"),{query:null,error:ProtocolError$1.SIZE_TOO_BIG};const rt=await tt.toProtoObj(nt);return rt?{query:PushRpc.createRequest(rt,tt.pubsubTopic),error:null}:(log$m.error("Failed to encode to protoMessage, aborting push"),{query:null,error:ProtocolError$1.ENCODE_FAILED})}catch(rt){return log$m.error("Failed to prepare push message",rt),{query:null,error:ProtocolError$1.GENERIC_FAIL}}}async send(tt,nt,rt){const{query:ot,error:it}=await this.preparePushMessage(tt,nt);if(it||!ot)return{success:null,failure:{error:it,peerId:rt.id}};let st;try{st=await this.getStream(rt)}catch(dt){return log$m.error("Failed to get stream",dt),{success:null,failure:{error:ProtocolError$1.NO_STREAM_AVAILABLE,peerId:rt.id}}}let at;try{at=await pipe([ot.encode()],encode$5,st,decode$5,async dt=>await all$2(dt))}catch(dt){return log$m.error("Failed to send waku light push request",dt),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:rt.id}}}const ct=new Uint8ArrayList;at.forEach(dt=>{ct.append(dt)});let lt;try{lt=PushRpc.decode(ct).response}catch(dt){return log$m.error("Failed to decode push reply",dt),{success:null,failure:{error:ProtocolError$1.DECODE_FAILED,peerId:rt.id}}}if(!lt)return log$m.error("Remote peer fault: No response in PushRPC"),{success:null,failure:{error:ProtocolError$1.NO_RESPONSE,peerId:rt.id}};if(isRLNResponseError(lt.info)){const dt=matchRLNErrorMessage(lt.info);return log$m.error("Remote peer rejected the message: ",dt),{success:null,failure:{error:dt,peerId:rt.id}}}return lt.isSuccess?{success:rt.id,failure:null}:(log$m.error("Remote peer rejected the message: ",lt.info),{success:null,failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:rt.id}})}}const EmptyMessage={payload:new Uint8Array,contentTopic:"",version:void 0,timestamp:void 0,meta:void 0,rateLimitProof:void 0,ephemeral:void 0};function toProtoMessage(o){return{...EmptyMessage,...o}}const DEFAULT_PAGE_SIZE=20,MAX_PAGE_SIZE=100,ONE_MILLION=1e6;class StoreQueryRequest{constructor(et){Ct(this,"proto");this.proto=et}static create(et){const tt=new StoreQueryRequest({...et,requestId:v4$2(),timeStart:et.timeStart?BigInt(et.timeStart.getTime()*ONE_MILLION):void 0,timeEnd:et.timeEnd?BigInt(et.timeEnd.getTime()*ONE_MILLION):void 0,messageHashes:et.messageHashes||[],paginationLimit:et.paginationLimit?BigInt(et.paginationLimit):void 0});if(et.pubsubTopic&&!et.contentTopics||!et.pubsubTopic&&et.contentTopics)throw new Error("Both pubsubTopic and contentTopics must be set or unset");if(et.messageHashes&&(et.pubsubTopic||et.contentTopics||et.timeStart||et.timeEnd))throw new Error("Message hash lookup queries cannot include content filter criteria");return tt}static decode(et){const tt=StoreQueryRequest$1.decode(et);return new StoreQueryRequest(tt)}encode(){return StoreQueryRequest$1.encode(this.proto)}}class StoreQueryResponse{constructor(et){Ct(this,"proto");this.proto=et}static decode(et){const tt=StoreQueryResponse$1.decode(et);return new StoreQueryResponse(tt)}encode(){return StoreQueryResponse$1.encode(this.proto)}get statusCode(){return this.proto.statusCode}get statusDesc(){return this.proto.statusDesc}get messages(){return this.proto.messages}get paginationCursor(){return this.proto.paginationCursor}}const log$l=new Logger$1("store"),StoreCodec="/vac/waku/store-query/3.0.0";class StoreCore extends BaseProtocol{constructor(tt,nt){super(StoreCodec,nt.components,log$l,tt);Ct(this,"pubsubTopics");this.pubsubTopics=tt}async*queryPerPage(tt,nt,rt){if(tt.contentTopics.toString()!==Array.from(nt.keys()).toString())throw new Error("Internal error, the decoders should match the query's content topics");let ot=tt.paginationCursor;for(;;){const it=StoreQueryRequest.create({...tt,paginationCursor:ot});let st;try{st=await this.getStream(rt)}catch(ht){log$l.error("Failed to get stream",ht);break}const at=await pipe([it.encode()],encode$5,st,decode$5,async ht=>await all$2(ht)),ct=new Uint8ArrayList;at.forEach(ht=>{ct.append(ht)});const lt=StoreQueryResponse.decode(ct);if(!lt.statusCode||lt.statusCode>=300){const ht=`Store query failed with status code: ${lt.statusCode}, description: ${lt.statusDesc}`;throw log$l.error(ht),new Error(ht)}if(!lt.messages||!lt.messages.length){log$l.warn("Stopping pagination due to empty messages in response");break}if(log$l.info(`${lt.messages.length} messages retrieved from store`),yield lt.messages.map(ht=>{if(!ht.message)return Promise.resolve(void 0);const pt=ht.message.contentTopic;if(pt){const mt=nt.get(pt);if(mt)return mt.fromProtoObj(ht.pubsubTopic||"",toProtoMessage(ht.message))}return Promise.resolve(void 0)}),tt.paginationForward?ot=lt.messages[lt.messages.length-1].messageHash:ot=lt.messages[0].messageHash,lt.messages.length>MAX_PAGE_SIZE&<.messages.length<(tt.paginationLimit||DEFAULT_PAGE_SIZE))break}}}const peerDiscoverySymbol$2=Symbol.for("@libp2p/peer-discovery"),peerIdSymbol$3=Symbol.for("@libp2p/peer-id");function isPeerId$2(o){return!!(o!=null&&o[peerIdSymbol$3])}var ss;let AbortError$9=(ss=class extends Error{constructor(et="The operation was aborted"){super(et),this.name="AbortError"}},Ct(ss,"name","AbortError"),ss);class UnexpectedPeerError extends Error{constructor(et="Unexpected Peer"){super(et),this.name="UnexpectedPeerError"}}Ct(UnexpectedPeerError,"name","UnexpectedPeerError");var as;let InvalidMessageError$3=(as=class extends Error{constructor(et="Invalid message"){super(et),this.name="InvalidMessageError"}},Ct(as,"name","InvalidMessageError"),as);class ProtocolError extends Error{constructor(et="Protocol error"){super(et),this.name="ProtocolError"}}Ct(ProtocolError,"name","ProtocolError");var cs;let TimeoutError$3=(cs=class extends Error{constructor(et="Timed out"){super(et),this.name="TimeoutError"}},Ct(cs,"name","TimeoutError"),cs);function setMaxListeners$9(){}const setMaxListeners$8=(o,...et)=>{try{[...et]}catch{}};var Qn,Zs;let TypedEventEmitter$3=(Zs=class extends EventTarget{constructor(){super();fn(this,Qn,new Map);setMaxListeners$8(1/0,this)}listenerCount(tt){const nt=Mt(this,Qn).get(tt);return nt==null?0:nt.length}addEventListener(tt,nt,rt){super.addEventListener(tt,nt,rt);let ot=Mt(this,Qn).get(tt);ot==null&&(ot=[],Mt(this,Qn).set(tt,ot)),ot.push({callback:nt,once:(rt!==!0&&rt!==!1&&(rt==null?void 0:rt.once))??!1})}removeEventListener(tt,nt,rt){super.removeEventListener(tt.toString(),nt??null,rt);let ot=Mt(this,Qn).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==nt),Mt(this,Qn).set(tt,ot))}dispatchEvent(tt){const nt=super.dispatchEvent(tt);let rt=Mt(this,Qn).get(tt.type);return rt==null||(rt=rt.filter(({once:ot})=>!ot),Mt(this,Qn).set(tt.type,rt)),nt}safeDispatchEvent(tt,nt={}){return this.dispatchEvent(new CustomEvent(tt,nt))}},Qn=new WeakMap,Zs);const serviceCapabilities$5=Symbol.for("@libp2p/service-capabilities"),RelayPingContentTopic="/relay-ping/1/ping/null",log$k=new Logger$1("keep-alive");class KeepAliveManager{constructor({options:et,relay:tt,libp2p:nt}){Ct(this,"relay");Ct(this,"libp2p");Ct(this,"options");Ct(this,"pingKeepAliveTimers",new Map);Ct(this,"relayKeepAliveTimers",new Map);this.options=et,this.relay=tt,this.libp2p=nt}start(et){this.stop(et);const{pingKeepAlive:tt,relayKeepAlive:nt}=this.options,rt=et.toString();if(tt!==0){const it=setInterval(()=>{(async()=>{let st;try{try{st=await this.libp2p.services.ping.ping(et),log$k.info(`Ping succeeded (${rt})`,st)}catch{log$k.error(`Ping failed for peer (${rt}). + Next ping will be attempted in ${tt} seconds. + `);return}try{await this.libp2p.peerStore.merge(et,{metadata:{ping:utf8ToBytes$1(st.toString())}})}catch(at){log$k.error("Failed to update ping",at)}}catch(at){log$k.error(`Ping failed (${rt})`,at)}})()},tt*1e3);this.pingKeepAliveTimers.set(rt,it)}const ot=this.relay;if(ot&&nt!==0){const it=this.scheduleRelayPings(ot,nt,et.toString());this.relayKeepAliveTimers.set(et,it)}}stop(et){var nt;const tt=et.toString();this.pingKeepAliveTimers.has(tt)&&(clearInterval(this.pingKeepAliveTimers.get(tt)),this.pingKeepAliveTimers.delete(tt)),this.relayKeepAliveTimers.has(et)&&((nt=this.relayKeepAliveTimers.get(et))==null||nt.map(clearInterval),this.relayKeepAliveTimers.delete(et))}stopAll(){for(const et of[...Object.values(this.pingKeepAliveTimers),...Object.values(this.relayKeepAliveTimers)])clearInterval(et);this.pingKeepAliveTimers.clear(),this.relayKeepAliveTimers.clear()}connectionsExist(){return this.pingKeepAliveTimers.size>0||this.relayKeepAliveTimers.size>0}scheduleRelayPings(et,tt,nt){const rt=[];for(const ot of et.pubsubTopics){if(!et.getMeshPeers(ot).includes(nt))continue;const st=createEncoder({pubsubTopicShardInfo:pubsubTopicToSingleShardInfo(ot),contentTopic:RelayPingContentTopic,ephemeral:!0}),at=setInterval(()=>{log$k.info("Sending Waku Relay ping message"),et.send(st,{payload:new Uint8Array([1])}).catch(ct=>log$k.error("Failed to send relay ping",ct))},tt*1e3);rt.push(at)}return rt}}const log$j=new Logger$1("connection-manager"),DEFAULT_MAX_BOOTSTRAP_PEERS_ALLOWED=1,DEFAULT_MAX_DIAL_ATTEMPTS_FOR_PEER=3,DEFAULT_MAX_PARALLEL_DIALS=3,Pr=class Pr extends TypedEventEmitter$3{constructor(tt,nt,rt,ot,it){super();Ct(this,"configuredPubsubTopics");Ct(this,"keepAliveManager");Ct(this,"options");Ct(this,"libp2p");Ct(this,"dialAttemptsForPeer",new Map);Ct(this,"dialErrorsForPeer",new Map);Ct(this,"currentActiveParallelDialCount",0);Ct(this,"pendingPeerDialQueue",[]);Ct(this,"isP2PNetworkConnected",!1);Ct(this,"onEventHandlers",{"peer:discovery":tt=>{(async()=>{const{id:nt}=tt.detail;await this.dispatchDiscoveryEvent(nt);try{await this.attemptDial(nt)}catch(rt){log$j.error(`Error dialing peer ${nt.toString()} : ${rt}`)}})()},"peer:connect":tt=>{(async()=>{log$j.info(`Connected to peer ${tt.detail.toString()}`);const nt=tt.detail;this.keepAliveManager.start(nt),(await this.getTagNamesForPeer(nt)).includes(Tags.BOOTSTRAP)?this.libp2p.getConnections().filter(it=>it.tags.includes(Tags.BOOTSTRAP)).length>this.options.maxBootstrapPeersAllowed?await this.dropConnection(nt):this.dispatchEvent(new CustomEvent(EPeersByDiscoveryEvents.PEER_CONNECT_BOOTSTRAP,{detail:nt})):this.dispatchEvent(new CustomEvent(EPeersByDiscoveryEvents.PEER_CONNECT_PEER_EXCHANGE,{detail:nt})),this.setP2PNetworkConnected()})()},"peer:disconnect":tt=>{(async()=>(this.keepAliveManager.stop(tt.detail),this.setP2PNetworkDisconnected()))()},"browser:network":()=>{this.dispatchWakuConnectionEvent()}});this.configuredPubsubTopics=rt,this.libp2p=tt,this.configuredPubsubTopics=rt,this.options={maxDialAttemptsForPeer:DEFAULT_MAX_DIAL_ATTEMPTS_FOR_PEER,maxBootstrapPeersAllowed:DEFAULT_MAX_BOOTSTRAP_PEERS_ALLOWED,maxParallelDials:DEFAULT_MAX_PARALLEL_DIALS,...it},this.keepAliveManager=new KeepAliveManager({relay:ot,libp2p:tt,options:nt}),this.startEventListeners().then(()=>log$j.info("Connection Manager is now running")).catch(st=>log$j.error("Unexpected error while running service",st)),this.dialPeerStorePeers().catch(st=>log$j.error("Unexpected error while dialing peer store peers",st))}isConnected(){var tt;return globalThis!=null&&globalThis.navigator&&!((tt=globalThis==null?void 0:globalThis.navigator)!=null&&tt.onLine)?!1:this.isP2PNetworkConnected}static create(tt,nt,rt,ot,it,st){let at=Pr.instances.get(tt);return at||(at=new Pr(nt,rt,ot,it,st),Pr.instances.set(tt,at)),at}stop(){this.keepAliveManager.stopAll(),this.libp2p.removeEventListener("peer:connect",this.onEventHandlers["peer:connect"]),this.libp2p.removeEventListener("peer:disconnect",this.onEventHandlers["peer:disconnect"]),this.libp2p.removeEventListener("peer:discovery",this.onEventHandlers["peer:discovery"]),this.stopNetworkStatusListener()}async dropConnection(tt){try{this.keepAliveManager.stop(tt),await this.libp2p.hangUp(tt),log$j.info(`Dropped connection with peer ${tt.toString()}`)}catch(nt){log$j.error(`Error dropping connection with peer ${tt.toString()} - ${nt}`)}}async getPeersByDiscovery(){const tt=await this.libp2p.peerStore.all(),nt=this.libp2p.getConnections().map(lt=>lt.remotePeer),rt=[],ot=[],it=[],st=[],at=[],ct=[];for(const lt of tt){const dt=await this.getTagNamesForPeer(lt.id);dt.includes(Tags.BOOTSTRAP)?rt.push(lt):dt.includes(Tags.PEER_EXCHANGE)?ot.push(lt):dt.includes(Tags.LOCAL)&&it.push(lt)}for(const lt of nt){const dt=await this.libp2p.peerStore.get(lt),ht=await this.getTagNamesForPeer(lt);ht.includes(Tags.BOOTSTRAP)?st.push(dt):ht.includes(Tags.PEER_EXCHANGE)?at.push(dt):ht.includes(Tags.LOCAL)&&ct.push(dt)}return{DISCOVERED:{[Tags.BOOTSTRAP]:rt,[Tags.PEER_EXCHANGE]:ot,[Tags.LOCAL]:it},CONNECTED:{[Tags.BOOTSTRAP]:st,[Tags.PEER_EXCHANGE]:at,[Tags.LOCAL]:ct}}}async dialPeerStorePeers(){const tt=await this.libp2p.peerStore.all(),nt=[];for(const rt of tt)this.libp2p.getConnections().find(ot=>ot.remotePeer===rt.id)||nt.push(this.attemptDial(rt.id));try{await Promise.all(nt)}catch(rt){log$j.error("Unexpected error while dialing peer store peers",rt)}}async startEventListeners(){this.startPeerDiscoveryListener(),this.startPeerConnectionListener(),this.startPeerDisconnectionListener(),this.startNetworkStatusListener()}async dialPeer(tt){this.currentActiveParallelDialCount+=1;let nt=0;for(;nt{ot.tags=Array.from(new Set([...ot.tags,...rt]))}),this.dialAttemptsForPeer.set(tt.toString(),-1),this.keepAliveManager.start(tt);break}catch(rt){rt instanceof AggregateError?log$j.error(`Error dialing peer ${tt.toString()} - ${rt.errors}`):log$j.error(`Error dialing peer ${tt.toString()} - ${rt.message}`),this.dialErrorsForPeer.set(tt.toString(),rt),nt++,this.dialAttemptsForPeer.set(tt.toString(),nt)}if(this.currentActiveParallelDialCount--,this.processDialQueue(),nt===this.options.maxDialAttemptsForPeer)try{const rt=this.dialErrorsForPeer.get(tt.toString());if(rt){let ot;rt instanceof AggregateError?rt.errors?rt.errors.length===0?log$j.warn("Errors array is empty for AggregateError"):ot=JSON.stringify(rt.errors[0]):log$j.warn("No errors array found for AggregateError"):ot=rt.message,log$j.info(`Deleting undialable peer ${tt.toString()} from peer store. Reason: ${ot}`)}this.dialErrorsForPeer.delete(tt.toString()),await this.libp2p.peerStore.delete(tt),await this.attemptDnsDiscovery()}catch(rt){throw new Error(`Error deleting undialable peer ${tt.toString()} from peer store - ${rt}`)}}async attemptDnsDiscovery(){if(this.libp2p.getConnections().length>0||(await this.libp2p.peerStore.all()).length>0)return;log$j.info("Attempting to trigger DNS discovery.");const tt=Object.values(this.libp2p.components.components).find(nt=>nt&&nt.toString?nt.toString().includes(DNS_DISCOVERY_TAG):!1);tt&&await tt.findPeers()}processDialQueue(){if(this.pendingPeerDialQueue.length>0&&this.currentActiveParallelDialCount{log$j.error(nt)})}}startPeerDiscoveryListener(){this.libp2p.addEventListener("peer:discovery",this.onEventHandlers["peer:discovery"])}startPeerConnectionListener(){this.libp2p.addEventListener("peer:connect",this.onEventHandlers["peer:connect"])}startPeerDisconnectionListener(){this.libp2p.addEventListener("peer:disconnect",this.onEventHandlers["peer:disconnect"])}async attemptDial(tt){if(await this.shouldDialPeer(tt)){if(this.currentActiveParallelDialCount>=this.options.maxParallelDials){this.pendingPeerDialQueue.push(tt);return}await this.dialPeer(tt)}}async shouldDialPeer(tt){if(this.libp2p.getConnections(tt).length>0)return log$j.warn(`Already connected to peer ${tt.toString()}. Not dialing.`),!1;if(!await this.isPeerTopicConfigured(tt)){const st=await this.getPeerShardInfo(tt,this.libp2p.peerStore);return log$j.warn(`Discovered peer ${tt.toString()} with ShardInfo ${st} is not part of any of the configured pubsub topics (${this.configuredPubsubTopics}). + Not dialing.`),!1}return await this.isPeerDialableBasedOnBootstrapStatus(tt)?this.dialAttemptsForPeer.has(tt.toString())?(log$j.warn(`Peer ${tt.toString()} has already been attempted dial before, or already has a dial attempt in progress, skipping dial`),!1):!0:(log$j.warn(`Peer ${tt.toString()} is not dialable based on bootstrap status. Not dialing.`),!1)}async isPeerDialableBasedOnBootstrapStatus(tt){return(await this.getTagNamesForPeer(tt)).some(it=>it===Tags.BOOTSTRAP)?this.libp2p.getConnections().filter(it=>it.tags.find(st=>st===Tags.BOOTSTRAP)).lengththis.configuredPubsubTopics.includes(it)):!0}async getPeerShardInfo(tt,nt){const ot=(await nt.get(tt)).metadata.get("shardInfo");if(ot)return decodeRelayShard(ot)}startNetworkStatusListener(){try{globalThis.addEventListener("online",this.onEventHandlers["browser:network"]),globalThis.addEventListener("offline",this.onEventHandlers["browser:network"])}catch(tt){log$j.error(`Failed to start network listener: ${tt}`)}}stopNetworkStatusListener(){try{globalThis.removeEventListener("online",this.onEventHandlers["browser:network"]),globalThis.removeEventListener("offline",this.onEventHandlers["browser:network"])}catch(tt){log$j.error(`Failed to stop network listener: ${tt}`)}}setP2PNetworkConnected(){this.isP2PNetworkConnected||(this.isP2PNetworkConnected=!0,this.dispatchWakuConnectionEvent())}setP2PNetworkDisconnected(){this.isP2PNetworkConnected&&this.libp2p.getConnections().length===0&&(this.isP2PNetworkConnected=!1,this.dispatchWakuConnectionEvent())}dispatchWakuConnectionEvent(){this.dispatchEvent(new CustomEvent(EConnectionStateEvents.CONNECTION_STATUS,{detail:this.isConnected()}))}};Ct(Pr,"instances",new Map);let ConnectionManager=Pr;const wr=class wr{constructor(){Ct(this,"health");this.health={overallStatus:HealthStatus.Unhealthy,protocolStatuses:new Map}}static getInstance(){return wr.instance||(wr.instance=new wr),wr.instance}getHealthStatus(){return this.health.overallStatus}getProtocolStatus(et){return this.health.protocolStatuses.get(et)}updateProtocolHealth(et,tt){const nt=this.getNameFromMulticodec(et);let rt=HealthStatus.Unhealthy;tt==1?rt=HealthStatus.MinimallyHealthy:tt>=2&&(rt=HealthStatus.SufficientlyHealthy),this.health.protocolStatuses.set(nt,{name:nt,status:rt,lastUpdate:new Date}),this.updateOverallHealth()}getNameFromMulticodec(et){let tt;if(et.includes("filter"))tt=Protocols.Filter;else if(et.includes("lightpush"))tt=Protocols.LightPush;else if(et.includes("store"))tt=Protocols.Store;else throw new Error(`Unknown protocol: ${et}`);return tt}updateOverallHealth(){const tt=[Protocols.LightPush,Protocols.Filter].map(nt=>{var rt;return(rt=this.getProtocolStatus(nt))==null?void 0:rt.status});tt.some(nt=>nt===HealthStatus.Unhealthy)?this.health.overallStatus=HealthStatus.Unhealthy:tt.some(nt=>nt===HealthStatus.MinimallyHealthy)?this.health.overallStatus=HealthStatus.MinimallyHealthy:this.health.overallStatus=HealthStatus.SufficientlyHealthy}};Ct(wr,"instance");let HealthManager=wr;const getHealthManager=()=>HealthManager.getInstance(),log$i=new Logger$1("metadata"),MetadataCodec="/vac/waku/metadata/1.0.0";class Metadata extends BaseProtocol{constructor(tt,nt){super(MetadataCodec,nt.components,log$i,tt);Ct(this,"pubsubTopics");Ct(this,"libp2pComponents");Ct(this,"handshakesConfirmed",new Map);this.pubsubTopics=tt,this.libp2pComponents=nt,nt.registrar.handle(MetadataCodec,rt=>{this.onRequest(rt)})}async query(tt){const nt=WakuMetadataRequest.encode(pubsubTopicsToShardInfo(this.pubsubTopics)),rt=await this.libp2pComponents.peerStore.get(tt);if(!rt)return{shardInfo:null,error:ProtocolError$1.NO_PEER_AVAILABLE};let ot;try{ot=await this.getStream(rt)}catch(ct){return log$i.error("Failed to get stream",ct),{shardInfo:null,error:ProtocolError$1.NO_STREAM_AVAILABLE}}const it=await pipe([nt],encode$5,ot,decode$5,async ct=>await all$2(ct)),{error:st,shardInfo:at}=this.decodeMetadataResponse(it);return st?{shardInfo:null,error:st}:(await this.savePeerShardInfo(tt,at),{shardInfo:at,error:null})}async confirmOrAttemptHandshake(tt){const nt=this.handshakesConfirmed.get(tt.toString());return nt?{shardInfo:nt,error:null}:await this.query(tt)}async onRequest(tt){try{const{stream:nt,connection:rt}=tt,ot=WakuMetadataResponse.encode(pubsubTopicsToShardInfo(this.pubsubTopics)),it=await pipe([ot],encode$5,nt,decode$5,async ct=>await all$2(ct)),{error:st,shardInfo:at}=this.decodeMetadataResponse(it);if(st)return;await this.savePeerShardInfo(rt.remotePeer,at)}catch(nt){log$i.error("Error handling metadata request",nt)}}decodeMetadataResponse(tt){const nt=new Uint8ArrayList;tt.forEach(ot=>{nt.append(ot)});const rt=WakuMetadataResponse.decode(nt);return rt?{shardInfo:rt,error:null}:(log$i.error("Error decoding metadata response"),{shardInfo:null,error:ProtocolError$1.DECODE_FAILED})}async savePeerShardInfo(tt,nt){await this.libp2pComponents.peerStore.merge(tt,{metadata:{shardInfo:encodeRelayShard(nt)}}),this.handshakesConfirmed.set(tt.toString(),nt)}}function wakuMetadata(o){return et=>new Metadata(o,et)}class Parser{constructor(){Ct(this,"index",0);Ct(this,"input","")}new(et){return this.index=0,this.input=et,this}readAtomically(et){const tt=this.index,nt=et();return nt===void 0&&(this.index=tt),nt}parseWith(et){const tt=et();if(this.index===this.input.length)return tt}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(et){return this.readAtomically(()=>{const tt=this.readChar();if(tt===et)return tt})}readSeparator(et,tt,nt){return this.readAtomically(()=>{if(!(tt>0&&this.readGivenChar(et)===void 0))return nt()})}readNumber(et,tt,nt,rt){return this.readAtomically(()=>{let ot=0,it=0;const st=this.peekChar();if(st===void 0)return;const at=st==="0",ct=2**(8*rt)-1;for(;;){const lt=this.readAtomically(()=>{const dt=this.readChar();if(dt===void 0)return;const ht=Number.parseInt(dt,et);if(!Number.isNaN(ht))return ht});if(lt===void 0)break;if(ot*=et,ot+=lt,ot>ct||(it+=1,tt!==void 0&&it>tt))return}if(it!==0)return!nt&&at&&it>1?void 0:ot})}readIPv4Addr(){return this.readAtomically(()=>{const et=new Uint8Array(4);for(let tt=0;ttthis.readNumber(10,3,!1,1));if(nt===void 0)return;et[tt]=nt}return et})}readIPv6Addr(){const et=tt=>{for(let nt=0;ntthis.readIPv4Addr());if(it!==void 0)return tt[rt]=it[0],tt[rt+1]=it[1],tt[rt+2]=it[2],tt[rt+3]=it[3],[rt+4,!0]}const ot=this.readSeparator(":",nt,()=>this.readNumber(16,4,!0,2));if(ot===void 0)return[rt,!1];tt[rt]=ot>>8,tt[rt+1]=ot&255}return[tt.length,!1]};return this.readAtomically(()=>{const tt=new Uint8Array(16),[nt,rt]=et(tt);if(nt===16)return tt;if(rt||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;const ot=new Uint8Array(14),it=16-(nt+2),[st]=et(ot.subarray(0,it));return tt.set(ot.subarray(0,st),16-st),tt})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}}const MAX_IPV6_LENGTH=45,MAX_IPV4_LENGTH=15,parser=new Parser;function parseIPv4(o){if(!(o.length>MAX_IPV4_LENGTH))return parser.new(o).parseWith(()=>parser.readIPv4Addr())}function parseIPv6(o){if(o.includes("%")&&(o=o.split("%")[0]),!(o.length>MAX_IPV6_LENGTH))return parser.new(o).parseWith(()=>parser.readIPv6Addr())}function parseIP(o){if(o.includes("%")&&(o=o.split("%")[0]),!(o.length>MAX_IPV6_LENGTH))return parser.new(o).parseWith(()=>parser.readIPAddr())}function isIPv4(o){return!!parseIPv4(o)}function isIPv6(o){return!!parseIPv6(o)}function isIP(o){return!!parseIP(o)}const isV4=isIPv4,isV6=isIPv6,toBytes$1=function(o){let et=0;if(o=o.toString().trim(),isV4(o)){const tt=new Uint8Array(et+4);return o.split(/\./g).forEach(nt=>{tt[et++]=parseInt(nt,10)&255}),tt}if(isV6(o)){const tt=o.split(":",8);let nt;for(nt=0;nt0;nt--)ot.push("0");tt.splice.apply(tt,ot)}const rt=new Uint8Array(et+16);for(nt=0;nt>8&255,rt[et++]=ot&255}return rt}throw new Error("invalid ip address")},toString$7=function(o,et=0,tt){et=~~et,tt=tt??o.length-et;const nt=new DataView(o.buffer);if(tt===4){const rt=[];for(let ot=0;ot{const et=createProtocol(...o);codes[et.code]=et,names[et.name]=et});function createProtocol(o,et,tt,nt,rt){return{code:o,size:et,name:tt,resolvable:!!nt,path:!!rt}}function getProtocol(o){if(typeof o=="number"){if(codes[o]!=null)return codes[o];throw new Error(`no protocol with code: ${o}`)}else if(typeof o=="string"){if(names[o]!=null)return names[o];throw new Error(`no protocol with name: ${o}`)}throw new Error(`invalid protocol id type: ${typeof o}`)}getProtocol("ip4");getProtocol("ip6");getProtocol("ipcidr");function convertToString(o,et){switch(getProtocol(o).code){case 4:case 41:return bytes2ip(et);case 42:return bytes2str(et);case 6:case 273:case 33:case 132:return bytes2port(et).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return bytes2str(et);case 421:return bytes2mh(et);case 444:return bytes2onion(et);case 445:return bytes2onion(et);case 466:return bytes2mb(et);case 481:return globalThis.encodeURIComponent(bytes2str(et));default:return toString$8(et,"base16")}}function convertToBytes(o,et){switch(getProtocol(o).code){case 4:return ip2bytes(et);case 41:return ip2bytes(et);case 42:return str2bytes(et);case 6:case 273:case 33:case 132:return port2bytes(parseInt(et,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return str2bytes(et);case 421:return mh2bytes(et);case 444:return onion2bytes(et);case 445:return onion32bytes(et);case 466:return mb2bytes(et);case 481:return str2bytes(globalThis.decodeURIComponent(et));default:return fromString(et,"base16")}}const decoders=Object.values(bases).map(o=>o.decoder),anybaseDecoder=function(){let o=decoders[0].or(decoders[1]);return decoders.slice(2).forEach(et=>o=o.or(et)),o}();function ip2bytes(o){if(!isIP(o))throw new Error("invalid ip address");return toBytes$1(o)}function bytes2ip(o){const et=toString$7(o,0,o.length);if(et==null)throw new Error("ipBuff is required");if(!isIP(et))throw new Error("invalid ip address");return et}function port2bytes(o){const et=new ArrayBuffer(2);return new DataView(et).setUint16(0,o),new Uint8Array(et)}function bytes2port(o){return new DataView(o.buffer).getUint16(o.byteOffset)}function str2bytes(o){const et=fromString(o),tt=Uint8Array.from(encode$a(et.length));return concat$1([tt,et],tt.length+et.length)}function bytes2str(o){const et=decode$b(o);if(o=o.slice(encodingLength$3(et)),o.length!==et)throw new Error("inconsistent lengths");return toString$8(o)}function mh2bytes(o){let et;o[0]==="Q"||o[0]==="1"?et=decode$6(base58btc.decode(`z${o}`)).bytes:et=CID.parse(o).multihash.bytes;const tt=Uint8Array.from(encode$a(et.length));return concat$1([tt,et],tt.length+et.length)}function mb2bytes(o){const et=anybaseDecoder.decode(o),tt=Uint8Array.from(encode$a(et.length));return concat$1([tt,et],tt.length+et.length)}function bytes2mb(o){const et=decode$b(o),tt=o.slice(encodingLength$3(et));if(tt.length!==et)throw new Error("inconsistent lengths");return"u"+toString$8(tt,"base64url")}function bytes2mh(o){const et=decode$b(o),tt=o.slice(encodingLength$3(et));if(tt.length!==et)throw new Error("inconsistent lengths");return toString$8(tt,"base58btc")}function onion2bytes(o){const et=o.split(":");if(et.length!==2)throw new Error(`failed to parse onion addr: ["'${et.join('", "')}'"]' does not contain a port number`);if(et[0].length!==16)throw new Error(`failed to parse onion addr: ${et[0]} not a Tor onion address.`);const tt=base32$2.decode("b"+et[0]),nt=parseInt(et[1],10);if(nt<1||nt>65536)throw new Error("Port number is not in range(1, 65536)");const rt=port2bytes(nt);return concat$1([tt,rt],tt.length+rt.length)}function onion32bytes(o){const et=o.split(":");if(et.length!==2)throw new Error(`failed to parse onion addr: ["'${et.join('", "')}'"]' does not contain a port number`);if(et[0].length!==56)throw new Error(`failed to parse onion addr: ${et[0]} not a Tor onion3 address.`);const tt=base32$2.decode(`b${et[0]}`),nt=parseInt(et[1],10);if(nt<1||nt>65536)throw new Error("Port number is not in range(1, 65536)");const rt=port2bytes(nt);return concat$1([tt,rt],tt.length+rt.length)}function bytes2onion(o){const et=o.slice(0,o.length-2),tt=o.slice(o.length-2),nt=toString$8(et,"base32"),rt=bytes2port(tt);return`${nt}:${rt}`}function stringToMultiaddrParts(o){o=cleanPath(o);const et=[],tt=[];let nt=null;const rt=o.split("/").slice(1);if(rt.length===1&&rt[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let ot=0;ot=rt.length)throw ParseError("invalid address: "+o);if(st.path===!0){nt=cleanPath(rt.slice(ot).join("/")),et.push([st.code,convertToBytes(st.code,nt)]),tt.push([st.code,nt]);break}const at=convertToBytes(st.code,rt[ot]);et.push([st.code,at]),tt.push([st.code,convertToString(st.code,at)])}return{string:stringTuplesToString(tt),bytes:tuplesToBytes(et),tuples:et,stringTuples:tt,path:nt}}function bytesToMultiaddrParts(o){const et=[],tt=[];let nt=null,rt=0;for(;rto.length)throw ParseError("Invalid address Uint8Array: "+toString$8(o,"base16"));et.push([ot,ct]);const lt=convertToString(ot,ct);if(tt.push([ot,lt]),st.path===!0){nt=lt;break}}return{bytes:Uint8Array.from(o),string:stringTuplesToString(tt),tuples:et,stringTuples:tt,path:nt}}function stringTuplesToString(o){const et=[];return o.map(tt=>{const nt=getProtocol(tt[0]);return et.push(nt.name),tt.length>1&&tt[1]!=null&&et.push(tt[1]),null}),cleanPath(et.join("/"))}function tuplesToBytes(o){return concat$1(o.map(et=>{const tt=getProtocol(et[0]);let nt=Uint8Array.from(encode$a(tt.code));return et.length>1&&et[1]!=null&&(nt=concat$1([nt,et[1]])),nt}))}function sizeForAddr(o,et){if(o.size>0)return o.size/8;if(o.size===0)return 0;{const tt=decode$b(et instanceof Uint8Array?et:Uint8Array.from(et));return tt+encodingLength$3(tt)}}function cleanPath(o){return"/"+o.trim().split("/").filter(et=>et).join("/")}function ParseError(o){return new Error("Error parsing address: "+o)}const inspect$1=Symbol.for("nodejs.util.inspect.custom"),symbol=Symbol.for("@multiformats/js-multiaddr/multiaddr"),DNS_CODES=[getProtocol("dns").code,getProtocol("dns4").code,getProtocol("dns6").code,getProtocol("dnsaddr").code];class NoAvailableResolverError extends Error{constructor(et="No available resolver"){super(et),this.name="NoAvailableResolverError"}}var Xs,Kr,xr,so,ao;const Lr=class Lr{constructor(et){Ct(this,"bytes");fn(this,Kr);fn(this,xr);fn(this,so);fn(this,ao);Ct(this,Xs,!0);et==null&&(et="");let tt;if(et instanceof Uint8Array)tt=bytesToMultiaddrParts(et);else if(typeof et=="string"){if(et.length>0&&et.charAt(0)!=="/")throw new Error(`multiaddr "${et}" must start with a "/"`);tt=stringToMultiaddrParts(et)}else if(isMultiaddr(et))tt=bytesToMultiaddrParts(et.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=tt.bytes,un(this,Kr,tt.string),un(this,xr,tt.tuples),un(this,so,tt.stringTuples),un(this,ao,tt.path)}toString(){return Mt(this,Kr)}toJSON(){return this.toString()}toOptions(){let et,tt,nt,rt,ot="";const it=getProtocol("tcp"),st=getProtocol("udp"),at=getProtocol("ip4"),ct=getProtocol("ip6"),lt=getProtocol("dns6"),dt=getProtocol("ip6zone");for(const[pt,mt]of this.stringTuples())pt===dt.code&&(ot=`%${mt??""}`),DNS_CODES.includes(pt)&&(tt=it.name,rt=443,nt=`${mt??""}${ot}`,et=pt===lt.code?6:4),(pt===it.code||pt===st.code)&&(tt=getProtocol(pt).name,rt=parseInt(mt??"")),(pt===at.code||pt===ct.code)&&(tt=getProtocol(pt).name,nt=`${mt??""}${ot}`,et=pt===ct.code?6:4);if(et==null||tt==null||nt==null||rt==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:et,host:nt,transport:tt,port:rt}}protos(){return Mt(this,xr).map(([et])=>Object.assign({},getProtocol(et)))}protoCodes(){return Mt(this,xr).map(([et])=>et)}protoNames(){return Mt(this,xr).map(([et])=>getProtocol(et).name)}tuples(){return Mt(this,xr)}stringTuples(){return Mt(this,so)}encapsulate(et){return et=new Lr(et),new Lr(this.toString()+et.toString())}decapsulate(et){const tt=et.toString(),nt=this.toString(),rt=nt.lastIndexOf(tt);if(rt<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${et.toString()}`);return new Lr(nt.slice(0,rt))}decapsulateCode(et){const tt=this.tuples();for(let nt=tt.length-1;nt>=0;nt--)if(tt[nt][0]===et)return new Lr(tuplesToBytes(tt.slice(0,nt)));return this}getPeerId(){try{let et=[];this.stringTuples().forEach(([nt,rt])=>{nt===names.p2p.code&&et.push([nt,rt]),nt===names["p2p-circuit"].code&&(et=[])});const tt=et.pop();if((tt==null?void 0:tt[1])!=null){const nt=tt[1];return nt[0]==="Q"||nt[0]==="1"?toString$8(base58btc.decode(`z${nt}`),"base58btc"):toString$8(CID.parse(nt).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return Mt(this,ao)}equals(et){return equals(this.bytes,et.bytes)}async resolve(et){const tt=this.protos().find(ot=>ot.resolvable);if(tt==null)return[this];const nt=resolvers$1.get(tt.name);if(nt==null)throw new NoAvailableResolverError(`no available resolver for ${tt.name}`);return(await nt(this,et)).map(ot=>multiaddr(ot))}nodeAddress(){const et=this.toOptions();if(et.transport!=="tcp"&&et.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${et.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:et.family,address:et.host,port:et.port}}isThinWaistAddress(et){const tt=(et??this).protos();return!(tt.length!==2||tt[0].code!==4&&tt[0].code!==41||tt[1].code!==6&&tt[1].code!==273)}[(Xs=symbol,inspect$1)](){return`Multiaddr(${Mt(this,Kr)})`}};Kr=new WeakMap,xr=new WeakMap,so=new WeakMap,ao=new WeakMap;let Multiaddr=Lr;const resolvers$1=new Map;function isMultiaddr(o){return!!(o!=null&&o[symbol])}function multiaddr(o){return new Multiaddr(o)}const E_CANCELED=new Error("request for lock canceled");var __awaiter$2=function(o,et,tt,nt){function rt(ot){return ot instanceof tt?ot:new tt(function(it){it(ot)})}return new(tt||(tt=Promise))(function(ot,it){function st(lt){try{ct(nt.next(lt))}catch(dt){it(dt)}}function at(lt){try{ct(nt.throw(lt))}catch(dt){it(dt)}}function ct(lt){lt.done?ot(lt.value):rt(lt.value).then(st,at)}ct((nt=nt.apply(o,et||[])).next())})};class Semaphore{constructor(et,tt=E_CANCELED){this._value=et,this._cancelError=tt,this._queue=[],this._weightedWaiters=[]}acquire(et=1,tt=0){if(et<=0)throw new Error(`invalid weight ${et}: must be positive`);return new Promise((nt,rt)=>{const ot={resolve:nt,reject:rt,weight:et,priority:tt},it=findIndexFromEnd(this._queue,st=>tt<=st.priority);it===-1&&et<=this._value?this._dispatchItem(ot):this._queue.splice(it+1,0,ot)})}runExclusive(et){return __awaiter$2(this,arguments,void 0,function*(tt,nt=1,rt=0){const[ot,it]=yield this.acquire(nt,rt);try{return yield tt(ot)}finally{it()}})}waitForUnlock(et=1,tt=0){if(et<=0)throw new Error(`invalid weight ${et}: must be positive`);return this._couldLockImmediately(et,tt)?Promise.resolve():new Promise(nt=>{this._weightedWaiters[et-1]||(this._weightedWaiters[et-1]=[]),insertSorted(this._weightedWaiters[et-1],{resolve:nt,priority:tt})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(et){this._value=et,this._dispatchQueue()}release(et=1){if(et<=0)throw new Error(`invalid weight ${et}: must be positive`);this._value+=et,this._dispatchQueue()}cancel(){this._queue.forEach(et=>et.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(et){const tt=this._value;this._value-=et.weight,et.resolve([tt,this._newReleaser(et.weight)])}_newReleaser(et){let tt=!1;return()=>{tt||(tt=!0,this.release(et))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let et=this._value;et>0;et--){const tt=this._weightedWaiters[et-1];tt&&(tt.forEach(nt=>nt.resolve()),this._weightedWaiters[et-1]=[])}else{const et=this._queue[0].priority;for(let tt=this._value;tt>0;tt--){const nt=this._weightedWaiters[tt-1];if(!nt)continue;const rt=nt.findIndex(ot=>ot.priority<=et);(rt===-1?nt:nt.splice(0,rt)).forEach(ot=>ot.resolve())}}}_couldLockImmediately(et,tt){return(this._queue.length===0||this._queue[0].priorityet.priority<=nt.priority);o.splice(tt+1,0,et)}function findIndexFromEnd(o,et){for(let tt=o.length-1;tt>=0;tt--)if(et(o[tt]))return tt;return-1}var __awaiter$1=function(o,et,tt,nt){function rt(ot){return ot instanceof tt?ot:new tt(function(it){it(ot)})}return new(tt||(tt=Promise))(function(ot,it){function st(lt){try{ct(nt.next(lt))}catch(dt){it(dt)}}function at(lt){try{ct(nt.throw(lt))}catch(dt){it(dt)}}function ct(lt){lt.done?ot(lt.value):rt(lt.value).then(st,at)}ct((nt=nt.apply(o,et||[])).next())})};class Mutex{constructor(et){this._semaphore=new Semaphore(1,et)}acquire(){return __awaiter$1(this,arguments,void 0,function*(et=0){const[,tt]=yield this._semaphore.acquire(1,et);return tt})}runExclusive(et,tt=0){return this._semaphore.runExclusive(()=>et(),1,tt)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(et=0){return this._semaphore.waitForUnlock(1,et)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class PeerManager{constructor(et,tt,nt){Ct(this,"connectionManager");Ct(this,"core");Ct(this,"log");Ct(this,"peers",new Map);Ct(this,"healthManager");Ct(this,"readMutex",new Mutex);Ct(this,"writeMutex",new Mutex);Ct(this,"writeLockHolder",null);this.connectionManager=et,this.core=tt,this.log=nt,this.healthManager=getHealthManager(),this.healthManager.updateProtocolHealth(this.core.multicodec,0)}getWriteLockHolder(){return this.writeLockHolder}getPeers(){return Array.from(this.peers.values())}async addPeer(et){return this.writeMutex.runExclusive(async()=>{this.writeLockHolder=`addPeer: ${et.id.toString()}`,await this.connectionManager.attemptDial(et.id),this.peers.set(et.id.toString(),et),this.log.info(`Added and dialed peer: ${et.id.toString()}`),this.healthManager.updateProtocolHealth(this.core.multicodec,this.peers.size),this.writeLockHolder=null})}async removePeer(et){return this.writeMutex.runExclusive(()=>{this.writeLockHolder=`removePeer: ${et.toString()}`,this.peers.delete(et.toString()),this.log.info(`Removed peer: ${et.toString()}`),this.healthManager.updateProtocolHealth(this.core.multicodec,this.peers.size),this.writeLockHolder=null})}async getPeerCount(){return this.readMutex.runExclusive(()=>this.peers.size)}async hasPeers(){return this.readMutex.runExclusive(()=>this.peers.size>0)}async removeExcessPeers(et){this.log.info(`Removing ${et} excess peer(s)`);const tt=Array.from(this.peers.values()).slice(0,et);for(const nt of tt)await this.removePeer(nt.id)}async findAndAddPeers(et){const tt=await this.findPeers(et);return tt.length===0?(this.log.warn("No additional peers found"),[]):this.addMultiplePeers(tt)}async findPeers(et){const tt=await this.core.getPeers();return this.readMutex.runExclusive(async()=>tt.filter(rt=>!this.peers.has(rt.id.toString())).slice(0,et))}async addMultiplePeers(et){const tt=[];for(const nt of et)await this.addPeer(nt),tt.push(nt);return tt}}const DEFAULT_NUM_PEERS_TO_USE=2,DEFAULT_MAINTAIN_PEERS_INTERVAL=3e4;class BaseProtocolSDK{constructor(et,tt,nt){Ct(this,"core");Ct(this,"connectionManager");Ct(this,"peerManager");Ct(this,"numPeersToUse");Ct(this,"maintainPeersIntervalId",null);Ct(this,"log");this.core=et,this.connectionManager=tt,this.log=new Logger$1(`sdk:${et.multicodec}`),this.numPeersToUse=(nt==null?void 0:nt.numPeersToUse)??DEFAULT_NUM_PEERS_TO_USE;const rt=(nt==null?void 0:nt.maintainPeersInterval)??DEFAULT_MAINTAIN_PEERS_INTERVAL;this.peerManager=new PeerManager(tt,et,this.log),this.log.info(`Initializing BaseProtocolSDK with numPeersToUse: ${this.numPeersToUse}, maintainPeersInterval: ${rt}ms`),this.startMaintainPeersInterval(rt)}get connectedPeers(){return this.peerManager.getPeers().slice(0,this.numPeersToUse)}async renewPeer(et){this.log.info(`Attempting to renew peer ${et}`);const tt=await this.peerManager.findPeers(1);if(tt.length===0){this.log.error("Failed to find a new peer to replace the disconnected one");return}return await this.peerManager.removePeer(et),await this.peerManager.addPeer(tt[0]),this.log.info(`Successfully renewed peer. New peer: ${tt[0].id}`),tt[0]}stopMaintainPeersInterval(){this.maintainPeersIntervalId?(clearInterval(this.maintainPeersIntervalId),this.maintainPeersIntervalId=null,this.log.info("Maintain peers interval stopped")):this.log.info("Maintain peers interval was not running")}async hasPeers(et={}){const{forceUseAllPeers:tt=!1,maxAttempts:nt=3}=et;this.log.info(`Checking for peers. forceUseAllPeers: ${tt}, maxAttempts: ${nt}`);for(let rt=0;rt0)return this.log.info(`At least one peer connected (${this.connectedPeers.length}), not forcing use of all peers`),!0;if(this.connectedPeers.length>=this.numPeersToUse)return this.log.info(`Required number of peers (${this.numPeersToUse}) reached`),!0;this.log.warn(`Found only ${this.connectedPeers.length}/${this.numPeersToUse} required peers. Retrying...`)}return this.log.error(`Failed to find required number of peers (${this.numPeersToUse}) after ${nt} attempts`),!1}async startMaintainPeersInterval(et){this.log.info(`Starting maintain peers interval with ${et}ms interval`);try{this.maintainPeersIntervalId=setInterval(()=>{this.log.info("Running scheduled peer maintenance"),this.maintainPeers().catch(tt=>{this.log.error("Error during scheduled peer maintenance:",tt)})},et),this.log.info("Maintain peers interval started successfully")}catch(tt){throw this.log.error("Error starting maintain peers interval:",tt),tt}}async maintainPeers(){try{const et=await this.peerManager.getPeerCount(),tt=this.numPeersToUse-et;if(this.log.info(`Current peer count: ${et}, target: ${this.numPeersToUse}`),tt===0){this.log.info("Peer count is at target, no maintenance required");return}tt>0?(this.log.info(`Attempting to add ${tt} peer(s)`),await this.peerManager.findAndAddPeers(tt)):(this.log.info(`Attempting to remove ${Math.abs(tt)} excess peer(s)`),await this.peerManager.removeExcessPeers(Math.abs(tt)));const nt=await this.peerManager.getPeerCount();this.log.info(`Peer maintenance completed. Initial count: ${et}, Final count: ${nt}`)}catch(et){this.log.error("Error during peer maintenance",{error:et})}}}const DEFAULT_KEEP_ALIVE=6e4,DEFAULT_LIGHT_PUSH_FILTER_CHECK=!1,DEFAULT_LIGHT_PUSH_FILTER_CHECK_INTERVAL=1e4,DEFAULT_SUBSCRIBE_OPTIONS={keepAlive:DEFAULT_KEEP_ALIVE,enableLightPushFilterCheck:DEFAULT_LIGHT_PUSH_FILTER_CHECK};function messageHash(o,et){const tt=utf8ToBytes$1(o),nt=utf8ToBytes$1(et.contentTopic),rt=tryConvertTimestampToBytes(et.timestamp),ot=concat$2([tt,et.payload,nt,et.meta,rt].filter(isDefined));return sha256$2(ot)}function tryConvertTimestampToBytes(o){if(!o)return;let et;return typeof o=="bigint"?et=o:et=BigInt(o.valueOf())*1000000n,numberToBytes(et)}function messageHashStr(o,et){const tt=messageHash(o,et);return bytesToHex$1(tt)}const log$h=new Logger$1("sdk:receiver:reliability_monitor"),DEFAULT_MAX_PINGS=3,MESSAGE_VERIFICATION_DELAY=5e3;class ReceiverReliabilityMonitor{constructor(et,tt,nt,rt,ot,it,st){Ct(this,"pubsubTopic");Ct(this,"getPeers");Ct(this,"renewPeer");Ct(this,"getContentTopics");Ct(this,"protocolSubscribe");Ct(this,"addLibp2pEventListener");Ct(this,"sendLightPushMessage");Ct(this,"receivedMessagesFormPeer",new Set);Ct(this,"receivedMessages",new Set);Ct(this,"scheduledVerification",new Map);Ct(this,"verifiedPeers",new Set);Ct(this,"peerFailures",new Map);Ct(this,"maxPingFailures",DEFAULT_MAX_PINGS);Ct(this,"peerRenewalLocks",new Set);this.pubsubTopic=et,this.getPeers=tt,this.renewPeer=nt,this.getContentTopics=rt,this.protocolSubscribe=ot,this.addLibp2pEventListener=it,this.sendLightPushMessage=st,this.addLibp2pEventListener("peer:disconnect",at=>{const ct=at.detail;this.getPeers().some(lt=>lt.id.equals(ct))&&this.renewAndSubscribePeer(ct)})}setMaxPingFailures(et){et!==void 0&&(this.maxPingFailures=et)}async handlePingResult(et,tt){if(tt!=null&&tt.success){this.peerFailures.delete(et.toString());return}const nt=(this.peerFailures.get(et.toString())||0)+1;if(this.peerFailures.set(et.toString(),nt),nt>=this.maxPingFailures)try{log$h.info(`Attempting to renew ${et.toString()} due to ping failures.`),await this.renewAndSubscribePeer(et),this.peerFailures.delete(et.toString())}catch(rt){log$h.error(`Failed to renew peer ${et.toString()}: ${rt}.`)}}notifyMessageReceived(et,tt){const nt=this.buildMessageHash(tt);return this.verifiedPeers.add(et),this.receivedMessagesFormPeer.add(`${et}-${nt}`),log$h.info(`notifyMessage received debug: ephemeral:${tt.ephemeral} ${bytesToUtf8(tt.payload)}`),log$h.info(`notifyMessage received: peer:${et} message:${nt}`),this.receivedMessages.has(nt)?!0:(this.receivedMessages.add(nt),!1)}notifyMessageSent(et,tt){const nt=et.toString(),rt=this.buildMessageHash(tt);if(log$h.info(`notifyMessage sent debug: ${bytesToUtf8(tt.payload)}`),this.scheduledVerification.has(nt)){log$h.warn(`notifyMessage sent: attempting to schedule verification for pending peer:${nt} message:${rt}`);return}const ot=setTimeout(async()=>{const it=this.verifiedPeers.has(nt),st=this.receivedMessagesFormPeer.has(`${nt}-${rt}`);if(it||st){log$h.info(`notifyMessage sent setTimeout: verified that peer pushes filter messages, peer:${nt} message:${rt}`);return}log$h.warn(`notifyMessage sent setTimeout: peer didn't return probe message, attempting renewAndSubscribe, peer:${nt} message:${rt}`),this.scheduledVerification.delete(nt),await this.renewAndSubscribePeer(et)},MESSAGE_VERIFICATION_DELAY);this.scheduledVerification.set(nt,ot)}shouldVerifyPeer(et){const tt=et.toString(),nt=this.verifiedPeers.has(tt),rt=this.scheduledVerification.has(tt);return!(nt||rt)}buildMessageHash(et){return messageHashStr(this.pubsubTopic,et)}async renewAndSubscribePeer(et){const tt=et.toString();try{if(this.peerRenewalLocks.has(tt)){log$h.info(`Peer ${tt} is already being renewed.`);return}this.peerRenewalLocks.add(tt);const nt=await this.renewPeer(et);if(!nt){log$h.warn(`Failed to renew peer ${tt}: No new peer found.`);return}return await this.protocolSubscribe(this.pubsubTopic,nt,this.getContentTopics()),await this.sendLightPushMessage(nt),this.peerFailures.delete(tt),nt}catch(nt){log$h.error(`Failed to renew peer ${tt}: ${nt}.`);return}finally{this.peerRenewalLocks.delete(tt)}}}const Nr=class Nr{static createReceiverMonitor(et,tt,nt,rt,ot,it,st){if(Nr.receiverMonitors.has(et))return Nr.receiverMonitors.get(et);const at=new ReceiverReliabilityMonitor(et,tt,nt,rt,ot,it,st);return Nr.receiverMonitors.set(et,at),at}constructor(){}static stop(et){this.receiverMonitors.delete(et)}static stopAll(){for(const[et,tt]of this.receiverMonitors)tt.setMaxPingFailures(void 0),this.receiverMonitors.delete(et)}};Ct(Nr,"receiverMonitors",new Map);let ReliabilityMonitorManager=Nr;const log$g=new Logger$1("sdk:filter:subscription_manager");class SubscriptionManager{constructor(et,tt,nt,rt,ot,it,st){Ct(this,"pubsubTopic");Ct(this,"protocol");Ct(this,"connectionManager");Ct(this,"getPeers");Ct(this,"renewPeer");Ct(this,"libp2p");Ct(this,"lightPush");Ct(this,"reliabilityMonitor");Ct(this,"keepAliveTimeout",DEFAULT_KEEP_ALIVE);Ct(this,"keepAliveInterval",null);Ct(this,"enableLightPushFilterCheck",DEFAULT_LIGHT_PUSH_FILTER_CHECK);Ct(this,"subscriptionCallbacks");this.pubsubTopic=et,this.protocol=tt,this.connectionManager=nt,this.getPeers=rt,this.renewPeer=ot,this.libp2p=it,this.lightPush=st,this.pubsubTopic=et,this.subscriptionCallbacks=new Map,this.reliabilityMonitor=ReliabilityMonitorManager.createReceiverMonitor(this.pubsubTopic,this.getPeers.bind(this),this.renewPeer.bind(this),()=>Array.from(this.subscriptionCallbacks.keys()),this.protocol.subscribe.bind(this.protocol),this.protocol.addLibp2pEventListener.bind(this.protocol),this.sendLightPushCheckMessage.bind(this))}async subscribe(et,tt,nt=DEFAULT_SUBSCRIBE_OPTIONS){this.reliabilityMonitor.setMaxPingFailures(nt.pingsBeforePeerRenewed),this.keepAliveTimeout=nt.keepAlive||DEFAULT_KEEP_ALIVE,this.enableLightPushFilterCheck=(nt==null?void 0:nt.enableLightPushFilterCheck)||DEFAULT_LIGHT_PUSH_FILTER_CHECK;const rt=Array.isArray(et)?et:[et];for(const lt of rt)if(lt.pubsubTopic!==this.pubsubTopic)return{failures:[{error:ProtocolError$1.TOPIC_DECODER_MISMATCH}],successes:[]};this.enableLightPushFilterCheck&&rt.push(createDecoder(this.buildLightPushContentTopic(),this.pubsubTopic));const ot=groupByContentTopic(rt),it=Array.from(ot.keys()),st=this.getPeers().map(async lt=>this.subscribeWithPeerVerification(lt,it)),at=await Promise.allSettled(st),ct=this.handleResult(at,"subscribe");return ot.forEach((lt,dt)=>{const ht={decoders:lt,callback:tt};dt!==this.buildLightPushContentTopic()&&this.subscriptionCallbacks.set(dt,ht)}),this.startSubscriptionsMaintenance(this.keepAliveTimeout),ct}async unsubscribe(et){const tt=this.getPeers().map(async ot=>{const it=await this.protocol.unsubscribe(this.pubsubTopic,ot,et);return et.forEach(st=>{this.subscriptionCallbacks.delete(st)}),it}),nt=await Promise.allSettled(tt),rt=this.handleResult(nt,"unsubscribe");return this.subscriptionCallbacks.size===0&&this.stopSubscriptionsMaintenance(),rt}async ping(et){log$g.info("Sending keep-alive ping");const nt=(et?[et]:this.getPeers().map(ot=>ot.id)).map(ot=>this.pingSpecificPeer(ot)),rt=await Promise.allSettled(nt);return this.handleResult(rt,"ping")}async unsubscribeAll(){const et=this.getPeers().map(async rt=>this.protocol.unsubscribeAll(this.pubsubTopic,rt)),tt=await Promise.allSettled(et);this.subscriptionCallbacks.clear();const nt=this.handleResult(tt,"unsubscribeAll");return this.stopSubscriptionsMaintenance(),nt}async processIncomingMessage(et,tt){if(this.reliabilityMonitor.notifyMessageReceived(tt,et)){log$g.info("Message already received, skipping");return}const{contentTopic:rt}=et,ot=this.subscriptionCallbacks.get(rt);if(!ot){log$g.error("No subscription callback available for ",rt);return}log$g.info("Processing message with content topic ",rt," on pubsub topic ",this.pubsubTopic),await pushMessage(ot,this.pubsubTopic,et)}async subscribeWithPeerVerification(et,tt){const nt=await this.protocol.subscribe(this.pubsubTopic,et,tt);return await this.sendLightPushCheckMessage(et),nt}handleResult(et,tt){const nt={failures:[],successes:[]};for(const rt of et)if(rt.status==="rejected")log$g.error(`Failed to resolve ${tt} promise successfully: `,rt.reason),nt.failures.push({error:ProtocolError$1.GENERIC_FAIL});else{const ot=rt.value;ot.failure?nt.failures.push(ot.failure):nt.successes.push(ot.success)}return nt}async pingSpecificPeer(et){var rt,ot;const tt=this.getPeers().find(it=>it.id.equals(et));if(!tt)return{success:null,failure:{peerId:et,error:ProtocolError$1.NO_PEER_AVAILABLE}};let nt;try{nt=await this.protocol.ping(tt)}catch{nt={success:null,failure:{peerId:et,error:ProtocolError$1.GENERIC_FAIL}}}return log$g.info(`Received result from filter ping peerId:${et.toString()} success:${(rt=nt.success)==null?void 0:rt.toString()} failure:${(ot=nt.failure)==null?void 0:ot.error}`),await this.reliabilityMonitor.handlePingResult(et,nt),nt}startSubscriptionsMaintenance(et){log$g.info("Starting subscriptions maintenance"),this.startKeepAlivePings(et),this.startConnectionListener()}stopSubscriptionsMaintenance(){log$g.info("Stopping subscriptions maintenance"),this.stopKeepAlivePings(),this.stopConnectionListener()}startConnectionListener(){this.connectionManager.addEventListener(EConnectionStateEvents.CONNECTION_STATUS,this.connectionListener.bind(this))}stopConnectionListener(){this.connectionManager.removeEventListener(EConnectionStateEvents.CONNECTION_STATUS,this.connectionListener.bind(this))}async connectionListener({detail:et}){if(!et){this.stopKeepAlivePings();return}try{await this.ping()}catch(tt){log$g.error(`networkStateListener failed to recover: ${tt}`)}this.startKeepAlivePings(this.keepAliveTimeout)}startKeepAlivePings(et){if(this.keepAliveInterval){log$g.info("Recurring pings already set up.");return}this.keepAliveInterval=setInterval(()=>{this.ping()},et)}stopKeepAlivePings(){if(!this.keepAliveInterval){log$g.info("Already stopped recurring pings.");return}log$g.info("Stopping recurring pings."),clearInterval(this.keepAliveInterval),this.keepAliveInterval=null}async sendLightPushCheckMessage(et){if(this.lightPush&&this.libp2p&&this.reliabilityMonitor.shouldVerifyPeer(et.id)){const tt=createEncoder({contentTopic:this.buildLightPushContentTopic(),pubsubTopic:this.pubsubTopic,ephemeral:!0}),nt={payload:new Uint8Array(1)},rt=await tt.toProtoObj(nt);setTimeout(async()=>{const ot=await this.lightPush.protocol.send(tt,nt,et);if(this.reliabilityMonitor.notifyMessageSent(et.id,rt),ot.failure){log$g.error(`failed to send lightPush ping message to peer:${et.id.toString()} ${ot.failure.error}`);return}},DEFAULT_LIGHT_PUSH_FILTER_CHECK_INTERVAL)}}buildLightPushContentTopic(){return`/js-waku-subscription-ping/1/${this.libp2p.peerId.toString()}/utf8`}}async function pushMessage(o,et,tt){const{decoders:nt,callback:rt}=o,{contentTopic:ot}=tt;if(!ot){log$g.warn("Message has no content topic, skipping");return}try{const it=nt.map(at=>at.fromProtoObj(et,tt).then(ct=>ct||Promise.reject("Decoding failed"))),st=await Promise.any(it);await rt(st)}catch(it){log$g.error("Error decoding message",it)}}const log$f=new Logger$1("sdk:filter");class Filter extends BaseProtocolSDK{constructor(tt,nt,rt,ot){super(new FilterCore(async(it,st,at)=>{const ct=this.getActiveSubscription(it);if(!ct){log$f.error(`No subscription locally registered for topic ${it}`);return}await ct.processIncomingMessage(st,at)},tt.configuredPubsubTopics,nt),tt,{numPeersToUse:ot==null?void 0:ot.numPeersToUse});Ct(this,"libp2p");Ct(this,"lightPush");Ct(this,"protocol");Ct(this,"activeSubscriptions",new Map);this.libp2p=nt,this.lightPush=rt,this.protocol=this.core,this.activeSubscriptions=new Map}async subscribe(tt,nt,rt,ot=DEFAULT_SUBSCRIBE_OPTIONS){const it=this.getUniquePubsubTopics(tt);if(it.length!==1)return{subscription:null,error:ProtocolError$1.INVALID_DECODER_TOPICS,results:null};const st=it[0],{subscription:at,error:ct}=await this.createSubscription(st,rt);if(ct)return{subscription:null,error:ct,results:null};const{failures:lt,successes:dt}=await at.subscribe(tt,nt,ot);return{subscription:at,error:null,results:{failures:lt,successes:dt}}}async createSubscription(tt,nt){var st;nt={autoRetry:!0,...nt};const rt=typeof tt=="string"?tt:(st=shardInfoToPubsubTopics(tt))==null?void 0:st[0];return ensurePubsubTopicIsConfigured(rt,this.protocol.pubsubTopics),await this.hasPeers(nt)?(log$f.info(`Creating filter subscription with ${this.connectedPeers.length} peers: `,this.connectedPeers.map(at=>at.id.toString())),{error:null,subscription:this.getActiveSubscription(rt)??this.setActiveSubscription(rt,new SubscriptionManager(rt,this.protocol,this.connectionManager,()=>this.connectedPeers,this.renewPeer.bind(this),this.libp2p,this.lightPush))}):{error:ProtocolError$1.NO_PEER_AVAILABLE,subscription:null}}async subscribeWithUnsubscribe(tt,nt,rt=DEFAULT_SUBSCRIBE_OPTIONS){const ot=this.getUniquePubsubTopics(tt);if(ot.length===0)throw Error("Failed to subscribe: no pubsubTopic found on decoders provided.");if(ot.length>1)throw Error("Failed to subscribe: all decoders should have the same pubsub topic. Use createSubscription to be more agile.");const{subscription:it,error:st}=await this.createSubscription(ot[0]);if(st)throw Error(`Failed to create subscription: ${st}`);await it.subscribe(tt,nt,rt);const at=Array.from(groupByContentTopic(Array.isArray(tt)?tt:[tt]).keys());return async()=>{await it.unsubscribe(at)}}toSubscriptionIterator(tt){return toAsyncIterator(this,tt)}getActiveSubscription(tt){return this.activeSubscriptions.get(tt)}setActiveSubscription(tt,nt){return this.activeSubscriptions.set(tt,nt),nt}getUniquePubsubTopics(tt){return Array.isArray(tt)?tt.length===0?[]:[...new Set(tt.map(rt=>rt.pubsubTopic))]:[tt.pubsubTopic]}}function wakuFilter(o,et,tt){return nt=>new Filter(o,nt,et,tt)}const log$e=new Logger$1("sdk:light-push"),DEFAULT_MAX_ATTEMPTS=3,DEFAULT_SEND_OPTIONS={autoRetry:!1,maxAttempts:DEFAULT_MAX_ATTEMPTS};class LightPush{constructor(et,tt,nt){Ct(this,"libp2p");Ct(this,"numPeersToUse",DEFAULT_NUM_PEERS_TO_USE);Ct(this,"protocol");this.libp2p=tt,this.numPeersToUse=(nt==null?void 0:nt.numPeersToUse)??DEFAULT_NUM_PEERS_TO_USE,this.protocol=new LightPushCore(et.configuredPubsubTopics,tt)}async send(et,tt,nt=DEFAULT_SEND_OPTIONS){const rt=[],ot=[],{pubsubTopic:it}=et;try{ensurePubsubTopicIsConfigured(it,this.protocol.pubsubTopics)}catch{return log$e.error("Failed to send waku light push: pubsub topic not configured"),{successes:rt,failures:[{error:ProtocolError$1.TOPIC_NOT_CONFIGURED}]}}const st=await this.getConnectedPeers();if(st.length===0)return{successes:rt,failures:[{error:ProtocolError$1.NO_PEER_AVAILABLE}]};const at=await Promise.allSettled(st.map(ct=>this.protocol.send(et,tt,ct)));for(const ct of at){if(ct.status!=="fulfilled"){log$e.error("Failed unexpectedly while sending:",ct.reason),ot.push({error:ProtocolError$1.GENERIC_FAIL});continue}const{failure:lt,success:dt}=ct.value;if(dt){rt.push(dt);continue}lt&&(ot.push(lt),nt!=null&&nt.autoRetry&&this.attemptRetries(ht=>this.protocol.send(et,tt,ht),nt.maxAttempts))}return getHealthManager().updateProtocolHealth(this.protocol.multicodec,rt.length),{successes:rt,failures:ot}}async attemptRetries(et,tt){var rt;tt=tt||DEFAULT_MAX_ATTEMPTS;const nt=await this.getConnectedPeers();if(nt.length===0){log$e.warn("Cannot retry with no connected peers.");return}for(let ot=0;ot{try{return await this.libp2p.peerStore.get(nt)}catch{return null}}))).filter(nt=>!!nt).filter(nt=>nt.protocols.includes(LightPushCodec)).slice(0,this.numPeersToUse)}}function wakuLightPush(o,et={}){return tt=>new LightPush(o,tt,et)}const DEFAULT_NUM_PEERS=1,log$d=new Logger$1("waku:store:sdk");class Store extends BaseProtocolSDK{constructor(tt,nt){super(new StoreCore(tt.configuredPubsubTopics,nt),tt,{numPeersToUse:DEFAULT_NUM_PEERS});Ct(this,"protocol");this.protocol=this.core}async*queryGenerator(tt,nt){const{pubsubTopic:rt,contentTopics:ot,decodersAsMap:it}=this.validateDecodersAndPubsubTopic(tt),st={pubsubTopic:rt,contentTopics:ot,includeData:!0,paginationForward:!0,...nt},at=(await this.protocol.getPeers({numPeers:this.numPeersToUse,maxBootstrapPeers:1}))[0];if(!at)throw log$d.error("No peers available to query"),new Error("No peers available to query");log$d.info(`Querying store with options: ${JSON.stringify(nt)}`);const ct=this.protocol.queryPerPage(st,it,at);for await(const lt of ct)yield lt}async queryWithOrderedCallback(tt,nt,rt){log$d.info("Querying store with ordered callback");for await(const ot of this.queryGenerator(tt,rt))if(await this.processMessages(ot,nt))break}async queryWithPromiseCallback(tt,nt,rt){log$d.info("Querying store with promise callback");let ot=!1;for await(const it of this.queryGenerator(tt,rt)){const st=it.map(async at=>{ot||(ot=!!await nt(at))});if(await Promise.all(st),ot)break}}async processMessages(tt,nt){let rt=!1;const it=(await Promise.all(tt)).filter(isDefined);return await Promise.all(it.map(async st=>{st&&!rt&&(rt=!!await nt(st))})),rt}createCursor(tt){return messageHash(tt.pubsubTopic,tt)}validateDecodersAndPubsubTopic(tt){if(tt.length===0)throw log$d.error("No decoders provided"),new Error("No decoders provided");const nt=Array.from(new Set(tt.map(st=>st.pubsubTopic)));if(nt.length>1)throw log$d.error("API does not support querying multiple pubsub topics at once"),new Error("API does not support querying multiple pubsub topics at once");const rt=nt[0];ensurePubsubTopicIsConfigured(rt,this.protocol.pubsubTopics);const ot=new Map;tt.forEach(st=>{if(ot.has(st.contentTopic))throw log$d.error("API does not support different decoder per content topic"),new Error("API does not support different decoder per content topic");ot.set(st.contentTopic,st)});const it=tt.filter(st=>st.pubsubTopic===rt).map(st=>st.contentTopic);if(it.length===0)throw log$d.error(`No decoders found for topic ${rt}`),new Error("No decoders found for topic "+rt);return{pubsubTopic:rt,contentTopics:it,decodersAsMap:ot}}}function wakuStore(o){return et=>new Store(o,et)}const log$c=new Logger$1("wait-for-remote-peer");async function waitForRemotePeer(o,et,tt){et=et!=null&&et.length?et:getEnabledProtocols(o);const nt=o.libp2p.getConnections();if(!o.isStarted())throw Error("Waku node is not started");for(const ot of et)switch(ot){case Protocols.Relay:if(!o.relay)throw Error("Cannot wait for Relay peer: protocol not mounted");break;case Protocols.LightPush:if(!o.lightPush)throw Error("Cannot wait for LightPush peer: protocol not mounted");break;case Protocols.Store:if(!o.store)throw Error("Cannot wait for Store peer: protocol not mounted");break;case Protocols.Filter:if(!o.filter)throw Error("Cannot wait for Filter peer: protocol not mounted");break}const rt=[waitForProtocols(o,et)];nt.length>0&&!et.includes(Protocols.Relay)&&rt.push(waitForMetadata(o,et)),tt?await rejectOnTimeout(Promise.any(rt),tt,"Timed out waiting for a remote peer."):await Promise.any(rt)}async function waitForProtocols(o,et){const tt=[];return o.relay&&et.includes(Protocols.Relay)&&tt.push(o.relay.waitForPeers()),o.store&&et.includes(Protocols.Store)&&tt.push(waitForConnectedPeer(StoreCodec,o.libp2p)),o.lightPush&&et.includes(Protocols.LightPush)&&tt.push(waitForConnectedPeer(LightPushCodec,o.libp2p)),o.filter&&et.includes(Protocols.Filter)&&tt.push(waitForConnectedPeer(FilterCodecs.SUBSCRIBE,o.libp2p)),Promise.all(tt)}async function waitForConnectedPeer(o,et){log$c.info(`Waiting for ${o} peer.`),await new Promise(tt=>{const nt=async rt=>{var ot,it;if((it=(ot=rt.detail)==null?void 0:ot.protocols)!=null&&it.includes(o)){const st=et.services.metadata;if(!st){et.removeEventListener("peer:identify",nt),tt();return}try{await st.confirmOrAttemptHandshake(rt.detail.peerId),et.removeEventListener("peer:identify",nt),tt()}catch(at){at.code==="ERR_CONNECTION_BEING_CLOSED"&&log$c.error("Connection closed. Some peers can be on different shard."),log$c.error(`Error waiting for metadata: ${at}`)}}};et.addEventListener("peer:identify",nt)})}async function waitForMetadata(o,et){const tt=o.libp2p.getPeers(),nt=o.libp2p.services.metadata,rt=mapProtocolsToCodecs(et);if(!tt.length||!nt){log$c.info(`Skipping waitForMetadata due to missing connections:${tt.length} or metadataService:${!!nt}`);return}for(const ot of tt)try{const it=await o.libp2p.peerStore.get(ot);if(it.protocols.some(at=>rt.has(at))&&!(await nt.confirmOrAttemptHandshake(ot)).error&&(it.protocols.forEach(lt=>{rt.has(lt)&&rt.set(lt,!0)}),Array.from(rt.values()).every(lt=>lt)))return}catch(it){it.code==="ERR_CONNECTION_BEING_CLOSED"&&log$c.error("Connection closed. Some peers can be on different shard."),log$c.error(`Error while iterating through peers: ${it}`);continue}}const awaitTimeout=(o,et)=>new Promise((tt,nt)=>setTimeout(()=>nt(Error(et)),o));async function rejectOnTimeout(o,et,tt){await Promise.race([o,awaitTimeout(et,tt)])}function getEnabledProtocols(o){const et=[];return o.relay&&et.push(Protocols.Relay),o.filter&&et.push(Protocols.Filter),o.store&&et.push(Protocols.Store),o.lightPush&&et.push(Protocols.LightPush),et}function mapProtocolsToCodecs(o){const et=new Map,tt={[Protocols.Filter]:FilterCodecs.SUBSCRIBE,[Protocols.LightPush]:LightPushCodec,[Protocols.Store]:StoreCodec};for(const nt of o)tt[nt]&&et.set(tt[nt],!1);return et}const DefaultPingKeepAliveValueSecs=5*60,DefaultRelayKeepAliveValueSecs=5*60,DefaultUserAgent="js-waku",DefaultPingMaxInboundStreams=10,log$b=new Logger$1("waku");class WakuNode{constructor(et,tt,nt,rt,ot){Ct(this,"pubsubTopics");Ct(this,"libp2p");Ct(this,"relay");Ct(this,"store");Ct(this,"filter");Ct(this,"lightPush");Ct(this,"connectionManager");Ct(this,"health");this.pubsubTopics=et,this.relay=ot,this.libp2p=nt,rt={filter:!1,lightpush:!1,store:!1,...rt};const it=tt.pingKeepAlive||DefaultPingKeepAliveValueSecs,st=this.relay?tt.relayKeepAlive||DefaultRelayKeepAliveValueSecs:0,at=this.libp2p.peerId.toString();if(this.connectionManager=ConnectionManager.create(at,nt,{pingKeepAlive:it,relayKeepAlive:st},this.pubsubTopics,this.relay),this.health=getHealthManager(),rt.store){const ct=wakuStore(this.connectionManager);this.store=ct(nt)}if(rt.lightpush){const ct=wakuLightPush(this.connectionManager,tt);this.lightPush=ct(nt)}if(rt.filter){const ct=wakuFilter(this.connectionManager,this.lightPush,tt);this.filter=ct(nt)}log$b.info("Waku node created",at,`relay: ${!!this.relay}, store: ${!!this.store}, light push: ${!!this.lightPush}, filter: ${!!this.filter}`)}get peerId(){return this.libp2p.peerId}get protocols(){return this.libp2p.getProtocols()}async dial(et,tt){const nt=tt??[],rt=this.mapToPeerIdOrMultiaddr(et);typeof tt>"u"&&(this.relay&&nt.push(Protocols.Relay),this.store&&nt.push(Protocols.Store),this.filter&&nt.push(Protocols.Filter),this.lightPush&&nt.push(Protocols.LightPush));const ot=[];return nt.includes(Protocols.Relay)&&(this.relay?this.relay.gossipSub.multicodecs.forEach(it=>ot.push(it)):log$b.error("Relay codec not included in dial codec: protocol not mounted locally")),nt.includes(Protocols.Store)&&(this.store?ot.push(this.store.protocol.multicodec):log$b.error("Store codec not included in dial codec: protocol not mounted locally")),nt.includes(Protocols.LightPush)&&(this.lightPush?ot.push(this.lightPush.protocol.multicodec):log$b.error("Light Push codec not included in dial codec: protocol not mounted locally")),nt.includes(Protocols.Filter)&&(this.filter?ot.push(this.filter.protocol.multicodec):log$b.error("Filter codec not included in dial codec: protocol not mounted locally")),log$b.info(`Dialing to ${rt.toString()} with protocols ${nt}`),this.libp2p.dialProtocol(rt,ot)}async start(){await this.libp2p.start()}async stop(){ReliabilityMonitorManager.stopAll(),this.connectionManager.stop(),await this.libp2p.stop()}async waitForPeers(et,tt){return waitForRemotePeer(this,et,tt)}isStarted(){return this.libp2p.status=="started"}isConnected(){return this.connectionManager.isConnected()}mapToPeerIdOrMultiaddr(et){return isPeerId$2(et)?et:multiaddr(et)}}var ls;let InvalidParametersError$3=(ls=class extends Error{constructor(et="Invalid parameters"){super(et),this.name="InvalidParametersError"}},Ct(ls,"name","InvalidParametersError"),ls);class InvalidPublicKeyError extends Error{constructor(et="Invalid public key"){super(et),this.name="InvalidPublicKeyError"}}Ct(InvalidPublicKeyError,"name","InvalidPublicKeyError");var us;let UnsupportedKeyTypeError$1=(us=class extends Error{constructor(et="Unsupported key type"){super(et),this.name="UnsupportedKeyTypeError"}},Ct(us,"name","UnsupportedKeyTypeError"),us);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$2=BigInt(0),_1n$3=BigInt(1),_2n$2=BigInt(2),_8n$2=BigInt(8),VERIFY_DEFAULT={zip215:!0};function validateOpts$1(o){const et=validateBasic(o);return validateObject(o,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...et})}function twistedEdwards(o){const et=validateOpts$1(o),{Fp:tt,n:nt,prehash:rt,hash:ot,randomBytes:it,nByteLength:st,h:at}=et,ct=_2n$2<{try{return{isValid:!0,value:tt.sqrt(Yt*tt.inv(Ht))}}catch{return{isValid:!1,value:_0n$2}}}),pt=et.adjustScalarBytes||(Yt=>Yt),mt=et.domain||((Yt,Ht,Ut)=>{if(abool("phflag",Ut),Ht.length||Ut)throw new Error("Contexts/pre-hash are not supported");return Yt});function ft(Yt,Ht){aInRange("coordinate "+Yt,Ht,_0n$2,ct)}function yt(Yt){if(!(Yt instanceof vt))throw new Error("ExtendedPoint expected")}const gt=memoized((Yt,Ht)=>{const{ex:Ut,ey:qt,ez:Lt}=Yt,Zt=Yt.is0();Ht==null&&(Ht=Zt?_8n$2:tt.inv(Lt));const Qt=lt(Ut*Ht),Nt=lt(qt*Ht),Gt=lt(Lt*Ht);if(Zt)return{x:_0n$2,y:_1n$3};if(Gt!==_1n$3)throw new Error("invZ was invalid");return{x:Qt,y:Nt}}),xt=memoized(Yt=>{const{a:Ht,d:Ut}=et;if(Yt.is0())throw new Error("bad point: ZERO");const{ex:qt,ey:Lt,ez:Zt,et:Qt}=Yt,Nt=lt(qt*qt),Gt=lt(Lt*Lt),nn=lt(Zt*Zt),Wt=lt(nn*nn),hn=lt(Nt*Ht),Xt=lt(nn*lt(hn+Gt)),Jt=lt(Wt+lt(Ut*lt(Nt*Gt)));if(Xt!==Jt)throw new Error("bad point: equation left != right (1)");const tn=lt(qt*Lt),_t=lt(Zt*Qt);if(tn!==_t)throw new Error("bad point: equation left != right (2)");return!0});class vt{constructor(Ht,Ut,qt,Lt){this.ex=Ht,this.ey=Ut,this.ez=qt,this.et=Lt,ft("x",Ht),ft("y",Ut),ft("z",qt),ft("t",Lt),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(Ht){if(Ht instanceof vt)throw new Error("extended point not allowed");const{x:Ut,y:qt}=Ht||{};return ft("x",Ut),ft("y",qt),new vt(Ut,qt,_1n$3,lt(Ut*qt))}static normalizeZ(Ht){const Ut=tt.invertBatch(Ht.map(qt=>qt.ez));return Ht.map((qt,Lt)=>qt.toAffine(Ut[Lt])).map(vt.fromAffine)}static msm(Ht,Ut){return pippenger(vt,dt,Ht,Ut)}_setWindowSize(Ht){wt.setWindowSize(this,Ht)}assertValidity(){xt(this)}equals(Ht){yt(Ht);const{ex:Ut,ey:qt,ez:Lt}=this,{ex:Zt,ey:Qt,ez:Nt}=Ht,Gt=lt(Ut*Nt),nn=lt(Zt*Lt),Wt=lt(qt*Nt),hn=lt(Qt*Lt);return Gt===nn&&Wt===hn}is0(){return this.equals(vt.ZERO)}negate(){return new vt(lt(-this.ex),this.ey,this.ez,lt(-this.et))}double(){const{a:Ht}=et,{ex:Ut,ey:qt,ez:Lt}=this,Zt=lt(Ut*Ut),Qt=lt(qt*qt),Nt=lt(_2n$2*lt(Lt*Lt)),Gt=lt(Ht*Zt),nn=Ut+qt,Wt=lt(lt(nn*nn)-Zt-Qt),hn=Gt+Qt,Xt=hn-Nt,Jt=Gt-Qt,tn=lt(Wt*Xt),_t=lt(hn*Jt),Dt=lt(Wt*Jt),Vt=lt(Xt*hn);return new vt(tn,_t,Vt,Dt)}add(Ht){yt(Ht);const{a:Ut,d:qt}=et,{ex:Lt,ey:Zt,ez:Qt,et:Nt}=this,{ex:Gt,ey:nn,ez:Wt,et:hn}=Ht;if(Ut===BigInt(-1)){const mn=lt((Zt-Lt)*(nn+Gt)),wn=lt((Zt+Lt)*(nn-Gt)),In=lt(wn-mn);if(In===_0n$2)return this.double();const Pn=lt(Qt*_2n$2*hn),yn=lt(Nt*_2n$2*Wt),En=yn+Pn,on=wn+mn,It=yn-Pn,St=lt(En*In),At=lt(on*It),jt=lt(En*It),Kt=lt(In*on);return new vt(St,At,Kt,jt)}const Xt=lt(Lt*Gt),Jt=lt(Zt*nn),tn=lt(Nt*qt*hn),_t=lt(Qt*Wt),Dt=lt((Lt+Zt)*(Gt+nn)-Xt-Jt),Vt=_t-tn,en=_t+tn,an=lt(Jt-Ut*Xt),dn=lt(Dt*Vt),ln=lt(en*an),pn=lt(Dt*an),kn=lt(Vt*en);return new vt(dn,ln,kn,pn)}subtract(Ht){return this.add(Ht.negate())}wNAF(Ht){return wt.wNAFCached(this,Ht,vt.normalizeZ)}multiply(Ht){const Ut=Ht;aInRange("scalar",Ut,_1n$3,nt);const{p:qt,f:Lt}=this.wNAF(Ut);return vt.normalizeZ([qt,Lt])[0]}multiplyUnsafe(Ht){const Ut=Ht;return aInRange("scalar",Ut,_0n$2,nt),Ut===_0n$2?Et:this.equals(Et)||Ut===_1n$3?this:this.equals(bt)?this.wNAF(Ut).p:wt.unsafeLadder(this,Ut)}isSmallOrder(){return this.multiplyUnsafe(at).is0()}isTorsionFree(){return wt.unsafeLadder(this,nt).is0()}toAffine(Ht){return gt(this,Ht)}clearCofactor(){const{h:Ht}=et;return Ht===_1n$3?this:this.multiplyUnsafe(Ht)}static fromHex(Ht,Ut=!1){const{d:qt,a:Lt}=et,Zt=tt.BYTES;Ht=ensureBytes$1("pointHex",Ht,Zt),abool("zip215",Ut);const Qt=Ht.slice(),Nt=Ht[Zt-1];Qt[Zt-1]=Nt&-129;const Gt=bytesToNumberLE(Qt),nn=Ut?ct:tt.ORDER;aInRange("pointHex.y",Gt,_0n$2,nn);const Wt=lt(Gt*Gt),hn=lt(Wt-_1n$3),Xt=lt(qt*Wt-Lt);let{isValid:Jt,value:tn}=ht(hn,Xt);if(!Jt)throw new Error("Point.fromHex: invalid y coordinate");const _t=(tn&_1n$3)===_1n$3,Dt=(Nt&128)!==0;if(!Ut&&tn===_0n$2&&Dt)throw new Error("Point.fromHex: x=0 and x_0=1");return Dt!==_t&&(tn=lt(-tn)),vt.fromAffine({x:tn,y:Gt})}static fromPrivateKey(Ht){return Rt(Ht).point}toRawBytes(){const{x:Ht,y:Ut}=this.toAffine(),qt=numberToBytesLE(Ut,tt.BYTES);return qt[qt.length-1]|=Ht&_1n$3?128:0,qt}toHex(){return bytesToHex$2(this.toRawBytes())}}vt.BASE=new vt(et.Gx,et.Gy,_1n$3,lt(et.Gx*et.Gy)),vt.ZERO=new vt(_0n$2,_1n$3,_1n$3,_0n$2);const{BASE:bt,ZERO:Et}=vt,wt=wNAF(vt,st*8);function kt(Yt){return mod$1(Yt,nt)}function Tt(Yt){return kt(bytesToNumberLE(Yt))}function Rt(Yt){const Ht=st;Yt=ensureBytes$1("private key",Yt,Ht);const Ut=ensureBytes$1("hashed private key",ot(Yt),2*Ht),qt=pt(Ut.slice(0,Ht)),Lt=Ut.slice(Ht,2*Ht),Zt=Tt(qt),Qt=bt.multiply(Zt),Nt=Qt.toRawBytes();return{head:qt,prefix:Lt,scalar:Zt,point:Qt,pointBytes:Nt}}function Pt(Yt){return Rt(Yt).pointBytes}function $t(Yt=new Uint8Array,...Ht){const Ut=concatBytes$1(...Ht);return Tt(ot(mt(Ut,ensureBytes$1("context",Yt),!!rt)))}function Ot(Yt,Ht,Ut={}){Yt=ensureBytes$1("message",Yt),rt&&(Yt=rt(Yt));const{prefix:qt,scalar:Lt,pointBytes:Zt}=Rt(Ht),Qt=$t(Ut.context,qt,Yt),Nt=bt.multiply(Qt).toRawBytes(),Gt=$t(Ut.context,Nt,Zt,Yt),nn=kt(Qt+Gt*Lt);aInRange("signature.s",nn,_0n$2,nt);const Wt=concatBytes$1(Nt,numberToBytesLE(nn,tt.BYTES));return ensureBytes$1("result",Wt,st*2)}const Bt=VERIFY_DEFAULT;function zt(Yt,Ht,Ut,qt=Bt){const{context:Lt,zip215:Zt}=qt,Qt=tt.BYTES;Yt=ensureBytes$1("signature",Yt,2*Qt),Ht=ensureBytes$1("message",Ht),Zt!==void 0&&abool("zip215",Zt),rt&&(Ht=rt(Ht));const Nt=bytesToNumberLE(Yt.slice(Qt,2*Qt));let Gt,nn,Wt;try{Gt=vt.fromHex(Ut,Zt),nn=vt.fromHex(Yt.slice(0,Qt),Zt),Wt=bt.multiplyUnsafe(Nt)}catch{return!1}if(!Zt&&Gt.isSmallOrder())return!1;const hn=$t(Lt,nn.toRawBytes(),Gt.toRawBytes(),Ht);return nn.add(Gt.multiplyUnsafe(hn)).subtract(Wt).clearCofactor().equals(vt.ZERO)}return bt._setWindowSize(8),{CURVE:et,getPublicKey:Pt,sign:Ot,verify:zt,ExtendedPoint:vt,utils:{getExtendedPublicKey:Rt,randomPrivateKey:()=>it(tt.BYTES),precompute(Yt=8,Ht=vt.BASE){return Ht._setWindowSize(Yt),Ht.multiply(BigInt(3)),Ht}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$1=BigInt(0),_1n$2=BigInt(1);function validateOpts(o){return validateObject(o,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...o})}function montgomery(o){const et=validateOpts(o),{P:tt}=et,nt=xt=>mod$1(xt,tt),rt=et.montgomeryBits,ot=Math.ceil(rt/8),it=et.nByteLength,st=et.adjustScalarBytes||(xt=>xt),at=et.powPminus2||(xt=>pow(xt,tt-BigInt(2),tt));function ct(xt,vt,bt){const Et=nt(xt*(vt-bt));return vt=nt(vt-Et),bt=nt(bt+Et),[vt,bt]}const lt=(et.a-BigInt(2))/BigInt(4);function dt(xt,vt){aInRange("u",xt,_0n$1,tt),aInRange("scalar",vt,_0n$1,tt);const bt=vt,Et=xt;let wt=_1n$2,kt=_0n$1,Tt=xt,Rt=_1n$2,Pt=_0n$1,$t;for(let Bt=BigInt(rt-1);Bt>=_0n$1;Bt--){const zt=bt>>Bt&_1n$2;Pt^=zt,$t=ct(Pt,wt,Tt),wt=$t[0],Tt=$t[1],$t=ct(Pt,kt,Rt),kt=$t[0],Rt=$t[1],Pt=zt;const Ft=wt+kt,Yt=nt(Ft*Ft),Ht=wt-kt,Ut=nt(Ht*Ht),qt=Yt-Ut,Lt=Tt+Rt,Zt=Tt-Rt,Qt=nt(Zt*Ft),Nt=nt(Lt*Ht),Gt=Qt+Nt,nn=Qt-Nt;Tt=nt(Gt*Gt),Rt=nt(Et*nt(nn*nn)),wt=nt(Yt*Ut),kt=nt(qt*(Yt+nt(lt*qt)))}$t=ct(Pt,wt,Tt),wt=$t[0],Tt=$t[1],$t=ct(Pt,kt,Rt),kt=$t[0],Rt=$t[1];const Ot=at(kt);return nt(wt*Ot)}function ht(xt){return numberToBytesLE(nt(xt),ot)}function pt(xt){const vt=ensureBytes$1("u coordinate",xt,ot);return it===32&&(vt[31]&=127),bytesToNumberLE(vt)}function mt(xt){const vt=ensureBytes$1("scalar",xt),bt=vt.length;if(bt!==ot&&bt!==it)throw new Error(`Expected ${ot} or ${it} bytes, got ${bt}`);return bytesToNumberLE(st(vt))}function ft(xt,vt){const bt=pt(vt),Et=mt(xt),wt=dt(bt,Et);if(wt===_0n$1)throw new Error("Invalid private or public key received");return ht(wt)}const yt=ht(et.Gu);function gt(xt){return ft(xt,yt)}return{scalarMult:ft,scalarMultBase:gt,getSharedSecret:(xt,vt)=>ft(xt,vt),getPublicKey:xt=>gt(xt),utils:{randomPrivateKey:()=>et.randomBytes(et.nByteLength)},GuBytes:yt}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ED25519_P=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),ED25519_SQRT_M1=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const _1n$1=BigInt(1),_2n$1=BigInt(2),_3n$1=BigInt(3),_5n=BigInt(5),_8n$1=BigInt(8);function ed25519_pow_2_252_3(o){const et=BigInt(10),tt=BigInt(20),nt=BigInt(40),rt=BigInt(80),ot=ED25519_P,st=o*o%ot*o%ot,at=pow2$1(st,_2n$1,ot)*st%ot,ct=pow2$1(at,_1n$1,ot)*o%ot,lt=pow2$1(ct,_5n,ot)*ct%ot,dt=pow2$1(lt,et,ot)*lt%ot,ht=pow2$1(dt,tt,ot)*dt%ot,pt=pow2$1(ht,nt,ot)*ht%ot,mt=pow2$1(pt,rt,ot)*pt%ot,ft=pow2$1(mt,rt,ot)*pt%ot,yt=pow2$1(ft,et,ot)*lt%ot;return{pow_p_5_8:pow2$1(yt,_2n$1,ot)*o%ot,b2:st}}function adjustScalarBytes(o){return o[0]&=248,o[31]&=127,o[31]|=64,o}function uvRatio(o,et){const tt=ED25519_P,nt=mod$1(et*et*et,tt),rt=mod$1(nt*nt*et,tt),ot=ed25519_pow_2_252_3(o*rt).pow_p_5_8;let it=mod$1(o*nt*ot,tt);const st=mod$1(et*it*it,tt),at=it,ct=mod$1(it*ED25519_SQRT_M1,tt),lt=st===o,dt=st===mod$1(-o,tt),ht=st===mod$1(-o*ED25519_SQRT_M1,tt);return lt&&(it=at),(dt||ht)&&(it=ct),isNegativeLE(it,tt)&&(it=mod$1(-it,tt)),{isValid:lt||dt,value:it}}const Fp=Field$1(ED25519_P,void 0,!0),ed25519Defaults={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:_8n$1,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:sha512,randomBytes:randomBytes$1,adjustScalarBytes,uvRatio},ed25519=twistedEdwards(ed25519Defaults),x25519=montgomery({P:ED25519_P,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:o=>{const et=ED25519_P,{pow_p_5_8:tt,b2:nt}=ed25519_pow_2_252_3(o);return mod$1(pow2$1(tt,_3n$1,et)*nt,et)},adjustScalarBytes,randomBytes:randomBytes$1}),PUBLIC_KEY_BYTE_LENGTH=32,PRIVATE_KEY_BYTE_LENGTH=64,KEYS_BYTE_LENGTH=32;function generateKey(){const o=ed25519.utils.randomPrivateKey(),et=ed25519.getPublicKey(o);return{privateKey:concatKeys(o,et),publicKey:et}}function hashAndSign(o,et){const tt=o.subarray(0,KEYS_BYTE_LENGTH);return ed25519.sign(et instanceof Uint8Array?et:et.subarray(),tt)}function hashAndVerify$2(o,et,tt){return ed25519.verify(et,tt instanceof Uint8Array?tt:tt.subarray(),o)}function concatKeys(o,et){const tt=new Uint8Array(PRIVATE_KEY_BYTE_LENGTH);for(let nt=0;ntenumeration(__KeyTypeValues)})(KeyType||(KeyType={}));var PublicKey;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.Type!=null&&(nt.uint32(8),KeyType.codec().encode(tt.Type,nt)),tt.Data!=null&&(nt.uint32(18),nt.bytes(tt.Data)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.Type=KeyType.codec().decode(tt);break}case 2:{ot.Data=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(PublicKey||(PublicKey={}));var PrivateKey;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.Type!=null&&(nt.uint32(8),KeyType.codec().encode(tt.Type,nt)),tt.Data!=null&&(nt.uint32(18),nt.bytes(tt.Data)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.Type=KeyType.codec().decode(tt);break}case 2:{ot.Data=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(PrivateKey||(PrivateKey={}));/*! + * MIT License + * + * Copyright (c) 2017-2022 Peculiar Ventures, LLC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + */const ARRAY_BUFFER_NAME="[object ArrayBuffer]";class BufferSourceConverter{static isArrayBuffer(et){return Object.prototype.toString.call(et)===ARRAY_BUFFER_NAME}static toArrayBuffer(et){return this.isArrayBuffer(et)?et:et.byteLength===et.buffer.byteLength||et.byteOffset===0&&et.byteLength===et.buffer.byteLength?et.buffer:this.toUint8Array(et.buffer).slice(et.byteOffset,et.byteOffset+et.byteLength).buffer}static toUint8Array(et){return this.toView(et,Uint8Array)}static toView(et,tt){if(et.constructor===tt)return et;if(this.isArrayBuffer(et))return new tt(et);if(this.isArrayBufferView(et))return new tt(et.buffer,et.byteOffset,et.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(et){return this.isArrayBufferView(et)||this.isArrayBuffer(et)}static isArrayBufferView(et){return ArrayBuffer.isView(et)||et&&this.isArrayBuffer(et.buffer)}static isEqual(et,tt){const nt=BufferSourceConverter.toUint8Array(et),rt=BufferSourceConverter.toUint8Array(tt);if(nt.length!==rt.byteLength)return!1;for(let ot=0;ot=0;nt--)tt+=o[o.length-1-nt]*Math.pow(2,et*nt);return tt}function utilToBase(o,et,tt=-1){const nt=tt;let rt=o,ot=0,it=Math.pow(2,et);for(let st=1;st<8;st++){if(o=0;lt--){const dt=Math.pow(2,lt*et);ct[ot-lt-1]=Math.floor(rt/dt),rt-=ct[ot-lt-1]*dt}return at}it*=Math.pow(2,et)}return new ArrayBuffer(0)}function utilConcatView(...o){let et=0,tt=0;for(const ot of o)et+=ot.length;const nt=new ArrayBuffer(et),rt=new Uint8Array(nt);for(const ot of o)rt.set(ot,tt),tt+=ot.length;return rt}function utilDecodeTC(){const o=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const st=o[0]===255&&o[1]&128,at=o[0]===0&&(o[1]&128)===0;(st||at)&&this.warnings.push("Needlessly long format")}const et=new ArrayBuffer(this.valueHex.byteLength),tt=new Uint8Array(et);for(let st=0;st"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function concat(o){let et=0,tt=0;for(let rt=0;rt=ot.length)return this.error="End of input reached before message was fully decoded",-1;if(at===lt){lt+=255;const ht=new Uint8Array(lt);for(let pt=0;pt8)return this.error="Too big integer",-1;if(it+1>ot.length)return this.error="End of input reached before message was fully decoded",-1;const st=tt+1,at=rt.subarray(st,st+it);return at[it-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=utilFromBase(at,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=it+1,tt+this.blockLength}toBER(et=!1){let tt,nt;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return tt=new ArrayBuffer(1),et===!1&&(nt=new Uint8Array(tt),nt[0]=128),tt;if(this.longFormUsed){const rt=utilToBase(this.length,8);if(rt.byteLength>127)return this.error="Too big length",EMPTY_BUFFER$1;if(tt=new ArrayBuffer(rt.byteLength+1),et)return tt;const ot=new Uint8Array(rt);nt=new Uint8Array(tt),nt[0]=rt.byteLength|128;for(let it=0;it=37&&rt.idBlock.isHexOnly===!1)return rt.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:rt};switch(rt.idBlock.tagNumber){case 0:if(rt.idBlock.isConstructed&&rt.lenBlock.length>0)return rt.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:rt};at=typeStore.EndOfContent;break;case 1:at=typeStore.Boolean;break;case 2:at=typeStore.Integer;break;case 3:at=typeStore.BitString;break;case 4:at=typeStore.OctetString;break;case 5:at=typeStore.Null;break;case 6:at=typeStore.ObjectIdentifier;break;case 10:at=typeStore.Enumerated;break;case 12:at=typeStore.Utf8String;break;case 13:at=typeStore.RelativeObjectIdentifier;break;case 14:at=typeStore.TIME;break;case 15:return rt.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:rt};case 16:at=typeStore.Sequence;break;case 17:at=typeStore.Set;break;case 18:at=typeStore.NumericString;break;case 19:at=typeStore.PrintableString;break;case 20:at=typeStore.TeletexString;break;case 21:at=typeStore.VideotexString;break;case 22:at=typeStore.IA5String;break;case 23:at=typeStore.UTCTime;break;case 24:at=typeStore.GeneralizedTime;break;case 25:at=typeStore.GraphicString;break;case 26:at=typeStore.VisibleString;break;case 27:at=typeStore.GeneralString;break;case 28:at=typeStore.UniversalString;break;case 29:at=typeStore.CharacterString;break;case 30:at=typeStore.BmpString;break;case 31:at=typeStore.DATE;break;case 32:at=typeStore.TimeOfDay;break;case 33:at=typeStore.DateTime;break;case 34:at=typeStore.Duration;break;default:{const ct=rt.idBlock.isConstructed?new typeStore.Constructed:new typeStore.Primitive;ct.idBlock=rt.idBlock,ct.lenBlock=rt.lenBlock,ct.warnings=rt.warnings,rt=ct}}break;case 2:case 3:case 4:default:at=rt.idBlock.isConstructed?typeStore.Constructed:typeStore.Primitive}return rt=localChangeType(rt,at),st=rt.fromBER(o,et,rt.lenBlock.isIndefiniteForm?tt:rt.lenBlock.length),rt.valueBeforeDecodeView=o.subarray(nt,nt+rt.blockLength),{offset:st,result:rt}}function fromBER(o){if(!o.byteLength){const et=new BaseBlock({},ValueBlock);return et.error="Input buffer has zero length",{offset:-1,result:et}}return localFromBER(BufferSourceConverter.toUint8Array(o).slice(),0,o.byteLength)}function checkLen(o,et){return o?1:et}class LocalConstructedValueBlock extends ValueBlock{constructor({value:et=[],isIndefiniteForm:tt=!1,...nt}={}){super(nt),this.value=et,this.isIndefiniteForm=tt}fromBER(et,tt,nt){const rt=BufferSourceConverter.toUint8Array(et);if(!checkBufferParams(this,rt,tt,nt))return-1;if(this.valueBeforeDecodeView=rt.subarray(tt,tt+nt),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),tt;let ot=tt;for(;checkLen(this.isIndefiniteForm,nt)>0;){const it=localFromBER(rt,ot,nt);if(it.offset===-1)return this.error=it.result.error,this.warnings.concat(it.result.warnings),-1;if(ot=it.offset,this.blockLength+=it.result.blockLength,nt-=it.result.blockLength,this.value.push(it.result),this.isIndefiniteForm&&it.result.constructor.NAME===END_OF_CONTENT_NAME)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===END_OF_CONTENT_NAME?this.value.pop():this.warnings.push("No EndOfContent block encoded")),ot}toBER(et,tt){const nt=tt||new ViewWriter;for(let rt=0;rt` ${rt}`).join(` +`));const tt=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return et.length?`${tt} : +${et.join(` +`)}`:`${tt} :`}}_a$v=Constructed;typeStore.Constructed=_a$v;Constructed.NAME="CONSTRUCTED";class LocalEndOfContentValueBlock extends ValueBlock{fromBER(et,tt,nt){return tt}toBER(et){return EMPTY_BUFFER$1}}LocalEndOfContentValueBlock.override="EndOfContentValueBlock";var _a$u;class EndOfContent extends BaseBlock{constructor(et={}){super(et,LocalEndOfContentValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}_a$u=EndOfContent;typeStore.EndOfContent=_a$u;EndOfContent.NAME=END_OF_CONTENT_NAME;var _a$t;class Null extends BaseBlock{constructor(et={}){super(et,ValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(et,tt,nt){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=nt,tt+nt>et.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):tt+nt}toBER(et,tt){const nt=new ArrayBuffer(2);if(!et){const rt=new Uint8Array(nt);rt[0]=5,rt[1]=0}return tt&&tt.write(nt),nt}onAsciiEncoding(){return`${this.constructor.NAME}`}}_a$t=Null;typeStore.Null=_a$t;Null.NAME="NULL";class LocalBooleanValueBlock extends HexBlock(ValueBlock){constructor({value:et,...tt}={}){super(tt),tt.valueHex?this.valueHexView=BufferSourceConverter.toUint8Array(tt.valueHex):this.valueHexView=new Uint8Array(1),et&&(this.value=et)}get value(){for(const et of this.valueHexView)if(et>0)return!0;return!1}set value(et){this.valueHexView[0]=et?255:0}fromBER(et,tt,nt){const rt=BufferSourceConverter.toUint8Array(et);return checkBufferParams(this,rt,tt,nt)?(this.valueHexView=rt.subarray(tt,tt+nt),nt>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,utilDecodeTC.call(this),this.blockLength=nt,tt+nt):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}LocalBooleanValueBlock.NAME="BooleanValueBlock";var _a$s;let Boolean$1=class extends BaseBlock{constructor(et={}){super(et,LocalBooleanValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(et){this.valueBlock.value=et}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};_a$s=Boolean$1;typeStore.Boolean=_a$s;Boolean$1.NAME="BOOLEAN";class LocalOctetStringValueBlock extends HexBlock(LocalConstructedValueBlock){constructor({isConstructed:et=!1,...tt}={}){super(tt),this.isConstructed=et}fromBER(et,tt,nt){let rt=0;if(this.isConstructed){if(this.isHexOnly=!1,rt=LocalConstructedValueBlock.prototype.fromBER.call(this,et,tt,nt),rt===-1)return rt;for(let ot=0;ot0&&ct.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=ct.unusedBits}return rt}const ot=BufferSourceConverter.toUint8Array(et);if(!checkBufferParams(this,ot,tt,nt))return-1;const it=ot.subarray(tt,tt+nt);if(this.unusedBits=it[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const st=it.subarray(1);try{if(st.byteLength){const at=localFromBER(st,0,st.byteLength);at.offset!==-1&&at.offset===nt-1&&(this.value=[at.result])}}catch{}}return this.valueHexView=it.subarray(1),this.blockLength=it.length,tt+nt}toBER(et,tt){if(this.isConstructed)return LocalConstructedValueBlock.prototype.toBER.call(this,et,tt);if(et)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return EMPTY_BUFFER$1;const nt=new Uint8Array(this.valueHexView.length+1);return nt[0]=this.unusedBits,nt.set(this.valueHexView,1),nt.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}LocalBitStringValueBlock.NAME="BitStringValueBlock";var _a$q;class BitString extends BaseBlock{constructor({idBlock:et={},lenBlock:tt={},...nt}={}){var rt,ot;(rt=nt.isConstructed)!==null&&rt!==void 0||(nt.isConstructed=!!(!((ot=nt.value)===null||ot===void 0)&&ot.length)),super({idBlock:{isConstructed:nt.isConstructed,...et},lenBlock:{...tt,isIndefiniteForm:!!nt.isIndefiniteForm},...nt},LocalBitStringValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(et,tt,nt){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(et,tt,nt)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Constructed.prototype.onAsciiEncoding.call(this);{const et=[],tt=this.valueBlock.valueHexView;for(const rt of tt)et.push(rt.toString(2).padStart(8,"0"));const nt=et.join("");return`${this.constructor.NAME} : ${nt.substring(0,nt.length-this.valueBlock.unusedBits)}`}}}_a$q=BitString;typeStore.BitString=_a$q;BitString.NAME=BIT_STRING_NAME;var _a$p;function viewAdd(o,et){const tt=new Uint8Array([0]),nt=new Uint8Array(o),rt=new Uint8Array(et);let ot=nt.slice(0);const it=ot.length-1,st=rt.slice(0),at=st.length-1;let ct=0;const lt=at=0;ht--,dt++){switch(!0){case dt=ot.length:ot=utilConcatView(new Uint8Array([ct%10]),ot);break;default:ot[it-dt]=ct%10}}return tt[0]>0&&(ot=utilConcatView(tt,ot)),ot}function power2(o){if(o>=powers2.length)for(let et=powers2.length;et<=o;et++){const tt=new Uint8Array([0]);let nt=powers2[et-1].slice(0);for(let rt=nt.length-1;rt>=0;rt--){const ot=new Uint8Array([(nt[rt]<<1)+tt[0]]);tt[0]=ot[0]/10,nt[rt]=ot[0]%10}tt[0]>0&&(nt=utilConcatView(tt,nt)),powers2.push(nt)}return powers2[o]}function viewSub(o,et){let tt=0;const nt=new Uint8Array(o),rt=new Uint8Array(et),ot=nt.slice(0),it=ot.length-1,st=rt.slice(0),at=st.length-1;let ct,lt=0;for(let dt=at;dt>=0;dt--,lt++)switch(ct=ot[it-lt]-st[at-lt]-tt,!0){case ct<0:tt=1,ot[it-lt]=ct+10;break;default:tt=0,ot[it-lt]=ct}if(tt>0)for(let dt=it-at+1;dt>=0;dt--,lt++)if(ct=ot[it-lt]-tt,ct<0)tt=1,ot[it-lt]=ct+10;else{tt=0,ot[it-lt]=ct;break}return ot.slice()}class LocalIntegerValueBlock extends HexBlock(ValueBlock){constructor({value:et,...tt}={}){super(tt),this._valueDec=0,tt.valueHex&&this.setValueHex(),et!==void 0&&(this.valueDec=et)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=utilDecodeTC.call(this)))}set valueDec(et){this._valueDec=et,this.isHexOnly=!1,this.valueHexView=new Uint8Array(utilEncodeTC(et))}get valueDec(){return this._valueDec}fromDER(et,tt,nt,rt=0){const ot=this.fromBER(et,tt,nt);if(ot===-1)return ot;const it=this.valueHexView;return it[0]===0&&it[1]&128?this.valueHexView=it.subarray(1):rt!==0&&it.length1&&(rt=it.length+1),this.valueHexView=it.subarray(rt-it.length)),ot}toDER(et=!1){const tt=this.valueHexView;switch(!0){case(tt[0]&128)!==0:{const nt=new Uint8Array(this.valueHexView.length+1);nt[0]=0,nt.set(tt,1),this.valueHexView=nt}break;case(tt[0]===0&&(tt[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(et)}fromBER(et,tt,nt){const rt=super.fromBER(et,tt,nt);return rt===-1||this.setValueHex(),rt}toBER(et){return et?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const et=this.valueHexView.length*8-1;let tt=new Uint8Array(this.valueHexView.length*8/3),nt=0,rt;const ot=this.valueHexView;let it="",st=!1;for(let at=ot.byteLength-1;at>=0;at--){rt=ot[at];for(let ct=0;ct<8;ct++){if((rt&1)===1)switch(nt){case et:tt=viewSub(power2(nt),tt),it="-";break;default:tt=viewAdd(tt,power2(nt))}nt++,rt>>=1}}for(let at=0;at0;){const ot=new LocalSidValueBlock;if(rt=ot.fromBER(et,rt,nt),rt===-1)return this.blockLength=0,this.error=ot.error,rt;this.value.length===0&&(ot.isFirstSid=!0),this.blockLength+=ot.blockLength,nt-=ot.blockLength,this.value.push(ot)}return rt}toBER(et){const tt=[];for(let nt=0;ntNumber.MAX_SAFE_INTEGER){assertBigInt();const st=BigInt(rt);it.valueBigInt=st}else if(it.valueDec=parseInt(rt,10),isNaN(it.valueDec))return;this.value.length||(it.isFirstSid=!0,ot=!0),this.value.push(it)}while(nt!==-1)}toString(){let et="",tt=!1;for(let nt=0;nt0;){const ot=new LocalRelativeSidValueBlock;if(rt=ot.fromBER(et,rt,nt),rt===-1)return this.blockLength=0,this.error=ot.error,rt;this.blockLength+=ot.blockLength,nt-=ot.blockLength,this.value.push(ot)}return rt}toBER(et,tt){const nt=[];for(let rt=0;rt4)continue;const st=4-it.length;for(let at=it.length-1;at>=0;at--)nt[rt*4+at+st]=it[at]}this.valueBlock.value=et}}LocalUniversalStringValueBlock.NAME="UniversalStringValueBlock";var _a$g;class UniversalString extends LocalUniversalStringValueBlock{constructor({...et}={}){super(et),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}_a$g=UniversalString;typeStore.UniversalString=_a$g;UniversalString.NAME="UniversalString";var _a$f;class NumericString extends LocalSimpleStringBlock{constructor(et={}){super(et),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}_a$f=NumericString;typeStore.NumericString=_a$f;NumericString.NAME="NumericString";var _a$e;class PrintableString extends LocalSimpleStringBlock{constructor(et={}){super(et),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}_a$e=PrintableString;typeStore.PrintableString=_a$e;PrintableString.NAME="PrintableString";var _a$d;class TeletexString extends LocalSimpleStringBlock{constructor(et={}){super(et),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}_a$d=TeletexString;typeStore.TeletexString=_a$d;TeletexString.NAME="TeletexString";var _a$c;class VideotexString extends LocalSimpleStringBlock{constructor(et={}){super(et),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}_a$c=VideotexString;typeStore.VideotexString=_a$c;VideotexString.NAME="VideotexString";var _a$b;class IA5String extends LocalSimpleStringBlock{constructor(et={}){super(et),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}_a$b=IA5String;typeStore.IA5String=_a$b;IA5String.NAME="IA5String";var _a$a;class GraphicString extends LocalSimpleStringBlock{constructor(et={}){super(et),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}_a$a=GraphicString;typeStore.GraphicString=_a$a;GraphicString.NAME="GraphicString";var _a$9;class VisibleString extends LocalSimpleStringBlock{constructor(et={}){super(et),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}_a$9=VisibleString;typeStore.VisibleString=_a$9;VisibleString.NAME="VisibleString";var _a$8;class GeneralString extends LocalSimpleStringBlock{constructor(et={}){super(et),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}_a$8=GeneralString;typeStore.GeneralString=_a$8;GeneralString.NAME="GeneralString";var _a$7;class CharacterString extends LocalSimpleStringBlock{constructor(et={}){super(et),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}_a$7=CharacterString;typeStore.CharacterString=_a$7;CharacterString.NAME="CharacterString";var _a$6;class UTCTime extends VisibleString{constructor({value:et,valueDate:tt,...nt}={}){if(super(nt),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,et){this.fromString(et),this.valueBlock.valueHexView=new Uint8Array(et.length);for(let rt=0;rt=50?this.year=1900+rt:this.year=2e3+rt,this.month=parseInt(nt[2],10),this.day=parseInt(nt[3],10),this.hour=parseInt(nt[4],10),this.minute=parseInt(nt[5],10),this.second=parseInt(nt[6],10)}toString(et="iso"){if(et==="iso"){const tt=new Array(7);return tt[0]=padNumber(this.year<2e3?this.year-1900:this.year-2e3,2),tt[1]=padNumber(this.month,2),tt[2]=padNumber(this.day,2),tt[3]=padNumber(this.hour,2),tt[4]=padNumber(this.minute,2),tt[5]=padNumber(this.second,2),tt[6]="Z",tt.join("")}return super.toString(et)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}_a$6=UTCTime;typeStore.UTCTime=_a$6;UTCTime.NAME="UTCTime";var _a$5;class GeneralizedTime extends UTCTime{constructor(et={}){var tt;super(et),(tt=this.millisecond)!==null&&tt!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(et){super.fromDate(et),this.millisecond=et.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(et){let tt=!1,nt="",rt="",ot=0,it,st=0,at=0;if(et[et.length-1]==="Z")nt=et.substring(0,et.length-1),tt=!0;else{const dt=new Number(et[et.length-1]);if(isNaN(dt.valueOf()))throw new Error("Wrong input string for conversion");nt=et}if(tt){if(nt.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(nt.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let dt=1,ht=nt.indexOf("+"),pt="";if(ht===-1&&(ht=nt.indexOf("-"),dt=-1),ht!==-1){if(pt=nt.substring(ht+1),nt=nt.substring(0,ht),pt.length!==2&&pt.length!==4)throw new Error("Wrong input string for conversion");let mt=parseInt(pt.substring(0,2),10);if(isNaN(mt.valueOf()))throw new Error("Wrong input string for conversion");if(st=dt*mt,pt.length===4){if(mt=parseInt(pt.substring(2,4),10),isNaN(mt.valueOf()))throw new Error("Wrong input string for conversion");at=dt*mt}}}let ct=nt.indexOf(".");if(ct===-1&&(ct=nt.indexOf(",")),ct!==-1){const dt=new Number(`0${nt.substring(ct)}`);if(isNaN(dt.valueOf()))throw new Error("Wrong input string for conversion");ot=dt.valueOf(),rt=nt.substring(0,ct)}else rt=nt;switch(!0){case rt.length===8:if(it=/(\d{4})(\d{2})(\d{2})/ig,ct!==-1)throw new Error("Wrong input string for conversion");break;case rt.length===10:if(it=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,ct!==-1){let dt=60*ot;this.minute=Math.floor(dt),dt=60*(dt-this.minute),this.second=Math.floor(dt),dt=1e3*(dt-this.second),this.millisecond=Math.floor(dt)}break;case rt.length===12:if(it=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,ct!==-1){let dt=60*ot;this.second=Math.floor(dt),dt=1e3*(dt-this.second),this.millisecond=Math.floor(dt)}break;case rt.length===14:if(it=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,ct!==-1){const dt=1e3*ot;this.millisecond=Math.floor(dt)}break;default:throw new Error("Wrong input string for conversion")}const lt=it.exec(rt);if(lt===null)throw new Error("Wrong input string for conversion");for(let dt=1;dt0&&(nt=`0${nt}`),et.push(nt)}),BigInt("0x"+et.join(""))}function pkixToRSAPublicKey(o){const et=pkixToJwk(o);if(rsaKeySize(et)>MAX_RSA_KEY_SIZE)throw new InvalidPublicKeyError("Key size is too large");const tt=sha256$2(PublicKey.encode({Type:KeyType.RSA,Data:o})),nt=create$3(SHA2_256_CODE,tt);return new RSAPublicKey(et,nt)}function isPromise$3(o){return o==null?!1:typeof o.then=="function"&&typeof o.catch=="function"&&typeof o.finally=="function"}function hashAndVerify(o,et,tt){const nt=sha256.digest(tt instanceof Uint8Array?tt:tt.subarray());if(isPromise$3(nt))return nt.then(({digest:rt})=>secp256k1.verify(et,rt,o)).catch(rt=>{throw new VerificationError(String(rt))});try{return secp256k1.verify(et,nt.digest,o)}catch(rt){throw new VerificationError(String(rt))}}class Secp256k1PublicKey{constructor(et){Ct(this,"type","secp256k1");Ct(this,"raw");Ct(this,"_key");this._key=validateSecp256k1PublicKey(et),this.raw=compressSecp256k1PublicKey(this._key)}toMultihash(){return identity.digest(publicKeyToProtobuf(this))}toCID(){return CID.createV1(114,this.toMultihash())}toString(){return base58btc.encode(this.toMultihash().bytes).substring(1)}equals(et){return et==null||!(et.raw instanceof Uint8Array)?!1:equals(this.raw,et.raw)}verify(et,tt){return hashAndVerify(this._key,tt,et)}}function unmarshalSecp256k1PublicKey(o){return new Secp256k1PublicKey(o)}function compressSecp256k1PublicKey(o){return secp256k1.ProjectivePoint.fromHex(o).toRawBytes(!0)}function validateSecp256k1PublicKey(o){try{return secp256k1.ProjectivePoint.fromHex(o),o}catch(et){throw new InvalidPublicKeyError(String(et))}}async function generateKeyPair(o,et){return generateEd25519KeyPair()}function publicKeyFromProtobuf(o){const{Type:et,Data:tt}=PublicKey.decode(o),nt=tt??new Uint8Array;switch(et){case KeyType.RSA:return pkixToRSAPublicKey(nt);case KeyType.Ed25519:return unmarshalEd25519PublicKey(nt);case KeyType.secp256k1:return unmarshalSecp256k1PublicKey(nt);default:throw new UnsupportedKeyTypeError$1}}function publicKeyFromRaw(o){return o.byteLength===32?unmarshalEd25519PublicKey(o):o.byteLength===33?unmarshalSecp256k1PublicKey(o):pkixToRSAPublicKey(o)}function publicKeyFromMultihash(o){const{Type:et,Data:tt}=PublicKey.decode(o.digest),nt=tt??new Uint8Array;switch(et){case KeyType.Ed25519:return unmarshalEd25519PublicKey(nt);case KeyType.secp256k1:return unmarshalSecp256k1PublicKey(nt);default:throw new UnsupportedKeyTypeError$1}}function publicKeyToProtobuf(o){return PublicKey.encode({Type:KeyType[o.type],Data:o.raw})}const peerIdSymbol$2=Symbol.for("@libp2p/peer-id");var ds;let InvalidParametersError$2=(ds=class extends Error{constructor(et="Invalid parameters"){super(et),this.name="InvalidParametersError"}},Ct(ds,"name","InvalidParametersError"),ds);class InvalidCIDError extends Error{constructor(et="Invalid CID"){super(et),this.name="InvalidCIDError"}}Ct(InvalidCIDError,"name","InvalidCIDError");class InvalidMultihashError extends Error{constructor(et="Invalid Multihash"){super(et),this.name="InvalidMultihashError"}}Ct(InvalidMultihashError,"name","InvalidMultihashError");class UnsupportedKeyTypeError extends Error{constructor(et="Unsupported key type"){super(et),this.name="UnsupportedKeyTypeError"}}Ct(UnsupportedKeyTypeError,"name","UnsupportedKeyTypeError");const inspect=Symbol.for("nodejs.util.inspect.custom"),LIBP2P_KEY_CODE$1=114;var Js;class PeerIdImpl{constructor(et){Ct(this,"type");Ct(this,"multihash");Ct(this,"publicKey");Ct(this,"string");Ct(this,Js,!0);this.type=et.type,this.multihash=et.multihash,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}get[Symbol.toStringTag](){return`PeerId(${this.toString()})`}toString(){return this.string==null&&(this.string=base58btc.encode(this.multihash.bytes).slice(1)),this.string}toMultihash(){return this.multihash}toCID(){return CID.createV1(LIBP2P_KEY_CODE$1,this.multihash)}toJSON(){return this.toString()}equals(et){var tt;if(et==null)return!1;if(et instanceof Uint8Array)return equals(this.multihash.bytes,et);if(typeof et=="string")return this.toString()===et;if(((tt=et==null?void 0:et.toMultihash())==null?void 0:tt.bytes)!=null)return equals(this.multihash.bytes,et.toMultihash().bytes);throw new Error("not valid Id")}[(Js=peerIdSymbol$2,inspect)](){return`PeerId(${this.toString()})`}}class RSAPeerId extends PeerIdImpl{constructor(tt){super({...tt,type:"RSA"});Ct(this,"type","RSA");Ct(this,"publicKey");this.publicKey=tt.publicKey}}class Ed25519PeerId extends PeerIdImpl{constructor(tt){super({...tt,type:"Ed25519"});Ct(this,"type","Ed25519");Ct(this,"publicKey");this.publicKey=tt.publicKey}}class Secp256k1PeerId extends PeerIdImpl{constructor(tt){super({...tt,type:"secp256k1"});Ct(this,"type","secp256k1");Ct(this,"publicKey");this.publicKey=tt.publicKey}}const TRANSPORT_IPFS_GATEWAY_HTTP_CODE$1=2336;var na,ga;class URLPeerId{constructor(et){Ct(this,"type","url");Ct(this,"multihash");Ct(this,"publicKey");Ct(this,"url");Ct(this,na,!0);this.url=et.toString(),this.multihash=identity.digest(fromString(this.url))}[(ga=inspect,na=peerIdSymbol$2,ga)](){return`PeerId(${this.url})`}toString(){return this.toCID().toString()}toMultihash(){return this.multihash}toCID(){return CID.createV1(TRANSPORT_IPFS_GATEWAY_HTTP_CODE$1,this.toMultihash())}toJSON(){return this.toString()}equals(et){return et==null?!1:(et instanceof Uint8Array&&(et=toString$8(et)),et.toString()===this.toString())}}const LIBP2P_KEY_CODE=114,TRANSPORT_IPFS_GATEWAY_HTTP_CODE=2336;function peerIdFromString$1(o,et){let tt;if(o.charAt(0)==="1"||o.charAt(0)==="Q")tt=decode$6(base58btc.decode(`z${o}`));else throw new InvalidParametersError$2('Please pass a multibase decoder for strings that do not start with "1" or "Q"');return peerIdFromMultihash(tt)}function peerIdFromPublicKey(o){if(o.type==="Ed25519")return new Ed25519PeerId({multihash:o.toCID().multihash,publicKey:o});if(o.type==="secp256k1")return new Secp256k1PeerId({multihash:o.toCID().multihash,publicKey:o});if(o.type==="RSA")return new RSAPeerId({multihash:o.toCID().multihash,publicKey:o});throw new UnsupportedKeyTypeError}function peerIdFromPrivateKey(o){return peerIdFromPublicKey(o.publicKey)}function peerIdFromMultihash(o){if(isSha256Multihash(o))return new RSAPeerId({multihash:o});if(isIdentityMultihash(o))try{const et=publicKeyFromMultihash(o);if(et.type==="Ed25519")return new Ed25519PeerId({multihash:o,publicKey:et});if(et.type==="secp256k1")return new Secp256k1PeerId({multihash:o,publicKey:et})}catch{const tt=toString$8(o.digest);return new URLPeerId(new URL(tt))}throw new InvalidMultihashError("Supplied PeerID Multihash is invalid")}function peerIdFromCID(o){if((o==null?void 0:o.multihash)==null||o.version==null||o.version===1&&o.code!==LIBP2P_KEY_CODE&&o.code!==TRANSPORT_IPFS_GATEWAY_HTTP_CODE)throw new InvalidCIDError("Supplied PeerID CID is invalid");if(o.code===TRANSPORT_IPFS_GATEWAY_HTTP_CODE){const et=toString$8(o.multihash.digest);return new URLPeerId(new URL(et))}return peerIdFromMultihash(o.multihash)}function isIdentityMultihash(o){return o.code===identity.code}function isSha256Multihash(o){return o.code===sha256.code}let AbortError$8=class extends Error{constructor(tt,nt,rt){super(tt??"The operation was aborted");Ct(this,"type");Ct(this,"code");this.type="aborted",this.name=rt??"AbortError",this.code=nt??"ABORT_ERR"}};async function raceSignal(o,et,tt){if(et==null)return o;if(et.aborted)return Promise.reject(new AbortError$8(tt==null?void 0:tt.errorMessage,tt==null?void 0:tt.errorCode,tt==null?void 0:tt.errorName));let nt;const rt=new AbortError$8(tt==null?void 0:tt.errorMessage,tt==null?void 0:tt.errorCode,tt==null?void 0:tt.errorName);try{return await Promise.race([o,new Promise((ot,it)=>{nt=()=>{it(rt)},et.addEventListener("abort",nt)})])}finally{nt!=null&&et.removeEventListener("abort",nt)}}class QueuelessPushable{constructor(){Ct(this,"readNext");Ct(this,"haveNext");Ct(this,"ended");Ct(this,"nextResult");this.ended=!1,this.readNext=pDefer(),this.haveNext=pDefer()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("HaveNext promise resolved but nextResult was undefined");const et=this.nextResult;return this.nextResult=void 0,this.readNext.resolve(),this.readNext=pDefer(),et}async throw(et){return this.ended=!0,et!=null&&(this.haveNext.promise.catch(()=>{}),this.haveNext.reject(et)),{done:!0,value:void 0}}async return(){const et={done:!0,value:void 0};return await this._push(void 0),et}async push(et,tt){await this._push(et,tt)}async end(et,tt){et!=null?await this.throw(et):await this._push(void 0,tt)}async _push(et,tt){if(et!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");for(;this.nextResult!=null;)await this.readNext.promise;et!=null?this.nextResult={done:!1,value:et}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=pDefer(),await raceSignal(this.readNext.promise,tt==null?void 0:tt.signal,tt)}}function queuelessPushable(){return new QueuelessPushable}class UnexpectedEOFError extends Error{constructor(){super(...arguments);Ct(this,"name","UnexpectedEOFError");Ct(this,"code","ERR_UNEXPECTED_EOF")}}class CodeError extends Error{constructor(tt,nt){super(tt);Ct(this,"code");this.code=nt}}let AbortError$7=class extends CodeError{constructor(tt){super(tt,"ABORT_ERR");Ct(this,"type");this.type="aborted",this.name="AbortError"}};function byteStream(o,et){const tt=queuelessPushable();o.sink(tt).catch(async it=>{await tt.end(it)}),o.sink=async it=>{for await(const st of it)await tt.push(st);await tt.end()};let nt=o.source;o.source[Symbol.iterator]!=null?nt=o.source[Symbol.iterator]():o.source[Symbol.asyncIterator]!=null&&(nt=o.source[Symbol.asyncIterator]());const rt=new Uint8ArrayList;return{read:async(it,st)=>{var lt,dt;(lt=st==null?void 0:st.signal)==null||lt.throwIfAborted();let at;const ct=new Promise((ht,pt)=>{var mt;at=()=>{pt(new AbortError$7("Read aborted"))},(mt=st==null?void 0:st.signal)==null||mt.addEventListener("abort",at)});try{if(it==null){const{done:pt,value:mt}=await Promise.race([nt.next(),ct]);return pt===!0?new Uint8ArrayList:mt}for(;rt.byteLength{var at;(at=st==null?void 0:st.signal)==null||at.throwIfAborted(),it instanceof Uint8Array?await tt.push(it,st):await tt.push(it.subarray(),st)},unwrap:()=>{if(rt.byteLength>0){const it=o.source;o.source=async function*(){(et==null?void 0:et.yieldBytes)===!1?yield rt:yield*rt,yield*it}()}return o}}}class InvalidMessageLengthError extends Error{constructor(){super(...arguments);Ct(this,"name","InvalidMessageLengthError");Ct(this,"code","ERR_INVALID_MSG_LENGTH")}}class InvalidDataLengthError extends Error{constructor(){super(...arguments);Ct(this,"name","InvalidDataLengthError");Ct(this,"code","ERR_MSG_DATA_TOO_LONG")}}class InvalidDataLengthLengthError extends Error{constructor(){super(...arguments);Ct(this,"name","InvalidDataLengthLengthError");Ct(this,"code","ERR_MSG_LENGTH_TOO_LONG")}}function lpStream(o,et={}){const tt=byteStream(o,et);et.maxDataLength!=null&&et.maxLengthLength==null&&(et.maxLengthLength=encodingLength$3(et.maxDataLength));const nt=(et==null?void 0:et.lengthDecoder)??decode$b,rt=(et==null?void 0:et.lengthEncoder)??encode$a;return{read:async it=>{let st=-1;const at=new Uint8ArrayList;for(;;){at.append(await tt.read(1,it));try{st=nt(at)}catch(ct){if(ct instanceof RangeError)continue;throw ct}if(st<0)throw new InvalidMessageLengthError("Invalid message length");if((et==null?void 0:et.maxLengthLength)!=null&&at.byteLength>et.maxLengthLength)throw new InvalidDataLengthLengthError("message length length too long");if(st>-1)break}if((et==null?void 0:et.maxDataLength)!=null&&st>et.maxDataLength)throw new InvalidDataLengthError("message length too long");return tt.read(st,it)},write:async(it,st)=>{await tt.write(new Uint8ArrayList(rt(it.byteLength),it),st)},writeV:async(it,st)=>{const at=new Uint8ArrayList(...it.flatMap(ct=>[rt(ct.byteLength),ct]));await tt.write(at,st)},unwrap:()=>tt.unwrap()}}function pair(){const o=pDefer();let et=!1;return{sink:async tt=>{if(et)throw new Error("already piped");et=!0,o.resolve(tt)},source:async function*(){yield*await o.promise}()}}function duplexPair(){const o=pair(),et=pair();return[{source:o.source,sink:et.sink},{source:et.source,sink:o.sink}]}var define_globalThis_process_env_default$2={};const NOISE_MSG_MAX_LENGTH_BYTES=65535,NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG=NOISE_MSG_MAX_LENGTH_BYTES-16,DUMP_SESSION_KEYS=!!(define_globalThis_process_env_default$2!=null&&define_globalThis_process_env_default$2.DUMP_SESSION_KEYS);function number$2(o){if(!Number.isSafeInteger(o)||o<0)throw new Error(`positive integer expected, not ${o}`)}function bool(o){if(typeof o!="boolean")throw new Error(`boolean expected, not ${o}`)}function isBytes$1(o){return o instanceof Uint8Array||o!=null&&typeof o=="object"&&o.constructor.name==="Uint8Array"}function bytes(o,...et){if(!isBytes$1(o))throw new Error("Uint8Array expected");if(et.length>0&&!et.includes(o.length))throw new Error(`Uint8Array expected of length ${et}, not of length=${o.length}`)}function exists(o,et=!0){if(o.destroyed)throw new Error("Hash instance has been destroyed");if(et&&o.finished)throw new Error("Hash#digest() has already been called")}function output(o,et){bytes(o);const tt=et.outputLen;if(o.lengthnew Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)),createView=o=>new DataView(o.buffer,o.byteOffset,o.byteLength),isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes(o){if(typeof o!="string")throw new Error(`string expected, got ${typeof o}`);return new Uint8Array(new TextEncoder().encode(o))}function toBytes(o){if(typeof o=="string")o=utf8ToBytes(o);else if(isBytes$1(o))o=copyBytes(o);else throw new Error(`Uint8Array expected, got ${typeof o}`);return o}function checkOpts(o,et){if(et==null||typeof et!="object")throw new Error("options must be defined");return Object.assign(o,et)}function equalBytes(o,et){if(o.length!==et.length)return!1;let tt=0;for(let nt=0;nt(Object.assign(et,o),et);function setBigUint64(o,et,tt,nt){if(typeof o.setBigUint64=="function")return o.setBigUint64(et,tt,nt);const rt=BigInt(32),ot=BigInt(4294967295),it=Number(tt>>rt&ot),st=Number(tt&ot),at=4,ct=0;o.setUint32(et+at,it,nt),o.setUint32(et+ct,st,nt)}function copyBytes(o){return Uint8Array.from(o)}function clean(...o){for(let et=0;etUint8Array.from(o.split("").map(et=>et.charCodeAt(0))),sigma16=_utf8ToBytes("expand 16-byte k"),sigma32=_utf8ToBytes("expand 32-byte k"),sigma16_32=u32(sigma16),sigma32_32=u32(sigma32);sigma32_32.slice();function rotl(o,et){return o<>>32-et}function isAligned32(o){return o.byteOffset%4===0}const BLOCK_LEN=64,BLOCK_LEN32=16,MAX_COUNTER=2**32-1,U32_EMPTY=new Uint32Array;function runCipher(o,et,tt,nt,rt,ot,it,st){const at=rt.length,ct=new Uint8Array(BLOCK_LEN),lt=u32(ct),dt=isAligned32(rt)&&isAligned32(ot),ht=dt?u32(rt):U32_EMPTY,pt=dt?u32(ot):U32_EMPTY;for(let mt=0;mt=MAX_COUNTER)throw new Error("arx: counter overflow");const ft=Math.min(BLOCK_LEN,at-mt);if(dt&&ft===BLOCK_LEN){const yt=mt/4;if(mt%4!==0)throw new Error("arx: invalid block position");for(let gt=0,xt;gt{bytes(st),bytes(at),bytes(ct);const ht=ct.length;if(lt===void 0&&(lt=new Uint8Array(ht)),bytes(lt),number$2(dt),dt<0||dt>=MAX_COUNTER)throw new Error("arx: counter overflow");if(lt.lengtho[et++]&255|(o[et++]&255)<<8;class Poly1305{constructor(et){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,et=toBytes(et),bytes(et,32);const tt=u8to16(et,0),nt=u8to16(et,2),rt=u8to16(et,4),ot=u8to16(et,6),it=u8to16(et,8),st=u8to16(et,10),at=u8to16(et,12),ct=u8to16(et,14);this.r[0]=tt&8191,this.r[1]=(tt>>>13|nt<<3)&8191,this.r[2]=(nt>>>10|rt<<6)&7939,this.r[3]=(rt>>>7|ot<<9)&8191,this.r[4]=(ot>>>4|it<<12)&255,this.r[5]=it>>>1&8190,this.r[6]=(it>>>14|st<<2)&8191,this.r[7]=(st>>>11|at<<5)&8065,this.r[8]=(at>>>8|ct<<8)&8191,this.r[9]=ct>>>5&127;for(let lt=0;lt<8;lt++)this.pad[lt]=u8to16(et,16+2*lt)}process(et,tt,nt=!1){const rt=nt?0:2048,{h:ot,r:it}=this,st=it[0],at=it[1],ct=it[2],lt=it[3],dt=it[4],ht=it[5],pt=it[6],mt=it[7],ft=it[8],yt=it[9],gt=u8to16(et,tt+0),xt=u8to16(et,tt+2),vt=u8to16(et,tt+4),bt=u8to16(et,tt+6),Et=u8to16(et,tt+8),wt=u8to16(et,tt+10),kt=u8to16(et,tt+12),Tt=u8to16(et,tt+14);let Rt=ot[0]+(gt&8191),Pt=ot[1]+((gt>>>13|xt<<3)&8191),$t=ot[2]+((xt>>>10|vt<<6)&8191),Ot=ot[3]+((vt>>>7|bt<<9)&8191),Bt=ot[4]+((bt>>>4|Et<<12)&8191),zt=ot[5]+(Et>>>1&8191),Ft=ot[6]+((Et>>>14|wt<<2)&8191),Yt=ot[7]+((wt>>>11|kt<<5)&8191),Ht=ot[8]+((kt>>>8|Tt<<8)&8191),Ut=ot[9]+(Tt>>>5|rt),qt=0,Lt=qt+Rt*st+Pt*(5*yt)+$t*(5*ft)+Ot*(5*mt)+Bt*(5*pt);qt=Lt>>>13,Lt&=8191,Lt+=zt*(5*ht)+Ft*(5*dt)+Yt*(5*lt)+Ht*(5*ct)+Ut*(5*at),qt+=Lt>>>13,Lt&=8191;let Zt=qt+Rt*at+Pt*st+$t*(5*yt)+Ot*(5*ft)+Bt*(5*mt);qt=Zt>>>13,Zt&=8191,Zt+=zt*(5*pt)+Ft*(5*ht)+Yt*(5*dt)+Ht*(5*lt)+Ut*(5*ct),qt+=Zt>>>13,Zt&=8191;let Qt=qt+Rt*ct+Pt*at+$t*st+Ot*(5*yt)+Bt*(5*ft);qt=Qt>>>13,Qt&=8191,Qt+=zt*(5*mt)+Ft*(5*pt)+Yt*(5*ht)+Ht*(5*dt)+Ut*(5*lt),qt+=Qt>>>13,Qt&=8191;let Nt=qt+Rt*lt+Pt*ct+$t*at+Ot*st+Bt*(5*yt);qt=Nt>>>13,Nt&=8191,Nt+=zt*(5*ft)+Ft*(5*mt)+Yt*(5*pt)+Ht*(5*ht)+Ut*(5*dt),qt+=Nt>>>13,Nt&=8191;let Gt=qt+Rt*dt+Pt*lt+$t*ct+Ot*at+Bt*st;qt=Gt>>>13,Gt&=8191,Gt+=zt*(5*yt)+Ft*(5*ft)+Yt*(5*mt)+Ht*(5*pt)+Ut*(5*ht),qt+=Gt>>>13,Gt&=8191;let nn=qt+Rt*ht+Pt*dt+$t*lt+Ot*ct+Bt*at;qt=nn>>>13,nn&=8191,nn+=zt*st+Ft*(5*yt)+Yt*(5*ft)+Ht*(5*mt)+Ut*(5*pt),qt+=nn>>>13,nn&=8191;let Wt=qt+Rt*pt+Pt*ht+$t*dt+Ot*lt+Bt*ct;qt=Wt>>>13,Wt&=8191,Wt+=zt*at+Ft*st+Yt*(5*yt)+Ht*(5*ft)+Ut*(5*mt),qt+=Wt>>>13,Wt&=8191;let hn=qt+Rt*mt+Pt*pt+$t*ht+Ot*dt+Bt*lt;qt=hn>>>13,hn&=8191,hn+=zt*ct+Ft*at+Yt*st+Ht*(5*yt)+Ut*(5*ft),qt+=hn>>>13,hn&=8191;let Xt=qt+Rt*ft+Pt*mt+$t*pt+Ot*ht+Bt*dt;qt=Xt>>>13,Xt&=8191,Xt+=zt*lt+Ft*ct+Yt*at+Ht*st+Ut*(5*yt),qt+=Xt>>>13,Xt&=8191;let Jt=qt+Rt*yt+Pt*ft+$t*mt+Ot*pt+Bt*ht;qt=Jt>>>13,Jt&=8191,Jt+=zt*dt+Ft*lt+Yt*ct+Ht*at+Ut*st,qt+=Jt>>>13,Jt&=8191,qt=(qt<<2)+qt|0,qt=qt+Lt|0,Lt=qt&8191,qt=qt>>>13,Zt+=qt,ot[0]=Lt,ot[1]=Zt,ot[2]=Qt,ot[3]=Nt,ot[4]=Gt,ot[5]=nn,ot[6]=Wt,ot[7]=hn,ot[8]=Xt,ot[9]=Jt}finalize(){const{h:et,pad:tt}=this,nt=new Uint16Array(10);let rt=et[1]>>>13;et[1]&=8191;for(let st=2;st<10;st++)et[st]+=rt,rt=et[st]>>>13,et[st]&=8191;et[0]+=rt*5,rt=et[0]>>>13,et[0]&=8191,et[1]+=rt,rt=et[1]>>>13,et[1]&=8191,et[2]+=rt,nt[0]=et[0]+5,rt=nt[0]>>>13,nt[0]&=8191;for(let st=1;st<10;st++)nt[st]=et[st]+rt,rt=nt[st]>>>13,nt[st]&=8191;nt[9]-=8192;let ot=(rt^1)-1;for(let st=0;st<10;st++)nt[st]&=ot;ot=~ot;for(let st=0;st<10;st++)et[st]=et[st]&ot|nt[st];et[0]=(et[0]|et[1]<<13)&65535,et[1]=(et[1]>>>3|et[2]<<10)&65535,et[2]=(et[2]>>>6|et[3]<<7)&65535,et[3]=(et[3]>>>9|et[4]<<4)&65535,et[4]=(et[4]>>>12|et[5]<<1|et[6]<<14)&65535,et[5]=(et[6]>>>2|et[7]<<11)&65535,et[6]=(et[7]>>>5|et[8]<<8)&65535,et[7]=(et[8]>>>8|et[9]<<5)&65535;let it=et[0]+tt[0];et[0]=it&65535;for(let st=1;st<8;st++)it=(et[st]+tt[st]|0)+(it>>>16)|0,et[st]=it&65535;clean(nt)}update(et){exists(this);const{buffer:tt,blockLen:nt}=this;et=toBytes(et);const rt=et.length;for(let ot=0;ot>>0,et[ot++]=nt[it]>>>8;return et}digest(){const{buffer:et,outputLen:tt}=this;this.digestInto(et);const nt=et.slice(0,tt);return this.destroy(),nt}}function wrapConstructorWithKey(o){const et=(nt,rt)=>o(rt).update(toBytes(nt)).digest(),tt=o(new Uint8Array(32));return et.outputLen=tt.outputLen,et.blockLen=tt.blockLen,et.create=nt=>o(nt),et}const poly1305=wrapConstructorWithKey(o=>new Poly1305(o));function chachaCore(o,et,tt,nt,rt,ot=20){let it=o[0],st=o[1],at=o[2],ct=o[3],lt=et[0],dt=et[1],ht=et[2],pt=et[3],mt=et[4],ft=et[5],yt=et[6],gt=et[7],xt=rt,vt=tt[0],bt=tt[1],Et=tt[2],wt=it,kt=st,Tt=at,Rt=ct,Pt=lt,$t=dt,Ot=ht,Bt=pt,zt=mt,Ft=ft,Yt=yt,Ht=gt,Ut=xt,qt=vt,Lt=bt,Zt=Et;for(let Nt=0;Nt{o.update(et);const tt=et.length%16;tt&&o.update(ZEROS16.subarray(tt))},ZEROS32=new Uint8Array(32);function computeTag(o,et,tt,nt,rt){const ot=o(et,tt,ZEROS32),it=poly1305.create(ot);rt&&updatePadded(it,rt),updatePadded(it,nt);const st=new Uint8Array(16),at=createView(st);setBigUint64(at,0,BigInt(rt?rt.length:0),!0),setBigUint64(at,8,BigInt(nt.length),!0),it.update(st);const ct=it.digest();return clean(ot,st),ct}const _poly1305_aead=o=>(et,tt,nt)=>(bytes(et,32),bytes(tt),{encrypt(ot,it){const st=ot.length,at=st+16;it?bytes(it,at):it=new Uint8Array(at),o(et,tt,ot,it,1);const ct=computeTag(o,et,tt,it.subarray(0,-16),nt);return it.set(ct,st),clean(ct),it},decrypt(ot,it){const st=ot.length,at=st-16;if(st<16)throw new Error("encrypted data must be at least 16 bytes");it?bytes(it,at):it=new Uint8Array(at);const ct=ot.subarray(0,-16),lt=ot.subarray(-16),dt=computeTag(o,et,tt,ct,nt);if(!equalBytes(lt,dt))throw new Error("invalid tag");return o(et,tt,ct,it,1),clean(dt),it}}),chacha20poly1305=wrapCipher({blockSize:64,nonceLength:12,tagLength:16},_poly1305_aead(chacha20));function extract(o,et,tt){return hash$1(o),tt===void 0&&(tt=new Uint8Array(o.outputLen)),hmac(o,toBytes$2(tt),toBytes$2(et))}const HKDF_COUNTER=new Uint8Array([0]),EMPTY_BUFFER=new Uint8Array;function expand(o,et,tt,nt=32){if(hash$1(o),number$4(nt),nt>255*o.outputLen)throw new Error("Length should be <= 255*HashLen");const rt=Math.ceil(nt/o.outputLen);tt===void 0&&(tt=EMPTY_BUFFER);const ot=new Uint8Array(rt*o.outputLen),it=hmac.create(o,et),st=it._cloneInto(),at=new Uint8Array(it.outputLen);for(let ct=0;cto.generateX25519SharedKey(et.privateKey,tt).subarray(0,32),encrypt:o.chaCha20Poly1305Encrypt,decrypt:o.chaCha20Poly1305Decrypt,hash:o.hashSHA256,hkdf:o.getHKDF}}const uint16BEEncode=o=>{const et=allocUnsafe(2);return et[0]=o>>8,et[1]=o,et};uint16BEEncode.bytes=2;const uint16BEDecode=o=>{if(o.length<2)throw RangeError("Could not decode int16BE");if(o instanceof Uint8Array){let et=0;return et+=o[0]<<8,et+=o[1],et}return o.getUint16(0)};uint16BEDecode.bytes=2;function registerMetrics(o){return{xxHandshakeSuccesses:o.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:o.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:o.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:o.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:o.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}function logLocalStaticKeys(o,et){!et.enabled||!DUMP_SESSION_KEYS||(o?(et(`LOCAL_STATIC_PUBLIC_KEY ${toString$8(o.publicKey,"hex")}`),et(`LOCAL_STATIC_PRIVATE_KEY ${toString$8(o.privateKey,"hex")}`)):et("Missing local static keys."))}function logLocalEphemeralKeys(o,et){!et.enabled||!DUMP_SESSION_KEYS||(o?(et(`LOCAL_PUBLIC_EPHEMERAL_KEY ${toString$8(o.publicKey,"hex")}`),et(`LOCAL_PRIVATE_EPHEMERAL_KEY ${toString$8(o.privateKey,"hex")}`)):et("Missing local ephemeral keys."))}function logRemoteStaticKey(o,et){!et.enabled||!DUMP_SESSION_KEYS||et(o?`REMOTE_STATIC_PUBLIC_KEY ${toString$8(o.subarray(),"hex")}`:"Missing remote static public key.")}function logRemoteEphemeralKey(o,et){!et.enabled||!DUMP_SESSION_KEYS||et(o?`REMOTE_EPHEMERAL_PUBLIC_KEY ${toString$8(o.subarray(),"hex")}`:"Missing remote ephemeral keys.")}function logCipherState(o,et,tt){!tt.enabled||!DUMP_SESSION_KEYS||(tt(`CIPHER_STATE_1 ${o.n.getUint64()} ${o.k&&toString$8(o.k,"hex")}`),tt(`CIPHER_STATE_2 ${et.n.getUint64()} ${et.k&&toString$8(et.k,"hex")}`))}const rs=class rs extends Error{constructor(tt="Invalid crypto exchange"){super(tt);Ct(this,"code");this.code=rs.code}};Ct(rs,"code","ERR_INVALID_CRYPTO_EXCHANGE");let InvalidCryptoExchangeError=rs;const MIN_NONCE=0,MAX_NONCE=4294967295,ERR_MAX_NONCE="Cipherstate has reached maximum n, a new handshake must be performed";class Nonce{constructor(et=MIN_NONCE){Ct(this,"n");Ct(this,"bytes");Ct(this,"view");this.n=et,this.bytes=alloc$2(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,et,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>MAX_NONCE)throw new Error(ERR_MAX_NONCE)}}const ZEROLEN=alloc$2(0);class CipherState{constructor(et,tt=void 0,nt=0){Ct(this,"k");Ct(this,"n");Ct(this,"crypto");this.crypto=et,this.k=tt,this.n=new Nonce(nt)}hasKey(){return!!this.k}encryptWithAd(et,tt){if(!this.hasKey())return tt;this.n.assertValue();const nt=this.crypto.encrypt(tt,this.n.getBytes(),et,this.k);return this.n.increment(),nt}decryptWithAd(et,tt,nt){if(!this.hasKey())return tt;this.n.assertValue();const rt=this.crypto.decrypt(tt,this.n.getBytes(),et,this.k,nt);return this.n.increment(),rt}}class SymmetricState{constructor(et,tt){Ct(this,"cs");Ct(this,"ck");Ct(this,"h");Ct(this,"crypto");this.crypto=et;const nt=fromString(tt,"utf-8");this.h=hashProtocolName(et,nt),this.ck=this.h,this.cs=new CipherState(et)}mixKey(et){const[tt,nt]=this.crypto.hkdf(this.ck,et);this.ck=tt,this.cs=new CipherState(this.crypto,nt)}mixHash(et){this.h=this.crypto.hash(new Uint8ArrayList(this.h,et))}encryptAndHash(et){const tt=this.cs.encryptWithAd(this.h,et);return this.mixHash(tt),tt}decryptAndHash(et){const tt=this.cs.decryptWithAd(this.h,et);return this.mixHash(et),tt}split(){const[et,tt]=this.crypto.hkdf(this.ck,ZEROLEN);return[new CipherState(this.crypto,et),new CipherState(this.crypto,tt)]}}class AbstractHandshakeState{constructor(et){Ct(this,"ss");Ct(this,"s");Ct(this,"e");Ct(this,"rs");Ct(this,"re");Ct(this,"initiator");Ct(this,"crypto");const{crypto:tt,protocolName:nt,prologue:rt,initiator:ot,s:it,e:st,rs:at,re:ct}=et;this.crypto=tt,this.ss=new SymmetricState(tt,nt),this.ss.mixHash(rt),this.initiator=ot,this.s=it,this.e=st,this.rs=at,this.re=ct}writeE(){if(this.e)throw new Error("ephemeral keypair is already set");const et=this.crypto.generateKeypair();return this.ss.mixHash(et.publicKey),this.e=et,et.publicKey}writeS(){if(!this.s)throw new Error("static keypair is not set");return this.ss.encryptAndHash(this.s.publicKey)}writeEE(){if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.re))}writeES(){if(this.initiator){if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.rs)throw new Error("remote static public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.rs))}else{if(!this.s)throw new Error("static keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.s,this.re))}}writeSE(){if(this.initiator){if(!this.s)throw new Error("static keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.s,this.re))}else{if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.rs)throw new Error("remote static public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.rs))}}readE(et,tt=0){if(this.re)throw new Error("remote ephemeral public key is already set");if(et.byteLength(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.webtransportCerthashes!=null)for(const ot of tt.webtransportCerthashes)nt.uint32(10),nt.bytes(ot);rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt)=>{const rt={webtransportCerthashes:[]},ot=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{rt.webtransportCerthashes.push(tt.bytes());break}default:{tt.skipType(it&7);break}}}return rt})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=tt=>decodeMessage(tt,o.codec())})(NoiseExtensions||(NoiseExtensions={}));var NoiseHandshakePayload;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.identityKey!=null&&tt.identityKey.byteLength>0&&(nt.uint32(10),nt.bytes(tt.identityKey)),tt.identitySig!=null&&tt.identitySig.byteLength>0&&(nt.uint32(18),nt.bytes(tt.identitySig)),tt.extensions!=null&&(nt.uint32(34),NoiseExtensions.codec().encode(tt.extensions,nt)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt)=>{const rt={identityKey:alloc$2(0),identitySig:alloc$2(0)},ot=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{rt.identityKey=tt.bytes();break}case 2:{rt.identitySig=tt.bytes();break}case 4:{rt.extensions=NoiseExtensions.codec().decode(tt,tt.uint32());break}default:{tt.skipType(it&7);break}}}return rt})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=tt=>decodeMessage(tt,o.codec())})(NoiseHandshakePayload||(NoiseHandshakePayload={}));async function createHandshakePayload(o,et,tt){const nt=await o.sign(getSignaturePayload(et));return NoiseHandshakePayload.encode({identityKey:publicKeyToProtobuf(o.publicKey),identitySig:nt,extensions:tt})}async function decodeHandshakePayload(o,et,tt){try{const nt=NoiseHandshakePayload.decode(o),rt=publicKeyFromProtobuf(nt.identityKey);if((tt==null?void 0:tt.equals(rt))===!1)throw new Error(`Payload identity key ${rt} does not match expected remote identity key ${tt}`);if(!et)throw new Error("Remote static does not exist");const ot=getSignaturePayload(et);if(!await rt.verify(ot,nt.identitySig))throw new Error("Invalid payload signature");return nt}catch(nt){throw new UnexpectedPeerError(nt.message)}}function getSignaturePayload(o){const et=fromString("noise-libp2p-static-key:");return o instanceof Uint8Array?concat$1([et,o],et.length+o.length):(o.prepend(et),o)}async function performHandshakeInitiator(o,et){const{log:tt,connection:nt,crypto:rt,privateKey:ot,prologue:it,s:st,remoteIdentityKey:at,extensions:ct}=o,lt=await createHandshakePayload(ot,st.publicKey,ct),dt=new XXHandshakeState({crypto:rt,protocolName:"Noise_XX_25519_ChaChaPoly_SHA256",initiator:!0,prologue:it,s:st});logLocalStaticKeys(dt.s,tt),tt.trace("Stage 0 - Initiator starting to send first message."),await nt.write(dt.writeMessageA(ZEROLEN),et),tt.trace("Stage 0 - Initiator finished sending first message."),logLocalEphemeralKeys(dt.e,tt),tt.trace("Stage 1 - Initiator waiting to receive first message from responder...");const ht=dt.readMessageB(await nt.read(et));tt.trace("Stage 1 - Initiator received the message."),logRemoteEphemeralKey(dt.re,tt),logRemoteStaticKey(dt.rs,tt),tt.trace("Initiator going to check remote's signature...");const pt=await decodeHandshakePayload(ht,dt.rs,at);tt.trace("All good with the signature!"),tt.trace("Stage 2 - Initiator sending third handshake message."),await nt.write(dt.writeMessageC(lt),et),tt.trace("Stage 2 - Initiator sent message with signed payload.");const[mt,ft]=dt.ss.split();return logCipherState(mt,ft,tt),{payload:pt,encrypt:yt=>mt.encryptWithAd(ZEROLEN,yt),decrypt:(yt,gt)=>ft.decryptWithAd(ZEROLEN,yt,gt)}}async function performHandshakeResponder(o,et){const{log:tt,connection:nt,crypto:rt,privateKey:ot,prologue:it,s:st,remoteIdentityKey:at,extensions:ct}=o,lt=await createHandshakePayload(ot,st.publicKey,ct),dt=new XXHandshakeState({crypto:rt,protocolName:"Noise_XX_25519_ChaChaPoly_SHA256",initiator:!1,prologue:it,s:st});logLocalStaticKeys(dt.s,tt),tt.trace("Stage 0 - Responder waiting to receive first message."),dt.readMessageA(await nt.read(et)),tt.trace("Stage 0 - Responder received first message."),logRemoteEphemeralKey(dt.re,tt),tt.trace("Stage 1 - Responder sending out first message with signed payload and static key."),await nt.write(dt.writeMessageB(lt),et),tt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),logLocalEphemeralKeys(dt.e,tt),tt.trace("Stage 2 - Responder waiting for third handshake message...");const ht=dt.readMessageC(await nt.read(et));tt.trace("Stage 2 - Responder received the message, finished handshake.");const pt=await decodeHandshakePayload(ht,dt.rs,at),[mt,ft]=dt.ss.split();return logCipherState(mt,ft,tt),{payload:pt,encrypt:yt=>ft.encryptWithAd(ZEROLEN,yt),decrypt:(yt,gt)=>mt.decryptWithAd(ZEROLEN,yt,gt)}}const CHACHA_TAG_LENGTH=16;function encryptStream(o,et){return async function*(tt){for await(const nt of tt)for(let rt=0;rtnt.length&&(ot=nt.length);let it;nt instanceof Uint8Array?it=o.encrypt(nt.subarray(rt,ot)):it=o.encrypt(nt.sublist(rt,ot)),et==null||et.encryptedPackets.increment(),yield new Uint8ArrayList(uint16BEEncode(it.byteLength),it)}}}function decryptStream(o,et){return async function*(tt){for await(const nt of tt)for(let rt=0;rtnt.length&&(ot=nt.length),ot-CHACHA_TAG_LENGTHdecode$5(it,{lengthDecoder:uint16BEDecode}),decryptStream(tt,this.metrics),nt),rt}}function noise(o={}){return et=>new Noise(et,o)}const peerDiscoverySymbol$1=Symbol.for("@libp2p/peer-discovery");function setMaxListeners$7(){}const setMaxListeners$6=(o,...et)=>{try{[...et]}catch{}};var Yn,$a;let TypedEventEmitter$2=($a=class extends EventTarget{constructor(){super();fn(this,Yn,new Map);setMaxListeners$6(1/0,this)}listenerCount(tt){const nt=Mt(this,Yn).get(tt);return nt==null?0:nt.length}addEventListener(tt,nt,rt){super.addEventListener(tt,nt,rt);let ot=Mt(this,Yn).get(tt);ot==null&&(ot=[],Mt(this,Yn).set(tt,ot)),ot.push({callback:nt,once:(rt!==!0&&rt!==!1&&(rt==null?void 0:rt.once))??!1})}removeEventListener(tt,nt,rt){super.removeEventListener(tt.toString(),nt??null,rt);let ot=Mt(this,Yn).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==nt),Mt(this,Yn).set(tt,ot))}dispatchEvent(tt){const nt=super.dispatchEvent(tt);let rt=Mt(this,Yn).get(tt.type);return rt==null||(rt=rt.filter(({once:ot})=>!ot),Mt(this,Yn).set(tt.type,rt)),nt}safeDispatchEvent(tt,nt={}){return this.dispatchEvent(new CustomEvent(tt,nt))}},Yn=new WeakMap,$a);const serviceCapabilities$4=Symbol.for("@libp2p/service-capabilities"),DNS4=base("dns4"),DNS6=base("dns6"),DNSADDR=base("dnsaddr"),DNS$1=or$1(base("dns"),DNSADDR,DNS4,DNS6),IP=or$1(base("ip4"),base("ip6")),TCP$1=or$1(and$1(IP,base("tcp")),and$1(DNS$1,base("tcp"))),UDP=and$1(IP,base("udp")),UTP=and$1(UDP,base("utp")),QUIC=and$1(UDP,base("quic")),QUICV1=and$1(UDP,base("quic-v1")),_WebSockets$1=or$1(and$1(TCP$1,base("ws")),and$1(DNS$1,base("ws"))),WebSockets$2=or$1(and$1(_WebSockets$1,base("p2p")),_WebSockets$1),_WebSocketsSecure$1=or$1(and$1(TCP$1,base("wss")),and$1(DNS$1,base("wss")),and$1(TCP$1,base("tls"),base("ws")),and$1(DNS$1,base("tls"),base("ws"))),WebSocketsSecure$1=or$1(and$1(_WebSocketsSecure$1,base("p2p")),_WebSocketsSecure$1),HTTP=or$1(and$1(TCP$1,base("http")),and$1(IP,base("http")),and$1(DNS$1,base("http"))),HTTPS=or$1(and$1(TCP$1,base("https")),and$1(IP,base("https")),and$1(DNS$1,base("https"))),_WebRTCDirect$1=and$1(UDP,base("webrtc-direct"),base("certhash")),WebRTCDirect$1=or$1(and$1(_WebRTCDirect$1,base("p2p")),_WebRTCDirect$1),_WebTransport$1=and$1(QUICV1,base("webtransport"),base("certhash"),base("certhash")),WebTransport$1=or$1(and$1(_WebTransport$1,base("p2p")),_WebTransport$1),P2PWebRTCStar=or$1(and$1(WebSockets$2,base("p2p-webrtc-star"),base("p2p")),and$1(WebSocketsSecure$1,base("p2p-webrtc-star"),base("p2p")),and$1(WebSockets$2,base("p2p-webrtc-star")),and$1(WebSocketsSecure$1,base("p2p-webrtc-star"))),P2PWebRTCDirect=or$1(and$1(HTTP,base("p2p-webrtc-direct"),base("p2p")),and$1(HTTPS,base("p2p-webrtc-direct"),base("p2p")),and$1(HTTP,base("p2p-webrtc-direct")),and$1(HTTPS,base("p2p-webrtc-direct"))),Reliable=or$1(_WebSockets$1,_WebSocketsSecure$1,HTTP,HTTPS,P2PWebRTCStar,P2PWebRTCDirect,TCP$1,UTP,QUIC,DNS$1,WebRTCDirect$1,WebTransport$1),_P2P$1=or$1(and$1(Reliable,base("p2p")),P2PWebRTCStar,P2PWebRTCDirect,WebRTCDirect$1,WebTransport$1,base("p2p")),_Circuit$1=or$1(and$1(_P2P$1,base("p2p-circuit"),_P2P$1),and$1(_P2P$1,base("p2p-circuit")),and$1(base("p2p-circuit"),_P2P$1),and$1(Reliable,base("p2p-circuit")),and$1(base("p2p-circuit"),Reliable),base("p2p-circuit")),CircuitRecursive=()=>or$1(and$1(_Circuit$1,CircuitRecursive),_Circuit$1),Circuit$1=CircuitRecursive(),P2P=or$1(and$1(Circuit$1,_P2P$1,Circuit$1),and$1(_P2P$1,Circuit$1),and$1(Circuit$1,_P2P$1),Circuit$1,_P2P$1);function makeMatchesFunction(o){function et(tt){let nt;try{nt=multiaddr(tt)}catch{return!1}const rt=o(nt.protoNames());return rt===null?!1:rt===!0||rt===!1?rt:rt.length===0}return et}function and$1(...o){function et(tt){if(tt.length(nt=typeof rt=="function"?rt().partialMatch(tt):rt.partialMatch(tt),Array.isArray(nt)&&(tt=nt),nt===null)),nt}return{toString:function(){return"{ "+o.join(" ")+" }"},input:o,matches:makeMatchesFunction(et),partialMatch:et}}function or$1(...o){function et(nt){let rt=null;return o.some(ot=>{const it=typeof ot=="function"?ot().partialMatch(nt):ot.partialMatch(nt);return it!=null?(rt=it,!0):!1}),rt}return{toString:function(){return"{ "+o.join(" ")+" }"},input:o,matches:makeMatchesFunction(et),partialMatch:et}}function base(o){const et=o;function tt(rt){let ot;try{ot=multiaddr(rt)}catch{return!1}const it=ot.protoNames();return it.length===1&&it[0]===et}function nt(rt){return rt.length===0?null:rt[0]===et?rt.slice(1):null}return{toString:function(){return et},matches:tt,partialMatch:nt}}const DEFAULT_BOOTSTRAP_TAG_NAME$1="bootstrap",DEFAULT_BOOTSTRAP_TAG_VALUE$1=50,DEFAULT_BOOTSTRAP_DISCOVERY_TIMEOUT=1e3;var _c,yl,xl,El;class Bootstrap extends(El=TypedEventEmitter$2,xl=peerDiscoverySymbol$1,yl=Symbol.toStringTag,_c=serviceCapabilities$4,El){constructor(tt,nt={list:[]}){if(nt.list==null||nt.list.length===0)throw new Error("Bootstrap requires a list of peer addresses");super();Ct(this,"log");Ct(this,"timer");Ct(this,"list");Ct(this,"timeout");Ct(this,"components");Ct(this,"_init");Ct(this,xl,this);Ct(this,yl,"@libp2p/bootstrap");Ct(this,_c,["@libp2p/peer-discovery"]);this.components=tt,this.log=tt.logger.forComponent("libp2p:bootstrap"),this.timeout=nt.timeout??DEFAULT_BOOTSTRAP_DISCOVERY_TIMEOUT,this.list=[];for(const rt of nt.list){if(!P2P.matches(rt)){this.log.error("Invalid multiaddr");continue}const ot=multiaddr(rt),it=ot.getPeerId();if(it==null){this.log.error("Invalid bootstrap multiaddr without peer id");continue}const st={id:peerIdFromString$1(it),multiaddrs:[ot]};this.list.push(st)}this._init=nt}isStarted(){return!!this.timer}start(){this.isStarted()||(this.log("Starting bootstrap node discovery, discovering peers after %s ms",this.timeout),this.timer=setTimeout(()=>{this._discoverBootstrapPeers().catch(tt=>{this.log.error(tt)})},this.timeout))}async _discoverBootstrapPeers(){if(this.timer!=null)for(const tt of this.list){if(await this.components.peerStore.merge(tt.id,{tags:{[this._init.tagName??DEFAULT_BOOTSTRAP_TAG_NAME$1]:{value:this._init.tagValue??DEFAULT_BOOTSTRAP_TAG_VALUE$1,ttl:this._init.tagTTL}},multiaddrs:tt.multiaddrs}),this.timer==null)return;this.safeDispatchEvent("peer",{detail:tt}),this.components.connectionManager.openConnection(tt.id).catch(nt=>{this.log.error("could not dial bootstrap peer %p",tt.id,nt)})}}stop(){this.timer!=null&&clearTimeout(this.timer),this.timer=void 0}}Ct(Bootstrap,"tag","bootstrap");function bootstrap(o){return et=>new Bootstrap(et,o)}var hs;let UnsupportedProtocolError$1=(hs=class extends Error{constructor(et="Unsupported protocol error"){super(et),this.name="UnsupportedProtocolError"}},Ct(hs,"name","UnsupportedProtocolError"),hs);var ps;let InvalidMessageError$2=(ps=class extends Error{constructor(et="Invalid message"){super(et),this.name="InvalidMessageError"}},Ct(ps,"name","InvalidMessageError"),ps);function setMaxListeners$5(){}const setMaxListeners$4=(o,...et)=>{try{[...et]}catch{}},serviceCapabilities$3=Symbol.for("@libp2p/service-capabilities");var Envelope;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.publicKey!=null&&tt.publicKey.byteLength>0&&(nt.uint32(10),nt.bytes(tt.publicKey)),tt.payloadType!=null&&tt.payloadType.byteLength>0&&(nt.uint32(18),nt.bytes(tt.payloadType)),tt.payload!=null&&tt.payload.byteLength>0&&(nt.uint32(26),nt.bytes(tt.payload)),tt.signature!=null&&tt.signature.byteLength>0&&(nt.uint32(42),nt.bytes(tt.signature)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={publicKey:alloc$2(0),payloadType:alloc$2(0),payload:alloc$2(0),signature:alloc$2(0)},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.publicKey=tt.bytes();break}case 2:{ot.payloadType=tt.bytes();break}case 3:{ot.payload=tt.bytes();break}case 5:{ot.signature=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(Envelope||(Envelope={}));class InvalidSignatureError extends Error{constructor(et="Invalid signature"){super(et),this.name="InvalidSignatureError"}}const cr=class cr{constructor(et){Ct(this,"publicKey");Ct(this,"payloadType");Ct(this,"payload");Ct(this,"signature");Ct(this,"marshaled");const{publicKey:tt,payloadType:nt,payload:rt,signature:ot}=et;this.publicKey=tt,this.payloadType=nt,this.payload=rt,this.signature=ot}marshal(){return this.marshaled==null&&(this.marshaled=Envelope.encode({publicKey:publicKeyToProtobuf(this.publicKey),payloadType:this.payloadType,payload:this.payload.subarray(),signature:this.signature})),this.marshaled}equals(et){return equals(this.marshal(),et.marshal())}async validate(et){const tt=formatSignaturePayload(et,this.payloadType,this.payload);return this.publicKey.verify(tt.subarray(),this.signature)}};Ct(cr,"createFromProtobuf",async et=>{const tt=Envelope.decode(et),nt=publicKeyFromProtobuf(tt.publicKey);return new cr({publicKey:nt,payloadType:tt.payloadType,payload:tt.payload,signature:tt.signature})}),Ct(cr,"seal",async(et,tt)=>{if(tt==null)throw new Error("Missing private key");const nt=et.domain,rt=et.codec,ot=et.marshal(),it=formatSignaturePayload(nt,rt,ot),st=await tt.sign(it.subarray());return new cr({publicKey:tt.publicKey,payloadType:rt,payload:ot,signature:st})}),Ct(cr,"openAndCertify",async(et,tt)=>{const nt=await cr.createFromProtobuf(et);if(!await nt.validate(tt))throw new InvalidSignatureError("Envelope signature is not valid for the given domain");return nt});let RecordEnvelope=cr;const formatSignaturePayload=(o,et,tt)=>{const nt=fromString(o),rt=encode$a(nt.byteLength),ot=encode$a(et.length),it=encode$a(tt.length);return new Uint8ArrayList(rt,nt,ot,et,it,tt)};function arrayEquals(o,et){const tt=(nt,rt)=>nt.toString().localeCompare(rt.toString());return o.length!==et.length?!1:(et.sort(tt),o.sort(tt).every((nt,rt)=>et[rt].equals(nt)))}const ENVELOPE_DOMAIN_PEER_RECORD="libp2p-peer-record",ENVELOPE_PAYLOAD_TYPE_PEER_RECORD=Uint8Array.from([3,1]);var PeerRecord$1;(function(o){(function(tt){let nt;tt.codec=()=>(nt==null&&(nt=message$1((rt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),rt.multiaddr!=null&&rt.multiaddr.byteLength>0&&(ot.uint32(10),ot.bytes(rt.multiaddr)),it.lengthDelimited!==!1&&ot.ldelim()},(rt,ot,it={})=>{const st={multiaddr:alloc$2(0)},at=ot==null?rt.len:rt.pos+ot;for(;rt.pos>>3){case 1:{st.multiaddr=rt.bytes();break}default:{rt.skipType(ct&7);break}}}return st})),nt),tt.encode=rt=>encodeMessage(rt,tt.codec()),tt.decode=(rt,ot)=>decodeMessage(rt,tt.codec(),ot)})(o.AddressInfo||(o.AddressInfo={}));let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.peerId!=null&&tt.peerId.byteLength>0&&(nt.uint32(10),nt.bytes(tt.peerId)),tt.seq!=null&&tt.seq!==0n&&(nt.uint32(16),nt.uint64(tt.seq)),tt.addresses!=null)for(const ot of tt.addresses)nt.uint32(26),o.AddressInfo.codec().encode(ot,nt);rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at;const ot={peerId:alloc$2(0),seq:0n,addresses:[]},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.peerId=tt.bytes();break}case 2:{ot.seq=tt.uint64();break}case 3:{if(((st=rt.limits)==null?void 0:st.addresses)!=null&&ot.addresses.length===rt.limits.addresses)throw new MaxLengthError('Decode error - map field "addresses" had too many elements');ot.addresses.push(o.AddressInfo.codec().decode(tt,tt.uint32(),{limits:(at=rt.limits)==null?void 0:at.addresses$}));break}default:{tt.skipType(ct&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(PeerRecord$1||(PeerRecord$1={}));const nr=class nr{constructor(et){Ct(this,"peerId");Ct(this,"multiaddrs");Ct(this,"seqNumber");Ct(this,"domain",nr.DOMAIN);Ct(this,"codec",nr.CODEC);Ct(this,"marshaled");const{peerId:tt,multiaddrs:nt,seqNumber:rt}=et;this.peerId=tt,this.multiaddrs=nt??[],this.seqNumber=rt??BigInt(Date.now())}marshal(){return this.marshaled==null&&(this.marshaled=PeerRecord$1.encode({peerId:this.peerId.toMultihash().bytes,seq:BigInt(this.seqNumber),addresses:this.multiaddrs.map(et=>({multiaddr:et.bytes}))})),this.marshaled}equals(et){return!(!(et instanceof nr)||!this.peerId.equals(et.peerId)||this.seqNumber!==et.seqNumber||!arrayEquals(this.multiaddrs,et.multiaddrs))}};Ct(nr,"createFromProtobuf",et=>{const tt=PeerRecord$1.decode(et),nt=peerIdFromMultihash(decode$6(tt.peerId)),rt=(tt.addresses??[]).map(it=>multiaddr(it.multiaddr)),ot=tt.seq;return new nr({peerId:nt,multiaddrs:rt,seqNumber:ot})}),Ct(nr,"DOMAIN",ENVELOPE_DOMAIN_PEER_RECORD),Ct(nr,"CODEC",ENVELOPE_PAYLOAD_TYPE_PEER_RECORD);let PeerRecord=nr;function isAsyncIterable$4(o){return o[Symbol.asyncIterator]!=null}function drain(o){if(isAsyncIterable$4(o))return(async()=>{for await(const et of o);})();for(const et of o);}const CustomEvent$1=globalThis.CustomEvent??Event;async function*parallel(o,et={}){let tt=et.concurrency??1/0;tt<1&&(tt=1/0);const nt=et.ordered==null?!1:et.ordered,rt=new EventTarget,ot=[];let it=pDefer(),st=pDefer(),at=!1,ct,lt=!1;rt.addEventListener("task-complete",()=>{st.resolve()}),Promise.resolve().then(async()=>{try{for await(const mt of o){if(ot.length===tt&&(it=pDefer(),await it.promise),lt)break;const ft={done:!1};ot.push(ft),mt().then(yt=>{ft.done=!0,ft.ok=!0,ft.value=yt,rt.dispatchEvent(new CustomEvent$1("task-complete"))},yt=>{ft.done=!0,ft.err=yt,rt.dispatchEvent(new CustomEvent$1("task-complete"))})}at=!0,rt.dispatchEvent(new CustomEvent$1("task-complete"))}catch(mt){ct=mt,rt.dispatchEvent(new CustomEvent$1("task-complete"))}});function dt(){var mt;return nt?(mt=ot[0])==null?void 0:mt.done:!!ot.find(ft=>ft.done)}function*ht(){for(;ot.length>0&&ot[0].done;){const mt=ot[0];if(ot.shift(),mt.ok)yield mt.value;else throw lt=!0,it.resolve(),mt.err;it.resolve()}}function*pt(){for(;dt();)for(let mt=0;mt{const it=await tt.read(ot);return rt.decode(it)},write:async(rt,ot,it)=>{await tt.write(ot.encode(rt),it)},writeV:async(rt,ot,it)=>{await tt.writeV(rt.map(st=>ot.encode(st)),it)},pb:rt=>({read:async ot=>nt.read(rt,ot),write:async(ot,it)=>nt.write(ot,rt,it),writeV:async(ot,it)=>nt.writeV(ot,rt,it),unwrap:()=>nt}),unwrap:()=>tt.unwrap()};return nt}const IDENTIFY_PROTOCOL_VERSION="0.1.0",MULTICODEC_IDENTIFY_PROTOCOL_NAME="id",MULTICODEC_IDENTIFY_PROTOCOL_VERSION="1.0.0",MAX_IDENTIFY_MESSAGE_SIZE=1024*8,MAX_PUSH_CONCURRENCY=32;var Identify$1;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.protocolVersion!=null&&(nt.uint32(42),nt.string(tt.protocolVersion)),tt.agentVersion!=null&&(nt.uint32(50),nt.string(tt.agentVersion)),tt.publicKey!=null&&(nt.uint32(10),nt.bytes(tt.publicKey)),tt.listenAddrs!=null)for(const ot of tt.listenAddrs)nt.uint32(18),nt.bytes(ot);if(tt.observedAddr!=null&&(nt.uint32(34),nt.bytes(tt.observedAddr)),tt.protocols!=null)for(const ot of tt.protocols)nt.uint32(26),nt.string(ot);tt.signedPeerRecord!=null&&(nt.uint32(66),nt.bytes(tt.signedPeerRecord)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at;const ot={listenAddrs:[],protocols:[]},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 5:{ot.protocolVersion=tt.string();break}case 6:{ot.agentVersion=tt.string();break}case 1:{ot.publicKey=tt.bytes();break}case 2:{if(((st=rt.limits)==null?void 0:st.listenAddrs)!=null&&ot.listenAddrs.length===rt.limits.listenAddrs)throw new MaxLengthError('Decode error - map field "listenAddrs" had too many elements');ot.listenAddrs.push(tt.bytes());break}case 4:{ot.observedAddr=tt.bytes();break}case 3:{if(((at=rt.limits)==null?void 0:at.protocols)!=null&&ot.protocols.length===rt.limits.protocols)throw new MaxLengthError('Decode error - map field "protocols" had too many elements');ot.protocols.push(tt.string());break}case 8:{ot.signedPeerRecord=tt.bytes();break}default:{tt.skipType(ct&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(Identify$1||(Identify$1={}));var define_process_default={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};function isElectron$1(){return!!(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof define_process_default<"u"&&typeof define_process_default.versions=="object"&&define_process_default.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0)}var isElectron_1=isElectron$1;const detectElectron=getDefaultExportFromCjs(isElectron_1),isEnvWithDom=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,isElectron=detectElectron(),isBrowser=isEnvWithDom&&!isElectron,isElectronMain=isElectron&&!isEnvWithDom,isElectronRenderer=isElectron&&isEnvWithDom,isNode=typeof globalThis.process<"u"&&typeof globalThis.process.release<"u"&&globalThis.process.release.name==="node"&&!isElectron,isWebWorker=typeof importScripts=="function"&&typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative",defaultValues={protocolPrefix:"ipfs",timeout:5e3,maxInboundStreams:1,maxOutboundStreams:1,maxObservedAddresses:10,maxMessageSize:MAX_IDENTIFY_MESSAGE_SIZE,runOnConnectionOpen:!0,runOnSelfUpdate:!0,runOnLimitedConnection:!0,concurrency:MAX_PUSH_CONCURRENCY};function getCleanMultiaddr(o){if(o!=null&&o.length>0)try{return multiaddr(o)}catch{}}function getAgentVersion(o,et){return et!=null||(et=`${o.name}/${o.version}`,isNode||isElectronMain?et+=` UserAgent=${globalThis.process.version}`:(isBrowser||isWebWorker||isElectronRenderer||isReactNative)&&(et+=` UserAgent=${globalThis.navigator.userAgent}`)),et}async function consumeIdentifyMessage(o,et,tt,nt,rt){if(tt("received identify from %p",nt.remotePeer),rt==null)throw new InvalidMessageError$2("message was null or undefined");const ot={};if(rt.listenAddrs.length>0&&(ot.addresses=rt.listenAddrs.map(at=>({isCertified:!1,multiaddr:multiaddr(at)}))),rt.protocols.length>0&&(ot.protocols=rt.protocols),rt.publicKey!=null){const at=publicKeyFromProtobuf(rt.publicKey);if(!peerIdFromPublicKey(at).equals(nt.remotePeer))throw new InvalidMessageError$2("public key did not match remote PeerId");ot.publicKey=at}let it;if(rt.signedPeerRecord!=null){tt.trace("received signedPeerRecord from %p",nt.remotePeer);let at=rt.signedPeerRecord;const ct=await RecordEnvelope.openAndCertify(at,PeerRecord.DOMAIN);let lt=PeerRecord.createFromProtobuf(ct.payload);const dt=peerIdFromCID(ct.publicKey.toCID());if(!lt.peerId.equals(dt))throw new InvalidMessageError$2("signing key does not match PeerId in the PeerRecord");if(!nt.remotePeer.equals(lt.peerId))throw new InvalidMessageError$2("signing key does not match remote PeerId");let ht;try{ht=await o.get(lt.peerId)}catch(pt){if(pt.name!=="NotFoundError")throw pt}if(ht!=null&&(ot.metadata=ht.metadata,ht.peerRecordEnvelope!=null)){const pt=await RecordEnvelope.createFromProtobuf(ht.peerRecordEnvelope),mt=PeerRecord.createFromProtobuf(pt.payload);mt.seqNumber>=lt.seqNumber&&(tt("sequence number was lower or equal to existing sequence number - stored: %d received: %d",mt.seqNumber,lt.seqNumber),lt=mt,at=ht.peerRecordEnvelope)}ot.peerRecordEnvelope=at,ot.addresses=lt.multiaddrs.map(pt=>({isCertified:!0,multiaddr:pt})),it={seq:lt.seqNumber,addresses:lt.multiaddrs}}else tt("%p did not send a signed peer record",nt.remotePeer);if(tt.trace("patching %p with",nt.remotePeer,ot),await o.patch(nt.remotePeer,ot),rt.agentVersion!=null||rt.protocolVersion!=null){const at={};rt.agentVersion!=null&&(at.AgentVersion=fromString(rt.agentVersion)),rt.protocolVersion!=null&&(at.ProtocolVersion=fromString(rt.protocolVersion)),tt.trace("merging %p metadata",nt.remotePeer,at),await o.merge(nt.remotePeer,{metadata:at})}const st={peerId:nt.remotePeer,protocolVersion:rt.protocolVersion,agentVersion:rt.agentVersion,publicKey:rt.publicKey,listenAddrs:rt.listenAddrs.map(at=>multiaddr(at)),observedAddr:rt.observedAddr==null?void 0:multiaddr(rt.observedAddr),protocols:rt.protocols,signedPeerRecord:it,connection:nt};return et.safeDispatchEvent("peer:identify",{detail:st}),st}class AbstractIdentify{constructor(et,tt){Ct(this,"host");Ct(this,"protocol");Ct(this,"started");Ct(this,"timeout");Ct(this,"peerId");Ct(this,"privateKey");Ct(this,"peerStore");Ct(this,"registrar");Ct(this,"addressManager");Ct(this,"maxInboundStreams");Ct(this,"maxOutboundStreams");Ct(this,"maxMessageSize");Ct(this,"maxObservedAddresses");Ct(this,"events");Ct(this,"runOnLimitedConnection");Ct(this,"log");this.protocol=tt.protocol,this.started=!1,this.peerId=et.peerId,this.privateKey=et.privateKey,this.peerStore=et.peerStore,this.registrar=et.registrar,this.addressManager=et.addressManager,this.events=et.events,this.log=tt.log,this.timeout=tt.timeout??defaultValues.timeout,this.maxInboundStreams=tt.maxInboundStreams??defaultValues.maxInboundStreams,this.maxOutboundStreams=tt.maxOutboundStreams??defaultValues.maxOutboundStreams,this.maxMessageSize=tt.maxMessageSize??defaultValues.maxMessageSize,this.maxObservedAddresses=tt.maxObservedAddresses??defaultValues.maxObservedAddresses,this.runOnLimitedConnection=tt.runOnLimitedConnection??defaultValues.runOnLimitedConnection,this.host={protocolVersion:`${tt.protocolPrefix??defaultValues.protocolPrefix}/${IDENTIFY_PROTOCOL_VERSION}`,agentVersion:getAgentVersion(et.nodeInfo,tt.agentVersion)}}isStarted(){return this.started}async start(){this.started||(await this.peerStore.merge(this.peerId,{metadata:{AgentVersion:fromString(this.host.agentVersion),ProtocolVersion:fromString(this.host.protocolVersion)}}),await this.registrar.handle(this.protocol,et=>{this.handleProtocol(et).catch(tt=>{this.log.error(tt)})},{maxInboundStreams:this.maxInboundStreams,maxOutboundStreams:this.maxOutboundStreams,runOnLimitedConnection:this.runOnLimitedConnection}),this.started=!0)}async stop(){await this.registrar.unhandle(this.protocol),this.started=!1}}var Netmask_1;(function(){var o,et,tt,nt,rt,ot,it,st;st=function(at){var ct,lt,dt,ht;return ct=(at&255<<24)>>>24,lt=(at&255<<16)>>>16,dt=(at&65280)>>>8,ht=at&255,[ct,lt,dt,ht].join(".")},it=function(at){var ct,lt,dt,ht,pt,mt;for(ct=[],dt=ht=0;ht<=3&&at.length!==0;dt=++ht){if(dt>0){if(at[0]!==".")throw new Error("Invalid IP");at=at.substring(1)}mt=et(at),pt=mt[0],lt=mt[1],at=at.substring(lt),ct.push(pt)}if(at.length!==0)throw new Error("Invalid IP");switch(ct.length){case 1:if(ct[0]>4294967295)throw new Error("Invalid IP");return ct[0]>>>0;case 2:if(ct[0]>255||ct[1]>16777215)throw new Error("Invalid IP");return(ct[0]<<24|ct[1])>>>0;case 3:if(ct[0]>255||ct[1]>255||ct[2]>65535)throw new Error("Invalid IP");return(ct[0]<<24|ct[1]<<16|ct[2])>>>0;case 4:if(ct[0]>255||ct[1]>255||ct[2]>255||ct[3]>255)throw new Error("Invalid IP");return(ct[0]<<24|ct[1]<<16|ct[2]<<8|ct[3])>>>0;default:throw new Error("Invalid IP")}},tt=function(at){return at.charCodeAt(0)},nt=tt("0"),ot=tt("a"),rt=tt("A"),et=function(at){var ct,lt,dt,ht,pt;for(ht=0,ct=10,lt="9",dt=0,at.length>1&&at[dt]==="0"&&(at[dt+1]==="x"||at[dt+1]==="X"?(dt+=2,ct=16):"0"<=at[dt+1]&&at[dt+1]<="9"&&(dt++,ct=8,lt="7")),pt=dt;dt>>0;else if(ct===16)if("a"<=at[dt]&&at[dt]<="f")ht=ht*ct+(10+tt(at[dt])-ot)>>>0;else if("A"<=at[dt]&&at[dt]<="F")ht=ht*ct+(10+tt(at[dt])-rt)>>>0;else break;else break;if(ht>4294967295)throw new Error("too large");dt++}if(dt===pt)throw new Error("empty octet");return[ht,dt]},o=function(){function at(ct,lt){var dt,ht,pt;if(typeof ct!="string")throw new Error("Missing `net' parameter");if(lt||(pt=ct.split("/",2),ct=pt[0],lt=pt[1]),lt||(lt=32),typeof lt=="string"&<.indexOf(".")>-1){try{this.maskLong=it(lt)}catch{throw new Error("Invalid mask: "+lt)}for(dt=ht=32;ht>=0;dt=--ht)if(this.maskLong===4294967295<<32-dt>>>0){this.bitmask=dt;break}}else if(lt||lt===0)this.bitmask=parseInt(lt,10),this.maskLong=0,this.bitmask>0&&(this.maskLong=4294967295<<32-this.bitmask>>>0);else throw new Error("Invalid mask: empty");try{this.netLong=(it(ct)&this.maskLong)>>>0}catch{throw new Error("Invalid net address: "+ct)}if(!(this.bitmask<=32))throw new Error("Invalid mask for ip4: "+lt);this.size=Math.pow(2,32-this.bitmask),this.base=st(this.netLong),this.mask=st(this.maskLong),this.hostmask=st(~this.maskLong),this.first=this.bitmask<=30?st(this.netLong+1):this.base,this.last=this.bitmask<=30?st(this.netLong+this.size-2):st(this.netLong+this.size-1),this.broadcast=this.bitmask<=30?st(this.netLong+this.size-1):void 0}return at.prototype.contains=function(ct){return typeof ct=="string"&&(ct.indexOf("/")>0||ct.split(".").length!==4)&&(ct=new at(ct)),ct instanceof at?this.contains(ct.base)&&this.contains(ct.broadcast||ct.last):(it(ct)&this.maskLong)>>>0===(this.netLong&this.maskLong)>>>0},at.prototype.next=function(ct){return ct==null&&(ct=1),new at(st(this.netLong+this.size*ct),this.mask)},at.prototype.forEach=function(ct){var lt,dt,ht;for(ht=it(this.first),dt=it(this.last),lt=0;ht<=dt;)ct(st(ht),ht,lt),lt++,ht++},at.prototype.toString=function(){return this.base+"/"+this.bitmask},at}(),Netmask_1=o}).call(commonjsGlobal);const PRIVATE_IP_RANGES=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"],NETMASK_RANGES=PRIVATE_IP_RANGES.map(o=>new Netmask_1(o));function ipv4Check(o){for(const et of NETMASK_RANGES)if(et.contains(o))return!0;return!1}function isIpv4MappedIpv6(o){return/^::ffff:([0-9a-fA-F]{1,4}):([0-9a-fA-F]{1,4})$/.test(o)}function ipv4MappedIpv6Check(o){const et=o.split(":");if(et.length<2)return!1;const tt=et[et.length-1].padStart(4,"0"),nt=et[et.length-2].padStart(4,"0"),rt=`${parseInt(nt.substring(0,2),16)}.${parseInt(nt.substring(2),16)}.${parseInt(tt.substring(0,2),16)}.${parseInt(tt.substring(2),16)}`;return ipv4Check(rt)}function isIpv4EmbeddedIpv6(o){return/^::ffff:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(o)}function ipv4EmbeddedIpv6Check(o){const et=o.split(":"),tt=et[et.length-1];return ipv4Check(tt)}function ipv6Check(o){return/^::$/.test(o)||/^::1$/.test(o)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(o)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(o)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(o)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(o)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(o)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(o)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(o)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(o)||/^ff([0-9a-fA-F]{2,2}):/i.test(o)}function isPrivateIp(o){return isIPv4(o)?ipv4Check(o):isIpv4MappedIpv6(o)?ipv4MappedIpv6Check(o):isIpv4EmbeddedIpv6(o)?ipv4EmbeddedIpv6Check(o):isIPv6(o)?ipv6Check(o):void 0}const toParts=o=>o.toString().split("/").slice(1),func=o=>({match:et=>et.length<1?!1:o(et[0])?et.slice(1):!1,pattern:"fn"}),literal=o=>({match:et=>func(tt=>tt===o).match(et),pattern:o}),string$3=()=>({match:o=>func(et=>typeof et=="string").match(o),pattern:"{string}"}),number$1=()=>({match:o=>func(et=>!isNaN(parseInt(et))).match(o),pattern:"{number}"}),peerId=()=>({match:o=>{if(o.length<2||o[0]!=="p2p"&&o[0]!=="ipfs")return!1;if(o[1].startsWith("Q")||o[1].startsWith("1"))try{base58btc.decode(`z${o[1]}`)}catch{return!1}else return!1;return o.slice(2)},pattern:"/p2p/{peerid}"}),certhash=()=>({match:o=>{if(o.length<2||o[0]!=="certhash")return!1;try{base64url.decode(o[1])}catch{return!1}return o.slice(2)},pattern:"/certhash/{certhash}"}),optional=o=>({match:et=>{const tt=o.match(et);return tt===!1?et:tt},pattern:`optional(${o.pattern})`}),or=(...o)=>({match:et=>{let tt;for(const nt of o){const rt=nt.match(et);rt!==!1&&(tt==null||rt.lengthet.pattern).join(", ")})`}),and=(...o)=>({match:et=>{for(const tt of o){const nt=tt.match(et);if(nt===!1)return!1;et=nt}return et},pattern:`and(${o.map(et=>et.pattern).join(", ")})`});function fmt(...o){function et(rt){let ot=toParts(rt);for(const it of o){const st=it.match(ot);if(st===!1)return!1;ot=st}return ot}function tt(rt){return et(rt)!==!1}function nt(rt){const ot=et(rt);return ot===!1?!1:ot.length===0}return{matchers:o,matches:tt,exactMatch:nt}}const _DNS4=and(literal("dns4"),string$3()),_DNS6=and(literal("dns6"),string$3()),_DNSADDR=and(literal("dnsaddr"),string$3()),_DNS=and(literal("dns"),string$3());fmt(_DNS4,optional(peerId()));fmt(_DNS6,optional(peerId()));fmt(_DNSADDR,optional(peerId()));fmt(or(_DNS,_DNSADDR,_DNS4,_DNS6),optional(peerId()));const _IP4=and(literal("ip4"),func(isIPv4)),_IP6=and(literal("ip6"),func(isIPv6)),_IP=or(_IP4,_IP6),_IP_OR_DOMAIN=or(_IP,_DNS,_DNS4,_DNS6,_DNSADDR),IP_OR_DOMAIN=fmt(or(_IP,and(or(_DNS,_DNSADDR,_DNS4,_DNS6),optional(peerId())))),_TCP=and(_IP_OR_DOMAIN,literal("tcp"),number$1()),_UDP=and(_IP_OR_DOMAIN,literal("udp"),number$1()),TCP=fmt(and(_TCP,optional(peerId()))),_QUIC=and(_UDP,literal("quic")),_QUICV1=and(_UDP,literal("quic-v1")),QUIC_V0_OR_V1=or(_QUIC,_QUICV1),_WEB=or(_IP_OR_DOMAIN,_TCP,_UDP,_QUIC,_QUICV1),_WebSockets=or(and(_WEB,literal("ws"),optional(peerId()))),WebSockets$1=fmt(_WebSockets),_WebSocketsSecure=or(and(_WEB,literal("wss"),optional(peerId())),and(_WEB,literal("tls"),optional(and(literal("sni"),string$3())),literal("ws"),optional(peerId()))),WebSocketsSecure=fmt(_WebSocketsSecure),_WebRTCDirect=and(_UDP,literal("webrtc-direct"),optional(certhash()),optional(certhash()),optional(peerId())),WebRTCDirect=fmt(_WebRTCDirect),_WebTransport=and(_QUICV1,literal("webtransport"),optional(certhash()),optional(certhash()),optional(peerId())),WebTransport=fmt(_WebTransport),_P2P=or(_WebSockets,_WebSocketsSecure,and(_TCP,optional(peerId())),and(QUIC_V0_OR_V1,optional(peerId())),and(_IP_OR_DOMAIN,optional(peerId())),_WebRTCDirect,_WebTransport,peerId()),_Circuit=and(_P2P,literal("p2p-circuit"),peerId()),Circuit=fmt(_Circuit),_WebRTC=or(and(_P2P,literal("p2p-circuit"),literal("webrtc"),optional(peerId())),and(_P2P,literal("webrtc"),optional(peerId())),and(literal("webrtc"),optional(peerId()))),WebRTC=fmt(_WebRTC);or(and(_IP_OR_DOMAIN,literal("tcp"),number$1(),literal("http"),optional(peerId())),and(_IP_OR_DOMAIN,literal("http"),optional(peerId())));or(and(_IP_OR_DOMAIN,literal("tcp"),or(and(literal("443"),literal("http")),and(number$1(),literal("https"))),optional(peerId())),and(_IP_OR_DOMAIN,literal("tls"),literal("http"),optional(peerId())),and(_IP_OR_DOMAIN,literal("https"),optional(peerId())));or(and(literal("memory"),string$3(),optional(peerId())));var wl,Cl;class Identify extends(Cl=AbstractIdentify,wl=serviceCapabilities$3,Cl){constructor(tt,nt={}){super(tt,{...nt,protocol:`/${nt.protocolPrefix??defaultValues.protocolPrefix}/${MULTICODEC_IDENTIFY_PROTOCOL_NAME}/${MULTICODEC_IDENTIFY_PROTOCOL_VERSION}`,log:tt.logger.forComponent("libp2p:identify")});Ct(this,wl,["@libp2p/identify"]);(nt.runOnConnectionOpen??defaultValues.runOnConnectionOpen)&&tt.events.addEventListener("connection:open",rt=>{const ot=rt.detail;this.identify(ot).catch(it=>{it.name!==UnsupportedProtocolError$1.name&&this.log.error("error during identify trigged by connection:open",it)})})}async _identify(tt,nt={}){let rt;if(nt.signal==null){const ot=AbortSignal.timeout(this.timeout);setMaxListeners$4(1/0,ot),nt={...nt,signal:ot}}try{rt=await tt.newStream(this.protocol,{...nt,runOnLimitedConnection:this.runOnLimitedConnection});const it=await pbStream(rt,{maxDataLength:this.maxMessageSize}).pb(Identify$1).read(nt);return await rt.close(nt),it}catch(ot){throw rt==null||rt.abort(ot),ot}}async identify(tt,nt={}){const rt=await this._identify(tt,nt),{publicKey:ot,protocols:it,observedAddr:st}=rt;if(ot==null)throw new InvalidMessageError$2("public key was missing from identify message");const at=publicKeyFromProtobuf(ot),ct=peerIdFromCID(at.toCID());if(!tt.remotePeer.equals(ct))throw new InvalidMessageError$2("identified peer does not match the expected peer");if(this.peerId.equals(ct))throw new InvalidMessageError$2("identified peer is our own peer id?");const lt=getCleanMultiaddr(st);return this.log("identify completed for peer %p and protocols %o",ct,it),lt!=null&&(this.log("our observed address was %a",lt),isPrivateIp(lt==null?void 0:lt.nodeAddress().address)===!0?this.log("our observed address was private"):this.addressManager.getObservedAddrs().length<(this.maxObservedAddresses??1/0)&&(this.log("storing our observed address"),this.addressManager.addObservedAddr(lt))),consumeIdentifyMessage(this.peerStore,this.events,this.log,tt,rt)}async handleProtocol(tt){const{connection:nt,stream:rt}=tt,ot=AbortSignal.timeout(this.timeout);setMaxListeners$4(1/0,ot);try{const it=await this.peerStore.get(this.peerId),st=this.addressManager.getAddresses().map(dt=>dt.decapsulateCode(getProtocol("p2p").code));let at=it.peerRecordEnvelope;if(st.length>0&&at==null){const dt=new PeerRecord({peerId:this.peerId,multiaddrs:st});at=(await RecordEnvelope.seal(dt,this.privateKey)).marshal().subarray()}let ct=nt.remoteAddr.bytes;IP_OR_DOMAIN.matches(nt.remoteAddr)||(ct=void 0),await pbStream(rt).pb(Identify$1).write({protocolVersion:this.host.protocolVersion,agentVersion:this.host.agentVersion,publicKey:publicKeyToProtobuf(this.privateKey.publicKey),listenAddrs:st.map(dt=>dt.bytes),signedPeerRecord:at,observedAddr:ct,protocols:it.protocols},{signal:ot}),await rt.close({signal:ot})}catch(it){this.log.error("could not respond to identify request",it),rt.abort(it)}}}function identify(o={}){return et=>new Identify(et,o)}class MuxerClosedError extends Error{constructor(et="The muxer is closed"){super(et),this.name="MuxerClosedError"}}Ct(MuxerClosedError,"name","MuxerClosedError");var gs;let InvalidMessageError$1=(gs=class extends Error{constructor(et="Invalid message"){super(et),this.name="InvalidMessageError"}},Ct(gs,"name","InvalidMessageError"),gs);var ys;let TooManyOutboundProtocolStreamsError$1=(ys=class extends Error{constructor(et="Too many outbound protocol streams"){super(et),this.name="TooManyOutboundProtocolStreamsError"}},Ct(ys,"name","TooManyOutboundProtocolStreamsError"),ys);const serviceCapabilities$2=Symbol.for("@libp2p/service-capabilities");function getIterator(o){if(o!=null){if(typeof o[Symbol.iterator]=="function")return o[Symbol.iterator]();if(typeof o[Symbol.asyncIterator]=="function")return o[Symbol.asyncIterator]();if(typeof o.next=="function")return o}throw new Error("argument is not an iterator or iterable")}function isPromise$2(o){return o==null?!1:typeof o.then=="function"&&typeof o.catch=="function"&&typeof o.finally=="function"}function closeSource(o,et){var nt,rt;const tt=(rt=(nt=getIterator(o)).return)==null?void 0:rt.call(nt);isPromise$2(tt)&&tt.catch(ot=>{et.error("could not cause iterator to return",ot)})}const createAbortError=()=>{const o=new Error("Delay aborted");return o.name="AbortError",o},clearMethods=new WeakMap;function createDelay({clearTimeout:o,setTimeout:et}={}){return(tt,{value:nt,signal:rt}={})=>{if(rt!=null&&rt.aborted)return Promise.reject(createAbortError());let ot,it,st;const at=o??clearTimeout,ct=()=>{at(ot),st(createAbortError())},lt=()=>{rt&&rt.removeEventListener("abort",ct)},dt=new Promise((ht,pt)=>{it=()=>{lt(),ht(nt)},st=pt,ot=(et??setTimeout)(it,tt)});return rt&&rt.addEventListener("abort",ct,{once:!0}),clearMethods.set(dt,()=>{at(ot),ot=null,it()}),dt}}const delay=createDelay();class RateLimitError extends Error{constructor(tt="Rate limit exceeded",nt){super(tt);Ct(this,"remainingPoints");Ct(this,"msBeforeNext");Ct(this,"consumedPoints");Ct(this,"isFirstInDuration");this.name="RateLimitError",this.remainingPoints=nt.remainingPoints,this.msBeforeNext=nt.msBeforeNext,this.consumedPoints=nt.consumedPoints,this.isFirstInDuration=nt.isFirstInDuration}}class QueueFullError extends Error{constructor(et="The queue was full"){super(et),this.name="QueueFullError"}}Ct(QueueFullError,"name","QueueFullError");class RateLimiter{constructor(et={}){Ct(this,"memoryStorage");Ct(this,"points");Ct(this,"duration");Ct(this,"blockDuration");Ct(this,"execEvenly");Ct(this,"execEvenlyMinDelayMs");Ct(this,"keyPrefix");this.points=et.points??4,this.duration=et.duration??1,this.blockDuration=et.blockDuration??0,this.execEvenly=et.execEvenly??!1,this.execEvenlyMinDelayMs=et.execEvenlyMinDelayMs??this.duration*1e3/this.points,this.keyPrefix=et.keyPrefix??"rlflx",this.memoryStorage=new MemoryStorage}async consume(et,tt=1,nt={}){const rt=this.getKey(et),ot=this._getKeySecDuration(nt);let it=this.memoryStorage.incrby(rt,tt,ot);if(it.remainingPoints=Math.max(this.points-it.consumedPoints,0),it.consumedPoints>this.points)throw this.blockDuration>0&&it.consumedPoints<=this.points+tt&&(it=this.memoryStorage.set(rt,it.consumedPoints,this.blockDuration)),new RateLimitError("Rate limit exceeded",it);if(this.execEvenly&&it.msBeforeNext>0&&!it.isFirstInDuration){let st=Math.ceil(it.msBeforeNext/(it.remainingPoints+2));st=0?nt:this.duration)*1e3;return this.memoryStorage.set(this.getKey(et),tt,nt),{remainingPoints:0,msBeforeNext:rt===0?-1:rt,consumedPoints:tt,isFirstInDuration:!1}}get(et){const tt=this.memoryStorage.get(this.getKey(et));return tt!=null&&(tt.remainingPoints=Math.max(this.points-tt.consumedPoints,0)),tt}delete(et){this.memoryStorage.delete(this.getKey(et))}_getKeySecDuration(et){return(et==null?void 0:et.customDuration)!=null&&et.customDuration>=0?et.customDuration:this.duration}getKey(et){return this.keyPrefix.length>0?`${this.keyPrefix}:${et}`:et}parseKey(et){return et.substring(this.keyPrefix.length)}}class MemoryStorage{constructor(){Ct(this,"storage");this.storage=new Map}incrby(et,tt,nt){const rt=this.storage.get(et);if(rt!=null){const ot=rt.expiresAt!=null?rt.expiresAt.getTime()-new Date().getTime():-1;return rt.expiresAt==null||ot>0?(rt.value+=tt,{remainingPoints:0,msBeforeNext:ot,consumedPoints:rt.value,isFirstInDuration:!1}):this.set(et,tt,nt)}return this.set(et,tt,nt)}set(et,tt,nt){const rt=nt*1e3,ot=this.storage.get(et);ot!=null&&clearTimeout(ot.timeoutId);const it={value:tt,expiresAt:rt>0?new Date(Date.now()+rt):void 0};return this.storage.set(et,it),rt>0&&(it.timeoutId=setTimeout(()=>{this.storage.delete(et)},rt),it.timeoutId.unref!=null&&it.timeoutId.unref()),{remainingPoints:0,msBeforeNext:rt===0?-1:rt,consumedPoints:it.value,isFirstInDuration:!0}}get(et){const tt=this.storage.get(et);if(tt!=null)return{remainingPoints:0,msBeforeNext:tt.expiresAt!=null?tt.expiresAt.getTime()-new Date().getTime():-1,consumedPoints:tt.value,isFirstInDuration:!1}}delete(et){const tt=this.storage.get(et);return tt!=null?(tt.timeoutId!=null&&clearTimeout(tt.timeoutId),this.storage.delete(et),!0):!1}}var MessageTypes;(function(o){o[o.NEW_STREAM=0]="NEW_STREAM",o[o.MESSAGE_RECEIVER=1]="MESSAGE_RECEIVER",o[o.MESSAGE_INITIATOR=2]="MESSAGE_INITIATOR",o[o.CLOSE_RECEIVER=3]="CLOSE_RECEIVER",o[o.CLOSE_INITIATOR=4]="CLOSE_INITIATOR",o[o.RESET_RECEIVER=5]="RESET_RECEIVER",o[o.RESET_INITIATOR=6]="RESET_INITIATOR"})(MessageTypes||(MessageTypes={}));const MessageTypeNames=Object.freeze({0:"NEW_STREAM",1:"MESSAGE_RECEIVER",2:"MESSAGE_INITIATOR",3:"CLOSE_RECEIVER",4:"CLOSE_INITIATOR",5:"RESET_RECEIVER",6:"RESET_INITIATOR"}),InitiatorMessageTypes=Object.freeze({NEW_STREAM:MessageTypes.NEW_STREAM,MESSAGE:MessageTypes.MESSAGE_INITIATOR,CLOSE:MessageTypes.CLOSE_INITIATOR,RESET:MessageTypes.RESET_INITIATOR}),ReceiverMessageTypes=Object.freeze({MESSAGE:MessageTypes.MESSAGE_RECEIVER,CLOSE:MessageTypes.CLOSE_RECEIVER,RESET:MessageTypes.RESET_RECEIVER}),MAX_MSG_SIZE=1<<20,MAX_MSG_QUEUE_SIZE=4<<20;class Decoder{constructor(et=MAX_MSG_SIZE,tt=MAX_MSG_QUEUE_SIZE){Ct(this,"_buffer");Ct(this,"_headerInfo");Ct(this,"_maxMessageSize");Ct(this,"_maxUnprocessedMessageQueueSize");this._buffer=new Uint8ArrayList,this._headerInfo=null,this._maxMessageSize=et,this._maxUnprocessedMessageQueueSize=tt}write(et){if(et==null||et.length===0)return[];if(this._buffer.append(et),this._buffer.byteLength>this._maxUnprocessedMessageQueueSize)throw new InvalidMessageError$1("Unprocessed message queue size too large!");const tt=[];for(;this._buffer.length!==0;){if(this._headerInfo==null)try{this._headerInfo=this._decodeHeader(this._buffer)}catch(ct){if(ct.name==="InvalidMessageError")throw ct;break}const{id:nt,type:rt,length:ot,offset:it}=this._headerInfo;if(this._buffer.length-itthis._maxMessageSize)throw new InvalidMessageError$1("Message size too large");return{id:tt>>3,type:it,offset:nt+ot,length:rt}}}const MSB=128,REST=127;function readVarInt(o,et=0){let tt=0,nt=0,rt=et,ot;const it=o.length;do{if(rt>=it||nt>49)throw et=0,new RangeError("Could not decode varint");ot=o.get(rt++),tt+=nt<28?(ot&REST)<=MSB);return et=rt-et,{value:tt,offset:et}}const POOL_SIZE=10*1024;class Encoder{constructor(){Ct(this,"_pool");Ct(this,"_poolOffset");this._pool=allocUnsafe(POOL_SIZE),this._poolOffset=0}write(et,tt){const nt=this._pool;let rt=this._poolOffset;encode$a(et.id<<3|et.type,nt,rt),rt+=encodingLength$3(et.id<<3|et.type),(et.type===MessageTypes.NEW_STREAM||et.type===MessageTypes.MESSAGE_INITIATOR||et.type===MessageTypes.MESSAGE_RECEIVER)&&et.data!=null?(encode$a(et.data.length,nt,rt),rt+=encodingLength$3(et.data.length)):(encode$a(0,nt,rt),rt+=encodingLength$3(0));const ot=nt.subarray(this._poolOffset,rt);POOL_SIZE-rt<100?(this._pool=allocUnsafe(POOL_SIZE),this._poolOffset=0):this._poolOffset=rt,tt.append(ot),(et.type===MessageTypes.NEW_STREAM||et.type===MessageTypes.MESSAGE_INITIATOR||et.type===MessageTypes.MESSAGE_RECEIVER)&&et.data!=null&&tt.append(et.data)}}const encoder$1=new Encoder;async function*encode$4(o){for await(const et of o){const tt=new Uint8ArrayList;encoder$1.write(et,tt),yield tt}}class StreamInputBufferError extends Error{constructor(et="Stream input buffer error"){super(et),this.name="StreamInputBufferError"}}var xs;let AbortError$6=(xs=class extends Error{constructor(et="The operation was aborted"){super(et),this.name="AbortError"}},Ct(xs,"name","AbortError"),xs);class StreamResetError extends Error{constructor(et="The stream has been reset"){super(et),this.name="StreamResetError"}}Ct(StreamResetError,"name","StreamResetError");class StreamStateError extends Error{constructor(et="The stream is in an invalid state"){super(et),this.name="StreamStateError"}}Ct(StreamStateError,"name","StreamStateError");function setMaxListeners$3(){}const setMaxListeners$2=(o,...et)=>{try{[...et]}catch{}};var Zn,Sl;let TypedEventEmitter$1=(Sl=class extends EventTarget{constructor(){super();fn(this,Zn,new Map);setMaxListeners$2(1/0,this)}listenerCount(tt){const nt=Mt(this,Zn).get(tt);return nt==null?0:nt.length}addEventListener(tt,nt,rt){super.addEventListener(tt,nt,rt);let ot=Mt(this,Zn).get(tt);ot==null&&(ot=[],Mt(this,Zn).set(tt,ot)),ot.push({callback:nt,once:(rt!==!0&&rt!==!1&&(rt==null?void 0:rt.once))??!1})}removeEventListener(tt,nt,rt){super.removeEventListener(tt.toString(),nt??null,rt);let ot=Mt(this,Zn).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==nt),Mt(this,Zn).set(tt,ot))}dispatchEvent(tt){const nt=super.dispatchEvent(tt);let rt=Mt(this,Zn).get(tt.type);return rt==null||(rt=rt.filter(({once:ot})=>!ot),Mt(this,Zn).set(tt.type,rt)),nt}safeDispatchEvent(tt,nt={}){return this.dispatchEvent(new CustomEvent(tt,nt))}},Zn=new WeakMap,Sl);const DEFAULT_SEND_CLOSE_WRITE_TIMEOUT=5e3;function isPromise$1(o){return o==null?!1:typeof o.then=="function"&&typeof o.catch=="function"&&typeof o.finally=="function"}class AbstractStream{constructor(et){Ct(this,"id");Ct(this,"direction");Ct(this,"timeline");Ct(this,"protocol");Ct(this,"metadata");Ct(this,"source");Ct(this,"status");Ct(this,"readStatus");Ct(this,"writeStatus");Ct(this,"log");Ct(this,"sinkController");Ct(this,"sinkEnd");Ct(this,"closed");Ct(this,"endErr");Ct(this,"streamSource");Ct(this,"onEnd");Ct(this,"onCloseRead");Ct(this,"onCloseWrite");Ct(this,"onReset");Ct(this,"onAbort");Ct(this,"sendCloseWriteTimeout");Ct(this,"sendingData");this.sinkController=new AbortController,this.sinkEnd=pDefer(),this.closed=pDefer(),this.log=et.log,this.status="open",this.readStatus="ready",this.writeStatus="ready",this.id=et.id,this.metadata=et.metadata??{},this.direction=et.direction,this.timeline={open:Date.now()},this.sendCloseWriteTimeout=et.sendCloseWriteTimeout??DEFAULT_SEND_CLOSE_WRITE_TIMEOUT,this.onEnd=et.onEnd,this.onCloseRead=et==null?void 0:et.onCloseRead,this.onCloseWrite=et==null?void 0:et.onCloseWrite,this.onReset=et==null?void 0:et.onReset,this.onAbort=et==null?void 0:et.onAbort,this.source=this.streamSource=pushable({onEnd:tt=>{tt!=null?this.log.trace("source ended with error",tt):this.log.trace("source ended"),this.onSourceEnd(tt)}}),this.sink=this.sink.bind(this)}async sink(et){if(this.writeStatus!=="ready")throw new StreamStateError(`writable end state is "${this.writeStatus}" not "ready"`);try{this.writeStatus="writing";const tt={signal:this.sinkController.signal};if(this.direction==="outbound"){const rt=this.sendNewStream(tt);isPromise$1(rt)&&await rt}const nt=()=>{closeSource(et,this.log)};try{this.sinkController.signal.addEventListener("abort",nt),this.log.trace("sink reading from source");for await(let rt of et){rt=rt instanceof Uint8Array?new Uint8ArrayList(rt):rt;const ot=this.sendData(rt,tt);isPromise$1(ot)&&(this.sendingData=pDefer(),await ot,this.sendingData.resolve(),this.sendingData=void 0)}}finally{this.sinkController.signal.removeEventListener("abort",nt)}this.log.trace('sink finished reading from source, write status is "%s"',this.writeStatus),this.writeStatus==="writing"&&(this.writeStatus="closing",this.log.trace("send close write to remote"),await this.sendCloseWrite({signal:AbortSignal.timeout(this.sendCloseWriteTimeout)}),this.writeStatus="closed"),this.onSinkEnd()}catch(tt){throw this.log.trace("sink ended with error, calling abort with error",tt),this.abort(tt),tt}finally{this.log.trace("resolve sink end"),this.sinkEnd.resolve()}}onSourceEnd(et){var tt;this.timeline.closeRead==null&&(this.timeline.closeRead=Date.now(),this.readStatus="closed",et!=null&&this.endErr==null&&(this.endErr=et),(tt=this.onCloseRead)==null||tt.call(this),this.timeline.closeWrite!=null?(this.log.trace("source and sink ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("source ended, waiting for sink to end"))}onSinkEnd(et){var tt;this.timeline.closeWrite==null&&(this.timeline.closeWrite=Date.now(),this.writeStatus="closed",et!=null&&this.endErr==null&&(this.endErr=et),(tt=this.onCloseWrite)==null||tt.call(this),this.timeline.closeRead!=null?(this.log.trace("sink and source ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("sink ended, waiting for source to end"))}async close(et){this.log.trace("closing gracefully"),this.status="closing",await raceSignal(Promise.all([this.closeWrite(et),this.closeRead(et),this.closed.promise]),et==null?void 0:et.signal),this.status="closed",this.log.trace("closed gracefully")}async closeRead(et={}){if(this.readStatus==="closing"||this.readStatus==="closed")return;this.log.trace('closing readable end of stream with starting read status "%s"',this.readStatus);const tt=this.readStatus;this.readStatus="closing",this.status!=="reset"&&this.status!=="aborted"&&this.timeline.closeRead==null&&(this.log.trace("send close read to remote"),await this.sendCloseRead(et)),tt==="ready"&&(this.log.trace("ending internal source queue with %d queued bytes",this.streamSource.readableLength),this.streamSource.end()),this.log.trace("closed readable end of stream")}async closeWrite(et={}){this.writeStatus==="closing"||this.writeStatus==="closed"||(this.log.trace('closing writable end of stream with starting write status "%s"',this.writeStatus),this.writeStatus==="ready"&&(this.log.trace("sink was never sunk, sink an empty array"),await raceSignal(this.sink([]),et.signal)),this.writeStatus==="writing"&&(this.sendingData!=null&&await raceSignal(this.sendingData.promise,et.signal),this.log.trace("aborting source passed to .sink"),this.sinkController.abort(),await raceSignal(this.sinkEnd.promise,et.signal)),this.writeStatus="closed",this.log.trace("closed writable end of stream"))}abort(et){var nt;if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;this.log("abort with error",et),this.log("try to send reset to remote");const tt=this.sendReset();isPromise$1(tt)&&tt.catch(rt=>{this.log.error("error sending reset message",rt)}),this.status="aborted",this.timeline.abort=Date.now(),this._closeSinkAndSource(et),(nt=this.onAbort)==null||nt.call(this,et)}reset(){var tt;if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;const et=new StreamResetError("stream reset");this.status="reset",this.timeline.reset=Date.now(),this._closeSinkAndSource(et),(tt=this.onReset)==null||tt.call(this)}_closeSinkAndSource(et){this._closeSink(et),this._closeSource(et)}_closeSink(et){this.writeStatus==="writing"&&(this.log.trace("end sink source"),this.sinkController.abort()),this.onSinkEnd(et)}_closeSource(et){this.readStatus!=="closing"&&this.readStatus!=="closed"&&(this.log.trace("ending source with %d bytes to be read by consumer",this.streamSource.readableLength),this.readStatus="closing",this.streamSource.end(et))}remoteCloseWrite(){if(this.readStatus==="closing"||this.readStatus==="closed"){this.log("received remote close write but local source is already closed");return}this.log.trace("remote close write"),this._closeSource()}remoteCloseRead(){if(this.writeStatus==="closing"||this.writeStatus==="closed"){this.log("received remote close read but local sink is already closed");return}this.log.trace("remote close read"),this._closeSink()}destroy(){if(this.status==="closed"||this.status==="aborted"||this.status==="reset"){this.log("received destroy but we are already closed");return}this.log.trace("stream destroyed"),this._closeSinkAndSource()}sourcePush(et){this.streamSource.push(et)}sourceReadableLength(){return this.streamSource.readableLength}}class MplexStream extends AbstractStream{constructor(tt){super(tt);Ct(this,"name");Ct(this,"streamId");Ct(this,"send");Ct(this,"types");Ct(this,"maxDataSize");this.types=tt.direction==="outbound"?InitiatorMessageTypes:ReceiverMessageTypes,this.send=tt.send,this.name=tt.name,this.streamId=tt.streamId,this.maxDataSize=tt.maxDataSize}async sendNewStream(){await this.send({id:this.streamId,type:InitiatorMessageTypes.NEW_STREAM,data:new Uint8ArrayList(fromString(this.name))})}async sendData(tt){for(tt=tt.sublist();tt.byteLength>0;){const nt=Math.min(tt.byteLength,this.maxDataSize);await this.send({id:this.streamId,type:this.types.MESSAGE,data:tt.sublist(0,nt)}),tt.consume(nt)}}async sendReset(){await this.send({id:this.streamId,type:this.types.RESET})}async sendCloseWrite(){await this.send({id:this.streamId,type:this.types.CLOSE})}async sendCloseRead(){}}function createStream(o){const{id:et,name:tt,send:nt,onEnd:rt,type:ot="initiator",maxMsgSize:it=MAX_MSG_SIZE}=o;return new MplexStream({id:ot==="initiator"?`i${et}`:`r${et}`,streamId:et,name:`${tt??et}`,direction:ot==="initiator"?"outbound":"inbound",maxDataSize:it,onEnd:rt,send:nt,log:o.logger.forComponent(`libp2p:mplex:stream:${ot}:${et}`)})}const MAX_STREAMS_INBOUND_STREAMS_PER_CONNECTION=1024,MAX_STREAMS_OUTBOUND_STREAMS_PER_CONNECTION=1024,MAX_STREAM_BUFFER_SIZE=1024*1024*4,DISCONNECT_THRESHOLD=5,CLOSE_TIMEOUT$2=500;function printMessage(o){const et={...o,type:`${MessageTypeNames[o.type]} (${o.type})`};return o.type===MessageTypes.NEW_STREAM&&(et.data=toString$8(o.data instanceof Uint8Array?o.data:o.data.subarray())),(o.type===MessageTypes.MESSAGE_INITIATOR||o.type===MessageTypes.MESSAGE_RECEIVER)&&(et.data=toString$8(o.data instanceof Uint8Array?o.data:o.data.subarray(),"base16")),et}class MplexStreamMuxer{constructor(et,tt){Ct(this,"protocol","/mplex/6.7.0");Ct(this,"sink");Ct(this,"source");Ct(this,"log");Ct(this,"_streamId");Ct(this,"_streams");Ct(this,"_init");Ct(this,"_source");Ct(this,"closeController");Ct(this,"rateLimiter");Ct(this,"closeTimeout");Ct(this,"logger");tt=tt??{},this.log=et.logger.forComponent("libp2p:mplex"),this.logger=et.logger,this._streamId=0,this._streams={initiators:new Map,receivers:new Map},this._init=tt,this.closeTimeout=tt.closeTimeout??CLOSE_TIMEOUT$2,this.sink=this._createSink(),this._source=pushable({objectMode:!0,onEnd:()=>{for(const nt of this._streams.initiators.values())nt.destroy();for(const nt of this._streams.receivers.values())nt.destroy()}}),this.source=pipe(this._source,nt=>encode$4(nt)),this.closeController=new AbortController,this.rateLimiter=new RateLimiter({points:tt.disconnectThreshold??DISCONNECT_THRESHOLD,duration:1})}get streams(){const et=[];for(const tt of this._streams.initiators.values())et.push(tt);for(const tt of this._streams.receivers.values())et.push(tt);return et}newStream(et){if(this.closeController.signal.aborted)throw new MuxerClosedError("Muxer already closed");const tt=this._streamId++;et=et==null?tt.toString():et.toString();const nt=this._streams.initiators;return this._newStream({id:tt,name:et,type:"initiator",registry:nt})}async close(et){if(this.closeController.signal.aborted)return;const tt=(et==null?void 0:et.signal)??AbortSignal.timeout(this.closeTimeout);try{await Promise.all(this.streams.map(async nt=>nt.close({signal:tt}))),this._source.end(),await this._source.onEmpty({signal:tt}),this.closeController.abort()}catch(nt){this.abort(nt)}}abort(et){this.closeController.signal.aborted||(this.streams.forEach(tt=>{tt.abort(et)}),this.closeController.abort(et))}_newReceiverStream(et){const{id:tt,name:nt}=et,rt=this._streams.receivers;return this._newStream({id:tt,name:nt,type:"receiver",registry:rt})}_newStream(et){const{id:tt,name:nt,type:rt,registry:ot}=et;if(this.log("new %s stream %s",rt,tt),rt==="initiator"&&this._streams.initiators.size===(this._init.maxOutboundStreams??MAX_STREAMS_OUTBOUND_STREAMS_PER_CONNECTION))throw new TooManyOutboundProtocolStreamsError$1("Too many outbound streams open");if(ot.has(tt))throw new Error(`${rt} stream ${tt} already exists!`);const at=createStream({id:tt,name:nt,send:async ct=>{this.log.enabled&&this.log.trace("%s stream %s send",rt,tt,printMessage(ct)),this._source.push(ct)},type:rt,onEnd:()=>{this.log("%s stream with id %s and protocol %s ended",rt,tt,at.protocol),ot.delete(tt),this._init.onStreamEnd!=null&&this._init.onStreamEnd(at)},maxMsgSize:this._init.maxMsgSize,logger:this.logger});return ot.set(tt,at),at}_createSink(){return async tt=>{const nt=()=>{closeSource(tt,this.log)};this.closeController.signal.addEventListener("abort",nt);try{const rt=new Decoder(this._init.maxMsgSize,this._init.maxUnprocessedMessageQueueSize);for await(const ot of tt)for(const it of rt.write(ot))await this._handleIncoming(it);this._source.end()}catch(rt){this.log("error in sink",rt),this._source.end(rt)}finally{this.closeController.signal.removeEventListener("abort",nt)}}}async _handleIncoming(et){const{id:tt,type:nt}=et;if(this.log.enabled&&this.log.trace("incoming message",printMessage(et)),et.type===MessageTypes.NEW_STREAM){if(this._streams.receivers.size===(this._init.maxInboundStreams??MAX_STREAMS_INBOUND_STREAMS_PER_CONNECTION)){this.log("too many inbound streams open"),this._source.push({id:tt,type:MessageTypes.RESET_RECEIVER});try{await this.rateLimiter.consume("new-stream",1)}catch{this.log("rate limit hit when opening too many new streams over the inbound stream limit - closing remote connection"),this.abort(new Error("Too many open streams"));return}return}const st=this._newReceiverStream({id:tt,name:toString$8(et.data instanceof Uint8Array?et.data:et.data.subarray())});this._init.onIncomingStream!=null&&this._init.onIncomingStream(st);return}const ot=((nt&1)===1?this._streams.initiators:this._streams.receivers).get(tt);if(ot==null){this.log("missing stream %s for message type %s",tt,MessageTypeNames[nt]);try{await this.rateLimiter.consume("missing-stream",1)}catch{this.log("rate limit hit when receiving messages for streams that do not exist - closing remote connection"),this.abort(new Error("Too many messages for missing streams"));return}return}const it=this._init.maxStreamBufferSize??MAX_STREAM_BUFFER_SIZE;try{switch(nt){case MessageTypes.MESSAGE_INITIATOR:case MessageTypes.MESSAGE_RECEIVER:if(ot.sourceReadableLength()>it)throw this._source.push({id:et.id,type:nt===MessageTypes.MESSAGE_INITIATOR?MessageTypes.RESET_RECEIVER:MessageTypes.RESET_INITIATOR}),new StreamInputBufferError("Input buffer full - increase Mplex maxBufferSize to accommodate slow consumers");ot.sourcePush(et.data);break;case MessageTypes.CLOSE_INITIATOR:case MessageTypes.CLOSE_RECEIVER:ot.remoteCloseWrite();break;case MessageTypes.RESET_INITIATOR:case MessageTypes.RESET_RECEIVER:ot.reset();break;default:this.log("unknown message type %s",nt)}}catch(st){this.log.error("error while processing message",st),ot.abort(st)}}}var Al,Rl;Rl=Symbol.toStringTag,Al=serviceCapabilities$2;class Mplex{constructor(et,tt={}){Ct(this,"protocol","/mplex/6.7.0");Ct(this,"_init");Ct(this,"components");Ct(this,Rl,"@libp2p/mplex");Ct(this,Al,["@libp2p/stream-multiplexing"]);this.components=et,this._init=tt}createStreamMuxer(et={}){return new MplexStreamMuxer(this.components,{...et,...this._init})}}function mplex(o={}){return et=>new Mplex(et,o)}function isAsyncIterable$3(o){return o[Symbol.asyncIterator]!=null}function first(o){if(isAsyncIterable$3(o))return(async()=>{for await(const et of o)return et})();for(const et of o)return et}const PING_LENGTH$1=32,PROTOCOL_VERSION$1="1.0.0",PROTOCOL_NAME$1="ping",PROTOCOL_PREFIX$1="ipfs",TIMEOUT=1e4,MAX_INBOUND_STREAMS=2,MAX_OUTBOUND_STREAMS=1;var _l;_l=Symbol.toStringTag;class PingService{constructor(et,tt={}){Ct(this,"protocol");Ct(this,"components");Ct(this,"started");Ct(this,"timeout");Ct(this,"maxInboundStreams");Ct(this,"maxOutboundStreams");Ct(this,"runOnLimitedConnection");Ct(this,"log");Ct(this,_l,"@libp2p/ping");this.components=et,this.log=et.logger.forComponent("libp2p:ping"),this.started=!1,this.protocol=`/${tt.protocolPrefix??PROTOCOL_PREFIX$1}/${PROTOCOL_NAME$1}/${PROTOCOL_VERSION$1}`,this.timeout=tt.timeout??TIMEOUT,this.maxInboundStreams=tt.maxInboundStreams??MAX_INBOUND_STREAMS,this.maxOutboundStreams=tt.maxOutboundStreams??MAX_OUTBOUND_STREAMS,this.runOnLimitedConnection=tt.runOnLimitedConnection??!0,this.handleMessage=this.handleMessage.bind(this)}async start(){await this.components.registrar.handle(this.protocol,this.handleMessage,{maxInboundStreams:this.maxInboundStreams,maxOutboundStreams:this.maxOutboundStreams,runOnLimitedConnection:this.runOnLimitedConnection}),this.started=!0}async stop(){await this.components.registrar.unhandle(this.protocol),this.started=!1}isStarted(){return this.started}handleMessage(et){this.log("incoming ping from %p",et.connection.remotePeer);const{stream:tt}=et,nt=Date.now();AbortSignal.timeout(this.timeout).addEventListener("abort",()=>{tt==null||tt.abort(new TimeoutError$3("ping timeout"))}),pipe(tt,async function*(ot){let it=0;for await(const st of ot){if(it+=st.byteLength,it>PING_LENGTH$1){tt==null||tt.abort(new InvalidMessageError$3("Too much data received"));return}yield st}},tt).catch(ot=>{this.log.error("incoming ping from %p failed with error",et.connection.remotePeer,ot),tt==null||tt.abort(ot)}).finally(()=>{const ot=Date.now()-nt;this.log("incoming ping from %p complete in %dms",et.connection.remotePeer,ot)})}async ping(et,tt={}){var at,ct;this.log("pinging %p",et);const nt=Date.now(),rt=randomBytes(PING_LENGTH$1),ot=await this.components.connectionManager.openConnection(et,tt);let it,st=()=>{};if(tt.signal==null){const lt=AbortSignal.timeout(this.timeout);tt={...tt,signal:lt}}try{it=await ot.newStream(this.protocol,{...tt,runOnLimitedConnection:this.runOnLimitedConnection}),st=()=>{it==null||it.abort(new AbortError$9)},(at=tt.signal)==null||at.addEventListener("abort",st,{once:!0});const lt=await pipe([rt],it,async ht=>first(ht)),dt=Date.now()-nt;if(lt==null)throw new ProtocolError(`Did not receive a ping ack after ${dt}ms`);if(!equals(rt,lt.subarray()))throw new ProtocolError(`Received wrong ping ack after ${dt}ms`);return this.log("ping %p complete in %dms",ot.remotePeer,dt),dt}catch(lt){throw this.log.error("error while pinging %p",ot.remotePeer,lt),it==null||it.abort(lt),lt}finally{(ct=tt.signal)==null||ct.removeEventListener("abort",st),it!=null&&await it.close()}}}function ping(o={}){return et=>new PingService(et,o)}const transportSymbol=Symbol.for("@libp2p/transport");var FaultTolerance$1;(function(o){o[o.FATAL_ALL=0]="FATAL_ALL",o[o.NO_FATAL=1]="NO_FATAL"})(FaultTolerance$1||(FaultTolerance$1={}));var vs;let AbortError$5=(vs=class extends Error{constructor(et="The operation was aborted"){super(et),this.name="AbortError"}},Ct(vs,"name","AbortError"),vs);class ConnectionFailedError extends Error{constructor(et="Connection failed"){super(et),this.name="ConnectionFailedError"}}Ct(ConnectionFailedError,"name","ConnectionFailedError");const serviceCapabilities$1=Symbol.for("@libp2p/service-capabilities"),ASSUME_HTTP_CODES=[getProtocol("tcp").code,getProtocol("dns").code,getProtocol("dnsaddr").code,getProtocol("dns4").code,getProtocol("dns6").code];function extractSNI(o){var et;return(et=extractTuple("sni",o))==null?void 0:et[1]}function extractPort(o){var tt;const et=(tt=extractTuple("tcp",o))==null?void 0:tt[1];return et==null?"":`:${et}`}function extractTuple(o,et){let tt;try{tt=getProtocol(o).code}catch{return}for(const[nt,rt]of et)if(nt===tt&&rt!=null)return[nt,rt]}function hasTLS(o){return o.some(([et,tt])=>et===getProtocol("tls").code)}function interpretNext(o,et,tt){const nt=interpreters[getProtocol(o).name];if(nt==null)throw new Error(`Can't interpret protocol ${getProtocol(o).name}`);const rt=nt(et,tt);return o===getProtocol("ip6").code?`[${rt}]`:rt}const interpreters={ip4:(o,et)=>o,ip6:(o,et)=>et.length===0?o:`[${o}]`,tcp:(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");return`tcp://${interpretNext(tt[0],tt[1]??"",et)}:${o}`},udp:(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");return`udp://${interpretNext(tt[0],tt[1]??"",et)}:${o}`},dnsaddr:(o,et)=>o,dns4:(o,et)=>o,dns6:(o,et)=>o,dns:(o,et)=>o,ipfs:(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",et)}/ipfs/${o}`},p2p:(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",et)}/p2p/${o}`},http:(o,et)=>{const tt=hasTLS(et),nt=extractSNI(et),rt=extractPort(et);if(tt&&nt!=null)return`https://${nt}${rt}`;const ot=tt?"https://":"http://",it=et.pop();if(it==null)throw new Error("Unexpected end of multiaddr");let st=interpretNext(it[0],it[1]??"",et);return st=st.replace("tcp://",""),`${ot}${st}`},"http-path":(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");const nt=interpretNext(tt[0],tt[1]??"",et),rt=decodeURIComponent(o);return`${nt}/${rt}`},tls:(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");return interpretNext(tt[0],tt[1]??"",et)},sni:(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");return interpretNext(tt[0],tt[1]??"",et)},https:(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");let nt=interpretNext(tt[0],tt[1]??"",et);return nt=nt.replace("tcp://",""),`https://${nt}`},ws:(o,et)=>{const tt=hasTLS(et),nt=extractSNI(et),rt=extractPort(et);if(tt&&nt!=null)return`wss://${nt}${rt}`;const ot=tt?"wss://":"ws://",it=et.pop();if(it==null)throw new Error("Unexpected end of multiaddr");let st=interpretNext(it[0],it[1]??"",et);return st=st.replace("tcp://",""),`${ot}${st}`},wss:(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");let nt=interpretNext(tt[0],tt[1]??"",et);return nt=nt.replace("tcp://",""),`wss://${nt}`},"p2p-websocket-star":(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",et)}/p2p-websocket-star`},"p2p-webrtc-star":(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",et)}/p2p-webrtc-star`},"p2p-webrtc-direct":(o,et)=>{const tt=et.pop();if(tt==null)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",et)}/p2p-webrtc-direct`}};function multiaddrToUri(o,et){const nt=multiaddr(o).stringTuples(),rt=nt.pop();if(rt==null)throw new Error("Unexpected end of multiaddr");const ot=getProtocol(rt[0]),it=interpreters[ot.name];if(it==null)throw new Error(`No interpreter found for ${ot.name}`);let st=it(rt[1]??"",nt);return ASSUME_HTTP_CODES.includes(rt[0])&&(st=st.replace(/^.*:\/\//,""),rt[1]==="443"?st=`https://${st}`:st=`http://${st}`),(st.startsWith("http://")||st.startsWith("https://")||st.startsWith("ws://")||st.startsWith("wss://"))&&(st=new URL(st).toString(),st.endsWith("/")&&(st=st.substring(0,st.length-1))),st}const ready=async o=>{if(o.readyState>=2)throw new Error("socket closed");o.readyState!==1&&await new Promise((et,tt)=>{function nt(){o.removeEventListener("open",rt),o.removeEventListener("error",ot)}function rt(){nt(),et()}function ot(it){nt(),tt(it.error??new Error(`connect ECONNREFUSED ${o.url}`))}o.addEventListener("open",rt),o.addEventListener("error",ot)})},sink=(o,et)=>(et=et??{},et.closeOnEnd=et.closeOnEnd!==!1,async nt=>{for await(const rt of nt){try{await ready(o)}catch(ot){if(ot.message==="socket closed")break;throw ot}if(o.readyState===o.CLOSING||o.readyState===o.CLOSED)break;o.send(rt)}et.closeOnEnd!=null&&o.readyState<=1&&await new Promise((rt,ot)=>{o.addEventListener("close",it=>{if(it.wasClean||it.code===1006)rt();else{const st=Object.assign(new Error("ws error"),{event:it});ot(st)}}),setTimeout(()=>{o.close()})})});var dom={},eventIterator={};Object.defineProperty(eventIterator,"__esModule",{value:!0});class EventQueue{constructor(){this.pullQueue=[],this.pushQueue=[],this.eventHandlers={},this.isPaused=!1,this.isStopped=!1}push(et){if(this.isStopped)return;const tt={value:et,done:!1};if(this.pullQueue.length){const nt=this.pullQueue.shift();nt&&nt.resolve(tt)}else this.pushQueue.push(Promise.resolve(tt)),this.highWaterMark!==void 0&&this.pushQueue.length>=this.highWaterMark&&!this.isPaused&&(this.isPaused=!0,this.eventHandlers.highWater?this.eventHandlers.highWater():console&&console.warn(`EventIterator queue reached ${this.pushQueue.length} items`))}stop(){if(!this.isStopped){this.isStopped=!0,this.remove();for(const et of this.pullQueue)et.resolve({value:void 0,done:!0});this.pullQueue.length=0}}fail(et){if(!this.isStopped)if(this.isStopped=!0,this.remove(),this.pullQueue.length){for(const tt of this.pullQueue)tt.reject(et);this.pullQueue.length=0}else{const tt=Promise.reject(et);tt.catch(()=>{}),this.pushQueue.push(tt)}}remove(){Promise.resolve().then(()=>{this.removeCallback&&this.removeCallback()})}[Symbol.asyncIterator](){return{next:et=>{const tt=this.pushQueue.shift();return tt?(this.lowWaterMark!==void 0&&this.pushQueue.length<=this.lowWaterMark&&this.isPaused&&(this.isPaused=!1,this.eventHandlers.lowWater&&this.eventHandlers.lowWater()),tt):this.isStopped?Promise.resolve({value:void 0,done:!0}):new Promise((nt,rt)=>{this.pullQueue.push({resolve:nt,reject:rt})})},return:()=>(this.isStopped=!0,this.pushQueue.length=0,this.remove(),Promise.resolve({value:void 0,done:!0}))}}}let EventIterator$1=class{constructor(et,{highWaterMark:tt=100,lowWaterMark:nt=1}={}){const rt=new EventQueue;rt.highWaterMark=tt,rt.lowWaterMark=nt,rt.removeCallback=et({push:ot=>rt.push(ot),stop:()=>rt.stop(),fail:ot=>rt.fail(ot),on:(ot,it)=>{rt.eventHandlers[ot]=it}})||(()=>{}),this[Symbol.asyncIterator]=()=>rt[Symbol.asyncIterator](),Object.freeze(this)}};eventIterator.EventIterator=EventIterator$1;eventIterator.default=EventIterator$1;Object.defineProperty(dom,"__esModule",{value:!0});const event_iterator_1=eventIterator;var EventIterator=dom.EventIterator=event_iterator_1.EventIterator;function subscribe(o,et,tt){return new event_iterator_1.EventIterator(({push:nt})=>(this.addEventListener(o,nt,et),()=>this.removeEventListener(o,nt,et)),tt)}dom.subscribe=subscribe;dom.default=event_iterator_1.EventIterator;function isArrayBuffer(o){var et;return o instanceof ArrayBuffer||((et=o==null?void 0:o.constructor)==null?void 0:et.name)==="ArrayBuffer"&&typeof(o==null?void 0:o.byteLength)=="number"}const source=o=>{o.binaryType="arraybuffer";const et=async()=>{await new Promise((ot,it)=>{if(nt){ot();return}if(rt!=null){it(rt);return}const st=lt=>{o.removeEventListener("open",at),o.removeEventListener("error",ct),lt()},at=()=>{st(ot)},ct=lt=>{st(()=>{it(lt.error??new Error(`connect ECONNREFUSED ${o.url}`))})};o.addEventListener("open",at),o.addEventListener("error",ct)})},tt=async function*(){const ot=new EventIterator(({push:it,stop:st,fail:at})=>{const ct=dt=>{let ht=null;typeof dt.data=="string"&&(ht=fromString(dt.data)),isArrayBuffer(dt.data)&&(ht=new Uint8Array(dt.data)),dt.data instanceof Uint8Array&&(ht=dt.data),ht!=null&&it(ht)},lt=dt=>{at(dt.error??new Error("Socket error"))};return o.addEventListener("message",ct),o.addEventListener("error",lt),o.addEventListener("close",st),()=>{o.removeEventListener("message",ct),o.removeEventListener("error",lt),o.removeEventListener("close",st)}},{highWaterMark:1/0});await et();for await(const it of ot)yield isArrayBuffer(it)?new Uint8Array(it):it}();let nt=o.readyState===1,rt;return o.addEventListener("open",()=>{nt=!0,rt=null}),o.addEventListener("close",()=>{nt=!1,rt=null}),o.addEventListener("error",ot=>{nt||(rt=ot.error??new Error(`connect ECONNREFUSED ${o.url}`))}),Object.assign(tt,{connected:et})},duplex=(o,et)=>{et=et??{};const tt=source(o);let nt=et.remoteAddress,rt=et.remotePort;if(o.url!=null)try{const it=new URL(o.url);nt=it.hostname,rt=parseInt(it.port,10)}catch{}if(nt==null||rt==null)throw new Error("Remote connection did not have address and/or port");return{sink:sink(o,et),source:tt,connected:async()=>{await tt.connected()},close:async()=>{(o.readyState===o.CONNECTING||o.readyState===o.OPEN)&&await new Promise(it=>{o.addEventListener("close",()=>{it()}),o.close()})},destroy:()=>{o.terminate!=null?o.terminate():o.close()},remoteAddress:nt,remotePort:rt,socket:o}},WebSocket$1=WebSocket,map={"http:":"ws:","https:":"wss:"},defaultProtocol="ws:",wsurl=(o,et)=>{if(o.startsWith("//")&&(o=`${(et==null?void 0:et.protocol)??defaultProtocol}${o}`),o.startsWith("/")&&et!=null){const nt=et.protocol??defaultProtocol,rt=et.host,ot=et.port!=null&&(rt==null?void 0:rt.endsWith(`:${et.port}`))!==!0?`:${et.port}`:"";o=`${nt}//${rt}${ot}${o}`}const tt=new URL(o);for(const[nt,rt]of Object.entries(map))tt.protocol===nt&&(tt.protocol=rt);return tt};function connect(o,et){const tt=typeof window>"u"?void 0:window.location;et=et??{};const nt=wsurl(o,tt),rt=new WebSocket$1(nt.toString(),et.websocket);return duplex(rt,et)}class CustomProgressEvent extends Event{constructor(tt,nt){super(tt);Ct(this,"type");Ct(this,"detail");this.type=tt,this.detail=nt}}function all$1(o){return o.filter(et=>WebSocketsSecure.exactMatch(et)||WebSockets$1.exactMatch(et))}function wss(o){return o.filter(et=>WebSocketsSecure.exactMatch(et))}function createListener(){throw new Error("WebSocket Servers can not be created in the browser!")}const CLOSE_TIMEOUT$1=500;function socketToMaConn(o,et,tt){const nt=tt.logger.forComponent("libp2p:websockets:maconn"),rt=tt.metrics,ot=tt.metricPrefix??"",it={log:nt,async sink(st){try{await o.sink(async function*(){for await(const at of st)at instanceof Uint8Array?yield at:yield at.subarray()}())}catch(at){at.type!=="aborted"&&nt.error(at)}},source:o.source,remoteAddr:et,timeline:{open:Date.now()},async close(st={}){var lt,dt;const at=Date.now();if(st.signal==null){const ht=AbortSignal.timeout(CLOSE_TIMEOUT$1);st={...st,signal:ht}}const ct=()=>{const{host:ht,port:pt}=it.remoteAddr.toOptions();nt("timeout closing stream to %s:%s after %dms, destroying it manually",ht,pt,Date.now()-at),this.abort(new AbortError$5("Socket close timeout"))};(lt=st.signal)==null||lt.addEventListener("abort",ct);try{await o.close()}catch(ht){nt.error("error closing WebSocket gracefully",ht),this.abort(ht)}finally{(dt=st.signal)==null||dt.removeEventListener("abort",ct),it.timeline.close=Date.now()}},abort(st){const{host:at,port:ct}=it.remoteAddr.toOptions();nt("timeout closing stream to %s:%s due to error",at,ct,st),o.destroy(),it.timeline.close=Date.now(),rt==null||rt.increment({[`${ot}error`]:!0})}};return o.socket.addEventListener("close",()=>{rt==null||rt.increment({[`${ot}close`]:!0}),it.timeline.close==null&&(it.timeline.close=Date.now())},{once:!0}),it}var Tl,Il,Pl;Pl=transportSymbol,Il=Symbol.toStringTag,Tl=serviceCapabilities$1;class WebSockets{constructor(et,tt){Ct(this,"log");Ct(this,"init");Ct(this,"logger");Ct(this,"metrics");Ct(this,"components");Ct(this,Pl,!0);Ct(this,Il,"@libp2p/websockets");Ct(this,Tl,["@libp2p/transport"]);this.log=et.logger.forComponent("libp2p:websockets"),this.logger=et.logger,this.components=et,this.init=tt,et.metrics!=null&&(this.metrics={dialerEvents:et.metrics.registerCounterGroup("libp2p_websockets_dialer_events_total",{label:"event",help:"Total count of WebSockets dialer events by type"})})}async dial(et,tt){var it;this.log("dialing %s",et),tt=tt??{};const nt=await this._connect(et,tt),rt=socketToMaConn(nt,et,{logger:this.logger,metrics:(it=this.metrics)==null?void 0:it.dialerEvents});this.log("new outbound connection %s",rt.remoteAddr);const ot=await tt.upgrader.upgradeOutbound(rt,tt);return this.log("outbound connection %s upgraded",rt.remoteAddr),ot}async _connect(et,tt){var it,st,at,ct,lt;(it=tt==null?void 0:tt.signal)==null||it.throwIfAborted();const nt=et.toOptions();this.log("dialing %s:%s",nt.host,nt.port);const rt=pDefer(),ot=connect(multiaddrToUri(et),this.init);ot.socket.addEventListener("error",()=>{var ht;const dt=new ConnectionFailedError(`Could not connect to ${et.toString()}`);this.log.error("connection error:",dt),(ht=this.metrics)==null||ht.dialerEvents.increment({error:!0}),rt.reject(dt)});try{(st=tt.onProgress)==null||st.call(tt,new CustomProgressEvent("websockets:open-connection")),await raceSignal(Promise.race([ot.connected(),rt.promise]),tt.signal)}catch(dt){throw((at=tt.signal)==null?void 0:at.aborted)===!0&&((ct=this.metrics)==null||ct.dialerEvents.increment({abort:!0})),ot.close().catch(ht=>{this.log.error("error closing raw socket",ht)}),dt}return this.log("connected %s",et),(lt=this.metrics)==null||lt.dialerEvents.increment({connect:!0}),ot}createListener(et){return createListener({logger:this.logger,metrics:this.components.metrics},{...this.init,...et})}listenFilter(et){var tt,nt;return et=Array.isArray(et)?et:[et],((tt=this.init)==null?void 0:tt.filter)!=null?(nt=this.init)==null?void 0:nt.filter(et):isBrowser||isWebWorker?wss(et):all$1(et)}dialFilter(et){return this.listenFilter(et)}}function webSockets(o={}){return et=>new WebSockets(et,o)}const connectionSymbol=Symbol.for("@libp2p/connection"),contentRoutingSymbol=Symbol.for("@libp2p/content-routing"),peerDiscoverySymbol=Symbol.for("@libp2p/peer-discovery"),peerIdSymbol$1=Symbol.for("@libp2p/peer-id");function isPeerId$1(o){return!!(o!=null&&o[peerIdSymbol$1])}const peerRoutingSymbol=Symbol.for("@libp2p/peer-routing"),KEEP_ALIVE="keep-alive";var FaultTolerance;(function(o){o[o.FATAL_ALL=0]="FATAL_ALL",o[o.NO_FATAL=1]="NO_FATAL"})(FaultTolerance||(FaultTolerance={}));var bs;let AbortError$4=(bs=class extends Error{constructor(et="The operation was aborted"){super(et),this.name="AbortError"}},Ct(bs,"name","AbortError"),bs);var Es;let InvalidParametersError$1=(Es=class extends Error{constructor(et="Invalid parameters"){super(et),this.name="InvalidParametersError"}},Ct(Es,"name","InvalidParametersError"),Es);class ConnectionClosingError extends Error{constructor(et="The connection is closing"){super(et),this.name="ConnectionClosingError"}}Ct(ConnectionClosingError,"name","ConnectionClosingError");class ConnectionClosedError extends Error{constructor(et="The connection is closed"){super(et),this.name="ConnectionClosedError"}}Ct(ConnectionClosedError,"name","ConnectionClosedError");var ws;let NotFoundError$1=(ws=class extends Error{constructor(et="Not found"){super(et),this.name="NotFoundError"}},Ct(ws,"name","NotFoundError"),ws);class InvalidPeerIdError extends Error{constructor(et="Invalid PeerID"){super(et),this.name="InvalidPeerIdError"}}Ct(InvalidPeerIdError,"name","InvalidPeerIdError");class InvalidMultiaddrError extends Error{constructor(et="Invalid multiaddr"){super(et),this.name="InvalidMultiaddrError"}}Ct(InvalidMultiaddrError,"name","InvalidMultiaddrError");var Cs;let TimeoutError$2=(Cs=class extends Error{constructor(et="Timed out"){super(et),this.name="TimeoutError"}},Ct(Cs,"name","TimeoutError"),Cs);class NotStartedError extends Error{constructor(et="Not started"){super(et),this.name="NotStartedError"}}Ct(NotStartedError,"name","NotStartedError");class DialError extends Error{constructor(et="Dial error"){super(et),this.name="DialError"}}Ct(DialError,"name","DialError");class LimitedConnectionError extends Error{constructor(et="Limited connection"){super(et),this.name="LimitedConnectionError"}}Ct(LimitedConnectionError,"name","LimitedConnectionError");class TooManyInboundProtocolStreamsError extends Error{constructor(et="Too many inbound protocol streams"){super(et),this.name="TooManyInboundProtocolStreamsError"}}Ct(TooManyInboundProtocolStreamsError,"name","TooManyInboundProtocolStreamsError");class TooManyOutboundProtocolStreamsError extends Error{constructor(et="Too many outbound protocol streams"){super(et),this.name="TooManyOutboundProtocolStreamsError"}}Ct(TooManyOutboundProtocolStreamsError,"name","TooManyOutboundProtocolStreamsError");function setMaxListeners$1(){}const setMaxListeners=(o,...et)=>{try{[...et]}catch{}};var Xn;class TypedEventEmitter extends EventTarget{constructor(){super();fn(this,Xn,new Map);setMaxListeners(1/0,this)}listenerCount(tt){const nt=Mt(this,Xn).get(tt);return nt==null?0:nt.length}addEventListener(tt,nt,rt){super.addEventListener(tt,nt,rt);let ot=Mt(this,Xn).get(tt);ot==null&&(ot=[],Mt(this,Xn).set(tt,ot)),ot.push({callback:nt,once:(rt!==!0&&rt!==!1&&(rt==null?void 0:rt.once))??!1})}removeEventListener(tt,nt,rt){super.removeEventListener(tt.toString(),nt??null,rt);let ot=Mt(this,Xn).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==nt),Mt(this,Xn).set(tt,ot))}dispatchEvent(tt){const nt=super.dispatchEvent(tt);let rt=Mt(this,Xn).get(tt.type);return rt==null||(rt=rt.filter(({once:ot})=>!ot),Mt(this,Xn).set(tt.type,rt)),nt}safeDispatchEvent(tt,nt={}){return this.dispatchEvent(new CustomEvent(tt,nt))}}Xn=new WeakMap;function isStartable(o){return o!=null&&typeof o.start=="function"&&typeof o.stop=="function"}async function start(...o){const et=[];for(const tt of o)isStartable(tt)&&et.push(tt);await Promise.all(et.map(async tt=>{tt.beforeStart!=null&&await tt.beforeStart()})),await Promise.all(et.map(async tt=>{await tt.start()})),await Promise.all(et.map(async tt=>{tt.afterStart!=null&&await tt.afterStart()}))}async function stop(...o){const et=[];for(const tt of o)isStartable(tt)&&et.push(tt);await Promise.all(et.map(async tt=>{tt.beforeStop!=null&&await tt.beforeStop()})),await Promise.all(et.map(async tt=>{await tt.stop()})),await Promise.all(et.map(async tt=>{tt.afterStop!=null&&await tt.afterStop()}))}const serviceCapabilities=Symbol.for("@libp2p/service-capabilities"),serviceDependencies=Symbol.for("@libp2p/service-dependencies");let TimeoutError$1=class extends Error{constructor(et){super(et),this.name="TimeoutError"}},AbortError$3=class extends Error{constructor(et){super(),this.name="AbortError",this.message=et}};const getDOMException=o=>globalThis.DOMException===void 0?new AbortError$3(o):new DOMException(o),getAbortedReason=o=>{const et=o.reason===void 0?getDOMException("This operation was aborted."):o.reason;return et instanceof Error?et:getDOMException(et)};function pTimeout(o,et){const{milliseconds:tt,fallback:nt,message:rt,customTimers:ot={setTimeout,clearTimeout}}=et;let it;const at=new Promise((ct,lt)=>{if(typeof tt!="number"||Math.sign(tt)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${tt}\``);if(et.signal){const{signal:ht}=et;ht.aborted&<(getAbortedReason(ht));const pt=()=>{lt(getAbortedReason(ht))};ht.addEventListener("abort",pt,{once:!0}),o.finally(()=>{ht.removeEventListener("abort",pt)})}if(tt===Number.POSITIVE_INFINITY){o.then(ct,lt);return}const dt=new TimeoutError$1;it=ot.setTimeout.call(void 0,()=>{if(nt){try{ct(nt())}catch(ht){lt(ht)}return}typeof o.cancel=="function"&&o.cancel(),rt===!1?ct():rt instanceof Error?lt(rt):(dt.message=rt??`Promise timed out after ${tt} milliseconds`,lt(dt))},tt),(async()=>{try{ct(await o)}catch(ht){lt(ht)}})()}).finally(()=>{at.clear()});return at.clear=()=>{ot.clearTimeout.call(void 0,it),it=void 0},at}function lowerBound(o,et,tt){let nt=0,rt=o.length;for(;rt>0;){const ot=Math.trunc(rt/2);let it=nt+ot;tt(o[it],et)<=0?(nt=++it,rt-=ot+1):rt=ot}return nt}var Jn,Ll;let PriorityQueue$1=(Ll=class{constructor(){fn(this,Jn,[])}enqueue(et,tt){tt={priority:0,...tt};const nt={priority:tt.priority,run:et};if(this.size&&Mt(this,Jn)[this.size-1].priority>=tt.priority){Mt(this,Jn).push(nt);return}const rt=lowerBound(Mt(this,Jn),nt,(ot,it)=>it.priority-ot.priority);Mt(this,Jn).splice(rt,0,nt)}dequeue(){const et=Mt(this,Jn).shift();return et==null?void 0:et.run}filter(et){return Mt(this,Jn).filter(tt=>tt.priority===et.priority).map(tt=>tt.run)}get size(){return Mt(this,Jn).length}},Jn=new WeakMap,Ll);var Qr,Yr,vr,co,Zr,lo,zn,Xr,Dn,uo,Vn,Jr,ir,ho,_n,Yl,Zl,Xl,Jl,eu,Xo,js,Os,Jo,tu,_i;class PQueue extends EventEmitter$1{constructor(tt){var nt,rt;super();fn(this,_n);fn(this,Qr);fn(this,Yr);fn(this,vr,0);fn(this,co);fn(this,Zr);fn(this,lo,0);fn(this,zn);fn(this,Xr);fn(this,Dn);fn(this,uo);fn(this,Vn,0);fn(this,Jr);fn(this,ir);fn(this,ho);Ct(this,"timeout");if(tt={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:PriorityQueue$1,...tt},!(typeof tt.intervalCap=="number"&&tt.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${((nt=tt.intervalCap)==null?void 0:nt.toString())??""}\` (${typeof tt.intervalCap})`);if(tt.interval===void 0||!(Number.isFinite(tt.interval)&&tt.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((rt=tt.interval)==null?void 0:rt.toString())??""}\` (${typeof tt.interval})`);un(this,Qr,tt.carryoverConcurrencyCount),un(this,Yr,tt.intervalCap===Number.POSITIVE_INFINITY||tt.interval===0),un(this,co,tt.intervalCap),un(this,Zr,tt.interval),un(this,Dn,new tt.queueClass),un(this,uo,tt.queueClass),this.concurrency=tt.concurrency,this.timeout=tt.timeout,un(this,ho,tt.throwOnTimeout===!0),un(this,ir,tt.autoStart===!1)}get concurrency(){return Mt(this,Jr)}set concurrency(tt){if(!(typeof tt=="number"&&tt>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${tt}\` (${typeof tt})`);un(this,Jr,tt),gn(this,_n,Jo).call(this)}async add(tt,nt={}){return nt={timeout:this.timeout,throwOnTimeout:Mt(this,ho),...nt},new Promise((rt,ot)=>{Mt(this,Dn).enqueue(async()=>{var it;br(this,Vn)._++,br(this,vr)._++;try{(it=nt.signal)==null||it.throwIfAborted();let st=tt({signal:nt.signal});nt.timeout&&(st=pTimeout(Promise.resolve(st),{milliseconds:nt.timeout})),nt.signal&&(st=Promise.race([st,gn(this,_n,tu).call(this,nt.signal)]));const at=await st;rt(at),this.emit("completed",at)}catch(st){if(st instanceof TimeoutError$1&&!nt.throwOnTimeout){rt();return}ot(st),this.emit("error",st)}finally{gn(this,_n,Xl).call(this)}},nt),this.emit("add"),gn(this,_n,Xo).call(this)})}async addAll(tt,nt){return Promise.all(tt.map(async rt=>this.add(rt,nt)))}start(){return Mt(this,ir)?(un(this,ir,!1),gn(this,_n,Jo).call(this),this):this}pause(){un(this,ir,!0)}clear(){un(this,Dn,new(Mt(this,uo)))}async onEmpty(){Mt(this,Dn).size!==0&&await gn(this,_n,_i).call(this,"empty")}async onSizeLessThan(tt){Mt(this,Dn).sizeMt(this,Dn).size{gn(this,_n,Jl).call(this)},nt)),!0}return!1},Xo=function(){if(Mt(this,Dn).size===0)return Mt(this,zn)&&clearInterval(Mt(this,zn)),un(this,zn,void 0),this.emit("empty"),Mt(this,Vn)===0&&this.emit("idle"),!1;if(!Mt(this,ir)){const tt=!Mt(this,_n,eu);if(Mt(this,_n,Yl)&&Mt(this,_n,Zl)){const nt=Mt(this,Dn).dequeue();return nt?(this.emit("active"),nt(),tt&&gn(this,_n,js).call(this),!0):!1}}return!1},js=function(){Mt(this,Yr)||Mt(this,zn)!==void 0||(un(this,zn,setInterval(()=>{gn(this,_n,Os).call(this)},Mt(this,Zr))),un(this,lo,Date.now()+Mt(this,Zr)))},Os=function(){Mt(this,vr)===0&&Mt(this,Vn)===0&&Mt(this,zn)&&(clearInterval(Mt(this,zn)),un(this,zn,void 0)),un(this,vr,Mt(this,Qr)?Mt(this,Vn):0),gn(this,_n,Jo).call(this)},Jo=function(){for(;gn(this,_n,Xo).call(this););},tu=async function(tt){return new Promise((nt,rt)=>{tt.addEventListener("abort",()=>{rt(tt.reason)},{once:!0})})},_i=async function(tt,nt){return new Promise(rt=>{const ot=()=>{nt&&!nt()||(this.off(tt,ot),rt())};this.on(tt,ot)})};function getTypes(o){const et=[RecordType.A];return o==null?et:Array.isArray(o)?o.length===0?et:o:[o]}const DEFAULT_TTL=60;function toDNSResponse(o){return{Status:o.Status??0,TC:o.TC??o.flag_tc??!1,RD:o.RD??o.flag_rd??!1,RA:o.RA??o.flag_ra??!1,AD:o.AD??o.flag_ad??!1,CD:o.CD??o.flag_cd??!1,Question:(o.Question??o.questions??[]).map(et=>({name:et.name,type:RecordType[et.type]})),Answer:(o.Answer??o.answers??[]).map(et=>({name:et.name,type:RecordType[et.type],TTL:et.TTL??et.ttl??DEFAULT_TTL,data:et.data instanceof Uint8Array?toString$8(et.data):et.data}))}}const DEFAULT_QUERY_CONCURRENCY=4;function dnsJsonOverHttps(o,et={}){const tt=new PQueue({concurrency:et.queryConcurrency??DEFAULT_QUERY_CONCURRENCY});return async(nt,rt={})=>{var st;const ot=new URLSearchParams;ot.set("name",nt),getTypes(rt.types).forEach(at=>{ot.append("type",RecordType[at])}),(st=rt.onProgress)==null||st.call(rt,new CustomProgressEvent("dns:query",{detail:nt}));const it=await tt.add(async()=>{var lt;const at=await fetch(`${o}?${ot}`,{headers:{accept:"application/dns-json"},signal:rt==null?void 0:rt.signal});if(at.status!==200)throw new Error(`Unexpected HTTP status: ${at.status} - ${at.statusText}`);const ct=toDNSResponse(await at.json());return(lt=rt.onProgress)==null||lt.call(rt,new CustomProgressEvent("dns:response",{detail:ct})),ct},{signal:rt.signal});if(it==null)throw new Error("No DNS response received");return it}}function defaultResolver(){return[dnsJsonOverHttps("https://cloudflare-dns.com/dns-query"),dnsJsonOverHttps("https://dns.google/resolve")]}var hashlru=function(o){if(!o)throw Error("hashlru must have a max value, of type number, greater than 0");var et=0,tt=Object.create(null),nt=Object.create(null);function rt(ot,it){tt[ot]=it,et++,et>=o&&(et=0,nt=tt,tt=Object.create(null))}return{has:function(ot){return tt[ot]!==void 0||nt[ot]!==void 0},remove:function(ot){tt[ot]!==void 0&&(tt[ot]=void 0),nt[ot]!==void 0&&(nt[ot]=void 0)},get:function(ot){var it=tt[ot];if(it!==void 0)return it;if((it=nt[ot])!==void 0)return rt(ot,it),it},set:function(ot,it){tt[ot]!==void 0?tt[ot]=it:rt(ot,it)},clear:function(){tt=Object.create(null),nt=Object.create(null)}}};const hashlru$1=getDefaultExportFromCjs(hashlru);class CachedAnswers{constructor(et){Ct(this,"lru");this.lru=hashlru$1(et)}get(et,tt){let nt=!0;const rt=[];for(const ot of tt){const it=this.getAnswers(et,ot);if(it.length===0){nt=!1;break}rt.push(...it)}if(nt)return toDNSResponse({answers:rt})}getAnswers(et,tt){const nt=`${et.toLowerCase()}-${tt}`,rt=this.lru.get(nt);if(rt!=null){const ot=rt.filter(it=>it.expires>Date.now()).map(({expires:it,value:st})=>({...st,TTL:Math.round((it-Date.now())/1e3),type:RecordType[st.type]}));return ot.length===0&&this.lru.remove(nt),ot}return[]}add(et,tt){const nt=`${et.toLowerCase()}-${tt.type}`,rt=this.lru.get(nt)??[];rt.push({expires:Date.now()+(tt.TTL??DEFAULT_TTL)*1e3,value:tt}),this.lru.set(nt,rt)}remove(et,tt){const nt=`${et.toLowerCase()}-${tt}`;this.lru.remove(nt)}clear(){this.lru.clear()}}function cache(o){return new CachedAnswers(o)}const DEFAULT_ANSWER_CACHE_SIZE=1e3;class DNS{constructor(et){Ct(this,"resolvers");Ct(this,"cache");this.resolvers={},this.cache=cache(et.cacheSize??DEFAULT_ANSWER_CACHE_SIZE),Object.entries(et.resolvers??{}).forEach(([tt,nt])=>{Array.isArray(nt)||(nt=[nt]),tt.endsWith(".")||(tt=`${tt}.`),this.resolvers[tt]=nt}),this.resolvers["."]==null&&(this.resolvers["."]=defaultResolver())}async query(et,tt={}){var at,ct,lt;const nt=getTypes(tt.types),rt=tt.cached!==!1?this.cache.get(et,nt):void 0;if(rt!=null)return(at=tt.onProgress)==null||at.call(tt,new CustomProgressEvent("dns:cache",{detail:rt})),rt;const ot=`${et.split(".").pop()}.`,it=(this.resolvers[ot]??this.resolvers["."]).sort(()=>Math.random()>.5?-1:1),st=[];for(const dt of it){if(((ct=tt.signal)==null?void 0:ct.aborted)===!0)break;try{const ht=await dt(et,{...tt,types:nt});for(const pt of ht.Answer)this.cache.add(et,pt);return ht}catch(ht){st.push(ht),(lt=tt.onProgress)==null||lt.call(tt,new CustomProgressEvent("dns:error",{detail:ht}))}}throw st.length===1?st[0]:new AggregateError(st,`DNS lookup of ${et} ${nt} failed`)}}var RecordType;(function(o){o[o.A=1]="A",o[o.CNAME=5]="CNAME",o[o.TXT=16]="TXT",o[o.AAAA=28]="AAAA"})(RecordType||(RecordType={}));function dns(o={}){return new DNS(o)}const MAX_RECURSIVE_DEPTH=32,{code:dnsaddrCode}=getProtocol("dnsaddr");class RecursionLimitError extends Error{constructor(et="Max recursive depth reached"){super(et),this.name="RecursionLimitError"}}const dnsaddrResolver=async function(et,tt={}){const nt=tt.maxRecursiveDepth??MAX_RECURSIVE_DEPTH;if(nt===0)throw new RecursionLimitError("Max recursive depth reached");const[,rt]=et.stringTuples().find(([ct])=>ct===dnsaddrCode)??[],it=await((tt==null?void 0:tt.dns)??dns()).query(`_dnsaddr.${rt}`,{signal:tt==null?void 0:tt.signal,types:[RecordType.TXT]}),st=et.getPeerId(),at=[];for(const ct of it.Answer){const lt=ct.data.replace(/["']/g,"").trim().split("=")[1];if(lt==null||st!=null&&!lt.includes(st))continue;const dt=multiaddr(lt);if(lt.startsWith("/dnsaddr")){const ht=await dt.resolve({...tt,maxRecursiveDepth:nt-1});at.push(...ht.map(pt=>pt.toString()))}else at.push(dt.toString())}return at};var isPlainObj=o=>{if(Object.prototype.toString.call(o)!=="[object Object]")return!1;const et=Object.getPrototypeOf(o);return et===null||et===Object.prototype};const isOptionObject=isPlainObj,{hasOwnProperty:hasOwnProperty$1}=Object.prototype,{propertyIsEnumerable}=Object,defineProperty$1=(o,et,tt)=>Object.defineProperty(o,et,{value:tt,writable:!0,enumerable:!0,configurable:!0}),globalThis$1=commonjsGlobal,defaultMergeOptions={concatArrays:!1,ignoreUndefined:!1},getEnumerableOwnPropertyKeys=o=>{const et=[];for(const tt in o)hasOwnProperty$1.call(o,tt)&&et.push(tt);if(Object.getOwnPropertySymbols){const tt=Object.getOwnPropertySymbols(o);for(const nt of tt)propertyIsEnumerable.call(o,nt)&&et.push(nt)}return et};function clone(o){return Array.isArray(o)?cloneArray(o):isOptionObject(o)?cloneOptionObject(o):o}function cloneArray(o){const et=o.slice(0,0);return getEnumerableOwnPropertyKeys(o).forEach(tt=>{defineProperty$1(et,tt,clone(o[tt]))}),et}function cloneOptionObject(o){const et=Object.getPrototypeOf(o)===null?Object.create(null):{};return getEnumerableOwnPropertyKeys(o).forEach(tt=>{defineProperty$1(et,tt,clone(o[tt]))}),et}const mergeKeys=(o,et,tt,nt)=>(tt.forEach(rt=>{typeof et[rt]>"u"&&nt.ignoreUndefined||(rt in o&&o[rt]!==Object.getPrototypeOf(o)?defineProperty$1(o,rt,merge$1(o[rt],et[rt],nt)):defineProperty$1(o,rt,clone(et[rt])))}),o),concatArrays=(o,et,tt)=>{let nt=o.slice(0,0),rt=0;return[o,et].forEach(ot=>{const it=[];for(let st=0;st!it.includes(st)),tt)}),nt};function merge$1(o,et,tt){return tt.concatArrays&&Array.isArray(o)&&Array.isArray(et)?concatArrays(o,et,tt):!isOptionObject(et)||!isOptionObject(o)?clone(et):mergeKeys(o,et,getEnumerableOwnPropertyKeys(et),tt)}var mergeOptions=function(...o){const et=merge$1(clone(defaultMergeOptions),this!==globalThis$1&&this||{},defaultMergeOptions);let tt={_:{}};for(const nt of o)if(nt!==void 0){if(!isOptionObject(nt))throw new TypeError("`"+nt+"` is not an Option Object");tt=merge$1(tt,{_:nt},et)}return tt._};const mergeOptions$1=getDefaultExportFromCjs(mergeOptions);var define_globalThis_process_env_default$1={};const DefaultConfig={addresses:{listen:[],announce:[],noAnnounce:[],announceFilter:o=>o},connectionManager:{resolvers:{dnsaddr:dnsaddrResolver}},transportManager:{faultTolerance:FaultTolerance.FATAL_ALL}};async function validateConfig(o){const et=mergeOptions$1(DefaultConfig,o);if(et.connectionProtector===null&&(define_globalThis_process_env_default$1==null?void 0:define_globalThis_process_env_default$1.LIBP2P_FORCE_PNET)!=null)throw new InvalidParametersError$1("Private network is enforced, but no protector was provided");return et}const s=1e3,m=s*60,h=m*60,d=h*24,w=d*7,y=d*365.25;function ms(o,et){try{if(typeof o=="string"&&o.length>0)return parse$3(o);if(typeof o=="number"&&isFinite(o))return et!=null&&et.long?fmtLong(o):fmtShort(o);throw new Error("Value is not a string or number.")}catch(tt){const nt=isError$1(tt)?`${tt.message}. value=${JSON.stringify(o)}`:"An unknown error has occured.";throw new Error(nt)}}function parse$3(o){if(o=String(o),o.length>100)throw new Error("Value exceeds the maximum length of 100 characters.");const et=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(!et)return NaN;const tt=parseFloat(et[1]),nt=(et[2]||"ms").toLowerCase();switch(nt){case"years":case"year":case"yrs":case"yr":case"y":return tt*y;case"weeks":case"week":case"w":return tt*w;case"days":case"day":case"d":return tt*d;case"hours":case"hour":case"hrs":case"hr":case"h":return tt*h;case"minutes":case"minute":case"mins":case"min":case"m":return tt*m;case"seconds":case"second":case"secs":case"sec":case"s":return tt*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return tt;default:throw new Error(`The unit ${nt} was matched, but no matching case exists.`)}}function fmtShort(o){const et=Math.abs(o);return et>=d?`${Math.round(o/d)}d`:et>=h?`${Math.round(o/h)}h`:et>=m?`${Math.round(o/m)}m`:et>=s?`${Math.round(o/s)}s`:`${o}ms`}function fmtLong(o){const et=Math.abs(o);return et>=d?plural(o,et,d,"day"):et>=h?plural(o,et,h,"hour"):et>=m?plural(o,et,m,"minute"):et>=s?plural(o,et,s,"second"):`${o} ms`}function plural(o,et,tt,nt){const rt=et>=tt*1.5;return`${Math.round(o/tt)} ${nt}${rt?"s":""}`}function isError$1(o){return typeof o=="object"&&o!==null&&"message"in o}function setup(o){tt.debug=tt,tt.default=tt,tt.coerce=at,tt.disable=ot,tt.enable=rt,tt.enabled=it,tt.humanize=ms,tt.destroy=ct,Object.keys(o).forEach(lt=>{tt[lt]=o[lt]}),tt.names=[],tt.skips=[],tt.formatters={};function et(lt){let dt=0;for(let ht=0;ht{if(wt==="%%")return"%";bt++;const Tt=tt.formatters[kt];if(typeof Tt=="function"){const Rt=yt[bt];wt=Tt.call(gt,Rt),yt.splice(bt,1),bt--}return wt}),tt.formatArgs.call(gt,yt),(gt.log||tt.log).apply(gt,yt)}return ft.namespace=lt,ft.useColors=tt.useColors(),ft.color=tt.selectColor(lt),ft.extend=nt,ft.destroy=tt.destroy,Object.defineProperty(ft,"enabled",{enumerable:!0,configurable:!1,get:()=>ht!==null?ht:(pt!==tt.namespaces&&(pt=tt.namespaces,mt=tt.enabled(lt)),mt),set:yt=>{ht=yt}}),typeof tt.init=="function"&&tt.init(ft),ft}function nt(lt,dt){const ht=tt(this.namespace+(typeof dt>"u"?":":dt)+lt);return ht.log=this.log,ht}function rt(lt){tt.save(lt),tt.namespaces=lt,tt.names=[],tt.skips=[];let dt;const ht=(typeof lt=="string"?lt:"").split(/[\s,]+/),pt=ht.length;for(dt=0;dt"-"+dt)].join(",");return tt.enable(""),lt}function it(lt){if(lt[lt.length-1]==="*")return!0;let dt,ht;for(dt=0,ht=tt.skips.length;dt=31||typeof navigator<"u"&&((rt=navigator.userAgent)==null?void 0:rt.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(o){if(o[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+o[0]+(this.useColors?"%c ":" ")+"+"+ms(this.diff),!this.useColors)return;const et="color: "+this.color;o.splice(1,0,et,"color: inherit");let tt=0,nt=0;o[0].replace(/%[a-zA-Z%]/g,rt=>{rt!=="%%"&&(tt++,rt==="%c"&&(nt=tt))}),o.splice(nt,0,et)}const log$a=console.debug??console.log??(()=>{});function save(o){try{o?storage==null||storage.setItem("debug",o):storage==null||storage.removeItem("debug")}catch{}}function load$1(){let o;try{o=storage==null?void 0:storage.getItem("debug")}catch{}return!o&&typeof globalThis.process<"u"&&"env"in globalThis.process&&(o=define_globalThis_process_env_default.DEBUG),o}function localstorage(){try{return localStorage}catch{}}function setupFormatters(o){o.j=function(et){try{return JSON.stringify(et)}catch(tt){return"[UnexpectedJSONParseError]: "+tt.message}}}const weald=setup({formatArgs,save,load:load$1,useColors,setupFormatters,colors,storage,log:log$a});weald.formatters.b=o=>o==null?"undefined":base58btc.baseEncode(o);weald.formatters.t=o=>o==null?"undefined":base32$2.baseEncode(o);weald.formatters.m=o=>o==null?"undefined":base64$2.baseEncode(o);weald.formatters.p=o=>o==null?"undefined":o.toString();weald.formatters.c=o=>o==null?"undefined":o.toString();weald.formatters.k=o=>o==null?"undefined":o.toString();weald.formatters.a=o=>o==null?"undefined":o.toString();weald.formatters.e=o=>o==null?"undefined":notEmpty(o.stack)??notEmpty(o.message)??o.toString();function createDisabledLogger(o){const et=()=>{};return et.enabled=!1,et.color="",et.diff=0,et.log=()=>{},et.namespace=o,et.destroy=()=>!0,et.extend=()=>et,et}function defaultLogger(){return{forComponent(o){return logger$2(o)}}}function logger$2(o){let et=createDisabledLogger(`${o}:trace`);return weald.enabled(`${o}:trace`)&&weald.names.map(tt=>tt.toString()).find(tt=>tt.includes(":trace"))!=null&&(et=weald(`${o}:trace`)),Object.assign(weald(o),{error:weald(`${o}:error`),trace:et})}function notEmpty(o){if(o!=null&&(o=o.trim(),o.length!==0))return o}function mapIterable(o,et){const tt={[Symbol.iterator]:()=>tt,next:()=>{const nt=o.next(),rt=nt.value;return nt.done===!0||rt==null?{done:!0,value:void 0}:{done:!1,value:et(rt)}}};return tt}function peerIdFromString(o){const et=decode$6(base58btc.decode(`z${o}`));return peerIdFromMultihash(et)}class PeerMap{constructor(et){Ct(this,"map");if(this.map=new Map,et!=null)for(const[tt,nt]of et.entries())this.map.set(tt.toString(),{key:tt,value:nt})}[Symbol.iterator](){return this.entries()}clear(){this.map.clear()}delete(et){return this.map.delete(et.toString())}entries(){return mapIterable(this.map.entries(),et=>[et[1].key,et[1].value])}forEach(et){this.map.forEach((tt,nt)=>{et(tt.value,tt.key,this)})}get(et){var tt;return(tt=this.map.get(et.toString()))==null?void 0:tt.value}has(et){return this.map.has(et.toString())}set(et,tt){this.map.set(et.toString(),{key:et,value:tt})}keys(){return mapIterable(this.map.values(),et=>et.key)}values(){return mapIterable(this.map.values(),et=>et.value)}get size(){return this.map.size}}class PeerSet{constructor(et){Ct(this,"set");if(this.set=new Set,et!=null)for(const tt of et)this.set.add(tt.toString())}get size(){return this.set.size}[Symbol.iterator](){return this.values()}add(et){this.set.add(et.toString())}clear(){this.set.clear()}delete(et){this.set.delete(et.toString())}entries(){return mapIterable(this.set.entries(),et=>{const tt=peerIdFromString(et[0]);return[tt,tt]})}forEach(et){this.set.forEach(tt=>{const nt=peerIdFromString(tt);et(nt,nt,this)})}has(et){return this.set.has(et.toString())}values(){return mapIterable(this.set.values(),et=>peerIdFromString(et))}intersection(et){const tt=new PeerSet;for(const nt of et)this.has(nt)&&tt.add(nt);return tt}difference(et){const tt=new PeerSet;for(const nt of this)et.has(nt)||tt.add(nt);return tt}union(et){const tt=new PeerSet;for(const nt of et)tt.add(nt);for(const nt of this)tt.add(nt);return tt}}var murmurHash3js={exports:{}};(function(o,et){(function(tt,nt){var rt={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function ot(ft){if(!Array.isArray(ft)&&!ArrayBuffer.isView(ft))return!1;for(var yt=0;yt255)return!1;return!0}function it(ft,yt){return(ft&65535)*yt+(((ft>>>16)*yt&65535)<<16)}function st(ft,yt){return ft<>>32-yt}function at(ft){return ft^=ft>>>16,ft=it(ft,2246822507),ft^=ft>>>13,ft=it(ft,3266489909),ft^=ft>>>16,ft}function ct(ft,yt){ft=[ft[0]>>>16,ft[0]&65535,ft[1]>>>16,ft[1]&65535],yt=[yt[0]>>>16,yt[0]&65535,yt[1]>>>16,yt[1]&65535];var gt=[0,0,0,0];return gt[3]+=ft[3]+yt[3],gt[2]+=gt[3]>>>16,gt[3]&=65535,gt[2]+=ft[2]+yt[2],gt[1]+=gt[2]>>>16,gt[2]&=65535,gt[1]+=ft[1]+yt[1],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[0]+=ft[0]+yt[0],gt[0]&=65535,[gt[0]<<16|gt[1],gt[2]<<16|gt[3]]}function lt(ft,yt){ft=[ft[0]>>>16,ft[0]&65535,ft[1]>>>16,ft[1]&65535],yt=[yt[0]>>>16,yt[0]&65535,yt[1]>>>16,yt[1]&65535];var gt=[0,0,0,0];return gt[3]+=ft[3]*yt[3],gt[2]+=gt[3]>>>16,gt[3]&=65535,gt[2]+=ft[2]*yt[3],gt[1]+=gt[2]>>>16,gt[2]&=65535,gt[2]+=ft[3]*yt[2],gt[1]+=gt[2]>>>16,gt[2]&=65535,gt[1]+=ft[1]*yt[3],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[1]+=ft[2]*yt[2],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[1]+=ft[3]*yt[1],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[0]+=ft[0]*yt[3]+ft[1]*yt[2]+ft[2]*yt[1]+ft[3]*yt[0],gt[0]&=65535,[gt[0]<<16|gt[1],gt[2]<<16|gt[3]]}function dt(ft,yt){return yt%=64,yt===32?[ft[1],ft[0]]:yt<32?[ft[0]<>>32-yt,ft[1]<>>32-yt]:(yt-=32,[ft[1]<>>32-yt,ft[0]<>>32-yt])}function ht(ft,yt){return yt%=64,yt===0?ft:yt<32?[ft[0]<>>32-yt,ft[1]<>>1]),ft=lt(ft,[4283543511,3981806797]),ft=pt(ft,[0,ft[0]>>>1]),ft=lt(ft,[3301882366,444984403]),ft=pt(ft,[0,ft[0]>>>1]),ft}rt.x86.hash32=function(ft,yt){if(rt.inputValidation&&!ot(ft))return nt;yt=yt||0;for(var gt=ft.length%4,xt=ft.length-gt,vt=yt,bt=0,Et=3432918353,wt=461845907,kt=0;kt>>0},rt.x86.hash128=function(ft,yt){if(rt.inputValidation&&!ot(ft))return nt;yt=yt||0;for(var gt=ft.length%16,xt=ft.length-gt,vt=yt,bt=yt,Et=yt,wt=yt,kt=0,Tt=0,Rt=0,Pt=0,$t=597399067,Ot=2869860233,Bt=951274213,zt=2716044179,Ft=0;Ft>>0).toString(16)).slice(-8)+("00000000"+(bt>>>0).toString(16)).slice(-8)+("00000000"+(Et>>>0).toString(16)).slice(-8)+("00000000"+(wt>>>0).toString(16)).slice(-8)},rt.x64.hash128=function(ft,yt){if(rt.inputValidation&&!ot(ft))return nt;yt=yt||0;for(var gt=ft.length%16,xt=ft.length-gt,vt=[0,yt],bt=[0,yt],Et=[0,0],wt=[0,0],kt=[2277735313,289559509],Tt=[1291169091,658871167],Rt=0;Rt>>0).toString(16)).slice(-8)+("00000000"+(vt[1]>>>0).toString(16)).slice(-8)+("00000000"+(bt[0]>>>0).toString(16)).slice(-8)+("00000000"+(bt[1]>>>0).toString(16)).slice(-8)},o.exports&&(et=o.exports=rt),et.murmurHash3=rt})()})(murmurHash3js,murmurHash3js.exports);const MAX_FINGERPRINT_SIZE=64;class Fingerprint{constructor(et,tt,nt,rt=2){Ct(this,"fp");Ct(this,"h");Ct(this,"seed");if(rt>MAX_FINGERPRINT_SIZE)throw new TypeError("Invalid Fingerprint Size");const ot=tt.hashV(et,nt),it=alloc$2(rt);for(let st=0;stet.equals(tt))}add(et){if(!(et instanceof Fingerprint))throw new TypeError("Invalid Fingerprint");for(let tt=0;ttet.equals(nt));return tt>-1?(this.contents[tt]=null,!0):!1}}const FNV_PRIMES={32:16777619n,64:1099511628211n,128:309485009821345068724781371n,256:374144419156711147060143317175368453031918731002211n,512:35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759n,1024:5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573n},FNV_OFFSETS={32:2166136261n,64:14695981039346656037n,128:144066263297769815596495629667062367629n,256:100029257958052580907070968620625704837092796014241193945225284501741471925557n,512:9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785n,1024:14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915n},cachedEncoder=new globalThis.TextEncoder;function fnv1aUint8Array(o,et){const tt=FNV_PRIMES[et];let nt=FNV_OFFSETS[et];for(let rt=0;rt0;){const it=cachedEncoder.encodeInto(ot,tt);ot=ot.slice(it.read);for(let st=0;stNumber(fnv1a$1(o,{size:32})),hashV:(o,et)=>numberToBuffer(fnv1a.hash(o,et))};function numberToBuffer(o){let et=o.toString(16);return et.length%2===1&&(et=`0${et}`),fromString(et,"base16")}const maxCuckooCount=500;class CuckooFilter{constructor(et){Ct(this,"bucketSize");Ct(this,"filterSize");Ct(this,"fingerprintSize");Ct(this,"buckets");Ct(this,"count");Ct(this,"hash");Ct(this,"seed");this.filterSize=et.filterSize,this.bucketSize=et.bucketSize??4,this.fingerprintSize=et.fingerprintSize??2,this.count=0,this.buckets=[],this.hash=et.hash??fnv1a,this.seed=et.seed??getRandomInt(0,Math.pow(2,10))}add(et){typeof et=="string"&&(et=fromString(et));const tt=new Fingerprint(et,this.hash,this.seed,this.fingerprintSize),nt=this.hash.hash(et,this.seed)%this.filterSize,rt=(nt^tt.hash())%this.filterSize;if(this.buckets[nt]==null&&(this.buckets[nt]=new Bucket(this.bucketSize)),this.buckets[rt]==null&&(this.buckets[rt]=new Bucket(this.bucketSize)),this.buckets[nt].add(tt)||this.buckets[rt].add(tt))return this.count++,!0;const ot=[nt,rt];let it=ot[getRandomInt(0,ot.length-1)];this.buckets[it]==null&&(this.buckets[it]=new Bucket(this.bucketSize));for(let st=0;st.002?2:o>1e-5?4:8}function optimize(o,et=.001){const tt=calculateBucketSize(et),nt=MAX_LOAD[tt],rt=Math.round(o/nt),ot=Math.min(Math.ceil(Math.log2(1/et)+Math.log2(2*tt)),MAX_FINGERPRINT_SIZE);return{filterSize:rt,bucketSize:tt,fingerprintSize:ot}}class ScalableCuckooFilter{constructor(et){Ct(this,"filterSize");Ct(this,"bucketSize");Ct(this,"fingerprintSize");Ct(this,"scale");Ct(this,"filterSeries");Ct(this,"hash");Ct(this,"seed");this.bucketSize=et.bucketSize??4,this.filterSize=et.filterSize??(1<<18)/this.bucketSize,this.fingerprintSize=et.fingerprintSize??2,this.scale=et.scale??2,this.hash=et.hash??fnv1a,this.seed=et.seed??getRandomInt(0,Math.pow(2,10)),this.filterSeries=[new CuckooFilter({filterSize:this.filterSize,bucketSize:this.bucketSize,fingerprintSize:this.fingerprintSize,hash:this.hash,seed:this.seed})]}add(et){if(typeof et=="string"&&(et=fromString(et)),this.has(et))return!0;let tt=this.filterSeries.find(nt=>nt.reliable);if(tt==null){const nt=this.filterSize*Math.pow(this.scale,this.filterSeries.length);tt=new CuckooFilter({filterSize:nt,bucketSize:this.bucketSize,fingerprintSize:this.fingerprintSize,hash:this.hash,seed:this.seed}),this.filterSeries.push(tt)}return tt.add(et)}has(et){typeof et=="string"&&(et=fromString(et));for(let tt=0;ttet+tt.count,0)}}function createScalableCuckooFilter(o,et=.001,tt){return new ScalableCuckooFilter({...optimize(o,et)})}const peerIdSymbol=Symbol.for("@libp2p/peer-id");function isPeerId(o){return!!(o!=null&&o[peerIdSymbol])}class InvalidParametersError extends Error{constructor(et="Invalid parameters"){super(et),this.name="InvalidParametersError"}}Ct(InvalidParametersError,"name","InvalidParametersError");const events={},observable=o=>{o.addEventListener("message",et=>{observable.dispatchEvent("message",o,et)}),o.port!=null&&o.port.addEventListener("message",et=>{observable.dispatchEvent("message",o,et)})};observable.addEventListener=(o,et)=>{events[o]==null&&(events[o]=[]),events[o].push(et)};observable.removeEventListener=(o,et)=>{events[o]!=null&&(events[o]=events[o].filter(tt=>tt===et))};observable.dispatchEvent=function(o,et,tt){events[o]!=null&&events[o].forEach(nt=>nt(et,tt))};const WORKER_REQUEST_READ_LOCK="lock:worker:request-read",WORKER_RELEASE_READ_LOCK="lock:worker:release-read",MASTER_GRANT_READ_LOCK="lock:master:grant-read",WORKER_REQUEST_WRITE_LOCK="lock:worker:request-write",WORKER_RELEASE_WRITE_LOCK="lock:worker:release-write",MASTER_GRANT_WRITE_LOCK="lock:master:grant-write",nanoid=(o=21)=>Math.random().toString().substring(2),handleWorkerLockRequest=(o,et,tt,nt,rt)=>(ot,it)=>{if(it.data.type!==tt)return;const st={type:it.data.type,name:it.data.name,identifier:it.data.identifier};o.dispatchEvent(new MessageEvent(et,{data:{name:st.name,handler:async()=>{ot.postMessage({type:rt,name:st.name,identifier:st.identifier}),await new Promise(at=>{const ct=lt=>{if((lt==null?void 0:lt.data)==null)return;const dt={type:lt.data.type,name:lt.data.name,identifier:lt.data.identifier};dt.type===nt&&dt.identifier===st.identifier&&(ot.removeEventListener("message",ct),at())};ot.addEventListener("message",ct)})}}}))},makeWorkerLockRequest=(o,et,tt,nt)=>async()=>{const rt=nanoid();return globalThis.postMessage({type:et,identifier:rt,name:o}),new Promise(ot=>{const it=st=>{if((st==null?void 0:st.data)==null)return;const at={type:st.data.type,identifier:st.data.identifier};at.type===tt&&at.identifier===rt&&(globalThis.removeEventListener("message",it),ot(()=>{globalThis.postMessage({type:nt,identifier:rt,name:o})}))};globalThis.addEventListener("message",it)})},defaultOptions$4={singleProcess:!1},impl=o=>{if(o=Object.assign({},defaultOptions$4,o),!!globalThis.document||o.singleProcess){const tt=new EventTarget;return observable.addEventListener("message",handleWorkerLockRequest(tt,"requestReadLock",WORKER_REQUEST_READ_LOCK,WORKER_RELEASE_READ_LOCK,MASTER_GRANT_READ_LOCK)),observable.addEventListener("message",handleWorkerLockRequest(tt,"requestWriteLock",WORKER_REQUEST_WRITE_LOCK,WORKER_RELEASE_WRITE_LOCK,MASTER_GRANT_WRITE_LOCK)),tt}return{isWorker:!0,readLock:tt=>makeWorkerLockRequest(tt,WORKER_REQUEST_READ_LOCK,MASTER_GRANT_READ_LOCK,WORKER_RELEASE_READ_LOCK),writeLock:tt=>makeWorkerLockRequest(tt,WORKER_REQUEST_WRITE_LOCK,MASTER_GRANT_WRITE_LOCK,WORKER_RELEASE_WRITE_LOCK)}},mutexes={};let implementation;async function createReleaseable(o,et){let tt;const nt=new Promise(rt=>{tt=rt});return o.add(async()=>pTimeout((async()=>{await new Promise(rt=>{tt(()=>{rt()})})})(),{milliseconds:et.timeout})),nt}const createMutex=(o,et)=>{if(implementation.isWorker===!0)return{readLock:implementation.readLock(o,et),writeLock:implementation.writeLock(o,et)};const tt=new PQueue({concurrency:1});let nt;return{async readLock(){if(nt!=null)return createReleaseable(nt,et);nt=new PQueue({concurrency:et.concurrency,autoStart:!1});const rt=nt,ot=createReleaseable(nt,et);return tt.add(async()=>{rt.start(),await rt.onIdle().then(()=>{nt===rt&&(nt=null)})}),ot},async writeLock(){return nt=null,createReleaseable(tt,et)}}},defaultOptions$3={name:"lock",concurrency:1/0,timeout:846e5,singleProcess:!1};function createMortice(o){const et=Object.assign({},defaultOptions$3,o);return implementation==null&&(implementation=impl(et),implementation.isWorker!==!0&&(implementation.addEventListener("requestReadLock",tt=>{mutexes[tt.data.name]!=null&&mutexes[tt.data.name].readLock().then(async nt=>tt.data.handler().finally(()=>{nt()}))}),implementation.addEventListener("requestWriteLock",async tt=>{mutexes[tt.data.name]!=null&&mutexes[tt.data.name].writeLock().then(async nt=>tt.data.handler().finally(()=>{nt()}))}))),mutexes[et.name]==null&&(mutexes[et.name]=createMutex(et.name,et)),mutexes[et.name]}var Peer;(function(o){(function(tt){let nt;tt.codec=()=>(nt==null&&(nt=message$1((rt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),rt.key!=null&&rt.key!==""&&(ot.uint32(10),ot.string(rt.key)),rt.value!=null&&rt.value.byteLength>0&&(ot.uint32(18),ot.bytes(rt.value)),it.lengthDelimited!==!1&&ot.ldelim()},(rt,ot,it={})=>{const st={key:"",value:alloc$2(0)},at=ot==null?rt.len:rt.pos+ot;for(;rt.pos>>3){case 1:{st.key=rt.string();break}case 2:{st.value=rt.bytes();break}default:{rt.skipType(ct&7);break}}}return st})),nt),tt.encode=rt=>encodeMessage(rt,tt.codec()),tt.decode=(rt,ot)=>decodeMessage(rt,tt.codec(),ot)})(o.Peer$metadataEntry||(o.Peer$metadataEntry={})),function(tt){let nt;tt.codec=()=>(nt==null&&(nt=message$1((rt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),rt.key!=null&&rt.key!==""&&(ot.uint32(10),ot.string(rt.key)),rt.value!=null&&(ot.uint32(18),Tag.codec().encode(rt.value,ot)),it.lengthDelimited!==!1&&ot.ldelim()},(rt,ot,it={})=>{var ct;const st={key:""},at=ot==null?rt.len:rt.pos+ot;for(;rt.pos>>3){case 1:{st.key=rt.string();break}case 2:{st.value=Tag.codec().decode(rt,rt.uint32(),{limits:(ct=it.limits)==null?void 0:ct.value});break}default:{rt.skipType(lt&7);break}}}return st})),nt),tt.encode=rt=>encodeMessage(rt,tt.codec()),tt.decode=(rt,ot)=>decodeMessage(rt,tt.codec(),ot)}(o.Peer$tagsEntry||(o.Peer$tagsEntry={}));let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{if(rt.lengthDelimited!==!1&&nt.fork(),tt.addresses!=null)for(const ot of tt.addresses)nt.uint32(10),Address.codec().encode(ot,nt);if(tt.protocols!=null)for(const ot of tt.protocols)nt.uint32(18),nt.string(ot);if(tt.publicKey!=null&&(nt.uint32(34),nt.bytes(tt.publicKey)),tt.peerRecordEnvelope!=null&&(nt.uint32(42),nt.bytes(tt.peerRecordEnvelope)),tt.metadata!=null&&tt.metadata.size!==0)for(const[ot,it]of tt.metadata.entries())nt.uint32(50),o.Peer$metadataEntry.codec().encode({key:ot,value:it},nt);if(tt.tags!=null&&tt.tags.size!==0)for(const[ot,it]of tt.tags.entries())nt.uint32(58),o.Peer$tagsEntry.codec().encode({key:ot,value:it},nt);rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{var st,at,ct,lt,dt,ht;const ot={addresses:[],protocols:[],metadata:new Map,tags:new Map},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{if(((st=rt.limits)==null?void 0:st.addresses)!=null&&ot.addresses.length===rt.limits.addresses)throw new MaxLengthError('Decode error - map field "addresses" had too many elements');ot.addresses.push(Address.codec().decode(tt,tt.uint32(),{limits:(at=rt.limits)==null?void 0:at.addresses$}));break}case 2:{if(((ct=rt.limits)==null?void 0:ct.protocols)!=null&&ot.protocols.length===rt.limits.protocols)throw new MaxLengthError('Decode error - map field "protocols" had too many elements');ot.protocols.push(tt.string());break}case 4:{ot.publicKey=tt.bytes();break}case 5:{ot.peerRecordEnvelope=tt.bytes();break}case 6:{if(((lt=rt.limits)==null?void 0:lt.metadata)!=null&&ot.metadata.size===rt.limits.metadata)throw new MaxSizeError('Decode error - map field "metadata" had too many elements');const mt=o.Peer$metadataEntry.codec().decode(tt,tt.uint32());ot.metadata.set(mt.key,mt.value);break}case 7:{if(((dt=rt.limits)==null?void 0:dt.tags)!=null&&ot.tags.size===rt.limits.tags)throw new MaxSizeError('Decode error - map field "tags" had too many elements');const mt=o.Peer$tagsEntry.codec().decode(tt,tt.uint32(),{limits:{value:(ht=rt.limits)==null?void 0:ht.tags$value}});ot.tags.set(mt.key,mt.value);break}default:{tt.skipType(pt&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(Peer||(Peer={}));var Address;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.multiaddr!=null&&tt.multiaddr.byteLength>0&&(nt.uint32(10),nt.bytes(tt.multiaddr)),tt.isCertified!=null&&(nt.uint32(16),nt.bool(tt.isCertified)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={multiaddr:alloc$2(0)},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.multiaddr=tt.bytes();break}case 2:{ot.isCertified=tt.bool();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(Address||(Address={}));var Tag;(function(o){let et;o.codec=()=>(et==null&&(et=message$1((tt,nt,rt={})=>{rt.lengthDelimited!==!1&&nt.fork(),tt.value!=null&&tt.value!==0&&(nt.uint32(8),nt.uint32(tt.value)),tt.expiry!=null&&(nt.uint32(16),nt.uint64(tt.expiry)),rt.lengthDelimited!==!1&&nt.ldelim()},(tt,nt,rt={})=>{const ot={value:0},it=nt==null?tt.len:tt.pos+nt;for(;tt.pos>>3){case 1:{ot.value=tt.uint32();break}case 2:{ot.expiry=tt.uint64();break}default:{tt.skipType(st&7);break}}}return ot})),et),o.encode=tt=>encodeMessage(tt,o.codec()),o.decode=(tt,nt)=>decodeMessage(tt,o.codec(),nt)})(Tag||(Tag={}));function bytesToPeer(o,et){const tt=Peer.decode(et);if(tt.publicKey!=null&&o.publicKey==null){const ot=publicKeyFromProtobuf(tt.publicKey);o=peerIdFromPublicKey(ot)}const nt=new Map,rt=BigInt(Date.now());for(const[ot,it]of tt.tags.entries())it.expiry!=null&&it.expiry({multiaddr:multiaddr(ot),isCertified:it??!1})),metadata:tt.metadata,peerRecordEnvelope:tt.peerRecordEnvelope??void 0,tags:nt}}const pathSepS="/",pathSepB=new TextEncoder().encode(pathSepS),pathSep=pathSepB[0];class Key{constructor(et,tt){Ct(this,"_buf");if(typeof et=="string")this._buf=fromString(et);else if(et instanceof Uint8Array)this._buf=et;else throw new Error("Invalid key, should be String of Uint8Array");if(tt==null&&(tt=!0),tt&&this.clean(),this._buf.byteLength===0||this._buf[0]!==pathSep)throw new Error("Invalid key")}toString(et="utf8"){return toString$8(this._buf,et)}uint8Array(){return this._buf}get[Symbol.toStringTag](){return`Key(${this.toString()})`}static withNamespaces(et){return new Key(et.join(pathSepS))}static random(){return new Key(Math.random().toString().substring(2))}static asKey(et){return et instanceof Uint8Array||typeof et=="string"?new Key(et):typeof et.uint8Array=="function"?new Key(et.uint8Array()):null}clean(){if((this._buf==null||this._buf.byteLength===0)&&(this._buf=pathSepB),this._buf[0]!==pathSep){const et=new Uint8Array(this._buf.byteLength+1);et.fill(pathSep,0,1),et.set(this._buf,1),this._buf=et}for(;this._buf.byteLength>1&&this._buf[this._buf.byteLength-1]===pathSep;)this._buf=this._buf.subarray(0,-1)}less(et){const tt=this.list(),nt=et.list();for(let rt=0;rtit)return!1}return tt.lengthtt.namespaces()))])}}function namespaceType(o){const et=o.split(":");return et.length<2?"":et.slice(0,-1).join(":")}function namespaceValue(o){const et=o.split(":");return et[et.length-1]}function flatten(o){return[].concat(...o)}const NAMESPACE_COMMON="/peers/";function peerIdToDatastoreKey(o){if(!isPeerId(o)||o.type==null)throw new InvalidParametersError("Invalid PeerId");const et=o.toCID().toString();return new Key(`${NAMESPACE_COMMON}${et}`)}async function dedupeFilterAndSortAddresses(o,et,tt){const nt=new Map;for(const rt of tt){if(rt==null)continue;if(rt.multiaddr instanceof Uint8Array&&(rt.multiaddr=multiaddr(rt.multiaddr)),!isMultiaddr(rt.multiaddr))throw new InvalidParametersError("Multiaddr was invalid");if(!await et(o,rt.multiaddr))continue;const ot=rt.isCertified??!1,it=rt.multiaddr.toString(),st=nt.get(it);st!=null?rt.isCertified=st.isCertified||ot:nt.set(it,{multiaddr:rt.multiaddr,isCertified:ot})}return[...nt.values()].sort((rt,ot)=>rt.multiaddr.toString().localeCompare(ot.multiaddr.toString())).map(({isCertified:rt,multiaddr:ot})=>({isCertified:rt,multiaddr:ot.bytes}))}async function toPeerPB(o,et,tt,nt){if(et==null)throw new InvalidParametersError("Invalid PeerData");if(et.publicKey!=null&&o.publicKey!=null&&!et.publicKey.equals(o.publicKey))throw new InvalidParametersError("publicKey bytes do not match peer id publicKey bytes");const rt=nt.existingPeer;if(rt!=null&&!o.equals(rt.id))throw new InvalidParametersError("peer id did not match existing peer id");let ot=(rt==null?void 0:rt.addresses)??[],it=new Set((rt==null?void 0:rt.protocols)??[]),st=(rt==null?void 0:rt.metadata)??new Map,at=(rt==null?void 0:rt.tags)??new Map,ct=rt==null?void 0:rt.peerRecordEnvelope;if(tt==="patch"){if((et.multiaddrs!=null||et.addresses!=null)&&(ot=[],et.multiaddrs!=null&&ot.push(...et.multiaddrs.map(ht=>({isCertified:!1,multiaddr:ht}))),et.addresses!=null&&ot.push(...et.addresses)),et.protocols!=null&&(it=new Set(et.protocols)),et.metadata!=null){const ht=et.metadata instanceof Map?[...et.metadata.entries()]:Object.entries(et.metadata);st=createSortedMap(ht,{validate:validateMetadata})}if(et.tags!=null){const ht=et.tags instanceof Map?[...et.tags.entries()]:Object.entries(et.tags);at=createSortedMap(ht,{validate:validateTag,map:mapTag})}et.peerRecordEnvelope!=null&&(ct=et.peerRecordEnvelope)}if(tt==="merge"){if(et.multiaddrs!=null&&ot.push(...et.multiaddrs.map(ht=>({isCertified:!1,multiaddr:ht}))),et.addresses!=null&&ot.push(...et.addresses),et.protocols!=null&&(it=new Set([...it,...et.protocols])),et.metadata!=null){const ht=et.metadata instanceof Map?[...et.metadata.entries()]:Object.entries(et.metadata);for(const[pt,mt]of ht)mt==null?st.delete(pt):st.set(pt,mt);st=createSortedMap([...st.entries()],{validate:validateMetadata})}if(et.tags!=null){const ht=et.tags instanceof Map?[...et.tags.entries()]:Object.entries(et.tags),pt=new Map(at);for(const[mt,ft]of ht)ft==null?pt.delete(mt):pt.set(mt,ft);at=createSortedMap([...pt.entries()],{validate:validateTag,map:mapTag})}et.peerRecordEnvelope!=null&&(ct=et.peerRecordEnvelope)}let lt;(rt==null?void 0:rt.id.publicKey)!=null?lt=publicKeyToProtobuf(rt.id.publicKey):et.publicKey!=null?lt=publicKeyToProtobuf(et.publicKey):o.publicKey!=null&&(lt=publicKeyToProtobuf(o.publicKey));const dt={addresses:await dedupeFilterAndSortAddresses(o,nt.addressFilter??(async()=>!0),ot),protocols:[...it.values()].sort((ht,pt)=>ht.localeCompare(pt)),metadata:st,tags:at,publicKey:lt,peerRecordEnvelope:ct};return o.type!=="RSA"&&delete dt.publicKey,dt}function createSortedMap(o,et){var nt;const tt=new Map;for(const[rt,ot]of o)ot!=null&&et.validate(rt,ot);for(const[rt,ot]of o.sort(([it],[st])=>it.localeCompare(st)))ot!=null&&tt.set(rt,((nt=et.map)==null?void 0:nt.call(et,rt,ot))??ot);return tt}function validateMetadata(o,et){if(typeof o!="string")throw new InvalidParametersError("Metadata key must be a string");if(!(et instanceof Uint8Array))throw new InvalidParametersError("Metadata value must be a Uint8Array")}function validateTag(o,et){if(typeof o!="string")throw new InvalidParametersError("Tag name must be a string");if(et.value!=null){if(parseInt(`${et.value}`,10)!==et.value)throw new InvalidParametersError("Tag value must be an integer");if(et.value<0||et.value>100)throw new InvalidParametersError("Tag value must be between 0-100")}if(et.ttl!=null){if(parseInt(`${et.ttl}`,10)!==et.ttl)throw new InvalidParametersError("Tag ttl must be an integer");if(et.ttl<0)throw new InvalidParametersError("Tag ttl must be between greater than 0")}}function mapTag(o,et){let tt;return et.expiry!=null&&(tt=et.expiry),et.ttl!=null&&(tt=BigInt(Date.now()+Number(et.ttl))),{value:et.value??0,expiry:tt}}function decodePeer(o,et){const tt=o.toString().split("/")[2],nt=CID.parse(tt,base32$2),rt=peerIdFromCID(nt);return bytesToPeer(rt,et)}function mapQuery(o){return o==null?{}:{prefix:NAMESPACE_COMMON,filters:(o.filters??[]).map(et=>({key:tt,value:nt})=>et(decodePeer(tt,nt))),orders:(o.orders??[]).map(et=>(tt,nt)=>et(decodePeer(tt.key,tt.value),decodePeer(nt.key,nt.value)))}}var er,es,ts;class PersistentStore{constructor(et,tt={}){fn(this,er);Ct(this,"peerId");Ct(this,"datastore");Ct(this,"lock");Ct(this,"addressFilter");this.peerId=et.peerId,this.datastore=et.datastore,this.addressFilter=tt.addressFilter,this.lock=createMortice({name:"peer-store",singleProcess:!0})}async has(et){return this.datastore.has(peerIdToDatastoreKey(et))}async delete(et){if(this.peerId.equals(et))throw new InvalidParametersError("Cannot delete self peer");await this.datastore.delete(peerIdToDatastoreKey(et))}async load(et){const tt=await this.datastore.get(peerIdToDatastoreKey(et));return bytesToPeer(et,tt)}async save(et,tt){const{existingBuf:nt,existingPeer:rt}=await gn(this,er,es).call(this,et),ot=await toPeerPB(et,tt,"patch",{addressFilter:this.addressFilter});return gn(this,er,ts).call(this,et,ot,nt,rt)}async patch(et,tt){const{existingBuf:nt,existingPeer:rt}=await gn(this,er,es).call(this,et),ot=await toPeerPB(et,tt,"patch",{addressFilter:this.addressFilter,existingPeer:rt});return gn(this,er,ts).call(this,et,ot,nt,rt)}async merge(et,tt){const{existingBuf:nt,existingPeer:rt}=await gn(this,er,es).call(this,et),ot=await toPeerPB(et,tt,"merge",{addressFilter:this.addressFilter,existingPeer:rt});return gn(this,er,ts).call(this,et,ot,nt,rt)}async*all(et){for await(const{key:tt,value:nt}of this.datastore.query(mapQuery(et??{}))){const rt=decodePeer(tt,nt);rt.id.equals(this.peerId)||(yield rt)}}}er=new WeakSet,es=async function(et){try{const tt=await this.datastore.get(peerIdToDatastoreKey(et)),nt=bytesToPeer(et,tt);return{existingBuf:tt,existingPeer:nt}}catch(tt){if(tt.name!=="NotFoundError")throw tt}return{}},ts=async function(et,tt,nt,rt){const ot=Peer.encode(tt);return nt!=null&&equals(ot,nt)?{peer:bytesToPeer(et,ot),previous:rt,updated:!1}:(await this.datastore.put(peerIdToDatastoreKey(et),ot),{peer:bytesToPeer(et,ot),previous:rt,updated:!0})};var Nl,eo,ns;Nl=Symbol.toStringTag;class PersistentPeerStore{constructor(et,tt={}){fn(this,eo);Ct(this,"store");Ct(this,"events");Ct(this,"peerId");Ct(this,"log");Ct(this,Nl,"@libp2p/peer-store");this.log=et.logger.forComponent("libp2p:peer-store"),this.events=et.events,this.peerId=et.peerId,this.store=new PersistentStore(et,tt)}async forEach(et,tt){this.log.trace("forEach await read lock");const nt=await this.store.lock.readLock();this.log.trace("forEach got read lock");try{for await(const rt of this.store.all(tt))et(rt)}finally{this.log.trace("forEach release read lock"),nt()}}async all(et){this.log.trace("all await read lock");const tt=await this.store.lock.readLock();this.log.trace("all got read lock");try{return await all$2(this.store.all(et))}finally{this.log.trace("all release read lock"),tt()}}async delete(et){this.log.trace("delete await write lock");const tt=await this.store.lock.writeLock();this.log.trace("delete got write lock");try{await this.store.delete(et)}finally{this.log.trace("delete release write lock"),tt()}}async has(et){this.log.trace("has await read lock");const tt=await this.store.lock.readLock();this.log.trace("has got read lock");try{return await this.store.has(et)}finally{this.log.trace("has release read lock"),tt()}}async get(et){this.log.trace("get await read lock");const tt=await this.store.lock.readLock();this.log.trace("get got read lock");try{return await this.store.load(et)}finally{this.log.trace("get release read lock"),tt()}}async save(et,tt){this.log.trace("save await write lock");const nt=await this.store.lock.writeLock();this.log.trace("save got write lock");try{const rt=await this.store.save(et,tt);return gn(this,eo,ns).call(this,et,rt),rt.peer}finally{this.log.trace("save release write lock"),nt()}}async patch(et,tt){this.log.trace("patch await write lock");const nt=await this.store.lock.writeLock();this.log.trace("patch got write lock");try{const rt=await this.store.patch(et,tt);return gn(this,eo,ns).call(this,et,rt),rt.peer}finally{this.log.trace("patch release write lock"),nt()}}async merge(et,tt){this.log.trace("merge await write lock");const nt=await this.store.lock.writeLock();this.log.trace("merge got write lock");try{const rt=await this.store.merge(et,tt);return gn(this,eo,ns).call(this,et,rt),rt.peer}finally{this.log.trace("merge release write lock"),nt()}}async consumePeerRecord(et,tt){const nt=await RecordEnvelope.openAndCertify(et,PeerRecord.DOMAIN),rt=peerIdFromCID(nt.publicKey.toCID());if((tt==null?void 0:tt.equals(rt))===!1)return this.log("envelope peer id was not the expected peer id - expected: %p received: %p",tt,rt),!1;const ot=PeerRecord.createFromProtobuf(nt.payload);let it;try{it=await this.get(rt)}catch(st){if(st.name!=="NotFoundError")throw st}if((it==null?void 0:it.peerRecordEnvelope)!=null){const st=await RecordEnvelope.createFromProtobuf(it.peerRecordEnvelope),at=PeerRecord.createFromProtobuf(st.payload);if(at.seqNumber>=ot.seqNumber)return this.log("sequence number was lower or equal to existing sequence number - stored: %d received: %d",at.seqNumber,ot.seqNumber),!1}return await this.patch(ot.peerId,{peerRecordEnvelope:et,addresses:ot.multiaddrs.map(st=>({isCertified:!0,multiaddr:st}))}),!0}}eo=new WeakSet,ns=function(et,tt){tt.updated&&(this.peerId.equals(et)?this.events.safeDispatchEvent("self:peer:update",{detail:tt}):this.events.safeDispatchEvent("peer:update",{detail:tt}))};function persistentPeerStore(o,et={}){return new PersistentPeerStore(o,et)}const $r=class $r extends Error{constructor(tt="Not Found"){super(tt);Ct(this,"name",$r.name);Ct(this,"code",$r.code)}};Ct($r,"name","NotFoundError"),Ct($r,"code","ERR_NOT_FOUND");let NotFoundError=$r;function peekable(o){const[et,tt]=o[Symbol.asyncIterator]!=null?[o[Symbol.asyncIterator](),Symbol.asyncIterator]:[o[Symbol.iterator](),Symbol.iterator],nt=[];return{peek:()=>et.next(),push:rt=>{nt.push(rt)},next:()=>nt.length>0?{done:!1,value:nt.shift()}:et.next(),[tt](){return this}}}function isAsyncIterable$2(o){return o[Symbol.asyncIterator]!=null}function filter(o,et){let tt=0;if(isAsyncIterable$2(o))return async function*(){for await(const at of o)await et(at,tt++)&&(yield at)}();const nt=peekable(o),{value:rt,done:ot}=nt.next();if(ot===!0)return function*(){}();const it=et(rt,tt++);if(typeof it.then=="function")return async function*(){await it&&(yield rt);for await(const at of nt)await et(at,tt++)&&(yield at)}();const st=et;return function*(){it===!0&&(yield rt);for(const at of nt)st(at,tt++)&&(yield at)}()}function isAsyncIterable$1(o){return o[Symbol.asyncIterator]!=null}function sort(o,et){return isAsyncIterable$1(o)?async function*(){yield*(await all$2(o)).sort(et)}():function*(){yield*all$2(o).sort(et)}()}function isAsyncIterable(o){return o[Symbol.asyncIterator]!=null}function take(o,et){return isAsyncIterable(o)?async function*(){let tt=0;if(!(et<1)){for await(const nt of o)if(yield nt,tt++,tt===et)return}}():function*(){let tt=0;if(!(et<1)){for(const nt of o)if(yield nt,tt++,tt===et)return}}()}class BaseDatastore{put(et,tt,nt){return Promise.reject(new Error(".put is not implemented"))}get(et,tt){return Promise.reject(new Error(".get is not implemented"))}has(et,tt){return Promise.reject(new Error(".has is not implemented"))}delete(et,tt){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(et,tt={}){for await(const{key:nt,value:rt}of et)await this.put(nt,rt,tt),yield nt}async*getMany(et,tt={}){for await(const nt of et)yield{key:nt,value:await this.get(nt,tt)}}async*deleteMany(et,tt={}){for await(const nt of et)await this.delete(nt,tt),yield nt}batch(){let et=[],tt=[];return{put(nt,rt){et.push({key:nt,value:rt})},delete(nt){tt.push(nt)},commit:async nt=>{await drain(this.putMany(et,nt)),et=[],await drain(this.deleteMany(tt,nt)),tt=[]}}}async*_all(et,tt){throw new Error("._all is not implemented")}async*_allKeys(et,tt){throw new Error("._allKeys is not implemented")}query(et,tt){let nt=this._all(et,tt);if(et.prefix!=null){const rt=et.prefix;nt=filter(nt,ot=>ot.key.toString().startsWith(rt))}if(Array.isArray(et.filters)&&(nt=et.filters.reduce((rt,ot)=>filter(rt,ot),nt)),Array.isArray(et.orders)&&(nt=et.orders.reduce((rt,ot)=>sort(rt,ot),nt)),et.offset!=null){let rt=0;const ot=et.offset;nt=filter(nt,()=>rt++>=ot)}return et.limit!=null&&(nt=take(nt,et.limit)),nt}queryKeys(et,tt){let nt=this._allKeys(et,tt);if(et.prefix!=null){const rt=et.prefix;nt=filter(nt,ot=>ot.toString().startsWith(rt))}if(Array.isArray(et.filters)&&(nt=et.filters.reduce((rt,ot)=>filter(rt,ot),nt)),Array.isArray(et.orders)&&(nt=et.orders.reduce((rt,ot)=>sort(rt,ot),nt)),et.offset!=null){const rt=et.offset;let ot=0;nt=filter(nt,()=>ot++>=rt)}return et.limit!=null&&(nt=take(nt,et.limit)),nt}}class MemoryDatastore extends BaseDatastore{constructor(){super();Ct(this,"data");this.data=new Map}put(tt,nt){return this.data.set(tt.toString(),nt),tt}get(tt){const nt=this.data.get(tt.toString());if(nt==null)throw new NotFoundError;return nt}has(tt){return this.data.has(tt.toString())}delete(tt){this.data.delete(tt.toString())}*_all(){for(const[tt,nt]of this.data.entries())yield{key:new Key(tt),value:nt}}*_allKeys(){for(const tt of this.data.keys())yield new Key(tt)}}function debounce(o,et){let tt;return function(){const nt=function(){tt=void 0,o()};clearTimeout(tt),tt=setTimeout(nt,et)}}const defaultAddressFilter=o=>o;function stripPeerId(o,et){const tt=o.getPeerId();return tt!=null&&peerIdFromString$1(tt).equals(et)&&(o=o.decapsulate(multiaddr(`/p2p/${et.toString()}`))),o}var $l;$l=Symbol.toStringTag;class DefaultAddressManager{constructor(et,tt={}){Ct(this,"log");Ct(this,"components");Ct(this,"listen");Ct(this,"announce");Ct(this,"observed");Ct(this,"announceFilter");Ct(this,$l,"@libp2p/address-manager");const{listen:nt=[],announce:rt=[]}=tt;this.components=et,this.log=et.logger.forComponent("libp2p:address-manager"),this.listen=nt.map(ot=>ot.toString()),this.announce=new Set(rt.map(ot=>ot.toString())),this.observed=new Map,this.announceFilter=tt.announceFilter??defaultAddressFilter,this._updatePeerStoreAddresses=debounce(this._updatePeerStoreAddresses.bind(this),1e3),et.events.addEventListener("transport:listening",()=>{this._updatePeerStoreAddresses()}),et.events.addEventListener("transport:close",()=>{this._updatePeerStoreAddresses()})}_updatePeerStoreAddresses(){const et=this.getAnnounceAddrs().concat(this.components.transportManager.getAddrs()).concat([...this.observed.entries()].filter(([tt,nt])=>nt.confident).map(([tt])=>multiaddr(tt))).map(tt=>tt.getPeerId()===this.components.peerId.toString()?tt.decapsulate(`/p2p/${this.components.peerId.toString()}`):tt);this.components.peerStore.patch(this.components.peerId,{multiaddrs:et}).catch(tt=>{this.log.error("error updating addresses",tt)})}getListenAddrs(){return Array.from(this.listen).map(et=>multiaddr(et))}getAnnounceAddrs(){return Array.from(this.announce).map(et=>multiaddr(et))}getObservedAddrs(){return Array.from(this.observed).map(([et])=>multiaddr(et))}addObservedAddr(et){et=stripPeerId(et,this.components.peerId);const tt=et.toString();this.observed.has(tt)||this.observed.set(tt,{confident:!1})}confirmObservedAddr(et){et=stripPeerId(et,this.components.peerId);const tt=et.toString(),rt=(this.observed.get(tt)??{confident:!1}).confident;this.observed.set(tt,{confident:!0}),rt||this._updatePeerStoreAddresses()}removeObservedAddr(et){et=stripPeerId(et,this.components.peerId);const tt=et.toString();this.observed.delete(tt)}getAddresses(){let et=this.getAnnounceAddrs().map(nt=>nt.toString());et.length===0&&(et=this.components.transportManager.getAddrs().map(nt=>nt.toString())),et=et.concat(Array.from(this.observed).filter(([nt,rt])=>rt.confident).map(([nt])=>nt));const tt=new Set(et);return this.announceFilter(Array.from(tt).map(nt=>multiaddr(nt))).map(nt=>{var rt;return((rt=nt.protos().pop())==null?void 0:rt.path)===!0||nt.getPeerId()===this.components.peerId.toString()?nt:nt.encapsulate(`/p2p/${this.components.peerId.toString()}`)})}}var messages;(function(o){o.NOT_STARTED_YET="The libp2p node is not started yet",o.NOT_FOUND="Not found"})(messages||(messages={}));class MissingServiceError extends Error{constructor(et="Missing service"){super(et),this.name="MissingServiceError"}}class UnmetServiceDependenciesError extends Error{constructor(et="Unmet service dependencies"){super(et),this.name="UnmetServiceDependenciesError"}}class NoContentRoutersError extends Error{constructor(et="No content routers available"){super(et),this.name="NoContentRoutersError"}}class NoPeerRoutersError extends Error{constructor(et="No peer routers available"){super(et),this.name="NoPeerRoutersError"}}class QueriedForSelfError extends Error{constructor(et="Should not try to find self"){super(et),this.name="QueriedForSelfError"}}class UnhandledProtocolError extends Error{constructor(et="Unhandled protocol error"){super(et),this.name="UnhandledProtocolError"}}class DuplicateProtocolHandlerError extends Error{constructor(et="Duplicate protocol handler error"){super(et),this.name="DuplicateProtocolHandlerError"}}class DialDeniedError extends Error{constructor(et="Dial denied error"){super(et),this.name="DialDeniedError"}}class NoValidAddressesError extends Error{constructor(et="No valid addresses"){super(et),this.name="NoValidAddressesError"}}class ConnectionInterceptedError extends Error{constructor(et="Connection intercepted"){super(et),this.name="ConnectionInterceptedError"}}class ConnectionDeniedError extends Error{constructor(et="Connection denied"){super(et),this.name="ConnectionDeniedError"}}class MuxerUnavailableError extends Error{constructor(et="Stream is not multiplexed"){super(et),this.name="MuxerUnavailableError"}}class EncryptionFailedError extends Error{constructor(et="Encryption failed"){super(et),this.name="EncryptionFailedError"}}class TransportUnavailableError extends Error{constructor(et="Transport unavailable"){super(et),this.name="TransportUnavailableError"}}class DefaultComponents{constructor(et={}){Ct(this,"components",{});Ct(this,"_started",!1);this.components={};for(const[tt,nt]of Object.entries(et))this.components[tt]=nt;this.components.logger==null&&(this.components.logger=defaultLogger())}isStarted(){return this._started}async _invokeStartableMethod(et){await Promise.all(Object.values(this.components).filter(tt=>isStartable(tt)).map(async tt=>{var nt;await((nt=tt[et])==null?void 0:nt.call(tt))}))}async beforeStart(){await this._invokeStartableMethod("beforeStart")}async start(){await this._invokeStartableMethod("start"),this._started=!0}async afterStart(){await this._invokeStartableMethod("afterStart")}async beforeStop(){await this._invokeStartableMethod("beforeStop")}async stop(){await this._invokeStartableMethod("stop"),this._started=!1}async afterStop(){await this._invokeStartableMethod("afterStop")}}const OPTIONAL_SERVICES=["metrics","connectionProtector","dns"],NON_SERVICE_PROPERTIES=["components","isStarted","beforeStart","start","afterStart","beforeStop","stop","afterStop","then","_invokeStartableMethod"];function defaultComponents(o={}){const et=new DefaultComponents(o);return new Proxy(et,{get(nt,rt,ot){if(typeof rt=="string"&&!NON_SERVICE_PROPERTIES.includes(rt)){const it=et.components[rt];if(it==null&&!OPTIONAL_SERVICES.includes(rt))throw new MissingServiceError(`${rt} not set`);return it}return Reflect.get(nt,rt,ot)},set(nt,rt,ot){return typeof rt=="string"?et.components[rt]=ot:Reflect.set(nt,rt,ot),!0}})}function checkServiceDependencies(o){const et={};for(const tt of Object.values(o.components))for(const nt of getServiceCapabilities(tt))et[nt]=!0;for(const tt of Object.values(o.components))for(const nt of getServiceDependencies(tt))if(et[nt]!==!0)throw new UnmetServiceDependenciesError(`Service "${getServiceName(tt)}" required capability "${nt}" but it was not provided by any component, you may need to add additional configuration when creating your node.`)}function getServiceCapabilities(o){return Array.isArray(o==null?void 0:o[serviceCapabilities])?o[serviceCapabilities]:[]}function getServiceDependencies(o){return Array.isArray(o==null?void 0:o[serviceDependencies])?o[serviceDependencies]:[]}function getServiceName(o){return(o==null?void 0:o[Symbol.toStringTag])??(o==null?void 0:o.toString())??"unknown"}function connectionGater(o={}){return{denyDialPeer:async()=>!1,denyDialMultiaddr:async et=>{const tt=et.stringTuples();return tt[0][0]===4||tt[0][0]===41?!!isPrivateIp(`${tt[0][1]}`):!1},denyInboundConnection:async()=>!1,denyOutboundConnection:async()=>!1,denyInboundEncryptedConnection:async()=>!1,denyOutboundEncryptedConnection:async()=>!1,denyInboundUpgradedConnection:async()=>!1,denyOutboundUpgradedConnection:async()=>!1,filterMultiaddrForPeer:async()=>!0,...o}}function getPeerAddress(o){if(isPeerId$1(o))return{peerId:o,multiaddrs:[]};Array.isArray(o)||(o=[o]);let et;if(o.length>0){const tt=o[0].getPeerId();et=tt==null?void 0:peerIdFromString$1(tt),o.forEach(nt=>{if(!isMultiaddr(nt))throw new InvalidMultiaddrError("Invalid multiaddr");const rt=nt.getPeerId();if(rt==null){if(et!=null)throw new InvalidParametersError$1("Multiaddrs must all have the same peer id or have no peer id")}else{const ot=peerIdFromString$1(rt);if((et==null?void 0:et.equals(ot))!==!0)throw new InvalidParametersError$1("Multiaddrs must all have the same peer id or have no peer id")}})}return{peerId:et,multiaddrs:o}}const DEFAULT_CLOSABLE_PROTOCOLS=["/ipfs/id/1.0.0","/ipfs/id/push/1.0.0","/libp2p/autonat/1.0.0","/libp2p/dcutr"];async function safelyCloseConnectionIfUnused(o,et){var rt;const tt=((rt=o==null?void 0:o.streams)==null?void 0:rt.map(ot=>ot.protocol))??[],nt=(et==null?void 0:et.closableProtocols)??DEFAULT_CLOSABLE_PROTOCOLS;if(!(tt.filter(ot=>ot!=null&&!nt.includes(ot)).length>0))try{await(o==null?void 0:o.close(et))}catch(ot){o==null||o.abort(ot)}}const DIAL_TIMEOUT=5e3,UPGRADE_TIMEOUT=3e3,PROTOCOL_NEGOTIATION_TIMEOUT=2e3,MAX_PEER_ADDRS_TO_DIAL=25,INBOUND_CONNECTION_THRESHOLD=5,MAX_INCOMING_PENDING_CONNECTIONS=10,MAX_PARALLEL_RECONNECTS=5,LAST_DIAL_FAILURE_KEY="last-dial-failure",LAST_DIAL_SUCCESS_KEY="last-dial-success",MAX_DIAL_QUEUE_LENGTH=500,MAX_CONNECTIONS=100,MAX_PARALLEL_DIALS=50,defaultOptions$2={maxConnections:MAX_CONNECTIONS,allow:[]};class ConnectionPruner{constructor(et,tt={}){Ct(this,"maxConnections");Ct(this,"connectionManager");Ct(this,"peerStore");Ct(this,"allow");Ct(this,"events");Ct(this,"log");this.maxConnections=tt.maxConnections??defaultOptions$2.maxConnections,this.allow=tt.allow??defaultOptions$2.allow,this.connectionManager=et.connectionManager,this.peerStore=et.peerStore,this.events=et.events,this.log=et.logger.forComponent("libp2p:connection-manager:connection-pruner"),this.maybePruneConnections=this.maybePruneConnections.bind(this)}start(){this.events.addEventListener("connection:open",this.maybePruneConnections)}stop(){this.events.removeEventListener("connection:open",this.maybePruneConnections)}maybePruneConnections(){this._maybePruneConnections().catch(et=>{this.log.error("error while pruning connections %e",et)})}async _maybePruneConnections(){const et=this.connectionManager.getConnections(),tt=et.length;if(this.log("checking max connections limit %d/%d",tt,this.maxConnections),tt<=this.maxConnections)return;const nt=new PeerMap;for(const st of et){const at=st.remotePeer;if(!nt.has(at)){nt.set(at,0);try{const ct=await this.peerStore.get(at);nt.set(at,[...ct.tags.values()].reduce((lt,dt)=>lt+dt.value,0))}catch(ct){ct.name!=="NotFoundError"&&this.log.error("error loading peer tags",ct)}}}const rt=this.sortConnections(et,nt),ot=Math.max(tt-this.maxConnections,0),it=[];for(const st of rt)if(this.log("too many connections open - closing a connection to %p",st.remotePeer),this.allow.some(ct=>st.remoteAddr.toString().startsWith(ct.toString()))||it.push(st),it.length===ot)break;await Promise.all(it.map(async st=>{await safelyCloseConnectionIfUnused(st,{signal:AbortSignal.timeout(1e3)})})),this.events.safeDispatchEvent("connection:prune",{detail:it})}sortConnections(et,tt){return et.sort((nt,rt)=>{const ot=nt.timeline.open,it=rt.timeline.open;return otit?-1:0}).sort((nt,rt)=>nt.direction==="outbound"&&rt.direction==="inbound"?1:nt.direction==="inbound"&&rt.direction==="outbound"?-1:0).sort((nt,rt)=>nt.streams.length>rt.streams.length?1:nt.streams.length{const ot=tt.get(nt.remotePeer)??0,it=tt.get(rt.remotePeer)??0;return ot>it?1:ot{function st(){tt==null||tt.removeEventListener("abort",lt),o.removeEventListener(et,at),(nt==null?void 0:nt.errorEvent)!=null&&o.removeEventListener(nt.errorEvent,ct)}const at=dt=>{var ht;try{if(((ht=nt==null?void 0:nt.filter)==null?void 0:ht.call(nt,dt))===!1)return}catch(pt){st(),it(pt);return}st(),ot(dt)},ct=dt=>{st(),it(dt.detail)},lt=()=>{st(),it(rt)};tt==null||tt.addEventListener("abort",lt),o.addEventListener(et,at),(nt==null?void 0:nt.errorEvent)!=null&&o.addEventListener(nt.errorEvent,ct)})}class JobRecipient{constructor(et){Ct(this,"deferred");Ct(this,"signal");var tt;this.signal=et,this.deferred=pDefer(),this.onAbort=this.onAbort.bind(this),(tt=this.signal)==null||tt.addEventListener("abort",this.onAbort)}onAbort(){var et;this.deferred.reject(((et=this.signal)==null?void 0:et.reason)??new AbortError$6)}cleanup(){var et;(et=this.signal)==null||et.removeEventListener("abort",this.onAbort)}}function randomId(){return`${parseInt(String(Math.random()*1e9),10).toString()}${Date.now()}`}class Job{constructor(et,tt){Ct(this,"id");Ct(this,"fn");Ct(this,"options");Ct(this,"recipients");Ct(this,"status");Ct(this,"timeline");Ct(this,"controller");this.id=randomId(),this.status="queued",this.fn=et,this.options=tt,this.recipients=[],this.timeline={created:Date.now()},this.controller=new AbortController,setMaxListeners$2(1/0,this.controller.signal),this.onAbort=this.onAbort.bind(this)}abort(et){this.controller.abort(et)}onAbort(){this.recipients.reduce((tt,nt)=>{var rt;return tt&&((rt=nt.signal)==null?void 0:rt.aborted)===!0},!0)&&(this.controller.abort(new AbortError$6),this.cleanup())}async join(et={}){var nt;const tt=new JobRecipient(et.signal);return this.recipients.push(tt),(nt=et.signal)==null||nt.addEventListener("abort",this.onAbort),tt.deferred.promise}async run(){this.status="running",this.timeline.started=Date.now();try{this.controller.signal.throwIfAborted();const et=await raceSignal(this.fn({...this.options??{},signal:this.controller.signal}),this.controller.signal);this.recipients.forEach(tt=>{tt.deferred.resolve(et)}),this.status="complete"}catch(et){this.recipients.forEach(tt=>{tt.deferred.reject(et)}),this.status="errored"}finally{this.timeline.finished=Date.now(),this.cleanup()}}cleanup(){this.recipients.forEach(et=>{var tt;et.cleanup(),(tt=et.signal)==null||tt.removeEventListener("abort",this.onAbort)})}}class Queue extends TypedEventEmitter$1{constructor(tt={}){var nt;super();Ct(this,"concurrency");Ct(this,"maxSize");Ct(this,"queue");Ct(this,"pending");Ct(this,"sort");this.concurrency=tt.concurrency??Number.POSITIVE_INFINITY,this.maxSize=tt.maxSize??Number.POSITIVE_INFINITY,this.pending=0,tt.metricName!=null&&((nt=tt.metrics)==null||nt.registerMetricGroup(tt.metricName,{calculate:()=>({size:this.queue.length,running:this.pending,queued:this.queue.length-this.pending})})),this.sort=tt.sort,this.queue=[]}tryToStartAnother(){if(this.size===0)return queueMicrotask(()=>{this.safeDispatchEvent("empty")}),this.running===0&&queueMicrotask(()=>{this.safeDispatchEvent("idle")}),!1;if(this.pending{for(let nt=0;nt(this.safeDispatchEvent("completed",{detail:it}),this.safeDispatchEvent("success",{detail:{job:rt,result:it}}),it)).catch(it=>{if(rt.status==="queued"){for(let st=0;st{tt.abort(new AbortError$6)}),this.clear()}async onEmpty(tt){this.size!==0&&await raceEvent(this,"empty",tt==null?void 0:tt.signal)}async onSizeLessThan(tt,nt){this.sizethis.size{ht!=null?this.abort():this.clear(),nt.end(ht)},ot=ht=>{ht.detail!=null&&nt.push(ht.detail)},it=ht=>{rt(ht.detail)},st=()=>{rt()},at=()=>{rt(new AbortError$6("Queue aborted"))};this.addEventListener("completed",ot),this.addEventListener("error",it),this.addEventListener("idle",st),(lt=tt==null?void 0:tt.signal)==null||lt.addEventListener("abort",at);try{yield*nt}finally{this.removeEventListener("completed",ot),this.removeEventListener("error",it),this.removeEventListener("idle",st),(dt=tt==null?void 0:tt.signal)==null||dt.removeEventListener("abort",at),rt()}}}class PriorityQueue extends Queue{constructor(et={}){super({...et,sort:(tt,nt)=>tt.options.priority>nt.options.priority?-1:tt.options.priorityrt.toString())),nt}const defaultOptions$1={maxParallelDials:MAX_PARALLEL_DIALS,maxDialQueueLength:MAX_DIAL_QUEUE_LENGTH,maxPeerAddrsToDial:MAX_PEER_ADDRS_TO_DIAL,dialTimeout:DIAL_TIMEOUT,resolvers:{dnsaddr:dnsaddrResolver}};class DialQueue{constructor(et,tt={}){Ct(this,"queue");Ct(this,"components");Ct(this,"addressSorter");Ct(this,"maxPeerAddrsToDial");Ct(this,"maxDialQueueLength");Ct(this,"dialTimeout");Ct(this,"shutDownController");Ct(this,"connections");Ct(this,"log");this.addressSorter=tt.addressSorter,this.maxPeerAddrsToDial=tt.maxPeerAddrsToDial??defaultOptions$1.maxPeerAddrsToDial,this.maxDialQueueLength=tt.maxDialQueueLength??defaultOptions$1.maxDialQueueLength,this.dialTimeout=tt.dialTimeout??defaultOptions$1.dialTimeout,this.connections=tt.connections??new PeerMap,this.log=et.logger.forComponent("libp2p:connection-manager:dial-queue"),this.components=et,this.shutDownController=new AbortController,setMaxListeners(1/0,this.shutDownController.signal);for(const[nt,rt]of Object.entries(tt.resolvers??{}))resolvers$1.set(nt,rt);this.queue=new PriorityQueue({concurrency:tt.maxParallelDials??defaultOptions$1.maxParallelDials,metricName:"libp2p_dial_queue",metrics:et.metrics}),this.queue.addEventListener("error",nt=>{nt.detail.name!==AbortError$4.name&&this.log.error("error in dial queue - %e",nt.detail)})}start(){this.shutDownController=new AbortController,setMaxListeners(1/0,this.shutDownController.signal)}stop(){this.shutDownController.abort(),this.queue.abort()}async dial(et,tt={}){var st,at,ct;const{peerId:nt,multiaddrs:rt}=getPeerAddress(et),ot=Array.from(this.connections.values()).flat().find(lt=>tt.force===!0?!1:lt.remotePeer.equals(nt)?!0:rt.find(dt=>dt.equals(lt.remoteAddr)));if((ot==null?void 0:ot.status)==="open")return this.log("already connected to %a",ot.remoteAddr),(st=tt.onProgress)==null||st.call(tt,new CustomProgressEvent("dial-queue:already-connected")),ot;const it=this.queue.queue.find(lt=>{if((nt==null?void 0:nt.equals(lt.options.peerId))===!0)return!0;const dt=lt.options.multiaddrs;if(dt==null)return!1;for(const ht of rt)if(dt.has(ht.toString()))return!0;return!1});if(it!=null){this.log("joining existing dial target for %p",nt);for(const lt of rt)it.options.multiaddrs.add(lt.toString());return(at=tt.onProgress)==null||at.call(tt,new CustomProgressEvent("dial-queue:already-in-dial-queue")),it.join(tt)}if(this.queue.size>=this.maxDialQueueLength)throw new DialError("Dial queue is full");return this.log("creating dial target for %p",nt,rt.map(lt=>lt.toString())),(ct=tt.onProgress)==null||ct.call(tt,new CustomProgressEvent("dial-queue:add-to-dial-queue")),this.queue.add(async lt=>{var pt,mt;(pt=lt==null?void 0:lt.onProgress)==null||pt.call(lt,new CustomProgressEvent("dial-queue:start-dial"));const dt=this.createDialAbortController(lt==null?void 0:lt.signal);let ht;try{ht=await this.calculateMultiaddrs(nt,lt==null?void 0:lt.multiaddrs,{...lt,signal:dt}),(mt=lt==null?void 0:lt.onProgress)==null||mt.call(lt,new CustomProgressEvent("dial-queue:calculated-addresses",ht)),ht.map(({multiaddr:ft})=>ft.toString()).forEach(ft=>{lt==null||lt.multiaddrs.add(ft)})}catch(ft){throw dt.clear(),ft}try{let ft=0;const yt=[];for(const gt of ht){if(ft===this.maxPeerAddrsToDial)throw this.log("dialed maxPeerAddrsToDial (%d) addresses for %p, not trying any others",ft,nt),new DialError("Peer had more than maxPeerAddrsToDial");ft++;try{const xt=await this.components.transportManager.dial(gt.multiaddr,{...lt,signal:dt});this.log("dial to %a succeeded",gt.multiaddr);try{await this.components.peerStore.merge(xt.remotePeer,{multiaddrs:[xt.remoteAddr],metadata:{[LAST_DIAL_SUCCESS_KEY]:fromString(Date.now().toString())}})}catch(vt){this.log.error("could not update last dial failure key for %p",nt,vt)}return xt}catch(xt){if(this.log.error("dial failed to %a",gt.multiaddr,xt),nt!=null)try{await this.components.peerStore.merge(nt,{metadata:{[LAST_DIAL_FAILURE_KEY]:fromString(Date.now().toString())}})}catch(vt){this.log.error("could not update last dial failure key for %p",nt,vt)}if(dt.aborted)throw new TimeoutError$2(xt.message);yt.push(xt)}}throw yt.length===1?yt[0]:new AggregateError(yt,"All multiaddr dials failed")}finally{dt.clear()}},{peerId:nt,priority:tt.priority??DEFAULT_DIAL_PRIORITY,multiaddrs:new Set(rt.map(lt=>lt.toString())),signal:tt.signal,onProgress:tt.onProgress})}createDialAbortController(et){const tt=anySignal([AbortSignal.timeout(this.dialTimeout),this.shutDownController.signal,et]);return setMaxListeners(1/0,tt),tt}async calculateMultiaddrs(et,tt=new Set,nt={}){var dt,ht;const rt=[...tt].map(pt=>({multiaddr:multiaddr(pt),isCertified:!1}));if(et!=null){if(this.components.peerId.equals(et))throw new DialError("Tried to dial self");if(await((ht=(dt=this.components.connectionGater).denyDialPeer)==null?void 0:ht.call(dt,et))===!0)throw new DialDeniedError("The dial request is blocked by gater.allowDialPeer");if(rt.length===0){this.log("loading multiaddrs for %p",et);try{const pt=await this.components.peerStore.get(et);rt.push(...pt.addresses),this.log("loaded multiaddrs for %p",et,rt.map(({multiaddr:mt})=>mt.toString()))}catch(pt){if(pt.name!=="NotFoundError")throw pt}}if(rt.length===0){this.log("looking up multiaddrs for %p in the peer routing",et);try{const pt=await this.components.peerRouting.findPeer(et);this.log("found multiaddrs for %p in the peer routing",et,rt.map(({multiaddr:mt})=>mt.toString())),rt.push(...pt.multiaddrs.map(mt=>({multiaddr:mt,isCertified:!1})))}catch(pt){pt.name!=="NoPeerRoutersError"&&this.log.error("looking up multiaddrs for %p in the peer routing failed",et,pt)}}}let ot=(await Promise.all(rt.map(async pt=>{const mt=await resolveMultiaddrs(pt.multiaddr,{dns:this.components.dns,...nt,log:this.log});return mt.length===1&&mt[0].equals(pt.multiaddr)?pt:mt.map(ft=>({multiaddr:ft,isCertified:!1}))}))).flat();if(et!=null){const pt=`/p2p/${et.toString()}`;ot=ot.map(mt=>{const ft=mt.multiaddr.protos().pop();return(ft==null?void 0:ft.path)===!0?mt:mt.multiaddr.getPeerId()==null?{multiaddr:mt.multiaddr.encapsulate(pt),isCertified:mt.isCertified}:mt})}const it=ot.filter(pt=>{if(this.components.transportManager.dialTransportForMultiaddr(pt.multiaddr)==null)return!1;const mt=pt.multiaddr.getPeerId();return et!=null&&mt!=null?et.equals(mt):!0}),st=new Map;for(const pt of it){const mt=pt.multiaddr.toString(),ft=st.get(mt);if(ft!=null){ft.isCertified=ft.isCertified||pt.isCertified||!1;continue}st.set(mt,pt)}const at=[...st.values()];if(at.length===0)throw new NoValidAddressesError("The dial request has no valid addresses");const ct=[];for(const pt of at)this.components.connectionGater.denyDialMultiaddr!=null&&await this.components.connectionGater.denyDialMultiaddr(pt.multiaddr)||ct.push(pt);const lt=this.addressSorter==null?defaultAddressSorter(ct):ct.sort(this.addressSorter);if(lt.length===0)throw new DialDeniedError("The connection gater denied all addresses in the dial request");return this.log.trace("addresses for %p before filtering",et??"unknown peer",ot.map(({multiaddr:pt})=>pt.toString())),this.log.trace("addresses for %p after filtering",et??"unknown peer",lt.map(({multiaddr:pt})=>pt.toString())),lt}async isDialable(et,tt={}){Array.isArray(et)||(et=[et]);try{const nt=await this.calculateMultiaddrs(void 0,new Set(et.map(rt=>rt.toString())),tt);return tt.runOnLimitedConnection===!1?nt.find(rt=>!Circuit.matches(rt.multiaddr))!=null:!0}catch(nt){this.log.trace("error calculating if multiaddr(s) were dialable",nt)}return!1}}class PeerQueue extends Queue{has(et){return this.find(et)!=null}find(et){return this.queue.find(tt=>et.equals(tt.options.peerId))}}var retry$2={};function RetryOperation(o,et){typeof et=="boolean"&&(et={forever:et}),this._originalTimeouts=JSON.parse(JSON.stringify(o)),this._timeouts=o,this._options=et||{},this._maxRetryTime=et&&et.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var retry_operation=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(o){if(this._timeout&&clearTimeout(this._timeout),!o)return!1;var et=new Date().getTime();if(o&&et-this._operationStart>=this._maxRetryTime)return this._errors.push(o),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(o);var tt=this._timeouts.shift();if(tt===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),tt=this._cachedTimeouts.slice(-1);else return!1;var nt=this;return this._timer=setTimeout(function(){nt._attempts++,nt._operationTimeoutCb&&(nt._timeout=setTimeout(function(){nt._operationTimeoutCb(nt._attempts)},nt._operationTimeout),nt._options.unref&&nt._timeout.unref()),nt._fn(nt._attempts)},tt),this._options.unref&&this._timer.unref(),!0};RetryOperation.prototype.attempt=function(o,et){this._fn=o,et&&(et.timeout&&(this._operationTimeout=et.timeout),et.cb&&(this._operationTimeoutCb=et.cb));var tt=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){tt._operationTimeoutCb()},tt._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(o){console.log("Using RetryOperation.try() is deprecated"),this.attempt(o)};RetryOperation.prototype.start=function(o){console.log("Using RetryOperation.start() is deprecated"),this.attempt(o)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var o={},et=null,tt=0,nt=0;nt=tt&&(et=rt,tt=it)}return et};(function(o){var et=retry_operation;o.operation=function(tt){var nt=o.timeouts(tt);return new et(nt,{forever:tt&&(tt.forever||tt.retries===1/0),unref:tt&&tt.unref,maxRetryTime:tt&&tt.maxRetryTime})},o.timeouts=function(tt){if(tt instanceof Array)return[].concat(tt);var nt={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var rt in tt)nt[rt]=tt[rt];if(nt.minTimeout>nt.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var ot=[],it=0;itobjectToString.call(o)==="[object Error]",errorMessages=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function isNetworkError(o){return o&&isError(o)&&o.name==="TypeError"&&typeof o.message=="string"?o.message==="Load failed"?o.stack===void 0:errorMessages.has(o.message):!1}let AbortError$1=class extends Error{constructor(et){super(),et instanceof Error?(this.originalError=et,{message:et}=et):(this.originalError=new Error(et),this.originalError.stack=this.stack),this.name="AbortError",this.message=et}};const decorateErrorWithCounts=(o,et,tt)=>{const nt=tt.retries-(et-1);return o.attemptNumber=et,o.retriesLeft=nt,o};async function pRetry(o,et){return new Promise((tt,nt)=>{et={onFailedAttempt(){},retries:10,shouldRetry:()=>!0,...et};const rt=retry$1.operation(et),ot=()=>{var st;rt.stop(),nt((st=et.signal)==null?void 0:st.reason)};et.signal&&!et.signal.aborted&&et.signal.addEventListener("abort",ot,{once:!0});const it=()=>{var st;(st=et.signal)==null||st.removeEventListener("abort",ot),rt.stop()};rt.attempt(async st=>{try{const at=await o(st);it(),tt(at)}catch(at){try{if(!(at instanceof Error))throw new TypeError(`Non-error was thrown: "${at}". You should only throw errors.`);if(at instanceof AbortError$1)throw at.originalError;if(at instanceof TypeError&&!isNetworkError(at))throw at;if(decorateErrorWithCounts(at,st,et),await et.shouldRetry(at)||(rt.stop(),nt(at)),await et.onFailedAttempt(at),!rt.retry(at))throw rt.mainError()}catch(ct){decorateErrorWithCounts(ct,st,et),it(),nt(ct)}}})})}class ReconnectQueue{constructor(et,tt={}){Ct(this,"log");Ct(this,"queue");Ct(this,"started");Ct(this,"peerStore");Ct(this,"retries");Ct(this,"retryInterval");Ct(this,"backoffFactor");Ct(this,"connectionManager");Ct(this,"events");this.log=et.logger.forComponent("libp2p:reconnect-queue"),this.peerStore=et.peerStore,this.connectionManager=et.connectionManager,this.queue=new PeerQueue({concurrency:tt.maxParallelReconnects??MAX_PARALLEL_RECONNECTS,metricName:"libp2p_reconnect_queue",metrics:et.metrics}),this.started=!1,this.retries=tt.retries??5,this.backoffFactor=tt.backoffFactor,this.retryInterval=tt.retryInterval,this.events=et.events,et.events.addEventListener("peer:disconnect",nt=>{this.maybeReconnect(nt.detail).catch(rt=>{this.log.error("failed to maybe reconnect to %p - %e",nt.detail,rt)})})}async maybeReconnect(et){if(!this.started)return;const tt=await this.peerStore.get(et);hasKeepAliveTag(tt)&&(this.queue.has(et)||this.queue.add(async nt=>{await pRetry(async rt=>{if(this.started)try{await this.connectionManager.openConnection(et,{signal:nt==null?void 0:nt.signal})}catch(ot){throw this.log("reconnecting to %p attempt %d of %d failed - %e",et,rt,this.retries,ot),ot}},{signal:nt==null?void 0:nt.signal,retries:this.retries,factor:this.backoffFactor,minTimeout:this.retryInterval})},{peerId:et}).catch(async nt=>{this.log.error("failed to reconnect to %p - %e",et,nt);const rt={};[...tt.tags.keys()].forEach(ot=>{ot.startsWith(KEEP_ALIVE)&&(rt[ot]=void 0)}),await this.peerStore.merge(et,{tags:rt}),this.events.safeDispatchEvent("peer:reconnect-failure",{detail:et})}).catch(async nt=>{this.log.error("failed to remove keep-alive tag from %p - %e",et,nt)}))}start(){this.started=!0}async afterStart(){Promise.resolve().then(async()=>{const et=await this.peerStore.all({filters:[tt=>hasKeepAliveTag(tt)]});await Promise.all(et.map(async tt=>{await this.connectionManager.openConnection(tt.id).catch(nt=>{this.log.error(nt)})}))}).catch(et=>{this.log.error(et)})}stop(){this.started=!1,this.queue.abort()}}function hasKeepAliveTag(o){for(const et of o.tags.keys())if(et.startsWith(KEEP_ALIVE))return!0;return!1}const DEFAULT_DIAL_PRIORITY=50,defaultOptions={maxConnections:MAX_CONNECTIONS,inboundConnectionThreshold:INBOUND_CONNECTION_THRESHOLD,maxIncomingPendingConnections:MAX_INCOMING_PENDING_CONNECTIONS};var Ol;Ol=Symbol.toStringTag;class DefaultConnectionManager{constructor(et,tt={}){Ct(this,"started");Ct(this,"connections");Ct(this,"allow");Ct(this,"deny");Ct(this,"maxIncomingPendingConnections");Ct(this,"incomingPendingConnections");Ct(this,"outboundPendingConnections");Ct(this,"maxConnections");Ct(this,"dialQueue");Ct(this,"reconnectQueue");Ct(this,"connectionPruner");Ct(this,"inboundConnectionRateLimiter");Ct(this,"peerStore");Ct(this,"metrics");Ct(this,"events");Ct(this,"log");Ct(this,"peerId");Ct(this,Ol,"@libp2p/connection-manager");if(this.maxConnections=tt.maxConnections??defaultOptions.maxConnections,this.maxConnections<1)throw new InvalidParametersError$1("Connection Manager maxConnections must be greater than 0");this.connections=new PeerMap,this.started=!1,this.peerId=et.peerId,this.peerStore=et.peerStore,this.metrics=et.metrics,this.events=et.events,this.log=et.logger.forComponent("libp2p:connection-manager"),this.onConnect=this.onConnect.bind(this),this.onDisconnect=this.onDisconnect.bind(this),this.allow=(tt.allow??[]).map(nt=>multiaddr(nt)),this.deny=(tt.deny??[]).map(nt=>multiaddr(nt)),this.incomingPendingConnections=0,this.maxIncomingPendingConnections=tt.maxIncomingPendingConnections??defaultOptions.maxIncomingPendingConnections,this.outboundPendingConnections=0,this.inboundConnectionRateLimiter=new RateLimiter({points:tt.inboundConnectionThreshold??defaultOptions.inboundConnectionThreshold,duration:1}),this.connectionPruner=new ConnectionPruner({connectionManager:this,peerStore:et.peerStore,events:et.events,logger:et.logger},{maxConnections:this.maxConnections,allow:this.allow}),this.dialQueue=new DialQueue(et,{addressSorter:tt.addressSorter,maxParallelDials:tt.maxParallelDials??MAX_PARALLEL_DIALS,maxDialQueueLength:tt.maxDialQueueLength??MAX_DIAL_QUEUE_LENGTH,maxPeerAddrsToDial:tt.maxPeerAddrsToDial??MAX_PEER_ADDRS_TO_DIAL,dialTimeout:tt.dialTimeout??DIAL_TIMEOUT,resolvers:tt.resolvers??{dnsaddr:dnsaddrResolver},connections:this.connections}),this.reconnectQueue=new ReconnectQueue({events:et.events,peerStore:et.peerStore,logger:et.logger,connectionManager:this},{retries:tt.reconnectRetries,retryInterval:tt.reconnectRetryInterval,backoffFactor:tt.reconnectBackoffFactor,maxParallelReconnects:tt.maxParallelReconnects})}async start(){var et,tt,nt;(et=this.metrics)==null||et.registerMetricGroup("libp2p_connection_manager_connections",{calculate:()=>{const rt={inbound:0,"inbound pending":this.incomingPendingConnections,outbound:0,"outbound pending":this.outboundPendingConnections};for(const ot of this.connections.values())for(const it of ot)rt[it.direction]++;return rt}}),(tt=this.metrics)==null||tt.registerMetricGroup("libp2p_protocol_streams_total",{label:"protocol",calculate:()=>{const rt={};for(const ot of this.connections.values())for(const it of ot)for(const st of it.streams){const at=`${st.direction} ${st.protocol??"unnegotiated"}`;rt[at]=(rt[at]??0)+1}return rt}}),(nt=this.metrics)==null||nt.registerMetricGroup("libp2p_connection_manager_protocol_streams_per_connection_90th_percentile",{label:"protocol",calculate:()=>{const rt={};for(const it of this.connections.values())for(const st of it){const at={};for(const ct of st.streams){const lt=`${ct.direction} ${ct.protocol??"unnegotiated"}`;at[lt]=(at[lt]??0)+1}for(const[ct,lt]of Object.entries(at))rt[ct]=rt[ct]??[],rt[ct].push(lt)}const ot={};for(let[it,st]of Object.entries(rt)){st=st.sort((ct,lt)=>ct-lt);const at=Math.floor(st.length*.9);ot[it]=st[at]}return ot}}),this.events.addEventListener("connection:open",this.onConnect),this.events.addEventListener("connection:close",this.onDisconnect),await start(this.dialQueue,this.reconnectQueue,this.connectionPruner),this.started=!0,this.log("started")}async stop(){this.events.removeEventListener("connection:open",this.onConnect),this.events.removeEventListener("connection:close",this.onDisconnect),await stop(this.reconnectQueue,this.dialQueue,this.connectionPruner);const et=[];for(const tt of this.connections.values())for(const nt of tt)et.push((async()=>{try{await nt.close()}catch(rt){this.log.error(rt)}})());this.log("closing %d connections",et.length),await Promise.all(et),this.connections.clear(),this.log("stopped")}onConnect(et){this._onConnect(et).catch(tt=>{this.log.error(tt)})}async _onConnect(et){const{detail:tt}=et;if(!this.started){await tt.close();return}if(tt.status!=="open")return;const nt=tt.remotePeer,rt=!this.connections.has(nt),ot=this.connections.get(nt)??[];ot.push(tt),this.connections.set(nt,ot),nt.publicKey!=null&&nt.type==="RSA"&&await this.peerStore.patch(nt,{publicKey:nt.publicKey}),rt&&this.events.safeDispatchEvent("peer:connect",{detail:tt.remotePeer})}onDisconnect(et){const{detail:tt}=et,nt=tt.remotePeer,ot=(this.connections.get(nt)??[]).filter(it=>it.id!==tt.id);this.connections.set(nt,ot),ot.length===0&&(this.log("onDisconnect remove all connections for peer %p",nt),this.connections.delete(nt),this.events.safeDispatchEvent("peer:disconnect",{detail:tt.remotePeer}))}getConnections(et){if(et!=null)return this.connections.get(et)??[];let tt=[];for(const nt of this.connections.values())tt=tt.concat(nt);return tt}getConnectionsMap(){return this.connections}async openConnection(et,tt={}){var nt,rt;if(!this.started)throw new NotStartedError("Not started");this.outboundPendingConnections++;try{(nt=tt.signal)==null||nt.throwIfAborted();const{peerId:ot}=getPeerAddress(et);if(this.peerId.equals(ot))throw new InvalidPeerIdError("Can not dial self");if(ot!=null&&tt.force!==!0){this.log("dial %p",ot);const ct=this.getConnections(ot).find(lt=>lt.limits==null);if(ct!=null)return this.log("had an existing non-limited connection to %p",ot),(rt=tt.onProgress)==null||rt.call(tt,new CustomProgressEvent("dial-queue:already-connected")),ct}const it=await this.dialQueue.dial(et,{...tt,priority:tt.priority??DEFAULT_DIAL_PRIORITY});if(it.status!=="open")throw new ConnectionClosedError("Remote closed connection during opening");let st=this.connections.get(it.remotePeer);st==null&&(st=[],this.connections.set(it.remotePeer,st));let at=!1;for(const ct of st)if(ct.id===it.id&&(at=!0),tt.force!==!0&&ct.id!==it.id&&ct.remoteAddr.equals(it.remoteAddr))return it.abort(new InvalidMultiaddrError("Duplicate multiaddr connection")),ct;return at||st.push(it),it}finally{this.outboundPendingConnections--}}async closeConnections(et,tt={}){const nt=this.connections.get(et)??[];await Promise.all(nt.map(async rt=>{try{await rt.close(tt)}catch(ot){rt.abort(ot)}}))}async acceptIncomingConnection(et){if(this.deny.some(rt=>et.remoteAddr.toString().startsWith(rt.toString())))return this.log("connection from %a refused - connection remote address was in deny list",et.remoteAddr),!1;if(this.allow.some(rt=>et.remoteAddr.toString().startsWith(rt.toString())))return this.incomingPendingConnections++,!0;if(this.incomingPendingConnections===this.maxIncomingPendingConnections)return this.log("connection from %a refused - incomingPendingConnections exceeded by host",et.remoteAddr),!1;if(et.remoteAddr.isThinWaistAddress()){const rt=et.remoteAddr.nodeAddress().address;try{await this.inboundConnectionRateLimiter.consume(rt,1)}catch{return this.log("connection from %a refused - inboundConnectionThreshold exceeded by host %s",et.remoteAddr,rt),!1}}return this.getConnections().length({id:tt.id,status:et[tt.status],peerId:tt.options.peerId,multiaddrs:[...tt.options.multiaddrs].map(nt=>multiaddr(nt))}))}async isDialable(et,tt={}){return this.dialQueue.isDialable(et,tt)}}class MovingAverage{constructor(et){Ct(this,"movingAverage");Ct(this,"variance");Ct(this,"deviation");Ct(this,"forecast");Ct(this,"timespan");Ct(this,"previousTime");this.timespan=et,this.movingAverage=0,this.variance=0,this.deviation=0,this.forecast=0}alpha(et,tt){return 1-Math.exp(-(et-tt)/this.timespan)}push(et,tt=Date.now()){if(this.previousTime!=null){const nt=this.alpha(tt,this.previousTime),rt=et-this.movingAverage,ot=nt*rt;this.movingAverage=nt*et+(1-nt)*this.movingAverage,this.variance=(1-nt)*(this.variance+rt*ot),this.deviation=Math.sqrt(this.variance),this.forecast=this.movingAverage+nt*rt}else this.movingAverage=et;this.previousTime=tt}}const DEFAULT_TIMEOUT_MULTIPLIER=1.2,DEFAULT_FAILURE_MULTIPLIER=2,DEFAULT_MIN_TIMEOUT=2e3;class AdaptiveTimeout{constructor(et={}){Ct(this,"success");Ct(this,"failure");Ct(this,"next");Ct(this,"metric");Ct(this,"timeoutMultiplier");Ct(this,"failureMultiplier");Ct(this,"minTimeout");var tt;this.success=new MovingAverage(et.interval??5e3),this.failure=new MovingAverage(et.interval??5e3),this.next=new MovingAverage(et.interval??5e3),this.failureMultiplier=et.failureMultiplier??DEFAULT_FAILURE_MULTIPLIER,this.timeoutMultiplier=et.timeoutMultiplier??DEFAULT_TIMEOUT_MULTIPLIER,this.minTimeout=et.minTimeout??DEFAULT_MIN_TIMEOUT,et.metricName!=null&&(this.metric=(tt=et.metrics)==null?void 0:tt.registerMetricGroup(et.metricName))}getTimeoutSignal(et={}){const tt=Math.max(Math.round(this.next.movingAverage*(et.timeoutFactor??this.timeoutMultiplier)),this.minTimeout),nt=AbortSignal.timeout(tt),rt=anySignal([et.signal,nt]);return setMaxListeners$2(1/0,rt,nt),rt.start=Date.now(),rt.timeout=tt,rt}cleanUp(et){var nt,rt;const tt=Date.now()-et.start;et.aborted?(this.failure.push(tt),this.next.push(tt*this.failureMultiplier),(nt=this.metric)==null||nt.update({failureMovingAverage:this.failure.movingAverage,failureDeviation:this.failure.deviation,failureForecast:this.failure.forecast,failureVariance:this.failure.variance,failure:tt})):(this.success.push(tt),this.next.push(tt),(rt=this.metric)==null||rt.update({successMovingAverage:this.success.movingAverage,successDeviation:this.success.deviation,successForecast:this.success.forecast,successVariance:this.success.variance,success:tt}))}}const DEFAULT_PING_INTERVAL_MS=1e4,PROTOCOL_VERSION="1.0.0",PROTOCOL_NAME="ping",PROTOCOL_PREFIX="ipfs",PING_LENGTH=32,DEFAULT_ABORT_CONNECTION_ON_PING_FAILURE=!0;var Ml,Bl;Bl=Symbol.toStringTag,Ml=serviceCapabilities;class ConnectionMonitor{constructor(et,tt={}){Ct(this,"protocol");Ct(this,"components");Ct(this,"log");Ct(this,"heartbeatInterval");Ct(this,"pingIntervalMs");Ct(this,"abortController");Ct(this,"timeout");Ct(this,"abortConnectionOnPingFailure");Ct(this,Bl,"@libp2p/connection-monitor");Ct(this,Ml,["@libp2p/connection-monitor"]);this.components=et,this.protocol=`/${tt.protocolPrefix??PROTOCOL_PREFIX}/${PROTOCOL_NAME}/${PROTOCOL_VERSION}`,this.log=et.logger.forComponent("libp2p:connection-monitor"),this.pingIntervalMs=tt.pingInterval??DEFAULT_PING_INTERVAL_MS,this.abortConnectionOnPingFailure=tt.abortConnectionOnPingFailure??DEFAULT_ABORT_CONNECTION_ON_PING_FAILURE,this.timeout=new AdaptiveTimeout({...tt.pingTimeout??{},metrics:et.metrics,metricName:"libp2p_connection_monitor_ping_time_milliseconds"})}start(){this.abortController=new AbortController,setMaxListeners(1/0,this.abortController.signal),this.heartbeatInterval=setInterval(()=>{this.components.connectionManager.getConnections().forEach(et=>{Promise.resolve().then(async()=>{var nt;let tt=Date.now();try{const rt=this.timeout.getTimeoutSignal({signal:(nt=this.abortController)==null?void 0:nt.signal}),ot=await et.newStream(this.protocol,{signal:rt,runOnLimitedConnection:!0}),it=byteStream(ot);tt=Date.now(),await Promise.all([it.write(randomBytes(PING_LENGTH),{signal:rt}),it.read(PING_LENGTH,{signal:rt})]),et.rtt=Date.now()-tt,await it.unwrap().close({signal:rt})}catch(rt){if(rt.name!=="UnsupportedProtocolError")throw rt;et.rtt=(Date.now()-tt)/2}}).catch(tt=>{this.log.error("error during heartbeat",tt),this.abortConnectionOnPingFailure?(this.log.error("aborting connection due to ping failure"),et.abort(tt)):this.log("connection ping failed, but not aborting due to abortConnectionOnPingFailure flag")})})},this.pingIntervalMs)}stop(){var et;(et=this.abortController)==null||et.abort(),this.heartbeatInterval!=null&&clearInterval(this.heartbeatInterval)}}var Dl;Dl=Symbol.toStringTag;class CompoundContentRouting{constructor(et,tt){Ct(this,"routers");Ct(this,"started");Ct(this,"components");Ct(this,Dl,"@libp2p/content-routing");this.routers=tt.routers??[],this.started=!1,this.components=et}isStarted(){return this.started}async start(){this.started=!0}async stop(){this.started=!1}async*findProviders(et,tt={}){if(this.routers.length===0)throw new NoContentRoutersError("No content routers available");const nt=this,rt=new PeerSet;for await(const ot of merge$2(...nt.routers.map(it=>it.findProviders(et,tt))))ot!=null&&(ot.multiaddrs.length>0&&await this.components.peerStore.merge(ot.id,{multiaddrs:ot.multiaddrs}),!rt.has(ot.id)&&(rt.add(ot.id),yield ot))}async provide(et,tt={}){if(this.routers.length===0)throw new NoContentRoutersError("No content routers available");await Promise.all(this.routers.map(async nt=>{await nt.provide(et,tt)}))}async put(et,tt,nt){if(!this.isStarted())throw new NotStartedError;await Promise.all(this.routers.map(async rt=>{await rt.put(et,tt,nt)}))}async get(et,tt){if(!this.isStarted())throw new NotStartedError;return Promise.any(this.routers.map(async nt=>nt.get(et,tt)))}}var Fl;Fl=Symbol.toStringTag;class DefaultPeerRouting{constructor(et,tt={}){Ct(this,"log");Ct(this,"peerId");Ct(this,"peerStore");Ct(this,"routers");Ct(this,Fl,"@libp2p/peer-routing");this.log=et.logger.forComponent("libp2p:peer-routing"),this.peerId=et.peerId,this.peerStore=et.peerStore,this.routers=tt.routers??[]}async findPeer(et,tt){if(this.routers.length===0)throw new NoPeerRoutersError("No peer routers available");if(et.toString()===this.peerId.toString())throw new QueriedForSelfError("Should not try to find self");const nt=this,rt=merge$2(...this.routers.map(ot=>async function*(){try{yield await ot.findPeer(et,tt)}catch(it){nt.log.error(it)}}()));for await(const ot of rt)if(ot!=null)return ot.multiaddrs.length>0&&await this.peerStore.merge(ot.id,{multiaddrs:ot.multiaddrs}),ot;throw new NotFoundError$1}async*getClosestPeers(et,tt={}){if(this.routers.length===0)throw new NoPeerRoutersError("No peer routers available");const nt=this,rt=createScalableCuckooFilter(1024);for await(const ot of parallel(async function*(){const it=merge$2(...nt.routers.map(st=>st.getClosestPeers(et,tt)));for await(let st of it)yield async()=>{if(st.multiaddrs.length===0)try{st=await nt.findPeer(st.id,{...tt,useCache:!1})}catch(at){nt.log.error("could not find peer multiaddrs",at);return}return st}}()))ot!=null&&(ot.multiaddrs.length>0&&await this.peerStore.merge(ot.id,{multiaddrs:ot.multiaddrs}),!rt.has(ot.id.toMultihash().bytes)&&(rt.add(ot.id.toMultihash().bytes),yield ot))}}var Ul,zl;class RandomWalk extends(zl=TypedEventEmitter,Ul=Symbol.toStringTag,zl){constructor(tt){super();Ct(this,"peerRouting");Ct(this,"log");Ct(this,"walking");Ct(this,"walkers");Ct(this,"shutdownController");Ct(this,"walkController");Ct(this,"needNext");Ct(this,Ul,"@libp2p/random-walk");this.log=tt.logger.forComponent("libp2p:random-walk"),this.peerRouting=tt.peerRouting,this.walkers=0,this.walking=!1,this.shutdownController=new AbortController,setMaxListeners(1/0,this.shutdownController.signal)}start(){this.shutdownController=new AbortController,setMaxListeners(1/0,this.shutdownController.signal)}stop(){this.shutdownController.abort()}async*walk(tt){var rt,ot;this.walking||this.startWalk(),this.walkers++;const nt=anySignal([this.shutdownController.signal,tt==null?void 0:tt.signal]);setMaxListeners(1/0,nt);try{for(;;)(rt=this.needNext)==null||rt.resolve(),this.needNext=pDefer(),yield(await raceEvent(this,"walk:peer",nt,{errorEvent:"walk:error"})).detail}finally{nt.clear(),this.walkers--,this.walkers===0&&((ot=this.walkController)==null||ot.abort(),this.walkController=void 0)}}startWalk(){this.walking=!0,this.walkController=new AbortController,setMaxListeners(1/0,this.walkController.signal);const tt=anySignal([this.walkController.signal,this.shutdownController.signal]);setMaxListeners(1/0,tt);const nt=Date.now();let rt=0;Promise.resolve().then(async()=>{for(this.log("start walk");this.walkers>0;)try{const ot=randomBytes(32);let it=Date.now();for await(const st of this.peerRouting.getClosestPeers(ot,{signal:tt}))tt.aborted&&this.log("aborting walk"),tt.throwIfAborted(),this.log("found peer %p after %dms for %d walkers",st.id,Date.now()-it,this.walkers),rt++,this.safeDispatchEvent("walk:peer",{detail:st}),this.walkers===1&&this.needNext!=null&&(this.log("wait for need next"),await raceSignal(this.needNext.promise,tt)),it=Date.now();this.log("walk iteration for %b and %d walkers finished, found %d peers",ot,this.walkers,rt)}catch(ot){this.log.error("randomwalk errored",ot),this.safeDispatchEvent("walk:error",{detail:ot})}this.log("no walkers left, ended walk")}).catch(ot=>{this.log.error("randomwalk errored",ot)}).finally(()=>{this.log("finished walk, found %d peers after %dms",rt,Date.now()-nt),this.walking=!1})}}const DEFAULT_MAX_INBOUND_STREAMS=32,DEFAULT_MAX_OUTBOUND_STREAMS=64;var Vl;Vl=Symbol.toStringTag;class DefaultRegistrar{constructor(et){Ct(this,"log");Ct(this,"topologies");Ct(this,"handlers");Ct(this,"components");Ct(this,Vl,"@libp2p/registrar");this.log=et.logger.forComponent("libp2p:registrar"),this.topologies=new Map,this.handlers=new Map,this.components=et,this._onDisconnect=this._onDisconnect.bind(this),this._onPeerUpdate=this._onPeerUpdate.bind(this),this._onPeerIdentify=this._onPeerIdentify.bind(this),this.components.events.addEventListener("peer:disconnect",this._onDisconnect),this.components.events.addEventListener("peer:update",this._onPeerUpdate),this.components.events.addEventListener("peer:identify",this._onPeerIdentify)}getProtocols(){return Array.from(new Set([...this.handlers.keys()])).sort()}getHandler(et){const tt=this.handlers.get(et);if(tt==null)throw new UnhandledProtocolError(`No handler registered for protocol ${et}`);return tt}getTopologies(et){const tt=this.topologies.get(et);return tt==null?[]:[...tt.values()]}async handle(et,tt,nt){if(this.handlers.has(et))throw new DuplicateProtocolHandlerError(`Handler already registered for protocol ${et}`);const rt=mergeOptions$1.bind({ignoreUndefined:!0})({maxInboundStreams:DEFAULT_MAX_INBOUND_STREAMS,maxOutboundStreams:DEFAULT_MAX_OUTBOUND_STREAMS},nt);this.handlers.set(et,{handler:tt,options:rt}),await this.components.peerStore.merge(this.components.peerId,{protocols:[et]})}async unhandle(et){(Array.isArray(et)?et:[et]).forEach(nt=>{this.handlers.delete(nt)}),await this.components.peerStore.patch(this.components.peerId,{protocols:this.getProtocols()})}async register(et,tt){if(tt==null)throw new InvalidParametersError$1("invalid topology");const nt=`${(Math.random()*1e9).toString(36)}${Date.now()}`;let rt=this.topologies.get(et);return rt==null&&(rt=new Map,this.topologies.set(et,rt)),rt.set(nt,tt),nt}unregister(et){for(const[tt,nt]of this.topologies.entries())nt.has(et)&&(nt.delete(et),nt.size===0&&this.topologies.delete(tt))}_onDisconnect(et){const tt=et.detail;this.components.peerStore.get(tt).then(nt=>{var rt,ot,it;for(const st of nt.protocols){const at=this.topologies.get(st);if(at!=null)for(const ct of at.values())((rt=ct.filter)==null?void 0:rt.has(tt))!==!1&&((ot=ct.filter)==null||ot.remove(tt),(it=ct.onDisconnect)==null||it.call(ct,tt))}}).catch(nt=>{nt.name!=="NotFoundError"&&this.log.error("could not inform topologies of disconnecting peer %p",tt,nt)})}_onPeerUpdate(et){var ot,it,st;const{peer:tt,previous:nt}=et.detail,rt=((nt==null?void 0:nt.protocols)??[]).filter(at=>!tt.protocols.includes(at));for(const at of rt){const ct=this.topologies.get(at);if(ct!=null)for(const lt of ct.values())((ot=lt.filter)==null?void 0:ot.has(tt.id))!==!1&&((it=lt.filter)==null||it.remove(tt.id),(st=lt.onDisconnect)==null||st.call(lt,tt.id))}}_onPeerIdentify(et){var ot,it,st;const tt=et.detail.protocols,nt=et.detail.connection,rt=et.detail.peerId;for(const at of tt){const ct=this.topologies.get(at);if(ct!=null)for(const lt of ct.values())nt.limits!=null&<.notifyOnLimitedConnection!==!0||((ot=lt.filter)==null?void 0:ot.has(rt))!==!0&&((it=lt.filter)==null||it.add(rt),(st=lt.onConnect)==null||st.call(lt,rt,nt))}}}class TrackedMap extends Map{constructor(tt){super();Ct(this,"metric");const{name:nt,metrics:rt}=tt;this.metric=rt.registerMetric(nt),this.updateComponentMetric()}set(tt,nt){return super.set(tt,nt),this.updateComponentMetric(),this}delete(tt){const nt=super.delete(tt);return this.updateComponentMetric(),nt}clear(){super.clear(),this.updateComponentMetric()}updateComponentMetric(){this.metric.update(this.size)}}function trackedMap(o){const{name:et,metrics:tt}=o;let nt;return tt!=null?nt=new TrackedMap({name:et,metrics:tt}):nt=new Map,nt}var Hl;Hl=Symbol.toStringTag;class DefaultTransportManager{constructor(et,tt={}){Ct(this,"log");Ct(this,"components");Ct(this,"transports");Ct(this,"listeners");Ct(this,"faultTolerance");Ct(this,"started");Ct(this,Hl,"@libp2p/transport-manager");this.log=et.logger.forComponent("libp2p:transports"),this.components=et,this.started=!1,this.transports=new Map,this.listeners=trackedMap({name:"libp2p_transport_manager_listeners",metrics:this.components.metrics}),this.faultTolerance=tt.faultTolerance??FaultTolerance.FATAL_ALL}add(et){const tt=et[Symbol.toStringTag];if(tt==null)throw new InvalidParametersError$1("Transport must have a valid tag");if(this.transports.has(tt))throw new InvalidParametersError$1(`There is already a transport with the tag ${tt}`);this.log("adding transport %s",tt),this.transports.set(tt,et),this.listeners.has(tt)||this.listeners.set(tt,[])}isStarted(){return this.started}start(){this.started=!0}async afterStart(){const et=this.components.addressManager.getListenAddrs();await this.listen(et)}async stop(){const et=[];for(const[tt,nt]of this.listeners)for(this.log("closing listeners for %s",tt);nt.length>0;){const rt=nt.pop();rt!=null&&et.push(rt.close())}await Promise.all(et),this.log("all listeners closed");for(const tt of this.listeners.keys())this.listeners.set(tt,[]);this.started=!1}async dial(et,tt){var rt;const nt=this.dialTransportForMultiaddr(et);if(nt==null)throw new TransportUnavailableError(`No transport available for address ${String(et)}`);return(rt=tt==null?void 0:tt.onProgress)==null||rt.call(tt,new CustomProgressEvent("transport-manager:selected-transport",nt[Symbol.toStringTag])),nt.dial(et,{...tt,upgrader:this.components.upgrader})}getAddrs(){let et=[];for(const tt of this.listeners.values())for(const nt of tt)et=[...et,...nt.getAddrs()];return et}getTransports(){return Array.of(...this.transports.values())}getListeners(){return Array.of(...this.listeners.values()).flat()}dialTransportForMultiaddr(et){for(const tt of this.transports.values())if(tt.dialFilter([et]).length>0)return tt}listenTransportForMultiaddr(et){for(const tt of this.transports.values())if(tt.listenFilter([et]).length>0)return tt}async listen(et){if(!this.isStarted())throw new NotStartedError("Not started");if(et==null||et.length===0){this.log("no addresses were provided for listening, this node is dial only");return}const tt=[];for(const[nt,rt]of this.transports.entries()){const ot=rt.listenFilter(et),it=[];for(const ct of ot){this.log("creating listener for %s on %a",nt,ct);const lt=rt.createListener({upgrader:this.components.upgrader});let dt=this.listeners.get(nt)??[];dt==null&&(dt=[],this.listeners.set(nt,dt)),dt.push(lt),lt.addEventListener("listening",()=>{this.components.events.safeDispatchEvent("transport:listening",{detail:lt})}),lt.addEventListener("close",()=>{const ht=dt.findIndex(pt=>pt===lt);dt.splice(ht,1),this.components.events.safeDispatchEvent("transport:close",{detail:lt})}),it.push(lt.listen(ct))}if(it.length===0){tt.push(nt);continue}if((await Promise.allSettled(it)).find(ct=>ct.status==="fulfilled")==null&&this.faultTolerance!==FaultTolerance.NO_FATAL)throw new NoValidAddressesError(`Transport (${nt}) could not listen on any available address`)}if(tt.length===this.transports.size){const nt=`no valid addresses were provided for transports [${tt.join(", ")}]`;if(this.faultTolerance===FaultTolerance.FATAL_ALL)throw new NoValidAddressesError(nt);this.log(`libp2p in dial mode only: ${nt}`)}}async remove(et){const tt=this.listeners.get(et)??[];this.log.trace("removing transport %s",et);const nt=[];for(this.log.trace("closing listeners for %s",et);tt.length>0;){const rt=tt.pop();rt!=null&&nt.push(rt.close())}await Promise.all(nt),this.transports.delete(et),this.listeners.delete(et)}async removeAll(){const et=[];for(const tt of this.transports.keys())et.push(this.remove(tt));await Promise.all(et)}}const PROTOCOL_ID="/multistream/1.0.0",MAX_PROTOCOL_LENGTH=1024;class UnsupportedProtocolError extends Error{constructor(et="Unsupported protocol error"){super(et),this.name="UnsupportedProtocolError"}}Ct(UnsupportedProtocolError,"name","UnsupportedProtocolError");class InvalidMessageError extends Error{constructor(et="Invalid message"){super(et),this.name="InvalidMessageError"}}Ct(InvalidMessageError,"name","InvalidMessageError");const NewLine=fromString(` +`);async function write$1(o,et,tt){await o.write(et,tt)}async function writeAll(o,et,tt){await o.writeV(et,tt)}async function read(o,et){const tt=await o.read(et);if(tt.byteLength===0||tt.get(tt.byteLength-1)!==NewLine[0])throw et.log.error("Invalid mss message - missing newline",tt),new InvalidMessageError("Missing newline");return tt.sublist(0,-1)}async function readString(o,et){const tt=await read(o,et);return toString$8(tt.subarray())}async function select(o,et,tt){if(et=Array.isArray(et)?[...et]:[et],et.length===1&&tt.negotiateFully===!1)return optimisticSelect(o,et[0],tt);const nt=lpStream(o,{...tt,maxDataLength:MAX_PROTOCOL_LENGTH}),rt=et.shift();if(rt==null)throw new Error("At least one protocol must be specified");tt.log.trace('select: write ["%s", "%s"]',PROTOCOL_ID,rt);const ot=fromString(`${PROTOCOL_ID} +`),it=fromString(`${rt} +`);await writeAll(nt,[ot,it],tt),tt.log.trace("select: reading multistream-select header");let st=await readString(nt,tt);if(tt.log.trace('select: read "%s"',st),st===PROTOCOL_ID&&(tt.log.trace("select: reading protocol response"),st=await readString(nt,tt),tt.log.trace('select: read "%s"',st)),st===rt)return{stream:nt.unwrap(),protocol:rt};for(const at of et){tt.log.trace('select: write "%s"',at),await write$1(nt,fromString(`${at} +`),tt),tt.log.trace("select: reading protocol response");const ct=await readString(nt,tt);if(tt.log.trace('select: read "%s" for "%s"',ct,at),ct===at)return{stream:nt.unwrap(),protocol:at}}throw new UnsupportedProtocolError("protocol selection failed")}function optimisticSelect(o,et,tt){const nt=o.sink.bind(o),rt=o.source;let ot=!1,it=!1;const st=pDefer();let at=!1,ct=!1;const lt=pDefer();let dt=!1,ht=!1;const pt=pDefer(),mt=lpStream({sink:nt,source:rt},{...tt,maxDataLength:MAX_PROTOCOL_LENGTH});o.sink=async xt=>{const{sink:vt}=mt.unwrap();await vt(async function*(){let bt=!1;for await(const Et of xt){if(ct&&await lt.promise,at)yield Et;else{ct=!0,tt.log.trace('optimistic: write ["%s", "%s", data(%d)] in sink',PROTOCOL_ID,et,Et.byteLength);const wt=`${et} +`;yield new Uint8ArrayList(Uint8Array.from([19]),fromString(`${PROTOCOL_ID} +`),encode$a(wt.length),fromString(wt),Et).subarray(),tt.log.trace('optimistic: wrote ["%s", "%s", data(%d)] in sink',PROTOCOL_ID,et,Et.byteLength),at=!0,ct=!1,lt.resolve(),ft().catch(kt=>{tt.log.error("could not finish optimistic protocol negotiation of %s",et,kt)})}bt=!0}bt||await ft()}())};async function ft(){if(it){tt.log.trace("optimistic: already negotiating %s stream",et),await st.promise;return}it=!0;try{at||(tt.log.trace("optimistic: doing send protocol for %s stream",et),await yt()),dt||(tt.log.trace("optimistic: doing read protocol for %s stream",et),await gt())}finally{it=!1,ot=!0,st.resolve()}}async function yt(){if(ct){await lt.promise;return}ct=!0;try{tt.log.trace('optimistic: write ["%s", "%s", data] in source',PROTOCOL_ID,et),await mt.writeV([fromString(`${PROTOCOL_ID} +`),fromString(`${et} +`)]),tt.log.trace('optimistic: wrote ["%s", "%s", data] in source',PROTOCOL_ID,et)}finally{at=!0,ct=!1,lt.resolve()}}async function gt(){if(ht){await pt.promise;return}ht=!0;try{tt.log.trace("optimistic: reading multistream select header");let xt=await readString(mt,tt);if(tt.log.trace('optimistic: read multistream select header "%s"',xt),xt===PROTOCOL_ID&&(xt=await readString(mt,tt)),tt.log.trace('optimistic: read protocol "%s", expecting "%s"',xt,et),xt!==et)throw new UnsupportedProtocolError("protocol selection failed")}finally{dt=!0,ht=!1,pt.resolve()}}if(o.source=async function*(){await ft(),tt.log.trace('optimistic: reading data from "%s" stream',et),yield*mt.unwrap().source}(),o.closeRead!=null){const xt=o.closeRead.bind(o);o.closeRead=async vt=>{ot||await ft().catch(bt=>{tt.log.error("could not negotiate protocol before close read",bt)}),await xt(vt)}}if(o.closeWrite!=null){const xt=o.closeWrite.bind(o);o.closeWrite=async vt=>{ot||await ft().catch(bt=>{tt.log.error("could not negotiate protocol before close write",bt)}),await xt(vt)}}if(o.close!=null){const xt=o.close.bind(o);o.close=async vt=>{const bt=[];ct&&bt.push(lt.promise),ht&&bt.push(pt.promise),bt.length>0?await raceSignal(Promise.all(bt),vt==null?void 0:vt.signal):(ot=!0,it=!1,st.resolve()),await xt(vt)}}return{stream:o,protocol:et}}async function handle(o,et,tt){et=Array.isArray(et)?et:[et],tt.log.trace("handle: available protocols %s",et);const nt=lpStream(o,{...tt,maxDataLength:MAX_PROTOCOL_LENGTH,maxLengthLength:2});for(;;){tt.log.trace("handle: reading incoming string");const rt=await readString(nt,tt);if(tt.log.trace('handle: read "%s"',rt),rt===PROTOCOL_ID){tt.log.trace('handle: respond with "%s" for "%s"',PROTOCOL_ID,rt),await write$1(nt,fromString(`${PROTOCOL_ID} +`),tt),tt.log.trace('handle: responded with "%s" for "%s"',PROTOCOL_ID,rt);continue}if(et.includes(rt))return tt.log.trace('handle: respond with "%s" for "%s"',rt,rt),await write$1(nt,fromString(`${rt} +`),tt),tt.log.trace('handle: responded with "%s" for "%s"',rt,rt),{stream:nt.unwrap(),protocol:rt};if(rt==="ls"){const ot=new Uint8ArrayList(...et.map(it=>encode$5.single(fromString(`${it} +`))),fromString(` +`));tt.log.trace('handle: respond with "%s" for %s',et,rt),await write$1(nt,ot,tt),tt.log.trace('handle: responded with "%s" for %s',et,rt);continue}tt.log.trace('handle: respond with "na" for "%s"',rt),await write$1(nt,fromString(`na +`),tt),tt.log('handle: responded with "na" for "%s"',rt)}}const CLOSE_TIMEOUT=500;var Wl,Gl;Gl=Symbol.toStringTag,Wl=connectionSymbol;class ConnectionImpl{constructor(et){Ct(this,"id");Ct(this,"remoteAddr");Ct(this,"remotePeer");Ct(this,"direction");Ct(this,"timeline");Ct(this,"multiplexer");Ct(this,"encryption");Ct(this,"status");Ct(this,"limits");Ct(this,"log");Ct(this,"tags");Ct(this,"_newStream");Ct(this,"_close");Ct(this,"_abort");Ct(this,"_getStreams");Ct(this,Gl,"Connection");Ct(this,Wl,!0);const{remoteAddr:tt,remotePeer:nt,newStream:rt,close:ot,abort:it,getStreams:st}=et;this.id=`${parseInt(String(Math.random()*1e9)).toString(36)}${Date.now()}`,this.remoteAddr=tt,this.remotePeer=nt,this.direction=et.direction,this.status="open",this.timeline=et.timeline,this.multiplexer=et.multiplexer,this.encryption=et.encryption,this.limits=et.limits,this.log=et.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`),this.remoteAddr.getPeerId()==null&&(this.remoteAddr=this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`)),this._newStream=rt,this._close=ot,this._abort=it,this._getStreams=st,this.tags=[]}get streams(){return this._getStreams()}async newStream(et,tt){if(this.status==="closing")throw new ConnectionClosingError("the connection is being closed");if(this.status==="closed")throw new ConnectionClosedError("the connection is closed");if(Array.isArray(et)||(et=[et]),this.limits!=null&&(tt==null?void 0:tt.runOnLimitedConnection)!==!0)throw new LimitedConnectionError("Cannot open protocol stream on limited connection");const nt=await this._newStream(et,tt);return nt.direction="outbound",nt}async close(et={}){if(!(this.status==="closed"||this.status==="closing")){if(this.log("closing connection to %a",this.remoteAddr),this.status="closing",et.signal==null){const tt=AbortSignal.timeout(CLOSE_TIMEOUT);setMaxListeners(1/0,tt),et={...et,signal:tt}}try{this.log.trace("closing underlying transport"),await this._close(et),this.log.trace("updating timeline with close time"),this.status="closed",this.timeline.close=Date.now()}catch(tt){this.log.error("error encountered during graceful close of connection to %a",this.remoteAddr,tt),this.abort(tt)}}}abort(et){this.status!=="closed"&&(this.log.error("aborting connection to %a due to error",this.remoteAddr,et),this.status="closing",this._abort(et),this.status="closed",this.timeline.close=Date.now())}}function createConnection(o){return new ConnectionImpl(o)}function findIncomingStreamLimit(o,et){try{const{options:tt}=et.getHandler(o);return tt.maxInboundStreams}catch(tt){if(tt.name!=="UnhandledProtocolError")throw tt}return DEFAULT_MAX_INBOUND_STREAMS}function findOutgoingStreamLimit(o,et,tt={}){try{const{options:nt}=et.getHandler(o);if(nt.maxOutboundStreams!=null)return nt.maxOutboundStreams}catch(nt){if(nt.name!=="UnhandledProtocolError")throw nt}return tt.maxOutboundStreams??DEFAULT_MAX_OUTBOUND_STREAMS}function countStreams(o,et,tt){let nt=0;return tt.streams.forEach(rt=>{rt.direction===et&&rt.protocol===o&&nt++}),nt}var Kl;Kl=Symbol.toStringTag;class DefaultUpgrader{constructor(et,tt){Ct(this,"components");Ct(this,"connectionEncrypters");Ct(this,"streamMuxers");Ct(this,"inboundUpgradeTimeout");Ct(this,"outboundUpgradeTimeout");Ct(this,"inboundStreamProtocolNegotiationTimeout");Ct(this,"outboundStreamProtocolNegotiationTimeout");Ct(this,"events");Ct(this,"metrics");Ct(this,Kl,"@libp2p/upgrader");var nt,rt;this.components=et,this.connectionEncrypters=new Map,tt.connectionEncrypters.forEach(ot=>{this.connectionEncrypters.set(ot.protocol,ot)}),this.streamMuxers=new Map,tt.streamMuxers.forEach(ot=>{this.streamMuxers.set(ot.protocol,ot)}),this.inboundUpgradeTimeout=tt.inboundUpgradeTimeout??UPGRADE_TIMEOUT,this.outboundUpgradeTimeout=tt.outboundUpgradeTimeout??UPGRADE_TIMEOUT,this.inboundStreamProtocolNegotiationTimeout=tt.inboundStreamProtocolNegotiationTimeout??PROTOCOL_NEGOTIATION_TIMEOUT,this.outboundStreamProtocolNegotiationTimeout=tt.outboundStreamProtocolNegotiationTimeout??PROTOCOL_NEGOTIATION_TIMEOUT,this.events=et.events,this.metrics={dials:(nt=et.metrics)==null?void 0:nt.registerCounterGroup("libp2p_connection_manager_dials_total"),errors:(rt=et.metrics)==null?void 0:rt.registerCounterGroup("libp2p_connection_manager_dial_errors_total")}}async shouldBlockConnection(et,...tt){const nt=this.components.connectionGater[et];if(nt==null)return;if(await nt.apply(this.components.connectionGater,tt)===!0)throw new ConnectionInterceptedError(`The multiaddr connection is blocked by gater.${et}`)}async upgradeInbound(et,tt={}){var nt,rt;try{if((nt=this.metrics.dials)==null||nt.increment({inbound:!0}),!await this.components.connectionManager.acceptIncomingConnection(et))throw new ConnectionDeniedError("connection denied");return await this.shouldBlockConnection("denyInboundConnection",et),await this._performUpgrade(et,"inbound",tt)}catch(ot){throw(rt=this.metrics.errors)==null||rt.increment({inbound:!0}),ot}finally{this.components.connectionManager.afterUpgradeInbound()}}async upgradeOutbound(et,tt={}){var nt,rt;try{(nt=this.metrics.dials)==null||nt.increment({outbound:!0});const ot=et.remoteAddr.getPeerId();let it;return ot!=null&&(it=peerIdFromString$1(ot),await this.shouldBlockConnection("denyOutboundConnection",it,et)),await this._performUpgrade(et,"outbound",tt)}catch(ot){throw(rt=this.metrics.errors)==null||rt.increment({outbound:!0}),ot}}async _performUpgrade(et,tt,nt){var ht,pt,mt;let rt,ot,it,st,at;const ct=AbortSignal.timeout(tt==="inbound"?this.inboundUpgradeTimeout:this.outboundUpgradeTimeout),lt=anySignal([ct,nt.signal]);setMaxListeners(1/0,ct,lt),nt.signal=lt,(ht=this.components.metrics)==null||ht.trackMultiaddrConnection(et),et.log.trace("starting the %s connection upgrade",tt);let dt=et;if((nt==null?void 0:nt.skipProtection)!==!0){const ft=this.components.connectionProtector;ft!=null&&(et.log("protecting the %s connection",tt),dt=await ft.protect(et,nt))}try{if(rt=dt,(nt==null?void 0:nt.skipEncryption)!==!0){(pt=nt==null?void 0:nt.onProgress)==null||pt.call(nt,new CustomProgressEvent(`upgrader:encrypt-${tt}-connection`)),{conn:rt,remotePeer:ot,protocol:at}=await(tt==="inbound"?this._encryptInbound(dt,{...nt,signal:lt}):this._encryptOutbound(dt,{...nt,signal:lt}));const ft={...dt,...rt};await this.shouldBlockConnection(tt==="inbound"?"denyInboundEncryptedConnection":"denyOutboundEncryptedConnection",ot,ft)}else{const ft=et.remoteAddr.getPeerId();if(ft==null)throw new InvalidMultiaddrError(`${tt} connection that skipped encryption must have a peer id`);const yt=peerIdFromString$1(ft);at="native",ot=yt}if(ot.equals(this.components.peerId)){const ft=new InvalidPeerIdError("Can not dial self");throw et.abort(ft),ft}if(it=rt,(nt==null?void 0:nt.muxerFactory)!=null)st=nt.muxerFactory;else if(this.streamMuxers.size>0){(mt=nt==null?void 0:nt.onProgress)==null||mt.call(nt,new CustomProgressEvent(`upgrader:multiplex-${tt}-connection`));const ft=await(tt==="inbound"?this._multiplexInbound({...dt,...rt},this.streamMuxers,nt):this._multiplexOutbound({...dt,...rt},this.streamMuxers,nt));st=ft.muxerFactory,it=ft.stream}}catch(ft){throw et.log.error("failed to upgrade inbound connection %s %a - %e",tt==="inbound"?"from":"to",et.remoteAddr,ft),ft}finally{lt.clear()}return await this.shouldBlockConnection(tt==="inbound"?"denyInboundUpgradedConnection":"denyOutboundUpgradedConnection",ot,et),et.log("successfully upgraded %s connection",tt),this._createConnection({cryptoProtocol:at,direction:tt,maConn:et,upgradedConn:it,muxerFactory:st,remotePeer:ot,limits:nt==null?void 0:nt.limits})}_createConnection(et){const{cryptoProtocol:tt,direction:nt,maConn:rt,upgradedConn:ot,remotePeer:it,muxerFactory:st,limits:at}=et;let ct,lt,dt;st!=null&&(ct=st.createStreamMuxer({direction:nt,onIncomingStream:mt=>{dt!=null&&Promise.resolve().then(async()=>{var Et;const ft=this.components.registrar.getProtocols(),yt=AbortSignal.timeout(this.inboundStreamProtocolNegotiationTimeout);setMaxListeners(1/0,yt);const{stream:gt,protocol:xt}=await handle(mt,ft,{signal:yt,log:mt.log,yieldBytes:!1});if(dt==null)return;dt.log("incoming stream opened on %s",xt);const vt=findIncomingStreamLimit(xt,this.components.registrar);if(countStreams(xt,"inbound",dt)===vt){const wt=new TooManyInboundProtocolStreamsError(`Too many inbound protocol streams for protocol "${xt}" - limit ${vt}`);throw mt.abort(wt),wt}mt.source=gt.source,mt.sink=gt.sink,mt.protocol=xt,gt.closeWrite!=null&&(mt.closeWrite=gt.closeWrite),gt.closeRead!=null&&(mt.closeRead=gt.closeRead),gt.close!=null&&(mt.close=gt.close),await this.components.peerStore.merge(it,{protocols:[xt]}),(Et=this.components.metrics)==null||Et.trackProtocolStream(mt,dt),this._onStream({connection:dt,stream:mt,protocol:xt})}).catch(async ft=>{dt.log.error("error handling incoming stream id %s - %e",mt.id,ft),mt.timeline.close==null&&await mt.close()})}}),lt=async(mt,ft={})=>{var gt;if(ct==null)throw new MuxerUnavailableError("Connection is not multiplexed");dt.log.trace("starting new stream for protocols %s",mt);const yt=await ct.newStream();dt.log.trace("started new stream %s for protocols %s",yt.id,mt);try{if(ft.signal==null){yt.log("no abort signal was passed while trying to negotiate protocols %s falling back to default timeout",mt);const wt=AbortSignal.timeout(this.outboundStreamProtocolNegotiationTimeout);setMaxListeners(1/0,wt),ft={...ft,signal:wt}}yt.log.trace("selecting protocol from protocols %s",mt);const{stream:xt,protocol:vt}=await select(yt,mt,{...ft,log:yt.log,yieldBytes:!0});yt.log.trace("selected protocol %s",vt);const bt=findOutgoingStreamLimit(vt,this.components.registrar,ft),Et=countStreams(vt,"outbound",dt);if(Et>=bt){const wt=new TooManyOutboundProtocolStreamsError(`Too many outbound protocol streams for protocol "${vt}" - ${Et}/${bt}`);throw yt.abort(wt),wt}return await this.components.peerStore.merge(it,{protocols:[vt]}),yt.source=xt.source,yt.sink=xt.sink,yt.protocol=vt,xt.closeWrite!=null&&(yt.closeWrite=xt.closeWrite),xt.closeRead!=null&&(yt.closeRead=xt.closeRead),xt.close!=null&&(yt.close=xt.close),(gt=this.components.metrics)==null||gt.trackProtocolStream(yt,dt),yt}catch(xt){throw dt.log.error("could not create new outbound stream on connection %s %a for protocols %s - %e",nt==="inbound"?"from":"to",et.maConn.remoteAddr,mt,xt),yt.timeline.close==null&&yt.abort(xt),xt}},Promise.all([ct.sink(ot.source),ot.sink(ct.source)]).catch(mt=>{dt.log.error("error piping data through muxer - %e",mt)}));const ht=rt.timeline;rt.timeline=new Proxy(ht,{set:(...mt)=>(mt[1]==="close"&&mt[2]!=null&&ht.close==null&&(async()=>{try{dt.status==="open"&&await dt.close()}catch(ft){dt.log.error("error closing connection after timeline close %e",ft)}finally{this.events.safeDispatchEvent("connection:close",{detail:dt})}})().catch(ft=>{dt.log.error("error thrown while dispatching connection:close event %e",ft)}),Reflect.set(...mt))}),rt.timeline.upgraded=Date.now();const pt=()=>{throw new MuxerUnavailableError("Connection is not multiplexed")};return dt=createConnection({remoteAddr:rt.remoteAddr,remotePeer:it,status:"open",direction:nt,timeline:rt.timeline,multiplexer:ct==null?void 0:ct.protocol,encryption:tt,limits:at,logger:this.components.logger,newStream:lt??pt,getStreams:()=>(ct==null?void 0:ct.streams)??[],close:async mt=>{await(ct==null?void 0:ct.close(mt)),await rt.close(mt)},abort:mt=>{rt.abort(mt),ct==null||ct.abort(mt)}}),this.events.safeDispatchEvent("connection:open",{detail:dt}),dt.__maConnTimeline=ht,dt}_onStream(et){const{connection:tt,stream:nt,protocol:rt}=et,{handler:ot,options:it}=this.components.registrar.getHandler(rt);if(tt.limits!=null&&it.runOnLimitedConnection!==!0)throw new LimitedConnectionError("Cannot open protocol stream on limited connection");ot({connection:tt,stream:nt})}async _encryptInbound(et,tt){const nt=Array.from(this.connectionEncrypters.keys());try{const{stream:rt,protocol:ot}=await handle(et,nt,{...tt,log:et.log}),it=this.connectionEncrypters.get(ot);if(it==null)throw new EncryptionFailedError(`no crypto module found for ${ot}`);return et.log("encrypting inbound connection to %a using %s",et.remoteAddr,ot),{...await it.secureInbound(rt,tt),protocol:ot}}catch(rt){throw et.log.error("encrypting inbound connection from %a failed",et.remoteAddr,rt),new EncryptionFailedError(rt.message)}}async _encryptOutbound(et,tt){const nt=Array.from(this.connectionEncrypters.keys());try{et.log.trace("selecting encrypter from %s",nt);const{stream:rt,protocol:ot}=await select(et,nt,{...tt,log:et.log,yieldBytes:!0}),it=this.connectionEncrypters.get(ot);if(it==null)throw new EncryptionFailedError(`no crypto module found for ${ot}`);return et.log("encrypting outbound connection to %a using %s",et.remoteAddr,ot),{...await it.secureOutbound(rt,tt),protocol:ot}}catch(rt){throw et.log.error("encrypting outbound connection to %a failed",et.remoteAddr,rt),new EncryptionFailedError(rt.message)}}async _multiplexOutbound(et,tt,nt){const rt=Array.from(tt.keys());et.log("outbound selecting muxer %s",rt);try{et.log.trace("selecting stream muxer from %s",rt);const{stream:ot,protocol:it}=await select(et,rt,{...nt,log:et.log,yieldBytes:!0});et.log("selected %s as muxer protocol",it);const st=tt.get(it);return{stream:ot,muxerFactory:st}}catch(ot){throw et.log.error("error multiplexing outbound connection",ot),new MuxerUnavailableError(String(ot))}}async _multiplexInbound(et,tt,nt){const rt=Array.from(tt.keys());et.log("inbound handling muxers %s",rt);try{const{stream:ot,protocol:it}=await handle(et,rt,{...nt,log:et.log}),st=tt.get(it);return{stream:ot,muxerFactory:st}}catch(ot){throw et.log.error("error multiplexing inbound connection",ot),new MuxerUnavailableError(String(ot))}}}const version$3="2.1.8",name$2="libp2p";var po,Ms;class Libp2p extends TypedEventEmitter{constructor(tt){var at,ct,lt,dt,ht,pt;super();fn(this,po);Ct(this,"peerId");Ct(this,"peerStore");Ct(this,"contentRouting");Ct(this,"peerRouting");Ct(this,"metrics");Ct(this,"services");Ct(this,"logger");Ct(this,"status");Ct(this,"components");Ct(this,"log");this.status="stopped";const nt=new TypedEventEmitter,rt=nt.dispatchEvent.bind(nt);nt.dispatchEvent=mt=>{const ft=rt(mt),yt=this.dispatchEvent(new CustomEvent(mt.type,{detail:mt.detail}));return ft||yt},setMaxListeners(1/0,nt),this.peerId=tt.peerId,this.logger=tt.logger??defaultLogger(),this.log=this.logger.forComponent("libp2p"),this.services={};const ot=this.components=defaultComponents({peerId:tt.peerId,privateKey:tt.privateKey,nodeInfo:tt.nodeInfo??{name:name$2,version:version$3},logger:this.logger,events:nt,datastore:tt.datastore??new MemoryDatastore,connectionGater:connectionGater(tt.connectionGater),dns:tt.dns});this.peerStore=this.configureComponent("peerStore",persistentPeerStore(ot,{addressFilter:this.components.connectionGater.filterMultiaddrForPeer,...tt.peerStore})),tt.metrics!=null&&(this.metrics=this.configureComponent("metrics",tt.metrics(this.components))),ot.events.addEventListener("peer:update",mt=>{if(mt.detail.previous==null){const ft={id:mt.detail.peer.id,multiaddrs:mt.detail.peer.addresses.map(yt=>yt.multiaddr)};ot.events.safeDispatchEvent("peer:discovery",{detail:ft})}}),tt.connectionProtector!=null&&this.configureComponent("connectionProtector",tt.connectionProtector(ot)),this.components.upgrader=new DefaultUpgrader(this.components,{connectionEncrypters:(tt.connectionEncrypters??[]).map((mt,ft)=>this.configureComponent(`connection-encryption-${ft}`,mt(this.components))),streamMuxers:(tt.streamMuxers??[]).map((mt,ft)=>this.configureComponent(`stream-muxers-${ft}`,mt(this.components))),inboundUpgradeTimeout:(at=tt.connectionManager)==null?void 0:at.inboundUpgradeTimeout,outboundUpgradeTimeout:(ct=tt.connectionManager)==null?void 0:ct.outboundUpgradeTimeout}),this.configureComponent("transportManager",new DefaultTransportManager(this.components,tt.transportManager)),this.configureComponent("connectionManager",new DefaultConnectionManager(this.components,tt.connectionManager)),((lt=tt.connectionMonitor)==null?void 0:lt.enabled)!==!1&&this.configureComponent("connectionMonitor",new ConnectionMonitor(this.components,tt.connectionMonitor)),this.configureComponent("registrar",new DefaultRegistrar(this.components)),this.configureComponent("addressManager",new DefaultAddressManager(this.components,tt.addresses));const it=(tt.peerRouters??[]).map((mt,ft)=>this.configureComponent(`peer-router-${ft}`,mt(this.components)));this.peerRouting=this.components.peerRouting=this.configureComponent("peerRouting",new DefaultPeerRouting(this.components,{routers:it}));const st=(tt.contentRouters??[]).map((mt,ft)=>this.configureComponent(`content-router-${ft}`,mt(this.components)));if(this.contentRouting=this.components.contentRouting=this.configureComponent("contentRouting",new CompoundContentRouting(this.components,{routers:st})),this.configureComponent("randomWalk",new RandomWalk(this.components)),(tt.peerDiscovery??[]).forEach((mt,ft)=>{this.configureComponent(`peer-discovery-${ft}`,mt(this.components)).addEventListener("peer",gt=>{gn(this,po,Ms).call(this,gt)})}),(dt=tt.transports)==null||dt.forEach((mt,ft)=>{this.components.transportManager.add(this.configureComponent(`transport-${ft}`,mt(this.components)))}),tt.services!=null)for(const mt of Object.keys(tt.services)){const ft=tt.services[mt],yt=ft(this.components);if(yt==null){this.log.error("service factory %s returned null or undefined instance",mt);continue}this.services[mt]=yt,this.configureComponent(mt,yt),yt[contentRoutingSymbol]!=null&&(this.log("registering service %s for content routing",mt),st.push(yt[contentRoutingSymbol])),yt[peerRoutingSymbol]!=null&&(this.log("registering service %s for peer routing",mt),it.push(yt[peerRoutingSymbol])),yt[peerDiscoverySymbol]!=null&&(this.log("registering service %s for peer discovery",mt),(pt=(ht=yt[peerDiscoverySymbol]).addEventListener)==null||pt.call(ht,"peer",gt=>{gn(this,po,Ms).call(this,gt)}))}checkServiceDependencies(ot)}configureComponent(tt,nt){return nt==null&&this.log.error("component %s was null or undefined",tt),this.components[tt]=nt,nt}async start(){var tt,nt,rt,ot;if(this.status==="stopped"){this.status="starting",this.log("libp2p is starting");try{await((nt=(tt=this.components).beforeStart)==null?void 0:nt.call(tt)),await this.components.start(),await((ot=(rt=this.components).afterStart)==null?void 0:ot.call(rt)),this.status="started",this.safeDispatchEvent("start",{detail:this}),this.log("libp2p has started")}catch(it){throw this.log.error("An error occurred starting libp2p",it),this.status="started",await this.stop(),it}}}async stop(){var tt,nt,rt,ot;this.status==="started"&&(this.log("libp2p is stopping"),this.status="stopping",await((nt=(tt=this.components).beforeStop)==null?void 0:nt.call(tt)),await this.components.stop(),await((ot=(rt=this.components).afterStop)==null?void 0:ot.call(rt)),this.status="stopped",this.safeDispatchEvent("stop",{detail:this}),this.log("libp2p has stopped"))}getConnections(tt){return this.components.connectionManager.getConnections(tt)}getDialQueue(){return this.components.connectionManager.getDialQueue()}getPeers(){const tt=new PeerSet;for(const nt of this.components.connectionManager.getConnections())tt.add(nt.remotePeer);return Array.from(tt)}async dial(tt,nt={}){return this.components.connectionManager.openConnection(tt,{priority:75,...nt})}async dialProtocol(tt,nt,rt={}){if(nt==null)throw new InvalidParametersError$1("no protocols were provided to open a stream");if(nt=Array.isArray(nt)?nt:[nt],nt.length===0)throw new InvalidParametersError$1("no protocols were provided to open a stream");return(await this.dial(tt,rt)).newStream(nt,rt)}getMultiaddrs(){return this.components.addressManager.getAddresses()}getProtocols(){return this.components.registrar.getProtocols()}async hangUp(tt,nt={}){isMultiaddr(tt)&&(tt=peerIdFromString$1(tt.getPeerId()??"")),await this.components.connectionManager.closeConnections(tt,nt)}async getPublicKey(tt,nt={}){if(this.log("getPublicKey %p",tt),tt.publicKey!=null)return tt.publicKey;try{const st=await this.peerStore.get(tt);if(st.id.publicKey!=null)return st.id.publicKey}catch(st){if(st.name!=="NotFoundError")throw st}const rt=concat$1([fromString("/pk/"),tt.toMultihash().bytes]),ot=await this.contentRouting.get(rt,nt),it=publicKeyFromProtobuf(ot);return await this.peerStore.patch(tt,{publicKey:it}),it}async handle(tt,nt,rt){Array.isArray(tt)||(tt=[tt]),await Promise.all(tt.map(async ot=>{await this.components.registrar.handle(ot,nt,rt)}))}async unhandle(tt){Array.isArray(tt)||(tt=[tt]),await Promise.all(tt.map(async nt=>{await this.components.registrar.unhandle(nt)}))}async register(tt,nt){return this.components.registrar.register(tt,nt)}unregister(tt){this.components.registrar.unregister(tt)}async isDialable(tt,nt={}){return this.components.connectionManager.isDialable(tt,nt)}}po=new WeakSet,Ms=function(tt){const{detail:nt}=tt;if(nt.id.toString()===this.peerId.toString()){this.log.error("peer discovery mechanism discovered self");return}this.components.peerStore.merge(nt.id,{multiaddrs:nt.multiaddrs}).catch(rt=>{this.log.error(rt)})};async function createLibp2p(o={}){o.privateKey??(o.privateKey=await generateKeyPair());const et=new Libp2p({...await validateConfig(o),peerId:peerIdFromPrivateKey(o.privateKey)});return o.start!==!1&&await et.start(),et}const enrTree={SANDBOX:"enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im",TEST:"enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im"},DEFAULT_BOOTSTRAP_TAG_NAME="bootstrap",DEFAULT_BOOTSTRAP_TAG_VALUE=50,DEFAULT_BOOTSTRAP_TAG_TTL=1e8,DEFAULT_NODE_REQUIREMENTS={store:1,filter:2,lightPush:2},ERR_INVALID_ID="Invalid record id",MULTIADDR_LENGTH_SIZE=2,__viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"}));/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const _0n=BigInt(0),_1n=BigInt(1),_2n=BigInt(2),_3n=BigInt(3),_8n=BigInt(8),CURVE=Object.freeze({a:_0n,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:_1n,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),divNearest=(o,et)=>(o+et/_2n)/et,endo={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(o){const{n:et}=CURVE,tt=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),nt=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),rt=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ot=tt,it=BigInt("0x100000000000000000000000000000000"),st=divNearest(ot*o,et),at=divNearest(-nt*o,et);let ct=mod(o-st*tt-at*rt,et),lt=mod(-st*nt-at*ot,et);const dt=ct>it,ht=lt>it;if(dt&&(ct=et-ct),ht&&(lt=et-lt),ct>it||lt>it)throw new Error("splitScalarEndo: Endomorphism failed, k="+o);return{k1neg:dt,k1:ct,k2neg:ht,k2:lt}}},fieldLen=32,groupLen=32,hashLen=32,compressedLen=fieldLen+1,uncompressedLen=2*fieldLen+1;function weierstrass(o){const{a:et,b:tt}=CURVE,nt=mod(o*o),rt=mod(nt*o);return mod(rt+et*o+tt)}const USE_ENDOMORPHISM=CURVE.a===_0n;class ShaError extends Error{constructor(et){super(et)}}function assertJacPoint(o){if(!(o instanceof JacobianPoint))throw new TypeError("JacobianPoint expected")}class JacobianPoint{constructor(et,tt,nt){this.x=et,this.y=tt,this.z=nt}static fromAffine(et){if(!(et instanceof Point))throw new TypeError("JacobianPoint#fromAffine: expected Point");return et.equals(Point.ZERO)?JacobianPoint.ZERO:new JacobianPoint(et.x,et.y,_1n)}static toAffineBatch(et){const tt=invertBatch(et.map(nt=>nt.z));return et.map((nt,rt)=>nt.toAffine(tt[rt]))}static normalizeZ(et){return JacobianPoint.toAffineBatch(et).map(JacobianPoint.fromAffine)}equals(et){assertJacPoint(et);const{x:tt,y:nt,z:rt}=this,{x:ot,y:it,z:st}=et,at=mod(rt*rt),ct=mod(st*st),lt=mod(tt*ct),dt=mod(ot*at),ht=mod(mod(nt*st)*ct),pt=mod(mod(it*rt)*at);return lt===dt&&ht===pt}negate(){return new JacobianPoint(this.x,mod(-this.y),this.z)}double(){const{x:et,y:tt,z:nt}=this,rt=mod(et*et),ot=mod(tt*tt),it=mod(ot*ot),st=et+ot,at=mod(_2n*(mod(st*st)-rt-it)),ct=mod(_3n*rt),lt=mod(ct*ct),dt=mod(lt-_2n*at),ht=mod(ct*(at-dt)-_8n*it),pt=mod(_2n*tt*nt);return new JacobianPoint(dt,ht,pt)}add(et){assertJacPoint(et);const{x:tt,y:nt,z:rt}=this,{x:ot,y:it,z:st}=et;if(ot===_0n||it===_0n)return this;if(tt===_0n||nt===_0n)return et;const at=mod(rt*rt),ct=mod(st*st),lt=mod(tt*ct),dt=mod(ot*at),ht=mod(mod(nt*st)*ct),pt=mod(mod(it*rt)*at),mt=mod(dt-lt),ft=mod(pt-ht);if(mt===_0n)return ft===_0n?this.double():JacobianPoint.ZERO;const yt=mod(mt*mt),gt=mod(mt*yt),xt=mod(lt*yt),vt=mod(ft*ft-gt-_2n*xt),bt=mod(ft*(xt-vt)-ht*gt),Et=mod(rt*st*mt);return new JacobianPoint(vt,bt,Et)}subtract(et){return this.add(et.negate())}multiplyUnsafe(et){const tt=JacobianPoint.ZERO;if(typeof et=="bigint"&&et===_0n)return tt;let nt=normalizeScalar(et);if(nt===_1n)return this;if(!USE_ENDOMORPHISM){let dt=tt,ht=this;for(;nt>_0n;)nt&_1n&&(dt=dt.add(ht)),ht=ht.double(),nt>>=_1n;return dt}let{k1neg:rt,k1:ot,k2neg:it,k2:st}=endo.splitScalar(nt),at=tt,ct=tt,lt=this;for(;ot>_0n||st>_0n;)ot&_1n&&(at=at.add(lt)),st&_1n&&(ct=ct.add(lt)),lt=lt.double(),ot>>=_1n,st>>=_1n;return rt&&(at=at.negate()),it&&(ct=ct.negate()),ct=new JacobianPoint(mod(ct.x*endo.beta),ct.y,ct.z),at.add(ct)}precomputeWindow(et){const tt=USE_ENDOMORPHISM?128/et+1:256/et+1,nt=[];let rt=this,ot=rt;for(let it=0;it>=dt,mt>at&&(mt-=lt,et+=_1n);const ft=pt,yt=pt+Math.abs(mt)-1,gt=ht%2!==0,xt=mt<0;mt===0?it=it.add(constTimeNegate(gt,rt[ft])):ot=ot.add(constTimeNegate(xt,rt[yt]))}return{p:ot,f:it}}multiply(et,tt){let nt=normalizeScalar(et),rt,ot;if(USE_ENDOMORPHISM){const{k1neg:it,k1:st,k2neg:at,k2:ct}=endo.splitScalar(nt);let{p:lt,f:dt}=this.wNAF(st,tt),{p:ht,f:pt}=this.wNAF(ct,tt);lt=constTimeNegate(it,lt),ht=constTimeNegate(at,ht),ht=new JacobianPoint(mod(ht.x*endo.beta),ht.y,ht.z),rt=lt.add(ht),ot=dt.add(pt)}else{const{p:it,f:st}=this.wNAF(nt,tt);rt=it,ot=st}return JacobianPoint.normalizeZ([rt,ot])[0]}toAffine(et){const{x:tt,y:nt,z:rt}=this,ot=this.equals(JacobianPoint.ZERO);et==null&&(et=ot?_8n:invert(rt));const it=et,st=mod(it*it),at=mod(st*it),ct=mod(tt*st),lt=mod(nt*at),dt=mod(rt*it);if(ot)return Point.ZERO;if(dt!==_1n)throw new Error("invZ was invalid");return new Point(ct,lt)}}JacobianPoint.BASE=new JacobianPoint(CURVE.Gx,CURVE.Gy,_1n);JacobianPoint.ZERO=new JacobianPoint(_0n,_1n,_0n);function constTimeNegate(o,et){const tt=et.negate();return o?tt:et}const pointPrecomputes=new WeakMap;class Point{constructor(et,tt){this.x=et,this.y=tt}_setWindowSize(et){this._WINDOW_SIZE=et,pointPrecomputes.delete(this)}hasEvenY(){return this.y%_2n===_0n}static fromCompressedHex(et){const tt=et.length===32,nt=bytesToNumber(tt?et:et.subarray(1));if(!isValidFieldElement(nt))throw new Error("Point is not on curve");const rt=weierstrass(nt);let ot=sqrtMod(rt);const it=(ot&_1n)===_1n;tt?it&&(ot=mod(-ot)):(et[0]&1)===1!==it&&(ot=mod(-ot));const st=new Point(nt,ot);return st.assertValidity(),st}static fromUncompressedHex(et){const tt=bytesToNumber(et.subarray(1,fieldLen+1)),nt=bytesToNumber(et.subarray(fieldLen+1,fieldLen*2+1)),rt=new Point(tt,nt);return rt.assertValidity(),rt}static fromHex(et){const tt=ensureBytes(et),nt=tt.length,rt=tt[0];if(nt===fieldLen)return this.fromCompressedHex(tt);if(nt===compressedLen&&(rt===2||rt===3))return this.fromCompressedHex(tt);if(nt===uncompressedLen&&rt===4)return this.fromUncompressedHex(tt);throw new Error(`Point.fromHex: received invalid point. Expected 32-${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes, not ${nt}`)}static fromPrivateKey(et){return Point.BASE.multiply(normalizePrivateKey(et))}static fromSignature(et,tt,nt){const{r:rt,s:ot}=normalizeSignature(tt);if(![0,1,2,3].includes(nt))throw new Error("Cannot recover: invalid recovery bit");const it=truncateHash(ensureBytes(et)),{n:st}=CURVE,at=nt===2||nt===3?rt+st:rt,ct=invert(at,st),lt=mod(-it*ct,st),dt=mod(ot*ct,st),ht=nt&1?"03":"02",pt=Point.fromHex(ht+numTo32bStr(at)),mt=Point.BASE.multiplyAndAddUnsafe(pt,lt,dt);if(!mt)throw new Error("Cannot recover signature: point at infinify");return mt.assertValidity(),mt}toRawBytes(et=!1){return hexToBytes(this.toHex(et))}toHex(et=!1){const tt=numTo32bStr(this.x);return et?`${this.hasEvenY()?"02":"03"}${tt}`:`04${tt}${numTo32bStr(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const et="Point is not on elliptic curve",{x:tt,y:nt}=this;if(!isValidFieldElement(tt)||!isValidFieldElement(nt))throw new Error(et);const rt=mod(nt*nt),ot=weierstrass(tt);if(mod(rt-ot)!==_0n)throw new Error(et)}equals(et){return this.x===et.x&&this.y===et.y}negate(){return new Point(this.x,mod(-this.y))}double(){return JacobianPoint.fromAffine(this).double().toAffine()}add(et){return JacobianPoint.fromAffine(this).add(JacobianPoint.fromAffine(et)).toAffine()}subtract(et){return this.add(et.negate())}multiply(et){return JacobianPoint.fromAffine(this).multiply(et,this).toAffine()}multiplyAndAddUnsafe(et,tt,nt){const rt=JacobianPoint.fromAffine(this),ot=tt===_0n||tt===_1n||this!==Point.BASE?rt.multiplyUnsafe(tt):rt.multiply(tt),it=JacobianPoint.fromAffine(et).multiplyUnsafe(nt),st=ot.add(it);return st.equals(JacobianPoint.ZERO)?void 0:st.toAffine()}}Point.BASE=new Point(CURVE.Gx,CURVE.Gy);Point.ZERO=new Point(_0n,_0n);function sliceDER(o){return Number.parseInt(o[0],16)>=8?"00"+o:o}function parseDERInt(o){if(o.length<2||o[0]!==2)throw new Error(`Invalid signature integer tag: ${bytesToHex(o)}`);const et=o[1],tt=o.subarray(2,et+2);if(!et||tt.length!==et)throw new Error("Invalid signature integer: wrong length");if(tt[0]===0&&tt[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:bytesToNumber(tt),left:o.subarray(et+2)}}function parseDERSignature(o){if(o.length<2||o[0]!=48)throw new Error(`Invalid signature tag: ${bytesToHex(o)}`);if(o[1]!==o.length-2)throw new Error("Invalid signature: incorrect length");const{data:et,left:tt}=parseDERInt(o.subarray(2)),{data:nt,left:rt}=parseDERInt(tt);if(rt.length)throw new Error(`Invalid signature: left bytes after parsing: ${bytesToHex(rt)}`);return{r:et,s:nt}}class Signature{constructor(et,tt){this.r=et,this.s=tt,this.assertValidity()}static fromCompact(et){const tt=et instanceof Uint8Array,nt="Signature.fromCompact";if(typeof et!="string"&&!tt)throw new TypeError(`${nt}: Expected string or Uint8Array`);const rt=tt?bytesToHex(et):et;if(rt.length!==128)throw new Error(`${nt}: Expected 64-byte hex`);return new Signature(hexToNumber(rt.slice(0,64)),hexToNumber(rt.slice(64,128)))}static fromDER(et){const tt=et instanceof Uint8Array;if(typeof et!="string"&&!tt)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:nt,s:rt}=parseDERSignature(tt?et:hexToBytes(et));return new Signature(nt,rt)}static fromHex(et){return this.fromDER(et)}assertValidity(){const{r:et,s:tt}=this;if(!isWithinCurveOrder(et))throw new Error("Invalid Signature: r must be 0 < r < n");if(!isWithinCurveOrder(tt))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const et=CURVE.n>>_1n;return this.s>et}normalizeS(){return this.hasHighS()?new Signature(this.r,mod(-this.s,CURVE.n)):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){const et=sliceDER(numberToHexUnpadded(this.s)),tt=sliceDER(numberToHexUnpadded(this.r)),nt=et.length/2,rt=tt.length/2,ot=numberToHexUnpadded(nt),it=numberToHexUnpadded(rt);return`30${numberToHexUnpadded(rt+nt+4)}02${it}${tt}02${ot}${et}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return numTo32bStr(this.r)+numTo32bStr(this.s)}}function concatBytes(...o){if(!o.every(nt=>nt instanceof Uint8Array))throw new Error("Uint8Array list expected");if(o.length===1)return o[0];const et=o.reduce((nt,rt)=>nt+rt.length,0),tt=new Uint8Array(et);for(let nt=0,rt=0;ntet.toString(16).padStart(2,"0"));function bytesToHex(o){if(!(o instanceof Uint8Array))throw new Error("Expected Uint8Array");let et="";for(let tt=0;tt0)return BigInt(o);if(typeof o=="bigint"&&isWithinCurveOrder(o))return o;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function mod(o,et=CURVE.P){const tt=o%et;return tt>=_0n?tt:et+tt}function pow2(o,et){const{P:tt}=CURVE;let nt=o;for(;et-- >_0n;)nt*=nt,nt%=tt;return nt}function sqrtMod(o){const{P:et}=CURVE,tt=BigInt(6),nt=BigInt(11),rt=BigInt(22),ot=BigInt(23),it=BigInt(44),st=BigInt(88),at=o*o*o%et,ct=at*at*o%et,lt=pow2(ct,_3n)*ct%et,dt=pow2(lt,_3n)*ct%et,ht=pow2(dt,_2n)*at%et,pt=pow2(ht,nt)*ht%et,mt=pow2(pt,rt)*pt%et,ft=pow2(mt,it)*mt%et,yt=pow2(ft,st)*ft%et,gt=pow2(yt,it)*mt%et,xt=pow2(gt,_3n)*ct%et,vt=pow2(xt,ot)*pt%et,bt=pow2(vt,tt)*at%et,Et=pow2(bt,_2n);if(Et*Et%et!==o)throw new Error("Cannot find square root");return Et}function invert(o,et=CURVE.P){if(o===_0n||et<=_0n)throw new Error(`invert: expected positive integers, got n=${o} mod=${et}`);let tt=mod(o,et),nt=et,rt=_0n,ot=_1n;for(;tt!==_0n;){const st=nt/tt,at=nt%tt,ct=rt-ot*st;nt=tt,tt=at,rt=ot,ot=ct}if(nt!==_1n)throw new Error("invert: does not exist");return mod(rt,et)}function invertBatch(o,et=CURVE.P){const tt=new Array(o.length),nt=o.reduce((ot,it,st)=>it===_0n?ot:(tt[st]=ot,mod(ot*it,et)),_1n),rt=invert(nt,et);return o.reduceRight((ot,it,st)=>it===_0n?ot:(tt[st]=mod(ot*tt[st],et),mod(ot*it,et)),rt),tt}function bits2int_2(o){const et=o.length*8-groupLen*8,tt=bytesToNumber(o);return et>0?tt>>BigInt(et):tt}function truncateHash(o,et=!1){const tt=bits2int_2(o);if(et)return tt;const{n:nt}=CURVE;return tt>=nt?tt-nt:tt}let _sha256Sync,_hmacSha256Sync;class HmacDrbg{constructor(et,tt){if(this.hashLen=et,this.qByteLen=tt,typeof et!="number"||et<2)throw new Error("hashLen must be a number");if(typeof tt!="number"||tt<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(et).fill(1),this.k=new Uint8Array(et).fill(0),this.counter=0}hmac(...et){return utils.hmacSha256(this.k,...et)}hmacSync(...et){return _hmacSha256Sync(this.k,...et)}checkSync(){if(typeof _hmacSha256Sync!="function")throw new ShaError("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(et=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),et),this.v=await this.hmac(this.v),et.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),et),this.v=await this.hmac(this.v))}reseedSync(et=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),et),this.v=this.hmacSync(this.v),et.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),et),this.v=this.hmacSync(this.v))}async generate(){this.incr();let et=0;const tt=[];for(;et0)et=BigInt(o);else if(typeof o=="string"){if(o.length!==2*groupLen)throw new Error("Expected 32 bytes of private key");et=hexToNumber(o)}else if(o instanceof Uint8Array){if(o.length!==groupLen)throw new Error("Expected 32 bytes of private key");et=bytesToNumber(o)}else throw new TypeError("Expected valid private key");if(!isWithinCurveOrder(et))throw new Error("Expected private key: 0 < key < n");return et}function normalizePublicKey(o){return o instanceof Point?(o.assertValidity(),o):Point.fromHex(o)}function normalizeSignature(o){if(o instanceof Signature)return o.assertValidity(),o;try{return Signature.fromDER(o)}catch{return Signature.fromCompact(o)}}function bits2int(o){const et=o.length>fieldLen?o.slice(0,fieldLen):o;return bytesToNumber(et)}function bits2octets(o){const et=bits2int(o),tt=mod(et,CURVE.n);return int2octets(tt<_0n?et:tt)}function int2octets(o){return numTo32b(o)}function initSigArgs(o,et,tt){if(o==null)throw new Error(`sign: expected valid message hash, not "${o}"`);const nt=ensureBytes(o),rt=normalizePrivateKey(et),ot=[int2octets(rt),bits2octets(nt)];if(tt!=null){tt===!0&&(tt=utils.randomBytes(fieldLen));const at=ensureBytes(tt);if(at.length!==fieldLen)throw new Error(`sign: Expected ${fieldLen} bytes of extra data`);ot.push(at)}const it=concatBytes(...ot),st=bits2int(nt);return{seed:it,m:st,d:rt}}function finalizeSig(o,et){const{sig:tt,recovery:nt}=o,{der:rt,recovered:ot}=Object.assign({canonical:!0,der:!0},et),it=rt?tt.toDERRawBytes():tt.toCompactRawBytes();return ot?[it,nt]:it}async function sign$1(o,et,tt={}){const{seed:nt,m:rt,d:ot}=initSigArgs(o,et,tt.extraEntropy),it=new HmacDrbg(hashLen,groupLen);await it.reseed(nt);let st;for(;!(st=kmdToSig(await it.generate(),rt,ot,tt.canonical));)await it.reseed();return finalizeSig(st,tt)}const vopts={strict:!0};function verify(o,et,tt,nt=vopts){let rt;try{rt=normalizeSignature(o),et=ensureBytes(et)}catch{return!1}const{r:ot,s:it}=rt;if(nt.strict&&rt.hasHighS())return!1;const st=truncateHash(et);let at;try{at=normalizePublicKey(tt)}catch{return!1}const{n:ct}=CURVE,lt=invert(it,ct),dt=mod(st*lt,ct),ht=mod(ot*lt,ct),pt=Point.BASE.multiplyAndAddUnsafe(at,dt,ht);return pt?mod(pt.x,ct)===ot:!1}Point.BASE._setWindowSize(8);const crypto$1={node:__viteBrowserExternal$1,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},TAGGED_HASH_PREFIXES={},utils={bytesToHex,hexToBytes,concatBytes,mod,invert,isValidPrivateKey(o){try{return normalizePrivateKey(o),!0}catch{return!1}},_bigintTo32Bytes:numTo32b,_normalizePrivateKey:normalizePrivateKey,hashToPrivateKey:o=>{o=ensureBytes(o);const et=groupLen+8;if(o.length1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const tt=mod(bytesToNumber(o),CURVE.n-_1n)+_1n;return numTo32b(tt)},randomBytes:(o=32)=>{if(crypto$1.web)return crypto$1.web.getRandomValues(new Uint8Array(o));if(crypto$1.node){const{randomBytes:et}=crypto$1.node;return Uint8Array.from(et(o))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>utils.hashToPrivateKey(utils.randomBytes(groupLen+8)),precompute(o=8,et=Point.BASE){const tt=et===Point.BASE?et:new Point(et.x,et.y);return tt._setWindowSize(o),tt.multiply(_3n),tt},sha256:async(...o)=>{if(crypto$1.web){const et=await crypto$1.web.subtle.digest("SHA-256",concatBytes(...o));return new Uint8Array(et)}else if(crypto$1.node){const{createHash:et}=crypto$1.node,tt=et("sha256");return o.forEach(nt=>tt.update(nt)),Uint8Array.from(tt.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(o,...et)=>{if(crypto$1.web){const tt=await crypto$1.web.subtle.importKey("raw",o,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),nt=concatBytes(...et),rt=await crypto$1.web.subtle.sign("HMAC",tt,nt);return new Uint8Array(rt)}else if(crypto$1.node){const{createHmac:tt}=crypto$1.node,nt=tt("sha256",o);return et.forEach(rt=>nt.update(rt)),Uint8Array.from(nt.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(o,...et)=>{let tt=TAGGED_HASH_PREFIXES[o];if(tt===void 0){const nt=await utils.sha256(Uint8Array.from(o,rt=>rt.charCodeAt(0)));tt=concatBytes(nt,nt),TAGGED_HASH_PREFIXES[o]=tt}return utils.sha256(tt,...et)},taggedHashSync:(o,...et)=>{if(typeof _sha256Sync!="function")throw new ShaError("sha256Sync is undefined, you need to set it");let tt=TAGGED_HASH_PREFIXES[o];if(tt===void 0){const nt=_sha256Sync(Uint8Array.from(o,rt=>rt.charCodeAt(0)));tt=concatBytes(nt,nt),TAGGED_HASH_PREFIXES[o]=tt}return _sha256Sync(tt,...et)},_JacobianPoint:JacobianPoint};Object.defineProperties(utils,{sha256Sync:{configurable:!1,get(){return _sha256Sync},set(o){_sha256Sync||(_sha256Sync=o)}},hmacSha256Sync:{configurable:!1,get(){return _hmacSha256Sync},set(o){_hmacSha256Sync||(_hmacSha256Sync=o)}}});var sha3$1={exports:{}};(function(o){var et={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};/** + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.9.3 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2023 + * @license MIT + */(function(){var tt="input is invalid type",nt="finalize already called",rt=typeof window=="object",ot=rt?window:{};ot.JS_SHA3_NO_WINDOW&&(rt=!1);var it=!rt&&typeof self=="object",st=!ot.JS_SHA3_NO_NODE_JS&&typeof et=="object"&&et.versions&&et.versions.node;st?ot=globalThis:it&&(ot=self);for(var at=!ot.JS_SHA3_NO_COMMON_JS&&!0&&o.exports,ct=!ot.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",lt="0123456789abcdef".split(""),dt=[31,7936,2031616,520093696],ht=[4,1024,262144,67108864],pt=[1,256,65536,16777216],mt=[6,1536,393216,100663296],ft=[0,8,16,24],yt=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],gt=[224,256,384,512],xt=[128,256],vt=["hex","buffer","arrayBuffer","array","digest"],bt={128:168,256:136},Et=ot.JS_SHA3_NO_NODE_JS||!Array.isArray?function(_t){return Object.prototype.toString.call(_t)==="[object Array]"}:Array.isArray,wt=ct&&(ot.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)?function(_t){return typeof _t=="object"&&_t.buffer&&_t.buffer.constructor===ArrayBuffer}:ArrayBuffer.isView,kt=function(_t){var Dt=typeof _t;if(Dt==="string")return[_t,!0];if(Dt!=="object"||_t===null)throw new Error(tt);if(ct&&_t.constructor===ArrayBuffer)return[new Uint8Array(_t),!1];if(!Et(_t)&&!wt(_t))throw new Error(tt);return[_t,!1]},Tt=function(_t){return kt(_t)[0].length===0},Rt=function(_t){for(var Dt=[],Vt=0;Vt<_t.length;++Vt)Dt[Vt]=_t[Vt];return Dt},Pt=function(_t,Dt,Vt){return function(en){return new Xt(_t,Dt,_t).update(en)[Vt]()}},$t=function(_t,Dt,Vt){return function(en,an){return new Xt(_t,Dt,an).update(en)[Vt]()}},Ot=function(_t,Dt,Vt){return function(en,an,dn,ln){return Lt["cshake"+_t].update(en,an,dn,ln)[Vt]()}},Bt=function(_t,Dt,Vt){return function(en,an,dn,ln){return Lt["kmac"+_t].update(en,an,dn,ln)[Vt]()}},zt=function(_t,Dt,Vt,en){for(var an=0;an>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Vt>>5,this.extraBytes=(Vt&31)>>3;for(var en=0;en<50;++en)this.s[en]=0}Xt.prototype.update=function(_t){if(this.finalized)throw new Error(nt);var Dt=kt(_t);_t=Dt[0];for(var Vt=Dt[1],en=this.blocks,an=this.byteCount,dn=_t.length,ln=this.blockCount,pn=0,kn=this.s,mn,wn;pn>2]|=wn<>2]|=(192|wn>>6)<>2]|=(128|wn&63)<=57344?(en[mn>>2]|=(224|wn>>12)<>2]|=(128|wn>>6&63)<>2]|=(128|wn&63)<>2]|=(240|wn>>18)<>2]|=(128|wn>>12&63)<>2]|=(128|wn>>6&63)<>2]|=(128|wn&63)<>2]|=_t[pn]<=an){for(this.start=mn-an,this.block=en[ln],mn=0;mn>8,Vt=_t&255;Vt>0;)an.unshift(Vt),_t=_t>>8,Vt=_t&255,++en;return Dt?an.push(en):an.unshift(en),this.update(an),an.length},Xt.prototype.encodeString=function(_t){var Dt=kt(_t);_t=Dt[0];var Vt=Dt[1],en=0,an=_t.length;if(Vt)for(var dn=0;dn<_t.length;++dn){var ln=_t.charCodeAt(dn);ln<128?en+=1:ln<2048?en+=2:ln<55296||ln>=57344?en+=3:(ln=65536+((ln&1023)<<10|_t.charCodeAt(++dn)&1023),en+=4)}else en=an;return en+=this.encode(en*8),this.update(_t),en},Xt.prototype.bytepad=function(_t,Dt){for(var Vt=this.encode(Dt),en=0;en<_t.length;++en)Vt+=this.encodeString(_t[en]);var an=(Dt-Vt%Dt)%Dt,dn=[];return dn.length=an,this.update(dn),this},Xt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var _t=this.blocks,Dt=this.lastByteIndex,Vt=this.blockCount,en=this.s;if(_t[Dt>>2]|=this.padding[Dt&3],this.lastByteIndex===this.byteCount)for(_t[0]=_t[Vt],Dt=1;Dt>4&15]+lt[pn&15]+lt[pn>>12&15]+lt[pn>>8&15]+lt[pn>>20&15]+lt[pn>>16&15]+lt[pn>>28&15]+lt[pn>>24&15];dn%_t===0&&(Dt=Rt(Dt),tn(Dt),an=0)}return en&&(pn=Dt[an],ln+=lt[pn>>4&15]+lt[pn&15],en>1&&(ln+=lt[pn>>12&15]+lt[pn>>8&15]),en>2&&(ln+=lt[pn>>20&15]+lt[pn>>16&15])),ln},Xt.prototype.arrayBuffer=function(){this.finalize();var _t=this.blockCount,Dt=this.s,Vt=this.outputBlocks,en=this.extraBytes,an=0,dn=0,ln=this.outputBits>>3,pn;en?pn=new ArrayBuffer(Vt+1<<2):pn=new ArrayBuffer(ln);for(var kn=new Uint32Array(pn);dn>8&255,ln[pn+2]=kn>>16&255,ln[pn+3]=kn>>24&255;dn%_t===0&&(Dt=Rt(Dt),tn(Dt))}return en&&(pn=dn<<2,kn=Dt[an],ln[pn]=kn&255,en>1&&(ln[pn+1]=kn>>8&255),en>2&&(ln[pn+2]=kn>>16&255)),ln};function Jt(_t,Dt,Vt){Xt.call(this,_t,Dt,Vt)}Jt.prototype=new Xt,Jt.prototype.finalize=function(){return this.encode(this.outputBits,!0),Xt.prototype.finalize.call(this)};var tn=function(_t){var Dt,Vt,en,an,dn,ln,pn,kn,mn,wn,In,Pn,yn,En,on,It,St,At,jt,Kt,rn,sn,xn,Rn,vn,An,bn,fo,mo,go,yo,xo,vo,bo,Eo,wo,Co,So,ko,Ao,Ro,_o,To,Io,Po,Lo,No,$o,jo,Oo,Mo,Bo,Do,Fo,Uo,zo,Vo,Ho,Wo,Go,qo,Ko,Qo;for(en=0;en<48;en+=2)an=_t[0]^_t[10]^_t[20]^_t[30]^_t[40],dn=_t[1]^_t[11]^_t[21]^_t[31]^_t[41],ln=_t[2]^_t[12]^_t[22]^_t[32]^_t[42],pn=_t[3]^_t[13]^_t[23]^_t[33]^_t[43],kn=_t[4]^_t[14]^_t[24]^_t[34]^_t[44],mn=_t[5]^_t[15]^_t[25]^_t[35]^_t[45],wn=_t[6]^_t[16]^_t[26]^_t[36]^_t[46],In=_t[7]^_t[17]^_t[27]^_t[37]^_t[47],Pn=_t[8]^_t[18]^_t[28]^_t[38]^_t[48],yn=_t[9]^_t[19]^_t[29]^_t[39]^_t[49],Dt=Pn^(ln<<1|pn>>>31),Vt=yn^(pn<<1|ln>>>31),_t[0]^=Dt,_t[1]^=Vt,_t[10]^=Dt,_t[11]^=Vt,_t[20]^=Dt,_t[21]^=Vt,_t[30]^=Dt,_t[31]^=Vt,_t[40]^=Dt,_t[41]^=Vt,Dt=an^(kn<<1|mn>>>31),Vt=dn^(mn<<1|kn>>>31),_t[2]^=Dt,_t[3]^=Vt,_t[12]^=Dt,_t[13]^=Vt,_t[22]^=Dt,_t[23]^=Vt,_t[32]^=Dt,_t[33]^=Vt,_t[42]^=Dt,_t[43]^=Vt,Dt=ln^(wn<<1|In>>>31),Vt=pn^(In<<1|wn>>>31),_t[4]^=Dt,_t[5]^=Vt,_t[14]^=Dt,_t[15]^=Vt,_t[24]^=Dt,_t[25]^=Vt,_t[34]^=Dt,_t[35]^=Vt,_t[44]^=Dt,_t[45]^=Vt,Dt=kn^(Pn<<1|yn>>>31),Vt=mn^(yn<<1|Pn>>>31),_t[6]^=Dt,_t[7]^=Vt,_t[16]^=Dt,_t[17]^=Vt,_t[26]^=Dt,_t[27]^=Vt,_t[36]^=Dt,_t[37]^=Vt,_t[46]^=Dt,_t[47]^=Vt,Dt=wn^(an<<1|dn>>>31),Vt=In^(dn<<1|an>>>31),_t[8]^=Dt,_t[9]^=Vt,_t[18]^=Dt,_t[19]^=Vt,_t[28]^=Dt,_t[29]^=Vt,_t[38]^=Dt,_t[39]^=Vt,_t[48]^=Dt,_t[49]^=Vt,En=_t[0],on=_t[1],Lo=_t[11]<<4|_t[10]>>>28,No=_t[10]<<4|_t[11]>>>28,fo=_t[20]<<3|_t[21]>>>29,mo=_t[21]<<3|_t[20]>>>29,Go=_t[31]<<9|_t[30]>>>23,qo=_t[30]<<9|_t[31]>>>23,_o=_t[40]<<18|_t[41]>>>14,To=_t[41]<<18|_t[40]>>>14,bo=_t[2]<<1|_t[3]>>>31,Eo=_t[3]<<1|_t[2]>>>31,It=_t[13]<<12|_t[12]>>>20,St=_t[12]<<12|_t[13]>>>20,$o=_t[22]<<10|_t[23]>>>22,jo=_t[23]<<10|_t[22]>>>22,go=_t[33]<<13|_t[32]>>>19,yo=_t[32]<<13|_t[33]>>>19,Ko=_t[42]<<2|_t[43]>>>30,Qo=_t[43]<<2|_t[42]>>>30,Fo=_t[5]<<30|_t[4]>>>2,Uo=_t[4]<<30|_t[5]>>>2,wo=_t[14]<<6|_t[15]>>>26,Co=_t[15]<<6|_t[14]>>>26,At=_t[25]<<11|_t[24]>>>21,jt=_t[24]<<11|_t[25]>>>21,Oo=_t[34]<<15|_t[35]>>>17,Mo=_t[35]<<15|_t[34]>>>17,xo=_t[45]<<29|_t[44]>>>3,vo=_t[44]<<29|_t[45]>>>3,Rn=_t[6]<<28|_t[7]>>>4,vn=_t[7]<<28|_t[6]>>>4,zo=_t[17]<<23|_t[16]>>>9,Vo=_t[16]<<23|_t[17]>>>9,So=_t[26]<<25|_t[27]>>>7,ko=_t[27]<<25|_t[26]>>>7,Kt=_t[36]<<21|_t[37]>>>11,rn=_t[37]<<21|_t[36]>>>11,Bo=_t[47]<<24|_t[46]>>>8,Do=_t[46]<<24|_t[47]>>>8,Io=_t[8]<<27|_t[9]>>>5,Po=_t[9]<<27|_t[8]>>>5,An=_t[18]<<20|_t[19]>>>12,bn=_t[19]<<20|_t[18]>>>12,Ho=_t[29]<<7|_t[28]>>>25,Wo=_t[28]<<7|_t[29]>>>25,Ao=_t[38]<<8|_t[39]>>>24,Ro=_t[39]<<8|_t[38]>>>24,sn=_t[48]<<14|_t[49]>>>18,xn=_t[49]<<14|_t[48]>>>18,_t[0]=En^~It&At,_t[1]=on^~St&jt,_t[10]=Rn^~An&fo,_t[11]=vn^~bn&mo,_t[20]=bo^~wo&So,_t[21]=Eo^~Co&ko,_t[30]=Io^~Lo&$o,_t[31]=Po^~No&jo,_t[40]=Fo^~zo&Ho,_t[41]=Uo^~Vo&Wo,_t[2]=It^~At&Kt,_t[3]=St^~jt&rn,_t[12]=An^~fo&go,_t[13]=bn^~mo&yo,_t[22]=wo^~So&Ao,_t[23]=Co^~ko&Ro,_t[32]=Lo^~$o&Oo,_t[33]=No^~jo&Mo,_t[42]=zo^~Ho&Go,_t[43]=Vo^~Wo&qo,_t[4]=At^~Kt&sn,_t[5]=jt^~rn&xn,_t[14]=fo^~go&xo,_t[15]=mo^~yo&vo,_t[24]=So^~Ao&_o,_t[25]=ko^~Ro&To,_t[34]=$o^~Oo&Bo,_t[35]=jo^~Mo&Do,_t[44]=Ho^~Go&Ko,_t[45]=Wo^~qo&Qo,_t[6]=Kt^~sn&En,_t[7]=rn^~xn&on,_t[16]=go^~xo&Rn,_t[17]=yo^~vo&vn,_t[26]=Ao^~_o&bo,_t[27]=Ro^~To&Eo,_t[36]=Oo^~Bo&Io,_t[37]=Mo^~Do&Po,_t[46]=Go^~Ko&Fo,_t[47]=qo^~Qo&Uo,_t[8]=sn^~En&It,_t[9]=xn^~on&St,_t[18]=xo^~Rn&An,_t[19]=vo^~vn&bn,_t[28]=_o^~bo&wo,_t[29]=To^~Eo&Co,_t[38]=Bo^~Io&Lo,_t[39]=Do^~Po&No,_t[48]=Ko^~Fo&zo,_t[49]=Qo^~Uo&Vo,_t[0]^=yt[en],_t[1]^=yt[en+1]};if(at)o.exports=Lt;else for(Qt=0;Qtot+MULTIADDR_LENGTH_SIZE+it.bytes.length,0),tt=new Uint8Array(et),nt=new DataView(tt.buffer);let rt=0;return o.forEach(ot=>{if(ot.getPeerId())throw new Error("`multiaddr` field MUST not contain peer id");nt.setUint16(rt,ot.bytes.length),rt+=MULTIADDR_LENGTH_SIZE,tt.set(ot.bytes,rt),rt+=ot.bytes.length}),tt}function encodeWaku2(o){let et=0;return o.lightPush&&(et+=1),et=et<<1,o.filter&&(et+=1),et=et<<1,o.store&&(et+=1),et=et<<1,o.relay&&(et+=1),et}function decodeWaku2(o){const et={relay:!1,store:!1,filter:!1,lightPush:!1};return o%2&&(et.relay=!0),o=o>>1,o%2&&(et.store=!0),o=o>>1,o%2&&(et.filter=!0),o=o>>1,o%2&&(et.lightPush=!0),et}class RawEnr extends Map{constructor(tt={},nt=BigInt(1),rt){super(Object.entries(tt));Ct(this,"seq");Ct(this,"signature");this.seq=nt,this.signature=rt}set(tt,nt){return this.signature=void 0,this.seq++,super.set(tt,nt)}get id(){const tt=this.get("id");if(!tt)throw new Error("id not found.");return bytesToUtf8(tt)}get publicKey(){switch(this.id){case"v4":return this.get("secp256k1");default:throw new Error(ERR_INVALID_ID)}}get rs(){const tt=this.get("rs");if(tt)return decodeRelayShard(tt)}get rsv(){const tt=this.get("rsv");if(tt)return decodeRelayShard(tt)}get ip(){return getStringValue(this,"ip","ip4")}set ip(tt){setStringValue(this,"ip","ip4",tt)}get tcp(){return getNumberAsStringValue(this,"tcp","tcp")}set tcp(tt){setNumberAsStringValue(this,"tcp","tcp",tt)}get udp(){return getNumberAsStringValue(this,"udp","udp")}set udp(tt){setNumberAsStringValue(this,"udp","udp",tt)}get ip6(){return getStringValue(this,"ip6","ip6")}set ip6(tt){setStringValue(this,"ip6","ip6",tt)}get tcp6(){return getNumberAsStringValue(this,"tcp6","tcp")}set tcp6(tt){setNumberAsStringValue(this,"tcp6","tcp",tt)}get udp6(){return getNumberAsStringValue(this,"udp6","udp")}set udp6(tt){setNumberAsStringValue(this,"udp6","udp",tt)}get multiaddrs(){const tt=this.get("multiaddrs");if(tt)return decodeMultiaddrs(tt)}set multiaddrs(tt){deleteUndefined(this,"multiaddrs",tt,encodeMultiaddrs)}get waku2(){const tt=this.get("waku2");if(tt)return decodeWaku2(tt[0])}set waku2(tt){deleteUndefined(this,"waku2",tt,nt=>new Uint8Array([encodeWaku2(nt)]))}}function getStringValue(o,et,tt){const nt=o.get(et);if(nt)return convertToString(tt,nt)}function getNumberAsStringValue(o,et,tt){const nt=o.get(et);if(nt)return Number(convertToString(tt,nt))}function setStringValue(o,et,tt,nt){deleteUndefined(o,et,nt,convertToBytes.bind({},tt))}function setNumberAsStringValue(o,et,tt,nt){setStringValue(o,et,tt,nt==null?void 0:nt.toString(10))}function deleteUndefined(o,et,tt,nt){tt!==void 0?o.set(et,nt(tt)):o.delete(et)}async function sign(o,et){return sign$1(keccak256(et),o,{der:!1})}function nodeId(o){const tt=Point.fromHex(o).toRawBytes(!1);return bytesToHex$1(keccak256(tt.slice(1)))}const log$9=new Logger$1("enr");var TransportProtocol;(function(o){o.TCP="tcp",o.UDP="udp"})(TransportProtocol||(TransportProtocol={}));var TransportProtocolPerIpVersion;(function(o){o.TCP4="tcp4",o.UDP4="udp4",o.TCP6="tcp6",o.UDP6="udp6"})(TransportProtocolPerIpVersion||(TransportProtocolPerIpVersion={}));const os=class os extends RawEnr{constructor(){super(...arguments);Ct(this,"peerId");Ct(this,"getLocationMultiaddr",locationMultiaddrFromEnrFields.bind({},this))}static create(tt={},nt=BigInt(1),rt){const ot=new os(tt,nt,rt);try{const it=ot.publicKey;it&&(ot.peerId=createPeerIdFromPublicKey(it))}catch(it){log$9.error("Could not calculate peer id for ENR",it)}return ot}get nodeId(){switch(this.id){case"v4":return this.publicKey?nodeId(this.publicKey):void 0;default:throw new Error(ERR_INVALID_ID)}}get shardInfo(){return this.rs&&this.rsv&&log$9.warn("ENR contains both `rs` and `rsv` fields."),this.rs||this.rsv}setLocationMultiaddr(tt){const nt=tt.protoNames();if(nt.length!==2&&nt[1]!=="udp"&&nt[1]!=="tcp")throw new Error("Invalid multiaddr");const rt=tt.tuples();if(!rt[0][1]||!rt[1][1])throw new Error("Invalid multiaddr");rt[0][0]===4?(this.set("ip",rt[0][1]),this.set(nt[1],rt[1][1])):(this.set("ip6",rt[0][1]),this.set(nt[1]+"6",rt[1][1]))}getAllLocationMultiaddrs(){const tt=[];for(const rt of Object.values(TransportProtocolPerIpVersion)){const ot=this.getLocationMultiaddr(rt);ot&&tt.push(ot)}const nt=this.multiaddrs??[];return tt.concat(nt).map(rt=>this.peerId?rt.encapsulate(`/p2p/${this.peerId.toString()}`):rt)}get peerInfo(){const tt=this.peerId;if(tt)return{id:tt,multiaddrs:this.getAllLocationMultiaddrs()}}getFullMultiaddr(tt){if(this.peerId){const nt=this.getLocationMultiaddr(tt);if(nt)return nt.encapsulate(`/p2p/${this.peerId.toString()}`)}}getFullMultiaddrs(){if(this.peerId&&this.multiaddrs){const tt=this.peerId;return this.multiaddrs.map(nt=>nt.encapsulate(`/p2p/${tt.toString()}`))}return[]}verify(tt,nt){if(!this.get("id")||this.id!=="v4")throw new Error(ERR_INVALID_ID);if(!this.publicKey)throw new Error("Failed to verify ENR: No public key");return verifySignature(nt,keccak256(tt),this.publicKey)}async sign(tt,nt){switch(this.id){case"v4":this.signature=await sign(nt,tt);break;default:throw new Error(ERR_INVALID_ID)}return this.signature}};Ct(os,"RECORD_PREFIX","enr:");let ENR=os;const version$2="logger/5.7.0";let _permanentCensorErrors=!1,_censorErrors=!1;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels.default,_globalLogger=null;function _checkNormalize(){try{const o=[];if(["NFD","NFC","NFKD","NFKC"].forEach(et=>{try{if("test".normalize(et)!=="test")throw new Error("bad normalize")}catch{o.push(et)}}),o.length)throw new Error("missing "+o.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(o){return o.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(o){o.DEBUG="DEBUG",o.INFO="INFO",o.WARNING="WARNING",o.ERROR="ERROR",o.OFF="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(o){o.UNKNOWN_ERROR="UNKNOWN_ERROR",o.NOT_IMPLEMENTED="NOT_IMPLEMENTED",o.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",o.NETWORK_ERROR="NETWORK_ERROR",o.SERVER_ERROR="SERVER_ERROR",o.TIMEOUT="TIMEOUT",o.BUFFER_OVERRUN="BUFFER_OVERRUN",o.NUMERIC_FAULT="NUMERIC_FAULT",o.MISSING_NEW="MISSING_NEW",o.INVALID_ARGUMENT="INVALID_ARGUMENT",o.MISSING_ARGUMENT="MISSING_ARGUMENT",o.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",o.CALL_EXCEPTION="CALL_EXCEPTION",o.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",o.NONCE_EXPIRED="NONCE_EXPIRED",o.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",o.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",o.TRANSACTION_REPLACED="TRANSACTION_REPLACED",o.ACTION_REJECTED="ACTION_REJECTED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{constructor(et){Object.defineProperty(this,"version",{enumerable:!0,value:et,writable:!1})}_log(et,tt){const nt=et.toLowerCase();LogLevels[nt]==null&&this.throwArgumentError("invalid log level name","logLevel",et),!(_logLevel>LogLevels[nt])&&console.log.apply(console,tt)}debug(...et){this._log(Logger.levels.DEBUG,et)}info(...et){this._log(Logger.levels.INFO,et)}warn(...et){this._log(Logger.levels.WARNING,et)}makeError(et,tt,nt){if(_censorErrors)return this.makeError("censored error",tt,{});tt||(tt=Logger.errors.UNKNOWN_ERROR),nt||(nt={});const rt=[];Object.keys(nt).forEach(at=>{const ct=nt[at];try{if(ct instanceof Uint8Array){let lt="";for(let dt=0;dt>4],lt+=HEX[ct[dt]&15];rt.push(at+"=Uint8Array(0x"+lt+")")}else rt.push(at+"="+JSON.stringify(ct))}catch{rt.push(at+"="+JSON.stringify(nt[at].toString()))}}),rt.push(`code=${tt}`),rt.push(`version=${this.version}`);const ot=et;let it="";switch(tt){case ErrorCode.NUMERIC_FAULT:{it="NUMERIC_FAULT";const at=et;switch(at){case"overflow":case"underflow":case"division-by-zero":it+="-"+at;break;case"negative-power":case"negative-width":it+="-unsupported";break;case"unbound-bitwise-result":it+="-unbound-result";break}break}case ErrorCode.CALL_EXCEPTION:case ErrorCode.INSUFFICIENT_FUNDS:case ErrorCode.MISSING_NEW:case ErrorCode.NONCE_EXPIRED:case ErrorCode.REPLACEMENT_UNDERPRICED:case ErrorCode.TRANSACTION_REPLACED:case ErrorCode.UNPREDICTABLE_GAS_LIMIT:it=tt;break}it&&(et+=" [ See: https://links.ethers.org/v5-errors-"+it+" ]"),rt.length&&(et+=" ("+rt.join(", ")+")");const st=new Error(et);return st.reason=ot,st.code=tt,Object.keys(nt).forEach(function(at){st[at]=nt[at]}),st}throwError(et,tt,nt){throw this.makeError(et,tt,nt)}throwArgumentError(et,tt,nt){return this.throwError(et,Logger.errors.INVALID_ARGUMENT,{argument:tt,value:nt})}assert(et,tt,nt,rt){et||this.throwError(tt,nt,rt)}assertArgument(et,tt,nt,rt){et||this.throwArgumentError(tt,nt,rt)}checkNormalize(et){_normalizeError&&this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}checkSafeUint53(et,tt){typeof et=="number"&&(tt==null&&(tt="value not safe"),(et<0||et>=9007199254740991)&&this.throwError(tt,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:et}),et%1&&this.throwError(tt,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:et}))}checkArgumentCount(et,tt,nt){nt?nt=": "+nt:nt="",ettt&&this.throwError("too many arguments"+nt,Logger.errors.UNEXPECTED_ARGUMENT,{count:et,expectedCount:tt})}checkNew(et,tt){(et===Object||et==null)&&this.throwError("missing new",Logger.errors.MISSING_NEW,{name:tt.name})}checkAbstract(et,tt){et===tt?this.throwError("cannot instantiate abstract class "+JSON.stringify(tt.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:et.name,operation:"new"}):(et===Object||et==null)&&this.throwError("missing new",Logger.errors.MISSING_NEW,{name:tt.name})}static globalLogger(){return _globalLogger||(_globalLogger=new Logger(version$2)),_globalLogger}static setCensorship(et,tt){if(!et&&tt&&this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_permanentCensorErrors){if(!et)return;this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!et,_permanentCensorErrors=!!tt}static setLogLevel(et){const tt=LogLevels[et.toLowerCase()];if(tt==null){Logger.globalLogger().warn("invalid log level - "+et);return}_logLevel=tt}static from(et){return new Logger(et)}}Logger.errors=ErrorCode;Logger.levels=LogLevel;const version$1="bytes/5.7.0",logger$1=new Logger(version$1);function isHexable(o){return!!o.toHexString}function addSlice(o){return o.slice||(o.slice=function(){const et=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(o,et)))}),o}function isBytesLike(o){return isHexString(o)&&!(o.length%2)||isBytes(o)}function isInteger(o){return typeof o=="number"&&o==o&&o%1===0}function isBytes(o){if(o==null)return!1;if(o.constructor===Uint8Array)return!0;if(typeof o=="string"||!isInteger(o.length)||o.length<0)return!1;for(let et=0;et=256)return!1}return!0}function arrayify(o,et){if(et||(et={}),typeof o=="number"){logger$1.checkSafeUint53(o,"invalid arrayify value");const tt=[];for(;o;)tt.unshift(o&255),o=parseInt(String(o/256));return tt.length===0&&tt.push(0),addSlice(new Uint8Array(tt))}if(et.allowMissingPrefix&&typeof o=="string"&&o.substring(0,2)!=="0x"&&(o="0x"+o),isHexable(o)&&(o=o.toHexString()),isHexString(o)){let tt=o.substring(2);tt.length%2&&(et.hexPad==="left"?tt="0"+tt:et.hexPad==="right"?tt+="0":logger$1.throwArgumentError("hex data is odd-length","value",o));const nt=[];for(let rt=0;rt>4]+HexCharacters[rt&15]}return tt}return logger$1.throwArgumentError("invalid hexlify value","value",o)}const version="rlp/5.7.0",logger=new Logger(version);function arrayifyInteger(o){const et=[];for(;o;)et.unshift(o&255),o>>=8;return et}function unarrayifyInteger(o,et,tt){let nt=0;for(let rt=0;rtet+1+nt&&logger.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+nt,result:rt}}function _decode(o,et){if(o.length===0&&logger.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{}),o[et]>=248){const tt=o[et]-247;et+1+tt>o.length&&logger.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{});const nt=unarrayifyInteger(o,et+1,tt);return et+1+tt+nt>o.length&&logger.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{}),_decodeChildren(o,et,et+1+tt,tt+nt)}else if(o[et]>=192){const tt=o[et]-192;return et+1+tt>o.length&&logger.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{}),_decodeChildren(o,et,et+1,tt)}else if(o[et]>=184){const tt=o[et]-183;et+1+tt>o.length&&logger.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const nt=unarrayifyInteger(o,et+1,tt);et+1+tt+nt>o.length&&logger.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const rt=hexlify(o.slice(et+1+tt,et+1+tt+nt));return{consumed:1+tt+nt,result:rt}}else if(o[et]>=128){const tt=o[et]-128;et+1+tt>o.length&&logger.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{});const nt=hexlify(o.slice(et+1,et+1+tt));return{consumed:1+tt,result:nt}}return{consumed:1,result:hexlify(o[et])}}function decode$4(o){const et=arrayify(o),tt=_decode(et,0);return tt.consumed!==et.length&&logger.throwArgumentError("invalid rlp data","data",o),tt.result}const log$8=new Logger$1("enr:decoder");class EnrDecoder{static fromString(et){if(!et.startsWith(ENR.RECORD_PREFIX))throw new Error(`"string encoded ENR must start with '${ENR.RECORD_PREFIX}'`);return EnrDecoder.fromRLP(fromString(et.slice(4),"base64url"))}static fromRLP(et){const tt=decode$4(et).map(hexToBytes$1);return fromValues(tt)}}async function fromValues(o){const{signature:et,seq:tt,kvs:nt}=checkValues(o),rt={};for(let st=0;stv4Regex$1.test(o),encode(o,et,tt){tt=~~tt,et=et||new Uint8Array(tt+v4Size);const nt=o.length;let rt=0;for(let ot=0;oto.length>0&&v6Regex$1.test(o),encode(o,et,tt){tt=~~tt;let nt=tt+v6Size,rt=-1,ot=0,it=0,st=!0,at=!1;et=et||new Uint8Array(tt+v6Size);for(let ct=0;ct>8),tt=97?lt-=87:lt>=65?lt-=55:(lt-=48,it=it*10+lt),ot=(ot<<4)+lt)}if(st===!1)at===!0?(tt>8),tt=rt+2;ct--)et[ct]=et[ct-2];et[rt]=0,et[rt+1]=0,rt=tt}if(rt!==tt&&rt!==-1)for(tt>nt-2&&(tt=nt-2);nt>rt;)et[--nt]=ttrt?et[--tt]:0;else for(;tt=SURROGATE_B||(o.charCodeAt(ot)&64512)!==SURROGATE_B?et+=3:(nt=ot,et+=4)}}return et}function encode$1(o,et,tt){const nt=o.length;tt==null&&(tt=0),et===void 0&&(et=new Uint8Array(encodingLength$1(o)+tt));let rt=tt;for(let ot=0;ot>6,et[rt++]=128|it&63;else if((it&63488)!==SURROGATE_A)et[rt++]=224|(it&61440)>>12,et[rt++]=128|(it&4032)>>6,et[rt++]=128|it&63;else{const st=ot+1;if(st===nt||it>=SURROGATE_B)et[rt++]=239,et[rt++]=191,et[rt++]=189;else{const at=o.charCodeAt(st);(at&64512)!==SURROGATE_B?(et[rt++]=239,et[rt++]=191,et[rt++]=189):(ot=st,it=65536|(it&1023)<<10|at&1023,et[rt++]=240|(it&1835008)>>18,et[rt++]=128|(it&258048)>>12,et[rt++]=128|(it&4032)>>6,et[rt++]=128|it&63)}}}return encode$1.bytes=rt-tt,et}encode$1.bytes=0;function decode$2(o,et,tt){let nt="";et==null&&(et=0),tt==null&&(tt=o.length);for(let rt=et;rt191&&ot<224)it=(ot&31)<<6|o[rt++]&63;else if(ot>239&&ot<365){it=((ot&7)<<18|(o[rt++]&63)<<12|(o[rt++]&63)<<6|o[rt++]&63)-65536;const st=SURROGATE_A|it>>10&1023;nt+=String.fromCharCode(st),it=SURROGATE_B|it&1023}else it=(ot&15)<<12|(o[rt++]&63)<<6|o[rt++]&63;nt+=String.fromCharCode(it)}return decode$2.bytes=tt-et,nt}decode$2.bytes=0;const isU8Arr=o=>o instanceof Uint8Array;function bytelength(o){return typeof o=="string"?encodingLength$1(o):o.byteLength}function from(o){return o instanceof Uint8Array?o:Array.isArray(o)?new Uint8Array(o):encode$1(o)}function write(o,et,tt){if(typeof et!="string")throw new Error("unknown input type");return encode$1(et,o,tt),encode$1.bytes}const P_24=Math.pow(2,24),P_16=Math.pow(2,16),P_8=Math.pow(2,8),readUInt32BE=(o,et)=>o[et]*P_24+o[et+1]*P_16+o[et+2]*P_8+o[et+3],readUInt16BE=(o,et)=>o[et]<<8|o[et+1],writeUInt32BE=(o,et,tt)=>(et=+et,o[tt+3]=et,et=et>>>8,o[tt+2]=et,et=et>>>8,o[tt+1]=et,et=et>>>8,o[tt]=et,tt+4),writeUInt16BE=(o,et,tt)=>(o[tt]=et>>8,o[tt+1]=et&255,tt+2);function copy(o,et,tt,nt,rt){return tt<0&&(nt-=tt,tt=0),nt<0&&(nt=0),rt<0?new Uint8Array(0):tt>=et.length||nt>=rt?0:_copyActual(o,et,tt,nt,rt)}function _copyActual(o,et,tt,nt,rt){rt-nt>et.length-tt&&(rt=nt+et.length-tt);let ot=rt-nt;const it=o.length-nt;return ot>it&&(ot=it),(nt!==0||rto)}}const name$1=codec({encode(o,et,tt){et||(et=new Uint8Array(name$1.encodingLength(o))),tt||(tt=0);const nt=tt,rt=o.replace(/^\.|\.$/gm,"");if(rt.length){const ot=rt.split(".");for(let it=0;it=o.length)throw new Error("Cannot decode name (buffer overflow)");const st=o[et++];if(ot+=it?0:1,st===0)break;if(st&192)if((st&192)===192){if(et+1>o.length)throw new Error("Cannot decode name (buffer overflow)");const at=readUInt16BE(o,et-1)-49152;if(at>=nt)throw new Error("Cannot decode name (bad pointer)");et=at,nt=at,ot+=it?0:1,it=!0}else throw new Error("Cannot decode name (bad label)");else{if(et+st>o.length)throw new Error("Cannot decode name (buffer overflow)");if(rt+=st+1,rt>254)throw new Error("Cannot decode name (name too long)");tt.push(decode$2(o,et,et+st)),et+=st,ot+=it?0:st}}return name$1.decode.bytes=ot,tt.length===0?".":tt.join(".")},encodingLength(o){return o==="."||o===".."?1:bytelength(o.replace(/^\.|\.$/gm,""))+2}}),string$2=codec({encode(o,et,tt){et||(et=new Uint8Array(string$2.encodingLength(o))),tt||(tt=0);const nt=write(et,o,tt+1);return et[tt]=nt,string$2.encode.bytes=nt+1,et},decode(o,et){et||(et=0);const tt=o[et],nt=decode$2(o,et+1,et+1+tt);return string$2.decode.bytes=tt+1,nt},encodingLength(o){return bytelength(o)+1}}),header=codec({bytes:12,encode(o,et,tt){et||(et=new Uint8Array(header.encodingLength(o))),tt||(tt=0);const nt=(o.flags||0)&32767,rt=o.type==="response"?RESPONSE_FLAG:QUERY_FLAG;return writeUInt16BE(et,o.id||0,tt),writeUInt16BE(et,nt|rt,tt+2),writeUInt16BE(et,o.questions.length,tt+4),writeUInt16BE(et,o.answers.length,tt+6),writeUInt16BE(et,o.authorities.length,tt+8),writeUInt16BE(et,o.additionals.length,tt+10),et},decode(o,et){if(et||(et=0),o.length<12)throw new Error("Header must be 12 bytes");const tt=readUInt16BE(o,et+2);return{id:readUInt16BE(o,et),type:tt&RESPONSE_FLAG?"response":"query",flags:tt&32767,flag_qr:(tt>>15&1)===1,opcode:toString$4(tt>>11&15),flag_aa:(tt>>10&1)===1,flag_tc:(tt>>9&1)===1,flag_rd:(tt>>8&1)===1,flag_ra:(tt>>7&1)===1,flag_z:(tt>>6&1)===1,flag_ad:(tt>>5&1)===1,flag_cd:(tt>>4&1)===1,rcode:toString$5(tt&15),questions:new Array(readUInt16BE(o,et+4)),answers:new Array(readUInt16BE(o,et+6)),authorities:new Array(readUInt16BE(o,et+8)),additionals:new Array(readUInt16BE(o,et+10))}},encodingLength(){return 12}}),runknown=codec({encode(o,et,tt){et||(et=new Uint8Array(runknown.encodingLength(o))),tt||(tt=0);const nt=o.length;return writeUInt16BE(et,nt,tt),copy(o,et,tt+2,0,nt),runknown.encode.bytes=nt+2,et},decode(o,et){et||(et=0);const tt=readUInt16BE(o,et),nt=o.slice(et+2,et+2+tt);return runknown.decode.bytes=tt+2,nt},encodingLength(o){return o.length+2}}),rns=codec({encode(o,et,tt){return et||(et=new Uint8Array(rns.encodingLength(o))),tt||(tt=0),name$1.encode(o,et,tt+2),writeUInt16BE(et,name$1.encode.bytes,tt),rns.encode.bytes=name$1.encode.bytes+2,et},decode(o,et){et||(et=0);const tt=readUInt16BE(o,et),nt=name$1.decode(o,et+2);return rns.decode.bytes=tt+2,nt},encodingLength(o){return name$1.encodingLength(o)+2}}),rsoa=codec({encode(o,et,tt){et||(et=new Uint8Array(rsoa.encodingLength(o))),tt||(tt=0);const nt=tt;return tt+=2,name$1.encode(o.mname,et,tt),tt+=name$1.encode.bytes,name$1.encode(o.rname,et,tt),tt+=name$1.encode.bytes,writeUInt32BE(et,o.serial||0,tt),tt+=4,writeUInt32BE(et,o.refresh||0,tt),tt+=4,writeUInt32BE(et,o.retry||0,tt),tt+=4,writeUInt32BE(et,o.expire||0,tt),tt+=4,writeUInt32BE(et,o.minimum||0,tt),tt+=4,writeUInt16BE(et,tt-nt-2,nt),rsoa.encode.bytes=tt-nt,et},decode(o,et){et||(et=0);const tt=et,nt={};return et+=2,nt.mname=name$1.decode(o,et),et+=name$1.decode.bytes,nt.rname=name$1.decode(o,et),et+=name$1.decode.bytes,nt.serial=readUInt32BE(o,et),et+=4,nt.refresh=readUInt32BE(o,et),et+=4,nt.retry=readUInt32BE(o,et),et+=4,nt.expire=readUInt32BE(o,et),et+=4,nt.minimum=readUInt32BE(o,et),et+=4,rsoa.decode.bytes=et-tt,nt},encodingLength(o){return 22+name$1.encodingLength(o.mname)+name$1.encodingLength(o.rname)}}),rtxt=codec({encode(o,et,tt){Array.isArray(o)||(o=[o]);for(let rt=0;rt0;){const ot=o[et++];if(--nt,ntnew Uint8Array(o),roption=codec({encode(o,et,tt){et||(et=new Uint8Array(roption.encodingLength(o))),tt||(tt=0);const nt=tt,rt=toCode(o.code);if(writeUInt16BE(et,rt,tt),tt+=2,o.data)writeUInt16BE(et,o.data.length,tt),tt+=2,copy(o.data,et,tt),tt+=o.data.length;else switch(rt){case 8:{const ot=o.sourcePrefixLength||0,it=o.family||familyOf(o.ip),st=encode$2(o.ip,alloc),at=Math.ceil(ot/8);writeUInt16BE(et,at+4,tt),tt+=2,writeUInt16BE(et,it,tt),tt+=2,et[tt++]=ot,et[tt++]=o.scopePrefixLength||0,copy(st,et,tt,0,at),tt+=at}break;case 11:o.timeout?(writeUInt16BE(et,2,tt),tt+=2,writeUInt16BE(et,o.timeout,tt),tt+=2):(writeUInt16BE(et,0,tt),tt+=2);break;case 12:{const ot=o.length||0;writeUInt16BE(et,ot,tt),tt+=2,et.fill(0,tt,tt+ot),tt+=ot}break;case 14:{const ot=o.tags.length*2;writeUInt16BE(et,ot,tt),tt+=2;for(const it of o.tags)writeUInt16BE(et,it,tt),tt+=2}break;default:throw new Error(`Unknown roption code: ${o.code}`)}return roption.encode.bytes=tt-nt,et},decode(o,et){et||(et=0);const tt={};tt.code=readUInt16BE(o,et),tt.type=toString$2(tt.code),et+=2;const nt=readUInt16BE(o,et);switch(et+=2,tt.data=o.slice(et,et+nt),tt.code){case 8:tt.family=readUInt16BE(o,et),et+=2,tt.sourcePrefixLength=o[et++],tt.scopePrefixLength=o[et++];{const rt=new Uint8Array(tt.family===1?4:16);copy(o,rt,0,et,et+nt-4),tt.ip=decode$3(rt)}break;case 11:nt>0&&(tt.timeout=readUInt16BE(o,et),et+=2);break;case 14:tt.tags=[];for(let rt=0;rt0;)nt[ot++]=roption.decode(o,et),et+=roption.decode.bytes,rt-=roption.decode.bytes;return ropt.decode.bytes=et-tt,nt},encodingLength(o){return 2+encodingLengthList(o||[],roption)}}),rdnskey=codec({encode(o,et,tt){et||(et=new Uint8Array(rdnskey.encodingLength(o))),tt||(tt=0);const nt=tt,rt=o.key;if(!isU8Arr(rt))throw new Error("Key must be a Buffer");return tt+=2,writeUInt16BE(et,o.flags,tt),tt+=2,et[tt]=rdnskey.PROTOCOL_DNSSEC,tt+=1,et[tt]=o.algorithm,tt+=1,copy(rt,et,tt,0,rt.length),tt+=rt.length,rdnskey.encode.bytes=tt-nt,writeUInt16BE(et,rdnskey.encode.bytes-2,nt),et},decode(o,et){et||(et=0);const tt=et,nt={},rt=readUInt16BE(o,et);if(et+=2,nt.flags=readUInt16BE(o,et),et+=2,o[et]!==rdnskey.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return et+=1,nt.algorithm=o[et],et+=1,nt.key=o.slice(et,tt+rt+2),et+=nt.key.length,rdnskey.decode.bytes=et-tt,nt},encodingLength(o){return 6+bytelength(o.key)}});rdnskey.PROTOCOL_DNSSEC=3;rdnskey.ZONE_KEY=128;rdnskey.SECURE_ENTRYPOINT=32768;const rrrsig=codec({encode(o,et,tt){et||(et=new Uint8Array(rrrsig.encodingLength(o))),tt||(tt=0);const nt=tt,rt=o.signature;if(!isU8Arr(rt))throw new Error("Signature must be a Buffer");return tt+=2,writeUInt16BE(et,toType(o.typeCovered),tt),tt+=2,et[tt]=o.algorithm,tt+=1,et[tt]=o.labels,tt+=1,writeUInt32BE(et,o.originalTTL,tt),tt+=4,writeUInt32BE(et,o.expiration,tt),tt+=4,writeUInt32BE(et,o.inception,tt),tt+=4,writeUInt16BE(et,o.keyTag,tt),tt+=2,name$1.encode(o.signersName,et,tt),tt+=name$1.encode.bytes,copy(rt,et,tt,0,rt.length),tt+=rt.length,rrrsig.encode.bytes=tt-nt,writeUInt16BE(et,rrrsig.encode.bytes-2,nt),et},decode(o,et){et||(et=0);const tt=et,nt={},rt=readUInt16BE(o,et);return et+=2,nt.typeCovered=toString$6(readUInt16BE(o,et)),et+=2,nt.algorithm=o[et],et+=1,nt.labels=o[et],et+=1,nt.originalTTL=readUInt32BE(o,et),et+=4,nt.expiration=readUInt32BE(o,et),et+=4,nt.inception=readUInt32BE(o,et),et+=4,nt.keyTag=readUInt16BE(o,et),et+=2,nt.signersName=name$1.decode(o,et),et+=name$1.decode.bytes,nt.signature=o.slice(et,tt+rt+2),et+=nt.signature.length,rrrsig.decode.bytes=et-tt,nt},encodingLength(o){return 20+name$1.encodingLength(o.signersName)+bytelength(o.signature)}}),rrp=codec({encode(o,et,tt){et||(et=new Uint8Array(rrp.encodingLength(o))),tt||(tt=0);const nt=tt;return tt+=2,name$1.encode(o.mbox||".",et,tt),tt+=name$1.encode.bytes,name$1.encode(o.txt||".",et,tt),tt+=name$1.encode.bytes,rrp.encode.bytes=tt-nt,writeUInt16BE(et,rrp.encode.bytes-2,nt),et},decode(o,et){et||(et=0);const tt=et,nt={};return et+=2,nt.mbox=name$1.decode(o,et)||".",et+=name$1.decode.bytes,nt.txt=name$1.decode(o,et)||".",et+=name$1.decode.bytes,rrp.decode.bytes=et-tt,nt},encodingLength(o){return 2+name$1.encodingLength(o.mbox||".")+name$1.encodingLength(o.txt||".")}}),typebitmap=codec({encode(o,et,tt){et||(et=new Uint8Array(typebitmap.encodingLength(o))),tt||(tt=0);const nt=tt,rt=[];for(let ot=0;ot>8]===void 0&&(rt[it>>8]=[]),rt[it>>8][it>>3&31]|=1<<7-(it&7)}for(let ot=0;ot>8]=Math.max(et[rt>>8]||0,rt&255)}let tt=0;for(let nt=0;nt>15&1)===1,tt.options=ropt.decode(o,et+8),et+=8+ropt.decode.bytes;else{const rt=readUInt16BE(o,et+2);tt.ttl=readUInt32BE(o,et+4),tt.class=toString$3(rt&NOT_FLUSH_MASK),tt.flush=!!(rt&FLUSH_MASK);const ot=renc(tt.type);tt.data=ot.decode(o,et+8),et+=8+ot.decode.bytes}return answer.decode.bytes=et-nt,tt},encodingLength(o){const et=o.data!==null&&o.data!==void 0?o.data:o.options;return name$1.encodingLength(o.name)+8+renc(o.type).encodingLength(et)}}),question=codec({encode(o,et,tt){et||(et=new Uint8Array(question.encodingLength(o))),tt||(tt=0);const nt=tt;return name$1.encode(o.name,et,tt),tt+=name$1.encode.bytes,writeUInt16BE(et,toType(o.type),tt),tt+=2,writeUInt16BE(et,toClass(o.class===void 0?"IN":o.class),tt),tt+=2,question.encode.bytes=tt-nt,o},decode(o,et){et||(et=0);const tt=et,nt={};return nt.name=name$1.decode(o,et),et+=name$1.decode.bytes,nt.type=toString$6(readUInt16BE(o,et)),et+=2,nt.class=toString$3(readUInt16BE(o,et)),et+=2,!!(nt.class&QU_MASK)&&(nt.class&=NOT_QU_MASK),question.decode.bytes=et-tt,nt},encodingLength(o){return name$1.encodingLength(o.name)+4}}),RECURSION_DESIRED=256,packet={encode:function(o,et,tt){const nt=!et;nt&&(et=new Uint8Array(encodingLength(o))),tt||(tt=0);const rt=tt;return o.questions||(o.questions=[]),o.answers||(o.answers=[]),o.authorities||(o.authorities=[]),o.additionals||(o.additionals=[]),header.encode(o,et,tt),tt+=header.encode.bytes,tt=encodeList(o.questions,question,et,tt),tt=encodeList(o.answers,answer,et,tt),tt=encodeList(o.authorities,answer,et,tt),tt=encodeList(o.additionals,answer,et,tt),packet.encode.bytes=tt-rt,nt&&encode.bytes!==et.length?et.slice(0,encode.bytes):et},decode:function(o,et){et||(et=0);const tt=et,nt=header.decode(o,et);return et+=header.decode.bytes,et=decodeList(nt.questions,question,o,et),et=decodeList(nt.answers,answer,o,et),et=decodeList(nt.authorities,answer,o,et),et=decodeList(nt.additionals,answer,o,et),packet.decode.bytes=et-tt,nt},encodingLength:function(o){return header.encodingLength(o)+encodingLengthList(o.questions||[],question)+encodingLengthList(o.answers||[],answer)+encodingLengthList(o.authorities||[],answer)+encodingLengthList(o.additionals||[],answer)}};packet.encode.bytes=0;packet.decode.bytes=0;const encode=packet.encode,decode$1=packet.decode,encodingLength=packet.encodingLength;function encodingLengthList(o,et){let tt=0;for(let nt=0;nt255)throw new Error(`Character #${at} in charset [code=${ct}, char=${et.charAt(at)}] is too high! (max=255)`);if(rt[ct]!==0)throw new Error(`Character [code=${ct}, char=${et.charAt(at)}] is more than once in the charset!`);rt[ct]=at,ot[at]=ct}const it=tt.charCodeAt(0),st={name:o,encodingLength(at){const ct=at.length,lt=ct*.75|0;return at.charCodeAt(ct-1)===it?at.charCodeAt(ct-2)===it?lt-2:lt-1:lt},encode(at,ct,lt){ct==null&&(ct=new Uint8Array(st.encodingLength(at))),lt==null&&(lt=0);let dt=at.length;at.charCodeAt(dt-1)===it&&(at.charCodeAt(dt-2)===it?dt-=2:dt-=1);const ht=dt%4,pt=dt-ht;let mt=lt,ft=0;for(;ft>16,ct[mt++]=yt>>8,ct[mt++]=yt,ft+=4}if(ht===3){const yt=rt[at.charCodeAt(ft)]<<10|rt[at.charCodeAt(ft+1)]<<4|rt[at.charCodeAt(ft+2)]>>2;ct[mt++]=yt>>8,ct[mt++]=yt}else ht===2&&(ct[mt++]=rt[at.charCodeAt(ft)]<<2|rt[at.charCodeAt(ft+1)]>>4);return st.encode.bytes=mt-lt,ct},decode(at,ct,lt){ct==null&&(ct=0),lt==null&&(lt=at.length);const dt=lt-ct,ht=dt%3,pt=ct+dt-ht,mt=[];for(let ft=ct;ft>18&63],ot[yt>>12&63],ot[yt>>6&63],ot[yt&63])}if(ht===2){const ft=(at[lt-2]<<8)+at[lt-1];mt.push(ot[ft>>10],ot[ft>>4&63],ot[ft<<2&63]),nt===PREFERS_PADDING&&mt.push(it)}else if(ht===1){const ft=at[lt-1];mt.push(ot[ft>>2],ot[ft<<4&63]),nt===PREFERS_PADDING&&mt.push(it,it)}return st.decode.bytes=dt,String.fromCharCode.apply(String,mt)}};return st}make("base64","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","=",PREFERS_PADDING);const base64URL=make("base64-url","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_","=",PREFERS_NO_PADDING);let AbortError=typeof globalThis<"u"?globalThis.AbortError:typeof window<"u"?window.AbortError:null;AbortError||(AbortError=class extends Error{constructor(et="Request aborted."){super(et)}});AbortError.prototype.name="AbortError";AbortError.prototype.code="ABORT_ERR";const URL$1=typeof globalThis<"u"&&globalThis.URL||require("url").URL;class HTTPStatusError extends Error{constructor(et,tt,nt){super("status="+tt+" while requesting "+et+" ["+nt+"]"),this.uri=et,this.status=tt,this.method=nt}toJSON(){return{code:this.code,uri:this.uri,status:this.status,method:this.method,endpoint:this.endpoint}}}HTTPStatusError.prototype.name="HTTPStatusError";HTTPStatusError.prototype.code="HTTP_STATUS";class ResponseError extends Error{constructor(et,tt){super(et),this.cause=tt}toJSON(){return{message:this.message,endpoint:this.endpoint,code:this.code,cause:reduceError(this.cause)}}}ResponseError.prototype.name="ResponseError";ResponseError.prototype.code="RESPONSE_ERR";class TimeoutError extends Error{constructor(et){super("Timeout (t="+et+")."),this.timeout=et}toJSON(){return{code:this.code,endpoint:this.endpoint,timeout:this.timeout}}}TimeoutError.prototype.name="TimeoutError";TimeoutError.prototype.code="ETIMEOUT";const v4Regex=/^((\d{1,3}\.){3,3}\d{1,3})(:(\d{2,5}))?$/,v6Regex=/^((::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?)(:(\d{2,5}))?$/i;function reduceError(o){if(typeof o=="string")return{message:o};try{const tt=JSON.stringify(o);if(tt!=="{}")return JSON.parse(tt)}catch{}const et={message:String(o.message||o)};return o.code!==void 0&&(et.code=String(o.code)),et}const baseParts=/^(([a-z0-9]+:)\/\/)?([^/[\s:]+|\[[^\]]+\])?(:([^/\s]+))?(\/[^\s]*)?(.*)$/,httpFlags=/\[(post|get|((ipv4|ipv6|name)=([^\]]+)))\]/ig,updFlags=/\[(((pk|name)=([^\]]+)))\]/ig;function parseEndpoint(o){const et=baseParts.exec(o),tt=et[2]||"https:",nt=et[3],rt=et[5],ot=et[6],it=et[7];if(tt==="https:"||tt==="http:"){const st=parseFlags(it,httpFlags);return{name:st.name,protocol:tt,ipv4:st.ipv4,ipv6:st.ipv6,host:nt,port:rt,path:ot,method:st.post?"POST":"GET"}}if(tt==="udp:"||tt==="udp4:"||tt==="udp6:"){const st=parseFlags(it,updFlags),at=/^\[(.*)\]$/.exec(nt);if(at&&tt==="udp4:")throw new Error(`Endpoint parsing error: Cannot use ipv6 host with udp4: (endpoint=${o})`);if(!at&&tt==="udp6:")throw new Error(`Endpoint parsing error: Incorrectly formatted host for udp6: (endpoint=${o})`);return at?new UDP6Endpoint({protocol:"udp6:",ipv6:at[1],port:rt,pk:st.pk,name:st.name}):new UDP4Endpoint({protocol:"udp4:",ipv4:nt,port:rt,pk:st.pk,name:st.name})}throw new InvalidProtocolError(tt,o)}function parseFlags(o,et){et.lastIndex=0;const tt={};for(;;){const nt=et.exec(o);if(!nt)break;nt[2]?tt[nt[3].toLowerCase()]=nt[4]:tt[nt[1].toLowerCase()]=!0}return tt}class InvalidProtocolError extends Error{constructor(et,tt){super(`Invalid Endpoint: unsupported protocol "${et}" for endpoint: ${tt}, supported protocols: ${supportedProtocols.join(", ")}`),this.protocol=et,this.endpoint=tt}toJSON(){return{code:this.code,endpoint:this.endpoint,timeout:this.timeout}}}InvalidProtocolError.prototype.name="InvalidProtocolError";InvalidProtocolError.prototype.code="EPROTOCOL";const supportedProtocols=["http:","https:","udp4:","udp6:"];class BaseEndpoint{constructor(et,tt){this.name=et.name||null,this.protocol=et.protocol;const nt=typeof et.port=="string"?et.port=parseInt(et.port,10):et.port;if(nt==null)this.port=tt?this.protocol==="https:"?443:80:et.pk?443:53;else{if(typeof nt!="number"&&!isNaN(nt))throw new Error(`Invalid Endpoint: port "${et.port}" needs to be a number: ${JSON.stringify(et)}`);this.port=nt}}toJSON(){return this.toString()}}class UDPEndpoint extends BaseEndpoint{constructor(et){super(et,!1),this.pk=et.pk||null}toString(){const et=this.port!==(this.pk?443:53)?`:${this.port}`:"",tt=this.pk?` [pk=${this.pk}]`:"",nt=this.name?` [name=${this.name}]`:"";return`udp://${this.ipv4||`[${this.ipv6}]`}${et}${tt}${nt}`}}class UDP4Endpoint extends UDPEndpoint{constructor(et){if(super(Object.assign({protocol:"udp4:"},et)),!et.ipv4||typeof et.ipv4!="string")throw new Error(`Invalid Endpoint: .ipv4 "${et.ipv4}" needs to be set: ${JSON.stringify(et)}`);this.ipv4=et.ipv4}}class UDP6Endpoint extends UDPEndpoint{constructor(et){if(super(Object.assign({protocol:"udp6:"},et)),!et.ipv6||typeof et.ipv6!="string")throw new Error(`Invalid Endpoint: .ipv6 "${et.ipv6}" needs to be set: ${JSON.stringify(et)}`);this.ipv6=et.ipv6}}function safeHost(o){return v6Regex.test(o)&&!v4Regex.test(o)?`[${o}]`:o}class HTTPEndpoint extends BaseEndpoint{constructor(et){if(super(Object.assign({protocol:"https:"},et),!0),et.host||(et.ipv4&&(et.host=et.ipv4),et.ipv6&&(et.host=`[${et.ipv6}]`)),!et.host||typeof et.host!="string")throw new Error(`Invalid Endpoint: host "${et.path}" needs to be set: ${JSON.stringify(et)}`);if(this.host=et.host,this.path=et.path||"/dns-query",this.method=/^post$/i.test(et.method)?"POST":"GET",this.ipv4=et.ipv4,this.ipv6=et.ipv6,!this.ipv6){const nt=v6Regex.exec(this.host);nt&&(this.ipv6=nt[1])}this.ipv4||v4Regex.test(this.host)&&(this.ipv4=this.host);const tt=`${this.protocol}//${safeHost(this.host)}:${this.port}${this.path}`;try{this.url=new URL$1(tt)}catch(nt){throw new Error(nt.message+` [${tt}]`)}}toString(){const et=this.protocol==="https:"?"":"http://",tt=this.port!==(this.protocol==="https:"?443:80)?`:${this.port}`:"",nt=this.method!=="GET"?" [post]":"",rt=this.path==="/dns-query"?"":this.path,ot=this.name?` [name=${this.name}]`:"",it=this.ipv4&&this.ipv4!==this.host?` [ipv4=${this.ipv4}]`:"",st=this.ipv6&&this.ipv6!==this.host?` [ipv6=${this.ipv6}]`:"";return`${et}${safeHost(this.host)}${tt}${rt}${nt}${it}${st}${ot}`}}function toEndpoint(o){let et;if(typeof o=="string")et=parseEndpoint(o);else{if(typeof o!="object"||o===null||Array.isArray(o))throw new Error(`Can not convert ${o} to an endpoint`);if(o instanceof BaseEndpoint)return o;et=o}(et.protocol===null||et.protocol===void 0)&&(et.protocol="https:");const tt=et.protocol;if(tt==="udp4:")return new UDP4Endpoint(et);if(tt==="udp6:")return new UDP6Endpoint(et);if(tt==="https:"||tt==="http:")return new HTTPEndpoint(et);throw new InvalidProtocolError(tt,JSON.stringify(et))}const contentType="application/dns-message";function noop$1(){}function queryDns(){throw new Error('Only "doh" endpoints are supported in the browser')}async function loadJSON(o,et,tt,nt){const rt=et?et.localStoragePrefix+et.name:null;if(rt)try{const st=JSON.parse(localStorage.getItem(rt));if(st&&st.time>et.maxTime)return st}catch{}const{data:ot}=await requestRaw(o,"GET",null,tt,nt),it={time:Date.now(),data:JSON.parse(decode$2(ot))};if(rt)try{localStorage.setItem(rt,JSON.stringify(it))}catch{it.time=null}return it}function requestRaw(o,et,tt,nt,rt){return new Promise((ot,it)=>{const st=new URL$1(o);et==="GET"&&tt&&(st.search="?dns="+base64URL.decode(tt));const at=st.toString(),ct=new XMLHttpRequest;ct.open(et,at,!0),ct.setRequestHeader("Accept",contentType),et==="POST"&&ct.setRequestHeader("Content-Type",contentType),ct.responseType="arraybuffer",ct.timeout=nt,ct.ontimeout=lt,ct.onreadystatechange=ht,ct.onerror=mt,ct.onload=dt,et==="POST"?ct.send(tt):ct.send(),rt&&rt.addEventListener("abort",ft);function lt(){pt(new TimeoutError(nt));try{ct.abort()}catch{}}function dt(){if(ct.status!==200)pt(new HTTPStatusError(at,ct.status,et));else{let yt;if(typeof ct.response=="string")yt=encode$1(ct.response);else if(ct.response instanceof Uint8Array)yt=ct.response;else if(Array.isArray(ct.response)||ct.response instanceof ArrayBuffer)yt=new Uint8Array(ct.response);else throw new Error("Unprocessable response "+ct.response);pt(null,yt)}}function ht(){if(ct.readyState>1&&ct.status!==200&&ct.status!==0){pt(new HTTPStatusError(at,ct.status,et));try{ct.abort()}catch{}}}let pt=function(yt,gt){pt=noop$1,rt&&rt.removeEventListener("abort",ft),ot(yt?{error:yt,response:ct}:{data:gt,response:ct})};function mt(){pt(ct.status===200?new Error("Inexplicable XHR Error"):new HTTPStatusError(at,ct.status,et))}function ft(){pt(new AbortError);try{ct.abort()}catch{}}})}function request(o,et,tt,nt,rt){return requestRaw(o,et,tt,nt,rt)}function processResolvers$1(o){return o.filter(et=>et.cors||et.endpoint.cors)}const resolvers={data:[{name:"adfree.usableprivacy.net",endpoint:{protocol:"https:",host:"adfree.usableprivacy.net"},description:`Public updns DoH service with advertising, tracker and malware filters. +Hosted in Europe by @usableprivacy, details see: https://docs.usableprivacy.com`,country:"Germany",location:{lat:51.2993,long:9.491},filter:!0},{name:"adguard-dns-doh",endpoint:{protocol:"https:",host:"dns.adguard.com",ipv4:"94.140.15.15"},description:"Remove ads and protect your computer from malware (over DoH)",country:"France",location:{lat:48.8582,long:2.3387},filter:!0},{name:"adguard-dns-family-doh",endpoint:{protocol:"https:",host:"dns-family.adguard.com",ipv4:"94.140.15.16"},description:"Adguard DNS with safesearch and adult content blocking (over DoH)",country:"France",location:{lat:48.8582,long:2.3387},filter:!0},{name:"adguard-dns-unfiltered-doh",endpoint:{protocol:"https:",host:"dns-unfiltered.adguard.com",ipv4:"94.140.14.140"},description:"AdGuard public DNS servers without filters (over DoH)",country:"France",location:{lat:48.8582,long:2.3387}},{name:"ahadns-doh-chi",endpoint:{protocol:"https:",host:"doh.chi.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Chicago, USA. By https://ahadns.com/ +Server statistics can be seen at: https://statistics.ahadns.com/?server=chi`,country:"United States",location:{lat:41.8483,long:-87.6517},filter:!0,cors:!0},{name:"ahadns-doh-in",endpoint:{protocol:"https:",host:"doh.in.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Mumbai, India. By https://ahadns.com/ +Server statistics can be seen at: https://statistics.ahadns.com/?server=in`,country:"India",location:{lat:19.0748,long:72.8856},filter:!0,cors:!0},{name:"ahadns-doh-la",endpoint:{protocol:"https:",host:"doh.la.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Los Angeles, USA. By https://ahadns.com/ +Server statistics can be seen at: https://statistics.ahadns.com/?server=la`,country:"United States",location:{lat:34.0549,long:-118.2578},filter:!0,cors:!0},{name:"ahadns-doh-nl",endpoint:{protocol:"https:",host:"doh.nl.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Amsterdam, Netherlands. By https://ahadns.com/ +Server statistics can be seen at: https://statistics.ahadns.com/?server=nl`,country:"Netherlands",location:{lat:52.3824,long:4.8995},filter:!0,cors:!0},{name:"ahadns-doh-ny",endpoint:{protocol:"https:",host:"doh.ny.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in New York. By https://ahadns.com/ +Server statistics can be seen at: https://statistics.ahadns.com/?server=ny`,country:"United States",location:{lat:40.7308,long:-73.9975},filter:!0,cors:!0},{name:"ahadns-doh-pl",endpoint:{protocol:"https:",host:"doh.pl.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Poland. By https://ahadns.com/ +Server statistics can be seen at: https://statistics.ahadns.com/?server=pl`,country:"Netherlands",location:{lat:52.3824,long:4.8995},filter:!0,cors:!0},{name:"alidns-doh",endpoint:{protocol:"https:",host:"dns.alidns.com",ipv4:"223.5.5.5",cors:!0},description:`A public DNS resolver that supports DoH/DoT in mainland China, provided by Alibaba-Cloud. +Warning: GFW filtering rules are applied by that resolver. +Homepage: https://alidns.com/`,country:"China",location:{lat:34.7725,long:113.7266},filter:!0,log:!0,cors:!0},{name:"ams-ads-doh-nl",endpoint:{protocol:"https:",host:"dnsnl-noads.alekberg.net"},description:"Resolver in Amsterdam. DoH protocol. Non-logging. Blocks ads, malware and trackers. DNSSEC enabled.",country:"Romania",location:{lat:45.9968,long:24.997},filter:!0},{name:"ams-doh-nl",endpoint:{protocol:"https:",host:"dnsnl.alekberg.net"},description:"Resolver in Amsterdam. DoH protocol. Non-logging, non-filtering, DNSSEC.",country:"Romania",location:{lat:45.9968,long:24.997}},{name:"att",endpoint:{protocol:"https:",host:"dohtrial.att.net"},description:"AT&T test DoH server.",log:!0},{name:"bcn-ads-doh",endpoint:{protocol:"https:",host:"dnses-noads.alekberg.net"},description:"Resolver in Spain. DoH protocol. Non-logging, remove ads and malware, DNSSEC.",country:"Spain",location:{lat:41.3891,long:2.1611},filter:!0},{name:"bcn-doh",endpoint:{protocol:"https:",host:"dnses.alekberg.net"},description:"Resolver in Spain. DoH protocol. Non-logging, non-filtering, DNSSEC.",country:"Spain",location:{lat:41.3891,long:2.1611}},{name:"brahma-world",endpoint:{protocol:"https:",host:"dns.brahma.world"},description:`DNS-over-HTTPS server. Non Logging, filters ads, trackers and malware. DNSSEC ready, QNAME Minimization, No EDNS Client-Subnet. +Hosted in Stockholm, Sweden. (https://dns.brahma.world)`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"cisco-doh",endpoint:{protocol:"https:",host:"doh.opendns.com",ipv4:"146.112.41.2"},description:`Remove your DNS blind spot (DoH protocol) +Warning: modifies your queries to include a copy of your network +address when forwarding them to a selection of companies and organizations.`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0,log:!0},{name:"cloudflare",endpoint:{protocol:"https:",host:"dns.cloudflare.com",ipv4:"1.0.0.1",cors:!0},description:"Cloudflare DNS (anycast) - aka 1.1.1.1 / 1.0.0.1",country:"Australia",location:{lat:-33.494,long:143.2104},cors:!0},{name:"cloudflare-family",endpoint:{protocol:"https:",host:"family.cloudflare-dns.com",ipv4:"1.0.0.3",cors:!0},description:"Cloudflare DNS (anycast) with malware protection and parental control - aka 1.1.1.3 / 1.0.0.3",country:"Australia",location:{lat:-33.494,long:143.2104},filter:!0,cors:!0},{name:"cloudflare-ipv6",endpoint:{protocol:"https:",host:"1dot1dot1dot1.cloudflare-dns.com",cors:!0},description:"Cloudflare DNS over IPv6 (anycast)",country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"cloudflare-security",endpoint:{protocol:"https:",host:"security.cloudflare-dns.com",ipv4:"1.0.0.2",cors:!0},description:"Cloudflare DNS (anycast) with malware blocking - aka 1.1.1.2 / 1.0.0.2",country:"Australia",location:{lat:-33.494,long:143.2104},filter:!0,cors:!0},{name:"controld-block-malware",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p1"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns +This DNS blocks Malware domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-block-malware-ad",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p2"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns +This DNS blocks Malware, Ads & Tracking domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-block-malware-ad-social",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p3"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns +This DNS blocks Malware, Ads & Tracking and Social Networks domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-family-friendly",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/family"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns +This DNS blocks Malware, Ads & Tracking, Adult Content and Drugs domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-uncensored",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/uncensored"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns +This DNS unblocks censored domains from various countries.`,country:"Canada",location:{lat:43.6319,long:-79.3716}},{name:"controld-unfiltered",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p0"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns +This is a Unfiltered DNS, no DNS record blocking or manipulation here, if you want to block Malware, Ads & Tracking or Social Network domains, use the other ControlD DNS configs.`,country:"Canada",location:{lat:43.6319,long:-79.3716}},{name:"dns.digitale-gesellschaft.ch",endpoint:{protocol:"https:",host:"dns.digitale-gesellschaft.ch"},description:`Public DoH resolver operated by the Digital Society (https://www.digitale-gesellschaft.ch). +Hosted in Zurich, Switzerland. +Non-logging, non-filtering, supports DNSSEC.`,country:"Switzerland",location:{lat:47.1449,long:8.1551}},{name:"dns.ryan-palmer",endpoint:{protocol:"https:",host:"dns1.ryan-palmer.com"},description:"Non-logging, non-filtering, DNSSEC DoH Server. Hosted in the UK.",country:"United Kingdom",location:{lat:51.5164,long:-.093}},{name:"dns.sb",endpoint:{protocol:"https:",host:"doh.sb",ipv4:"185.222.222.222",cors:!0},description:`DNSSEC-enabled DoH server by https://xtom.com/ +https://dns.sb/doh/`,country:"Unknown",location:{lat:47,long:8},cors:!0},{name:"dns.therifleman.name",endpoint:{protocol:"https:",host:"dns.therifleman.name"},description:`DNS-over-HTTPS DNS forwarder from Mumbai, India. Blocks web and Android trackers and ads. +IP addresses are not logged, but queries are logged for 24 hours for debugging. +Report issues, send suggestions @ joker349 at protonmail.com. +Also supports DoT (for android) @ dns.therifleman.name and plain DNS @ 172.104.206.174`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"dnsforfamily-doh",endpoint:{protocol:"https:",host:"dns-doh.dnsforfamily.com"},description:`(DoH Protocol) (Now supports DNSSEC). Block adult websites, gambling websites, malwares and advertisements. +It also enforces safe search in: Google, YouTube, Bing, DuckDuckGo and Yandex. +Social websites like Facebook and Instagram are not blocked. No DNS queries are logged. +As of 26-May-2022 5.9 million websites are blocked and new websites are added to blacklist daily. +Completely free, no ads or any commercial motive. Operating for 4 years now. +Provided by: https://dnsforfamily.com`,country:"Finland",location:{lat:60.1758,long:24.9349},filter:!0},{name:"dnsforfamily-doh-no-safe-search",endpoint:{protocol:"https:",host:"dns-doh-no-safe-search.dnsforfamily.com"},description:`(DoH Protocol) (Now supports DNSSEC) Block adult websites, gambling websites, malwares and advertisements. +Unlike other dnsforfamily servers, this one does not enforces safe search. So Google, YouTube, Bing, DuckDuckGo and Yandex are completely accessible without any restriction. +Social websites like Facebook and Instagram are not blocked. No DNS queries are logged. +As of 26-May-2022 5.9 million websites are blocked and new websites are added to blacklist daily. +Completely free, no ads or any commercial motive. Operating for 4 years now. +Warning: This server is incompatible with anonymization. +Provided by: https://dnsforfamily.com`,country:"Finland",location:{lat:60.1758,long:24.9349},filter:!0},{name:"dnsforge.de",endpoint:{protocol:"https:",host:"dnsforge.de",cors:!0},description:`Public DoH resolver running with Pihole for Adblocking (https://dnsforge.de). +Non-logging, AD-filtering, supports DNSSEC. Hosted in Germany.`,country:"Germany",location:{lat:52.2998,long:9.447},filter:!0,cors:!0},{name:"dnshome-doh",endpoint:{protocol:"https:",host:"dns.dnshome.de"},description:"https://www.dnshome.de/ public resolver in Germany"},{name:"dnspod-doh",endpoint:{protocol:"https:",host:"doh.pub",cors:!0},description:`A public DNS resolver in mainland China provided by DNSPod (Tencent Cloud). +https://www.dnspod.cn/Products/Public.DNS?lang=en`,filter:!0,log:!0,cors:!0},{name:"dnswarden-asia-adblock-dohv4",endpoint:{protocol:"https:",host:"doh.asia.dnswarden.com",path:"/adblock"},description:"Hosted in Singapore. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Singapore",location:{lat:1.2929,long:103.8547},filter:!0},{name:"dnswarden-asia-adultfilter-dohv4",endpoint:{protocol:"https:",host:"doh.asia.dnswarden.com",path:"/adultfilter"},description:"Hosted in Singapore. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Singapore",location:{lat:1.2929,long:103.8547},filter:!0},{name:"dnswarden-asia-uncensor-dohv4",endpoint:{protocol:"https:",host:"doh.asia.dnswarden.com",path:"/uncensored"},description:"Hosted in Singapore. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Singapore",location:{lat:1.2929,long:103.8547}},{name:"dnswarden-eu-adblock-dohv4",endpoint:{protocol:"https:",host:"doh.eu.dnswarden.com"},description:"Hosted in Germany. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Germany",location:{lat:50.1103,long:8.7147},filter:!0},{name:"dnswarden-us-adblock-dohv4",endpoint:{protocol:"https:",host:"doh.us.dnswarden.com"},description:"Hosted in USA (Dallas) . For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"United States",location:{lat:32.7889,long:-96.8021},filter:!0},{name:"doh-ch-blahdns",endpoint:{protocol:"https:",host:"doh-ch.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Switzerland. By https://blahdns.com/",country:"Netherlands",location:{lat:52.3824,long:4.8995},filter:!0,cors:!0},{name:"doh-cleanbrowsing-adult",endpoint:{protocol:"https:",host:"doh.cleanbrowsing.org",path:"/doh/adult-filter/",cors:!0},description:`Blocks access to all adult, pornographic and explicit sites. It does +not block proxy or VPNs, nor mixed-content sites. Sites like Reddit +are allowed. Google and Bing are set to the Safe Mode. +By https://cleanbrowsing.org/`,filter:!0,cors:!0},{name:"doh-cleanbrowsing-family",endpoint:{protocol:"https:",host:"doh.cleanbrowsing.org",path:"/doh/family-filter/",cors:!0},description:`Blocks access to all adult, pornographic and explicit sites. It also +blocks proxy and VPN domains that are used to bypass the filters. +Mixed content sites (like Reddit) are also blocked. Google, Bing and +Youtube are set to the Safe Mode. +By https://cleanbrowsing.org/`,filter:!0,cors:!0},{name:"doh-cleanbrowsing-security",endpoint:{protocol:"https:",host:"doh.cleanbrowsing.org",path:"/doh/security-filter/",cors:!0},description:`Block access to phishing, malware and malicious domains. It does not block adult content. +By https://cleanbrowsing.org/`,filter:!0,cors:!0},{name:"doh-crypto-sx",endpoint:{protocol:"https:",host:"doh.crypto.sx",cors:!0},description:`DNS-over-HTTPS server. Anycast, no logs, no censorship, DNSSEC. +Backend hosted by Scaleway, globally cached via Cloudflare. +Maintained by Frank Denis.`,country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"doh-crypto-sx-ipv6",endpoint:{protocol:"https:",host:"doh-ipv6.crypto.sx",cors:!0},description:`DNS-over-HTTPS server accessible over IPv6. Anycast, no logs, no censorship, DNSSEC. +Backend hosted by Scaleway, globally cached via Cloudflare. +Maintained by Frank Denis.`,country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"doh-de-blahdns",endpoint:{protocol:"https:",host:"doh-de.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Germany. By https://blahdns.com/",country:"Germany",location:{lat:51.2993,long:9.491},filter:!0,cors:!0},{name:"doh-fi-blahdns",endpoint:{protocol:"https:",host:"doh-fi.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Finland. By https://blahdns.com/",country:"Finland",location:{lat:60.1758,long:24.9349},filter:!0,cors:!0},{name:"doh-ibksturm",endpoint:{protocol:"https:",host:"ibksturm.synology.me"},description:`DoH & DoT Server, No Logging, No Filters, DNSSEC +Running privately by ibksturm in Thurgau, Switzerland`},{name:"doh-jp-blahdns",endpoint:{protocol:"https:",host:"doh-jp.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Japan. By https://blahdns.com/",country:"Japan",location:{lat:35.6882,long:139.7532},filter:!0,cors:!0},{name:"doh.ffmuc.net",endpoint:{protocol:"https:",host:"doh.ffmuc.net"},description:`An open (non-logging, non-filtering, non-censoring) DoH resolver operated by Freifunk Munich with nodes in DE. +https://ffmuc.net/`,country:"Germany",location:{lat:51.2993,long:9.491}},{name:"doh.tiarap.org",endpoint:{protocol:"https:",host:"doh.tiarap.org"},description:`Non-Logging DNS-over-HTTPS server, cached via Cloudflare. +Filters out ads, trackers and malware, NO ECS, supports DNSSEC.`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"google",endpoint:{protocol:"https:",host:"dns.google",ipv4:"8.8.8.8",cors:!0},description:"Google DNS (anycast)",country:"United States",location:{lat:37.751,long:-97.822},log:!0,cors:!0},{name:"hdns",endpoint:{protocol:"https:",host:"query.hdns.io",cors:!0},description:`HDNS is a public DNS resolver that supports Handshake domains. +https://www.hdns.io`,country:"United States",location:{lat:37.7771,long:-122.406},cors:!0},{name:"he",endpoint:{protocol:"https:",host:"ordns.he.net"},description:`Hurricane Electric DoH server (anycast) +Unknown logging policy.`,country:"United States",location:{lat:37.751,long:-97.822},log:!0},{name:"id-gmail-doh",endpoint:{protocol:"https:",host:"doh.tiar.app"},description:`Non-Logging DNS-over-HTTPS server located in Singapore. +Filters out ads, trackers and malware, supports DNSSEC, provided by id-gmail.`,country:"Singapore",location:{lat:1.2929,long:103.8547},filter:!0},{name:"iij",endpoint:{protocol:"https:",host:"public.dns.iij.jp"},description:`DoH server operated by Internet Initiative Japan in Tokyo. +https://www.iij.ad.jp/`,country:"Japan",location:{lat:35.69,long:139.69},log:!0},{name:"iqdns-doh",endpoint:{protocol:"https:",host:"a.passcloud.xyz"},description:`Non-logging DoH service runned by V2EX.com user johnsonwil. +Returns "no such domain" for anti-Chinese government websites. Supports DNSSEC. +For more information: https://www.v2ex.com/t/785666`,filter:!0},{name:"jp.tiar.app-doh",endpoint:{protocol:"https:",host:"jp.tiar.app"},description:`Non-Logging, Non-Filtering DNS-over-HTTPS server in Japan. +No ECS, Support DNSSEC`,country:"Japan",location:{lat:35.6882,long:139.7532}},{name:"jp.tiarap.org",endpoint:{protocol:"https:",host:"jp.tiarap.org"},description:`DNS-over-HTTPS Server. Non-Logging, Non-Filtering, No ECS, Support DNSSEC. +Cached via Cloudflare.`},{name:"libredns",endpoint:{protocol:"https:",host:"doh.libredns.gr"},description:`DoH server in Germany. No logging, but no DNS padding and no DNSSEC support. +https://libredns.gr/`,country:"Germany",location:{lat:51.2993,long:9.491}},{name:"nextdns",endpoint:{protocol:"https:",host:"anycsast.dns.nextdns.io"},description:`NextDNS is a cloud-based private DNS service that gives you full control +over what is allowed and what is blocked on the Internet. +DNSSEC, Anycast, Non-logging, NoFilters +https://www.nextdns.io/`,country:"Netherlands",location:{lat:52.3891,long:4.6563}},{name:"nextdns-ultralow",endpoint:{protocol:"https:",host:"dns.nextdns.io",path:"/dnscrypt-proxy"},description:`NextDNS is a cloud-based private DNS service that gives you full control +over what is allowed and what is blocked on the Internet. +https://www.nextdns.io/ +To select the server location, the "-ultralow" variant relies on bootstrap servers +instead of anycast.`},{name:"njalla-doh",endpoint:{protocol:"https:",host:"dns.njal.la",cors:!0},description:`Non-logging DoH server in Sweden operated by Njalla. +https://dns.njal.la/`,country:"Sweden",location:{lat:59.3247,long:18.056},cors:!0},{name:"odoh-cloudflare",endpoint:{protocol:"https:",host:"odoh.cloudflare-dns.com",cors:!0},description:`Cloudflare ODoH server. +https://cloudflare.com`,cors:!0},{name:"odoh-crypto-sx",endpoint:{protocol:"https:",host:"odoh.crypto.sx",cors:!0},description:`ODoH target server. Anycast, no logs. +Backend hosted by Scaleway. Maintained by Frank Denis.`,cors:!0},{name:"odoh-id-gmail",endpoint:{protocol:"https:",host:"doh.tiar.app",path:"/odoh"},description:`ODoH target server. Based in Singapore, no logs. +Filter ads, trackers and malware.`,filter:!0},{name:"odoh-jp.tiar.app",endpoint:{protocol:"https:",host:"jp.tiar.app",path:"/odoh"},description:"ODoH target server. no logs."},{name:"odoh-jp.tiarap.org",endpoint:{protocol:"https:",host:"jp.tiarap.org",path:"/odoh"},description:"ODoH target server via Cloudflare, no logs."},{name:"odoh-resolver4.dns.openinternet.io",endpoint:{protocol:"https:",host:"resolver4.dns.openinternet.io"},description:`ODoH target server. no logs, no filter, DNSSEC. +Running on dedicated hardware colocated at Sonic.net in Santa Rosa, CA in the United States. +Uses Sonic's recusrive DNS servers as upstream resolvers (but is not affiliated with Sonic +in any way). Provided by https://openinternet.io`},{name:"odoh-tiarap.org",endpoint:{protocol:"https:",host:"doh.tiarap.org",path:"/odoh"},description:`ODoH target server via Cloudflare, no logs. +Filter ads, trackers and malware.`,filter:!0},{name:"publicarray-au2-doh",endpoint:{protocol:"https:",host:"doh-2.seby.io",cors:!0},description:`DNSSEC • OpenNIC • Non-logging • Uncensored - hosted on ovh.com.au +Maintained by publicarray - https://dns.seby.io`,country:"Australia",location:{lat:-33.8591,long:151.2002},cors:!0},{name:"puredns-doh",endpoint:{protocol:"https:",host:"puredns.org",ipv4:"146.190.6.13",cors:!0},description:`Public uncensored DNS resolver in Singapore - https://puredns.org +** Only available in Indonesia and Singapore **`,country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"quad101",endpoint:{protocol:"https:",host:"dns.twnic.tw",cors:!0},description:`DNSSEC-aware public resolver by the Taiwan Network Information Center (TWNIC) +https://101.101.101.101/index_en.html`,cors:!0},{name:"quad9-doh-ip4-port443-filter-ecs-pri",endpoint:{protocol:"https:",host:"dns11.quad9.net",ipv4:"149.112.112.11"},description:"Quad9 (anycast) dnssec/no-log/filter/ecs 9.9.9.11 - 149.112.112.11",country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"quad9-doh-ip4-port443-filter-pri",endpoint:{protocol:"https:",host:"dns.quad9.net",ipv4:"149.112.112.112"},description:"Quad9 (anycast) dnssec/no-log/filter 9.9.9.9 - 149.112.112.9 - 149.112.112.112",country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"quad9-doh-ip4-port443-nofilter-ecs-pri",endpoint:{protocol:"https:",host:"dns12.quad9.net",ipv4:"9.9.9.12"},description:"Quad9 (anycast) no-dnssec/no-log/no-filter/ecs 9.9.9.12 - 149.112.112.12",country:"United States",location:{lat:37.751,long:-97.822}},{name:"quad9-doh-ip4-port443-nofilter-pri",endpoint:{protocol:"https:",host:"dns10.quad9.net",ipv4:"149.112.112.10"},description:"Quad9 (anycast) no-dnssec/no-log/no-filter 9.9.9.10 - 149.112.112.10",country:"United States",location:{lat:37.751,long:-97.822}},{name:"quad9-doh-ip6-port5053-filter-pri",endpoint:{protocol:"https:",host:"dns9.quad9.net"},description:"Quad9 (anycast) dnssec/no-log/filter 2620:fe::fe - 2620:fe::9 - 2620:fe::fe:9",country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"safesurfer-doh",endpoint:{protocol:"https:",host:"doh.safesurfer.io"},description:`Family safety focused blocklist for over 2 million adult sites, as well as phishing and malware and more. +Free to use, paid for customizing blocking for more categories+sites and viewing usage at my.safesurfer.io. Logs taken for viewing +usage, data never sold - https://safesurfer.io`,filter:!0,log:!0},{name:"sth-ads-doh-se",endpoint:{protocol:"https:",host:"dnsse-noads.alekberg.net"},description:"Resolver in Stockholm, Sweden. DoH server. Non-logging, remove ads and malware, DNSSEC.",country:"Bulgaria",location:{lat:42.696,long:23.332},filter:!0},{name:"sth-doh-se",endpoint:{protocol:"https:",host:"dnsse.alekberg.net"},description:"Resolver in Stockholm, Sweden. DoH server. Non-logging, non-filtering, DNSSEC.",country:"Bulgaria",location:{lat:42.696,long:23.332}},{name:"switch",endpoint:{protocol:"https:",host:"dns.switch.ch"},description:`Public DoH service provided by SWITCH in Switzerland +https://www.switch.ch +Provides protection against malware, but does not block ads.`,filter:!0},{name:"uncensoreddns-dk-ipv4",endpoint:{protocol:"https:",host:"unicast.uncensoreddns.org"},description:`Also known as censurfridns. +DoH, no logs, no filter, DNSSEC, unicast hosted in Denmark - https://blog.uncensoreddns.org`,country:"Denmark",location:{lat:55.7123,long:12.0564}},{name:"uncensoreddns-ipv4",endpoint:{protocol:"https:",host:"anycast.uncensoreddns.org"},description:`Also known as censurfridns. +DoH, no logs, no filter, DNSSEC, anycast - https://blog.uncensoreddns.org`,country:"Denmark",location:{lat:55.7123,long:12.0564}},{name:"v.dnscrypt.uk-doh-ipv4",endpoint:{protocol:"https:",host:"v.dnscrypt.uk"},description:`DoH, no logs, uncensored, DNSSEC. Hosted in London UK on Digital Ocean +https://www.dnscrypt.uk`,country:"United Kingdom",location:{lat:51.4964,long:-.1224}}],time:1654187067783};function processResolvers(o){const et=o.time===null||o.time===void 0?Date.now():o.time,tt=processResolvers$1(o.data.map(rt=>(rt.endpoint=toEndpoint(Object.assign({name:rt.name},rt.endpoint)),rt))),nt=tt.map(rt=>rt.endpoint);return{data:{resolvers:tt,resolverByName:tt.reduce((rt,ot)=>(rt[ot.name]=ot,rt),{}),endpoints:nt,endpointByName:nt.reduce((rt,ot)=>(rt[ot.name]=ot,rt),{})},time:et}}const backup=processResolvers(resolvers);function toMultiQuery(o){const et=Object.assign({type:"query"},o);return delete et.question,et.questions=[],o.question&&et.questions.push(o.question),et}function queryOne(o,et,tt,nt){return nt&&nt.aborted?Promise.reject(new AbortError):o.protocol==="udp4:"||o.protocol==="udp6:"?queryDns():queryDoh(o,et,tt,nt)}function queryDoh(o,et,tt,nt){return request(o.url,o.method,encode(Object.assign({flags:RECURSION_DESIRED},et)),tt,nt).then(function(rt){const ot=rt.data,it=rt.response;let st=rt.error;if(st===void 0)if(ot.length===0)st=new ResponseError("Empty.");else try{const at=decode$1(ot);return at.response=it,at}catch(at){st=new ResponseError("Invalid packet (cause="+at.message+")",at)}throw Object.assign(st,{response:it})})}const UPDATE_URL=new URL$1("https://martinheidegger.github.io/dns-query/resolvers.json");function isNameString(o){return/^@/.test(o)}class Wellknown{constructor(et){this.opts=Object.assign({timeout:5e3,update:!0,updateURL:UPDATE_URL,persist:!1,localStoragePrefix:"dnsquery_",maxAge:3e5},et),this._dataP=null}_data(et,tt){return!et&&this._dataP!==null?this._dataP.then(nt=>nt.timeprocessResolvers({data:nt.data.resolvers,time:nt.time})).catch(()=>tt||backup):Promise.resolve(backup),this._dataP)}data(){return this._data(!1).then(et=>et.data)}endpoints(et){if(et==null)return this.data().then(tt=>tt.endpoints);if(et==="doh"&&(et=filterDoh),et==="dns"&&(et=filterDns),typeof et=="function")return this.data().then(tt=>tt.endpoints.filter(et));if(typeof et=="string"||typeof et[Symbol.iterator]!="function")return Promise.reject(new Error(`Endpoints (${et}) needs to be iterable (array).`));if(et=Array.from(et).filter(Boolean),et.findIndex(isNameString)===-1)try{return Promise.resolve(et.map(toEndpoint))}catch(tt){return Promise.reject(tt)}return this.data().then(tt=>et.map(nt=>{if(isNameString(nt)){const rt=tt.endpointByName[nt.substring(1)];if(!rt)throw new Error(`Endpoint ${nt} is not known.`);return rt}return toEndpoint(nt)}))}}const wellknown=new Wellknown;function isPromise(o){return o===null||typeof o!="object"?!1:typeof o.then=="function"}function toPromise(o){return isPromise(o)?o:Promise.resolve(o)}function query(o,et){return et=Object.assign({retries:5,timeout:3e4},et),o.question?toPromise(et.endpoints).then(tt=>{if(!Array.isArray(tt)||tt.length===0)throw new Error("No endpoints defined to lookup dns records.");return queryN(tt.map(toEndpoint),toMultiQuery(o),et)}).then(tt=>(tt.question=tt.questions[0],delete tt.questions,tt)):Promise.reject(new Error("To request data you need to specify a .question!"))}function queryN(o,et,tt){const nt=o.length===1?o[0]:o[Math.floor(Math.random()*o.length)%o.length];return queryOne(nt,et,tt.timeout,tt.signal).then(rt=>(rt.endpoint=nt.toString(),rt),rt=>{if(rt.name==="AbortError"||tt.retries===0)throw rt.endpoint=nt.toString(),rt;return tt.retries>0&&(tt.retries-=1),queryN(o,et,tt)})}function filterDoh(o){return o.protocol==="https:"||o.protocol==="http:"}function filterDns(o){return o.protocol==="udp4:"||o.protocol==="udp6:"}const log$7=new Logger$1("dns-over-https");class DnsOverHttps{constructor(et,tt=3){Ct(this,"endpoints");Ct(this,"retries");this.endpoints=et,this.retries=tt}static async create(et,tt){const nt=et??await wellknown.endpoints("doh");return new DnsOverHttps(nt,tt)}async resolveTXT(et){let tt;try{tt=(await query({question:{type:"TXT",name:et}},{endpoints:this.endpoints,retries:this.retries})).answers}catch(ot){throw log$7.error("query failed: ",ot),new Error("DNS query failed")}if(!tt)throw new Error(`Could not resolve ${et}`);const nt=tt.map(ot=>ot.data),rt=[];return nt.forEach(ot=>{typeof ot=="string"?rt.push(ot):Array.isArray(ot)?ot.forEach(it=>{typeof it=="string"?rt.push(it):rt.push(bytesToUtf8(it))}):rt.push(bytesToUtf8(ot))}),rt}}var base32$1={exports:{}};(function(o){var et={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};/* + * [hi-base32]{@link https://github.com/emn178/hi-base32} + * + * @version 0.5.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2018 + * @license MIT + */(function(){var tt=typeof window=="object"?window:{},nt=!tt.HI_BASE32_NO_NODE_JS&&typeof et=="object"&&et.versions&&et.versions.node;nt&&(tt=globalThis);var rt=!tt.HI_BASE32_NO_COMMON_JS&&!0&&o.exports,ot="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),it={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},st=[0,0,0,0,0,0,0,0],at=function(gt,xt){xt.length>10&&(xt="..."+xt.substr(-10));var vt=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+gt+" bytes: "+xt+" <-");throw vt.position=gt,vt},ct=function(gt){for(var xt="",vt=gt.length,bt=0,Et=0,wt,kt;bt191&&wt<=223?(kt=wt&31,Et=1):wt<=239?(kt=wt&15,Et=2):wt<=247?(kt=wt&7,Et=3):at(bt,xt);for(var Tt=0;Tt191)&&at(bt,xt),kt<<=6,kt+=wt&63;kt>=55296&&kt<=57343&&at(bt,xt),kt>1114111&&at(bt,xt),kt<=65535?xt+=String.fromCharCode(kt):(kt-=65536,xt+=String.fromCharCode((kt>>10)+55296),xt+=String.fromCharCode((kt&1023)+56320))}return xt},lt=function(gt){if(gt==="")return[];if(!/^[A-Z2-7=]+$/.test(gt))throw new Error("Invalid base32 characters");gt=gt.replace(/=/g,"");for(var xt,vt,bt,Et,wt,kt,Tt,Rt,Pt=[],$t=0,Ot=gt.length,Bt=0,zt=Ot>>3<<3;Bt>>2)&255,Pt[$t++]=(vt<<6|bt<<1|Et>>>4)&255,Pt[$t++]=(Et<<4|wt>>>1)&255,Pt[$t++]=(wt<<7|kt<<2|Tt>>>3)&255,Pt[$t++]=(Tt<<5|Rt)&255;var Ft=Ot-zt;return Ft===2?(xt=it[gt.charAt(Bt++)],vt=it[gt.charAt(Bt++)],Pt[$t++]=(xt<<3|vt>>>2)&255):Ft===4?(xt=it[gt.charAt(Bt++)],vt=it[gt.charAt(Bt++)],bt=it[gt.charAt(Bt++)],Et=it[gt.charAt(Bt++)],Pt[$t++]=(xt<<3|vt>>>2)&255,Pt[$t++]=(vt<<6|bt<<1|Et>>>4)&255):Ft===5?(xt=it[gt.charAt(Bt++)],vt=it[gt.charAt(Bt++)],bt=it[gt.charAt(Bt++)],Et=it[gt.charAt(Bt++)],wt=it[gt.charAt(Bt++)],Pt[$t++]=(xt<<3|vt>>>2)&255,Pt[$t++]=(vt<<6|bt<<1|Et>>>4)&255,Pt[$t++]=(Et<<4|wt>>>1)&255):Ft===7&&(xt=it[gt.charAt(Bt++)],vt=it[gt.charAt(Bt++)],bt=it[gt.charAt(Bt++)],Et=it[gt.charAt(Bt++)],wt=it[gt.charAt(Bt++)],kt=it[gt.charAt(Bt++)],Tt=it[gt.charAt(Bt++)],Pt[$t++]=(xt<<3|vt>>>2)&255,Pt[$t++]=(vt<<6|bt<<1|Et>>>4)&255,Pt[$t++]=(Et<<4|wt>>>1)&255,Pt[$t++]=(wt<<7|kt<<2|Tt>>>3)&255),Pt},dt=function(gt){for(var xt,vt,bt,Et,wt,kt="",Tt=gt.length,Rt=0,Pt=parseInt(Tt/5)*5;Rt>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[(vt<<4|bt>>>4)&31]+ot[(bt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[(Et<<3|wt>>>5)&31]+ot[wt&31];var $t=Tt-Pt;return $t===1?(xt=gt.charCodeAt(Rt),kt+=ot[xt>>>3]+ot[xt<<2&31]+"======"):$t===2?(xt=gt.charCodeAt(Rt++),vt=gt.charCodeAt(Rt),kt+=ot[xt>>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[vt<<4&31]+"===="):$t===3?(xt=gt.charCodeAt(Rt++),vt=gt.charCodeAt(Rt++),bt=gt.charCodeAt(Rt),kt+=ot[xt>>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[(vt<<4|bt>>>4)&31]+ot[bt<<1&31]+"==="):$t===4&&(xt=gt.charCodeAt(Rt++),vt=gt.charCodeAt(Rt++),bt=gt.charCodeAt(Rt++),Et=gt.charCodeAt(Rt),kt+=ot[xt>>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[(vt<<4|bt>>>4)&31]+ot[(bt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[Et<<3&31]+"="),kt},ht=function(gt){var xt,vt,bt,Et,wt,kt,Tt=!1,Rt="",Pt=0,$t,Ot=0,Bt=gt.length;if(gt==="")return Rt;do{for(st[0]=st[5],st[1]=st[6],st[2]=st[7],$t=Ot;Pt>6,st[$t++]=128|kt&63):kt<55296||kt>=57344?(st[$t++]=224|kt>>12,st[$t++]=128|kt>>6&63,st[$t++]=128|kt&63):(kt=65536+((kt&1023)<<10|gt.charCodeAt(++Pt)&1023),st[$t++]=240|kt>>18,st[$t++]=128|kt>>12&63,st[$t++]=128|kt>>6&63,st[$t++]=128|kt&63);Ot=$t-5,Pt===Bt&&++Pt,Pt>Bt&&$t<6&&(Tt=!0),xt=st[0],$t>4?(vt=st[1],bt=st[2],Et=st[3],wt=st[4],Rt+=ot[xt>>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[(vt<<4|bt>>>4)&31]+ot[(bt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[(Et<<3|wt>>>5)&31]+ot[wt&31]):$t===1?Rt+=ot[xt>>>3]+ot[xt<<2&31]+"======":$t===2?(vt=st[1],Rt+=ot[xt>>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[vt<<4&31]+"===="):$t===3?(vt=st[1],bt=st[2],Rt+=ot[xt>>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[(vt<<4|bt>>>4)&31]+ot[bt<<1&31]+"==="):(vt=st[1],bt=st[2],Et=st[3],Rt+=ot[xt>>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[(vt<<4|bt>>>4)&31]+ot[(bt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[Et<<3&31]+"=")}while(!Tt);return Rt},pt=function(gt){for(var xt,vt,bt,Et,wt,kt="",Tt=gt.length,Rt=0,Pt=parseInt(Tt/5)*5;Rt>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[(vt<<4|bt>>>4)&31]+ot[(bt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[(Et<<3|wt>>>5)&31]+ot[wt&31];var $t=Tt-Pt;return $t===1?(xt=gt[Rt],kt+=ot[xt>>>3]+ot[xt<<2&31]+"======"):$t===2?(xt=gt[Rt++],vt=gt[Rt],kt+=ot[xt>>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[vt<<4&31]+"===="):$t===3?(xt=gt[Rt++],vt=gt[Rt++],bt=gt[Rt],kt+=ot[xt>>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[(vt<<4|bt>>>4)&31]+ot[bt<<1&31]+"==="):$t===4&&(xt=gt[Rt++],vt=gt[Rt++],bt=gt[Rt++],Et=gt[Rt],kt+=ot[xt>>>3]+ot[(xt<<2|vt>>>6)&31]+ot[vt>>>1&31]+ot[(vt<<4|bt>>>4)&31]+ot[(bt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[Et<<3&31]+"="),kt},mt=function(gt,xt){var vt=typeof gt!="string";return vt&>.constructor===ArrayBuffer&&(gt=new Uint8Array(gt)),vt?pt(gt):xt?dt(gt):ht(gt)},ft=function(gt,xt){if(!xt)return ct(lt(gt));if(gt==="")return"";if(!/^[A-Z2-7=]+$/.test(gt))throw new Error("Invalid base32 characters");var vt,bt,Et,wt,kt,Tt,Rt,Pt,$t="",Ot=gt.indexOf("=");Ot===-1&&(Ot=gt.length);for(var Bt=0,zt=Ot>>3<<3;Bt>>2)&255)+String.fromCharCode((bt<<6|Et<<1|wt>>>4)&255)+String.fromCharCode((wt<<4|kt>>>1)&255)+String.fromCharCode((kt<<7|Tt<<2|Rt>>>3)&255)+String.fromCharCode((Rt<<5|Pt)&255);var Ft=Ot-zt;return Ft===2?(vt=it[gt.charAt(Bt++)],bt=it[gt.charAt(Bt++)],$t+=String.fromCharCode((vt<<3|bt>>>2)&255)):Ft===4?(vt=it[gt.charAt(Bt++)],bt=it[gt.charAt(Bt++)],Et=it[gt.charAt(Bt++)],wt=it[gt.charAt(Bt++)],$t+=String.fromCharCode((vt<<3|bt>>>2)&255)+String.fromCharCode((bt<<6|Et<<1|wt>>>4)&255)):Ft===5?(vt=it[gt.charAt(Bt++)],bt=it[gt.charAt(Bt++)],Et=it[gt.charAt(Bt++)],wt=it[gt.charAt(Bt++)],kt=it[gt.charAt(Bt++)],$t+=String.fromCharCode((vt<<3|bt>>>2)&255)+String.fromCharCode((bt<<6|Et<<1|wt>>>4)&255)+String.fromCharCode((wt<<4|kt>>>1)&255)):Ft===7&&(vt=it[gt.charAt(Bt++)],bt=it[gt.charAt(Bt++)],Et=it[gt.charAt(Bt++)],wt=it[gt.charAt(Bt++)],kt=it[gt.charAt(Bt++)],Tt=it[gt.charAt(Bt++)],Rt=it[gt.charAt(Bt++)],$t+=String.fromCharCode((vt<<3|bt>>>2)&255)+String.fromCharCode((bt<<6|Et<<1|wt>>>4)&255)+String.fromCharCode((wt<<4|kt>>>1)&255)+String.fromCharCode((kt<<7|Tt<<2|Rt>>>3)&255)),$t},yt={encode:mt,decode:ft};ft.asBytes=lt,rt?o.exports=yt:tt.base32=yt})()})(base32$1);var base32Exports=base32$1.exports;const base32=getDefaultExportFromCjs(base32Exports),Cr=class Cr{static parseAndVerifyRoot(et,tt){if(!et.startsWith(this.ROOT_PREFIX))throw new Error(`ENRTree root entry must start with '${this.ROOT_PREFIX}'`);const nt=Cr.parseRootValues(et),rt=base32.decode.asBytes(tt),ot=et.split(" sig")[0],it=utf8ToBytes$1(ot),st=fromString(nt.signature,"base64url").slice(0,64);if(!verifySignature(st,keccak256(it),new Uint8Array(rt)))throw new Error("Unable to verify ENRTree root signature");return nt.eRoot}static parseRootValues(et){const tt=et.match(/^enrtree-root:v1 e=([^ ]+) l=([^ ]+) seq=(\d+) sig=([^ ]+)$/);if(!Array.isArray(tt))throw new Error("Could not parse ENRTree root entry");tt.shift();const[nt,rt,ot,it]=tt;if(!nt)throw new Error("Could not parse 'e' value from ENRTree root entry");if(!rt)throw new Error("Could not parse 'l' value from ENRTree root entry");if(!ot)throw new Error("Could not parse 'seq' value from ENRTree root entry");if(!it)throw new Error("Could not parse 'sig' value from ENRTree root entry");return{eRoot:nt,lRoot:rt,seq:Number(ot),signature:it}}static parseTree(et){if(!et.startsWith(this.TREE_PREFIX))throw new Error(`ENRTree tree entry must start with '${this.TREE_PREFIX}'`);const tt=et.match(/^enrtree:\/\/([^@]+)@(.+)$/);if(!Array.isArray(tt))throw new Error("Could not parse ENRTree tree entry");tt.shift();const[nt,rt]=tt;if(!nt)throw new Error("Could not parse public key from ENRTree tree entry");if(!rt)throw new Error("Could not parse domain from ENRTree tree entry");return{publicKey:nt,domain:rt}}static parseBranch(et){if(!et.startsWith(this.BRANCH_PREFIX))throw new Error(`ENRTree branch entry must start with '${this.BRANCH_PREFIX}'`);return et.split(this.BRANCH_PREFIX)[1].split(",")}};Ct(Cr,"RECORD_PREFIX",ENR.RECORD_PREFIX),Ct(Cr,"TREE_PREFIX","enrtree:"),Ct(Cr,"BRANCH_PREFIX","enrtree-branch:"),Ct(Cr,"ROOT_PREFIX","enrtree-root:");let ENRTree=Cr;const log$6=new Logger$1("discovery:fetch_nodes");async function fetchNodesUntilCapabilitiesFulfilled(o,et,tt){const nt={relay:o.relay??0,store:o.store??0,filter:o.filter??0,lightPush:o.lightPush??0},rt=nt.relay+nt.store+nt.filter+nt.lightPush,ot={relay:0,store:0,filter:0,lightPush:0};let it=0;const st=[];for(;!isSatisfied(nt,ot)&&it=o.relay&&et.store>=o.store&&et.filter>=o.filter&&et.lightPush>=o.lightPush}function isNewPeer(o,et){if(!o.nodeId)return!1;for(const tt of et)if(o.nodeId===tt.nodeId)return!1;return!0}function addCapabilities(o,et){o.relay&&(et.relay+=1),o.store&&(et.store+=1),o.filter&&(et.filter+=1),o.lightPush&&(et.lightPush+=1)}function helpsSatisfyCapabilities(o,et,tt){if(isSatisfied(et,tt))throw"Internal Error: Waku2 wanted capabilities are already fulfilled";const nt=missingCapabilities(et,tt);return nt.relay&&o.relay||nt.store&&o.store||nt.filter&&o.filter||nt.lightPush&&o.lightPush}function missingCapabilities(o,et){return{relay:et.relaythis._search(ot,it));return log$5.info("retrieved peers: ",st.map(at=>{var ct,lt;return{id:(ct=at.peerId)==null?void 0:ct.toString(),multiaddrs:(lt=at.multiaddrs)==null?void 0:lt.map(dt=>dt.toString())}})),st}async*getNextPeer(et,tt){const nt=Math.floor(Math.random()*et.length),{publicKey:rt,domain:ot}=ENRTree.parseTree(et[nt]),it={domain:ot,publicKey:rt,visits:{}};for await(const st of yieldNodesUntilCapabilitiesFulfilled(tt,this._errorTolerance,()=>this._search(ot,it)))yield st}async _search(et,tt){try{const nt=await this._getTXTRecord(et,tt);tt.visits[et]=!0;let rt,ot;const it=getEntryType(nt);try{switch(it){case ENRTree.ROOT_PREFIX:return rt=ENRTree.parseAndVerifyRoot(nt,tt.publicKey),await this._search(rt,tt);case ENRTree.BRANCH_PREFIX:return ot=ENRTree.parseBranch(nt),rt=selectRandomPath(ot,tt),await this._search(rt,tt);case ENRTree.RECORD_PREFIX:return EnrDecoder.fromString(nt);default:return null}}catch(st){return log$5.error(`Failed to search DNS tree ${it} at subdomain ${et}: ${st}`),null}}catch(nt){return log$5.error(`Failed to retrieve TXT record at subdomain ${et}: ${nt}`),null}}async _getTXTRecord(et,tt){if(this._DNSTreeCache[et])return this._DNSTreeCache[et];const nt=et!==tt.domain?`${et}.${tt.domain}`:tt.domain,rt=await this.dns.resolveTXT(nt);if(!rt.length)throw new Error("Received empty result array while fetching TXT record");if(!rt[0].length)throw new Error("Received empty TXT record");const ot=rt.join("");return this._DNSTreeCache[et]=ot,ot}}function getEntryType(o){return o.startsWith(ENRTree.ROOT_PREFIX)?ENRTree.ROOT_PREFIX:o.startsWith(ENRTree.BRANCH_PREFIX)?ENRTree.BRANCH_PREFIX:o.startsWith(ENRTree.RECORD_PREFIX)?ENRTree.RECORD_PREFIX:""}function selectRandomPath(o,et){const tt={};for(const[rt,ot]of o.entries())et.visits[ot]&&(tt[rt]=!0);if(Object.keys(tt).length===o.length)throw new Error("Unresolvable circular path detected");let nt;do nt=Math.floor(Math.random()*o.length);while(tt[nt]);return o[nt]}const log$4=new Logger$1("peer-discovery-dns");class PeerDiscoveryDns extends TypedEventEmitter$3{constructor(tt,nt){super();Ct(this,"nextPeer");Ct(this,"_started");Ct(this,"_components");Ct(this,"_options");this._started=!1,this._components=tt,this._options=nt;const{enrUrls:rt}=nt;log$4.info("Use following EIP-1459 ENR Tree URLs: ",rt)}async start(){log$4.info("Starting peer discovery via dns"),this._started=!0,await this.findPeers()}async findPeers(){if(!this.nextPeer){let{enrUrls:tt}=this._options;Array.isArray(tt)||(tt=[tt]);const{wantedNodeCapabilityCount:nt}=this._options,rt=await DnsNodeDiscovery.dnsOverHttp();this.nextPeer=rt.getNextPeer.bind(rt,tt,nt)}for await(const tt of this.nextPeer()){if(!this._started)return;const{peerInfo:nt,shardInfo:rt}=tt;if(!nt)continue;const ot={[DEFAULT_BOOTSTRAP_TAG_NAME]:{value:this._options.tagValue??DEFAULT_BOOTSTRAP_TAG_VALUE,ttl:this._options.tagTTL??DEFAULT_BOOTSTRAP_TAG_TTL}};let it=!1;await this._components.peerStore.has(nt.id)?(await this._components.peerStore.get(nt.id)).tags.has(DEFAULT_BOOTSTRAP_TAG_NAME)||(it=!0,await this._components.peerStore.merge(nt.id,{tags:ot})):(it=!0,await this._components.peerStore.save(nt.id,{tags:ot,...rt&&{metadata:{shardInfo:encodeRelayShard(rt)}}})),it&&this.dispatchEvent(new CustomEvent("peer",{detail:nt}))}}stop(){this._started=!1}get[peerDiscoverySymbol$2](){return!0}get[Symbol.toStringTag](){return DNS_DISCOVERY_TAG}}function wakuDnsDiscovery(o,et=DEFAULT_NODE_REQUIREMENTS){return tt=>new PeerDiscoveryDns(tt,{enrUrls:o,wantedNodeCapabilityCount:et})}class PeerExchangeRPC{constructor(et){Ct(this,"proto");this.proto=et}static createRequest(et){const{numPeers:tt}=et;return new PeerExchangeRPC({query:{numPeers:tt},response:void 0})}encode(){return PeerExchangeRPC$1.encode(this.proto)}static decode(et){const tt=PeerExchangeRPC$1.decode(et);return new PeerExchangeRPC(tt)}get query(){return this.proto.query}get response(){return this.proto.response}}const PeerExchangeCodec="/vac/waku/peer-exchange/2.0.0-alpha1",log$3=new Logger$1("peer-exchange");class WakuPeerExchange extends BaseProtocol{constructor(et,tt){super(PeerExchangeCodec,et,log$3,tt)}async query(et){const{numPeers:tt,peerId:nt}=et,rt=PeerExchangeRPC.createRequest({numPeers:BigInt(tt)}),ot=await this.components.peerStore.get(nt);if(!ot)return{peerInfos:null,error:ProtocolError$1.NO_PEER_AVAILABLE};let it;try{it=await this.getStream(ot)}catch(at){return log$3.error("Failed to get stream",at),{peerInfos:null,error:ProtocolError$1.NO_STREAM_AVAILABLE}}const st=await pipe([rt.encode()],encode$5,it,decode$5,async at=>await all$2(at));try{const at=new Uint8ArrayList;st.forEach(dt=>{at.append(dt)});const{response:ct}=PeerExchangeRPC.decode(at);return ct?{peerInfos:await Promise.all(ct.peerInfos.map(dt=>dt.enr).filter(isDefined).map(async dt=>({ENR:await EnrDecoder.fromRLP(dt)}))),error:null}:(log$3.error("PeerExchangeRPC message did not contains a `response` field"),{peerInfos:null,error:ProtocolError$1.EMPTY_PAYLOAD})}catch(at){return log$3.error("Failed to decode push reply",at),{peerInfos:null,error:ProtocolError$1.DECODE_FAILED}}}}const log$2=new Logger$1("peer-exchange-discovery"),DEFAULT_PEER_EXCHANGE_REQUEST_NODES=10,DEFAULT_PEER_EXCHANGE_QUERY_INTERVAL_MS=10*1e3,DEFAULT_MAX_RETRIES=3,DEFAULT_PEER_EXCHANGE_TAG_NAME=Tags.PEER_EXCHANGE,DEFAULT_PEER_EXCHANGE_TAG_VALUE=50,DEFAULT_PEER_EXCHANGE_TAG_TTL=1e8;class PeerExchangeDiscovery extends TypedEventEmitter$3{constructor(tt,nt,rt={}){super();Ct(this,"components");Ct(this,"peerExchange");Ct(this,"options");Ct(this,"isStarted");Ct(this,"queryingPeers",new Set);Ct(this,"queryAttempts",new Map);Ct(this,"handleDiscoveredPeer",tt=>{const{protocols:nt,peerId:rt}=tt.detail;!nt.includes(PeerExchangeCodec)||this.queryingPeers.has(rt.toString())||(this.queryingPeers.add(rt.toString()),this.startRecurringQueries(rt).catch(ot=>log$2.error(`Error querying peer ${ot}`)))});Ct(this,"startRecurringQueries",async tt=>{const nt=tt.toString(),{queryInterval:rt=DEFAULT_PEER_EXCHANGE_QUERY_INTERVAL_MS,maxRetries:ot=DEFAULT_MAX_RETRIES}=this.options;log$2.info(`Querying peer: ${nt} (attempt ${this.queryAttempts.get(nt)??1})`),await this.query(tt);const it=this.queryAttempts.get(nt)??1;if(it>ot){this.abortQueriesForPeer(nt);return}setTimeout(()=>{this.queryAttempts.set(nt,it+1),this.startRecurringQueries(tt).catch(st=>{log$2.error(`Error in startRecurringQueries: ${st}`)})},rt*it)});this.components=tt,this.peerExchange=new WakuPeerExchange(tt,nt),this.options=rt,this.isStarted=!1}start(){this.isStarted||(this.dispatchEvent(new CustomEvent("waku:peer-exchange:started",{detail:!0})),log$2.info("Starting peer exchange node discovery, discovering peers"),this.components.events.addEventListener("peer:identify",this.handleDiscoveredPeer))}stop(){this.isStarted&&(log$2.info("Stopping peer exchange node discovery"),this.isStarted=!1,this.queryingPeers.clear(),this.components.events.removeEventListener("peer:identify",this.handleDiscoveredPeer))}get[peerDiscoverySymbol$2](){return!0}get[Symbol.toStringTag](){return"@waku/peer-exchange"}async query(tt){const{error:nt,peerInfos:rt}=await this.peerExchange.query({numPeers:DEFAULT_PEER_EXCHANGE_REQUEST_NODES,peerId:tt});if(nt)return log$2.error("Peer exchange query failed",nt),{error:nt,peerInfos:null};for(const ot of rt){const{ENR:it}=ot;if(!it){log$2.warn("No ENR in peerInfo object, skipping");continue}const{peerId:st,peerInfo:at,shardInfo:ct}=it;if(!st||!at)continue;if(await this.components.peerStore.has(st)){const{hasMultiaddrDiff:dt,hasShardDiff:ht}=await this.checkPeerInfoDiff(at,ct);if(dt||ht){log$2.info(`Peer ${st.toString()} has updated multiaddrs or shardInfo, updating`),dt&&(log$2.info(`Peer ${st.toString()} has updated multiaddrs, updating`),await this.components.peerStore.patch(st,{multiaddrs:at.multiaddrs})),ht&&ct&&(log$2.info(`Peer ${st.toString()} has updated shardInfo, updating`),await this.components.peerStore.merge(st,{metadata:{shardInfo:encodeRelayShard(ct)}}),this.dispatchEvent(new CustomEvent("peer",{detail:{id:st,multiaddrs:at.multiaddrs}})));continue}}await this.components.peerStore.save(st,{tags:{[DEFAULT_PEER_EXCHANGE_TAG_NAME]:{value:this.options.tagValue??DEFAULT_PEER_EXCHANGE_TAG_VALUE,ttl:this.options.tagTTL??DEFAULT_PEER_EXCHANGE_TAG_TTL}},...ct&&{metadata:{shardInfo:encodeRelayShard(ct)}},...at.multiaddrs&&{multiaddrs:at.multiaddrs}}),log$2.info(`Discovered peer: ${st.toString()}`),this.dispatchEvent(new CustomEvent("peer",{detail:{id:st,multiaddrs:at.multiaddrs}}))}return{error:null,peerInfos:rt}}abortQueriesForPeer(tt){log$2.info(`Aborting queries for peer: ${tt}`),this.queryingPeers.delete(tt),this.queryAttempts.delete(tt)}async checkPeerInfoDiff(tt,nt){const{id:rt}=tt,ot=await this.components.peerStore.get(rt),it=ot.addresses.map(dt=>dt.multiaddr.toString()),st=tt.multiaddrs.map(dt=>dt.toString()),at=it.some(dt=>!st.includes(dt));let ct=!1;const lt=ot.metadata.get("shardInfo");if(lt){const dt=decodeRelayShard(lt);(dt||nt)&&(ct=dt.clusterId!==(nt==null?void 0:nt.clusterId)||dt.shards.some(ht=>!(nt!=null&&nt.shards.includes(ht))))}return{hasMultiaddrDiff:at,hasShardDiff:ct}}}function wakuPeerExchangeDiscovery(o){return et=>new PeerExchangeDiscovery(et,o)}const log$1=new Logger$1("peer-exchange-discovery"),DEFAULT_LOCAL_TAG_NAME=Tags.LOCAL,DEFAULT_LOCAL_TAG_VALUE=50,DEFAULT_LOCAL_TAG_TTL=1e8;class LocalPeerCacheDiscovery extends TypedEventEmitter$3{constructor(tt,nt){super();Ct(this,"components");Ct(this,"options");Ct(this,"isStarted");Ct(this,"peers",[]);Ct(this,"handleNewPeers",tt=>{const{peerId:nt,listenAddrs:rt}=tt.detail,ot=getWsMultiaddrFromMultiaddrs(rt),it=this.getPeersFromLocalStorage(),st=it.findIndex(at=>at.id===nt.toString());st>=0?it[st].address=ot.toString():it.push({id:nt.toString(),address:ot.toString()}),this.peers=it,this.savePeersToLocalStorage()});this.components=tt,this.options=nt,this.isStarted=!1,this.peers=this.getPeersFromLocalStorage()}get[Symbol.toStringTag](){return"@waku/local-peer-cache-discovery"}async start(){var tt,nt,rt;if(!this.isStarted){log$1.info("Starting Local Storage Discovery"),this.components.events.addEventListener("peer:identify",this.handleNewPeers);for(const{id:ot,address:it}of this.peers){const st=peerIdFromString$1(ot);await this.components.peerStore.has(st)||(await this.components.peerStore.save(st,{multiaddrs:[multiaddr(it)],tags:{[((tt=this.options)==null?void 0:tt.tagName)??DEFAULT_LOCAL_TAG_NAME]:{value:((nt=this.options)==null?void 0:nt.tagValue)??DEFAULT_LOCAL_TAG_VALUE,ttl:((rt=this.options)==null?void 0:rt.tagTTL)??DEFAULT_LOCAL_TAG_TTL}}}),this.dispatchEvent(new CustomEvent("peer",{detail:{id:st,multiaddrs:[multiaddr(it)]}})))}log$1.info(`Discovered ${this.peers.length} peers`),this.isStarted=!0}}stop(){this.isStarted&&(log$1.info("Stopping Local Storage Discovery"),this.components.events.removeEventListener("peer:identify",this.handleNewPeers),this.isStarted=!1,this.savePeersToLocalStorage())}getPeersFromLocalStorage(){try{const tt=localStorage.getItem("waku:peers");return tt?JSON.parse(tt).filter(isValidStoredPeer):[]}catch(tt){return log$1.error("Error parsing peers from local storage:",tt),[]}}savePeersToLocalStorage(){try{localStorage.setItem("waku:peers",JSON.stringify(this.peers))}catch(tt){log$1.error("Error saving peers to local storage:",tt)}}}function isValidStoredPeer(o){return o&&typeof o=="object"&&typeof o.id=="string"&&typeof o.address=="string"}function wakuLocalPeerCacheDiscovery(){return(o,et)=>new LocalPeerCacheDiscovery(o,et)}function defaultPeerDiscoveries(o){const et=[enrTree.SANDBOX,enrTree.TEST];return[wakuDnsDiscovery(et),wakuLocalPeerCacheDiscovery(),wakuPeerExchangeDiscovery(o)]}const log=new Logger$1("sdk:create");async function defaultLibp2p(o,et,tt){et!=null&&et.hideWebSocketInfo||(console.info("%cIgnore WebSocket connection failures","background: gray; color: white; font-size: x-large"),console.info("%cWaku tries to discover peers and some of them are expected to fail","background: gray; color: white; font-size: x-large"));const nt=o?{metadata:wakuMetadata(o)}:{},rt=(et==null?void 0:et.filterMultiaddrs)===!1?all$1:wss;return createLibp2p({transports:[webSockets({filter:rt})],streamMuxers:[mplex()],connectionEncrypters:[noise()],...et,services:{identify:identify({agentVersion:tt??DefaultUserAgent}),ping:ping({maxInboundStreams:(et==null?void 0:et.pingMaxInboundStreams)??DefaultPingMaxInboundStreams}),...nt,...et==null?void 0:et.services}})}async function createLibp2pAndUpdateOptions(o){const{networkConfig:et}=o,tt=derivePubsubTopicsFromNetworkConfig(et??DefaultNetworkConfig);log.info("Creating Waku node with pubsub topics",tt);const nt=(o==null?void 0:o.libp2p)??{},rt=nt.peerDiscovery??[];return o!=null&&o.defaultBootstrap&&rt.push(...defaultPeerDiscoveries(tt)),o!=null&&o.bootstrapPeers&&rt.push(bootstrap({list:o.bootstrapPeers})),nt.peerDiscovery=rt,{libp2p:await defaultLibp2p(tt,nt,o==null?void 0:o.userAgent),pubsubTopics:tt}}async function createLightNode(o={}){const{libp2p:et,pubsubTopics:tt}=await createLibp2pAndUpdateOptions(o);return new WakuNode(tt,o,et,{store:!0,lightpush:!0,filter:!0})}React.createContext({decoder:void 0,encoder:void 0});const useCreateNode=o=>{const{factory:et,options:tt,protocols:nt=[]}=o,[rt,ot]=React.useState(void 0),[it,st]=React.useState(!0),[at,ct]=React.useState(void 0);return React.useEffect(()=>{let lt=!1;return st(!0),et(tt).then(async dt=>{lt||(await dt.start(),await waitForRemotePeer(dt,nt),ot(dt),st(!1))}).catch(dt=>{st(!1),ct(`Failed at creating node: ${(dt==null?void 0:dt.message)||"no message"}`)}),()=>{lt=!0}},[]),{node:rt,error:at,isLoading:it}},useCreateLightNode=o=>useCreateNode({...o,factory:createLightNode}),WakuContext=React.createContext({node:void 0,isLoading:!1,error:void 0}),useWaku=()=>React.useContext(WakuContext),LightNodeProvider=o=>{const et=useCreateLightNode({options:o.options,protocols:o.protocols});return React.createElement(WakuContext.Provider,{value:et},o.children)};/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const toKebabCase=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mergeClasses=(...o)=>o.filter((et,tt,nt)=>!!et&&nt.indexOf(et)===tt).join(" ");/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var defaultAttributes={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Icon=reactExports.forwardRef(({color:o="currentColor",size:et=24,strokeWidth:tt=2,absoluteStrokeWidth:nt,className:rt="",children:ot,iconNode:it,...st},at)=>reactExports.createElement("svg",{ref:at,...defaultAttributes,width:et,height:et,stroke:o,strokeWidth:nt?Number(tt)*24/Number(et):tt,className:mergeClasses("lucide",rt),...st},[...it.map(([ct,lt])=>reactExports.createElement(ct,lt)),...Array.isArray(ot)?ot:[ot]]));/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const createLucideIcon=(o,et)=>{const tt=reactExports.forwardRef(({className:nt,...rt},ot)=>reactExports.createElement(Icon,{ref:ot,iconNode:et,className:mergeClasses(`lucide-${toKebabCase(o)}`,nt),...rt}));return tt.displayName=`${o}`,tt};/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Check=createLucideIcon("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Copy=createLucideIcon("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + * @license lucide-react v0.453.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const LoaderCircle=createLucideIcon("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Header=({wakuStatus:o})=>{const{address:et,isConnected:tt}=useAccount(),{disconnect:nt}=useDisconnect(),{isLoading:rt,error:ot,node:it}=useWaku(),[st,at]=reactExports.useState(0),ct=useLocation(),{data:lt}=useEnsName({address:et});reactExports.useEffect(()=>{if(it){const ht=()=>{at(it.libp2p.getConnections().length)};return ht(),it.libp2p.addEventListener("peer:connect",ht),it.libp2p.addEventListener("peer:disconnect",ht),()=>{it.libp2p.removeEventListener("peer:connect",ht),it.libp2p.removeEventListener("peer:disconnect",ht)}}},[it]);const dt=ht=>{switch(ht){case"success":return"bg-green-500";case"in-progress":return"bg-yellow-500";case"error":return"bg-red-500"}};return jsxRuntimeExports.jsx("header",{className:"sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:jsxRuntimeExports.jsx("div",{className:"container",children:jsxRuntimeExports.jsx("div",{className:"h-14",children:jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between gap-4",children:[jsxRuntimeExports.jsxs("nav",{className:"flex items-center gap-2 md:gap-4",children:[jsxRuntimeExports.jsx(Link,{to:"",className:`text-sm font-medium ${ct.pathname===""?"text-foreground":"text-muted-foreground"}`,children:"Home"}),jsxRuntimeExports.jsx(Link,{to:"create",className:`text-sm font-medium ${ct.pathname==="/create"?"text-foreground":"text-muted-foreground"}`,children:"Create"}),jsxRuntimeExports.jsx(Link,{to:"view",className:`text-sm font-medium ${ct.pathname==="/view"?"text-foreground":"text-muted-foreground"}`,children:"View"})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[jsxRuntimeExports.jsx("div",{className:"hidden md:flex items-center gap-2",children:!rt&&!ot&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntimeExports.jsx("span",{className:"text-muted-foreground",children:"Filter:"}),jsxRuntimeExports.jsx("div",{className:`w-2 h-2 md:w-3 md:h-3 rounded-full ${dt(o.filter)}`})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntimeExports.jsx("span",{className:"text-muted-foreground",children:"Store:"}),jsxRuntimeExports.jsx("div",{className:`w-2 h-2 md:w-3 md:h-3 rounded-full ${dt(o.store)}`})]})]})}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[rt?jsxRuntimeExports.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}):ot?jsxRuntimeExports.jsx("span",{className:"text-xs text-red-500",children:"Error"}):jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${st>0?"bg-green-500":"bg-yellow-500"}`}),tt?jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("span",{className:"text-xs md:text-sm text-muted-foreground truncate max-w-[80px] md:max-w-[120px]",children:lt||(et?`${et.slice(0,4)}...${et.slice(-4)}`:"")}),jsxRuntimeExports.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>nt(),children:[jsxRuntimeExports.jsx("span",{className:"md:hidden",children:"×"}),jsxRuntimeExports.jsx("span",{className:"hidden md:inline",children:"Logout"})]})]}):jsxRuntimeExports.jsx(ConnectKitButton,{})]})]})]})})})})},Input=reactExports.forwardRef(({className:o,type:et,...tt},nt)=>jsxRuntimeExports.jsx("input",{type:et,className:cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base md:text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","touch-manipulation min-h-[44px] md:min-h-[36px]",o),ref:nt,...tt}));Input.displayName="Input";const Textarea=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx("textarea",{className:cn("flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md:text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","touch-manipulation resize-y",o),ref:tt,...et}));Textarea.displayName="Textarea";var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Primitive=NODES.reduce((o,et)=>{const tt=reactExports.forwardRef((nt,rt)=>{const{asChild:ot,...it}=nt,st=ot?Slot:et;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(st,{...it,ref:rt})});return tt.displayName=`Primitive.${et}`,{...o,[et]:tt}},{});function dispatchDiscreteCustomEvent(o,et){o&&reactDomExports.flushSync(()=>o.dispatchEvent(et))}var NAME="Label",Label$1=reactExports.forwardRef((o,et)=>jsxRuntimeExports.jsx(Primitive.label,{...o,ref:et,onMouseDown:tt=>{var rt;tt.target.closest("button, input, select, textarea")||((rt=o.onMouseDown)==null||rt.call(o,tt),!tt.defaultPrevented&&tt.detail>1&&tt.preventDefault())}}));Label$1.displayName=NAME;var Root$3=Label$1;const labelVariants=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Label=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx(Root$3,{ref:tt,className:cn(labelVariants(),o),...et}));Label.displayName=Root$3.displayName;const Card=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("rounded-lg border bg-card text-card-foreground shadow-sm p-4 md:p-6 w-full max-w-[95vw] mx-auto",o),...et}));Card.displayName="Card";const CardHeader=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("flex flex-col space-y-1.5 p-4 md:p-6",o),...et}));CardHeader.displayName="CardHeader";const CardTitle=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx("h3",{ref:tt,className:cn("font-semibold leading-none tracking-tight",o),...et}));CardTitle.displayName="CardTitle";const CardDescription=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx("p",{ref:tt,className:cn("text-sm text-muted-foreground",o),...et}));CardDescription.displayName="CardDescription";const CardContent=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("p-6 pt-0",o),...et}));CardContent.displayName="CardContent";const CardFooter=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("flex items-center p-6 pt-0",o),...et}));CardFooter.displayName="CardFooter";function composeEventHandlers(o,et,{checkForDefaultPrevented:tt=!0}={}){return function(rt){if(o==null||o(rt),tt===!1||!rt.defaultPrevented)return et==null?void 0:et(rt)}}function createContext2(o,et){const tt=reactExports.createContext(et),nt=ot=>{const{children:it,...st}=ot,at=reactExports.useMemo(()=>st,Object.values(st));return jsxRuntimeExports.jsx(tt.Provider,{value:at,children:it})};nt.displayName=o+"Provider";function rt(ot){const it=reactExports.useContext(tt);if(it)return it;if(et!==void 0)return et;throw new Error(`\`${ot}\` must be used within \`${o}\``)}return[nt,rt]}function createContextScope(o,et=[]){let tt=[];function nt(ot,it){const st=reactExports.createContext(it),at=tt.length;tt=[...tt,it];const ct=dt=>{var gt;const{scope:ht,children:pt,...mt}=dt,ft=((gt=ht==null?void 0:ht[o])==null?void 0:gt[at])||st,yt=reactExports.useMemo(()=>mt,Object.values(mt));return jsxRuntimeExports.jsx(ft.Provider,{value:yt,children:pt})};ct.displayName=ot+"Provider";function lt(dt,ht){var ft;const pt=((ft=ht==null?void 0:ht[o])==null?void 0:ft[at])||st,mt=reactExports.useContext(pt);if(mt)return mt;if(it!==void 0)return it;throw new Error(`\`${dt}\` must be used within \`${ot}\``)}return[ct,lt]}const rt=()=>{const ot=tt.map(it=>reactExports.createContext(it));return function(st){const at=(st==null?void 0:st[o])||ot;return reactExports.useMemo(()=>({[`__scope${o}`]:{...st,[o]:at}}),[st,at])}};return rt.scopeName=o,[nt,composeContextScopes(rt,...et)]}function composeContextScopes(...o){const et=o[0];if(o.length===1)return et;const tt=()=>{const nt=o.map(rt=>({useScope:rt(),scopeName:rt.scopeName}));return function(ot){const it=nt.reduce((st,{useScope:at,scopeName:ct})=>{const dt=at(ot)[`__scope${ct}`];return{...st,...dt}},{});return reactExports.useMemo(()=>({[`__scope${et.scopeName}`]:it}),[it])}};return tt.scopeName=et.scopeName,tt}var useLayoutEffect2=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:()=>{},useReactId=React$1.useId||(()=>{}),count$1=0;function useId(o){const[et,tt]=reactExports.useState(useReactId());return useLayoutEffect2(()=>{o||tt(nt=>nt??String(count$1++))},[o]),o||(et?`radix-${et}`:"")}function useCallbackRef$1(o){const et=reactExports.useRef(o);return reactExports.useEffect(()=>{et.current=o}),reactExports.useMemo(()=>(...tt)=>{var nt;return(nt=et.current)==null?void 0:nt.call(et,...tt)},[])}function useControllableState({prop:o,defaultProp:et,onChange:tt=()=>{}}){const[nt,rt]=useUncontrolledState({defaultProp:et,onChange:tt}),ot=o!==void 0,it=ot?o:nt,st=useCallbackRef$1(tt),at=reactExports.useCallback(ct=>{if(ot){const dt=typeof ct=="function"?ct(o):ct;dt!==o&&st(dt)}else rt(ct)},[ot,o,rt,st]);return[it,at]}function useUncontrolledState({defaultProp:o,onChange:et}){const tt=reactExports.useState(o),[nt]=tt,rt=reactExports.useRef(nt),ot=useCallbackRef$1(et);return reactExports.useEffect(()=>{rt.current!==nt&&(ot(nt),rt.current=nt)},[nt,rt,ot]),tt}function useEscapeKeydown(o,et=globalThis==null?void 0:globalThis.document){const tt=useCallbackRef$1(o);reactExports.useEffect(()=>{const nt=rt=>{rt.key==="Escape"&&tt(rt)};return et.addEventListener("keydown",nt,{capture:!0}),()=>et.removeEventListener("keydown",nt,{capture:!0})},[tt,et])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=reactExports.forwardRef((o,et)=>{const{disableOutsidePointerEvents:tt=!1,onEscapeKeyDown:nt,onPointerDownOutside:rt,onFocusOutside:ot,onInteractOutside:it,onDismiss:st,...at}=o,ct=reactExports.useContext(DismissableLayerContext),[lt,dt]=reactExports.useState(null),ht=(lt==null?void 0:lt.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,pt]=reactExports.useState({}),mt=useComposedRefs(et,kt=>dt(kt)),ft=Array.from(ct.layers),[yt]=[...ct.layersWithOutsidePointerEventsDisabled].slice(-1),gt=ft.indexOf(yt),xt=lt?ft.indexOf(lt):-1,vt=ct.layersWithOutsidePointerEventsDisabled.size>0,bt=xt>=gt,Et=usePointerDownOutside(kt=>{const Tt=kt.target,Rt=[...ct.branches].some(Pt=>Pt.contains(Tt));!bt||Rt||(rt==null||rt(kt),it==null||it(kt),kt.defaultPrevented||st==null||st())},ht),wt=useFocusOutside(kt=>{const Tt=kt.target;[...ct.branches].some(Pt=>Pt.contains(Tt))||(ot==null||ot(kt),it==null||it(kt),kt.defaultPrevented||st==null||st())},ht);return useEscapeKeydown(kt=>{xt===ct.layers.size-1&&(nt==null||nt(kt),!kt.defaultPrevented&&st&&(kt.preventDefault(),st()))},ht),reactExports.useEffect(()=>{if(lt)return tt&&(ct.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=ht.body.style.pointerEvents,ht.body.style.pointerEvents="none"),ct.layersWithOutsidePointerEventsDisabled.add(lt)),ct.layers.add(lt),dispatchUpdate(),()=>{tt&&ct.layersWithOutsidePointerEventsDisabled.size===1&&(ht.body.style.pointerEvents=originalBodyPointerEvents)}},[lt,ht,tt,ct]),reactExports.useEffect(()=>()=>{lt&&(ct.layers.delete(lt),ct.layersWithOutsidePointerEventsDisabled.delete(lt),dispatchUpdate())},[lt,ct]),reactExports.useEffect(()=>{const kt=()=>pt({});return document.addEventListener(CONTEXT_UPDATE,kt),()=>document.removeEventListener(CONTEXT_UPDATE,kt)},[]),jsxRuntimeExports.jsx(Primitive.div,{...at,ref:mt,style:{pointerEvents:vt?bt?"auto":"none":void 0,...o.style},onFocusCapture:composeEventHandlers(o.onFocusCapture,wt.onFocusCapture),onBlurCapture:composeEventHandlers(o.onBlurCapture,wt.onBlurCapture),onPointerDownCapture:composeEventHandlers(o.onPointerDownCapture,Et.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=reactExports.forwardRef((o,et)=>{const tt=reactExports.useContext(DismissableLayerContext),nt=reactExports.useRef(null),rt=useComposedRefs(et,nt);return reactExports.useEffect(()=>{const ot=nt.current;if(ot)return tt.branches.add(ot),()=>{tt.branches.delete(ot)}},[tt.branches]),jsxRuntimeExports.jsx(Primitive.div,{...o,ref:rt})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(o,et=globalThis==null?void 0:globalThis.document){const tt=useCallbackRef$1(o),nt=reactExports.useRef(!1),rt=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const ot=st=>{if(st.target&&!nt.current){let at=function(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,tt,ct,{discrete:!0})};const ct={originalEvent:st};st.pointerType==="touch"?(et.removeEventListener("click",rt.current),rt.current=at,et.addEventListener("click",rt.current,{once:!0})):at()}else et.removeEventListener("click",rt.current);nt.current=!1},it=window.setTimeout(()=>{et.addEventListener("pointerdown",ot)},0);return()=>{window.clearTimeout(it),et.removeEventListener("pointerdown",ot),et.removeEventListener("click",rt.current)}},[et,tt]),{onPointerDownCapture:()=>nt.current=!0}}function useFocusOutside(o,et=globalThis==null?void 0:globalThis.document){const tt=useCallbackRef$1(o),nt=reactExports.useRef(!1);return reactExports.useEffect(()=>{const rt=ot=>{ot.target&&!nt.current&&handleAndDispatchCustomEvent(FOCUS_OUTSIDE,tt,{originalEvent:ot},{discrete:!1})};return et.addEventListener("focusin",rt),()=>et.removeEventListener("focusin",rt)},[et,tt]),{onFocusCapture:()=>nt.current=!0,onBlurCapture:()=>nt.current=!1}}function dispatchUpdate(){const o=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(o)}function handleAndDispatchCustomEvent(o,et,tt,{discrete:nt}){const rt=tt.originalEvent.target,ot=new CustomEvent(o,{bubbles:!1,cancelable:!0,detail:tt});et&&rt.addEventListener(o,et,{once:!0}),nt?dispatchDiscreteCustomEvent(rt,ot):rt.dispatchEvent(ot)}var AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=reactExports.forwardRef((o,et)=>{const{loop:tt=!1,trapped:nt=!1,onMountAutoFocus:rt,onUnmountAutoFocus:ot,...it}=o,[st,at]=reactExports.useState(null),ct=useCallbackRef$1(rt),lt=useCallbackRef$1(ot),dt=reactExports.useRef(null),ht=useComposedRefs(et,ft=>at(ft)),pt=reactExports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;reactExports.useEffect(()=>{if(nt){let ft=function(vt){if(pt.paused||!st)return;const bt=vt.target;st.contains(bt)?dt.current=bt:focus(dt.current,{select:!0})},yt=function(vt){if(pt.paused||!st)return;const bt=vt.relatedTarget;bt!==null&&(st.contains(bt)||focus(dt.current,{select:!0}))},gt=function(vt){if(document.activeElement===document.body)for(const Et of vt)Et.removedNodes.length>0&&focus(st)};document.addEventListener("focusin",ft),document.addEventListener("focusout",yt);const xt=new MutationObserver(gt);return st&&xt.observe(st,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",ft),document.removeEventListener("focusout",yt),xt.disconnect()}}},[nt,st,pt.paused]),reactExports.useEffect(()=>{if(st){focusScopesStack.add(pt);const ft=document.activeElement;if(!st.contains(ft)){const gt=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);st.addEventListener(AUTOFOCUS_ON_MOUNT,ct),st.dispatchEvent(gt),gt.defaultPrevented||(focusFirst(removeLinks(getTabbableCandidates(st)),{select:!0}),document.activeElement===ft&&focus(st))}return()=>{st.removeEventListener(AUTOFOCUS_ON_MOUNT,ct),setTimeout(()=>{const gt=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);st.addEventListener(AUTOFOCUS_ON_UNMOUNT,lt),st.dispatchEvent(gt),gt.defaultPrevented||focus(ft??document.body,{select:!0}),st.removeEventListener(AUTOFOCUS_ON_UNMOUNT,lt),focusScopesStack.remove(pt)},0)}}},[st,ct,lt,pt]);const mt=reactExports.useCallback(ft=>{if(!tt&&!nt||pt.paused)return;const yt=ft.key==="Tab"&&!ft.altKey&&!ft.ctrlKey&&!ft.metaKey,gt=document.activeElement;if(yt&>){const xt=ft.currentTarget,[vt,bt]=getTabbableEdges(xt);vt&&bt?!ft.shiftKey&>===bt?(ft.preventDefault(),tt&&focus(vt,{select:!0})):ft.shiftKey&>===vt&&(ft.preventDefault(),tt&&focus(bt,{select:!0})):gt===xt&&ft.preventDefault()}},[tt,nt,pt.paused]);return jsxRuntimeExports.jsx(Primitive.div,{tabIndex:-1,...it,ref:ht,onKeyDown:mt})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst(o,{select:et=!1}={}){const tt=document.activeElement;for(const nt of o)if(focus(nt,{select:et}),document.activeElement!==tt)return}function getTabbableEdges(o){const et=getTabbableCandidates(o),tt=findVisible(et,o),nt=findVisible(et.reverse(),o);return[tt,nt]}function getTabbableCandidates(o){const et=[],tt=document.createTreeWalker(o,NodeFilter.SHOW_ELEMENT,{acceptNode:nt=>{const rt=nt.tagName==="INPUT"&&nt.type==="hidden";return nt.disabled||nt.hidden||rt?NodeFilter.FILTER_SKIP:nt.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;tt.nextNode();)et.push(tt.currentNode);return et}function findVisible(o,et){for(const tt of o)if(!isHidden(tt,{upTo:et}))return tt}function isHidden(o,{upTo:et}){if(getComputedStyle(o).visibility==="hidden")return!0;for(;o;){if(et!==void 0&&o===et)return!1;if(getComputedStyle(o).display==="none")return!0;o=o.parentElement}return!1}function isSelectableInput(o){return o instanceof HTMLInputElement&&"select"in o}function focus(o,{select:et=!1}={}){if(o&&o.focus){const tt=document.activeElement;o.focus({preventScroll:!0}),o!==tt&&isSelectableInput(o)&&et&&o.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let o=[];return{add(et){const tt=o[0];et!==tt&&(tt==null||tt.pause()),o=arrayRemove(o,et),o.unshift(et)},remove(et){var tt;o=arrayRemove(o,et),(tt=o[0])==null||tt.resume()}}}function arrayRemove(o,et){const tt=[...o],nt=tt.indexOf(et);return nt!==-1&&tt.splice(nt,1),tt}function removeLinks(o){return o.filter(et=>et.tagName!=="A")}var PORTAL_NAME$1="Portal",Portal$1=reactExports.forwardRef((o,et)=>{var st;const{container:tt,...nt}=o,[rt,ot]=reactExports.useState(!1);useLayoutEffect2(()=>ot(!0),[]);const it=tt||rt&&((st=globalThis==null?void 0:globalThis.document)==null?void 0:st.body);return it?ReactDOM.createPortal(jsxRuntimeExports.jsx(Primitive.div,{...nt,ref:et}),it):null});Portal$1.displayName=PORTAL_NAME$1;function useStateMachine$1(o,et){return reactExports.useReducer((tt,nt)=>et[tt][nt]??tt,o)}var Presence=o=>{const{present:et,children:tt}=o,nt=usePresence(et),rt=typeof tt=="function"?tt({present:nt.isPresent}):reactExports.Children.only(tt),ot=useComposedRefs(nt.ref,getElementRef(rt));return typeof tt=="function"||nt.isPresent?reactExports.cloneElement(rt,{ref:ot}):null};Presence.displayName="Presence";function usePresence(o){const[et,tt]=reactExports.useState(),nt=reactExports.useRef({}),rt=reactExports.useRef(o),ot=reactExports.useRef("none"),it=o?"mounted":"unmounted",[st,at]=useStateMachine$1(it,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const ct=getAnimationName(nt.current);ot.current=st==="mounted"?ct:"none"},[st]),useLayoutEffect2(()=>{const ct=nt.current,lt=rt.current;if(lt!==o){const ht=ot.current,pt=getAnimationName(ct);o?at("MOUNT"):pt==="none"||(ct==null?void 0:ct.display)==="none"?at("UNMOUNT"):at(lt&&ht!==pt?"ANIMATION_OUT":"UNMOUNT"),rt.current=o}},[o,at]),useLayoutEffect2(()=>{if(et){let ct;const lt=et.ownerDocument.defaultView??window,dt=pt=>{const ft=getAnimationName(nt.current).includes(pt.animationName);if(pt.target===et&&ft&&(at("ANIMATION_END"),!rt.current)){const yt=et.style.animationFillMode;et.style.animationFillMode="forwards",ct=lt.setTimeout(()=>{et.style.animationFillMode==="forwards"&&(et.style.animationFillMode=yt)})}},ht=pt=>{pt.target===et&&(ot.current=getAnimationName(nt.current))};return et.addEventListener("animationstart",ht),et.addEventListener("animationcancel",dt),et.addEventListener("animationend",dt),()=>{lt.clearTimeout(ct),et.removeEventListener("animationstart",ht),et.removeEventListener("animationcancel",dt),et.removeEventListener("animationend",dt)}}else at("ANIMATION_END")},[et,at]),{isPresent:["mounted","unmountSuspended"].includes(st),ref:reactExports.useCallback(ct=>{ct&&(nt.current=getComputedStyle(ct)),tt(ct)},[])}}function getAnimationName(o){return(o==null?void 0:o.animationName)||"none"}function getElementRef(o){var nt,rt;let et=(nt=Object.getOwnPropertyDescriptor(o.props,"ref"))==null?void 0:nt.get,tt=et&&"isReactWarning"in et&&et.isReactWarning;return tt?o.ref:(et=(rt=Object.getOwnPropertyDescriptor(o,"ref"))==null?void 0:rt.get,tt=et&&"isReactWarning"in et&&et.isReactWarning,tt?o.props.ref:o.props.ref||o.ref)}var count=0;function useFocusGuards(){reactExports.useEffect(()=>{const o=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",o[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",o[1]??createFocusGuard()),count++,()=>{count===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(et=>et.remove()),count--}},[])}function createFocusGuard(){const o=document.createElement("span");return o.setAttribute("data-radix-focus-guard",""),o.tabIndex=0,o.style.outline="none",o.style.opacity="0",o.style.position="fixed",o.style.pointerEvents="none",o}var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";function assignRef(o,et){return typeof o=="function"?o(et):o&&(o.current=et),o}function useCallbackRef(o,et){var tt=reactExports.useState(function(){return{value:o,callback:et,facade:{get current(){return tt.value},set current(nt){var rt=tt.value;rt!==nt&&(tt.value=nt,tt.callback(nt,rt))}}}})[0];return tt.callback=et,tt.facade}var useIsomorphicLayoutEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,currentValues=new WeakMap;function useMergeRefs(o,et){var tt=useCallbackRef(null,function(nt){return o.forEach(function(rt){return assignRef(rt,nt)})});return useIsomorphicLayoutEffect(function(){var nt=currentValues.get(tt);if(nt){var rt=new Set(nt),ot=new Set(o),it=tt.current;rt.forEach(function(st){ot.has(st)||assignRef(st,null)}),ot.forEach(function(st){rt.has(st)||assignRef(st,it)})}currentValues.set(tt,o)},[o]),tt}function ItoI(o){return o}function innerCreateMedium(o,et){et===void 0&&(et=ItoI);var tt=[],nt=!1,rt={read:function(){if(nt)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return tt.length?tt[tt.length-1]:o},useMedium:function(ot){var it=et(ot,nt);return tt.push(it),function(){tt=tt.filter(function(st){return st!==it})}},assignSyncMedium:function(ot){for(nt=!0;tt.length;){var it=tt;tt=[],it.forEach(ot)}tt={push:function(st){return ot(st)},filter:function(){return tt}}},assignMedium:function(ot){nt=!0;var it=[];if(tt.length){var st=tt;tt=[],st.forEach(ot),it=tt}var at=function(){var lt=it;it=[],lt.forEach(ot)},ct=function(){return Promise.resolve().then(at)};ct(),tt={push:function(lt){it.push(lt),ct()},filter:function(lt){return it=it.filter(lt),tt}}}};return rt}function createSidecarMedium(o){o===void 0&&(o={});var et=innerCreateMedium(null);return et.options=__assign({async:!0,ssr:!1},o),et}var SideCar$1=function(o){var et=o.sideCar,tt=__rest(o,["sideCar"]);if(!et)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var nt=et.read();if(!nt)throw new Error("Sidecar medium not found");return reactExports.createElement(nt,__assign({},tt))};SideCar$1.isSideCarExport=!0;function exportSidecar(o,et){return o.useMedium(et),SideCar$1}var effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=reactExports.forwardRef(function(o,et){var tt=reactExports.useRef(null),nt=reactExports.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),rt=nt[0],ot=nt[1],it=o.forwardProps,st=o.children,at=o.className,ct=o.removeScrollBar,lt=o.enabled,dt=o.shards,ht=o.sideCar,pt=o.noIsolation,mt=o.inert,ft=o.allowPinchZoom,yt=o.as,gt=yt===void 0?"div":yt,xt=o.gapMode,vt=__rest(o,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),bt=ht,Et=useMergeRefs([tt,et]),wt=__assign(__assign({},vt),rt);return reactExports.createElement(reactExports.Fragment,null,lt&&reactExports.createElement(bt,{sideCar:effectCar,removeScrollBar:ct,shards:dt,noIsolation:pt,inert:mt,setCallbacks:ot,allowPinchZoom:!!ft,lockRef:tt,gapMode:xt}),it?reactExports.cloneElement(reactExports.Children.only(st),__assign(__assign({},wt),{ref:Et})):reactExports.createElement(gt,__assign({},wt,{className:at,ref:Et}),st))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var o=document.createElement("style");o.type="text/css";var et=getNonce();return et&&o.setAttribute("nonce",et),o}function injectStyles(o,et){o.styleSheet?o.styleSheet.cssText=et:o.appendChild(document.createTextNode(et))}function insertStyleTag(o){var et=document.head||document.getElementsByTagName("head")[0];et.appendChild(o)}var stylesheetSingleton=function(){var o=0,et=null;return{add:function(tt){o==0&&(et=makeStyleTag())&&(injectStyles(et,tt),insertStyleTag(et)),o++},remove:function(){o--,!o&&et&&(et.parentNode&&et.parentNode.removeChild(et),et=null)}}},styleHookSingleton=function(){var o=stylesheetSingleton();return function(et,tt){reactExports.useEffect(function(){return o.add(et),function(){o.remove()}},[et&&tt])}},styleSingleton=function(){var o=styleHookSingleton(),et=function(tt){var nt=tt.styles,rt=tt.dynamic;return o(nt,rt),null};return et},zeroGap={left:0,top:0,right:0,gap:0},parse$2=function(o){return parseInt(o||"",10)||0},getOffset=function(o){var et=window.getComputedStyle(document.body),tt=et[o==="padding"?"paddingLeft":"marginLeft"],nt=et[o==="padding"?"paddingTop":"marginTop"],rt=et[o==="padding"?"paddingRight":"marginRight"];return[parse$2(tt),parse$2(nt),parse$2(rt)]},getGapWidth=function(o){if(o===void 0&&(o="margin"),typeof window>"u")return zeroGap;var et=getOffset(o),tt=document.documentElement.clientWidth,nt=window.innerWidth;return{left:et[0],top:et[1],right:et[2],gap:Math.max(0,nt-tt+et[2]-et[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(o,et,tt,nt){var rt=o.left,ot=o.top,it=o.right,st=o.gap;return tt===void 0&&(tt="margin"),` + .`.concat(noScrollbarsClassName,` { + overflow: hidden `).concat(nt,`; + padding-right: `).concat(st,"px ").concat(nt,`; + } + body[`).concat(lockAttribute,`] { + overflow: hidden `).concat(nt,`; + overscroll-behavior: contain; + `).concat([et&&"position: relative ".concat(nt,";"),tt==="margin"&&` + padding-left: `.concat(rt,`px; + padding-top: `).concat(ot,`px; + padding-right: `).concat(it,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(st,"px ").concat(nt,`; + `),tt==="padding"&&"padding-right: ".concat(st,"px ").concat(nt,";")].filter(Boolean).join(""),` + } + + .`).concat(zeroRightClassName,` { + right: `).concat(st,"px ").concat(nt,`; + } + + .`).concat(fullWidthClassName,` { + margin-right: `).concat(st,"px ").concat(nt,`; + } + + .`).concat(zeroRightClassName," .").concat(zeroRightClassName,` { + right: 0 `).concat(nt,`; + } + + .`).concat(fullWidthClassName," .").concat(fullWidthClassName,` { + margin-right: 0 `).concat(nt,`; + } + + body[`).concat(lockAttribute,`] { + `).concat(removedBarSizeVariable,": ").concat(st,`px; + } +`)},getCurrentUseCounter=function(){var o=parseInt(document.body.getAttribute(lockAttribute)||"0",10);return isFinite(o)?o:0},useLockAttribute=function(){reactExports.useEffect(function(){return document.body.setAttribute(lockAttribute,(getCurrentUseCounter()+1).toString()),function(){var o=getCurrentUseCounter()-1;o<=0?document.body.removeAttribute(lockAttribute):document.body.setAttribute(lockAttribute,o.toString())}},[])},RemoveScrollBar=function(o){var et=o.noRelative,tt=o.noImportant,nt=o.gapMode,rt=nt===void 0?"margin":nt;useLockAttribute();var ot=reactExports.useMemo(function(){return getGapWidth(rt)},[rt]);return reactExports.createElement(Style,{styles:getStyles(ot,!et,rt,tt?"":"!important")})},passiveSupported=!1;if(typeof window<"u")try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveSupported=!1}var nonPassive=passiveSupported?{passive:!1}:!1,alwaysContainsScroll=function(o){return o.tagName==="TEXTAREA"},elementCanBeScrolled=function(o,et){if(!(o instanceof Element))return!1;var tt=window.getComputedStyle(o);return tt[et]!=="hidden"&&!(tt.overflowY===tt.overflowX&&!alwaysContainsScroll(o)&&tt[et]==="visible")},elementCouldBeVScrolled=function(o){return elementCanBeScrolled(o,"overflowY")},elementCouldBeHScrolled=function(o){return elementCanBeScrolled(o,"overflowX")},locationCouldBeScrolled=function(o,et){var tt=et.ownerDocument,nt=et;do{typeof ShadowRoot<"u"&&nt instanceof ShadowRoot&&(nt=nt.host);var rt=elementCouldBeScrolled(o,nt);if(rt){var ot=getScrollVariables(o,nt),it=ot[1],st=ot[2];if(it>st)return!0}nt=nt.parentNode}while(nt&&nt!==tt.body);return!1},getVScrollVariables=function(o){var et=o.scrollTop,tt=o.scrollHeight,nt=o.clientHeight;return[et,tt,nt]},getHScrollVariables=function(o){var et=o.scrollLeft,tt=o.scrollWidth,nt=o.clientWidth;return[et,tt,nt]},elementCouldBeScrolled=function(o,et){return o==="v"?elementCouldBeVScrolled(et):elementCouldBeHScrolled(et)},getScrollVariables=function(o,et){return o==="v"?getVScrollVariables(et):getHScrollVariables(et)},getDirectionFactor=function(o,et){return o==="h"&&et==="rtl"?-1:1},handleScroll=function(o,et,tt,nt,rt){var ot=getDirectionFactor(o,window.getComputedStyle(et).direction),it=ot*nt,st=tt.target,at=et.contains(st),ct=!1,lt=it>0,dt=0,ht=0;do{var pt=getScrollVariables(o,st),mt=pt[0],ft=pt[1],yt=pt[2],gt=ft-yt-ot*mt;(mt||gt)&&elementCouldBeScrolled(o,st)&&(dt+=gt,ht+=mt),st instanceof ShadowRoot?st=st.host:st=st.parentNode}while(!at&&st!==document.body||at&&(et.contains(st)||et===st));return(lt&&(Math.abs(dt)<1||!rt)||!lt&&(Math.abs(ht)<1||!rt))&&(ct=!0),ct},getTouchXY=function(o){return"changedTouches"in o?[o.changedTouches[0].clientX,o.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(o){return[o.deltaX,o.deltaY]},extractRef=function(o){return o&&"current"in o?o.current:o},deltaCompare=function(o,et){return o[0]===et[0]&&o[1]===et[1]},generateStyle=function(o){return` + .block-interactivity-`.concat(o,` {pointer-events: none;} + .allow-interactivity-`).concat(o,` {pointer-events: all;} +`)},idCounter=0,lockStack=[];function RemoveScrollSideCar(o){var et=reactExports.useRef([]),tt=reactExports.useRef([0,0]),nt=reactExports.useRef(),rt=reactExports.useState(idCounter++)[0],ot=reactExports.useState(styleSingleton)[0],it=reactExports.useRef(o);reactExports.useEffect(function(){it.current=o},[o]),reactExports.useEffect(function(){if(o.inert){document.body.classList.add("block-interactivity-".concat(rt));var ft=__spreadArray([o.lockRef.current],(o.shards||[]).map(extractRef),!0).filter(Boolean);return ft.forEach(function(yt){return yt.classList.add("allow-interactivity-".concat(rt))}),function(){document.body.classList.remove("block-interactivity-".concat(rt)),ft.forEach(function(yt){return yt.classList.remove("allow-interactivity-".concat(rt))})}}},[o.inert,o.lockRef.current,o.shards]);var st=reactExports.useCallback(function(ft,yt){if("touches"in ft&&ft.touches.length===2||ft.type==="wheel"&&ft.ctrlKey)return!it.current.allowPinchZoom;var gt=getTouchXY(ft),xt=tt.current,vt="deltaX"in ft?ft.deltaX:xt[0]-gt[0],bt="deltaY"in ft?ft.deltaY:xt[1]-gt[1],Et,wt=ft.target,kt=Math.abs(vt)>Math.abs(bt)?"h":"v";if("touches"in ft&&kt==="h"&&wt.type==="range")return!1;var Tt=locationCouldBeScrolled(kt,wt);if(!Tt)return!0;if(Tt?Et=kt:(Et=kt==="v"?"h":"v",Tt=locationCouldBeScrolled(kt,wt)),!Tt)return!1;if(!nt.current&&"changedTouches"in ft&&(vt||bt)&&(nt.current=Et),!Et)return!0;var Rt=nt.current||Et;return handleScroll(Rt,yt,ft,Rt==="h"?vt:bt,!0)},[]),at=reactExports.useCallback(function(ft){var yt=ft;if(!(!lockStack.length||lockStack[lockStack.length-1]!==ot)){var gt="deltaY"in yt?getDeltaXY(yt):getTouchXY(yt),xt=et.current.filter(function(Et){return Et.name===yt.type&&(Et.target===yt.target||yt.target===Et.shadowParent)&&deltaCompare(Et.delta,gt)})[0];if(xt&&xt.should){yt.cancelable&&yt.preventDefault();return}if(!xt){var vt=(it.current.shards||[]).map(extractRef).filter(Boolean).filter(function(Et){return Et.contains(yt.target)}),bt=vt.length>0?st(yt,vt[0]):!it.current.noIsolation;bt&&yt.cancelable&&yt.preventDefault()}}},[]),ct=reactExports.useCallback(function(ft,yt,gt,xt){var vt={name:ft,delta:yt,target:gt,should:xt,shadowParent:getOutermostShadowParent(gt)};et.current.push(vt),setTimeout(function(){et.current=et.current.filter(function(bt){return bt!==vt})},1)},[]),lt=reactExports.useCallback(function(ft){tt.current=getTouchXY(ft),nt.current=void 0},[]),dt=reactExports.useCallback(function(ft){ct(ft.type,getDeltaXY(ft),ft.target,st(ft,o.lockRef.current))},[]),ht=reactExports.useCallback(function(ft){ct(ft.type,getTouchXY(ft),ft.target,st(ft,o.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack.push(ot),o.setCallbacks({onScrollCapture:dt,onWheelCapture:dt,onTouchMoveCapture:ht}),document.addEventListener("wheel",at,nonPassive),document.addEventListener("touchmove",at,nonPassive),document.addEventListener("touchstart",lt,nonPassive),function(){lockStack=lockStack.filter(function(ft){return ft!==ot}),document.removeEventListener("wheel",at,nonPassive),document.removeEventListener("touchmove",at,nonPassive),document.removeEventListener("touchstart",lt,nonPassive)}},[]);var pt=o.removeScrollBar,mt=o.inert;return reactExports.createElement(reactExports.Fragment,null,mt?reactExports.createElement(ot,{styles:generateStyle(rt)}):null,pt?reactExports.createElement(RemoveScrollBar,{gapMode:o.gapMode}):null)}function getOutermostShadowParent(o){for(var et=null;o!==null;)o instanceof ShadowRoot&&(et=o.host,o=o.host),o=o.parentNode;return et}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=reactExports.forwardRef(function(o,et){return reactExports.createElement(RemoveScroll,__assign({},o,{ref:et,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;var getDefaultParent=function(o){if(typeof document>"u")return null;var et=Array.isArray(o)?o[0]:o;return et.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(o){return o&&(o.host||unwrapHost(o.parentNode))},correctTargets=function(o,et){return et.map(function(tt){if(o.contains(tt))return tt;var nt=unwrapHost(tt);return nt&&o.contains(nt)?nt:(console.error("aria-hidden",tt,"in not contained inside",o,". Doing nothing"),null)}).filter(function(tt){return!!tt})},applyAttributeToOthers=function(o,et,tt,nt){var rt=correctTargets(et,Array.isArray(o)?o:[o]);markerMap[tt]||(markerMap[tt]=new WeakMap);var ot=markerMap[tt],it=[],st=new Set,at=new Set(rt),ct=function(dt){!dt||st.has(dt)||(st.add(dt),ct(dt.parentNode))};rt.forEach(ct);var lt=function(dt){!dt||at.has(dt)||Array.prototype.forEach.call(dt.children,function(ht){if(st.has(ht))lt(ht);else try{var pt=ht.getAttribute(nt),mt=pt!==null&&pt!=="false",ft=(counterMap.get(ht)||0)+1,yt=(ot.get(ht)||0)+1;counterMap.set(ht,ft),ot.set(ht,yt),it.push(ht),ft===1&&mt&&uncontrolledNodes.set(ht,!0),yt===1&&ht.setAttribute(tt,"true"),mt||ht.setAttribute(nt,"true")}catch(gt){console.error("aria-hidden: cannot operate on ",ht,gt)}})};return lt(et),st.clear(),lockCount++,function(){it.forEach(function(dt){var ht=counterMap.get(dt)-1,pt=ot.get(dt)-1;counterMap.set(dt,ht),ot.set(dt,pt),ht||(uncontrolledNodes.has(dt)||dt.removeAttribute(nt),uncontrolledNodes.delete(dt)),pt||dt.removeAttribute(tt)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(o,et,tt){tt===void 0&&(tt="data-aria-hidden");var nt=Array.from(Array.isArray(o)?o:[o]),rt=getDefaultParent(o);return rt?(nt.push.apply(nt,Array.from(rt.querySelectorAll("[aria-live]"))),applyAttributeToOthers(nt,rt,tt,"aria-hidden")):function(){return null}},DIALOG_NAME="Dialog",[createDialogContext,createDialogScope]=createContextScope(DIALOG_NAME),[DialogProvider,useDialogContext]=createDialogContext(DIALOG_NAME),Dialog$1=o=>{const{__scopeDialog:et,children:tt,open:nt,defaultOpen:rt,onOpenChange:ot,modal:it=!0}=o,st=reactExports.useRef(null),at=reactExports.useRef(null),[ct=!1,lt]=useControllableState({prop:nt,defaultProp:rt,onChange:ot});return jsxRuntimeExports.jsx(DialogProvider,{scope:et,triggerRef:st,contentRef:at,contentId:useId(),titleId:useId(),descriptionId:useId(),open:ct,onOpenChange:lt,onOpenToggle:reactExports.useCallback(()=>lt(dt=>!dt),[lt]),modal:it,children:tt})};Dialog$1.displayName=DIALOG_NAME;var TRIGGER_NAME="DialogTrigger",DialogTrigger$1=reactExports.forwardRef((o,et)=>{const{__scopeDialog:tt,...nt}=o,rt=useDialogContext(TRIGGER_NAME,tt),ot=useComposedRefs(et,rt.triggerRef);return jsxRuntimeExports.jsx(Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":rt.open,"aria-controls":rt.contentId,"data-state":getState(rt.open),...nt,ref:ot,onClick:composeEventHandlers(o.onClick,rt.onOpenToggle)})});DialogTrigger$1.displayName=TRIGGER_NAME;var PORTAL_NAME="DialogPortal",[PortalProvider,usePortalContext]=createDialogContext(PORTAL_NAME,{forceMount:void 0}),DialogPortal$1=o=>{const{__scopeDialog:et,forceMount:tt,children:nt,container:rt}=o,ot=useDialogContext(PORTAL_NAME,et);return jsxRuntimeExports.jsx(PortalProvider,{scope:et,forceMount:tt,children:reactExports.Children.map(nt,it=>jsxRuntimeExports.jsx(Presence,{present:tt||ot.open,children:jsxRuntimeExports.jsx(Portal$1,{asChild:!0,container:rt,children:it})}))})};DialogPortal$1.displayName=PORTAL_NAME;var OVERLAY_NAME="DialogOverlay",DialogOverlay$1=reactExports.forwardRef((o,et)=>{const tt=usePortalContext(OVERLAY_NAME,o.__scopeDialog),{forceMount:nt=tt.forceMount,...rt}=o,ot=useDialogContext(OVERLAY_NAME,o.__scopeDialog);return ot.modal?jsxRuntimeExports.jsx(Presence,{present:nt||ot.open,children:jsxRuntimeExports.jsx(DialogOverlayImpl,{...rt,ref:et})}):null});DialogOverlay$1.displayName=OVERLAY_NAME;var DialogOverlayImpl=reactExports.forwardRef((o,et)=>{const{__scopeDialog:tt,...nt}=o,rt=useDialogContext(OVERLAY_NAME,tt);return jsxRuntimeExports.jsx(ReactRemoveScroll,{as:Slot,allowPinchZoom:!0,shards:[rt.contentRef],children:jsxRuntimeExports.jsx(Primitive.div,{"data-state":getState(rt.open),...nt,ref:et,style:{pointerEvents:"auto",...nt.style}})})}),CONTENT_NAME="DialogContent",DialogContent$1=reactExports.forwardRef((o,et)=>{const tt=usePortalContext(CONTENT_NAME,o.__scopeDialog),{forceMount:nt=tt.forceMount,...rt}=o,ot=useDialogContext(CONTENT_NAME,o.__scopeDialog);return jsxRuntimeExports.jsx(Presence,{present:nt||ot.open,children:ot.modal?jsxRuntimeExports.jsx(DialogContentModal,{...rt,ref:et}):jsxRuntimeExports.jsx(DialogContentNonModal,{...rt,ref:et})})});DialogContent$1.displayName=CONTENT_NAME;var DialogContentModal=reactExports.forwardRef((o,et)=>{const tt=useDialogContext(CONTENT_NAME,o.__scopeDialog),nt=reactExports.useRef(null),rt=useComposedRefs(et,tt.contentRef,nt);return reactExports.useEffect(()=>{const ot=nt.current;if(ot)return hideOthers(ot)},[]),jsxRuntimeExports.jsx(DialogContentImpl,{...o,ref:rt,trapFocus:tt.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(o.onCloseAutoFocus,ot=>{var it;ot.preventDefault(),(it=tt.triggerRef.current)==null||it.focus()}),onPointerDownOutside:composeEventHandlers(o.onPointerDownOutside,ot=>{const it=ot.detail.originalEvent,st=it.button===0&&it.ctrlKey===!0;(it.button===2||st)&&ot.preventDefault()}),onFocusOutside:composeEventHandlers(o.onFocusOutside,ot=>ot.preventDefault())})}),DialogContentNonModal=reactExports.forwardRef((o,et)=>{const tt=useDialogContext(CONTENT_NAME,o.__scopeDialog),nt=reactExports.useRef(!1),rt=reactExports.useRef(!1);return jsxRuntimeExports.jsx(DialogContentImpl,{...o,ref:et,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:ot=>{var it,st;(it=o.onCloseAutoFocus)==null||it.call(o,ot),ot.defaultPrevented||(nt.current||(st=tt.triggerRef.current)==null||st.focus(),ot.preventDefault()),nt.current=!1,rt.current=!1},onInteractOutside:ot=>{var at,ct;(at=o.onInteractOutside)==null||at.call(o,ot),ot.defaultPrevented||(nt.current=!0,ot.detail.originalEvent.type==="pointerdown"&&(rt.current=!0));const it=ot.target;((ct=tt.triggerRef.current)==null?void 0:ct.contains(it))&&ot.preventDefault(),ot.detail.originalEvent.type==="focusin"&&rt.current&&ot.preventDefault()}})}),DialogContentImpl=reactExports.forwardRef((o,et)=>{const{__scopeDialog:tt,trapFocus:nt,onOpenAutoFocus:rt,onCloseAutoFocus:ot,...it}=o,st=useDialogContext(CONTENT_NAME,tt),at=reactExports.useRef(null),ct=useComposedRefs(et,at);return useFocusGuards(),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FocusScope,{asChild:!0,loop:!0,trapped:nt,onMountAutoFocus:rt,onUnmountAutoFocus:ot,children:jsxRuntimeExports.jsx(DismissableLayer,{role:"dialog",id:st.contentId,"aria-describedby":st.descriptionId,"aria-labelledby":st.titleId,"data-state":getState(st.open),...it,ref:ct,onDismiss:()=>st.onOpenChange(!1)})}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TitleWarning,{titleId:st.titleId}),jsxRuntimeExports.jsx(DescriptionWarning,{contentRef:at,descriptionId:st.descriptionId})]})]})}),TITLE_NAME="DialogTitle",DialogTitle$1=reactExports.forwardRef((o,et)=>{const{__scopeDialog:tt,...nt}=o,rt=useDialogContext(TITLE_NAME,tt);return jsxRuntimeExports.jsx(Primitive.h2,{id:rt.titleId,...nt,ref:et})});DialogTitle$1.displayName=TITLE_NAME;var DESCRIPTION_NAME="DialogDescription",DialogDescription$1=reactExports.forwardRef((o,et)=>{const{__scopeDialog:tt,...nt}=o,rt=useDialogContext(DESCRIPTION_NAME,tt);return jsxRuntimeExports.jsx(Primitive.p,{id:rt.descriptionId,...nt,ref:et})});DialogDescription$1.displayName=DESCRIPTION_NAME;var CLOSE_NAME="DialogClose",DialogClose=reactExports.forwardRef((o,et)=>{const{__scopeDialog:tt,...nt}=o,rt=useDialogContext(CLOSE_NAME,tt);return jsxRuntimeExports.jsx(Primitive.button,{type:"button",...nt,ref:et,onClick:composeEventHandlers(o.onClick,()=>rt.onOpenChange(!1))})});DialogClose.displayName=CLOSE_NAME;function getState(o){return o?"open":"closed"}var TITLE_WARNING_NAME="DialogTitleWarning",[WarningProvider,useWarningContext]=createContext2(TITLE_WARNING_NAME,{contentName:CONTENT_NAME,titleName:TITLE_NAME,docsSlug:"dialog"}),TitleWarning=({titleId:o})=>{const et=useWarningContext(TITLE_WARNING_NAME),tt=`\`${et.contentName}\` requires a \`${et.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${et.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${et.docsSlug}`;return reactExports.useEffect(()=>{o&&(document.getElementById(o)||console.error(tt))},[tt,o]),null},DESCRIPTION_WARNING_NAME="DialogDescriptionWarning",DescriptionWarning=({contentRef:o,descriptionId:et})=>{const nt=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;return reactExports.useEffect(()=>{var ot;const rt=(ot=o.current)==null?void 0:ot.getAttribute("aria-describedby");et&&rt&&(document.getElementById(et)||console.warn(nt))},[nt,o,et]),null},Root$2=Dialog$1,Trigger=DialogTrigger$1,Portal=DialogPortal$1,Overlay=DialogOverlay$1,Content=DialogContent$1,Title=DialogTitle$1,Description=DialogDescription$1;const Dialog=Root$2,DialogTrigger=Trigger,DialogPortal=Portal,DialogOverlay=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx(Overlay,{ref:tt,className:cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",o),...et}));DialogOverlay.displayName=Overlay.displayName;const DialogContent=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsxs(DialogPortal,{children:[jsxRuntimeExports.jsx(DialogOverlay,{}),jsxRuntimeExports.jsx(Content,{ref:tt,className:cn("fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200","rounded-lg","max-h-[85vh] overflow-y-auto",o),...et})]}));DialogContent.displayName=Content.displayName;const DialogHeader=({className:o,...et})=>jsxRuntimeExports.jsx("div",{className:cn("flex flex-col space-y-1.5 text-center sm:text-left",o),...et});DialogHeader.displayName="DialogHeader";const DialogFooter=({className:o,...et})=>jsxRuntimeExports.jsx("div",{className:cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",o),...et});DialogFooter.displayName="DialogFooter";const DialogTitle=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx(Title,{ref:tt,className:cn("text-lg font-semibold leading-none tracking-tight",o),...et}));DialogTitle.displayName=Title.displayName;const DialogDescription=reactExports.forwardRef(({className:o,...et},tt)=>jsxRuntimeExports.jsx(Description,{ref:tt,className:cn("text-sm text-muted-foreground",o),...et}));DialogDescription.displayName=Description.displayName;var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(o,et,tt)=>et in o?__defProp(o,et,{enumerable:!0,configurable:!0,writable:!0,value:tt}):o[et]=tt,__spreadValues=(o,et)=>{for(var tt in et||(et={}))__hasOwnProp.call(et,tt)&&__defNormalProp(o,tt,et[tt]);if(__getOwnPropSymbols)for(var tt of __getOwnPropSymbols(et))__propIsEnum.call(et,tt)&&__defNormalProp(o,tt,et[tt]);return o},__objRest=(o,et)=>{var tt={};for(var nt in o)__hasOwnProp.call(o,nt)&&et.indexOf(nt)<0&&(tt[nt]=o[nt]);if(o!=null&&__getOwnPropSymbols)for(var nt of __getOwnPropSymbols(o))et.indexOf(nt)<0&&__propIsEnum.call(o,nt)&&(tt[nt]=o[nt]);return tt};/** + * @license QR Code generator library (TypeScript) + * Copyright (c) Project Nayuki. + * SPDX-License-Identifier: MIT + */var qrcodegen;(o=>{const et=class Cn{constructor(at,ct,lt,dt){if(this.version=at,this.errorCorrectionLevel=ct,this.modules=[],this.isFunction=[],atCn.MAX_VERSION)throw new RangeError("Version value out of range");if(dt<-1||dt>7)throw new RangeError("Mask value out of range");this.size=at*4+17;let ht=[];for(let mt=0;mt7)throw new RangeError("Invalid value");let mt,ft;for(mt=lt;;mt++){const vt=Cn.getNumDataCodewords(mt,ct)*8,bt=it.getTotalBits(at,mt);if(bt<=vt){ft=bt;break}if(mt>=dt)throw new RangeError("Data too long")}for(const vt of[Cn.Ecc.MEDIUM,Cn.Ecc.QUARTILE,Cn.Ecc.HIGH])pt&&ft<=Cn.getNumDataCodewords(mt,vt)*8&&(ct=vt);let yt=[];for(const vt of at){tt(vt.mode.modeBits,4,yt),tt(vt.numChars,vt.mode.numCharCountBits(mt),yt);for(const bt of vt.getData())yt.push(bt)}rt(yt.length==ft);const gt=Cn.getNumDataCodewords(mt,ct)*8;rt(yt.length<=gt),tt(0,Math.min(4,gt-yt.length),yt),tt(0,(8-yt.length%8)%8,yt),rt(yt.length%8==0);for(let vt=236;yt.lengthxt[bt>>>3]|=vt<<7-(bt&7)),new Cn(mt,ct,xt,ht)}getModule(at,ct){return 0<=at&&at>>9)*1335;const dt=(ct<<10|lt)^21522;rt(dt>>>15==0);for(let ht=0;ht<=5;ht++)this.setFunctionModule(8,ht,nt(dt,ht));this.setFunctionModule(8,7,nt(dt,6)),this.setFunctionModule(8,8,nt(dt,7)),this.setFunctionModule(7,8,nt(dt,8));for(let ht=9;ht<15;ht++)this.setFunctionModule(14-ht,8,nt(dt,ht));for(let ht=0;ht<8;ht++)this.setFunctionModule(this.size-1-ht,8,nt(dt,ht));for(let ht=8;ht<15;ht++)this.setFunctionModule(8,this.size-15+ht,nt(dt,ht));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let at=this.version;for(let lt=0;lt<12;lt++)at=at<<1^(at>>>11)*7973;const ct=this.version<<12|at;rt(ct>>>18==0);for(let lt=0;lt<18;lt++){const dt=nt(ct,lt),ht=this.size-11+lt%3,pt=Math.floor(lt/3);this.setFunctionModule(ht,pt,dt),this.setFunctionModule(pt,ht,dt)}}drawFinderPattern(at,ct){for(let lt=-4;lt<=4;lt++)for(let dt=-4;dt<=4;dt++){const ht=Math.max(Math.abs(dt),Math.abs(lt)),pt=at+dt,mt=ct+lt;0<=pt&&pt{(vt!=ft-ht||Et>=mt)&&xt.push(bt[vt])});return rt(xt.length==pt),xt}drawCodewords(at){if(at.length!=Math.floor(Cn.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let ct=0;for(let lt=this.size-1;lt>=1;lt-=2){lt==6&&(lt=5);for(let dt=0;dt>>3],7-(ct&7)),ct++)}}rt(ct==at.length*8)}applyMask(at){if(at<0||at>7)throw new RangeError("Mask value out of range");for(let ct=0;ct5&&at++):(this.finderPenaltyAddHistory(mt,ft),pt||(at+=this.finderPenaltyCountPatterns(ft)*Cn.PENALTY_N3),pt=this.modules[ht][yt],mt=1);at+=this.finderPenaltyTerminateAndCount(pt,mt,ft)*Cn.PENALTY_N3}for(let ht=0;ht5&&at++):(this.finderPenaltyAddHistory(mt,ft),pt||(at+=this.finderPenaltyCountPatterns(ft)*Cn.PENALTY_N3),pt=this.modules[yt][ht],mt=1);at+=this.finderPenaltyTerminateAndCount(pt,mt,ft)*Cn.PENALTY_N3}for(let ht=0;htpt+(mt?1:0),ct);const lt=this.size*this.size,dt=Math.ceil(Math.abs(ct*20-lt*10)/lt)-1;return rt(0<=dt&&dt<=9),at+=dt*Cn.PENALTY_N4,rt(0<=at&&at<=2568888),at}getAlignmentPatternPositions(){if(this.version==1)return[];{const at=Math.floor(this.version/7)+2,ct=this.version==32?26:Math.ceil((this.version*4+4)/(at*2-2))*2;let lt=[6];for(let dt=this.size-7;lt.lengthCn.MAX_VERSION)throw new RangeError("Version number out of range");let ct=(16*at+128)*at+64;if(at>=2){const lt=Math.floor(at/7)+2;ct-=(25*lt-10)*lt-55,at>=7&&(ct-=36)}return rt(208<=ct&&ct<=29648),ct}static getNumDataCodewords(at,ct){return Math.floor(Cn.getNumRawDataModules(at)/8)-Cn.ECC_CODEWORDS_PER_BLOCK[ct.ordinal][at]*Cn.NUM_ERROR_CORRECTION_BLOCKS[ct.ordinal][at]}static reedSolomonComputeDivisor(at){if(at<1||at>255)throw new RangeError("Degree out of range");let ct=[];for(let dt=0;dt0);for(const dt of at){const ht=dt^lt.shift();lt.push(0),ct.forEach((pt,mt)=>lt[mt]^=Cn.reedSolomonMultiply(pt,ht))}return lt}static reedSolomonMultiply(at,ct){if(at>>>8||ct>>>8)throw new RangeError("Byte out of range");let lt=0;for(let dt=7;dt>=0;dt--)lt=lt<<1^(lt>>>7)*285,lt^=(ct>>>dt&1)*at;return rt(lt>>>8==0),lt}finderPenaltyCountPatterns(at){const ct=at[1];rt(ct<=this.size*3);const lt=ct>0&&at[2]==ct&&at[3]==ct*3&&at[4]==ct&&at[5]==ct;return(lt&&at[0]>=ct*4&&at[6]>=ct?1:0)+(lt&&at[6]>=ct*4&&at[0]>=ct?1:0)}finderPenaltyTerminateAndCount(at,ct,lt){return at&&(this.finderPenaltyAddHistory(ct,lt),ct=0),ct+=this.size,this.finderPenaltyAddHistory(ct,lt),this.finderPenaltyCountPatterns(lt)}finderPenaltyAddHistory(at,ct){ct[0]==0&&(at+=this.size),ct.pop(),ct.unshift(at)}};et.MIN_VERSION=1,et.MAX_VERSION=40,et.PENALTY_N1=3,et.PENALTY_N2=3,et.PENALTY_N3=40,et.PENALTY_N4=10,et.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],et.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],o.QrCode=et;function tt(st,at,ct){if(at<0||at>31||st>>>at)throw new RangeError("Value out of range");for(let lt=at-1;lt>=0;lt--)ct.push(st>>>lt&1)}function nt(st,at){return(st>>>at&1)!=0}function rt(st){if(!st)throw new Error("Assertion error")}const ot=class Ln{constructor(at,ct,lt){if(this.mode=at,this.numChars=ct,this.bitData=lt,ct<0)throw new RangeError("Invalid argument");this.bitData=lt.slice()}static makeBytes(at){let ct=[];for(const lt of at)tt(lt,8,ct);return new Ln(Ln.Mode.BYTE,at.length,ct)}static makeNumeric(at){if(!Ln.isNumeric(at))throw new RangeError("String contains non-numeric characters");let ct=[];for(let lt=0;lt=1<{(et=>{const tt=class{constructor(rt,ot){this.ordinal=rt,this.formatBits=ot}};tt.LOW=new tt(0,1),tt.MEDIUM=new tt(1,0),tt.QUARTILE=new tt(2,3),tt.HIGH=new tt(3,2),et.Ecc=tt})(o.QrCode||(o.QrCode={}))})(qrcodegen||(qrcodegen={}));(o=>{(et=>{const tt=class{constructor(rt,ot){this.modeBits=rt,this.numBitsCharCount=ot}numCharCountBits(rt){return this.numBitsCharCount[Math.floor((rt+7)/17)]}};tt.NUMERIC=new tt(1,[10,12,14]),tt.ALPHANUMERIC=new tt(2,[9,11,13]),tt.BYTE=new tt(4,[8,16,16]),tt.KANJI=new tt(8,[8,10,12]),tt.ECI=new tt(7,[0,0,0]),et.Mode=tt})(o.QrSegment||(o.QrSegment={}))})(qrcodegen||(qrcodegen={}));var qrcodegen_default=qrcodegen;/** + * @license qrcode.react + * Copyright (c) Paul O'Shannessy + * SPDX-License-Identifier: ISC + */var ERROR_LEVEL_MAP={L:qrcodegen_default.QrCode.Ecc.LOW,M:qrcodegen_default.QrCode.Ecc.MEDIUM,Q:qrcodegen_default.QrCode.Ecc.QUARTILE,H:qrcodegen_default.QrCode.Ecc.HIGH},DEFAULT_SIZE=128,DEFAULT_LEVEL="L",DEFAULT_BGCOLOR="#FFFFFF",DEFAULT_FGCOLOR="#000000",DEFAULT_INCLUDEMARGIN=!1,DEFAULT_MINVERSION=1,SPEC_MARGIN_SIZE=4,DEFAULT_MARGIN_SIZE=0,DEFAULT_IMG_SCALE=.1;function generatePath(o,et=0){const tt=[];return o.forEach(function(nt,rt){let ot=null;nt.forEach(function(it,st){if(!it&&ot!==null){tt.push(`M${ot+et} ${rt+et}h${st-ot}v1H${ot+et}z`),ot=null;return}if(st===nt.length-1){if(!it)return;ot===null?tt.push(`M${st+et},${rt+et} h1v1H${st+et}z`):tt.push(`M${ot+et},${rt+et} h${st+1-ot}v1H${ot+et}z`);return}it&&ot===null&&(ot=st)})}),tt.join("")}function excavateModules(o,et){return o.slice().map((tt,nt)=>nt=et.y+et.h?tt:tt.map((rt,ot)=>ot=et.x+et.w?rt:!1))}function getImageSettings(o,et,tt,nt){if(nt==null)return null;const rt=o.length+tt*2,ot=Math.floor(et*DEFAULT_IMG_SCALE),it=rt/et,st=(nt.width||ot)*it,at=(nt.height||ot)*it,ct=nt.x==null?o.length/2-st/2:nt.x*it,lt=nt.y==null?o.length/2-at/2:nt.y*it,dt=nt.opacity==null?1:nt.opacity;let ht=null;if(nt.excavate){let mt=Math.floor(ct),ft=Math.floor(lt),yt=Math.ceil(st+ct-mt),gt=Math.ceil(at+lt-ft);ht={x:mt,y:ft,w:yt,h:gt}}const pt=nt.crossOrigin;return{x:ct,y:lt,h:at,w:st,excavation:ht,opacity:dt,crossOrigin:pt}}function getMarginSize(o,et){return et!=null?Math.max(Math.floor(et),0):o?SPEC_MARGIN_SIZE:DEFAULT_MARGIN_SIZE}function useQRCode({value:o,level:et,minVersion:tt,includeMargin:nt,marginSize:rt,imageSettings:ot,size:it,boostLevel:st}){let at=React.useMemo(()=>{const mt=(Array.isArray(o)?o:[o]).reduce((ft,yt)=>(ft.push(...qrcodegen_default.QrSegment.makeSegments(yt)),ft),[]);return qrcodegen_default.QrCode.encodeSegments(mt,ERROR_LEVEL_MAP[et],tt,void 0,void 0,st)},[o,et,tt,st]);const{cells:ct,margin:lt,numCells:dt,calculatedImageSettings:ht}=React.useMemo(()=>{let pt=at.getModules();const mt=getMarginSize(nt,rt),ft=pt.length+mt*2,yt=getImageSettings(pt,it,mt,ot);return{cells:pt,margin:mt,numCells:ft,calculatedImageSettings:yt}},[at,it,ot,nt,rt]);return{qrcode:at,margin:lt,cells:ct,numCells:dt,calculatedImageSettings:ht}}var SUPPORTS_PATH2D=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),QRCodeCanvas=React.forwardRef(function(et,tt){const nt=et,{value:rt,size:ot=DEFAULT_SIZE,level:it=DEFAULT_LEVEL,bgColor:st=DEFAULT_BGCOLOR,fgColor:at=DEFAULT_FGCOLOR,includeMargin:ct=DEFAULT_INCLUDEMARGIN,minVersion:lt=DEFAULT_MINVERSION,boostLevel:dt,marginSize:ht,imageSettings:pt}=nt,ft=__objRest(nt,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:yt}=ft,gt=__objRest(ft,["style"]),xt=pt==null?void 0:pt.src,vt=React.useRef(null),bt=React.useRef(null),Et=React.useCallback(zt=>{vt.current=zt,typeof tt=="function"?tt(zt):tt&&(tt.current=zt)},[tt]),[wt,kt]=React.useState(!1),{margin:Tt,cells:Rt,numCells:Pt,calculatedImageSettings:$t}=useQRCode({value:rt,level:it,minVersion:lt,boostLevel:dt,includeMargin:ct,marginSize:ht,imageSettings:pt,size:ot});React.useEffect(()=>{if(vt.current!=null){const zt=vt.current,Ft=zt.getContext("2d");if(!Ft)return;let Yt=Rt;const Ht=bt.current,Ut=$t!=null&&Ht!==null&&Ht.complete&&Ht.naturalHeight!==0&&Ht.naturalWidth!==0;Ut&&$t.excavation!=null&&(Yt=excavateModules(Rt,$t.excavation));const qt=window.devicePixelRatio||1;zt.height=zt.width=ot*qt;const Lt=ot/Pt*qt;Ft.scale(Lt,Lt),Ft.fillStyle=st,Ft.fillRect(0,0,Pt,Pt),Ft.fillStyle=at,SUPPORTS_PATH2D?Ft.fill(new Path2D(generatePath(Yt,Tt))):Rt.forEach(function(Zt,Qt){Zt.forEach(function(Nt,Gt){Nt&&Ft.fillRect(Gt+Tt,Qt+Tt,1,1)})}),$t&&(Ft.globalAlpha=$t.opacity),Ut&&Ft.drawImage(Ht,$t.x+Tt,$t.y+Tt,$t.w,$t.h)}}),React.useEffect(()=>{kt(!1)},[xt]);const Ot=__spreadValues({height:ot,width:ot},yt);let Bt=null;return xt!=null&&(Bt=React.createElement("img",{src:xt,key:xt,style:{display:"none"},onLoad:()=>{kt(!0)},ref:bt,crossOrigin:$t==null?void 0:$t.crossOrigin})),React.createElement(React.Fragment,null,React.createElement("canvas",__spreadValues({style:Ot,height:ot,width:ot,ref:Et,role:"img"},gt)),Bt)});QRCodeCanvas.displayName="QRCodeCanvas";var QRCodeSVG=React.forwardRef(function(et,tt){const nt=et,{value:rt,size:ot=DEFAULT_SIZE,level:it=DEFAULT_LEVEL,bgColor:st=DEFAULT_BGCOLOR,fgColor:at=DEFAULT_FGCOLOR,includeMargin:ct=DEFAULT_INCLUDEMARGIN,minVersion:lt=DEFAULT_MINVERSION,boostLevel:dt,title:ht,marginSize:pt,imageSettings:mt}=nt,ft=__objRest(nt,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:yt,cells:gt,numCells:xt,calculatedImageSettings:vt}=useQRCode({value:rt,level:it,minVersion:lt,boostLevel:dt,includeMargin:ct,marginSize:pt,imageSettings:mt,size:ot});let bt=gt,Et=null;mt!=null&&vt!=null&&(vt.excavation!=null&&(bt=excavateModules(gt,vt.excavation)),Et=React.createElement("image",{href:mt.src,height:vt.h,width:vt.w,x:vt.x+yt,y:vt.y+yt,preserveAspectRatio:"none",opacity:vt.opacity,crossOrigin:vt.crossOrigin}));const wt=generatePath(bt,yt);return React.createElement("svg",__spreadValues({height:ot,width:ot,viewBox:`0 0 ${xt} ${xt}`,ref:tt,role:"img"},ft),!!ht&&React.createElement("title",null,ht),React.createElement("path",{fill:st,d:`M0,0 h${xt}v${xt}H0z`,shapeRendering:"crispEdges"}),React.createElement("path",{fill:at,d:wt,shapeRendering:"crispEdges"}),Et)});QRCodeSVG.displayName="QRCodeSVG";const QRCode=({text:o,width:et=256,height:tt=256})=>{const[nt,rt]=reactExports.useState(!1),ot=window.innerWidth<640,it=async()=>{await navigator.clipboard.writeText(o),rt(!0),setTimeout(()=>rt(!1),2e3)};return jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntimeExports.jsx(QRCodeSVG,{value:o,size:ot?Math.min(et*.8,window.innerWidth-64):Math.min(et,tt)}),jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2 w-full max-w-[300px]",children:[jsxRuntimeExports.jsx("input",{type:"text",value:o,readOnly:!0,className:"flex-1 px-3 py-2 text-xs sm:text-sm border rounded-md bg-muted truncate"}),jsxRuntimeExports.jsx(Button,{variant:"outline",size:"icon",onClick:it,className:"shrink-0",children:nt?jsxRuntimeExports.jsx(Check,{className:"h-4 w-4"}):jsxRuntimeExports.jsx(Copy,{className:"h-4 w-4"})})]})]})};var byteToHex=[];for(var i=0;i<256;++i)byteToHex.push((i+256).toString(16).slice(1));function unsafeStringify(o,et=0){return(byteToHex[o[et+0]]+byteToHex[o[et+1]]+byteToHex[o[et+2]]+byteToHex[o[et+3]]+"-"+byteToHex[o[et+4]]+byteToHex[o[et+5]]+"-"+byteToHex[o[et+6]]+byteToHex[o[et+7]]+"-"+byteToHex[o[et+8]]+byteToHex[o[et+9]]+"-"+byteToHex[o[et+10]]+byteToHex[o[et+11]]+byteToHex[o[et+12]]+byteToHex[o[et+13]]+byteToHex[o[et+14]]+byteToHex[o[et+15]]).toLowerCase()}var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}var randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const native={randomUUID};function v4(o,et,tt){if(native.randomUUID&&!et&&!o)return native.randomUUID();o=o||{};var nt=o.random||(o.rng||rng)();return nt[6]=nt[6]&15|64,nt[8]=nt[8]&63|128,unsafeStringify(nt)}var src={exports:{}},indexLight={exports:{}},indexMinimal={},minimal={},aspromise=asPromise$1;function asPromise$1(o,et){for(var tt=new Array(arguments.length-1),nt=0,rt=2,ot=!0;rt1&&st.charAt(at)==="=";)++ct;return Math.ceil(st.length*3)/4-ct};for(var tt=new Array(64),nt=new Array(123),rt=0;rt<64;)nt[tt[rt]=rt<26?rt+65:rt<52?rt+71:rt<62?rt-4:rt-59|43]=rt++;et.encode=function(st,at,ct){for(var lt=null,dt=[],ht=0,pt=0,mt;at>2],mt=(ft&3)<<4,pt=1;break;case 1:dt[ht++]=tt[mt|ft>>4],mt=(ft&15)<<2,pt=2;break;case 2:dt[ht++]=tt[mt|ft>>6],dt[ht++]=tt[ft&63],pt=0;break}ht>8191&&((lt||(lt=[])).push(String.fromCharCode.apply(String,dt)),ht=0)}return pt&&(dt[ht++]=tt[mt],dt[ht++]=61,pt===1&&(dt[ht++]=61)),lt?(ht&<.push(String.fromCharCode.apply(String,dt.slice(0,ht))),lt.join("")):String.fromCharCode.apply(String,dt.slice(0,ht))};var ot="invalid encoding";et.decode=function(st,at,ct){for(var lt=ct,dt=0,ht,pt=0;pt1)break;if((mt=nt[mt])===void 0)throw Error(ot);switch(dt){case 0:ht=mt,dt=1;break;case 1:at[ct++]=ht<<2|(mt&48)>>4,ht=mt,dt=2;break;case 2:at[ct++]=(ht&15)<<4|(mt&60)>>2,ht=mt,dt=3;break;case 3:at[ct++]=(ht&3)<<6|mt,dt=0;break}}if(dt===1)throw Error(ot);return ct-lt},et.test=function(st){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(st)}})(base64$1);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(et,tt,nt){return(this._listeners[et]||(this._listeners[et]=[])).push({fn:tt,ctx:nt||this}),this};EventEmitter.prototype.off=function(et,tt){if(et===void 0)this._listeners={};else if(tt===void 0)this._listeners[et]=[];else for(var nt=this._listeners[et],rt=0;rt0?0:2147483648,ot,it);else if(isNaN(rt))nt(2143289344,ot,it);else if(rt>34028234663852886e22)nt((st<<31|2139095040)>>>0,ot,it);else if(rt<11754943508222875e-54)nt((st<<31|Math.round(rt/1401298464324817e-60))>>>0,ot,it);else{var at=Math.floor(Math.log(rt)/Math.LN2),ct=Math.round(rt*Math.pow(2,-at)*8388608)&8388607;nt((st<<31|at+127<<23|ct)>>>0,ot,it)}}o.writeFloatLE=et.bind(null,writeUintLE),o.writeFloatBE=et.bind(null,writeUintBE);function tt(nt,rt,ot){var it=nt(rt,ot),st=(it>>31)*2+1,at=it>>>23&255,ct=it&8388607;return at===255?ct?NaN:st*(1/0):at===0?st*1401298464324817e-60*ct:st*Math.pow(2,at-150)*(ct+8388608)}o.readFloatLE=tt.bind(null,readUintLE),o.readFloatBE=tt.bind(null,readUintBE)}(),typeof Float64Array<"u"?function(){var et=new Float64Array([-0]),tt=new Uint8Array(et.buffer),nt=tt[7]===128;function rt(at,ct,lt){et[0]=at,ct[lt]=tt[0],ct[lt+1]=tt[1],ct[lt+2]=tt[2],ct[lt+3]=tt[3],ct[lt+4]=tt[4],ct[lt+5]=tt[5],ct[lt+6]=tt[6],ct[lt+7]=tt[7]}function ot(at,ct,lt){et[0]=at,ct[lt]=tt[7],ct[lt+1]=tt[6],ct[lt+2]=tt[5],ct[lt+3]=tt[4],ct[lt+4]=tt[3],ct[lt+5]=tt[2],ct[lt+6]=tt[1],ct[lt+7]=tt[0]}o.writeDoubleLE=nt?rt:ot,o.writeDoubleBE=nt?ot:rt;function it(at,ct){return tt[0]=at[ct],tt[1]=at[ct+1],tt[2]=at[ct+2],tt[3]=at[ct+3],tt[4]=at[ct+4],tt[5]=at[ct+5],tt[6]=at[ct+6],tt[7]=at[ct+7],et[0]}function st(at,ct){return tt[7]=at[ct],tt[6]=at[ct+1],tt[5]=at[ct+2],tt[4]=at[ct+3],tt[3]=at[ct+4],tt[2]=at[ct+5],tt[1]=at[ct+6],tt[0]=at[ct+7],et[0]}o.readDoubleLE=nt?it:st,o.readDoubleBE=nt?st:it}():function(){function et(nt,rt,ot,it,st,at){var ct=it<0?1:0;if(ct&&(it=-it),it===0)nt(0,st,at+rt),nt(1/it>0?0:2147483648,st,at+ot);else if(isNaN(it))nt(0,st,at+rt),nt(2146959360,st,at+ot);else if(it>17976931348623157e292)nt(0,st,at+rt),nt((ct<<31|2146435072)>>>0,st,at+ot);else{var lt;if(it<22250738585072014e-324)lt=it/5e-324,nt(lt>>>0,st,at+rt),nt((ct<<31|lt/4294967296)>>>0,st,at+ot);else{var dt=Math.floor(Math.log(it)/Math.LN2);dt===1024&&(dt=1023),lt=it*Math.pow(2,-dt),nt(lt*4503599627370496>>>0,st,at+rt),nt((ct<<31|dt+1023<<20|lt*1048576&1048575)>>>0,st,at+ot)}}}o.writeDoubleLE=et.bind(null,writeUintLE,0,4),o.writeDoubleBE=et.bind(null,writeUintBE,4,0);function tt(nt,rt,ot,it,st){var at=nt(it,st+rt),ct=nt(it,st+ot),lt=(ct>>31)*2+1,dt=ct>>>20&2047,ht=4294967296*(ct&1048575)+at;return dt===2047?ht?NaN:lt*(1/0):dt===0?lt*5e-324*ht:lt*Math.pow(2,dt-1075)*(ht+4503599627370496)}o.readDoubleLE=tt.bind(null,readUintLE,0,4),o.readDoubleBE=tt.bind(null,readUintBE,4,0)}(),o}function writeUintLE(o,et,tt){et[tt]=o&255,et[tt+1]=o>>>8&255,et[tt+2]=o>>>16&255,et[tt+3]=o>>>24}function writeUintBE(o,et,tt){et[tt]=o>>>24,et[tt+1]=o>>>16&255,et[tt+2]=o>>>8&255,et[tt+3]=o&255}function readUintLE(o,et){return(o[et]|o[et+1]<<8|o[et+2]<<16|o[et+3]<<24)>>>0}function readUintBE(o,et){return(o[et]<<24|o[et+1]<<16|o[et+2]<<8|o[et+3])>>>0}var inquire_1=inquire$1;function inquire$1(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(o){}return null}var utf8$2={};(function(o){var et=o;et.length=function(nt){for(var rt=0,ot=0,it=0;it191&<<224?at[ct++]=(lt&31)<<6|nt[rt++]&63:lt>239&<<365?(lt=((lt&7)<<18|(nt[rt++]&63)<<12|(nt[rt++]&63)<<6|nt[rt++]&63)-65536,at[ct++]=55296+(lt>>10),at[ct++]=56320+(lt&1023)):at[ct++]=(lt&15)<<12|(nt[rt++]&63)<<6|nt[rt++]&63,ct>8191&&((st||(st=[])).push(String.fromCharCode.apply(String,at)),ct=0);return st?(ct&&st.push(String.fromCharCode.apply(String,at.slice(0,ct))),st.join("")):String.fromCharCode.apply(String,at.slice(0,ct))},et.write=function(nt,rt,ot){for(var it=ot,st,at,ct=0;ct>6|192,rt[ot++]=st&63|128):(st&64512)===55296&&((at=nt.charCodeAt(ct+1))&64512)===56320?(st=65536+((st&1023)<<10)+(at&1023),++ct,rt[ot++]=st>>18|240,rt[ot++]=st>>12&63|128,rt[ot++]=st>>6&63|128,rt[ot++]=st&63|128):(rt[ot++]=st>>12|224,rt[ot++]=st>>6&63|128,rt[ot++]=st&63|128);return ot-it}})(utf8$2);var pool_1=pool;function pool(o,et,tt){var nt=tt||8192,rt=nt>>>1,ot=null,it=nt;return function(at){if(at<1||at>rt)return o(at);it+at>nt&&(ot=o(nt),it=0);var ct=et.call(ot,it,it+=at);return it&7&&(it=(it|7)+1),ct}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=et;var o=requireMinimal();function et(ot,it){this.lo=ot>>>0,this.hi=it>>>0}var tt=et.zero=new et(0,0);tt.toNumber=function(){return 0},tt.zzEncode=tt.zzDecode=function(){return this},tt.length=function(){return 1};var nt=et.zeroHash="\0\0\0\0\0\0\0\0";et.fromNumber=function(it){if(it===0)return tt;var st=it<0;st&&(it=-it);var at=it>>>0,ct=(it-at)/4294967296>>>0;return st&&(ct=~ct>>>0,at=~at>>>0,++at>4294967295&&(at=0,++ct>4294967295&&(ct=0))),new et(at,ct)},et.from=function(it){if(typeof it=="number")return et.fromNumber(it);if(o.isString(it))if(o.Long)it=o.Long.fromString(it);else return et.fromNumber(parseInt(it,10));return it.low||it.high?new et(it.low>>>0,it.high>>>0):tt},et.prototype.toNumber=function(it){if(!it&&this.hi>>>31){var st=~this.lo+1>>>0,at=~this.hi>>>0;return st||(at=at+1>>>0),-(st+at*4294967296)}return this.lo+this.hi*4294967296},et.prototype.toLong=function(it){return o.Long?new o.Long(this.lo|0,this.hi|0,!!it):{low:this.lo|0,high:this.hi|0,unsigned:!!it}};var rt=String.prototype.charCodeAt;return et.fromHash=function(it){return it===nt?tt:new et((rt.call(it,0)|rt.call(it,1)<<8|rt.call(it,2)<<16|rt.call(it,3)<<24)>>>0,(rt.call(it,4)|rt.call(it,5)<<8|rt.call(it,6)<<16|rt.call(it,7)<<24)>>>0)},et.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},et.prototype.zzEncode=function(){var it=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^it)>>>0,this.lo=(this.lo<<1^it)>>>0,this},et.prototype.zzDecode=function(){var it=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^it)>>>0,this.hi=(this.hi>>>1^it)>>>0,this},et.prototype.length=function(){var it=this.lo,st=(this.lo>>>28|this.hi<<4)>>>0,at=this.hi>>>24;return at===0?st===0?it<16384?it<128?1:2:it<2097152?3:4:st<16384?st<128?5:6:st<2097152?7:8:at<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(o){var et=o;et.asPromise=aspromise,et.base64=base64$1,et.EventEmitter=eventemitter,et.float=float,et.inquire=inquire_1,et.utf8=utf8$2,et.pool=pool_1,et.LongBits=requireLongbits(),et.isNode=!!(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node),et.global=et.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,et.emptyArray=Object.freeze?Object.freeze([]):[],et.emptyObject=Object.freeze?Object.freeze({}):{},et.isInteger=Number.isInteger||function(ot){return typeof ot=="number"&&isFinite(ot)&&Math.floor(ot)===ot},et.isString=function(ot){return typeof ot=="string"||ot instanceof String},et.isObject=function(ot){return ot&&typeof ot=="object"},et.isset=et.isSet=function(ot,it){var st=ot[it];return st!=null&&ot.hasOwnProperty(it)?typeof st!="object"||(Array.isArray(st)?st.length:Object.keys(st).length)>0:!1},et.Buffer=function(){try{var rt=et.inquire("buffer").Buffer;return rt.prototype.utf8Write?rt:null}catch{return null}}(),et._Buffer_from=null,et._Buffer_allocUnsafe=null,et.newBuffer=function(ot){return typeof ot=="number"?et.Buffer?et._Buffer_allocUnsafe(ot):new et.Array(ot):et.Buffer?et._Buffer_from(ot):typeof Uint8Array>"u"?ot:new Uint8Array(ot)},et.Array=typeof Uint8Array<"u"?Uint8Array:Array,et.Long=et.global.dcodeIO&&et.global.dcodeIO.Long||et.global.Long||et.inquire("long"),et.key2Re=/^true|false|0|1$/,et.key32Re=/^-?(?:0|[1-9][0-9]*)$/,et.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,et.longToHash=function(ot){return ot?et.LongBits.from(ot).toHash():et.LongBits.zeroHash},et.longFromHash=function(ot,it){var st=et.LongBits.fromHash(ot);return et.Long?et.Long.fromBits(st.lo,st.hi,it):st.toNumber(!!it)};function tt(rt,ot,it){for(var st=Object.keys(ot),at=0;at-1;--ct)if(it[at[ct]]===1&&this[at[ct]]!==void 0&&this[at[ct]]!==null)return at[ct]}},et.oneOfSetter=function(ot){return function(it){for(var st=0;st127;)et[tt++]=o&127|128,o>>>=7;et[tt]=o}function VarintOp(o,et){this.len=o,this.next=void 0,this.val=et}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function o(et){return this.len+=(this.tail=this.tail.next=new VarintOp((et=et>>>0)<128?1:et<16384?2:et<2097152?3:et<268435456?4:5,et)).len,this};Writer$1.prototype.int32=function o(et){return et<0?this._push(writeVarint64,10,LongBits$1.fromNumber(et)):this.uint32(et)};Writer$1.prototype.sint32=function o(et){return this.uint32((et<<1^et>>31)>>>0)};function writeVarint64(o,et,tt){for(;o.hi;)et[tt++]=o.lo&127|128,o.lo=(o.lo>>>7|o.hi<<25)>>>0,o.hi>>>=7;for(;o.lo>127;)et[tt++]=o.lo&127|128,o.lo=o.lo>>>7;et[tt++]=o.lo}Writer$1.prototype.uint64=function o(et){var tt=LongBits$1.from(et);return this._push(writeVarint64,tt.length(),tt)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function o(et){var tt=LongBits$1.from(et).zzEncode();return this._push(writeVarint64,tt.length(),tt)};Writer$1.prototype.bool=function o(et){return this._push(writeByte,1,et?1:0)};function writeFixed32(o,et,tt){et[tt]=o&255,et[tt+1]=o>>>8&255,et[tt+2]=o>>>16&255,et[tt+3]=o>>>24}Writer$1.prototype.fixed32=function o(et){return this._push(writeFixed32,4,et>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function o(et){var tt=LongBits$1.from(et);return this._push(writeFixed32,4,tt.lo)._push(writeFixed32,4,tt.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function o(et){return this._push(util$7.float.writeFloatLE,4,et)};Writer$1.prototype.double=function o(et){return this._push(util$7.float.writeDoubleLE,8,et)};var writeBytes=util$7.Array.prototype.set?function o(et,tt,nt){tt.set(et,nt)}:function o(et,tt,nt){for(var rt=0;rt>>0;if(!tt)return this._push(writeByte,1,0);if(util$7.isString(et)){var nt=Writer$1.alloc(tt=base64.length(et));base64.decode(et,nt,0),et=nt}return this.uint32(tt)._push(writeBytes,tt,et)};Writer$1.prototype.string=function o(et){var tt=utf8$1.length(et);return tt?this.uint32(tt)._push(utf8$1.write,tt,et):this._push(writeByte,1,0)};Writer$1.prototype.fork=function o(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this};Writer$1.prototype.reset=function o(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this};Writer$1.prototype.ldelim=function o(){var et=this.head,tt=this.tail,nt=this.len;return this.reset().uint32(nt),nt&&(this.tail.next=et.next,this.tail=tt,this.len+=nt),this};Writer$1.prototype.finish=function o(){for(var et=this.head.next,tt=this.constructor.alloc(this.len),nt=0;et;)et.fn(et.val,tt,nt),nt+=et.len,et=et.next;return tt};Writer$1._configure=function(o){BufferWriter$1=o,Writer$1.create=create$2(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$6=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$6._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$6.Buffer&&util$6.Buffer.prototype instanceof Uint8Array&&util$6.Buffer.prototype.set.name==="set"?function(et,tt,nt){tt.set(et,nt)}:function(et,tt,nt){if(et.copy)et.copy(tt,nt,0,et.length);else for(var rt=0;rt>>0;return this.uint32(tt),tt&&this._push(BufferWriter.writeBytesBuffer,tt,et),this};function writeStringBuffer(o,et,tt){o.length<40?util$6.utf8.write(o,et,tt):et.utf8Write?et.utf8Write(o,tt):et.write(o,tt)}BufferWriter.prototype.string=function o(et){var tt=util$6.Buffer.byteLength(et);return this.uint32(tt),tt&&this._push(writeStringBuffer,tt,et),this};BufferWriter._configure();var reader=Reader$1,util$5=requireMinimal(),BufferReader$1,LongBits=util$5.LongBits,utf8=util$5.utf8;function indexOutOfRange(o,et){return RangeError("index out of range: "+o.pos+" + "+(et||1)+" > "+o.len)}function Reader$1(o){this.buf=o,this.pos=0,this.len=o.length}var create_array=typeof Uint8Array<"u"?function o(et){if(et instanceof Uint8Array||Array.isArray(et))return new Reader$1(et);throw Error("illegal buffer")}:function o(et){if(Array.isArray(et))return new Reader$1(et);throw Error("illegal buffer")},create$1=function o(){return util$5.Buffer?function(tt){return(Reader$1.create=function(rt){return util$5.Buffer.isBuffer(rt)?new BufferReader$1(rt):create_array(rt)})(tt)}:create_array};Reader$1.create=create$1();Reader$1.prototype._slice=util$5.Array.prototype.subarray||util$5.Array.prototype.slice;Reader$1.prototype.uint32=function o(){var et=4294967295;return function(){if(et=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(et=(et|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(et=(et|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(et=(et|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(et=(et|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return et;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return et}}();Reader$1.prototype.int32=function o(){return this.uint32()|0};Reader$1.prototype.sint32=function o(){var et=this.uint32();return et>>>1^-(et&1)|0};function readLongVarint(){var o=new LongBits(0,0),et=0;if(this.len-this.pos>4){for(;et<4;++et)if(o.lo=(o.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o;if(o.lo=(o.lo|(this.buf[this.pos]&127)<<28)>>>0,o.hi=(o.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return o;et=0}else{for(;et<3;++et){if(this.pos>=this.len)throw indexOutOfRange(this);if(o.lo=(o.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}return o.lo=(o.lo|(this.buf[this.pos++]&127)<>>0,o}if(this.len-this.pos>4){for(;et<5;++et)if(o.hi=(o.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}else for(;et<5;++et){if(this.pos>=this.len)throw indexOutOfRange(this);if(o.hi=(o.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function o(){return this.uint32()!==0};function readFixed32_end(o,et){return(o[et-4]|o[et-3]<<8|o[et-2]<<16|o[et-1]<<24)>>>0}Reader$1.prototype.fixed32=function o(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function o(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function o(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var et=util$5.float.readFloatLE(this.buf,this.pos);return this.pos+=4,et};Reader$1.prototype.double=function o(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var et=util$5.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,et};Reader$1.prototype.bytes=function o(){var et=this.uint32(),tt=this.pos,nt=this.pos+et;if(nt>this.len)throw indexOutOfRange(this,et);if(this.pos+=et,Array.isArray(this.buf))return this.buf.slice(tt,nt);if(tt===nt){var rt=util$5.Buffer;return rt?rt.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,tt,nt)};Reader$1.prototype.string=function o(){var et=this.bytes();return utf8.read(et,0,et.length)};Reader$1.prototype.skip=function o(et){if(typeof et=="number"){if(this.pos+et>this.len)throw indexOutOfRange(this,et);this.pos+=et}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(o){switch(o){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(o=this.uint32()&7)!==4;)this.skipType(o);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+o+" at offset "+this.pos)}return this};Reader$1._configure=function(o){BufferReader$1=o,Reader$1.create=create$1(),BufferReader$1._configure();var et=util$5.Long?"toLong":"toNumber";util$5.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[et](!1)},uint64:function(){return readLongVarint.call(this)[et](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[et](!1)},fixed64:function(){return readFixed64.call(this)[et](!0)},sfixed64:function(){return readFixed64.call(this)[et](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$4=requireMinimal();function BufferReader(o){Reader.call(this,o)}BufferReader._configure=function(){util$4.Buffer&&(BufferReader.prototype._slice=util$4.Buffer.prototype.slice)};BufferReader.prototype.string=function o(){var et=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+et,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+et,this.len))};BufferReader._configure();var rpc={},service$1=Service$1,util$3=requireMinimal();(Service$1.prototype=Object.create(util$3.EventEmitter.prototype)).constructor=Service$1;function Service$1(o,et,tt){if(typeof o!="function")throw TypeError("rpcImpl must be a function");util$3.EventEmitter.call(this),this.rpcImpl=o,this.requestDelimited=!!et,this.responseDelimited=!!tt}Service$1.prototype.rpcCall=function o(et,tt,nt,rt,ot){if(!rt)throw TypeError("request must be specified");var it=this;if(!ot)return util$3.asPromise(o,it,et,tt,nt,rt);if(!it.rpcImpl){setTimeout(function(){ot(Error("already ended"))},0);return}try{return it.rpcImpl(et,tt[it.requestDelimited?"encodeDelimited":"encode"](rt).finish(),function(at,ct){if(at)return it.emit("error",at,et),ot(at);if(ct===null){it.end(!0);return}if(!(ct instanceof nt))try{ct=nt[it.responseDelimited?"decodeDelimited":"decode"](ct)}catch(lt){return it.emit("error",lt,et),ot(lt)}return it.emit("data",ct,et),ot(null,ct)})}catch(st){it.emit("error",st,et),setTimeout(function(){ot(st)},0);return}};Service$1.prototype.end=function o(et){return this.rpcImpl&&(et||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(o){var et=o;et.Service=service$1})(rpc);var roots={};(function(o){var et=o;et.build="minimal",et.Writer=writer,et.BufferWriter=writer_buffer,et.Reader=reader,et.BufferReader=reader_buffer,et.util=requireMinimal(),et.rpc=rpc,et.roots=roots,et.configure=tt;function tt(){et.util._configure(),et.Writer._configure(et.BufferWriter),et.Reader._configure(et.BufferReader)}tt()})(indexMinimal);var util$2={exports:{}},codegen_1=codegen;function codegen(o,et){typeof o=="string"&&(et=o,o=void 0);var tt=[];function nt(ot){if(typeof ot!="string"){var it=rt();if(codegen.verbose&&console.log("codegen: "+it),it="return "+it,ot){for(var st=Object.keys(ot),at=new Array(st.length+1),ct=new Array(st.length),lt=0;lt0&&it[ct-1]!==".."?it.splice(--ct,2):st?it.splice(ct,1):++ct:it[ct]==="."?it.splice(ct,1):++ct;return at+it.join("/")};et.resolve=function(ot,it,st){return st||(it=nt(it)),tt(it)?it:(st||(ot=nt(ot)),(ot=ot.replace(/(?:\/|^)[^/]+$/,"")).length?nt(ot+"/"+it):it)}})(path);var types$2={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(o){var et=o,tt=requireUtil(),nt=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function rt(ot,it){var st=0,at={};for(it|=0;st-1&&this.oneof.splice(st,1),it.partOf=null,this},nt.prototype.onAdd=function(it){o.prototype.onAdd.call(this,it);for(var st=this,at=0;atht)return!0}return!1},at.isReservedName=function(dt,ht){if(dt){for(var pt=0;pt0;){var mt=dt.shift();if(pt.nested&&pt.nested[mt]){if(pt=pt.nested[mt],!(pt instanceof at))throw Error("path conflicts with non-namespace objects")}else pt.add(pt=new at(mt))}return ht&&pt.addJSON(ht),pt},at.prototype.resolveAll=function(){for(var dt=this.nestedArray,ht=0;ht-1)return mt}else if(mt instanceof at&&(mt=mt.lookup(dt.slice(1),ht,!0)))return mt}else for(var ft=0;ft>>3){");for(var st=0;st>>3){")("case 1: k=r.%s(); break",at.keyType)("case 2:"),et.basic[ct]===void 0?it("value=types[%i].decode(r,r.uint32())",st):it("value=r.%s()",ct),it("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),et.long[at.keyType]!==void 0?it('%s[typeof k==="object"?util.longToHash(k):k]=value',lt):it("%s[k]=value",lt)):at.repeated?(it("if(!(%s&&%s.length))",lt,lt)("%s=[]",lt),et.packed[ct]!==void 0&&it("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0",ct,ct);break;case"int32":case"sint32":case"sfixed32":it("m%s=d%s|0",ct,ct);break;case"uint64":mt=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":it("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",ct,ct,mt)('else if(typeof d%s==="string")',ct)("m%s=parseInt(d%s,10)",ct,ct)('else if(typeof d%s==="number")',ct)("m%s=d%s",ct,ct)('else if(typeof d%s==="object")',ct)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",ct,ct,ct,mt?"true":"");break;case"bytes":it('if(typeof d%s==="string")',ct)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",ct,ct,ct)("else if(d%s.length >= 0)",ct)("m%s=d%s",ct,ct);break;case"string":it("m%s=String(d%s)",ct,ct);break;case"bool":it("m%s=Boolean(d%s)",ct,ct);break}}return it}et.fromObject=function(st){var at=st.fieldsArray,ct=nt.codegen(["d"],st.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!at.length)return ct("return new this.ctor");ct("var m=new this.ctor");for(var lt=0;lt>>0,m%s.high>>>0).toNumber(%s):m%s",ct,ct,ct,ct,lt?"true":"",ct);break;case"bytes":it("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",ct,ct,ct,ct,ct);break;default:it("d%s=m%s",ct,ct);break}}return it}et.toObject=function(st){var at=st.fieldsArray.slice().sort(nt.compareFieldsById);if(!at.length)return nt.codegen()("return {}");for(var ct=nt.codegen(["m","o"],st.name+"$toObject")("if(!o)")("o={}")("var d={}"),lt=[],dt=[],ht=[],pt=0;pt-1){var $t=Rt.substring(Pt);if($t in st)return $t}return null}function bt(Rt,Pt){try{if(rt.isString(Pt)&&Pt.charAt(0)==="{"&&(Pt=JSON.parse(Pt)),!rt.isString(Pt))yt.setOptions(Pt.options).addJSON(Pt.nested);else{it.filename=Rt;var $t=it(Pt,yt,mt),Ot,Bt=0;if($t.imports)for(;Bt<$t.imports.length;++Bt)(Ot=vt($t.imports[Bt])||yt.resolvePath(Rt,$t.imports[Bt]))&&Et(Ot);if($t.weakImports)for(Bt=0;Bt<$t.weakImports.length;++Bt)(Ot=vt($t.weakImports[Bt])||yt.resolvePath(Rt,$t.weakImports[Bt]))&&Et(Ot,!0)}}catch(zt){xt(zt)}!gt&&!wt&&xt(null,yt)}function Et(Rt,Pt){if(Rt=vt(Rt)||Rt,!(yt.files.indexOf(Rt)>-1)){if(yt.files.push(Rt),Rt in st){gt?bt(Rt,st[Rt]):(++wt,setTimeout(function(){--wt,bt(Rt,st[Rt])}));return}if(gt){var $t;try{$t=rt.fs.readFileSync(Rt).toString("utf8")}catch(Ot){Pt||xt(Ot);return}bt(Rt,$t)}else++wt,yt.fetch(Rt,function(Ot,Bt){if(--wt,!!ft){if(Ot){Pt?wt||xt(null,yt):xt(Ot);return}bt(Rt,Bt)}})}}var wt=0;rt.isString(pt)&&(pt=[pt]);for(var kt=0,Tt;kt-1&&this.deferred.splice(mt,1)}}else if(pt instanceof tt)lt.test(pt.name)&&delete pt.parent[pt.name];else if(pt instanceof o){for(var ft=0;ft0)pt[yt]=ht(pt[yt]||{},mt,ft);else{var gt=pt[yt];gt&&(ft=[].concat(gt).concat(ft)),pt[yt]=ft}return pt}if(typeof ct!="object")throw TypeError("dst must be an object");if(!lt)throw TypeError("path must be specified");return lt=lt.split("."),ht(ct,lt,dt)},Object.defineProperty(o,"decorateRoot",{get:function(){return et.decorated||(et.decorated=new(requireRoot()))}}),util$2.exports}var object,hasRequiredObject;function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=tt,tt.className="ReflectionObject";var o=requireUtil(),et;function tt(nt,rt){if(!o.isString(nt))throw TypeError("name must be a string");if(rt&&!o.isObject(rt))throw TypeError("options must be an object");this.options=rt,this.parsedOptions=null,this.name=nt,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(tt.prototype,{root:{get:function(){for(var nt=this;nt.parent!==null;)nt=nt.parent;return nt}},fullName:{get:function(){for(var nt=[this.name],rt=this.parent;rt;)nt.unshift(rt.name),rt=rt.parent;return nt.join(".")}}}),tt.prototype.toJSON=function(){throw Error()},tt.prototype.onAdd=function(rt){this.parent&&this.parent!==rt&&this.parent.remove(this),this.parent=rt,this.resolved=!1;var ot=rt.root;ot instanceof et&&ot._handleAdd(this)},tt.prototype.onRemove=function(rt){var ot=rt.root;ot instanceof et&&ot._handleRemove(this),this.parent=null,this.resolved=!1},tt.prototype.resolve=function(){return this.resolved?this:(this.root instanceof et&&(this.resolved=!0),this)},tt.prototype.getOption=function(rt){if(this.options)return this.options[rt]},tt.prototype.setOption=function(rt,ot,it){return(!it||!this.options||this.options[rt]===void 0)&&((this.options||(this.options={}))[rt]=ot),this},tt.prototype.setParsedOption=function(rt,ot,it){this.parsedOptions||(this.parsedOptions=[]);var st=this.parsedOptions;if(it){var at=st.find(function(dt){return Object.prototype.hasOwnProperty.call(dt,rt)});if(at){var ct=at[rt];o.setProperty(ct,it,ot)}else at={},at[rt]=o.setProperty({},it,ot),st.push(at)}else{var lt={};lt[rt]=ot,st.push(lt)}return this},tt.prototype.setOptions=function(rt,ot){if(rt)for(var it=Object.keys(rt),st=0;st>>0,(it.id<<3|4)>>>0):ot("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",st,at,(it.id<<3|2)>>>0)}function rt(ot){for(var it=tt.codegen(["m","w"],ot.name+"$encode")("if(!w)")("w=Writer.create()"),st,at,ct=ot.fieldsArray.slice().sort(tt.compareFieldsById),st=0;st>>0,8|et.mapKey[lt.keyType],lt.keyType),pt===void 0?it("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",dt,at):it(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|pt,ht,at),it("}")("}")):lt.repeated?(it("if(%s!=null&&%s.length){",at,at),lt.packed&&et.packed[ht]!==void 0?it("w.uint32(%i).fork()",(lt.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",at)("w.%s(%s[i])",ht,at)("w.ldelim()"):(it("for(var i=0;i<%s.length;++i)",at),pt===void 0?nt(it,lt,dt,at+"[i]"):it("w.uint32(%i).%s(%s[i])",(lt.id<<3|pt)>>>0,ht,at)),it("}")):(lt.optional&&it("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",at,lt.name),pt===void 0?nt(it,lt,dt,at):it("w.uint32(%i).%s(%s)",(lt.id<<3|pt)>>>0,ht,at))}return it("return w")}return encoder_1}var protobuf$2=indexLight.exports=indexMinimal;protobuf$2.build="light";function load(o,et,tt){return typeof et=="function"?(tt=et,et=new protobuf$2.Root):et||(et=new protobuf$2.Root),et.load(o,tt)}protobuf$2.load=load;function loadSync(o,et){return et||(et=new protobuf$2.Root),et.loadSync(o)}protobuf$2.loadSync=loadSync;protobuf$2.encoder=requireEncoder();protobuf$2.decoder=requireDecoder();protobuf$2.verifier=requireVerifier();protobuf$2.converter=requireConverter();protobuf$2.ReflectionObject=requireObject();protobuf$2.Namespace=requireNamespace();protobuf$2.Root=requireRoot();protobuf$2.Enum=require_enum();protobuf$2.Type=requireType();protobuf$2.Field=requireField();protobuf$2.OneOf=requireOneof();protobuf$2.MapField=requireMapfield();protobuf$2.Service=requireService();protobuf$2.Method=requireMethod();protobuf$2.Message=message;protobuf$2.wrappers=wrappers;protobuf$2.types=requireTypes();protobuf$2.util=requireUtil();protobuf$2.ReflectionObject._configure(protobuf$2.Root);protobuf$2.Namespace._configure(protobuf$2.Type,protobuf$2.Service,protobuf$2.Enum);protobuf$2.Root._configure(protobuf$2.Type);protobuf$2.Field._configure(protobuf$2.Type);var indexLightExports=indexLight.exports,tokenize_1=tokenize$1,delimRe=/[\s{}=;:[\],'"()<>]/g,stringDoubleRe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,stringSingleRe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,setCommentRe=/^ *[*/]+ */,setCommentAltRe=/^\s*\*?\/*/,setCommentSplitRe=/\n/g,whitespaceRe=/\s/,unescapeRe=/\\(.?)/g,unescapeMap={0:"\0",r:"\r",n:` +`,t:" "};function unescape$1(o){return o.replace(unescapeRe,function(et,tt){switch(tt){case"\\":case"":return tt;default:return unescapeMap[tt]||""}})}tokenize$1.unescape=unescape$1;function tokenize$1(o,et){o=o.toString();var tt=0,nt=o.length,rt=1,ot=0,it={},st=[],at=null;function ct(bt){return Error("illegal "+bt+" (line "+rt+")")}function lt(){var bt=at==="'"?stringSingleRe:stringDoubleRe;bt.lastIndex=tt-1;var Et=bt.exec(o);if(!Et)throw ct("string");return tt=bt.lastIndex,yt(at),at=null,unescape$1(Et[1])}function dt(bt){return o.charAt(bt)}function ht(bt,Et,wt){var kt={type:o.charAt(bt++),lineEmpty:!1,leading:wt},Tt;et?Tt=2:Tt=3;var Rt=bt-Tt,Pt;do if(--Rt<0||(Pt=o.charAt(Rt))===` +`){kt.lineEmpty=!0;break}while(Pt===" "||Pt===" ");for(var $t=o.substring(bt,Et).split(setCommentSplitRe),Ot=0;Ot<$t.length;++Ot)$t[Ot]=$t[Ot].replace(et?setCommentAltRe:setCommentRe,"").trim();kt.text=$t.join(` +`).trim(),it[rt]=kt,ot=rt}function pt(bt){var Et=mt(bt),wt=o.substring(bt,Et),kt=/^\s*\/\//.test(wt);return kt}function mt(bt){for(var Et=bt;Et0)return st.shift();if(at)return lt();var bt,Et,wt,kt,Tt,Rt=tt===0;do{if(tt===nt)return null;for(bt=!1;whitespaceRe.test(wt=dt(tt));)if(wt===` +`&&(Rt=!0,++rt),++tt===nt)return null;if(dt(tt)==="/"){if(++tt===nt)throw ct("comment");if(dt(tt)==="/")if(et){if(kt=tt,Tt=!1,pt(tt-1)){Tt=!0;do if(tt=mt(tt),tt===nt||(tt++,!Rt))break;while(pt(tt))}else tt=Math.min(nt,mt(tt)+1);Tt&&(ht(kt,tt,Rt),Rt=!0),rt++,bt=!0}else{for(Tt=dt(kt=tt+1)==="/";dt(++tt)!==` +`;)if(tt===nt)return null;++tt,Tt&&(ht(kt,tt-1,Rt),Rt=!0),++rt,bt=!0}else if((wt=dt(tt))==="*"){kt=tt+1,Tt=et||dt(kt)==="*";do{if(wt===` +`&&++rt,++tt===nt)throw ct("comment");Et=wt,wt=dt(tt)}while(Et!=="*"||wt!=="/");++tt,Tt&&(ht(kt,tt-2,Rt),Rt=!0),bt=!0}else return"/"}}while(bt);var Pt=tt;delimRe.lastIndex=0;var $t=delimRe.test(dt(Pt++));if(!$t)for(;Pt");var Dt=ot();if(!nameRe$1.test(Dt))throw xt(Dt,"name");at("=");var Vt=new MapField(gt(Dt),kt(ot()),tn,_t);Ot(Vt,function(an){if(an==="option")Lt(Vt,an),at(";");else throw xt(an)},function(){Gt(Vt)}),Jt.add(Vt)}function Ht(Jt,tn){if(!nameRe$1.test(tn=ot()))throw xt(tn,"name");var _t=new OneOf(gt(tn));Ot(_t,function(Vt){Vt==="option"?(Lt(_t,Vt),at(";")):(it(Vt),zt(_t,"optional"))}),Jt.add(_t)}function Ut(Jt,tn){if(!nameRe$1.test(tn=ot()))throw xt(tn,"name");var _t=new Enum(tn);Ot(_t,function(Vt){switch(Vt){case"option":Lt(_t,Vt),at(";");break;case"reserved":Et(_t.reserved||(_t.reserved=[]),!0);break;default:qt(_t,Vt)}}),Jt.add(_t)}function qt(Jt,tn){if(!nameRe$1.test(tn))throw xt(tn,"name");at("=");var _t=kt(ot(),!0),Dt={options:void 0};Dt.setOption=function(Vt,en){this.options===void 0&&(this.options={}),this.options[Vt]=en},Ot(Dt,function(en){if(en==="option")Lt(Dt,en),at(";");else throw xt(en)},function(){Gt(Dt)}),Jt.add(tn,_t,Dt.comment,Dt.options)}function Lt(Jt,tn){var _t=at("(",!0);if(!typeRefRe.test(tn=ot()))throw xt(tn,"name");var Dt=tn,Vt=Dt,en;_t&&(at(")"),Dt="("+Dt+")",Vt=Dt,tn=st(),fqTypeRefRe.test(tn)&&(en=tn.slice(1),Dt+=tn,ot())),at("=");var an=Zt(Jt,Dt);Nt(Jt,Vt,an,en)}function Zt(Jt,tn){if(at("{",!0)){for(var _t={};!at("}",!0);){if(!nameRe$1.test(Xt=ot()))throw xt(Xt,"name");if(Xt===null)throw xt(Xt,"end of input");var Dt,Vt=Xt;if(at(":",!0),st()==="{")Dt=Zt(Jt,tn+"."+Xt);else if(st()==="["){Dt=[];var en;if(at("[",!0)){do en=bt(),Dt.push(en);while(at(",",!0));at("]"),typeof en<"u"&&Qt(Jt,tn+"."+Xt,en)}}else Dt=bt(),Qt(Jt,tn+"."+Xt,Dt);var an=_t[Vt];an&&(Dt=[].concat(an).concat(Dt)),_t[Vt]=Dt,at(",",!0),at(";",!0)}return _t}var dn=bt();return Qt(Jt,tn,dn),dn}function Qt(Jt,tn,_t){Jt.setOption&&Jt.setOption(tn,_t)}function Nt(Jt,tn,_t,Dt){Jt.setParsedOption&&Jt.setParsedOption(tn,_t,Dt)}function Gt(Jt){if(at("[",!0)){do Lt(Jt,"option");while(at(",",!0));at("]")}return Jt}function nn(Jt,tn){if(!nameRe$1.test(tn=ot()))throw xt(tn,"service name");var _t=new Service(tn);Ot(_t,function(Vt){if(!$t(_t,Vt))if(Vt==="rpc")Wt(_t,Vt);else throw xt(Vt)}),Jt.add(_t)}function Wt(Jt,tn){var _t=ct(),Dt=tn;if(!nameRe$1.test(tn=ot()))throw xt(tn,"name");var Vt=tn,en,an,dn,ln;if(at("("),at("stream",!0)&&(an=!0),!typeRefRe.test(tn=ot())||(en=tn,at(")"),at("returns"),at("("),at("stream",!0)&&(ln=!0),!typeRefRe.test(tn=ot())))throw xt(tn);dn=tn,at(")");var pn=new Method(Vt,Dt,en,dn,an,ln);pn.comment=_t,Ot(pn,function(mn){if(mn==="option")Lt(pn,mn),at(";");else throw xt(mn)}),Jt.add(pn)}function hn(Jt,tn){if(!typeRefRe.test(tn=ot()))throw xt(tn,"reference");var _t=tn;Ot(null,function(Vt){switch(Vt){case"required":case"repeated":zt(Jt,Vt,_t);break;case"optional":ft?zt(Jt,"proto3_optional",_t):zt(Jt,"optional",_t);break;default:if(!ft||!typeRefRe.test(Vt))throw xt(Vt);it(Vt),zt(Jt,"optional",_t);break}})}for(var Xt;(Xt=ot())!==null;)switch(Xt){case"package":if(!lt)throw xt(Xt);Tt();break;case"import":if(!lt)throw xt(Xt);Rt();break;case"syntax":if(!lt)throw xt(Xt);Pt();break;case"option":Lt(yt,Xt),at(";");break;default:if($t(yt,Xt)){lt=!1;continue}throw xt(Xt)}return parse$1.filename=null,{package:dt,imports:ht,weakImports:pt,syntax:mt,root:et}}var common_1=common,commonRe=/\/|\./;function common(o,et){commonRe.test(o)||(o="google/protobuf/"+o+".proto",et={nested:{google:{nested:{protobuf:{nested:et}}}}}),common[o]=et}common("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var timeType;common("duration",{Duration:timeType={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});common("timestamp",{Timestamp:timeType});common("empty",{Empty:{fields:{}}});common("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});common("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});common("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});common.get=function o(et){return common[et]||null};var protobuf$1=src.exports=indexLightExports;protobuf$1.build="full";protobuf$1.tokenize=tokenize_1;protobuf$1.parse=parse_1;protobuf$1.common=common_1;protobuf$1.Root._configure(protobuf$1.Type,protobuf$1.parse,protobuf$1.common);var srcExports=src.exports,protobufjs=srcExports;const protobuf=getDefaultExportFromCjs(protobufjs),contentTopic="/buddybook-dogfood/1/chain/proto",encoder=createEncoder({contentTopic,ephemeral:!1}),decoder=createDecoder(contentTopic),block=new protobuf.Type("block").add(new protobuf.Field("chainUUID",1,"string")).add(new protobuf.Field("blockUUID",2,"string")).add(new protobuf.Field("title",3,"string")).add(new protobuf.Field("description",4,"string")).add(new protobuf.Field("signedMessage",5,"string")).add(new protobuf.Field("timestamp",6,"uint64")).add(new protobuf.Field("signatures",7,"string","repeated")).add(new protobuf.Field("parentBlockUUID",8,"string"));function createMessage({chainUUID:o,blockUUID:et,title:tt,description:nt,signedMessage:rt,timestamp:ot,signatures:it,parentBlockUUID:st}){const at=block.create({chainUUID:o,blockUUID:et,title:tt,description:nt,signedMessage:rt,timestamp:ot,signatures:it.map(lt=>JSON.stringify(lt)),parentBlockUUID:st});return{payload:block.encode(at).finish()}}async function*getMessagesFromStore(o){console.time("getMessagesFromStore");for await(const et of o.store.queryGenerator([decoder])){const tt=await Promise.all(et);for(const nt of tt){if(console.log(nt),!(nt!=null&&nt.payload))continue;const rt=block.decode(nt.payload);rt.signatures=rt.signatures.map(ot=>JSON.parse(ot)),yield rt}}console.timeEnd("getMessagesFromStore")}async function subscribeToFilter(o,et){const{error:tt,subscription:nt,results:rt}=await o.filter.subscribe([decoder],ot=>{if(console.log("message received from filter",ot),ot.payload){const it=block.decode(ot.payload);it.signatures=it.signatures.map(st=>JSON.parse(st)),et(it)}},{forceUseAllPeers:!1});if(console.log("results",rt),tt&&console.log("Error subscribing to filter",tt),!nt||tt||rt.successes.length===0||rt.failures.length>0)throw new Error("Failed to subscribe to filter")}function useWalletPrompt(){const{isConnected:o}=useAccount(),{connect:et,connectors:tt}=useConnect$1();return{ensureWalletConnected:async()=>{if(!o)try{const rt=tt[0];return rt&&await et({connector:rt}),await new Promise(ot=>setTimeout(ot,1e3)),!0}catch(rt){return console.error("Error connecting wallet:",rt),!1}return!0}}}const DEFAULT_FORM_DATA={title:"Devcon24 DeFi Dynamo",description:"A revolutionary blockchain for Devcon 24, focusing on scalable DeFi solutions and cross-chain interoperability.",uuid:v4()},ChainCreationForm=()=>{const[o,et]=reactExports.useState(DEFAULT_FORM_DATA),[tt,nt]=reactExports.useState({}),[rt,ot]=reactExports.useState(!1),[it,st]=reactExports.useState(!1),[at,ct]=reactExports.useState(!1),[lt,dt]=reactExports.useState(null),[ht,pt]=reactExports.useState(null),[mt,ft]=reactExports.useState(null),{node:yt}=useWaku(),{address:gt}=useAccount(),{signMessage:xt}=useSignMessage({mutation:{async onSuccess(Rt){if(!gt||!yt)return;pt(Rt);const Pt=v4();ft(Pt);const $t=createMessage({chainUUID:o.uuid,blockUUID:Pt,title:o.title,description:o.description,signedMessage:Rt,timestamp:Date.now(),signatures:[{address:gt,signature:Rt}],parentBlockUUID:null});await(yt==null?void 0:yt.lightPush.send(encoder,$t)),ct(!0),st(!1)},onError(Rt){console.error("Error signing message:",Rt),st(!1),dt("Error signing message. Please try again.")}}}),{ensureWalletConnected:vt}=useWalletPrompt(),bt=Rt=>{const{name:Pt,value:$t}=Rt.target;et(Ot=>({...Ot,[Pt]:$t})),tt[Pt]&&nt(Ot=>({...Ot,[Pt]:void 0}))},Et=()=>{const Rt={};return o.title.trim()||(Rt.title="Title is required"),o.description.trim()||(Rt.description="Description is required"),nt(Rt),Object.keys(Rt).length===0},wt=Rt=>{Rt.preventDefault(),vt()&&Et()&&ot(!0)},kt=async()=>{st(!0),dt(null);const Rt=`Create Chain: + Chain UUID: ${o.uuid} + Title: ${o.title} + Description: ${o.description} + Timestamp: ${new Date().getTime()} + Signed by: ${gt}`;xt({message:Rt})},Tt=()=>{ot(!1),ct(!1),st(!1),dt(null),ft(null)};return jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-2xl mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:"Create a New Chain"})}),jsxRuntimeExports.jsx(CardContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:wt,className:"space-y-6",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx(Label,{htmlFor:"title",children:"Chain Title"}),jsxRuntimeExports.jsx(Input,{type:"text",id:"title",name:"title",value:o.title,onChange:bt,maxLength:50,className:"text-base sm:text-sm"}),tt.title&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:tt.title})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx(Label,{htmlFor:"description",children:"Chain Description"}),jsxRuntimeExports.jsx(Textarea,{id:"description",name:"description",value:o.description,onChange:bt,maxLength:500,className:"min-h-[100px] text-base sm:text-sm"}),tt.description&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:tt.description})]}),jsxRuntimeExports.jsx(Button,{type:"submit",className:"w-full py-6 text-base sm:py-2 sm:text-sm",children:"Create Chain"})]})}),jsxRuntimeExports.jsx(Dialog,{open:rt,onOpenChange:Tt,children:jsxRuntimeExports.jsxs(DialogContent,{className:"sm:max-w-md",children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsx(DialogTitle,{children:at?"Chain Created":"Chain Preview"})}),at?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ht&&mt&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntimeExports.jsx(QRCode,{text:`${window.location.origin}/sign/${o.uuid}/${mt}`,width:200,height:200}),jsxRuntimeExports.jsx("p",{className:"text-sm text-center break-all",children:`${window.location.origin}/sign/${o.uuid}/${mt}`}),jsxRuntimeExports.jsx(Button,{onClick:()=>navigator.clipboard.writeText(`${window.location.origin}/sign/${o.uuid}/${mt}`),variant:"outline",children:"Copy Link"})]})})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("h4",{className:"text-xl font-semibold",children:o.title}),jsxRuntimeExports.jsx("p",{className:"text-muted-foreground",children:o.description}),lt&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:lt})]}),jsxRuntimeExports.jsxs(DialogFooter,{className:"sm:justify-start",children:[jsxRuntimeExports.jsx(Button,{type:"button",variant:"secondary",onClick:Tt,children:"Edit"}),jsxRuntimeExports.jsx(Button,{type:"button",onClick:kt,disabled:it,children:it?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing..."]}):"Sign"})]})]})]})})]})},SignChain=({block:o,chainsData:et,onSuccess:tt})=>{const[nt,rt]=reactExports.useState(!1),[ot,it]=reactExports.useState(!1),[st,at]=reactExports.useState(null),[ct,lt]=reactExports.useState(!1),{address:dt}=useAccount(),{data:ht}=useEnsName({address:dt}),{node:pt}=useWaku(),{ensureWalletConnected:mt}=useWalletPrompt();reactExports.useEffect(()=>{if(dt){const gt=vt=>{if(vt.signatures.some(wt=>wt.address.toLowerCase()===dt.toLowerCase()))return!0;const bt=et.find(wt=>wt.blockUUID===vt.parentBlockUUID);return bt&>(bt)?!0:et.filter(wt=>wt.parentBlockUUID===vt.blockUUID).some(wt=>gt(wt))},xt=gt(o);lt(xt)}},[dt,o,et]);const{signMessage:ft}=useSignMessage({mutation:{onMutate(){at(null),it(!0)},async onSuccess(gt){if(!(!dt||!pt))try{if(o.signatures.some(wt=>wt.address.toLowerCase()===dt.toLowerCase())){at("You have already signed this chain.");return}const xt={chainUUID:o.chainUUID,blockUUID:v4(),title:o.title,description:o.description,signedMessage:gt,timestamp:Date.now(),signatures:[{address:dt,signature:gt}],parentBlockUUID:o.blockUUID},vt=createMessage(xt),{failures:bt,successes:Et}=await pt.lightPush.send(encoder,vt);if(bt.length>0||Et.length===0)throw new Error("Failed to send message to Waku network");tt(xt),rt(!1)}catch(xt){console.error("Error creating new block:",xt),at("Failed to create new block. Please try again.")}},onError(gt){console.error("Error signing message:",gt),at("Error signing message. Please try again. If using a mobile wallet, please ensure your wallet app is open.")},onSettled(){it(!1)}}}),yt=async()=>{try{if(!dt&&!await mt())return;if(ct){at("You have already signed this chain.");return}const gt=`Sign Block: +Chain UUID: ${o.chainUUID} +Block UUID: ${o.blockUUID} +Title: ${o.title} +Description: ${o.description} +Timestamp: ${new Date().getTime()} +Parent Block UUID: ${o.parentBlockUUID} +Signed by: ${ht||dt}`;ft({message:gt})}catch(gt){console.error("Error in sign flow:",gt),at("Failed to initiate signing. Please try again."),it(!1)}};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{onClick:()=>rt(!0),disabled:ct,children:ct?"Already Signed":dt?"Sign Chain":"Connect Wallet"}),jsxRuntimeExports.jsx(Dialog,{open:nt,onOpenChange:rt,children:jsxRuntimeExports.jsxs(DialogContent,{className:"sm:max-w-md",children:[jsxRuntimeExports.jsxs(DialogHeader,{children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Sign Chain"}),jsxRuntimeExports.jsx(DialogDescription,{children:ct?"You have already signed this chain.":"Review the block details and sign to add your signature to the chain."})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-4",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx("h4",{className:"font-medium",children:"Block Details"}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:o.title}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:o.description})]}),jsxRuntimeExports.jsx(QRCode,{text:`${window.location.origin}/sign/${o.chainUUID}/${o.blockUUID}`})]}),st&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:st}),jsxRuntimeExports.jsxs(DialogFooter,{children:[jsxRuntimeExports.jsx(Button,{variant:"secondary",onClick:()=>rt(!1),children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:yt,disabled:ot||ct,children:ot?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing..."]}):ct?"Already Signed":dt?"Sign":"Connect Wallet"})]})]})})]})},ChainList=({chainsData:o,onChainUpdate:et,isLoading:tt})=>{const nt=it=>{et(it)},rt=(it,st=0)=>{const at=o.filter(dt=>dt.parentBlockUUID===it.blockUUID),ct=it.signatures.length+at.reduce((dt,ht)=>dt+ht.signatures.length,0),lt=`${window.location.origin}/sign/${it.chainUUID??it.blockUUID}/${it.blockUUID}`;return jsxRuntimeExports.jsxs("li",{className:"mb-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-start",children:[jsxRuntimeExports.jsx("div",{className:"mr-4 mt-2",children:st>0&&jsxRuntimeExports.jsx("div",{className:"w-6 h-6 border-l-2 border-b-2 border-gray-300"})}),st===0?jsxRuntimeExports.jsxs(Card,{className:"flex-grow",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:it.title})}),jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsx("p",{children:it.description}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-2 mt-2",children:[jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:jsxRuntimeExports.jsx(SignerName,{address:it.signatures[0].address,prefix:"Created by"})}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-muted-foreground",children:["Created at: ",new Date(it.timestamp).toLocaleString()]}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-muted-foreground",children:["Total Signatures: ",ct]}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-muted-foreground",children:["Block UUID: ",it.blockUUID]})]}),jsxRuntimeExports.jsxs("div",{className:"mt-2 space-x-2",children:[jsxRuntimeExports.jsx(SignChain,{block:it,chainsData:o,onSuccess:nt}),jsxRuntimeExports.jsxs(Dialog,{children:[jsxRuntimeExports.jsx(DialogTrigger,{asChild:!0,children:jsxRuntimeExports.jsx(Button,{variant:"outline",children:"Share"})}),jsxRuntimeExports.jsxs(DialogContent,{className:"sm:max-w-md",children:[jsxRuntimeExports.jsxs(DialogHeader,{children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Share this Chain"}),jsxRuntimeExports.jsx(DialogDescription,{children:"Share this chain with others to collect their signatures."})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntimeExports.jsx(QRCode,{text:lt,width:200,height:200}),jsxRuntimeExports.jsx("p",{className:"text-sm text-center break-all",children:lt}),jsxRuntimeExports.jsx(Button,{onClick:()=>navigator.clipboard.writeText(lt),variant:"outline",children:"Copy Link"})]})]})]})]})]})]}):jsxRuntimeExports.jsx("div",{className:"flex-grow",children:jsxRuntimeExports.jsx("p",{className:"text-sm",children:jsxRuntimeExports.jsx(SignerName,{address:it.signatures[0].address,prefix:"Signed by"})})})]}),at.length>0&&jsxRuntimeExports.jsx("ul",{className:"ml-8 mt-2",children:at.map(dt=>rt(dt,st+1))})]},`${it.blockUUID}-${st}`)},ot=o.filter(it=>!it.parentBlockUUID);return jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-4xl mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsxs(CardTitle,{children:["Existing Chains",tt&&jsxRuntimeExports.jsxs("span",{className:"ml-2 inline-flex items-center text-muted-foreground text-sm font-normal",children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin mr-2"}),"Loading more chains..."]})]})}),jsxRuntimeExports.jsx(CardContent,{children:ot.length===0&&!tt?jsxRuntimeExports.jsx("p",{children:"No chains found."}):jsxRuntimeExports.jsx("ul",{className:"space-y-4",children:ot.map(it=>rt(it,0))})})]})},SignerName=({address:o,prefix:et})=>{const{data:tt}=useEnsName({address:o});return jsxRuntimeExports.jsxs("span",{className:"text-sm",children:[et&&`${et}: `,tt||`${o.slice(0,6)}...${o.slice(-4)}`]})};var DirectionContext=reactExports.createContext(void 0);function useDirection(o){const et=reactExports.useContext(DirectionContext);return o||et||"ltr"}function clamp(o,[et,tt]){return Math.min(tt,Math.max(et,o))}function useStateMachine(o,et){return reactExports.useReducer((tt,nt)=>et[tt][nt]??tt,o)}var SCROLL_AREA_NAME="ScrollArea",[createScrollAreaContext,createScrollAreaScope]=createContextScope(SCROLL_AREA_NAME),[ScrollAreaProvider,useScrollAreaContext]=createScrollAreaContext(SCROLL_AREA_NAME),ScrollArea$1=reactExports.forwardRef((o,et)=>{const{__scopeScrollArea:tt,type:nt="hover",dir:rt,scrollHideDelay:ot=600,...it}=o,[st,at]=reactExports.useState(null),[ct,lt]=reactExports.useState(null),[dt,ht]=reactExports.useState(null),[pt,mt]=reactExports.useState(null),[ft,yt]=reactExports.useState(null),[gt,xt]=reactExports.useState(0),[vt,bt]=reactExports.useState(0),[Et,wt]=reactExports.useState(!1),[kt,Tt]=reactExports.useState(!1),Rt=useComposedRefs(et,$t=>at($t)),Pt=useDirection(rt);return jsxRuntimeExports.jsx(ScrollAreaProvider,{scope:tt,type:nt,dir:Pt,scrollHideDelay:ot,scrollArea:st,viewport:ct,onViewportChange:lt,content:dt,onContentChange:ht,scrollbarX:pt,onScrollbarXChange:mt,scrollbarXEnabled:Et,onScrollbarXEnabledChange:wt,scrollbarY:ft,onScrollbarYChange:yt,scrollbarYEnabled:kt,onScrollbarYEnabledChange:Tt,onCornerWidthChange:xt,onCornerHeightChange:bt,children:jsxRuntimeExports.jsx(Primitive.div,{dir:Pt,...it,ref:Rt,style:{position:"relative","--radix-scroll-area-corner-width":gt+"px","--radix-scroll-area-corner-height":vt+"px",...o.style}})})});ScrollArea$1.displayName=SCROLL_AREA_NAME;var VIEWPORT_NAME="ScrollAreaViewport",ScrollAreaViewport=reactExports.forwardRef((o,et)=>{const{__scopeScrollArea:tt,children:nt,asChild:rt,nonce:ot,...it}=o,st=useScrollAreaContext(VIEWPORT_NAME,tt),at=reactExports.useRef(null),ct=useComposedRefs(et,at,st.onViewportChange);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("style",{dangerouslySetInnerHTML:{__html:` +[data-radix-scroll-area-viewport] { + scrollbar-width: none; + -ms-overflow-style: none; + -webkit-overflow-scrolling: touch; +} +[data-radix-scroll-area-viewport]::-webkit-scrollbar { + display: none; +} +:where([data-radix-scroll-area-viewport]) { + display: flex; + flex-direction: column; + align-items: stretch; +} +:where([data-radix-scroll-area-content]) { + flex-grow: 1; +} +`},nonce:ot}),jsxRuntimeExports.jsx(Primitive.div,{"data-radix-scroll-area-viewport":"",...it,asChild:rt,ref:ct,style:{overflowX:st.scrollbarXEnabled?"scroll":"hidden",overflowY:st.scrollbarYEnabled?"scroll":"hidden",...o.style},children:getSubtree({asChild:rt,children:nt},lt=>jsxRuntimeExports.jsx("div",{"data-radix-scroll-area-content":"",ref:st.onContentChange,style:{minWidth:st.scrollbarXEnabled?"fit-content":void 0},children:lt}))})]})});ScrollAreaViewport.displayName=VIEWPORT_NAME;var SCROLLBAR_NAME="ScrollAreaScrollbar",ScrollAreaScrollbar=reactExports.forwardRef((o,et)=>{const{forceMount:tt,...nt}=o,rt=useScrollAreaContext(SCROLLBAR_NAME,o.__scopeScrollArea),{onScrollbarXEnabledChange:ot,onScrollbarYEnabledChange:it}=rt,st=o.orientation==="horizontal";return reactExports.useEffect(()=>(st?ot(!0):it(!0),()=>{st?ot(!1):it(!1)}),[st,ot,it]),rt.type==="hover"?jsxRuntimeExports.jsx(ScrollAreaScrollbarHover,{...nt,ref:et,forceMount:tt}):rt.type==="scroll"?jsxRuntimeExports.jsx(ScrollAreaScrollbarScroll,{...nt,ref:et,forceMount:tt}):rt.type==="auto"?jsxRuntimeExports.jsx(ScrollAreaScrollbarAuto,{...nt,ref:et,forceMount:tt}):rt.type==="always"?jsxRuntimeExports.jsx(ScrollAreaScrollbarVisible,{...nt,ref:et}):null});ScrollAreaScrollbar.displayName=SCROLLBAR_NAME;var ScrollAreaScrollbarHover=reactExports.forwardRef((o,et)=>{const{forceMount:tt,...nt}=o,rt=useScrollAreaContext(SCROLLBAR_NAME,o.__scopeScrollArea),[ot,it]=reactExports.useState(!1);return reactExports.useEffect(()=>{const st=rt.scrollArea;let at=0;if(st){const ct=()=>{window.clearTimeout(at),it(!0)},lt=()=>{at=window.setTimeout(()=>it(!1),rt.scrollHideDelay)};return st.addEventListener("pointerenter",ct),st.addEventListener("pointerleave",lt),()=>{window.clearTimeout(at),st.removeEventListener("pointerenter",ct),st.removeEventListener("pointerleave",lt)}}},[rt.scrollArea,rt.scrollHideDelay]),jsxRuntimeExports.jsx(Presence,{present:tt||ot,children:jsxRuntimeExports.jsx(ScrollAreaScrollbarAuto,{"data-state":ot?"visible":"hidden",...nt,ref:et})})}),ScrollAreaScrollbarScroll=reactExports.forwardRef((o,et)=>{const{forceMount:tt,...nt}=o,rt=useScrollAreaContext(SCROLLBAR_NAME,o.__scopeScrollArea),ot=o.orientation==="horizontal",it=useDebounceCallback(()=>at("SCROLL_END"),100),[st,at]=useStateMachine("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return reactExports.useEffect(()=>{if(st==="idle"){const ct=window.setTimeout(()=>at("HIDE"),rt.scrollHideDelay);return()=>window.clearTimeout(ct)}},[st,rt.scrollHideDelay,at]),reactExports.useEffect(()=>{const ct=rt.viewport,lt=ot?"scrollLeft":"scrollTop";if(ct){let dt=ct[lt];const ht=()=>{const pt=ct[lt];dt!==pt&&(at("SCROLL"),it()),dt=pt};return ct.addEventListener("scroll",ht),()=>ct.removeEventListener("scroll",ht)}},[rt.viewport,ot,at,it]),jsxRuntimeExports.jsx(Presence,{present:tt||st!=="hidden",children:jsxRuntimeExports.jsx(ScrollAreaScrollbarVisible,{"data-state":st==="hidden"?"hidden":"visible",...nt,ref:et,onPointerEnter:composeEventHandlers(o.onPointerEnter,()=>at("POINTER_ENTER")),onPointerLeave:composeEventHandlers(o.onPointerLeave,()=>at("POINTER_LEAVE"))})})}),ScrollAreaScrollbarAuto=reactExports.forwardRef((o,et)=>{const tt=useScrollAreaContext(SCROLLBAR_NAME,o.__scopeScrollArea),{forceMount:nt,...rt}=o,[ot,it]=reactExports.useState(!1),st=o.orientation==="horizontal",at=useDebounceCallback(()=>{if(tt.viewport){const ct=tt.viewport.offsetWidth{const{orientation:tt="vertical",...nt}=o,rt=useScrollAreaContext(SCROLLBAR_NAME,o.__scopeScrollArea),ot=reactExports.useRef(null),it=reactExports.useRef(0),[st,at]=reactExports.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),ct=getThumbRatio(st.viewport,st.content),lt={...nt,sizes:st,onSizesChange:at,hasThumb:ct>0&&ct<1,onThumbChange:ht=>ot.current=ht,onThumbPointerUp:()=>it.current=0,onThumbPointerDown:ht=>it.current=ht};function dt(ht,pt){return getScrollPositionFromPointer(ht,it.current,st,pt)}return tt==="horizontal"?jsxRuntimeExports.jsx(ScrollAreaScrollbarX,{...lt,ref:et,onThumbPositionChange:()=>{if(rt.viewport&&ot.current){const ht=rt.viewport.scrollLeft,pt=getThumbOffsetFromScroll(ht,st,rt.dir);ot.current.style.transform=`translate3d(${pt}px, 0, 0)`}},onWheelScroll:ht=>{rt.viewport&&(rt.viewport.scrollLeft=ht)},onDragScroll:ht=>{rt.viewport&&(rt.viewport.scrollLeft=dt(ht,rt.dir))}}):tt==="vertical"?jsxRuntimeExports.jsx(ScrollAreaScrollbarY,{...lt,ref:et,onThumbPositionChange:()=>{if(rt.viewport&&ot.current){const ht=rt.viewport.scrollTop,pt=getThumbOffsetFromScroll(ht,st);ot.current.style.transform=`translate3d(0, ${pt}px, 0)`}},onWheelScroll:ht=>{rt.viewport&&(rt.viewport.scrollTop=ht)},onDragScroll:ht=>{rt.viewport&&(rt.viewport.scrollTop=dt(ht))}}):null}),ScrollAreaScrollbarX=reactExports.forwardRef((o,et)=>{const{sizes:tt,onSizesChange:nt,...rt}=o,ot=useScrollAreaContext(SCROLLBAR_NAME,o.__scopeScrollArea),[it,st]=reactExports.useState(),at=reactExports.useRef(null),ct=useComposedRefs(et,at,ot.onScrollbarXChange);return reactExports.useEffect(()=>{at.current&&st(getComputedStyle(at.current))},[at]),jsxRuntimeExports.jsx(ScrollAreaScrollbarImpl,{"data-orientation":"horizontal",...rt,ref:ct,sizes:tt,style:{bottom:0,left:ot.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:ot.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":getThumbSize(tt)+"px",...o.style},onThumbPointerDown:lt=>o.onThumbPointerDown(lt.x),onDragScroll:lt=>o.onDragScroll(lt.x),onWheelScroll:(lt,dt)=>{if(ot.viewport){const ht=ot.viewport.scrollLeft+lt.deltaX;o.onWheelScroll(ht),isScrollingWithinScrollbarBounds(ht,dt)&<.preventDefault()}},onResize:()=>{at.current&&ot.viewport&&it&&nt({content:ot.viewport.scrollWidth,viewport:ot.viewport.offsetWidth,scrollbar:{size:at.current.clientWidth,paddingStart:toInt(it.paddingLeft),paddingEnd:toInt(it.paddingRight)}})}})}),ScrollAreaScrollbarY=reactExports.forwardRef((o,et)=>{const{sizes:tt,onSizesChange:nt,...rt}=o,ot=useScrollAreaContext(SCROLLBAR_NAME,o.__scopeScrollArea),[it,st]=reactExports.useState(),at=reactExports.useRef(null),ct=useComposedRefs(et,at,ot.onScrollbarYChange);return reactExports.useEffect(()=>{at.current&&st(getComputedStyle(at.current))},[at]),jsxRuntimeExports.jsx(ScrollAreaScrollbarImpl,{"data-orientation":"vertical",...rt,ref:ct,sizes:tt,style:{top:0,right:ot.dir==="ltr"?0:void 0,left:ot.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":getThumbSize(tt)+"px",...o.style},onThumbPointerDown:lt=>o.onThumbPointerDown(lt.y),onDragScroll:lt=>o.onDragScroll(lt.y),onWheelScroll:(lt,dt)=>{if(ot.viewport){const ht=ot.viewport.scrollTop+lt.deltaY;o.onWheelScroll(ht),isScrollingWithinScrollbarBounds(ht,dt)&<.preventDefault()}},onResize:()=>{at.current&&ot.viewport&&it&&nt({content:ot.viewport.scrollHeight,viewport:ot.viewport.offsetHeight,scrollbar:{size:at.current.clientHeight,paddingStart:toInt(it.paddingTop),paddingEnd:toInt(it.paddingBottom)}})}})}),[ScrollbarProvider,useScrollbarContext]=createScrollAreaContext(SCROLLBAR_NAME),ScrollAreaScrollbarImpl=reactExports.forwardRef((o,et)=>{const{__scopeScrollArea:tt,sizes:nt,hasThumb:rt,onThumbChange:ot,onThumbPointerUp:it,onThumbPointerDown:st,onThumbPositionChange:at,onDragScroll:ct,onWheelScroll:lt,onResize:dt,...ht}=o,pt=useScrollAreaContext(SCROLLBAR_NAME,tt),[mt,ft]=reactExports.useState(null),yt=useComposedRefs(et,Rt=>ft(Rt)),gt=reactExports.useRef(null),xt=reactExports.useRef(""),vt=pt.viewport,bt=nt.content-nt.viewport,Et=useCallbackRef$1(lt),wt=useCallbackRef$1(at),kt=useDebounceCallback(dt,10);function Tt(Rt){if(gt.current){const Pt=Rt.clientX-gt.current.left,$t=Rt.clientY-gt.current.top;ct({x:Pt,y:$t})}}return reactExports.useEffect(()=>{const Rt=Pt=>{const $t=Pt.target;(mt==null?void 0:mt.contains($t))&&Et(Pt,bt)};return document.addEventListener("wheel",Rt,{passive:!1}),()=>document.removeEventListener("wheel",Rt,{passive:!1})},[vt,mt,bt,Et]),reactExports.useEffect(wt,[nt,wt]),useResizeObserver(mt,kt),useResizeObserver(pt.content,kt),jsxRuntimeExports.jsx(ScrollbarProvider,{scope:tt,scrollbar:mt,hasThumb:rt,onThumbChange:useCallbackRef$1(ot),onThumbPointerUp:useCallbackRef$1(it),onThumbPositionChange:wt,onThumbPointerDown:useCallbackRef$1(st),children:jsxRuntimeExports.jsx(Primitive.div,{...ht,ref:yt,style:{position:"absolute",...ht.style},onPointerDown:composeEventHandlers(o.onPointerDown,Rt=>{Rt.button===0&&(Rt.target.setPointerCapture(Rt.pointerId),gt.current=mt.getBoundingClientRect(),xt.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",pt.viewport&&(pt.viewport.style.scrollBehavior="auto"),Tt(Rt))}),onPointerMove:composeEventHandlers(o.onPointerMove,Tt),onPointerUp:composeEventHandlers(o.onPointerUp,Rt=>{const Pt=Rt.target;Pt.hasPointerCapture(Rt.pointerId)&&Pt.releasePointerCapture(Rt.pointerId),document.body.style.webkitUserSelect=xt.current,pt.viewport&&(pt.viewport.style.scrollBehavior=""),gt.current=null})})})}),THUMB_NAME="ScrollAreaThumb",ScrollAreaThumb=reactExports.forwardRef((o,et)=>{const{forceMount:tt,...nt}=o,rt=useScrollbarContext(THUMB_NAME,o.__scopeScrollArea);return jsxRuntimeExports.jsx(Presence,{present:tt||rt.hasThumb,children:jsxRuntimeExports.jsx(ScrollAreaThumbImpl,{ref:et,...nt})})}),ScrollAreaThumbImpl=reactExports.forwardRef((o,et)=>{const{__scopeScrollArea:tt,style:nt,...rt}=o,ot=useScrollAreaContext(THUMB_NAME,tt),it=useScrollbarContext(THUMB_NAME,tt),{onThumbPositionChange:st}=it,at=useComposedRefs(et,dt=>it.onThumbChange(dt)),ct=reactExports.useRef(),lt=useDebounceCallback(()=>{ct.current&&(ct.current(),ct.current=void 0)},100);return reactExports.useEffect(()=>{const dt=ot.viewport;if(dt){const ht=()=>{if(lt(),!ct.current){const pt=addUnlinkedScrollListener(dt,st);ct.current=pt,st()}};return st(),dt.addEventListener("scroll",ht),()=>dt.removeEventListener("scroll",ht)}},[ot.viewport,lt,st]),jsxRuntimeExports.jsx(Primitive.div,{"data-state":it.hasThumb?"visible":"hidden",...rt,ref:at,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...nt},onPointerDownCapture:composeEventHandlers(o.onPointerDownCapture,dt=>{const pt=dt.target.getBoundingClientRect(),mt=dt.clientX-pt.left,ft=dt.clientY-pt.top;it.onThumbPointerDown({x:mt,y:ft})}),onPointerUp:composeEventHandlers(o.onPointerUp,it.onThumbPointerUp)})});ScrollAreaThumb.displayName=THUMB_NAME;var CORNER_NAME="ScrollAreaCorner",ScrollAreaCorner=reactExports.forwardRef((o,et)=>{const tt=useScrollAreaContext(CORNER_NAME,o.__scopeScrollArea),nt=!!(tt.scrollbarX&&tt.scrollbarY);return tt.type!=="scroll"&&nt?jsxRuntimeExports.jsx(ScrollAreaCornerImpl,{...o,ref:et}):null});ScrollAreaCorner.displayName=CORNER_NAME;var ScrollAreaCornerImpl=reactExports.forwardRef((o,et)=>{const{__scopeScrollArea:tt,...nt}=o,rt=useScrollAreaContext(CORNER_NAME,tt),[ot,it]=reactExports.useState(0),[st,at]=reactExports.useState(0),ct=!!(ot&&st);return useResizeObserver(rt.scrollbarX,()=>{var dt;const lt=((dt=rt.scrollbarX)==null?void 0:dt.offsetHeight)||0;rt.onCornerHeightChange(lt),at(lt)}),useResizeObserver(rt.scrollbarY,()=>{var dt;const lt=((dt=rt.scrollbarY)==null?void 0:dt.offsetWidth)||0;rt.onCornerWidthChange(lt),it(lt)}),ct?jsxRuntimeExports.jsx(Primitive.div,{...nt,ref:et,style:{width:ot,height:st,position:"absolute",right:rt.dir==="ltr"?0:void 0,left:rt.dir==="rtl"?0:void 0,bottom:0,...o.style}}):null});function toInt(o){return o?parseInt(o,10):0}function getThumbRatio(o,et){const tt=o/et;return isNaN(tt)?0:tt}function getThumbSize(o){const et=getThumbRatio(o.viewport,o.content),tt=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,nt=(o.scrollbar.size-tt)*et;return Math.max(nt,18)}function getScrollPositionFromPointer(o,et,tt,nt="ltr"){const rt=getThumbSize(tt),ot=rt/2,it=et||ot,st=rt-it,at=tt.scrollbar.paddingStart+it,ct=tt.scrollbar.size-tt.scrollbar.paddingEnd-st,lt=tt.content-tt.viewport,dt=nt==="ltr"?[0,lt]:[lt*-1,0];return linearScale([at,ct],dt)(o)}function getThumbOffsetFromScroll(o,et,tt="ltr"){const nt=getThumbSize(et),rt=et.scrollbar.paddingStart+et.scrollbar.paddingEnd,ot=et.scrollbar.size-rt,it=et.content-et.viewport,st=ot-nt,at=tt==="ltr"?[0,it]:[it*-1,0],ct=clamp(o,at);return linearScale([0,it],[0,st])(ct)}function linearScale(o,et){return tt=>{if(o[0]===o[1]||et[0]===et[1])return et[0];const nt=(et[1]-et[0])/(o[1]-o[0]);return et[0]+nt*(tt-o[0])}}function isScrollingWithinScrollbarBounds(o,et){return o>0&&o{})=>{let tt={left:o.scrollLeft,top:o.scrollTop},nt=0;return function rt(){const ot={left:o.scrollLeft,top:o.scrollTop},it=tt.left!==ot.left,st=tt.top!==ot.top;(it||st)&&et(),tt=ot,nt=window.requestAnimationFrame(rt)}(),()=>window.cancelAnimationFrame(nt)};function useDebounceCallback(o,et){const tt=useCallbackRef$1(o),nt=reactExports.useRef(0);return reactExports.useEffect(()=>()=>window.clearTimeout(nt.current),[]),reactExports.useCallback(()=>{window.clearTimeout(nt.current),nt.current=window.setTimeout(tt,et)},[tt,et])}function useResizeObserver(o,et){const tt=useCallbackRef$1(et);useLayoutEffect2(()=>{let nt=0;if(o){const rt=new ResizeObserver(()=>{cancelAnimationFrame(nt),nt=window.requestAnimationFrame(tt)});return rt.observe(o),()=>{window.cancelAnimationFrame(nt),rt.unobserve(o)}}},[o,tt])}function getSubtree(o,et){const{asChild:tt,children:nt}=o;if(!tt)return typeof et=="function"?et(nt):et;const rt=reactExports.Children.only(nt);return reactExports.cloneElement(rt,{children:typeof et=="function"?et(rt.props.children):et})}var Root=ScrollArea$1,Viewport=ScrollAreaViewport,Corner=ScrollAreaCorner;const ScrollArea=reactExports.forwardRef(({className:o,children:et,...tt},nt)=>jsxRuntimeExports.jsxs(Root,{ref:nt,className:cn("relative overflow-hidden",o),...tt,children:[jsxRuntimeExports.jsx(Viewport,{className:"h-full w-full rounded-[inherit]",children:et}),jsxRuntimeExports.jsx(ScrollBar,{}),jsxRuntimeExports.jsx(Corner,{})]}));ScrollArea.displayName=Root.displayName;const ScrollBar=reactExports.forwardRef(({className:o,orientation:et="vertical",...tt},nt)=>jsxRuntimeExports.jsx(ScrollAreaScrollbar,{ref:nt,orientation:et,className:cn("flex touch-none select-none transition-colors",et==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",et==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",o),...tt,children:jsxRuntimeExports.jsx(ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));ScrollBar.displayName=ScrollAreaScrollbar.displayName;const privacyPolicy=` +# Waku - Dogfooding Website + +*Last updated: 22 August 2024* + +This Privacy Policy is intended to inform users of our approach to privacy in respect of this website ("Website"). In this regard, if you are visiting or interacting with our Website, this Privacy Policy applies to you. + +This Website has been set-up by us for the purposes of gathering telemetry data from users of the Website about the reliability protocols utilised by Waku (such activity and related activity, being referred to as "Dogfooding"). + +Waku is a family of robust, censorship-resistant communication protocols designed to enable privacy-focused messaging for web3 apps. You can read more about Waku here: https://waku.org/. + +## Who we are + +For the purposes of this Privacy Policy and the collection and processing of personal data as a controller, the relevant entity is the Logos Collective Association, which has its registered office in Zug and its legal domicile address at + +Logos Collective Association +c/o PST Consulting GmbH +Baarerstrasse 10 +6300 Zug +Switzerland + +Whenever we refer to "Logos", "we" or other similar references, we are referring to the Logos Collective Association. + +## We limit the collection and processing of personal data from your use of the Website and for "Dogfooding" purposes + +We aim to limit the collection and processing of personal data from users of the Website and your participation in Dogfooding. We only collect and process certain personal data for specific purposes and where we have the legal basis to do so under applicable privacy legislation. We will not collect or process any personal data that we don't need and where we do store any personal data, we will only store it for the least amount of time needed for the indicated purpose and in any event no longer than thirty (30) days. + +In this regard, we collect and process the following personal data from your use of the Website and your participation in Dogfooding: + +**IP address**: As part of such use of the Website, we briefly process your IP address. We however have a legitimate interest in processing such IP addresses to ensure the technical functionality and enhance the security measures of the Website. This IP address is not stored by us over time. + +**Telemetry data**: We collect certain technical information (also referred to as telemetry data) to primarily determine the reliability (including, the performance and usage patterns) of the Waku reliability protocols for light clients. This information is only collected once you have accepted the prompt on the Website to participate in Dogfooding. Once you've accepted this prompt, a Waku node will start operating on your browser and then the technical information will start being collected by us. + +The information collected includes: + +- timestamps of receiving and sending messages; +- size of message packets; +- content topics/pubsub topics of the messages; +- code logs of errors and warnings; and +- a randomly generated temporary peer ID that represents your Waku node. + +The temporary peer ID is a seeded identifier used for the duration of your participation in Dogfooding and allows us to correlate the obtained technical information with a particular session and with the additional information collected, could be potentially considered personal data. We process such data based on our legitimate interest to improve our software and the user's experience in respect of Waku. + +If you do not agree to this data collection and processing, please do not interact with the Website or proceed with your participation in Dogfooding. + +## Personal data sharing with third party service providers + +We may share personal data with third party service providers in order for us to fulfil the above purposes. Such third party service providers act as data processors on our behalf and are only permitted to process personal data in accordance with our instructions and for the purposes specified above. + +## Security measures we take in respect of the Website + +As a general approach, we take data security seriously and we have implemented a variety of security measures on the Website that are reasonably designed to maintain the safety of your personal data when you submit such information to us. + +In addition to the security measures of the Website, personal data is also protected by Waku (protocol) itself. You can read more about the security features implemented by the Waku protocol here. + +## Exporting data outside the European Union and Switzerland + +We are obliged to protect the privacy of personal data that you may have submitted in the unlikely event that we export your personal data to places outside the European Union or Switzerland. This means that personal data will only be processed in countries or by parties that provide an adequate level of protection as deemed by Switzerland or the European Commission. Otherwise, we will use other forms of protections, such as specific forms of contractual clauses to ensure such personal data is provided the same protection as required in Switzerland or Europe. In any event, the transmission of personal data outside the European Union and Switzerland will always occur in conformity with applicable privacy legislation. + +## Your choices and rights + +As explained in this Privacy Policy, we limit our collection and processing of your personal data wherever possible. Nonetheless, you still have certain choices and rights in respect of the personal data which we do collect and process. As laid out in relevant privacy legislation, you have the right to: + +- Ask us to correct or update your personal data (where reasonably possible); +- Ask us to remove your personal data from our systems; +- Ask us for a copy of your personal data, which may also be transferred to another data controller at your request; +- Withdraw your consent to process your personal data (only if consent was asked for a processing activity), which only affects processing activities that are based on your consent and doesn't affect the validity of such processing activities before you have withdrawn your consent; +- Object to the processing of your personal data; and +- File a complaint with the Federal Data Protection and Information Commissioner (FDPIC), if you believe that your personal data has been processed unlawfully. + +## Third party links + +On this Website, you may come across links to third party websites. These third party sites have separate and independent privacy policies. We therefore have no responsibility or liability for the content and activities of these third party websites. + +## This Privacy Policy might change + +We may modify or replace any part of this Privacy Policy at any time and without notice. Please check the Website periodically for any changes. The new Privacy Policy will be effective immediately upon its posting on our Website. + +## Contact information + +To the extent that you have any questions about the Privacy Policy, please contact us at legal@free.technology. + +This document is licensed under CC-BY-SA. +`;function ok$1(){}function unreachable(){}function stringify$1(o,et){const tt={};return(o[o.length-1]===""?[...o,""]:o).join((tt.padRight?" ":"")+","+(tt.padLeft===!1?"":" ")).trim()}const nameRe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nameReJsx=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,emptyOptions$2={};function name(o,et){return(emptyOptions$2.jsx?nameReJsx:nameRe).test(o)}const re=/[ \t\n\f\r]/g;function whitespace(o){return typeof o=="object"?o.type==="text"?empty$1(o.value):!1:empty$1(o)}function empty$1(o){return o.replace(re,"")===""}class Schema{constructor(et,tt,nt){this.property=et,this.normal=tt,nt&&(this.space=nt)}}Schema.prototype.property={};Schema.prototype.normal={};Schema.prototype.space=null;function merge(o,et){const tt={},nt={};let rt=-1;for(;++rt4&&tt.slice(0,4)==="data"&&valid.test(et)){if(et.charAt(4)==="-"){const ot=et.slice(5).replace(dash,camelcase);nt="data"+ot.charAt(0).toUpperCase()+ot.slice(1)}else{const ot=et.slice(4);if(!dash.test(ot)){let it=ot.replace(cap$1,kebab);it.charAt(0)!=="-"&&(it="-"+it),et="data"+it}}rt=DefinedInfo}return new rt(nt,et)}function kebab(o){return"-"+o.toLowerCase()}function camelcase(o){return o.charAt(1).toUpperCase()}const hastToReact={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},html$1=merge([xml,xlink,xmlns,aria,html$2],"html"),svg=merge([xml,xlink,xmlns,aria,svg$1],"svg");function stringify(o){return o.join(" ").trim()}var cjs={},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=` +`,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(o,et){if(typeof o!="string")throw new TypeError("First argument must be a string");if(!o)return[];et=et||{};var tt=1,nt=1;function rt(mt){var ft=mt.match(NEWLINE_REGEX);ft&&(tt+=ft.length);var yt=mt.lastIndexOf(NEWLINE);nt=~yt?mt.length-yt:nt+mt.length}function ot(){var mt={line:tt,column:nt};return function(ft){return ft.position=new it(mt),ct(),ft}}function it(mt){this.start=mt,this.end={line:tt,column:nt},this.source=et.source}it.prototype.content=o;function st(mt){var ft=new Error(et.source+":"+tt+":"+nt+": "+mt);if(ft.reason=mt,ft.filename=et.source,ft.line=tt,ft.column=nt,ft.source=o,!et.silent)throw ft}function at(mt){var ft=mt.exec(o);if(ft){var yt=ft[0];return rt(yt),o=o.slice(yt.length),ft}}function ct(){at(WHITESPACE_REGEX)}function lt(mt){var ft;for(mt=mt||[];ft=dt();)ft!==!1&&mt.push(ft);return mt}function dt(){var mt=ot();if(!(FORWARD_SLASH!=o.charAt(0)||ASTERISK!=o.charAt(1))){for(var ft=2;EMPTY_STRING!=o.charAt(ft)&&(ASTERISK!=o.charAt(ft)||FORWARD_SLASH!=o.charAt(ft+1));)++ft;if(ft+=2,EMPTY_STRING===o.charAt(ft-1))return st("End of comment missing");var yt=o.slice(2,ft-2);return nt+=2,rt(yt),o=o.slice(ft),nt+=2,mt({type:TYPE_COMMENT,comment:yt})}}function ht(){var mt=ot(),ft=at(PROPERTY_REGEX);if(ft){if(dt(),!at(COLON_REGEX))return st("property missing ':'");var yt=at(VALUE_REGEX),gt=mt({type:TYPE_DECLARATION,property:trim(ft[0].replace(COMMENT_REGEX,EMPTY_STRING)),value:yt?trim(yt[0].replace(COMMENT_REGEX,EMPTY_STRING)):EMPTY_STRING});return at(SEMICOLON_REGEX),gt}}function pt(){var mt=[];lt(mt);for(var ft;ft=ht();)ft!==!1&&(mt.push(ft),lt(mt));return mt}return ct(),pt()};function trim(o){return o?o.replace(TRIM_REGEX,EMPTY_STRING):EMPTY_STRING}var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(cjs,"__esModule",{value:!0});var _default=cjs.default=StyleToObject,inline_style_parser_1=__importDefault(inlineStyleParser);function StyleToObject(o,et){var tt=null;if(!o||typeof o!="string")return tt;var nt=(0,inline_style_parser_1.default)(o),rt=typeof et=="function";return nt.forEach(function(ot){if(ot.type==="declaration"){var it=ot.property,st=ot.value;rt?et(it,st,ot):st&&(tt=tt||{},tt[it]=st)}}),tt}const styleToObject=_default.default||_default,pointEnd=point$2("end"),pointStart=point$2("start");function point$2(o){return et;function et(tt){const nt=tt&&tt.position&&tt.position[o]||{};if(typeof nt.line=="number"&&nt.line>0&&typeof nt.column=="number"&&nt.column>0)return{line:nt.line,column:nt.column,offset:typeof nt.offset=="number"&&nt.offset>-1?nt.offset:void 0}}}function position$1(o){const et=pointStart(o),tt=pointEnd(o);if(et&&tt)return{start:et,end:tt}}function stringifyPosition(o){return!o||typeof o!="object"?"":"position"in o||"type"in o?position(o.position):"start"in o||"end"in o?position(o):"line"in o||"column"in o?point$1(o):""}function point$1(o){return index(o&&o.line)+":"+index(o&&o.column)}function position(o){return point$1(o&&o.start)+"-"+point$1(o&&o.end)}function index(o){return o&&typeof o=="number"?o:1}class VFileMessage extends Error{constructor(et,tt,nt){super(),typeof tt=="string"&&(nt=tt,tt=void 0);let rt="",ot={},it=!1;if(tt&&("line"in tt&&"column"in tt?ot={place:tt}:"start"in tt&&"end"in tt?ot={place:tt}:"type"in tt?ot={ancestors:[tt],place:tt.position}:ot={...tt}),typeof et=="string"?rt=et:!ot.cause&&et&&(it=!0,rt=et.message,ot.cause=et),!ot.ruleId&&!ot.source&&typeof nt=="string"){const at=nt.indexOf(":");at===-1?ot.ruleId=nt:(ot.source=nt.slice(0,at),ot.ruleId=nt.slice(at+1))}if(!ot.place&&ot.ancestors&&ot.ancestors){const at=ot.ancestors[ot.ancestors.length-1];at&&(ot.place=at.position)}const st=ot.place&&"start"in ot.place?ot.place.start:ot.place;this.ancestors=ot.ancestors||void 0,this.cause=ot.cause||void 0,this.column=st?st.column:void 0,this.fatal=void 0,this.file,this.message=rt,this.line=st?st.line:void 0,this.name=stringifyPosition(ot.place)||"1:1",this.place=ot.place||void 0,this.reason=this.message,this.ruleId=ot.ruleId||void 0,this.source=ot.source||void 0,this.stack=it&&ot.cause&&typeof ot.cause.stack=="string"?ot.cause.stack:"",this.actual,this.expected,this.note,this.url}}VFileMessage.prototype.file="";VFileMessage.prototype.name="";VFileMessage.prototype.reason="";VFileMessage.prototype.message="";VFileMessage.prototype.stack="";VFileMessage.prototype.column=void 0;VFileMessage.prototype.line=void 0;VFileMessage.prototype.ancestors=void 0;VFileMessage.prototype.cause=void 0;VFileMessage.prototype.fatal=void 0;VFileMessage.prototype.place=void 0;VFileMessage.prototype.ruleId=void 0;VFileMessage.prototype.source=void 0;const own$3={}.hasOwnProperty,emptyMap=new Map,cap=/[A-Z]/g,dashSomething=/-([a-z])/g,tableElements=new Set(["table","tbody","thead","tfoot","tr"]),tableCellElement=new Set(["td","th"]),docs="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function toJsxRuntime(o,et){if(!et||et.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const tt=et.filePath||void 0;let nt;if(et.development){if(typeof et.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");nt=developmentCreate(tt,et.jsxDEV)}else{if(typeof et.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof et.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");nt=productionCreate(tt,et.jsx,et.jsxs)}const rt={Fragment:et.Fragment,ancestors:[],components:et.components||{},create:nt,elementAttributeNameCase:et.elementAttributeNameCase||"react",evaluater:et.createEvaluater?et.createEvaluater():void 0,filePath:tt,ignoreInvalidStyle:et.ignoreInvalidStyle||!1,passKeys:et.passKeys!==!1,passNode:et.passNode||!1,schema:et.space==="svg"?svg:html$1,stylePropertyNameCase:et.stylePropertyNameCase||"dom",tableCellAlignToStyle:et.tableCellAlignToStyle!==!1},ot=one$1(rt,o,void 0);return ot&&typeof ot!="string"?ot:rt.create(o,rt.Fragment,{children:ot||void 0},void 0)}function one$1(o,et,tt){if(et.type==="element")return element$1(o,et,tt);if(et.type==="mdxFlowExpression"||et.type==="mdxTextExpression")return mdxExpression(o,et);if(et.type==="mdxJsxFlowElement"||et.type==="mdxJsxTextElement")return mdxJsxElement(o,et,tt);if(et.type==="mdxjsEsm")return mdxEsm(o,et);if(et.type==="root")return root$1(o,et,tt);if(et.type==="text")return text$3(o,et)}function element$1(o,et,tt){const nt=o.schema;let rt=nt;et.tagName.toLowerCase()==="svg"&&nt.space==="html"&&(rt=svg,o.schema=rt),o.ancestors.push(et);const ot=findComponentFromName(o,et.tagName,!1),it=createElementProps(o,et);let st=createChildren(o,et);return tableElements.has(et.tagName)&&(st=st.filter(function(at){return typeof at=="string"?!whitespace(at):!0})),addNode(o,it,ot,et),addChildren(it,st),o.ancestors.pop(),o.schema=nt,o.create(et,ot,it,tt)}function mdxExpression(o,et){if(et.data&&et.data.estree&&o.evaluater){const nt=et.data.estree.body[0];return nt.type,o.evaluater.evaluateExpression(nt.expression)}crashEstree(o,et.position)}function mdxEsm(o,et){if(et.data&&et.data.estree&&o.evaluater)return o.evaluater.evaluateProgram(et.data.estree);crashEstree(o,et.position)}function mdxJsxElement(o,et,tt){const nt=o.schema;let rt=nt;et.name==="svg"&&nt.space==="html"&&(rt=svg,o.schema=rt),o.ancestors.push(et);const ot=et.name===null?o.Fragment:findComponentFromName(o,et.name,!0),it=createJsxElementProps(o,et),st=createChildren(o,et);return addNode(o,it,ot,et),addChildren(it,st),o.ancestors.pop(),o.schema=nt,o.create(et,ot,it,tt)}function root$1(o,et,tt){const nt={};return addChildren(nt,createChildren(o,et)),o.create(et,o.Fragment,nt,tt)}function text$3(o,et){return et.value}function addNode(o,et,tt,nt){typeof tt!="string"&&tt!==o.Fragment&&o.passNode&&(et.node=nt)}function addChildren(o,et){if(et.length>0){const tt=et.length>1?et:et[0];tt&&(o.children=tt)}}function productionCreate(o,et,tt){return nt;function nt(rt,ot,it,st){const ct=Array.isArray(it.children)?tt:et;return st?ct(ot,it,st):ct(ot,it)}}function developmentCreate(o,et){return tt;function tt(nt,rt,ot,it){const st=Array.isArray(ot.children),at=pointStart(nt);return et(rt,ot,it,st,{columnNumber:at?at.column-1:void 0,fileName:o,lineNumber:at?at.line:void 0},void 0)}}function createElementProps(o,et){const tt={};let nt,rt;for(rt in et.properties)if(rt!=="children"&&own$3.call(et.properties,rt)){const ot=createProperty(o,rt,et.properties[rt]);if(ot){const[it,st]=ot;o.tableCellAlignToStyle&&it==="align"&&typeof st=="string"&&tableCellElement.has(et.tagName)?nt=st:tt[it]=st}}if(nt){const ot=tt.style||(tt.style={});ot[o.stylePropertyNameCase==="css"?"text-align":"textAlign"]=nt}return tt}function createJsxElementProps(o,et){const tt={};for(const nt of et.attributes)if(nt.type==="mdxJsxExpressionAttribute")if(nt.data&&nt.data.estree&&o.evaluater){const ot=nt.data.estree.body[0];ot.type;const it=ot.expression;it.type;const st=it.properties[0];st.type,Object.assign(tt,o.evaluater.evaluateExpression(st.argument))}else crashEstree(o,et.position);else{const rt=nt.name;let ot;if(nt.value&&typeof nt.value=="object")if(nt.value.data&&nt.value.data.estree&&o.evaluater){const st=nt.value.data.estree.body[0];st.type,ot=o.evaluater.evaluateExpression(st.expression)}else crashEstree(o,et.position);else ot=nt.value===null?!0:nt.value;tt[rt]=ot}return tt}function createChildren(o,et){const tt=[];let nt=-1;const rt=o.passKeys?new Map:emptyMap;for(;++ntrt?0:rt+et:et=et>rt?rt:et,tt=tt>0?tt:0,nt.length<1e4)it=Array.from(nt),it.unshift(et,tt),o.splice(...it);else for(tt&&o.splice(et,tt);ot0?(splice(o,o.length,0,et),o):et}const hasOwnProperty={}.hasOwnProperty;function combineExtensions(o){const et={};let tt=-1;for(;++tt13&&tt<32||tt>126&&tt<160||tt>55295&&tt<57344||tt>64975&&tt<65008||(tt&65535)===65535||(tt&65535)===65534||tt>1114111?"�":String.fromCodePoint(tt)}function normalizeIdentifier(o){return o.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const asciiAlpha=regexCheck(/[A-Za-z]/),asciiAlphanumeric=regexCheck(/[\dA-Za-z]/),asciiAtext=regexCheck(/[#-'*+\--9=?A-Z^-~]/);function asciiControl(o){return o!==null&&(o<32||o===127)}const asciiDigit=regexCheck(/\d/),asciiHexDigit=regexCheck(/[\dA-Fa-f]/),asciiPunctuation=regexCheck(/[!-/:-@[-`{-~]/);function markdownLineEnding(o){return o!==null&&o<-2}function markdownLineEndingOrSpace(o){return o!==null&&(o<0||o===32)}function markdownSpace(o){return o===-2||o===-1||o===32}const unicodePunctuation=regexCheck(new RegExp("\\p{P}|\\p{S}","u")),unicodeWhitespace=regexCheck(/\s/);function regexCheck(o){return et;function et(tt){return tt!==null&&tt>-1&&o.test(String.fromCharCode(tt))}}function normalizeUri(o){const et=[];let tt=-1,nt=0,rt=0;for(;++tt55295&&ot<57344){const st=o.charCodeAt(tt+1);ot<56320&&st>56319&&st<57344?(it=String.fromCharCode(ot,st),rt=1):it="�"}else it=String.fromCharCode(ot);it&&(et.push(o.slice(nt,tt),encodeURIComponent(it)),nt=tt+rt+1,it=""),rt&&(tt+=rt,rt=0)}return et.join("")+o.slice(nt)}function factorySpace(o,et,tt,nt){const rt=nt?nt-1:Number.POSITIVE_INFINITY;let ot=0;return it;function it(at){return markdownSpace(at)?(o.enter(tt),st(at)):et(at)}function st(at){return markdownSpace(at)&&ot++it))return;const kt=et.events.length;let Tt=kt,Rt,Pt;for(;Tt--;)if(et.events[Tt][0]==="exit"&&et.events[Tt][1].type==="chunkFlow"){if(Rt){Pt=et.events[Tt][1].end;break}Rt=!0}for(gt(nt),wt=kt;wtvt;){const Et=tt[bt];et.containerState=Et[1],Et[0].exit.call(et,o)}tt.length=vt}function xt(){rt.write([null]),ot=void 0,rt=void 0,et.containerState._closeFlow=void 0}}function tokenizeContainer(o,et,tt){return factorySpace(o,o.attempt(this.parser.constructs.document,et,tt),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function classifyCharacter(o){if(o===null||markdownLineEndingOrSpace(o)||unicodeWhitespace(o))return 1;if(unicodePunctuation(o))return 2}function resolveAll(o,et,tt){const nt=[];let rt=-1;for(;++rt1&&o[tt][1].end.offset-o[tt][1].start.offset>1?2:1;const dt=Object.assign({},o[nt][1].end),ht=Object.assign({},o[tt][1].start);movePoint(dt,-at),movePoint(ht,at),it={type:at>1?"strongSequence":"emphasisSequence",start:dt,end:Object.assign({},o[nt][1].end)},st={type:at>1?"strongSequence":"emphasisSequence",start:Object.assign({},o[tt][1].start),end:ht},ot={type:at>1?"strongText":"emphasisText",start:Object.assign({},o[nt][1].end),end:Object.assign({},o[tt][1].start)},rt={type:at>1?"strong":"emphasis",start:Object.assign({},it.start),end:Object.assign({},st.end)},o[nt][1].end=Object.assign({},it.start),o[tt][1].start=Object.assign({},st.end),ct=[],o[nt][1].end.offset-o[nt][1].start.offset&&(ct=push(ct,[["enter",o[nt][1],et],["exit",o[nt][1],et]])),ct=push(ct,[["enter",rt,et],["enter",it,et],["exit",it,et],["enter",ot,et]]),ct=push(ct,resolveAll(et.parser.constructs.insideSpan.null,o.slice(nt+1,tt),et)),ct=push(ct,[["exit",ot,et],["enter",st,et],["exit",st,et],["exit",rt,et]]),o[tt][1].end.offset-o[tt][1].start.offset?(lt=2,ct=push(ct,[["enter",o[tt][1],et],["exit",o[tt][1],et]])):lt=0,splice(o,nt-1,tt-nt+3,ct),tt=nt+ct.length-lt-2;break}}for(tt=-1;++tt0&&markdownSpace(wt)?factorySpace(o,xt,"linePrefix",ot+1)(wt):xt(wt)}function xt(wt){return wt===null||markdownLineEnding(wt)?o.check(nonLazyContinuation,ft,bt)(wt):(o.enter("codeFlowValue"),vt(wt))}function vt(wt){return wt===null||markdownLineEnding(wt)?(o.exit("codeFlowValue"),xt(wt)):(o.consume(wt),vt)}function bt(wt){return o.exit("codeFenced"),et(wt)}function Et(wt,kt,Tt){let Rt=0;return Pt;function Pt(Ft){return wt.enter("lineEnding"),wt.consume(Ft),wt.exit("lineEnding"),$t}function $t(Ft){return wt.enter("codeFencedFence"),markdownSpace(Ft)?factorySpace(wt,Ot,"linePrefix",nt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ft):Ot(Ft)}function Ot(Ft){return Ft===st?(wt.enter("codeFencedFenceSequence"),Bt(Ft)):Tt(Ft)}function Bt(Ft){return Ft===st?(Rt++,wt.consume(Ft),Bt):Rt>=it?(wt.exit("codeFencedFenceSequence"),markdownSpace(Ft)?factorySpace(wt,zt,"whitespace")(Ft):zt(Ft)):Tt(Ft)}function zt(Ft){return Ft===null||markdownLineEnding(Ft)?(wt.exit("codeFencedFence"),kt(Ft)):Tt(Ft)}}}function tokenizeNonLazyContinuation(o,et,tt){const nt=this;return rt;function rt(it){return it===null?tt(it):(o.enter("lineEnding"),o.consume(it),o.exit("lineEnding"),ot)}function ot(it){return nt.parser.lazy[nt.now().line]?tt(it):et(it)}}const codeIndented={name:"codeIndented",tokenize:tokenizeCodeIndented},furtherStart={tokenize:tokenizeFurtherStart,partial:!0};function tokenizeCodeIndented(o,et,tt){const nt=this;return rt;function rt(ct){return o.enter("codeIndented"),factorySpace(o,ot,"linePrefix",5)(ct)}function ot(ct){const lt=nt.events[nt.events.length-1];return lt&<[1].type==="linePrefix"&<[2].sliceSerialize(lt[1],!0).length>=4?it(ct):tt(ct)}function it(ct){return ct===null?at(ct):markdownLineEnding(ct)?o.attempt(furtherStart,it,at)(ct):(o.enter("codeFlowValue"),st(ct))}function st(ct){return ct===null||markdownLineEnding(ct)?(o.exit("codeFlowValue"),it(ct)):(o.consume(ct),st)}function at(ct){return o.exit("codeIndented"),et(ct)}}function tokenizeFurtherStart(o,et,tt){const nt=this;return rt;function rt(it){return nt.parser.lazy[nt.now().line]?tt(it):markdownLineEnding(it)?(o.enter("lineEnding"),o.consume(it),o.exit("lineEnding"),rt):factorySpace(o,ot,"linePrefix",5)(it)}function ot(it){const st=nt.events[nt.events.length-1];return st&&st[1].type==="linePrefix"&&st[2].sliceSerialize(st[1],!0).length>=4?et(it):markdownLineEnding(it)?rt(it):tt(it)}}const codeText={name:"codeText",tokenize:tokenizeCodeText,resolve:resolveCodeText,previous};function resolveCodeText(o){let et=o.length-4,tt=3,nt,rt;if((o[tt][1].type==="lineEnding"||o[tt][1].type==="space")&&(o[et][1].type==="lineEnding"||o[et][1].type==="space")){for(nt=tt;++nt=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+et+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return etthis.left.length?this.right.slice(this.right.length-nt+this.left.length,this.right.length-et+this.left.length).reverse():this.left.slice(et).concat(this.right.slice(this.right.length-nt+this.left.length).reverse())}splice(et,tt,nt){const rt=tt||0;this.setCursor(Math.trunc(et));const ot=this.right.splice(this.right.length-rt,Number.POSITIVE_INFINITY);return nt&&chunkedPush(this.left,nt),ot.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(et){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(et)}pushMany(et){this.setCursor(Number.POSITIVE_INFINITY),chunkedPush(this.left,et)}unshift(et){this.setCursor(0),this.right.push(et)}unshiftMany(et){this.setCursor(0),chunkedPush(this.right,et.reverse())}setCursor(et){if(!(et===this.left.length||et>this.left.length&&this.right.length===0||et<0&&this.left.length===0))if(et=4?et(it):o.interrupt(nt.parser.constructs.flow,tt,et)(it)}}function factoryDestination(o,et,tt,nt,rt,ot,it,st,at){const ct=at||Number.POSITIVE_INFINITY;let lt=0;return dt;function dt(gt){return gt===60?(o.enter(nt),o.enter(rt),o.enter(ot),o.consume(gt),o.exit(ot),ht):gt===null||gt===32||gt===41||asciiControl(gt)?tt(gt):(o.enter(nt),o.enter(it),o.enter(st),o.enter("chunkString",{contentType:"string"}),ft(gt))}function ht(gt){return gt===62?(o.enter(ot),o.consume(gt),o.exit(ot),o.exit(rt),o.exit(nt),et):(o.enter(st),o.enter("chunkString",{contentType:"string"}),pt(gt))}function pt(gt){return gt===62?(o.exit("chunkString"),o.exit(st),ht(gt)):gt===null||gt===60||markdownLineEnding(gt)?tt(gt):(o.consume(gt),gt===92?mt:pt)}function mt(gt){return gt===60||gt===62||gt===92?(o.consume(gt),pt):pt(gt)}function ft(gt){return!lt&&(gt===null||gt===41||markdownLineEndingOrSpace(gt))?(o.exit("chunkString"),o.exit(st),o.exit(it),o.exit(nt),et(gt)):lt999||pt===null||pt===91||pt===93&&!at||pt===94&&!st&&"_hiddenFootnoteSupport"in it.parser.constructs?tt(pt):pt===93?(o.exit(ot),o.enter(rt),o.consume(pt),o.exit(rt),o.exit(nt),et):markdownLineEnding(pt)?(o.enter("lineEnding"),o.consume(pt),o.exit("lineEnding"),lt):(o.enter("chunkString",{contentType:"string"}),dt(pt))}function dt(pt){return pt===null||pt===91||pt===93||markdownLineEnding(pt)||st++>999?(o.exit("chunkString"),lt(pt)):(o.consume(pt),at||(at=!markdownSpace(pt)),pt===92?ht:dt)}function ht(pt){return pt===91||pt===92||pt===93?(o.consume(pt),st++,dt):dt(pt)}}function factoryTitle(o,et,tt,nt,rt,ot){let it;return st;function st(ht){return ht===34||ht===39||ht===40?(o.enter(nt),o.enter(rt),o.consume(ht),o.exit(rt),it=ht===40?41:ht,at):tt(ht)}function at(ht){return ht===it?(o.enter(rt),o.consume(ht),o.exit(rt),o.exit(nt),et):(o.enter(ot),ct(ht))}function ct(ht){return ht===it?(o.exit(ot),at(it)):ht===null?tt(ht):markdownLineEnding(ht)?(o.enter("lineEnding"),o.consume(ht),o.exit("lineEnding"),factorySpace(o,ct,"linePrefix")):(o.enter("chunkString",{contentType:"string"}),lt(ht))}function lt(ht){return ht===it||ht===null||markdownLineEnding(ht)?(o.exit("chunkString"),ct(ht)):(o.consume(ht),ht===92?dt:lt)}function dt(ht){return ht===it||ht===92?(o.consume(ht),lt):lt(ht)}}function factoryWhitespace(o,et){let tt;return nt;function nt(rt){return markdownLineEnding(rt)?(o.enter("lineEnding"),o.consume(rt),o.exit("lineEnding"),tt=!0,nt):markdownSpace(rt)?factorySpace(o,nt,tt?"linePrefix":"lineSuffix")(rt):et(rt)}}const definition={name:"definition",tokenize:tokenizeDefinition},titleBefore={tokenize:tokenizeTitleBefore,partial:!0};function tokenizeDefinition(o,et,tt){const nt=this;let rt;return ot;function ot(pt){return o.enter("definition"),it(pt)}function it(pt){return factoryLabel.call(nt,o,st,tt,"definitionLabel","definitionLabelMarker","definitionLabelString")(pt)}function st(pt){return rt=normalizeIdentifier(nt.sliceSerialize(nt.events[nt.events.length-1][1]).slice(1,-1)),pt===58?(o.enter("definitionMarker"),o.consume(pt),o.exit("definitionMarker"),at):tt(pt)}function at(pt){return markdownLineEndingOrSpace(pt)?factoryWhitespace(o,ct)(pt):ct(pt)}function ct(pt){return factoryDestination(o,lt,tt,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(pt)}function lt(pt){return o.attempt(titleBefore,dt,dt)(pt)}function dt(pt){return markdownSpace(pt)?factorySpace(o,ht,"whitespace")(pt):ht(pt)}function ht(pt){return pt===null||markdownLineEnding(pt)?(o.exit("definition"),nt.parser.defined.push(rt),et(pt)):tt(pt)}}function tokenizeTitleBefore(o,et,tt){return nt;function nt(st){return markdownLineEndingOrSpace(st)?factoryWhitespace(o,rt)(st):tt(st)}function rt(st){return factoryTitle(o,ot,tt,"definitionTitle","definitionTitleMarker","definitionTitleString")(st)}function ot(st){return markdownSpace(st)?factorySpace(o,it,"whitespace")(st):it(st)}function it(st){return st===null||markdownLineEnding(st)?et(st):tt(st)}}const hardBreakEscape={name:"hardBreakEscape",tokenize:tokenizeHardBreakEscape};function tokenizeHardBreakEscape(o,et,tt){return nt;function nt(ot){return o.enter("hardBreakEscape"),o.consume(ot),rt}function rt(ot){return markdownLineEnding(ot)?(o.exit("hardBreakEscape"),et(ot)):tt(ot)}}const headingAtx={name:"headingAtx",tokenize:tokenizeHeadingAtx,resolve:resolveHeadingAtx};function resolveHeadingAtx(o,et){let tt=o.length-2,nt=3,rt,ot;return o[nt][1].type==="whitespace"&&(nt+=2),tt-2>nt&&o[tt][1].type==="whitespace"&&(tt-=2),o[tt][1].type==="atxHeadingSequence"&&(nt===tt-1||tt-4>nt&&o[tt-2][1].type==="whitespace")&&(tt-=nt+1===tt?2:4),tt>nt&&(rt={type:"atxHeadingText",start:o[nt][1].start,end:o[tt][1].end},ot={type:"chunkText",start:o[nt][1].start,end:o[tt][1].end,contentType:"text"},splice(o,nt,tt-nt+1,[["enter",rt,et],["enter",ot,et],["exit",ot,et],["exit",rt,et]])),o}function tokenizeHeadingAtx(o,et,tt){let nt=0;return rt;function rt(lt){return o.enter("atxHeading"),ot(lt)}function ot(lt){return o.enter("atxHeadingSequence"),it(lt)}function it(lt){return lt===35&&nt++<6?(o.consume(lt),it):lt===null||markdownLineEndingOrSpace(lt)?(o.exit("atxHeadingSequence"),st(lt)):tt(lt)}function st(lt){return lt===35?(o.enter("atxHeadingSequence"),at(lt)):lt===null||markdownLineEnding(lt)?(o.exit("atxHeading"),et(lt)):markdownSpace(lt)?factorySpace(o,st,"whitespace")(lt):(o.enter("atxHeadingText"),ct(lt))}function at(lt){return lt===35?(o.consume(lt),at):(o.exit("atxHeadingSequence"),st(lt))}function ct(lt){return lt===null||lt===35||markdownLineEndingOrSpace(lt)?(o.exit("atxHeadingText"),st(lt)):(o.consume(lt),ct)}}const htmlBlockNames=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],htmlRawNames=["pre","script","style","textarea"],htmlFlow={name:"htmlFlow",tokenize:tokenizeHtmlFlow,resolveTo:resolveToHtmlFlow,concrete:!0},blankLineBefore={tokenize:tokenizeBlankLineBefore,partial:!0},nonLazyContinuationStart={tokenize:tokenizeNonLazyContinuationStart,partial:!0};function resolveToHtmlFlow(o){let et=o.length;for(;et--&&!(o[et][0]==="enter"&&o[et][1].type==="htmlFlow"););return et>1&&o[et-2][1].type==="linePrefix"&&(o[et][1].start=o[et-2][1].start,o[et+1][1].start=o[et-2][1].start,o.splice(et-2,2)),o}function tokenizeHtmlFlow(o,et,tt){const nt=this;let rt,ot,it,st,at;return ct;function ct(Nt){return lt(Nt)}function lt(Nt){return o.enter("htmlFlow"),o.enter("htmlFlowData"),o.consume(Nt),dt}function dt(Nt){return Nt===33?(o.consume(Nt),ht):Nt===47?(o.consume(Nt),ot=!0,ft):Nt===63?(o.consume(Nt),rt=3,nt.interrupt?et:Lt):asciiAlpha(Nt)?(o.consume(Nt),it=String.fromCharCode(Nt),yt):tt(Nt)}function ht(Nt){return Nt===45?(o.consume(Nt),rt=2,pt):Nt===91?(o.consume(Nt),rt=5,st=0,mt):asciiAlpha(Nt)?(o.consume(Nt),rt=4,nt.interrupt?et:Lt):tt(Nt)}function pt(Nt){return Nt===45?(o.consume(Nt),nt.interrupt?et:Lt):tt(Nt)}function mt(Nt){const Gt="CDATA[";return Nt===Gt.charCodeAt(st++)?(o.consume(Nt),st===Gt.length?nt.interrupt?et:Ot:mt):tt(Nt)}function ft(Nt){return asciiAlpha(Nt)?(o.consume(Nt),it=String.fromCharCode(Nt),yt):tt(Nt)}function yt(Nt){if(Nt===null||Nt===47||Nt===62||markdownLineEndingOrSpace(Nt)){const Gt=Nt===47,nn=it.toLowerCase();return!Gt&&!ot&&htmlRawNames.includes(nn)?(rt=1,nt.interrupt?et(Nt):Ot(Nt)):htmlBlockNames.includes(it.toLowerCase())?(rt=6,Gt?(o.consume(Nt),gt):nt.interrupt?et(Nt):Ot(Nt)):(rt=7,nt.interrupt&&!nt.parser.lazy[nt.now().line]?tt(Nt):ot?xt(Nt):vt(Nt))}return Nt===45||asciiAlphanumeric(Nt)?(o.consume(Nt),it+=String.fromCharCode(Nt),yt):tt(Nt)}function gt(Nt){return Nt===62?(o.consume(Nt),nt.interrupt?et:Ot):tt(Nt)}function xt(Nt){return markdownSpace(Nt)?(o.consume(Nt),xt):Pt(Nt)}function vt(Nt){return Nt===47?(o.consume(Nt),Pt):Nt===58||Nt===95||asciiAlpha(Nt)?(o.consume(Nt),bt):markdownSpace(Nt)?(o.consume(Nt),vt):Pt(Nt)}function bt(Nt){return Nt===45||Nt===46||Nt===58||Nt===95||asciiAlphanumeric(Nt)?(o.consume(Nt),bt):Et(Nt)}function Et(Nt){return Nt===61?(o.consume(Nt),wt):markdownSpace(Nt)?(o.consume(Nt),Et):vt(Nt)}function wt(Nt){return Nt===null||Nt===60||Nt===61||Nt===62||Nt===96?tt(Nt):Nt===34||Nt===39?(o.consume(Nt),at=Nt,kt):markdownSpace(Nt)?(o.consume(Nt),wt):Tt(Nt)}function kt(Nt){return Nt===at?(o.consume(Nt),at=null,Rt):Nt===null||markdownLineEnding(Nt)?tt(Nt):(o.consume(Nt),kt)}function Tt(Nt){return Nt===null||Nt===34||Nt===39||Nt===47||Nt===60||Nt===61||Nt===62||Nt===96||markdownLineEndingOrSpace(Nt)?Et(Nt):(o.consume(Nt),Tt)}function Rt(Nt){return Nt===47||Nt===62||markdownSpace(Nt)?vt(Nt):tt(Nt)}function Pt(Nt){return Nt===62?(o.consume(Nt),$t):tt(Nt)}function $t(Nt){return Nt===null||markdownLineEnding(Nt)?Ot(Nt):markdownSpace(Nt)?(o.consume(Nt),$t):tt(Nt)}function Ot(Nt){return Nt===45&&rt===2?(o.consume(Nt),Yt):Nt===60&&rt===1?(o.consume(Nt),Ht):Nt===62&&rt===4?(o.consume(Nt),Zt):Nt===63&&rt===3?(o.consume(Nt),Lt):Nt===93&&rt===5?(o.consume(Nt),qt):markdownLineEnding(Nt)&&(rt===6||rt===7)?(o.exit("htmlFlowData"),o.check(blankLineBefore,Qt,Bt)(Nt)):Nt===null||markdownLineEnding(Nt)?(o.exit("htmlFlowData"),Bt(Nt)):(o.consume(Nt),Ot)}function Bt(Nt){return o.check(nonLazyContinuationStart,zt,Qt)(Nt)}function zt(Nt){return o.enter("lineEnding"),o.consume(Nt),o.exit("lineEnding"),Ft}function Ft(Nt){return Nt===null||markdownLineEnding(Nt)?Bt(Nt):(o.enter("htmlFlowData"),Ot(Nt))}function Yt(Nt){return Nt===45?(o.consume(Nt),Lt):Ot(Nt)}function Ht(Nt){return Nt===47?(o.consume(Nt),it="",Ut):Ot(Nt)}function Ut(Nt){if(Nt===62){const Gt=it.toLowerCase();return htmlRawNames.includes(Gt)?(o.consume(Nt),Zt):Ot(Nt)}return asciiAlpha(Nt)&&it.length<8?(o.consume(Nt),it+=String.fromCharCode(Nt),Ut):Ot(Nt)}function qt(Nt){return Nt===93?(o.consume(Nt),Lt):Ot(Nt)}function Lt(Nt){return Nt===62?(o.consume(Nt),Zt):Nt===45&&rt===2?(o.consume(Nt),Lt):Ot(Nt)}function Zt(Nt){return Nt===null||markdownLineEnding(Nt)?(o.exit("htmlFlowData"),Qt(Nt)):(o.consume(Nt),Zt)}function Qt(Nt){return o.exit("htmlFlow"),et(Nt)}}function tokenizeNonLazyContinuationStart(o,et,tt){const nt=this;return rt;function rt(it){return markdownLineEnding(it)?(o.enter("lineEnding"),o.consume(it),o.exit("lineEnding"),ot):tt(it)}function ot(it){return nt.parser.lazy[nt.now().line]?tt(it):et(it)}}function tokenizeBlankLineBefore(o,et,tt){return nt;function nt(rt){return o.enter("lineEnding"),o.consume(rt),o.exit("lineEnding"),o.attempt(blankLine,et,tt)}}const htmlText={name:"htmlText",tokenize:tokenizeHtmlText};function tokenizeHtmlText(o,et,tt){const nt=this;let rt,ot,it;return st;function st(Lt){return o.enter("htmlText"),o.enter("htmlTextData"),o.consume(Lt),at}function at(Lt){return Lt===33?(o.consume(Lt),ct):Lt===47?(o.consume(Lt),Et):Lt===63?(o.consume(Lt),vt):asciiAlpha(Lt)?(o.consume(Lt),Tt):tt(Lt)}function ct(Lt){return Lt===45?(o.consume(Lt),lt):Lt===91?(o.consume(Lt),ot=0,mt):asciiAlpha(Lt)?(o.consume(Lt),xt):tt(Lt)}function lt(Lt){return Lt===45?(o.consume(Lt),pt):tt(Lt)}function dt(Lt){return Lt===null?tt(Lt):Lt===45?(o.consume(Lt),ht):markdownLineEnding(Lt)?(it=dt,Ht(Lt)):(o.consume(Lt),dt)}function ht(Lt){return Lt===45?(o.consume(Lt),pt):dt(Lt)}function pt(Lt){return Lt===62?Yt(Lt):Lt===45?ht(Lt):dt(Lt)}function mt(Lt){const Zt="CDATA[";return Lt===Zt.charCodeAt(ot++)?(o.consume(Lt),ot===Zt.length?ft:mt):tt(Lt)}function ft(Lt){return Lt===null?tt(Lt):Lt===93?(o.consume(Lt),yt):markdownLineEnding(Lt)?(it=ft,Ht(Lt)):(o.consume(Lt),ft)}function yt(Lt){return Lt===93?(o.consume(Lt),gt):ft(Lt)}function gt(Lt){return Lt===62?Yt(Lt):Lt===93?(o.consume(Lt),gt):ft(Lt)}function xt(Lt){return Lt===null||Lt===62?Yt(Lt):markdownLineEnding(Lt)?(it=xt,Ht(Lt)):(o.consume(Lt),xt)}function vt(Lt){return Lt===null?tt(Lt):Lt===63?(o.consume(Lt),bt):markdownLineEnding(Lt)?(it=vt,Ht(Lt)):(o.consume(Lt),vt)}function bt(Lt){return Lt===62?Yt(Lt):vt(Lt)}function Et(Lt){return asciiAlpha(Lt)?(o.consume(Lt),wt):tt(Lt)}function wt(Lt){return Lt===45||asciiAlphanumeric(Lt)?(o.consume(Lt),wt):kt(Lt)}function kt(Lt){return markdownLineEnding(Lt)?(it=kt,Ht(Lt)):markdownSpace(Lt)?(o.consume(Lt),kt):Yt(Lt)}function Tt(Lt){return Lt===45||asciiAlphanumeric(Lt)?(o.consume(Lt),Tt):Lt===47||Lt===62||markdownLineEndingOrSpace(Lt)?Rt(Lt):tt(Lt)}function Rt(Lt){return Lt===47?(o.consume(Lt),Yt):Lt===58||Lt===95||asciiAlpha(Lt)?(o.consume(Lt),Pt):markdownLineEnding(Lt)?(it=Rt,Ht(Lt)):markdownSpace(Lt)?(o.consume(Lt),Rt):Yt(Lt)}function Pt(Lt){return Lt===45||Lt===46||Lt===58||Lt===95||asciiAlphanumeric(Lt)?(o.consume(Lt),Pt):$t(Lt)}function $t(Lt){return Lt===61?(o.consume(Lt),Ot):markdownLineEnding(Lt)?(it=$t,Ht(Lt)):markdownSpace(Lt)?(o.consume(Lt),$t):Rt(Lt)}function Ot(Lt){return Lt===null||Lt===60||Lt===61||Lt===62||Lt===96?tt(Lt):Lt===34||Lt===39?(o.consume(Lt),rt=Lt,Bt):markdownLineEnding(Lt)?(it=Ot,Ht(Lt)):markdownSpace(Lt)?(o.consume(Lt),Ot):(o.consume(Lt),zt)}function Bt(Lt){return Lt===rt?(o.consume(Lt),rt=void 0,Ft):Lt===null?tt(Lt):markdownLineEnding(Lt)?(it=Bt,Ht(Lt)):(o.consume(Lt),Bt)}function zt(Lt){return Lt===null||Lt===34||Lt===39||Lt===60||Lt===61||Lt===96?tt(Lt):Lt===47||Lt===62||markdownLineEndingOrSpace(Lt)?Rt(Lt):(o.consume(Lt),zt)}function Ft(Lt){return Lt===47||Lt===62||markdownLineEndingOrSpace(Lt)?Rt(Lt):tt(Lt)}function Yt(Lt){return Lt===62?(o.consume(Lt),o.exit("htmlTextData"),o.exit("htmlText"),et):tt(Lt)}function Ht(Lt){return o.exit("htmlTextData"),o.enter("lineEnding"),o.consume(Lt),o.exit("lineEnding"),Ut}function Ut(Lt){return markdownSpace(Lt)?factorySpace(o,qt,"linePrefix",nt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Lt):qt(Lt)}function qt(Lt){return o.enter("htmlTextData"),it(Lt)}}const labelEnd={name:"labelEnd",tokenize:tokenizeLabelEnd,resolveTo:resolveToLabelEnd,resolveAll:resolveAllLabelEnd},resourceConstruct={tokenize:tokenizeResource},referenceFullConstruct={tokenize:tokenizeReferenceFull},referenceCollapsedConstruct={tokenize:tokenizeReferenceCollapsed};function resolveAllLabelEnd(o){let et=-1;for(;++et=3&&(ct===null||markdownLineEnding(ct))?(o.exit("thematicBreak"),et(ct)):tt(ct)}function at(ct){return ct===rt?(o.consume(ct),nt++,at):(o.exit("thematicBreakSequence"),markdownSpace(ct)?factorySpace(o,st,"whitespace")(ct):st(ct))}}const list$1={name:"list",tokenize:tokenizeListStart,continuation:{tokenize:tokenizeListContinuation},exit:tokenizeListEnd},listItemPrefixWhitespaceConstruct={tokenize:tokenizeListItemPrefixWhitespace,partial:!0},indentConstruct={tokenize:tokenizeIndent,partial:!0};function tokenizeListStart(o,et,tt){const nt=this,rt=nt.events[nt.events.length-1];let ot=rt&&rt[1].type==="linePrefix"?rt[2].sliceSerialize(rt[1],!0).length:0,it=0;return st;function st(pt){const mt=nt.containerState.type||(pt===42||pt===43||pt===45?"listUnordered":"listOrdered");if(mt==="listUnordered"?!nt.containerState.marker||pt===nt.containerState.marker:asciiDigit(pt)){if(nt.containerState.type||(nt.containerState.type=mt,o.enter(mt,{_container:!0})),mt==="listUnordered")return o.enter("listItemPrefix"),pt===42||pt===45?o.check(thematicBreak$1,tt,ct)(pt):ct(pt);if(!nt.interrupt||pt===49)return o.enter("listItemPrefix"),o.enter("listItemValue"),at(pt)}return tt(pt)}function at(pt){return asciiDigit(pt)&&++it<10?(o.consume(pt),at):(!nt.interrupt||it<2)&&(nt.containerState.marker?pt===nt.containerState.marker:pt===41||pt===46)?(o.exit("listItemValue"),ct(pt)):tt(pt)}function ct(pt){return o.enter("listItemMarker"),o.consume(pt),o.exit("listItemMarker"),nt.containerState.marker=nt.containerState.marker||pt,o.check(blankLine,nt.interrupt?tt:lt,o.attempt(listItemPrefixWhitespaceConstruct,ht,dt))}function lt(pt){return nt.containerState.initialBlankLine=!0,ot++,ht(pt)}function dt(pt){return markdownSpace(pt)?(o.enter("listItemPrefixWhitespace"),o.consume(pt),o.exit("listItemPrefixWhitespace"),ht):tt(pt)}function ht(pt){return nt.containerState.size=ot+nt.sliceSerialize(o.exit("listItemPrefix"),!0).length,et(pt)}}function tokenizeListContinuation(o,et,tt){const nt=this;return nt.containerState._closeFlow=void 0,o.check(blankLine,rt,ot);function rt(st){return nt.containerState.furtherBlankLines=nt.containerState.furtherBlankLines||nt.containerState.initialBlankLine,factorySpace(o,et,"listItemIndent",nt.containerState.size+1)(st)}function ot(st){return nt.containerState.furtherBlankLines||!markdownSpace(st)?(nt.containerState.furtherBlankLines=void 0,nt.containerState.initialBlankLine=void 0,it(st)):(nt.containerState.furtherBlankLines=void 0,nt.containerState.initialBlankLine=void 0,o.attempt(indentConstruct,et,it)(st))}function it(st){return nt.containerState._closeFlow=!0,nt.interrupt=void 0,factorySpace(o,o.attempt(list$1,et,tt),"linePrefix",nt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(st)}}function tokenizeIndent(o,et,tt){const nt=this;return factorySpace(o,rt,"listItemIndent",nt.containerState.size+1);function rt(ot){const it=nt.events[nt.events.length-1];return it&&it[1].type==="listItemIndent"&&it[2].sliceSerialize(it[1],!0).length===nt.containerState.size?et(ot):tt(ot)}}function tokenizeListEnd(o){o.exit(this.containerState.type)}function tokenizeListItemPrefixWhitespace(o,et,tt){const nt=this;return factorySpace(o,rt,"listItemPrefixWhitespace",nt.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function rt(ot){const it=nt.events[nt.events.length-1];return!markdownSpace(ot)&&it&&it[1].type==="listItemPrefixWhitespace"?et(ot):tt(ot)}}const setextUnderline={name:"setextUnderline",tokenize:tokenizeSetextUnderline,resolveTo:resolveToSetextUnderline};function resolveToSetextUnderline(o,et){let tt=o.length,nt,rt,ot;for(;tt--;)if(o[tt][0]==="enter"){if(o[tt][1].type==="content"){nt=tt;break}o[tt][1].type==="paragraph"&&(rt=tt)}else o[tt][1].type==="content"&&o.splice(tt,1),!ot&&o[tt][1].type==="definition"&&(ot=tt);const it={type:"setextHeading",start:Object.assign({},o[rt][1].start),end:Object.assign({},o[o.length-1][1].end)};return o[rt][1].type="setextHeadingText",ot?(o.splice(rt,0,["enter",it,et]),o.splice(ot+1,0,["exit",o[nt][1],et]),o[nt][1].end=Object.assign({},o[ot][1].end)):o[nt][1]=it,o.push(["exit",it,et]),o}function tokenizeSetextUnderline(o,et,tt){const nt=this;let rt;return ot;function ot(ct){let lt=nt.events.length,dt;for(;lt--;)if(nt.events[lt][1].type!=="lineEnding"&&nt.events[lt][1].type!=="linePrefix"&&nt.events[lt][1].type!=="content"){dt=nt.events[lt][1].type==="paragraph";break}return!nt.parser.lazy[nt.now().line]&&(nt.interrupt||dt)?(o.enter("setextHeadingLine"),rt=ct,it(ct)):tt(ct)}function it(ct){return o.enter("setextHeadingLineSequence"),st(ct)}function st(ct){return ct===rt?(o.consume(ct),st):(o.exit("setextHeadingLineSequence"),markdownSpace(ct)?factorySpace(o,at,"lineSuffix")(ct):at(ct))}function at(ct){return ct===null||markdownLineEnding(ct)?(o.exit("setextHeadingLine"),et(ct)):tt(ct)}}const flow$1={tokenize:initializeFlow};function initializeFlow(o){const et=this,tt=o.attempt(blankLine,nt,o.attempt(this.parser.constructs.flowInitial,rt,factorySpace(o,o.attempt(this.parser.constructs.flow,rt,o.attempt(content,rt)),"linePrefix")));return tt;function nt(ot){if(ot===null){o.consume(ot);return}return o.enter("lineEndingBlank"),o.consume(ot),o.exit("lineEndingBlank"),et.currentConstruct=void 0,tt}function rt(ot){if(ot===null){o.consume(ot);return}return o.enter("lineEnding"),o.consume(ot),o.exit("lineEnding"),et.currentConstruct=void 0,tt}}const resolver={resolveAll:createResolver()},string$1=initializeFactory("string"),text$2=initializeFactory("text");function initializeFactory(o){return{tokenize:et,resolveAll:createResolver(o==="text"?resolveAllLineSuffixes:void 0)};function et(tt){const nt=this,rt=this.parser.constructs[o],ot=tt.attempt(rt,it,st);return it;function it(lt){return ct(lt)?ot(lt):st(lt)}function st(lt){if(lt===null){tt.consume(lt);return}return tt.enter("data"),tt.consume(lt),at}function at(lt){return ct(lt)?(tt.exit("data"),ot(lt)):(tt.consume(lt),at)}function ct(lt){if(lt===null)return!0;const dt=rt[lt];let ht=-1;if(dt)for(;++ht-1){const st=it[0];typeof st=="string"?it[0]=st.slice(nt):it.shift()}ot>0&&it.push(o[rt].slice(0,ot))}return it}function serializeChunks(o,et){let tt=-1;const nt=[];let rt;for(;++tt0){const Kt=St.tokenStack[St.tokenStack.length-1];(Kt[1]||defaultOnError).call(St,void 0,Kt[0])}for(It.position={start:point(on.length>0?on[0][1].start:{line:1,column:1,offset:0}),end:point(on.length>0?on[on.length-2][1].end:{line:1,column:1,offset:0})},jt=-1;++jt1?"-"+st:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(it)}]};o.patch(et,at);const ct={type:"element",tagName:"sup",properties:{},children:[at]};return o.patch(et,ct),o.applyData(et,ct)}function heading(o,et){const tt={type:"element",tagName:"h"+et.depth,properties:{},children:o.all(et)};return o.patch(et,tt),o.applyData(et,tt)}function html(o,et){if(o.options.allowDangerousHtml){const tt={type:"raw",value:et.value};return o.patch(et,tt),o.applyData(et,tt)}}function revert(o,et){const tt=et.referenceType;let nt="]";if(tt==="collapsed"?nt+="[]":tt==="full"&&(nt+="["+(et.label||et.identifier)+"]"),et.type==="imageReference")return[{type:"text",value:"!["+et.alt+nt}];const rt=o.all(et),ot=rt[0];ot&&ot.type==="text"?ot.value="["+ot.value:rt.unshift({type:"text",value:"["});const it=rt[rt.length-1];return it&&it.type==="text"?it.value+=nt:rt.push({type:"text",value:nt}),rt}function imageReference(o,et){const tt=String(et.identifier).toUpperCase(),nt=o.definitionById.get(tt);if(!nt)return revert(o,et);const rt={src:normalizeUri(nt.url||""),alt:et.alt};nt.title!==null&&nt.title!==void 0&&(rt.title=nt.title);const ot={type:"element",tagName:"img",properties:rt,children:[]};return o.patch(et,ot),o.applyData(et,ot)}function image(o,et){const tt={src:normalizeUri(et.url)};et.alt!==null&&et.alt!==void 0&&(tt.alt=et.alt),et.title!==null&&et.title!==void 0&&(tt.title=et.title);const nt={type:"element",tagName:"img",properties:tt,children:[]};return o.patch(et,nt),o.applyData(et,nt)}function inlineCode(o,et){const tt={type:"text",value:et.value.replace(/\r?\n|\r/g," ")};o.patch(et,tt);const nt={type:"element",tagName:"code",properties:{},children:[tt]};return o.patch(et,nt),o.applyData(et,nt)}function linkReference(o,et){const tt=String(et.identifier).toUpperCase(),nt=o.definitionById.get(tt);if(!nt)return revert(o,et);const rt={href:normalizeUri(nt.url||"")};nt.title!==null&&nt.title!==void 0&&(rt.title=nt.title);const ot={type:"element",tagName:"a",properties:rt,children:o.all(et)};return o.patch(et,ot),o.applyData(et,ot)}function link(o,et){const tt={href:normalizeUri(et.url)};et.title!==null&&et.title!==void 0&&(tt.title=et.title);const nt={type:"element",tagName:"a",properties:tt,children:o.all(et)};return o.patch(et,nt),o.applyData(et,nt)}function listItem(o,et,tt){const nt=o.all(et),rt=tt?listLoose(tt):listItemLoose(et),ot={},it=[];if(typeof et.checked=="boolean"){const lt=nt[0];let dt;lt&<.type==="element"&<.tagName==="p"?dt=lt:(dt={type:"element",tagName:"p",properties:{},children:[]},nt.unshift(dt)),dt.children.length>0&&dt.children.unshift({type:"text",value:" "}),dt.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:et.checked,disabled:!0},children:[]}),ot.className=["task-list-item"]}let st=-1;for(;++st1}function list(o,et){const tt={},nt=o.all(et);let rt=-1;for(typeof et.start=="number"&&et.start!==1&&(tt.start=et.start);++rt0){const it={type:"element",tagName:"tbody",properties:{},children:o.wrap(tt,!0)},st=pointStart(et.children[1]),at=pointEnd(et.children[et.children.length-1]);st&&at&&(it.position={start:st,end:at}),rt.push(it)}const ot={type:"element",tagName:"table",properties:{},children:o.wrap(rt,!0)};return o.patch(et,ot),o.applyData(et,ot)}function tableRow(o,et,tt){const nt=tt?tt.children:void 0,ot=(nt?nt.indexOf(et):1)===0?"th":"td",it=tt&&tt.type==="table"?tt.align:void 0,st=it?it.length:et.children.length;let at=-1;const ct=[];for(;++at0,!0),nt[0]),rt=nt.index+nt[0].length,nt=tt.exec(et);return ot.push(trimLine(et.slice(rt),rt>0,!1)),ot.join("")}function trimLine(o,et,tt){let nt=0,rt=o.length;if(et){let ot=o.codePointAt(nt);for(;ot===tab||ot===space;)nt++,ot=o.codePointAt(nt)}if(tt){let ot=o.codePointAt(rt-1);for(;ot===tab||ot===space;)rt--,ot=o.codePointAt(rt-1)}return rt>nt?o.slice(nt,rt):""}function text(o,et){const tt={type:"text",value:trimLines(String(et.value))};return o.patch(et,tt),o.applyData(et,tt)}function thematicBreak(o,et){const tt={type:"element",tagName:"hr",properties:{},children:[]};return o.patch(et,tt),o.applyData(et,tt)}const handlers={blockquote,break:hardBreak,code,delete:strikethrough,emphasis,footnoteReference,heading,html,imageReference,image,inlineCode,linkReference,link,listItem,list,paragraph,root,strong,table,tableCell,tableRow,text,thematicBreak,toml:ignore,yaml:ignore,definition:ignore,footnoteDefinition:ignore};function ignore(){}const VOID=-1,PRIMITIVE=0,ARRAY=1,OBJECT=2,DATE=3,REGEXP=4,MAP=5,SET=6,ERROR=7,BIGINT=8,env=typeof self=="object"?self:globalThis,deserializer=(o,et)=>{const tt=(rt,ot)=>(o.set(ot,rt),rt),nt=rt=>{if(o.has(rt))return o.get(rt);const[ot,it]=et[rt];switch(ot){case PRIMITIVE:case VOID:return tt(it,rt);case ARRAY:{const st=tt([],rt);for(const at of it)st.push(nt(at));return st}case OBJECT:{const st=tt({},rt);for(const[at,ct]of it)st[nt(at)]=nt(ct);return st}case DATE:return tt(new Date(it),rt);case REGEXP:{const{source:st,flags:at}=it;return tt(new RegExp(st,at),rt)}case MAP:{const st=tt(new Map,rt);for(const[at,ct]of it)st.set(nt(at),nt(ct));return st}case SET:{const st=tt(new Set,rt);for(const at of it)st.add(nt(at));return st}case ERROR:{const{name:st,message:at}=it;return tt(new env[st](at),rt)}case BIGINT:return tt(BigInt(it),rt);case"BigInt":return tt(Object(BigInt(it)),rt)}return tt(new env[ot](it),rt)};return nt},deserialize=o=>deserializer(new Map,o)(0),EMPTY="",{toString}={},{keys}=Object,typeOf=o=>{const et=typeof o;if(et!=="object"||!o)return[PRIMITIVE,et];const tt=toString.call(o).slice(8,-1);switch(tt){case"Array":return[ARRAY,EMPTY];case"Object":return[OBJECT,EMPTY];case"Date":return[DATE,EMPTY];case"RegExp":return[REGEXP,EMPTY];case"Map":return[MAP,EMPTY];case"Set":return[SET,EMPTY]}return tt.includes("Array")?[ARRAY,tt]:tt.includes("Error")?[ERROR,tt]:[OBJECT,tt]},shouldSkip=([o,et])=>o===PRIMITIVE&&(et==="function"||et==="symbol"),serializer=(o,et,tt,nt)=>{const rt=(it,st)=>{const at=nt.push(it)-1;return tt.set(st,at),at},ot=it=>{if(tt.has(it))return tt.get(it);let[st,at]=typeOf(it);switch(st){case PRIMITIVE:{let lt=it;switch(at){case"bigint":st=BIGINT,lt=it.toString();break;case"function":case"symbol":if(o)throw new TypeError("unable to serialize "+at);lt=null;break;case"undefined":return rt([VOID],it)}return rt([st,lt],it)}case ARRAY:{if(at)return rt([at,[...it]],it);const lt=[],dt=rt([st,lt],it);for(const ht of it)lt.push(ot(ht));return dt}case OBJECT:{if(at)switch(at){case"BigInt":return rt([at,it.toString()],it);case"Boolean":case"Number":case"String":return rt([at,it.valueOf()],it)}if(et&&"toJSON"in it)return ot(it.toJSON());const lt=[],dt=rt([st,lt],it);for(const ht of keys(it))(o||!shouldSkip(typeOf(it[ht])))&<.push([ot(ht),ot(it[ht])]);return dt}case DATE:return rt([st,it.toISOString()],it);case REGEXP:{const{source:lt,flags:dt}=it;return rt([st,{source:lt,flags:dt}],it)}case MAP:{const lt=[],dt=rt([st,lt],it);for(const[ht,pt]of it)(o||!(shouldSkip(typeOf(ht))||shouldSkip(typeOf(pt))))&<.push([ot(ht),ot(pt)]);return dt}case SET:{const lt=[],dt=rt([st,lt],it);for(const ht of it)(o||!shouldSkip(typeOf(ht)))&<.push(ot(ht));return dt}}const{message:ct}=it;return rt([st,{name:at,message:ct}],it)};return ot},serialize=(o,{json:et,lossy:tt}={})=>{const nt=[];return serializer(!(et||tt),!!et,new Map,nt)(o),nt},structuredClone$1=typeof structuredClone=="function"?(o,et)=>et&&("json"in et||"lossy"in et)?deserialize(serialize(o,et)):structuredClone(o):(o,et)=>deserialize(serialize(o,et));function defaultFootnoteBackContent(o,et){const tt=[{type:"text",value:"↩"}];return et>1&&tt.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(et)}]}),tt}function defaultFootnoteBackLabel(o,et){return"Back to reference "+(o+1)+(et>1?"-"+et:"")}function footer(o){const et=typeof o.options.clobberPrefix=="string"?o.options.clobberPrefix:"user-content-",tt=o.options.footnoteBackContent||defaultFootnoteBackContent,nt=o.options.footnoteBackLabel||defaultFootnoteBackLabel,rt=o.options.footnoteLabel||"Footnotes",ot=o.options.footnoteLabelTagName||"h2",it=o.options.footnoteLabelProperties||{className:["sr-only"]},st=[];let at=-1;for(;++at0&&mt.push({type:"text",value:" "});let xt=typeof tt=="string"?tt:tt(at,pt);typeof xt=="string"&&(xt={type:"text",value:xt}),mt.push({type:"element",tagName:"a",properties:{href:"#"+et+"fnref-"+ht+(pt>1?"-"+pt:""),dataFootnoteBackref:"",ariaLabel:typeof nt=="string"?nt:nt(at,pt),className:["data-footnote-backref"]},children:Array.isArray(xt)?xt:[xt]})}const yt=lt[lt.length-1];if(yt&&yt.type==="element"&&yt.tagName==="p"){const xt=yt.children[yt.children.length-1];xt&&xt.type==="text"?xt.value+=" ":yt.children.push({type:"text",value:" "}),yt.children.push(...mt)}else lt.push(...mt);const gt={type:"element",tagName:"li",properties:{id:et+"fn-"+ht},children:o.wrap(lt,!0)};o.patch(ct,gt),st.push(gt)}if(st.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:ot,properties:{...structuredClone$1(it),id:"footnote-label"},children:[{type:"text",value:rt}]},{type:"text",value:` +`},{type:"element",tagName:"ol",properties:{},children:o.wrap(st,!0)},{type:"text",value:` +`}]}}const convert=function(o){if(o==null)return ok;if(typeof o=="function")return castFactory(o);if(typeof o=="object")return Array.isArray(o)?anyFactory(o):propsFactory(o);if(typeof o=="string")return typeFactory(o);throw new Error("Expected function, string, or object as test")};function anyFactory(o){const et=[];let tt=-1;for(;++tt":""))+")"})}return ht;function ht(){let pt=empty,mt,ft,yt;if((!et||ot(at,ct,lt[lt.length-1]||void 0))&&(pt=toResult(tt(at,lt)),pt[0]===EXIT))return pt;if("children"in at&&at.children){const gt=at;if(gt.children&&pt[0]!==SKIP)for(ft=(nt?gt.children.length:-1)+it,yt=lt.concat(gt);ft>-1&&ft0&&tt.push({type:"text",value:` +`}),tt}function trimMarkdownSpaceStart(o){let et=0,tt=o.charCodeAt(et);for(;tt===9||tt===32;)et++,tt=o.charCodeAt(et);return o.slice(et)}function toHast(o,et){const tt=createState(o,et),nt=tt.one(o,void 0),rt=footer(tt),ot=Array.isArray(nt)?{type:"root",children:nt}:nt||{type:"root",children:[]};return rt&&ot.children.push({type:"text",value:` +`},rt),ot}function remarkRehype(o,et){return o&&"run"in o?async function(tt,nt){const rt=toHast(tt,{file:nt,...et});await o.run(rt,nt)}:function(tt,nt){return toHast(tt,{file:nt,...o||et})}}function bail(o){if(o)throw o}var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray=function o(et){return typeof Array.isArray=="function"?Array.isArray(et):toStr.call(et)==="[object Array]"},isPlainObject$1=function o(et){if(!et||toStr.call(et)!=="[object Object]")return!1;var tt=hasOwn.call(et,"constructor"),nt=et.constructor&&et.constructor.prototype&&hasOwn.call(et.constructor.prototype,"isPrototypeOf");if(et.constructor&&!tt&&!nt)return!1;var rt;for(rt in et);return typeof rt>"u"||hasOwn.call(et,rt)},setProperty=function o(et,tt){defineProperty&&tt.name==="__proto__"?defineProperty(et,tt.name,{enumerable:!0,configurable:!0,value:tt.newValue,writable:!0}):et[tt.name]=tt.newValue},getProperty=function o(et,tt){if(tt==="__proto__")if(hasOwn.call(et,tt)){if(gOPD)return gOPD(et,tt).value}else return;return et[tt]},extend=function o(){var et,tt,nt,rt,ot,it,st=arguments[0],at=1,ct=arguments.length,lt=!1;for(typeof st=="boolean"&&(lt=st,st=arguments[1]||{},at=2),(st==null||typeof st!="object"&&typeof st!="function")&&(st={});atit.length;let at;st&&it.push(rt);try{at=o.apply(this,it)}catch(ct){const lt=ct;if(st&&tt)throw lt;return rt(lt)}st||(at&&at.then&&typeof at.then=="function"?at.then(ot,rt):at instanceof Error?rt(at):ot(at))}function rt(it,...st){tt||(tt=!0,et(it,...st))}function ot(it){rt(null,it)}}const minpath={basename,dirname,extname,join,sep:"/"};function basename(o,et){if(et!==void 0&&typeof et!="string")throw new TypeError('"ext" argument must be a string');assertPath$1(o);let tt=0,nt=-1,rt=o.length,ot;if(et===void 0||et.length===0||et.length>o.length){for(;rt--;)if(o.codePointAt(rt)===47){if(ot){tt=rt+1;break}}else nt<0&&(ot=!0,nt=rt+1);return nt<0?"":o.slice(tt,nt)}if(et===o)return"";let it=-1,st=et.length-1;for(;rt--;)if(o.codePointAt(rt)===47){if(ot){tt=rt+1;break}}else it<0&&(ot=!0,it=rt+1),st>-1&&(o.codePointAt(rt)===et.codePointAt(st--)?st<0&&(nt=rt):(st=-1,nt=it));return tt===nt?nt=it:nt<0&&(nt=o.length),o.slice(tt,nt)}function dirname(o){if(assertPath$1(o),o.length===0)return".";let et=-1,tt=o.length,nt;for(;--tt;)if(o.codePointAt(tt)===47){if(nt){et=tt;break}}else nt||(nt=!0);return et<0?o.codePointAt(0)===47?"/":".":et===1&&o.codePointAt(0)===47?"//":o.slice(0,et)}function extname(o){assertPath$1(o);let et=o.length,tt=-1,nt=0,rt=-1,ot=0,it;for(;et--;){const st=o.codePointAt(et);if(st===47){if(it){nt=et+1;break}continue}tt<0&&(it=!0,tt=et+1),st===46?rt<0?rt=et:ot!==1&&(ot=1):rt>-1&&(ot=-1)}return rt<0||tt<0||ot===0||ot===1&&rt===tt-1&&rt===nt+1?"":o.slice(rt,tt)}function join(...o){let et=-1,tt;for(;++et0&&o.codePointAt(o.length-1)===47&&(tt+="/"),et?"/"+tt:tt}function normalizeString(o,et){let tt="",nt=0,rt=-1,ot=0,it=-1,st,at;for(;++it<=o.length;){if(it2){if(at=tt.lastIndexOf("/"),at!==tt.length-1){at<0?(tt="",nt=0):(tt=tt.slice(0,at),nt=tt.length-1-tt.lastIndexOf("/")),rt=it,ot=0;continue}}else if(tt.length>0){tt="",nt=0,rt=it,ot=0;continue}}et&&(tt=tt.length>0?tt+"/..":"..",nt=2)}else tt.length>0?tt+="/"+o.slice(rt+1,it):tt=o.slice(rt+1,it),nt=it-rt-1;rt=it,ot=0}else st===46&&ot>-1?ot++:ot=-1}return tt}function assertPath$1(o){if(typeof o!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(o))}const minproc={cwd};function cwd(){return"/"}function isUrl(o){return!!(o!==null&&typeof o=="object"&&"href"in o&&o.href&&"protocol"in o&&o.protocol&&o.auth===void 0)}function urlToPath(o){if(typeof o=="string")o=new URL(o);else if(!isUrl(o)){const et=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+o+"`");throw et.code="ERR_INVALID_ARG_TYPE",et}if(o.protocol!=="file:"){const et=new TypeError("The URL must be of scheme file");throw et.code="ERR_INVALID_URL_SCHEME",et}return getPathFromURLPosix(o)}function getPathFromURLPosix(o){if(o.hostname!==""){const nt=new TypeError('File URL host must be "localhost" or empty on darwin');throw nt.code="ERR_INVALID_FILE_URL_HOST",nt}const et=o.pathname;let tt=-1;for(;++tt0){let[pt,...mt]=lt;const ft=nt[ht][1];isPlainObject(ft)&&isPlainObject(pt)&&(pt=extend$1(!0,ft,pt)),nt[ht]=[ct,pt,...mt]}}}}const unified=new Processor().freeze();function assertParser(o,et){if(typeof et!="function")throw new TypeError("Cannot `"+o+"` without `parser`")}function assertCompiler(o,et){if(typeof et!="function")throw new TypeError("Cannot `"+o+"` without `compiler`")}function assertUnfrozen(o,et){if(et)throw new Error("Cannot call `"+o+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function assertNode(o){if(!isPlainObject(o)||typeof o.type!="string")throw new TypeError("Expected node, got `"+o+"`")}function assertDone(o,et,tt){if(!tt)throw new Error("`"+o+"` finished async. Use `"+et+"` instead")}function vfile(o){return looksLikeAVFile(o)?o:new VFile(o)}function looksLikeAVFile(o){return!!(o&&typeof o=="object"&&"message"in o&&"messages"in o)}function looksLikeAValue(o){return typeof o=="string"||isUint8Array(o)}function isUint8Array(o){return!!(o&&typeof o=="object"&&"byteLength"in o&&"byteOffset"in o)}const changelog="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",emptyPlugins=[],emptyRemarkRehypeOptions={allowDangerousHtml:!0},safeProtocol=/^(https?|ircs?|mailto|xmpp)$/i,deprecations=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Markdown(o){const et=o.allowedElements,tt=o.allowElement,nt=o.children||"",rt=o.className,ot=o.components,it=o.disallowedElements,st=o.rehypePlugins||emptyPlugins,at=o.remarkPlugins||emptyPlugins,ct=o.remarkRehypeOptions?{...o.remarkRehypeOptions,...emptyRemarkRehypeOptions}:emptyRemarkRehypeOptions,lt=o.skipHtml,dt=o.unwrapDisallowed,ht=o.urlTransform||defaultUrlTransform,pt=unified().use(remarkParse).use(at).use(remarkRehype,ct).use(st),mt=new VFile;typeof nt=="string"&&(mt.value=nt);for(const xt of deprecations)Object.hasOwn(o,xt.from)&&(""+xt.from+(xt.to?"use `"+xt.to+"` instead":"remove it")+changelog+xt.id,void 0);const ft=pt.parse(mt);let yt=pt.runSync(ft,mt);return rt&&(yt={type:"element",tagName:"div",properties:{className:rt},children:yt.type==="root"?yt.children:[yt]}),visit(yt,gt),toJsxRuntime(yt,{Fragment:jsxRuntimeExports.Fragment,components:ot,ignoreInvalidStyle:!0,jsx:jsxRuntimeExports.jsx,jsxs:jsxRuntimeExports.jsxs,passKeys:!0,passNode:!0});function gt(xt,vt,bt){if(xt.type==="raw"&&bt&&typeof vt=="number")return lt?bt.children.splice(vt,1):bt.children[vt]={type:"text",value:xt.value},vt;if(xt.type==="element"){let Et;for(Et in urlAttributes)if(Object.hasOwn(urlAttributes,Et)&&Object.hasOwn(xt.properties,Et)){const wt=xt.properties[Et],kt=urlAttributes[Et];(kt===null||kt.includes(xt.tagName))&&(xt.properties[Et]=ht(String(wt||""),Et,xt))}}if(xt.type==="element"){let Et=et?!et.includes(xt.tagName):it?it.includes(xt.tagName):!1;if(!Et&&tt&&typeof vt=="number"&&(Et=!tt(xt,vt,bt)),Et&&bt&&typeof vt=="number")return dt&&xt.children?bt.children.splice(vt,1,...xt.children):bt.children.splice(vt,1),vt}}}function defaultUrlTransform(o){const et=o.indexOf(":"),tt=o.indexOf("?"),nt=o.indexOf("#"),rt=o.indexOf("/");return et<0||rt>-1&&et>rt||tt>-1&&et>tt||nt>-1&&et>nt||safeProtocol.test(o.slice(0,et))?o:""}const PrivacyPolicyOptIn=({onOptIn:o})=>{const[et,tt]=reactExports.useState(!1);return jsxRuntimeExports.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:[jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-md",children:[jsxRuntimeExports.jsx(CardHeader,{className:"space-y-2",children:jsxRuntimeExports.jsx(CardTitle,{className:"text-xl sm:text-2xl",children:"Privacy Policy & Data Collection"})}),jsxRuntimeExports.jsx(CardContent,{children:jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"We collect data to improve our services. This data is anonymous and helps us understand how our application is used. You can opt-in or opt-out of this data collection."}),jsxRuntimeExports.jsx(Button,{variant:"link",onClick:()=>tt(!0),className:"px-0 text-sm sm:text-base",children:"View Full Privacy Policy"})]})}),jsxRuntimeExports.jsxs(CardFooter,{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[jsxRuntimeExports.jsx(Button,{variant:"outline",onClick:()=>o(!1),className:"w-full sm:w-auto",children:"Opt Out"}),jsxRuntimeExports.jsx(Button,{onClick:()=>o(!0),className:"w-full sm:w-auto",children:"Opt In"})]})]}),jsxRuntimeExports.jsx(Dialog,{open:et,onOpenChange:tt,children:jsxRuntimeExports.jsxs(DialogContent,{className:"w-[95vw] max-w-4xl max-h-[90vh] p-4 sm:p-6",children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsx(DialogTitle,{className:"text-xl sm:text-2xl",children:"Privacy Policy"})}),jsxRuntimeExports.jsx(ScrollArea,{className:"mt-4 h-[50vh] sm:h-[60vh]",children:jsxRuntimeExports.jsx(DialogDescription,{className:"space-y-4",children:jsxRuntimeExports.jsx(Markdown,{className:"prose dark:prose-invert max-w-none text-sm sm:text-base",children:privacyPolicy})})})]})})]})},PrivacyPolicyPage=()=>{const[o,et]=reactExports.useState(!1);reactExports.useEffect(()=>{const nt=localStorage.getItem("privacyPolicyOptIn");nt!==null&&et(nt==="true")},[]);const tt=()=>{const nt=!o;et(nt),localStorage.setItem("privacyPolicyOptIn",nt.toString())};return jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-4xl mx-auto p-4 sm:p-6",children:[jsxRuntimeExports.jsx(CardHeader,{className:"space-y-2",children:jsxRuntimeExports.jsx(CardTitle,{className:"text-2xl sm:text-3xl",children:"Privacy Policy Settings"})}),jsxRuntimeExports.jsx(CardContent,{children:jsxRuntimeExports.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"We collect data to improve our services. This data is anonymous and helps us understand how our application is used."}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[jsxRuntimeExports.jsxs("p",{className:"font-semibold",children:["Current status: ",o?"Opted In":"Opted Out"]}),jsxRuntimeExports.jsx(Button,{onClick:tt,className:"w-full sm:w-auto",children:o?"Opt Out":"Opt In"})]})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{className:"text-lg sm:text-xl font-semibold mb-4",children:"Privacy Policy"}),jsxRuntimeExports.jsx(ScrollArea,{className:"h-[50vh] sm:h-[60vh] border rounded-md p-2 sm:p-4",children:jsxRuntimeExports.jsx(Markdown,{className:"prose dark:prose-invert max-w-none text-sm sm:text-base",children:privacyPolicy})})]})]})})]})},SignSharedChain=({chainsData:o,onChainUpdate:et,isLoading:tt})=>{const{chainUUID:nt,blockUUID:rt}=useParams(),[ot,it]=reactExports.useState(null),st=useNavigate();return reactExports.useEffect(()=>{const at=o.find(ct=>ct.chainUUID===nt&&ct.blockUUID===rt);at&&it(at)},[o,nt,rt]),tt&&!ot?jsxRuntimeExports.jsx(Card,{className:"w-full max-w-md mx-auto",children:jsxRuntimeExports.jsxs(CardContent,{className:"flex flex-col items-center justify-center py-8 space-y-4",children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin"}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:"Looking for chain..."})]})}):ot?jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-2xl mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:"Sign Shared Chain"})}),jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsx("h2",{className:"text-xl font-semibold mb-2",children:ot.title}),jsxRuntimeExports.jsx("p",{className:"mb-4",children:ot.description}),jsxRuntimeExports.jsx(SignChain,{block:ot,chainsData:o,onSuccess:et})]})]}):jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-md mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:"Chain Not Found"})}),jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsx("p",{className:"mb-4",children:"The requested chain or block could not be found."}),jsxRuntimeExports.jsx(Button,{onClick:()=>st("/view"),children:"View All Chains"})]})]})};function App(){const[o,et]=reactExports.useState(!1),[tt,nt]=reactExports.useState([]),{isLoading:rt,error:ot,node:it}=useWaku(),[st,at]=reactExports.useState({filter:"in-progress",store:"in-progress"}),[ct,lt]=reactExports.useState(null),[dt,ht]=reactExports.useState(!0);reactExports.useEffect(()=>{const yt=localStorage.getItem("telemetryOptIn");yt!==null&<(yt==="true")},[]),reactExports.useEffect(()=>{rt||!it||it.libp2p.getConnections().length===0||tt.length>0||o||(et(!0),mt())},[it,rt,st]);const pt=yt=>{lt(yt),localStorage.setItem("telemetryOptIn",yt.toString())};if(rt)return jsxRuntimeExports.jsx("div",{className:"min-h-screen bg-background text-foreground",children:jsxRuntimeExports.jsxs("div",{className:"container mx-auto px-4 py-16 flex flex-col items-center justify-center space-y-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-2xl md:text-4xl font-bold",children:"BuddyBook"}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin"}),jsxRuntimeExports.jsx("p",{className:"text-muted-foreground",children:"Connecting to Waku's decentralized network..."})]})]})});const mt=async()=>{console.log("Starting message listening");try{at(gt=>({...gt,store:"in-progress"})),ht(!0);const yt=getMessagesFromStore(it);try{for await(const gt of yt)nt(xt=>xt.some(bt=>bt.blockUUID===gt.blockUUID)?xt:[...xt,gt])}catch(gt){console.error("Error processing message:",gt)}at(gt=>({...gt,store:"success"}))}catch(yt){console.error("Error fetching messages from store:",yt),at(gt=>({...gt,store:"error"}))}finally{ht(!1)}try{at(yt=>({...yt,filter:"in-progress"})),await subscribeToFilter(it,yt=>{ft(yt)}),at(yt=>({...yt,filter:"success"}))}catch(yt){console.error("Error subscribing to filter:",yt),at(gt=>({...gt,filter:"error"}))}};if(ot)return console.error("Waku error:",ot),jsxRuntimeExports.jsxs("div",{className:"min-h-screen bg-background text-foreground flex flex-col justify-center items-center",children:[jsxRuntimeExports.jsx("p",{className:"text-red-500",children:"Error connecting to Waku network"}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:ot.toString()})]});const ft=yt=>{nt(gt=>gt.some(vt=>vt.blockUUID===yt.blockUUID)?gt:[...gt,yt])};return ct===null?jsxRuntimeExports.jsx(PrivacyPolicyOptIn,{onOptIn:pt}):jsxRuntimeExports.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[jsxRuntimeExports.jsx(Header,{wakuStatus:st}),jsxRuntimeExports.jsx("main",{className:"container mx-auto px-4 py-4 md:py-8 max-w-7xl",children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"",element:jsxRuntimeExports.jsx(Home,{})}),jsxRuntimeExports.jsx(Route,{path:"create",element:jsxRuntimeExports.jsx(ChainCreationForm,{})}),jsxRuntimeExports.jsx(Route,{path:"view",element:jsxRuntimeExports.jsx(ChainList,{chainsData:tt,onChainUpdate:ft,isLoading:dt})}),jsxRuntimeExports.jsx(Route,{path:"sign/:chainUUID/:blockUUID",element:jsxRuntimeExports.jsx(SignSharedChain,{chainsData:tt,onChainUpdate:ft,isLoading:dt})}),jsxRuntimeExports.jsx(Route,{path:"telemetry",element:jsxRuntimeExports.jsx(PrivacyPolicyPage,{})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(Navigate,{to:"",replace:!0})})]})})]})}const Home=()=>jsxRuntimeExports.jsxs("div",{className:"space-y-4 md:space-y-6 p-4 md:p-6",children:[jsxRuntimeExports.jsx("h1",{className:"text-2xl md:text-4xl font-bold",children:"BuddyBook"}),jsxRuntimeExports.jsxs("div",{className:"w-full max-w-sm mx-auto p-4 md:p-6 bg-card rounded-lg shadow-md",children:[jsxRuntimeExports.jsx(Link,{to:"create",children:jsxRuntimeExports.jsx(Button,{className:"w-full mb-4",children:"Create New Chain"})}),jsxRuntimeExports.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:"Click the button above to start creating a new chain."})]}),jsxRuntimeExports.jsx("p",{className:"text-xs md:text-sm text-muted-foreground text-center",children:"Welcome to BuddyBook - Create and share your chains!"})]}),projectId="1d93edc21291f98e3bed6ff7617ff539",config=createConfig(defaultConfig({appName:"BuddyBook",walletConnectProjectId:projectId,chains:[mainnet],transports:{[mainnet.id]:http()}})),WAKU_NODE_OPTIONS={defaultBootstrap:!0,protocols:[Protocols.Store,Protocols.Filter,Protocols.LightPush]};typeof globalThis>"u"&&(window.global=window);typeof buffer$2.Buffer>"u"&&(window.Buffer=buffer$2.Buffer);const queryClient=new QueryClient;createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(WagmiProvider,{config,children:jsxRuntimeExports.jsx(QueryClientProvider,{client:queryClient,children:jsxRuntimeExports.jsx(ConnectKitProvider,{children:jsxRuntimeExports.jsx(LightNodeProvider,{options:WAKU_NODE_OPTIONS,children:jsxRuntimeExports.jsx(BrowserRouter,{basename:"/",children:jsxRuntimeExports.jsx(App,{})})})})})})}));export{isHex as A,BaseError$3 as B,dijkstraExports as C,EventEmitter$1 as E,HttpRequestError as H,InvalidAddressError as I,__vitePreload as _,BytesSizeMismatchError as a,stringToHex as b,concat$3 as c,bytesToHex$4 as d,encodeAbiParameters as e,commonjsGlobal as f,encodeFunctionData as g,getDefaultExportFromCjs as h,isAddress as i,getAugmentedNamespace as j,keccak256$1 as k,sha3$2 as l,bytesToHex$3 as m,numberToHex as n,sha256$2 as o,buffer$2 as p,browserExports as q,tslib_es6$1 as r,size$2 as s,toHex as t,detect as u,__viteBrowserExternal$1 as v,getUrl as w,stringify$2 as x,decodeErrorResult as y,call as z}; diff --git a/buddybook/assets/index-D8m_BJXT.js b/buddybook/assets/index-D8m_BJXT.js deleted file mode 100644 index c808f2a..0000000 --- a/buddybook/assets/index-D8m_BJXT.js +++ /dev/null @@ -1 +0,0 @@ -import{d as M,g as sr,h as ir}from"./index-Gmp6KMX1.js";import{j as ar,s as or,r as _t,a as cr,b as dr}from"./hooks.module-Bu9ycfnK.js";var Et={},te={},me={};Object.defineProperty(me,"__esModule",{value:!0});me.walletLogo=void 0;const lr=(r,e)=>{let t;switch(r){case"standard":return t=e,`data:image/svg+xml,%3Csvg width='${e}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return t=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return t=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return t=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return t=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return t=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${t}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return t=e,`data:image/svg+xml,%3Csvg width='${e}' height='${t}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};me.walletLogo=lr;var be={},j={},U={};Object.defineProperty(U,"__esModule",{value:!0});U.errorValues=U.standardErrorCodes=void 0;U.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};U.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var ye={},$e={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.serialize=r.getErrorCode=r.isValidCode=r.getMessageFromCode=r.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=U,t="Unspecified error message.";r.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(d,p=t){if(d&&Number.isInteger(d)){const m=d.toString();if(h(e.errorValues,m))return e.errorValues[m].message;if(c(d))return r.JSON_RPC_SERVER_ERROR_MESSAGE}return p}r.getMessageFromCode=n;function s(d){if(!Number.isInteger(d))return!1;const p=d.toString();return!!(e.errorValues[p]||c(d))}r.isValidCode=s;function i(d){var p;if(typeof d=="number")return d;if(a(d))return(p=d.code)!==null&&p!==void 0?p:d.errorCode}r.getErrorCode=i;function a(d){return typeof d=="object"&&d!==null&&(typeof d.code=="number"||typeof d.errorCode=="number")}function o(d,{shouldIncludeStack:p=!1}={}){const m={};if(d&&typeof d=="object"&&!Array.isArray(d)&&h(d,"code")&&s(d.code)){const B=d;m.code=B.code,B.message&&typeof B.message=="string"?(m.message=B.message,h(B,"data")&&(m.data=B.data)):(m.message=n(m.code),m.data={originalError:l(d)})}else m.code=e.standardErrorCodes.rpc.internal,m.message=f(d,"message")?d.message:t,m.data={originalError:l(d)};return p&&(m.stack=f(d,"stack")?d.stack:void 0),m}r.serialize=o;function c(d){return d>=-32099&&d<=-32e3}function l(d){return d&&typeof d=="object"&&!Array.isArray(d)?Object.assign({},d):d}function h(d,p){return Object.prototype.hasOwnProperty.call(d,p)}function f(d,p){return typeof d=="object"&&d!==null&&p in d&&typeof d[p]=="string"}})($e);Object.defineProperty(ye,"__esModule",{value:!0});ye.standardErrors=void 0;const v=U,St=$e;ye.standardErrors={rpc:{parse:r=>C(v.standardErrorCodes.rpc.parse,r),invalidRequest:r=>C(v.standardErrorCodes.rpc.invalidRequest,r),invalidParams:r=>C(v.standardErrorCodes.rpc.invalidParams,r),methodNotFound:r=>C(v.standardErrorCodes.rpc.methodNotFound,r),internal:r=>C(v.standardErrorCodes.rpc.internal,r),server:r=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=r;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return C(e,r)},invalidInput:r=>C(v.standardErrorCodes.rpc.invalidInput,r),resourceNotFound:r=>C(v.standardErrorCodes.rpc.resourceNotFound,r),resourceUnavailable:r=>C(v.standardErrorCodes.rpc.resourceUnavailable,r),transactionRejected:r=>C(v.standardErrorCodes.rpc.transactionRejected,r),methodNotSupported:r=>C(v.standardErrorCodes.rpc.methodNotSupported,r),limitExceeded:r=>C(v.standardErrorCodes.rpc.limitExceeded,r)},provider:{userRejectedRequest:r=>$(v.standardErrorCodes.provider.userRejectedRequest,r),unauthorized:r=>$(v.standardErrorCodes.provider.unauthorized,r),unsupportedMethod:r=>$(v.standardErrorCodes.provider.unsupportedMethod,r),disconnected:r=>$(v.standardErrorCodes.provider.disconnected,r),chainDisconnected:r=>$(v.standardErrorCodes.provider.chainDisconnected,r),unsupportedChain:r=>$(v.standardErrorCodes.provider.unsupportedChain,r),custom:r=>{if(!r||typeof r!="object"||Array.isArray(r))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:t,data:n}=r;if(!t||typeof t!="string")throw new Error('"message" must be a nonempty string');return new It(e,t,n)}}};function C(r,e){const[t,n]=Ct(e);return new kt(r,t||(0,St.getMessageFromCode)(r),n)}function $(r,e){const[t,n]=Ct(e);return new It(r,t||(0,St.getMessageFromCode)(r),n)}function Ct(r){if(r){if(typeof r=="string")return[r];if(typeof r=="object"&&!Array.isArray(r)){const{message:e,data:t}=r;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,t]}}return[]}class kt extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||typeof t!="string")throw new Error('"message" must be a nonempty string.');super(t),this.code=e,n!==void 0&&(this.data=n)}}class It extends kt{constructor(e,t,n){if(!ur(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}function ur(r){return Number.isInteger(r)&&r>=1e3&&r<=4999}(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.standardErrors=r.standardErrorCodes=void 0;var e=U;Object.defineProperty(r,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var t=ye;Object.defineProperty(r,"standardErrors",{enumerable:!0,get:function(){return t.standardErrors}})})(j);var we={},Q={};Object.defineProperty(Q,"__esModule",{value:!0});Q.isErrorResponse=void 0;function hr(r){return r.errorMessage!==void 0}Q.isErrorResponse=hr;var K={};Object.defineProperty(K,"__esModule",{value:!0});K.LIB_VERSION=void 0;K.LIB_VERSION="4.0.4";Object.defineProperty(we,"__esModule",{value:!0});we.serializeError=void 0;const gr=Q,pr=K,fr=U,mr=$e;function br(r,e){const t=(0,mr.serialize)(yr(r),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",pr.LIB_VERSION),n.searchParams.set("code",t.code.toString());const s=wr(t.data,e);return s&&n.searchParams.set("method",s),n.searchParams.set("message",t.message),Object.assign(Object.assign({},t),{docUrl:n.href})}we.serializeError=br;function yr(r){return typeof r=="string"?{message:r,code:fr.standardErrorCodes.rpc.internal}:(0,gr.isErrorResponse)(r)?Object.assign(Object.assign({},r),{message:r.errorMessage,code:r.errorCode,data:{method:r.method}}):r}function wr(r,e){const t=r==null?void 0:r.method;if(t)return t;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}var _={};Object.defineProperty(_,"__esModule",{value:!0});_.RegExpString=_.IntNumber=_.BigIntString=_.AddressString=_.HexString=_.OpaqueType=void 0;function re(){return r=>r}_.OpaqueType=re;_.HexString=re();_.AddressString=re();_.BigIntString=re();function vr(r){return Math.floor(r)}_.IntNumber=vr;_.RegExpString=re();var u={};Object.defineProperty(u,"__esModule",{value:!0});u.areAddressArraysEqual=u.getFavicon=u.range=u.isBigNumber=u.ensureParsedJSONObject=u.ensureBigInt=u.ensureRegExpString=u.ensureIntNumber=u.ensureBuffer=u.ensureAddressString=u.ensureEvenLengthHexString=u.ensureHexString=u.isHexString=u.prepend0x=u.strip0x=u.has0xPrefix=u.hexStringFromIntNumber=u.intNumberFromHexString=u.bigIntStringFromBigInt=u.hexStringFromBuffer=u.hexStringToUint8Array=u.uint8ArrayToHex=u.randomBytesHex=void 0;const q=j,I=_,Mt=/^[0-9]*$/,Lt=/^[a-f0-9]*$/;function _r(r){return At(crypto.getRandomValues(new Uint8Array(r)))}u.randomBytesHex=_r;function At(r){return[...r].map(e=>e.toString(16).padStart(2,"0")).join("")}u.uint8ArrayToHex=At;function Er(r){return new Uint8Array(r.match(/.{1,2}/g).map(e=>parseInt(e,16)))}u.hexStringToUint8Array=Er;function Sr(r,e=!1){const t=r.toString("hex");return(0,I.HexString)(e?`0x${t}`:t)}u.hexStringFromBuffer=Sr;function Cr(r){return(0,I.BigIntString)(r.toString(10))}u.bigIntStringFromBigInt=Cr;function kr(r){return(0,I.IntNumber)(Number(BigInt(se(r,!0))))}u.intNumberFromHexString=kr;function Ir(r){return(0,I.HexString)(`0x${BigInt(r).toString(16)}`)}u.hexStringFromIntNumber=Ir;function Fe(r){return r.startsWith("0x")||r.startsWith("0X")}u.has0xPrefix=Fe;function ve(r){return Fe(r)?r.slice(2):r}u.strip0x=ve;function Rt(r){return Fe(r)?`0x${r.slice(2)}`:`0x${r}`}u.prepend0x=Rt;function ne(r){if(typeof r!="string")return!1;const e=ve(r).toLowerCase();return Lt.test(e)}u.isHexString=ne;function xt(r,e=!1){if(typeof r=="string"){const t=ve(r).toLowerCase();if(Lt.test(t))return(0,I.HexString)(e?`0x${t}`:t)}throw q.standardErrors.rpc.invalidParams(`"${String(r)}" is not a hexadecimal string`)}u.ensureHexString=xt;function se(r,e=!1){let t=xt(r,!1);return t.length%2===1&&(t=(0,I.HexString)(`0${t}`)),e?(0,I.HexString)(`0x${t}`):t}u.ensureEvenLengthHexString=se;function Mr(r){if(typeof r=="string"){const e=ve(r).toLowerCase();if(ne(e)&&e.length===40)return(0,I.AddressString)(Rt(e))}throw q.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(r)}`)}u.ensureAddressString=Mr;function Lr(r){if(Buffer.isBuffer(r))return r;if(typeof r=="string"){if(ne(r)){const e=se(r,!1);return Buffer.from(e,"hex")}return Buffer.from(r,"utf8")}throw q.standardErrors.rpc.invalidParams(`Not binary data: ${String(r)}`)}u.ensureBuffer=Lr;function Pt(r){if(typeof r=="number"&&Number.isInteger(r))return(0,I.IntNumber)(r);if(typeof r=="string"){if(Mt.test(r))return(0,I.IntNumber)(Number(r));if(ne(r))return(0,I.IntNumber)(Number(BigInt(se(r,!0))))}throw q.standardErrors.rpc.invalidParams(`Not an integer: ${String(r)}`)}u.ensureIntNumber=Pt;function Ar(r){if(r instanceof RegExp)return(0,I.RegExpString)(r.toString());throw q.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(r)}`)}u.ensureRegExpString=Ar;function Rr(r){if(r!==null&&(typeof r=="bigint"||Nt(r)))return BigInt(r.toString(10));if(typeof r=="number")return BigInt(Pt(r));if(typeof r=="string"){if(Mt.test(r))return BigInt(r);if(ne(r))return BigInt(se(r,!0))}throw q.standardErrors.rpc.invalidParams(`Not an integer: ${String(r)}`)}u.ensureBigInt=Rr;function xr(r){if(typeof r=="string")return JSON.parse(r);if(typeof r=="object")return r;throw q.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(r)}`)}u.ensureParsedJSONObject=xr;function Nt(r){if(r==null||typeof r.constructor!="function")return!1;const{constructor:e}=r;return typeof e.config=="function"&&typeof e.EUCLID=="number"}u.isBigNumber=Nt;function Pr(r,e){return Array.from({length:e-r},(t,n)=>r+n)}u.range=Pr;function Nr(){const r=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:t}=document.location,n=r?r.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${t}${n}`}u.getFavicon=Nr;function Tr(r,e){return r.length===e.length&&r.every((t,n)=>t===e[n])}u.areAddressArraysEqual=Tr;var P={},_e={},Ee={},y={};Object.defineProperty(y,"__esModule",{value:!0});y.decryptContent=y.encryptContent=y.importKeyFromHexString=y.exportKeyToHexString=y.decrypt=y.encrypt=y.deriveSharedSecret=y.generateKeyPair=void 0;const Tt=u;async function jr(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}y.generateKeyPair=jr;async function Or(r,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},r,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}y.deriveSharedSecret=Or;async function jt(r,e){const t=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:t},r,new TextEncoder().encode(e));return{iv:t,cipherText:n}}y.encrypt=jt;async function Ot(r,{iv:e,cipherText:t}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},r,t);return new TextDecoder().decode(n)}y.decrypt=Ot;function Dt(r){switch(r){case"public":return"spki";case"private":return"pkcs8"}}async function Dr(r,e){const t=Dt(r),n=await crypto.subtle.exportKey(t,e);return(0,Tt.uint8ArrayToHex)(new Uint8Array(n))}y.exportKeyToHexString=Dr;async function Wr(r,e){const t=Dt(r),n=(0,Tt.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(t,n,{name:"ECDH",namedCurve:"P-256"},!0,r==="private"?["deriveKey"]:[])}y.importKeyFromHexString=Wr;async function Ur(r,e){const t=JSON.stringify(r,(n,s)=>{if(!(s instanceof Error))return s;const i=s;return Object.assign(Object.assign({},i.code?{code:i.code}:{}),{message:i.message})});return jt(e,t)}y.encryptContent=Ur;async function Br(r,e){return JSON.parse(await Ot(e,r))}y.decryptContent=Br;var O={};Object.defineProperty(O,"__esModule",{value:!0});O.ScopedLocalStorage=void 0;class fe{constructor(e,t){this.scope=e,this.module=t}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),t=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new fe("CBWSDK").clear(),new fe("walletlink").clear()}}O.ScopedLocalStorage=fe;Object.defineProperty(Ee,"__esModule",{value:!0});Ee.SCWKeyManager=void 0;const oe=y,Hr=O,De={storageKey:"ownPrivateKey",keyType:"private"},We={storageKey:"ownPublicKey",keyType:"public"},Ue={storageKey:"peerPublicKey",keyType:"public"};class Kr{constructor(){this.storage=new Hr.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(Ue,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(We.storageKey),this.storage.removeItem(De.storageKey),this.storage.removeItem(Ue.storageKey)}async generateKeyPair(){const e=await(0,oe.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(De,e.privateKey),await this.storeKey(We,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(De)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(We)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(Ue)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,oe.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const t=this.storage.getItem(e.storageKey);return t?(0,oe.importKeyFromHexString)(e.keyType,t):null}async storeKey(e,t){const n=await(0,oe.exportKeyToHexString)(e.keyType,t);this.storage.setItem(e.storageKey,n)}}Ee.SCWKeyManager=Kr;var Se={};Object.defineProperty(Se,"__esModule",{value:!0});Se.SCWStateManager=void 0;const qr=O,Qe="accounts",Xe="activeChain",et="availableChains",tt="walletCapabilities";class $r{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var t,n;this.storage=new qr.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(et),this._walletCapabilities=this.loadItemFromStorage(tt);const s=this.loadItemFromStorage(Qe),i=this.loadItemFromStorage(Xe);s&&this.updateListener.onAccountsUpdate({accounts:s,source:"storage"}),i&&this.updateListener.onChainUpdate({chain:i,source:"storage"}),this._accounts=s||[],this._activeChain=i||{id:(n=(t=e.appChainIds)===null||t===void 0?void 0:t[0])!==null&&n!==void 0?n:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(Qe,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var t;const n=(t=this.availableChains)===null||t===void 0?void 0:t.find(s=>s.id===e);return n?(n===this._activeChain||(this._activeChain=n,this.storeItemToStorage(Xe,n),this.updateListener.onChainUpdate({chain:n,source:"wallet"})),!0):!1}updateAvailableChains(e){if(!e||Object.keys(e).length===0)return;const t=Object.entries(e).map(([n,s])=>({id:Number(n),rpcUrl:s}));this.availableChains=t,this.storeItemToStorage(et,t),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(tt,e)}storeItemToStorage(e,t){this.storage.setItem(e,JSON.stringify(t))}loadItemFromStorage(e){const t=this.storage.getItem(e);return t?JSON.parse(t):void 0}clear(){this.storage.clear()}}Se.SCWStateManager=$r;Object.defineProperty(_e,"__esModule",{value:!0});_e.SCWSigner=void 0;const Fr=Ee,zr=Se,ce=j,rt=u,de=y;class Vr{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new Fr.SCWKeyManager,this.stateManager=new zr.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),t=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in t.content)throw t.content.failure;const n=await(0,de.importKeyFromHexString)("public",t.sender);await this.keyManager.setPeerPublicKey(n);const s=await this.decryptResponseMessage(t);this.updateInternalState({method:"eth_requestAccounts"},s);const i=s.result;if("error"in i)throw i.error;return this.stateManager.accounts}async request(e){const t=this.tryLocalHandling(e);if(t!==void 0){if(t instanceof Error)throw t;return t}await this.communicator.waitForPopupLoaded();const n=await this.sendEncryptedRequest(e),s=await this.decryptResponseMessage(n);this.updateInternalState(e,s);const i=s.result;if("error"in i)throw i.error;return i.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var t;switch(e.method){case"wallet_switchEthereumChain":{const n=e.params;if(!n||!(!((t=n[0])===null||t===void 0)&&t.chainId))throw ce.standardErrors.rpc.invalidParams();const s=(0,rt.ensureIntNumber)(n[0].chainId);return this.stateManager.switchChain(s)?null:void 0}case"wallet_getCapabilities":{const n=this.stateManager.walletCapabilities;if(!n)throw ce.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return n}default:return}}async sendEncryptedRequest(e){const t=await this.keyManager.getSharedSecret();if(!t)throw ce.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await(0,de.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},t),s=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(s)}async createRequestMessage(e){const t=await(0,de.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){const t=e.content;if("failure"in t)throw t.failure;const n=await this.keyManager.getSharedSecret();if(!n)throw ce.standardErrors.provider.unauthorized("Invalid session");return(0,de.decryptContent)(t.encrypted,n)}updateInternalState(e,t){var n,s;const i=(n=t.data)===null||n===void 0?void 0:n.chains;i&&this.stateManager.updateAvailableChains(i);const a=(s=t.data)===null||s===void 0?void 0:s.capabilities;a&&this.stateManager.updateWalletCapabilities(a);const o=t.result;if(!("error"in o))switch(e.method){case"eth_requestAccounts":{const c=o.value;this.stateManager.updateAccounts(c);break}case"wallet_switchEthereumChain":{if(o.value!==null)return;const c=e.params,l=(0,rt.ensureIntNumber)(c[0].chainId);this.stateManager.switchChain(l);break}}}}_e.SCWSigner=Vr;var Ce={};const Zr=ar;function Wt(r){return Buffer.allocUnsafe(r).fill(0)}function Gr(r){return r.toString(2).length}function Ut(r,e){let t=r.toString(16);t.length%2!==0&&(t="0"+t);const n=t.match(/.{1,2}/g).map(s=>parseInt(s,16));for(;n.length"u")throw new Error("Not an array?");if(t=Ft(r),t!=="dynamic"&&t!==0&&e.length>t)throw new Error("Elements exceed array size: "+t);s=[],r=r.slice(0,r.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(i in e)s.push(R(r,e[i]));if(t==="dynamic"){var a=R("uint256",e.length);s.unshift(a)}return Buffer.concat(s)}else{if(r==="bytes")return e=new Buffer(e),s=Buffer.concat([R("uint256",e.length),e]),e.length%32!==0&&(s=Buffer.concat([s,E.zeros(32-e.length%32)])),s;if(r.startsWith("bytes")){if(t=G(r),t<1||t>32)throw new Error("Invalid bytes width: "+t);return E.setLengthRight(e,32)}else if(r.startsWith("uint")){if(t=G(r),t%8||t<8||t>256)throw new Error("Invalid uint width: "+t);n=H(e);const o=E.bitLengthFromBigInt(n);if(o>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+o);if(n<0)throw new Error("Supplied uint is negative");return E.bufferBEFromBigInt(n,32)}else if(r.startsWith("int")){if(t=G(r),t%8||t<8||t>256)throw new Error("Invalid int width: "+t);n=H(e);const o=E.bitLengthFromBigInt(n);if(o>t)throw new Error("Supplied int exceeds width: "+t+" vs "+o);const c=E.twosFromBigInt(n,256);return E.bufferBEFromBigInt(c,32)}else if(r.startsWith("ufixed")){if(t=nt(r),n=H(e),n<0)throw new Error("Supplied ufixed is negative");return R("uint256",n*BigInt(2)**BigInt(t[1]))}else if(r.startsWith("fixed"))return t=nt(r),R("int256",H(e)*BigInt(2)**BigInt(t[1]))}throw new Error("Unsupported or invalid type: "+r)}function tn(r){return r==="string"||r==="bytes"||Ft(r)==="dynamic"}function rn(r){return r.lastIndexOf("]")===r.length-1}function nn(r,e){var t=[],n=[],s=32*r.length;for(var i in r){var a=$t(r[i]),o=e[i],c=R(a,o);tn(a)?(t.push(R("uint256",s)),n.push(c),s+=c.length):t.push(c)}return Buffer.concat(t.concat(n))}function zt(r,e){if(r.length!==e.length)throw new Error("Number of types are not matching the values");for(var t,n,s=[],i=0;i32)throw new Error("Invalid bytes width: "+t);s.push(E.setLengthRight(o,t))}else if(a.startsWith("uint")){if(t=G(a),t%8||t<8||t>256)throw new Error("Invalid uint width: "+t);n=H(o);const c=E.bitLengthFromBigInt(n);if(c>t)throw new Error("Supplied uint exceeds width: "+t+" vs "+c);s.push(E.bufferBEFromBigInt(n,t/8))}else if(a.startsWith("int")){if(t=G(a),t%8||t<8||t>256)throw new Error("Invalid int width: "+t);n=H(o);const c=E.bitLengthFromBigInt(n);if(c>t)throw new Error("Supplied int exceeds width: "+t+" vs "+c);const l=E.twosFromBigInt(n,t);s.push(E.bufferBEFromBigInt(l,t/8))}else throw new Error("Unsupported or invalid type: "+a)}return Buffer.concat(s)}function sn(r,e){return E.keccak(zt(r,e))}var an={rawEncode:nn,solidityPack:zt,soliditySHA3:sn};const A=qt,ee=an,Vt={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Be={encodeData(r,e,t,n=!0){const s=["bytes32"],i=[this.hashType(r,t)];if(n){const a=(o,c,l)=>{if(t[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":A.keccak(this.encodeData(c,l,t,n))];if(l===void 0)throw new Error(`missing value for field ${o} of type ${c}`);if(c==="bytes")return["bytes32",A.keccak(l)];if(c==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",A.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const h=c.slice(0,c.lastIndexOf("[")),f=l.map(d=>a(o,h,d));return["bytes32",A.keccak(ee.rawEncode(f.map(([d])=>d),f.map(([,d])=>d)))]}return[c,l]};for(const o of t[r]){const[c,l]=a(o.name,o.type,e[o.name]);s.push(c),i.push(l)}}else for(const a of t[r]){let o=e[a.name];if(o!==void 0)if(a.type==="bytes")s.push("bytes32"),o=A.keccak(o),i.push(o);else if(a.type==="string")s.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=A.keccak(o),i.push(o);else if(t[a.type]!==void 0)s.push("bytes32"),o=A.keccak(this.encodeData(a.type,o,t,n)),i.push(o);else{if(a.type.lastIndexOf("]")===a.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");s.push(a.type),i.push(o)}}return ee.rawEncode(s,i)},encodeType(r,e){let t="",n=this.findTypeDependencies(r,e).filter(s=>s!==r);n=[r].concat(n.sort());for(const s of n){if(!e[s])throw new Error("No type definition specified: "+s);t+=s+"("+e[s].map(({name:a,type:o})=>o+" "+a).join(",")+")"}return t},findTypeDependencies(r,e,t=[]){if(r=r.match(/^\w*/)[0],t.includes(r)||e[r]===void 0)return t;t.push(r);for(const n of e[r])for(const s of this.findTypeDependencies(n.type,e,t))!t.includes(s)&&t.push(s);return t},hashStruct(r,e,t,n=!0){return A.keccak(this.encodeData(r,e,t,n))},hashType(r,e){return A.keccak(this.encodeType(r,e))},sanitizeData(r){const e={};for(const t in Vt.properties)r[t]&&(e[t]=r[t]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(r,e=!0){const t=this.sanitizeData(r),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",t.domain,t.types,e)),t.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(t.primaryType,t.message,t.types,e)),A.keccak(Buffer.concat(n))}};var on={TYPED_MESSAGE_SCHEMA:Vt,TypedDataUtils:Be,hashForSignTypedDataLegacy:function(r){return cn(r.data)},hashForSignTypedData_v3:function(r){return Be.hash(r.data,!1)},hashForSignTypedData_v4:function(r){return Be.hash(r.data)}};function cn(r){const e=new Error("Expect argument to be non-empty array");if(typeof r!="object"||!r.length)throw e;const t=r.map(function(i){return i.type==="bytes"?A.toBuffer(i.value):i.value}),n=r.map(function(i){return i.type}),s=r.map(function(i){if(!i.name)throw e;return i.type+" "+i.name});return ee.soliditySHA3(["bytes32","bytes32"],[ee.soliditySHA3(new Array(r.length).fill("string"),s),ee.soliditySHA3(n,t)])}var N={};Object.defineProperty(N,"__esModule",{value:!0});N.APP_VERSION_KEY=N.LOCAL_STORAGE_ADDRESSES_KEY=N.WALLET_USER_NAME_KEY=void 0;N.WALLET_USER_NAME_KEY="walletUsername";N.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";N.APP_VERSION_KEY="AppVersion";var ie={};Object.defineProperty(ie,"__esModule",{value:!0});ie.RelayEventManager=void 0;const dn=u;class ln{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=(0,dn.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}ie.RelayEventManager=ln;var Ie={},Me={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.WalletLinkCipher=void 0;const le=u;class un{constructor(e){this.secret=e}async encrypt(e){const t=this.secret;if(t.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.importKey("raw",(0,le.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,a=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},s,i.encode(e)),o=16,c=a.slice(a.byteLength-o),l=a.slice(0,a.byteLength-o),h=new Uint8Array(c),f=new Uint8Array(l),d=new Uint8Array([...n,...h,...f]);return(0,le.uint8ArrayToHex)(d)}async decrypt(e){const t=this.secret;if(t.length!==64)throw Error("secret must be 256 bits");return new Promise((n,s)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,le.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=(0,le.hexStringToUint8Array)(e),o=a.slice(0,12),c=a.slice(12,28),l=a.slice(28),h=new Uint8Array([...l,...c]),f={name:"AES-GCM",iv:new Uint8Array(o)};try{const d=await window.crypto.subtle.decrypt(f,i,h),p=new TextDecoder;n(p.decode(d))}catch(d){s(d)}})()})}}Le.WalletLinkCipher=un;var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.WalletLinkHTTP=void 0;class hn{constructor(e,t,n){this.linkAPIUrl=e,this.sessionId=t;const s=`${t}:${n}`;this.auth=`Basic ${btoa(s)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(t=>fetch(`${this.linkAPIUrl}/events/${t.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(t=>console.error("Unabled to mark event as failed:",t))}async fetchUnseenEvents(){var e;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:n,error:s}=await t.json();if(s)throw new Error(`Check unseen events failed: ${s}`);const i=(e=n==null?void 0:n.filter(a=>a.event==="Web3Response").map(a=>({type:"Event",sessionId:this.sessionId,eventId:a.id,event:a.event,data:a.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(i),i}throw new Error(`Check unseen events failed: ${t.status}`)}}Ae.WalletLinkHTTP=hn;var Y={};Object.defineProperty(Y,"__esModule",{value:!0});Y.WalletLinkWebSocket=Y.ConnectionState=void 0;var Z;(function(r){r[r.DISCONNECTED=0]="DISCONNECTED",r[r.CONNECTING=1]="CONNECTING",r[r.CONNECTED=2]="CONNECTED"})(Z||(Y.ConnectionState=Z={}));class gn{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,t)=>{var n;let s;try{this.webSocket=s=new this.WebSocketClass(this.url)}catch(i){t(i);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Z.CONNECTING),s.onclose=i=>{var a;this.clearWebSocket(),t(new Error(`websocket error ${i.code}: ${i.reason}`)),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Z.DISCONNECTED)},s.onopen=i=>{var a;e(),(a=this.connectionStateListener)===null||a===void 0||a.call(this,Z.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(c=>this.sendData(c)),this.pendingData=[])},s.onmessage=i=>{var a,o;if(i.data==="h")(a=this.incomingDataListener)===null||a===void 0||a.call(this,{type:"Heartbeat"});else try{const c=JSON.parse(i.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,c)}catch{}}})}disconnect(){var e;const{webSocket:t}=this;if(t){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Z.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch{}}}sendData(e){const{webSocket:t}=this;if(!t){this.pendingData.push(e),this.connect();return}t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}Y.WalletLinkWebSocket=gn;Object.defineProperty(Me,"__esModule",{value:!0});Me.WalletLinkConnection=void 0;const st=N,pn=Le,fn=Ae,ue=Y,F=_,it=1e4,mn=6e4;class bn{constructor({session:e,linkAPIUrl:t,listener:n,WebSocketClass:s=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,F.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=a=>{if(!a)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",c=>a.JsonRpcUrl&&this.handleChainUpdated(c,a.JsonRpcUrl)]]).forEach((c,l)=>{const h=a[l];h!==void 0&&c(h)})},this.handleDestroyed=a=>{var o;a==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async a=>{var o;{const c=await this.cipher.decrypt(a);(o=this.listener)===null||o===void 0||o.accountUpdated(c)}},this.handleMetadataUpdated=async(a,o)=>{var c;{const l=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.metadataUpdated(a,l)}},this.handleWalletUsernameUpdated=async a=>{this.handleMetadataUpdated(st.WALLET_USER_NAME_KEY,a)},this.handleAppVersionUpdated=async a=>{this.handleMetadataUpdated(st.APP_VERSION_KEY,a)},this.handleChainUpdated=async(a,o)=>{var c;{const l=await this.cipher.decrypt(a),h=await this.cipher.decrypt(o);(c=this.listener)===null||c===void 0||c.chainUpdated(l,h)}},this.session=e,this.cipher=new pn.WalletLinkCipher(e.secret),this.listener=n;const i=new ue.WalletLinkWebSocket(`${t}/rpc`,s);i.setConnectionStateListener(async a=>{let o=!1;switch(a){case ue.ConnectionState.DISCONNECTED:if(!this.destroyed){const c=async()=>{await new Promise(l=>setTimeout(l,5e3)),this.destroyed||i.connect().catch(()=>{c()})};c()}break;case ue.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),o=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},it),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case ue.ConnectionState.CONNECTING:break}this.connected!==o&&(this.connected=o)}),i.setIncomingDataListener(a=>{var o;switch(a.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const c=a.type==="IsLinkedOK"?a.linked:void 0;this.linked=c||a.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(a.metadata);break}case"Event":{this.handleIncomingEvent(a);break}}a.id!==void 0&&((o=this.requestResolutions.get(a.id))===null||o===void 0||o(a))}),this.ws=i,this.http=new fn.WalletLinkHTTP(t,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var t;this._connected=e,e&&((t=this.onceConnected)===null||t===void 0||t.call(this))}setOnceConnected(e){return new Promise(t=>{this.connected?e().then(t):this.onceConnected=()=>{e().then(t),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var t,n;this._linked=e,e&&((t=this.onceLinked)===null||t===void 0||t.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t;if(!(e.type!=="Event"||e.event!=="Web3Response")){const n=await this.cipher.decrypt(e.data),s=JSON.parse(n);if(s.type!=="WEB3_RESPONSE")return;(t=this.listener)===null||t===void 0||t.handleWeb3ResponseMessage(s)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(t=>this.handleIncomingEvent(t))}async setSessionMetadata(e,t){const n={type:"SetSessionConfig",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:t}};return this.setOnceConnected(async()=>{const s=await this.makeRequest(n);if(s.type==="Fail")throw new Error(s.error||"failed to set session metadata")})}async publishEvent(e,t,n=!1){const s=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:s,callWebhook:n};return this.setOnceLinked(async()=>{const a=await this.makeRequest(i);if(a.type==="Fail")throw new Error(a.error||"failed to publish event");return a.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>it*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,t=mn){const n=e.id;this.sendData(e);let s;return Promise.race([new Promise((i,a)=>{s=window.setTimeout(()=>{a(new Error(`request ${n} timed out`))},t)}),new Promise(i=>{this.requestResolutions.set(n,a=>{clearTimeout(s),i(a),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},t=await this.makeRequest(e);if(t.type==="Fail")throw new Error(t.error||"failed to authenticate")}sendIsLinked(){const e={type:"IsLinked",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,F.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}Me.WalletLinkConnection=bn;var Re={};Object.defineProperty(Re,"__esModule",{value:!0});Re.WalletLinkSession=void 0;const yn=or,at=u,ot="session:id",ct="session:secret",dt="session:linked";class ze{constructor(e,t,n,s){this._storage=e,this._id=t||(0,at.randomBytesHex)(16),this._secret=n||(0,at.randomBytesHex)(32),this._key=new yn.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(e){const t=e.getItem(ot),n=e.getItem(dt),s=e.getItem(ct);return t&&s?new ze(e,t,s,n==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(ot,this._id),this._storage.setItem(ct,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(dt,this._linked?"1":"0")}}Re.WalletLinkSession=ze;var S={};Object.defineProperty(S,"__esModule",{value:!0});S.isDarkMode=S.isMobileWeb=S.getLocation=S.createQrUrl=void 0;function wn(r,e,t,n,s,i){const a=n?"parent-id":"id",o=new URLSearchParams({[a]:r,secret:e,server:t,v:s,chainId:i.toString()}).toString();return`${t}/#/link?${o}`}S.createQrUrl=wn;function vn(){try{return window.frameElement!==null}catch{return!1}}function _n(){try{return vn()&&window.top?window.top.location:window.location}catch{return window.location}}S.getLocation=_n;function En(){var r;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((r=window==null?void 0:window.navigator)===null||r===void 0?void 0:r.userAgent)}S.isMobileWeb=En;function Sn(){var r,e;return(e=(r=window==null?void 0:window.matchMedia)===null||r===void 0?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}S.isDarkMode=Sn;var xe={},ae={},Ve={};Object.defineProperty(Ve,"__esModule",{value:!0});Ve.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var Cn=M&&M.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ae,"__esModule",{value:!0});ae.injectCssReset=void 0;const kn=Cn(Ve);function In(){const r=document.createElement("style");r.type="text/css",r.appendChild(document.createTextNode(kn.default)),document.documentElement.appendChild(r)}ae.injectCssReset=In;var Ze={};function Zt(r){var e,t,n="";if(typeof r=="string"||typeof r=="number")n+=r;else if(typeof r=="object")if(Array.isArray(r))for(e=0;e{this.items.delete(m),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(r.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([p,m])=>(0,n.h)(r.SnackbarInstance,Object.assign({},m,{key:p}))))),this.root)}}r.Snackbar=l;const h=d=>(0,n.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,a.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},d.children));r.SnackbarContainer=h;const f=({autoExpand:d,message:p,menuItems:m})=>{const[B,tr]=(0,s.useState)(!0),[Oe,Je]=(0,s.useState)(d??!1);(0,s.useEffect)(()=>{const L=[window.setTimeout(()=>{tr(!1)},1),window.setTimeout(()=>{Je(!0)},1e4)];return()=>{L.forEach(window.clearTimeout)}});const rr=()=>{Je(!Oe)};return(0,n.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance",B&&"-cbwsdk-snackbar-instance-hidden",Oe&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:rr},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},p),(0,n.h)("div",{class:"-gear-container"},!Oe&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:c,class:"-gear-icon",title:"Expand"}))),m&&m.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},m.map((L,nr)=>(0,n.h)("div",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:L.onClick,key:nr},(0,n.h)("svg",{width:L.svgWidth,height:L.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":L.defaultFillRule,"clip-rule":L.defaultClipRule,d:L.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,t.default)("-cbwsdk-snackbar-instance-menu-item-info",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},L.info)))))};r.SnackbarInstance=f})(Ze);Object.defineProperty(xe,"__esModule",{value:!0});xe.WalletLinkRelayUI=void 0;const Ln=ae,An=Ze;class Rn{constructor(){this.attached=!1,this.snackbar=new An.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,(0,Ln.injectCssReset)()}showConnecting(e){let t;return e.isUnlinkedErrorState?t={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:t={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}xe.WalletLinkRelayUI=Rn;var Pe={},Ne={},Ye={};Object.defineProperty(Ye,"__esModule",{value:!0});Ye.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Yt=M&&M.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ne,"__esModule",{value:!0});Ne.RedirectDialog=void 0;const xn=Yt(Gt),x=_t,Pn=ae,Nn=Ze,Tn=S,jn=Yt(Ye);class On{constructor(){this.root=null,this.darkMode=(0,Tn.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,Pn.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,x.render)(null,this.root),e&&(0,x.render)((0,x.h)(Dn,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}Ne.RedirectDialog=On;const Dn=({title:r,buttonText:e,darkMode:t,onButtonClick:n,onDismiss:s})=>{const i=t?"dark":"light";return(0,x.h)(Nn.SnackbarContainer,{darkMode:t},(0,x.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,x.h)("style",null,jn.default),(0,x.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),(0,x.h)("div",{class:(0,xn.default)("-cbwsdk-redirect-dialog-box",i)},(0,x.h)("p",null,r),(0,x.h)("button",{onClick:n},e))))};var T={};Object.defineProperty(T,"__esModule",{value:!0});T.CBW_MOBILE_DEEPLINK_URL=T.WALLETLINK_URL=T.CB_KEYS_URL=void 0;T.CB_KEYS_URL="https://keys.coinbase.com/connect";T.WALLETLINK_URL="https://www.walletlink.org";T.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.WLMobileRelayUI=void 0;const Wn=Ne,Un=S,Bn=T;class Hn{constructor(){this.attached=!1,this.redirectDialog=new Wn.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const t=new URL(Bn.CBW_MOBILE_DEEPLINK_URL);t.searchParams.append("redirect_url",(0,Un.getLocation)().href),e&&t.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=t.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}Pe.WLMobileRelayUI=Hn;Object.defineProperty(Ie,"__esModule",{value:!0});Ie.WalletLinkRelay=void 0;const Kn=Me,qn=N,$n=ie,He=Re,z=Q,Fn=S,zn=xe,ut=Pe,Vn=j,b=u,Zn=O;class W{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,Fn.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=i=>{this.isLinked=i;const a=this.storage.getItem(qn.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this._session.linked=i),this.isUnlinkedErrorState=!1,a){const o=a.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!i&&this._session.linked&&!c&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(i,a)=>{this.storage.setItem(i,a)},this.chainUpdated=(i,a)=>{this.chainCallbackParams.chainId===i&&this.chainCallbackParams.jsonRpcUrl===a||(this.chainCallbackParams={chainId:i,jsonRpcUrl:a},this.chainCallback&&this.chainCallback(i,a))},this.accountUpdated=i=>{this.accountsCallback&&this.accountsCallback([i]),W.accountRequestCallbackIds.size>0&&(Array.from(W.accountRequestCallbackIds.values()).forEach(a=>{const o={type:"WEB3_RESPONSE",id:a,response:{method:"requestEthereumAccounts",result:[i]}};this.invokeCallback(Object.assign(Object.assign({},o),{id:a}))}),W.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;const{session:t,ui:n,connection:s}=this.subscribe();this._session=t,this.connection=s,this.relayEventManager=new $n.RelayEventManager,this.ui=n}subscribe(){const e=He.WalletLinkSession.load(this.storage)||new He.WalletLinkSession(this.storage).save(),{linkAPIUrl:t}=this,n=new Kn.WalletLinkConnection({session:e,linkAPIUrl:t,listener:this}),s=this.isMobileWeb?new ut.WLMobileRelayUI:new zn.WalletLinkRelayUI;return n.connect(),{session:e,ui:s,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{this.connection.destroy();const e=He.WalletLinkSession.load(this.storage);(e==null?void 0:e.id)===this._session.id&&Zn.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(e=>{})}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,n,s){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,b.hexStringFromBuffer)(e,!0),address:t,addPrefix:n,typedDataJson:s||null}})}ethereumAddressFromSignedMessage(e,t,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,b.hexStringFromBuffer)(e,!0),signature:(0,b.hexStringFromBuffer)(t,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,b.bigIntStringFromBigInt)(e.weiValue),data:(0,b.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,b.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,b.bigIntStringFromBigInt)(e.weiValue),data:(0,b.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,b.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,b.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,b.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,b.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,b.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,t){return this.sendRequest({method:"generic",params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null;const n=(0,b.randomBytesHex)(8),s=i=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,i),t==null||t()};return new Promise((i,a)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:s,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,o=>{if(t==null||t(),(0,z.isErrorResponse)(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(n,e)})}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,t){const n={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",n,!0).then(s=>{}).catch(s=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n.id,response:{method:t.method,errorMessage:s.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof ut.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const t={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",t,!1).then()}publishEvent(e,t,n){return this.connection.publishEvent(e,t,n)}handleWeb3ResponseMessage(e){const{response:t}=e;if(t.method==="requestEthereumAccounts"){W.accountRequestCallbackIds.forEach(n=>this.invokeCallback(Object.assign(Object.assign({},e),{id:n}))),W.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,t,n){var s;const i=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:t,errorMessage:i}})}invokeCallback(e){const t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,b.randomBytesHex)(8);return new Promise((n,s)=>{this.relayEventManager.callbacks.set(t,i=>{if((0,z.isErrorResponse)(i))return s(new Error(i.errorMessage));n(i)}),W.accountRequestCallbackIds.add(t),this.publishWeb3RequestEvent(t,e)})}watchAsset(e,t,n,s,i,a){const o={method:"watchAsset",params:{type:e,options:{address:t,symbol:n,decimals:s,image:i},chainId:a}};let c=null;const l=(0,b.randomBytesHex)(8),h=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,f),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}),new Promise((f,d)=>{this.relayEventManager.callbacks.set(l,p=>{if(c==null||c(),(0,z.isErrorResponse)(p))return d(new Error(p.errorMessage));f(p)}),this.publishWeb3RequestEvent(l,o)})}addEthereumChain(e,t,n,s,i,a){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:s,chainName:i,iconUrls:n,nativeCurrency:a}};let c=null;const l=(0,b.randomBytesHex)(8),h=f=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,o.method,f),c==null||c()};return c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:h,onResetConnection:this.resetAndReload}),new Promise((f,d)=>{this.relayEventManager.callbacks.set(l,p=>{if(c==null||c(),(0,z.isErrorResponse)(p))return d(new Error(p.errorMessage));f(p)}),this.publishWeb3RequestEvent(l,o)})}switchEthereumChain(e,t){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},s=(0,b.randomBytesHex)(8);return new Promise((i,a)=>{this.relayEventManager.callbacks.set(s,o=>{if((0,z.isErrorResponse)(o)&&o.errorCode)return a(Vn.standardErrors.provider.custom({code:o.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,z.isErrorResponse)(o))return a(new Error(o.errorMessage));i(o)}),this.publishWeb3RequestEvent(s,n)})}}Ie.WalletLinkRelay=W;W.accountRequestCallbackIds=new Set;var Gn=M&&M.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.WalletLinkSigner=void 0;const Ke=Gn(on),ht=N,Yn=ie,D=Q,Jn=Ie,gt=T,w=j,g=u,Qn=O,qe="DefaultChainId",pt="DefaultJsonRpcUrl";class Xn{constructor(e){var t,n;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:s,appLogoUrl:i}=e.metadata;this._appName=s,this._appLogoUrl=i,this._storage=new Qn.ScopedLocalStorage("walletlink",gt.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new Yn.RelayEventManager,this._jsonRpcUrlFromOpts="";const a=this._storage.getItem(ht.LOCAL_STORAGE_ADDRESSES_KEY);if(a){const c=a.split(" ");c[0]!==""&&(this._addresses=c.map(l=>(0,g.ensureAddressString)(l)),(t=this.updateListener)===null||t===void 0||t.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(qe)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:t,secret:n}=e.getWalletLinkSession();return{id:t,secret:n}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(pt))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(pt,e)}updateProviderInfo(e,t){var n;this.jsonRpcUrl=e;const s=this.getChainId();this._storage.setItem(qe,t.toString(10)),((0,g.ensureIntNumber)(t)!==s||!this.hasMadeFirstChainChangedEmission)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:t,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,n,s,i,a){const c=await this.initializeRelay().watchAsset(e,t,n,s,i,a==null?void 0:a.toString());return(0,D.isErrorResponse)(c)?!1:!!c.result}async addEthereumChain(e,t,n,s,i,a){var o,c;if((0,g.ensureIntNumber)(e)===this.getChainId())return!1;const l=this.initializeRelay();this._isAuthorized()||await l.requestEthereumAccounts();const h=await l.addEthereumChain(e.toString(),t,i,n,s,a);return(0,D.isErrorResponse)(h)?!1:(((o=h.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(t[0],e),((c=h.result)===null||c===void 0?void 0:c.isApproved)===!0)}async switchEthereumChain(e){const n=await this.initializeRelay().switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,D.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===w.standardErrorCodes.provider.unsupportedChain?w.standardErrors.provider.unsupportedChain():w.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const s=n.result;s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch(t=>{throw t})}catch(t){return Promise.reject(t)}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw w.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:n}=e;if(typeof t!="string"||t.length===0)throw w.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw w.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const s=n===void 0?[]:n,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:s,jsonrpc:"2.0",id:i})).result}_setAddresses(e,t){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const s=e.map(i=>(0,g.ensureAddressString)(i));JSON.stringify(s)!==JSON.stringify(this._addresses)&&(this._addresses=s,(n=this.updateListener)===null||n===void 0||n.onAccountsUpdate({accounts:s,source:"wallet"}),this._storage.setItem(ht.LOCAL_STORAGE_ADDRESSES_KEY,s.join(" ")))}_sendRequestAsync(e){return new Promise((t,n)=>{try{const s=this._handleSynchronousMethods(e);if(s!==void 0)return t({jsonrpc:"2.0",id:e.id,result:s})}catch(s){return n(s)}this._handleAsynchronousMethods(e).then(s=>s&&t(Object.assign(Object.assign({},s),{id:e.id}))).catch(s=>n(s))})}_handleSynchronousMethods(e){const{method:t}=e;switch(t){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:t}=e,n=e.params||[];switch(t){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(e){try{const t=(0,g.ensureAddressString)(e);return this._addresses.map(s=>(0,g.ensureAddressString)(s)).includes(t)}catch{}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?(0,g.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);const n=e.to?(0,g.ensureAddressString)(e.to):null,s=e.value!=null?(0,g.ensureBigInt)(e.value):BigInt(0),i=e.data?(0,g.ensureBuffer)(e.data):Buffer.alloc(0),a=e.nonce!=null?(0,g.ensureIntNumber)(e.nonce):null,o=e.gasPrice!=null?(0,g.ensureBigInt)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,g.ensureBigInt)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,g.ensureBigInt)(e.maxPriorityFeePerGas):null,h=e.gas!=null?(0,g.ensureBigInt)(e.gas):null,f=e.chainId?(0,g.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:t,toAddress:n,weiValue:s,data:i,nonce:a,gasPriceInWei:o,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:h,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw w.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw w.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,n,s){this._ensureKnownAddress(t);try{const a=await this.initializeRelay().signEthereumMessage(e,t,n,s);if((0,D.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}catch(i){throw typeof i.message=="string"&&i.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied message signature"):i}}async _ethereumAddressFromSignedMessage(e,t,n){const i=await this.initializeRelay().ethereumAddressFromSignedMessage(e,t,n);if((0,D.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,g.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(qe);if(!e)return(0,g.ensureIntNumber)(1);const t=parseInt(e,10);return(0,g.ensureIntNumber)(t)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{if(e=await this.initializeRelay().requestEthereumAccounts(),(0,D.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(t){throw typeof t.message=="string"&&t.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied account authorization"):t}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),n=(0,g.ensureBuffer)(e[1]);return this._signEthereumMessage(n,t,!1)}_eth_ecRecover(e){const t=(0,g.ensureBuffer)(e[0]),n=(0,g.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!1)}_personal_sign(e){this._requireAuthorization();const t=(0,g.ensureBuffer)(e[0]),n=(0,g.ensureAddressString)(e[1]);return this._signEthereumMessage(t,n,!0)}_personal_ecRecover(e){const t=(0,g.ensureBuffer)(e[0]),n=(0,g.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const s=await this.initializeRelay().signEthereumTransaction(t);if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const t=(0,g.ensureBuffer)(e[0]),s=await this.initializeRelay().submitEthereumTransaction(t,this.getChainId());if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}async _eth_sendTransaction(e){this._requireAuthorization();const t=this._prepareTransactionParams(e[0]||{});try{const s=await this.initializeRelay().signAndSubmitEthereumTransaction(t);if((0,D.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?w.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const t=(0,g.ensureParsedJSONObject)(e[0]),n=(0,g.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const s=Ke.default.hashForSignTypedDataLegacy({data:t}),i=JSON.stringify(t,null,2);return this._signEthereumMessage(s,n,!1,i)}async _eth_signTypedData_v3(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),n=(0,g.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const s=Ke.default.hashForSignTypedData_v3({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,t,!1,i)}async _eth_signTypedData_v4(e){this._requireAuthorization();const t=(0,g.ensureAddressString)(e[0]),n=(0,g.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);const s=Ke.default.hashForSignTypedData_v4({data:n}),i=JSON.stringify(n,null,2);return this._signEthereumMessage(s,t,!1,i)}async _wallet_addEthereumChain(e){var t,n,s,i;const a=e[0];if(((t=a.rpcUrls)===null||t===void 0?void 0:t.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!a.chainName||a.chainName.trim()==="")throw w.standardErrors.rpc.invalidParams("chainName is a required field");if(!a.nativeCurrency)throw w.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(a.chainId,16);return await this.addEthereumChain(o,(n=a.rpcUrls)!==null&&n!==void 0?n:[],(s=a.blockExplorerUrls)!==null&&s!==void 0?s:[],a.chainName,(i=a.iconUrls)!==null&&i!==void 0?i:[],a.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw w.standardErrors.rpc.invalidParams("Type is required");if((t==null?void 0:t.type)!=="ERC20")throw w.standardErrors.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(t!=null&&t.options))throw w.standardErrors.rpc.invalidParams("Options are required");if(!(t!=null&&t.options.address))throw w.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:s,symbol:i,image:a,decimals:o}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,s,i,o,a,n)}}initializeRelay(){if(!this._relay){const e=new Jn.WalletLinkRelay({linkAPIUrl:gt.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback((t,n)=>this._setAddresses(t,n)),e.setChainCallback((t,n)=>{this.updateProviderInfo(n,parseInt(t,10))}),this._relay=e}return this._relay}}Ce.WalletLinkSigner=Xn;var k={};Object.defineProperty(k,"__esModule",{value:!0});k.checkErrorForInvalidRequestArgs=k.getCoinbaseInjectedProvider=k.getCoinbaseInjectedSigner=k.fetchRPCRequest=void 0;const es=K,pe=j;async function ts(r,e){if(!e.rpcUrl)throw pe.standardErrors.rpc.internal("No RPC URL set for chain");const t=Object.assign(Object.assign({},r),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(e.rpcUrl,{method:"POST",body:JSON.stringify(t),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":es.LIB_VERSION}})).json()).result}k.fetchRPCRequest=ts;function Jt(){return globalThis.coinbaseWalletSigner}k.getCoinbaseInjectedSigner=Jt;function rs(){return globalThis.coinbaseWalletExtension}function ns(){var r,e;try{const t=globalThis;return(r=t.ethereum)!==null&&r!==void 0?r:(e=t.top)===null||e===void 0?void 0:e.ethereum}catch{return}}function ss({metadata:r,preference:e}){var t;if(e.options!=="smartWalletOnly"){if(Jt())return;const i=rs();if(i){const{appName:a,appLogoUrl:o,appChainIds:c}=r;return(t=i.setAppInfo)===null||t===void 0||t.call(i,a,o,c),i}}const n=ns();if(n!=null&&n.isCoinbaseBrowser)return n}k.getCoinbaseInjectedProvider=ss;function is(r){if(!r||typeof r!="object"||Array.isArray(r))return pe.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:r});const{method:e,params:t}=r;if(typeof e!="string"||e.length===0)return pe.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:r});if(t!==void 0&&!Array.isArray(t)&&(typeof t!="object"||t===null))return pe.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:r})}k.checkErrorForInvalidRequestArgs=is;Object.defineProperty(P,"__esModule",{value:!0});P.createSigner=P.fetchSignerType=P.storeSignerType=P.loadSignerType=void 0;const as=_e,Qt=Ce,os=j,cs=k,ds=O,Xt="SignerType",er=new ds.ScopedLocalStorage("CBWSDK","SignerConfigurator");function ls(){return er.getItem(Xt)}P.loadSignerType=ls;function us(r){er.setItem(Xt,r)}P.storeSignerType=us;async function hs(r){const{communicator:e,metadata:t}=r;ps(e,t).catch(()=>{});const n={id:crypto.randomUUID(),event:"selectSignerType",data:r.preference},{data:s}=await e.postRequestAndWaitForResponse(n);return s}P.fetchSignerType=hs;function gs(r){const{signerType:e,metadata:t,communicator:n,updateListener:s}=r;switch(e){case"scw":return new as.SCWSigner({metadata:t,updateListener:s,communicator:n});case"walletlink":return new Qt.WalletLinkSigner({metadata:t,updateListener:s});case"extension":{const i=(0,cs.getCoinbaseInjectedSigner)();if(!i)throw os.standardErrors.rpc.internal("injected signer not found");return i}}}P.createSigner=gs;async function ps(r,e){await r.onMessage(({event:n})=>n==="WalletLinkSessionRequest");const t=new Qt.WalletLinkSigner({metadata:e});r.postMessage({event:"WalletLinkUpdate",data:{session:t.getSession()}}),await t.handshake(),r.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var Te={},J={};Object.defineProperty(J,"__esModule",{value:!0});J.closePopup=J.openPopup=void 0;const fs=j,ft=420,mt=540;function ms(r){const e=(window.innerWidth-ft)/2+window.screenX,t=(window.innerHeight-mt)/2+window.screenY,n=window.open(r,"Smart Wallet",`width=${ft}, height=${mt}, left=${e}, top=${t}`);if(n==null||n.focus(),!n)throw fs.standardErrors.rpc.internal("Pop up window failed to open");return n}J.openPopup=ms;function bs(r){r&&!r.closed&&r.close()}J.closePopup=bs;Object.defineProperty(Te,"__esModule",{value:!0});Te.Communicator=void 0;const ys=K,bt=J,ws=T,yt=j;class vs{constructor(e=ws.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async t=>{(await this.waitForPopupLoaded()).postMessage(t,this.url.origin)},this.postRequestAndWaitForResponse=async t=>{const n=this.onMessage(({requestId:s})=>s===t.id);return this.postMessage(t),await n},this.onMessage=async t=>new Promise((n,s)=>{const i=a=>{if(a.origin!==this.url.origin)return;const o=a.data;t(o)&&(n(o),window.removeEventListener("message",i),this.listeners.delete(i))};window.addEventListener("message",i),this.listeners.set(i,{reject:s})}),this.disconnect=()=>{(0,bt.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:t},n)=>{t(yt.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",n)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=(0,bt.openPopup)(this.url),this.onMessage(({event:t})=>t==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:t})=>t==="PopupLoaded").then(t=>{this.postMessage({requestId:t.id,data:{version:ys.LIB_VERSION}})}).then(()=>{if(!this.popup)throw yt.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}Te.Communicator=vs;var je={};Object.defineProperty(je,"__esModule",{value:!0});je.determineMethodCategory=void 0;const wt={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function _s(r){for(const e in wt){const t=e;if(wt[t].includes(r))return t}}je.determineMethodCategory=_s;var Es=M&&M.__rest||function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s{try{if(this.connected)return this.emit("connect",{chainId:(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id))}),this.accounts;const h=await this.requestSignerSelection(),f=this.initSigner(h),d=await f.handshake();return this.signer=f,(0,ge.storeSignerType)(h),this.emit("connect",{chainId:(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id))}),d}catch(h){throw this.handleUnauthorizedError(h),h}},sign:async l=>{if(!this.connected||!this.signer)throw V.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(l)}catch(h){throw this.handleUnauthorizedError(h),h}},fetch:l=>(0,vt.fetchRPCRequest)(l,this.chain),state:l=>{const h=()=>{if(this.connected)return this.accounts;throw V.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(l.method){case"eth_chainId":return(0,X.hexStringFromIntNumber)((0,he.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return h();case"eth_coinbase":return h()[0];default:return this.handlers.unsupported(l)}},deprecated:({method:l})=>{throw V.standardErrors.rpc.methodNotSupported(`Method ${l} is deprecated.`)},unsupported:({method:l})=>{throw V.standardErrors.rpc.methodNotSupported(`Method ${l} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:l,source:h})=>{(0,X.areAddressArraysEqual)(this.accounts,l)||(this.accounts=l,h!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:l,source:h})=>{l.id===this.chain.id&&l.rpcUrl===this.chain.rpcUrl||(this.chain=l,h!=="storage"&&this.emit("chainChanged",(0,X.hexStringFromIntNumber)((0,he.IntNumber)(l.id))))}},this.metadata=s,this.preference=o,this.communicator=new Is.Communicator(a),this.chain={id:(n=(t=s.appChainIds)===null||t===void 0?void 0:t[0])!==null&&n!==void 0?n:1};const c=(0,ge.loadSignerType)();this.signer=c?this.initSigner(c):null}get connected(){return this.accounts.length>0}async request(e){var t;try{const n=(0,vt.checkErrorForInvalidRequestArgs)(e);if(n)throw n;const s=(t=(0,Ms.determineMethodCategory)(e.method))!==null&&t!==void 0?t:"fetch";return this.handlers[s](e)}catch(n){return Promise.reject((0,ks.serializeError)(n,e.method))}}handleUnauthorizedError(e){e.code===V.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},Ls.ScopedLocalStorage.clearAll(),this.emit("disconnect",V.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,ge.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,ge.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}be.CoinbaseWalletProvider=As;Object.defineProperty(te,"__esModule",{value:!0});te.CoinbaseWalletSDK=void 0;const Rs=me,xs=be,Ps=O,Ns=K,Ts=u,js=k;class Os{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,Ts.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var t;const n={metadata:this.metadata,preference:e};return(t=(0,js.getCoinbaseInjectedProvider)(n))!==null&&t!==void 0?t:new xs.CoinbaseWalletProvider(n)}getCoinbaseWalletLogo(e,t=240){return(0,Rs.walletLogo)(e,t)}storeLatestVersion(){new Ps.ScopedLocalStorage("CBWSDK").setItem("VERSION",Ns.LIB_VERSION)}}te.CoinbaseWalletSDK=Os;(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.CoinbaseWalletSDK=void 0;const e=te;r.default=e.CoinbaseWalletSDK;var t=te;Object.defineProperty(r,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return t.CoinbaseWalletSDK}})})(Et);const Ds=ir(Et),Bs=Object.freeze(Object.defineProperty({__proto__:null,default:Ds},Symbol.toStringTag,{value:"Module"}));export{Bs as i}; diff --git a/buddybook/assets/index-DsVjVM-s.js b/buddybook/assets/index-DsVjVM-s.js deleted file mode 100644 index ed6c50e..0000000 --- a/buddybook/assets/index-DsVjVM-s.js +++ /dev/null @@ -1 +0,0 @@ -import{e as p}from"./events-q8pkyiVZ.js";function _(n,r){for(var i=0;ie[s]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var l={},g={},f={};Object.defineProperty(f,"__esModule",{value:!0});f.getLowerCase=void 0;function m(n){return n&&n.toLowerCase()}f.getLowerCase=m;Object.defineProperty(g,"__esModule",{value:!0});g.SafeAppProvider=void 0;const w=p,u=f;class k extends w.EventEmitter{constructor(r,i){super(),this.submittedTxs=new Map,this.safe=r,this.sdk=i}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(r){const{method:i,params:e=[]}=r;switch(i){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return`0x${this.chainId.toString(16)}`;case"personal_sign":{const[t,a]=e;if(this.safe.safeAddress.toLowerCase()!==a.toLowerCase())throw new Error("The address or message hash is invalid");const h=await this.sdk.txs.signMessage(t);return("signature"in h?h.signature:void 0)||"0x"}case"eth_sign":{const[t,a]=e;if(this.safe.safeAddress.toLowerCase()!==t.toLowerCase()||!a.startsWith("0x"))throw new Error("The address or message hash is invalid");const h=await this.sdk.txs.signMessage(a);return("signature"in h?h.signature:void 0)||"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{const[t,a]=e,h=typeof a=="string"?JSON.parse(a):a;if(this.safe.safeAddress.toLowerCase()!==t.toLowerCase())throw new Error("The address is invalid");const c=await this.sdk.txs.signTypedMessage(h);return("signature"in c?c.signature:void 0)||"0x"}case"eth_sendTransaction":const s={...e[0],value:e[0].value||"0",data:e[0].data||"0x"};typeof s.gas=="string"&&s.gas.startsWith("0x")&&(s.gas=parseInt(s.gas,16));const o=await this.sdk.txs.send({txs:[s],params:{safeTxGas:s.gas}});return this.submittedTxs.set(o.safeTxHash,{from:this.safe.safeAddress,hash:o.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:s.data,value:s.value,to:s.to,blockHash:null,blockNumber:null,transactionIndex:null}),o.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,u.getLowerCase)(e[0]),e[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,u.getLowerCase)(e[0]),e[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,u.getLowerCase)(e[0]),e[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,u.getLowerCase)(e[0]),e[1],e[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([e[0],e[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([e[0],e[1]]);case"eth_getTransactionByHash":let d=e[0];try{d=(await this.sdk.txs.getBySafeTxHash(d)).txHash||d}catch{}return this.submittedTxs.has(d)?this.submittedTxs.get(d):this.sdk.eth.getTransactionByHash([d]).then(t=>(t&&(t.hash=e[0]),t));case"eth_getTransactionReceipt":{let t=e[0];try{t=(await this.sdk.txs.getBySafeTxHash(t)).txHash||t}catch{}return this.sdk.eth.getTransactionReceipt([t]).then(a=>(a&&(a.transactionHash=e[0]),a))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(e[0]);case"eth_call":return this.sdk.eth.call([e[0],e[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([e[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(e[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([e[0]]);default:throw Error(`"${r.method}" not implemented`)}}send(r,i){r||i("Undefined request"),this.request(r).then(e=>i(null,{jsonrpc:"2.0",id:r.id,result:e})).catch(e=>i(e,null))}}g.SafeAppProvider=k;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SafeAppProvider=void 0;var r=g;Object.defineProperty(n,"SafeAppProvider",{enumerable:!0,get:function(){return r.SafeAppProvider}})})(l);const T=_({__proto__:null},[l]);export{T as i}; diff --git a/buddybook/assets/index-Gmp6KMX1.js b/buddybook/assets/index-Gmp6KMX1.js deleted file mode 100644 index 7ae39d3..0000000 --- a/buddybook/assets/index-Gmp6KMX1.js +++ /dev/null @@ -1,4272 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-D8m_BJXT.js","assets/hooks.module-Bu9ycfnK.js","assets/events-q8pkyiVZ.js","assets/inherits_browser-C-oMugCi.js","assets/index-CF3pMtIR.js","assets/index-DsVjVM-s.js","assets/index.es-D00CSFMM.js"])))=>i.map(i=>d[i]); -var cu=Object.defineProperty;var Us=et=>{throw TypeError(et)};var lu=(et,o,tt)=>o in et?cu(et,o,{enumerable:!0,configurable:!0,writable:!0,value:tt}):et[o]=tt;var wt=(et,o,tt)=>lu(et,typeof o!="symbol"?o+"":o,tt),cs=(et,o,tt)=>o.has(et)||Us("Cannot "+tt);var Ot=(et,o,tt)=>(cs(et,o,"read from private field"),tt?tt.call(et):o.get(et)),fr=(et,o,tt)=>o.has(et)?Us("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(et):o.set(et,tt),lr=(et,o,tt,rt)=>(cs(et,o,"write to private field"),rt?rt.call(et,tt):o.set(et,tt),tt),mr=(et,o,tt)=>(cs(et,o,"access private method"),tt);var Cn=(et,o,tt,rt)=>({set _(nt){lr(et,o,nt,tt)},get _(){return Ot(et,o,rt)}});function _mergeNamespaces(et,o){for(var tt=0;ttrt[nt]})}}}return Object.freeze(Object.defineProperty(et,Symbol.toStringTag,{value:"Module"}))}(function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const nt of document.querySelectorAll('link[rel="modulepreload"]'))rt(nt);new MutationObserver(nt=>{for(const ot of nt)if(ot.type==="childList")for(const it of ot.addedNodes)it.tagName==="LINK"&&it.rel==="modulepreload"&&rt(it)}).observe(document,{childList:!0,subtree:!0});function tt(nt){const ot={};return nt.integrity&&(ot.integrity=nt.integrity),nt.referrerPolicy&&(ot.referrerPolicy=nt.referrerPolicy),nt.crossOrigin==="use-credentials"?ot.credentials="include":nt.crossOrigin==="anonymous"?ot.credentials="omit":ot.credentials="same-origin",ot}function rt(nt){if(nt.ep)return;nt.ep=!0;const ot=tt(nt);fetch(nt.href,ot)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function getDefaultExportFromCjs(et){return et&&et.__esModule&&Object.prototype.hasOwnProperty.call(et,"default")?et.default:et}function getAugmentedNamespace(et){if(et.__esModule)return et;var o=et.default;if(typeof o=="function"){var tt=function rt(){return this instanceof rt?Reflect.construct(o,arguments,this.constructor):o.apply(this,arguments)};tt.prototype=o.prototype}else tt={};return Object.defineProperty(tt,"__esModule",{value:!0}),Object.keys(et).forEach(function(rt){var nt=Object.getOwnPropertyDescriptor(et,rt);Object.defineProperty(tt,rt,nt.get?nt:{enumerable:!0,get:function(){return et[rt]}})}),tt}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var l$4=Symbol.for("react.element"),n$5=Symbol.for("react.portal"),p$6=Symbol.for("react.fragment"),q$6=Symbol.for("react.strict_mode"),r$5=Symbol.for("react.profiler"),t$4=Symbol.for("react.provider"),u$3=Symbol.for("react.context"),v$5=Symbol.for("react.forward_ref"),w$4=Symbol.for("react.suspense"),x$2=Symbol.for("react.memo"),y$3=Symbol.for("react.lazy"),z$3=Symbol.iterator;function A$2(et){return et===null||typeof et!="object"?null:(et=z$3&&et[z$3]||et["@@iterator"],typeof et=="function"?et:null)}var B$2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$2=Object.assign,D$2={};function E$2(et,o,tt){this.props=et,this.context=o,this.refs=D$2,this.updater=tt||B$2}E$2.prototype.isReactComponent={};E$2.prototype.setState=function(et,o){if(typeof et!="object"&&typeof et!="function"&&et!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,et,o,"setState")};E$2.prototype.forceUpdate=function(et){this.updater.enqueueForceUpdate(this,et,"forceUpdate")};function F$1(){}F$1.prototype=E$2.prototype;function G$2(et,o,tt){this.props=et,this.context=o,this.refs=D$2,this.updater=tt||B$2}var H$2=G$2.prototype=new F$1;H$2.constructor=G$2;C$2(H$2,E$2.prototype);H$2.isPureReactComponent=!0;var I$2=Array.isArray,J$1=Object.prototype.hasOwnProperty,K$2={current:null},L$2={key:!0,ref:!0,__self:!0,__source:!0};function M$2(et,o,tt){var rt,nt={},ot=null,it=null;if(o!=null)for(rt in o.ref!==void 0&&(it=o.ref),o.key!==void 0&&(ot=""+o.key),o)J$1.call(o,rt)&&!L$2.hasOwnProperty(rt)&&(nt[rt]=o[rt]);var st=arguments.length-2;if(st===1)nt.children=tt;else if(10)throw new Error("Invalid string. Length must be a multiple of 4");var tt=et.indexOf("=");tt===-1&&(tt=o);var rt=tt===o?0:4-tt%4;return[tt,rt]}function byteLength(et){var o=getLens(et),tt=o[0],rt=o[1];return(tt+rt)*3/4-rt}function _byteLength(et,o,tt){return(o+tt)*3/4-tt}function toByteArray(et){var o,tt=getLens(et),rt=tt[0],nt=tt[1],ot=new Arr(_byteLength(et,rt,nt)),it=0,st=nt>0?rt-4:rt,at;for(at=0;at>16&255,ot[it++]=o>>8&255,ot[it++]=o&255;return nt===2&&(o=revLookup[et.charCodeAt(at)]<<2|revLookup[et.charCodeAt(at+1)]>>4,ot[it++]=o&255),nt===1&&(o=revLookup[et.charCodeAt(at)]<<10|revLookup[et.charCodeAt(at+1)]<<4|revLookup[et.charCodeAt(at+2)]>>2,ot[it++]=o>>8&255,ot[it++]=o&255),ot}function tripletToBase64(et){return lookup[et>>18&63]+lookup[et>>12&63]+lookup[et>>6&63]+lookup[et&63]}function encodeChunk(et,o,tt){for(var rt,nt=[],ot=o;otst?st:it+ot));return rt===1?(o=et[tt-1],nt.push(lookup[o>>2]+lookup[o<<4&63]+"==")):rt===2&&(o=(et[tt-2]<<8)+et[tt-1],nt.push(lookup[o>>10]+lookup[o>>4&63]+lookup[o<<2&63]+"=")),nt.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ieee754.read=function(et,o,tt,rt,nt){var ot,it,st=nt*8-rt-1,at=(1<>1,lt=-7,dt=tt?nt-1:0,ht=tt?-1:1,mt=et[o+dt];for(dt+=ht,ot=mt&(1<<-lt)-1,mt>>=-lt,lt+=st;lt>0;ot=ot*256+et[o+dt],dt+=ht,lt-=8);for(it=ot&(1<<-lt)-1,ot>>=-lt,lt+=rt;lt>0;it=it*256+et[o+dt],dt+=ht,lt-=8);if(ot===0)ot=1-ct;else{if(ot===at)return it?NaN:(mt?-1:1)*(1/0);it=it+Math.pow(2,rt),ot=ot-ct}return(mt?-1:1)*it*Math.pow(2,ot-rt)};ieee754.write=function(et,o,tt,rt,nt,ot){var it,st,at,ct=ot*8-nt-1,lt=(1<>1,ht=nt===23?Math.pow(2,-24)-Math.pow(2,-77):0,mt=rt?0:ot-1,ft=rt?1:-1,pt=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(st=isNaN(o)?1:0,it=lt):(it=Math.floor(Math.log(o)/Math.LN2),o*(at=Math.pow(2,-it))<1&&(it--,at*=2),it+dt>=1?o+=ht/at:o+=ht*Math.pow(2,1-dt),o*at>=2&&(it++,at/=2),it+dt>=lt?(st=0,it=lt):it+dt>=1?(st=(o*at-1)*Math.pow(2,nt),it=it+dt):(st=o*Math.pow(2,dt-1)*Math.pow(2,nt),it=0));nt>=8;et[tt+mt]=st&255,mt+=ft,st/=256,nt-=8);for(it=it<0;et[tt+mt]=it&255,mt+=ft,it/=256,ct-=8);et[tt+mt-ft]|=pt*128};/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */(function(et){const o=base64Js,tt=ieee754,rt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;et.Buffer=st,et.SlowBuffer=bt,et.INSPECT_MAX_BYTES=50;const nt=2147483647;et.kMaxLength=nt,st.TYPED_ARRAY_SUPPORT=ot(),!st.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ot(){try{const Tt=new Uint8Array(1),$t={foo:function(){return 42}};return Object.setPrototypeOf($t,Uint8Array.prototype),Object.setPrototypeOf(Tt,$t),Tt.foo()===42}catch{return!1}}Object.defineProperty(st.prototype,"parent",{enumerable:!0,get:function(){if(st.isBuffer(this))return this.buffer}}),Object.defineProperty(st.prototype,"offset",{enumerable:!0,get:function(){if(st.isBuffer(this))return this.byteOffset}});function it(Tt){if(Tt>nt)throw new RangeError('The value "'+Tt+'" is invalid for option "size"');const $t=new Uint8Array(Tt);return Object.setPrototypeOf($t,st.prototype),$t}function st(Tt,$t,Rt){if(typeof Tt=="number"){if(typeof $t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return dt(Tt)}return at(Tt,$t,Rt)}st.poolSize=8192;function at(Tt,$t,Rt){if(typeof Tt=="string")return ht(Tt,$t);if(ArrayBuffer.isView(Tt))return ft(Tt);if(Tt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Tt);if(_r(Tt,ArrayBuffer)||Tt&&_r(Tt.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(_r(Tt,SharedArrayBuffer)||Tt&&_r(Tt.buffer,SharedArrayBuffer)))return pt(Tt,$t,Rt);if(typeof Tt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Dt=Tt.valueOf&&Tt.valueOf();if(Dt!=null&&Dt!==Tt)return st.from(Dt,$t,Rt);const Kt=yt(Tt);if(Kt)return Kt;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Tt[Symbol.toPrimitive]=="function")return st.from(Tt[Symbol.toPrimitive]("string"),$t,Rt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Tt)}st.from=function(Tt,$t,Rt){return at(Tt,$t,Rt)},Object.setPrototypeOf(st.prototype,Uint8Array.prototype),Object.setPrototypeOf(st,Uint8Array);function ct(Tt){if(typeof Tt!="number")throw new TypeError('"size" argument must be of type number');if(Tt<0)throw new RangeError('The value "'+Tt+'" is invalid for option "size"')}function lt(Tt,$t,Rt){return ct(Tt),Tt<=0?it(Tt):$t!==void 0?typeof Rt=="string"?it(Tt).fill($t,Rt):it(Tt).fill($t):it(Tt)}st.alloc=function(Tt,$t,Rt){return lt(Tt,$t,Rt)};function dt(Tt){return ct(Tt),it(Tt<0?0:gt(Tt)|0)}st.allocUnsafe=function(Tt){return dt(Tt)},st.allocUnsafeSlow=function(Tt){return dt(Tt)};function ht(Tt,$t){if((typeof $t!="string"||$t==="")&&($t="utf8"),!st.isEncoding($t))throw new TypeError("Unknown encoding: "+$t);const Rt=xt(Tt,$t)|0;let Dt=it(Rt);const Kt=Dt.write(Tt,$t);return Kt!==Rt&&(Dt=Dt.slice(0,Kt)),Dt}function mt(Tt){const $t=Tt.length<0?0:gt(Tt.length)|0,Rt=it($t);for(let Dt=0;Dt<$t;Dt+=1)Rt[Dt]=Tt[Dt]&255;return Rt}function ft(Tt){if(_r(Tt,Uint8Array)){const $t=new Uint8Array(Tt);return pt($t.buffer,$t.byteOffset,$t.byteLength)}return mt(Tt)}function pt(Tt,$t,Rt){if($t<0||Tt.byteLength<$t)throw new RangeError('"offset" is outside of buffer bounds');if(Tt.byteLength<$t+(Rt||0))throw new RangeError('"length" is outside of buffer bounds');let Dt;return $t===void 0&&Rt===void 0?Dt=new Uint8Array(Tt):Rt===void 0?Dt=new Uint8Array(Tt,$t):Dt=new Uint8Array(Tt,$t,Rt),Object.setPrototypeOf(Dt,st.prototype),Dt}function yt(Tt){if(st.isBuffer(Tt)){const $t=gt(Tt.length)|0,Rt=it($t);return Rt.length===0||Tt.copy(Rt,0,0,$t),Rt}if(Tt.length!==void 0)return typeof Tt.length!="number"||Tr(Tt.length)?it(0):mt(Tt);if(Tt.type==="Buffer"&&Array.isArray(Tt.data))return mt(Tt.data)}function gt(Tt){if(Tt>=nt)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+nt.toString(16)+" bytes");return Tt|0}function bt(Tt){return+Tt!=Tt&&(Tt=0),st.alloc(+Tt)}st.isBuffer=function($t){return $t!=null&&$t._isBuffer===!0&&$t!==st.prototype},st.compare=function($t,Rt){if(_r($t,Uint8Array)&&($t=st.from($t,$t.offset,$t.byteLength)),_r(Rt,Uint8Array)&&(Rt=st.from(Rt,Rt.offset,Rt.byteLength)),!st.isBuffer($t)||!st.isBuffer(Rt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if($t===Rt)return 0;let Dt=$t.length,Kt=Rt.length;for(let nr=0,sr=Math.min(Dt,Kt);nrKt.length?(st.isBuffer(sr)||(sr=st.from(sr)),sr.copy(Kt,nr)):Uint8Array.prototype.set.call(Kt,sr,nr);else if(st.isBuffer(sr))sr.copy(Kt,nr);else throw new TypeError('"list" argument must be an Array of Buffers');nr+=sr.length}return Kt};function xt(Tt,$t){if(st.isBuffer(Tt))return Tt.length;if(ArrayBuffer.isView(Tt)||_r(Tt,ArrayBuffer))return Tt.byteLength;if(typeof Tt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Tt);const Rt=Tt.length,Dt=arguments.length>2&&arguments[2]===!0;if(!Dt&&Rt===0)return 0;let Kt=!1;for(;;)switch($t){case"ascii":case"latin1":case"binary":return Rt;case"utf8":case"utf-8":return cr(Tt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rt*2;case"hex":return Rt>>>1;case"base64":return pr(Tt).length;default:if(Kt)return Dt?-1:cr(Tt).length;$t=(""+$t).toLowerCase(),Kt=!0}}st.byteLength=xt;function vt(Tt,$t,Rt){let Dt=!1;if(($t===void 0||$t<0)&&($t=0),$t>this.length||((Rt===void 0||Rt>this.length)&&(Rt=this.length),Rt<=0)||(Rt>>>=0,$t>>>=0,Rt<=$t))return"";for(Tt||(Tt="utf8");;)switch(Tt){case"hex":return qt(this,$t,Rt);case"utf8":case"utf-8":return zt(this,$t,Rt);case"ascii":return Wt(this,$t,Rt);case"latin1":case"binary":return Ft(this,$t,Rt);case"base64":return Mt(this,$t,Rt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pt(this,$t,Rt);default:if(Dt)throw new TypeError("Unknown encoding: "+Tt);Tt=(Tt+"").toLowerCase(),Dt=!0}}st.prototype._isBuffer=!0;function Et(Tt,$t,Rt){const Dt=Tt[$t];Tt[$t]=Tt[Rt],Tt[Rt]=Dt}st.prototype.swap16=function(){const $t=this.length;if($t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Rt=0;Rt<$t;Rt+=2)Et(this,Rt,Rt+1);return this},st.prototype.swap32=function(){const $t=this.length;if($t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let Rt=0;Rt<$t;Rt+=4)Et(this,Rt,Rt+3),Et(this,Rt+1,Rt+2);return this},st.prototype.swap64=function(){const $t=this.length;if($t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let Rt=0;Rt<$t;Rt+=8)Et(this,Rt,Rt+7),Et(this,Rt+1,Rt+6),Et(this,Rt+2,Rt+5),Et(this,Rt+3,Rt+4);return this},st.prototype.toString=function(){const $t=this.length;return $t===0?"":arguments.length===0?zt(this,0,$t):vt.apply(this,arguments)},st.prototype.toLocaleString=st.prototype.toString,st.prototype.equals=function($t){if(!st.isBuffer($t))throw new TypeError("Argument must be a Buffer");return this===$t?!0:st.compare(this,$t)===0},st.prototype.inspect=function(){let $t="";const Rt=et.INSPECT_MAX_BYTES;return $t=this.toString("hex",0,Rt).replace(/(.{2})/g,"$1 ").trim(),this.length>Rt&&($t+=" ... "),""},rt&&(st.prototype[rt]=st.prototype.inspect),st.prototype.compare=function($t,Rt,Dt,Kt,nr){if(_r($t,Uint8Array)&&($t=st.from($t,$t.offset,$t.byteLength)),!st.isBuffer($t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof $t);if(Rt===void 0&&(Rt=0),Dt===void 0&&(Dt=$t?$t.length:0),Kt===void 0&&(Kt=0),nr===void 0&&(nr=this.length),Rt<0||Dt>$t.length||Kt<0||nr>this.length)throw new RangeError("out of range index");if(Kt>=nr&&Rt>=Dt)return 0;if(Kt>=nr)return-1;if(Rt>=Dt)return 1;if(Rt>>>=0,Dt>>>=0,Kt>>>=0,nr>>>=0,this===$t)return 0;let sr=nr-Kt,br=Dt-Rt;const $r=Math.min(sr,br),yr=this.slice(Kt,nr),Ar=$t.slice(Rt,Dt);for(let xr=0;xr<$r;++xr)if(yr[xr]!==Ar[xr]){sr=yr[xr],br=Ar[xr];break}return sr2147483647?Rt=2147483647:Rt<-2147483648&&(Rt=-2147483648),Rt=+Rt,Tr(Rt)&&(Rt=Kt?0:Tt.length-1),Rt<0&&(Rt=Tt.length+Rt),Rt>=Tt.length){if(Kt)return-1;Rt=Tt.length-1}else if(Rt<0)if(Kt)Rt=0;else return-1;if(typeof $t=="string"&&($t=st.from($t,Dt)),st.isBuffer($t))return $t.length===0?-1:St(Tt,$t,Rt,Dt,Kt);if(typeof $t=="number")return $t=$t&255,typeof Uint8Array.prototype.indexOf=="function"?Kt?Uint8Array.prototype.indexOf.call(Tt,$t,Rt):Uint8Array.prototype.lastIndexOf.call(Tt,$t,Rt):St(Tt,[$t],Rt,Dt,Kt);throw new TypeError("val must be string, number or Buffer")}function St(Tt,$t,Rt,Dt,Kt){let nr=1,sr=Tt.length,br=$t.length;if(Dt!==void 0&&(Dt=String(Dt).toLowerCase(),Dt==="ucs2"||Dt==="ucs-2"||Dt==="utf16le"||Dt==="utf-16le")){if(Tt.length<2||$t.length<2)return-1;nr=2,sr/=2,br/=2,Rt/=2}function $r(Ar,xr){return nr===1?Ar[xr]:Ar.readUInt16BE(xr*nr)}let yr;if(Kt){let Ar=-1;for(yr=Rt;yrsr&&(Rt=sr-br),yr=Rt;yr>=0;yr--){let Ar=!0;for(let xr=0;xrKt&&(Dt=Kt)):Dt=Kt;const nr=$t.length;Dt>nr/2&&(Dt=nr/2);let sr;for(sr=0;sr>>0,isFinite(Dt)?(Dt=Dt>>>0,Kt===void 0&&(Kt="utf8")):(Kt=Dt,Dt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const nr=this.length-Rt;if((Dt===void 0||Dt>nr)&&(Dt=nr),$t.length>0&&(Dt<0||Rt<0)||Rt>this.length)throw new RangeError("Attempt to write outside buffer bounds");Kt||(Kt="utf8");let sr=!1;for(;;)switch(Kt){case"hex":return At(this,$t,Rt,Dt);case"utf8":case"utf-8":return kt(this,$t,Rt,Dt);case"ascii":case"latin1":case"binary":return It(this,$t,Rt,Dt);case"base64":return Nt(this,$t,Rt,Dt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lt(this,$t,Rt,Dt);default:if(sr)throw new TypeError("Unknown encoding: "+Kt);Kt=(""+Kt).toLowerCase(),sr=!0}},st.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Mt(Tt,$t,Rt){return $t===0&&Rt===Tt.length?o.fromByteArray(Tt):o.fromByteArray(Tt.slice($t,Rt))}function zt(Tt,$t,Rt){Rt=Math.min(Tt.length,Rt);const Dt=[];let Kt=$t;for(;Kt239?4:nr>223?3:nr>191?2:1;if(Kt+br<=Rt){let $r,yr,Ar,xr;switch(br){case 1:nr<128&&(sr=nr);break;case 2:$r=Tt[Kt+1],($r&192)===128&&(xr=(nr&31)<<6|$r&63,xr>127&&(sr=xr));break;case 3:$r=Tt[Kt+1],yr=Tt[Kt+2],($r&192)===128&&(yr&192)===128&&(xr=(nr&15)<<12|($r&63)<<6|yr&63,xr>2047&&(xr<55296||xr>57343)&&(sr=xr));break;case 4:$r=Tt[Kt+1],yr=Tt[Kt+2],Ar=Tt[Kt+3],($r&192)===128&&(yr&192)===128&&(Ar&192)===128&&(xr=(nr&15)<<18|($r&63)<<12|(yr&63)<<6|Ar&63,xr>65535&&xr<1114112&&(sr=xr))}}sr===null?(sr=65533,br=1):sr>65535&&(sr-=65536,Dt.push(sr>>>10&1023|55296),sr=56320|sr&1023),Dt.push(sr),Kt+=br}return Xt(Dt)}const Ut=4096;function Xt(Tt){const $t=Tt.length;if($t<=Ut)return String.fromCharCode.apply(String,Tt);let Rt="",Dt=0;for(;Dt<$t;)Rt+=String.fromCharCode.apply(String,Tt.slice(Dt,Dt+=Ut));return Rt}function Wt(Tt,$t,Rt){let Dt="";Rt=Math.min(Tt.length,Rt);for(let Kt=$t;KtDt)&&(Rt=Dt);let Kt="";for(let nr=$t;nrDt&&($t=Dt),Rt<0?(Rt+=Dt,Rt<0&&(Rt=0)):Rt>Dt&&(Rt=Dt),Rt<$t&&(Rt=$t);const Kt=this.subarray($t,Rt);return Object.setPrototypeOf(Kt,st.prototype),Kt};function Yt(Tt,$t,Rt){if(Tt%1!==0||Tt<0)throw new RangeError("offset is not uint");if(Tt+$t>Rt)throw new RangeError("Trying to access beyond buffer length")}st.prototype.readUintLE=st.prototype.readUIntLE=function($t,Rt,Dt){$t=$t>>>0,Rt=Rt>>>0,Dt||Yt($t,Rt,this.length);let Kt=this[$t],nr=1,sr=0;for(;++sr>>0,Rt=Rt>>>0,Dt||Yt($t,Rt,this.length);let Kt=this[$t+--Rt],nr=1;for(;Rt>0&&(nr*=256);)Kt+=this[$t+--Rt]*nr;return Kt},st.prototype.readUint8=st.prototype.readUInt8=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,1,this.length),this[$t]},st.prototype.readUint16LE=st.prototype.readUInt16LE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,2,this.length),this[$t]|this[$t+1]<<8},st.prototype.readUint16BE=st.prototype.readUInt16BE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,2,this.length),this[$t]<<8|this[$t+1]},st.prototype.readUint32LE=st.prototype.readUInt32LE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),(this[$t]|this[$t+1]<<8|this[$t+2]<<16)+this[$t+3]*16777216},st.prototype.readUint32BE=st.prototype.readUInt32BE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),this[$t]*16777216+(this[$t+1]<<16|this[$t+2]<<8|this[$t+3])},st.prototype.readBigUInt64LE=vr(function($t){$t=$t>>>0,Vt($t,"offset");const Rt=this[$t],Dt=this[$t+7];(Rt===void 0||Dt===void 0)&&er($t,this.length-8);const Kt=Rt+this[++$t]*2**8+this[++$t]*2**16+this[++$t]*2**24,nr=this[++$t]+this[++$t]*2**8+this[++$t]*2**16+Dt*2**24;return BigInt(Kt)+(BigInt(nr)<>>0,Vt($t,"offset");const Rt=this[$t],Dt=this[$t+7];(Rt===void 0||Dt===void 0)&&er($t,this.length-8);const Kt=Rt*2**24+this[++$t]*2**16+this[++$t]*2**8+this[++$t],nr=this[++$t]*2**24+this[++$t]*2**16+this[++$t]*2**8+Dt;return(BigInt(Kt)<>>0,Rt=Rt>>>0,Dt||Yt($t,Rt,this.length);let Kt=this[$t],nr=1,sr=0;for(;++sr=nr&&(Kt-=Math.pow(2,8*Rt)),Kt},st.prototype.readIntBE=function($t,Rt,Dt){$t=$t>>>0,Rt=Rt>>>0,Dt||Yt($t,Rt,this.length);let Kt=Rt,nr=1,sr=this[$t+--Kt];for(;Kt>0&&(nr*=256);)sr+=this[$t+--Kt]*nr;return nr*=128,sr>=nr&&(sr-=Math.pow(2,8*Rt)),sr},st.prototype.readInt8=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,1,this.length),this[$t]&128?(255-this[$t]+1)*-1:this[$t]},st.prototype.readInt16LE=function($t,Rt){$t=$t>>>0,Rt||Yt($t,2,this.length);const Dt=this[$t]|this[$t+1]<<8;return Dt&32768?Dt|4294901760:Dt},st.prototype.readInt16BE=function($t,Rt){$t=$t>>>0,Rt||Yt($t,2,this.length);const Dt=this[$t+1]|this[$t]<<8;return Dt&32768?Dt|4294901760:Dt},st.prototype.readInt32LE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),this[$t]|this[$t+1]<<8|this[$t+2]<<16|this[$t+3]<<24},st.prototype.readInt32BE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),this[$t]<<24|this[$t+1]<<16|this[$t+2]<<8|this[$t+3]},st.prototype.readBigInt64LE=vr(function($t){$t=$t>>>0,Vt($t,"offset");const Rt=this[$t],Dt=this[$t+7];(Rt===void 0||Dt===void 0)&&er($t,this.length-8);const Kt=this[$t+4]+this[$t+5]*2**8+this[$t+6]*2**16+(Dt<<24);return(BigInt(Kt)<>>0,Vt($t,"offset");const Rt=this[$t],Dt=this[$t+7];(Rt===void 0||Dt===void 0)&&er($t,this.length-8);const Kt=(Rt<<24)+this[++$t]*2**16+this[++$t]*2**8+this[++$t];return(BigInt(Kt)<>>0,Rt||Yt($t,4,this.length),tt.read(this,$t,!0,23,4)},st.prototype.readFloatBE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,4,this.length),tt.read(this,$t,!1,23,4)},st.prototype.readDoubleLE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,8,this.length),tt.read(this,$t,!0,52,8)},st.prototype.readDoubleBE=function($t,Rt){return $t=$t>>>0,Rt||Yt($t,8,this.length),tt.read(this,$t,!1,52,8)};function Qt(Tt,$t,Rt,Dt,Kt,nr){if(!st.isBuffer(Tt))throw new TypeError('"buffer" argument must be a Buffer instance');if($t>Kt||$tTt.length)throw new RangeError("Index out of range")}st.prototype.writeUintLE=st.prototype.writeUIntLE=function($t,Rt,Dt,Kt){if($t=+$t,Rt=Rt>>>0,Dt=Dt>>>0,!Kt){const br=Math.pow(2,8*Dt)-1;Qt(this,$t,Rt,Dt,br,0)}let nr=1,sr=0;for(this[Rt]=$t&255;++sr>>0,Dt=Dt>>>0,!Kt){const br=Math.pow(2,8*Dt)-1;Qt(this,$t,Rt,Dt,br,0)}let nr=Dt-1,sr=1;for(this[Rt+nr]=$t&255;--nr>=0&&(sr*=256);)this[Rt+nr]=$t/sr&255;return Rt+Dt},st.prototype.writeUint8=st.prototype.writeUInt8=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,1,255,0),this[Rt]=$t&255,Rt+1},st.prototype.writeUint16LE=st.prototype.writeUInt16LE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,2,65535,0),this[Rt]=$t&255,this[Rt+1]=$t>>>8,Rt+2},st.prototype.writeUint16BE=st.prototype.writeUInt16BE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,2,65535,0),this[Rt]=$t>>>8,this[Rt+1]=$t&255,Rt+2},st.prototype.writeUint32LE=st.prototype.writeUInt32LE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,4,4294967295,0),this[Rt+3]=$t>>>24,this[Rt+2]=$t>>>16,this[Rt+1]=$t>>>8,this[Rt]=$t&255,Rt+4},st.prototype.writeUint32BE=st.prototype.writeUInt32BE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,4,4294967295,0),this[Rt]=$t>>>24,this[Rt+1]=$t>>>16,this[Rt+2]=$t>>>8,this[Rt+3]=$t&255,Rt+4};function jt(Tt,$t,Rt,Dt,Kt){Bt($t,Dt,Kt,Tt,Rt,7);let nr=Number($t&BigInt(4294967295));Tt[Rt++]=nr,nr=nr>>8,Tt[Rt++]=nr,nr=nr>>8,Tt[Rt++]=nr,nr=nr>>8,Tt[Rt++]=nr;let sr=Number($t>>BigInt(32)&BigInt(4294967295));return Tt[Rt++]=sr,sr=sr>>8,Tt[Rt++]=sr,sr=sr>>8,Tt[Rt++]=sr,sr=sr>>8,Tt[Rt++]=sr,Rt}function Gt(Tt,$t,Rt,Dt,Kt){Bt($t,Dt,Kt,Tt,Rt,7);let nr=Number($t&BigInt(4294967295));Tt[Rt+7]=nr,nr=nr>>8,Tt[Rt+6]=nr,nr=nr>>8,Tt[Rt+5]=nr,nr=nr>>8,Tt[Rt+4]=nr;let sr=Number($t>>BigInt(32)&BigInt(4294967295));return Tt[Rt+3]=sr,sr=sr>>8,Tt[Rt+2]=sr,sr=sr>>8,Tt[Rt+1]=sr,sr=sr>>8,Tt[Rt]=sr,Rt+8}st.prototype.writeBigUInt64LE=vr(function($t,Rt=0){return jt(this,$t,Rt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeBigUInt64BE=vr(function($t,Rt=0){return Gt(this,$t,Rt,BigInt(0),BigInt("0xffffffffffffffff"))}),st.prototype.writeIntLE=function($t,Rt,Dt,Kt){if($t=+$t,Rt=Rt>>>0,!Kt){const $r=Math.pow(2,8*Dt-1);Qt(this,$t,Rt,Dt,$r-1,-$r)}let nr=0,sr=1,br=0;for(this[Rt]=$t&255;++nr>0)-br&255;return Rt+Dt},st.prototype.writeIntBE=function($t,Rt,Dt,Kt){if($t=+$t,Rt=Rt>>>0,!Kt){const $r=Math.pow(2,8*Dt-1);Qt(this,$t,Rt,Dt,$r-1,-$r)}let nr=Dt-1,sr=1,br=0;for(this[Rt+nr]=$t&255;--nr>=0&&(sr*=256);)$t<0&&br===0&&this[Rt+nr+1]!==0&&(br=1),this[Rt+nr]=($t/sr>>0)-br&255;return Rt+Dt},st.prototype.writeInt8=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,1,127,-128),$t<0&&($t=255+$t+1),this[Rt]=$t&255,Rt+1},st.prototype.writeInt16LE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,2,32767,-32768),this[Rt]=$t&255,this[Rt+1]=$t>>>8,Rt+2},st.prototype.writeInt16BE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,2,32767,-32768),this[Rt]=$t>>>8,this[Rt+1]=$t&255,Rt+2},st.prototype.writeInt32LE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,4,2147483647,-2147483648),this[Rt]=$t&255,this[Rt+1]=$t>>>8,this[Rt+2]=$t>>>16,this[Rt+3]=$t>>>24,Rt+4},st.prototype.writeInt32BE=function($t,Rt,Dt){return $t=+$t,Rt=Rt>>>0,Dt||Qt(this,$t,Rt,4,2147483647,-2147483648),$t<0&&($t=4294967295+$t+1),this[Rt]=$t>>>24,this[Rt+1]=$t>>>16,this[Rt+2]=$t>>>8,this[Rt+3]=$t&255,Rt+4},st.prototype.writeBigInt64LE=vr(function($t,Rt=0){return jt(this,$t,Rt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),st.prototype.writeBigInt64BE=vr(function($t,Rt=0){return Gt(this,$t,Rt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function rr(Tt,$t,Rt,Dt,Kt,nr){if(Rt+Dt>Tt.length)throw new RangeError("Index out of range");if(Rt<0)throw new RangeError("Index out of range")}function Ht(Tt,$t,Rt,Dt,Kt){return $t=+$t,Rt=Rt>>>0,Kt||rr(Tt,$t,Rt,4),tt.write(Tt,$t,Rt,Dt,23,4),Rt+4}st.prototype.writeFloatLE=function($t,Rt,Dt){return Ht(this,$t,Rt,!0,Dt)},st.prototype.writeFloatBE=function($t,Rt,Dt){return Ht(this,$t,Rt,!1,Dt)};function dr(Tt,$t,Rt,Dt,Kt){return $t=+$t,Rt=Rt>>>0,Kt||rr(Tt,$t,Rt,8),tt.write(Tt,$t,Rt,Dt,52,8),Rt+8}st.prototype.writeDoubleLE=function($t,Rt,Dt){return dr(this,$t,Rt,!0,Dt)},st.prototype.writeDoubleBE=function($t,Rt,Dt){return dr(this,$t,Rt,!1,Dt)},st.prototype.copy=function($t,Rt,Dt,Kt){if(!st.isBuffer($t))throw new TypeError("argument should be a Buffer");if(Dt||(Dt=0),!Kt&&Kt!==0&&(Kt=this.length),Rt>=$t.length&&(Rt=$t.length),Rt||(Rt=0),Kt>0&&Kt=this.length)throw new RangeError("Index out of range");if(Kt<0)throw new RangeError("sourceEnd out of bounds");Kt>this.length&&(Kt=this.length),$t.length-Rt>>0,Dt=Dt===void 0?this.length:Dt>>>0,$t||($t=0);let nr;if(typeof $t=="number")for(nr=Rt;nr2**32?Kt=tr(String(Rt)):typeof Rt=="bigint"&&(Kt=String(Rt),(Rt>BigInt(2)**BigInt(32)||Rt<-(BigInt(2)**BigInt(32)))&&(Kt=tr(Kt)),Kt+="n"),Dt+=` It must be ${$t}. Received ${Kt}`,Dt},RangeError);function tr(Tt){let $t="",Rt=Tt.length;const Dt=Tt[0]==="-"?1:0;for(;Rt>=Dt+4;Rt-=3)$t=`_${Tt.slice(Rt-3,Rt)}${$t}`;return`${Tt.slice(0,Rt)}${$t}`}function _t(Tt,$t,Rt){Vt($t,"offset"),(Tt[$t]===void 0||Tt[$t+Rt]===void 0)&&er($t,Tt.length-(Rt+1))}function Bt(Tt,$t,Rt,Dt,Kt,nr){if(Tt>Rt||Tt<$t){const sr=typeof $t=="bigint"?"n":"";let br;throw $t===0||$t===BigInt(0)?br=`>= 0${sr} and < 2${sr} ** ${(nr+1)*8}${sr}`:br=`>= -(2${sr} ** ${(nr+1)*8-1}${sr}) and < 2 ** ${(nr+1)*8-1}${sr}`,new Zt.ERR_OUT_OF_RANGE("value",br,Tt)}_t(Dt,Kt,nr)}function Vt(Tt,$t){if(typeof Tt!="number")throw new Zt.ERR_INVALID_ARG_TYPE($t,"number",Tt)}function er(Tt,$t,Rt){throw Math.floor(Tt)!==Tt?(Vt(Tt,Rt),new Zt.ERR_OUT_OF_RANGE("offset","an integer",Tt)):$t<0?new Zt.ERR_BUFFER_OUT_OF_BOUNDS:new Zt.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${$t}`,Tt)}const ar=/[^+/0-9A-Za-z-_]/g;function ur(Tt){if(Tt=Tt.split("=")[0],Tt=Tt.trim().replace(ar,""),Tt.length<2)return"";for(;Tt.length%4!==0;)Tt=Tt+"=";return Tt}function cr(Tt,$t){$t=$t||1/0;let Rt;const Dt=Tt.length;let Kt=null;const nr=[];for(let sr=0;sr55295&&Rt<57344){if(!Kt){if(Rt>56319){($t-=3)>-1&&nr.push(239,191,189);continue}else if(sr+1===Dt){($t-=3)>-1&&nr.push(239,191,189);continue}Kt=Rt;continue}if(Rt<56320){($t-=3)>-1&&nr.push(239,191,189),Kt=Rt;continue}Rt=(Kt-55296<<10|Rt-56320)+65536}else Kt&&($t-=3)>-1&&nr.push(239,191,189);if(Kt=null,Rt<128){if(($t-=1)<0)break;nr.push(Rt)}else if(Rt<2048){if(($t-=2)<0)break;nr.push(Rt>>6|192,Rt&63|128)}else if(Rt<65536){if(($t-=3)<0)break;nr.push(Rt>>12|224,Rt>>6&63|128,Rt&63|128)}else if(Rt<1114112){if(($t-=4)<0)break;nr.push(Rt>>18|240,Rt>>12&63|128,Rt>>6&63|128,Rt&63|128)}else throw new Error("Invalid code point")}return nr}function hr(Tt){const $t=[];for(let Rt=0;Rt>8,Kt=Rt%256,nr.push(Kt),nr.push(Dt);return nr}function pr(Tt){return o.toByteArray(ur(Tt))}function wr(Tt,$t,Rt,Dt){let Kt;for(Kt=0;Kt=$t.length||Kt>=Tt.length);++Kt)$t[Kt+Rt]=Tt[Kt];return Kt}function _r(Tt,$t){return Tt instanceof $t||Tt!=null&&Tt.constructor!=null&&Tt.constructor.name!=null&&Tt.constructor.name===$t.name}function Tr(Tt){return Tt!==Tt}const gr=function(){const Tt="0123456789abcdef",$t=new Array(256);for(let Rt=0;Rt<16;++Rt){const Dt=Rt*16;for(let Kt=0;Kt<16;++Kt)$t[Dt+Kt]=Tt[Rt]+Tt[Kt]}return $t}();function vr(Tt){return typeof BigInt>"u"?ir:Tt}function ir(){throw new Error("BigInt not supported")}})(buffer$2);var reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(et){function o(Ft,qt){var Pt=Ft.length;Ft.push(qt);e:for(;0>>1,Qt=Ft[Yt];if(0>>1;Ytnt(rr,Pt))Htnt(dr,rr)?(Ft[Yt]=dr,Ft[Ht]=Pt,Yt=Ht):(Ft[Yt]=rr,Ft[Gt]=Pt,Yt=Gt);else if(Htnt(dr,Pt))Ft[Yt]=dr,Ft[Ht]=Pt,Yt=Ht;else break e}}return qt}function nt(Ft,qt){var Pt=Ft.sortIndex-qt.sortIndex;return Pt!==0?Pt:Ft.id-qt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var ot=performance;et.unstable_now=function(){return ot.now()}}else{var it=Date,st=it.now();et.unstable_now=function(){return it.now()-st}}var at=[],ct=[],lt=1,dt=null,ht=3,mt=!1,ft=!1,pt=!1,yt=typeof setTimeout=="function"?setTimeout:null,gt=typeof clearTimeout=="function"?clearTimeout:null,bt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function xt(Ft){for(var qt=tt(ct);qt!==null;){if(qt.callback===null)rt(ct);else if(qt.startTime<=Ft)rt(ct),qt.sortIndex=qt.expirationTime,o(at,qt);else break;qt=tt(ct)}}function vt(Ft){if(pt=!1,xt(Ft),!ft)if(tt(at)!==null)ft=!0,Xt(Et);else{var qt=tt(ct);qt!==null&&Wt(vt,qt.startTime-Ft)}}function Et(Ft,qt){ft=!1,pt&&(pt=!1,gt(At),At=-1),mt=!0;var Pt=ht;try{for(xt(qt),dt=tt(at);dt!==null&&(!(dt.expirationTime>qt)||Ft&&!Nt());){var Yt=dt.callback;if(typeof Yt=="function"){dt.callback=null,ht=dt.priorityLevel;var Qt=Yt(dt.expirationTime<=qt);qt=et.unstable_now(),typeof Qt=="function"?dt.callback=Qt:dt===tt(at)&&rt(at),xt(qt)}else rt(at);dt=tt(at)}if(dt!==null)var jt=!0;else{var Gt=tt(ct);Gt!==null&&Wt(vt,Gt.startTime-qt),jt=!1}return jt}finally{dt=null,ht=Pt,mt=!1}}var Ct=!1,St=null,At=-1,kt=5,It=-1;function Nt(){return!(et.unstable_now()-ItFt||125Yt?(Ft.sortIndex=Pt,o(ct,Ft),tt(at)===null&&Ft===tt(ct)&&(pt?(gt(At),At=-1):pt=!0,Wt(vt,Pt-Yt))):(Ft.sortIndex=Qt,o(at,Ft),ft||mt||(ft=!0,Xt(Et))),Ft},et.unstable_shouldYield=Nt,et.unstable_wrapCallback=function(Ft){var qt=ht;return function(){var Pt=ht;ht=qt;try{return Ft.apply(this,arguments)}finally{ht=Pt}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var aa=reactExports,ca$1=schedulerExports;function p$4(et){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+et,tt=1;tt"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la={},ma={};function oa(et){return ja.call(ma,et)?!0:ja.call(la,et)?!1:ka.test(et)?ma[et]=!0:(la[et]=!0,!1)}function pa(et,o,tt,rt){if(tt!==null&&tt.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return rt?!1:tt!==null?!tt.acceptsBooleans:(et=et.toLowerCase().slice(0,5),et!=="data-"&&et!=="aria-");default:return!1}}function qa(et,o,tt,rt){if(o===null||typeof o>"u"||pa(et,o,tt,rt))return!0;if(rt)return!1;if(tt!==null)switch(tt.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function v$4(et,o,tt,rt,nt,ot,it){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=rt,this.attributeNamespace=nt,this.mustUseProperty=tt,this.propertyName=et,this.type=o,this.sanitizeURL=ot,this.removeEmptyString=it}var z$2={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(et){z$2[et]=new v$4(et,0,!1,et,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(et){var o=et[0];z$2[o]=new v$4(o,1,!1,et[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(et){z$2[et]=new v$4(et,2,!1,et.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(et){z$2[et]=new v$4(et,2,!1,et,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(et){z$2[et]=new v$4(et,3,!1,et.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(et){z$2[et]=new v$4(et,3,!0,et,null,!1,!1)});["capture","download"].forEach(function(et){z$2[et]=new v$4(et,4,!1,et,null,!1,!1)});["cols","rows","size","span"].forEach(function(et){z$2[et]=new v$4(et,6,!1,et,null,!1,!1)});["rowSpan","start"].forEach(function(et){z$2[et]=new v$4(et,5,!1,et.toLowerCase(),null,!1,!1)});var ra$1=/[\-:]([a-z])/g;function sa(et){return et[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(et){var o=et.replace(ra$1,sa);z$2[o]=new v$4(o,1,!1,et,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(et){var o=et.replace(ra$1,sa);z$2[o]=new v$4(o,1,!1,et,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(et){var o=et.replace(ra$1,sa);z$2[o]=new v$4(o,1,!1,et,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(et){z$2[et]=new v$4(et,1,!1,et.toLowerCase(),null,!1,!1)});z$2.xlinkHref=new v$4("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(et){z$2[et]=new v$4(et,1,!1,et.toLowerCase(),null,!0,!0)});function ta(et,o,tt,rt){var nt=z$2.hasOwnProperty(o)?z$2[o]:null;(nt!==null?nt.type!==0:rt||!(2st||nt[it]!==ot[st]){var at=` -`+nt[it].replace(" at new "," at ");return et.displayName&&at.includes("")&&(at=at.replace("",et.displayName)),at}while(1<=it&&0<=st);break}}}finally{Na=!1,Error.prepareStackTrace=tt}return(et=et?et.displayName||et.name:"")?Ma(et):""}function Pa(et){switch(et.tag){case 5:return Ma(et.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return et=Oa(et.type,!1),et;case 11:return et=Oa(et.type.render,!1),et;case 1:return et=Oa(et.type,!0),et;default:return""}}function Qa(et){if(et==null)return null;if(typeof et=="function")return et.displayName||et.name||null;if(typeof et=="string")return et;switch(et){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof et=="object")switch(et.$$typeof){case Ca:return(et.displayName||"Context")+".Consumer";case Ba:return(et._context.displayName||"Context")+".Provider";case Da:var o=et.render;return et=et.displayName,et||(et=o.displayName||o.name||"",et=et!==""?"ForwardRef("+et+")":"ForwardRef"),et;case Ga:return o=et.displayName||null,o!==null?o:Qa(et.type)||"Memo";case Ha:o=et._payload,et=et._init;try{return Qa(et(o))}catch{}}return null}function Ra(et){var o=et.type;switch(et.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return et=o.render,et=et.displayName||et.name||"",o.displayName||(et!==""?"ForwardRef("+et+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(o);case 8:return o===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Sa(et){switch(typeof et){case"boolean":case"number":case"string":case"undefined":return et;case"object":return et;default:return""}}function Ta(et){var o=et.type;return(et=et.nodeName)&&et.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Ua(et){var o=Ta(et)?"checked":"value",tt=Object.getOwnPropertyDescriptor(et.constructor.prototype,o),rt=""+et[o];if(!et.hasOwnProperty(o)&&typeof tt<"u"&&typeof tt.get=="function"&&typeof tt.set=="function"){var nt=tt.get,ot=tt.set;return Object.defineProperty(et,o,{configurable:!0,get:function(){return nt.call(this)},set:function(it){rt=""+it,ot.call(this,it)}}),Object.defineProperty(et,o,{enumerable:tt.enumerable}),{getValue:function(){return rt},setValue:function(it){rt=""+it},stopTracking:function(){et._valueTracker=null,delete et[o]}}}}function Va(et){et._valueTracker||(et._valueTracker=Ua(et))}function Wa(et){if(!et)return!1;var o=et._valueTracker;if(!o)return!0;var tt=o.getValue(),rt="";return et&&(rt=Ta(et)?et.checked?"true":"false":et.value),et=rt,et!==tt?(o.setValue(et),!0):!1}function Xa(et){if(et=et||(typeof document<"u"?document:void 0),typeof et>"u")return null;try{return et.activeElement||et.body}catch{return et.body}}function Ya(et,o){var tt=o.checked;return A$1({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:tt??et._wrapperState.initialChecked})}function Za(et,o){var tt=o.defaultValue==null?"":o.defaultValue,rt=o.checked!=null?o.checked:o.defaultChecked;tt=Sa(o.value!=null?o.value:tt),et._wrapperState={initialChecked:rt,initialValue:tt,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function ab(et,o){o=o.checked,o!=null&&ta(et,"checked",o,!1)}function bb(et,o){ab(et,o);var tt=Sa(o.value),rt=o.type;if(tt!=null)rt==="number"?(tt===0&&et.value===""||et.value!=tt)&&(et.value=""+tt):et.value!==""+tt&&(et.value=""+tt);else if(rt==="submit"||rt==="reset"){et.removeAttribute("value");return}o.hasOwnProperty("value")?cb$1(et,o.type,tt):o.hasOwnProperty("defaultValue")&&cb$1(et,o.type,Sa(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(et.defaultChecked=!!o.defaultChecked)}function db(et,o,tt){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var rt=o.type;if(!(rt!=="submit"&&rt!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+et._wrapperState.initialValue,tt||o===et.value||(et.value=o),et.defaultValue=o}tt=et.name,tt!==""&&(et.name=""),et.defaultChecked=!!et._wrapperState.initialChecked,tt!==""&&(et.name=tt)}function cb$1(et,o,tt){(o!=="number"||Xa(et.ownerDocument)!==et)&&(tt==null?et.defaultValue=""+et._wrapperState.initialValue:et.defaultValue!==""+tt&&(et.defaultValue=""+tt))}var eb=Array.isArray;function fb(et,o,tt,rt){if(et=et.options,o){o={};for(var nt=0;nt"+o.valueOf().toString()+"",o=mb.firstChild;et.firstChild;)et.removeChild(et.firstChild);for(;o.firstChild;)et.appendChild(o.firstChild)}});function ob(et,o){if(o){var tt=et.firstChild;if(tt&&tt===et.lastChild&&tt.nodeType===3){tt.nodeValue=o;return}}et.textContent=o}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(et){qb.forEach(function(o){o=o+et.charAt(0).toUpperCase()+et.substring(1),pb[o]=pb[et]})});function rb(et,o,tt){return o==null||typeof o=="boolean"||o===""?"":tt||typeof o!="number"||o===0||pb.hasOwnProperty(et)&&pb[et]?(""+o).trim():o+"px"}function sb(et,o){et=et.style;for(var tt in o)if(o.hasOwnProperty(tt)){var rt=tt.indexOf("--")===0,nt=rb(tt,o[tt],rt);tt==="float"&&(tt="cssFloat"),rt?et.setProperty(tt,nt):et[tt]=nt}}var tb=A$1({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(et,o){if(o){if(tb[et]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(p$4(137,et));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(p$4(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(p$4(61))}if(o.style!=null&&typeof o.style!="object")throw Error(p$4(62))}}function vb(et,o){if(et.indexOf("-")===-1)return typeof o.is=="string";switch(et){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=null;function xb(et){return et=et.target||et.srcElement||window,et.correspondingUseElement&&(et=et.correspondingUseElement),et.nodeType===3?et.parentNode:et}var yb=null,zb=null,Ab=null;function Bb(et){if(et=Cb(et)){if(typeof yb!="function")throw Error(p$4(280));var o=et.stateNode;o&&(o=Db(o),yb(et.stateNode,et.type,o))}}function Eb(et){zb?Ab?Ab.push(et):Ab=[et]:zb=et}function Fb(){if(zb){var et=zb,o=Ab;if(Ab=zb=null,Bb(et),o)for(et=0;et>>=0,et===0?32:31-(pc(et)/qc|0)|0}var rc=64,sc=4194304;function tc(et){switch(et&-et){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return et&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return et&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return et}}function uc(et,o){var tt=et.pendingLanes;if(tt===0)return 0;var rt=0,nt=et.suspendedLanes,ot=et.pingedLanes,it=tt&268435455;if(it!==0){var st=it&~nt;st!==0?rt=tc(st):(ot&=it,ot!==0&&(rt=tc(ot)))}else it=tt&~nt,it!==0?rt=tc(it):ot!==0&&(rt=tc(ot));if(rt===0)return 0;if(o!==0&&o!==rt&&!(o&nt)&&(nt=rt&-rt,ot=o&-o,nt>=ot||nt===16&&(ot&4194240)!==0))return o;if(rt&4&&(rt|=tt&16),o=et.entangledLanes,o!==0)for(et=et.entanglements,o&=rt;0tt;tt++)o.push(et);return o}function Ac(et,o,tt){et.pendingLanes|=o,o!==536870912&&(et.suspendedLanes=0,et.pingedLanes=0),et=et.eventTimes,o=31-oc(o),et[o]=tt}function Bc(et,o){var tt=et.pendingLanes&~o;et.pendingLanes=o,et.suspendedLanes=0,et.pingedLanes=0,et.expiredLanes&=o,et.mutableReadLanes&=o,et.entangledLanes&=o,o=et.entanglements;var rt=et.eventTimes;for(et=et.expirationTimes;0=be$1),ee$1=" ",fe$1=!1;function ge$1(et,o){switch(et){case"keyup":return $d.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he$1(et){return et=et.detail,typeof et=="object"&&"data"in et?et.data:null}var ie$1=!1;function je$1(et,o){switch(et){case"compositionend":return he$1(o);case"keypress":return o.which!==32?null:(fe$1=!0,ee$1);case"textInput":return et=o.data,et===ee$1&&fe$1?null:et;default:return null}}function ke$1(et,o){if(ie$1)return et==="compositionend"||!ae$1&&ge$1(et,o)?(et=nd(),md=ld=kd=null,ie$1=!1,et):null;switch(et){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:tt,offset:o-et};et=rt}e:{for(;tt;){if(tt.nextSibling){tt=tt.nextSibling;break e}tt=tt.parentNode}tt=void 0}tt=Je(tt)}}function Le$1(et,o){return et&&o?et===o?!0:et&&et.nodeType===3?!1:o&&o.nodeType===3?Le$1(et,o.parentNode):"contains"in et?et.contains(o):et.compareDocumentPosition?!!(et.compareDocumentPosition(o)&16):!1:!1}function Me$1(){for(var et=window,o=Xa();o instanceof et.HTMLIFrameElement;){try{var tt=typeof o.contentWindow.location.href=="string"}catch{tt=!1}if(tt)et=o.contentWindow;else break;o=Xa(et.document)}return o}function Ne$1(et){var o=et&&et.nodeName&&et.nodeName.toLowerCase();return o&&(o==="input"&&(et.type==="text"||et.type==="search"||et.type==="tel"||et.type==="url"||et.type==="password")||o==="textarea"||et.contentEditable==="true")}function Oe$1(et){var o=Me$1(),tt=et.focusedElem,rt=et.selectionRange;if(o!==tt&&tt&&tt.ownerDocument&&Le$1(tt.ownerDocument.documentElement,tt)){if(rt!==null&&Ne$1(tt)){if(o=rt.start,et=rt.end,et===void 0&&(et=o),"selectionStart"in tt)tt.selectionStart=o,tt.selectionEnd=Math.min(et,tt.value.length);else if(et=(o=tt.ownerDocument||document)&&o.defaultView||window,et.getSelection){et=et.getSelection();var nt=tt.textContent.length,ot=Math.min(rt.start,nt);rt=rt.end===void 0?ot:Math.min(rt.end,nt),!et.extend&&ot>rt&&(nt=rt,rt=ot,ot=nt),nt=Ke(tt,ot);var it=Ke(tt,rt);nt&&it&&(et.rangeCount!==1||et.anchorNode!==nt.node||et.anchorOffset!==nt.offset||et.focusNode!==it.node||et.focusOffset!==it.offset)&&(o=o.createRange(),o.setStart(nt.node,nt.offset),et.removeAllRanges(),ot>rt?(et.addRange(o),et.extend(it.node,it.offset)):(o.setEnd(it.node,it.offset),et.addRange(o)))}}for(o=[],et=tt;et=et.parentNode;)et.nodeType===1&&o.push({element:et,left:et.scrollLeft,top:et.scrollTop});for(typeof tt.focus=="function"&&tt.focus(),tt=0;tt=document.documentMode,Qe=null,Re$1=null,Se$1=null,Te$1=!1;function Ue(et,o,tt){var rt=tt.window===tt?tt.document:tt.nodeType===9?tt:tt.ownerDocument;Te$1||Qe==null||Qe!==Xa(rt)||(rt=Qe,"selectionStart"in rt&&Ne$1(rt)?rt={start:rt.selectionStart,end:rt.selectionEnd}:(rt=(rt.ownerDocument&&rt.ownerDocument.defaultView||window).getSelection(),rt={anchorNode:rt.anchorNode,anchorOffset:rt.anchorOffset,focusNode:rt.focusNode,focusOffset:rt.focusOffset}),Se$1&&Ie(Se$1,rt)||(Se$1=rt,rt=oe$1(Re$1,"onSelect"),0Tf||(et.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G$1(et,o){Tf++,Sf[Tf]=et.current,et.current=o}var Vf={},H$1=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(et,o){var tt=et.type.contextTypes;if(!tt)return Vf;var rt=et.stateNode;if(rt&&rt.__reactInternalMemoizedUnmaskedChildContext===o)return rt.__reactInternalMemoizedMaskedChildContext;var nt={},ot;for(ot in tt)nt[ot]=o[ot];return rt&&(et=et.stateNode,et.__reactInternalMemoizedUnmaskedChildContext=o,et.__reactInternalMemoizedMaskedChildContext=nt),nt}function Zf(et){return et=et.childContextTypes,et!=null}function $f(){E$1(Wf),E$1(H$1)}function ag(et,o,tt){if(H$1.current!==Vf)throw Error(p$4(168));G$1(H$1,o),G$1(Wf,tt)}function bg(et,o,tt){var rt=et.stateNode;if(o=o.childContextTypes,typeof rt.getChildContext!="function")return tt;rt=rt.getChildContext();for(var nt in rt)if(!(nt in o))throw Error(p$4(108,Ra(et)||"Unknown",nt));return A$1({},tt,rt)}function cg(et){return et=(et=et.stateNode)&&et.__reactInternalMemoizedMergedChildContext||Vf,Xf=H$1.current,G$1(H$1,et),G$1(Wf,Wf.current),!0}function dg(et,o,tt){var rt=et.stateNode;if(!rt)throw Error(p$4(169));tt?(et=bg(et,o,Xf),rt.__reactInternalMemoizedMergedChildContext=et,E$1(Wf),E$1(H$1),G$1(H$1,et)):E$1(Wf),G$1(Wf,tt)}var eg=null,fg=!1,gg=!1;function hg(et){eg===null?eg=[et]:eg.push(et)}function ig(et){fg=!0,hg(et)}function jg(){if(!gg&&eg!==null){gg=!0;var et=0,o=C$1;try{var tt=eg;for(C$1=1;et>=it,nt-=it,rg=1<<32-oc(o)+nt|tt<At?(kt=St,St=null):kt=St.sibling;var It=ht(gt,St,xt[At],vt);if(It===null){St===null&&(St=kt);break}et&&St&&It.alternate===null&&o(gt,St),bt=ot(It,bt,At),Ct===null?Et=It:Ct.sibling=It,Ct=It,St=kt}if(At===xt.length)return tt(gt,St),I$1&&tg(gt,At),Et;if(St===null){for(;AtAt?(kt=St,St=null):kt=St.sibling;var Nt=ht(gt,St,It.value,vt);if(Nt===null){St===null&&(St=kt);break}et&&St&&Nt.alternate===null&&o(gt,St),bt=ot(Nt,bt,At),Ct===null?Et=Nt:Ct.sibling=Nt,Ct=Nt,St=kt}if(It.done)return tt(gt,St),I$1&&tg(gt,At),Et;if(St===null){for(;!It.done;At++,It=xt.next())It=dt(gt,It.value,vt),It!==null&&(bt=ot(It,bt,At),Ct===null?Et=It:Ct.sibling=It,Ct=It);return I$1&&tg(gt,At),Et}for(St=rt(gt,St);!It.done;At++,It=xt.next())It=mt(St,gt,At,It.value,vt),It!==null&&(et&&It.alternate!==null&&St.delete(It.key===null?At:It.key),bt=ot(It,bt,At),Ct===null?Et=It:Ct.sibling=It,Ct=It);return et&&St.forEach(function(Lt){return o(gt,Lt)}),I$1&&tg(gt,At),Et}function yt(gt,bt,xt,vt){if(typeof xt=="object"&&xt!==null&&xt.type===ya&&xt.key===null&&(xt=xt.props.children),typeof xt=="object"&&xt!==null){switch(xt.$$typeof){case va:e:{for(var Et=xt.key,Ct=bt;Ct!==null;){if(Ct.key===Et){if(Et=xt.type,Et===ya){if(Ct.tag===7){tt(gt,Ct.sibling),bt=nt(Ct,xt.props.children),bt.return=gt,gt=bt;break e}}else if(Ct.elementType===Et||typeof Et=="object"&&Et!==null&&Et.$$typeof===Ha&&Ng(Et)===Ct.type){tt(gt,Ct.sibling),bt=nt(Ct,xt.props),bt.ref=Lg(gt,Ct,xt),bt.return=gt,gt=bt;break e}tt(gt,Ct);break}else o(gt,Ct);Ct=Ct.sibling}xt.type===ya?(bt=Tg(xt.props.children,gt.mode,vt,xt.key),bt.return=gt,gt=bt):(vt=Rg(xt.type,xt.key,xt.props,null,gt.mode,vt),vt.ref=Lg(gt,bt,xt),vt.return=gt,gt=vt)}return it(gt);case wa:e:{for(Ct=xt.key;bt!==null;){if(bt.key===Ct)if(bt.tag===4&&bt.stateNode.containerInfo===xt.containerInfo&&bt.stateNode.implementation===xt.implementation){tt(gt,bt.sibling),bt=nt(bt,xt.children||[]),bt.return=gt,gt=bt;break e}else{tt(gt,bt);break}else o(gt,bt);bt=bt.sibling}bt=Sg(xt,gt.mode,vt),bt.return=gt,gt=bt}return it(gt);case Ha:return Ct=xt._init,yt(gt,bt,Ct(xt._payload),vt)}if(eb(xt))return ft(gt,bt,xt,vt);if(Ka(xt))return pt(gt,bt,xt,vt);Mg(gt,xt)}return typeof xt=="string"&&xt!==""||typeof xt=="number"?(xt=""+xt,bt!==null&&bt.tag===6?(tt(gt,bt.sibling),bt=nt(bt,xt),bt.return=gt,gt=bt):(tt(gt,bt),bt=Qg(xt,gt.mode,vt),bt.return=gt,gt=bt),it(gt)):tt(gt,bt)}return yt}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(et){var o=Wg.current;E$1(Wg),et._currentValue=o}function bh(et,o,tt){for(;et!==null;){var rt=et.alternate;if((et.childLanes&o)!==o?(et.childLanes|=o,rt!==null&&(rt.childLanes|=o)):rt!==null&&(rt.childLanes&o)!==o&&(rt.childLanes|=o),et===tt)break;et=et.return}}function ch(et,o){Xg=et,Zg=Yg=null,et=et.dependencies,et!==null&&et.firstContext!==null&&(et.lanes&o&&(dh=!0),et.firstContext=null)}function eh(et){var o=et._currentValue;if(Zg!==et)if(et={context:et,memoizedValue:o,next:null},Yg===null){if(Xg===null)throw Error(p$4(308));Yg=et,Xg.dependencies={lanes:0,firstContext:et}}else Yg=Yg.next=et;return o}var fh=null;function gh(et){fh===null?fh=[et]:fh.push(et)}function hh(et,o,tt,rt){var nt=o.interleaved;return nt===null?(tt.next=tt,gh(o)):(tt.next=nt.next,nt.next=tt),o.interleaved=tt,ih(et,rt)}function ih(et,o){et.lanes|=o;var tt=et.alternate;for(tt!==null&&(tt.lanes|=o),tt=et,et=et.return;et!==null;)et.childLanes|=o,tt=et.alternate,tt!==null&&(tt.childLanes|=o),tt=et,et=et.return;return tt.tag===3?tt.stateNode:null}var jh=!1;function kh(et){et.updateQueue={baseState:et.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(et,o){et=et.updateQueue,o.updateQueue===et&&(o.updateQueue={baseState:et.baseState,firstBaseUpdate:et.firstBaseUpdate,lastBaseUpdate:et.lastBaseUpdate,shared:et.shared,effects:et.effects})}function mh(et,o){return{eventTime:et,lane:o,tag:0,payload:null,callback:null,next:null}}function nh(et,o,tt){var rt=et.updateQueue;if(rt===null)return null;if(rt=rt.shared,K$1&2){var nt=rt.pending;return nt===null?o.next=o:(o.next=nt.next,nt.next=o),rt.pending=o,ih(et,tt)}return nt=rt.interleaved,nt===null?(o.next=o,gh(rt)):(o.next=nt.next,nt.next=o),rt.interleaved=o,ih(et,tt)}function oh(et,o,tt){if(o=o.updateQueue,o!==null&&(o=o.shared,(tt&4194240)!==0)){var rt=o.lanes;rt&=et.pendingLanes,tt|=rt,o.lanes=tt,Cc(et,tt)}}function ph(et,o){var tt=et.updateQueue,rt=et.alternate;if(rt!==null&&(rt=rt.updateQueue,tt===rt)){var nt=null,ot=null;if(tt=tt.firstBaseUpdate,tt!==null){do{var it={eventTime:tt.eventTime,lane:tt.lane,tag:tt.tag,payload:tt.payload,callback:tt.callback,next:null};ot===null?nt=ot=it:ot=ot.next=it,tt=tt.next}while(tt!==null);ot===null?nt=ot=o:ot=ot.next=o}else nt=ot=o;tt={baseState:rt.baseState,firstBaseUpdate:nt,lastBaseUpdate:ot,shared:rt.shared,effects:rt.effects},et.updateQueue=tt;return}et=tt.lastBaseUpdate,et===null?tt.firstBaseUpdate=o:et.next=o,tt.lastBaseUpdate=o}function qh(et,o,tt,rt){var nt=et.updateQueue;jh=!1;var ot=nt.firstBaseUpdate,it=nt.lastBaseUpdate,st=nt.shared.pending;if(st!==null){nt.shared.pending=null;var at=st,ct=at.next;at.next=null,it===null?ot=ct:it.next=ct,it=at;var lt=et.alternate;lt!==null&&(lt=lt.updateQueue,st=lt.lastBaseUpdate,st!==it&&(st===null?lt.firstBaseUpdate=ct:st.next=ct,lt.lastBaseUpdate=at))}if(ot!==null){var dt=nt.baseState;it=0,lt=ct=at=null,st=ot;do{var ht=st.lane,mt=st.eventTime;if((rt&ht)===ht){lt!==null&&(lt=lt.next={eventTime:mt,lane:0,tag:st.tag,payload:st.payload,callback:st.callback,next:null});e:{var ft=et,pt=st;switch(ht=o,mt=tt,pt.tag){case 1:if(ft=pt.payload,typeof ft=="function"){dt=ft.call(mt,dt,ht);break e}dt=ft;break e;case 3:ft.flags=ft.flags&-65537|128;case 0:if(ft=pt.payload,ht=typeof ft=="function"?ft.call(mt,dt,ht):ft,ht==null)break e;dt=A$1({},dt,ht);break e;case 2:jh=!0}}st.callback!==null&&st.lane!==0&&(et.flags|=64,ht=nt.effects,ht===null?nt.effects=[st]:ht.push(st))}else mt={eventTime:mt,lane:ht,tag:st.tag,payload:st.payload,callback:st.callback,next:null},lt===null?(ct=lt=mt,at=dt):lt=lt.next=mt,it|=ht;if(st=st.next,st===null){if(st=nt.shared.pending,st===null)break;ht=st,st=ht.next,ht.next=null,nt.lastBaseUpdate=ht,nt.shared.pending=null}}while(!0);if(lt===null&&(at=dt),nt.baseState=at,nt.firstBaseUpdate=ct,nt.lastBaseUpdate=lt,o=nt.shared.interleaved,o!==null){nt=o;do it|=nt.lane,nt=nt.next;while(nt!==o)}else ot===null&&(nt.shared.lanes=0);rh|=it,et.lanes=it,et.memoizedState=dt}}function sh(et,o,tt){if(et=o.effects,o.effects=null,et!==null)for(o=0;ott?tt:4,et(!0);var rt=Gh.transition;Gh.transition={};try{et(!1),o()}finally{C$1=tt,Gh.transition=rt}}function wi(){return Uh().memoizedState}function xi(et,o,tt){var rt=yi(et);if(tt={lane:rt,action:tt,hasEagerState:!1,eagerState:null,next:null},zi(et))Ai(o,tt);else if(tt=hh(et,o,tt,rt),tt!==null){var nt=R();gi(tt,et,rt,nt),Bi(tt,o,rt)}}function ii(et,o,tt){var rt=yi(et),nt={lane:rt,action:tt,hasEagerState:!1,eagerState:null,next:null};if(zi(et))Ai(o,nt);else{var ot=et.alternate;if(et.lanes===0&&(ot===null||ot.lanes===0)&&(ot=o.lastRenderedReducer,ot!==null))try{var it=o.lastRenderedState,st=ot(it,tt);if(nt.hasEagerState=!0,nt.eagerState=st,He(st,it)){var at=o.interleaved;at===null?(nt.next=nt,gh(o)):(nt.next=at.next,at.next=nt),o.interleaved=nt;return}}catch{}finally{}tt=hh(et,o,nt,rt),tt!==null&&(nt=R(),gi(tt,et,rt,nt),Bi(tt,o,rt))}}function zi(et){var o=et.alternate;return et===M$1||o!==null&&o===M$1}function Ai(et,o){Jh=Ih=!0;var tt=et.pending;tt===null?o.next=o:(o.next=tt.next,tt.next=o),et.pending=o}function Bi(et,o,tt){if(tt&4194240){var rt=o.lanes;rt&=et.pendingLanes,tt|=rt,o.lanes=tt,Cc(et,tt)}}var Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(et,o){return Th().memoizedState=[et,o===void 0?null:o],et},useContext:eh,useEffect:mi,useImperativeHandle:function(et,o,tt){return tt=tt!=null?tt.concat([et]):null,ki(4194308,4,pi.bind(null,o,et),tt)},useLayoutEffect:function(et,o){return ki(4194308,4,et,o)},useInsertionEffect:function(et,o){return ki(4,2,et,o)},useMemo:function(et,o){var tt=Th();return o=o===void 0?null:o,et=et(),tt.memoizedState=[et,o],et},useReducer:function(et,o,tt){var rt=Th();return o=tt!==void 0?tt(o):o,rt.memoizedState=rt.baseState=o,et={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:et,lastRenderedState:o},rt.queue=et,et=et.dispatch=xi.bind(null,M$1,et),[rt.memoizedState,et]},useRef:function(et){var o=Th();return et={current:et},o.memoizedState=et},useState:hi,useDebugValue:ri,useDeferredValue:function(et){return Th().memoizedState=et},useTransition:function(){var et=hi(!1),o=et[0];return et=vi.bind(null,et[1]),Th().memoizedState=et,[o,et]},useMutableSource:function(){},useSyncExternalStore:function(et,o,tt){var rt=M$1,nt=Th();if(I$1){if(tt===void 0)throw Error(p$4(407));tt=tt()}else{if(tt=o(),Q$1===null)throw Error(p$4(349));Hh&30||di(rt,o,tt)}nt.memoizedState=tt;var ot={value:tt,getSnapshot:o};return nt.queue=ot,mi(ai.bind(null,rt,ot,et),[et]),rt.flags|=2048,bi(9,ci.bind(null,rt,ot,tt,o),void 0,null),tt},useId:function(){var et=Th(),o=Q$1.identifierPrefix;if(I$1){var tt=sg,rt=rg;tt=(rt&~(1<<32-oc(rt)-1)).toString(32)+tt,o=":"+o+"R"+tt,tt=Kh++,0<\/script>",et=et.removeChild(et.firstChild)):typeof rt.is=="string"?et=it.createElement(tt,{is:rt.is}):(et=it.createElement(tt),tt==="select"&&(it=et,rt.multiple?it.multiple=!0:rt.size&&(it.size=rt.size))):et=it.createElementNS(et,tt),et[Of]=o,et[Pf]=rt,zj(et,o,!1,!1),o.stateNode=et;e:{switch(it=vb(tt,rt),tt){case"dialog":D$1("cancel",et),D$1("close",et),nt=rt;break;case"iframe":case"object":case"embed":D$1("load",et),nt=rt;break;case"video":case"audio":for(nt=0;ntGj&&(o.flags|=128,rt=!0,Dj(ot,!1),o.lanes=4194304)}else{if(!rt)if(et=Ch(it),et!==null){if(o.flags|=128,rt=!0,tt=et.updateQueue,tt!==null&&(o.updateQueue=tt,o.flags|=4),Dj(ot,!0),ot.tail===null&&ot.tailMode==="hidden"&&!it.alternate&&!I$1)return S$1(o),null}else 2*B$1()-ot.renderingStartTime>Gj&&tt!==1073741824&&(o.flags|=128,rt=!0,Dj(ot,!1),o.lanes=4194304);ot.isBackwards?(it.sibling=o.child,o.child=it):(tt=ot.last,tt!==null?tt.sibling=it:o.child=it,ot.last=it)}return ot.tail!==null?(o=ot.tail,ot.rendering=o,ot.tail=o.sibling,ot.renderingStartTime=B$1(),o.sibling=null,tt=L$1.current,G$1(L$1,rt?tt&1|2:tt&1),o):(S$1(o),null);case 22:case 23:return Hj(),rt=o.memoizedState!==null,et!==null&&et.memoizedState!==null!==rt&&(o.flags|=8192),rt&&o.mode&1?fj&1073741824&&(S$1(o),o.subtreeFlags&6&&(o.flags|=8192)):S$1(o),null;case 24:return null;case 25:return null}throw Error(p$4(156,o.tag))}function Ij(et,o){switch(wg(o),o.tag){case 1:return Zf(o.type)&&$f(),et=o.flags,et&65536?(o.flags=et&-65537|128,o):null;case 3:return zh(),E$1(Wf),E$1(H$1),Eh(),et=o.flags,et&65536&&!(et&128)?(o.flags=et&-65537|128,o):null;case 5:return Bh(o),null;case 13:if(E$1(L$1),et=o.memoizedState,et!==null&&et.dehydrated!==null){if(o.alternate===null)throw Error(p$4(340));Ig()}return et=o.flags,et&65536?(o.flags=et&-65537|128,o):null;case 19:return E$1(L$1),null;case 4:return zh(),null;case 10:return ah(o.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U$1=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V$2=null;function Lj(et,o){var tt=et.ref;if(tt!==null)if(typeof tt=="function")try{tt(null)}catch(rt){W$1(et,o,rt)}else tt.current=null}function Mj(et,o,tt){try{tt()}catch(rt){W$1(et,o,rt)}}var Nj=!1;function Oj(et,o){if(Cf=dd,et=Me$1(),Ne$1(et)){if("selectionStart"in et)var tt={start:et.selectionStart,end:et.selectionEnd};else e:{tt=(tt=et.ownerDocument)&&tt.defaultView||window;var rt=tt.getSelection&&tt.getSelection();if(rt&&rt.rangeCount!==0){tt=rt.anchorNode;var nt=rt.anchorOffset,ot=rt.focusNode;rt=rt.focusOffset;try{tt.nodeType,ot.nodeType}catch{tt=null;break e}var it=0,st=-1,at=-1,ct=0,lt=0,dt=et,ht=null;t:for(;;){for(var mt;dt!==tt||nt!==0&&dt.nodeType!==3||(st=it+nt),dt!==ot||rt!==0&&dt.nodeType!==3||(at=it+rt),dt.nodeType===3&&(it+=dt.nodeValue.length),(mt=dt.firstChild)!==null;)ht=dt,dt=mt;for(;;){if(dt===et)break t;if(ht===tt&&++ct===nt&&(st=it),ht===ot&&++lt===rt&&(at=it),(mt=dt.nextSibling)!==null)break;dt=ht,ht=dt.parentNode}dt=mt}tt=st===-1||at===-1?null:{start:st,end:at}}else tt=null}tt=tt||{start:0,end:0}}else tt=null;for(Df={focusedElem:et,selectionRange:tt},dd=!1,V$2=o;V$2!==null;)if(o=V$2,et=o.child,(o.subtreeFlags&1028)!==0&&et!==null)et.return=o,V$2=et;else for(;V$2!==null;){o=V$2;try{var ft=o.alternate;if(o.flags&1024)switch(o.tag){case 0:case 11:case 15:break;case 1:if(ft!==null){var pt=ft.memoizedProps,yt=ft.memoizedState,gt=o.stateNode,bt=gt.getSnapshotBeforeUpdate(o.elementType===o.type?pt:Ci(o.type,pt),yt);gt.__reactInternalSnapshotBeforeUpdate=bt}break;case 3:var xt=o.stateNode.containerInfo;xt.nodeType===1?xt.textContent="":xt.nodeType===9&&xt.documentElement&&xt.removeChild(xt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$4(163))}}catch(vt){W$1(o,o.return,vt)}if(et=o.sibling,et!==null){et.return=o.return,V$2=et;break}V$2=o.return}return ft=Nj,Nj=!1,ft}function Pj(et,o,tt){var rt=o.updateQueue;if(rt=rt!==null?rt.lastEffect:null,rt!==null){var nt=rt=rt.next;do{if((nt.tag&et)===et){var ot=nt.destroy;nt.destroy=void 0,ot!==void 0&&Mj(o,tt,ot)}nt=nt.next}while(nt!==rt)}}function Qj(et,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var tt=o=o.next;do{if((tt.tag&et)===et){var rt=tt.create;tt.destroy=rt()}tt=tt.next}while(tt!==o)}}function Rj(et){var o=et.ref;if(o!==null){var tt=et.stateNode;switch(et.tag){case 5:et=tt;break;default:et=tt}typeof o=="function"?o(et):o.current=et}}function Sj(et){var o=et.alternate;o!==null&&(et.alternate=null,Sj(o)),et.child=null,et.deletions=null,et.sibling=null,et.tag===5&&(o=et.stateNode,o!==null&&(delete o[Of],delete o[Pf],delete o[of],delete o[Qf],delete o[Rf])),et.stateNode=null,et.return=null,et.dependencies=null,et.memoizedProps=null,et.memoizedState=null,et.pendingProps=null,et.stateNode=null,et.updateQueue=null}function Tj(et){return et.tag===5||et.tag===3||et.tag===4}function Uj(et){e:for(;;){for(;et.sibling===null;){if(et.return===null||Tj(et.return))return null;et=et.return}for(et.sibling.return=et.return,et=et.sibling;et.tag!==5&&et.tag!==6&&et.tag!==18;){if(et.flags&2||et.child===null||et.tag===4)continue e;et.child.return=et,et=et.child}if(!(et.flags&2))return et.stateNode}}function Vj(et,o,tt){var rt=et.tag;if(rt===5||rt===6)et=et.stateNode,o?tt.nodeType===8?tt.parentNode.insertBefore(et,o):tt.insertBefore(et,o):(tt.nodeType===8?(o=tt.parentNode,o.insertBefore(et,tt)):(o=tt,o.appendChild(et)),tt=tt._reactRootContainer,tt!=null||o.onclick!==null||(o.onclick=Bf));else if(rt!==4&&(et=et.child,et!==null))for(Vj(et,o,tt),et=et.sibling;et!==null;)Vj(et,o,tt),et=et.sibling}function Wj(et,o,tt){var rt=et.tag;if(rt===5||rt===6)et=et.stateNode,o?tt.insertBefore(et,o):tt.appendChild(et);else if(rt!==4&&(et=et.child,et!==null))for(Wj(et,o,tt),et=et.sibling;et!==null;)Wj(et,o,tt),et=et.sibling}var X$1=null,Xj=!1;function Yj(et,o,tt){for(tt=tt.child;tt!==null;)Zj(et,o,tt),tt=tt.sibling}function Zj(et,o,tt){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,tt)}catch{}switch(tt.tag){case 5:U$1||Lj(tt,o);case 6:var rt=X$1,nt=Xj;X$1=null,Yj(et,o,tt),X$1=rt,Xj=nt,X$1!==null&&(Xj?(et=X$1,tt=tt.stateNode,et.nodeType===8?et.parentNode.removeChild(tt):et.removeChild(tt)):X$1.removeChild(tt.stateNode));break;case 18:X$1!==null&&(Xj?(et=X$1,tt=tt.stateNode,et.nodeType===8?Kf(et.parentNode,tt):et.nodeType===1&&Kf(et,tt),bd(et)):Kf(X$1,tt.stateNode));break;case 4:rt=X$1,nt=Xj,X$1=tt.stateNode.containerInfo,Xj=!0,Yj(et,o,tt),X$1=rt,Xj=nt;break;case 0:case 11:case 14:case 15:if(!U$1&&(rt=tt.updateQueue,rt!==null&&(rt=rt.lastEffect,rt!==null))){nt=rt=rt.next;do{var ot=nt,it=ot.destroy;ot=ot.tag,it!==void 0&&(ot&2||ot&4)&&Mj(tt,o,it),nt=nt.next}while(nt!==rt)}Yj(et,o,tt);break;case 1:if(!U$1&&(Lj(tt,o),rt=tt.stateNode,typeof rt.componentWillUnmount=="function"))try{rt.props=tt.memoizedProps,rt.state=tt.memoizedState,rt.componentWillUnmount()}catch(st){W$1(tt,o,st)}Yj(et,o,tt);break;case 21:Yj(et,o,tt);break;case 22:tt.mode&1?(U$1=(rt=U$1)||tt.memoizedState!==null,Yj(et,o,tt),U$1=rt):Yj(et,o,tt);break;default:Yj(et,o,tt)}}function ak(et){var o=et.updateQueue;if(o!==null){et.updateQueue=null;var tt=et.stateNode;tt===null&&(tt=et.stateNode=new Kj),o.forEach(function(rt){var nt=bk.bind(null,et,rt);tt.has(rt)||(tt.add(rt),rt.then(nt,nt))})}}function ck(et,o){var tt=o.deletions;if(tt!==null)for(var rt=0;rtnt&&(nt=it),rt&=~ot}if(rt=nt,rt=B$1()-rt,rt=(120>rt?120:480>rt?480:1080>rt?1080:1920>rt?1920:3e3>rt?3e3:4320>rt?4320:1960*lk(rt/1960))-rt,10et?16:et,wk===null)var rt=!1;else{if(et=wk,wk=null,xk=0,K$1&6)throw Error(p$4(331));var nt=K$1;for(K$1|=4,V$2=et.current;V$2!==null;){var ot=V$2,it=ot.child;if(V$2.flags&16){var st=ot.deletions;if(st!==null){for(var at=0;atB$1()-fk?Kk(et,0):rk|=tt),Dk(et,o)}function Yk(et,o){o===0&&(et.mode&1?(o=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):o=1);var tt=R();et=ih(et,o),et!==null&&(Ac(et,o,tt),Dk(et,tt))}function uj(et){var o=et.memoizedState,tt=0;o!==null&&(tt=o.retryLane),Yk(et,tt)}function bk(et,o){var tt=0;switch(et.tag){case 13:var rt=et.stateNode,nt=et.memoizedState;nt!==null&&(tt=nt.retryLane);break;case 19:rt=et.stateNode;break;default:throw Error(p$4(314))}rt!==null&&rt.delete(o),Yk(et,tt)}var Vk;Vk=function(et,o,tt){if(et!==null)if(et.memoizedProps!==o.pendingProps||Wf.current)dh=!0;else{if(!(et.lanes&tt)&&!(o.flags&128))return dh=!1,yj(et,o,tt);dh=!!(et.flags&131072)}else dh=!1,I$1&&o.flags&1048576&&ug(o,ng,o.index);switch(o.lanes=0,o.tag){case 2:var rt=o.type;ij(et,o),et=o.pendingProps;var nt=Yf(o,H$1.current);ch(o,tt),nt=Nh(null,o,rt,et,nt,tt);var ot=Sh();return o.flags|=1,typeof nt=="object"&&nt!==null&&typeof nt.render=="function"&&nt.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Zf(rt)?(ot=!0,cg(o)):ot=!1,o.memoizedState=nt.state!==null&&nt.state!==void 0?nt.state:null,kh(o),nt.updater=Ei,o.stateNode=nt,nt._reactInternals=o,Ii(o,rt,et,tt),o=jj(null,o,rt,!0,ot,tt)):(o.tag=0,I$1&&ot&&vg(o),Xi(null,o,nt,tt),o=o.child),o;case 16:rt=o.elementType;e:{switch(ij(et,o),et=o.pendingProps,nt=rt._init,rt=nt(rt._payload),o.type=rt,nt=o.tag=Zk(rt),et=Ci(rt,et),nt){case 0:o=cj(null,o,rt,et,tt);break e;case 1:o=hj(null,o,rt,et,tt);break e;case 11:o=Yi(null,o,rt,et,tt);break e;case 14:o=$i(null,o,rt,Ci(rt.type,et),tt);break e}throw Error(p$4(306,rt,""))}return o;case 0:return rt=o.type,nt=o.pendingProps,nt=o.elementType===rt?nt:Ci(rt,nt),cj(et,o,rt,nt,tt);case 1:return rt=o.type,nt=o.pendingProps,nt=o.elementType===rt?nt:Ci(rt,nt),hj(et,o,rt,nt,tt);case 3:e:{if(kj(o),et===null)throw Error(p$4(387));rt=o.pendingProps,ot=o.memoizedState,nt=ot.element,lh(et,o),qh(o,rt,null,tt);var it=o.memoizedState;if(rt=it.element,ot.isDehydrated)if(ot={element:rt,isDehydrated:!1,cache:it.cache,pendingSuspenseBoundaries:it.pendingSuspenseBoundaries,transitions:it.transitions},o.updateQueue.baseState=ot,o.memoizedState=ot,o.flags&256){nt=Ji(Error(p$4(423)),o),o=lj(et,o,rt,tt,nt);break e}else if(rt!==nt){nt=Ji(Error(p$4(424)),o),o=lj(et,o,rt,tt,nt);break e}else for(yg=Lf(o.stateNode.containerInfo.firstChild),xg=o,I$1=!0,zg=null,tt=Vg(o,null,rt,tt),o.child=tt;tt;)tt.flags=tt.flags&-3|4096,tt=tt.sibling;else{if(Ig(),rt===nt){o=Zi(et,o,tt);break e}Xi(et,o,rt,tt)}o=o.child}return o;case 5:return Ah(o),et===null&&Eg(o),rt=o.type,nt=o.pendingProps,ot=et!==null?et.memoizedProps:null,it=nt.children,Ef(rt,nt)?it=null:ot!==null&&Ef(rt,ot)&&(o.flags|=32),gj(et,o),Xi(et,o,it,tt),o.child;case 6:return et===null&&Eg(o),null;case 13:return oj(et,o,tt);case 4:return yh(o,o.stateNode.containerInfo),rt=o.pendingProps,et===null?o.child=Ug(o,null,rt,tt):Xi(et,o,rt,tt),o.child;case 11:return rt=o.type,nt=o.pendingProps,nt=o.elementType===rt?nt:Ci(rt,nt),Yi(et,o,rt,nt,tt);case 7:return Xi(et,o,o.pendingProps,tt),o.child;case 8:return Xi(et,o,o.pendingProps.children,tt),o.child;case 12:return Xi(et,o,o.pendingProps.children,tt),o.child;case 10:e:{if(rt=o.type._context,nt=o.pendingProps,ot=o.memoizedProps,it=nt.value,G$1(Wg,rt._currentValue),rt._currentValue=it,ot!==null)if(He(ot.value,it)){if(ot.children===nt.children&&!Wf.current){o=Zi(et,o,tt);break e}}else for(ot=o.child,ot!==null&&(ot.return=o);ot!==null;){var st=ot.dependencies;if(st!==null){it=ot.child;for(var at=st.firstContext;at!==null;){if(at.context===rt){if(ot.tag===1){at=mh(-1,tt&-tt),at.tag=2;var ct=ot.updateQueue;if(ct!==null){ct=ct.shared;var lt=ct.pending;lt===null?at.next=at:(at.next=lt.next,lt.next=at),ct.pending=at}}ot.lanes|=tt,at=ot.alternate,at!==null&&(at.lanes|=tt),bh(ot.return,tt,o),st.lanes|=tt;break}at=at.next}}else if(ot.tag===10)it=ot.type===o.type?null:ot.child;else if(ot.tag===18){if(it=ot.return,it===null)throw Error(p$4(341));it.lanes|=tt,st=it.alternate,st!==null&&(st.lanes|=tt),bh(it,tt,o),it=ot.sibling}else it=ot.child;if(it!==null)it.return=ot;else for(it=ot;it!==null;){if(it===o){it=null;break}if(ot=it.sibling,ot!==null){ot.return=it.return,it=ot;break}it=it.return}ot=it}Xi(et,o,nt.children,tt),o=o.child}return o;case 9:return nt=o.type,rt=o.pendingProps.children,ch(o,tt),nt=eh(nt),rt=rt(nt),o.flags|=1,Xi(et,o,rt,tt),o.child;case 14:return rt=o.type,nt=Ci(rt,o.pendingProps),nt=Ci(rt.type,nt),$i(et,o,rt,nt,tt);case 15:return bj(et,o,o.type,o.pendingProps,tt);case 17:return rt=o.type,nt=o.pendingProps,nt=o.elementType===rt?nt:Ci(rt,nt),ij(et,o),o.tag=1,Zf(rt)?(et=!0,cg(o)):et=!1,ch(o,tt),Gi(o,rt,nt),Ii(o,rt,nt,tt),jj(null,o,rt,!0,et,tt);case 19:return xj(et,o,tt);case 22:return dj(et,o,tt)}throw Error(p$4(156,o.tag))};function Fk(et,o){return ac(et,o)}function $k(et,o,tt,rt){this.tag=et,this.key=tt,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=rt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(et,o,tt,rt){return new $k(et,o,tt,rt)}function aj(et){return et=et.prototype,!(!et||!et.isReactComponent)}function Zk(et){if(typeof et=="function")return aj(et)?1:0;if(et!=null){if(et=et.$$typeof,et===Da)return 11;if(et===Ga)return 14}return 2}function Pg(et,o){var tt=et.alternate;return tt===null?(tt=Bg(et.tag,o,et.key,et.mode),tt.elementType=et.elementType,tt.type=et.type,tt.stateNode=et.stateNode,tt.alternate=et,et.alternate=tt):(tt.pendingProps=o,tt.type=et.type,tt.flags=0,tt.subtreeFlags=0,tt.deletions=null),tt.flags=et.flags&14680064,tt.childLanes=et.childLanes,tt.lanes=et.lanes,tt.child=et.child,tt.memoizedProps=et.memoizedProps,tt.memoizedState=et.memoizedState,tt.updateQueue=et.updateQueue,o=et.dependencies,tt.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},tt.sibling=et.sibling,tt.index=et.index,tt.ref=et.ref,tt}function Rg(et,o,tt,rt,nt,ot){var it=2;if(rt=et,typeof et=="function")aj(et)&&(it=1);else if(typeof et=="string")it=5;else e:switch(et){case ya:return Tg(tt.children,nt,ot,o);case za:it=8,nt|=8;break;case Aa:return et=Bg(12,tt,o,nt|2),et.elementType=Aa,et.lanes=ot,et;case Ea:return et=Bg(13,tt,o,nt),et.elementType=Ea,et.lanes=ot,et;case Fa:return et=Bg(19,tt,o,nt),et.elementType=Fa,et.lanes=ot,et;case Ia:return pj(tt,nt,ot,o);default:if(typeof et=="object"&&et!==null)switch(et.$$typeof){case Ba:it=10;break e;case Ca:it=9;break e;case Da:it=11;break e;case Ga:it=14;break e;case Ha:it=16,rt=null;break e}throw Error(p$4(130,et==null?et:typeof et,""))}return o=Bg(it,tt,o,nt),o.elementType=et,o.type=rt,o.lanes=ot,o}function Tg(et,o,tt,rt){return et=Bg(7,et,rt,o),et.lanes=tt,et}function pj(et,o,tt,rt){return et=Bg(22,et,rt,o),et.elementType=Ia,et.lanes=tt,et.stateNode={isHidden:!1},et}function Qg(et,o,tt){return et=Bg(6,et,null,o),et.lanes=tt,et}function Sg(et,o,tt){return o=Bg(4,et.children!==null?et.children:[],et.key,o),o.lanes=tt,o.stateNode={containerInfo:et.containerInfo,pendingChildren:null,implementation:et.implementation},o}function al(et,o,tt,rt,nt){this.tag=o,this.containerInfo=et,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=rt,this.onRecoverableError=nt,this.mutableSourceEagerHydrationData=null}function bl(et,o,tt,rt,nt,ot,it,st,at){return et=new al(et,o,tt,st,at),o===1?(o=1,ot===!0&&(o|=8)):o=0,ot=Bg(3,null,null,o),et.current=ot,ot.stateNode=et,ot.memoizedState={element:rt,isDehydrated:tt,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(ot),et}function cl(et,o,tt){var rt=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(et){console.error(et)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs(reactDomExports);var createRoot,m$5=reactDomExports;createRoot=m$5.createRoot,m$5.hydrateRoot;const version$8="2.21.28";let errorConfig={getDocsUrl:({docsBaseUrl:et,docsPath:o="",docsSlug:tt})=>o?`${et??"https://viem.sh"}${o}${tt?`#${tt}`:""}`:void 0,version:version$8},BaseError$3=class ks extends Error{constructor(o,tt={}){var st;const rt=(()=>{var at;return tt.cause instanceof ks?tt.cause.details:(at=tt.cause)!=null&&at.message?tt.cause.message:tt.details})(),nt=tt.cause instanceof ks&&tt.cause.docsPath||tt.docsPath,ot=(st=errorConfig.getDocsUrl)==null?void 0:st.call(errorConfig,{...tt,docsPath:nt}),it=[o||"An error occurred.","",...tt.metaMessages?[...tt.metaMessages,""]:[],...ot?[`Docs: ${ot}`]:[],...rt?[`Details: ${rt}`]:[],`Version: ${errorConfig.version}`].join(` -`);super(it,tt.cause?{cause:tt.cause}:void 0),Object.defineProperty(this,"details",{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,"metaMessages",{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,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=rt,this.docsPath=nt,this.metaMessages=tt.metaMessages,this.name=tt.name??this.name,this.shortMessage=o,this.version=version$8}walk(o){return walk(this,o)}};function walk(et,o){return o!=null&&o(et)?et:et&&typeof et=="object"&&"cause"in et?walk(et.cause,o):o?null:et}class IntegerOutOfRangeError extends BaseError$3{constructor({max:o,min:tt,signed:rt,size:nt,value:ot}){super(`Number "${ot}" is not in safe ${nt?`${nt*8}-bit ${rt?"signed":"unsigned"} `:""}integer range ${o?`(${tt} to ${o})`:`(above ${tt})`}`,{name:"IntegerOutOfRangeError"})}}class InvalidBytesBooleanError extends BaseError$3{constructor(o){super(`Bytes value "${o}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class SizeOverflowError extends BaseError$3{constructor({givenSize:o,maxSize:tt}){super(`Size cannot exceed ${tt} bytes. Given size: ${o} bytes.`,{name:"SizeOverflowError"})}}class SliceOffsetOutOfBoundsError extends BaseError$3{constructor({offset:o,position:tt,size:rt}){super(`Slice ${tt==="start"?"starting":"ending"} at offset "${o}" is out-of-bounds (size: ${rt}).`,{name:"SliceOffsetOutOfBoundsError"})}}class SizeExceedsPaddingSizeError extends BaseError$3{constructor({size:o,targetSize:tt,type:rt}){super(`${rt.charAt(0).toUpperCase()}${rt.slice(1).toLowerCase()} size (${o}) exceeds padding size (${tt}).`,{name:"SizeExceedsPaddingSizeError"})}}class InvalidBytesLengthError extends BaseError$3{constructor({size:o,targetSize:tt,type:rt}){super(`${rt.charAt(0).toUpperCase()}${rt.slice(1).toLowerCase()} is expected to be ${tt} ${rt} long, but is ${o} ${rt} long.`,{name:"InvalidBytesLengthError"})}}function pad(et,{dir:o,size:tt=32}={}){return typeof et=="string"?padHex(et,{dir:o,size:tt}):padBytes(et,{dir:o,size:tt})}function padHex(et,{dir:o,size:tt=32}={}){if(tt===null)return et;const rt=et.replace("0x","");if(rt.length>tt*2)throw new SizeExceedsPaddingSizeError({size:Math.ceil(rt.length/2),targetSize:tt,type:"hex"});return`0x${rt[o==="right"?"padEnd":"padStart"](tt*2,"0")}`}function padBytes(et,{dir:o,size:tt=32}={}){if(tt===null)return et;if(et.length>tt)throw new SizeExceedsPaddingSizeError({size:et.length,targetSize:tt,type:"bytes"});const rt=new Uint8Array(tt);for(let nt=0;nt=charCodeMap.zero&&et<=charCodeMap.nine)return et-charCodeMap.zero;if(et>=charCodeMap.A&&et<=charCodeMap.F)return et-(charCodeMap.A-10);if(et>=charCodeMap.a&&et<=charCodeMap.f)return et-(charCodeMap.a-10)}function hexToBytes$3(et,o={}){let tt=et;o.size&&(assertSize(tt,{size:o.size}),tt=pad(tt,{dir:"right",size:o.size}));let rt=tt.slice(2);rt.length%2&&(rt=`0${rt}`);const nt=rt.length/2,ot=new Uint8Array(nt);for(let it=0,st=0;ito)throw new SizeOverflowError({givenSize:size$2(et),maxSize:o})}function hexToBigInt(et,o={}){const{signed:tt}=o;o.size&&assertSize(et,{size:o.size});const rt=BigInt(et);if(!tt)return rt;const nt=(et.length-2)/2,ot=(1n<o.toString(16).padStart(2,"0"));function toHex(et,o={}){return typeof et=="number"||typeof et=="bigint"?numberToHex(et,o):typeof et=="string"?stringToHex(et,o):typeof et=="boolean"?boolToHex(et,o):bytesToHex$3(et,o)}function boolToHex(et,o={}){const tt=`0x${Number(et)}`;return typeof o.size=="number"?(assertSize(tt,{size:o.size}),pad(tt,{size:o.size})):tt}function bytesToHex$3(et,o={}){let tt="";for(let nt=0;ntot||ntformatAbiParam(tt,{includeName:o})).join(o?", ":","):""}function formatAbiParam(et,{includeName:o}){return et.type.startsWith("tuple")?`(${formatAbiParams(et.components,{includeName:o})})${et.type.slice(5)}`:et.type+(o&&et.name?` ${et.name}`:"")}class AbiConstructorNotFoundError extends BaseError$3{constructor({docsPath:o}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` -`),{docsPath:o,name:"AbiConstructorNotFoundError"})}}class AbiConstructorParamsNotFoundError extends BaseError$3{constructor({docsPath:o}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` -`),{docsPath:o,name:"AbiConstructorParamsNotFoundError"})}}class AbiDecodingDataSizeTooSmallError extends BaseError$3{constructor({data:o,params:tt,size:rt}){super([`Data size of ${rt} bytes is too small for given parameters.`].join(` -`),{metaMessages:[`Params: (${formatAbiParams(tt,{includeName:!0})})`,`Data: ${o} (${rt} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o,this.params=tt,this.size=rt}}class AbiDecodingZeroDataError extends BaseError$3{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class AbiEncodingArrayLengthMismatchError extends BaseError$3{constructor({expectedLength:o,givenLength:tt,type:rt}){super([`ABI encoding array length mismatch for type ${rt}.`,`Expected length: ${o}`,`Given length: ${tt}`].join(` -`),{name:"AbiEncodingArrayLengthMismatchError"})}}class AbiEncodingBytesSizeMismatchError extends BaseError$3{constructor({expectedSize:o,value:tt}){super(`Size of bytes "${tt}" (bytes${size$2(tt)}) does not match expected size (bytes${o}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class AbiEncodingLengthMismatchError extends BaseError$3{constructor({expectedLength:o,givenLength:tt}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${o}`,`Given length (values): ${tt}`].join(` -`),{name:"AbiEncodingLengthMismatchError"})}}class AbiErrorSignatureNotFoundError extends BaseError$3{constructor(o,{docsPath:tt}){super([`Encoded error signature "${o}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${o}.`].join(` -`),{docsPath:tt,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=o}}class AbiFunctionNotFoundError extends BaseError$3{constructor(o,{docsPath:tt}={}){super([`Function ${o?`"${o}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:tt,name:"AbiFunctionNotFoundError"})}}class AbiFunctionOutputsNotFoundError extends BaseError$3{constructor(o,{docsPath:tt}){super([`Function "${o}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:tt,name:"AbiFunctionOutputsNotFoundError"})}}class AbiItemAmbiguityError extends BaseError$3{constructor(o,tt){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${o.type}\` in \`${formatAbiItem$1(o.abiItem)}\`, and`,`\`${tt.type}\` in \`${formatAbiItem$1(tt.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class BytesSizeMismatchError extends BaseError$3{constructor({expectedSize:o,givenSize:tt}){super(`Expected bytes${o}, got bytes${tt}.`,{name:"BytesSizeMismatchError"})}}class InvalidAbiEncodingTypeError extends BaseError$3{constructor(o,{docsPath:tt}){super([`Type "${o}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:tt,name:"InvalidAbiEncodingType"})}}class InvalidAbiDecodingTypeError extends BaseError$3{constructor(o,{docsPath:tt}){super([`Type "${o}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:tt,name:"InvalidAbiDecodingType"})}}class InvalidArrayError extends BaseError$3{constructor(o){super([`Value "${o}" is not a valid array.`].join(` -`),{name:"InvalidArrayError"})}}class InvalidDefinitionTypeError extends BaseError$3{constructor(o){super([`"${o}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` -`),{name:"InvalidDefinitionTypeError"})}}function concat$6(et){return typeof et[0]=="string"?concatHex(et):concatBytes$3(et)}function concatBytes$3(et){let o=0;for(const nt of et)o+=nt.length;const tt=new Uint8Array(o);let rt=0;for(const nt of et)tt.set(nt,rt),rt+=nt.length;return tt}function concatHex(et){return`0x${et.reduce((o,tt)=>o+tt.replace("0x",""),"")}`}class InvalidAddressError extends BaseError$3{constructor({address:o}){super(`Address "${o}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class LruMap extends Map{constructor(o){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=o}get(o){const tt=super.get(o);return super.has(o)&&tt!==void 0&&(this.delete(o),super.set(o,tt)),tt}set(o,tt){if(super.set(o,tt),this.maxSize&&this.size>this.maxSize){const rt=this.keys().next().value;rt&&this.delete(rt)}return this}}function number$4(et){if(!Number.isSafeInteger(et)||et<0)throw new Error(`positive integer expected, not ${et}`)}function isBytes$3(et){return et instanceof Uint8Array||et!=null&&typeof et=="object"&&et.constructor.name==="Uint8Array"}function bytes$1(et,...o){if(!isBytes$3(et))throw new Error("Uint8Array expected");if(o.length>0&&!o.includes(et.length))throw new Error(`Uint8Array expected of length ${o}, not of length=${et.length}`)}function hash$1(et){if(typeof et!="function"||typeof et.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$4(et.outputLen),number$4(et.blockLen)}function exists$1(et,o=!0){if(et.destroyed)throw new Error("Hash instance has been destroyed");if(o&&et.finished)throw new Error("Hash#digest() has already been called")}function output$1(et,o){bytes$1(et);const tt=o.outputLen;if(et.length>_32n&U32_MASK64)}:{h:Number(et>>_32n&U32_MASK64)|0,l:Number(et&U32_MASK64)|0}}function split$1(et,o=!1){let tt=new Uint32Array(et.length),rt=new Uint32Array(et.length);for(let nt=0;ntBigInt(et>>>0)<<_32n|BigInt(o>>>0),shrSH=(et,o,tt)=>et>>>tt,shrSL=(et,o,tt)=>et<<32-tt|o>>>tt,rotrSH=(et,o,tt)=>et>>>tt|o<<32-tt,rotrSL=(et,o,tt)=>et<<32-tt|o>>>tt,rotrBH=(et,o,tt)=>et<<64-tt|o>>>tt-32,rotrBL=(et,o,tt)=>et>>>tt-32|o<<64-tt,rotr32H=(et,o)=>o,rotr32L=(et,o)=>et,rotlSH=(et,o,tt)=>et<>>32-tt,rotlSL=(et,o,tt)=>o<>>32-tt,rotlBH=(et,o,tt)=>o<>>64-tt,rotlBL=(et,o,tt)=>et<>>64-tt;function add(et,o,tt,rt){const nt=(o>>>0)+(rt>>>0);return{h:et+tt+(nt/2**32|0)|0,l:nt|0}}const add3L=(et,o,tt)=>(et>>>0)+(o>>>0)+(tt>>>0),add3H=(et,o,tt,rt)=>o+tt+rt+(et/2**32|0)|0,add4L=(et,o,tt,rt)=>(et>>>0)+(o>>>0)+(tt>>>0)+(rt>>>0),add4H=(et,o,tt,rt,nt)=>o+tt+rt+nt+(et/2**32|0)|0,add5L=(et,o,tt,rt,nt)=>(et>>>0)+(o>>>0)+(tt>>>0)+(rt>>>0)+(nt>>>0),add5H=(et,o,tt,rt,nt,ot)=>o+tt+rt+nt+ot+(et/2**32|0)|0,u64={fromBig,split:split$1,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH,rotlSL,rotlBH,rotlBL,add,add3L,add3H,add4L,add4H,add5H,add5L},crypto$2=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32$1=et=>new Uint32Array(et.buffer,et.byteOffset,Math.floor(et.byteLength/4)),createView$1=et=>new DataView(et.buffer,et.byteOffset,et.byteLength),rotr=(et,o)=>et<<32-o|et>>>o,isLE$1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,byteSwap=et=>et<<24&4278190080|et<<8&16711680|et>>>8&65280|et>>>24&255;function byteSwap32(et){for(let o=0;oet().update(toBytes$2(rt)).digest(),tt=et();return o.outputLen=tt.outputLen,o.blockLen=tt.blockLen,o.create=()=>et(),o}function randomBytes$1(et=32){if(crypto$2&&typeof crypto$2.getRandomValues=="function")return crypto$2.getRandomValues(new Uint8Array(et));if(crypto$2&&typeof crypto$2.randomBytes=="function")return crypto$2.randomBytes(et);throw new Error("crypto.getRandomValues must be defined")}const SHA3_PI=[],SHA3_ROTL=[],_SHA3_IOTA=[],_0n$7=BigInt(0),_1n$9=BigInt(1),_2n$6=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let et=0,o=_1n$9,tt=1,rt=0;et<24;et++){[tt,rt]=[rt,(2*tt+3*rt)%5],SHA3_PI.push(2*(5*rt+tt)),SHA3_ROTL.push((et+1)*(et+2)/2%64);let nt=_0n$7;for(let ot=0;ot<7;ot++)o=(o<<_1n$9^(o>>_7n)*_0x71n)%_256n,o&_2n$6&&(nt^=_1n$9<<(_1n$9<tt>32?rotlBH(et,o,tt):rotlSH(et,o,tt),rotlL=(et,o,tt)=>tt>32?rotlBL(et,o,tt):rotlSL(et,o,tt);function keccakP(et,o=24){const tt=new Uint32Array(10);for(let rt=24-o;rt<24;rt++){for(let it=0;it<10;it++)tt[it]=et[it]^et[it+10]^et[it+20]^et[it+30]^et[it+40];for(let it=0;it<10;it+=2){const st=(it+8)%10,at=(it+2)%10,ct=tt[at],lt=tt[at+1],dt=rotlH(ct,lt,1)^tt[st],ht=rotlL(ct,lt,1)^tt[st+1];for(let mt=0;mt<50;mt+=10)et[it+mt]^=dt,et[it+mt+1]^=ht}let nt=et[2],ot=et[3];for(let it=0;it<24;it++){const st=SHA3_ROTL[it],at=rotlH(nt,ot,st),ct=rotlL(nt,ot,st),lt=SHA3_PI[it];nt=et[lt],ot=et[lt+1],et[lt]=at,et[lt+1]=ct}for(let it=0;it<50;it+=10){for(let st=0;st<10;st++)tt[st]=et[it+st];for(let st=0;st<10;st++)et[it+st]^=~tt[(st+2)%10]&tt[(st+4)%10]}et[0]^=SHA3_IOTA_H[rt],et[1]^=SHA3_IOTA_L[rt]}tt.fill(0)}class Keccak extends Hash{constructor(o,tt,rt,nt=!1,ot=24){if(super(),this.blockLen=o,this.suffix=tt,this.outputLen=rt,this.enableXOF=nt,this.rounds=ot,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number$4(rt),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32$1(this.state)}keccak(){isLE$1||byteSwap32(this.state32),keccakP(this.state32,this.rounds),isLE$1||byteSwap32(this.state32),this.posOut=0,this.pos=0}update(o){exists$1(this);const{blockLen:tt,state:rt}=this;o=toBytes$2(o);const nt=o.length;for(let ot=0;ot=rt&&this.keccak();const it=Math.min(rt-this.posOut,ot-nt);o.set(tt.subarray(this.posOut,this.posOut+it),nt),this.posOut+=it,nt+=it}return o}xofInto(o){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(o)}xof(o){return number$4(o),this.xofInto(new Uint8Array(o))}digestInto(o){if(output$1(o,this),this.finished)throw new Error("digest() was already called");return this.writeInto(o),this.destroy(),o}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(o){const{blockLen:tt,suffix:rt,outputLen:nt,rounds:ot,enableXOF:it}=this;return o||(o=new Keccak(tt,rt,nt,it,ot)),o.state32.set(this.state32),o.pos=this.pos,o.posOut=this.posOut,o.finished=this.finished,o.rounds=ot,o.suffix=rt,o.outputLen=nt,o.enableXOF=it,o.destroyed=this.destroyed,o}}const gen=(et,o,tt)=>wrapConstructor(()=>new Keccak(o,et,tt)),keccak_256=gen(1,136,256/8);function keccak256$1(et,o){const tt=o||"hex",rt=keccak_256(isHex(et,{strict:!1})?toBytes$3(et):et);return tt==="bytes"?rt:toHex(rt)}const checksumAddressCache=new LruMap(8192);function checksumAddress(et,o){if(checksumAddressCache.has(`${et}.${o}`))return checksumAddressCache.get(`${et}.${o}`);const tt=o?`${o}${et.toLowerCase()}`:et.substring(2).toLowerCase(),rt=keccak256$1(stringToBytes(tt),"bytes"),nt=(o?tt.substring(`${o}0x`.length):tt).split("");for(let it=0;it<40;it+=2)rt[it>>1]>>4>=8&&nt[it]&&(nt[it]=nt[it].toUpperCase()),(rt[it>>1]&15)>=8&&nt[it+1]&&(nt[it+1]=nt[it+1].toUpperCase());const ot=`0x${nt.join("")}`;return checksumAddressCache.set(`${et}.${o}`,ot),ot}function getAddress(et,o){if(!isAddress(et,{strict:!1}))throw new InvalidAddressError({address:et});return checksumAddress(et,o)}const addressRegex=/^0x[a-fA-F0-9]{40}$/,isAddressCache=new LruMap(8192);function isAddress(et,o){const{strict:tt=!0}=o??{},rt=`${et}.${tt}`;if(isAddressCache.has(rt))return isAddressCache.get(rt);const nt=addressRegex.test(et)?et.toLowerCase()===et?!0:tt?checksumAddress(et)===et:!0:!1;return isAddressCache.set(rt,nt),nt}function slice(et,o,tt,{strict:rt}={}){return isHex(et,{strict:!1})?sliceHex(et,o,tt,{strict:rt}):sliceBytes(et,o,tt,{strict:rt})}function assertStartOffset(et,o){if(typeof o=="number"&&o>0&&o>size$2(et)-1)throw new SliceOffsetOutOfBoundsError({offset:o,position:"start",size:size$2(et)})}function assertEndOffset(et,o,tt){if(typeof o=="number"&&typeof tt=="number"&&size$2(et)!==tt-o)throw new SliceOffsetOutOfBoundsError({offset:tt,position:"end",size:size$2(et)})}function sliceBytes(et,o,tt,{strict:rt}={}){assertStartOffset(et,o);const nt=et.slice(o,tt);return rt&&assertEndOffset(nt,o,tt),nt}function sliceHex(et,o,tt,{strict:rt}={}){assertStartOffset(et,o);const nt=`0x${et.replace("0x","").slice((o??0)*2,(tt??et.length)*2)}`;return rt&&assertEndOffset(nt,o,tt),nt}function encodeAbiParameters(et,o){if(et.length!==o.length)throw new AbiEncodingLengthMismatchError({expectedLength:et.length,givenLength:o.length});const tt=prepareParams({params:et,values:o}),rt=encodeParams(tt);return rt.length===0?"0x":rt}function prepareParams({params:et,values:o}){const tt=[];for(let rt=0;rt0?concat$6([st,it]):st}}if(nt)return{dynamic:!0,encoded:it}}return{dynamic:!1,encoded:concat$6(ot.map(({encoded:it})=>it))}}function encodeBytes(et,{param:o}){const[,tt]=o.type.split("bytes"),rt=size$2(et);if(!tt){let nt=et;return rt%32!==0&&(nt=padHex(nt,{dir:"right",size:Math.ceil((et.length-2)/2/32)*32})),{dynamic:!0,encoded:concat$6([padHex(numberToHex(rt,{size:32})),nt])}}if(rt!==Number.parseInt(tt))throw new AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt(tt),value:et});return{dynamic:!1,encoded:padHex(et,{dir:"right"})}}function encodeBool(et){if(typeof et!="boolean")throw new BaseError$3(`Invalid boolean value: "${et}" (type: ${typeof et}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:padHex(boolToHex(et))}}function encodeNumber(et,{signed:o}){return{dynamic:!1,encoded:numberToHex(et,{size:32,signed:o})}}function encodeString(et){const o=stringToHex(et),tt=Math.ceil(size$2(o)/32),rt=[];for(let nt=0;ntnt))}}function getArrayComponents(et){const o=et.match(/^(.*)\[(\d+)?\]$/);return o?[o[2]?Number(o[2]):null,o[1]]:void 0}const docsPath$2="/docs/contract/encodeDeployData";function encodeDeployData(et){const{abi:o,args:tt,bytecode:rt}=et;if(!tt||tt.length===0)return rt;const nt=o.find(it=>"type"in it&&it.type==="constructor");if(!nt)throw new AbiConstructorNotFoundError({docsPath:docsPath$2});if(!("inputs"in nt))throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$2});if(!nt.inputs||nt.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$2});const ot=encodeAbiParameters(nt.inputs,tt);return concatHex([rt,ot])}function parseAccount(et){return typeof et=="string"?{address:et,type:"json-rpc"}:et}class AccountNotFoundError extends BaseError$3{constructor({docsPath:o}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` -`),{docsPath:o,docsSlug:"account",name:"AccountNotFoundError"})}}const scriptRel="modulepreload",assetsURL=function(et){return"/"+et},seen={},__vitePreload=function(o,tt,rt){let nt=Promise.resolve();if(tt&&tt.length>0){document.getElementsByTagName("link");const it=document.querySelector("meta[property=csp-nonce]"),st=(it==null?void 0:it.nonce)||(it==null?void 0:it.getAttribute("nonce"));nt=Promise.allSettled(tt.map(at=>{if(at=assetsURL(at),at in seen)return;seen[at]=!0;const ct=at.endsWith(".css"),lt=ct?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${at}"]${lt}`))return;const dt=document.createElement("link");if(dt.rel=ct?"stylesheet":scriptRel,ct||(dt.as="script"),dt.crossOrigin="",dt.href=at,st&&dt.setAttribute("nonce",st),document.head.appendChild(dt),ct)return new Promise((ht,mt)=>{dt.addEventListener("load",ht),dt.addEventListener("error",()=>mt(new Error(`Unable to preload CSS for ${at}`)))})}))}function ot(it){const st=new Event("vite:preloadError",{cancelable:!0});if(st.payload=it,window.dispatchEvent(st),!st.defaultPrevented)throw it}return nt.then(it=>{for(const st of it||[])st.status==="rejected"&&ot(st.reason);return o().catch(ot)})};class NegativeOffsetError extends BaseError$3{constructor({offset:o}){super(`Offset \`${o}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class PositionOutOfBoundsError extends BaseError$3{constructor({length:o,position:tt}){super(`Position \`${tt}\` is out of bounds (\`0 < position < ${o}\`).`,{name:"PositionOutOfBoundsError"})}}class RecursiveReadLimitExceededError extends BaseError$3{constructor({count:o,limit:tt}){super(`Recursive read limit of \`${tt}\` exceeded (recursive read count: \`${o}\`).`,{name:"RecursiveReadLimitExceededError"})}}const staticCursor={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(et){if(et<0||et>this.bytes.length-1)throw new PositionOutOfBoundsError({length:this.bytes.length,position:et})},decrementPosition(et){if(et<0)throw new NegativeOffsetError({offset:et});const o=this.position-et;this.assertPosition(o),this.position=o},getReadCount(et){return this.positionReadCount.get(et||this.position)||0},incrementPosition(et){if(et<0)throw new NegativeOffsetError({offset:et});const o=this.position+et;this.assertPosition(o),this.position=o},inspectByte(et){const o=et??this.position;return this.assertPosition(o),this.bytes[o]},inspectBytes(et,o){const tt=o??this.position;return this.assertPosition(tt+et-1),this.bytes.subarray(tt,tt+et)},inspectUint8(et){const o=et??this.position;return this.assertPosition(o),this.bytes[o]},inspectUint16(et){const o=et??this.position;return this.assertPosition(o+1),this.dataView.getUint16(o)},inspectUint24(et){const o=et??this.position;return this.assertPosition(o+2),(this.dataView.getUint16(o)<<8)+this.dataView.getUint8(o+2)},inspectUint32(et){const o=et??this.position;return this.assertPosition(o+3),this.dataView.getUint32(o)},pushByte(et){this.assertPosition(this.position),this.bytes[this.position]=et,this.position++},pushBytes(et){this.assertPosition(this.position+et.length-1),this.bytes.set(et,this.position),this.position+=et.length},pushUint8(et){this.assertPosition(this.position),this.bytes[this.position]=et,this.position++},pushUint16(et){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,et),this.position+=2},pushUint24(et){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,et>>8),this.dataView.setUint8(this.position+2,et&255),this.position+=3},pushUint32(et){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,et),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const et=this.inspectByte();return this.position++,et},readBytes(et,o){this.assertReadLimit(),this._touch();const tt=this.inspectBytes(et);return this.position+=o??et,tt},readUint8(){this.assertReadLimit(),this._touch();const et=this.inspectUint8();return this.position+=1,et},readUint16(){this.assertReadLimit(),this._touch();const et=this.inspectUint16();return this.position+=2,et},readUint24(){this.assertReadLimit(),this._touch();const et=this.inspectUint24();return this.position+=3,et},readUint32(){this.assertReadLimit(),this._touch();const et=this.inspectUint32();return this.position+=4,et},get remaining(){return this.bytes.length-this.position},setPosition(et){const o=this.position;return this.assertPosition(et),this.position=et,()=>this.position=o},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const et=this.getReadCount();this.positionReadCount.set(this.position,et+1),et>0&&this.recursiveReadCount++}};function createCursor(et,{recursiveReadLimit:o=8192}={}){const tt=Object.create(staticCursor);return tt.bytes=et,tt.dataView=new DataView(et.buffer,et.byteOffset,et.byteLength),tt.positionReadCount=new Map,tt.recursiveReadLimit=o,tt}function toRlp(et,o="hex"){const tt=getEncodable(et),rt=createCursor(new Uint8Array(tt.length));return tt.encode(rt),o==="hex"?bytesToHex$3(rt.bytes):rt.bytes}function getEncodable(et){return Array.isArray(et)?getEncodableList(et.map(o=>getEncodable(o))):getEncodableBytes(et)}function getEncodableList(et){const o=et.reduce((nt,ot)=>nt+ot.length,0),tt=getSizeOfLength(o);return{length:o<=55?1+o:1+tt+o,encode(nt){o<=55?nt.pushByte(192+o):(nt.pushByte(247+tt),tt===1?nt.pushUint8(o):tt===2?nt.pushUint16(o):tt===3?nt.pushUint24(o):nt.pushUint32(o));for(const{encode:ot}of et)ot(nt)}}}function getEncodableBytes(et){const o=typeof et=="string"?hexToBytes$3(et):et,tt=getSizeOfLength(o.length);return{length:o.length===1&&o[0]<128?1:o.length<=55?1+o.length:1+tt+o.length,encode(nt){o.length===1&&o[0]<128?nt.pushBytes(o):o.length<=55?(nt.pushByte(128+o.length),nt.pushBytes(o)):(nt.pushByte(183+tt),tt===1?nt.pushUint8(o.length):tt===2?nt.pushUint16(o.length):tt===3?nt.pushUint24(o.length):nt.pushUint32(o.length),nt.pushBytes(o))}}}function getSizeOfLength(et){if(et<2**8)return 1;if(et<2**16)return 2;if(et<2**24)return 3;if(et<2**32)return 4;throw new BaseError$3("Length is too large.")}class ChainDoesNotSupportContract extends BaseError$3{constructor({blockNumber:o,chain:tt,contract:rt}){super(`Chain "${tt.name}" does not support contract "${rt.name}".`,{metaMessages:["This could be due to any of the following:",...o&&rt.blockCreated&&rt.blockCreated>o?[`- The contract "${rt.name}" was not deployed until block ${rt.blockCreated} (current block ${o}).`]:[`- The chain does not have the contract "${rt.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class ClientChainNotConfiguredError extends BaseError$3{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class InvalidChainIdError extends BaseError$3{constructor({chainId:o}){super(typeof o=="number"?`Chain ID "${o}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const etherUnits={gwei:9,wei:18},gweiUnits={ether:-9,wei:9},weiUnits={ether:-18,gwei:-9};function formatUnits(et,o){let tt=et.toString();const rt=tt.startsWith("-");rt&&(tt=tt.slice(1)),tt=tt.padStart(o,"0");let[nt,ot]=[tt.slice(0,tt.length-o),tt.slice(tt.length-o)];return ot=ot.replace(/(0+)$/,""),`${rt?"-":""}${nt||"0"}${ot?`.${ot}`:""}`}function formatGwei(et,o="wei"){return formatUnits(et,gweiUnits[o])}class ExecutionRevertedError extends BaseError$3{constructor({cause:o,message:tt}={}){var nt;const rt=(nt=tt==null?void 0:tt.replace("execution reverted: ",""))==null?void 0:nt.replace("execution reverted","");super(`Execution reverted ${rt?`with reason: ${rt}`:"for an unknown reason"}.`,{cause:o,name:"ExecutionRevertedError"})}}Object.defineProperty(ExecutionRevertedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ExecutionRevertedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class FeeCapTooHighError extends BaseError$3{constructor({cause:o,maxFeePerGas:tt}={}){super(`The fee cap (\`maxFeePerGas\`${tt?` = ${formatGwei(tt)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:o,name:"FeeCapTooHighError"})}}Object.defineProperty(FeeCapTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class FeeCapTooLowError extends BaseError$3{constructor({cause:o,maxFeePerGas:tt}={}){super(`The fee cap (\`maxFeePerGas\`${tt?` = ${formatGwei(tt)}`:""} gwei) cannot be lower than the block base fee.`,{cause:o,name:"FeeCapTooLowError"})}}Object.defineProperty(FeeCapTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class NonceTooHighError extends BaseError$3{constructor({cause:o,nonce:tt}={}){super(`Nonce provided for the transaction ${tt?`(${tt}) `:""}is higher than the next one expected.`,{cause:o,name:"NonceTooHighError"})}}Object.defineProperty(NonceTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class NonceTooLowError extends BaseError$3{constructor({cause:o,nonce:tt}={}){super([`Nonce provided for the transaction ${tt?`(${tt}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` -`),{cause:o,name:"NonceTooLowError"})}}Object.defineProperty(NonceTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class NonceMaxValueError extends BaseError$3{constructor({cause:o,nonce:tt}={}){super(`Nonce provided for the transaction ${tt?`(${tt}) `:""}exceeds the maximum allowed nonce.`,{cause:o,name:"NonceMaxValueError"})}}Object.defineProperty(NonceMaxValueError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class InsufficientFundsError extends BaseError$3{constructor({cause:o}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` -`),{cause:o,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(InsufficientFundsError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class IntrinsicGasTooHighError extends BaseError$3{constructor({cause:o,gas:tt}={}){super(`The amount of gas ${tt?`(${tt}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:o,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(IntrinsicGasTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class IntrinsicGasTooLowError extends BaseError$3{constructor({cause:o,gas:tt}={}){super(`The amount of gas ${tt?`(${tt}) `:""}provided for the transaction is too low.`,{cause:o,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(IntrinsicGasTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class TransactionTypeNotSupportedError extends BaseError$3{constructor({cause:o}){super("The transaction type is not supported for this chain.",{cause:o,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(TransactionTypeNotSupportedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class TipAboveFeeCapError extends BaseError$3{constructor({cause:o,maxPriorityFeePerGas:tt,maxFeePerGas:rt}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${tt?` = ${formatGwei(tt)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${rt?` = ${formatGwei(rt)} gwei`:""}).`].join(` -`),{cause:o,name:"TipAboveFeeCapError"})}}Object.defineProperty(TipAboveFeeCapError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class UnknownNodeError extends BaseError$3{constructor({cause:o}){super(`An error occurred while executing: ${o==null?void 0:o.shortMessage}`,{cause:o,name:"UnknownNodeError"})}}function formatEther(et,o="wei"){return formatUnits(et,etherUnits[o])}function prettyPrint(et){const o=Object.entries(et).map(([rt,nt])=>nt===void 0||nt===!1?null:[rt,nt]).filter(Boolean),tt=o.reduce((rt,[nt])=>Math.max(rt,nt.length),0);return o.map(([rt,nt])=>` ${`${rt}:`.padEnd(tt+1)} ${nt}`).join(` -`)}class FeeConflictError extends BaseError$3{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` -`),{name:"FeeConflictError"})}}class InvalidLegacyVError extends BaseError$3{constructor({v:o}){super(`Invalid \`v\` value "${o}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class InvalidSerializableTransactionError extends BaseError$3{constructor({transaction:o}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",prettyPrint(o),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class InvalidStorageKeySizeError extends BaseError$3{constructor({storageKey:o}){super(`Size for storage key "${o}" is invalid. Expected 32 bytes. Got ${Math.floor((o.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}const stringify$2=(et,o,tt)=>JSON.stringify(et,(rt,nt)=>typeof nt=="bigint"?nt.toString():nt,tt),getContractAddress=et=>et,getUrl=et=>et;class HttpRequestError extends BaseError$3{constructor({body:o,cause:tt,details:rt,headers:nt,status:ot,url:it}){super("HTTP request failed.",{cause:tt,details:rt,metaMessages:[ot&&`Status: ${ot}`,`URL: ${getUrl(it)}`,o&&`Request body: ${stringify$2(o)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=o,this.headers=nt,this.status=ot,this.url=it}}class RpcRequestError extends BaseError$3{constructor({body:o,error:tt,url:rt}){super("RPC Request failed.",{cause:tt,details:tt.message,metaMessages:[`URL: ${getUrl(rt)}`,`Request body: ${stringify$2(o)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=tt.code}}let TimeoutError$4=class extends BaseError$3{constructor({body:o,url:tt}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${getUrl(tt)}`,`Request body: ${stringify$2(o)}`],name:"TimeoutError"})}};const unknownErrorCode=-1;class RpcError extends BaseError$3{constructor(o,{code:tt,docsPath:rt,metaMessages:nt,name:ot,shortMessage:it}){super(it,{cause:o,docsPath:rt,metaMessages:nt||(o==null?void 0:o.metaMessages),name:ot||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=ot||o.name,this.code=o instanceof RpcRequestError?o.code:tt??unknownErrorCode}}class ProviderRpcError extends RpcError{constructor(o,tt){super(o,tt),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=tt.data}}class ParseRpcError extends RpcError{constructor(o){super(o,{code:ParseRpcError.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(ParseRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class InvalidRequestRpcError extends RpcError{constructor(o){super(o,{code:InvalidRequestRpcError.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(InvalidRequestRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class MethodNotFoundRpcError extends RpcError{constructor(o,{method:tt}={}){super(o,{code:MethodNotFoundRpcError.code,name:"MethodNotFoundRpcError",shortMessage:`The method${tt?` "${tt}"`:""} does not exist / is not available.`})}}Object.defineProperty(MethodNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class InvalidParamsRpcError extends RpcError{constructor(o){super(o,{code:InvalidParamsRpcError.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(InvalidParamsRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class InternalRpcError extends RpcError{constructor(o){super(o,{code:InternalRpcError.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(InternalRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class InvalidInputRpcError extends RpcError{constructor(o){super(o,{code:InvalidInputRpcError.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(InvalidInputRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ResourceNotFoundRpcError extends RpcError{constructor(o){super(o,{code:ResourceNotFoundRpcError.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ResourceNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ResourceUnavailableRpcError extends RpcError{constructor(o){super(o,{code:ResourceUnavailableRpcError.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ResourceUnavailableRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class TransactionRejectedRpcError extends RpcError{constructor(o){super(o,{code:TransactionRejectedRpcError.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(TransactionRejectedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class MethodNotSupportedRpcError extends RpcError{constructor(o,{method:tt}={}){super(o,{code:MethodNotSupportedRpcError.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${tt?` "${tt}"`:""} is not implemented.`})}}Object.defineProperty(MethodNotSupportedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class LimitExceededRpcError extends RpcError{constructor(o){super(o,{code:LimitExceededRpcError.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(LimitExceededRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class JsonRpcVersionUnsupportedError extends RpcError{constructor(o){super(o,{code:JsonRpcVersionUnsupportedError.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(JsonRpcVersionUnsupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class UserRejectedRequestError extends ProviderRpcError{constructor(o){super(o,{code:UserRejectedRequestError.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(UserRejectedRequestError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class UnauthorizedProviderError extends ProviderRpcError{constructor(o){super(o,{code:UnauthorizedProviderError.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(UnauthorizedProviderError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class UnsupportedProviderMethodError extends ProviderRpcError{constructor(o,{method:tt}={}){super(o,{code:UnsupportedProviderMethodError.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${tt?` " ${tt}"`:""}.`})}}Object.defineProperty(UnsupportedProviderMethodError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ProviderDisconnectedError extends ProviderRpcError{constructor(o){super(o,{code:ProviderDisconnectedError.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ProviderDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class ChainDisconnectedError extends ProviderRpcError{constructor(o){super(o,{code:ChainDisconnectedError.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(ChainDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class SwitchChainError extends ProviderRpcError{constructor(o){super(o,{code:SwitchChainError.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(SwitchChainError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class UnknownRpcError extends RpcError{constructor(o){super(o,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}function getNodeError(et,o){const tt=(et.details||"").toLowerCase(),rt=et instanceof BaseError$3?et.walk(nt=>(nt==null?void 0:nt.code)===ExecutionRevertedError.code):et;return rt instanceof BaseError$3?new ExecutionRevertedError({cause:et,message:rt.details}):ExecutionRevertedError.nodeMessage.test(tt)?new ExecutionRevertedError({cause:et,message:et.details}):FeeCapTooHighError.nodeMessage.test(tt)?new FeeCapTooHighError({cause:et,maxFeePerGas:o==null?void 0:o.maxFeePerGas}):FeeCapTooLowError.nodeMessage.test(tt)?new FeeCapTooLowError({cause:et,maxFeePerGas:o==null?void 0:o.maxFeePerGas}):NonceTooHighError.nodeMessage.test(tt)?new NonceTooHighError({cause:et,nonce:o==null?void 0:o.nonce}):NonceTooLowError.nodeMessage.test(tt)?new NonceTooLowError({cause:et,nonce:o==null?void 0:o.nonce}):NonceMaxValueError.nodeMessage.test(tt)?new NonceMaxValueError({cause:et,nonce:o==null?void 0:o.nonce}):InsufficientFundsError.nodeMessage.test(tt)?new InsufficientFundsError({cause:et}):IntrinsicGasTooHighError.nodeMessage.test(tt)?new IntrinsicGasTooHighError({cause:et,gas:o==null?void 0:o.gas}):IntrinsicGasTooLowError.nodeMessage.test(tt)?new IntrinsicGasTooLowError({cause:et,gas:o==null?void 0:o.gas}):TransactionTypeNotSupportedError.nodeMessage.test(tt)?new TransactionTypeNotSupportedError({cause:et}):TipAboveFeeCapError.nodeMessage.test(tt)?new TipAboveFeeCapError({cause:et,maxFeePerGas:o==null?void 0:o.maxFeePerGas,maxPriorityFeePerGas:o==null?void 0:o.maxPriorityFeePerGas}):new UnknownNodeError({cause:et})}function extract$1(et,{format:o}){if(!o)return{};const tt={};function rt(ot){const it=Object.keys(ot);for(const st of it)st in et&&(tt[st]=et[st]),ot[st]&&typeof ot[st]=="object"&&!Array.isArray(ot[st])&&rt(ot[st])}const nt=o(et||{});return rt(nt),tt}function defineFormatter(et,o){return({exclude:tt,format:rt})=>({exclude:tt,format:nt=>{const ot=o(nt);if(tt)for(const it of tt)delete ot[it];return{...ot,...rt(nt)}},type:et})}const rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function formatTransactionRequest(et){const o={};return typeof et.authorizationList<"u"&&(o.authorizationList=formatAuthorizationList$1(et.authorizationList)),typeof et.accessList<"u"&&(o.accessList=et.accessList),typeof et.blobVersionedHashes<"u"&&(o.blobVersionedHashes=et.blobVersionedHashes),typeof et.blobs<"u"&&(typeof et.blobs[0]!="string"?o.blobs=et.blobs.map(tt=>bytesToHex$3(tt)):o.blobs=et.blobs),typeof et.data<"u"&&(o.data=et.data),typeof et.from<"u"&&(o.from=et.from),typeof et.gas<"u"&&(o.gas=numberToHex(et.gas)),typeof et.gasPrice<"u"&&(o.gasPrice=numberToHex(et.gasPrice)),typeof et.maxFeePerBlobGas<"u"&&(o.maxFeePerBlobGas=numberToHex(et.maxFeePerBlobGas)),typeof et.maxFeePerGas<"u"&&(o.maxFeePerGas=numberToHex(et.maxFeePerGas)),typeof et.maxPriorityFeePerGas<"u"&&(o.maxPriorityFeePerGas=numberToHex(et.maxPriorityFeePerGas)),typeof et.nonce<"u"&&(o.nonce=numberToHex(et.nonce)),typeof et.to<"u"&&(o.to=et.to),typeof et.type<"u"&&(o.type=rpcTransactionType[et.type]),typeof et.value<"u"&&(o.value=numberToHex(et.value)),o}function formatAuthorizationList$1(et){return et.map(o=>({address:o.contractAddress,r:o.r,s:o.s,chainId:numberToHex(o.chainId),nonce:numberToHex(o.nonce),...typeof o.yParity<"u"?{yParity:numberToHex(o.yParity)}:{},...typeof o.v<"u"&&typeof o.yParity>"u"?{v:numberToHex(o.v)}:{}}))}function getAction$1(et,o,tt){const rt=et[o.name];if(typeof rt=="function")return rt;const nt=et[tt];return typeof nt=="function"?nt:ot=>o(et,ot)}const maxUint256=2n**256n-1n;function assertRequest(et){const{account:o,gasPrice:tt,maxFeePerGas:rt,maxPriorityFeePerGas:nt,to:ot}=et,it=o?parseAccount(o):void 0;if(it&&!isAddress(it.address))throw new InvalidAddressError({address:it.address});if(ot&&!isAddress(ot))throw new InvalidAddressError({address:ot});if(typeof tt<"u"&&(typeof rt<"u"||typeof nt<"u"))throw new FeeConflictError;if(rt&&rt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:rt});if(nt&&rt&&nt>rt)throw new TipAboveFeeCapError({maxFeePerGas:rt,maxPriorityFeePerGas:nt})}const transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function formatTransaction(et){const o={...et,blockHash:et.blockHash?et.blockHash:null,blockNumber:et.blockNumber?BigInt(et.blockNumber):null,chainId:et.chainId?hexToNumber$2(et.chainId):void 0,gas:et.gas?BigInt(et.gas):void 0,gasPrice:et.gasPrice?BigInt(et.gasPrice):void 0,maxFeePerBlobGas:et.maxFeePerBlobGas?BigInt(et.maxFeePerBlobGas):void 0,maxFeePerGas:et.maxFeePerGas?BigInt(et.maxFeePerGas):void 0,maxPriorityFeePerGas:et.maxPriorityFeePerGas?BigInt(et.maxPriorityFeePerGas):void 0,nonce:et.nonce?hexToNumber$2(et.nonce):void 0,to:et.to?et.to:null,transactionIndex:et.transactionIndex?Number(et.transactionIndex):null,type:et.type?transactionType[et.type]:void 0,typeHex:et.type?et.type:void 0,value:et.value?BigInt(et.value):void 0,v:et.v?BigInt(et.v):void 0};return et.authorizationList&&(o.authorizationList=formatAuthorizationList(et.authorizationList)),o.yParity=(()=>{if(et.yParity)return Number(et.yParity);if(typeof o.v=="bigint"){if(o.v===0n||o.v===27n)return 0;if(o.v===1n||o.v===28n)return 1;if(o.v>=35n)return o.v%2n===0n?1:0}})(),o.type==="legacy"&&(delete o.accessList,delete o.maxFeePerBlobGas,delete o.maxFeePerGas,delete o.maxPriorityFeePerGas,delete o.yParity),o.type==="eip2930"&&(delete o.maxFeePerBlobGas,delete o.maxFeePerGas,delete o.maxPriorityFeePerGas),o.type==="eip1559"&&delete o.maxFeePerBlobGas,o}const defineTransaction=defineFormatter("transaction",formatTransaction);function formatAuthorizationList(et){return et.map(o=>({contractAddress:o.address,chainId:Number(o.chainId),nonce:Number(o.nonce),r:o.r,s:o.s,yParity:Number(o.yParity)}))}function formatBlock(et){var tt;const o=(tt=et.transactions)==null?void 0:tt.map(rt=>typeof rt=="string"?rt:formatTransaction(rt));return{...et,baseFeePerGas:et.baseFeePerGas?BigInt(et.baseFeePerGas):null,blobGasUsed:et.blobGasUsed?BigInt(et.blobGasUsed):void 0,difficulty:et.difficulty?BigInt(et.difficulty):void 0,excessBlobGas:et.excessBlobGas?BigInt(et.excessBlobGas):void 0,gasLimit:et.gasLimit?BigInt(et.gasLimit):void 0,gasUsed:et.gasUsed?BigInt(et.gasUsed):void 0,hash:et.hash?et.hash:null,logsBloom:et.logsBloom?et.logsBloom:null,nonce:et.nonce?et.nonce:null,number:et.number?BigInt(et.number):null,size:et.size?BigInt(et.size):void 0,timestamp:et.timestamp?BigInt(et.timestamp):void 0,transactions:o,totalDifficulty:et.totalDifficulty?BigInt(et.totalDifficulty):null}}const defineBlock=defineFormatter("block",formatBlock);class AccountStateConflictError extends BaseError$3{constructor({address:o}){super(`State for account "${o}" is set multiple times.`,{name:"AccountStateConflictError"})}}class StateAssignmentConflictError extends BaseError$3{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function prettyStateMapping(et){return et.reduce((o,{slot:tt,value:rt})=>`${o} ${tt}: ${rt} -`,"")}function prettyStateOverride(et){return et.reduce((o,{address:tt,...rt})=>{let nt=`${o} ${tt}: -`;return rt.nonce&&(nt+=` nonce: ${rt.nonce} -`),rt.balance&&(nt+=` balance: ${rt.balance} -`),rt.code&&(nt+=` code: ${rt.code} -`),rt.state&&(nt+=` state: -`,nt+=prettyStateMapping(rt.state)),rt.stateDiff&&(nt+=` stateDiff: -`,nt+=prettyStateMapping(rt.stateDiff)),nt},` State Override: -`).slice(0,-1)}function serializeStateMapping(et){if(!(!et||et.length===0))return et.reduce((o,{slot:tt,value:rt})=>{if(tt.length!==66)throw new InvalidBytesLengthError({size:tt.length,targetSize:66,type:"hex"});if(rt.length!==66)throw new InvalidBytesLengthError({size:rt.length,targetSize:66,type:"hex"});return o[tt]=rt,o},{})}function serializeAccountStateOverride(et){const{balance:o,nonce:tt,state:rt,stateDiff:nt,code:ot}=et,it={};if(ot!==void 0&&(it.code=ot),o!==void 0&&(it.balance=numberToHex(o)),tt!==void 0&&(it.nonce=numberToHex(tt)),rt!==void 0&&(it.state=serializeStateMapping(rt)),nt!==void 0){if(it.state)throw new StateAssignmentConflictError;it.stateDiff=serializeStateMapping(nt)}return it}function serializeStateOverride(et){if(!et)return;const o={};for(const{address:tt,...rt}of et){if(!isAddress(tt,{strict:!1}))throw new InvalidAddressError({address:tt});if(o[tt])throw new AccountStateConflictError({address:tt});o[tt]=serializeAccountStateOverride(rt)}return o}async function getBalance$1(et,{address:o,blockNumber:tt,blockTag:rt="latest"}){const nt=tt?numberToHex(tt):void 0,ot=await et.request({method:"eth_getBalance",params:[o,nt||rt]});return BigInt(ot)}function blobsToCommitments(et){const{kzg:o}=et,tt=et.to??(typeof et.blobs[0]=="string"?"hex":"bytes"),rt=typeof et.blobs[0]=="string"?et.blobs.map(ot=>hexToBytes$3(ot)):et.blobs,nt=[];for(const ot of rt)nt.push(Uint8Array.from(o.blobToKzgCommitment(ot)));return tt==="bytes"?nt:nt.map(ot=>bytesToHex$3(ot))}function blobsToProofs(et){const{kzg:o}=et,tt=et.to??(typeof et.blobs[0]=="string"?"hex":"bytes"),rt=typeof et.blobs[0]=="string"?et.blobs.map(it=>hexToBytes$3(it)):et.blobs,nt=typeof et.commitments[0]=="string"?et.commitments.map(it=>hexToBytes$3(it)):et.commitments,ot=[];for(let it=0;itbytesToHex$3(it))}function setBigUint64$1(et,o,tt,rt){if(typeof et.setBigUint64=="function")return et.setBigUint64(o,tt,rt);const nt=BigInt(32),ot=BigInt(4294967295),it=Number(tt>>nt&ot),st=Number(tt&ot),at=rt?4:0,ct=rt?0:4;et.setUint32(o+at,it,rt),et.setUint32(o+ct,st,rt)}const Chi=(et,o,tt)=>et&o^~et&tt,Maj=(et,o,tt)=>et&o^et&tt^o&tt;class HashMD extends Hash{constructor(o,tt,rt,nt){super(),this.blockLen=o,this.outputLen=tt,this.padOffset=rt,this.isLE=nt,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(o),this.view=createView$1(this.buffer)}update(o){exists$1(this);const{view:tt,buffer:rt,blockLen:nt}=this;o=toBytes$2(o);const ot=o.length;for(let it=0;itnt-it&&(this.process(rt,0),it=0);for(let dt=it;dtlt.length)throw new Error("_sha2: outputLen bigger than state");for(let dt=0;dt>>3,pt=rotr(mt,17)^rotr(mt,19)^mt>>>10;SHA256_W[dt]=pt+SHA256_W[dt-7]+ft+SHA256_W[dt-16]|0}let{A:rt,B:nt,C:ot,D:it,E:st,F:at,G:ct,H:lt}=this;for(let dt=0;dt<64;dt++){const ht=rotr(st,6)^rotr(st,11)^rotr(st,25),mt=lt+ht+Chi(st,at,ct)+SHA256_K[dt]+SHA256_W[dt]|0,pt=(rotr(rt,2)^rotr(rt,13)^rotr(rt,22))+Maj(rt,nt,ot)|0;lt=ct,ct=at,at=st,st=it+mt|0,it=ot,ot=nt,nt=rt,rt=mt+pt|0}rt=rt+this.A|0,nt=nt+this.B|0,ot=ot+this.C|0,it=it+this.D|0,st=st+this.E|0,at=at+this.F|0,ct=ct+this.G|0,lt=lt+this.H|0,this.set(rt,nt,ot,it,st,at,ct,lt)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const sha256$3=wrapConstructor(()=>new SHA256);function sha256$2(et,o){return sha256$3(isHex(et,{strict:!1})?toBytes$3(et):et)}function commitmentToVersionedHash(et){const{commitment:o,version:tt=1}=et,rt=et.to??(typeof o=="string"?"hex":"bytes"),nt=sha256$2(o);return nt.set([tt],0),rt==="bytes"?nt:bytesToHex$3(nt)}function commitmentsToVersionedHashes(et){const{commitments:o,version:tt}=et,rt=et.to??(typeof o[0]=="string"?"hex":"bytes"),nt=[];for(const ot of o)nt.push(commitmentToVersionedHash({commitment:ot,to:rt,version:tt}));return nt}const blobsPerTransaction=6,bytesPerFieldElement=32,fieldElementsPerBlob=4096,bytesPerBlob=bytesPerFieldElement*fieldElementsPerBlob,maxBytesPerTransaction=bytesPerBlob*blobsPerTransaction-1-1*fieldElementsPerBlob*blobsPerTransaction,versionedHashVersionKzg=1;class BlobSizeTooLargeError extends BaseError$3{constructor({maxSize:o,size:tt}){super("Blob size is too large.",{metaMessages:[`Max: ${o} bytes`,`Given: ${tt} bytes`],name:"BlobSizeTooLargeError"})}}class EmptyBlobError extends BaseError$3{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class InvalidVersionedHashSizeError extends BaseError$3{constructor({hash:o,size:tt}){super(`Versioned hash "${o}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${tt}`],name:"InvalidVersionedHashSizeError"})}}class InvalidVersionedHashVersionError extends BaseError$3{constructor({hash:o,version:tt}){super(`Versioned hash "${o}" version is invalid.`,{metaMessages:[`Expected: ${versionedHashVersionKzg}`,`Received: ${tt}`],name:"InvalidVersionedHashVersionError"})}}function toBlobs(et){const o=et.to??(typeof et.data=="string"?"hex":"bytes"),tt=typeof et.data=="string"?hexToBytes$3(et.data):et.data,rt=size$2(tt);if(!rt)throw new EmptyBlobError;if(rt>maxBytesPerTransaction)throw new BlobSizeTooLargeError({maxSize:maxBytesPerTransaction,size:rt});const nt=[];let ot=!0,it=0;for(;ot;){const st=createCursor(new Uint8Array(bytesPerBlob));let at=0;for(;atst.bytes):nt.map(st=>bytesToHex$3(st.bytes))}function toBlobSidecars(et){const{data:o,kzg:tt,to:rt}=et,nt=et.blobs??toBlobs({data:o,to:rt}),ot=et.commitments??blobsToCommitments({blobs:nt,kzg:tt,to:rt}),it=et.proofs??blobsToProofs({blobs:nt,commitments:ot,kzg:tt,to:rt}),st=[];for(let at=0;at1||tt[0]>1)throw new InvalidBytesBooleanError(tt);return!!tt[0]}function bytesToNumber$1(et,o={}){typeof o.size<"u"&&assertSize(et,{size:o.size});const tt=bytesToHex$3(et,o);return hexToNumber$2(tt,o)}function bytesToString(et,o={}){let tt=et;return typeof o.size<"u"&&(assertSize(tt,{size:o.size}),tt=trim$1(tt,{dir:"right"})),new TextDecoder().decode(tt)}function decodeAbiParameters(et,o){const tt=typeof o=="string"?hexToBytes$3(o):o,rt=createCursor(tt);if(size$2(tt)===0&&et.length>0)throw new AbiDecodingZeroDataError;if(size$2(o)&&size$2(o)<32)throw new AbiDecodingDataSizeTooSmallError({data:typeof o=="string"?o:bytesToHex$3(o),params:et,size:size$2(o)});let nt=0;const ot=[];for(let it=0;it48?bytesToBigInt(nt,{signed:tt}):bytesToNumber$1(nt,{signed:tt}),32]}function decodeTuple(et,o,{staticPosition:tt}){const rt=o.components.length===0||o.components.some(({name:it})=>!it),nt=rt?[]:{};let ot=0;if(hasDynamicChild(o)){const it=bytesToNumber$1(et.readBytes(sizeOfOffset)),st=tt+it;for(let at=0;atkeccak256$1(toBytes$3(et));function hashSignature(et){return hash(et)}const version$7="1.0.6";let BaseError$2=class Rs extends Error{constructor(o,tt={}){var it;const rt=tt.cause instanceof Rs?tt.cause.details:(it=tt.cause)!=null&&it.message?tt.cause.message:tt.details,nt=tt.cause instanceof Rs&&tt.cause.docsPath||tt.docsPath,ot=[o||"An error occurred.","",...tt.metaMessages?[...tt.metaMessages,""]:[],...nt?[`Docs: https://abitype.dev${nt}`]:[],...rt?[`Details: ${rt}`]:[],`Version: abitype@${version$7}`].join(` -`);super(ot),Object.defineProperty(this,"details",{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,"metaMessages",{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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),tt.cause&&(this.cause=tt.cause),this.details=rt,this.docsPath=nt,this.metaMessages=tt.metaMessages,this.shortMessage=o}};function execTyped(et,o){const tt=et.exec(o);return tt==null?void 0:tt.groups}const bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,isTupleRegex=/^\(.+?\).*?$/,tupleRegex=/^tuple(?(\[(\d*)\])*)$/;function formatAbiParameter(et){let o=et.type;if(tupleRegex.test(et.type)&&"components"in et){o="(";const tt=et.components.length;for(let nt=0;nt[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function isErrorSignature(et){return errorSignatureRegex.test(et)}function execErrorSignature(et){return execTyped(errorSignatureRegex,et)}const eventSignatureRegex=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function isEventSignature(et){return eventSignatureRegex.test(et)}function execEventSignature(et){return execTyped(eventSignatureRegex,et)}const functionSignatureRegex=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function isFunctionSignature(et){return functionSignatureRegex.test(et)}function execFunctionSignature(et){return execTyped(functionSignatureRegex,et)}const structSignatureRegex=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function isStructSignature(et){return structSignatureRegex.test(et)}function execStructSignature(et){return execTyped(structSignatureRegex,et)}const constructorSignatureRegex=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function isConstructorSignature(et){return constructorSignatureRegex.test(et)}function execConstructorSignature(et){return execTyped(constructorSignatureRegex,et)}const fallbackSignatureRegex=/^fallback\(\) external(?:\s(?payable{1}))?$/;function isFallbackSignature(et){return fallbackSignatureRegex.test(et)}const receiveSignatureRegex=/^receive\(\) external payable$/;function isReceiveSignature(et){return receiveSignatureRegex.test(et)}const eventModifiers=new Set(["indexed"]),functionModifiers=new Set(["calldata","memory","storage"]);class UnknownTypeError extends BaseError$2{constructor({type:o}){super("Unknown type.",{metaMessages:[`Type "${o}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class UnknownSolidityTypeError extends BaseError$2{constructor({type:o}){super("Unknown type.",{metaMessages:[`Type "${o}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class InvalidParameterError extends BaseError$2{constructor({param:o}){super("Invalid ABI parameter.",{details:o}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class SolidityProtectedKeywordError extends BaseError$2{constructor({param:o,name:tt}){super("Invalid ABI parameter.",{details:o,metaMessages:[`"${tt}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class InvalidModifierError extends BaseError$2{constructor({param:o,type:tt,modifier:rt}){super("Invalid ABI parameter.",{details:o,metaMessages:[`Modifier "${rt}" not allowed${tt?` in "${tt}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class InvalidFunctionModifierError extends BaseError$2{constructor({param:o,type:tt,modifier:rt}){super("Invalid ABI parameter.",{details:o,metaMessages:[`Modifier "${rt}" not allowed${tt?` in "${tt}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${rt}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class InvalidAbiTypeParameterError extends BaseError$2{constructor({abiParameter:o}){super("Invalid ABI parameter.",{details:JSON.stringify(o,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}let InvalidSignatureError$1=class extends BaseError$2{constructor({signature:o,type:tt}){super(`Invalid ${tt} signature.`,{details:o}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}};class UnknownSignatureError extends BaseError$2{constructor({signature:o}){super("Unknown signature.",{details:o}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class InvalidStructSignatureError extends BaseError$2{constructor({signature:o}){super("Invalid struct signature.",{details:o,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class CircularReferenceError extends BaseError$2{constructor({type:o}){super("Circular reference detected.",{metaMessages:[`Struct "${o}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class InvalidParenthesisError extends BaseError$2{constructor({current:o,depth:tt}){super("Unbalanced parentheses.",{metaMessages:[`"${o.trim()}" has too many ${tt>0?"opening":"closing"} parentheses.`],details:`Depth "${tt}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function getParameterCacheKey(et,o){return o?`${o}:${et}`:et}const parameterCache=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function parseSignature(et,o={}){if(isFunctionSignature(et)){const tt=execFunctionSignature(et);if(!tt)throw new InvalidSignatureError$1({signature:et,type:"function"});const rt=splitParameters(tt.parameters),nt=[],ot=rt.length;for(let st=0;st[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,abiParameterWithTupleRegex=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,dynamicIntegerRegex=/^u?int$/;function parseAbiParameter(et,o){var dt,ht;const tt=getParameterCacheKey(et,o==null?void 0:o.type);if(parameterCache.has(tt))return parameterCache.get(tt);const rt=isTupleRegex.test(et),nt=execTyped(rt?abiParameterWithTupleRegex:abiParameterWithoutTupleRegex,et);if(!nt)throw new InvalidParameterError({param:et});if(nt.name&&isSolidityKeyword(nt.name))throw new SolidityProtectedKeywordError({param:et,name:nt.name});const ot=nt.name?{name:nt.name}:{},it=nt.modifier==="indexed"?{indexed:!0}:{},st=(o==null?void 0:o.structs)??{};let at,ct={};if(rt){at="tuple";const mt=splitParameters(nt.type),ft=[],pt=mt.length;for(let yt=0;yt[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function resolveStructs(et,o,tt=new Set){const rt=[],nt=et.length;for(let ot=0;ot{const o=typeof et=="string"?et:formatAbiItem(et);return normalizeSignature$1(o)};function toSignatureHash(et){return hashSignature(toSignature(et))}const toEventSelector=toSignatureHash,toFunctionSelector=et=>slice(toSignatureHash(et),0,4);function getAbiItem(et){const{abi:o,args:tt=[],name:rt}=et,nt=isHex(rt,{strict:!1}),ot=o.filter(st=>nt?st.type==="function"?toFunctionSelector(st)===rt:st.type==="event"?toEventSelector(st)===rt:!1:"name"in st&&st.name===rt);if(ot.length===0)return;if(ot.length===1)return ot[0];let it;for(const st of ot){if(!("inputs"in st))continue;if(!tt||tt.length===0){if(!st.inputs||st.inputs.length===0)return st;continue}if(!st.inputs||st.inputs.length===0||st.inputs.length!==tt.length)continue;if(tt.every((ct,lt)=>{const dt="inputs"in st&&st.inputs[lt];return dt?isArgOfType(ct,dt):!1})){if(it&&"inputs"in it&&it.inputs){const ct=getAmbiguousTypes(st.inputs,it.inputs,tt);if(ct)throw new AbiItemAmbiguityError({abiItem:st,type:ct[0]},{abiItem:it,type:ct[1]})}it=st}}return it||ot[0]}function isArgOfType(et,o){const tt=typeof et,rt=o.type;switch(rt){case"address":return isAddress(et,{strict:!1});case"bool":return tt==="boolean";case"function":return tt==="string";case"string":return tt==="string";default:return rt==="tuple"&&"components"in o?Object.values(o.components).every((nt,ot)=>isArgOfType(Object.values(et)[ot],nt)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(rt)?tt==="number"||tt==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(rt)?tt==="string"||et instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(rt)?Array.isArray(et)&&et.every(nt=>isArgOfType(nt,{...o,type:rt.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function getAmbiguousTypes(et,o,tt){for(const rt in et){const nt=et[rt],ot=o[rt];if(nt.type==="tuple"&&ot.type==="tuple"&&"components"in nt&&"components"in ot)return getAmbiguousTypes(nt.components,ot.components,tt[rt]);const it=[nt.type,ot.type];if(it.includes("address")&&it.includes("bytes20")?!0:it.includes("address")&&it.includes("string")?isAddress(tt[rt],{strict:!1}):it.includes("address")&&it.includes("bytes")?isAddress(tt[rt],{strict:!1}):!1)return it}}const docsPath$1="/docs/contract/decodeFunctionResult";function decodeFunctionResult(et){const{abi:o,args:tt,functionName:rt,data:nt}=et;let ot=o[0];if(rt){const st=getAbiItem({abi:o,args:tt,name:rt});if(!st)throw new AbiFunctionNotFoundError(rt,{docsPath:docsPath$1});ot=st}if(ot.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$1});if(!ot.outputs)throw new AbiFunctionOutputsNotFoundError(ot.name,{docsPath:docsPath$1});const it=decodeAbiParameters(ot.outputs,nt);if(it&&it.length>1)return it;if(it&&it.length===1)return it[0]}const docsPath="/docs/contract/encodeFunctionData";function prepareEncodeFunctionData(et){const{abi:o,args:tt,functionName:rt}=et;let nt=o[0];if(rt){const ot=getAbiItem({abi:o,args:tt,name:rt});if(!ot)throw new AbiFunctionNotFoundError(rt,{docsPath});nt=ot}if(nt.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath});return{abi:[nt],functionName:toFunctionSelector(formatAbiItem$1(nt))}}function encodeFunctionData(et){const{args:o}=et,{abi:tt,functionName:rt}=(()=>{var st;return et.abi.length===1&&((st=et.functionName)!=null&&st.startsWith("0x"))?et:prepareEncodeFunctionData(et)})(),nt=tt[0],ot=rt,it="inputs"in nt&&nt.inputs?encodeAbiParameters(nt.inputs,o??[]):void 0;return concatHex([ot,it??"0x"])}function getChainContractAddress({blockNumber:et,chain:o,contract:tt}){var nt;const rt=(nt=o==null?void 0:o.contracts)==null?void 0:nt[tt];if(!rt)throw new ChainDoesNotSupportContract({chain:o,contract:{name:tt}});if(et&&rt.blockCreated&&rt.blockCreated>et)throw new ChainDoesNotSupportContract({blockNumber:et,chain:o,contract:{name:tt,blockCreated:rt.blockCreated}});return rt.address}const panicReasons={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function decodeErrorResult(et){const{abi:o,data:tt}=et,rt=slice(tt,0,4);if(rt==="0x")throw new AbiDecodingZeroDataError;const ot=[...o||[],solidityError,solidityPanic].find(it=>it.type==="error"&&rt===toFunctionSelector(formatAbiItem$1(it)));if(!ot)throw new AbiErrorSignatureNotFoundError(rt,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:ot,args:"inputs"in ot&&ot.inputs&&ot.inputs.length>0?decodeAbiParameters(ot.inputs,slice(tt,4)):void 0,errorName:ot.name}}function formatAbiItemWithArgs({abiItem:et,args:o,includeFunctionName:tt=!0,includeName:rt=!1}){if("name"in et&&"inputs"in et&&et.inputs)return`${tt?et.name:""}(${et.inputs.map((nt,ot)=>`${rt&&nt.name?`${nt.name}: `:""}${typeof o[ot]=="object"?stringify$2(o[ot]):o[ot]}`).join(", ")})`}class CallExecutionError extends BaseError$3{constructor(o,{account:tt,docsPath:rt,chain:nt,data:ot,gas:it,gasPrice:st,maxFeePerGas:at,maxPriorityFeePerGas:ct,nonce:lt,to:dt,value:ht,stateOverride:mt}){var yt;const ft=tt?parseAccount(tt):void 0;let pt=prettyPrint({from:ft==null?void 0:ft.address,to:dt,value:typeof ht<"u"&&`${formatEther(ht)} ${((yt=nt==null?void 0:nt.nativeCurrency)==null?void 0:yt.symbol)||"ETH"}`,data:ot,gas:it,gasPrice:typeof st<"u"&&`${formatGwei(st)} gwei`,maxFeePerGas:typeof at<"u"&&`${formatGwei(at)} gwei`,maxPriorityFeePerGas:typeof ct<"u"&&`${formatGwei(ct)} gwei`,nonce:lt});mt&&(pt+=` -${prettyStateOverride(mt)}`),super(o.shortMessage,{cause:o,docsPath:rt,metaMessages:[...o.metaMessages?[...o.metaMessages," "]:[],"Raw Call Arguments:",pt].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=o}}class ContractFunctionExecutionError extends BaseError$3{constructor(o,{abi:tt,args:rt,contractAddress:nt,docsPath:ot,functionName:it,sender:st}){const at=getAbiItem({abi:tt,args:rt,name:it}),ct=at?formatAbiItemWithArgs({abiItem:at,args:rt,includeFunctionName:!1,includeName:!1}):void 0,lt=at?formatAbiItem$1(at,{includeName:!0}):void 0,dt=prettyPrint({address:nt&&getContractAddress(nt),function:lt,args:ct&&ct!=="()"&&`${[...Array((it==null?void 0:it.length)??0).keys()].map(()=>" ").join("")}${ct}`,sender:st});super(o.shortMessage||`An unknown error occurred while executing the contract function "${it}".`,{cause:o,docsPath:ot,metaMessages:[...o.metaMessages?[...o.metaMessages," "]:[],dt&&"Contract Call:",dt].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{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,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=tt,this.args=rt,this.cause=o,this.contractAddress=nt,this.functionName=it,this.sender=st}}class ContractFunctionRevertedError extends BaseError$3{constructor({abi:o,data:tt,functionName:rt,message:nt}){let ot,it,st,at;if(tt&&tt!=="0x")try{it=decodeErrorResult({abi:o,data:tt});const{abiItem:lt,errorName:dt,args:ht}=it;if(dt==="Error")at=ht[0];else if(dt==="Panic"){const[mt]=ht;at=panicReasons[mt]}else{const mt=lt?formatAbiItem$1(lt,{includeName:!0}):void 0,ft=lt&&ht?formatAbiItemWithArgs({abiItem:lt,args:ht,includeFunctionName:!1,includeName:!1}):void 0;st=[mt?`Error: ${mt}`:"",ft&&ft!=="()"?` ${[...Array((dt==null?void 0:dt.length)??0).keys()].map(()=>" ").join("")}${ft}`:""]}}catch(lt){ot=lt}else nt&&(at=nt);let ct;ot instanceof AbiErrorSignatureNotFoundError&&(ct=ot.signature,st=[`Unable to decode signature "${ct}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${ct}.`]),super(at&&at!=="execution reverted"||ct?[`The contract function "${rt}" reverted with the following ${ct?"signature":"reason"}:`,at||ct].join(` -`):`The contract function "${rt}" reverted.`,{cause:ot,metaMessages:st,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=it,this.reason=at,this.signature=ct}}class ContractFunctionZeroDataError extends BaseError$3{constructor({functionName:o}){super(`The contract function "${o}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${o}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class CounterfactualDeploymentFailedError extends BaseError$3{constructor({factory:o}){super(`Deployment for counterfactual contract call failed${o?` for factory "${o}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class RawContractError extends BaseError$3{constructor({data:o,message:tt}){super(tt||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=o}}function isNullUniversalResolverError(et,o){var rt,nt,ot,it,st,at;if(!(et instanceof BaseError$3))return!1;const tt=et.walk(ct=>ct instanceof ContractFunctionRevertedError);return tt instanceof ContractFunctionRevertedError?!!(((rt=tt.data)==null?void 0:rt.errorName)==="ResolverNotFound"||((nt=tt.data)==null?void 0:nt.errorName)==="ResolverWildcardNotSupported"||((ot=tt.data)==null?void 0:ot.errorName)==="ResolverNotContract"||((it=tt.data)==null?void 0:it.errorName)==="ResolverError"||((st=tt.data)==null?void 0:st.errorName)==="HttpError"||(at=tt.reason)!=null&&at.includes("Wildcard on non-extended resolvers is not supported")||o==="reverse"&&tt.reason===panicReasons[50]):!1}function encodedLabelToLabelhash(et){if(et.length!==66||et.indexOf("[")!==0||et.indexOf("]")!==65)return null;const o=`0x${et.slice(1,65)}`;return isHex(o)?o:null}function namehash(et){let o=new Uint8Array(32).fill(0);if(!et)return bytesToHex$3(o);const tt=et.split(".");for(let rt=tt.length-1;rt>=0;rt-=1){const nt=encodedLabelToLabelhash(tt[rt]),ot=nt?toBytes$3(nt):keccak256$1(stringToBytes(tt[rt]),"bytes");o=keccak256$1(concat$6([o,ot]),"bytes")}return bytesToHex$3(o)}function encodeLabelhash(et){return`[${et.slice(2)}]`}function labelhash(et){const o=new Uint8Array(32).fill(0);return et?encodedLabelToLabelhash(et)||keccak256$1(stringToBytes(et)):bytesToHex$3(o)}function packetToBytes(et){const o=et.replace(/^\.|\.$/gm,"");if(o.length===0)return new Uint8Array(1);const tt=new Uint8Array(stringToBytes(o).byteLength+2);let rt=0;const nt=o.split(".");for(let ot=0;ot255&&(it=stringToBytes(encodeLabelhash(labelhash(nt[ot])))),tt[rt]=it.length,tt.set(it,rt+1),rt+=it.length+1}return tt.byteLength!==rt+1?tt.slice(0,rt+1):tt}const EXECUTION_REVERTED_ERROR_CODE=3;function getContractError(et,{abi:o,address:tt,args:rt,docsPath:nt,functionName:ot,sender:it}){const{code:st,data:at,message:ct,shortMessage:lt}=et instanceof RawContractError?et:et instanceof BaseError$3?et.walk(ht=>"data"in ht)||et.walk():{},dt=et instanceof AbiDecodingZeroDataError?new ContractFunctionZeroDataError({functionName:ot}):[EXECUTION_REVERTED_ERROR_CODE,InternalRpcError.code].includes(st)&&(at||ct||lt)?new ContractFunctionRevertedError({abi:o,data:typeof at=="object"?at.data:at,functionName:ot,message:lt??ct}):et;return new ContractFunctionExecutionError(dt,{abi:o,args:rt,contractAddress:tt,docsPath:nt,functionName:ot,sender:it})}const aggregate3Signature="0x82ad56cb",deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";function getCallError(et,{docsPath:o,...tt}){const rt=(()=>{const nt=getNodeError(et,tt);return nt instanceof UnknownNodeError?et:nt})();return new CallExecutionError(rt,{docsPath:o,...tt})}const schedulerCache=new Map;function createBatchScheduler({fn:et,id:o,shouldSplitBatch:tt,wait:rt=0,sort:nt}){const ot=async()=>{const lt=at();it();const dt=lt.map(({args:ht})=>ht);dt.length!==0&&et(dt).then(ht=>{var mt;nt&&Array.isArray(ht)&&ht.sort(nt);for(let ft=0;ft{var mt;for(let ft=0;ftschedulerCache.delete(o),st=()=>at().map(({args:lt})=>lt),at=()=>schedulerCache.get(o)||[],ct=lt=>schedulerCache.set(o,[...at(),lt]);return{flush:it,async schedule(lt){const dt={},ht=new Promise((pt,yt)=>{dt.resolve=pt,dt.reject=yt});return(tt==null?void 0:tt([...st(),lt]))&&ot(),at().length>0?(ct({args:lt,pendingPromise:dt}),ht):(ct({args:lt,pendingPromise:dt}),setTimeout(ot,rt),ht)}}}async function call(et,o){var Nt,Lt,Mt,zt;const{account:tt=et.account,batch:rt=!!((Nt=et.batch)!=null&&Nt.multicall),blockNumber:nt,blockTag:ot="latest",accessList:it,blobs:st,code:at,data:ct,factory:lt,factoryData:dt,gas:ht,gasPrice:mt,maxFeePerBlobGas:ft,maxFeePerGas:pt,maxPriorityFeePerGas:yt,nonce:gt,to:bt,value:xt,stateOverride:vt,...Et}=o,Ct=tt?parseAccount(tt):void 0;if(at&&(lt||dt))throw new BaseError$3("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(at&&bt)throw new BaseError$3("Cannot provide both `code` & `to` as parameters.");const St=at&&ct,At=lt&&dt&&bt&&ct,kt=St||At,It=St?toDeploylessCallViaBytecodeData({code:at,data:ct}):At?toDeploylessCallViaFactoryData({data:ct,factory:lt,factoryData:dt,to:bt}):ct;try{assertRequest(o);const Xt=(nt?numberToHex(nt):void 0)||ot,Wt=serializeStateOverride(vt),Ft=(zt=(Mt=(Lt=et.chain)==null?void 0:Lt.formatters)==null?void 0:Mt.transactionRequest)==null?void 0:zt.format,Pt=(Ft||formatTransactionRequest)({...extract$1(Et,{format:Ft}),from:Ct==null?void 0:Ct.address,accessList:it,blobs:st,data:It,gas:ht,gasPrice:mt,maxFeePerBlobGas:ft,maxFeePerGas:pt,maxPriorityFeePerGas:yt,nonce:gt,to:kt?void 0:bt,value:xt});if(rt&&shouldPerformMulticall({request:Pt})&&!Wt)try{return await scheduleMulticall(et,{...Pt,blockNumber:nt,blockTag:ot})}catch(Qt){if(!(Qt instanceof ClientChainNotConfiguredError)&&!(Qt instanceof ChainDoesNotSupportContract))throw Qt}const Yt=await et.request({method:"eth_call",params:Wt?[Pt,Xt,Wt]:[Pt,Xt]});return Yt==="0x"?{data:void 0}:{data:Yt}}catch(Ut){const Xt=getRevertErrorData(Ut),{offchainLookup:Wt,offchainLookupSignature:Ft}=await __vitePreload(async()=>{const{offchainLookup:qt,offchainLookupSignature:Pt}=await import("./ccip-BL6nn1x6.js");return{offchainLookup:qt,offchainLookupSignature:Pt}},[]);if(et.ccipRead!==!1&&(Xt==null?void 0:Xt.slice(0,10))===Ft&&bt)return{data:await Wt(et,{data:Xt,to:bt})};throw kt&&(Xt==null?void 0:Xt.slice(0,10))==="0x101bb98d"?new CounterfactualDeploymentFailedError({factory:lt}):getCallError(Ut,{...o,account:Ct,chain:et.chain})}}function shouldPerformMulticall({request:et}){const{data:o,to:tt,...rt}=et;return!(!o||o.startsWith(aggregate3Signature)||!tt||Object.values(rt).filter(nt=>typeof nt<"u").length>0)}async function scheduleMulticall(et,o){var pt;const{batchSize:tt=1024,wait:rt=0}=typeof((pt=et.batch)==null?void 0:pt.multicall)=="object"?et.batch.multicall:{},{blockNumber:nt,blockTag:ot="latest",data:it,multicallAddress:st,to:at}=o;let ct=st;if(!ct){if(!et.chain)throw new ClientChainNotConfiguredError;ct=getChainContractAddress({blockNumber:nt,chain:et.chain,contract:"multicall3"})}const dt=(nt?numberToHex(nt):void 0)||ot,{schedule:ht}=createBatchScheduler({id:`${et.uid}.${dt}`,wait:rt,shouldSplitBatch(yt){return yt.reduce((bt,{data:xt})=>bt+(xt.length-2),0)>tt*2},fn:async yt=>{const gt=yt.map(vt=>({allowFailure:!0,callData:vt.data,target:vt.to})),bt=encodeFunctionData({abi:multicall3Abi,args:[gt],functionName:"aggregate3"}),xt=await et.request({method:"eth_call",params:[{data:bt,to:ct},dt]});return decodeFunctionResult({abi:multicall3Abi,args:[gt],functionName:"aggregate3",data:xt||"0x"})}}),[{returnData:mt,success:ft}]=await ht({data:it,to:at});if(!ft)throw new RawContractError({data:mt});return mt==="0x"?{data:void 0}:{data:mt}}function toDeploylessCallViaBytecodeData(et){const{code:o,data:tt}=et;return encodeDeployData({abi:parseAbi(["constructor(bytes, bytes)"]),bytecode:deploylessCallViaBytecodeBytecode,args:[o,tt]})}function toDeploylessCallViaFactoryData(et){const{data:o,factory:tt,factoryData:rt,to:nt}=et;return encodeDeployData({abi:parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:deploylessCallViaFactoryBytecode,args:[nt,o,tt,rt]})}function getRevertErrorData(et){var tt;if(!(et instanceof BaseError$3))return;const o=et.walk();return typeof(o==null?void 0:o.data)=="object"?(tt=o.data)==null?void 0:tt.data:o.data}async function readContract$1(et,o){const{abi:tt,address:rt,args:nt,functionName:ot,...it}=o,st=encodeFunctionData({abi:tt,args:nt,functionName:ot});try{const{data:at}=await getAction$1(et,call,"call")({...it,data:st,to:rt});return decodeFunctionResult({abi:tt,args:nt,functionName:ot,data:at||"0x"})}catch(at){throw getContractError(at,{abi:tt,address:rt,args:nt,docsPath:"/docs/contract/readContract",functionName:ot})}}async function getEnsAddress$1(et,{blockNumber:o,blockTag:tt,coinType:rt,name:nt,gatewayUrls:ot,strict:it,universalResolverAddress:st}){let at=st;if(!at){if(!et.chain)throw new Error("client chain not configured. universalResolverAddress is required.");at=getChainContractAddress({blockNumber:o,chain:et.chain,contract:"ensUniversalResolver"})}try{const ct=encodeFunctionData({abi:addressResolverAbi,functionName:"addr",...rt!=null?{args:[namehash(nt),BigInt(rt)]}:{args:[namehash(nt)]}}),lt={address:at,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex(packetToBytes(nt)),ct],blockNumber:o,blockTag:tt},dt=getAction$1(et,readContract$1,"readContract"),ht=ot?await dt({...lt,args:[...lt.args,ot]}):await dt(lt);if(ht[0]==="0x")return null;const mt=decodeFunctionResult({abi:addressResolverAbi,args:rt!=null?[namehash(nt),BigInt(rt)]:void 0,functionName:"addr",data:ht[0]});return mt==="0x"||trim$1(mt)==="0x00"?null:mt}catch(ct){if(it)throw ct;if(isNullUniversalResolverError(ct,"resolve"))return null;throw ct}}class EnsAvatarInvalidMetadataError extends BaseError$3{constructor({data:o}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(o)}`],name:"EnsAvatarInvalidMetadataError"})}}class EnsAvatarInvalidNftUriError extends BaseError$3{constructor({reason:o}){super(`ENS NFT avatar URI is invalid. ${o}`,{name:"EnsAvatarInvalidNftUriError"})}}class EnsAvatarUriResolutionError extends BaseError$3{constructor({uri:o}){super(`Unable to resolve ENS avatar URI "${o}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class EnsAvatarUnsupportedNamespaceError extends BaseError$3{constructor({namespace:o}){super(`ENS NFT avatar namespace "${o}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const networkRegex=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,ipfsHashRegex=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,base64Regex=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dataURIRegex=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function isImageUri(et){try{const o=await fetch(et,{method:"HEAD"});if(o.status===200){const tt=o.headers.get("content-type");return tt==null?void 0:tt.startsWith("image/")}return!1}catch(o){return typeof o=="object"&&typeof o.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(tt=>{const rt=new Image;rt.onload=()=>{tt(!0)},rt.onerror=()=>{tt(!1)},rt.src=et})}}function getGateway(et,o){return et?et.endsWith("/")?et.slice(0,-1):et:o}function resolveAvatarUri({uri:et,gatewayUrls:o}){const tt=base64Regex.test(et);if(tt)return{uri:et,isOnChain:!0,isEncoded:tt};const rt=getGateway(o==null?void 0:o.ipfs,"https://ipfs.io"),nt=getGateway(o==null?void 0:o.arweave,"https://arweave.net"),ot=et.match(networkRegex),{protocol:it,subpath:st,target:at,subtarget:ct=""}=(ot==null?void 0:ot.groups)||{},lt=it==="ipns:/"||st==="ipns/",dt=it==="ipfs:/"||st==="ipfs/"||ipfsHashRegex.test(et);if(et.startsWith("http")&&!lt&&!dt){let mt=et;return o!=null&&o.arweave&&(mt=et.replace(/https:\/\/arweave.net/g,o==null?void 0:o.arweave)),{uri:mt,isOnChain:!1,isEncoded:!1}}if((lt||dt)&&at)return{uri:`${rt}/${lt?"ipns":"ipfs"}/${at}${ct}`,isOnChain:!1,isEncoded:!1};if(it==="ar:/"&&at)return{uri:`${nt}/${at}${ct||""}`,isOnChain:!1,isEncoded:!1};let ht=et.replace(dataURIRegex,"");if(ht.startsWith("nt.json());return await parseAvatarUri({gatewayUrls:et,uri:getJsonImage(tt)})}catch{throw new EnsAvatarUriResolutionError({uri:o})}}async function parseAvatarUri({gatewayUrls:et,uri:o}){const{uri:tt,isOnChain:rt}=resolveAvatarUri({uri:o,gatewayUrls:et});if(rt||await isImageUri(tt))return tt;throw new EnsAvatarUriResolutionError({uri:o})}function parseNftUri(et){let o=et;o.startsWith("did:nft:")&&(o=o.replace("did:nft:","").replace(/_/g,"/"));const[tt,rt,nt]=o.split("/"),[ot,it]=tt.split(":"),[st,at]=rt.split(":");if(!ot||ot.toLowerCase()!=="eip155")throw new EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!it)throw new EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!at)throw new EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!nt)throw new EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!st)throw new EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(it),namespace:st.toLowerCase(),contractAddress:at,tokenID:nt}}async function getNftTokenUri(et,{nft:o}){if(o.namespace==="erc721")return readContract$1(et,{address:o.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(o.tokenID)]});if(o.namespace==="erc1155")return readContract$1(et,{address:o.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(o.tokenID)]});throw new EnsAvatarUnsupportedNamespaceError({namespace:o.namespace})}async function parseAvatarRecord(et,{gatewayUrls:o,record:tt}){return/eip155:/i.test(tt)?parseNftAvatarUri(et,{gatewayUrls:o,record:tt}):parseAvatarUri({uri:tt,gatewayUrls:o})}async function parseNftAvatarUri(et,{gatewayUrls:o,record:tt}){const rt=parseNftUri(tt),nt=await getNftTokenUri(et,{nft:rt}),{uri:ot,isOnChain:it,isEncoded:st}=resolveAvatarUri({uri:nt,gatewayUrls:o});if(it&&(ot.includes("data:application/json;base64,")||ot.startsWith("{"))){const ct=st?atob(ot.replace("data:application/json;base64,","")):ot,lt=JSON.parse(ct);return parseAvatarUri({uri:getJsonImage(lt),gatewayUrls:o})}let at=rt.tokenID;return rt.namespace==="erc1155"&&(at=at.replace("0x","").padStart(64,"0")),getMetadataAvatarUri({gatewayUrls:o,uri:ot.replace(/(?:0x)?{id}/,at)})}async function getEnsText(et,{blockNumber:o,blockTag:tt,name:rt,key:nt,gatewayUrls:ot,strict:it,universalResolverAddress:st}){let at=st;if(!at){if(!et.chain)throw new Error("client chain not configured. universalResolverAddress is required.");at=getChainContractAddress({blockNumber:o,chain:et.chain,contract:"ensUniversalResolver"})}try{const ct={address:at,abi:universalResolverResolveAbi,functionName:"resolve",args:[toHex(packetToBytes(rt)),encodeFunctionData({abi:textResolverAbi,functionName:"text",args:[namehash(rt),nt]})],blockNumber:o,blockTag:tt},lt=getAction$1(et,readContract$1,"readContract"),dt=ot?await lt({...ct,args:[...ct.args,ot]}):await lt(ct);if(dt[0]==="0x")return null;const ht=decodeFunctionResult({abi:textResolverAbi,functionName:"text",data:dt[0]});return ht===""?null:ht}catch(ct){if(it)throw ct;if(isNullUniversalResolverError(ct,"resolve"))return null;throw ct}}async function getEnsAvatar$1(et,{blockNumber:o,blockTag:tt,assetGatewayUrls:rt,name:nt,gatewayUrls:ot,strict:it,universalResolverAddress:st}){const at=await getAction$1(et,getEnsText,"getEnsText")({blockNumber:o,blockTag:tt,key:"avatar",name:nt,universalResolverAddress:st,gatewayUrls:ot,strict:it});if(!at)return null;try{return await parseAvatarRecord(et,{record:at,gatewayUrls:rt})}catch{return null}}async function getEnsName$1(et,{address:o,blockNumber:tt,blockTag:rt,gatewayUrls:nt,strict:ot,universalResolverAddress:it}){let st=it;if(!st){if(!et.chain)throw new Error("client chain not configured. universalResolverAddress is required.");st=getChainContractAddress({blockNumber:tt,chain:et.chain,contract:"ensUniversalResolver"})}const at=`${o.toLowerCase().substring(2)}.addr.reverse`;try{const ct={address:st,abi:universalResolverReverseAbi,functionName:"reverse",args:[toHex(packetToBytes(at))],blockNumber:tt,blockTag:rt},lt=getAction$1(et,readContract$1,"readContract"),[dt,ht]=nt?await lt({...ct,args:[...ct.args,nt]}):await lt(ct);return o.toLowerCase()!==ht.toLowerCase()?null:dt}catch(ct){if(ot)throw ct;if(isNullUniversalResolverError(ct,"reverse"))return null;throw ct}}const promiseCache$1=new Map,responseCache=new Map;function getCache(et){const o=(nt,ot)=>({clear:()=>ot.delete(nt),get:()=>ot.get(nt),set:it=>ot.set(nt,it)}),tt=o(et,promiseCache$1),rt=o(et,responseCache);return{clear:()=>{tt.clear(),rt.clear()},promise:tt,response:rt}}async function withCache(et,{cacheKey:o,cacheTime:tt=Number.POSITIVE_INFINITY}){const rt=getCache(o),nt=rt.response.get();if(nt&&tt>0&&new Date().getTime()-nt.created.getTime()`blockNumber.${et}`;async function getBlockNumber$1(et,{cacheTime:o=et.cacheTime}={}){const tt=await withCache(()=>et.request({method:"eth_blockNumber"}),{cacheKey:cacheKey(et.uid),cacheTime:o});return BigInt(tt)}function formatLog(et,{args:o,eventName:tt}={}){return{...et,blockHash:et.blockHash?et.blockHash:null,blockNumber:et.blockNumber?BigInt(et.blockNumber):null,logIndex:et.logIndex?Number(et.logIndex):null,transactionHash:et.transactionHash?et.transactionHash:null,transactionIndex:et.transactionIndex?Number(et.transactionIndex):null,...tt?{args:o,eventName:tt}:{}}}const receiptStatuses={"0x0":"reverted","0x1":"success"};function formatTransactionReceipt(et){const o={...et,blockNumber:et.blockNumber?BigInt(et.blockNumber):null,contractAddress:et.contractAddress?et.contractAddress:null,cumulativeGasUsed:et.cumulativeGasUsed?BigInt(et.cumulativeGasUsed):null,effectiveGasPrice:et.effectiveGasPrice?BigInt(et.effectiveGasPrice):null,gasUsed:et.gasUsed?BigInt(et.gasUsed):null,logs:et.logs?et.logs.map(tt=>formatLog(tt)):null,to:et.to?et.to:null,transactionIndex:et.transactionIndex?hexToNumber$2(et.transactionIndex):null,status:et.status?receiptStatuses[et.status]:null,type:et.type?transactionType[et.type]||et.type:null};return et.blobGasPrice&&(o.blobGasPrice=BigInt(et.blobGasPrice)),et.blobGasUsed&&(o.blobGasUsed=BigInt(et.blobGasUsed)),o}const defineTransactionReceipt=defineFormatter("transactionReceipt",formatTransactionReceipt);async function multicall$1(et,o){var yt;const{allowFailure:tt=!0,batchSize:rt,blockNumber:nt,blockTag:ot,multicallAddress:it,stateOverride:st}=o,at=o.contracts,ct=rt??(typeof((yt=et.batch)==null?void 0:yt.multicall)=="object"&&et.batch.multicall.batchSize||1024);let lt=it;if(!lt){if(!et.chain)throw new Error("client chain not configured. multicallAddress is required.");lt=getChainContractAddress({blockNumber:nt,chain:et.chain,contract:"multicall3"})}const dt=[[]];let ht=0,mt=0;for(let gt=0;gt0&&mt>ct&&dt[ht].length>0&&(ht++,mt=(Ct.length-2)/2,dt[ht]=[]),dt[ht]=[...dt[ht],{allowFailure:!0,callData:Ct,target:xt}]}catch(Ct){const St=getContractError(Ct,{abi:bt,address:xt,args:vt,docsPath:"/docs/contract/multicall",functionName:Et});if(!tt)throw St;dt[ht]=[...dt[ht],{allowFailure:!0,callData:"0x",target:xt}]}}const ft=await Promise.allSettled(dt.map(gt=>getAction$1(et,readContract$1,"readContract")({abi:multicall3Abi,address:lt,args:[gt],blockNumber:nt,blockTag:ot,functionName:"aggregate3",stateOverride:st}))),pt=[];for(let gt=0;gtlistenersCache.get(et)||[],ot=()=>{const lt=nt();listenersCache.set(et,lt.filter(dt=>dt.id!==rt))},it=()=>{const lt=cleanupCache.get(et);nt().length===1&<&<(),ot()},st=nt();if(listenersCache.set(et,[...st,{id:rt,fns:o}]),st&&st.length>0)return it;const at={};for(const lt in o)at[lt]=(...dt)=>{var mt,ft;const ht=nt();if(ht.length!==0)for(const pt of ht)(ft=(mt=pt.fns)[lt])==null||ft.call(mt,...dt)};const ct=tt(at);return typeof ct=="function"&&cleanupCache.set(et,ct),it}async function wait$1(et){return new Promise(o=>setTimeout(o,et))}function poll(et,{emitOnBegin:o,initialWaitTime:tt,interval:rt}){let nt=!0;const ot=()=>nt=!1;return(async()=>{let st;o&&(st=await et({unpoll:ot}));const at=await(tt==null?void 0:tt(st))??rt;await wait$1(at);const ct=async()=>{nt&&(await et({unpoll:ot}),await wait$1(rt),ct())};ct()})(),ot}function watchBlockNumber$1(et,{emitOnBegin:o=!1,emitMissed:tt=!1,onBlockNumber:rt,onError:nt,poll:ot,pollingInterval:it=et.pollingInterval}){const st=typeof ot<"u"?ot:!(et.transport.type==="webSocket"||et.transport.type==="fallback"&&et.transport.transports[0].config.type==="webSocket");let at;return st?(()=>{const dt=stringify$2(["watchBlockNumber",et.uid,o,tt,it]);return observe(dt,{onBlockNumber:rt,onError:nt},ht=>poll(async()=>{var mt;try{const ft=await getAction$1(et,getBlockNumber$1,"getBlockNumber")({cacheTime:0});if(at){if(ft===at)return;if(ft-at>1&&tt)for(let pt=at+1n;ptat)&&(ht.onBlockNumber(ft,at),at=ft)}catch(ft){(mt=ht.onError)==null||mt.call(ht,ft)}},{emitOnBegin:o,interval:it}))})():(()=>{const dt=stringify$2(["watchBlockNumber",et.uid,o,tt]);return observe(dt,{onBlockNumber:rt,onError:nt},ht=>{let mt=!0,ft=()=>mt=!1;return(async()=>{try{const pt=(()=>{if(et.transport.type==="fallback"){const gt=et.transport.transports.find(bt=>bt.config.type==="webSocket");return gt?gt.value:et.transport}return et.transport})(),{unsubscribe:yt}=await pt.subscribe({params:["newHeads"],onData(gt){var xt;if(!mt)return;const bt=hexToBigInt((xt=gt.result)==null?void 0:xt.number);ht.onBlockNumber(bt,at),at=bt},onError(gt){var bt;(bt=ht.onError)==null||bt.call(ht,gt)}});ft=yt,mt||ft()}catch(pt){nt==null||nt(pt)}})(),()=>ft()})})()}const promiseCache=new LruMap(8192);function withDedupe(et,{enabled:o=!0,id:tt}){if(!o||!tt)return et();if(promiseCache.get(tt))return promiseCache.get(tt);const rt=et().finally(()=>promiseCache.delete(tt));return promiseCache.set(tt,rt),rt}function withRetry(et,{delay:o=100,retryCount:tt=2,shouldRetry:rt=()=>!0}={}){return new Promise((nt,ot)=>{const it=async({count:st=0}={})=>{const at=async({error:ct})=>{const lt=typeof o=="function"?o({count:st,error:ct}):o;lt&&await wait$1(lt),it({count:st+1})};try{const ct=await et();nt(ct)}catch(ct){if(st{const{dedupe:nt=!1,retryDelay:ot=150,retryCount:it=3,uid:st}={...o,...rt},at=nt?keccak256$1(stringToHex(`${st}.${stringify$2(tt)}`)):void 0;return withDedupe(()=>withRetry(async()=>{try{return await et(tt)}catch(ct){const lt=ct;switch(lt.code){case ParseRpcError.code:throw new ParseRpcError(lt);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(lt);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(lt,{method:tt.method});case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(lt);case InternalRpcError.code:throw new InternalRpcError(lt);case InvalidInputRpcError.code:throw new InvalidInputRpcError(lt);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(lt);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(lt);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(lt);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(lt,{method:tt.method});case LimitExceededRpcError.code:throw new LimitExceededRpcError(lt);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(lt);case UserRejectedRequestError.code:throw new UserRejectedRequestError(lt);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(lt);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(lt);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(lt);case ChainDisconnectedError.code:throw new ChainDisconnectedError(lt);case SwitchChainError.code:throw new SwitchChainError(lt);case 5e3:throw new UserRejectedRequestError(lt);default:throw ct instanceof BaseError$3?ct:new UnknownRpcError(lt)}}},{delay:({count:ct,error:lt})=>{var dt;if(lt&< instanceof HttpRequestError){const ht=(dt=lt==null?void 0:lt.headers)==null?void 0:dt.get("Retry-After");if(ht!=null&&ht.match(/\d/))return Number.parseInt(ht)*1e3}return~~(1<shouldRetry(ct)}),{enabled:nt,id:at})}}function shouldRetry(et){return"code"in et&&typeof et.code=="number"?et.code===-1||et.code===LimitExceededRpcError.code||et.code===InternalRpcError.code:et instanceof HttpRequestError&&et.status?et.status===403||et.status===408||et.status===413||et.status===429||et.status===500||et.status===502||et.status===503||et.status===504:!0}function defineChain(et){return{formatters:void 0,fees:void 0,serializers:void 0,...et}}function withTimeout(et,{errorInstance:o=new Error("timed out"),timeout:tt,signal:rt}){return new Promise((nt,ot)=>{(async()=>{let it;try{const st=new AbortController;tt>0&&(it=setTimeout(()=>{rt?st.abort():ot(o)},tt)),nt(await et({signal:(st==null?void 0:st.signal)||null}))}catch(st){(st==null?void 0:st.name)==="AbortError"&&ot(o),ot(st)}finally{clearTimeout(it)}})()})}function createIdStore(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const idCache=createIdStore();function getHttpRpcClient(et,o={}){return{async request(tt){var dt;const{body:rt,onRequest:nt=o.onRequest,onResponse:ot=o.onResponse,timeout:it=o.timeout??1e4}=tt,st={...o.fetchOptions??{},...tt.fetchOptions??{}},{headers:at,method:ct,signal:lt}=st;try{const ht=await withTimeout(async({signal:ft})=>{const pt={...st,body:Array.isArray(rt)?stringify$2(rt.map(xt=>({jsonrpc:"2.0",id:xt.id??idCache.take(),...xt}))):stringify$2({jsonrpc:"2.0",id:rt.id??idCache.take(),...rt}),headers:{"Content-Type":"application/json",...at},method:ct||"POST",signal:lt||(it>0?ft:null)},yt=new Request(et,pt),gt=await(nt==null?void 0:nt(yt,pt))??{...pt,url:et};return await fetch(gt.url??et,gt)},{errorInstance:new TimeoutError$4({body:rt,url:et}),timeout:it,signal:!0});ot&&await ot(ht);let mt;if((dt=ht.headers.get("Content-Type"))!=null&&dt.startsWith("application/json"))mt=await ht.json();else{mt=await ht.text();try{mt=JSON.parse(mt||"{}")}catch(ft){if(ht.ok)throw ft;mt={error:mt}}}if(!ht.ok)throw new HttpRequestError({body:rt,details:stringify$2(mt.error)||ht.statusText,headers:ht.headers,status:ht.status,url:et});return mt}catch(ht){throw ht instanceof HttpRequestError||ht instanceof TimeoutError$4?ht:new HttpRequestError({body:rt,cause:ht,url:et})}}}}function assertTransactionEIP7702(et){const{authorizationList:o}=et;if(o)for(const tt of o){const{contractAddress:rt,chainId:nt}=tt;if(!isAddress(rt))throw new InvalidAddressError({address:rt});if(nt<=0)throw new InvalidChainIdError({chainId:nt})}assertTransactionEIP1559(et)}function assertTransactionEIP4844(et){const{blobVersionedHashes:o}=et;if(o){if(o.length===0)throw new EmptyBlobError;for(const tt of o){const rt=size$2(tt),nt=hexToNumber$2(slice(tt,0,1));if(rt!==32)throw new InvalidVersionedHashSizeError({hash:tt,size:rt});if(nt!==versionedHashVersionKzg)throw new InvalidVersionedHashVersionError({hash:tt,version:nt})}}assertTransactionEIP1559(et)}function assertTransactionEIP1559(et){const{chainId:o,maxPriorityFeePerGas:tt,maxFeePerGas:rt,to:nt}=et;if(o<=0)throw new InvalidChainIdError({chainId:o});if(nt&&!isAddress(nt))throw new InvalidAddressError({address:nt});if(rt&&rt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:rt});if(tt&&rt&&tt>rt)throw new TipAboveFeeCapError({maxFeePerGas:rt,maxPriorityFeePerGas:tt})}function assertTransactionEIP2930(et){const{chainId:o,maxPriorityFeePerGas:tt,gasPrice:rt,maxFeePerGas:nt,to:ot}=et;if(o<=0)throw new InvalidChainIdError({chainId:o});if(ot&&!isAddress(ot))throw new InvalidAddressError({address:ot});if(tt||nt)throw new BaseError$3("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(rt&&rt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:rt})}function assertTransactionLegacy(et){const{chainId:o,maxPriorityFeePerGas:tt,gasPrice:rt,maxFeePerGas:nt,to:ot}=et;if(ot&&!isAddress(ot))throw new InvalidAddressError({address:ot});if(typeof o<"u"&&o<=0)throw new InvalidChainIdError({chainId:o});if(tt||nt)throw new BaseError$3("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(rt&&rt>maxUint256)throw new FeeCapTooHighError({maxFeePerGas:rt})}function serializeAuthorizationList(et){if(!et||et.length===0)return[];const o=[];for(const tt of et){const{contractAddress:rt,chainId:nt,nonce:ot,...it}=tt;o.push([toHex(nt),rt,ot?toHex(ot):"0x",...toYParitySignatureArray({},it)])}return o}function serializeAccessList(et){if(!et||et.length===0)return[];const o=[];for(let tt=0;tt"u"||typeof mt>"u")){const xt=typeof et.blobs[0]=="string"?et.blobs:et.blobs.map(Ct=>bytesToHex$3(Ct)),vt=et.kzg,Et=blobsToCommitments({blobs:xt,kzg:vt});if(typeof ht>"u"&&(ht=commitmentsToVersionedHashes({commitments:Et})),typeof mt>"u"){const Ct=blobsToProofs({blobs:xt,commitments:Et,kzg:vt});mt=toBlobSidecars({blobs:xt,commitments:Et,proofs:Ct})}}const ft=serializeAccessList(lt),pt=[toHex(tt),nt?toHex(nt):"0x",ct?toHex(ct):"0x",at?toHex(at):"0x",rt?toHex(rt):"0x",ot??"0x",it?toHex(it):"0x",dt??"0x",ft,st?toHex(st):"0x",ht??[],...toYParitySignatureArray(et,o)],yt=[],gt=[],bt=[];if(mt)for(let xt=0;xt{if(o.v>=35n)return(o.v-35n)/2n>0?o.v:27n+(o.v===35n?0n:1n);if(tt>0)return BigInt(tt*2)+BigInt(35n+o.v-27n);const mt=27n+(o.v===27n?0n:1n);if(o.v!==mt)throw new InvalidLegacyVError({v:o.v});return mt})(),dt=trim$1(o.r),ht=trim$1(o.s);ct=[...ct,toHex(lt),dt==="0x00"?"0x":dt,ht==="0x00"?"0x":ht]}else tt>0&&(ct=[...ct,toHex(tt),"0x","0x"]);return toRlp(ct)}function toYParitySignatureArray(et,o){const tt=o??et,{v:rt,yParity:nt}=tt;if(typeof tt.r>"u")return[];if(typeof tt.s>"u")return[];if(typeof rt>"u"&&typeof nt>"u")return[];const ot=trim$1(tt.r),it=trim$1(tt.s);return[typeof nt=="number"?nt?toHex(1):"0x":rt===0n?"0x":rt===1n?toHex(1):rt===27n?"0x":toHex(1),ot==="0x00"?"0x":ot,it==="0x00"?"0x":it]}async function signMessage$1(et,{account:o=et.account,message:tt}){if(!o)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const rt=parseAccount(o);if(rt.signMessage)return rt.signMessage({message:tt});const nt=typeof tt=="string"?stringToHex(tt):tt.raw instanceof Uint8Array?toHex(tt.raw):tt.raw;return et.request({method:"personal_sign",params:[nt,rt.address]},{retryCount:0})}class HMAC extends Hash{constructor(o,tt){super(),this.finished=!1,this.destroyed=!1,hash$1(o);const rt=toBytes$2(tt);if(this.iHash=o.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const nt=this.blockLen,ot=new Uint8Array(nt);ot.set(rt.length>nt?o.create().update(rt).digest():rt);for(let it=0;itnew HMAC(et,o).update(tt).digest();hmac.create=(et,o)=>new HMAC(et,o);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$6=BigInt(0),_1n$8=BigInt(1),_2n$5=BigInt(2);function isBytes$2(et){return et instanceof Uint8Array||et!=null&&typeof et=="object"&&et.constructor.name==="Uint8Array"}function abytes(et){if(!isBytes$2(et))throw new Error("Uint8Array expected")}function abool(et,o){if(typeof o!="boolean")throw new Error(`${et} must be valid boolean, got "${o}".`)}const hexes$1=Array.from({length:256},(et,o)=>o.toString(16).padStart(2,"0"));function bytesToHex$2(et){abytes(et);let o="";for(let tt=0;tt=asciis._0&&et<=asciis._9)return et-asciis._0;if(et>=asciis._A&&et<=asciis._F)return et-(asciis._A-10);if(et>=asciis._a&&et<=asciis._f)return et-(asciis._a-10)}function hexToBytes$2(et){if(typeof et!="string")throw new Error("hex string expected, got "+typeof et);const o=et.length,tt=o/2;if(o%2)throw new Error("padded hex string expected, got unpadded hex of length "+o);const rt=new Uint8Array(tt);for(let nt=0,ot=0;nttypeof et=="bigint"&&_0n$6<=et;function inRange(et,o,tt){return isPosBig(et)&&isPosBig(o)&&isPosBig(tt)&&o<=et&&et_0n$6;et>>=_1n$8,o+=1);return o}function bitGet(et,o){return et>>BigInt(o)&_1n$8}function bitSet(et,o,tt){return et|(tt?_1n$8:_0n$6)<(_2n$5<new Uint8Array(et),u8fr=et=>Uint8Array.from(et);function createHmacDrbg(et,o,tt){if(typeof et!="number"||et<2)throw new Error("hashLen must be a number");if(typeof o!="number"||o<2)throw new Error("qByteLen must be a number");if(typeof tt!="function")throw new Error("hmacFn must be a function");let rt=u8n(et),nt=u8n(et),ot=0;const it=()=>{rt.fill(1),nt.fill(0),ot=0},st=(...dt)=>tt(nt,rt,...dt),at=(dt=u8n())=>{nt=st(u8fr([0]),dt),rt=st(),dt.length!==0&&(nt=st(u8fr([1]),dt),rt=st())},ct=()=>{if(ot++>=1e3)throw new Error("drbg: tried 1000 values");let dt=0;const ht=[];for(;dt{it(),at(dt);let mt;for(;!(mt=ht(ct()));)at();return it(),mt}}const validatorFns={bigint:et=>typeof et=="bigint",function:et=>typeof et=="function",boolean:et=>typeof et=="boolean",string:et=>typeof et=="string",stringOrUint8Array:et=>typeof et=="string"||isBytes$2(et),isSafeInteger:et=>Number.isSafeInteger(et),array:et=>Array.isArray(et),field:(et,o)=>o.Fp.isValid(et),hash:et=>typeof et=="function"&&Number.isSafeInteger(et.outputLen)};function validateObject(et,o,tt={}){const rt=(nt,ot,it)=>{const st=validatorFns[ot];if(typeof st!="function")throw new Error(`Invalid validator "${ot}", expected function`);const at=et[nt];if(!(it&&at===void 0)&&!st(at,et))throw new Error(`Invalid param ${String(nt)}=${at} (${typeof at}), expected ${ot}`)};for(const[nt,ot]of Object.entries(o))rt(nt,ot,!1);for(const[nt,ot]of Object.entries(tt))rt(nt,ot,!0);return et}const notImplemented=()=>{throw new Error("not implemented")};function memoized(et){const o=new WeakMap;return(tt,...rt)=>{const nt=o.get(tt);if(nt!==void 0)return nt;const ot=et(tt,...rt);return o.set(tt,ot),ot}}const ut=Object.freeze(Object.defineProperty({__proto__:null,aInRange,abool,abytes,bitGet,bitLen,bitMask,bitSet,bytesToHex:bytesToHex$2,bytesToNumberBE,bytesToNumberLE,concatBytes:concatBytes$1,createHmacDrbg,ensureBytes:ensureBytes$1,equalBytes:equalBytes$1,hexToBytes:hexToBytes$2,hexToNumber:hexToNumber$1,inRange,isBytes:isBytes$2,memoized,notImplemented,numberToBytesBE,numberToBytesLE,numberToHexUnpadded:numberToHexUnpadded$1,numberToVarBytesBE,utf8ToBytes:utf8ToBytes$2,validateObject},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$5=BigInt(0),_1n$7=BigInt(1),_2n$4=BigInt(2),_3n$3=BigInt(3),_4n=BigInt(4),_5n$1=BigInt(5),_8n$3=BigInt(8);BigInt(9);BigInt(16);function mod$1(et,o){const tt=et%o;return tt>=_0n$5?tt:o+tt}function pow(et,o,tt){if(tt<=_0n$5||o<_0n$5)throw new Error("Expected power/modulo > 0");if(tt===_1n$7)return _0n$5;let rt=_1n$7;for(;o>_0n$5;)o&_1n$7&&(rt=rt*et%tt),et=et*et%tt,o>>=_1n$7;return rt}function pow2$1(et,o,tt){let rt=et;for(;o-- >_0n$5;)rt*=rt,rt%=tt;return rt}function invert$1(et,o){if(et===_0n$5||o<=_0n$5)throw new Error(`invert: expected positive integers, got n=${et} mod=${o}`);let tt=mod$1(et,o),rt=o,nt=_0n$5,ot=_1n$7;for(;tt!==_0n$5;){const st=rt/tt,at=rt%tt,ct=nt-ot*st;rt=tt,tt=at,nt=ot,ot=ct}if(rt!==_1n$7)throw new Error("invert: does not exist");return mod$1(nt,o)}function tonelliShanks(et){const o=(et-_1n$7)/_2n$4;let tt,rt,nt;for(tt=et-_1n$7,rt=0;tt%_2n$4===_0n$5;tt/=_2n$4,rt++);for(nt=_2n$4;nt(mod$1(et,o)&_1n$7)===_1n$7,FIELD_FIELDS=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function validateField(et){const o={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},tt=FIELD_FIELDS.reduce((rt,nt)=>(rt[nt]="function",rt),o);return validateObject(et,tt)}function FpPow(et,o,tt){if(tt<_0n$5)throw new Error("Expected power > 0");if(tt===_0n$5)return et.ONE;if(tt===_1n$7)return o;let rt=et.ONE,nt=o;for(;tt>_0n$5;)tt&_1n$7&&(rt=et.mul(rt,nt)),nt=et.sqr(nt),tt>>=_1n$7;return rt}function FpInvertBatch(et,o){const tt=new Array(o.length),rt=o.reduce((ot,it,st)=>et.is0(it)?ot:(tt[st]=ot,et.mul(ot,it)),et.ONE),nt=et.inv(rt);return o.reduceRight((ot,it,st)=>et.is0(it)?ot:(tt[st]=et.mul(ot,tt[st]),et.mul(ot,it)),nt),tt}function nLength(et,o){const tt=o!==void 0?o:et.toString(2).length,rt=Math.ceil(tt/8);return{nBitLength:tt,nByteLength:rt}}function Field$1(et,o,tt=!1,rt={}){if(et<=_0n$5)throw new Error(`Expected Field ORDER > 0, got ${et}`);const{nBitLength:nt,nByteLength:ot}=nLength(et,o);if(ot>2048)throw new Error("Field lengths over 2048 bytes are not supported");const it=FpSqrt(et),st=Object.freeze({ORDER:et,BITS:nt,BYTES:ot,MASK:bitMask(nt),ZERO:_0n$5,ONE:_1n$7,create:at=>mod$1(at,et),isValid:at=>{if(typeof at!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof at}`);return _0n$5<=at&&atat===_0n$5,isOdd:at=>(at&_1n$7)===_1n$7,neg:at=>mod$1(-at,et),eql:(at,ct)=>at===ct,sqr:at=>mod$1(at*at,et),add:(at,ct)=>mod$1(at+ct,et),sub:(at,ct)=>mod$1(at-ct,et),mul:(at,ct)=>mod$1(at*ct,et),pow:(at,ct)=>FpPow(st,at,ct),div:(at,ct)=>mod$1(at*invert$1(ct,et),et),sqrN:at=>at*at,addN:(at,ct)=>at+ct,subN:(at,ct)=>at-ct,mulN:(at,ct)=>at*ct,inv:at=>invert$1(at,et),sqrt:rt.sqrt||(at=>it(st,at)),invertBatch:at=>FpInvertBatch(st,at),cmov:(at,ct,lt)=>lt?ct:at,toBytes:at=>tt?numberToBytesLE(at,ot):numberToBytesBE(at,ot),fromBytes:at=>{if(at.length!==ot)throw new Error(`Fp.fromBytes: expected ${ot}, got ${at.length}`);return tt?bytesToNumberLE(at):bytesToNumberBE(at)}});return Object.freeze(st)}function getFieldBytesLength(et){if(typeof et!="bigint")throw new Error("field order must be bigint");const o=et.toString(2).length;return Math.ceil(o/8)}function getMinHashLength(et){const o=getFieldBytesLength(et);return o+Math.ceil(o/2)}function mapHashToField(et,o,tt=!1){const rt=et.length,nt=getFieldBytesLength(o),ot=getMinHashLength(o);if(rt<16||rt1024)throw new Error(`expected ${ot}-1024 bytes of input, got ${rt}`);const it=tt?bytesToNumberBE(et):bytesToNumberLE(et),st=mod$1(it,o-_1n$7)+_1n$7;return tt?numberToBytesLE(st,nt):numberToBytesBE(st,nt)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$4=BigInt(0),_1n$6=BigInt(1),pointPrecomputes$1=new WeakMap,pointWindowSizes=new WeakMap;function wNAF(et,o){const tt=(ot,it)=>{const st=it.negate();return ot?st:it},rt=ot=>{if(!Number.isSafeInteger(ot)||ot<=0||ot>o)throw new Error(`Wrong window size=${ot}, should be [1..${o}]`)},nt=ot=>{rt(ot);const it=Math.ceil(o/ot)+1,st=2**(ot-1);return{windows:it,windowSize:st}};return{constTimeNegate:tt,unsafeLadder(ot,it){let st=et.ZERO,at=ot;for(;it>_0n$4;)it&_1n$6&&(st=st.add(at)),at=at.double(),it>>=_1n$6;return st},precomputeWindow(ot,it){const{windows:st,windowSize:at}=nt(it),ct=[];let lt=ot,dt=lt;for(let ht=0;ht>=ft,gt>ct&&(gt-=mt,st+=_1n$6);const bt=yt,xt=yt+Math.abs(gt)-1,vt=pt%2!==0,Et=gt<0;gt===0?dt=dt.add(tt(vt,it[bt])):lt=lt.add(tt(Et,it[xt]))}return{p:lt,f:dt}},wNAFCached(ot,it,st){const at=pointWindowSizes.get(ot)||1;let ct=pointPrecomputes$1.get(ot);return ct||(ct=this.precomputeWindow(ot,at),at!==1&&pointPrecomputes$1.set(ot,st(ct))),this.wNAF(at,ct,it)},setWindowSize(ot,it){rt(it),pointWindowSizes.set(ot,it),pointPrecomputes$1.delete(ot)}}}function pippenger(et,o,tt,rt){if(!Array.isArray(tt)||!Array.isArray(rt)||rt.length!==tt.length)throw new Error("arrays of points and scalars must have equal length");rt.forEach((lt,dt)=>{if(!o.isValid(lt))throw new Error(`wrong scalar at index ${dt}`)}),tt.forEach((lt,dt)=>{if(!(lt instanceof et))throw new Error(`wrong point at index ${dt}`)});const nt=bitLen(BigInt(tt.length)),ot=nt>12?nt-3:nt>4?nt-2:nt?2:1,it=(1<=0;lt-=ot){st.fill(et.ZERO);for(let ht=0;ht>BigInt(lt)&BigInt(it));st[ft]=st[ft].add(tt[ht])}let dt=et.ZERO;for(let ht=st.length-1,mt=et.ZERO;ht>0;ht--)mt=mt.add(st[ht]),dt=dt.add(mt);if(ct=ct.add(dt),lt!==0)for(let ht=0;ht{const{Err:tt}=DER;if(et<0||et>256)throw new tt("tlv.encode: wrong tag");if(o.length&1)throw new tt("tlv.encode: unpadded data");const rt=o.length/2,nt=numberToHexUnpadded$1(rt);if(nt.length/2&128)throw new tt("tlv.encode: long form length too big");const ot=rt>127?numberToHexUnpadded$1(nt.length/2|128):"";return`${numberToHexUnpadded$1(et)}${ot}${nt}${o}`},decode(et,o){const{Err:tt}=DER;let rt=0;if(et<0||et>256)throw new tt("tlv.encode: wrong tag");if(o.length<2||o[rt++]!==et)throw new tt("tlv.decode: wrong tlv");const nt=o[rt++],ot=!!(nt&128);let it=0;if(!ot)it=nt;else{const at=nt&127;if(!at)throw new tt("tlv.decode(long): indefinite length not supported");if(at>4)throw new tt("tlv.decode(long): byte length is too big");const ct=o.subarray(rt,rt+at);if(ct.length!==at)throw new tt("tlv.decode: length bytes not complete");if(ct[0]===0)throw new tt("tlv.decode(long): zero leftmost byte");for(const lt of ct)it=it<<8|lt;if(rt+=at,it<128)throw new tt("tlv.decode(long): not minimal encoding")}const st=o.subarray(rt,rt+it);if(st.length!==it)throw new tt("tlv.decode: wrong value length");return{v:st,l:o.subarray(rt+it)}}},_int:{encode(et){const{Err:o}=DER;if(et<_0n$3)throw new o("integer: negative integers are not allowed");let tt=numberToHexUnpadded$1(et);if(Number.parseInt(tt[0],16)&8&&(tt="00"+tt),tt.length&1)throw new o("unexpected assertion");return tt},decode(et){const{Err:o}=DER;if(et[0]&128)throw new o("Invalid signature integer: negative");if(et[0]===0&&!(et[1]&128))throw new o("Invalid signature integer: unnecessary leading zero");return b2n(et)}},toSig(et){const{Err:o,_int:tt,_tlv:rt}=DER,nt=typeof et=="string"?h2b(et):et;abytes(nt);const{v:ot,l:it}=rt.decode(48,nt);if(it.length)throw new o("Invalid signature: left bytes after parsing");const{v:st,l:at}=rt.decode(2,ot),{v:ct,l:lt}=rt.decode(2,at);if(lt.length)throw new o("Invalid signature: left bytes after parsing");return{r:tt.decode(st),s:tt.decode(ct)}},hexFromSig(et){const{_tlv:o,_int:tt}=DER,rt=`${o.encode(2,tt.encode(et.r))}${o.encode(2,tt.encode(et.s))}`;return o.encode(48,rt)}},_0n$3=BigInt(0),_1n$5=BigInt(1);BigInt(2);const _3n$2=BigInt(3);BigInt(4);function weierstrassPoints(et){const o=validatePointOpts(et),{Fp:tt}=o,rt=Field$1(o.n,o.nBitLength),nt=o.toBytes||((pt,yt,gt)=>{const bt=yt.toAffine();return concatBytes$1(Uint8Array.from([4]),tt.toBytes(bt.x),tt.toBytes(bt.y))}),ot=o.fromBytes||(pt=>{const yt=pt.subarray(1),gt=tt.fromBytes(yt.subarray(0,tt.BYTES)),bt=tt.fromBytes(yt.subarray(tt.BYTES,2*tt.BYTES));return{x:gt,y:bt}});function it(pt){const{a:yt,b:gt}=o,bt=tt.sqr(pt),xt=tt.mul(bt,pt);return tt.add(tt.add(xt,tt.mul(pt,yt)),gt)}if(!tt.eql(tt.sqr(o.Gy),it(o.Gx)))throw new Error("bad generator point: equation left != right");function st(pt){return inRange(pt,_1n$5,o.n)}function at(pt){const{allowedPrivateKeyLengths:yt,nByteLength:gt,wrapPrivateKey:bt,n:xt}=o;if(yt&&typeof pt!="bigint"){if(isBytes$2(pt)&&(pt=bytesToHex$2(pt)),typeof pt!="string"||!yt.includes(pt.length))throw new Error("Invalid key");pt=pt.padStart(gt*2,"0")}let vt;try{vt=typeof pt=="bigint"?pt:bytesToNumberBE(ensureBytes$1("private key",pt,gt))}catch{throw new Error(`private key must be ${gt} bytes, hex or bigint, not ${typeof pt}`)}return bt&&(vt=mod$1(vt,xt)),aInRange("private key",vt,_1n$5,xt),vt}function ct(pt){if(!(pt instanceof ht))throw new Error("ProjectivePoint expected")}const lt=memoized((pt,yt)=>{const{px:gt,py:bt,pz:xt}=pt;if(tt.eql(xt,tt.ONE))return{x:gt,y:bt};const vt=pt.is0();yt==null&&(yt=vt?tt.ONE:tt.inv(xt));const Et=tt.mul(gt,yt),Ct=tt.mul(bt,yt),St=tt.mul(xt,yt);if(vt)return{x:tt.ZERO,y:tt.ZERO};if(!tt.eql(St,tt.ONE))throw new Error("invZ was invalid");return{x:Et,y:Ct}}),dt=memoized(pt=>{if(pt.is0()){if(o.allowInfinityPoint&&!tt.is0(pt.py))return;throw new Error("bad point: ZERO")}const{x:yt,y:gt}=pt.toAffine();if(!tt.isValid(yt)||!tt.isValid(gt))throw new Error("bad point: x or y not FE");const bt=tt.sqr(gt),xt=it(yt);if(!tt.eql(bt,xt))throw new Error("bad point: equation left != right");if(!pt.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class ht{constructor(yt,gt,bt){if(this.px=yt,this.py=gt,this.pz=bt,yt==null||!tt.isValid(yt))throw new Error("x required");if(gt==null||!tt.isValid(gt))throw new Error("y required");if(bt==null||!tt.isValid(bt))throw new Error("z required");Object.freeze(this)}static fromAffine(yt){const{x:gt,y:bt}=yt||{};if(!yt||!tt.isValid(gt)||!tt.isValid(bt))throw new Error("invalid affine point");if(yt instanceof ht)throw new Error("projective point not allowed");const xt=vt=>tt.eql(vt,tt.ZERO);return xt(gt)&&xt(bt)?ht.ZERO:new ht(gt,bt,tt.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(yt){const gt=tt.invertBatch(yt.map(bt=>bt.pz));return yt.map((bt,xt)=>bt.toAffine(gt[xt])).map(ht.fromAffine)}static fromHex(yt){const gt=ht.fromAffine(ot(ensureBytes$1("pointHex",yt)));return gt.assertValidity(),gt}static fromPrivateKey(yt){return ht.BASE.multiply(at(yt))}static msm(yt,gt){return pippenger(ht,rt,yt,gt)}_setWindowSize(yt){ft.setWindowSize(this,yt)}assertValidity(){dt(this)}hasEvenY(){const{y:yt}=this.toAffine();if(tt.isOdd)return!tt.isOdd(yt);throw new Error("Field doesn't support isOdd")}equals(yt){ct(yt);const{px:gt,py:bt,pz:xt}=this,{px:vt,py:Et,pz:Ct}=yt,St=tt.eql(tt.mul(gt,Ct),tt.mul(vt,xt)),At=tt.eql(tt.mul(bt,Ct),tt.mul(Et,xt));return St&&At}negate(){return new ht(this.px,tt.neg(this.py),this.pz)}double(){const{a:yt,b:gt}=o,bt=tt.mul(gt,_3n$2),{px:xt,py:vt,pz:Et}=this;let Ct=tt.ZERO,St=tt.ZERO,At=tt.ZERO,kt=tt.mul(xt,xt),It=tt.mul(vt,vt),Nt=tt.mul(Et,Et),Lt=tt.mul(xt,vt);return Lt=tt.add(Lt,Lt),At=tt.mul(xt,Et),At=tt.add(At,At),Ct=tt.mul(yt,At),St=tt.mul(bt,Nt),St=tt.add(Ct,St),Ct=tt.sub(It,St),St=tt.add(It,St),St=tt.mul(Ct,St),Ct=tt.mul(Lt,Ct),At=tt.mul(bt,At),Nt=tt.mul(yt,Nt),Lt=tt.sub(kt,Nt),Lt=tt.mul(yt,Lt),Lt=tt.add(Lt,At),At=tt.add(kt,kt),kt=tt.add(At,kt),kt=tt.add(kt,Nt),kt=tt.mul(kt,Lt),St=tt.add(St,kt),Nt=tt.mul(vt,Et),Nt=tt.add(Nt,Nt),kt=tt.mul(Nt,Lt),Ct=tt.sub(Ct,kt),At=tt.mul(Nt,It),At=tt.add(At,At),At=tt.add(At,At),new ht(Ct,St,At)}add(yt){ct(yt);const{px:gt,py:bt,pz:xt}=this,{px:vt,py:Et,pz:Ct}=yt;let St=tt.ZERO,At=tt.ZERO,kt=tt.ZERO;const It=o.a,Nt=tt.mul(o.b,_3n$2);let Lt=tt.mul(gt,vt),Mt=tt.mul(bt,Et),zt=tt.mul(xt,Ct),Ut=tt.add(gt,bt),Xt=tt.add(vt,Et);Ut=tt.mul(Ut,Xt),Xt=tt.add(Lt,Mt),Ut=tt.sub(Ut,Xt),Xt=tt.add(gt,xt);let Wt=tt.add(vt,Ct);return Xt=tt.mul(Xt,Wt),Wt=tt.add(Lt,zt),Xt=tt.sub(Xt,Wt),Wt=tt.add(bt,xt),St=tt.add(Et,Ct),Wt=tt.mul(Wt,St),St=tt.add(Mt,zt),Wt=tt.sub(Wt,St),kt=tt.mul(It,Xt),St=tt.mul(Nt,zt),kt=tt.add(St,kt),St=tt.sub(Mt,kt),kt=tt.add(Mt,kt),At=tt.mul(St,kt),Mt=tt.add(Lt,Lt),Mt=tt.add(Mt,Lt),zt=tt.mul(It,zt),Xt=tt.mul(Nt,Xt),Mt=tt.add(Mt,zt),zt=tt.sub(Lt,zt),zt=tt.mul(It,zt),Xt=tt.add(Xt,zt),Lt=tt.mul(Mt,Xt),At=tt.add(At,Lt),Lt=tt.mul(Wt,Xt),St=tt.mul(Ut,St),St=tt.sub(St,Lt),Lt=tt.mul(Ut,Mt),kt=tt.mul(Wt,kt),kt=tt.add(kt,Lt),new ht(St,At,kt)}subtract(yt){return this.add(yt.negate())}is0(){return this.equals(ht.ZERO)}wNAF(yt){return ft.wNAFCached(this,yt,ht.normalizeZ)}multiplyUnsafe(yt){aInRange("scalar",yt,_0n$3,o.n);const gt=ht.ZERO;if(yt===_0n$3)return gt;if(yt===_1n$5)return this;const{endo:bt}=o;if(!bt)return ft.unsafeLadder(this,yt);let{k1neg:xt,k1:vt,k2neg:Et,k2:Ct}=bt.splitScalar(yt),St=gt,At=gt,kt=this;for(;vt>_0n$3||Ct>_0n$3;)vt&_1n$5&&(St=St.add(kt)),Ct&_1n$5&&(At=At.add(kt)),kt=kt.double(),vt>>=_1n$5,Ct>>=_1n$5;return xt&&(St=St.negate()),Et&&(At=At.negate()),At=new ht(tt.mul(At.px,bt.beta),At.py,At.pz),St.add(At)}multiply(yt){const{endo:gt,n:bt}=o;aInRange("scalar",yt,_1n$5,bt);let xt,vt;if(gt){const{k1neg:Et,k1:Ct,k2neg:St,k2:At}=gt.splitScalar(yt);let{p:kt,f:It}=this.wNAF(Ct),{p:Nt,f:Lt}=this.wNAF(At);kt=ft.constTimeNegate(Et,kt),Nt=ft.constTimeNegate(St,Nt),Nt=new ht(tt.mul(Nt.px,gt.beta),Nt.py,Nt.pz),xt=kt.add(Nt),vt=It.add(Lt)}else{const{p:Et,f:Ct}=this.wNAF(yt);xt=Et,vt=Ct}return ht.normalizeZ([xt,vt])[0]}multiplyAndAddUnsafe(yt,gt,bt){const xt=ht.BASE,vt=(Ct,St)=>St===_0n$3||St===_1n$5||!Ct.equals(xt)?Ct.multiplyUnsafe(St):Ct.multiply(St),Et=vt(this,gt).add(vt(yt,bt));return Et.is0()?void 0:Et}toAffine(yt){return lt(this,yt)}isTorsionFree(){const{h:yt,isTorsionFree:gt}=o;if(yt===_1n$5)return!0;if(gt)return gt(ht,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:yt,clearCofactor:gt}=o;return yt===_1n$5?this:gt?gt(ht,this):this.multiplyUnsafe(o.h)}toRawBytes(yt=!0){return abool("isCompressed",yt),this.assertValidity(),nt(ht,this,yt)}toHex(yt=!0){return abool("isCompressed",yt),bytesToHex$2(this.toRawBytes(yt))}}ht.BASE=new ht(o.Gx,o.Gy,tt.ONE),ht.ZERO=new ht(tt.ZERO,tt.ONE,tt.ZERO);const mt=o.nBitLength,ft=wNAF(ht,o.endo?Math.ceil(mt/2):mt);return{CURVE:o,ProjectivePoint:ht,normPrivateKeyToScalar:at,weierstrassEquation:it,isWithinCurveOrder:st}}function validateOpts$2(et){const o=validateBasic(et);return validateObject(o,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...o})}function weierstrass$1(et){const o=validateOpts$2(et),{Fp:tt,n:rt}=o,nt=tt.BYTES+1,ot=2*tt.BYTES+1;function it(zt){return mod$1(zt,rt)}function st(zt){return invert$1(zt,rt)}const{ProjectivePoint:at,normPrivateKeyToScalar:ct,weierstrassEquation:lt,isWithinCurveOrder:dt}=weierstrassPoints({...o,toBytes(zt,Ut,Xt){const Wt=Ut.toAffine(),Ft=tt.toBytes(Wt.x),qt=concatBytes$1;return abool("isCompressed",Xt),Xt?qt(Uint8Array.from([Ut.hasEvenY()?2:3]),Ft):qt(Uint8Array.from([4]),Ft,tt.toBytes(Wt.y))},fromBytes(zt){const Ut=zt.length,Xt=zt[0],Wt=zt.subarray(1);if(Ut===nt&&(Xt===2||Xt===3)){const Ft=bytesToNumberBE(Wt);if(!inRange(Ft,_1n$5,tt.ORDER))throw new Error("Point is not on curve");const qt=lt(Ft);let Pt;try{Pt=tt.sqrt(qt)}catch(jt){const Gt=jt instanceof Error?": "+jt.message:"";throw new Error("Point is not on curve"+Gt)}const Yt=(Pt&_1n$5)===_1n$5;return(Xt&1)===1!==Yt&&(Pt=tt.neg(Pt)),{x:Ft,y:Pt}}else if(Ut===ot&&Xt===4){const Ft=tt.fromBytes(Wt.subarray(0,tt.BYTES)),qt=tt.fromBytes(Wt.subarray(tt.BYTES,2*tt.BYTES));return{x:Ft,y:qt}}else throw new Error(`Point of length ${Ut} was invalid. Expected ${nt} compressed bytes or ${ot} uncompressed bytes`)}}),ht=zt=>bytesToHex$2(numberToBytesBE(zt,o.nByteLength));function mt(zt){const Ut=rt>>_1n$5;return zt>Ut}function ft(zt){return mt(zt)?it(-zt):zt}const pt=(zt,Ut,Xt)=>bytesToNumberBE(zt.slice(Ut,Xt));class yt{constructor(Ut,Xt,Wt){this.r=Ut,this.s=Xt,this.recovery=Wt,this.assertValidity()}static fromCompact(Ut){const Xt=o.nByteLength;return Ut=ensureBytes$1("compactSignature",Ut,Xt*2),new yt(pt(Ut,0,Xt),pt(Ut,Xt,2*Xt))}static fromDER(Ut){const{r:Xt,s:Wt}=DER.toSig(ensureBytes$1("DER",Ut));return new yt(Xt,Wt)}assertValidity(){aInRange("r",this.r,_1n$5,rt),aInRange("s",this.s,_1n$5,rt)}addRecoveryBit(Ut){return new yt(this.r,this.s,Ut)}recoverPublicKey(Ut){const{r:Xt,s:Wt,recovery:Ft}=this,qt=Ct(ensureBytes$1("msgHash",Ut));if(Ft==null||![0,1,2,3].includes(Ft))throw new Error("recovery id invalid");const Pt=Ft===2||Ft===3?Xt+o.n:Xt;if(Pt>=tt.ORDER)throw new Error("recovery id 2 or 3 invalid");const Yt=Ft&1?"03":"02",Qt=at.fromHex(Yt+ht(Pt)),jt=st(Pt),Gt=it(-qt*jt),rr=it(Wt*jt),Ht=at.BASE.multiplyAndAddUnsafe(Qt,Gt,rr);if(!Ht)throw new Error("point at infinify");return Ht.assertValidity(),Ht}hasHighS(){return mt(this.s)}normalizeS(){return this.hasHighS()?new yt(this.r,it(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes$2(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes$2(this.toCompactHex())}toCompactHex(){return ht(this.r)+ht(this.s)}}const gt={isValidPrivateKey(zt){try{return ct(zt),!0}catch{return!1}},normPrivateKeyToScalar:ct,randomPrivateKey:()=>{const zt=getMinHashLength(o.n);return mapHashToField(o.randomBytes(zt),o.n)},precompute(zt=8,Ut=at.BASE){return Ut._setWindowSize(zt),Ut.multiply(BigInt(3)),Ut}};function bt(zt,Ut=!0){return at.fromPrivateKey(zt).toRawBytes(Ut)}function xt(zt){const Ut=isBytes$2(zt),Xt=typeof zt=="string",Wt=(Ut||Xt)&&zt.length;return Ut?Wt===nt||Wt===ot:Xt?Wt===2*nt||Wt===2*ot:zt instanceof at}function vt(zt,Ut,Xt=!0){if(xt(zt))throw new Error("first arg must be private key");if(!xt(Ut))throw new Error("second arg must be public key");return at.fromHex(Ut).multiply(ct(zt)).toRawBytes(Xt)}const Et=o.bits2int||function(zt){const Ut=bytesToNumberBE(zt),Xt=zt.length*8-o.nBitLength;return Xt>0?Ut>>BigInt(Xt):Ut},Ct=o.bits2int_modN||function(zt){return it(Et(zt))},St=bitMask(o.nBitLength);function At(zt){return aInRange(`num < 2^${o.nBitLength}`,zt,_0n$3,St),numberToBytesBE(zt,o.nByteLength)}function kt(zt,Ut,Xt=It){if(["recovered","canonical"].some(Zt=>Zt in Xt))throw new Error("sign() legacy options not supported");const{hash:Wt,randomBytes:Ft}=o;let{lowS:qt,prehash:Pt,extraEntropy:Yt}=Xt;qt==null&&(qt=!0),zt=ensureBytes$1("msgHash",zt),validateSigVerOpts(Xt),Pt&&(zt=ensureBytes$1("prehashed msgHash",Wt(zt)));const Qt=Ct(zt),jt=ct(Ut),Gt=[At(jt),At(Qt)];if(Yt!=null&&Yt!==!1){const Zt=Yt===!0?Ft(tt.BYTES):Yt;Gt.push(ensureBytes$1("extraEntropy",Zt))}const rr=concatBytes$1(...Gt),Ht=Qt;function dr(Zt){const Jt=Et(Zt);if(!dt(Jt))return;const tr=st(Jt),_t=at.BASE.multiply(Jt).toAffine(),Bt=it(_t.x);if(Bt===_0n$3)return;const Vt=it(tr*it(Ht+Bt*jt));if(Vt===_0n$3)return;let er=(_t.x===Bt?0:2)|Number(_t.y&_1n$5),ar=Vt;return qt&&mt(Vt)&&(ar=ft(Vt),er^=1),new yt(Bt,ar,er)}return{seed:rr,k2sig:dr}}const It={lowS:o.lowS,prehash:!1},Nt={lowS:o.lowS,prehash:!1};function Lt(zt,Ut,Xt=It){const{seed:Wt,k2sig:Ft}=kt(zt,Ut,Xt),qt=o;return createHmacDrbg(qt.hash.outputLen,qt.nByteLength,qt.hmac)(Wt,Ft)}at.BASE._setWindowSize(8);function Mt(zt,Ut,Xt,Wt=Nt){var _t;const Ft=zt;if(Ut=ensureBytes$1("msgHash",Ut),Xt=ensureBytes$1("publicKey",Xt),"strict"in Wt)throw new Error("options.strict was renamed to lowS");validateSigVerOpts(Wt);const{lowS:qt,prehash:Pt}=Wt;let Yt,Qt;try{if(typeof Ft=="string"||isBytes$2(Ft))try{Yt=yt.fromDER(Ft)}catch(Bt){if(!(Bt instanceof DER.Err))throw Bt;Yt=yt.fromCompact(Ft)}else if(typeof Ft=="object"&&typeof Ft.r=="bigint"&&typeof Ft.s=="bigint"){const{r:Bt,s:Vt}=Ft;Yt=new yt(Bt,Vt)}else throw new Error("PARSE");Qt=at.fromHex(Xt)}catch(Bt){if(Bt.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(qt&&Yt.hasHighS())return!1;Pt&&(Ut=o.hash(Ut));const{r:jt,s:Gt}=Yt,rr=Ct(Ut),Ht=st(Gt),dr=it(rr*Ht),Zt=it(jt*Ht),Jt=(_t=at.BASE.multiplyAndAddUnsafe(Qt,dr,Zt))==null?void 0:_t.toAffine();return Jt?it(Jt.x)===jt:!1}return{CURVE:o,getPublicKey:bt,getSharedSecret:vt,sign:Lt,verify:Mt,ProjectivePoint:at,Signature:yt,utils:gt}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(et){return{hash:et,hmac:(o,...tt)=>hmac(et,o,concatBytes$2(...tt)),randomBytes:randomBytes$1}}function createCurve(et,o){const tt=rt=>weierstrass$1({...et,...getHash(rt)});return Object.freeze({...tt(o),create:tt})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n$4=BigInt(1),_2n$3=BigInt(2),divNearest$1=(et,o)=>(et+o/_2n$3)/o;function sqrtMod$1(et){const o=secp256k1P,tt=BigInt(3),rt=BigInt(6),nt=BigInt(11),ot=BigInt(22),it=BigInt(23),st=BigInt(44),at=BigInt(88),ct=et*et*et%o,lt=ct*ct*et%o,dt=pow2$1(lt,tt,o)*lt%o,ht=pow2$1(dt,tt,o)*lt%o,mt=pow2$1(ht,_2n$3,o)*ct%o,ft=pow2$1(mt,nt,o)*mt%o,pt=pow2$1(ft,ot,o)*ft%o,yt=pow2$1(pt,st,o)*pt%o,gt=pow2$1(yt,at,o)*yt%o,bt=pow2$1(gt,st,o)*pt%o,xt=pow2$1(bt,tt,o)*lt%o,vt=pow2$1(xt,it,o)*ft%o,Et=pow2$1(vt,rt,o)*ct%o,Ct=pow2$1(Et,_2n$3,o);if(!Fp$1.eql(Fp$1.sqr(Ct),et))throw new Error("Cannot find square root");return Ct}const Fp$1=Field$1(secp256k1P,void 0,void 0,{sqrt:sqrtMod$1}),secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp:Fp$1,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:et=>{const o=secp256k1N,tt=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),rt=-_1n$4*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),nt=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ot=tt,it=BigInt("0x100000000000000000000000000000000"),st=divNearest$1(ot*et,o),at=divNearest$1(-rt*et,o);let ct=mod$1(et-st*tt-at*nt,o),lt=mod$1(-st*rt-at*ot,o);const dt=ct>it,ht=lt>it;if(dt&&(ct=o-ct),ht&&(lt=o-lt),ct>it||lt>it)throw new Error("splitScalar: Endomorphism failed, k="+et);return{k1neg:dt,k1:ct,k2neg:ht,k2:lt}}}},sha256$3);BigInt(0);secp256k1.ProjectivePoint;function getAction(et,o,tt){const rt=et[o.name];if(typeof rt=="function")return rt;const nt=et[tt];return typeof nt=="function"?nt:ot=>o(et,ot)}const version$6="2.13.8",getVersion$1=()=>`@wagmi/core@${version$6}`;var __classPrivateFieldGet$1=function(et,o,tt,rt){if(tt==="a"&&!rt)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?et!==o||!rt:!o.has(et))throw new TypeError("Cannot read private member from an object whose class did not declare it");return tt==="m"?rt:tt==="a"?rt.call(et):rt?rt.value:o.get(et)},_BaseError_instances,_BaseError_walk;let BaseError$1=class _s extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return getVersion$1()}constructor(o,tt={}){var ot;super(),_BaseError_instances.add(this),Object.defineProperty(this,"details",{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,"metaMessages",{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,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const rt=tt.cause instanceof _s?tt.cause.details:(ot=tt.cause)!=null&&ot.message?tt.cause.message:tt.details,nt=tt.cause instanceof _s&&tt.cause.docsPath||tt.docsPath;this.message=[o||"An error occurred.","",...tt.metaMessages?[...tt.metaMessages,""]:[],...nt?[`Docs: ${this.docsBaseUrl}${nt}.html${tt.docsSlug?`#${tt.docsSlug}`:""}`]:[],...rt?[`Details: ${rt}`]:[],`Version: ${this.version}`].join(` -`),tt.cause&&(this.cause=tt.cause),this.details=rt,this.docsPath=nt,this.metaMessages=tt.metaMessages,this.shortMessage=o}walk(o){return __classPrivateFieldGet$1(this,_BaseError_instances,"m",_BaseError_walk).call(this,this,o)}};_BaseError_instances=new WeakSet,_BaseError_walk=function et(o,tt){return tt!=null&&tt(o)?o:o.cause?__classPrivateFieldGet$1(this,_BaseError_instances,"m",et).call(this,o.cause,tt):o};class ChainNotConfiguredError extends BaseError$1{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}class ConnectorAlreadyConnectedError extends BaseError$1{constructor(){super("Connector already connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAlreadyConnectedError"})}}class ConnectorNotConnectedError extends BaseError$1{constructor(){super("Connector not connected."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorNotConnectedError"})}}class ConnectorAccountNotFoundError extends BaseError$1{constructor({address:o,connector:tt}){super(`Account "${o}" not found for connector "${tt.name}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorAccountNotFoundError"})}}class ConnectorChainMismatchError extends BaseError$1{constructor({connectionChainId:o,connectorChainId:tt}){super(`The current chain of the connector (id: ${tt}) does not match the connection's chain (id: ${o}).`,{metaMessages:[`Current Chain ID: ${tt}`,`Expected Chain ID: ${o}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorChainMismatchError"})}}class ConnectorUnavailableReconnectingError extends BaseError$1{constructor({connector:o}){super(`Connector "${o.name}" unavailable while reconnecting.`,{details:["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.","All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.","This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ConnectorUnavailableReconnectingError"})}}async function connect$1(et,o){var rt;let tt;if(typeof o.connector=="function"?tt=et._internal.connectors.setup(o.connector):tt=o.connector,tt.uid===et.state.current)throw new ConnectorAlreadyConnectedError;try{et.setState(it=>({...it,status:"connecting"})),tt.emitter.emit("message",{type:"connecting"});const nt=await tt.connect({chainId:o.chainId}),ot=nt.accounts;return tt.emitter.off("connect",et._internal.events.connect),tt.emitter.on("change",et._internal.events.change),tt.emitter.on("disconnect",et._internal.events.disconnect),await((rt=et.storage)==null?void 0:rt.setItem("recentConnectorId",tt.id)),et.setState(it=>({...it,connections:new Map(it.connections).set(tt.uid,{accounts:ot,chainId:nt.chainId,connector:tt}),current:tt.uid,status:"connected"})),{accounts:ot,chainId:nt.chainId}}catch(nt){throw et.setState(ot=>({...ot,status:ot.current?"connected":"disconnected"})),nt}}const size$1=256;let index$3=size$1,buffer$1;function uid$1(et=11){if(!buffer$1||index$3+et>size$1*2){buffer$1="",index$3=0;for(let o=0;o{const bt=gt(yt);for(const vt in ft)delete bt[vt];const xt={...yt,...bt};return Object.assign(xt,{extend:pt(xt)})}}return Object.assign(ft,{extend:pt(ft)})}function createTransport({key:et,name:o,request:tt,retryCount:rt=3,retryDelay:nt=150,timeout:ot,type:it},st){const at=uid$1();return{config:{key:et,name:o,request:tt,retryCount:rt,retryDelay:nt,timeout:ot,type:it},request:buildRequest(tt,{retryCount:rt,retryDelay:nt,uid:at}),value:st}}function custom(et,o={}){const{key:tt="custom",name:rt="Custom Provider",retryDelay:nt}=o;return({retryCount:ot})=>createTransport({key:tt,name:rt,request:et.request.bind(et),retryCount:o.retryCount??ot,retryDelay:nt,type:"custom"})}class UrlRequiredError extends BaseError$3{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function http(et,o={}){const{batch:tt,fetchOptions:rt,key:nt="http",name:ot="HTTP JSON-RPC",onFetchRequest:it,onFetchResponse:st,retryDelay:at}=o;return({chain:ct,retryCount:lt,timeout:dt})=>{const{batchSize:ht=1e3,wait:mt=0}=typeof tt=="object"?tt:{},ft=o.retryCount??lt,pt=dt??o.timeout??1e4,yt=ct==null?void 0:ct.rpcUrls.default.http[0];if(!yt)throw new UrlRequiredError;const gt=getHttpRpcClient(yt,{fetchOptions:rt,onRequest:it,onResponse:st,timeout:pt});return createTransport({key:nt,name:ot,async request({method:bt,params:xt}){const vt={method:bt,params:xt},{schedule:Et}=createBatchScheduler({id:yt,wait:mt,shouldSplitBatch(kt){return kt.length>ht},fn:kt=>gt.request({body:kt}),sort:(kt,It)=>kt.id-It.id}),Ct=async kt=>tt?Et(kt):[await gt.request({body:kt})],[{error:St,result:At}]=await Ct(vt);if(St)throw new RpcRequestError({body:vt,error:St,url:yt});return At},retryCount:ft,retryDelay:at,timeout:pt,type:"http"},{fetchOptions:rt,url:yt})}}async function getConnectorClient(et,o={}){let tt;if(o.connector){const{connector:ct}=o;if(et.state.status==="reconnecting"&&!ct.getAccounts&&!ct.getChainId)throw new ConnectorUnavailableReconnectingError({connector:ct});const[lt,dt]=await Promise.all([ct.getAccounts(),ct.getChainId()]);tt={accounts:lt,chainId:dt,connector:ct}}else tt=et.state.connections.get(et.state.current);if(!tt)throw new ConnectorNotConnectedError;const rt=o.chainId??tt.chainId,nt=await tt.connector.getChainId();if(nt!==tt.chainId)throw new ConnectorChainMismatchError({connectionChainId:tt.chainId,connectorChainId:nt});const ot=tt.connector;if(ot.getClient)return ot.getClient({chainId:rt});const it=parseAccount(o.account??tt.accounts[0]);if(it.address=getAddress(it.address),o.account&&!tt.accounts.some(ct=>ct.toLowerCase()===it.address.toLowerCase()))throw new ConnectorAccountNotFoundError({address:it.address,connector:ot});const st=et.chains.find(ct=>ct.id===rt),at=await tt.connector.getProvider({chainId:rt});return createClient({account:it,chain:st,name:"Connector Client",transport:ct=>custom(at)({...ct,retryCount:0})})}async function disconnect(et,o={}){var nt,ot;let tt;if(o.connector)tt=o.connector;else{const{connections:it,current:st}=et.state,at=it.get(st);tt=at==null?void 0:at.connector}const rt=et.state.connections;tt&&(await tt.disconnect(),tt.emitter.off("change",et._internal.events.change),tt.emitter.off("disconnect",et._internal.events.disconnect),tt.emitter.on("connect",et._internal.events.connect),rt.delete(tt.uid)),et.setState(it=>{if(rt.size===0)return{...it,connections:new Map,current:null,status:"disconnected"};const st=rt.values().next().value;return{...it,connections:new Map(rt),current:st.connector.uid}});{const it=et.state.current;if(!it)return;const st=(nt=et.state.connections.get(it))==null?void 0:nt.connector;if(!st)return;await((ot=et.storage)==null?void 0:ot.setItem("recentConnectorId",st.id))}}function getUnit(et){return typeof et=="number"?et:et==="wei"?0:Math.abs(weiUnits[et])}function getAccount(et){const o=et.state.current,tt=et.state.connections.get(o),rt=tt==null?void 0:tt.accounts,nt=rt==null?void 0:rt[0],ot=et.chains.find(st=>st.id===(tt==null?void 0:tt.chainId)),it=et.state.status;switch(it){case"connected":return{address:nt,addresses:rt,chain:ot,chainId:tt==null?void 0:tt.chainId,connector:tt==null?void 0:tt.connector,isConnected:!0,isConnecting:!1,isDisconnected:!1,isReconnecting:!1,status:it};case"reconnecting":return{address:nt,addresses:rt,chain:ot,chainId:tt==null?void 0:tt.chainId,connector:tt==null?void 0:tt.connector,isConnected:!!nt,isConnecting:!1,isDisconnected:!1,isReconnecting:!0,status:it};case"connecting":return{address:nt,addresses:rt,chain:ot,chainId:tt==null?void 0:tt.chainId,connector:tt==null?void 0:tt.connector,isConnected:!1,isConnecting:!0,isDisconnected:!1,isReconnecting:!1,status:it};case"disconnected":return{address:void 0,addresses:void 0,chain:void 0,chainId:void 0,connector:void 0,isConnected:!1,isConnecting:!1,isDisconnected:!0,isReconnecting:!1,status:it}}}async function multicall(et,o){const{allowFailure:tt=!0,chainId:rt,contracts:nt,...ot}=o,it=et.getClient({chainId:rt});return getAction(it,multicall$1,"multicall")({allowFailure:tt,contracts:nt,...ot})}function readContract(et,o){const{chainId:tt,...rt}=o,nt=et.getClient({chainId:tt});return getAction(nt,readContract$1,"readContract")(rt)}async function readContracts(et,o){var st;const{allowFailure:tt=!0,blockNumber:rt,blockTag:nt,...ot}=o,it=o.contracts;try{const at={};for(const[ht,mt]of it.entries()){const ft=mt.chainId??et.state.chainId;at[ft]||(at[ft]=[]),(st=at[ft])==null||st.push({contract:mt,index:ht})}const ct=()=>Object.entries(at).map(([ht,mt])=>multicall(et,{...ot,allowFailure:tt,blockNumber:rt,blockTag:nt,chainId:Number.parseInt(ht),contracts:mt.map(({contract:ft})=>ft)})),lt=(await Promise.all(ct())).flat(),dt=Object.values(at).flatMap(ht=>ht.map(({index:mt})=>mt));return lt.reduce((ht,mt,ft)=>(ht&&(ht[dt[ft]]=mt),ht),[])}catch(at){if(at instanceof ContractFunctionExecutionError)throw at;const ct=()=>it.map(lt=>readContract(et,{...lt,blockNumber:rt,blockTag:nt}));return tt?(await Promise.allSettled(ct())).map(lt=>lt.status==="fulfilled"?{result:lt.value,status:"success"}:{error:lt.reason,result:void 0,status:"failure"}):await Promise.all(ct())}}async function getBalance(et,o){const{address:tt,blockNumber:rt,blockTag:nt,chainId:ot,token:it,unit:st="ether"}=o;if(it)try{return getTokenBalance(et,{balanceAddress:tt,chainId:ot,symbolType:"string",tokenAddress:it})}catch(ht){if(ht instanceof ContractFunctionExecutionError){const mt=await getTokenBalance(et,{balanceAddress:tt,chainId:ot,symbolType:"bytes32",tokenAddress:it}),ft=hexToString(trim$1(mt.symbol,{dir:"right"}));return{...mt,symbol:ft}}throw ht}const at=et.getClient({chainId:ot}),lt=await getAction(at,getBalance$1,"getBalance")(rt?{address:tt,blockNumber:rt}:{address:tt,blockTag:nt}),dt=et.chains.find(ht=>ht.id===ot)??at.chain;return{decimals:dt.nativeCurrency.decimals,formatted:formatUnits(lt,getUnit(st)),symbol:dt.nativeCurrency.symbol,value:lt}}async function getTokenBalance(et,o){const{balanceAddress:tt,chainId:rt,symbolType:nt,tokenAddress:ot,unit:it}=o,st={abi:[{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:nt}]}],address:ot},[at,ct,lt]=await readContracts(et,{allowFailure:!1,contracts:[{...st,functionName:"balanceOf",args:[tt],chainId:rt},{...st,functionName:"decimals",chainId:rt},{...st,functionName:"symbol",chainId:rt}]}),dt=formatUnits(at??"0",getUnit(it??ct));return{decimals:ct,formatted:dt,symbol:lt,value:at}}function getBlockNumber(et,o={}){const{chainId:tt,...rt}=o,nt=et.getClient({chainId:tt});return getAction(nt,getBlockNumber$1,"getBlockNumber")(rt)}function getChainId(et){return et.state.chainId}function deepEqual(et,o){if(et===o)return!0;if(et&&o&&typeof et=="object"&&typeof o=="object"){if(et.constructor!==o.constructor)return!1;let tt,rt;if(Array.isArray(et)&&Array.isArray(o)){if(tt=et.length,tt!==o.length)return!1;for(rt=tt;rt--!==0;)if(!deepEqual(et[rt],o[rt]))return!1;return!0}if(et.valueOf!==Object.prototype.valueOf)return et.valueOf()===o.valueOf();if(et.toString!==Object.prototype.toString)return et.toString()===o.toString();const nt=Object.keys(et);if(tt=nt.length,tt!==Object.keys(o).length)return!1;for(rt=tt;rt--!==0;)if(!Object.prototype.hasOwnProperty.call(o,nt[rt]))return!1;for(rt=tt;rt--!==0;){const ot=nt[rt];if(ot&&!deepEqual(et[ot],o[ot]))return!1}return!0}return et!==et&&o!==o}let previousChains=[];function getChains(et){const o=et.chains;return deepEqual(previousChains,o)?previousChains:(previousChains=o,o)}let previousConnections=[];function getConnections(et){const o=[...et.state.connections.values()];return et.state.status==="reconnecting"||deepEqual(previousConnections,o)?previousConnections:(previousConnections=o,o)}let previousConnectors=[];function getConnectors(et){const o=et.connectors;return deepEqual(previousConnectors,o)?previousConnectors:(previousConnectors=o,o)}function getEnsAddress(et,o){const{chainId:tt,...rt}=o,nt=et.getClient({chainId:tt});return getAction(nt,getEnsAddress$1,"getEnsAddress")(rt)}function getEnsAvatar(et,o){const{chainId:tt,...rt}=o,nt=et.getClient({chainId:tt});return getAction(nt,getEnsAvatar$1,"getEnsAvatar")(rt)}function getEnsName(et,o){const{chainId:tt,...rt}=o,nt=et.getClient({chainId:tt});return getAction(nt,getEnsName$1,"getEnsName")(rt)}let isReconnecting=!1;async function reconnect(et,o={}){var ct,lt;if(isReconnecting)return[];isReconnecting=!0,et.setState(dt=>({...dt,status:dt.current?"reconnecting":"connecting"}));const tt=[];if((ct=o.connectors)!=null&&ct.length)for(const dt of o.connectors){let ht;typeof dt=="function"?ht=et._internal.connectors.setup(dt):ht=dt,tt.push(ht)}else tt.push(...et.connectors);let rt;try{rt=await((lt=et.storage)==null?void 0:lt.getItem("recentConnectorId"))}catch{}const nt={};for(const[,dt]of et.state.connections)nt[dt.connector.id]=1;rt&&(nt[rt]=0);const ot=Object.keys(nt).length>0?[...tt].sort((dt,ht)=>(nt[dt.id]??10)-(nt[ht.id]??10)):tt;let it=!1;const st=[],at=[];for(const dt of ot){const ht=await dt.getProvider().catch(()=>{});if(!ht||at.some(pt=>pt===ht)||!await dt.isAuthorized())continue;const ft=await dt.connect({isReconnecting:!0}).catch(()=>null);ft&&(dt.emitter.off("connect",et._internal.events.connect),dt.emitter.on("change",et._internal.events.change),dt.emitter.on("disconnect",et._internal.events.disconnect),et.setState(pt=>{const yt=new Map(it?pt.connections:new Map).set(dt.uid,{accounts:ft.accounts,chainId:ft.chainId,connector:dt});return{...pt,current:it?pt.current:dt.uid,connections:yt}}),st.push({accounts:ft.accounts,chainId:ft.chainId,connector:dt}),at.push(ht),it=!0)}return(et.state.status==="reconnecting"||et.state.status==="connecting")&&(it?et.setState(dt=>({...dt,status:"connected"})):et.setState(dt=>({...dt,connections:new Map,current:null,status:"disconnected"}))),isReconnecting=!1,st}async function signMessage(et,o){const{account:tt,connector:rt,...nt}=o;let ot;return typeof tt=="object"&&tt.type==="local"?ot=et.getClient():ot=await getConnectorClient(et,{account:tt,connector:rt}),getAction(ot,signMessage$1,"signMessage")({...nt,...tt?{account:tt}:{}})}class ProviderNotFoundError extends BaseError$1{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}class SwitchChainNotSupportedError extends BaseError$1{constructor({connector:o}){super(`"${o.name}" does not support programmatic chain switching.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainNotSupportedError"})}}async function switchChain(et,o){var it;const{addEthereumChainParameter:tt,chainId:rt}=o,nt=et.state.connections.get(((it=o.connector)==null?void 0:it.uid)??et.state.current);if(nt){const st=nt.connector;if(!st.switchChain)throw new SwitchChainNotSupportedError({connector:st});return await st.switchChain({addEthereumChainParameter:tt,chainId:rt})}const ot=et.chains.find(st=>st.id===rt);if(!ot)throw new ChainNotConfiguredError;return et.setState(st=>({...st,chainId:rt})),ot}function watchAccount(et,o){const{onChange:tt}=o;return et.subscribe(()=>getAccount(et),tt,{equalityFn(rt,nt){const{connector:ot,...it}=rt,{connector:st,...at}=nt;return deepEqual(it,at)&&(ot==null?void 0:ot.id)===(st==null?void 0:st.id)&&(ot==null?void 0:ot.uid)===(st==null?void 0:st.uid)}})}function watchBlockNumber(et,o){const{syncConnectedChain:tt=et._internal.syncConnectedChain,...rt}=o;let nt;const ot=at=>{nt&&nt();const ct=et.getClient({chainId:at});return nt=getAction(ct,watchBlockNumber$1,"watchBlockNumber")(rt),nt},it=ot(o.chainId);let st;return tt&&!o.chainId&&(st=et.subscribe(({chainId:at})=>at,async at=>ot(at))),()=>{it==null||it(),st==null||st()}}function watchChainId(et,o){const{onChange:tt}=o;return et.subscribe(rt=>rt.chainId,tt)}function watchConnections(et,o){const{onChange:tt}=o;return et.subscribe(()=>getConnections(et),tt,{equalityFn:deepEqual})}function watchConnectors(et,o){const{onChange:tt}=o;return et._internal.connectors.subscribe((rt,nt)=>{tt(Object.values(rt),nt)})}function createConnector(et){return et}const supportsSimulationIdRegex=/(rabby|trustwallet)/,targetMap={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(et){return et!=null&&et.coinbaseWalletExtension?et.coinbaseWalletExtension:findProvider(et,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(et){return findProvider(et,o=>{if(!o.isMetaMask||o.isBraveWallet&&!o._events&&!o._state)return!1;const tt=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPortal","isRabby","isTokenPocket","isTokenary","isZerion"];for(const rt of tt)if(o[rt])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(et){var o,tt;return(o=et==null?void 0:et.phantom)!=null&&o.ethereum?(tt=et.phantom)==null?void 0:tt.ethereum:findProvider(et,"isPhantom")}}};injected.type="injected";function injected(et={}){const{shimDisconnect:o=!0,unstable_shimAsyncInject:tt}=et;function rt(){const at=et.target;if(typeof at=="function"){const ct=at();if(ct)return ct}return typeof at=="object"?at:typeof at=="string"?{...targetMap[at]??{id:at,name:`${at[0].toUpperCase()}${at.slice(1)}`,provider:`is${at[0].toUpperCase()}${at.slice(1)}`}}:{id:"injected",name:"Injected",provider(ct){return ct==null?void 0:ct.ethereum}}}let nt,ot,it,st;return at=>({get icon(){return rt().icon},get id(){return rt().id},get name(){return rt().name},get supportsSimulation(){return supportsSimulationIdRegex.test(this.id.toLowerCase())},type:injected.type,async setup(){const ct=await this.getProvider();ct!=null&&ct.on&&et.target&&(it||(it=this.onConnect.bind(this),ct.on("connect",it)),nt||(nt=this.onAccountsChanged.bind(this),ct.on("accountsChanged",nt)))},async connect({chainId:ct,isReconnecting:lt}={}){var mt,ft,pt,yt,gt,bt;const dt=await this.getProvider();if(!dt)throw new ProviderNotFoundError;let ht=[];if(lt)ht=await this.getAccounts().catch(()=>[]);else if(o)try{ht=(yt=(pt=(ft=(mt=(await dt.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0])==null?void 0:mt.caveats)==null?void 0:ft[0])==null?void 0:pt.value)==null?void 0:yt.map(vt=>getAddress(vt)),ht.length>0&&(ht=await this.getAccounts())}catch(xt){const vt=xt;if(vt.code===UserRejectedRequestError.code)throw new UserRejectedRequestError(vt);if(vt.code===ResourceUnavailableRpcError.code)throw vt}try{!(ht!=null&&ht.length)&&!lt&&(ht=(await dt.request({method:"eth_requestAccounts"})).map(Et=>getAddress(Et))),it&&(dt.removeListener("connect",it),it=void 0),nt||(nt=this.onAccountsChanged.bind(this),dt.on("accountsChanged",nt)),ot||(ot=this.onChainChanged.bind(this),dt.on("chainChanged",ot)),st||(st=this.onDisconnect.bind(this),dt.on("disconnect",st));let xt=await this.getChainId();if(ct&&xt!==ct){const vt=await this.switchChain({chainId:ct}).catch(Et=>{if(Et.code===UserRejectedRequestError.code)throw Et;return{id:xt}});xt=(vt==null?void 0:vt.id)??xt}return o&&await((gt=at.storage)==null?void 0:gt.removeItem(`${this.id}.disconnected`)),et.target||await((bt=at.storage)==null?void 0:bt.setItem("injected.connected",!0)),{accounts:ht,chainId:xt}}catch(xt){const vt=xt;throw vt.code===UserRejectedRequestError.code?new UserRejectedRequestError(vt):vt.code===ResourceUnavailableRpcError.code?new ResourceUnavailableRpcError(vt):vt}},async disconnect(){var lt,dt;const ct=await this.getProvider();if(!ct)throw new ProviderNotFoundError;ot&&(ct.removeListener("chainChanged",ot),ot=void 0),st&&(ct.removeListener("disconnect",st),st=void 0),it||(it=this.onConnect.bind(this),ct.on("connect",it));try{await withTimeout(()=>ct.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}o&&await((lt=at.storage)==null?void 0:lt.setItem(`${this.id}.disconnected`,!0)),et.target||await((dt=at.storage)==null?void 0:dt.removeItem("injected.connected"))},async getAccounts(){const ct=await this.getProvider();if(!ct)throw new ProviderNotFoundError;return(await ct.request({method:"eth_accounts"})).map(dt=>getAddress(dt))},async getChainId(){const ct=await this.getProvider();if(!ct)throw new ProviderNotFoundError;const lt=await ct.request({method:"eth_chainId"});return Number(lt)},async getProvider(){if(typeof window>"u")return;let ct;const lt=rt();return typeof lt.provider=="function"?ct=lt.provider(window):typeof lt.provider=="string"?ct=findProvider(window,lt.provider):ct=lt.provider,ct&&!ct.removeListener&&("off"in ct&&typeof ct.off=="function"?ct.removeListener=ct.off:ct.removeListener=()=>{}),ct},async isAuthorized(){var ct,lt;try{if(o&&await((ct=at.storage)==null?void 0:ct.getItem(`${this.id}.disconnected`))||!et.target&&!await((lt=at.storage)==null?void 0:lt.getItem("injected.connected")))return!1;if(!await this.getProvider()){if(tt!==void 0&&tt!==!1){const ft=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",ft),!!await this.getProvider()),pt=typeof tt=="number"?tt:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(gt=>window.addEventListener("ethereum#initialized",()=>gt(ft()),{once:!0}))]:[],new Promise(gt=>setTimeout(()=>gt(ft()),pt))]))return!0}throw new ProviderNotFoundError}return!!(await withRetry(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:ct,chainId:lt}){var mt,ft,pt,yt;const dt=await this.getProvider();if(!dt)throw new ProviderNotFoundError;const ht=at.chains.find(gt=>gt.id===lt);if(!ht)throw new SwitchChainError(new ChainNotConfiguredError);try{return await Promise.all([dt.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(lt)}]}).then(async()=>{await this.getChainId()===lt&&at.emitter.emit("change",{chainId:lt})}),new Promise(gt=>{const bt=xt=>{"chainId"in xt&&xt.chainId===lt&&(at.emitter.off("change",bt),gt())};at.emitter.on("change",bt)})]),ht}catch(gt){const bt=gt;if(bt.code===4902||((ft=(mt=bt==null?void 0:bt.data)==null?void 0:mt.originalError)==null?void 0:ft.code)===4902)try{const{default:xt,...vt}=ht.blockExplorers??{};let Et;ct!=null&&ct.blockExplorerUrls?Et=ct.blockExplorerUrls:xt&&(Et=[xt.url,...Object.values(vt).map(kt=>kt.url)]);let Ct;(pt=ct==null?void 0:ct.rpcUrls)!=null&&pt.length?Ct=ct.rpcUrls:Ct=[((yt=ht.rpcUrls.default)==null?void 0:yt.http[0])??""];const St={blockExplorerUrls:Et,chainId:numberToHex(lt),chainName:(ct==null?void 0:ct.chainName)??ht.name,iconUrls:ct==null?void 0:ct.iconUrls,nativeCurrency:(ct==null?void 0:ct.nativeCurrency)??ht.nativeCurrency,rpcUrls:Ct};if(await dt.request({method:"wallet_addEthereumChain",params:[St]}),await this.getChainId()!==lt)throw new UserRejectedRequestError(new Error("User rejected switch after adding network."));return ht}catch(xt){throw new UserRejectedRequestError(xt)}throw bt.code===UserRejectedRequestError.code?new UserRejectedRequestError(bt):new SwitchChainError(bt)}},async onAccountsChanged(ct){var lt;if(ct.length===0)this.onDisconnect();else if(at.emitter.listenerCount("connect")){const dt=(await this.getChainId()).toString();this.onConnect({chainId:dt}),o&&await((lt=at.storage)==null?void 0:lt.removeItem(`${this.id}.disconnected`))}else at.emitter.emit("change",{accounts:ct.map(dt=>getAddress(dt))})},onChainChanged(ct){const lt=Number(ct);at.emitter.emit("change",{chainId:lt})},async onConnect(ct){const lt=await this.getAccounts();if(lt.length===0)return;const dt=Number(ct.chainId);at.emitter.emit("connect",{accounts:lt,chainId:dt});const ht=await this.getProvider();ht&&(it&&(ht.removeListener("connect",it),it=void 0),nt||(nt=this.onAccountsChanged.bind(this),ht.on("accountsChanged",nt)),ot||(ot=this.onChainChanged.bind(this),ht.on("chainChanged",ot)),st||(st=this.onDisconnect.bind(this),ht.on("disconnect",st)))},async onDisconnect(ct){const lt=await this.getProvider();ct&&ct.code===1013&<&&(await this.getAccounts()).length||(at.emitter.emit("disconnect"),lt&&(ot&&(lt.removeListener("chainChanged",ot),ot=void 0),st&&(lt.removeListener("disconnect",st),st=void 0),it||(it=this.onConnect.bind(this),lt.on("connect",it))))}})}function findProvider(et,o){function tt(nt){return typeof o=="function"?o(nt):typeof o=="string"?nt[o]:!0}const rt=et.ethereum;if(rt!=null&&rt.providers)return rt.providers.find(nt=>tt(nt));if(rt&&tt(rt))return rt}function requestProviders(et){if(typeof window>"u")return;const o=tt=>et(tt.detail);return window.addEventListener("eip6963:announceProvider",o),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",o)}function createStore$1(){const et=new Set;let o=[];const tt=()=>requestProviders(nt=>{o.some(({info:ot})=>ot.uuid===nt.info.uuid)||(o=[...o,nt],et.forEach(ot=>ot(o,{added:[nt]})))});let rt=tt();return{_listeners(){return et},clear(){et.forEach(nt=>nt([],{removed:[...o]})),o=[]},destroy(){this.clear(),et.clear(),rt==null||rt()},findProvider({rdns:nt}){return o.find(ot=>ot.info.rdns===nt)},getProviders(){return o},reset(){this.clear(),rt==null||rt(),rt=tt()},subscribe(nt,{emitImmediately:ot}={}){return et.add(nt),ot&&nt(o,{added:o}),()=>et.delete(nt)}}}const __vite_import_meta_env__$1={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_WALLETCONNECT_PROJECT_ID:"1d93edc21291f98e3bed6ff7617ff539"},subscribeWithSelectorImpl=et=>(o,tt,rt)=>{const nt=rt.subscribe;return rt.subscribe=(it,st,at)=>{let ct=it;if(st){const lt=(at==null?void 0:at.equalityFn)||Object.is;let dt=it(rt.getState());ct=ht=>{const mt=it(ht);if(!lt(dt,mt)){const ft=dt;st(dt=mt,ft)}},at!=null&&at.fireImmediately&&st(dt,dt)}return nt(ct)},et(o,tt,rt)},subscribeWithSelector=subscribeWithSelectorImpl;function createJSONStorage(et,o){let tt;try{tt=et()}catch{return}return{getItem:nt=>{var ot;const it=at=>at===null?null:JSON.parse(at,void 0),st=(ot=tt.getItem(nt))!=null?ot:null;return st instanceof Promise?st.then(it):it(st)},setItem:(nt,ot)=>tt.setItem(nt,JSON.stringify(ot,void 0)),removeItem:nt=>tt.removeItem(nt)}}const toThenable=et=>o=>{try{const tt=et(o);return tt instanceof Promise?tt:{then(rt){return toThenable(rt)(tt)},catch(rt){return this}}}catch(tt){return{then(rt){return this},catch(rt){return toThenable(rt)(tt)}}}},oldImpl=(et,o)=>(tt,rt,nt)=>{let ot={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:yt=>yt,version:0,merge:(yt,gt)=>({...gt,...yt}),...o},it=!1;const st=new Set,at=new Set;let ct;try{ct=ot.getStorage()}catch{}if(!ct)return et((...yt)=>{console.warn(`[zustand persist middleware] Unable to update item '${ot.name}', the given storage is currently unavailable.`),tt(...yt)},rt,nt);const lt=toThenable(ot.serialize),dt=()=>{const yt=ot.partialize({...rt()});let gt;const bt=lt({state:yt,version:ot.version}).then(xt=>ct.setItem(ot.name,xt)).catch(xt=>{gt=xt});if(gt)throw gt;return bt},ht=nt.setState;nt.setState=(yt,gt)=>{ht(yt,gt),dt()};const mt=et((...yt)=>{tt(...yt),dt()},rt,nt);let ft;const pt=()=>{var yt;if(!ct)return;it=!1,st.forEach(bt=>bt(rt()));const gt=((yt=ot.onRehydrateStorage)==null?void 0:yt.call(ot,rt()))||void 0;return toThenable(ct.getItem.bind(ct))(ot.name).then(bt=>{if(bt)return ot.deserialize(bt)}).then(bt=>{if(bt)if(typeof bt.version=="number"&&bt.version!==ot.version){if(ot.migrate)return ot.migrate(bt.state,bt.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return bt.state}).then(bt=>{var xt;return ft=ot.merge(bt,(xt=rt())!=null?xt:mt),tt(ft,!0),dt()}).then(()=>{gt==null||gt(ft,void 0),it=!0,at.forEach(bt=>bt(ft))}).catch(bt=>{gt==null||gt(void 0,bt)})};return nt.persist={setOptions:yt=>{ot={...ot,...yt},yt.getStorage&&(ct=yt.getStorage())},clearStorage:()=>{ct==null||ct.removeItem(ot.name)},getOptions:()=>ot,rehydrate:()=>pt(),hasHydrated:()=>it,onHydrate:yt=>(st.add(yt),()=>{st.delete(yt)}),onFinishHydration:yt=>(at.add(yt),()=>{at.delete(yt)})},pt(),ft||mt},newImpl=(et,o)=>(tt,rt,nt)=>{let ot={storage:createJSONStorage(()=>localStorage),partialize:pt=>pt,version:0,merge:(pt,yt)=>({...yt,...pt}),...o},it=!1;const st=new Set,at=new Set;let ct=ot.storage;if(!ct)return et((...pt)=>{console.warn(`[zustand persist middleware] Unable to update item '${ot.name}', the given storage is currently unavailable.`),tt(...pt)},rt,nt);const lt=()=>{const pt=ot.partialize({...rt()});return ct.setItem(ot.name,{state:pt,version:ot.version})},dt=nt.setState;nt.setState=(pt,yt)=>{dt(pt,yt),lt()};const ht=et((...pt)=>{tt(...pt),lt()},rt,nt);let mt;const ft=()=>{var pt,yt;if(!ct)return;it=!1,st.forEach(bt=>{var xt;return bt((xt=rt())!=null?xt:ht)});const gt=((yt=ot.onRehydrateStorage)==null?void 0:yt.call(ot,(pt=rt())!=null?pt:ht))||void 0;return toThenable(ct.getItem.bind(ct))(ot.name).then(bt=>{if(bt)if(typeof bt.version=="number"&&bt.version!==ot.version){if(ot.migrate)return ot.migrate(bt.state,bt.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return bt.state}).then(bt=>{var xt;return mt=ot.merge(bt,(xt=rt())!=null?xt:ht),tt(mt,!0),lt()}).then(()=>{gt==null||gt(mt,void 0),mt=rt(),it=!0,at.forEach(bt=>bt(mt))}).catch(bt=>{gt==null||gt(void 0,bt)})};return nt.persist={setOptions:pt=>{ot={...ot,...pt},pt.storage&&(ct=pt.storage)},clearStorage:()=>{ct==null||ct.removeItem(ot.name)},getOptions:()=>ot,rehydrate:()=>ft(),hasHydrated:()=>it,onHydrate:pt=>(st.add(pt),()=>{st.delete(pt)}),onFinishHydration:pt=>(at.add(pt),()=>{at.delete(pt)})},ot.skipHydration||ft(),mt||ht},persistImpl=(et,o)=>"getStorage"in o||"serialize"in o||"deserialize"in o?((__vite_import_meta_env__$1?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),oldImpl(et,o)):newImpl(et,o),persist=persistImpl,__vite_import_meta_env__={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_WALLETCONNECT_PROJECT_ID:"1d93edc21291f98e3bed6ff7617ff539"},createStoreImpl=et=>{let o;const tt=new Set,rt=(at,ct)=>{const lt=typeof at=="function"?at(o):at;if(!Object.is(lt,o)){const dt=o;o=ct??typeof lt!="object"?lt:Object.assign({},o,lt),tt.forEach(ht=>ht(o,dt))}},nt=()=>o,st={setState:rt,getState:nt,subscribe:at=>(tt.add(at),()=>tt.delete(at)),destroy:()=>{(__vite_import_meta_env__?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),tt.clear()}};return o=et(rt,nt,st),st},createStore=et=>et?createStoreImpl(et):createStoreImpl;var eventemitter3={exports:{}};(function(et){var o=Object.prototype.hasOwnProperty,tt="~";function rt(){}Object.create&&(rt.prototype=Object.create(null),new rt().__proto__||(tt=!1));function nt(at,ct,lt){this.fn=at,this.context=ct,this.once=lt||!1}function ot(at,ct,lt,dt,ht){if(typeof lt!="function")throw new TypeError("The listener must be a function");var mt=new nt(lt,dt||at,ht),ft=tt?tt+ct:ct;return at._events[ft]?at._events[ft].fn?at._events[ft]=[at._events[ft],mt]:at._events[ft].push(mt):(at._events[ft]=mt,at._eventsCount++),at}function it(at,ct){--at._eventsCount===0?at._events=new rt:delete at._events[ct]}function st(){this._events=new rt,this._eventsCount=0}st.prototype.eventNames=function(){var ct=[],lt,dt;if(this._eventsCount===0)return ct;for(dt in lt=this._events)o.call(lt,dt)&&ct.push(tt?dt.slice(1):dt);return Object.getOwnPropertySymbols?ct.concat(Object.getOwnPropertySymbols(lt)):ct},st.prototype.listeners=function(ct){var lt=tt?tt+ct:ct,dt=this._events[lt];if(!dt)return[];if(dt.fn)return[dt.fn];for(var ht=0,mt=dt.length,ft=new Array(mt);ht{let nt=rt;return(nt==null?void 0:nt.__type)==="bigint"&&(nt=BigInt(nt.value)),(nt==null?void 0:nt.__type)==="Map"&&(nt=new Map(nt.value)),(o==null?void 0:o(tt,nt))??nt})}function getReferenceKey(et,o){return et.slice(0,o).join(".")||"."}function getCutoff(et,o){const{length:tt}=et;for(let rt=0;rt{let it=ot;return typeof it=="bigint"&&(it={__type:"bigint",value:ot.toString()}),it instanceof Map&&(it={__type:"Map",value:Array.from(ot.entries())}),(o==null?void 0:o(nt,it))??it},rt),tt??void 0)}function createStorage(et){const{deserialize:o=deserialize$1,key:tt="wagmi",serialize:rt=serialize$1,storage:nt=noopStorage}=et;function ot(it){return it instanceof Promise?it.then(st=>st).catch(()=>null):it}return{...nt,key:tt,async getItem(it,st){const at=nt.getItem(`${tt}.${it}`),ct=await ot(at);return ct?o(ct)??null:st??null},async setItem(it,st){const at=`${tt}.${it}`;st===null?await ot(nt.removeItem(at)):await ot(nt.setItem(at,rt(st)))},async removeItem(it){await ot(nt.removeItem(`${tt}.${it}`))}}}const noopStorage={getItem:()=>null,setItem:()=>{},removeItem:()=>{}},size=256;let index$2=size,buffer;function uid(et=11){if(!buffer||index$2+et>size*2){buffer="",index$2=0;for(let o=0;oot.chains),at=createStore(()=>[...ot.connectors??[],...nt?[]:(it==null?void 0:it.getProviders().map(lt))??[]].map(ct));function ct(Et){var At;const Ct=createEmitter(uid()),St={...Et({emitter:Ct,chains:st.getState(),storage:tt,transports:ot.transports}),emitter:Ct,uid:Ct.uid};return Ct.on("connect",xt),(At=St.setup)==null||At.call(St),St}function lt(Et){const{info:Ct}=Et,St=Et.provider;return injected({target:{...Ct,id:Ct.rdns,provider:St}})}const dt=new Map;function ht(Et={}){const Ct=Et.chainId??yt.getState().chainId,St=st.getState().find(kt=>kt.id===Ct);if(Et.chainId&&!St)throw new ChainNotConfiguredError;{const kt=dt.get(yt.getState().chainId);if(kt&&!St)return kt;if(!St)throw new ChainNotConfiguredError}{const kt=dt.get(Ct);if(kt)return kt}let At;if(ot.client)At=ot.client({chain:St});else{const kt=St.id,It=st.getState().map(Mt=>Mt.id),Nt={},Lt=Object.entries(ot);for(const[Mt,zt]of Lt)if(!(Mt==="chains"||Mt==="client"||Mt==="connectors"||Mt==="transports"))if(typeof zt=="object")if(kt in zt)Nt[Mt]=zt[kt];else{if(It.some(Xt=>Xt in zt))continue;Nt[Mt]=zt}else Nt[Mt]=zt;At=createClient({...Nt,chain:St,batch:Nt.batch??{multicall:!0},transport:Mt=>ot.transports[kt]({...Mt,connectors:at})})}return dt.set(Ct,At),At}function mt(){return{chainId:st.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let ft;const pt="0.0.0-canary-";version$6.startsWith(pt)?ft=Number.parseInt(version$6.replace(pt,"")):ft=Number.parseInt(version$6.split(".")[0]??"0");const yt=createStore(subscribeWithSelector(tt?persist(mt,{migrate(Et,Ct){if(Ct===ft)return Et;const St=mt(),At=gt(Et,St.chainId);return{...St,chainId:At}},name:"store",partialize(Et){return{connections:{__type:"Map",value:Array.from(Et.connections.entries()).map(([Ct,St])=>{const{id:At,name:kt,type:It,uid:Nt}=St.connector;return[Ct,{...St,connector:{id:At,name:kt,type:It,uid:Nt}}]})},chainId:Et.chainId,current:Et.current}},merge(Et,Ct){typeof Et=="object"&&Et&&"status"in Et&&delete Et.status;const St=gt(Et,Ct.chainId);return{...Ct,...Et,chainId:St}},skipHydration:nt,storage:tt,version:ft}):mt));function gt(Et,Ct){return Et&&typeof Et=="object"&&"chainId"in Et&&typeof Et.chainId=="number"&&st.getState().some(St=>St.id===Et.chainId)?Et.chainId:Ct}rt&&yt.subscribe(({connections:Et,current:Ct})=>{var St;return Ct?(St=Et.get(Ct))==null?void 0:St.chainId:void 0},Et=>{if(st.getState().some(St=>St.id===Et))return yt.setState(St=>({...St,chainId:Et??St.chainId}))}),it==null||it.subscribe(Et=>{const Ct=new Map;for(const At of at.getState())Ct.set(At.id,!0);const St=[];for(const At of Et){const kt=ct(lt(At));Ct.has(kt.id)||St.push(kt)}tt&&!yt.persist.hasHydrated()||at.setState(At=>[...At,...St],!0)});function bt(Et){yt.setState(Ct=>{const St=Ct.connections.get(Et.uid);return St?{...Ct,connections:new Map(Ct.connections).set(Et.uid,{accounts:Et.accounts??St.accounts,chainId:Et.chainId??St.chainId,connector:St.connector})}:Ct})}function xt(Et){yt.getState().status==="connecting"||yt.getState().status==="reconnecting"||yt.setState(Ct=>{const St=at.getState().find(At=>At.uid===Et.uid);return St?(St.emitter.listenerCount("connect")&&St.emitter.off("connect",bt),St.emitter.listenerCount("change")||St.emitter.on("change",bt),St.emitter.listenerCount("disconnect")||St.emitter.on("disconnect",vt),{...Ct,connections:new Map(Ct.connections).set(Et.uid,{accounts:Et.accounts,chainId:Et.chainId,connector:St}),current:Et.uid,status:"connected"}):Ct})}function vt(Et){yt.setState(Ct=>{const St=Ct.connections.get(Et.uid);if(St){const kt=St.connector;kt.emitter.listenerCount("change")&&St.connector.emitter.off("change",bt),kt.emitter.listenerCount("disconnect")&&St.connector.emitter.off("disconnect",vt),kt.emitter.listenerCount("connect")||St.connector.emitter.on("connect",xt)}if(Ct.connections.delete(Et.uid),Ct.connections.size===0)return{...Ct,connections:new Map,current:null,status:"disconnected"};const At=Ct.connections.values().next().value;return{...Ct,connections:new Map(Ct.connections),current:At.connector.uid}})}return{get chains(){return st.getState()},get connectors(){return at.getState()},storage:tt,getClient:ht,get state(){return yt.getState()},setState(Et){let Ct;typeof Et=="function"?Ct=Et(yt.getState()):Ct=Et;const St=mt();typeof Ct!="object"&&(Ct=St),Object.keys(St).some(kt=>!(kt in Ct))&&(Ct=St),yt.setState(Ct,!0)},subscribe(Et,Ct,St){return yt.subscribe(Et,Ct,St?{...St,fireImmediately:St.emitImmediately}:void 0)},_internal:{mipd:it,store:yt,ssr:!!nt,syncConnectedChain:rt,transports:ot.transports,chains:{setState(Et){const Ct=typeof Et=="function"?Et(st.getState()):Et;if(Ct.length!==0)return st.setState(Ct,!0)},subscribe(Et){return st.subscribe(Et)}},connectors:{providerDetailToConnector:lt,setup:ct,setState(Et){return at.setState(typeof Et=="function"?Et(at.getState()):Et,!0)},subscribe(Et){return at.subscribe(Et)}},events:{change:bt,connect:xt,disconnect:vt}}}}function hydrate(et,o){const{initialState:tt,reconnectOnMount:rt}=o;return tt&&!et._internal.store.persist.hasHydrated()&&et.setState({...tt,chainId:et.chains.some(nt=>nt.id===tt.chainId)?tt.chainId:et.chains[0].id,connections:rt?tt.connections:new Map,status:rt?"reconnecting":"disconnected"}),{async onMount(){var nt;if(et._internal.ssr){await et._internal.store.persist.rehydrate();const ot=(nt=et._internal.mipd)==null?void 0:nt.getProviders().map(et._internal.connectors.providerDetailToConnector).map(et._internal.connectors.setup);et._internal.connectors.setState(it=>[...it,...ot??[]])}rt?reconnect(et):et.storage&&et.setState(ot=>({...ot,connections:new Map}))}}}function extractRpcUrls(et){var ot,it,st;const{chain:o}=et,tt=o.rpcUrls.default.http[0];if(!et.transports)return[tt];const rt=(it=(ot=et.transports)==null?void 0:ot[o.id])==null?void 0:it.call(ot,{chain:o});return(((st=rt==null?void 0:rt.value)==null?void 0:st.transports)||[rt]).map(({value:at})=>(at==null?void 0:at.url)||tt)}function Hydrate(et){const{children:o,config:tt,initialState:rt,reconnectOnMount:nt=!0}=et,{onMount:ot}=hydrate(tt,{initialState:rt,reconnectOnMount:nt});tt._internal.ssr||ot();const it=reactExports.useRef(!0);return reactExports.useEffect(()=>{if(it.current&&tt._internal.ssr)return ot(),()=>{it.current=!1}},[]),o}const WagmiContext=reactExports.createContext(void 0);function WagmiProvider(et){const{children:o,config:tt}=et,rt={value:tt};return reactExports.createElement(Hydrate,et,reactExports.createElement(WagmiContext.Provider,rt,o))}const version$5="2.12.19",getVersion=()=>`wagmi@${version$5}`;class BaseError extends BaseError$1{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return getVersion()}}class WagmiProviderNotFoundError extends BaseError{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function useConfig(et={}){const o=et.config??reactExports.useContext(WagmiContext);if(!o)throw new WagmiProviderNotFoundError;return o}function watchChains(et,o){const{onChange:tt}=o;return et._internal.chains.subscribe((rt,nt)=>{tt(rt,nt)})}var withSelector={exports:{}},withSelector_production_min={},shim={exports:{}},useSyncExternalStoreShim_production_min={};/** - * @license React - * use-sync-external-store-shim.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var e$2=reactExports;function h$4(et,o){return et===o&&(et!==0||1/et===1/o)||et!==et&&o!==o}var k$3=typeof Object.is=="function"?Object.is:h$4,l$2=e$2.useState,m$4=e$2.useEffect,n$3=e$2.useLayoutEffect,p$3=e$2.useDebugValue;function q$4(et,o){var tt=o(),rt=l$2({inst:{value:tt,getSnapshot:o}}),nt=rt[0].inst,ot=rt[1];return n$3(function(){nt.value=tt,nt.getSnapshot=o,r$4(nt)&&ot({inst:nt})},[et,tt,o]),m$4(function(){return r$4(nt)&&ot({inst:nt}),et(function(){r$4(nt)&&ot({inst:nt})})},[et]),p$3(tt),tt}function r$4(et){var o=et.getSnapshot;et=et.value;try{var tt=o();return!k$3(et,tt)}catch{return!0}}function t$3(et,o){return o()}var u$2=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?t$3:q$4;useSyncExternalStoreShim_production_min.useSyncExternalStore=e$2.useSyncExternalStore!==void 0?e$2.useSyncExternalStore:u$2;shim.exports=useSyncExternalStoreShim_production_min;var shimExports=shim.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var h$3=reactExports,n$2=shimExports;function p$2(et,o){return et===o&&(et!==0||1/et===1/o)||et!==et&&o!==o}var q$3=typeof Object.is=="function"?Object.is:p$2,r$3=n$2.useSyncExternalStore,t$2=h$3.useRef,u$1=h$3.useEffect,v$3=h$3.useMemo,w$3=h$3.useDebugValue;withSelector_production_min.useSyncExternalStoreWithSelector=function(et,o,tt,rt,nt){var ot=t$2(null);if(ot.current===null){var it={hasValue:!1,value:null};ot.current=it}else it=ot.current;ot=v$3(function(){function at(mt){if(!ct){if(ct=!0,lt=mt,mt=rt(mt),nt!==void 0&&it.hasValue){var ft=it.value;if(nt(ft,mt))return dt=ft}return dt=mt}if(ft=dt,q$3(lt,mt))return ft;var pt=rt(mt);return nt!==void 0&&nt(ft,pt)?ft:(lt=mt,dt=pt)}var ct=!1,lt,dt,ht=tt===void 0?null:tt;return[function(){return at(o())},ht===null?void 0:function(){return at(ht())}]},[o,tt,rt,nt]);var st=r$3(et,ot[0],ot[1]);return u$1(function(){it.hasValue=!0,it.value=st},[st]),w$3(st),st};withSelector.exports=withSelector_production_min;var withSelectorExports=withSelector.exports;const isPlainObject$4=et=>typeof et=="object"&&!Array.isArray(et);function useSyncExternalStoreWithTracked(et,o,tt=o,rt=deepEqual){const nt=reactExports.useRef([]),ot=withSelectorExports.useSyncExternalStoreWithSelector(et,o,tt,it=>it,(it,st)=>{if(isPlainObject$4(it)&&isPlainObject$4(st)&&nt.current.length){for(const at of nt.current)if(!rt(it[at],st[at]))return!1;return!0}return rt(it,st)});return reactExports.useMemo(()=>{if(isPlainObject$4(ot)){const it={...ot};let st={};for(const[at,ct]of Object.entries(it))st={...st,[at]:{configurable:!1,enumerable:!0,get:()=>(nt.current.includes(at)||nt.current.push(at),ct)}};return Object.defineProperties(it,st),it}return ot},[ot])}function useAccount(et={}){const o=useConfig(et);return useSyncExternalStoreWithTracked(tt=>watchAccount(o,{onChange:tt}),()=>getAccount(o))}function useAccountEffect(et={}){const{onConnect:o,onDisconnect:tt}=et,rt=useConfig(et);reactExports.useEffect(()=>watchAccount(rt,{onChange(nt,ot){if((ot.status==="reconnecting"||ot.status==="connecting"&&ot.address===void 0)&&nt.status==="connected"){const{address:it,addresses:st,chain:at,chainId:ct,connector:lt}=nt,dt=ot.status==="reconnecting"||ot.status===void 0;o==null||o({address:it,addresses:st,chain:at,chainId:ct,connector:lt,isReconnected:dt})}else ot.status==="connected"&&nt.status==="disconnected"&&(tt==null||tt())}}),[rt,o,tt])}var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(et){return this.listeners.add(et),this.onSubscribe(),()=>{this.listeners.delete(et),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$4(){}function functionalUpdate(et,o){return typeof et=="function"?et(o):et}function isValidTimeout(et){return typeof et=="number"&&et>=0&&et!==1/0}function timeUntilStale(et,o){return Math.max(et+(o||0)-Date.now(),0)}function resolveStaleTime(et,o){return typeof et=="function"?et(o):et}function resolveEnabled(et,o){return typeof et=="function"?et(o):et}function matchQuery(et,o){const{type:tt="all",exact:rt,fetchStatus:nt,predicate:ot,queryKey:it,stale:st}=et;if(it){if(rt){if(o.queryHash!==hashQueryKeyByOptions(it,o.options))return!1}else if(!partialMatchKey(o.queryKey,it))return!1}if(tt!=="all"){const at=o.isActive();if(tt==="active"&&!at||tt==="inactive"&&at)return!1}return!(typeof st=="boolean"&&o.isStale()!==st||nt&&nt!==o.state.fetchStatus||ot&&!ot(o))}function matchMutation(et,o){const{exact:tt,status:rt,predicate:nt,mutationKey:ot}=et;if(ot){if(!o.options.mutationKey)return!1;if(tt){if(hashKey(o.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(o.options.mutationKey,ot))return!1}return!(rt&&o.state.status!==rt||nt&&!nt(o))}function hashQueryKeyByOptions(et,o){return((o==null?void 0:o.queryKeyHashFn)||hashKey)(et)}function hashKey(et){return JSON.stringify(et,(o,tt)=>isPlainObject$3(tt)?Object.keys(tt).sort().reduce((rt,nt)=>(rt[nt]=tt[nt],rt),{}):tt)}function partialMatchKey(et,o){return et===o?!0:typeof et!=typeof o?!1:et&&o&&typeof et=="object"&&typeof o=="object"?!Object.keys(o).some(tt=>!partialMatchKey(et[tt],o[tt])):!1}function replaceEqualDeep(et,o){if(et===o)return et;const tt=isPlainArray(et)&&isPlainArray(o);if(tt||isPlainObject$3(et)&&isPlainObject$3(o)){const rt=tt?et:Object.keys(et),nt=rt.length,ot=tt?o:Object.keys(o),it=ot.length,st=tt?[]:{};let at=0;for(let ct=0;ct{setTimeout(o,et)})}function replaceData(et,o,tt){return typeof tt.structuralSharing=="function"?tt.structuralSharing(et,o):tt.structuralSharing!==!1?replaceEqualDeep(et,o):o}function addToEnd(et,o,tt=0){const rt=[...et,o];return tt&&rt.length>tt?rt.slice(1):rt}function addToStart(et,o,tt=0){const rt=[o,...et];return tt&&rt.length>tt?rt.slice(0,-1):rt}var skipToken=Symbol();function ensureQueryFn(et,o){return!et.queryFn&&(o!=null&&o.initialPromise)?()=>o.initialPromise:!et.queryFn||et.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${et.queryHash}'`)):et.queryFn}var kn,hn,Mn,zs,FocusManager=(zs=class extends Subscribable{constructor(){super();fr(this,kn);fr(this,hn);fr(this,Mn);lr(this,Mn,o=>{if(!isServer&&window.addEventListener){const tt=()=>o();return window.addEventListener("visibilitychange",tt,!1),()=>{window.removeEventListener("visibilitychange",tt)}}})}onSubscribe(){Ot(this,hn)||this.setEventListener(Ot(this,Mn))}onUnsubscribe(){var o;this.hasListeners()||((o=Ot(this,hn))==null||o.call(this),lr(this,hn,void 0))}setEventListener(o){var tt;lr(this,Mn,o),(tt=Ot(this,hn))==null||tt.call(this),lr(this,hn,o(rt=>{typeof rt=="boolean"?this.setFocused(rt):this.onFocus()}))}setFocused(o){Ot(this,kn)!==o&&(lr(this,kn,o),this.onFocus())}onFocus(){const o=this.isFocused();this.listeners.forEach(tt=>{tt(o)})}isFocused(){var o;return typeof Ot(this,kn)=="boolean"?Ot(this,kn):((o=globalThis.document)==null?void 0:o.visibilityState)!=="hidden"}},kn=new WeakMap,hn=new WeakMap,Mn=new WeakMap,zs),focusManager=new FocusManager,Bn,fn,Fn,Vs,OnlineManager=(Vs=class extends Subscribable{constructor(){super();fr(this,Bn,!0);fr(this,fn);fr(this,Fn);lr(this,Fn,o=>{if(!isServer&&window.addEventListener){const tt=()=>o(!0),rt=()=>o(!1);return window.addEventListener("online",tt,!1),window.addEventListener("offline",rt,!1),()=>{window.removeEventListener("online",tt),window.removeEventListener("offline",rt)}}})}onSubscribe(){Ot(this,fn)||this.setEventListener(Ot(this,Fn))}onUnsubscribe(){var o;this.hasListeners()||((o=Ot(this,fn))==null||o.call(this),lr(this,fn,void 0))}setEventListener(o){var tt;lr(this,Fn,o),(tt=Ot(this,fn))==null||tt.call(this),lr(this,fn,o(this.setOnline.bind(this)))}setOnline(o){Ot(this,Bn)!==o&&(lr(this,Bn,o),this.listeners.forEach(rt=>{rt(o)}))}isOnline(){return Ot(this,Bn)}},Bn=new WeakMap,fn=new WeakMap,Fn=new WeakMap,Vs),onlineManager=new OnlineManager;function pendingThenable(){let et,o;const tt=new Promise((nt,ot)=>{et=nt,o=ot});tt.status="pending",tt.catch(()=>{});function rt(nt){Object.assign(tt,nt),delete tt.resolve,delete tt.reject}return tt.resolve=nt=>{rt({status:"fulfilled",value:nt}),et(nt)},tt.reject=nt=>{rt({status:"rejected",reason:nt}),o(nt)},tt}function defaultRetryDelay(et){return Math.min(1e3*2**et,3e4)}function canFetch(et){return(et??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(et){super("CancelledError"),this.revert=et==null?void 0:et.revert,this.silent=et==null?void 0:et.silent}};function isCancelledError(et){return et instanceof CancelledError}function createRetryer(et){let o=!1,tt=0,rt=!1,nt;const ot=pendingThenable(),it=pt=>{var yt;rt||(ht(new CancelledError(pt)),(yt=et.abort)==null||yt.call(et))},st=()=>{o=!0},at=()=>{o=!1},ct=()=>focusManager.isFocused()&&(et.networkMode==="always"||onlineManager.isOnline())&&et.canRun(),lt=()=>canFetch(et.networkMode)&&et.canRun(),dt=pt=>{var yt;rt||(rt=!0,(yt=et.onSuccess)==null||yt.call(et,pt),nt==null||nt(),ot.resolve(pt))},ht=pt=>{var yt;rt||(rt=!0,(yt=et.onError)==null||yt.call(et,pt),nt==null||nt(),ot.reject(pt))},mt=()=>new Promise(pt=>{var yt;nt=gt=>{(rt||ct())&&pt(gt)},(yt=et.onPause)==null||yt.call(et)}).then(()=>{var pt;nt=void 0,rt||(pt=et.onContinue)==null||pt.call(et)}),ft=()=>{if(rt)return;let pt;const yt=tt===0?et.initialPromise:void 0;try{pt=yt??et.fn()}catch(gt){pt=Promise.reject(gt)}Promise.resolve(pt).then(dt).catch(gt=>{var Ct;if(rt)return;const bt=et.retry??(isServer?0:3),xt=et.retryDelay??defaultRetryDelay,vt=typeof xt=="function"?xt(tt,gt):xt,Et=bt===!0||typeof bt=="number"&&ttct()?void 0:mt()).then(()=>{o?ht(gt):ft()})})};return{promise:ot,cancel:it,continue:()=>(nt==null||nt(),ot),cancelRetry:st,continueRetry:at,canStart:lt,start:()=>(lt()?ft():mt().then(ft),ot)}}function createNotifyManager(){let et=[],o=0,tt=st=>{st()},rt=st=>{st()},nt=st=>setTimeout(st,0);const ot=st=>{o?et.push(st):nt(()=>{tt(st)})},it=()=>{const st=et;et=[],st.length&&nt(()=>{rt(()=>{st.forEach(at=>{tt(at)})})})};return{batch:st=>{let at;o++;try{at=st()}finally{o--,o||it()}return at},batchCalls:st=>(...at)=>{ot(()=>{st(...at)})},schedule:ot,setNotifyFunction:st=>{tt=st},setBatchNotifyFunction:st=>{rt=st},setScheduler:st=>{nt=st}}}var notifyManager=createNotifyManager(),Rn,Hs,Removable=(Hs=class{constructor(){fr(this,Rn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&lr(this,Rn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(et){this.gcTime=Math.max(this.gcTime||0,et??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Ot(this,Rn)&&(clearTimeout(Ot(this,Rn)),lr(this,Rn,void 0))}},Rn=new WeakMap,Hs),Un,zn,Vr,Lr,io,_n,Gr,nn,Ws,Query=(Ws=class extends Removable{constructor(o){super();fr(this,Gr);fr(this,Un);fr(this,zn);fr(this,Vr);fr(this,Lr);fr(this,io);fr(this,_n);lr(this,_n,!1),lr(this,io,o.defaultOptions),this.setOptions(o.options),this.observers=[],lr(this,Vr,o.cache),this.queryKey=o.queryKey,this.queryHash=o.queryHash,lr(this,Un,getDefaultState$1(this.options)),this.state=o.state??Ot(this,Un),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var o;return(o=Ot(this,Lr))==null?void 0:o.promise}setOptions(o){this.options={...Ot(this,io),...o},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Ot(this,Vr).remove(this)}setData(o,tt){const rt=replaceData(this.state.data,o,this.options);return mr(this,Gr,nn).call(this,{data:rt,type:"success",dataUpdatedAt:tt==null?void 0:tt.updatedAt,manual:tt==null?void 0:tt.manual}),rt}setState(o,tt){mr(this,Gr,nn).call(this,{type:"setState",state:o,setStateOptions:tt})}cancel(o){var rt,nt;const tt=(rt=Ot(this,Lr))==null?void 0:rt.promise;return(nt=Ot(this,Lr))==null||nt.cancel(o),tt?tt.then(noop$4).catch(noop$4):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Ot(this,Un))}isActive(){return this.observers.some(o=>resolveEnabled(o.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(o=>o.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(o=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,o)}onFocus(){var tt;const o=this.observers.find(rt=>rt.shouldFetchOnWindowFocus());o==null||o.refetch({cancelRefetch:!1}),(tt=Ot(this,Lr))==null||tt.continue()}onOnline(){var tt;const o=this.observers.find(rt=>rt.shouldFetchOnReconnect());o==null||o.refetch({cancelRefetch:!1}),(tt=Ot(this,Lr))==null||tt.continue()}addObserver(o){this.observers.includes(o)||(this.observers.push(o),this.clearGcTimeout(),Ot(this,Vr).notify({type:"observerAdded",query:this,observer:o}))}removeObserver(o){this.observers.includes(o)&&(this.observers=this.observers.filter(tt=>tt!==o),this.observers.length||(Ot(this,Lr)&&(Ot(this,_n)?Ot(this,Lr).cancel({revert:!0}):Ot(this,Lr).cancelRetry()),this.scheduleGc()),Ot(this,Vr).notify({type:"observerRemoved",query:this,observer:o}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||mr(this,Gr,nn).call(this,{type:"invalidate"})}fetch(o,tt){var at,ct,lt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(tt!=null&&tt.cancelRefetch))this.cancel({silent:!0});else if(Ot(this,Lr))return Ot(this,Lr).continueRetry(),Ot(this,Lr).promise}if(o&&this.setOptions(o),!this.options.queryFn){const dt=this.observers.find(ht=>ht.options.queryFn);dt&&this.setOptions(dt.options)}const rt=new AbortController,nt=dt=>{Object.defineProperty(dt,"signal",{enumerable:!0,get:()=>(lr(this,_n,!0),rt.signal)})},ot=()=>{const dt=ensureQueryFn(this.options,tt),ht={queryKey:this.queryKey,meta:this.meta};return nt(ht),lr(this,_n,!1),this.options.persister?this.options.persister(dt,ht,this):dt(ht)},it={fetchOptions:tt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};nt(it),(at=this.options.behavior)==null||at.onFetch(it,this),lr(this,zn,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=it.fetchOptions)==null?void 0:ct.meta))&&mr(this,Gr,nn).call(this,{type:"fetch",meta:(lt=it.fetchOptions)==null?void 0:lt.meta});const st=dt=>{var ht,mt,ft,pt;isCancelledError(dt)&&dt.silent||mr(this,Gr,nn).call(this,{type:"error",error:dt}),isCancelledError(dt)||((mt=(ht=Ot(this,Vr).config).onError)==null||mt.call(ht,dt,this),(pt=(ft=Ot(this,Vr).config).onSettled)==null||pt.call(ft,this.state.data,dt,this)),this.scheduleGc()};return lr(this,Lr,createRetryer({initialPromise:tt==null?void 0:tt.initialPromise,fn:it.fetchFn,abort:rt.abort.bind(rt),onSuccess:dt=>{var ht,mt,ft,pt;if(dt===void 0){st(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(dt)}catch(yt){st(yt);return}(mt=(ht=Ot(this,Vr).config).onSuccess)==null||mt.call(ht,dt,this),(pt=(ft=Ot(this,Vr).config).onSettled)==null||pt.call(ft,dt,this.state.error,this),this.scheduleGc()},onError:st,onFail:(dt,ht)=>{mr(this,Gr,nn).call(this,{type:"failed",failureCount:dt,error:ht})},onPause:()=>{mr(this,Gr,nn).call(this,{type:"pause"})},onContinue:()=>{mr(this,Gr,nn).call(this,{type:"continue"})},retry:it.options.retry,retryDelay:it.options.retryDelay,networkMode:it.options.networkMode,canRun:()=>!0})),Ot(this,Lr).start()}},Un=new WeakMap,zn=new WeakMap,Vr=new WeakMap,Lr=new WeakMap,io=new WeakMap,_n=new WeakMap,Gr=new WeakSet,nn=function(o){const tt=rt=>{switch(o.type){case"failed":return{...rt,fetchFailureCount:o.failureCount,fetchFailureReason:o.error};case"pause":return{...rt,fetchStatus:"paused"};case"continue":return{...rt,fetchStatus:"fetching"};case"fetch":return{...rt,...fetchState(rt.data,this.options),fetchMeta:o.meta??null};case"success":return{...rt,data:o.data,dataUpdateCount:rt.dataUpdateCount+1,dataUpdatedAt:o.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!o.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const nt=o.error;return isCancelledError(nt)&&nt.revert&&Ot(this,zn)?{...Ot(this,zn),fetchStatus:"idle"}:{...rt,error:nt,errorUpdateCount:rt.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:rt.fetchFailureCount+1,fetchFailureReason:nt,fetchStatus:"idle",status:"error"};case"invalidate":return{...rt,isInvalidated:!0};case"setState":return{...rt,...o.state}}};this.state=tt(this.state),notifyManager.batch(()=>{this.observers.forEach(rt=>{rt.onQueryUpdate()}),Ot(this,Vr).notify({query:this,type:"updated",action:o})})},Ws);function fetchState(et,o){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(o.networkMode)?"fetching":"paused",...et===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(et){const o=typeof et.initialData=="function"?et.initialData():et.initialData,tt=o!==void 0,rt=tt?typeof et.initialDataUpdatedAt=="function"?et.initialDataUpdatedAt():et.initialDataUpdatedAt:0;return{data:o,dataUpdateCount:0,dataUpdatedAt:tt?rt??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:tt?"success":"pending",fetchStatus:"idle"}}var qr,Gs,QueryCache=(Gs=class extends Subscribable{constructor(o={}){super();fr(this,qr);this.config=o,lr(this,qr,new Map)}build(o,tt,rt){const nt=tt.queryKey,ot=tt.queryHash??hashQueryKeyByOptions(nt,tt);let it=this.get(ot);return it||(it=new Query({cache:this,queryKey:nt,queryHash:ot,options:o.defaultQueryOptions(tt),state:rt,defaultOptions:o.getQueryDefaults(nt)}),this.add(it)),it}add(o){Ot(this,qr).has(o.queryHash)||(Ot(this,qr).set(o.queryHash,o),this.notify({type:"added",query:o}))}remove(o){const tt=Ot(this,qr).get(o.queryHash);tt&&(o.destroy(),tt===o&&Ot(this,qr).delete(o.queryHash),this.notify({type:"removed",query:o}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(o=>{this.remove(o)})})}get(o){return Ot(this,qr).get(o)}getAll(){return[...Ot(this,qr).values()]}find(o){const tt={exact:!0,...o};return this.getAll().find(rt=>matchQuery(tt,rt))}findAll(o={}){const tt=this.getAll();return Object.keys(o).length>0?tt.filter(rt=>matchQuery(o,rt)):tt}notify(o){notifyManager.batch(()=>{this.listeners.forEach(tt=>{tt(o)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(o=>{o.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(o=>{o.onOnline()})})}},qr=new WeakMap,Gs),Kr,Or,Tn,Qr,un,qs,Mutation=(qs=class extends Removable{constructor(o){super();fr(this,Qr);fr(this,Kr);fr(this,Or);fr(this,Tn);this.mutationId=o.mutationId,lr(this,Or,o.mutationCache),lr(this,Kr,[]),this.state=o.state||getDefaultState(),this.setOptions(o.options),this.scheduleGc()}setOptions(o){this.options=o,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(o){Ot(this,Kr).includes(o)||(Ot(this,Kr).push(o),this.clearGcTimeout(),Ot(this,Or).notify({type:"observerAdded",mutation:this,observer:o}))}removeObserver(o){lr(this,Kr,Ot(this,Kr).filter(tt=>tt!==o)),this.scheduleGc(),Ot(this,Or).notify({type:"observerRemoved",mutation:this,observer:o})}optionalRemove(){Ot(this,Kr).length||(this.state.status==="pending"?this.scheduleGc():Ot(this,Or).remove(this))}continue(){var o;return((o=Ot(this,Tn))==null?void 0:o.continue())??this.execute(this.state.variables)}async execute(o){var nt,ot,it,st,at,ct,lt,dt,ht,mt,ft,pt,yt,gt,bt,xt,vt,Et,Ct,St;lr(this,Tn,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(o):Promise.reject(new Error("No mutationFn found")),onFail:(At,kt)=>{mr(this,Qr,un).call(this,{type:"failed",failureCount:At,error:kt})},onPause:()=>{mr(this,Qr,un).call(this,{type:"pause"})},onContinue:()=>{mr(this,Qr,un).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Ot(this,Or).canRun(this)}));const tt=this.state.status==="pending",rt=!Ot(this,Tn).canStart();try{if(!tt){mr(this,Qr,un).call(this,{type:"pending",variables:o,isPaused:rt}),await((ot=(nt=Ot(this,Or).config).onMutate)==null?void 0:ot.call(nt,o,this));const kt=await((st=(it=this.options).onMutate)==null?void 0:st.call(it,o));kt!==this.state.context&&mr(this,Qr,un).call(this,{type:"pending",context:kt,variables:o,isPaused:rt})}const At=await Ot(this,Tn).start();return await((ct=(at=Ot(this,Or).config).onSuccess)==null?void 0:ct.call(at,At,o,this.state.context,this)),await((dt=(lt=this.options).onSuccess)==null?void 0:dt.call(lt,At,o,this.state.context)),await((mt=(ht=Ot(this,Or).config).onSettled)==null?void 0:mt.call(ht,At,null,this.state.variables,this.state.context,this)),await((pt=(ft=this.options).onSettled)==null?void 0:pt.call(ft,At,null,o,this.state.context)),mr(this,Qr,un).call(this,{type:"success",data:At}),At}catch(At){try{throw await((gt=(yt=Ot(this,Or).config).onError)==null?void 0:gt.call(yt,At,o,this.state.context,this)),await((xt=(bt=this.options).onError)==null?void 0:xt.call(bt,At,o,this.state.context)),await((Et=(vt=Ot(this,Or).config).onSettled)==null?void 0:Et.call(vt,void 0,At,this.state.variables,this.state.context,this)),await((St=(Ct=this.options).onSettled)==null?void 0:St.call(Ct,void 0,At,o,this.state.context)),At}finally{mr(this,Qr,un).call(this,{type:"error",error:At})}}finally{Ot(this,Or).runNext(this)}}},Kr=new WeakMap,Or=new WeakMap,Tn=new WeakMap,Qr=new WeakSet,un=function(o){const tt=rt=>{switch(o.type){case"failed":return{...rt,failureCount:o.failureCount,failureReason:o.error};case"pause":return{...rt,isPaused:!0};case"continue":return{...rt,isPaused:!1};case"pending":return{...rt,context:o.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:o.isPaused,status:"pending",variables:o.variables,submittedAt:Date.now()};case"success":return{...rt,data:o.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...rt,data:void 0,error:o.error,failureCount:rt.failureCount+1,failureReason:o.error,isPaused:!1,status:"error"}}};this.state=tt(this.state),notifyManager.batch(()=>{Ot(this,Kr).forEach(rt=>{rt.onMutationUpdate(o)}),Ot(this,Or).notify({mutation:this,type:"updated",action:o})})},qs);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var zr,so,Ks,MutationCache=(Ks=class extends Subscribable{constructor(o={}){super();fr(this,zr);fr(this,so);this.config=o,lr(this,zr,new Map),lr(this,so,Date.now())}build(o,tt,rt){const nt=new Mutation({mutationCache:this,mutationId:++Cn(this,so)._,options:o.defaultMutationOptions(tt),state:rt});return this.add(nt),nt}add(o){const tt=scopeFor(o),rt=Ot(this,zr).get(tt)??[];rt.push(o),Ot(this,zr).set(tt,rt),this.notify({type:"added",mutation:o})}remove(o){var rt;const tt=scopeFor(o);if(Ot(this,zr).has(tt)){const nt=(rt=Ot(this,zr).get(tt))==null?void 0:rt.filter(ot=>ot!==o);nt&&(nt.length===0?Ot(this,zr).delete(tt):Ot(this,zr).set(tt,nt))}this.notify({type:"removed",mutation:o})}canRun(o){var rt;const tt=(rt=Ot(this,zr).get(scopeFor(o)))==null?void 0:rt.find(nt=>nt.state.status==="pending");return!tt||tt===o}runNext(o){var rt;const tt=(rt=Ot(this,zr).get(scopeFor(o)))==null?void 0:rt.find(nt=>nt!==o&&nt.state.isPaused);return(tt==null?void 0:tt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(o=>{this.remove(o)})})}getAll(){return[...Ot(this,zr).values()].flat()}find(o){const tt={exact:!0,...o};return this.getAll().find(rt=>matchMutation(tt,rt))}findAll(o={}){return this.getAll().filter(tt=>matchMutation(o,tt))}notify(o){notifyManager.batch(()=>{this.listeners.forEach(tt=>{tt(o)})})}resumePausedMutations(){const o=this.getAll().filter(tt=>tt.state.isPaused);return notifyManager.batch(()=>Promise.all(o.map(tt=>tt.continue().catch(noop$4))))}},zr=new WeakMap,so=new WeakMap,Ks);function scopeFor(et){var o;return((o=et.options.scope)==null?void 0:o.id)??String(et.mutationId)}function infiniteQueryBehavior(et){return{onFetch:(o,tt)=>{var lt,dt,ht,mt,ft;const rt=o.options,nt=(ht=(dt=(lt=o.fetchOptions)==null?void 0:lt.meta)==null?void 0:dt.fetchMore)==null?void 0:ht.direction,ot=((mt=o.state.data)==null?void 0:mt.pages)||[],it=((ft=o.state.data)==null?void 0:ft.pageParams)||[];let st={pages:[],pageParams:[]},at=0;const ct=async()=>{let pt=!1;const yt=xt=>{Object.defineProperty(xt,"signal",{enumerable:!0,get:()=>(o.signal.aborted?pt=!0:o.signal.addEventListener("abort",()=>{pt=!0}),o.signal)})},gt=ensureQueryFn(o.options,o.fetchOptions),bt=async(xt,vt,Et)=>{if(pt)return Promise.reject();if(vt==null&&xt.pages.length)return Promise.resolve(xt);const Ct={queryKey:o.queryKey,pageParam:vt,direction:Et?"backward":"forward",meta:o.options.meta};yt(Ct);const St=await gt(Ct),{maxPages:At}=o.options,kt=Et?addToStart:addToEnd;return{pages:kt(xt.pages,St,At),pageParams:kt(xt.pageParams,vt,At)}};if(nt&&ot.length){const xt=nt==="backward",vt=xt?getPreviousPageParam:getNextPageParam,Et={pages:ot,pageParams:it},Ct=vt(rt,Et);st=await bt(Et,Ct,xt)}else{const xt=et??ot.length;do{const vt=at===0?it[0]??rt.initialPageParam:getNextPageParam(rt,st);if(at>0&&vt==null)break;st=await bt(st,vt),at++}while(at{var pt,yt;return(yt=(pt=o.options).persister)==null?void 0:yt.call(pt,ct,{queryKey:o.queryKey,meta:o.options.meta,signal:o.signal},tt)}:o.fetchFn=ct}}}function getNextPageParam(et,{pages:o,pageParams:tt}){const rt=o.length-1;return o.length>0?et.getNextPageParam(o[rt],o,tt[rt],tt):void 0}function getPreviousPageParam(et,{pages:o,pageParams:tt}){var rt;return o.length>0?(rt=et.getPreviousPageParam)==null?void 0:rt.call(et,o[0],o,tt[0],tt):void 0}var Pr,pn,mn,Vn,Hn,gn,Wn,Gn,Qs,QueryClient=(Qs=class{constructor(et={}){fr(this,Pr);fr(this,pn);fr(this,mn);fr(this,Vn);fr(this,Hn);fr(this,gn);fr(this,Wn);fr(this,Gn);lr(this,Pr,et.queryCache||new QueryCache),lr(this,pn,et.mutationCache||new MutationCache),lr(this,mn,et.defaultOptions||{}),lr(this,Vn,new Map),lr(this,Hn,new Map),lr(this,gn,0)}mount(){Cn(this,gn)._++,Ot(this,gn)===1&&(lr(this,Wn,focusManager.subscribe(async et=>{et&&(await this.resumePausedMutations(),Ot(this,Pr).onFocus())})),lr(this,Gn,onlineManager.subscribe(async et=>{et&&(await this.resumePausedMutations(),Ot(this,Pr).onOnline())})))}unmount(){var et,o;Cn(this,gn)._--,Ot(this,gn)===0&&((et=Ot(this,Wn))==null||et.call(this),lr(this,Wn,void 0),(o=Ot(this,Gn))==null||o.call(this),lr(this,Gn,void 0))}isFetching(et){return Ot(this,Pr).findAll({...et,fetchStatus:"fetching"}).length}isMutating(et){return Ot(this,pn).findAll({...et,status:"pending"}).length}getQueryData(et){var tt;const o=this.defaultQueryOptions({queryKey:et});return(tt=Ot(this,Pr).get(o.queryHash))==null?void 0:tt.state.data}ensureQueryData(et){const o=this.getQueryData(et.queryKey);if(o===void 0)return this.fetchQuery(et);{const tt=this.defaultQueryOptions(et),rt=Ot(this,Pr).build(this,tt);return et.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(tt.staleTime,rt))&&this.prefetchQuery(tt),Promise.resolve(o)}}getQueriesData(et){return Ot(this,Pr).findAll(et).map(({queryKey:o,state:tt})=>{const rt=tt.data;return[o,rt]})}setQueryData(et,o,tt){const rt=this.defaultQueryOptions({queryKey:et}),nt=Ot(this,Pr).get(rt.queryHash),ot=nt==null?void 0:nt.state.data,it=functionalUpdate(o,ot);if(it!==void 0)return Ot(this,Pr).build(this,rt).setData(it,{...tt,manual:!0})}setQueriesData(et,o,tt){return notifyManager.batch(()=>Ot(this,Pr).findAll(et).map(({queryKey:rt})=>[rt,this.setQueryData(rt,o,tt)]))}getQueryState(et){var tt;const o=this.defaultQueryOptions({queryKey:et});return(tt=Ot(this,Pr).get(o.queryHash))==null?void 0:tt.state}removeQueries(et){const o=Ot(this,Pr);notifyManager.batch(()=>{o.findAll(et).forEach(tt=>{o.remove(tt)})})}resetQueries(et,o){const tt=Ot(this,Pr),rt={type:"active",...et};return notifyManager.batch(()=>(tt.findAll(et).forEach(nt=>{nt.reset()}),this.refetchQueries(rt,o)))}cancelQueries(et={},o={}){const tt={revert:!0,...o},rt=notifyManager.batch(()=>Ot(this,Pr).findAll(et).map(nt=>nt.cancel(tt)));return Promise.all(rt).then(noop$4).catch(noop$4)}invalidateQueries(et={},o={}){return notifyManager.batch(()=>{if(Ot(this,Pr).findAll(et).forEach(rt=>{rt.invalidate()}),et.refetchType==="none")return Promise.resolve();const tt={...et,type:et.refetchType??et.type??"active"};return this.refetchQueries(tt,o)})}refetchQueries(et={},o){const tt={...o,cancelRefetch:(o==null?void 0:o.cancelRefetch)??!0},rt=notifyManager.batch(()=>Ot(this,Pr).findAll(et).filter(nt=>!nt.isDisabled()).map(nt=>{let ot=nt.fetch(void 0,tt);return tt.throwOnError||(ot=ot.catch(noop$4)),nt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(rt).then(noop$4)}fetchQuery(et){const o=this.defaultQueryOptions(et);o.retry===void 0&&(o.retry=!1);const tt=Ot(this,Pr).build(this,o);return tt.isStaleByTime(resolveStaleTime(o.staleTime,tt))?tt.fetch(o):Promise.resolve(tt.state.data)}prefetchQuery(et){return this.fetchQuery(et).then(noop$4).catch(noop$4)}fetchInfiniteQuery(et){return et.behavior=infiniteQueryBehavior(et.pages),this.fetchQuery(et)}prefetchInfiniteQuery(et){return this.fetchInfiniteQuery(et).then(noop$4).catch(noop$4)}ensureInfiniteQueryData(et){return et.behavior=infiniteQueryBehavior(et.pages),this.ensureQueryData(et)}resumePausedMutations(){return onlineManager.isOnline()?Ot(this,pn).resumePausedMutations():Promise.resolve()}getQueryCache(){return Ot(this,Pr)}getMutationCache(){return Ot(this,pn)}getDefaultOptions(){return Ot(this,mn)}setDefaultOptions(et){lr(this,mn,et)}setQueryDefaults(et,o){Ot(this,Vn).set(hashKey(et),{queryKey:et,defaultOptions:o})}getQueryDefaults(et){const o=[...Ot(this,Vn).values()];let tt={};return o.forEach(rt=>{partialMatchKey(et,rt.queryKey)&&(tt={...tt,...rt.defaultOptions})}),tt}setMutationDefaults(et,o){Ot(this,Hn).set(hashKey(et),{mutationKey:et,defaultOptions:o})}getMutationDefaults(et){const o=[...Ot(this,Hn).values()];let tt={};return o.forEach(rt=>{partialMatchKey(et,rt.mutationKey)&&(tt={...tt,...rt.defaultOptions})}),tt}defaultQueryOptions(et){if(et._defaulted)return et;const o={...Ot(this,mn).queries,...this.getQueryDefaults(et.queryKey),...et,_defaulted:!0};return o.queryHash||(o.queryHash=hashQueryKeyByOptions(o.queryKey,o)),o.refetchOnReconnect===void 0&&(o.refetchOnReconnect=o.networkMode!=="always"),o.throwOnError===void 0&&(o.throwOnError=!!o.suspense),!o.networkMode&&o.persister&&(o.networkMode="offlineFirst"),o.enabled!==!0&&o.queryFn===skipToken&&(o.enabled=!1),o}defaultMutationOptions(et){return et!=null&&et._defaulted?et:{...Ot(this,mn).mutations,...(et==null?void 0:et.mutationKey)&&this.getMutationDefaults(et.mutationKey),...et,_defaulted:!0}}clear(){Ot(this,Pr).clear(),Ot(this,pn).clear()}},Pr=new WeakMap,pn=new WeakMap,mn=new WeakMap,Vn=new WeakMap,Hn=new WeakMap,gn=new WeakMap,Wn=new WeakMap,Gn=new WeakMap,Qs),Br,Cr,ao,Mr,In,qn,bn,Xr,co,Kn,Qn,Pn,jn,yn,Xn,Rr,oo,Ts,Is,Ps,js,Ns,Ds,Ls,tu,Xs,QueryObserver=(Xs=class extends Subscribable{constructor(o,tt){super();fr(this,Rr);fr(this,Br);fr(this,Cr);fr(this,ao);fr(this,Mr);fr(this,In);fr(this,qn);fr(this,bn);fr(this,Xr);fr(this,co);fr(this,Kn);fr(this,Qn);fr(this,Pn);fr(this,jn);fr(this,yn);fr(this,Xn,new Set);this.options=tt,lr(this,Br,o),lr(this,Xr,null),lr(this,bn,pendingThenable()),this.options.experimental_prefetchInRender||Ot(this,bn).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(tt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Ot(this,Cr).addObserver(this),shouldFetchOnMount(Ot(this,Cr),this.options)?mr(this,Rr,oo).call(this):this.updateResult(),mr(this,Rr,js).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Ot(this,Cr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Ot(this,Cr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,mr(this,Rr,Ns).call(this),mr(this,Rr,Ds).call(this),Ot(this,Cr).removeObserver(this)}setOptions(o,tt){const rt=this.options,nt=Ot(this,Cr);if(this.options=Ot(this,Br).defaultQueryOptions(o),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Ot(this,Cr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");mr(this,Rr,Ls).call(this),Ot(this,Cr).setOptions(this.options),rt._defaulted&&!shallowEqualObjects(this.options,rt)&&Ot(this,Br).getQueryCache().notify({type:"observerOptionsUpdated",query:Ot(this,Cr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Ot(this,Cr),nt,this.options,rt)&&mr(this,Rr,oo).call(this),this.updateResult(tt),ot&&(Ot(this,Cr)!==nt||resolveEnabled(this.options.enabled,Ot(this,Cr))!==resolveEnabled(rt.enabled,Ot(this,Cr))||resolveStaleTime(this.options.staleTime,Ot(this,Cr))!==resolveStaleTime(rt.staleTime,Ot(this,Cr)))&&mr(this,Rr,Ts).call(this);const it=mr(this,Rr,Is).call(this);ot&&(Ot(this,Cr)!==nt||resolveEnabled(this.options.enabled,Ot(this,Cr))!==resolveEnabled(rt.enabled,Ot(this,Cr))||it!==Ot(this,yn))&&mr(this,Rr,Ps).call(this,it)}getOptimisticResult(o){const tt=Ot(this,Br).getQueryCache().build(Ot(this,Br),o),rt=this.createResult(tt,o);return shouldAssignObserverCurrentProperties(this,rt)&&(lr(this,Mr,rt),lr(this,qn,this.options),lr(this,In,Ot(this,Cr).state)),rt}getCurrentResult(){return Ot(this,Mr)}trackResult(o,tt){const rt={};return Object.keys(o).forEach(nt=>{Object.defineProperty(rt,nt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(nt),tt==null||tt(nt),o[nt])})}),rt}trackProp(o){Ot(this,Xn).add(o)}getCurrentQuery(){return Ot(this,Cr)}refetch({...o}={}){return this.fetch({...o})}fetchOptimistic(o){const tt=Ot(this,Br).defaultQueryOptions(o),rt=Ot(this,Br).getQueryCache().build(Ot(this,Br),tt);return rt.fetch().then(()=>this.createResult(rt,tt))}fetch(o){return mr(this,Rr,oo).call(this,{...o,cancelRefetch:o.cancelRefetch??!0}).then(()=>(this.updateResult(),Ot(this,Mr)))}createResult(o,tt){var At;const rt=Ot(this,Cr),nt=this.options,ot=Ot(this,Mr),it=Ot(this,In),st=Ot(this,qn),ct=o!==rt?o.state:Ot(this,ao),{state:lt}=o;let dt={...lt},ht=!1,mt;if(tt._optimisticResults){const kt=this.hasListeners(),It=!kt&&shouldFetchOnMount(o,tt),Nt=kt&&shouldFetchOptionally(o,rt,tt,nt);(It||Nt)&&(dt={...dt,...fetchState(lt.data,o.options)}),tt._optimisticResults==="isRestoring"&&(dt.fetchStatus="idle")}let{error:ft,errorUpdatedAt:pt,status:yt}=dt;if(tt.select&&dt.data!==void 0)if(ot&&dt.data===(it==null?void 0:it.data)&&tt.select===Ot(this,co))mt=Ot(this,Kn);else try{lr(this,co,tt.select),mt=tt.select(dt.data),mt=replaceData(ot==null?void 0:ot.data,mt,tt),lr(this,Kn,mt),lr(this,Xr,null)}catch(kt){lr(this,Xr,kt)}else mt=dt.data;if(tt.placeholderData!==void 0&&mt===void 0&&yt==="pending"){let kt;if(ot!=null&&ot.isPlaceholderData&&tt.placeholderData===(st==null?void 0:st.placeholderData))kt=ot.data;else if(kt=typeof tt.placeholderData=="function"?tt.placeholderData((At=Ot(this,Qn))==null?void 0:At.state.data,Ot(this,Qn)):tt.placeholderData,tt.select&&kt!==void 0)try{kt=tt.select(kt),lr(this,Xr,null)}catch(It){lr(this,Xr,It)}kt!==void 0&&(yt="success",mt=replaceData(ot==null?void 0:ot.data,kt,tt),ht=!0)}Ot(this,Xr)&&(ft=Ot(this,Xr),mt=Ot(this,Kn),pt=Date.now(),yt="error");const gt=dt.fetchStatus==="fetching",bt=yt==="pending",xt=yt==="error",vt=bt&>,Et=mt!==void 0,St={status:yt,fetchStatus:dt.fetchStatus,isPending:bt,isSuccess:yt==="success",isError:xt,isInitialLoading:vt,isLoading:vt,data:mt,dataUpdatedAt:dt.dataUpdatedAt,error:ft,errorUpdatedAt:pt,failureCount:dt.fetchFailureCount,failureReason:dt.fetchFailureReason,errorUpdateCount:dt.errorUpdateCount,isFetched:dt.dataUpdateCount>0||dt.errorUpdateCount>0,isFetchedAfterMount:dt.dataUpdateCount>ct.dataUpdateCount||dt.errorUpdateCount>ct.errorUpdateCount,isFetching:gt,isRefetching:gt&&!bt,isLoadingError:xt&&!Et,isPaused:dt.fetchStatus==="paused",isPlaceholderData:ht,isRefetchError:xt&&Et,isStale:isStale(o,tt),refetch:this.refetch,promise:Ot(this,bn)};if(this.options.experimental_prefetchInRender){const kt=Lt=>{St.status==="error"?Lt.reject(St.error):St.data!==void 0&&Lt.resolve(St.data)},It=()=>{const Lt=lr(this,bn,St.promise=pendingThenable());kt(Lt)},Nt=Ot(this,bn);switch(Nt.status){case"pending":o.queryHash===rt.queryHash&&kt(Nt);break;case"fulfilled":(St.status==="error"||St.data!==Nt.value)&&It();break;case"rejected":(St.status!=="error"||St.error!==Nt.reason)&&It();break}}return St}updateResult(o){const tt=Ot(this,Mr),rt=this.createResult(Ot(this,Cr),this.options);if(lr(this,In,Ot(this,Cr).state),lr(this,qn,this.options),Ot(this,In).data!==void 0&&lr(this,Qn,Ot(this,Cr)),shallowEqualObjects(rt,tt))return;lr(this,Mr,rt);const nt={},ot=()=>{if(!tt)return!0;const{notifyOnChangeProps:it}=this.options,st=typeof it=="function"?it():it;if(st==="all"||!st&&!Ot(this,Xn).size)return!0;const at=new Set(st??Ot(this,Xn));return this.options.throwOnError&&at.add("error"),Object.keys(Ot(this,Mr)).some(ct=>{const lt=ct;return Ot(this,Mr)[lt]!==tt[lt]&&at.has(lt)})};(o==null?void 0:o.listeners)!==!1&&ot()&&(nt.listeners=!0),mr(this,Rr,tu).call(this,{...nt,...o})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&mr(this,Rr,js).call(this)}},Br=new WeakMap,Cr=new WeakMap,ao=new WeakMap,Mr=new WeakMap,In=new WeakMap,qn=new WeakMap,bn=new WeakMap,Xr=new WeakMap,co=new WeakMap,Kn=new WeakMap,Qn=new WeakMap,Pn=new WeakMap,jn=new WeakMap,yn=new WeakMap,Xn=new WeakMap,Rr=new WeakSet,oo=function(o){mr(this,Rr,Ls).call(this);let tt=Ot(this,Cr).fetch(this.options,o);return o!=null&&o.throwOnError||(tt=tt.catch(noop$4)),tt},Ts=function(){mr(this,Rr,Ns).call(this);const o=resolveStaleTime(this.options.staleTime,Ot(this,Cr));if(isServer||Ot(this,Mr).isStale||!isValidTimeout(o))return;const rt=timeUntilStale(Ot(this,Mr).dataUpdatedAt,o)+1;lr(this,Pn,setTimeout(()=>{Ot(this,Mr).isStale||this.updateResult()},rt))},Is=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Ot(this,Cr)):this.options.refetchInterval)??!1},Ps=function(o){mr(this,Rr,Ds).call(this),lr(this,yn,o),!(isServer||resolveEnabled(this.options.enabled,Ot(this,Cr))===!1||!isValidTimeout(Ot(this,yn))||Ot(this,yn)===0)&&lr(this,jn,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&mr(this,Rr,oo).call(this)},Ot(this,yn)))},js=function(){mr(this,Rr,Ts).call(this),mr(this,Rr,Ps).call(this,mr(this,Rr,Is).call(this))},Ns=function(){Ot(this,Pn)&&(clearTimeout(Ot(this,Pn)),lr(this,Pn,void 0))},Ds=function(){Ot(this,jn)&&(clearInterval(Ot(this,jn)),lr(this,jn,void 0))},Ls=function(){const o=Ot(this,Br).getQueryCache().build(Ot(this,Br),this.options);if(o===Ot(this,Cr))return;const tt=Ot(this,Cr);lr(this,Cr,o),lr(this,ao,o.state),this.hasListeners()&&(tt==null||tt.removeObserver(this),o.addObserver(this))},tu=function(o){notifyManager.batch(()=>{o.listeners&&this.listeners.forEach(tt=>{tt(Ot(this,Mr))}),Ot(this,Br).getQueryCache().notify({query:Ot(this,Cr),type:"observerResultsUpdated"})})},Xs);function shouldLoadOnMount(et,o){return resolveEnabled(o.enabled,et)!==!1&&et.state.data===void 0&&!(et.state.status==="error"&&o.retryOnMount===!1)}function shouldFetchOnMount(et,o){return shouldLoadOnMount(et,o)||et.state.data!==void 0&&shouldFetchOn(et,o,o.refetchOnMount)}function shouldFetchOn(et,o,tt){if(resolveEnabled(o.enabled,et)!==!1){const rt=typeof tt=="function"?tt(et):tt;return rt==="always"||rt!==!1&&isStale(et,o)}return!1}function shouldFetchOptionally(et,o,tt,rt){return(et!==o||resolveEnabled(rt.enabled,et)===!1)&&(!tt.suspense||et.state.status!=="error")&&isStale(et,tt)}function isStale(et,o){return resolveEnabled(o.enabled,et)!==!1&&et.isStaleByTime(resolveStaleTime(o.staleTime,et))}function shouldAssignObserverCurrentProperties(et,o){return!shallowEqualObjects(et.getCurrentResult(),o)}var xn,vn,Fr,sn,ln,Jo,Os,Ys,MutationObserver$1=(Ys=class extends Subscribable{constructor(tt,rt){super();fr(this,ln);fr(this,xn);fr(this,vn);fr(this,Fr);fr(this,sn);lr(this,xn,tt),this.setOptions(rt),this.bindMethods(),mr(this,ln,Jo).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(tt){var nt;const rt=this.options;this.options=Ot(this,xn).defaultMutationOptions(tt),shallowEqualObjects(this.options,rt)||Ot(this,xn).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Ot(this,Fr),observer:this}),rt!=null&&rt.mutationKey&&this.options.mutationKey&&hashKey(rt.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Ot(this,Fr))==null?void 0:nt.state.status)==="pending"&&Ot(this,Fr).setOptions(this.options)}onUnsubscribe(){var tt;this.hasListeners()||(tt=Ot(this,Fr))==null||tt.removeObserver(this)}onMutationUpdate(tt){mr(this,ln,Jo).call(this),mr(this,ln,Os).call(this,tt)}getCurrentResult(){return Ot(this,vn)}reset(){var tt;(tt=Ot(this,Fr))==null||tt.removeObserver(this),lr(this,Fr,void 0),mr(this,ln,Jo).call(this),mr(this,ln,Os).call(this)}mutate(tt,rt){var nt;return lr(this,sn,rt),(nt=Ot(this,Fr))==null||nt.removeObserver(this),lr(this,Fr,Ot(this,xn).getMutationCache().build(Ot(this,xn),this.options)),Ot(this,Fr).addObserver(this),Ot(this,Fr).execute(tt)}},xn=new WeakMap,vn=new WeakMap,Fr=new WeakMap,sn=new WeakMap,ln=new WeakSet,Jo=function(){var rt;const tt=((rt=Ot(this,Fr))==null?void 0:rt.state)??getDefaultState();lr(this,vn,{...tt,isPending:tt.status==="pending",isSuccess:tt.status==="success",isError:tt.status==="error",isIdle:tt.status==="idle",mutate:this.mutate,reset:this.reset})},Os=function(tt){notifyManager.batch(()=>{var rt,nt,ot,it,st,at,ct,lt;if(Ot(this,sn)&&this.hasListeners()){const dt=Ot(this,vn).variables,ht=Ot(this,vn).context;(tt==null?void 0:tt.type)==="success"?((nt=(rt=Ot(this,sn)).onSuccess)==null||nt.call(rt,tt.data,dt,ht),(it=(ot=Ot(this,sn)).onSettled)==null||it.call(ot,tt.data,null,dt,ht)):(tt==null?void 0:tt.type)==="error"&&((at=(st=Ot(this,sn)).onError)==null||at.call(st,tt.error,dt,ht),(lt=(ct=Ot(this,sn)).onSettled)==null||lt.call(ct,void 0,tt.error,dt,ht))}this.listeners.forEach(dt=>{dt(Ot(this,vn))})})},Ys);function hashFn(et){return JSON.stringify(et,(o,tt)=>isPlainObject$2(tt)?Object.keys(tt).sort().reduce((rt,nt)=>(rt[nt]=tt[nt],rt),{}):typeof tt=="bigint"?tt.toString():tt)}function isPlainObject$2(et){if(!hasObjectPrototype(et))return!1;const o=et.constructor;if(typeof o>"u")return!0;const tt=o.prototype;return!(!hasObjectPrototype(tt)||!tt.hasOwnProperty("isPrototypeOf"))}function hasObjectPrototype(et){return Object.prototype.toString.call(et)==="[object Object]"}function filterQueryOptions(et){const{_defaulted:o,behavior:tt,gcTime:rt,initialData:nt,initialDataUpdatedAt:ot,maxPages:it,meta:st,networkMode:at,queryFn:ct,queryHash:lt,queryKey:dt,queryKeyHashFn:ht,retry:mt,retryDelay:ft,structuralSharing:pt,getPreviousPageParam:yt,getNextPageParam:gt,initialPageParam:bt,_optimisticResults:xt,enabled:vt,notifyOnChangeProps:Et,placeholderData:Ct,refetchInterval:St,refetchIntervalInBackground:At,refetchOnMount:kt,refetchOnReconnect:It,refetchOnWindowFocus:Nt,retryOnMount:Lt,select:Mt,staleTime:zt,suspense:Ut,throwOnError:Xt,config:Wt,connector:Ft,query:qt,...Pt}=et;return Pt}function connectMutationOptions(et){return{mutationFn(o){return connect$1(et,o)},mutationKey:["connect"]}}function disconnectMutationOptions(et){return{mutationFn(o){return disconnect(et,o)},mutationKey:["disconnect"]}}function getBalanceQueryOptions(et,o={}){return{async queryFn({queryKey:tt}){const{address:rt,scopeKey:nt,...ot}=tt[1];if(!rt)throw new Error("address is required");return await getBalance(et,{...ot,address:rt})??null},queryKey:getBalanceQueryKey(o)}}function getBalanceQueryKey(et={}){return["balance",filterQueryOptions(et)]}function getBlockNumberQueryOptions(et,o={}){return{gcTime:0,async queryFn({queryKey:tt}){const{scopeKey:rt,...nt}=tt[1];return await getBlockNumber(et,nt)??null},queryKey:getBlockNumberQueryKey(o)}}function getBlockNumberQueryKey(et={}){return["blockNumber",filterQueryOptions(et)]}function getEnsAddressQueryOptions(et,o={}){return{async queryFn({queryKey:tt}){const{name:rt,scopeKey:nt,...ot}=tt[1];if(!rt)throw new Error("name is required");return getEnsAddress(et,{...ot,name:rt})},queryKey:getEnsAddressQueryKey(o)}}function getEnsAddressQueryKey(et={}){return["ensAddress",filterQueryOptions(et)]}function getEnsAvatarQueryOptions(et,o={}){return{async queryFn({queryKey:tt}){const{name:rt,scopeKey:nt,...ot}=tt[1];if(!rt)throw new Error("name is required");return getEnsAvatar(et,{...ot,name:rt})},queryKey:getEnsAvatarQueryKey(o)}}function getEnsAvatarQueryKey(et={}){return["ensAvatar",filterQueryOptions(et)]}function getEnsNameQueryOptions(et,o={}){return{async queryFn({queryKey:tt}){const{address:rt,scopeKey:nt,...ot}=tt[1];if(!rt)throw new Error("address is required");return getEnsName(et,{...ot,address:rt})},queryKey:getEnsNameQueryKey(o)}}function getEnsNameQueryKey(et={}){return["ensName",filterQueryOptions(et)]}function signMessageMutationOptions(et){return{mutationFn(o){return signMessage(et,o)},mutationKey:["signMessage"]}}function switchChainMutationOptions(et){return{mutationFn(o){return switchChain(et,o)},mutationKey:["switchChain"]}}var QueryClientContext=reactExports.createContext(void 0),useQueryClient=et=>{const o=reactExports.useContext(QueryClientContext);if(!o)throw new Error("No QueryClient set, use QueryClientProvider to set one");return o},QueryClientProvider=({client:et,children:o})=>(reactExports.useEffect(()=>(et.mount(),()=>{et.unmount()}),[et]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:et,children:o})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let et=!1;return{clearReset:()=>{et=!1},reset:()=>{et=!0},isReset:()=>et}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(et,o){return typeof et=="function"?et(...o):!!et}function noop$3(){}var ensurePreventErrorBoundaryRetry=(et,o)=>{(et.suspense||et.throwOnError)&&(o.isReset()||(et.retryOnMount=!1))},useClearResetErrorBoundary=et=>{reactExports.useEffect(()=>{et.clearReset()},[et])},getHasError=({result:et,errorResetBoundary:o,throwOnError:tt,query:rt})=>et.isError&&!o.isReset()&&!et.isFetching&&rt&&shouldThrowError(tt,[et.error,rt]),ensureSuspenseTimers=et=>{et.suspense&&(et.staleTime===void 0&&(et.staleTime=1e3),typeof et.gcTime=="number"&&(et.gcTime=Math.max(et.gcTime,1e3)))},willFetch=(et,o)=>et.isLoading&&et.isFetching&&!o,shouldSuspend=(et,o)=>(et==null?void 0:et.suspense)&&o.isPending,fetchOptimistic=(et,o,tt)=>o.fetchOptimistic(et).catch(()=>{tt.clearReset()});function useBaseQuery(et,o,tt){var lt,dt,ht,mt,ft;const rt=useQueryClient(),nt=useIsRestoring(),ot=useQueryErrorResetBoundary(),it=rt.defaultQueryOptions(et);(dt=(lt=rt.getDefaultOptions().queries)==null?void 0:lt._experimental_beforeQuery)==null||dt.call(lt,it),it._optimisticResults=nt?"isRestoring":"optimistic",ensureSuspenseTimers(it),ensurePreventErrorBoundaryRetry(it,ot),useClearResetErrorBoundary(ot);const st=!rt.getQueryCache().get(it.queryHash),[at]=reactExports.useState(()=>new o(rt,it)),ct=at.getOptimisticResult(it);if(reactExports.useSyncExternalStore(reactExports.useCallback(pt=>{const yt=nt?()=>{}:at.subscribe(notifyManager.batchCalls(pt));return at.updateResult(),yt},[at,nt]),()=>at.getCurrentResult(),()=>at.getCurrentResult()),reactExports.useEffect(()=>{at.setOptions(it,{listeners:!1})},[it,at]),shouldSuspend(it,ct))throw fetchOptimistic(it,at,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:it.throwOnError,query:rt.getQueryCache().get(it.queryHash)}))throw ct.error;if((mt=(ht=rt.getDefaultOptions().queries)==null?void 0:ht._experimental_afterQuery)==null||mt.call(ht,it,ct),it.experimental_prefetchInRender&&!isServer&&willFetch(ct,nt)){const pt=st?fetchOptimistic(it,at,ot):(ft=rt.getQueryCache().get(it.queryHash))==null?void 0:ft.promise;pt==null||pt.catch(noop$3).finally(()=>{at.hasListeners()||at.updateResult()})}return it.notifyOnChangeProps?ct:at.trackResult(ct)}function useQuery$1(et,o){return useBaseQuery(et,QueryObserver)}function useMutation(et,o){const tt=useQueryClient(),[rt]=reactExports.useState(()=>new MutationObserver$1(tt,et));reactExports.useEffect(()=>{rt.setOptions(et)},[rt,et]);const nt=reactExports.useSyncExternalStore(reactExports.useCallback(it=>rt.subscribe(notifyManager.batchCalls(it)),[rt]),()=>rt.getCurrentResult(),()=>rt.getCurrentResult()),ot=reactExports.useCallback((it,st)=>{rt.mutate(it,st).catch(noop$3)},[rt]);if(nt.error&&shouldThrowError(rt.options.throwOnError,[nt.error]))throw nt.error;return{...nt,mutate:ot,mutateAsync:nt.mutate}}function useQuery(et){const o=useQuery$1({...et,queryKeyHashFn:hashFn});return o.queryKey=et.queryKey,o}function useChainId(et={}){const o=useConfig(et);return reactExports.useSyncExternalStore(tt=>watchChainId(o,{onChange:tt}),()=>getChainId(o),()=>getChainId(o))}function useBalance(et={}){const{address:o,query:tt={}}=et,rt=useConfig(et),nt=useChainId({config:rt}),ot=getBalanceQueryOptions(rt,{...et,chainId:et.chainId??nt}),it=!!(o&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useWatchBlockNumber(et={}){const{enabled:o=!0,onBlockNumber:tt,config:rt,...nt}=et,ot=useConfig(et),it=useChainId({config:ot}),st=et.chainId??it;reactExports.useEffect(()=>{if(o&&tt)return watchBlockNumber(ot,{...nt,chainId:st,onBlockNumber:tt})},[st,ot,o,tt,nt.onError,nt.emitMissed,nt.emitOnBegin,nt.poll,nt.pollingInterval,nt.syncConnectedChain])}function useBlockNumber(et={}){const{query:o={},watch:tt}=et,rt=useConfig(et),nt=useQueryClient(),ot=useChainId({config:rt}),it=et.chainId??ot,st=getBlockNumberQueryOptions(rt,{...et,chainId:it});return useWatchBlockNumber({config:et.config,chainId:et.chainId,...typeof tt=="object"?tt:{},enabled:!!((o.enabled??!0)&&(typeof tt=="object"?tt.enabled:tt)),onBlockNumber(at){nt.setQueryData(st.queryKey,at)}}),useQuery({...o,...st})}function useChains$1(et={}){const o=useConfig(et);return reactExports.useSyncExternalStore(tt=>watchChains(o,{onChange:tt}),()=>getChains(o),()=>getChains(o))}function useConnectors$1(et={}){const o=useConfig(et);return reactExports.useSyncExternalStore(tt=>watchConnectors(o,{onChange:tt}),()=>getConnectors(o),()=>getConnectors(o))}function useConnect$1(et={}){const{mutation:o}=et,tt=useConfig(et),rt=connectMutationOptions(tt),{mutate:nt,mutateAsync:ot,...it}=useMutation({...o,...rt});return reactExports.useEffect(()=>tt.subscribe(({status:st})=>st,(st,at)=>{at==="connected"&&st==="disconnected"&&it.reset()}),[tt,it.reset]),{...it,connect:nt,connectAsync:ot,connectors:useConnectors$1({config:tt})}}function useConnections(et={}){const o=useConfig(et);return reactExports.useSyncExternalStore(tt=>watchConnections(o,{onChange:tt}),()=>getConnections(o),()=>getConnections(o))}function useDisconnect(et={}){const{mutation:o}=et,tt=useConfig(et),rt=disconnectMutationOptions(tt),{mutate:nt,mutateAsync:ot,...it}=useMutation({...o,...rt});return{...it,connectors:useConnections({config:tt}).map(st=>st.connector),disconnect:nt,disconnectAsync:ot}}function useEnsAddress(et={}){const{name:o,query:tt={}}=et,rt=useConfig(et),nt=useChainId({config:rt}),ot=getEnsAddressQueryOptions(rt,{...et,chainId:et.chainId??nt}),it=!!(o&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useEnsAvatar(et={}){const{name:o,query:tt={}}=et,rt=useConfig(et),nt=useChainId({config:rt}),ot=getEnsAvatarQueryOptions(rt,{...et,chainId:et.chainId??nt}),it=!!(o&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useEnsName(et={}){const{address:o,query:tt={}}=et,rt=useConfig(et),nt=useChainId({config:rt}),ot=getEnsNameQueryOptions(rt,{...et,chainId:et.chainId??nt}),it=!!(o&&(tt.enabled??!0));return useQuery({...tt,...ot,enabled:it})}function useSignMessage(et={}){const{mutation:o}=et,tt=useConfig(et),rt=signMessageMutationOptions(tt),{mutate:nt,mutateAsync:ot,...it}=useMutation({...o,...rt});return{...it,signMessage:nt,signMessageAsync:ot}}function useSwitchChain(et={}){const{mutation:o}=et,tt=useConfig(et),rt=switchChainMutationOptions(tt),{mutate:nt,mutateAsync:ot,...it}=useMutation({...o,...rt});return{...it,chains:useChains$1({config:tt}),switchChain:nt,switchChainAsync:ot}}const contracts={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},formatters={block:defineBlock({format(et){var tt;return{transactions:(tt=et.transactions)==null?void 0:tt.map(rt=>{if(typeof rt=="string")return rt;const nt=formatTransaction(rt);return nt.typeHex==="0x7e"&&(nt.isSystemTx=rt.isSystemTx,nt.mint=rt.mint?hexToBigInt(rt.mint):void 0,nt.sourceHash=rt.sourceHash,nt.type="deposit"),nt}),stateRoot:et.stateRoot}}}),transaction:defineTransaction({format(et){const o={};return et.type==="0x7e"&&(o.isSystemTx=et.isSystemTx,o.mint=et.mint?hexToBigInt(et.mint):void 0,o.sourceHash=et.sourceHash,o.type="deposit"),o}}),transactionReceipt:defineTransactionReceipt({format(et){return{l1GasPrice:et.l1GasPrice?hexToBigInt(et.l1GasPrice):null,l1GasUsed:et.l1GasUsed?hexToBigInt(et.l1GasUsed):null,l1Fee:et.l1Fee?hexToBigInt(et.l1Fee):null,l1FeeScalar:et.l1FeeScalar?Number(et.l1FeeScalar):null}}})};function serializeTransaction(et,o){return isDeposit(et)?serializeTransactionDeposit(et):serializeTransaction$1(et,o)}const serializers={transaction:serializeTransaction};function serializeTransactionDeposit(et){assertTransactionDeposit(et);const{sourceHash:o,data:tt,from:rt,gas:nt,isSystemTx:ot,mint:it,to:st,value:at}=et,ct=[o,rt,st??"0x",it?toHex(it):"0x",at?toHex(at):"0x",nt?toHex(nt):"0x",ot?"0x1":"0x",tt??"0x"];return concatHex(["0x7e",toRlp(ct)])}function isDeposit(et){return et.type==="deposit"||typeof et.sourceHash<"u"}function assertTransactionDeposit(et){const{from:o,to:tt}=et;if(o&&!isAddress(o))throw new InvalidAddressError({address:o});if(tt&&!isAddress(tt))throw new InvalidAddressError({address:tt})}const chainConfig={contracts,formatters,serializers},arbitrum=defineChain({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),mainnet=defineChain({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://cloudflare-eth.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensRegistry:{address:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},ensUniversalResolver:{address:"0xce01f8eee7E479C928F8919abD53E553a36CeF67",blockCreated:19258213},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),sourceId=1,optimism=defineChain({...chainConfig,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...chainConfig.contracts,disputeGameFactory:{[sourceId]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[sourceId]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[sourceId]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[sourceId]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId}),polygon=defineChain({id:137,name:"Polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.polygonscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}});coinbaseWallet.type="coinbaseWallet";function coinbaseWallet(et={}){return et.version==="3"||et.headlessMode?version3(et):version4(et)}function version4(et){let o,tt,rt,nt,ot;return it=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:coinbaseWallet.type,async connect({chainId:st}={}){try{const at=await this.getProvider(),ct=(await at.request({method:"eth_requestAccounts"})).map(dt=>getAddress(dt));rt||(rt=this.onAccountsChanged.bind(this),at.on("accountsChanged",rt)),nt||(nt=this.onChainChanged.bind(this),at.on("chainChanged",nt)),ot||(ot=this.onDisconnect.bind(this),at.on("disconnect",ot));let lt=await this.getChainId();if(st&<!==st){const dt=await this.switchChain({chainId:st}).catch(ht=>{if(ht.code===UserRejectedRequestError.code)throw ht;return{id:lt}});lt=(dt==null?void 0:dt.id)??lt}return{accounts:ct,chainId:lt}}catch(at){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(at.message)?new UserRejectedRequestError(at):at}},async disconnect(){var at;const st=await this.getProvider();rt&&(st.removeListener("accountsChanged",rt),rt=void 0),nt&&(st.removeListener("chainChanged",nt),nt=void 0),ot&&(st.removeListener("disconnect",ot),ot=void 0),st.disconnect(),(at=st.close)==null||at.call(st)},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(at=>getAddress(at))},async getChainId(){const at=await(await this.getProvider()).request({method:"eth_chainId"});return Number(at)},async getProvider(){if(!tt){const st=await(async()=>{const{default:at}=await __vitePreload(async()=>{const{default:ct}=await import("./index-D8m_BJXT.js").then(lt=>lt.i);return{default:ct}},__vite__mapDeps([0,1,2,3]));return typeof at!="function"&&typeof at.default=="function"?at.default:at})();o=new st({...et,appChainIds:it.chains.map(at=>at.id)}),tt=o.makeWeb3Provider({...et,options:et.preference??"all"})}return tt},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:st,chainId:at}){var dt,ht,mt,ft;const ct=it.chains.find(pt=>pt.id===at);if(!ct)throw new SwitchChainError(new ChainNotConfiguredError);const lt=await this.getProvider();try{return await lt.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(ct.id)}]}),ct}catch(pt){if(pt.code===4902)try{let yt;st!=null&&st.blockExplorerUrls?yt=st.blockExplorerUrls:yt=(dt=ct.blockExplorers)!=null&&dt.default.url?[(ht=ct.blockExplorers)==null?void 0:ht.default.url]:[];let gt;(mt=st==null?void 0:st.rpcUrls)!=null&&mt.length?gt=st.rpcUrls:gt=[((ft=ct.rpcUrls.default)==null?void 0:ft.http[0])??""];const bt={blockExplorerUrls:yt,chainId:numberToHex(at),chainName:(st==null?void 0:st.chainName)??ct.name,iconUrls:st==null?void 0:st.iconUrls,nativeCurrency:(st==null?void 0:st.nativeCurrency)??ct.nativeCurrency,rpcUrls:gt};return await lt.request({method:"wallet_addEthereumChain",params:[bt]}),ct}catch(yt){throw new UserRejectedRequestError(yt)}throw new SwitchChainError(pt)}},onAccountsChanged(st){st.length===0?this.onDisconnect():it.emitter.emit("change",{accounts:st.map(at=>getAddress(at))})},onChainChanged(st){const at=Number(st);it.emitter.emit("change",{chainId:at})},async onDisconnect(st){it.emitter.emit("disconnect");const at=await this.getProvider();rt&&(at.removeListener("accountsChanged",rt),rt=void 0),nt&&(at.removeListener("chainChanged",nt),nt=void 0),ot&&(at.removeListener("disconnect",ot),ot=void 0)}})}function version3(et){let tt,rt,nt,ot,it;return st=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",supportsSimulation:!0,type:coinbaseWallet.type,async connect({chainId:at}={}){try{const ct=await this.getProvider(),lt=(await ct.request({method:"eth_requestAccounts"})).map(ht=>getAddress(ht));nt||(nt=this.onAccountsChanged.bind(this),ct.on("accountsChanged",nt)),ot||(ot=this.onChainChanged.bind(this),ct.on("chainChanged",ot)),it||(it=this.onDisconnect.bind(this),ct.on("disconnect",it));let dt=await this.getChainId();if(at&&dt!==at){const ht=await this.switchChain({chainId:at}).catch(mt=>{if(mt.code===UserRejectedRequestError.code)throw mt;return{id:dt}});dt=(ht==null?void 0:ht.id)??dt}return{accounts:lt,chainId:dt}}catch(ct){throw/(user closed modal|accounts received is empty|user denied account)/i.test(ct.message)?new UserRejectedRequestError(ct):ct}},async disconnect(){const at=await this.getProvider();nt&&(at.removeListener("accountsChanged",nt),nt=void 0),ot&&(at.removeListener("chainChanged",ot),ot=void 0),it&&(at.removeListener("disconnect",it),it=void 0),at.disconnect(),at.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(ct=>getAddress(ct))},async getChainId(){const ct=await(await this.getProvider()).request({method:"eth_chainId"});return Number(ct)},async getProvider(){var at;if(!rt){const ct=await(async()=>{const{default:ft}=await __vitePreload(async()=>{const{default:pt}=await import("./index-CF3pMtIR.js").then(yt=>yt.i);return{default:pt}},__vite__mapDeps([4,3,1,2]));return typeof ft!="function"&&typeof ft.default=="function"?ft.default:ft})();tt=new ct({...et,reloadOnDisconnect:!1});const lt=(at=tt.walletExtension)==null?void 0:at.getChainId(),dt=st.chains.find(ft=>et.chainId?ft.id===et.chainId:ft.id===lt)||st.chains[0],ht=et.chainId||(dt==null?void 0:dt.id),mt=et.jsonRpcUrl||(dt==null?void 0:dt.rpcUrls.default.http[0]);rt=tt.makeWeb3Provider(mt,ht)}return rt},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:at,chainId:ct}){var ht,mt,ft,pt;const lt=st.chains.find(yt=>yt.id===ct);if(!lt)throw new SwitchChainError(new ChainNotConfiguredError);const dt=await this.getProvider();try{return await dt.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(lt.id)}]}),lt}catch(yt){if(yt.code===4902)try{let gt;at!=null&&at.blockExplorerUrls?gt=at.blockExplorerUrls:gt=(ht=lt.blockExplorers)!=null&&ht.default.url?[(mt=lt.blockExplorers)==null?void 0:mt.default.url]:[];let bt;(ft=at==null?void 0:at.rpcUrls)!=null&&ft.length?bt=at.rpcUrls:bt=[((pt=lt.rpcUrls.default)==null?void 0:pt.http[0])??""];const xt={blockExplorerUrls:gt,chainId:numberToHex(ct),chainName:(at==null?void 0:at.chainName)??lt.name,iconUrls:at==null?void 0:at.iconUrls,nativeCurrency:(at==null?void 0:at.nativeCurrency)??lt.nativeCurrency,rpcUrls:bt};return await dt.request({method:"wallet_addEthereumChain",params:[xt]}),lt}catch(gt){throw new UserRejectedRequestError(gt)}throw new SwitchChainError(yt)}},onAccountsChanged(at){at.length===0?this.onDisconnect():st.emitter.emit("change",{accounts:at.map(ct=>getAddress(ct))})},onChainChanged(at){const ct=Number(at);st.emitter.emit("change",{chainId:ct})},async onDisconnect(at){st.emitter.emit("disconnect");const ct=await this.getProvider();nt&&(ct.removeListener("accountsChanged",nt),nt=void 0),ot&&(ct.removeListener("chainChanged",ot),ot=void 0),it&&(ct.removeListener("disconnect",it),it=void 0)}})}safe.type="safe";function safe(et={}){const{shimDisconnect:o=!1}=et;let tt,rt;return nt=>({id:"safe",name:"Safe",type:safe.type,async connect(){var at;const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;const it=await this.getAccounts(),st=await this.getChainId();return rt||(rt=this.onDisconnect.bind(this),ot.on("disconnect",rt)),o&&await((at=nt.storage)==null?void 0:at.removeItem("safe.disconnected")),{accounts:it,chainId:st}},async disconnect(){var it;const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;rt&&(ot.removeListener("disconnect",rt),rt=void 0),o&&await((it=nt.storage)==null?void 0:it.setItem("safe.disconnected",!0))},async getAccounts(){const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;return(await ot.request({method:"eth_accounts"})).map(getAddress)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!tt){const{default:it}=await __vitePreload(async()=>{const{default:lt}=await import("./index-Cr-ON-_S.js");return{default:lt}},[]),st=new it(et),at=await withTimeout(()=>st.safe.getInfo(),{timeout:et.unstable_getInfoTimeout??10});if(!at)throw new Error("Could not load Safe information");const{SafeAppProvider:ct}=await __vitePreload(async()=>{const{SafeAppProvider:lt}=await import("./index-DsVjVM-s.js").then(dt=>dt.i);return{SafeAppProvider:lt}},__vite__mapDeps([5,2]));tt=new ct(at,st)}return tt}},async getChainId(){const ot=await this.getProvider();if(!ot)throw new ProviderNotFoundError;return Number(ot.chainId)},async isAuthorized(){var ot;try{return o&&await((ot=nt.storage)==null?void 0:ot.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){nt.emitter.emit("disconnect")}})}walletConnect.type="walletConnect";function walletConnect(et){const o=et.isNewChainsStale??!0;let tt,rt;const nt="eip155";let ot,it,st,at,ct,lt;return dt=>({id:"walletConnect",name:"WalletConnect",type:walletConnect.type,async setup(){const ht=await this.getProvider().catch(()=>null);ht&&(st||(st=this.onConnect.bind(this),ht.on("connect",st)),ct||(ct=this.onSessionDelete.bind(this),ht.on("session_delete",ct)))},async connect({chainId:ht,...mt}={}){var ft,pt;try{const yt=await this.getProvider();if(!yt)throw new ProviderNotFoundError;at||(at=this.onDisplayUri,yt.on("display_uri",at));let gt=ht;if(!gt){const Et=await((ft=dt.storage)==null?void 0:ft.getItem("state"))??{};dt.chains.some(St=>St.id===Et.chainId)?gt=Et.chainId:gt=(pt=dt.chains[0])==null?void 0:pt.id}if(!gt)throw new Error("No chains found on connector.");const bt=await this.isChainsStale();if(yt.session&&bt&&await yt.disconnect(),!yt.session||bt){const Et=dt.chains.filter(Ct=>Ct.id!==gt).map(Ct=>Ct.id);await yt.connect({optionalChains:[gt,...Et],..."pairingTopic"in mt?{pairingTopic:mt.pairingTopic}:{}}),this.setRequestedChainsIds(dt.chains.map(Ct=>Ct.id))}const xt=(await yt.enable()).map(Et=>getAddress(Et)),vt=await this.getChainId();return at&&(yt.removeListener("display_uri",at),at=void 0),st&&(yt.removeListener("connect",st),st=void 0),ot||(ot=this.onAccountsChanged.bind(this),yt.on("accountsChanged",ot)),it||(it=this.onChainChanged.bind(this),yt.on("chainChanged",it)),lt||(lt=this.onDisconnect.bind(this),yt.on("disconnect",lt)),ct||(ct=this.onSessionDelete.bind(this),yt.on("session_delete",ct)),{accounts:xt,chainId:vt}}catch(yt){throw/(user rejected|connection request reset)/i.test(yt==null?void 0:yt.message)?new UserRejectedRequestError(yt):yt}},async disconnect(){const ht=await this.getProvider();try{await(ht==null?void 0:ht.disconnect())}catch(mt){if(!/No matching key/i.test(mt.message))throw mt}finally{it&&(ht==null||ht.removeListener("chainChanged",it),it=void 0),lt&&(ht==null||ht.removeListener("disconnect",lt),lt=void 0),st||(st=this.onConnect.bind(this),ht==null||ht.on("connect",st)),ot&&(ht==null||ht.removeListener("accountsChanged",ot),ot=void 0),ct&&(ht==null||ht.removeListener("session_delete",ct),ct=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(mt=>getAddress(mt))},async getProvider({chainId:ht}={}){var ft;async function mt(){const pt=dt.chains.map(gt=>gt.id);if(!pt.length)return;const{EthereumProvider:yt}=await __vitePreload(async()=>{const{EthereumProvider:gt}=await import("./index.es-D00CSFMM.js");return{EthereumProvider:gt}},__vite__mapDeps([6,2,3]));return await yt.init({...et,disableProviderPing:!0,optionalChains:pt,projectId:et.projectId,rpcMap:Object.fromEntries(dt.chains.map(gt=>{const[bt]=extractRpcUrls({chain:gt,transports:dt.transports});return[gt.id,bt]})),showQrModal:et.showQrModal??!0})}return tt||(rt||(rt=mt()),tt=await rt,tt==null||tt.events.setMaxListeners(Number.POSITIVE_INFINITY)),ht&&await((ft=this.switchChain)==null?void 0:ft.call(this,{chainId:ht})),tt},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[ht,mt]=await Promise.all([this.getAccounts(),this.getProvider()]);return ht.length?await this.isChainsStale()&&mt.session?(await mt.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:ht,chainId:mt}){var yt,gt,bt;const ft=await this.getProvider();if(!ft)throw new ProviderNotFoundError;const pt=dt.chains.find(xt=>xt.id===mt);if(!pt)throw new SwitchChainError(new ChainNotConfiguredError);try{await Promise.all([new Promise(vt=>{const Et=({chainId:Ct})=>{Ct===mt&&(dt.emitter.off("change",Et),vt())};dt.emitter.on("change",Et)}),ft.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(mt)}]})]);const xt=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...xt,mt]),pt}catch(xt){const vt=xt;if(/(user rejected)/i.test(vt.message))throw new UserRejectedRequestError(vt);try{let Et;ht!=null&&ht.blockExplorerUrls?Et=ht.blockExplorerUrls:Et=(yt=pt.blockExplorers)!=null&&yt.default.url?[(gt=pt.blockExplorers)==null?void 0:gt.default.url]:[];let Ct;(bt=ht==null?void 0:ht.rpcUrls)!=null&&bt.length?Ct=ht.rpcUrls:Ct=[...pt.rpcUrls.default.http];const St={blockExplorerUrls:Et,chainId:numberToHex(mt),chainName:(ht==null?void 0:ht.chainName)??pt.name,iconUrls:ht==null?void 0:ht.iconUrls,nativeCurrency:(ht==null?void 0:ht.nativeCurrency)??pt.nativeCurrency,rpcUrls:Ct};await ft.request({method:"wallet_addEthereumChain",params:[St]});const At=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...At,mt]),pt}catch(Et){throw new UserRejectedRequestError(Et)}}},onAccountsChanged(ht){ht.length===0?this.onDisconnect():dt.emitter.emit("change",{accounts:ht.map(mt=>getAddress(mt))})},onChainChanged(ht){const mt=Number(ht);dt.emitter.emit("change",{chainId:mt})},async onConnect(ht){const mt=Number(ht.chainId),ft=await this.getAccounts();dt.emitter.emit("connect",{accounts:ft,chainId:mt})},async onDisconnect(ht){this.setRequestedChainsIds([]),dt.emitter.emit("disconnect");const mt=await this.getProvider();ot&&(mt.removeListener("accountsChanged",ot),ot=void 0),it&&(mt.removeListener("chainChanged",it),it=void 0),lt&&(mt.removeListener("disconnect",lt),lt=void 0),ct&&(mt.removeListener("session_delete",ct),ct=void 0),st||(st=this.onConnect.bind(this),mt.on("connect",st))},onDisplayUri(ht){dt.emitter.emit("message",{type:"display_uri",data:ht})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var mt,ft,pt;return tt?((pt=(ft=(mt=tt.session)==null?void 0:mt.namespaces[nt])==null?void 0:ft.accounts)==null?void 0:pt.map(yt=>Number.parseInt(yt.split(":")[1]||"")))??[]:[]},async getRequestedChainsIds(){var ht;return await((ht=dt.storage)==null?void 0:ht.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!o)return!1;const ht=dt.chains.map(pt=>pt.id),mt=this.getNamespaceChainsIds();if(mt.length&&!mt.some(pt=>ht.includes(pt)))return!1;const ft=await this.getRequestedChainsIds();return!ht.every(pt=>ft.includes(pt))},async setRequestedChainsIds(ht){var mt;await((mt=dt.storage)==null?void 0:mt.setItem(this.requestedChainsStorageKey,ht))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var define_process_default$3={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},__spreadArray$1=function(et,o,tt){for(var rt=0,nt=o.length,ot;rt"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ReactNativeInfo:typeof navigator<"u"?parseUserAgent(navigator.userAgent):getNodeVersion()}function matchUserAgent(et){return et!==""&&userAgentRules.reduce(function(o,tt){var rt=tt[0],nt=tt[1];if(o)return o;var ot=nt.exec(et);return!!ot&&[rt,ot]},!1)}function parseUserAgent(et){var o=matchUserAgent(et);if(!o)return null;var tt=o[0],rt=o[1];if(tt==="searchbot")return new BotInfo;var nt=rt[1]&&rt[1].split(".").join("_").split("_").slice(0,3);nt?nt.length=0;st--)(it=et[st])&&(ot=(nt<3?it(ot):nt>3?it(o,tt,ot):it(o,tt))||ot);return nt>3&&ot&&Object.defineProperty(o,tt,ot),ot}function __param(et,o){return function(tt,rt){o(tt,rt,et)}}function __esDecorate(et,o,tt,rt,nt,ot){function it(gt){if(gt!==void 0&&typeof gt!="function")throw new TypeError("Function expected");return gt}for(var st=rt.kind,at=st==="getter"?"get":st==="setter"?"set":"value",ct=!o&&et?rt.static?et:et.prototype:null,lt=o||(ct?Object.getOwnPropertyDescriptor(ct,rt.name):{}),dt,ht=!1,mt=tt.length-1;mt>=0;mt--){var ft={};for(var pt in rt)ft[pt]=pt==="access"?{}:rt[pt];for(var pt in rt.access)ft.access[pt]=rt.access[pt];ft.addInitializer=function(gt){if(ht)throw new TypeError("Cannot add initializers after decoration has completed");ot.push(it(gt||null))};var yt=(0,tt[mt])(st==="accessor"?{get:lt.get,set:lt.set}:lt[at],ft);if(st==="accessor"){if(yt===void 0)continue;if(yt===null||typeof yt!="object")throw new TypeError("Object expected");(dt=it(yt.get))&&(lt.get=dt),(dt=it(yt.set))&&(lt.set=dt),(dt=it(yt.init))&&nt.unshift(dt)}else(dt=it(yt))&&(st==="field"?nt.unshift(dt):lt[at]=dt)}ct&&Object.defineProperty(ct,rt.name,lt),ht=!0}function __runInitializers(et,o,tt){for(var rt=arguments.length>2,nt=0;nt0&&ot[ot.length-1])&&(ct[0]===6||ct[0]===2)){tt=0;continue}if(ct[0]===3&&(!ot||ct[1]>ot[0]&&ct[1]=et.length&&(et=void 0),{value:et&&et[rt++],done:!et}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(et,o){var tt=typeof Symbol=="function"&&et[Symbol.iterator];if(!tt)return et;var rt=tt.call(et),nt,ot=[],it;try{for(;(o===void 0||o-- >0)&&!(nt=rt.next()).done;)ot.push(nt.value)}catch(st){it={error:st}}finally{try{nt&&!nt.done&&(tt=rt.return)&&tt.call(rt)}finally{if(it)throw it.error}}return ot}function __spread(){for(var et=[],o=0;o1||at(mt,pt)})},ft&&(nt[mt]=ft(nt[mt])))}function at(mt,ft){try{ct(rt[mt](ft))}catch(pt){ht(ot[0][3],pt)}}function ct(mt){mt.value instanceof __await?Promise.resolve(mt.value.v).then(lt,dt):ht(ot[0][2],mt)}function lt(mt){at("next",mt)}function dt(mt){at("throw",mt)}function ht(mt,ft){mt(ft),ot.shift(),ot.length&&at(ot[0][0],ot[0][1])}}function __asyncDelegator(et){var o,tt;return o={},rt("next"),rt("throw",function(nt){throw nt}),rt("return"),o[Symbol.iterator]=function(){return this},o;function rt(nt,ot){o[nt]=et[nt]?function(it){return(tt=!tt)?{value:__await(et[nt](it)),done:!1}:ot?ot(it):it}:ot}}function __asyncValues(et){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=et[Symbol.asyncIterator],tt;return o?o.call(et):(et=typeof __values=="function"?__values(et):et[Symbol.iterator](),tt={},rt("next"),rt("throw"),rt("return"),tt[Symbol.asyncIterator]=function(){return this},tt);function rt(ot){tt[ot]=et[ot]&&function(it){return new Promise(function(st,at){it=et[ot](it),nt(st,at,it.done,it.value)})}}function nt(ot,it,st,at){Promise.resolve(at).then(function(ct){ot({value:ct,done:st})},it)}}function __makeTemplateObject(et,o){return Object.defineProperty?Object.defineProperty(et,"raw",{value:o}):et.raw=o,et}var __setModuleDefault=Object.create?function(et,o){Object.defineProperty(et,"default",{enumerable:!0,value:o})}:function(et,o){et.default=o};function __importStar(et){if(et&&et.__esModule)return et;var o={};if(et!=null)for(var tt in et)tt!=="default"&&Object.prototype.hasOwnProperty.call(et,tt)&&__createBinding(o,et,tt);return __setModuleDefault(o,et),o}function __importDefault$1(et){return et&&et.__esModule?et:{default:et}}function __classPrivateFieldGet(et,o,tt,rt){if(tt==="a"&&!rt)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?et!==o||!rt:!o.has(et))throw new TypeError("Cannot read private member from an object whose class did not declare it");return tt==="m"?rt:tt==="a"?rt.call(et):rt?rt.value:o.get(et)}function __classPrivateFieldSet(et,o,tt,rt,nt){if(rt==="m")throw new TypeError("Private method is not writable");if(rt==="a"&&!nt)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?et!==o||!nt:!o.has(et))throw new TypeError("Cannot write private member to an object whose class did not declare it");return rt==="a"?nt.call(et,tt):nt?nt.value=tt:o.set(et,tt),tt}function __classPrivateFieldIn(et,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof et=="function"?o===et:et.has(o)}function __addDisposableResource(et,o,tt){if(o!=null){if(typeof o!="object"&&typeof o!="function")throw new TypeError("Object expected.");var rt,nt;if(tt){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");rt=o[Symbol.asyncDispose]}if(rt===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");rt=o[Symbol.dispose],tt&&(nt=rt)}if(typeof rt!="function")throw new TypeError("Object not disposable.");nt&&(rt=function(){try{nt.call(this)}catch(ot){return Promise.reject(ot)}}),et.stack.push({value:o,dispose:rt,async:tt})}else tt&&et.stack.push({async:!0});return o}var _SuppressedError=typeof SuppressedError=="function"?SuppressedError:function(et,o,tt){var rt=new Error(tt);return rt.name="SuppressedError",rt.error=et,rt.suppressed=o,rt};function __disposeResources(et){function o(ot){et.error=et.hasError?new _SuppressedError(ot,et.error,"An error was suppressed during disposal."):ot,et.hasError=!0}var tt,rt=0;function nt(){for(;tt=et.stack.pop();)try{if(!tt.async&&rt===1)return rt=0,et.stack.push(tt),Promise.resolve().then(nt);if(tt.dispose){var ot=tt.dispose.call(tt.value);if(tt.async)return rt|=2,Promise.resolve(ot).then(nt,function(it){return o(it),nt()})}else rt|=1}catch(it){o(it)}if(rt===1)return et.hasError?Promise.reject(et.error):Promise.resolve();if(et.hasError)throw et.error}return nt()}function __rewriteRelativeImportExtension(et,o){return typeof et=="string"&&/^\.\.?\//.test(et)?et.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(tt,rt,nt,ot,it){return rt?o?".jsx":".js":nt&&(!ot||!it)?tt:nt+ot+"."+it.toLowerCase()+"js"}):et}const tslib_es6={__extends,__assign,__rest,__decorate,__param,__esDecorate,__runInitializers,__propKey,__setFunctionName,__metadata,__awaiter,__generator,__createBinding,__exportStar,__values,__read,__spread,__spreadArrays,__spreadArray,__await,__asyncGenerator,__asyncDelegator,__asyncValues,__makeTemplateObject,__importStar,__importDefault:__importDefault$1,__classPrivateFieldGet,__classPrivateFieldSet,__classPrivateFieldIn,__addDisposableResource,__disposeResources,__rewriteRelativeImportExtension},tslib_es6$1=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource,get __assign(){return __assign},__asyncDelegator,__asyncGenerator,__asyncValues,__await,__awaiter,__classPrivateFieldGet,__classPrivateFieldIn,__classPrivateFieldSet,__createBinding,__decorate,__disposeResources,__esDecorate,__exportStar,__extends,__generator,__importDefault:__importDefault$1,__importStar,__makeTemplateObject,__metadata,__param,__propKey,__read,__rest,__rewriteRelativeImportExtension,__runInitializers,__setFunctionName,__spread,__spreadArray,__spreadArrays,__values,default:tslib_es6},Symbol.toStringTag,{value:"Module"}));var define_process_default$2={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},define_process_env_default$1={},defaultEnvironment="production",env$1=typeof define_process_default$2>"u"||define_process_env_default$1===void 0?defaultEnvironment:"production",createDefinition=function(et){return{isEnabled:function(o){return et.some(function(tt){return!!o[tt]})}}},featureDefinitions={measureLayout:createDefinition(["layout","layoutId","drag"]),animation:createDefinition(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:createDefinition(["exit"]),drag:createDefinition(["drag","dragControls"]),focus:createDefinition(["whileFocus"]),hover:createDefinition(["whileHover","onHoverStart","onHoverEnd"]),tap:createDefinition(["whileTap","onTap","onTapStart","onTapCancel"]),pan:createDefinition(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:createDefinition(["whileInView","onViewportEnter","onViewportLeave"])};function loadFeatures(et){for(var o in et)et[o]!==null&&(o==="projectionNodeConstructor"?featureDefinitions.projectionNodeConstructor=et[o]:featureDefinitions[o].Component=et[o])}var invariant$1=function(){},LazyContext=reactExports.createContext({strict:!1}),featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length;function useFeatures(et,o,tt){var rt=[],nt=reactExports.useContext(LazyContext);if(!o)return null;env$1!=="production"&&tt&&nt.strict;for(var ot=0;ot"u")return o;var tt=new Map;return new Proxy(o,{get:function(rt,nt){return tt.has(nt)||tt.set(nt,o(nt)),tt.get(nt)}})}var lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function isSVGComponent(et){return typeof et!="string"||et.includes("-")?!1:!!(lowercaseSVGElements.indexOf(et)>-1||/[A-Z]/.test(et))}var scaleCorrectors={};function addScaleCorrector(et){Object.assign(scaleCorrectors,et)}var transformAxes=["","X","Y","Z"],order$1=["translate","scale","rotate","skew"],transformProps=["transformPerspective","x","y","z"];order$1.forEach(function(et){return transformAxes.forEach(function(o){return transformProps.push(et+o)})});function sortTransformProps(et,o){return transformProps.indexOf(et)-transformProps.indexOf(o)}var transformPropSet=new Set(transformProps);function isTransformProp(et){return transformPropSet.has(et)}var transformOriginProps=new Set(["originX","originY","originZ"]);function isTransformOriginProp(et){return transformOriginProps.has(et)}function isForcedMotionValue(et,o){var tt=o.layout,rt=o.layoutId;return isTransformProp(et)||isTransformOriginProp(et)||(tt||rt!==void 0)&&(!!scaleCorrectors[et]||et==="opacity")}var isMotionValue=function(et){return!!(et!==null&&typeof et=="object"&&et.getVelocity)},translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function buildTransform(et,o,tt,rt){var nt=et.transform,ot=et.transformKeys,it=o.enableHardwareAcceleration,st=it===void 0?!0:it,at=o.allowTransformNone,ct=at===void 0?!0:at,lt="";ot.sort(sortTransformProps);for(var dt=!1,ht=ot.length,mt=0;mttt=>Math.max(Math.min(tt,o),et),sanitize=et=>et%1?Number(et.toFixed(5)):et,floatRegex=/(-)?([\d]*\.?[\d])+/g,colorRegex=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,singleColorRegex=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function isString(et){return typeof et=="string"}const number$3={test:et=>typeof et=="number",parse:parseFloat,transform:et=>et},alpha=Object.assign(Object.assign({},number$3),{transform:clamp$2(0,1)}),scale=Object.assign(Object.assign({},number$3),{default:1}),createUnitType=et=>({test:o=>isString(o)&&o.endsWith(et)&&o.split(" ").length===1,parse:parseFloat,transform:o=>`${o}${et}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage=Object.assign(Object.assign({},percent),{parse:et=>percent.parse(et)/100,transform:et=>percent.transform(et*100)}),isColorString=(et,o)=>tt=>!!(isString(tt)&&singleColorRegex.test(tt)&&tt.startsWith(et)||o&&Object.prototype.hasOwnProperty.call(tt,o)),splitColor=(et,o,tt)=>rt=>{if(!isString(rt))return rt;const[nt,ot,it,st]=rt.match(floatRegex);return{[et]:parseFloat(nt),[o]:parseFloat(ot),[tt]:parseFloat(it),alpha:st!==void 0?parseFloat(st):1}},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:et,saturation:o,lightness:tt,alpha:rt=1})=>"hsla("+Math.round(et)+", "+percent.transform(sanitize(o))+", "+percent.transform(sanitize(tt))+", "+sanitize(alpha.transform(rt))+")"},clampRgbUnit=clamp$2(0,255),rgbUnit=Object.assign(Object.assign({},number$3),{transform:et=>Math.round(clampRgbUnit(et))}),rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:et,green:o,blue:tt,alpha:rt=1})=>"rgba("+rgbUnit.transform(et)+", "+rgbUnit.transform(o)+", "+rgbUnit.transform(tt)+", "+sanitize(alpha.transform(rt))+")"};function parseHex(et){let o="",tt="",rt="",nt="";return et.length>5?(o=et.substr(1,2),tt=et.substr(3,2),rt=et.substr(5,2),nt=et.substr(7,2)):(o=et.substr(1,1),tt=et.substr(2,1),rt=et.substr(3,1),nt=et.substr(4,1),o+=o,tt+=tt,rt+=rt,nt+=nt),{red:parseInt(o,16),green:parseInt(tt,16),blue:parseInt(rt,16),alpha:nt?parseInt(nt,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},color$1={test:et=>rgba.test(et)||hex.test(et)||hsla.test(et),parse:et=>rgba.test(et)?rgba.parse(et):hsla.test(et)?hsla.parse(et):hex.parse(et),transform:et=>isString(et)?et:et.hasOwnProperty("red")?rgba.transform(et):hsla.transform(et)},colorToken="${c}",numberToken="${n}";function test(et){var o,tt,rt,nt;return isNaN(et)&&isString(et)&&((tt=(o=et.match(floatRegex))===null||o===void 0?void 0:o.length)!==null&&tt!==void 0?tt:0)+((nt=(rt=et.match(colorRegex))===null||rt===void 0?void 0:rt.length)!==null&&nt!==void 0?nt:0)>0}function analyse$1(et){typeof et=="number"&&(et=`${et}`);const o=[];let tt=0;const rt=et.match(colorRegex);rt&&(tt=rt.length,et=et.replace(colorRegex,colorToken),o.push(...rt.map(color$1.parse)));const nt=et.match(floatRegex);return nt&&(et=et.replace(floatRegex,numberToken),o.push(...nt.map(number$3.parse))),{values:o,numColors:tt,tokenised:et}}function parse$4(et){return analyse$1(et).values}function createTransformer(et){const{values:o,numColors:tt,tokenised:rt}=analyse$1(et),nt=o.length;return ot=>{let it=rt;for(let st=0;sttypeof et=="number"?0:et;function getAnimatableNone$1(et){const o=parse$4(et);return createTransformer(et)(o.map(convertNumbersToZero))}const complex={test,parse:parse$4,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(et){let[o,tt]=et.slice(0,-1).split("(");if(o==="drop-shadow")return et;const[rt]=tt.match(floatRegex)||[];if(!rt)return et;const nt=tt.replace(rt,"");let ot=maxDefaults.has(o)?1:0;return rt!==tt&&(ot*=100),o+"("+ot+nt+")"}const functionRegex=/([a-z-]*)\(.*?\)/g,filter$1=Object.assign(Object.assign({},complex),{getAnimatableNone:et=>{const o=et.match(functionRegex);return o?o.map(applyDefaultFilter).join(" "):et}});var int=__assign(__assign({},number$3),{transform:Math.round}),numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(et,o,tt,rt){var nt,ot=et.style,it=et.vars,st=et.transform,at=et.transformKeys,ct=et.transformOrigin;at.length=0;var lt=!1,dt=!1,ht=!0;for(var mt in o){var ft=o[mt];if(isCSSVariable$1(mt)){it[mt]=ft;continue}var pt=numberValueTypes[mt],yt=getValueAsType(ft,pt);if(isTransformProp(mt)){if(lt=!0,st[mt]=yt,at.push(mt),!ht)continue;ft!==((nt=pt.default)!==null&&nt!==void 0?nt:0)&&(ht=!1)}else isTransformOriginProp(mt)?(ct[mt]=yt,dt=!0):ot[mt]=yt}lt?ot.transform=buildTransform(et,tt,ht,rt):rt?ot.transform=rt({},""):!o.transform&&ot.transform&&(ot.transform="none"),dt&&(ot.transformOrigin=buildTransformOrigin(ct))}var createHtmlRenderState=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function copyRawValuesOnly(et,o,tt){for(var rt in o)!isMotionValue(o[rt])&&!isForcedMotionValue(rt,tt)&&(et[rt]=o[rt])}function useInitialMotionValues(et,o,tt){var rt=et.transformTemplate;return reactExports.useMemo(function(){var nt=createHtmlRenderState();buildHTMLStyles(nt,o,{enableHardwareAcceleration:!tt},rt);var ot=nt.vars,it=nt.style;return __assign(__assign({},ot),it)},[o])}function useStyle(et,o,tt){var rt=et.style||{},nt={};return copyRawValuesOnly(nt,rt,et),Object.assign(nt,useInitialMotionValues(et,o,tt)),et.transformValues&&(nt=et.transformValues(nt)),nt}function useHTMLProps(et,o,tt){var rt={},nt=useStyle(et,o,tt);return et.drag&&et.dragListener!==!1&&(rt.draggable=!1,nt.userSelect=nt.WebkitUserSelect=nt.WebkitTouchCallout="none",nt.touchAction=et.drag===!0?"none":"pan-".concat(et.drag==="x"?"y":"x")),rt.style=nt,rt}var validMotionProps=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover","whileInView","onViewportEnter","onViewportLeave","viewport","layoutScroll"]);function isValidMotionProp(et){return validMotionProps.has(et)}var shouldForward=function(et){return!isValidMotionProp(et)};function loadExternalIsValidProp(et){et&&(shouldForward=function(o){return o.startsWith("on")?!isValidMotionProp(o):et(o)})}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch{}function filterProps(et,o,tt){var rt={};for(var nt in et)(shouldForward(nt)||tt===!0&&isValidMotionProp(nt)||!o&&!isValidMotionProp(nt)||et.draggable&&nt.startsWith("onDrag"))&&(rt[nt]=et[nt]);return rt}function calcOrigin$1(et,o,tt){return typeof et=="string"?et:px.transform(o+tt*et)}function calcSVGTransformOrigin(et,o,tt){var rt=calcOrigin$1(o,et.x,et.width),nt=calcOrigin$1(tt,et.y,et.height);return"".concat(rt," ").concat(nt)}var camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(et,o,tt,rt,nt){tt===void 0&&(tt=1),rt===void 0&&(rt=0),et.pathLength=1;var ot=camelKeys;et[ot.offset]=px.transform(-rt);var it=px.transform(o),st=px.transform(tt);et[ot.array]="".concat(it," ").concat(st)}function buildSVGAttrs(et,o,tt,rt){var nt=o.attrX,ot=o.attrY,it=o.originX,st=o.originY,at=o.pathLength,ct=o.pathSpacing,lt=ct===void 0?1:ct,dt=o.pathOffset,ht=dt===void 0?0:dt,mt=__rest(o,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]);buildHTMLStyles(et,mt,tt,rt),et.attrs=et.style,et.style={};var ft=et.attrs,pt=et.style,yt=et.dimensions;ft.transform&&(yt&&(pt.transform=ft.transform),delete ft.transform),yt&&(it!==void 0||st!==void 0||pt.transform)&&(pt.transformOrigin=calcSVGTransformOrigin(yt,it!==void 0?it:.5,st!==void 0?st:.5)),nt!==void 0&&(ft.x=nt),ot!==void 0&&(ft.y=ot),at!==void 0&&buildSVGPath(ft,at,lt,ht)}var createSvgRenderState=function(){return __assign(__assign({},createHtmlRenderState()),{attrs:{}})};function useSVGProps(et,o){var tt=reactExports.useMemo(function(){var nt=createSvgRenderState();return buildSVGAttrs(nt,o,{enableHardwareAcceleration:!1},et.transformTemplate),__assign(__assign({},nt.attrs),{style:__assign({},nt.style)})},[o]);if(et.style){var rt={};copyRawValuesOnly(rt,et.style,et),tt.style=__assign(__assign({},rt),tt.style)}return tt}function createUseRender(et){et===void 0&&(et=!1);var o=function(tt,rt,nt,ot,it,st){var at=it.latestValues,ct=isSVGComponent(tt)?useSVGProps:useHTMLProps,lt=ct(rt,at,st),dt=filterProps(rt,typeof tt=="string",et),ht=__assign(__assign(__assign({},dt),lt),{ref:ot});return nt&&(ht["data-projection-id"]=nt),reactExports.createElement(tt,ht)};return o}var CAMEL_CASE_PATTERN=/([a-z])([A-Z])/g,REPLACE_TEMPLATE="$1-$2",camelToDash=function(et){return et.replace(CAMEL_CASE_PATTERN,REPLACE_TEMPLATE).toLowerCase()};function renderHTML(et,o,tt,rt){var nt=o.style,ot=o.vars;Object.assign(et.style,nt,rt&&rt.getProjectionStyles(tt));for(var it in ot)et.style.setProperty(it,ot[it])}var camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function renderSVG(et,o,tt,rt){renderHTML(et,o,void 0,rt);for(var nt in o.attrs)et.setAttribute(camelCaseAttributes.has(nt)?nt:camelToDash(nt),o.attrs[nt])}function scrapeMotionValuesFromProps$1(et){var o=et.style,tt={};for(var rt in o)(isMotionValue(o[rt])||isForcedMotionValue(rt,et))&&(tt[rt]=o[rt]);return tt}function scrapeMotionValuesFromProps(et){var o=scrapeMotionValuesFromProps$1(et);for(var tt in et)if(isMotionValue(et[tt])){var rt=tt==="x"||tt==="y"?"attr"+tt.toUpperCase():tt;o[rt]=et[tt]}return o}function isAnimationControls(et){return typeof et=="object"&&typeof et.start=="function"}var isKeyframesTarget=function(et){return Array.isArray(et)},isCustomValue=function(et){return!!(et&&typeof et=="object"&&et.mix&&et.toValue)},resolveFinalValueInKeyframes=function(et){return isKeyframesTarget(et)?et[et.length-1]||0:et};function resolveMotionValue(et){var o=isMotionValue(et)?et.get():et;return isCustomValue(o)?o.toValue():o}function makeState(et,o,tt,rt){var nt=et.scrapeMotionValuesFromProps,ot=et.createRenderState,it=et.onMount,st={latestValues:makeLatestValues(o,tt,rt,nt),renderState:ot()};return it&&(st.mount=function(at){return it(o,at,st)}),st}var makeUseVisualState=function(et){return function(o,tt){var rt=reactExports.useContext(MotionContext),nt=reactExports.useContext(PresenceContext);return tt?makeState(et,o,rt,nt):useConstant(function(){return makeState(et,o,rt,nt)})}};function makeLatestValues(et,o,tt,rt){var nt={},ot=(tt==null?void 0:tt.initial)===!1,it=rt(et);for(var st in it)nt[st]=resolveMotionValue(it[st]);var at=et.initial,ct=et.animate,lt=checkIfControllingVariants(et),dt=checkIfVariantNode(et);o&&dt&&!lt&&et.inherit!==!1&&(at??(at=o.initial),ct??(ct=o.animate));var ht=ot||at===!1,mt=ht?ct:at;if(mt&&typeof mt!="boolean"&&!isAnimationControls(mt)){var ft=Array.isArray(mt)?mt:[mt];ft.forEach(function(pt){var yt=resolveVariantFromProps(et,pt);if(yt){var gt=yt.transitionEnd;yt.transition;var bt=__rest(yt,["transitionEnd","transition"]);for(var xt in bt){var vt=bt[xt];if(Array.isArray(vt)){var Et=ht?vt.length-1:0;vt=vt[Et]}vt!==null&&(nt[xt]=vt)}for(var xt in gt)nt[xt]=gt[xt]}})}return nt}var svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:function(et,o,tt){var rt=tt.renderState,nt=tt.latestValues;try{rt.dimensions=typeof o.getBBox=="function"?o.getBBox():o.getBoundingClientRect()}catch{rt.dimensions={x:0,y:0,width:0,height:0}}buildSVGAttrs(rt,nt,{enableHardwareAcceleration:!1},et.transformTemplate),renderSVG(o,rt)}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(et,o,tt,rt,nt){var ot=o.forwardMotionProps,it=ot===void 0?!1:ot,st=isSVGComponent(et)?svgMotionConfig:htmlMotionConfig;return __assign(__assign({},st),{preloadedFeatures:tt,useRender:createUseRender(it),createVisualElement:rt,projectionNodeConstructor:nt,Component:et})}var AnimationType;(function(et){et.Animate="animate",et.Hover="whileHover",et.Tap="whileTap",et.Drag="whileDrag",et.Focus="whileFocus",et.InView="whileInView",et.Exit="exit"})(AnimationType||(AnimationType={}));function addDomEvent(et,o,tt,rt){return rt===void 0&&(rt={passive:!0}),et.addEventListener(o,tt,rt),function(){return et.removeEventListener(o,tt)}}function useDomEvent(et,o,tt,rt){reactExports.useEffect(function(){var nt=et.current;if(tt&&nt)return addDomEvent(nt,o,tt,rt)},[et,o,tt,rt])}function useFocusGesture(et){var o=et.whileFocus,tt=et.visualElement,rt=function(){var ot;(ot=tt.animationState)===null||ot===void 0||ot.setActive(AnimationType.Focus,!0)},nt=function(){var ot;(ot=tt.animationState)===null||ot===void 0||ot.setActive(AnimationType.Focus,!1)};useDomEvent(tt,"focus",o?rt:void 0),useDomEvent(tt,"blur",o?nt:void 0)}function isMouseEvent(et){return typeof PointerEvent<"u"&&et instanceof PointerEvent?et.pointerType==="mouse":et instanceof MouseEvent}function isTouchEvent(et){var o=!!et.touches;return o}function filterPrimaryPointer(et){return function(o){var tt=o instanceof MouseEvent,rt=!tt||tt&&o.button===0;rt&&et(o)}}var defaultPagePoint={pageX:0,pageY:0};function pointFromTouch(et,o){o===void 0&&(o="page");var tt=et.touches[0]||et.changedTouches[0],rt=tt||defaultPagePoint;return{x:rt[o+"X"],y:rt[o+"Y"]}}function pointFromMouse(et,o){return o===void 0&&(o="page"),{x:et[o+"X"],y:et[o+"Y"]}}function extractEventInfo(et,o){return o===void 0&&(o="page"),{point:isTouchEvent(et)?pointFromTouch(et,o):pointFromMouse(et,o)}}var wrapHandler=function(et,o){o===void 0&&(o=!1);var tt=function(rt){return et(rt,extractEventInfo(rt))};return o?filterPrimaryPointer(tt):tt},supportsPointerEvents=function(){return isBrowser$3&&window.onpointerdown===null},supportsTouchEvents=function(){return isBrowser$3&&window.ontouchstart===null},supportsMouseEvents=function(){return isBrowser$3&&window.onmousedown===null},mouseEventNames={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},touchEventNames={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function getPointerEventName(et){return supportsPointerEvents()?et:supportsTouchEvents()?touchEventNames[et]:supportsMouseEvents()?mouseEventNames[et]:et}function addPointerEvent(et,o,tt,rt){return addDomEvent(et,getPointerEventName(o),wrapHandler(tt,o==="pointerdown"),rt)}function usePointerEvent(et,o,tt,rt){return useDomEvent(et,getPointerEventName(o),tt&&wrapHandler(tt,o==="pointerdown"),rt)}function createLock(et){var o=null;return function(){var tt=function(){o=null};return o===null?(o=et,tt):!1}}var globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(et){var o=!1;if(et==="y")o=globalVerticalLock();else if(et==="x")o=globalHorizontalLock();else{var tt=globalHorizontalLock(),rt=globalVerticalLock();tt&&rt?o=function(){tt(),rt()}:(tt&&tt(),rt&&rt())}return o}function isDragActive(){var et=getGlobalLock(!0);return et?(et(),!1):!0}function createHoverEvent(et,o,tt){return function(rt,nt){var ot;!isMouseEvent(rt)||isDragActive()||((ot=et.animationState)===null||ot===void 0||ot.setActive(AnimationType.Hover,o),tt==null||tt(rt,nt))}}function useHoverGesture(et){var o=et.onHoverStart,tt=et.onHoverEnd,rt=et.whileHover,nt=et.visualElement;usePointerEvent(nt,"pointerenter",o||rt?createHoverEvent(nt,!0,o):void 0,{passive:!o}),usePointerEvent(nt,"pointerleave",tt||rt?createHoverEvent(nt,!1,tt):void 0,{passive:!tt})}var isNodeOrChild=function(et,o){return o?et===o?!0:isNodeOrChild(et,o.parentElement):!1};function useUnmountEffect(et){return reactExports.useEffect(function(){return function(){return et()}},[])}const clamp$1=(et,o,tt)=>Math.min(Math.max(tt,et),o),safeMin=.001,minDuration=.01,maxDuration=10,minDamping=.05,maxDamping=1;function findSpring({duration:et=800,bounce:o=.25,velocity:tt=0,mass:rt=1}){let nt,ot,it=1-o;it=clamp$1(minDamping,maxDamping,it),et=clamp$1(minDuration,maxDuration,et/1e3),it<1?(nt=ct=>{const lt=ct*it,dt=lt*et,ht=lt-tt,mt=calcAngularFreq(ct,it),ft=Math.exp(-dt);return safeMin-ht/mt*ft},ot=ct=>{const dt=ct*it*et,ht=dt*tt+tt,mt=Math.pow(it,2)*Math.pow(ct,2)*et,ft=Math.exp(-dt),pt=calcAngularFreq(Math.pow(ct,2),it);return(-nt(ct)+safeMin>0?-1:1)*((ht-mt)*ft)/pt}):(nt=ct=>{const lt=Math.exp(-ct*et),dt=(ct-tt)*et+1;return-safeMin+lt*dt},ot=ct=>{const lt=Math.exp(-ct*et),dt=(tt-ct)*(et*et);return lt*dt});const st=5/et,at=approximateRoot(nt,ot,st);if(et=et*1e3,isNaN(at))return{stiffness:100,damping:10,duration:et};{const ct=Math.pow(at,2)*rt;return{stiffness:ct,damping:it*2*Math.sqrt(rt*ct),duration:et}}}const rootIterations=12;function approximateRoot(et,o,tt){let rt=tt;for(let nt=1;ntet[tt]!==void 0)}function getSpringOptions(et){let o=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},et);if(!isSpringType(et,physicsKeys)&&isSpringType(et,durationKeys)){const tt=findSpring(et);o=Object.assign(Object.assign(Object.assign({},o),tt),{velocity:0,mass:1}),o.isResolvedFromDuration=!0}return o}function spring(et){var{from:o=0,to:tt=1,restSpeed:rt=2,restDelta:nt}=et,ot=__rest(et,["from","to","restSpeed","restDelta"]);const it={done:!1,value:o};let{stiffness:st,damping:at,mass:ct,velocity:lt,duration:dt,isResolvedFromDuration:ht}=getSpringOptions(ot),mt=zero$1,ft=zero$1;function pt(){const yt=lt?-(lt/1e3):0,gt=tt-o,bt=at/(2*Math.sqrt(st*ct)),xt=Math.sqrt(st/ct)/1e3;if(nt===void 0&&(nt=Math.min(Math.abs(tt-o)/100,.4)),bt<1){const vt=calcAngularFreq(xt,bt);mt=Et=>{const Ct=Math.exp(-bt*xt*Et);return tt-Ct*((yt+bt*xt*gt)/vt*Math.sin(vt*Et)+gt*Math.cos(vt*Et))},ft=Et=>{const Ct=Math.exp(-bt*xt*Et);return bt*xt*Ct*(Math.sin(vt*Et)*(yt+bt*xt*gt)/vt+gt*Math.cos(vt*Et))-Ct*(Math.cos(vt*Et)*(yt+bt*xt*gt)-vt*gt*Math.sin(vt*Et))}}else if(bt===1)mt=vt=>tt-Math.exp(-xt*vt)*(gt+(yt+xt*gt)*vt);else{const vt=xt*Math.sqrt(bt*bt-1);mt=Et=>{const Ct=Math.exp(-bt*xt*Et),St=Math.min(vt*Et,300);return tt-Ct*((yt+bt*xt*gt)*Math.sinh(St)+vt*gt*Math.cosh(St))/vt}}}return pt(),{next:yt=>{const gt=mt(yt);if(ht)it.done=yt>=dt;else{const bt=ft(yt)*1e3,xt=Math.abs(bt)<=rt,vt=Math.abs(tt-gt)<=nt;it.done=xt&&vt}return it.value=it.done?tt:gt,it},flipTarget:()=>{lt=-lt,[o,tt]=[tt,o],pt()}}}spring.needsInterpolation=(et,o)=>typeof et=="string"||typeof o=="string";const zero$1=et=>0,progress=(et,o,tt)=>{const rt=o-et;return rt===0?1:(tt-et)/rt},mix=(et,o,tt)=>-tt*et+tt*o+et;function hueToRgb(et,o,tt){return tt<0&&(tt+=1),tt>1&&(tt-=1),tt<1/6?et+(o-et)*6*tt:tt<1/2?o:tt<2/3?et+(o-et)*(2/3-tt)*6:et}function hslaToRgba({hue:et,saturation:o,lightness:tt,alpha:rt}){et/=360,o/=100,tt/=100;let nt=0,ot=0,it=0;if(!o)nt=ot=it=tt;else{const st=tt<.5?tt*(1+o):tt+o-tt*o,at=2*tt-st;nt=hueToRgb(at,st,et+1/3),ot=hueToRgb(at,st,et),it=hueToRgb(at,st,et-1/3)}return{red:Math.round(nt*255),green:Math.round(ot*255),blue:Math.round(it*255),alpha:rt}}const mixLinearColor=(et,o,tt)=>{const rt=et*et,nt=o*o;return Math.sqrt(Math.max(0,tt*(nt-rt)+rt))},colorTypes=[hex,rgba,hsla],getColorType=et=>colorTypes.find(o=>o.test(et)),mixColor=(et,o)=>{let tt=getColorType(et),rt=getColorType(o),nt=tt.parse(et),ot=rt.parse(o);tt===hsla&&(nt=hslaToRgba(nt),tt=rgba),rt===hsla&&(ot=hslaToRgba(ot),rt=rgba);const it=Object.assign({},nt);return st=>{for(const at in it)at!=="alpha"&&(it[at]=mixLinearColor(nt[at],ot[at],st));return it.alpha=mix(nt.alpha,ot.alpha,st),tt.transform(it)}},isNum=et=>typeof et=="number",combineFunctions=(et,o)=>tt=>o(et(tt)),pipe$1=(...et)=>et.reduce(combineFunctions);function getMixer(et,o){return isNum(et)?tt=>mix(et,o,tt):color$1.test(et)?mixColor(et,o):mixComplex(et,o)}const mixArray=(et,o)=>{const tt=[...et],rt=tt.length,nt=et.map((ot,it)=>getMixer(ot,o[it]));return ot=>{for(let it=0;it{const tt=Object.assign(Object.assign({},et),o),rt={};for(const nt in tt)et[nt]!==void 0&&o[nt]!==void 0&&(rt[nt]=getMixer(et[nt],o[nt]));return nt=>{for(const ot in rt)tt[ot]=rt[ot](nt);return tt}};function analyse(et){const o=complex.parse(et),tt=o.length;let rt=0,nt=0,ot=0;for(let it=0;it{const tt=complex.createTransformer(o),rt=analyse(et),nt=analyse(o);return rt.numHSL===nt.numHSL&&rt.numRGB===nt.numRGB&&rt.numNumbers>=nt.numNumbers?pipe$1(mixArray(rt.parsed,nt.parsed),tt):it=>`${it>0?o:et}`},mixNumber=(et,o)=>tt=>mix(et,o,tt);function detectMixerFactory(et){if(typeof et=="number")return mixNumber;if(typeof et=="string")return color$1.test(et)?mixColor:mixComplex;if(Array.isArray(et))return mixArray;if(typeof et=="object")return mixObject}function createMixers(et,o,tt){const rt=[],nt=tt||detectMixerFactory(et[0]),ot=et.length-1;for(let it=0;ittt(progress(et,o,rt))}function slowInterpolate(et,o){const tt=et.length,rt=tt-1;return nt=>{let ot=0,it=!1;if(nt<=et[0]?it=!0:nt>=et[rt]&&(ot=rt-1,it=!0),!it){let at=1;for(;atnt||at===rt);at++);ot=at-1}const st=progress(et[ot],et[ot+1],nt);return o[ot](st)}}function interpolate(et,o,{clamp:tt=!0,ease:rt,mixer:nt}={}){const ot=et.length;invariant$1(ot===o.length),invariant$1(!rt||!Array.isArray(rt)||rt.length===ot-1),et[0]>et[ot-1]&&(et=[].concat(et),o=[].concat(o),et.reverse(),o.reverse());const it=createMixers(o,rt,nt),st=ot===2?fastInterpolate(et,it):slowInterpolate(et,it);return tt?at=>st(clamp$1(et[0],et[ot-1],at)):st}const reverseEasing=et=>o=>1-et(1-o),mirrorEasing=et=>o=>o<=.5?et(2*o)/2:(2-et(2*(1-o)))/2,createExpoIn=et=>o=>Math.pow(o,et),createBackIn=et=>o=>o*o*((et+1)*o-et),createAnticipate=et=>{const o=createBackIn(et);return tt=>(tt*=2)<1?.5*o(tt):.5*(2-Math.pow(2,-10*(tt-1)))},DEFAULT_OVERSHOOT_STRENGTH=1.525,BOUNCE_FIRST_THRESHOLD=4/11,BOUNCE_SECOND_THRESHOLD=8/11,BOUNCE_THIRD_THRESHOLD=9/10,linear=et=>et,easeIn=createExpoIn(2),easeOut=reverseEasing(easeIn),easeInOut=mirrorEasing(easeIn),circIn=et=>1-Math.sin(Math.acos(et)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circOut),backIn=createBackIn(DEFAULT_OVERSHOOT_STRENGTH),backOut=reverseEasing(backIn),backInOut=mirrorEasing(backIn),anticipate=createAnticipate(DEFAULT_OVERSHOOT_STRENGTH),ca=4356/361,cb=35442/1805,cc=16061/1805,bounceOut=et=>{if(et===1||et===0)return et;const o=et*et;return etet<.5?.5*(1-bounceOut(1-et*2)):.5*bounceOut(et*2-1)+.5;function defaultEasing(et,o){return et.map(()=>o||easeInOut).splice(0,et.length-1)}function defaultOffset(et){const o=et.length;return et.map((tt,rt)=>rt!==0?rt/(o-1):0)}function convertOffsetToTimes(et,o){return et.map(tt=>tt*o)}function keyframes$1({from:et=0,to:o=1,ease:tt,offset:rt,duration:nt=300}){const ot={done:!1,value:et},it=Array.isArray(o)?o:[et,o],st=convertOffsetToTimes(rt&&rt.length===it.length?rt:defaultOffset(it),nt);function at(){return interpolate(st,it,{ease:Array.isArray(tt)?tt:defaultEasing(it,tt)})}let ct=at();return{next:lt=>(ot.value=ct(lt),ot.done=lt>=nt,ot),flipTarget:()=>{it.reverse(),ct=at()}}}function decay({velocity:et=0,from:o=0,power:tt=.8,timeConstant:rt=350,restDelta:nt=.5,modifyTarget:ot}){const it={done:!1,value:o};let st=tt*et;const at=o+st,ct=ot===void 0?at:ot(at);return ct!==at&&(st=ct-o),{next:lt=>{const dt=-st*Math.exp(-lt/rt);return it.done=!(dt>nt||dt<-nt),it.value=it.done?ct:ct+dt,it},flipTarget:()=>{}}}const types$3={keyframes:keyframes$1,spring,decay};function detectAnimationFromOptions(et){if(Array.isArray(et.to))return keyframes$1;if(types$3[et.type])return types$3[et.type];const o=new Set(Object.keys(et));return o.has("ease")||o.has("duration")&&!o.has("dampingRatio")?keyframes$1:o.has("dampingRatio")||o.has("stiffness")||o.has("mass")||o.has("damping")||o.has("restSpeed")||o.has("restDelta")?spring:keyframes$1}const defaultTimestep=1/60*1e3,getCurrentTime=typeof performance<"u"?()=>performance.now():()=>Date.now(),onNextFrame=typeof window<"u"?et=>window.requestAnimationFrame(et):et=>setTimeout(()=>et(getCurrentTime()),defaultTimestep);function createRenderStep(et){let o=[],tt=[],rt=0,nt=!1,ot=!1;const it=new WeakSet,st={schedule:(at,ct=!1,lt=!1)=>{const dt=lt&&nt,ht=dt?o:tt;return ct&&it.add(at),ht.indexOf(at)===-1&&(ht.push(at),dt&&nt&&(rt=o.length)),at},cancel:at=>{const ct=tt.indexOf(at);ct!==-1&&tt.splice(ct,1),it.delete(at)},process:at=>{if(nt){ot=!0;return}if(nt=!0,[o,tt]=[tt,o],tt.length=0,rt=o.length,rt)for(let ct=0;ct(et[o]=createRenderStep(()=>runNextFrame=!0),et),{}),sync=stepsOrder.reduce((et,o)=>{const tt=steps[o];return et[o]=(rt,nt=!1,ot=!1)=>(runNextFrame||startLoop(),tt.schedule(rt,nt,ot)),et},{}),cancelSync=stepsOrder.reduce((et,o)=>(et[o]=steps[o].cancel,et),{}),flushSync=stepsOrder.reduce((et,o)=>(et[o]=()=>steps[o].process(frame),et),{}),processStep=et=>steps[et].process(frame),processFrame=et=>{runNextFrame=!1,frame.delta=useDefaultElapsed?defaultTimestep:Math.max(Math.min(et-frame.timestamp,maxElapsed),1),frame.timestamp=et,isProcessing=!0,stepsOrder.forEach(processStep),isProcessing=!1,runNextFrame&&(useDefaultElapsed=!1,onNextFrame(processFrame))},startLoop=()=>{runNextFrame=!0,useDefaultElapsed=!0,isProcessing||onNextFrame(processFrame)},getFrameData=()=>frame;function loopElapsed(et,o,tt=0){return et-o-tt}function reverseElapsed(et,o,tt=0,rt=!0){return rt?loopElapsed(o+-et,o,tt):o-(et-o)+tt}function hasRepeatDelayElapsed(et,o,tt,rt){return rt?et>=o+tt:et<=-tt}const framesync=et=>{const o=({delta:tt})=>et(tt);return{start:()=>sync.update(o,!0),stop:()=>cancelSync.update(o)}};function animate$1(et){var o,tt,{from:rt,autoplay:nt=!0,driver:ot=framesync,elapsed:it=0,repeat:st=0,repeatType:at="loop",repeatDelay:ct=0,onPlay:lt,onStop:dt,onComplete:ht,onRepeat:mt,onUpdate:ft}=et,pt=__rest(et,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:yt}=pt,gt,bt=0,xt=pt.duration,vt,Et=!1,Ct=!0,St;const At=detectAnimationFromOptions(pt);!((tt=(o=At).needsInterpolation)===null||tt===void 0)&&tt.call(o,rt,yt)&&(St=interpolate([0,100],[rt,yt],{clamp:!1}),rt=0,yt=100);const kt=At(Object.assign(Object.assign({},pt),{from:rt,to:yt}));function It(){bt++,at==="reverse"?(Ct=bt%2===0,it=reverseElapsed(it,xt,ct,Ct)):(it=loopElapsed(it,xt,ct),at==="mirror"&&kt.flipTarget()),Et=!1,mt&&mt()}function Nt(){gt.stop(),ht&&ht()}function Lt(zt){if(Ct||(zt=-zt),it+=zt,!Et){const Ut=kt.next(Math.max(0,it));vt=Ut.value,St&&(vt=St(vt)),Et=Ct?Ut.done:it<=0}ft==null||ft(vt),Et&&(bt===0&&(xt??(xt=it)),bt{dt==null||dt(),gt.stop()}}}function velocityPerSecond(et,o){return o?et*(1e3/o):0}function inertia({from:et=0,velocity:o=0,min:tt,max:rt,power:nt=.8,timeConstant:ot=750,bounceStiffness:it=500,bounceDamping:st=10,restDelta:at=1,modifyTarget:ct,driver:lt,onUpdate:dt,onComplete:ht,onStop:mt}){let ft;function pt(xt){return tt!==void 0&&xtrt}function yt(xt){return tt===void 0?rt:rt===void 0||Math.abs(tt-xt){var Et;dt==null||dt(vt),(Et=xt.onUpdate)===null||Et===void 0||Et.call(xt,vt)},onComplete:ht,onStop:mt}))}function bt(xt){gt(Object.assign({type:"spring",stiffness:it,damping:st,restDelta:at},xt))}if(pt(et))bt({from:et,velocity:o,to:yt(et)});else{let xt=nt*o+et;typeof ct<"u"&&(xt=ct(xt));const vt=yt(xt),Et=vt===tt?-1:1;let Ct,St;const At=kt=>{Ct=St,St=kt,o=velocityPerSecond(kt-Ct,getFrameData().delta),(Et===1&&kt>vt||Et===-1&&ktft==null?void 0:ft.stop()}}const isPoint=et=>et.hasOwnProperty("x")&&et.hasOwnProperty("y"),isPoint3D=et=>isPoint(et)&&et.hasOwnProperty("z"),distance1D=(et,o)=>Math.abs(et-o);function distance(et,o){if(isNum(et)&&isNum(o))return distance1D(et,o);if(isPoint(et)&&isPoint(o)){const tt=distance1D(et.x,o.x),rt=distance1D(et.y,o.y),nt=isPoint3D(et)&&isPoint3D(o)?distance1D(et.z,o.z):0;return Math.sqrt(Math.pow(tt,2)+Math.pow(rt,2)+Math.pow(nt,2))}}const a=(et,o)=>1-3*o+3*et,b$3=(et,o)=>3*o-6*et,c$2=et=>3*et,calcBezier=(et,o,tt)=>((a(o,tt)*et+b$3(o,tt))*et+c$2(o))*et,getSlope=(et,o,tt)=>3*a(o,tt)*et*et+2*b$3(o,tt)*et+c$2(o),subdivisionPrecision=1e-7,subdivisionMaxIterations=10;function binarySubdivide(et,o,tt,rt,nt){let ot,it,st=0;do it=o+(tt-o)/2,ot=calcBezier(it,rt,nt)-et,ot>0?tt=it:o=it;while(Math.abs(ot)>subdivisionPrecision&&++st=newtonMinSlope?newtonRaphsonIterate(it,dt,et,tt):ht===0?dt:binarySubdivide(it,st,st+kSampleStepSize,et,tt)}return it=>it===0||it===1?it:calcBezier(ot(it),o,rt)}function useTapGesture(et){var o=et.onTap,tt=et.onTapStart,rt=et.onTapCancel,nt=et.whileTap,ot=et.visualElement,it=o||tt||rt||nt,st=reactExports.useRef(!1),at=reactExports.useRef(null),ct={passive:!(tt||o||rt||ft)};function lt(){var pt;(pt=at.current)===null||pt===void 0||pt.call(at),at.current=null}function dt(){var pt;return lt(),st.current=!1,(pt=ot.animationState)===null||pt===void 0||pt.setActive(AnimationType.Tap,!1),!isDragActive()}function ht(pt,yt){dt()&&(isNodeOrChild(ot.getInstance(),pt.target)?o==null||o(pt,yt):rt==null||rt(pt,yt))}function mt(pt,yt){dt()&&(rt==null||rt(pt,yt))}function ft(pt,yt){var gt;lt(),!st.current&&(st.current=!0,at.current=pipe$1(addPointerEvent(window,"pointerup",ht,ct),addPointerEvent(window,"pointercancel",mt,ct)),(gt=ot.animationState)===null||gt===void 0||gt.setActive(AnimationType.Tap,!0),tt==null||tt(pt,yt))}usePointerEvent(ot,"pointerdown",it?ft:void 0,ct),useUnmountEffect(lt)}var warned=new Set;function warnOnce(et,o,tt){warned.has(o)||(console.warn(o),warned.add(o))}var observerCallbacks=new WeakMap,observers$1=new WeakMap,fireObserverCallback=function(et){var o;(o=observerCallbacks.get(et.target))===null||o===void 0||o(et)},fireAllObserverCallbacks=function(et){et.forEach(fireObserverCallback)};function initIntersectionObserver(et){var o=et.root,tt=__rest(et,["root"]),rt=o||document;observers$1.has(rt)||observers$1.set(rt,{});var nt=observers$1.get(rt),ot=JSON.stringify(tt);return nt[ot]||(nt[ot]=new IntersectionObserver(fireAllObserverCallbacks,__assign({root:o},tt))),nt[ot]}function observeIntersection(et,o,tt){var rt=initIntersectionObserver(o);return observerCallbacks.set(et,tt),rt.observe(et),function(){observerCallbacks.delete(et),rt.unobserve(et)}}function useViewport(et){var o=et.visualElement,tt=et.whileInView,rt=et.onViewportEnter,nt=et.onViewportLeave,ot=et.viewport,it=ot===void 0?{}:ot,st=reactExports.useRef({hasEnteredView:!1,isInView:!1}),at=!!(tt||rt||nt);it.once&&st.current.hasEnteredView&&(at=!1);var ct=typeof IntersectionObserver>"u"?useMissingIntersectionObserver:useIntersectionObserver;ct(at,st.current,o,it)}var thresholdNames={some:0,all:1};function useIntersectionObserver(et,o,tt,rt){var nt=rt.root,ot=rt.margin,it=rt.amount,st=it===void 0?"some":it,at=rt.once;reactExports.useEffect(function(){if(et){var ct={root:nt==null?void 0:nt.current,rootMargin:ot,threshold:typeof st=="number"?st:thresholdNames[st]},lt=function(dt){var ht,mt=dt.isIntersecting;if(o.isInView!==mt&&(o.isInView=mt,!(at&&!mt&&o.hasEnteredView))){mt&&(o.hasEnteredView=!0),(ht=tt.animationState)===null||ht===void 0||ht.setActive(AnimationType.InView,mt);var ft=tt.getProps(),pt=mt?ft.onViewportEnter:ft.onViewportLeave;pt==null||pt(dt)}};return observeIntersection(tt.getInstance(),ct,lt)}},[et,nt,ot,st])}function useMissingIntersectionObserver(et,o,tt,rt){var nt=rt.fallback,ot=nt===void 0?!0:nt;reactExports.useEffect(function(){!et||!ot||(env$1!=="production"&&warnOnce(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(function(){var it;o.hasEnteredView=!0;var st=tt.getProps().onViewportEnter;st==null||st(null),(it=tt.animationState)===null||it===void 0||it.setActive(AnimationType.InView,!0)}))},[et])}var makeRenderlessComponent=function(et){return function(o){return et(o),null}},gestureAnimations={inView:makeRenderlessComponent(useViewport),tap:makeRenderlessComponent(useTapGesture),focus:makeRenderlessComponent(useFocusGesture),hover:makeRenderlessComponent(useHoverGesture)},counter=0,incrementId=function(){return counter++},useId$1=function(){return useConstant(incrementId)};function usePresence$1(){var et=reactExports.useContext(PresenceContext);if(et===null)return[!0,null];var o=et.isPresent,tt=et.onExitComplete,rt=et.register,nt=useId$1();reactExports.useEffect(function(){return rt(nt)},[]);var ot=function(){return tt==null?void 0:tt(nt)};return!o&&tt?[!1,ot]:[!0]}function shallowCompare(et,o){if(!Array.isArray(o))return!1;var tt=o.length;if(tt!==et.length)return!1;for(var rt=0;rt-1&&et.splice(tt,1)}var SubscriptionManager$1=function(){function et(){this.subscriptions=[]}return et.prototype.add=function(o){var tt=this;return addUniqueItem(this.subscriptions,o),function(){return removeItem(tt.subscriptions,o)}},et.prototype.notify=function(o,tt,rt){var nt=this.subscriptions.length;if(nt)if(nt===1)this.subscriptions[0](o,tt,rt);else for(var ot=0;otbt&&Nt,Xt=Array.isArray(It)?It:[It],Wt=Xt.reduce(ot,{});Lt===!1&&(Wt={});var Ft=kt.prevResolvedValues,qt=Ft===void 0?{}:Ft,Pt=__assign(__assign({},qt),Wt),Yt=function(rr){Ut=!0,yt.delete(rr),kt.needsAnimating[rr]=!0};for(var Qt in Pt){var jt=Wt[Qt],Gt=qt[Qt];gt.hasOwnProperty(Qt)||(jt!==Gt?isKeyframesTarget(jt)&&isKeyframesTarget(Gt)?!shallowCompare(jt,Gt)||zt?Yt(Qt):kt.protectedKeys[Qt]=!0:jt!==void 0?Yt(Qt):yt.add(Qt):jt!==void 0&&yt.has(Qt)?Yt(Qt):kt.protectedKeys[Qt]=!0)}kt.prevProp=It,kt.prevResolvedValues=Wt,kt.isActive&&(gt=__assign(__assign({},gt),Wt)),nt&&et.blockInitialAnimation&&(Ut=!1),Ut&&!Mt&&pt.push.apply(pt,__spreadArray([],__read(Xt.map(function(rr){return{animation:rr,options:__assign({type:At},lt)}})),!1))},vt=0;vt=3;if(!(!mt&&!ft)){var pt=ht.point,yt=getFrameData().timestamp;nt.history.push(__assign(__assign({},pt),{timestamp:yt}));var gt=nt.handlers,bt=gt.onStart,xt=gt.onMove;mt||(bt&&bt(nt.lastMoveEvent,ht),nt.startEvent=nt.lastMoveEvent),xt&&xt(nt.lastMoveEvent,ht)}}},this.handlePointerMove=function(ht,mt){if(nt.lastMoveEvent=ht,nt.lastMoveEventInfo=transformPoint(mt,nt.transformPagePoint),isMouseEvent(ht)&&ht.buttons===0){nt.handlePointerUp(ht,mt);return}sync.update(nt.updatePoint,!0)},this.handlePointerUp=function(ht,mt){nt.end();var ft=nt.handlers,pt=ft.onEnd,yt=ft.onSessionEnd,gt=getPanInfo(transformPoint(mt,nt.transformPagePoint),nt.history);nt.startEvent&&pt&&pt(ht,gt),yt&&yt(ht,gt)},!(isTouchEvent(o)&&o.touches.length>1)){this.handlers=tt,this.transformPagePoint=it;var st=extractEventInfo(o),at=transformPoint(st,this.transformPagePoint),ct=at.point,lt=getFrameData().timestamp;this.history=[__assign(__assign({},ct),{timestamp:lt})];var dt=tt.onSessionStart;dt&&dt(o,getPanInfo(at,this.history)),this.removeListeners=pipe$1(addPointerEvent(window,"pointermove",this.handlePointerMove),addPointerEvent(window,"pointerup",this.handlePointerUp),addPointerEvent(window,"pointercancel",this.handlePointerUp))}}return et.prototype.updateHandlers=function(o){this.handlers=o},et.prototype.end=function(){this.removeListeners&&this.removeListeners(),cancelSync.update(this.updatePoint)},et}();function transformPoint(et,o){return o?{point:o(et.point)}:et}function subtractPoint(et,o){return{x:et.x-o.x,y:et.y-o.y}}function getPanInfo(et,o){var tt=et.point;return{point:tt,delta:subtractPoint(tt,lastDevicePoint(o)),offset:subtractPoint(tt,startDevicePoint(o)),velocity:getVelocity(o,.1)}}function startDevicePoint(et){return et[0]}function lastDevicePoint(et){return et[et.length-1]}function getVelocity(et,o){if(et.length<2)return{x:0,y:0};for(var tt=et.length-1,rt=null,nt=lastDevicePoint(et);tt>=0&&(rt=et[tt],!(nt.timestamp-rt.timestamp>secondsToMilliseconds(o)));)tt--;if(!rt)return{x:0,y:0};var ot=(nt.timestamp-rt.timestamp)/1e3;if(ot===0)return{x:0,y:0};var it={x:(nt.x-rt.x)/ot,y:(nt.y-rt.y)/ot};return it.x===1/0&&(it.x=0),it.y===1/0&&(it.y=0),it}function calcLength(et){return et.max-et.min}function isNear(et,o,tt){return o===void 0&&(o=0),tt===void 0&&(tt=.01),distance(et,o)nt&&(et=tt?mix(nt,et,tt.max):Math.min(et,nt)),et}function calcRelativeAxisConstraints(et,o,tt){return{min:o!==void 0?et.min+o:void 0,max:tt!==void 0?et.max+tt-(et.max-et.min):void 0}}function calcRelativeConstraints(et,o){var tt=o.top,rt=o.left,nt=o.bottom,ot=o.right;return{x:calcRelativeAxisConstraints(et.x,rt,ot),y:calcRelativeAxisConstraints(et.y,tt,nt)}}function calcViewportAxisConstraints(et,o){var tt,rt=o.min-et.min,nt=o.max-et.max;return o.max-o.minrt?tt=progress(o.min,o.max-rt,et.min):rt>nt&&(tt=progress(et.min,et.max-nt,o.min)),clamp$1(0,1,tt)}function rebaseAxisConstraints(et,o){var tt={};return o.min!==void 0&&(tt.min=o.min-et.min),o.max!==void 0&&(tt.max=o.max-et.min),tt}var defaultElastic=.35;function resolveDragElastic(et){return et===void 0&&(et=defaultElastic),et===!1?et=0:et===!0&&(et=defaultElastic),{x:resolveAxisElastic(et,"left","right"),y:resolveAxisElastic(et,"top","bottom")}}function resolveAxisElastic(et,o,tt){return{min:resolvePointElastic(et,o),max:resolvePointElastic(et,tt)}}function resolvePointElastic(et,o){var tt;return typeof et=="number"?et:(tt=et[o])!==null&&tt!==void 0?tt:0}var createAxisDelta=function(){return{translate:0,scale:1,origin:0,originPoint:0}},createDelta=function(){return{x:createAxisDelta(),y:createAxisDelta()}},createAxis=function(){return{min:0,max:0}},createBox=function(){return{x:createAxis(),y:createAxis()}};function eachAxis(et){return[et("x"),et("y")]}function convertBoundingBoxToBox(et){var o=et.top,tt=et.left,rt=et.right,nt=et.bottom;return{x:{min:tt,max:rt},y:{min:o,max:nt}}}function convertBoxToBoundingBox(et){var o=et.x,tt=et.y;return{top:tt.min,right:o.max,bottom:tt.max,left:o.min}}function transformBoxPoints(et,o){if(!o)return et;var tt=o({x:et.left,y:et.top}),rt=o({x:et.right,y:et.bottom});return{top:tt.y,left:tt.x,bottom:rt.y,right:rt.x}}function isIdentityScale(et){return et===void 0||et===1}function hasScale(et){var o=et.scale,tt=et.scaleX,rt=et.scaleY;return!isIdentityScale(o)||!isIdentityScale(tt)||!isIdentityScale(rt)}function hasTransform(et){return hasScale(et)||hasTranslate(et.x)||hasTranslate(et.y)||et.z||et.rotate||et.rotateX||et.rotateY}function hasTranslate(et){return et&&et!=="0%"}function scalePoint(et,o,tt){var rt=et-tt,nt=o*rt;return tt+nt}function applyPointDelta(et,o,tt,rt,nt){return nt!==void 0&&(et=scalePoint(et,nt,rt)),scalePoint(et,tt,rt)+o}function applyAxisDelta(et,o,tt,rt,nt){o===void 0&&(o=0),tt===void 0&&(tt=1),et.min=applyPointDelta(et.min,o,tt,rt,nt),et.max=applyPointDelta(et.max,o,tt,rt,nt)}function applyBoxDelta(et,o){var tt=o.x,rt=o.y;applyAxisDelta(et.x,tt.translate,tt.scale,tt.originPoint),applyAxisDelta(et.y,rt.translate,rt.scale,rt.originPoint)}function applyTreeDeltas(et,o,tt,rt){var nt,ot;rt===void 0&&(rt=!1);var it=tt.length;if(it){o.x=o.y=1;for(var st,at,ct=0;cto?tt="y":Math.abs(et.x)>o&&(tt="x"),tt}function useDrag(et){var o=et.dragControls,tt=et.visualElement,rt=useConstant(function(){return new VisualElementDragControls(tt)});reactExports.useEffect(function(){return o&&o.subscribe(rt)},[rt,o]),reactExports.useEffect(function(){return rt.addListeners()},[rt])}function usePanGesture(et){var o=et.onPan,tt=et.onPanStart,rt=et.onPanEnd,nt=et.onPanSessionStart,ot=et.visualElement,it=o||tt||rt||nt,st=reactExports.useRef(null),at=reactExports.useContext(MotionConfigContext).transformPagePoint,ct={onSessionStart:nt,onStart:tt,onMove:o,onEnd:function(dt,ht){st.current=null,rt&&rt(dt,ht)}};reactExports.useEffect(function(){st.current!==null&&st.current.updateHandlers(ct)});function lt(dt){st.current=new PanSession(dt,ct,{transformPagePoint:at})}usePointerEvent(ot,"pointerdown",it&<),useUnmountEffect(function(){return st.current&&st.current.end()})}var drag={pan:makeRenderlessComponent(usePanGesture),drag:makeRenderlessComponent(useDrag)},names$1=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function createLifecycles(){var et=names$1.map(function(){return new SubscriptionManager$1}),o={},tt={clearAllListeners:function(){return et.forEach(function(rt){return rt.clear()})},updatePropListeners:function(rt){names$1.forEach(function(nt){var ot,it="on"+nt,st=rt[it];(ot=o[nt])===null||ot===void 0||ot.call(o),st&&(o[nt]=tt[it](st))})}};return et.forEach(function(rt,nt){tt["on"+names$1[nt]]=function(ot){return rt.add(ot)},tt["notify"+names$1[nt]]=function(){for(var ot=[],it=0;it=0?window.pageYOffset:null,ct=convertChangedValueTypes(o,et,st);return ot.length&&ot.forEach(function(lt){var dt=__read(lt,2),ht=dt[0],mt=dt[1];et.getValue(ht).set(mt)}),et.syncRender(),at!==null&&window.scrollTo({top:at}),{target:ct,transitionEnd:rt}}else return{target:o,transitionEnd:rt}};function unitConversion(et,o,tt,rt){return hasPositionalKey(o)?checkAndConvertChangedValueTypes(et,o,tt,rt):{target:o,transitionEnd:rt}}var parseDomVariant=function(et,o,tt,rt){var nt=resolveCSSVariables(et,o,rt);return o=nt.target,rt=nt.transitionEnd,unitConversion(et,o,tt,rt)};function getComputedStyle$1(et){return window.getComputedStyle(et)}var htmlConfig={treeType:"dom",readValueFromInstance:function(et,o){if(isTransformProp(o)){var tt=getDefaultValueType(o);return tt&&tt.default||0}else{var rt=getComputedStyle$1(et);return(isCSSVariable$1(o)?rt.getPropertyValue(o):rt[o])||0}},sortNodePosition:function(et,o){return et.compareDocumentPosition(o)&2?1:-1},getBaseTarget:function(et,o){var tt;return(tt=et.style)===null||tt===void 0?void 0:tt[o]},measureViewportBox:function(et,o){var tt=o.transformPagePoint;return measureViewportBox(et,tt)},resetTransform:function(et,o,tt){var rt=tt.transformTemplate;o.style.transform=rt?rt({},""):"none",et.scheduleRender()},restoreTransform:function(et,o){et.style.transform=o.style.transform},removeValueFromRenderState:function(et,o){var tt=o.vars,rt=o.style;delete tt[et],delete rt[et]},makeTargetAnimatable:function(et,o,tt,rt){var nt=tt.transformValues;rt===void 0&&(rt=!0);var ot=o.transition,it=o.transitionEnd,st=__rest(o,["transition","transitionEnd"]),at=getOrigin(st,ot||{},et);if(nt&&(it&&(it=nt(it)),st&&(st=nt(st)),at&&(at=nt(at))),rt){checkTargetForNewValues(et,st,at);var ct=parseDomVariant(et,st,at,it);it=ct.transitionEnd,st=ct.target}return __assign({transition:ot,transitionEnd:it},st)},scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,build:function(et,o,tt,rt,nt){et.isVisible!==void 0&&(o.style.visibility=et.isVisible?"visible":"hidden"),buildHTMLStyles(o,tt,rt,nt.transformTemplate)},render:renderHTML},htmlVisualElement=visualElement(htmlConfig),svgVisualElement=visualElement(__assign(__assign({},htmlConfig),{getBaseTarget:function(et,o){return et[o]},readValueFromInstance:function(et,o){var tt;return isTransformProp(o)?((tt=getDefaultValueType(o))===null||tt===void 0?void 0:tt.default)||0:(o=camelCaseAttributes.has(o)?o:camelToDash(o),et.getAttribute(o))},scrapeMotionValuesFromProps,build:function(et,o,tt,rt,nt){buildSVGAttrs(o,tt,rt,nt.transformTemplate)},render:renderSVG})),createDomVisualElement=function(et,o){return isSVGComponent(et)?svgVisualElement(o,{enableHardwareAcceleration:!1}):htmlVisualElement(o,{enableHardwareAcceleration:!0})};function pixelsToPercent(et,o){return o.max===o.min?0:et/(o.max-o.min)*100}var correctBorderRadius={correct:function(et,o){if(!o.target)return et;if(typeof et=="string")if(px.test(et))et=parseFloat(et);else return et;var tt=pixelsToPercent(et,o.target.x),rt=pixelsToPercent(et,o.target.y);return"".concat(tt,"% ").concat(rt,"%")}},varToken="_$css",correctBoxShadow={correct:function(et,o){var tt=o.treeScale,rt=o.projectionDelta,nt=et,ot=et.includes("var("),it=[];ot&&(et=et.replace(cssVariableRegex,function(pt){return it.push(pt),varToken}));var st=complex.parse(et);if(st.length>5)return nt;var at=complex.createTransformer(et),ct=typeof st[0]!="number"?1:0,lt=rt.x.scale*tt.x,dt=rt.y.scale*tt.y;st[0+ct]/=lt,st[1+ct]/=dt;var ht=mix(lt,dt,.5);typeof st[2+ct]=="number"&&(st[2+ct]/=ht),typeof st[3+ct]=="number"&&(st[3+ct]/=ht);var mt=at(st);if(ot){var ft=0;mt=mt.replace(varToken,function(){var pt=it[ft];return ft++,pt})}return mt}},MeasureLayoutWithContext=function(et){__extends(o,et);function o(){return et!==null&&et.apply(this,arguments)||this}return o.prototype.componentDidMount=function(){var tt=this,rt=this.props,nt=rt.visualElement,ot=rt.layoutGroup,it=rt.switchLayoutGroup,st=rt.layoutId,at=nt.projection;addScaleCorrector(defaultScaleCorrectors),at&&(ot!=null&&ot.group&&ot.group.add(at),it!=null&&it.register&&st&&it.register(at),at.root.didUpdate(),at.addEventListener("animationComplete",function(){tt.safeToRemove()}),at.setOptions(__assign(__assign({},at.options),{onExitComplete:function(){return tt.safeToRemove()}}))),globalProjectionState.hasEverUpdated=!0},o.prototype.getSnapshotBeforeUpdate=function(tt){var rt=this,nt=this.props,ot=nt.layoutDependency,it=nt.visualElement,st=nt.drag,at=nt.isPresent,ct=it.projection;return ct&&(ct.isPresent=at,st||tt.layoutDependency!==ot||ot===void 0?ct.willUpdate():this.safeToRemove(),tt.isPresent!==at&&(at?ct.promote():ct.relegate()||sync.postRender(function(){var lt;!((lt=ct.getStack())===null||lt===void 0)&<.members.length||rt.safeToRemove()}))),null},o.prototype.componentDidUpdate=function(){var tt=this.props.visualElement.projection;tt&&(tt.root.didUpdate(),!tt.currentAnimation&&tt.isLead()&&this.safeToRemove())},o.prototype.componentWillUnmount=function(){var tt=this.props,rt=tt.visualElement,nt=tt.layoutGroup,ot=tt.switchLayoutGroup,it=rt.projection;it&&(it.scheduleCheckAfterUnmount(),nt!=null&&nt.group&&nt.group.remove(it),ot!=null&&ot.deregister&&ot.deregister(it))},o.prototype.safeToRemove=function(){var tt=this.props.safeToRemove;tt==null||tt()},o.prototype.render=function(){return null},o}(React.Component);function MeasureLayout(et){var o=__read(usePresence$1(),2),tt=o[0],rt=o[1],nt=reactExports.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,__assign({},et,{layoutGroup:nt,switchLayoutGroup:reactExports.useContext(SwitchLayoutGroupContext),isPresent:tt,safeToRemove:rt}))}var defaultScaleCorrectors={borderRadius:__assign(__assign({},correctBorderRadius),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},layoutFeatures={measureLayout:MeasureLayout};function animate(et,o,tt){tt===void 0&&(tt={});var rt=isMotionValue(et)?et:motionValue(et);return startAnimation("",rt,o,tt),{stop:function(){return rt.stop()},isAnimating:function(){return rt.isAnimating()}}}var borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=function(et){return typeof et=="string"?parseFloat(et):et},isPx=function(et){return typeof et=="number"||px.test(et)};function mixValues(et,o,tt,rt,nt,ot){var it,st,at,ct;nt?(et.opacity=mix(0,(it=tt.opacity)!==null&&it!==void 0?it:1,easeCrossfadeIn(rt)),et.opacityExit=mix((st=o.opacity)!==null&&st!==void 0?st:1,0,easeCrossfadeOut(rt))):ot&&(et.opacity=mix((at=o.opacity)!==null&&at!==void 0?at:1,(ct=tt.opacity)!==null&&ct!==void 0?ct:1,rt));for(var lt=0;lto?1:tt(progress(et,o,rt))}}function copyAxisInto(et,o){et.min=o.min,et.max=o.max}function copyBoxInto(et,o){copyAxisInto(et.x,o.x),copyAxisInto(et.y,o.y)}function removePointDelta(et,o,tt,rt,nt){return et-=o,et=scalePoint(et,1/tt,rt),nt!==void 0&&(et=scalePoint(et,1/nt,rt)),et}function removeAxisDelta(et,o,tt,rt,nt,ot,it){if(o===void 0&&(o=0),tt===void 0&&(tt=1),rt===void 0&&(rt=.5),ot===void 0&&(ot=et),it===void 0&&(it=et),percent.test(o)){o=parseFloat(o);var st=mix(it.min,it.max,o/100);o=st-it.min}if(typeof o=="number"){var at=mix(ot.min,ot.max,rt);et===ot&&(at-=o),et.min=removePointDelta(et.min,o,tt,at,nt),et.max=removePointDelta(et.max,o,tt,at,nt)}}function removeAxisTransforms(et,o,tt,rt,nt){var ot=__read(tt,3),it=ot[0],st=ot[1],at=ot[2];removeAxisDelta(et,o[it],o[st],o[at],o.scale,rt,nt)}var xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(et,o,tt,rt){removeAxisTransforms(et.x,o,xKeys,tt==null?void 0:tt.x,rt==null?void 0:rt.x),removeAxisTransforms(et.y,o,yKeys,tt==null?void 0:tt.y,rt==null?void 0:rt.y)}function isAxisDeltaZero(et){return et.translate===0&&et.scale===1}function isDeltaZero(et){return isAxisDeltaZero(et.x)&&isAxisDeltaZero(et.y)}function boxEquals(et,o){return et.x.min===o.x.min&&et.x.max===o.x.max&&et.y.min===o.y.min&&et.y.max===o.y.max}var NodeStack=function(){function et(){this.members=[]}return et.prototype.add=function(o){addUniqueItem(this.members,o),o.scheduleRender()},et.prototype.remove=function(o){if(removeItem(this.members,o),o===this.prevLead&&(this.prevLead=void 0),o===this.lead){var tt=this.members[this.members.length-1];tt&&this.promote(tt)}},et.prototype.relegate=function(o){var tt=this.members.findIndex(function(it){return o===it});if(tt===0)return!1;for(var rt,nt=tt;nt>=0;nt--){var ot=this.members[nt];if(ot.isPresent!==!1){rt=ot;break}}return rt?(this.promote(rt),!0):!1},et.prototype.promote=function(o,tt){var rt,nt=this.lead;if(o!==nt&&(this.prevLead=nt,this.lead=o,o.show(),nt)){nt.instance&&nt.scheduleRender(),o.scheduleRender(),o.resumeFrom=nt,tt&&(o.resumeFrom.preserveOpacity=!0),nt.snapshot&&(o.snapshot=nt.snapshot,o.snapshot.latestValues=nt.animationValues||nt.latestValues,o.snapshot.isShared=!0),!((rt=o.root)===null||rt===void 0)&&rt.isUpdating&&(o.isLayoutDirty=!0);var ot=o.options.crossfade;ot===!1&&nt.hide()}},et.prototype.exitAnimationComplete=function(){this.members.forEach(function(o){var tt,rt,nt,ot,it;(rt=(tt=o.options).onExitComplete)===null||rt===void 0||rt.call(tt),(it=(nt=o.resumingFrom)===null||nt===void 0?void 0:(ot=nt.options).onExitComplete)===null||it===void 0||it.call(ot)})},et.prototype.scheduleRender=function(){this.members.forEach(function(o){o.instance&&o.scheduleRender(!1)})},et.prototype.removeLeadSnapshot=function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)},et}(),identityProjection="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function buildProjectionTransform(et,o,tt){var rt=et.x.translate/o.x,nt=et.y.translate/o.y,ot="translate3d(".concat(rt,"px, ").concat(nt,"px, 0) ");if(ot+="scale(".concat(1/o.x,", ").concat(1/o.y,") "),tt){var it=tt.rotate,st=tt.rotateX,at=tt.rotateY;it&&(ot+="rotate(".concat(it,"deg) ")),st&&(ot+="rotateX(".concat(st,"deg) ")),at&&(ot+="rotateY(".concat(at,"deg) "))}var ct=et.x.scale*o.x,lt=et.y.scale*o.y;return ot+="scale(".concat(ct,", ").concat(lt,")"),ot===identityProjection?"none":ot}var compareByDepth=function(et,o){return et.depth-o.depth},FlatTree=function(){function et(){this.children=[],this.isDirty=!1}return et.prototype.add=function(o){addUniqueItem(this.children,o),this.isDirty=!0},et.prototype.remove=function(o){removeItem(this.children,o),this.isDirty=!0},et.prototype.forEach=function(o){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(o)},et}(),animationTarget=1e3;function createProjectionNode(et){var o=et.attachResizeListener,tt=et.defaultParent,rt=et.measureScroll,nt=et.checkIsScrollRoot,ot=et.resetTransform;return function(){function it(st,at,ct){var lt=this;at===void 0&&(at={}),ct===void 0&&(ct=tt==null?void 0:tt()),this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=function(){lt.isUpdating&&(lt.isUpdating=!1,lt.clearAllSnapshots())},this.updateProjection=function(){lt.nodes.forEach(resolveTargetDelta),lt.nodes.forEach(calcProjection)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=st,this.latestValues=at,this.root=ct?ct.root||ct:this,this.path=ct?__spreadArray(__spreadArray([],__read(ct.path),!1),[ct],!1):[],this.parent=ct,this.depth=ct?ct.depth+1:0,st&&this.root.registerPotentialNode(st,this);for(var dt=0;dt=0;rt--)if(et.path[rt].instance){tt=et.path[rt];break}var nt=tt&&tt!==et.root?tt.instance:document,ot=nt.querySelector('[data-projection-id="'.concat(o,'"]'));ot&&et.mount(ot,!0)}function roundAxis(et){et.min=Math.round(et.min),et.max=Math.round(et.max)}function roundBox(et){roundAxis(et.x),roundAxis(et.y)}var DocumentProjectionNode=createProjectionNode({attachResizeListener:function(et,o){return addDomEvent(et,"resize",o)},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}},checkIsScrollRoot:function(){return!0}}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:function(et){return{x:et.scrollLeft,y:et.scrollTop}},defaultParent:function(){if(!rootProjectionNode.current){var et=new DocumentProjectionNode(0,{});et.mount(window),et.setOptions({layoutScroll:!0}),rootProjectionNode.current=et}return rootProjectionNode.current},resetTransform:function(et,o){et.style.transform=o??"none"},checkIsScrollRoot:function(et){return window.getComputedStyle(et).position==="fixed"}}),featureBundle=__assign(__assign(__assign(__assign({},animations),gestureAnimations),drag),layoutFeatures),motion=createMotionProxy(function(et,o){return createDomMotionConfig(et,o,featureBundle,createDomVisualElement,HTMLProjectionNode)});function useIsMounted$1(){var et=reactExports.useRef(!1);return useIsomorphicLayoutEffect$3(function(){return et.current=!0,function(){et.current=!1}},[]),et}function useForceUpdate(){var et=useIsMounted$1(),o=__read(reactExports.useState(0),2),tt=o[0],rt=o[1],nt=reactExports.useCallback(function(){et.current&&rt(tt+1)},[tt]),ot=reactExports.useCallback(function(){return sync.postRender(nt)},[nt]);return[ot,tt]}var PresenceChild=function(et){var o=et.children,tt=et.initial,rt=et.isPresent,nt=et.onExitComplete,ot=et.custom,it=et.presenceAffectsLayout,st=useConstant(newChildrenMap),at=useId$1(),ct=reactExports.useMemo(function(){return{id:at,initial:tt,isPresent:rt,custom:ot,onExitComplete:function(lt){var dt,ht;st.set(lt,!0);try{for(var mt=__values(st.values()),ft=mt.next();!ft.done;ft=mt.next()){var pt=ft.value;if(!pt)return}}catch(yt){dt={error:yt}}finally{try{ft&&!ft.done&&(ht=mt.return)&&ht.call(mt)}finally{if(dt)throw dt.error}}nt==null||nt()},register:function(lt){return st.set(lt,!1),function(){return st.delete(lt)}}}},it?void 0:[rt]);return reactExports.useMemo(function(){st.forEach(function(lt,dt){return st.set(dt,!1)})},[rt]),reactExports.useEffect(function(){!rt&&!st.size&&(nt==null||nt())},[rt]),reactExports.createElement(PresenceContext.Provider,{value:ct},o)};function newChildrenMap(){return new Map}var getChildKey=function(et){return et.key||""};function updateChildLookup(et,o){et.forEach(function(tt){var rt=getChildKey(tt);o.set(rt,tt)})}function onlyElements(et){var o=[];return reactExports.Children.forEach(et,function(tt){reactExports.isValidElement(tt)&&o.push(tt)}),o}var AnimatePresence=function(et){var o=et.children,tt=et.custom,rt=et.initial,nt=rt===void 0?!0:rt,ot=et.onExitComplete,it=et.exitBeforeEnter,st=et.presenceAffectsLayout,at=st===void 0?!0:st,ct=__read(useForceUpdate(),1),lt=ct[0],dt=reactExports.useContext(LayoutGroupContext).forceRender;dt&&(lt=dt);var ht=useIsMounted$1(),mt=onlyElements(o),ft=mt,pt=new Set,yt=reactExports.useRef(ft),gt=reactExports.useRef(new Map).current,bt=reactExports.useRef(!0);if(useIsomorphicLayoutEffect$3(function(){bt.current=!1,updateChildLookup(mt,gt),yt.current=ft}),useUnmountEffect(function(){bt.current=!0,gt.clear(),pt.clear()}),bt.current)return reactExports.createElement(reactExports.Fragment,null,ft.map(function(At){return reactExports.createElement(PresenceChild,{key:getChildKey(At),isPresent:!0,initial:nt?void 0:!1,presenceAffectsLayout:at},At)}));ft=__spreadArray([],__read(ft),!1);for(var xt=yt.current.map(getChildKey),vt=mt.map(getChildKey),Et=xt.length,Ct=0;Ct1&&console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour."),reactExports.createElement(reactExports.Fragment,null,pt.size?ft:ft.map(function(At){return reactExports.cloneElement(At)}))};function MotionConfig(et){var o=et.children,tt=et.isValidProp,rt=__rest(et,["children","isValidProp"]);tt&&loadExternalIsValidProp(tt),rt=__assign(__assign({},reactExports.useContext(MotionConfigContext)),rt),rt.isStatic=useConstant(function(){return rt.isStatic});var nt=reactExports.useMemo(function(){return rt},[JSON.stringify(rt.transition),rt.transformPagePoint,rt.reducedMotion]);return reactExports.createElement(MotionConfigContext.Provider,{value:nt},o)}var reactIs$2={exports:{}},reactIs_production_min$1={};/** - * @license React - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var b$2=Symbol.for("react.element"),c$1=Symbol.for("react.portal"),d$2=Symbol.for("react.fragment"),e$1=Symbol.for("react.strict_mode"),f$1=Symbol.for("react.profiler"),g$2=Symbol.for("react.provider"),h$2=Symbol.for("react.context"),k$2=Symbol.for("react.server_context"),l$1=Symbol.for("react.forward_ref"),m$3=Symbol.for("react.suspense"),n$1=Symbol.for("react.suspense_list"),p$1=Symbol.for("react.memo"),q$2=Symbol.for("react.lazy"),t$1=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");function v$2(et){if(typeof et=="object"&&et!==null){var o=et.$$typeof;switch(o){case b$2:switch(et=et.type,et){case d$2:case f$1:case e$1:case m$3:case n$1:return et;default:switch(et=et&&et.$$typeof,et){case k$2:case h$2:case l$1:case q$2:case p$1:case g$2:return et;default:return o}}case c$1:return o}}}reactIs_production_min$1.ContextConsumer=h$2;reactIs_production_min$1.ContextProvider=g$2;reactIs_production_min$1.Element=b$2;reactIs_production_min$1.ForwardRef=l$1;reactIs_production_min$1.Fragment=d$2;reactIs_production_min$1.Lazy=q$2;reactIs_production_min$1.Memo=p$1;reactIs_production_min$1.Portal=c$1;reactIs_production_min$1.Profiler=f$1;reactIs_production_min$1.StrictMode=e$1;reactIs_production_min$1.Suspense=m$3;reactIs_production_min$1.SuspenseList=n$1;reactIs_production_min$1.isAsyncMode=function(){return!1};reactIs_production_min$1.isConcurrentMode=function(){return!1};reactIs_production_min$1.isContextConsumer=function(et){return v$2(et)===h$2};reactIs_production_min$1.isContextProvider=function(et){return v$2(et)===g$2};reactIs_production_min$1.isElement=function(et){return typeof et=="object"&&et!==null&&et.$$typeof===b$2};reactIs_production_min$1.isForwardRef=function(et){return v$2(et)===l$1};reactIs_production_min$1.isFragment=function(et){return v$2(et)===d$2};reactIs_production_min$1.isLazy=function(et){return v$2(et)===q$2};reactIs_production_min$1.isMemo=function(et){return v$2(et)===p$1};reactIs_production_min$1.isPortal=function(et){return v$2(et)===c$1};reactIs_production_min$1.isProfiler=function(et){return v$2(et)===f$1};reactIs_production_min$1.isStrictMode=function(et){return v$2(et)===e$1};reactIs_production_min$1.isSuspense=function(et){return v$2(et)===m$3};reactIs_production_min$1.isSuspenseList=function(et){return v$2(et)===n$1};reactIs_production_min$1.isValidElementType=function(et){return typeof et=="string"||typeof et=="function"||et===d$2||et===f$1||et===e$1||et===m$3||et===n$1||et===t$1||typeof et=="object"&&et!==null&&(et.$$typeof===q$2||et.$$typeof===p$1||et.$$typeof===g$2||et.$$typeof===h$2||et.$$typeof===l$1||et.$$typeof===u||et.getModuleId!==void 0)};reactIs_production_min$1.typeOf=v$2;reactIs$2.exports=reactIs_production_min$1;var reactIsExports$1=reactIs$2.exports;function stylis_min(et){function o(Qt,jt,Gt,rr,Ht){for(var dr=0,Zt=0,Jt=0,tr=0,_t,Bt,Vt=0,er=0,ar,ur=ar=_t=0,cr=0,hr=0,Sr=0,pr=0,wr=Gt.length,_r=wr-1,Tr,gr="",vr="",ir="",Tt="",$t;cr_t)&&(pr=(gr=gr.replace(" ",":")).length),0rr&&(rr=(jt=jt.trim()).charCodeAt(0)),rr){case 38:return jt.replace(gt,"$1"+Qt.trim());case 58:return Qt.trim()+jt.replace(gt,"$1"+Qt.trim());default:if(0<1*Gt&&0Zt.charCodeAt(8))break;case 115:Ht=Ht.replace(Zt,"-webkit-"+Zt)+";"+Ht;break;case 207:case 102:Ht=Ht.replace(Zt,"-webkit-"+(102Gt.charCodeAt(0)&&(Gt=Gt.trim()),Yt=Gt,Gt=[Yt],01?o-1:0),rt=1;rt0?" Args: "+tt.join(", "):""))}var j=function(){function et(tt){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=tt}var o=et.prototype;return o.indexOfGroup=function(tt){for(var rt=0,nt=0;nt=this.groupSizes.length){for(var nt=this.groupSizes,ot=nt.length,it=ot;tt>=it;)(it<<=1)<0&&D(16,""+tt);this.groupSizes=new Uint32Array(it),this.groupSizes.set(nt),this.length=it;for(var st=ot;st=this.length||this.groupSizes[tt]===0)return rt;for(var nt=this.groupSizes[tt],ot=this.indexOfGroup(tt),it=ot+nt,st=ot;st=k&&(k=o+1),T.set(et,o),x.set(o,et)},M="style["+N+'][data-styled-version="5.3.11"]',G=new RegExp("^"+N+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),L=function(et,o,tt){for(var rt,nt=tt.split(","),ot=0,it=nt.length;ot=0;ct--){var lt=at[ct];if(lt&<.nodeType===1&<.hasAttribute(N))return lt}}(tt),ot=nt!==void 0?nt.nextSibling:null;rt.setAttribute(N,"active"),rt.setAttribute("data-styled-version","5.3.11");var it=Y();return it&&rt.setAttribute("nonce",it),tt.insertBefore(rt,ot),rt},H=function(){function et(tt){var rt=this.element=q(tt);rt.appendChild(document.createTextNode("")),this.sheet=function(nt){if(nt.sheet)return nt.sheet;for(var ot=document.styleSheets,it=0,st=ot.length;it=0){var nt=document.createTextNode(rt),ot=this.nodes[tt];return this.element.insertBefore(nt,ot||null),this.length++,!0}return!1},o.deleteRule=function(tt){this.element.removeChild(this.nodes[tt]),this.length--},o.getRule=function(tt){return tt0&&(dt+=ht+",")}),ot+=""+ct+lt+'{content:"'+dt+`"}/*!sc*/ -`}}}return ot}(this)},et}(),Z=/(a)(d)/gi,K=function(et){return String.fromCharCode(et+(et>25?39:97))};function Q(et){var o,tt="";for(o=Math.abs(et);o>52;o=o/52|0)tt=K(o%52)+tt;return(K(o%52)+tt).replace(Z,"$1-$2")}var ee=function(et,o){for(var tt=o.length;tt;)et=33*et^o.charCodeAt(--tt);return et},te=function(et){return ee(5381,et)};function ne(et){for(var o=0;o>>0);if(!tt.hasNameForId(nt,st)){var at=rt(it,"."+st,void 0,nt);tt.insertRules(nt,st,at)}ot.push(st),this.staticRulesId=st}else{for(var ct=this.rules.length,lt=ee(this.baseHash,rt.hash),dt="",ht=0;ht>>0);if(!tt.hasNameForId(nt,yt)){var gt=rt(dt,"."+yt,void 0,nt);tt.insertRules(nt,yt,gt)}ot.push(yt)}}return ot.join(" ")},et}(),se=/^\s*\/\/.*$/gm,ie=[":","[",".","#"];function ae(et){var o,tt,rt,nt,ot=w$1,it=ot.options,st=it===void 0?w$1:it,at=ot.plugins,ct=at===void 0?S:at,lt=new stylis_min(st),dt=[],ht=function(pt){function yt(gt){if(gt)try{pt(gt+"}")}catch{}}return function(gt,bt,xt,vt,Et,Ct,St,At,kt,It){switch(gt){case 1:if(kt===0&&bt.charCodeAt(0)===64)return pt(bt+";"),"";break;case 2:if(At===0)return bt+"/*|*/";break;case 3:switch(At){case 102:case 112:return pt(xt[0]+bt),"";default:return bt+(It===0?"/*|*/":"")}case-2:bt.split("/*|*/}").forEach(yt)}}}(function(pt){dt.push(pt)}),mt=function(pt,yt,gt){return yt===0&&ie.indexOf(gt[tt.length])!==-1||gt.match(nt)?pt:"."+o};function ft(pt,yt,gt,bt){bt===void 0&&(bt="&");var xt=pt.replace(se,""),vt=yt&>?gt+" "+yt+" { "+xt+" }":xt;return o=bt,tt=yt,rt=new RegExp("\\"+tt+"\\b","g"),nt=new RegExp("(\\"+tt+"\\b){2,}"),lt(gt||!yt?"":yt,vt)}return lt.use([].concat(ct,[function(pt,yt,gt){pt===2&>.length&>[0].lastIndexOf(tt)>0&&(gt[0]=gt[0].replace(rt,mt))},ht,function(pt){if(pt===-2){var yt=dt;return dt=[],yt}}])),ft.hash=ct.length?ct.reduce(function(pt,yt){return yt.name||D(15),ee(pt,yt.name)},5381).toString():"",ft}var ce=React.createContext();ce.Consumer;var le=React.createContext(),de=(le.Consumer,new X),he=ae();function pe(){return reactExports.useContext(ce)||de}function fe(){return reactExports.useContext(le)||he}var ye=function(){function et(o,tt){var rt=this;this.inject=function(nt,ot){ot===void 0&&(ot=he);var it=rt.name+ot.hash;nt.hasNameForId(rt.id,it)||nt.insertRules(rt.id,it,ot(rt.rules,it,"@keyframes"))},this.toString=function(){return D(12,String(rt.name))},this.name=o,this.id="sc-keyframes-"+o,this.rules=tt}return et.prototype.getName=function(o){return o===void 0&&(o=he),this.name+o.hash},et}(),ve=/([A-Z])/,ge=/([A-Z])/g,Se=/^ms-/,we=function(et){return"-"+et.toLowerCase()};function Ee(et){return ve.test(et)?et.replace(ge,we).replace(Se,"-ms-"):et}var be=function(et){return et==null||et===!1||et===""};function _e(et,o,tt,rt){if(Array.isArray(et)){for(var nt,ot=[],it=0,st=et.length;it1?o-1:0),rt=1;rt?@[\\\]^`{|}~-]+/g,De=/(^-|-$)/g;function je(et){return et.replace(Re,"-").replace(De,"")}var Te=function(et){return Q(te(et)>>>0)};function xe(et){return typeof et=="string"&&!0}var ke=function(et){return typeof et=="function"||typeof et=="object"&&et!==null&&!Array.isArray(et)},Ve=function(et){return et!=="__proto__"&&et!=="constructor"&&et!=="prototype"};function Be(et,o,tt){var rt=et[tt];ke(o)&&ke(rt)?ze(rt,o):et[tt]=o}function ze(et){for(var o=arguments.length,tt=new Array(o>1?o-1:0),rt=1;rt=0||(It[At]=Ct[At]);return It}(o,["componentId"]),Et=xt&&xt+"-"+(xe(bt)?bt:je(b(bt)));return Ye(bt,y$1({},vt,{attrs:ht,componentId:Et}),tt)},Object.defineProperty(ft,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(bt){this._foldedDefaultProps=rt?ze({},et.defaultProps,bt):bt}}),Object.defineProperty(ft,"toString",{value:function(){return"."+ft.styledComponentId}}),nt&&m$1(ft,et,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),ft}var qe=function(et){return function o(tt,rt,nt){if(nt===void 0&&(nt=w$1),!reactIsExports$1.isValidElementType(rt))return D(1,String(rt));var ot=function(){return tt(rt,nt,Ae.apply(void 0,arguments))};return ot.withConfig=function(it){return o(tt,rt,y$1({},nt,{},it))},ot.attrs=function(it){return o(tt,rt,y$1({},nt,{attrs:Array.prototype.concat(nt.attrs,it).filter(Boolean)}))},ot}(Ye,et)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(et){qe[et]=qe(et)});function We(et){for(var o=arguments.length,tt=new Array(o>1?o-1:0),rt=1;rt>--at&1}const dt=31,ht=2**dt,mt=ht>>>1,ft=mt>>1,pt=ht-1;let yt=0;for(let Et=0;Et1;){let It=Ct+St>>>1;Et>>1|lt(),At=At<<1^mt,kt=(kt^mt)<<1|mt|1;bt=At,xt=1+kt-At}let vt=rt-4;return gt.map(Et=>{switch(Et-vt){case 3:return vt+65792+(et[st++]<<16|et[st++]<<8|et[st++]);case 2:return vt+256+(et[st++]<<8|et[st++]);case 1:return vt+et[st++];default:return Et-1}})}function read_payload(et){let o=0;return()=>et[o++]}function read_compressed_payload(et){return read_payload(decode_arithmetic(unsafe_atob(et)))}function unsafe_atob(et){let o=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((nt,ot)=>o[nt.charCodeAt(0)]=ot);let tt=et.length,rt=new Uint8Array(6*tt>>3);for(let nt=0,ot=0,it=0,st=0;nt=8&&(rt[ot++]=st>>(it-=8));return rt}function signed(et){return et&1?~et>>1:et>>1}function read_deltas(et,o){let tt=Array(et);for(let rt=0,nt=0;rt{let o=read_sorted(et);if(o.length)return o})}function read_mapped(et){let o=[];for(;;){let tt=et();if(tt==0)break;o.push(read_linear_table(tt,et))}for(;;){let tt=et()-1;if(tt<0)break;o.push(read_replacement_table(tt,et))}return o.flat()}function read_array_while(et){let o=[];for(;;){let tt=et(o.length);if(!tt)break;o.push(tt)}return o}function read_transposed(et,o,tt){let rt=Array(et).fill().map(()=>[]);for(let nt=0;ntrt[it].push(ot));return rt}function read_linear_table(et,o){let tt=1+o(),rt=o(),nt=read_array_while(o);return read_transposed(nt.length,1+et,o).flatMap((it,st)=>{let[at,...ct]=it;return Array(nt[st]).fill().map((lt,dt)=>{let ht=dt*rt;return[at+dt*tt,ct.map(mt=>mt+ht)]})})}function read_replacement_table(et,o){let tt=1+o();return read_transposed(tt,1+et,o).map(nt=>[nt[0],nt.slice(1)])}function read_trie(et){let o=[],tt=read_sorted(et);return nt(rt([]),[]),o;function rt(ot){let it=et(),st=read_array_while(()=>{let at=read_sorted(et).map(ct=>tt[ct]);if(at.length)return rt(at)});return{S:it,B:st,Q:ot}}function nt({S:ot,B:it},st,at){if(!(ot&4&&at===st[st.length-1])){ot&2&&(at=st[st.length-1]),ot&1&&o.push(st);for(let ct of it)for(let lt of ct.Q)nt(ct,[...st,lt],at)}}}function hex_cp(et){return et.toString(16).toUpperCase().padStart(2,"0")}function quote_cp(et){return`{${hex_cp(et)}}`}function explode_cp(et){let o=[];for(let tt=0,rt=et.length;tt>24&255}function unpack_cp(et){return et&16777215}let SHIFTED_RANK,EXCLUSIONS,DECOMP,RECOMP;function init$1(){let et=read_compressed_payload(COMPRESSED);SHIFTED_RANK=new Map(read_sorted_arrays(et).flatMap((o,tt)=>o.map(rt=>[rt,tt+1<<24]))),EXCLUSIONS=new Set(read_sorted(et)),DECOMP=new Map,RECOMP=new Map;for(let[o,tt]of read_mapped(et)){if(!EXCLUSIONS.has(o)&&tt.length==2){let[rt,nt]=tt,ot=RECOMP.get(rt);ot||(ot=new Map,RECOMP.set(rt,ot)),ot.set(nt,o)}DECOMP.set(o,tt.reverse())}}function is_hangul(et){return et>=S0&&et=L0&&et=V0&&oT0&&o0&&nt(T0+ct)}else{let it=DECOMP.get(ot);it?tt.push(...it):nt(ot)}if(!tt.length)break;ot=tt.pop()}if(rt&&o.length>1){let ot=unpack_cc(o[0]);for(let it=1;it0&&nt>=it)it==0?(o.push(rt,...tt),tt.length=0,rt=st):tt.push(st),nt=it;else{let at=compose_pair(rt,st);at>=0?rt=at:nt==0&&it==0?(o.push(rt),rt=st):(tt.push(st),nt=it)}}return rt>=0&&o.push(rt,...tt),o}function nfd(et){return decomposed(et).map(unpack_cp)}function nfc(et){return composed_from_decomposed(decomposed(et))}const HYPHEN=45,STOP_CH=".",FE0F=65039,UNIQUE_PH=1,Array_from=et=>Array.from(et);function group_has_cp(et,o){return et.P.has(o)||et.Q.has(o)}class Emoji extends Array{get is_emoji(){return!0}}let MAPPED,IGNORED,CM,NSM,ESCAPE,GROUPS,WHOLE_VALID,WHOLE_MAP,VALID,EMOJI_LIST,EMOJI_ROOT;function init(){if(MAPPED)return;let et=read_compressed_payload(COMPRESSED$1);const o=()=>read_sorted(et),tt=()=>new Set(o()),rt=(lt,dt)=>dt.forEach(ht=>lt.add(ht));MAPPED=new Map(read_mapped(et)),IGNORED=tt(),CM=o(),NSM=new Set(o().map(lt=>CM[lt])),CM=new Set(CM),ESCAPE=tt(),tt();let nt=read_sorted_arrays(et),ot=et();const it=()=>{let lt=new Set;return o().forEach(dt=>rt(lt,nt[dt])),rt(lt,o()),lt};GROUPS=read_array_while(lt=>{let dt=read_array_while(et).map(ht=>ht+96);if(dt.length){let ht=lt>=ot;dt[0]-=32,dt=str_from_cps(dt),ht&&(dt=`Restricted[${dt}]`);let mt=it(),ft=it(),pt=!et();return{N:dt,P:mt,Q:ft,M:pt,R:ht}}}),WHOLE_VALID=tt(),WHOLE_MAP=new Map;let st=o().concat(Array_from(WHOLE_VALID)).sort((lt,dt)=>lt-dt);st.forEach((lt,dt)=>{let ht=et(),mt=st[dt]=ht?st[dt-ht]:{V:[],M:new Map};mt.V.push(lt),WHOLE_VALID.has(lt)||WHOLE_MAP.set(lt,mt)});for(let{V:lt,M:dt}of new Set(WHOLE_MAP.values())){let ht=[];for(let ft of lt){let pt=GROUPS.filter(gt=>group_has_cp(gt,ft)),yt=ht.find(({G:gt})=>pt.some(bt=>gt.has(bt)));yt||(yt={G:new Set,V:[]},ht.push(yt)),yt.V.push(ft),rt(yt.G,pt)}let mt=ht.flatMap(ft=>Array_from(ft.G));for(let{G:ft,V:pt}of ht){let yt=new Set(mt.filter(gt=>!ft.has(gt)));for(let gt of pt)dt.set(gt,yt)}}VALID=new Set;let at=new Set;const ct=lt=>VALID.has(lt)?at.add(lt):VALID.add(lt);for(let lt of GROUPS){for(let dt of lt.P)ct(dt);for(let dt of lt.Q)ct(dt)}for(let lt of VALID)!WHOLE_MAP.has(lt)&&!at.has(lt)&&WHOLE_MAP.set(lt,UNIQUE_PH);rt(VALID,nfd(VALID)),EMOJI_LIST=read_trie(et).map(lt=>Emoji.from(lt)).sort(compare_arrays),EMOJI_ROOT=new Map;for(let lt of EMOJI_LIST){let dt=[EMOJI_ROOT];for(let ht of lt){let mt=dt.map(ft=>{let pt=ft.get(ht);return pt||(pt=new Map,ft.set(ht,pt)),pt});ht===FE0F?dt.push(...mt):dt=mt}for(let ht of dt)ht.V=lt}}function quoted_cp(et){return(should_escape(et)?"":`${bidi_qq(safe_str_from_cps([et]))} `)+quote_cp(et)}function bidi_qq(et){return`"${et}"‎`}function check_label_extension(et){if(et.length>=4&&et[2]==HYPHEN&&et[3]==HYPHEN)throw new Error(`invalid label extension: "${str_from_cps(et.slice(0,4))}"`)}function check_leading_underscore(et){for(let tt=et.lastIndexOf(95);tt>0;)if(et[--tt]!==95)throw new Error("underscore allowed only at start")}function check_fenced(et){let o=et[0],tt=FENCED.get(o);if(tt)throw error_placement(`leading ${tt}`);let rt=et.length,nt=-1;for(let ot=1;oto&&(o>>=1,et=[...et.slice(0,o),8230,...et.slice(-o)]);let nt=0,ot=et.length;for(let it=0;it{let ot=explode_cp(nt),it={input:ot,offset:rt};rt+=ot.length+1;try{let st=it.tokens=tokens_from_str(ot,o,tt),at=st.length,ct;if(!at)throw new Error("empty label");let lt=it.output=st.flat();if(check_leading_underscore(lt),!(it.emoji=at>1||st[0].is_emoji)&<.every(ht=>ht<128))check_label_extension(lt),ct="ASCII";else{let ht=st.flatMap(mt=>mt.is_emoji?[]:mt);if(!ht.length)ct="Emoji";else{if(CM.has(lt[0]))throw error_placement("leading combining mark");for(let pt=1;ptit.has(st)):Array_from(it),!tt.length)return}else rt.push(nt)}if(tt){for(let nt of tt)if(rt.every(ot=>group_has_cp(nt,ot)))throw new Error(`whole-script confusable: ${et.N}/${nt.N}`)}}function determine_group(et){let o=GROUPS;for(let tt of et){let rt=o.filter(nt=>group_has_cp(nt,tt));if(!rt.length)throw GROUPS.some(nt=>group_has_cp(nt,tt))?error_group_member(o[0],tt):error_disallowed(tt);if(o=rt,rt.length==1)break}return o}function flatten$1(et){return et.map(({input:o,error:tt,output:rt})=>{if(tt){let nt=tt.message;throw new Error(et.length==1?nt:`Invalid label ${bidi_qq(safe_str_from_cps(o,63))}: ${nt}`)}return str_from_cps(rt)}).join(STOP_CH)}function error_disallowed(et){return new Error(`disallowed character: ${quoted_cp(et)}`)}function error_group_member(et,o){let tt=quoted_cp(o),rt=GROUPS.find(nt=>nt.P.has(o));return rt&&(tt=`${rt.N} ${tt}`),new Error(`illegal mixture: ${et.N} + ${tt}`)}function error_placement(et){return new Error(`illegal placement: ${et}`)}function check_group(et,o){for(let tt of o)if(!group_has_cp(et,tt))throw error_group_member(et,tt);if(et.M){let tt=nfd(o);for(let rt=1,nt=tt.length;rtNSM_MAX)throw new Error(`excessive non-spacing marks: ${bidi_qq(safe_str_from_cps(tt.slice(rt-1,ot)))} (${ot-rt}/${NSM_MAX})`);rt=ot}}}function tokens_from_str(et,o,tt){let rt=[],nt=[];for(et=et.slice().reverse();et.length;){let ot=consume_emoji_reversed(et);if(ot)nt.length&&(rt.push(o(nt)),nt=[]),rt.push(tt(ot));else{let it=et.pop();if(VALID.has(it))nt.push(it);else{let st=MAPPED.get(it);if(st)nt.push(...st);else if(!IGNORED.has(it))throw error_disallowed(it)}}}return nt.length&&rt.push(o(nt)),rt}function filter_fe0f(et){return et.filter(o=>o!=FE0F)}function consume_emoji_reversed(et,o){let tt=EMOJI_ROOT,rt,nt=et.length;for(;nt&&(tt=tt.get(et[--nt]),!!tt);){let{V:ot}=tt;ot&&(rt=ot,et.length=nt)}return rt}function normalize$2(et){return ens_normalize(et)}function debounce$1(et,o,tt){var rt,nt,ot,it,st;o==null&&(o=100);function at(){var lt=Date.now()-it;lt=0?rt=setTimeout(at,o-lt):(rt=null,tt||(st=et.apply(ot,nt),ot=nt=null))}var ct=function(){ot=this,nt=arguments,it=Date.now();var lt=tt&&!rt;return rt||(rt=setTimeout(at,o)),lt&&(st=et.apply(ot,nt),ot=nt=null),st};return ct.clear=function(){rt&&(clearTimeout(rt),rt=null)},ct.flush=function(){rt&&(st=et.apply(ot,nt),ot=nt=null,clearTimeout(rt),rt=null)},ct}debounce$1.debounce=debounce$1;var debounce_1=debounce$1;const createDebounce=getDefaultExportFromCjs(debounce_1);function useMeasure(et){let{debounce:o,scroll:tt,polyfill:rt,offsetSize:nt}=et===void 0?{debounce:0,scroll:!1,offsetSize:!1}:et;const ot=rt||(typeof window>"u"?class{}:window.ResizeObserver);if(!ot)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[it,st]=reactExports.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),at=reactExports.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:it}),ct=o?typeof o=="number"?o:o.scroll:null,lt=o?typeof o=="number"?o:o.resize:null,dt=reactExports.useRef(!1);reactExports.useEffect(()=>(dt.current=!0,()=>void(dt.current=!1)));const[ht,mt,ft]=reactExports.useMemo(()=>{const bt=()=>{if(!at.current.element)return;const{left:xt,top:vt,width:Et,height:Ct,bottom:St,right:At,x:kt,y:It}=at.current.element.getBoundingClientRect(),Nt={left:xt,top:vt,width:Et,height:Ct,bottom:St,right:At,x:kt,y:It};at.current.element instanceof HTMLElement&&nt&&(Nt.height=at.current.element.offsetHeight,Nt.width=at.current.element.offsetWidth),Object.freeze(Nt),dt.current&&!areBoundsEqual(at.current.lastBounds,Nt)&&st(at.current.lastBounds=Nt)};return[bt,lt?createDebounce(bt,lt):bt,ct?createDebounce(bt,ct):bt]},[st,nt,ct,lt]);function pt(){at.current.scrollContainers&&(at.current.scrollContainers.forEach(bt=>bt.removeEventListener("scroll",ft,!0)),at.current.scrollContainers=null),at.current.resizeObserver&&(at.current.resizeObserver.disconnect(),at.current.resizeObserver=null)}function yt(){at.current.element&&(at.current.resizeObserver=new ot(ft),at.current.resizeObserver.observe(at.current.element),tt&&at.current.scrollContainers&&at.current.scrollContainers.forEach(bt=>bt.addEventListener("scroll",ft,{capture:!0,passive:!0})))}const gt=bt=>{!bt||bt===at.current.element||(pt(),at.current.element=bt,at.current.scrollContainers=findScrollContainers(bt),yt())};return useOnWindowScroll(ft,!!tt),useOnWindowResize(mt),reactExports.useEffect(()=>{pt(),yt()},[tt,ft,mt]),reactExports.useEffect(()=>pt,[]),[gt,it,ht]}function useOnWindowResize(et){reactExports.useEffect(()=>{const o=et;return window.addEventListener("resize",o),()=>void window.removeEventListener("resize",o)},[et])}function useOnWindowScroll(et,o){reactExports.useEffect(()=>{if(o){const tt=et;return window.addEventListener("scroll",tt,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",tt,!0)}},[et,o])}function findScrollContainers(et){const o=[];if(!et||et===document.body)return o;const{overflow:tt,overflowX:rt,overflowY:nt}=window.getComputedStyle(et);return[tt,rt,nt].some(ot=>ot==="auto"||ot==="scroll")&&o.push(et),[...o,...findScrollContainers(et.parentElement)]}const keys$1=["x","y","top","bottom","left","right","width","height"],areBoundsEqual=(et,o)=>keys$1.every(tt=>et[tt]===o[tt]);var MapShim=function(){if(typeof Map<"u")return Map;function et(o,tt){var rt=-1;return o.some(function(nt,ot){return nt[0]===tt?(rt=ot,!0):!1}),rt}return function(){function o(){this.__entries__=[]}return Object.defineProperty(o.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),o.prototype.get=function(tt){var rt=et(this.__entries__,tt),nt=this.__entries__[rt];return nt&&nt[1]},o.prototype.set=function(tt,rt){var nt=et(this.__entries__,tt);~nt?this.__entries__[nt][1]=rt:this.__entries__.push([tt,rt])},o.prototype.delete=function(tt){var rt=this.__entries__,nt=et(rt,tt);~nt&&rt.splice(nt,1)},o.prototype.has=function(tt){return!!~et(this.__entries__,tt)},o.prototype.clear=function(){this.__entries__.splice(0)},o.prototype.forEach=function(tt,rt){rt===void 0&&(rt=null);for(var nt=0,ot=this.__entries__;nt0},et.prototype.connect_=function(){!isBrowser$2||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},et.prototype.disconnect_=function(){!isBrowser$2||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},et.prototype.onTransitionEnd_=function(o){var tt=o.propertyName,rt=tt===void 0?"":tt,nt=transitionKeys.some(function(ot){return!!~rt.indexOf(ot)});nt&&this.refresh()},et.getInstance=function(){return this.instance_||(this.instance_=new et),this.instance_},et.instance_=null,et}(),defineConfigurable=function(et,o){for(var tt=0,rt=Object.keys(o);tt"u"||!(Element instanceof Object))){if(!(o instanceof getWindowOf(o).Element))throw new TypeError('parameter 1 is not of type "Element".');var tt=this.observations_;tt.has(o)||(tt.set(o,new ResizeObservation(o)),this.controller_.addObserver(this),this.controller_.refresh())}},et.prototype.unobserve=function(o){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(o instanceof getWindowOf(o).Element))throw new TypeError('parameter 1 is not of type "Element".');var tt=this.observations_;tt.has(o)&&(tt.delete(o),tt.size||this.controller_.removeObserver(this))}},et.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},et.prototype.gatherActive=function(){var o=this;this.clearActive(),this.observations_.forEach(function(tt){tt.isActive()&&o.activeObservations_.push(tt)})},et.prototype.broadcastActive=function(){if(this.hasActive()){var o=this.callbackCtx_,tt=this.activeObservations_.map(function(rt){return new ResizeObserverEntry(rt.target,rt.broadcastRect())});this.callback_.call(o,tt,o),this.clearActive()}},et.prototype.clearActive=function(){this.activeObservations_.splice(0)},et.prototype.hasActive=function(){return this.activeObservations_.length>0},et}(),observers=typeof WeakMap<"u"?new WeakMap:new MapShim,ResizeObserver$1=function(){function et(o){if(!(this instanceof et))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var tt=ResizeObserverController.getInstance(),rt=new ResizeObserverSPI(o,tt,this);observers.set(this,rt)}return et}();["observe","unobserve","disconnect"].forEach(function(et){ResizeObserver$1.prototype[et]=function(){var o;return(o=observers.get(this))[et].apply(o,arguments)}});var index$1=function(){return typeof global$1.ResizeObserver<"u"?global$1.ResizeObserver:ResizeObserver$1}(),browser$1={},canPromise$1=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},qrcode={},utils$2={};let toSJISFunction;const CODEWORDS_COUNT=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];utils$2.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17};utils$2.getSymbolTotalCodewords=function(o){return CODEWORDS_COUNT[o]};utils$2.getBCHDigit=function(et){let o=0;for(;et!==0;)o++,et>>>=1;return o};utils$2.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');toSJISFunction=o};utils$2.isKanjiModeEnabled=function(){return typeof toSJISFunction<"u"};utils$2.toSJIS=function(o){return toSJISFunction(o)};var errorCorrectionLevel={};(function(et){et.L={bit:1},et.M={bit:0},et.Q={bit:3},et.H={bit:2};function o(tt){if(typeof tt!="string")throw new Error("Param is not a string");switch(tt.toLowerCase()){case"l":case"low":return et.L;case"m":case"medium":return et.M;case"q":case"quartile":return et.Q;case"h":case"high":return et.H;default:throw new Error("Unknown EC Level: "+tt)}}et.isValid=function(rt){return rt&&typeof rt.bit<"u"&&rt.bit>=0&&rt.bit<4},et.from=function(rt,nt){if(et.isValid(rt))return rt;try{return o(rt)}catch{return nt}}})(errorCorrectionLevel);function BitBuffer$1(){this.buffer=[],this.length=0}BitBuffer$1.prototype={get:function(et){const o=Math.floor(et/8);return(this.buffer[o]>>>7-et%8&1)===1},put:function(et,o){for(let tt=0;tt>>o-tt-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(et){const o=Math.floor(this.length/8);this.buffer.length<=o&&this.buffer.push(0),et&&(this.buffer[o]|=128>>>this.length%8),this.length++}};var bitBuffer=BitBuffer$1;function BitMatrix$1(et){if(!et||et<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=et,this.data=new Uint8Array(et*et),this.reservedBit=new Uint8Array(et*et)}BitMatrix$1.prototype.set=function(et,o,tt,rt){const nt=et*this.size+o;this.data[nt]=tt,rt&&(this.reservedBit[nt]=!0)};BitMatrix$1.prototype.get=function(et,o){return this.data[et*this.size+o]};BitMatrix$1.prototype.xor=function(et,o,tt){this.data[et*this.size+o]^=tt};BitMatrix$1.prototype.isReserved=function(et,o){return this.reservedBit[et*this.size+o]};var bitMatrix=BitMatrix$1,alignmentPattern={};(function(et){const o=utils$2.getSymbolSize;et.getRowColCoords=function(rt){if(rt===1)return[];const nt=Math.floor(rt/7)+2,ot=o(rt),it=ot===145?26:Math.ceil((ot-13)/(2*nt-2))*2,st=[ot-7];for(let at=1;at=0&&nt<=7},et.from=function(nt){return et.isValid(nt)?parseInt(nt,10):void 0},et.getPenaltyN1=function(nt){const ot=nt.size;let it=0,st=0,at=0,ct=null,lt=null;for(let dt=0;dt=5&&(it+=o.N1+(st-5)),ct=mt,st=1),mt=nt.get(ht,dt),mt===lt?at++:(at>=5&&(it+=o.N1+(at-5)),lt=mt,at=1)}st>=5&&(it+=o.N1+(st-5)),at>=5&&(it+=o.N1+(at-5))}return it},et.getPenaltyN2=function(nt){const ot=nt.size;let it=0;for(let st=0;st=10&&(st===1488||st===93)&&it++,at=at<<1&2047|nt.get(lt,ct),lt>=10&&(at===1488||at===93)&&it++}return it*o.N3},et.getPenaltyN4=function(nt){let ot=0;const it=nt.data.length;for(let at=0;at=0;){const it=ot[0];for(let at=0;at0){const ot=new Uint8Array(this.degree);return ot.set(rt,nt),ot}return rt};var reedSolomonEncoder=ReedSolomonEncoder$1,version$4={},mode$1={},versionCheck={};versionCheck.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40};var regex={};const numeric="[0-9]+",alphanumeric="[A-Z $%*+\\-./:]+";let kanji="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";kanji=kanji.replace(/u/g,"\\u");const byte="(?:(?![A-Z0-9 $%*+\\-./:]|"+kanji+`)(?:.|[\r -]))+`;regex.KANJI=new RegExp(kanji,"g");regex.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");regex.BYTE=new RegExp(byte,"g");regex.NUMERIC=new RegExp(numeric,"g");regex.ALPHANUMERIC=new RegExp(alphanumeric,"g");const TEST_KANJI=new RegExp("^"+kanji+"$"),TEST_NUMERIC=new RegExp("^"+numeric+"$"),TEST_ALPHANUMERIC=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");regex.testKanji=function(o){return TEST_KANJI.test(o)};regex.testNumeric=function(o){return TEST_NUMERIC.test(o)};regex.testAlphanumeric=function(o){return TEST_ALPHANUMERIC.test(o)};(function(et){const o=versionCheck,tt=regex;et.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},et.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},et.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},et.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},et.MIXED={bit:-1},et.getCharCountIndicator=function(ot,it){if(!ot.ccBits)throw new Error("Invalid mode: "+ot);if(!o.isValid(it))throw new Error("Invalid version: "+it);return it>=1&&it<10?ot.ccBits[0]:it<27?ot.ccBits[1]:ot.ccBits[2]},et.getBestModeForData=function(ot){return tt.testNumeric(ot)?et.NUMERIC:tt.testAlphanumeric(ot)?et.ALPHANUMERIC:tt.testKanji(ot)?et.KANJI:et.BYTE},et.toString=function(ot){if(ot&&ot.id)return ot.id;throw new Error("Invalid mode")},et.isValid=function(ot){return ot&&ot.bit&&ot.ccBits};function rt(nt){if(typeof nt!="string")throw new Error("Param is not a string");switch(nt.toLowerCase()){case"numeric":return et.NUMERIC;case"alphanumeric":return et.ALPHANUMERIC;case"kanji":return et.KANJI;case"byte":return et.BYTE;default:throw new Error("Unknown mode: "+nt)}}et.from=function(ot,it){if(et.isValid(ot))return ot;try{return rt(ot)}catch{return it}}})(mode$1);(function(et){const o=utils$2,tt=errorCorrectionCode,rt=errorCorrectionLevel,nt=mode$1,ot=versionCheck,it=7973,st=o.getBCHDigit(it);function at(ht,mt,ft){for(let pt=1;pt<=40;pt++)if(mt<=et.getCapacity(pt,ft,ht))return pt}function ct(ht,mt){return nt.getCharCountIndicator(ht,mt)+4}function lt(ht,mt){let ft=0;return ht.forEach(function(pt){const yt=ct(pt.mode,mt);ft+=yt+pt.getBitsLength()}),ft}function dt(ht,mt){for(let ft=1;ft<=40;ft++)if(lt(ht,ft)<=et.getCapacity(ft,mt,nt.MIXED))return ft}et.from=function(mt,ft){return ot.isValid(mt)?parseInt(mt,10):ft},et.getCapacity=function(mt,ft,pt){if(!ot.isValid(mt))throw new Error("Invalid QR Code version");typeof pt>"u"&&(pt=nt.BYTE);const yt=o.getSymbolTotalCodewords(mt),gt=tt.getTotalCodewordsCount(mt,ft),bt=(yt-gt)*8;if(pt===nt.MIXED)return bt;const xt=bt-ct(pt,mt);switch(pt){case nt.NUMERIC:return Math.floor(xt/10*3);case nt.ALPHANUMERIC:return Math.floor(xt/11*2);case nt.KANJI:return Math.floor(xt/13);case nt.BYTE:default:return Math.floor(xt/8)}},et.getBestVersionForData=function(mt,ft){let pt;const yt=rt.from(ft,rt.M);if(Array.isArray(mt)){if(mt.length>1)return dt(mt,yt);if(mt.length===0)return 1;pt=mt[0]}else pt=mt;return at(pt.mode,pt.getLength(),yt)},et.getEncodedBits=function(mt){if(!ot.isValid(mt)||mt<7)throw new Error("Invalid QR Code version");let ft=mt<<12;for(;o.getBCHDigit(ft)-st>=0;)ft^=it<=0;)nt^=G15<0&&(rt=this.data.substr(tt),nt=parseInt(rt,10),o.put(nt,ot*3+1))};var numericData=NumericData;const Mode$3=mode$1,ALPHA_NUM_CHARS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function AlphanumericData(et){this.mode=Mode$3.ALPHANUMERIC,this.data=et}AlphanumericData.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)};AlphanumericData.prototype.getLength=function(){return this.data.length};AlphanumericData.prototype.getBitsLength=function(){return AlphanumericData.getBitsLength(this.data.length)};AlphanumericData.prototype.write=function(o){let tt;for(tt=0;tt+2<=this.data.length;tt+=2){let rt=ALPHA_NUM_CHARS.indexOf(this.data[tt])*45;rt+=ALPHA_NUM_CHARS.indexOf(this.data[tt+1]),o.put(rt,11)}this.data.length%2&&o.put(ALPHA_NUM_CHARS.indexOf(this.data[tt]),6)};var alphanumericData=AlphanumericData;const Mode$2=mode$1;function ByteData(et){this.mode=Mode$2.BYTE,typeof et=="string"?this.data=new TextEncoder().encode(et):this.data=new Uint8Array(et)}ByteData.getBitsLength=function(o){return o*8};ByteData.prototype.getLength=function(){return this.data.length};ByteData.prototype.getBitsLength=function(){return ByteData.getBitsLength(this.data.length)};ByteData.prototype.write=function(et){for(let o=0,tt=this.data.length;o=33088&&tt<=40956)tt-=33088;else if(tt>=57408&&tt<=60351)tt-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+` -Make sure your charset is UTF-8`);tt=(tt>>>8&255)*192+(tt&255),et.put(tt,13)}};var kanjiData=KanjiData,dijkstra={exports:{}};(function(et){var o={single_source_shortest_paths:function(tt,rt,nt){var ot={},it={};it[rt]=0;var st=o.PriorityQueue.make();st.push(rt,0);for(var at,ct,lt,dt,ht,mt,ft,pt,yt;!st.empty();){at=st.pop(),ct=at.value,dt=at.cost,ht=tt[ct]||{};for(lt in ht)ht.hasOwnProperty(lt)&&(mt=ht[lt],ft=dt+mt,pt=it[lt],yt=typeof it[lt]>"u",(yt||pt>ft)&&(it[lt]=ft,st.push(lt,ft),ot[lt]=ct))}if(typeof nt<"u"&&typeof it[nt]>"u"){var gt=["Could not find a path from ",rt," to ",nt,"."].join("");throw new Error(gt)}return ot},extract_shortest_path_from_predecessor_list:function(tt,rt){for(var nt=[],ot=rt;ot;)nt.push(ot),tt[ot],ot=tt[ot];return nt.reverse(),nt},find_path:function(tt,rt,nt){var ot=o.single_source_shortest_paths(tt,rt,nt);return o.extract_shortest_path_from_predecessor_list(ot,nt)},PriorityQueue:{make:function(tt){var rt=o.PriorityQueue,nt={},ot;tt=tt||{};for(ot in rt)rt.hasOwnProperty(ot)&&(nt[ot]=rt[ot]);return nt.queue=[],nt.sorter=tt.sorter||rt.default_sorter,nt},default_sorter:function(tt,rt){return tt.cost-rt.cost},push:function(tt,rt){var nt={value:tt,cost:rt};this.queue.push(nt),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};et.exports=o})(dijkstra);var dijkstraExports=dijkstra.exports;(function(et){const o=mode$1,tt=numericData,rt=alphanumericData,nt=byteData,ot=kanjiData,it=regex,st=utils$2,at=dijkstraExports;function ct(gt){return unescape(encodeURIComponent(gt)).length}function lt(gt,bt,xt){const vt=[];let Et;for(;(Et=gt.exec(xt))!==null;)vt.push({data:Et[0],index:Et.index,mode:bt,length:Et[0].length});return vt}function dt(gt){const bt=lt(it.NUMERIC,o.NUMERIC,gt),xt=lt(it.ALPHANUMERIC,o.ALPHANUMERIC,gt);let vt,Et;return st.isKanjiModeEnabled()?(vt=lt(it.BYTE,o.BYTE,gt),Et=lt(it.KANJI,o.KANJI,gt)):(vt=lt(it.BYTE_KANJI,o.BYTE,gt),Et=[]),bt.concat(xt,vt,Et).sort(function(St,At){return St.index-At.index}).map(function(St){return{data:St.data,mode:St.mode,length:St.length}})}function ht(gt,bt){switch(bt){case o.NUMERIC:return tt.getBitsLength(gt);case o.ALPHANUMERIC:return rt.getBitsLength(gt);case o.KANJI:return ot.getBitsLength(gt);case o.BYTE:return nt.getBitsLength(gt)}}function mt(gt){return gt.reduce(function(bt,xt){const vt=bt.length-1>=0?bt[bt.length-1]:null;return vt&&vt.mode===xt.mode?(bt[bt.length-1].data+=xt.data,bt):(bt.push(xt),bt)},[])}function ft(gt){const bt=[];for(let xt=0;xt=0&&st<=6&&(at===0||at===6)||at>=0&&at<=6&&(st===0||st===6)||st>=2&&st<=4&&at>=2&&at<=4?et.set(ot+st,it+at,!0,!0):et.set(ot+st,it+at,!1,!0))}}function setupTimingPattern(et){const o=et.size;for(let tt=8;tt>st&1)===1,et.set(nt,ot,it,!0),et.set(ot,nt,it,!0)}function setupFormatInfo(et,o,tt){const rt=et.size,nt=FormatInfo.getEncodedBits(o,tt);let ot,it;for(ot=0;ot<15;ot++)it=(nt>>ot&1)===1,ot<6?et.set(ot,8,it,!0):ot<8?et.set(ot+1,8,it,!0):et.set(rt-15+ot,8,it,!0),ot<8?et.set(8,rt-ot-1,it,!0):ot<9?et.set(8,15-ot-1+1,it,!0):et.set(8,15-ot-1,it,!0);et.set(rt-8,8,1,!0)}function setupData(et,o){const tt=et.size;let rt=-1,nt=tt-1,ot=7,it=0;for(let st=tt-1;st>0;st-=2)for(st===6&&st--;;){for(let at=0;at<2;at++)if(!et.isReserved(nt,st-at)){let ct=!1;it>>ot&1)===1),et.set(nt,st-at,ct),ot--,ot===-1&&(it++,ot=7)}if(nt+=rt,nt<0||tt<=nt){nt-=rt,rt=-rt;break}}}function createData(et,o,tt){const rt=new BitBuffer;tt.forEach(function(at){rt.put(at.mode.bit,4),rt.put(at.getLength(),Mode.getCharCountIndicator(at.mode,et)),at.write(rt)});const nt=Utils$1.getSymbolTotalCodewords(et),ot=ECCode.getTotalCodewordsCount(et,o),it=(nt-ot)*8;for(rt.getLengthInBits()+4<=it&&rt.put(0,4);rt.getLengthInBits()%8!==0;)rt.putBit(0);const st=(it-rt.getLengthInBits())/8;for(let at=0;at=7&&setupVersionInfo(at,o),setupData(at,it),isNaN(rt)&&(rt=MaskPattern.getBestMask(at,setupFormatInfo.bind(null,at,tt))),MaskPattern.applyMask(rt,at),setupFormatInfo(at,tt,rt),{modules:at,version:o,errorCorrectionLevel:tt,maskPattern:rt,segments:nt}}qrcode.create=function(o,tt){if(typeof o>"u"||o==="")throw new Error("No input text");let rt=ECLevel.M,nt,ot;return typeof tt<"u"&&(rt=ECLevel.from(tt.errorCorrectionLevel,ECLevel.M),nt=Version$1.from(tt.version),ot=MaskPattern.from(tt.maskPattern),tt.toSJISFunc&&Utils$1.setToSJISFunction(tt.toSJISFunc)),createSymbol(o,nt,rt,ot)};var canvas={},utils$1={};(function(et){function o(tt){if(typeof tt=="number"&&(tt=tt.toString()),typeof tt!="string")throw new Error("Color should be defined as hex string");let rt=tt.slice().replace("#","").split("");if(rt.length<3||rt.length===5||rt.length>8)throw new Error("Invalid hex color: "+tt);(rt.length===3||rt.length===4)&&(rt=Array.prototype.concat.apply([],rt.map(function(ot){return[ot,ot]}))),rt.length===6&&rt.push("F","F");const nt=parseInt(rt.join(""),16);return{r:nt>>24&255,g:nt>>16&255,b:nt>>8&255,a:nt&255,hex:"#"+rt.slice(0,6).join("")}}et.getOptions=function(rt){rt||(rt={}),rt.color||(rt.color={});const nt=typeof rt.margin>"u"||rt.margin===null||rt.margin<0?4:rt.margin,ot=rt.width&&rt.width>=21?rt.width:void 0,it=rt.scale||4;return{width:ot,scale:ot?4:it,margin:nt,color:{dark:o(rt.color.dark||"#000000ff"),light:o(rt.color.light||"#ffffffff")},type:rt.type,rendererOpts:rt.rendererOpts||{}}},et.getScale=function(rt,nt){return nt.width&&nt.width>=rt+nt.margin*2?nt.width/(rt+nt.margin*2):nt.scale},et.getImageWidth=function(rt,nt){const ot=et.getScale(rt,nt);return Math.floor((rt+nt.margin*2)*ot)},et.qrToImageData=function(rt,nt,ot){const it=nt.modules.size,st=nt.modules.data,at=et.getScale(it,ot),ct=Math.floor((it+ot.margin*2)*at),lt=ot.margin*at,dt=[ot.color.light,ot.color.dark];for(let ht=0;ht=lt&&mt>=lt&&ht"u"&&(!it||!it.getContext)&&(at=it,it=void 0),it||(ct=rt()),at=o.getOptions(at);const lt=o.getImageWidth(ot.modules.size,at),dt=ct.getContext("2d"),ht=dt.createImageData(lt,lt);return o.qrToImageData(ht.data,ot,at),tt(dt,ct,lt),dt.putImageData(ht,0,0),ct},et.renderToDataURL=function(ot,it,st){let at=st;typeof at>"u"&&(!it||!it.getContext)&&(at=it,it=void 0),at||(at={});const ct=et.render(ot,it,at),lt=at.type||"image/png",dt=at.rendererOpts||{};return ct.toDataURL(lt,dt.quality)}})(canvas);var svgTag={};const Utils=utils$1;function getColorAttrib(et,o){const tt=et.a/255,rt=o+'="'+et.hex+'"';return tt<1?rt+" "+o+'-opacity="'+tt.toFixed(2).slice(1)+'"':rt}function svgCmd(et,o,tt){let rt=et+o;return typeof tt<"u"&&(rt+=" "+tt),rt}function qrToPath(et,o,tt){let rt="",nt=0,ot=!1,it=0;for(let st=0;st0&&at>0&&et[st-1]||(rt+=ot?svgCmd("M",at+tt,.5+ct+tt):svgCmd("m",nt,0),nt=0,ot=!1),at+1':"",ct="',lt='viewBox="0 0 '+st+" "+st+'"',ht=''+at+ct+` -`;return typeof rt=="function"&&rt(null,ht),ht};const canPromise=canPromise$1,QRCode$2=qrcode,CanvasRenderer=canvas,SvgRenderer=svgTag;function renderCanvas(et,o,tt,rt,nt){const ot=[].slice.call(arguments,1),it=ot.length,st=typeof ot[it-1]=="function";if(!st&&!canPromise())throw new Error("Callback required as last argument");if(st){if(it<2)throw new Error("Too few arguments provided");it===2?(nt=tt,tt=o,o=rt=void 0):it===3&&(o.getContext&&typeof nt>"u"?(nt=rt,rt=void 0):(nt=rt,rt=tt,tt=o,o=void 0))}else{if(it<1)throw new Error("Too few arguments provided");return it===1?(tt=o,o=rt=void 0):it===2&&!o.getContext&&(rt=tt,tt=o,o=void 0),new Promise(function(at,ct){try{const lt=QRCode$2.create(tt,rt);at(et(lt,o,rt))}catch(lt){ct(lt)}})}try{const at=QRCode$2.create(tt,rt);nt(null,et(at,o,rt))}catch(at){nt(at)}}browser$1.create=QRCode$2.create;browser$1.toCanvas=renderCanvas.bind(null,CanvasRenderer.render);browser$1.toDataURL=renderCanvas.bind(null,CanvasRenderer.renderToDataURL);browser$1.toString=renderCanvas.bind(null,function(et,o,tt){return SvgRenderer.render(et,tt)});var PRE_ENTER=0,ENTERING=1,ENTERED=2,PRE_EXIT=3,EXITING=4,EXITED=5,UNMOUNTED=6,STATES=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],startOrEnd=function(o){return o?UNMOUNTED:EXITED},updateState=function(o,tt,rt,nt,ot){clearTimeout(nt.current),tt(o),rt.current=o,ot&&ot({state:STATES[o]})},useTransition=function(o){var tt=o===void 0?{}:o,rt=tt.enter,nt=rt===void 0?!0:rt,ot=tt.exit,it=ot===void 0?!0:ot,st=tt.preEnter,at=tt.preExit,ct=tt.timeout,lt=tt.initialEntered,dt=tt.mountOnEnter,ht=tt.unmountOnExit,mt=tt.onChange,ft=reactExports.useState(lt?ENTERED:startOrEnd(dt)),pt=ft[0],yt=ft[1],gt=reactExports.useRef(pt),bt=reactExports.useRef(),xt,vt;typeof ct=="object"?(xt=ct.enter,vt=ct.exit):xt=vt=ct;var Et=reactExports.useCallback(function(){var St;switch(gt.current){case ENTERING:case PRE_ENTER:St=ENTERED;break;case EXITING:case PRE_EXIT:St=startOrEnd(ht);break}St!==void 0&&updateState(St,yt,gt,bt,mt)},[mt,ht]),Ct=reactExports.useCallback(function(St){var At=function It(Nt){switch(updateState(Nt,yt,gt,bt,mt),Nt){case ENTERING:xt>=0&&(bt.current=setTimeout(Et,xt));break;case EXITING:vt>=0&&(bt.current=setTimeout(Et,vt));break;case PRE_ENTER:case PRE_EXIT:bt.current=setTimeout(function(){return It(Nt+1)},0);break}},kt=gt.current<=ENTERED;typeof St!="boolean"&&(St=!kt),St?kt||At(nt?st?PRE_ENTER:ENTERING:ENTERED):kt&&At(it?at?PRE_EXIT:EXITING:startOrEnd(ht))},[Et,mt,nt,it,st,at,xt,vt,ht]);return reactExports.useEffect(function(){return function(){return clearTimeout(bt.current)}},[]),[STATES[pt],Ct,Et]};const defaultConnectors=({app:et,walletConnectProjectId:o,coinbaseWalletPreference:tt})=>{const rt=et.name&&et.icon&&et.description&&et.url,nt=!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,ot=[];return nt&&ot.push(safe({allowedDomains:[/gnosis-safe.io$/,/app.safe.global$/]})),ot.push(injected({target:"metaMask"}),coinbaseWallet({appName:et.name,appLogoUrl:et.icon,overrideIsMetaMask:!1,preference:tt})),o&&ot.push(walletConnect({showQrModal:!1,projectId:o,metadata:rt?{name:et.name,description:et.description,url:et.url,icons:[et.icon]}:void 0})),ot};let globalAppName,globalAppIcon;const getAppName=()=>globalAppName,getAppIcon=()=>globalAppIcon,defaultConfig=({appName:et="ConnectKit",appIcon:o,appDescription:tt,appUrl:rt,walletConnectProjectId:nt,coinbaseWalletPreference:ot,chains:it=[mainnet,polygon,optimism,arbitrum],client:st,...at})=>{var ct,lt;globalAppName=et,o&&(globalAppIcon=o);const dt=(ct=at==null?void 0:at.transports)!==null&&ct!==void 0?ct:Object.fromEntries(it.map(ft=>[ft.id,http()])),ht=(lt=at==null?void 0:at.connectors)!==null&<!==void 0?lt:defaultConnectors({app:{name:et,icon:o,description:tt,url:rt},walletConnectProjectId:nt,coinbaseWalletPreference:ot});return{...at,chains:it,connectors:ht,transports:dt}},isWalletInstalled=et=>{if(typeof window>"u")return!1;const{ethereum:o}=window;return!!(o!=null&&o[`is${et}`]||o!=null&&o.providers&&(o!=null&&o.providers.find(tt=>tt==null?void 0:tt[`is${et}`])))},isFamily=()=>isWalletInstalled("Family"),isRainbow=()=>isWalletInstalled("Rainbow"),isZerion=()=>isWalletInstalled("Zerion"),Mock=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)"},children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.5611 8.12948C21.0082 7.90729 21.5007 7.79167 22 7.79167C22.4993 7.79167 22.9919 7.90729 23.439 8.12948L23.4408 8.1304L33.0387 12.9293C33.577 13.197 34.031 13.61 34.3478 14.121C34.6649 14.6323 34.833 15.2218 34.8333 15.8234V27.2595C34.833 27.8611 34.6649 28.4511 34.3478 28.9624C34.031 29.4733 33.578 29.8858 33.0398 30.1535L23.4411 34.9528C22.9919 35.1775 22.4963 35.2947 21.994 35.2947C21.4918 35.2947 20.9964 35.1777 20.5472 34.9529L10.9475 30.1531L10.9452 30.1519C10.4071 29.8808 9.95535 29.4646 9.6411 28.9504C9.32739 28.437 9.16312 27.8464 9.16673 27.2448L9.16675 27.2417L10.0004 27.2475H9.16673V27.2448V15.8239C9.16705 15.2223 9.33518 14.6322 9.65222 14.121C9.96906 13.61 10.4221 13.1976 10.9604 12.9298L20.5592 8.1304L20.5611 8.12948ZM21.3031 9.62267L11.8706 14.3389L22 19.4036L32.1294 14.3389L22.697 9.62267C22.4806 9.51531 22.2416 9.45905 22 9.45905C21.7585 9.45905 21.5194 9.51534 21.3031 9.62267ZM10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241ZM22.8337 33.3923L32.2967 28.6608C32.5576 28.5312 32.7772 28.3313 32.9308 28.0836C33.0844 27.836 33.1658 27.5504 33.166 27.259V15.8243C33.1659 15.7786 33.1639 15.7331 33.1599 15.6878L22.8337 20.8509V33.3923Z",fill:"url(#paint0_linear_3546_7073)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241Z",fill:"url(#paint1_linear_3546_7073)",fillOpacity:"0.3"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]})]})]}),Injected=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.6505 3.64041C15.6501 3.64062 15.6497 3.64083 15.6493 3.64103L6.05165 8.43985L16.2501 13.5391L26.4484 8.43987L16.8508 3.64103C16.8504 3.64083 16.85 3.64063 16.8496 3.64043C16.6632 3.54806 16.458 3.5 16.25 3.5C16.042 3.5 15.8369 3.54806 15.6505 3.64041ZM28 10.4592L17.5001 15.7091L17.5 28.5205L27.248 23.6465L27.2508 23.6452C27.4757 23.5334 27.665 23.3611 27.7973 23.1477C27.9297 22.9342 27.9999 22.6881 28 22.4369V10.4592ZM15 28.527L15.0001 15.7091L4.50006 10.4591V22.4333C4.49831 22.6849 4.56687 22.9319 4.69807 23.1466C4.82896 23.3608 5.01696 23.5342 5.24095 23.6475C5.24148 23.6477 5.242 23.648 5.24253 23.6483L15 28.527ZM14.5207 31.0824L4.12104 25.8826L4.11759 25.8809C3.47681 25.558 2.93902 25.0625 2.56486 24.4502C2.19154 23.8394 1.99597 23.1365 2.00006 22.4207V10.0486C2.00044 9.33234 2.20062 8.62972 2.5781 8.021C2.95529 7.41274 3.49457 6.92167 4.13537 6.60291C4.13585 6.60267 4.13633 6.60243 4.13681 6.60219L14.534 1.40359L14.5368 1.40221C15.0692 1.13767 15.6556 1 16.25 1C16.8445 1 17.4309 1.13767 17.9633 1.40221L17.966 1.40358L28.3633 6.60219C28.3638 6.60245 28.3643 6.6027 28.3648 6.60295C29.0055 6.92171 29.5448 7.41276 29.922 8.021C30.2994 8.62973 30.4996 9.33168 30.5 10.0479V22.4376C30.4996 23.1538 30.2994 23.8565 29.922 24.4652C29.5448 25.0734 29.0056 25.5644 28.365 25.8831C28.3644 25.8834 28.3638 25.8837 28.3633 25.884L17.9664 31.0824C17.9663 31.0825 17.9665 31.0824 17.9664 31.0824C17.4316 31.3499 16.8415 31.4894 16.2435 31.4894C15.6455 31.4894 15.0554 31.3499 14.5207 31.0824C14.5205 31.0824 14.5208 31.0825 14.5207 31.0824Z",fill:"#CCCCCC"})}),WalletConnect=({background:et=!1,...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:et?{background:"var(--ck-brand-walletConnect)"}:void 0,children:jsxRuntimeExports.jsx("path",{d:"M9.58818 11.8556C13.1293 8.31442 18.8706 8.31442 22.4117 11.8556L22.8379 12.2818C23.015 12.4588 23.015 12.7459 22.8379 12.9229L21.3801 14.3808C21.2915 14.4693 21.148 14.4693 21.0595 14.3808L20.473 13.7943C18.0026 11.3239 13.9973 11.3239 11.5269 13.7943L10.8989 14.4223C10.8104 14.5109 10.6668 14.5109 10.5783 14.4223L9.12041 12.9645C8.94336 12.7875 8.94336 12.5004 9.12041 12.3234L9.58818 11.8556ZM25.4268 14.8706L26.7243 16.1682C26.9013 16.3452 26.9013 16.6323 26.7243 16.8093L20.8737 22.6599C20.6966 22.8371 20.4096 22.8371 20.2325 22.6599L16.0802 18.5076C16.0359 18.4634 15.9641 18.4634 15.9199 18.5076L11.7675 22.6599C11.5905 22.8371 11.3034 22.8371 11.1264 22.66C11.1264 22.66 11.1264 22.6599 11.1264 22.6599L5.27561 16.8092C5.09856 16.6322 5.09856 16.3451 5.27561 16.168L6.57313 14.8706C6.75019 14.6934 7.03726 14.6934 7.21431 14.8706L11.3668 19.023C11.411 19.0672 11.4828 19.0672 11.5271 19.023L15.6793 14.8706C15.8563 14.6934 16.1434 14.6934 16.3205 14.8706L20.473 19.023C20.5172 19.0672 20.589 19.0672 20.6332 19.023L24.7856 14.8706C24.9627 14.6935 25.2498 14.6935 25.4268 14.8706Z",fill:et?"white":"var(--ck-brand-walletConnect)"})}),MetaMask=({background:et=!1,...o})=>jsxRuntimeExports.jsxs("svg",{...o,style:et?{background:"linear-gradient(0deg, var(--ck-brand-metamask-12), var(--ck-brand-metamask-11))",borderRadius:"27.5%"}:void 0,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M27.2684 4.03027L17.5018 11.2841L19.3079 7.00442L27.2684 4.03027Z",fill:"var(--ck-brand-metamask-02)",stroke:"var(--ck-brand-metamask-02)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M4.7218 4.03027L14.4099 11.3528L12.6921 7.00442L4.7218 4.03027Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M23.7544 20.8438L21.1532 24.8289L26.7187 26.3602L28.3187 20.9321L23.7544 20.8438Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M3.69104 20.9321L5.28117 26.3602L10.8467 24.8289L8.24551 20.8438L3.69104 20.9321Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.5327 14.1108L8.98181 16.4568L14.5081 16.7022L14.3117 10.7637L10.5327 14.1108Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M21.4576 14.1111L17.6295 10.6953L17.5018 16.7025L23.0182 16.4571L21.4576 14.1111Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.8469 24.8292L14.1647 23.2096L11.2984 20.9717L10.8469 24.8292Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.8257 23.2096L21.1531 24.8292L20.6918 20.9717L17.8257 23.2096Z",fill:"var(--ck-brand-metamask-08)",stroke:"var(--ck-brand-metamask-08)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M21.1531 24.8296L17.8257 23.21L18.0906 25.3793L18.0612 26.2921L21.1531 24.8296Z",fill:"var(--ck-brand-metamask-06)",stroke:"var(--ck-brand-metamask-06)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.8469 24.8296L13.9388 26.2921L13.9192 25.3793L14.1647 23.21L10.8469 24.8296Z",fill:"var(--ck-brand-metamask-06)",stroke:"var(--ck-brand-metamask-06)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M13.9877 19.5389L11.2196 18.7242L13.1729 17.8311L13.9877 19.5389Z",fill:"var(--ck-brand-metamask-09)",stroke:"var(--ck-brand-metamask-09)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M18.0023 19.5389L18.8171 17.8311L20.7802 18.7242L18.0023 19.5389Z",fill:"var(--ck-brand-metamask-09)",stroke:"var(--ck-brand-metamask-09)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.8468 24.8289L11.3179 20.8438L8.24561 20.9321L10.8468 24.8289Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M20.6821 20.8438L21.1532 24.8289L23.7544 20.9321L20.6821 20.8438Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M23.0182 16.4565L17.5018 16.7019L18.0122 19.5387L18.827 17.8308L20.7902 18.7239L23.0182 16.4565Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M11.2198 18.7239L13.1829 17.8308L13.9878 19.5387L14.5081 16.7019L8.98181 16.4565L11.2198 18.7239Z",fill:"var(--ck-brand-metamask-03)",stroke:"var(--ck-brand-metamask-03)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M8.98181 16.4565L11.2983 20.9718L11.2198 18.7239L8.98181 16.4565Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M20.7901 18.7239L20.6919 20.9718L23.0181 16.4565L20.7901 18.7239Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M14.508 16.7021L13.9878 19.5389L14.6356 22.886L14.7828 18.4788L14.508 16.7021Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.5017 16.7021L17.2367 18.4689L17.3545 22.886L18.0121 19.5389L17.5017 16.7021Z",fill:"var(--ck-brand-metamask-10)",stroke:"var(--ck-brand-metamask-10)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M18.0121 19.5388L17.3545 22.886L17.8257 23.2099L20.6918 20.972L20.79 18.7241L18.0121 19.5388Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M11.2196 18.7241L11.2981 20.972L14.1644 23.2099L14.6355 22.886L13.9877 19.5388L11.2196 18.7241Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M18.0615 26.2917L18.0908 25.3788L17.8455 25.1628H14.145L13.9192 25.3788L13.9388 26.2917L10.8469 24.8291L11.9267 25.7126L14.1155 27.234H17.875L20.0736 25.7126L21.1533 24.8291L18.0615 26.2917Z",fill:"var(--ck-brand-metamask-07)",stroke:"var(--ck-brand-metamask-07)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.8258 23.2096L17.3546 22.8857H14.6357L14.1646 23.2096L13.9191 25.379L14.1449 25.163H17.8454L18.0907 25.379L17.8258 23.2096Z",fill:"var(--ck-brand-metamask-04)",stroke:"var(--ck-brand-metamask-04)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M27.6806 11.7552L28.5149 7.75041L27.2683 4.03027L17.8257 11.0387L21.4575 14.1109L26.591 15.6128L27.7296 14.2876L27.2389 13.9342L28.0241 13.2178L27.4156 12.7465L28.2007 12.1478L27.6806 11.7552Z",fill:"var(--ck-brand-metamask-05)",stroke:"var(--ck-brand-metamask-05)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M3.48486 7.75041L4.3192 11.7552L3.78916 12.1478L4.57441 12.7465L3.97566 13.2178L4.7609 13.9342L4.27012 14.2876L5.39892 15.6128L10.5325 14.1109L14.1644 11.0387L4.72164 4.03027L3.48486 7.75041Z",fill:"var(--ck-brand-metamask-05)",stroke:"var(--ck-brand-metamask-05)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M26.591 15.6122L21.4575 14.1104L23.0181 16.4564L20.6919 20.9716L23.7544 20.9323H28.3186L26.591 15.6122Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M10.5326 14.1104L5.39897 15.6122L3.69104 20.9323H8.24551L11.2982 20.9716L8.98168 16.4564L10.5326 14.1104Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M17.5018 16.7018L17.8258 11.0381L19.3177 7.00391H12.6921L14.1645 11.0381L14.5081 16.7018L14.6258 18.4883L14.6356 22.8856H17.3546L17.3742 18.4883L17.5018 16.7018Z",fill:"var(--ck-brand-metamask-01)",stroke:"var(--ck-brand-metamask-01)",strokeWidth:"0.269931",strokeLinecap:"round",strokeLinejoin:"round"})]}),Coinbase=({background:et=!1,...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"10",fill:"var(--ck-brand-coinbaseWallet)"}),et&&jsxRuntimeExports.jsx("rect",{rx:"27%",width:"20",height:"20",fill:"var(--ck-brand-coinbaseWallet)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.0001 17C13.8661 17 17.0001 13.866 17.0001 10C17.0001 6.13401 13.8661 3 10.0001 3C6.13413 3 3.00012 6.13401 3.00012 10C3.00012 13.866 6.13413 17 10.0001 17ZM8.25012 7.71429C7.95427 7.71429 7.71441 7.95414 7.71441 8.25V11.75C7.71441 12.0459 7.95427 12.2857 8.25012 12.2857H11.7501C12.046 12.2857 12.2858 12.0459 12.2858 11.75V8.25C12.2858 7.95414 12.046 7.71429 11.7501 7.71429H8.25012Z",fill:"white"})]}),Family=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{backgroundSize:"100% 100%",backgroundImage:'url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAC0CAYAAAA9zQYyAAABQGlDQ1BzUDNDAAB4nGNgYHyQk5xbzKLAwJCbV1IU5O6kEBEZpcD+iIGZQYSBk4GPQTYxubjAN9gthAEIihPLi5NLinIYUMC3awyMIPqybkZiXopc+xz3pvOzD4rlWyascy2VY8APuFJSi5OB9B8gVkkuKCphYGAEuoZBqbykAMR2AbJFkjMSU4DsCCBbpwjoQCC7BSSeDmHPALGTIOw1IHZRSJAzkH0AyFZIR2InIbFzc0qToW4AuZ4nNS80GEhzALEMQzFDAIMxgzMONWxgNc5AaMCgCAov9HAoTjM2gujicWJgYL33//9nVQYG9skMDH8n/P//e+H////8GBiYZzEwHBBB6G++z8Bgux/EQoh5AfkbzYHBtBUhpmHBwCDIxcBwoqIgsSgRLMQMxExpmQwMn5YzMPBGMjAIXwDqiQYAOQZcLsEClb4AAGmfSURBVHgB1b0J1G3HVR6497n3/98o6Q0anubBludJeAiTbYwd2gGC6UACBFZY7gVNB3CaJEB3VhbQhNW9OtDQkAYSIOkEGhJCGJrEBGzJkrEsT7Jky5JszXrSexqf3qw3/v891TXsvWvvferce/8nyabrvfPfc+rUqdq166u9d+06pwrP+/CHA3AI8RQRmqFxbyRliVdpcSQ9jj27IASwdAVHVxi7l65hcZAn6NlFdOOce4vCgB5Fc5iXdiN1abSFP1/2PrRoUtiYR/Oy9C9Tr7EwNVc4pwojTDFxC0CMI2nH8hwlhX4D5ZOvWwzy9cHlS8FlzhfwZNlyDN2pPlSXwT0VAtd7yTL8+SDuHOvCzzKdyOButIeuj6HfpTXtu8Ew3WD6NpjnALnFuI1IPB9GK0n5ZiCM9H4GyTJhLqAX1GHZMoJK70Etp0tK4nlhLqBfQF08CFnAgPrN8SHMz0N1YmjluYGwNKDnSeV5DEOnttHnpZ7fKBDyuWJWUHnKqWLUsgyaJ4WbjT2nDv56TCWL6gaw0vklrAv/vpD2mNcWrTpAI00+H9G0G5XWU/1gs8fBSCM1gMq/Y/d9BzD3WiqUpS4zQakyBkDQ6k7HQ5uZi4CgQepphJE66DiuC9PM57lcpsU1auA6Ul1Q1S399o6mF1qXFDq5NbyHqi7QoBmZ5wp8wdn+3G6o6qifRV0vQ3QtbxGwPUbT+RSXeEj/NiUyqQwP5BaIOw8Gl94HAwTKS0viXkk1fejeru02k2+jrNb1gE7d4GA7YwtEYYEtHyhN0HWh6/Q7AQV4bmidPwzDaF00rbpdGnHQqI+vh26LoPjNdQCi3XeAlL7zcaA6g5PYCDBqMup70xahvpK2DkMACmjVvc4904EFApL08dJgAAxVUX3OTEIlFcYYigooPi9fZ0nPtCj6fKPr+2MSD+fUARzNDBCJ0yBR9ZT6qjKC8jRImcxfvuf4b84pLXBdsG1bG94pLSL00i0taHpdP4rv6XnoOiut1aDSaCyYI3AV7aM29KAyc1QwNqSyZ5gHdEcM7kbyaAXfmOYg5vaF2MrQxCzFGFZ3Oj9dH98xPc263t0YQKAdPCA0CHxn1CDo+Z4ysSQvrovTPjkksHCdoLYDtOpCaY3AAZgvYBjABFShWdGfjs7VKcepugSiS3dK/6vt80HHUnVfalA4b2CHDROCG1uDmM87dd4Cgy5HiG1I2OB6uwEC9VhOhxosytZrSSAg2nU9dZ2wRT+MaB+mXwdtd7pD6qJA3ENtQCOxAYZ2d6M+Y3w2dQEL9rntQXXSAGOaO2f+zcACGZVwMRJZ5QtULxE+/OvKHAvTFhMs7bZx5XyOVNZg7kAxT0nkTkmNVNFunoRz6rZXKi4xxvR2YhoDm5ntJRxxroJhBMQtIHe+vj6e8muBTMwKJgFqg/eUV0/8aNWnWRfn/QBV/gDUrh2w0Un9PZMv063axEtfXxehn/JhgdNzHRoDQM2fWiU12Hb3OMyV0K3KeDAbadUA8AQsIDqVRqS1VndOOoCuWCBmIavgdE0MI/D2JCl61eAi7RSYWVWO1Rddp9QN7evQAnk5tJyRUgemknQ6rgMfyozyoNHqfTDo1PWAtkQWuhttxveB6lDqpWtQz7XG0HTqw8fNFF3mOWU+5eKcRNYSG6AN6qk2wNHZKWJPkgqQHstSFZxUpvOJZhTlNaHryQig828AwBFzoFQ0MQ8ziDOYMTGhJ6akhq+gnjGoYWjD8YBEQK0GFbrjAYyD2AAhd6KSFQNZQBCcOMDaTj1wfahjgjU5pB7U2B1UbcPqfCDJuC6qzYxWTPGR3xPTBqm9dD1R6gLAHdO2SSDaU6MJX/u+CA3XMWdES0edk6UzUr14nNDxs/QrfnPlANBSnmkKCsNTQ6gGk+r1A3uR47ykggrmibrWcRbQLOGGErEVqkRT6jjm2qtG5/MJAXwGwajApunhB0QODFrTtECd03VWwmk+1QqEobnBEjrTXkDOkjkBYUIgSHGmkyIaST/wCuCQnk4ETW2TBOSBSei1UkMDcJlFkBBPu0mhnwA6I3BO0nlMs574SrydoRt7Qe0A2VRRYDbjKIVRI6kpvpgcaJWjrkCnC8Wh50I3rkhhdT1RQJ5AZaIBNjZUdqOHDtSub2xEB+5YTpSQM2ApUk0PaA0wEF3Du/qBBcBE1Vnbn1wXAKtxuNzg6qCBrTtlp0FO5Zl0YMHMdeBfDUoteSe+ftxhVVov3TWPQNOv24bbIZ33SaOU81mU4h1pmBkdPEBE6rg6yLgIQAb1fvAbPF0UN5hY0b3GxI+AWYOXwTzRYCYglHN7TzPQgDoUM0QTUCUrSzEl4bCaGTOodhoDPEvr9Gwo5kp+tsOB71ZLpPpb6DYN7+qLyBpJaRwYDqiCrouugx8HxLqzNJ5BBbnutMYT4iUoCYNkBhWTCJrmoBU0heaJ/Or2BlUbMjWAgdww9aCAWOoQUnukMgjY8VgHEBM3g5qvCcAz6vxsZg0EkBIOmsfW5OCEKpGW2PMkM/fwdD51gJ4OAA71GfRmS2oAa9MOJxpIMkOpeJZiufGKqVFUNWSmiS2HKObKhJiuxw8AUMtnerDS5U2nOh6gdMD1YL5hFZYChfpbxwDa/scMBLYnRf1C6aCdgF55CAhMpmWx2vBm4Ad2LMNAnrTa1LW/RkVQvz0SqEmbzLDSOyOAI4E4CyqlTGYAYusz9tiG7uhX28/efQsNoFsJ7aTVIjNDwAkV2CsUxyCepgEIn9MzU8VII6mBTZxu0Mm4LxZgFk9HH9hOLoydEUNnGeCJjpAlQxo4zrB6C/TslkhodLYmWM1R60qgRjAdskq5CuiuYkB0pAZzoQVIqiHVAXPdZoE7axBg8AAraFDTL41ATVsyLRMPaAJz4k+HOJDURZr7+tiKsJZhM7AnwTIjzZN+14nvqdz19BsHjetprBH6iq0krWO8ES5OUouzAut7MQxs78qbagaAIV7hSR2+FwuDSBJPiTHTzsalgqY0us73FSgK07vCQG0OKsIDeQuyT0M1fC82clFjEwZ1aphQ8u9j3myKGFCr+gFJBRiRVtV0AiPhJtToDPTKJwvu5KGRupBUyx0T2EYO1VSCamumDjkDZUqxlA7VG1AHuEPtqr0YRiKHInSqhq0dtQ7WM+VO42DtlCylCdgzoT+QidFl4dLFmGw/0zQ3BvqNQM64i/HrDNqgXsrCOkcR9GA4uPc7FKiH73JQZtq3DNBQXQrMGsgGxJHQBOQVD/RScJVwWCUgWEEjhBYGBlHB1b5ij0Yqm+w1sTeBwIDk4bAN4AdTnZNqbFMycLWZNAUwEk1AQLDNT5PNL1PtSH+oSPbozUgDyYAqJliPfzU41sksYcnNklGm+509WQFNNjSoekDxykwRlLSm9KFAll18bIYBtbuRNsjjGDVucQIl//ZdHiCugRWWeZzUB4lc122OzMnqj0elVVEBHxRd1YbGxswSWneOPrRknjgJzQBeSQXEXlriC4jzgWAGi2xf8UBjU6zohaurcPnmzXDhpk2wfTrN6VJYiww4urYGz545HY8z8FQ8nl9fJ3VTGmad6ElgTnlP2FOAIICBUAEFaAFQzQ0w9r4e3IrXgyVYKEp4c6J902a4YssW2BXrcIGifT0mObJ2Fg6ePQvPpuP0aTg163MjBCqnF7o7GkwFMg0YLKTaMZCEZ5+8FUwMYgxBBniTGDPpap0Sz/PAkbr6aqR9T+T3ZYnvkfYdK6uwQoPztShNj6yvwcHI70OR/wfi71oocnKSNVDRmKklspuuLzRnV12H1L4I1P0K3mKesZoQLRAxwQCgvl0Itl49COKNIBLhBM5tJ+2Lbb+z9zUXScUgJRBHBqxgjVtByEcBeKxsVwBfGFmBsDsy7y07dsDrLjgfrti61fiijXoBG1Lc/pOn4LaDB+ELR4/CExHoE6h2bx6ksInCg8v0r3MAgDqZoDutsZs7HhBSJ8y9IsDO1RV4285d8MZI+1WRdmjQPhYeO3kSPnv4MNx97Dg8d/ZMAW/uOB3Z0oX2DBJkSVht7p5MFxYG0oaBtARWLcJ1wcD+4BA73Ap89a6d8NadO+G6bduk8y0KqaxHnj8Bdx45DPcePw6HI8iZ71nDTAqPOnLfFewEKLosZDv6LCIBtmfXjwCbQd0pHgplJJmDaT9Kt+MjHwk8KzaQ0NAYAPJvNicSgK1kLkeXpfCKiqu2NKu3ItleFpn4zgsvhOu3b4ctkwm8kHB6NovgOJLB/cCJE1k6BG50UDNxoQ5okMSz7rzae6HtzokAuaS7LoL37ZH2V5+3HbZON/w1mwlnorS668hR+EwE94PPP0/mRPWArIdgBl3F2xGMXz6HUA2PjqU0qAF3KGB/VaT5a3ftjkDeAdsi7QHOPSS+fz7Sfnuk/eHIdx6j5MkUoj0da3Tocx233vO9XsxGGUuE6n/n+vo3FLOpvDMCWrtl6mDASWMA671g4HYKzPE+S+gVksgrnQI0VKYmc+JvXroHXhGBPO06eDFDqmgCx588+SQ8dupUUUuIakDGDAABM1uKqEAsPmg2LWg0tCNKte+96kp4RQRFt6REWzakBrvv+PPwB/v3Z9Ok0A7i1eBJojqrCKJ1St1BNA2bUEDSOMTEF0VT4u9ccTm8MWrDTS8y35O34gtHj8EHn34q0r5WXHohmYAgIE6/ZxuA1qBOgF4nQK+HOljWM6UMaDZD+Bp33Xxz0CaHnhmc52NOYNbSeVWBd8VdywCQ7Ll3XXQRvOfii7JkaIWNSosxSCVb+2PPHYQ/fvIJksQo7wME9aAfQ0xATUJAsTETs1L811+4G755z55RbfJi0v6JSPtHDhwgW5VnRosZUj02QTSOJyKra3LzrcZn3x35/k2XXAI7VlfgpaT9yNnE9+ci7c/KmCWZSwLoBFqwYD4bO0MaNM76XtLMwIGaB8TpnREqS795mTvurltuCaJuQzBvvlW7y87wMWjT+aoyMzKQs6nRxQFGBfOUpNv2CIIkHb4q2msvBkOXZfDnjhyB33p0b2Za1j7Kfg5gvTnFi6EnWbJ+jwDu4G9dfjm8ddcu+HLSfmek/T/t2x8HjzOlaQqoxdMR9Dsiyk/bFzAngfM9V14B74yA/nLRnvL89KFD8B8j7Wtk+qUB4zowgIskzucB5HyNJHO6z+aKMT+CMrNC48MHA2iwgz8D6K4TG9hIZgEzCLg3sX0NNOqMBe6Oqu6HrrsWLo+j/40GPSgcY+BY4LTPxFH5P7/vfng+AmNKkpols6TDAuKJPFsAcX40MX7k5S+Di6IHwOcbXkKaOSTT41cfeih6SNbFF6xfudQ0VDdnAcN5UYj841dcD5cpvnvazoXmscGuj9sXTb5/8eBDcCJ1yA5zR0yS+GwC9qzPQD4DUCV1qCA+21vTQ3zxLVDT0XkwyygZ3bsWQC4eBOuLJjuT/bJTSsv2cpIS26YT+B8jIOaBOcw5ACzzwxLpfdqLIxj/yateCTsjLezDLrOWoUz6xCN1wNUcTxM+8cGdEcwfePnLDZiXpWEjNM9Lm9x/P3jttdF2n+aIRHv2HvFv5j/Vg/hfbP0p/Nj1L4dLI99btL0QmmHJuOS+/PFXviK6AKcZC0lIVCFZvDlm4goAzNt/+gDCKGITsymY2Vk5x6HbLoOYZv8Q0cyUsSuLz6eB3paKPWwaH/yxCIjdDhAA4yB8oWEsz+TT/tFIy7YotbJ/FoqfXA9icx1K14etUdP8wHXXRdpXR8v5ctCdQgLlD0RQbyVbMQsNHnhD0pQdTV4V03FTbKvUEa9wbkRd1osdxvJMwuSHIh+3RH5mUCczKJDQwzp/IJNYIRiBarCovEwcPE6rVG4k4BlCfmlHu4D8Sy/sh8xqi1Tf9111VXTUb5HWCvqAL++RQmrg74r2JKT3B/o+D/hEYkDxj2fAxOM7or1/6ZbN0lhfrqMfof2yrVvgu6++Kr8TAQQMkWpQ/L1pliIB5TuvuCLWdcuXnfYW3SlcRXzPcQqU5lVWsO/PdAp7nZPMgxluCnV4pG1JgIGETrf1K5R62rcQRUzNPE1+xB7ee8nF0c+5SzLVFQwNTmuwvxghjFy/OQ7s3hcHeOkLizRb1ZG0Tu8cYF80y7suvhjeSIPXVj4vEomjYYz2115wAXxDpC3RWKamifaYgGl/T/RkfG30j4/l81LS7vPX52+LfH9XpCthIwuTAFkay3Q8VN8/v5ZbDmhaDC1wdwMgq0FhzdD2EHnHFqDOygHbL2UgtXtlJYOCy9Ijz6B+5RysGmkBeyMNEUae4eu3RffbxXGKOvFWXm/MXoEeLki077lk8Py5gOFcaB4rj8+/Mfrvz4/2cT8rHbC8OlDAvCvOuL7z4osG+W2E9hdCcyten39LpP3S1U3lDUEynXhsVj+WAPNujFgIjEXKK3umDCaR3zdBaAE7hQ6UkR7Um1dQ3+LStk5ShcmX+LejykvA4AoxOMNYhdGCXqQ6Abtn6Q3LHbAgPvnA33fl5TCLo+9AhfDvt0Xa03sNPh9Ysuxl6Fg2bav8RNu3RA2TrvI3lUR3mtj45ssugy1q5u/FouNc+Qzu/LyIif82mnKJ1uyfCEraOiBrSZzGb4IxJZH1dQG2KlQjXq7pqvYO/Uph8QTwb5J2aaYnzf69Kc5E+RoGOg/+gJGggM00eft7meAZy9evjur7+jjb10dQJ2CvR4l37bbtMf78QVqfz5crjJX/hl074cpol84izcl0Sr9Xb9sGN+zeJWm/krTPK+/1ke/plYdEM7/fzC9KCZC1V0OeVBIZrEbnIINCbTvbN++GtrQBNhFUZqSi37CfwTuiAz+5YzJTcQnGkgTmY9DjvfSmZzY6uHRF5uPN0aY7G8GcfaKR9q+O6ppnE33ar/QB7vyrI5+TPbq2Pst1+Np43QLyV5pWH59ej/jr0aRLUrr40QO9C88vMhG20L71yVhMQeNUBzOZrxN7/Egvol+2oXMhGVTllcH0rsCbd9XB1DKAA1eWGRx6JKrE6MySdm+hNCPlJkm3ParB9HLQjmjbXRslNkC7cb5SoQWQFF5NLxYl2tNk1us03+ErS/uA38Eerzv/fNgZ+Z60S5bSYSg8BWuUZwuT4OI6j3C9iqjpHfyk8QNW8Zu+8k3S+YZoamzuJpaZDqCtwd4ouAFGvR+BEjMjFqVtSY80A/raHTvh9NpaNjW2OvtT/4LLw9/zYUEfW5i2Va4+ki39mgt2RNrX4U27d2fJt0g6Amyc5jAvrQYqzOlMzgmQbOmviTRnKd0HSay/jClvWllvhuDVu+1kzDdyQ//1lCGpB21upJ6WiHt7GmEzfaqiwgBo91h9T38q5cOoaYJDcoNKp6vg6bkhejwSU18f7U//OuY8UMwDzyIwLpMWRtLo+K+6KJlM6/CGSPsi8J4rzfk6WN7XT9nASqAlAueb3HjrNAaQdesIECZbusWYRBwvrJgcPBhEhwh1qW1oLUoLcPpsbqR3Oa7Zus2+orlMMOIYqKcOogwdfHPgs2ZzREVpid2i6Yrt2+DKaGpcFgcqPixdh69QuChO/FwaeZ7q4MMLpd0IHGXmedNg9Hn368PLIs83T8qSDcnlmIM1ksupLgRdMu2hQ2wsY8CJWnlnFcCfvDCxxXZOg5Mr4/RsNufnSEU5H6slMasPrmyowPb0ttKaHsGnrYehfLz7/a98BWyaTJqS8K9K8OSn8+Si++HXvUZo1/LmnGhXHb8lCJfOM7QvjQ0cC0gfdtx19BgNxIORXg0cm3P5rhBqvQfvcmAjgzCH2rKEVcgumEs2bR6kNwM2fQ5O/XFd+grQfA9hYBer7IRWbUMbApwo8WYIh0u3DT+d+qsEZg7ebEjh4q1bBvc3Srsx/RAA8RyedXlou9nPMbBQ27N5c563KFI6qDqotwiDbetyUgnUpE45A6uiw8iKlvy5ePksP3+wG4BeVezzSygepIqmltC00tql5xNDiQNry+LQeQ7UFXeKAYeGQUu8ZVTruaSFBenH6FgE2IV0NDr9WN4BRm4w/9Hauj5/LZUlPQmqHXFwuN6XGc8cJ5KvpA668jqP0OZANTmCRwC6HqJBXpbVKgPR4ktMZsfO6LIbY0aABpBhhOkuk7JiZTud1BXbWTSqpeq0iJBmXxsN55J2o+mXSQtz0hqgIcylKbQyGbFpwlhGMJBBtU2gzNjmla7y6wdxcIjsqXEfwQawcxojKqR+A4X606QqDyxYaPlXypzX880zVfHgT96NdG5wtRJllmVogkrw5/Ix74gEIddKEyXWQqg2dtBV9OmXCBtI+pKl3UhoDZxxUVqvQkbas4X3VnwrTQrJbzyjl9nSnbqVSC2B1zSEUZpraVO9ZpgRYnrWAvVqOQRqqMtQycIuDTUwhmvd+42QNBfjjGlpHNTPeomsymxJa/ldwgTxfWHs2WUat5UNwNDEOJfgeYwNXrQGS0IDQ2OJCmi54mmw5myNSD/5S3bCDkthvY43Y80WhgYAemZX1uXwRJjtD/ggiSrrytFUJS9Ntdb3g3zsicqfajSo7AgnWjakUV9OOiMo6Y3OjgtOKyiEaknuA7rGsDcd6apcHwZAddoE5jy7LMq9jdx8BNtpuYFawqiBfwFmq6eH8WLzvfTuD+Mnf4zc1wWBAjWG4C/Ubwh9EEB7kMivNkEALLAlU6xfIMfrQ2fOwrygwWKkMcVBsCCE0KDNSxmVN5Fd74V2A+j7Uvw825oBho1ygorXtGObJtN/VL76PuCweB1QlTsgtQHkwQCYCup7MJqMXzBbpKX0SQAYdGauc3BpMAyzPr6+Jt9FzqROdUGg1rs9GZshGHwyn6ZjBGu+lAWoSwHF7KjL2aaIQIXuP3lCAGEc8uAq54HrCmaws1aQ4FoX1X2fDUtIkZbqIS2dg6s8qvOA7lmwwJdrBa65aVs0jKQfpNW9YSRt0M+4zqo7aRPgUPntaWNBpNtM918tBExnVcW0tG+i8eDpM/myeMxC9p7NNNbQdSLXiX2Y2loHVwt+URTM7J9soQCgtkwL8PCxYzZ3lrrQICLYiqP8aUgc5rCTKMF3UXAA1M/qcnF4v2VqoEqLwdanNXtViXb5jkk8Fy9pcTytpFEAb3ouNPhCOy8BH47w3AHID/SDa191a3BtOmX9gX0nnidMlQ8VeACY41AJR6jxY9u7pTynLL7NGryZWDRiP73SVwqoawLnRbiB4xAeTUtYETe0lOW6hFYtVY8HJ0m1JNeSkxvJ8XyYt6LBgEpJHANULdl0owebdlAejv9ii8hGPSUtzEkHVnJL3Rp5SRZhPEsxl9x90xah/SxHDPgPDUHUCEWDB7jr0GGpOO/XUsZpYCS0frfHrO+dC6x77ph3OXSFmkcI5uWU+hJRaeWT6zP40tGjlWBVcZM5MyOoHti6Vs9YOmqcgF3HaSkL4xJSD/JETTcaEjXQwdWlBdRBy4/ELUqLjfLcuQGzT9voOIYVaNvItEGjOAN0V2xwYNHtxGj05Dx8/Hgcd52Bmiw4XLmX0EKbxRrYHYQxTquKgj3MwuEApJbLikS3PP1UW2L6YlABERxjW+USsz1t6PI22l9JNX101H99fOvFG7nm3wD23V2+9s/jgrRjecNIOWP0wkjeisd8H4iPqPjX7Bz+NrWFFgAtkOnnTMBKiw4f3L+/rBFNpq3BWAB5+V+RaPvpYGYo1Hc5Br0xhCaIZcX5YFe+LEtsdfCnjz1e1mv2EgOlzLoCaF/j+De4Hu4ldx+cNACwkhpUgxIgOK2Ol3vQAAo4oIzdw0baMPIcNs7DAqAvQ4dLq4OPF0VsUNEGS4ARgOs2ChbUrUOeDWDGYQkjH3v6aUCqgDYtZgrIjDcWnB6bPgxXS5TBoAO3KhChuurqCv8F1M+cOg23PPkUfOtVV7KWg3pSOaMlMmgm4zDeMFeBeHRgFm8eiAPUX/uvN8Itd98Ljzz9bHmJnAYdQHUCfW5Y0GKVC75OX4GAjgGI6pdGl3yetNLVl1wE3/yWr4L3//V3wJ6dO5qg5mphcKBs1FU/Y9pUxfPGR3oskU4/8sST0YlwHLZu2SQTI7LhKNTtLVodRM65/VT81NOq24l3nLITLOU9Dl54G4mxefPytIfKpIM/2/84vPuyS2HTpLG6KDa4xyBtiASHU0D9S8/pdk2ndzyyF3783/4ePPzMgbL1wuoq1YfBqlbsDB7AwXSa5cKLhWzceCqsMSztUF3n866k2H/4KPzGh2+Gm+66B37m7/4teMdrXmUpZyk6B+iDENrxnkYvqz74+OMZK2kfFiD8yC6yAAN7uXo6lM0DNk0Kxm3H6omEtAUwsi8aRUqXtdgrqvKn5t0EbjvwLHzi2WfhGy+9rPoudal8GhYzh/2ixdNimSRpCPgp7dNHjsBP/s5/gMfi6HnTls3QTTrgr9eFKUEDur3Y4cbDQMYtkR4b58uHgmVU1ygS0KwBR+Ixz8LF2ZS9Bw/Bz/z7P4Y/+MkPwIXnn2coCiOdOYTlu62ZA9BgJto+9tRTcMfBg9CtTq0NjTwwrGt56y9jqmljcaf5YTYNkiZBNhXQVLIAuSxAy4tts0rJ2wuThJ5EUP/SPXfDDbt25w9PTd6qsAANldaQ0uLvbIlrVaf08zt/eVtssCOwGsE8XZlGQE/iDVkCR9nwQWyxcnPcLvurGgyUFS9kKwoAMMsApO/30nINa2uwL0rrf/Whm+Gn/vb7hnVWPAdoyqMBDUGZE14ia1v+udOn4dfv/SL0Xfr6e5K1esDi/O1J89e9cJwLD6qQLQJMVZqk8HSebPAyJEAFcJbUNKuTpTP9TiKAJtMJPB5nDX/v4YfgR1/zWjOy1p0GWtKAJQHdN+mGnXLA2Q994V6YblqBlc2bIh0rmR7eT4VHzWIfkqQmWQ3a1Pr/Q/DbaeQ4GvnJFhRpu7wcn+od22wWB+y5k5+FW+970OQnPGAB4u61QmgkYsmsaWP6/t9H98IXo2t38+bV3DbscgoaxIRP3oexVtjZlp4W0CaH2BlhUEGZfqSK9iSlda8pNkiXiVxJ77hGSfDvHnwQrty2Hb7tqqsNogNn7mgzQlqBGHUicNJApU/k7z9yDFY2rWa7eZpWbsoSgF5L5IKdk1zAremDNsMcKXNDeInSChFOl5PlXPmFtF5cR1I7DeLTNlhpQ6J4/vjhozUrJYb1Ng/6RGNA32e6/edP3u34l3Eg+Cv33AMrqyswjeOrpM2hKwLH+J8DezawmhoIRuhUPljMmlFbq8FEMoeqzvI0JZQtEpAkXsZzUh1RVCdCp2m9iPUz8M/uvANu2L0brti2XTJHpdKQKiGMUi1rOr+Xzq4XiPaJHapLpkZaS3lazA1WU9zri7M+iATQqkyX5XnDHaf1vgNAm4e1OkPI6mLQp9WFjKBd6hwqoHl5NqzGdH5c9u7uijadRFCtr88smMGaFyw4vAbVNDNtehZVDgXmJ54/AT/56U+RwEuAnkRaJlmjyN7lAOKA6D0tMAR0K24KDZ7lc2r0uksnmvqwlObBGm+VkBmWiY5Xqz2cOXMWvufmm+DfvvNdcP35F9AmkZYo6fTEiWDfQm2/3O2AzDSD9Ppim+XdmEKdgSrbKBd7LZUle3SEYkblvLyNpKSSLns0YCsNbjytL9NlgQElNQOnjHOwbBQPdQHxkjDfibwJNOZB40vWRQlQwljZNVp2/3XWAS/X9cSJk/C9N90EZ2K61diRVnhsk9sIaG9G/R50FTS8G5h8Fui0g6Y5hc7c1IMk0lu5PtTVOHPvpzbraEQik6E/nRbTI1XgWLTb/v7Hb4UHjx6pPVcfjpONCaAB4b5Ckm9Z4zcDOm+yQwxjpuV9s9PCuVi2HS4b8WBNg/W8z3sFduZ+jW/FdYP82mnxHNI6OmIdNK25LnIfch3T/bQ7a+nENW1S8XkgNumsKefaQeJY7atGD475DH7pXJTggcOH4e/d9JG8WedqBHI6knTuJp3gSBcZNB3KzNCf/8EgroYpqFGwF0b1RR0U/SNTkYhkhvB+00XChdz5yzYDsBIonwDPnj0N33fLzfBPb/gq+JtXX2PVujNDRFqHBoCVamtpZt2oxT/Oe/uhbFzJEkBLAlMO+g7TkK7YkKI6rWHkBtKCq5BPjzpLvbBmbT9eLVb+kOTgvbtzW3WlA4ArqmVe6JccXbOZKqA7v3HfPvi5z34Wjsfx1OYo2FbjuCZJ5zJQ74rggerVYJdw0fb1qyiRcoxB3wkVhqfMS6cxABrXtQdVYHPv7aUiJbfiwpvStG5B5um1s/Czd3wWnj55Er7r5dfDedGW0iZIAMs548NWNKBOr86RmUEHsIQOxcyozvsuL2ySpTiZF1rFNqXPWMAN3NtI2kacviQuS4fmMb0AHRU/gDs6zR1QR2cV7sHMJsigo3s6sJobYi/H4+jZM/DnceLkf7/jzuzx2kxATho7gVkPTGWvcuqsUi7jF2AgtT1PNG3NhWYM0whY+VyjP5SlDMoItPai6oHA7P7tphORGskaOLO2Dr9y793wx48+Aj/+hhvgXXmd48qcAahYuIVKQ3A0GymtGhDZrMh7pPO0Kt3vOqG9NCC9P0CACE1mgJK6MB40gWGDaeflrdIiEYNQec03i2sVqRN38tyMUicu9L6OVDc2LTy4USdDa1boLD7zzDPwC5+7Ex46djSCeKVI5vg7mRavBsrYpjzBZoN0Iqz1GJC3iJfQeJdDp8fGRVCMqB8nltlEFv/lHY+ySHXeeWVSV2fn7eGeOnUK/sFtH4M3X3gRfHeU1u+4LC0yPjHdrSWB5VqBWDc0qywg27MyivbHBm1ysJkSiO7CgaDz9CDrGvdAXaOLgzlpfZqxMJJ3BXX1bBThwa634oPONjPUmThklU6SmkVgUHQEHQfz+1paV+NjTz4Bf/rww3BrnAVcjUJsS5TKCcjpSJIZp8WrUex3EiAde6CoDEQZ2LIlUDRkQ8DAkK0pND/B4i/BRb2PqMNSKGWJaGbeOJ8M7OzIR7OBZ1p+ay322LsOH4Q7Pvks7Nq0Cb7lqmuixL4Krt+xE7bweyCKaiEFhxI7aNpp8ANYJDX7oYsqq1+r16lV8lMj2spR+lbdze+8+EVpF8VBlYrlHBWJhSPsnWHPQpXQJR3PFmY3a+Jbj9U+cNXrnYT2gQVJAvEjcYLkxsf2ws37H4f90S2XgLs1zgGsxl82MVaS63SiwUzg7IY7+labWZXnGTF2j8LiHde70rih2TDV7uGepCdoGHCFoR1lR5t2pj3Bk786VnatW4Nj62vwOw98CX73/i/Ba3buhn90w1vgDbsvqiNrxUwPbFR08UieX/EKaNcRoW+L6QWroDoGCkAss+iLHlAdRvcwGArPSh89q0yKuWkBqixqgUp5BWyfIdrJHu0oF9GgCNVTRav29B2aF314QoNp4l8Wavprnk8+9QT89r33wL0HD8GZfj0DN5sWUwZx8WQkTxeqyZMwUDGoOiWohgzDSoYhL8zkBJ2bdzncyGIYjLejlCIOfCWpAar3gPPN7xbQQjRp0iNJ6TWoWy3vXtkEb9+zB959xVVw+bbzYOvU7ketgc2VNUKVkYEgHpcisrC6nGQQRINazZScB6qBUjD15iv28zINoOJ1lNYYAezNABbYtmrtvJstQhJX92jdgUHbp2xeUHygjh+g0q5DaERw3F+79DJ444UXw31Ru378ySfh9gPPwoEzp2ETSeTslovnub3JfVqkcjUltMYx5xCknaB5rhpd45TOp55BzaCYY0ZlWlwEqC48oJdlggKNPE47amUvCMCrdu2CvxHt57dGBq120/rJTbDMNLadizNMR6RBBw9AFHjp+WK/seYJkl0gaVwYr9A3KKZVeDv5RtLOS18lGLi6IzC1JZq0ZrruCuDZwigdPNW9LLnVXGc5VPzojqabPGmArdE2fsvFe+Ctl+yBY2tn4IuHDsGH9u+HLx47UvaLx/IFk3QiZRoZ/57vwFxRb+uKhaBxOORgc1CIMGSp//5uUJBIarAtpVpCppbjvws3b4YfuO56+Gu7L8r3+c0q8I/6iwaILT1l4oBGSQPnuwGG0Kt8mxnwCAohoKU1UqfR/dkIEh8C2nuhLRPqPTRpAXU60g3iuAikPVhSS2yFeadJwWreZN50ltRgAayBDfqaeMUvqp2/ugm+bs+l8DUR3HceOgD/5oEH4bkIcp223XnRMQGbKVuxHmqcxvih7RMoX4KjtAC9DxCKqYE4LE5G3iqa7dfEsbQo33dffS18xxVX5+18jUTW57XWVkUH27HBVaA0ElKjkfM+qA7lXtDGvN1mLSuHLpjy0XGnIdeqUBkJvt04Lc5J65WgScPI5tC18iquVQSe8QVaSCYR0NkJCmJN0/8cwChvXo+QvSkyEI0Rb4ua9g07d8EfRz/0H+57nFZUqsANHQg2mnWngpDOMVRXKig8tviSzo0fuiWZwT3APbxcl0LQi3+XSa5U/HNe9Fz85KtfBW+Jg76UfBbA+D39wSG430ERWrqWjRXJBYRgjewuI0kkMNh69I1M2xgdioA5WG4+Pf+uLdvWm7UcKhMABCXycr1ko1qVToPSXgbAI4JEYYmAVuLLuiwwCJtjO3/ftdfB1du3wa8/9CAcm/W84WWdETb2L/+xqo5BDXpQDvP5JyYHKoNbZ8T3cCQbrBlAVYzCk/IhQBxa74l+yZ97zevg2q3bq2sogJHQ5hdqJtzJW0HUpLRbJ35osaeNnletzVIJQEkr1zkVHca8Gr0HTg8uEN1G1CxoLq4o6t+guF7Kqnv1odDGg+L8YlJP2qthjgXNE1ASWl3Ly0hhKGR6dfH2iy6BK7Zug5+OHpEDZ8/mWWQ2c7Rg5NP0spVwQN8DaJsc4kWisQ+03HZa2rLNxSYGQEOKq/cJlE0UmNXx2Uuib/J/ffUb4OqtWwXM/QiY5V3cMGS0x1MLQ0H21sU8wma3ox4to3JXFcb1ogvZzRbAlaFB6wE8L8zrjc30uDBv3dSIxUmHZD4hMUrkS1fbMGutbC90xQ5HrPxXgsT4oYPjf2WjlMPP8cJDoO6njUx//g1vhH941+fhUHTN5o29lamErYqhh7Adh4jJYdxc5bmpj5BfY0JY6YagdpNlVQcsjOoL88npeX5k3v/5ujfl7SqCA7Ps5qWYKcwYntbrUM+Hn2WhSCdWbahsONMiHM8vOoogx0Wy8q9EQP4rAGBxE2rHEMFdUvNsXK5zN7/niI8elHRW9yQdHR1Ld/plMi7dvAV+IYL6A5//HDyfHOFsCmqLAEBwlalDmnFW5UubaPeyEr4pzH2XgxM2l8BqPUeABQJzGgD+WJzW3hPB3Dsga6kMYNWbzm8ecaH1y7NRWkJDxbKWLEkqB6xAyA6+vkqA+XyBNuJH9eNI/EbyCPayaht1M3tVwlDFSGU64g00KyhtElyxaCV15k8Q2ZGD2NRKg/KA8cotW+GHr3sZ/MJDD2QTlN/HblW9OFpxXvVH443JYfdVrg/o32GoAxEkRCbpnDYRev+VV8G74qh3RvyVjx6DVW0M5EWgboGMn5FBEBKQlaRm+rVG4YmXOmaszn+v4kYDLhGvicZzzMPFockbQcxBJYmLAGqMfZBMDuyabjvdETS4fZPoTkpkiCFhNn2C2jbfFN16Xzp+DP746afyhBroBQO5h5hCQMZvdWIsGHb4ybHpUjzGsXviECKi6POmWRkEfssll8rdwYaNAYy7bOA6WzJ47PCAkO3o8oEsyzOa9JFrkPNiawcY2GV/BUMFNO+HbU3A6glRTwhgqKPzx6lKW0q2MJwTGITgzBBqQ7HulPmhxeh/d821cMtzB+Bw3xfes7YIunbBncHgeuzeYFs3YRS0TArbOwYVTPZzP4vM6OEfvex62B0d7t7UGAAbykyWH1mbQzEPYHhuAzUUSSFtS/M1H2VNiI4kujs6d+jnx9K37p1zWlycdkA/A6Q8i4Zm7uz10zTWUF4ocOgd7+e1j1l2IKhz/RuP7ZMV+J+vfxX0eQfZWRlrkVoWM4qaUVNWh3fYanH5nXrjXJ4USVWnseug0Kk9ILdJktDRvnjz+RfAW3fstBUMbXNDshgisxmkh/ruyT/80g37rrCtU8oFWXjKLBHN5gtONh+oPj3kay2LPAtBO283nFY3Zn15B3X7gDSRekYzQ8kxPRWKlS8esADtpgijF8N0rOwkwvHzzXHi5TXbt8M9J54v73uI6w0sr5qmQgAzsYI4tKFReTcqb9BkI7OFRtgr1RbKyjzrsxm8N/ofJzQL6D9Pp6SGgWBya7d/UCUX26kt1QXELK2okYMbrVRgFy8I22KoO3cj4AbMkRczLbbSq9E+irnU0W8gs4C4xun5fWQ2O8AKFD43g/URAHuQ61WuUnHyNT/3XSjaOEpR+PZLL4e77v9iERSqg5VHEDS6ZfYwODMDcWCC1IkVIcy95Ic1XoM5AMggsDCgz+bGZdF2/oY4EBQprA5tZoxJZ31vDNj6XkuSAgNUg5pEmbz8wxKM/LPS4AttaNUxXtKgy7Fl6rZiQAfVGUVrsqKiNmKbuZoxEzCZqnWcA6g5AU0WtinlW/4LfcEB1inzBOqv3r0bLlxZhYNRAOYPQeT9GX7jztY7SAGqrEZbdbBsUGq5UkvgTqYGSee377oQtqaPIIP+LB2Mm24emD0zlr2WjpDaU+xFqIMOusZO2dHs1tMLRstX41jvdapzmOdHDnTn89Jj49rRhnw+llbFo7qHavwQlLEs0hnB2MEBqubTkhX8NcC4hg1Drcn5azxcsLIC3xy9HrM05upDNbnE1aILC0uLkMUv+EOVxmikcwDRDInYtHliNPT/mz17bCXCEMQtZkAjDnWcEqymyugliGtoMTPUr5zSm2qctndpPTGtc4ChzD7XtO5ap0V3L5/yC0n0joShHVUm5rrUtX7eVJONfZQMYSg8WjS2Qu8S6OWY33HRRfBvHtsLOOlLpx18V1d/gzIFw5zy7KZBriba3PDACvKbattnQG+NRL32vAvs5Ik2ORxj5klnVRTRB1Vz+oQaBB3NGKRGS+9Dd0oJyeCKPkmCMnUcnA0HG7B9XfHzQ9hY1rggr/rKXnnpCrlRsIKgY3OEHhETjNfm8HlqQamiF5LiyAoj0lyPn14dsXJB1ObHI3Y6Ze4FJbwG5bNpOBKmJoE/x0Ym6CrN3o1I1FVxNihIPAzUmSbOMyHYrEcFjA4BGpJf1KlSxYoZuQzj1cAqybsRCb1IDPm0sGR6nXaZMlxDy/MdGmbkAS91Ho378kxXPUHs6XBFDMqcd3+cTPMrOLCkwuuiR+y2o4dpJ1l6E3IseHzqXwplYqUlnRq1rMCriM5xaZnWKH6v2LRlkFayCENmhJFffW56Png6hs9l6sh2lKqoypeGxkGvL14P+hpPNXTpAG06TJpavPyMpZVztGXk5yhikNbRUYuiiSKPA9brA8mgvt6RASSozgADb9QYqNHdGhM62toRgUeRaUq8P3woC0R24dVdrtCqaHFV4qBcvh68D+0TDRpGIbMuHl4k9OVbNksluIB+RDpr4C8bWkJs8LwaELHZUdIRc9jNhUoasBpOL3KEKqnH+AKN61Zj4pxrXPD8vLRyHqrJkZtYOX+T1yC9KoryDVa5F7ind50BO7fJAMwAoxLcn7faJwV245mBJ52nwWGfPWRBFv0Z9GgYCscxwSFbUjCDEGqeY8xmKc1M6DMxPVyc3qijAoNmDljmhEa+LWAjjEvqUQZifTFJv/OLyn6uJgY/UtaHkI/vEIcEtK49sQDj4mtR5TaSFlx6+hAY5X4BhJga7JqmRkWZfOqaoIQl4lokzrsXGkcK50+nWRim9+YnQZfB4MGBK9CU5ezp5tt23r2XgRPql9wazGn5liyho4djhQcZyPdcviPXY20ZYAhkfz54hiUzYm04ig+6p2p9T/H5o1pwlQdoistip4Zx0Zry7lRaiVwi30Vp+TrU2V3UqMlx/N5KAQfS8g252syjFhe57VqdGRptRTxsC5eaxC+DwaRO0xp7PUvoOEwPk6pNQGEPsfqdEcwYQYfhV9+ukUKw0XI7aNWhP3+d36vDkBeD66YEp5tjQK51ACijfiA7ml1UoZohQNKqq2BnCnLDIwgUhm6JWgM0XgJHNbq0tefAIh1l0/K9IR0y1ymDXPvqKPtyzFOsobImAwGjBnGohGgrpkFpO4L6mrkGbW6ox4omD7Q8c5AbgiHU7WMLEY0bKgF2j5VQGhCDpdB/5lIWlOmFKHaMn+2HKzxocI+B2l+3znXP9irMlJdmvzITOkA9oWDcc7TgjEiNrvCFyK+DDt0qWHsVYKPkF5LW10yn82AucXnhHiGYOhaPAVDlxy8pM3o6GnSxJ4iYyLf1uzatxWf8uadUSg42Xg8INajX88tsALw9CHIOiA47wfGMsBhq2hRGJlawimNNpDpnYiszAhw4c8YkEGKCajMVWsxyVLTvIaiJhMqknBetDT1w2ynJVDJQkhTppKP3GNEDiIjttN5EW1EESxB1pJKKJXkD2NyKUmZXy0NVvhaX4r7p1HVQC3CoorraYbIZxhMrPDBcFEYb4dyCl7VHzq4De8sEzgFk3ZQCZWw8PcRoCnZQOC8IKIPKS1aLzoBK65uNVUKDG7AthwZFamwFlxiH9Jm2V9PdbC+iXo6KXXUpiQyqUibO5FDpLSEAyki2BIrbTzcTQlMkqLSoOWI6VWjGiVyiupTlFwIYkwP7KsgJ1IHfhR5r9OB+/fmisKDNdLGHzpxWu1yR10xWuwrVtSht28hEheZOsnriodanfjdYrtU9Sv+lo0dMVnodZzHtGrgQ6a3vIQw6pCETxqQ3DwRbElmBAt15Dp27bnFtDAXYiBnrdSNpTc92PdSnTzT2TmLnx6r6KnzH+h2UpMX6bjQzUh1sGnAeVZiBUVgGqBqwpDElmvujA3U69j7/PN1U5QGBG5mkOsAFw6Kg+Ffip/OaDsTBbXnt6CfN2MGjJ07YfCihMRPVvSwV6X6v2xOHNAVdOLTpzUlY+nTki+bGk7fu6Gl97Xs9joEWYOAC8gTMedTcHEsrrYbDDu4DWwyo0BBoYRleST4zF0zd9Bp3TSqDJUeK16BDm2asKuZAe53CHYcO5gUdDVhHtLjGoKePabSbBhGAsfGQDhrg+suHE7N1uOfIEXj1BTtECxtCAYxTnEEN/p76Ne6eMKTDS+rgpHIYvHlGQ/tOZcrJ6btCSUu3tAsLtaoOtaEZ52bGT2hScWj7hC5Hp9Vli6Zr8AD1M4VAZegkBvblDbwAMksK4qeHJhINPz24AgxNFVS0oQK/l3ooJObzew4fhsNnz8KmrZuBNWt5rBpgGi8BxgMX01x9NP/wZwdYkwfu/RDcrCpmoKRnbnrqCXgNAZrHKkiNItovDCnBFsGacfNqY55RElmtcWdEBADZ01Dqgwi23+iPZw0LJI3vqeKCd5qESGqmnZt3GD47SKsBBLXs/NupXsCjcn43lDulAnrvf0EJiwDW5Ajgx2IVzKF2QvMsBzXs+C/7HiNw86KanJXqlNJulqGhD4M4lX2lqV7YIU2NDiY9q3mkrZH/095H4ejaWT0e81ga/Dqa7L0W4+YF5eEQWxoa3+Pxd/z6+73WN4PdyDH2zaD/1m/ed4MbyXtuWqx1oLoGXy64Dx8kfn4QLUhAbbE/KNCKpFYdUoSbki0n19fhpiefzPtKopiHXusODYzABSr6NHC6eRXRBXCGrDL11g98JFto/+mTcOszT1WhCCPA5huuUF7rwRhG0Eg7Qi9wBVlKo3rfOfub6yc/SGDgOJQ0uLGjewFxG8nTHVy3vGKS1EXFq06Kgii0nX6kzduMBSudhwJSNLKAVwnS3K2IhA8/sR/2nnietmmuryWIpA6s+RXQCUDBla1De0sKHYEAowYl1M+XMO9PWDYj/92HH4L3XnZlZig6LonPODgGhhEilJrT9yWJZm4AA+QUiV1tSLZ/6/d7WnzoOo/3ngF/5oSXKq0OIhz0tWJa8YagVHXoARqRumCBGwKMaktUJWozE8DKFv54KE1x/+lje8uGUoQdmfhqcMJYCsr90vrca6nN6wcdklWPTCWhmB2JyNsPHoBPH3g2rxfM9rNIaEUTzFFVnhCDaWyrQjZ/RGNojsoBYNUE1MkHwTlaOhSfscUwn5ZPfdpRhqq0rV+X1uSlz/vWbWI+zRnJjc4C2vCzYqZkyd8aNuqi95fMbFM0yJyWO2575hm47dmnodu8iSQ0vaNNhRQPFZg6t+RaK4jJYfg1gvD6fmopzXx7lmzo1OOmUwiTKfzE7Z+EE2trw3EZDPHVbDgP7jGafLwTCbwCaVZVtF5FGIC8cZAnwHzLR6bAeNpuGN+65vRj9xalbeVtxGCNs68AKPOLhJBrYBh0QNUuGGyctB3/hNq+HbTJOnDqJPzs7Z/JGOmmK1kAajpaUleEk2nnNiQkK1NhegI9UMBKSRRgM4PSlrfRcbIyhSdOn4JfufcusZs6B2JU+TAjhIeoDo4Plr/eQtGVr7OBZD8SEbxoIxoQdEbtobI/669dtEXHDY+WPe7Tdy9aWvYu1WsHXKyTKKCAzfaoB4n8jhyadYM4Hr9ilQUTdaTrP3r0Edh76gR0ar9v+QwuI0pnVvFl5R2aejJm01/jtsMBeOuLSkGii+7S343l4vKHmph73GQ2hX5lFX4v2tJvu/ASeM/lVxq1xhNXKBnTj1J180JL60s+Ipn1OtGd6kUMZLAMFB2KhgeguFPobaQdBGKw7f0ATZni00JFy2ASpzZcHXgQHUGLTRDzA5VNwO7VIDbrkNdGcKibTQsoVHKR6sCSmf1I+vjQY4/Br3/x3gjm1bKpUPZwdCJsRKhKmSisq6apIxrrgBLAezkaDVSXX2UGQ2OmiRidXXeTDOrUA0/F6J/49Cfg8RPHW9pwKLFR52aZGRo3jJRGVQctIsTe6ZR/uhPpXJct6KoYaal4oz+7kYq8GGlV2XPpoLQTdHXRYpK0ledHp+IavOSIlsWH/ly1H4N5oorg86dPPg8/dfunIyYCdKvTMiCcVI9T0BkCmEkfng6pn9LBaOhcHUYuGDRob6OKZ/EfiUxmx2Ql2kfxOBxm8Hdu/At4MlZIqx7+1W0EXB+0jJMylQQPY3Tq4XSngQE0cKV7WHdq4nhxebmGx5EDGgduIP2yaXFeeqRBlJEWYNLXDtM4Wk3ueBoabOZ26kCKGxxT+n306BH4rg9/CA716xkXk2Q7J9OUJbRkCCQwa+sHVRY06Bs0v7s2NrLEMZPSuZ9w6RQSsdiiidBJlNCT1Uh8VC9PnTkD33PTX8ADRw4bKe3bwHTAxZ1R6OXReaGHpVpn3/vN0SVeJJh0xG5wjs5nbQ1F1YFR27rdaFpYKm3XTAsL6bA0DydcbBsBS22aWGHzQgRGsKaHP/ghxpluvwmBin8fPHwI3v+RG+GJU6cyFiarqxkbWUJrDcT0UaMHwhpAo0NhbXsfOhgBSTNoCY1Qu49Bo5bSkfhNqzDdvAqPxQr93QjqG/ftNSqJe3h+NNjyvStJ3Ejuvr7WYBYA53g1KGJpTGqbvR9GbWu1bI5W3Fj6jabFJdP6vMlkEoaWZwIOTZb6+ijV3fFRL//FfGfvRnDto9stS2k6WBN//Mn98L0f/gvYf+Y0TDYXLGTNnSSz0Aa1XRAHps4A7GBp8KEbfbCRUQUMqQP5pY8tOyWBaDfRrGJSr9y0CZ6brcP/8LFb4Ne+8Hk4G8/FAwJOUsOQeSKFg13ERjO6dLBOJFzQnc1LbLpn1sDDZQ5YMl1JixtIu3y+7WPgmlMdeCipARaqPxeUAJUsuO20kEpt+y9jG//AzTfCkX4WBdommCYMrK5kTGAyNzplP3tBKQV6c8QR3cCo9XIggneBYagP1BdPyug7u8LVtkeBE2WTFYtbhhFHjF6P5sc/v+sO+I8P3g8/+7avha+77AroqGdWVUOg1nWDOZpDh86ty6HB5cAMUD69yq3gRs7NkSnfaxHCBBpCUf1dIm2rks20dN2P01FeUIK6vFlHz6e6zpQrb0HAxq/xXiggJwR8dN9j8HOf+VR+BWKyGoG8aSUem/J4aiKejfoWpOSM5aW4YsLWOQ5U9ytGHJCVN8h89R0aFZFzLDM5qKa+q1slqNnxOmLNg5KQPB6g7K0C7Mejn/oHPvpheMeey+F7rn813HDRHtgeGSBVRD26tcQNANJqhdzhnBRj0KBqZE5jnsd2nq3zVhos3JlLqUeKxDeeW3qTG2jYA1TvvHmMykd3Wq0Ng9WGuh8PqkTnZ9bX4RNPPA6/f/+X4PY4A7geTc4E4mxukmROE27JA8ZChds56GxVG/G7JxnHlD40qleJK2G6kEdoMxGzQ14thboXAYRqKrD663jbsSlotdrHnjo7uwY3P/0k3BR79cvPuwDefeXV8O6rXgYv27ELNiW1BNbkgAXnOSgpHJRak0EQn2dSOjvBYEAwYMNyGkLS15dsFvVAk3fAdiO00vYqQlqcwMvCINU12WhZCyW7OQBPJmVtZmy6eqp/TTXo5MTZs7Dv2BH4yGOPwI3xeOLkiTj7F8dOEbwrEcRddgqsFqkcvRri0UD13jNrfmTgwiivREjC/GA3DZITBPvmfbkZ2Mxwb3MHrqn+4lg5+vOCgdk/XRo6/eu7AvY+MmEWzx+Obr2H4szib3/xbrjhwovh+197A3zd5VfDhgMDtkPTgXiWMDhJXc0SVVVss83HLsIqAixuAZ1WnczLW+LJYrB9oHzRXn4Lv+sH4gG8vc0dQX+VrUNo0Hd3lML/4vbb4AsHnoX1DsskSQTylFy1xWU7zWDOQJ6wZGZzIYCxjzletw2otmkxZKSNllpOV2cU5BoHta9fW2C1a/QX0HmwqOhR7qjLz9sE33jJ5fDeK6+BV+68EFYi+oMzM4x6GqW1SmLjV9amBzOqQ/uc/CyHQhyLDHMeWFLM40bSpj9iR6ajr5n02ZAmEzTxJdS6Iw68HABK0IfBcCCH1128B371ve+D+w8diJ6MffDnUcMenK1VIOf3NJyfGSwPeE2QodStLbwRjcjB7LEy/AwBbLycC3KJokBblWC9nVxCZdM/Mt0C8FfX2CO9btrD11xyKXzbZVfCe/ZcASsR7bNQN5rx1VwUcppOgVkDubMvJaEGt3CW69nBUDb5EUZonNM1wsj91j0Yzwtxflpt6HLaPCDsgPe8yRvk9sSLvD8gVp88DYbFdlb28wDkQVEY/yST8IaLL4W3xPb7wJveDB9/5in4w8cfgTuPxrmGSXm/pJPBH4A2NcoMZeE5GlSXOkg6biO91MPgdQAbP1w5qRVK9zbnvKwWybXKb/TdOkjanjiVlOE1286Dn3j5q+DtaR/DvgBY9jNUDB0DdvAHdyQjkbvqjyXah+48MqMKp3NupYrooIgiO4LUDdTdSldJg4oDnq817xeWlmhGereG+V2NDRnz8DYPdrJo6OUII7+ozBJjosRjJZqT74neqvdefgV8/MAz8MsP3RfnHU4W5QCVd0QARTZ+0X16pXgglPjnJEm5njZvclwYkYvcTSEM5IecZYEXKpMTE/JK6D384wjkb4/ejQumq4PdZf1Os5l/oTYoV00kCJEpzB645kDZyQTgfG1n30QikEEq/VMGEIqXUtdQCcAKtIIdFzfCRsKZZtsG0iJotMueNyqS6ShNljpzqLzocCAg+BwaUhpIe7KXk/dM4SPt9Z02rH/Lrt3wh08+Dr+59xE4lRJNwCjCIZi5HIc3w3AcxjfCYLHGEQib3o6NpQ3Mjp6uQxWA9rAj2lX/5JWvgW+95LKs/WYklc0Os6HSMSotGnGmsomU5kQJVIYydjWDU2C7us6lU77BcUP9emnirwchuLS+Zv63kRYdkynfMGhN3TtJCqIaFFKy4A+wgqRXxfAneEyxFNMVUG+N5sj7r7oO9mzaAv9blNbHs9dlonSLpxABYBykLBs8R1ph2krQAngrs0DgZmmuP60qpwhld6weLp6swK+//k3w6u3nZxNDwByUuaHALYAOlo4x2iSQe66+OwwCYuOX5tyQGQq2dTqcwxVY4t5G0uPwXFwX6l4mrZEWgpIlLKor+upileX5Ym3UOrbmZ3QI6sSbHTOlHWbBPvM3on39qvPPgx+9+/PwRHTzsWjX4GTpjKrTDYVUW6gN6IM6tWAOL4sQYKBua9paQ/SFJWamrSo2bYbfueGtAzDro2+B2REcWoeW6MGWbSkFhxtqhczNAGbRlnlYNJxZNpxD2mX6COLwRnNixj9cz/0rBgOtDwp8dF/zno8kmVvteu2W7fCrr78BLkoLmye1TFPLlhrukFWGLzo8jXw05z4HvJxjsyDX0quSUNb73Rzjf/N1b4IrN2+pYO7L0fcwvmWyVn3QALWTBmJzEyDlKwZsdEiSyhKvegO6f8OY8TsvVdp5sRr/ui9WBw4qa0vlxgNk02YDPMt173ivN1RddyBed8e1W7fBb0dPyBagtaB94wEqqylsrP+DqjDwywz+0IlEPyB4VW2lYFCMKVtUhNkMfj7azFdu3poBvM5gdpI5gxvqN7cayPPUod9mOf121FA4QLEmHWGABu6aGMwnYKDOFx0vVdrR9GDrxSc8bezrzQffTrzywqS5lTUdJr6haVP7roXazuuUJv1etmkr/PT1r8wCToN6gF0vPNER3sKnGmS2306ZI5HtbIdlWrlVtkhOYP5AHBi8e/fFUjEBtTv0xucMYgE4wGAHWi+5tdS4dss2KHYYGrFleRHUOJElFplMga6VoMCRAxZc4waePae8pV+GKoFd29kxMXVaSp037HG8Np2l0YFyeyAd6lltcmTJDOVYU3HfEv3W358+x5uVcVXGClHklbwZ3Noq1Yo1wuLXrRoZFdwSBUEbBMVESlskvyqqme+Mg4Je+ZhbPV8kQG+vPWKD+pUSdT5E0jt27C43mvyocAiidSiepjnrErX+2QYrFlzDBp49p7xFyhH9pUe6p+jJUCU9R31TFDYiSPQBVUiYNoDKd/DtF6yEZxD3wQqx74mAvnrTpgzoIJMMWDMUTJ1baAPaZ4g1PkiN1G8oPSrQILCLhP5InMK+cLqpAlnZzTPFjL53IFUMazKTy1MdQXeOH7z0Srgu2ut17epGPQjwQYMXB4leYNhoo5xLIypa1Xsdhluo40udE2+u2bwZvvviy9rjGA9saJsecg8aZkivzA5lelwQvV3/8NqXw2w2K4PEXm0wDgCGD9KrYNgsI6BfOChEWCClGOBU2z5K59dt2w7v2nWRVJQrpE0LPb3N6o7pbOBZ953BoRti12QVfvaKl0cpsBlkyznJQzMrEB898AMMnbLncsBLnD6AbnypR4BBXYJOE5l01epm+PHLrxWBMwsLvEtt7EBotQmDnto15w9qvBSPr9mxC752x84ipUN1OdbC69ziMkFjdKojszkRQrNSOgbliTrNyv7mZDt/Z5w4SSKhNdhoTW97Bo2FIKWWIPtGh+oDTRL7TVvPh//76lfBfzj8LNx04hjsWz9b3u7Ls2MBZEbFuQXqYBEWE8IsWCaElzAtAAE5WAQy4Gn/m0k8rooA/przt8P7d10KO+Lkx3oYd5kOMDZGQgDxG3DQryuke6mMVKX8Bkc8X8UJfOtFe+AThw/n5eOwo0y4QxIOB+MBqPc8G6QZr/zc54Khbiwl9yRmlJIU6R2NZOj3a+tw9XQFfv+Nb4Wt3VTUTFY7oLwZWiipopbqlGgHRfqrCfP5fGfvySCqYRsvwo+wgXnOeVTz1CUcVsV3xrFyWhdhIWGNfILVYPyrJSW3j0jSoDxNUCXuouB5qj+p4+8Lk+Rc6cpMXvo906/D++74FDwXZuo7w5RJZ8c22mMl5gcOC6fQ3tZtNDiZGhTz8vbIM3jHzj2wXfX+BGRjZsBiMGsKsEWCAk2vHkg/HVeqr9O1MgseKrCNlFV5oqNBbrtxCzSJs7QMgmOvATnXqdETmnkpAseEQQvQRlsqU3AWbHuMgVnzReKUlEZVJn9bkLUoS+oE8FCmx7/9kj3wm0/ui2OuXjZ6KjPPAIOGyVEIi4Te+PvQwVLcYnQVA8U266O58b7o2WBm8K+RyP1iMAdXDEtkRY6pL4M6v/mbpA5JZ1ZzvDa2dHpfgKOhiXdsly8NqYGH86VqcHUz5PT1HsC8hGCcA2G8OBEi+lcG51B/Nfh9xwOY3y6jpgfWNpAxFYH6XdHL8hv79kKYTgkYtOmm+WKBrkE34niY/4I/jkVaSBbDvoft0R56RRwQ9r2VBMbPOXi6hnmN0orLL3sqUAeSCtnzgUpCsHRmvsASQQM2OECrziQrbbFBD3Pq1ei4SBfVC1HycvJETK1BXvPAHCyvjaTW5wADIeTzHGsDqQO0EwTVBjKvEEr7vHr7edGWn8Dx7MIjW7qR2+CrtDmFjgO6qU6D+Q2kQ9ldl97ZSB/RejDLyDfUAYNm9Fw1PacOjCEtLVhjZQYqUwOUyTFWPak6g1gBTfZHYWIoE2PChXHpls/RpjP14/yDep46CpepAb3MABpcegYT09gSMqZdXB4Lg2okLXD0hlB6MmYSmfem83bAx44fIQnd1Rfecl4NaQIwt/GW+wSLM/FiRzhTAH11nOI2zApgZv9aDGMA9rA4GFCH2nNR1T+Fju7rdanB9fJWXKtAb37kaIMspWoV6JlWkbzBdQamP9g00ik4bbD1NnnoOLD5mijX0Xr1nO+AXGed91weUcCRa22embKo8Ku3xDmDo4cgKCeDBTAuTwRoQOveYIxUzlSLEBCq2NzI/s0tWw2TmPktuwwABlJkmdACtcRRRjMGOsWZX9daZsDM0b5RqQDhSHDEBKspWCoNaO+H4OOj19KbeaeaQOc94JeOYI0UhvwN7tx3njAn26WDaiCNIoMLrFJ618pqeVUiqK2RWw1l7A4vnapEGF1ON5DI45f5pXrefqSMEqgvXl09J6ZslHEe1PnHixWwDNUiTpsdxmsBMBRPrV/uREoG1AxV52U54B7XhLEnRkwxnT6UTmBkSytoHjQawJM/qFIYz/6cQO2e58O/sZeO5BHLApEJocDv2QudWN8S1PSa5or3pjhCxXyzxc7uBPJyrKrF/7Q0mFvbcwweh9yJmdZBIwZlZzfuWZ0+LKw18NZb1Q1wpKTUoDyv6MCaXKIRejVJ0UKj7jDObhupxvBeWKqvzA1Olw9IDa5T9aqtpjxRQgdrU+ZvS4OKFmpgdLENHdwTvSabDupd2HhUKhLmM/lcwqCXslSkc98pQ+MZnJPvWJwHRl+LFm1g0rPkZomu81BSHdTzHNcaW7SUSIvoMHLOEWO832ibeDDjgnTmmhHu7o7lsSi0AY3zSQmtk/j/bD9rpB420jyh84IDc3TOWKIFiEWNEFS+Bgyq4wiY6ab3agwGfT5/cB1jhLCxDjdicQyfUXTASF6Lgi5Paz7vixYJje2815K5YXo4M9S3nrseabDFEpoNdG1jtDgXw4H03Rice+861zAA7ghKrb1VG0LuKZu49y0W6jNmyarQaDDNrgatetCk+ajBF8bqBjC0+VWn4nGBLr8fo2MD8YvShpEbWpjla1eZo2trdqKLnsqbHcHGQ3sZA+/t0Ht1NVqLXxx//OTz0AxBnhyZcXzhodnwPl4B0WNiEHDeTRATysgSVRizbzApADAwL4LuFOpmcOmXeXndegpgYOJwXPNZeHFDZrcXKmhZe/DMaStZ+I5vUNSN5+6rVza6QYlS1EhmY8THNPcdP9rOQUmkpY6wgbTqWDRRwA0pC3QjyAtLT508XgYbxPBOV1uZMNLowXaUfM+lL8sKQ/2MyjEGNV0ufw8uDVIGCh97jx2SF7DkRSx+bn6zgarOSxsUb5nuFPaePAGAOK6FdMVb9+W6ZLrxL1YG+aLs9bH35EkzA6zbFlzcgkzPOXhADDp+UGCAAoDT62vwU7feCCfXzgy3yZhTzkCdAhg/awZyB+Ir77GCmz9h8p2Ega3rwLQbIEPpdGcj7b92+62wlhaQx9oRDajn0B/ghYPZ8ELFGbrdM3x95+GDwMtL4AtoeH6y8xH+nK+1NMJB4gLq07MZ3HX4kH3DDU2yHIQBYdigoxKW1TLMl8IAI+q1IcH4uP/wAbj38LPw2LGjAzBji3bXQoYOBOvShBYT7XOeZgQHCFQNRuf8WuYjRw7C3QefhYcjMMxWH1jrr/mnJ7n80W/wCHMOUOVKBR1f7z16GI6tr6sNmywP2sbDfNB3vicbZvq8JK1ycgt6u7wA40effdqCYQTUfC70BYB5HVR7DFoEekmsJzs8OBnY6Z3pvBfIU/vyB50373vEbJFhwI2OfvrtB4UrglogpjgvffVvUHXQr7wybXonsdueeAzOhBnc/PhDeaOeCdo3DXGMPGyTvGzABfn5cvnddW0q/dmTT+S94dHZIsVERpMPjuXr7rU/wZL80c6CNbzcslsTrff8n5/cF3vd2YpzsKAGaDBzpCcNJK0CA0uZQXq0z0rHAQUKtRfPegTDBx9/OK9r/JEnH8/7gzDQtQoXm9rTzWVjI16VG3D00VJ1tI0tDYm1ofSmPGlG7EQ0kW6NnTEtKP6XTz2e66K3zht83ADDjq95tdEwT8Nwh2Sa0V2fipL5o88+WRbEz4viE44oB6HTjyLVKTZoqoPCUVGO4FBd+w6DGQuY01cHaW+NTx08INKtpeI1R7TP1khhPtVpggWtJtnYs3T4vqhpYgmdAHHo7Jm8nvEzZ07BbU/vL4DohuobdB1QsUafa3taHbpqZnbP5cv30cWL1ugK3QnQ9xx6FvadeD7TfuDMGfjoE3ulM2pQG23uCYPaDmGePeeO0MjDXxvtAlbz3fLMk/BYHBAWCd3ROtKVIShMrlxo2tjGBOBBoQY16tZxD+pfUzhmwhKg03Zuv/3og1Fa9Haf584x2BXjpzmFIegOxSgNfKQ8AG0dfZnc0FNq+D945AHaT3ElRk7gDx59ANIaHQO6u6G0KwXU8oNli6mLodPfV52iU3XWHUoDuWweG+BPEu0rtNNYPP7r44/k+1NVP94vUH8W5VsQG829TPDmpD40r/QncumYRWz80eN7C16mE6h7lcMAoCBqDsCqe0c0nXeLKWZydbzKHMBK6UjgZw8fhk8ceNbaoyo76bnpYTWAMJILQQZY5gA7AOMgj9JJLrdTQAb1fRv9fjRK589GKVf2AynA+Pyh5+DmaHrkNJ0FtedfRx0MGuuj67FBa5UjbwJ4a85rEk37Sjw+9fST8JkDz5TOmGmfwO3x+rZYp6kCvv7WUuMBHQIzL5VdE9y9sCCNViWylU2ngKzOb33mqYiRg2WV/7RVCdvRhhEOc9Bo7EYYWTlp/AEDcAXsBOZJ2rh+WnYJ/cUv3Q1HkirvhpIGPXMBmpLLd0gtfX16VCdMYl6DEWGw/Vhi7snZGvzS3Z+j7cZou960oGC8+fN33Zk/4vS2aBMcmpOuIoM06K7pOW0nC5hBgRpq2Qmsa5G2n7/r9kxrJ7SXHVp/8Qt3wrGzpwX8GtiirbpGh/L8bPEch+0DFgbVvFC8zr9Q6DgUafs/vvSFrA0TXspq/938Rm0V7KJ0M7haUHBq0qJQIqXGbAfljesjqO8/cQx+66H7TQ9t2XVjzNJBC785nXNIIsLAK8DH7z98P+w9cTyrvdQJ80HnT0Vb+l/fd4+R5gLmDoZmEMAArEYC6mvFtk5dexOpc+VqcP72/V+CJ6LPP29sSkJkQttR74t26Z/sfUjS+kN3Ri/0/CBca00+b74Oy3UAMB4Wz7e0PevvP/IQ7Dt1qmw0lPZi6SZ1E07B05BAnNfoKtTldEe7HxLDVeaoDHSyfdjLUTeuX4V/F23pv4heD89QM2iBBjhgSAo6svw9n0fnmUkdKn1C/2f7HoV/dd+9tO902egmdcQJb0UWj9+4/4vRJNkvdqsxQbBhRvE5qVyhFRtp6DrofEKVnppfbGLw70eeeBx+6767YbJphWznKe3YOy3aJpog/9e9d8EHH3ukLBvAtndXXXrieXD0MG+D8x0HjXZ0fAcwGiXzvquSeaqOD0Us/OsoSDK/eb/vSfFwaKnG66Ogxp2AvB2Ylo6XVA30LqrYwwDGrgl8nW3CCnIGNw8MJxMyPSLBSSX+7BfugPuPHxEpzcAYmCKKud0yAFdpWGoaNY1qMIWlQdPx8LEj8M8+91k4neIJEJM8mJ3IICXFpy+R/6fPfBIeOHJ4KOXAaprW3uVeeosUVucizdSzvizmVwLzQ0ePwM/dcXve4zGbSStTorsjTVNAjvH3FyLfvxTt1Ck9K/ynQ0tQGTAC2MEjtoFrTCN18GCUtcNKVzvjo8ePwk9/7jMZE4nG6YRox44GhYwnICHJjKo49HjTeGWCO/CR0kVrJtJrOK3qRbr1qvuu7vF9pO/h73/qY/DUqeeNlOPKD4DtQO1tuGYcOHBpqaSkUwLzf3/bR+F4nA6ZrGySBU462ksvg2JSpF3aATVtpfBDH/8oPBif0w017WwjzgOzsSvBSmNtVmg7mQ8GQzqePPk8/Eik/XC0n7u8sWWL9kmW0NN4HItt+IGYfv/zxwywWl4Q7QnhJs3XwQK8C/Y+P5eWJBC6QbUvnT8daX//rTfDmSTwWCtOaTBoGlrkp+BPRFhLOjfi8Jq777ZmqTeSsMTJJzLKuDIfNvI6ZbQc2PraOqyfPQuzeKydOg07I/H/z9e/G1523gV1ERq1ao9fxXKMFEt9Za6W7hpszOj90V7+7ls+BIfixEnatndKG0VOaC89pDLSAoJ9JGx97Wykfy3vTb5ndTP8+298D1y6bbssnCOL6GClmd/h0DSHEdqZnZn+INURAE2hStEnjh+Dv3fLTXAg0lRoX420k4RTtCfez/pZoZtov2LTFvj1r3sXXHXe+WZpW1lkJkBzNasgRDqWV9w1B9zaPEudKAmDf/DJKNDiZFvexD7SzzvNdnkTe16irQ5OMsidLc2Se8BMB+rJjh/+4f8F5gXUDzHruDx1DaxeiSiAahvFcDLODP3Row/BVdu2wSsuuADqrBAMTQgYSl4ttb1fU2zkzrrlsrqNx3+JNvMPfvwWeD7Fpf2naQ/qTjZT76qGEW3TSWHHYqf8k0cehiu2b4NX7txR6Waed65DUaWEXufZYfWuTZiJphlrPT6yfx/8yMf/Eg5HbZGBvKlIuMmAdiKEAA4EiuRp+qM4lnlZBPT1519glKqx7xVfEYbnk86acVrbshZc0b8x/qZo7//EZ2+DgyxEEqBXqqmU7WfXuIXvAjBiXrUUKtBUI8wF9NiDgzgEh2eTRNs6DP61KEFujJWcxd/E3G3J3tNMhSG4NXM7BQ593emBlDIzjsXG/K0Hvgi/GAdJZ7ATIBdATCoglC9LQN0RE2mvw1NR69y0b1/+oPOa886D80Zo9+aQNkUMQBqAnlJ8+j0ZJdov3fU5+OV774aTKT7SvbKpRXsnTKu0E7CJiLUofv/8sUdz21x7/vmwPdEOli5PoxEg6toM7qE9eH0+8v1f3veFyPfPw6mYMG9kT6ZQcZFW2mUDUGIceheYs6PngTlHDUyOFEbeAA+ik/oq+vvyxXf169BC1oEWcEzmx/paND3Ws/nBZsjVm7fAT7z+q+Cdey6PDOkG664xGU1KcAh+bYOeiRLhtmefjgOjO2FvtN+K5yKZGKt5AiK7ubqJME73fl7ZMn9aH9X3bD3RT+bTWqrHGlweaf+ZN78Fvv7Sy/KAzK8IZNQ22DpgY9aQ9yzqch49fPqZZ+CffvqTcSr+tKO9uOk6nioeoT0RMiPaZ5n2tczzRPsroqT+4de8Hr7h0itz6WZrEGi76wy9CmsT/qXzNAP4mQNPwy/f8zl44Pnj0RNDAmS1emTy/t9KIxpTg8EdQIHcSWeDg3mA1jf79rIvZhlT/rDR2NIAvKQBr4Bd1rxbz4ydra1npiZw9BEcIca9bfdF8J3XvBzefdmVsGU6ta84wpCxqOpiJEk8PxE7zs3RNfSf47Tqrc8+lScdpnkWjcAgdudEADEaAtAq831enDuDOY0Loh3bn020z+CrL74Y3nfttfBNV12Vpd5gSVq0tOuLTL+yoY9Ge/fWOPv3+w8+CHcefC6q47Qh/JRUdOmIxW/bKdpHVKTQXkGd6M/AjnXoYn1eu2MnfMe1L4f3XH41bIt80qtc8a8Onu9a2xyPPLk9Avl3H7ov0n6gDFizRF6VafmJTHNP8kNDMAOYUT8BGnXB8r1hI9B9vPaeeyrt/EAIlVXaCB8MDivajJSmDhFohfZAA60C7JlIugRqZvY1ccD1jXuugG+/5jp4ZWR2KrQlJTSDS90C3HP4UDZl/mTvI/DM6VNlKpt8s8zQjtR0deRzvii4EJ4BrUUSaBFKBsdaAkcBxSw2YqpLH+m/aus2eOell8L7XnYdvCl2UNmPRPjW6JBQAH3Xc8/Bjfsehz999FF4+vQpmiyZin9cBq5Tol1UNEiDq2ar3CJQ8+ZNBdhr0jHT0sepPa7del7eb/19174MXnXBTuClxlvaUWMuCbG7Dz0Ht0Zf/QejAHni9IncCQvPiwDp2MRIbsWueGOA5ityfmn/9XTSVds5l58L6gSnAuKgpAEUya35mqHKgJYIboMgzW1upLWg7ar9UJpfJHZGcr6OrAQkSd0rEySBOAFhRkdibmJ4ktipEc6PDfrmCy+Ga7afBxdG9X5+sh+JgLWYz/FoXx6MnpO9cTbyzgiIw2tnyjsBNEvJEw1ZKrB7iyRbp2xOgkRFXf6rUVjq03OnTEeiN0vsdalHn4AdwZHqd0Es780XXQTXRFt195bNcEGincpKtuzRqJ0OnY60R8/F5yPtB8+cNTOs2Q+eNEukP7vjplUqi5mhGzV3HKwLs7DJpMxD9twk/s4GtJf6JNp3Rtpft+vC7InavXlzHCes5vXnUogp8uD4udjpHovmxF1RixyJnRrFB86TJVM5Ty5QZD851lFlBm1nB4DJdg7GxKjnDDcWQlxngKGSzYCGVhizo/meA3WGtTJDyAdW05NbLzO2nxWJvb4uUruAYpalSU8bsvRkk4vIMHqvU7OTXQX0ZCqDJlZx7O+UKVbdc1HLzGDrzp0V2Kb2wE6dcVb2CyHaWRsF3gXJ85JUbWrUTDcN7jKQJ9OqSQztRL+g2dPebjutZRI9zPvAZghpzcT7zHfZnaov30XrsZIMygotQhdpDn6Hp+NOyG0y6Spw2dRA6/bRAG4OBFth5N507gMNR7CVZ6yuS/dJdMoH4lyBQFvzpsqnDYUmHc009qUh+8QIZuiMVCRtbxF6JWmG6gZI4qK8utoViUHqLcejArLoTPVrEUKVq4BG6qBZgmA5WFp2swn00zhJQ2BIC75nLUQ7pga/vpfy+Ajtk05evUUBwRzaofFrQgC2eVghs/RLwOr7JB2TCRP5nrXKtPB9VjsrjPGdaJeX8h3txa9M8ZjukX0iLjkE4xoCBWapTwPMWgCN1ruEja0+ajLkxkKoi9xpUEvXjrf7AuJU2QQOJID0XWZiVqWRKazaZTMZ9qAAGCM0k9LV/bxRqWQUkNMLUwbAlXFo6qUrF4oECUGtA106dx7ERTDk1wQS7dRJQ+pM3AFZktPoVvY/UdKg0K20hjmQ7HwE80qlp320UQvRTdonpNozj0t5YdIX2jXfaYJM+J6Obg7tJIUHmlAdAzCjm53WUrpVJTkfB3MK87ek8NcmKS/oSAAQBhCoZRVwECAH0AwuwM62VPo0ui9xxUwJ4vrLwHKjKv0yS/W9FjUIZI8NmCXPcSbYZpjaQAXVaMvQnssk2vtUZho4VrNKz6AuTTv7wVu0E78r7Ypo075YtaVI6hbtSUqHzHfueL3srxdqHTiPIu6HtJP/3ggWJzw8sOvzmnjbHrgAtPPCdID4RZlpTwjSICr34I7AX6RRYQOafJH91KoiWVqTfZx/J50CBVTGUnrJ34AUrY2pQbsIzD54aZCL6/NC7kHVveTYZ6lXBiwh84D3Aay0g6IfLO2IDiScxA1ccQHtWvAgOl5pkms65HwTnV2QjhkE1OD4DoYW4bumXUtZHSevH+pnoKaFeo4D3jfqOicsb3IMCiJQA3diRQ1J7jwY6INdEQgnWU2D8BZFMiCbLZSH2WAueJsDrOo1IKZ8jIRGWwd5RpUpZCqpyvqWO1w2RZj4yQjtQeUFA1ygq8eARlyedqx2jOOXTT+gXQ1YBdx0rbvfwFyaR7t0QAAZ+Ml9UJ1X5aE6wQsFcwpTjbVmUBWVtHwyCupQJFpKlE0KxewQSJqTVOPGR8pUhFooDGBJgR1UicP54RDQAIBO5QV9XzO2PmJPVQ+sp1ReNjPSNfnaNY8g1A1FSL1L5waiGX2h2KAdXN0U0M11bYpyqfilaWfNwlqS8hCNw3wXcwWE/wGHgsTSrujmarBEVmlqvQCqr/nFBXMKZuNNqxhrvj5/c88wiWznTHxhEtLgShqXMFyaVzFZSYKgGbsMHU6CMYil8QXElZm2fjpXMqW4oQgkgW1+BmgyL6h+tSOivDq3iOZKru2QfM31CqoDapkRTI4cF1Q+NTGbbTJ2z0IGlKSu6ZaiGSzfmc+8KLmhnUAr5ikDGXGw4ZW0G8LAyGydt/hsTI5Bp9C/oma5cCApCwLKoOINgVoqAJJkhjpBg1WKo86EH2MbW2qAhglYiTRSgJlHlqq6Jyn0IxIbGBcQNANMvVnDBKKd0RKU1gJdd8VHLY1atNdzpElBHKWdfwLUzgdEOypeMFSlGZE1iGpXqhwaLWlpr+RZMGvaUfO9EV/4AnYFWBU/aBPEAZDBXfPvtJVoNKAd+fsGQGJCYG5nSwHNLKKuYHBbSxUQ8iruOOyGo3S5E7TMMw/XnmB/VTkCwlDjURAkibI2MqzO/3WdYJB3m3aFTAI5eoDDCO0WiyBodPtTiMQOoaLJPSwQDUMyxWxxJGnazMcgDhtSjsqjVNcxhdvNlbcURmN66+XwROtrf48yKPdUkRrY8uYUWN3AmBB7SW9xQYl0e4wCQV0oqSESQz/fArDPSC/sAa7uwRPD0ockMxfm9iscFINQeRkqregb3nQAtHVo0WzOcQjaUhFgyVnpINoNwGEIalO+ohNgfudjfqqOizAHS63rFib9L92bbjhTbLSWAU8thIWCrHOlgco2HD2jwQ1BD+Ra4qIWjIY2dUuBxdI9TKvlgDEQdJ1QgxqgaigCJPuv2YaeR7uyK5envUkwKAMGzFggKBAx7SLRg8qXaCeAByZg0Mw4LLFFO0e0OiBWSBth2IBUE2emTBymyxL6XAMDV65BEVh7jICaEykholV6uV0NKA2yprRoE1V/Rhg693F/Txfd6pRMuxoUV6nlM2gV0Cj9y017TqsEi87pXPhO+bQ6oBE+nP9GwLxEOHdAc8HB1boBbNR+WZYaGvgi/eYxcsT+QEePv4HtpMsyzXhwwNPuAMIheDJeGO3nQrce0M2lXZMHG6AdWvSPgNikASvUBnmeO5hTeGGA1gRsANg5WtMtEgSy0h/uOei7MsK4SoTlgTAmIXS80zZMrpSQcNGhnVkz9L8ItGs6WjT6eJ++QTt7c2paR7sZM+j7uDHacUFHWJTWPRZgfpiWdzKU/5Ey1e9D13rj0FdJUjo4aT2UDjZvW+nyE9QFC4eQB5RolEGllU3DlqhRNOtn1L3RJW7RyyVUQABomloZpx1REXj8pX0HjmbK19RaiAaemBnQ7Mod3ENFM+eNdWyQ2cltizUH7o+opLmlGW2nMGmpDYxbF4c0W9IVzTgfdy6PeWmnzDh9Ax0T6qyXTQtgO4GvVKD0qK8BqQJg03K5YGuueA4amrVMUPR48FJa3Umw0iVxaqTcphkkt1J2nbVUpKoGwDbNFG/GMTDkfYnoVL1KJ9kQzahyD5UHmndgylQ059lcrM/pduBidVr0g/OC9ADu+RbNiJYOVQ+NBXR8ZozKfcp78HJSMxNNqAuDwrWKtuLINYh6CtXzXnqbwlpVtfc4b1XVQXLfKXW95tLMZ452uRPCKF0wXqsB7fYe/yyg2WQ3ntaoJcUaQ3urvceq0alpbj3YxAU0y8ts87NvhWYayvuF29Cjpere2mroxjPB3RiIrbFnwOqnpbiyGGBNurmMFg2A42lg7Bl4cWmXPM+R9nk81+rPP78M7Yjzr1+E8P8B0szv+tLrxRwAAAAASUVORK5CYII=")'}}),Trust=({theme:et="light",...o})=>jsxRuntimeExports.jsxs("svg",{...o,width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"44",height:"44",fill:et==="light"?"var(--ck-brand-trust-02)":"var(--ck-brand-trust-02b)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.0246 11.8662C33.4096 11.8662 33.774 12.0243 34.0421 12.2925C34.3102 12.5675 34.4615 12.9387 34.4546 13.3168C34.3859 17.4143 34.2277 20.5493 33.9321 23.0312C33.6433 25.5131 33.2102 27.3556 32.5571 28.8475C32.1171 29.8443 31.574 30.6693 30.9346 31.3706C30.0752 32.2987 29.0921 32.9725 28.0196 33.6119C27.561 33.8861 27.0843 34.1568 26.5842 34.4408C25.5172 35.0468 24.3441 35.713 23.0146 36.6025C22.5333 36.9256 21.9077 36.9256 21.4265 36.6025C20.0766 35.7026 18.8879 35.0281 17.8112 34.4173C17.5718 34.2815 17.3379 34.1488 17.109 34.0175C15.8509 33.2887 14.7165 32.5943 13.7265 31.5906C13.0665 30.9306 12.4959 30.1262 12.0421 29.1706C11.4234 27.8918 11.004 26.345 10.6946 24.3443C10.2821 21.67 10.0759 18.1706 10.0002 13.3168C9.99336 12.9387 10.1377 12.5675 10.4059 12.2925C10.674 12.0243 11.0452 11.8662 11.4302 11.8662H12.0215C13.8433 11.8731 17.8652 11.6943 21.344 8.98559C21.8596 8.58683 22.5815 8.58683 23.0971 8.98559C26.5759 11.6943 30.5977 11.8731 32.4265 11.8662H33.0246ZM29.8277 27.9331C30.2746 27.0118 30.6459 25.74 30.9277 23.9112C31.2646 21.725 31.4709 18.755 31.5671 14.7125C29.4221 14.6506 25.7371 14.2381 22.224 11.8731C18.7109 14.2312 15.0259 14.6437 12.8877 14.7125C12.9633 18.0537 13.1146 20.6525 13.3552 22.6943C13.6302 25.0181 14.0221 26.5925 14.5102 27.6993C14.8333 28.435 15.1909 28.9643 15.6171 29.4318C16.1877 30.0575 16.9096 30.5731 17.8927 31.1643C18.3005 31.409 18.7502 31.6635 19.2396 31.9406C20.1116 32.4341 21.1099 32.9991 22.224 33.7081C23.3175 33.0107 24.3014 32.4515 25.1633 31.9616C25.4231 31.8139 25.6717 31.6725 25.909 31.5356C27.119 30.8412 28.0127 30.2637 28.6796 29.59C29.1265 29.1293 29.4909 28.6275 29.8277 27.9331Z",fill:et==="light"?"var(--ck-brand-trust-01)":"var(--ck-brand-trust-01b)"})]}),Argent=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"32",height:"32",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M18.3242 7.63647H13.6516C13.4955 7.63647 13.3704 7.76611 13.367 7.92726C13.2726 12.4568 10.9768 16.7559 7.02532 19.8009C6.89986 19.8976 6.87128 20.0792 6.963 20.21L9.69685 24.112C9.78986 24.2448 9.97107 24.2747 10.0986 24.1772C12.5694 22.2856 14.5567 20.0038 15.9879 17.4746C17.4191 20.0038 19.4065 22.2856 21.8773 24.1772C22.0047 24.2747 22.186 24.2448 22.2791 24.112L25.013 20.21C25.1045 20.0792 25.0759 19.8976 24.9506 19.8009C20.999 16.7559 18.7033 12.4568 18.609 7.92726C18.6056 7.76611 18.4803 7.63647 18.3242 7.63647Z",fill:"var(--ck-brand-argent)"})]}),ImToken=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:`linear-gradient( - 180deg, - var(--ck-brand-imtoken-01) 0%, - var(--ck-brand-imtoken-02) 100% - )`},children:jsxRuntimeExports.jsx("path",{d:"M26.8543 9.96509C27.5498 19.3857 21.4942 23.8384 16.0655 24.3132C11.0184 24.7546 6.26765 21.6534 5.85087 16.8885C5.50707 12.952 7.94004 11.2761 9.8516 11.109C11.8177 10.9367 13.4698 12.2925 13.6132 13.9342C13.7512 15.5125 12.7664 16.2308 12.0815 16.2906C11.5398 16.3381 10.8584 16.0093 10.7968 15.3032C10.7441 14.6965 10.9744 14.6138 10.9182 13.9693C10.8179 12.8219 9.81731 12.6882 9.26951 12.7357C8.60654 12.7937 7.40368 13.5675 7.5725 15.4949C7.7422 17.439 9.60628 18.9751 12.0498 18.7614C14.6868 18.531 16.5227 16.4779 16.6608 13.5983C16.6595 13.4458 16.6916 13.2948 16.7548 13.156L16.7557 13.1525C16.7841 13.0922 16.8174 13.0342 16.8551 12.9793C16.9113 12.8949 16.9835 12.8016 17.0767 12.6997C17.0775 12.697 17.0775 12.697 17.0793 12.697C17.147 12.6205 17.2288 12.5379 17.3211 12.4491C18.473 11.3623 22.6214 8.79916 26.5448 9.61074C26.6277 9.62851 26.7026 9.67262 26.7584 9.73649C26.8142 9.80035 26.8478 9.88054 26.8543 9.96509",fill:"white"})}),Frame=({...et})=>jsxRuntimeExports.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"32",height:"32",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M24.9055 15.8824V8.30065C24.9055 7.63399 24.3583 7.08497 23.6938 7.08497H16.1238C16.0456 7.08497 15.9805 7.05882 15.9153 7.00654L15.0033 6.0915C14.9511 6.03922 14.873 6 14.7948 6H7.21173C6.54723 6 6 6.53595 6 7.21569V14.7974C6 14.8758 6.02606 14.9412 6.07818 15.0065L6.99023 15.9216C7.04235 15.9739 7.08143 16.0523 7.08143 16.1307V23.7124C7.08143 24.3791 7.62866 24.9281 8.29316 24.9281H15.8762C15.9544 24.9281 16.0195 24.9542 16.0847 25.0065L16.9967 25.9216C17.0489 25.9739 17.127 26 17.2052 26H24.7883C25.4528 26 26 25.4641 26 24.7843V17.2026C26 17.1242 25.9739 17.0588 25.9218 16.9935L25.0098 16.0784C24.9446 16.0261 24.9055 15.9608 24.9055 15.8824ZM19.759 19.9346H12.241C12.1498 19.9346 12.0717 19.8562 12.0717 19.7647V12.2353C12.0717 12.1438 12.1498 12.0654 12.241 12.0654H19.759C19.8502 12.0654 19.9283 12.1438 19.9283 12.2353V19.7647C19.9414 19.8562 19.8632 19.9346 19.759 19.9346Z",fill:"#00D2BE"})]}),Rainbow=({round:et=!1,...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{backgroundSize:"100% 100%",backgroundImage:`url("${et?"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMF84XzU1NCkiPgo8bWFzayBpZD0ibWFzazBfOF81NTQiIHN0eWxlPSJtYXNrLXR5cGU6YWxwaGEiIG1hc2tVbml0cz0idXNlclNwYWNlT25Vc2UiIHg9IjAiIHk9IjAiIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIj4KPGNpcmNsZSBjeD0iNjAiIGN5PSI2MCIgcj0iNjAiIGZpbGw9IiNEOUQ5RDkiLz4KPC9tYXNrPgo8ZyBtYXNrPSJ1cmwoI21hc2swXzhfNTU0KSI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfOF81NTQpIi8+CjwvZz4KPHBhdGggZD0iTTI2LjY2NjcgNDEuNjY2N0gzMS42NjY3QzU3LjQ0IDQxLjY2NjcgNzguMzMzMyA2Mi41NiA3OC4zMzMzIDg4LjMzMzNWOTMuMzMzM0g4OC4zMzMzQzkxLjA5NDggOTMuMzMzMyA5My4zMzMzIDkxLjA5NDcgOTMuMzMzMyA4OC4zMzMzQzkzLjMzMzMgNTQuMjc1OCA2NS43MjQyIDI2LjY2NjcgMzEuNjY2NyAyNi42NjY3QzI4LjkwNTIgMjYuNjY2NyAyNi42NjY3IDI4LjkwNTIgMjYuNjY2NyAzMS42NjY3VjQxLjY2NjdaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfOF81NTQpIi8+CjxwYXRoIGQ9Ik04MCA4OC4zMzMzSDkzLjMzMzNDOTMuMzMzMyA5MS4wOTQ4IDkxLjA5NDcgOTMuMzMzMyA4OC4zMzMzIDkzLjMzMzNIODBWODguMzMzM1oiIGZpbGw9InVybCgjcGFpbnQyX2xpbmVhcl84XzU1NCkiLz4KPHBhdGggZD0iTTMxLjY2NjcgMjYuNjY2N0wzMS42NjY3IDQwSDI2LjY2NjdMMjYuNjY2NyAzMS42NjY3QzI2LjY2NjcgMjguOTA1MiAyOC45MDUyIDI2LjY2NjcgMzEuNjY2NyAyNi42NjY3WiIgZmlsbD0idXJsKCNwYWludDNfbGluZWFyXzhfNTU0KSIvPgo8cGF0aCBkPSJNMjYuNjY2NiA0MEgzMS42NjY2QzU4LjM2MDQgNDAgODAgNjEuNjM5NiA4MCA4OC4zMzMzVjkzLjMzMzNINjVWODguMzMzM0M2NSA2OS45MjM4IDUwLjA3NjEgNTUgMzEuNjY2NiA1NUgyNi42NjY2VjQwWiIgZmlsbD0idXJsKCNwYWludDRfcmFkaWFsXzhfNTU0KSIvPgo8cGF0aCBkPSJNNjYuNjY2NiA4OC4zMzMzSDgwVjkzLjMzMzNINjYuNjY2NlY4OC4zMzMzWiIgZmlsbD0idXJsKCNwYWludDVfbGluZWFyXzhfNTU0KSIvPgo8cGF0aCBkPSJNMjYuNjY2NiA1My4zMzMzTDI2LjY2NjYgNDBMMzEuNjY2NiA0MEwzMS42NjY2IDUzLjMzMzNIMjYuNjY2NloiIGZpbGw9InVybCgjcGFpbnQ2X2xpbmVhcl84XzU1NCkiLz4KPHBhdGggZD0iTTI2LjY2NjYgNjEuNjY2N0MyNi42NjY2IDY0LjQyODEgMjguOTA1MiA2Ni42NjY3IDMxLjY2NjYgNjYuNjY2N0M0My42MzI4IDY2LjY2NjcgNTMuMzMzMyA3Ni4zNjcyIDUzLjMzMzMgODguMzMzM0M1My4zMzMzIDkxLjA5NDcgNTUuNTcxOSA5My4zMzMzIDU4LjMzMzMgOTMuMzMzM0g2Ni42NjY2Vjg4LjMzMzNDNjYuNjY2NiA2OS4wMDM0IDUwLjk5NjYgNTMuMzMzMyAzMS42NjY2IDUzLjMzMzNIMjYuNjY2NlY2MS42NjY3WiIgZmlsbD0idXJsKCNwYWludDdfcmFkaWFsXzhfNTU0KSIvPgo8cGF0aCBkPSJNNTMuMzMzMyA4OC4zMzMzSDY2LjY2NjZWOTMuMzMzM0g1OC4zMzMzQzU1LjU3MTkgOTMuMzMzMyA1My4zMzMzIDkxLjA5NDggNTMuMzMzMyA4OC4zMzMzWiIgZmlsbD0idXJsKCNwYWludDhfcmFkaWFsXzhfNTU0KSIvPgo8cGF0aCBkPSJNMzEuNjY2NiA2Ni42NjY3QzI4LjkwNTIgNjYuNjY2NyAyNi42NjY2IDY0LjQyODEgMjYuNjY2NiA2MS42NjY3TDI2LjY2NjYgNTMuMzMzM0wzMS42NjY2IDUzLjMzMzNMMzEuNjY2NiA2Ni42NjY3WiIgZmlsbD0idXJsKCNwYWludDlfcmFkaWFsXzhfNTU0KSIvPgo8L2c+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfOF81NTQiIHgxPSI2MCIgeTE9IjAiIHgyPSI2MCIgeTI9IjEyMCIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMTc0Mjk5Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAwMUU1OSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50MV9yYWRpYWxfOF81NTQiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzEuNjY2NyA4OC4zMzMzKSByb3RhdGUoLTkwKSBzY2FsZSg2MS42NjY3KSI+CjxzdG9wIG9mZnNldD0iMC43NzAyNzciIHN0b3AtY29sb3I9IiNGRjQwMDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjODc1NEM5Ii8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQyX2xpbmVhcl84XzU1NCIgeDE9Ijc5LjE2NjYiIHkxPSI5MC44MzMzIiB4Mj0iOTMuMzMzMyIgeTI9IjkwLjgzMzMiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGNDAwMCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM4NzU0QzkiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDNfbGluZWFyXzhfNTU0IiB4MT0iMjkuMTY2NyIgeTE9IjI2LjY2NjciIHgyPSIyOS4xNjY3IiB5Mj0iNDAuODMzMyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjODc1NEM5Ii8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0ZGNDAwMCIvPgo8L2xpbmVhckdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50NF9yYWRpYWxfOF81NTQiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzEuNjY2NiA4OC4zMzMzKSByb3RhdGUoLTkwKSBzY2FsZSg0OC4zMzMzKSI+CjxzdG9wIG9mZnNldD0iMC43MjM5MjkiIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQ1X2xpbmVhcl84XzU1NCIgeDE9IjY2LjY2NjYiIHkxPSI5MC44MzMzIiB4Mj0iODAiIHkyPSI5MC44MzMzIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQ2X2xpbmVhcl84XzU1NCIgeDE9IjI5LjE2NjYiIHkxPSI1My4zMzMzIiB4Mj0iMjkuMTY2NiIgeTI9IjQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ3X3JhZGlhbF84XzU1NCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgzMS42NjY2IDg4LjMzMzMpIHJvdGF0ZSgtOTApIHNjYWxlKDM1KSI+CjxzdG9wIG9mZnNldD0iMC41OTUxMyIgc3RvcC1jb2xvcj0iIzAwQUFGRiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiMwMURBNDAiLz4KPC9yYWRpYWxHcmFkaWVudD4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDhfcmFkaWFsXzhfNTU0IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDUyLjUgOTAuODMzMykgc2NhbGUoMTQuMTY2NyAzNy43Nzc4KSI+CjxzdG9wIHN0b3AtY29sb3I9IiMwMEFBRkYiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDFEQTQwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ5X3JhZGlhbF84XzU1NCIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyOS4xNjY2IDY3LjUpIHJvdGF0ZSgtOTApIHNjYWxlKDE0LjE2NjcgMjY4LjY0MikiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8Y2xpcFBhdGggaWQ9ImNsaXAwXzhfNTU0Ij4KPHJlY3Qgd2lkdGg9IjEyMCIgaGVpZ2h0PSIxMjAiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg==":"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCIgdmlld0JveD0iMCAwIDEyMCAxMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiBmaWxsPSJ1cmwoI3BhaW50MF9saW5lYXJfNjJfMzI5KSIvPgo8cGF0aCBkPSJNMjAgMzhIMjZDNTYuOTI3OSAzOCA4MiA2My4wNzIxIDgyIDk0VjEwMEg5NEM5Ny4zMTM3IDEwMCAxMDAgOTcuMzEzNyAxMDAgOTRDMTAwIDUzLjEzMDkgNjYuODY5MSAyMCAyNiAyMEMyMi42ODYzIDIwIDIwIDIyLjY4NjMgMjAgMjZWMzhaIiBmaWxsPSJ1cmwoI3BhaW50MV9yYWRpYWxfNjJfMzI5KSIvPgo8cGF0aCBkPSJNODQgOTRIMTAwQzEwMCA5Ny4zMTM3IDk3LjMxMzcgMTAwIDk0IDEwMEg4NFY5NFoiIGZpbGw9InVybCgjcGFpbnQyX2xpbmVhcl82Ml8zMjkpIi8+CjxwYXRoIGQ9Ik0yNiAyMEwyNiAzNkgyMEwyMCAyNkMyMCAyMi42ODYzIDIyLjY4NjMgMjAgMjYgMjBaIiBmaWxsPSJ1cmwoI3BhaW50M19saW5lYXJfNjJfMzI5KSIvPgo8cGF0aCBkPSJNMjAgMzZIMjZDNTguMDMyNSAzNiA4NCA2MS45Njc1IDg0IDk0VjEwMEg2NlY5NEM2NiA3MS45MDg2IDQ4LjA5MTQgNTQgMjYgNTRIMjBWMzZaIiBmaWxsPSJ1cmwoI3BhaW50NF9yYWRpYWxfNjJfMzI5KSIvPgo8cGF0aCBkPSJNNjggOTRIODRWMTAwSDY4Vjk0WiIgZmlsbD0idXJsKCNwYWludDVfbGluZWFyXzYyXzMyOSkiLz4KPHBhdGggZD0iTTIwIDUyTDIwIDM2TDI2IDM2TDI2IDUySDIwWiIgZmlsbD0idXJsKCNwYWludDZfbGluZWFyXzYyXzMyOSkiLz4KPHBhdGggZD0iTTIwIDYyQzIwIDY1LjMxMzcgMjIuNjg2MyA2OCAyNiA2OEM0MC4zNTk0IDY4IDUyIDc5LjY0MDYgNTIgOTRDNTIgOTcuMzEzNyA1NC42ODYzIDEwMCA1OCAxMDBINjhWOTRDNjggNzAuODA0IDQ5LjE5NiA1MiAyNiA1MkgyMFY2MloiIGZpbGw9InVybCgjcGFpbnQ3X3JhZGlhbF82Ml8zMjkpIi8+CjxwYXRoIGQ9Ik01MiA5NEg2OFYxMDBINThDNTQuNjg2MyAxMDAgNTIgOTcuMzEzNyA1MiA5NFoiIGZpbGw9InVybCgjcGFpbnQ4X3JhZGlhbF82Ml8zMjkpIi8+CjxwYXRoIGQ9Ik0yNiA2OEMyMi42ODYzIDY4IDIwIDY1LjMxMzcgMjAgNjJMMjAgNTJMMjYgNTJMMjYgNjhaIiBmaWxsPSJ1cmwoI3BhaW50OV9yYWRpYWxfNjJfMzI5KSIvPgo8ZGVmcz4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDBfbGluZWFyXzYyXzMyOSIgeDE9IjYwIiB5MT0iMCIgeDI9IjYwIiB5Mj0iMTIwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiMxNzQyOTkiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDAxRTU5Ii8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQxX3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjYgOTQpIHJvdGF0ZSgtOTApIHNjYWxlKDc0KSI+CjxzdG9wIG9mZnNldD0iMC43NzAyNzciIHN0b3AtY29sb3I9IiNGRjQwMDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjODc1NEM5Ii8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQyX2xpbmVhcl82Ml8zMjkiIHgxPSI4MyIgeTE9Ijk3IiB4Mj0iMTAwIiB5Mj0iOTciIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGNDAwMCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM4NzU0QzkiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDNfbGluZWFyXzYyXzMyOSIgeDE9IjIzIiB5MT0iMjAiIHgyPSIyMyIgeTI9IjM3IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CjxzdG9wIHN0b3AtY29sb3I9IiM4NzU0QzkiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY0MDAwIi8+CjwvbGluZWFyR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ0X3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjYgOTQpIHJvdGF0ZSgtOTApIHNjYWxlKDU4KSI+CjxzdG9wIG9mZnNldD0iMC43MjM5MjkiIHN0b3AtY29sb3I9IiNGRkY3MDAiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjRkY5OTAxIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxsaW5lYXJHcmFkaWVudCBpZD0icGFpbnQ1X2xpbmVhcl82Ml8zMjkiIHgxPSI2OCIgeTE9Ijk3IiB4Mj0iODQiIHkyPSI5NyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgo8c3RvcCBzdG9wLWNvbG9yPSIjRkZGNzAwIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI0ZGOTkwMSIvPgo8L2xpbmVhckdyYWRpZW50Pgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50Nl9saW5lYXJfNjJfMzI5IiB4MT0iMjMiIHkxPSI1MiIgeDI9IjIzIiB5Mj0iMzYiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGRjcwMCIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjk5MDEiLz4KPC9saW5lYXJHcmFkaWVudD4KPHJhZGlhbEdyYWRpZW50IGlkPSJwYWludDdfcmFkaWFsXzYyXzMyOSIgY3g9IjAiIGN5PSIwIiByPSIxIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgZ3JhZGllbnRUcmFuc2Zvcm09InRyYW5zbGF0ZSgyNiA5NCkgcm90YXRlKC05MCkgc2NhbGUoNDIpIj4KPHN0b3Agb2Zmc2V0PSIwLjU5NTEzIiBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8cmFkaWFsR3JhZGllbnQgaWQ9InBhaW50OF9yYWRpYWxfNjJfMzI5IiBjeD0iMCIgY3k9IjAiIHI9IjEiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiBncmFkaWVudFRyYW5zZm9ybT0idHJhbnNsYXRlKDUxIDk3KSBzY2FsZSgxNyA0NS4zMzMzKSI+CjxzdG9wIHN0b3AtY29sb3I9IiMwMEFBRkYiLz4KPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjMDFEQTQwIi8+CjwvcmFkaWFsR3JhZGllbnQ+CjxyYWRpYWxHcmFkaWVudCBpZD0icGFpbnQ5X3JhZGlhbF82Ml8zMjkiIGN4PSIwIiBjeT0iMCIgcj0iMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjMgNjkpIHJvdGF0ZSgtOTApIHNjYWxlKDE3IDMyMi4zNykiPgo8c3RvcCBzdG9wLWNvbG9yPSIjMDBBQUZGIi8+CjxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iIzAxREE0MCIvPgo8L3JhZGlhbEdyYWRpZW50Pgo8L2RlZnM+Cjwvc3ZnPgo="}")`}}),Brave$1=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{rx:"27%",width:"88",height:"88",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M69.0892 28.2123L70.5781 24.5643L66.3594 20.1967C64.0763 17.9136 59.2123 19.2537 59.2123 19.2537L53.7031 13H34.2721L28.7381 19.2785C28.7381 19.2785 23.8741 17.9632 21.591 20.1967L17.3722 24.5395L18.8612 28.1875L17 33.5974L23.204 57.2472C24.4945 62.3097 25.3631 64.2702 29.011 66.8511L40.352 74.5441C41.4439 75.2142 42.784 76.3805 44 76.3805C45.216 76.3805 46.5561 75.2142 47.648 74.5441L58.989 66.8511C62.6369 64.2702 63.5055 62.3097 64.796 57.2472L71 33.5974L69.0892 28.2123Z",fill:"url(#paint0_linear_2183_5890)"}),jsxRuntimeExports.jsx("path",{d:"M57.6737 23.2739C57.6737 23.2739 64.796 31.8851 64.796 33.6967C64.796 35.5579 63.9026 36.0294 63.0092 36.9972L57.6737 42.705C57.1774 43.2013 56.1103 44.045 56.7307 45.5092C57.3511 46.9982 58.2197 48.8346 57.227 50.7206C56.2344 52.6314 54.4972 53.8971 53.3805 53.6985C51.7195 53.1594 50.1348 52.4088 48.6654 51.4651C47.7224 50.8447 44.6949 48.3382 44.6949 47.3704C44.6949 46.4026 47.8217 44.6406 48.4173 44.2932C48.9881 43.8961 51.6434 42.3575 51.693 41.7619C51.7427 41.1664 51.7427 41.0175 50.9485 39.5285C50.1544 38.0395 48.7647 36.0542 48.9632 34.7638C49.2114 33.4733 51.4449 32.7785 53.1075 32.1581L58.2445 30.2224C58.6415 30.0239 58.5423 29.8502 57.3511 29.7261C56.1599 29.6268 52.8097 29.1801 51.296 29.602C49.7822 30.0239 47.2509 30.6691 47.0028 31.0165C46.8042 31.364 46.6057 31.364 46.829 32.5551L48.2684 40.3722C48.3677 41.3649 48.5662 42.0349 47.5239 42.2831C46.432 42.5313 44.6204 42.9531 44 42.9531C43.3796 42.9531 41.5432 42.5313 40.4761 42.2831C39.409 42.0349 39.6075 41.3649 39.7316 40.3722C39.8309 39.3796 40.9228 33.7215 41.1461 32.5551C41.3943 31.364 41.171 31.364 40.9724 31.0165C40.7243 30.6691 38.1682 30.0239 36.6544 29.602C35.1654 29.1801 31.7904 29.6268 30.5993 29.7509C29.4081 29.8502 29.3088 29.9991 29.7059 30.2472L34.8428 32.1581C36.4807 32.7785 38.7638 33.4733 38.9871 34.7638C39.2353 36.079 37.8208 38.0395 37.0018 39.5285C36.1829 41.0175 36.2077 41.1664 36.2574 41.7619C36.307 42.3575 38.9871 43.8961 39.5331 44.2932C40.1287 44.6654 43.2555 46.4026 43.2555 47.3704C43.2555 48.3382 40.3024 50.8447 39.3097 51.4651C37.8404 52.4088 36.2557 53.1594 34.5947 53.6985C33.4779 53.8971 31.7408 52.6314 30.7233 50.7206C29.7307 48.8346 30.6241 46.9982 31.2197 45.5092C31.8401 44.0202 30.7978 43.2261 30.2767 42.705L24.9412 36.9972C24.0726 36.079 23.1792 35.5827 23.1792 33.7463C23.1792 31.9099 30.3015 23.3235 30.3015 23.3235L37.0763 24.4154C37.8704 24.4154 39.6324 23.7454 41.2454 23.1746C42.8585 22.6783 43.9752 22.6287 43.9752 22.6287C43.9752 22.6287 45.0671 22.6287 46.705 23.1746C48.3428 23.7206 50.08 24.4154 50.8741 24.4154C51.693 24.4154 57.6985 23.2491 57.6985 23.2491L57.6737 23.2739ZM52.3382 56.2298C52.7849 56.4779 52.512 57.0239 52.0901 57.3217L45.7868 62.2353C45.2904 62.7316 44.4963 63.4761 43.9752 63.4761C43.454 63.4761 42.6847 62.7316 42.1636 62.2353C40.0743 60.5717 37.9648 58.9337 35.8355 57.3217C35.4384 57.0239 35.1654 56.5028 35.5873 56.2298L39.3097 54.2445C40.7894 53.4618 42.3551 52.8539 43.9752 52.4329C44.3474 52.4329 46.705 53.2767 48.6158 54.2445L52.3382 56.2298Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M59.262 19.2785L53.7032 13H34.2721L28.7381 19.2785C28.7381 19.2785 23.8741 17.9632 21.591 20.1967C21.591 20.1967 28.0432 19.6259 30.2767 23.2491L37.126 24.4154C37.9201 24.4154 39.682 23.7454 41.2951 23.1746C42.9081 22.6783 44.0249 22.6287 44.0249 22.6287C44.0249 22.6287 45.1168 22.6287 46.7546 23.1746C48.3925 23.7206 50.1296 24.4154 50.9238 24.4154C51.7427 24.4154 57.7482 23.2491 57.7482 23.2491C59.9817 19.6259 66.4339 20.1967 66.4339 20.1967C64.1508 17.9136 59.2868 19.2537 59.2868 19.2537",fill:"url(#paint1_linear_2183_5890)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2183_5890",x1:"17",y1:"45.3241",x2:"71",y2:"45.3241",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.4",stopColor:"#FF5500"}),jsxRuntimeExports.jsx("stop",{offset:"0.6",stopColor:"#FF2000"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_2183_5890",x1:"22.4879",y1:"18.8219",x2:"66.4339",y2:"18.8219",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FF452A"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#FF2000"})]})]})]}),Crypto=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"white"},children:[jsxRuntimeExports.jsx("mask",{id:"mask0_2091_4394",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"13",y:"9",width:"62",height:"71",children:jsxRuntimeExports.jsx("path",{d:"M44 9L13 26.75V62.25L44 80L75 62.25V26.75L44 9ZM31.7577 24.3492H56.1513L59.0935 36.684H28.9307L31.7577 24.3492ZM41.5613 61.2993L36.2955 66.161H31.8427L20.6924 46.9369L28.8701 40.9079L36.0953 45.4627V53.6578L41.5552 58.8504V61.2993H41.5613ZM37.9759 53.1584L38.7888 45.4326L36.1256 38.5432H51.9229L49.3204 45.4326L50.0787 53.1283L44 53.1584H37.9759ZM56.2059 66.1069H51.8076L46.5419 61.2993V58.8564L52.0018 53.6638V45.4627L59.1421 40.8537L67.2955 46.9369L56.2059 66.1069Z",fill:"#002D74"})}),jsxRuntimeExports.jsxs("g",{mask:"url(#mask0_2091_4394)",children:[jsxRuntimeExports.jsx("rect",{y:"8",width:"44",height:"72",fill:"url(#paint0_linear_2091_4394)"}),jsxRuntimeExports.jsx("rect",{x:"88",y:"80",width:"44",height:"72",transform:"rotate(-180 88 80)",fill:"url(#paint1_linear_2091_4394)"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2091_4394",x1:"22",y1:"8",x2:"22",y2:"80",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#010935"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#142C70"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_2091_4394",x1:"110",y1:"80",x2:"110",y2:"152",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#010935"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#142C70"})]})]})]}),Ledger=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"black"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.2106 16H16V29.4577H19.2182V19.2182L37.2106 19.1011V16ZM37.3568 33.4073V54.6179H50.8146V51.3997H40.575L40.458 33.4073H37.3568ZM16 72.1714H37.2106V69.0703L19.2182 68.9533V58.7137H16V72.1714ZM50.9609 16H72.1714V29.4577H68.9533V19.2182L50.9609 19.1011V16ZM72.1714 72.1714H50.9609V69.0703L68.9533 68.9533V58.7137H72.1714V72.1714Z",fill:"white"})}),Steak=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"600",height:"600",viewBox:"0 0 600 600",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"black"},children:[jsxRuntimeExports.jsx("path",{d:"M470.747 209.191C462.305 192.354 448.646 178.695 431.808 170.253C413.337 161 389.233 161 341.006 161C331.236 161 307.916 161 300 161C292.084 161 268.728 161 258.994 161C210.856 161 186.662 161 168.191 170.253C151.354 178.69 137.7 192.35 129.27 209.191C119.999 227.662 120 251.767 120 299.976C120 348.185 119.999 372.308 129.27 390.778C137.7 407.619 151.354 421.279 168.191 429.716C186.662 438.97 210.784 438.97 258.994 438.97C268.764 438.97 292.084 438.97 300 438.97C307.916 438.97 331.272 438.97 341.006 438.97C389.144 438.97 413.337 438.97 431.808 429.716C448.646 421.274 462.305 407.616 470.747 390.778C480 372.308 480 348.203 480 299.976C480 251.749 480 227.662 470.747 209.191Z",fill:"#FFCEAA"}),jsxRuntimeExports.jsx("path",{d:"M218.557 350.342C216.323 345.957 212.922 342.274 208.729 339.698C204.536 337.121 199.713 335.752 194.791 335.741H166.747C163.876 335.755 161.041 336.37 158.422 337.548C155.804 338.725 153.462 340.439 151.547 342.577C149.632 344.716 148.186 347.232 147.303 349.964C146.42 352.696 146.12 355.582 146.422 358.437C147.385 367.476 148.954 374.34 151.575 379.564C157.629 391.573 167.378 401.323 179.388 407.377C188.195 411.798 201.674 413.26 222.444 413.742C225.415 413.812 228.353 413.109 230.97 411.702C233.587 410.295 235.793 408.232 237.373 405.715C238.953 403.199 239.852 400.315 239.982 397.346C240.113 394.378 239.47 391.427 238.116 388.781L218.557 350.342Z",fill:"#FF3B9A"}),jsxRuntimeExports.jsx("path",{d:"M180.618 312.563C189.852 312.562 198.95 310.335 207.14 306.071C215.33 301.806 222.371 295.63 227.668 288.066L254.856 249.253C259.761 242.25 262.839 234.134 263.81 225.64C264.782 217.146 263.616 208.545 260.419 200.616V200.384C258.913 196.555 256.409 193.2 253.167 190.666C249.925 188.133 246.064 186.514 241.985 185.978C209.732 186.085 190.726 186.887 179.405 192.575C167.37 198.586 157.611 208.339 151.592 220.37C146.725 230.247 145.227 258.007 144.87 280.507C144.797 284.698 145.56 288.862 147.114 292.754C148.668 296.647 150.983 300.191 153.923 303.179C156.863 306.167 160.369 308.539 164.236 310.156C168.103 311.774 172.254 312.604 176.445 312.599L180.618 312.563Z",fill:"#FF3B9A"}),jsxRuntimeExports.jsx("path",{d:"M449.702 220.356C443.655 208.365 433.909 198.639 421.906 192.614C409.89 186.588 389.262 186.053 353.337 186C304.664 186 289.528 242 279.134 256.834L248.556 300.497C243.645 307.51 240.729 315.725 240.12 324.266C239.511 332.806 241.231 341.352 245.098 348.991L267.758 393.813C270.842 399.931 275.578 405.063 281.43 408.627C287.282 412.191 294.016 414.045 300.867 413.978H301.49C309.495 413.978 334.171 413.978 342.283 413.978C385.072 413.978 408.713 413.977 421.906 407.381C433.914 401.331 443.66 391.58 449.702 379.568C456.317 366.374 456.316 342.787 456.316 299.944C456.316 257.101 456.317 233.621 449.702 220.356Z",fill:"#FF3B9A"})]}),Unstoppable=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"linear-gradient(180deg, #FED812 0%, #FFAF00 100%)"},children:jsxRuntimeExports.jsx("path",{d:"M47.4 43.7163C47.4 45.6251 45.8781 47.1714 44.0001 47.1714C42.1219 47.1714 40.6 45.6251 40.6 43.7163L40.6 -7H27L27 43.7163C27 53.2612 34.6106 61 44.0001 61C53.3882 61 61 53.2612 61 43.7163V-7H47.4V43.7163Z",fill:"#1F2129"})}),ONTO=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"white"},children:jsxRuntimeExports.jsx("path",{d:"M20 16L28.675 24.677C32.1885 21.8644 36.4154 20.0873 40.8816 19.545C45.348 19.0026 49.8769 19.7164 53.9604 21.6063C58.0438 23.4963 61.5207 26.4876 64.0005 30.2447C66.4804 34.0019 67.8653 38.3763 68 42.8772V43.5854V72L59.3367 63.3231C55.8263 66.1389 51.6014 67.9196 47.1361 68.4655C42.6708 69.0112 38.1419 68.3007 34.0577 66.4135C29.9734 64.5262 26.4956 61.537 24.0144 57.7813C21.5333 54.0255 20.1472 49.6521 20.0115 45.1515V44.4433L20 16ZM25.931 30.3311V44.4146C25.9323 47.7294 26.8335 50.9817 28.5384 53.8236C30.2432 56.6655 32.6875 58.9902 35.6101 60.5497C38.5328 62.1089 41.8238 62.8439 45.1313 62.6764C48.439 62.5087 51.639 61.4445 54.3894 59.5978L54.8611 59.2754L27.0873 31.4884L25.931 30.3311ZM33.6223 28.4022L33.1505 28.7304L60.9186 56.5117L62.069 57.6632V43.5854C62.0683 40.2717 61.1679 37.0204 59.464 34.179C57.7603 31.3377 55.3171 29.0132 52.3957 27.4539C49.4742 25.8946 46.1844 25.1592 42.8777 25.3262C39.5712 25.4933 36.372 26.5565 33.6223 28.4022Z",fill:"#23262F"})}),Slope=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"#6C67F1"},children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.6667 24.3696L34.8872 40.1864L24.0001 37.7402L37.3334 24.3696L48.4438 13.3798C49.268 12.5646 50.6667 13.1484 50.6667 14.3077V24.3696ZM37.3339 51.0358L50.6672 37.74V24.3694L35.2001 39.8737L37.3339 51.0358Z",fill:"url(#paint0_linear_2593_6077)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.3337 64.2947V50.9617L50.667 37.6284L55.7849 45.8435L55.9822 45.6463L64 50.9616L39.5582 75.2343C38.7347 76.0521 37.3336 75.4687 37.3336 74.3082V64.2949L37.3337 64.2947Z",fill:"url(#paint1_linear_2593_6077)"}),jsxRuntimeExports.jsx("path",{d:"M24 37.7405H32.573C35.202 37.7405 37.3333 39.8718 37.3333 42.5009V51.0359H28.7602C26.1313 51.0359 24 48.9046 24 46.2757V37.7405Z",fill:"#F1F0FF"}),jsxRuntimeExports.jsx("path",{d:"M50.6667 37.7405H59.2398C61.8688 37.7405 64 39.8718 64 42.5009V51.0359H55.4271C52.798 51.0359 50.6667 48.9046 50.6667 46.2757V37.7405Z",fill:"#F1F0FF"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2593_6077",x1:"37.3336",y1:"13",x2:"37.3336",y2:"51.0358",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#A8ADFF"}),jsxRuntimeExports.jsx("stop",{offset:"0.648556",stopColor:"white"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_2593_6077",x1:"50.6668",y1:"37.6284",x2:"50.6668",y2:"75.616",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.260784",stopColor:"#B6BAFF"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#E4E2FF"})]})]})]}),Safe=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"var(--ck-brand-safe)"},children:[jsxRuntimeExports.jsx("path",{d:"M68.7186 44H62.6472C60.8339 44 59.3646 45.4686 59.3646 47.281V56.0888C59.3646 57.9012 57.8952 59.3697 56.0819 59.3697H31.9278C30.1145 59.3697 28.6452 60.8383 28.6452 62.6507V68.719C28.6452 70.5314 30.1145 72 31.9278 72H57.48C59.2933 72 60.7417 70.5314 60.7417 68.719V63.8504C60.7417 62.038 62.2111 60.7524 64.0244 60.7524H68.7174C70.5307 60.7524 72 59.2838 72 57.4714V47.2429C72 45.4305 70.5307 44 68.7174 44H68.7186Z",fill:"#121312"}),jsxRuntimeExports.jsx("path",{d:"M28.6406 31.9308C28.6406 30.1162 30.1104 28.6458 31.9243 28.6458H56.0712C57.8851 28.6458 59.3548 27.1754 59.3548 25.3608V19.285C59.3548 17.4704 57.8851 16 56.0712 16H30.5245C28.7107 16 27.2409 17.4704 27.2409 19.285V23.9666C27.2409 25.7813 25.7711 27.2516 23.9572 27.2516H19.2837C17.4698 27.2516 16 28.722 16 30.5366V40.7888C16 42.6034 17.4759 44 19.2898 44H25.3631C27.177 44 28.6468 42.5296 28.6468 40.715L28.6406 31.932V31.9308Z",fill:"#121312"}),jsxRuntimeExports.jsx("path",{d:"M41.1004 37.6774H46.8995C48.7894 37.6774 50.3226 39.2117 50.3226 41.1004V46.8995C50.3226 48.7894 48.7882 50.3225 46.8995 50.3225H41.1004C39.2106 50.3225 37.6774 48.7882 37.6774 46.8995V41.1004C37.6774 39.2105 39.2118 37.6774 41.1004 37.6774V37.6774Z",fill:"#121312"})]}),Frontier=({...et})=>jsxRuntimeExports.jsx("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"#CC703C"},children:jsxRuntimeExports.jsx("path",{d:"M63.6429 20L63.3645 20.7254L62.4521 23.0445L61.8461 24.5395C57.2427 35.7491 53.6629 41.0688 49.8557 41.0688C48.8938 41.0936 47.9371 40.9212 47.0465 40.5625C46.156 40.2038 45.3512 39.6667 44.6834 38.9852L44.1979 38.5518C42.9885 37.4538 42.4799 37.1831 41.3154 37.1832C40.7094 37.1832 39.6238 37.9435 38.2521 39.7303C36.4147 42.2912 34.8522 45.0327 33.59 47.9106L33.4353 48.2482L49.7645 48.2483L47.7312 52.4075H32.4845L32.4843 69.44L28 69.44L28.0001 20L63.6429 20ZM57.2889 24.1518L32.4843 24.1518L32.4843 40.6262C35.4564 35.5545 38.2816 33.0086 41.32 33.0086C42.3421 32.9765 43.3595 33.1534 44.3082 33.5284C45.2569 33.9034 46.1159 34.468 46.8311 35.1865L47.3323 35.6335C48.4611 36.6585 48.8956 36.8941 49.8604 36.8941C50.9211 36.8957 53.7433 32.4855 57.2889 24.1518Z",fill:"white"})}),Zerion=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"linear-gradient(120.22deg, #2962EF 0%, #255CE5 100%)"},children:[jsxRuntimeExports.jsx("path",{d:"M19.0864 22C17.5783 22 16.9973 23.8648 18.2628 24.6438L49.9199 43.732C50.709 44.2178 51.7614 44.0258 52.3048 43.2969L66.2236 25.024C67.17 23.7545 66.2138 22 64.5757 22H19.0864Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M68.8425 66C70.3503 66 70.9466 64.1252 69.6814 63.3464L38.015 44.2605C37.2259 43.7748 36.1989 43.991 35.6558 44.7198L21.7099 62.9891C20.7639 64.2582 21.7499 66 23.3877 66H68.8425Z",fill:"white"})]}),Phantom=({background:et=!1,...o})=>jsxRuntimeExports.jsx("svg",{...o,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:et?{background:"#AB9FF2"}:void 0,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.7425 57.0705C34.1942 62.3362 28.2483 69 20.3366 69C16.5965 69 13.0001 67.5093 13 61.0322C12.9997 44.5362 36.2555 19.0003 57.8334 19C70.1084 18.9998 75 27.2474 75 36.6136C75 48.6357 66.9442 62.3824 58.9368 62.3824C56.3955 62.3824 55.1487 61.031 55.1487 58.888C55.1487 58.3288 55.2442 57.7228 55.4365 57.0705C52.7029 61.5902 47.4285 65.7849 42.4896 65.7849C38.8933 65.7849 37.0713 63.5944 37.0713 60.5187C37.0713 59.4003 37.311 58.2357 37.7425 57.0705ZM53.7586 31.6834C51.8054 31.6868 50.4738 33.2938 50.478 35.5864C50.4822 37.879 51.8198 39.5273 53.7729 39.5241C55.6789 39.5208 57.0099 37.8679 57.0058 35.5752C57.0016 33.2827 55.6646 31.6802 53.7586 31.6834ZM64.1193 31.6725C62.1661 31.6759 60.8345 33.2829 60.8387 35.5755C60.8429 37.868 62.1798 39.5164 64.1336 39.5131C66.0396 39.5099 67.3706 37.8569 67.3664 35.5643C67.3622 33.2718 66.0253 31.6693 64.1193 31.6725Z",fill:et?"#ffffff":"currentColor"})}),PlaceHolder=()=>jsxRuntimeExports.jsx("div",{style:{width:80,height:80,background:"#555"}}),Dawn=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88px",height:"88px",viewBox:"0 0 192 192",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:[jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"linearGradient-1",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#151515",offset:"0%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#232323",offset:"100%"})]}),jsxRuntimeExports.jsx("rect",{rx:"27%",id:"path-2",x:"0",y:"0",width:"192",height:"192"}),jsxRuntimeExports.jsxs("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"99.7051532%",id:"linearGradient-3",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#F3DC83",offset:"0%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#F9EEC8",offset:"100%"})]})]}),jsxRuntimeExports.jsx("g",{id:"Icons---Pixel-Fitted",stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:jsxRuntimeExports.jsxs("g",{id:"Group",children:[jsxRuntimeExports.jsxs("g",{id:"Rectangle",children:[jsxRuntimeExports.jsx("use",{fill:"#232323",xlinkHref:"#path-2"}),jsxRuntimeExports.jsx("use",{fill:"url(#linearGradient-1)",xlinkHref:"#path-2"})]}),jsxRuntimeExports.jsx("path",{d:"M123.748399,157.001808 C115.293464,160.853955 105.89735,163 96,163 C86.1026503,163 76.7065363,160.853955 68.2516012,157.001808 Z M146.526595,140.002206 C144.677242,142.123986 142.696426,144.128189 140.59684,146.002121 L51.4031598,146.002121 C49.3035743,144.128189 47.3227581,142.123986 45.4734054,140.002206 Z M157.337411,122.999613 C155.955969,126.133404 154.34141,129.141319 152.515704,132.001388 L39.484296,132.001388 C37.6585895,129.141319 36.0440306,126.133404 34.662589,122.999613 Z M96,29 C133.003078,29 163,58.9969218 163,96 C163,103.706309 161.69895,111.108742 159.304524,117.999626 L32.6954763,117.999626 C30.3010496,111.108742 29,103.706309 29,96 C29,58.9969218 58.9969218,29 96,29 Z",id:"Combined-Shape",fill:"url(#linearGradient-3)"})]})})]}),InfinityWallet=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,version:"1.1",id:"e551690a-81c0-4880-9b93-334a37ce6796",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 1025 1025",children:[jsxRuntimeExports.jsx("style",{type:"text/css",children:` - .infinityWallet-st0{fill:url(#ID_InfinityWallet_1);} - .infinityWallet-st1{fill:url(#ID_InfinityWallet_2);} - .infinityWallet-st2{opacity:0.49;fill:url(#ID_InfinityWallet_3);enable-background:new;} - .infinityWallet-st3{opacity:0.49;fill:url(#ID_InfinityWallet_4);enable-background:new;} - .infinityWallet-st4{opacity:0.49;fill:url(#ID_InfinityWallet_5);enable-background:new;} - .infinityWallet-st5{fill:url(#ID_InfinityWallet_6);} - .infinityWallet-st6{opacity:0.49;fill:url(#ID_InfinityWallet_7);enable-background:new;} - .infinityWallet-st7{opacity:0.49;fill:url(#ID_InfinityWallet_8);enable-background:new;} - .infinityWallet-st8{opacity:0.49;fill:url(#ID_InfinityWallet_9);enable-background:new;} - `}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_1",gradientUnits:"userSpaceOnUse",x1:"512.5",y1:"1056.1801",x2:"512.5",y2:"317.03",gradientTransform:"matrix(1 0 0 -1 0 1260)",children:[jsxRuntimeExports.jsx("stop",{offset:"0",style:{stopColor:"#1D2643"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#12142C"}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st0",d:`M130,0H895c71.8,0,130,58.2,130,130V895c0,71.8-58.2,130-130,130H130C58.2,1025,0,966.8,0,895V130 - C0,58.2,58.2,0,130,0z`}),jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_2",gradientUnits:"userSpaceOnUse",x1:"326.0557",y1:"-1280.3162",x2:"326.0557",y2:"-296.3967",gradientTransform:"matrix(1 0 0 1 0 1474)",children:[jsxRuntimeExports.jsx("stop",{offset:"1.000000e-02",style:{stopColor:"#00BFE1"}}),jsxRuntimeExports.jsx("stop",{offset:"0.97",style:{stopColor:"#2738AB"}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st1",d:`M550.9,380.8c-0.7-2-2.4-3.4-4.4-3.9c-2.3-0.6-4.7,0-6.4,1.7l-13.4,13.4l-2.2,2.2L418.3,288.5 - c-40.2-40-105.2-40-145.4,0L121.7,439.9c-40,40.5-40,105.6,0,146.1l151.4,150.5c40.2,40,105.1,40,145.3,0l34.4-34.4 - c4.5-4.5,9.9-10.7,12.9-18.7c4.7-13.1,2.8-27.7-5.2-39.1c-1.5-2.2-3.2-4.2-5.1-6c-16.9-16.5-43.9-16.3-60.7,0.3l-37.2,37.1 - c-2.2,2.3-5,3.8-8.1,4.5c-2.9,0.7-6,0.5-8.8-0.6c-2.9-1-5.5-2.7-7.7-5L182.6,524.2c-2.3-2.3-3.9-5.2-4.6-8.4 - c-0.8-4-0.1-8.2,2.1-11.8l0.8-0.9L334,350.3c2.4-2.4,5.4-4,8.7-4.6c1-0.2,2.1-0.3,3.1-0.3c4.4-0.1,8.7,1.7,11.7,5l105.8,105.2 - l-5.3,5.3l-10.4,10.6c-1.7,1.7-2.3,4.1-1.7,6.4c0.5,2,2,3.7,3.9,4.4l95.7,11.7c8.2-0.1,14.8-6.7,15-15L550.9,380.8z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_3",gradientUnits:"userSpaceOnUse",x1:"137.7126",y1:"-935.1906",x2:"201.098",y2:"-882.1746",gradientTransform:"matrix(1 0 0 1 -0.94 1473.3899)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st2",d:"M181.4,522.9c-4.3-4.9-5.1-13.3-1.3-19c0,0-49.7,54.3-25.8,114.4l31.5,31.3l45.8-76.2L181.4,522.9z"}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_4",gradientUnits:"userSpaceOnUse",x1:"4132.3252",y1:"1674.2513",x2:"4102.1333",y2:"1717.0756",gradientTransform:"matrix(-1 0 0 -1 4515 2382.0898)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st3",d:`M336.4,677.7c56.1,51.6,117.9,22.9,117.9,22.9s8.1-7.5,11.4-17.4c-8.3-4-68.6-47.2-68.6-47.2l-35.6,35.6 - C348.6,687.1,336.4,677.7,336.4,677.7z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_5",gradientUnits:"userSpaceOnUse",x1:"4217.4238",y1:"2067.1885",x2:"4240.0796",y2:"2011.1337",gradientTransform:"matrix(-1 0 0 -1 4515 2382.0898)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st4",d:"M299.4,385c0,0,35.9-36.2,36-36c0,0,9.6-7.7,19.7-0.7c0,0-59.7-49.2-123.6-18.3l-18.6,18.7L299.4,385z"})]}),jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_6",gradientUnits:"userSpaceOnUse",x1:"698.9443",y1:"-1280.3162",x2:"698.9443",y2:"-296.3967",gradientTransform:"matrix(1 0 0 1 0 1474)",children:[jsxRuntimeExports.jsx("stop",{offset:"1.000000e-02",style:{stopColor:"#00BFE1"}}),jsxRuntimeExports.jsx("stop",{offset:"0.97",style:{stopColor:"#2738AB"}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st5",d:`M474.1,644.3c0.7,2,2.4,3.4,4.4,3.9c2.3,0.6,4.7,0,6.4-1.7l13.4-13.4l2.2-2.2l106.2,105.6 - c40.2,40,105.2,40,145.4,0l151.2-151.4c40-40.5,40-105.6,0-146.1L751.9,288.5c-40.2-40-105.1-40-145.3,0l-34.4,34.4 - c-4.5,4.5-9.9,10.7-12.9,18.7c-4.7,13.1-2.8,27.7,5.2,39.1c1.5,2.2,3.2,4.2,5.1,6c16.9,16.5,43.9,16.3,60.7-0.3l37.2-37.1 - c2.2-2.3,5-3.8,8.1-4.5c2.9-0.7,6-0.5,8.8,0.6c2.9,1,5.5,2.7,7.7,5l150.3,150.3c2.3,2.3,3.9,5.2,4.6,8.4c0.8,4,0.1,8.2-2.1,11.8 - l-0.8,0.9L691,674.5c-2.4,2.4-5.4,4-8.7,4.6c-1,0.2-2.1,0.3-3.1,0.3c-4.4,0.1-8.7-1.7-11.7-5L561.6,569.7l5.3-5.3l10.4-10.6 - c1.7-1.7,2.3-4.1,1.7-6.4c-0.5-2-2-3.7-3.9-4.4l-95.6-11.7c-8.2,0.1-14.8,6.7-15,15L474.1,644.3z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_7",gradientUnits:"userSpaceOnUse",x1:"3824.9182",y1:"1469.7789",x2:"3888.3037",y2:"1522.7949",gradientTransform:"matrix(-1 0 0 -1 4713.1299 1956.6599)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st6",d:"M843.6,502.2c4.3,4.9,5.1,13.3,1.3,19c0,0,49.7-54.3,25.8-114.4l-31.5-31.3l-45.8,76.2L843.6,502.2z"}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_8",gradientUnits:"userSpaceOnUse",x1:"445.1279",y1:"-730.6945",x2:"414.9359",y2:"-687.8702",gradientTransform:"matrix(1 0 0 1 197.19 1047.96)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st7",d:`M688.6,347.4c-56.1-51.6-117.9-22.9-117.9-22.9s-8.1,7.5-11.4,17.4c8.3,4,68.6,47.2,68.6,47.2l35.6-35.6 - C676.4,338,688.6,347.4,688.6,347.4z`}),jsxRuntimeExports.jsxs("linearGradient",{id:"ID_InfinityWallet_9",gradientUnits:"userSpaceOnUse",x1:"530.1512",y1:"-337.7953",x2:"552.8069",y2:"-393.8502",gradientTransform:"matrix(1 0 0 1 197.19 1047.96)",children:[jsxRuntimeExports.jsx("stop",{offset:"3.000000e-02",style:{stopColor:"#1B1464"}}),jsxRuntimeExports.jsx("stop",{offset:"1",style:{stopColor:"#1B1464",stopOpacity:0}})]}),jsxRuntimeExports.jsx("path",{className:"infinityWallet-st8",d:"M725.5,640.1c0,0-35.9,36.2-36,36c0,0-9.6,7.7-19.7,0.7c0,0,59.7,49.2,123.6,18.3l18.6-18.7L725.5,640.1z"})]})]})]}),Rabby=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:"#8697FF"},children:[jsxRuntimeExports.jsx("path",{d:"M76.2062 48.0657C78.7621 42.356 66.1267 26.404 54.0555 19.7581C46.4467 14.6095 38.5183 15.3169 36.9125 17.5775C33.3886 22.5385 48.5814 26.7423 58.742 31.6478C56.5579 32.5964 54.4996 34.2987 53.2893 36.4758C49.5013 32.3404 41.1872 28.7791 31.4315 31.6478C24.8574 33.5809 19.3937 38.1382 17.2821 45.0216C16.7689 44.7936 16.2009 44.6669 15.6032 44.6669C13.3176 44.6669 11.4648 46.5197 11.4648 48.8052C11.4648 51.0908 13.3176 52.9435 15.6032 52.9435C16.0268 52.9435 17.3514 52.6594 17.3514 52.6594L38.5183 52.8128C30.0532 66.2418 23.3634 68.2049 23.3634 70.5314C23.3634 72.8579 29.7643 72.2274 32.1678 71.3602C43.6732 67.2088 56.0306 54.2706 58.1511 50.5462C67.056 51.6572 74.5397 51.7886 76.2062 48.0657Z",fill:"url(#paint0_linear_60607_36577)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M58.65 31.6053C58.682 31.6193 58.7139 31.6332 58.7458 31.6471C59.2168 31.4616 59.1406 30.766 59.0113 30.2198C58.714 28.9643 53.5856 23.9001 48.7696 21.6318C42.1984 18.5367 37.3618 18.7007 36.6582 20.1307C37.9975 22.8695 44.1927 25.441 50.663 28.1266C53.3909 29.2589 56.1676 30.4114 58.65 31.6053Z",fill:"url(#paint1_linear_60607_36577)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4154 59.2247C49.0895 58.7182 47.592 58.2536 45.8898 57.8319C47.707 54.5801 48.0884 49.7663 46.3721 46.7226C43.9635 42.4512 40.9399 40.1777 33.9139 40.1777C30.0495 40.1777 19.6451 41.4794 19.4603 50.1648C19.441 51.0763 19.4599 51.9118 19.5259 52.68L38.5175 52.8176C35.9568 56.8798 33.5586 59.8928 31.4589 62.1841C33.9831 62.8309 36.0657 63.3738 37.9775 63.8722C39.7885 64.3443 41.4462 64.7764 43.1809 65.2191C45.8007 63.3102 48.2635 61.2288 50.4154 59.2247Z",fill:"url(#paint2_linear_60607_36577)"}),jsxRuntimeExports.jsx("path",{d:"M17.0296 51.7821C17.8058 58.38 21.5555 60.9657 29.2177 61.7309C36.8799 62.4961 41.2751 61.9828 47.1265 62.5151C52.0136 62.9598 56.3772 65.4502 57.996 64.5895C59.4529 63.815 58.6378 61.0167 56.6884 59.2214C54.1614 56.8943 50.6641 55.2763 44.5104 54.7021C45.7368 51.3443 45.3931 46.6362 43.4885 44.0748C40.7345 40.3711 35.6513 38.6967 29.2177 39.4282C22.4962 40.1926 16.0556 43.5018 17.0296 51.7821Z",fill:"url(#paint3_linear_60607_36577)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_60607_36577",x1:"30.666",y1:"43.0094",x2:"75.6558",y2:"55.7677",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_60607_36577",x1:"68.0842",y1:"42.1521",x2:"35.6221",y2:"9.60636",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#7258DC"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#797DEA",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint2_linear_60607_36577",x1:"51.3184",y1:"60.3591",x2:"20.1383",y2:"42.4347",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#7461EA"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#BFC2FF",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint3_linear_60607_36577",x1:"33.3531",y1:"42.6732",x2:"54.4308",y2:"69.4547",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"0.983895",stopColor:"#D5CEFF"})]})]})]}),TokenPocket=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88px",height:"88px",viewBox:"0 0 88 88",version:"1.1",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{x1:"107.511425%",y1:"50.0147427%",x2:"0.0459570557%",y2:"50.0147427%",id:"linearGradient-1",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FFFFFF",offset:"0%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#FFFFFF",stopOpacity:"0.3233",offset:"96.67%"}),jsxRuntimeExports.jsx("stop",{stopColor:"#FFFFFF",stopOpacity:"0.3",offset:"100%"})]})}),jsxRuntimeExports.jsx("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",children:jsxRuntimeExports.jsxs("g",{id:"tokenpocket",fillRule:"nonzero",children:[jsxRuntimeExports.jsx("polygon",{fill:"#2980FE",points:"87.9604864 0 0 0 0 88 87.9604864 88"}),jsxRuntimeExports.jsxs("g",{transform:"translate(16.052385, 23.804688)",children:[jsxRuntimeExports.jsx("path",{d:"M19.6653508,13.8911953 L19.6784508,13.8911953 C19.6653508,13.8236484 19.6653508,13.7448437 19.6653508,13.6772969 L19.6653508,13.8911953 Z",fill:"#29AEFF"}),jsxRuntimeExports.jsx("path",{d:"M41.1271993,16.0301797 L29.2440711,16.0301797 L29.2440711,38.4205938 C29.2440711,39.4787422 30.0635659,40.3343359 31.0771712,40.3343359 L39.2940168,40.3343359 C40.3077044,40.3343359 41.1271993,39.4787422 41.1271993,38.4205938 L41.1271993,16.0301797 Z",fill:"#FFFFFF"}),jsxRuntimeExports.jsx("path",{d:"M23.5075248,0 L23.1085201,0 L1.83318241,0 C0.819494855,0 0,0.855507812 0,1.91374219 L0,9.68111719 C0,10.7393516 0.819494855,11.5948594 1.83318241,11.5948594 L6.82580355,11.5948594 L8.80996071,11.5948594 L8.80996071,13.8912813 L8.80996071,38.4768828 C8.80996071,39.5351172 9.62945557,40.390625 10.6430608,40.390625 L18.4502002,40.390625 C19.4638054,40.390625 20.2833003,39.5351172 20.2833003,38.4768828 L20.2833003,13.8912813 L20.2833003,13.6774688 L20.2833003,11.5948594 L22.2674574,11.5948594 L23.0761684,11.5948594 L23.4751731,11.5948594 C26.5376389,11.5948594 29.0285575,8.99447656 29.0285575,5.79742969 C29.0609093,2.60038281 26.5699906,0 23.5075248,0 Z",fill:"#FFFFFF"}),jsxRuntimeExports.jsx("path",{d:"M41.1381478,16.0301797 L41.1381478,31.6550781 C41.5479364,31.7563984 41.9684266,31.8352031 42.399783,31.90275 C43.0036819,31.9928125 43.6290664,32.0491016 44.2545332,32.0603594 C44.2868849,32.0603594 44.3192367,32.0603594 44.3623723,32.0603594 L44.3623723,19.6324219 C42.5615416,19.5085859 41.1381478,17.9438359 41.1381478,16.0301797 Z",fill:"url(#linearGradient-1)"}),jsxRuntimeExports.jsx("path",{d:"M44.5993714,0 C36.1237942,0 29.2440711,7.18205469 29.2440711,16.0301797 C29.2440711,23.6400312 34.3229635,30.0115234 41.1379832,31.6550781 L41.1379832,16.0301797 C41.1379832,14.0376328 42.6907839,12.4165937 44.5993714,12.4165937 C46.5080412,12.4165937 48.0608419,14.0376328 48.0608419,16.0301797 C48.0608419,17.7075078 46.9717493,19.1146484 45.483652,19.5198437 C45.2032703,19.5986484 44.9013209,19.6436797 44.5993714,19.6436797 L44.5993714,32.0603594 C44.9013209,32.0603594 45.1924864,32.0491016 45.483652,32.0378438 C53.5495229,31.5537578 59.9547666,24.5743438 59.9547666,16.0301797 C59.9655379,7.18205469 53.0858148,0 44.5993714,0 Z",fill:"#FFFFFF"}),jsxRuntimeExports.jsx("path",{d:"M44.5992891,32.0603594 L44.5992891,19.6436797 C44.5131001,19.6436797 44.4376127,19.6436797 44.3513414,19.6324219 L44.3513414,32.0603594 C44.4376127,32.0603594 44.523884,32.0603594 44.5992891,32.0603594 Z",fill:"#FFFFFF"})]})]})})]}),Talisman=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"82",height:"82",viewBox:"0 0 82 82",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("rect",{width:"82",height:"82",rx:"12",fill:"#D5FF5C"}),jsxRuntimeExports.jsx("path",{d:"M35.04 55C35.04 58.2905 37.6887 60.9623 40.9703 60.9996C44.2519 60.9623 46.9006 58.2905 46.9006 55C46.9006 51.7096 44.2519 49.0377 40.9703 49.0004C37.6887 49.0377 35.04 51.7096 35.04 55Z",fill:"#FD4848"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.8544 44.6623C22.2462 45.9868 20.4553 46.4546 19.4248 45.4241L17.5356 43.5349C15.583 41.5823 12.4171 41.5823 10.4645 43.5349C8.51184 45.4875 8.51184 48.6534 10.4645 50.606L25.7391 65.8807C29.3942 70.2176 34.8595 72.9788 40.9703 72.9994C47.0811 72.9788 52.5464 70.2176 56.2014 65.8807L71.4761 50.606C73.4287 48.6534 73.4287 45.4875 71.4761 43.5349C69.5234 41.5823 66.3576 41.5823 64.4049 43.5349L62.5158 45.4241C61.4852 46.4546 59.6943 45.9868 59.0861 44.6623C58.9663 44.4013 58.901 44.1213 58.901 43.8341L58.901 20.9995C58.901 18.2381 56.6624 15.9995 53.901 15.9995C51.1396 15.9995 48.901 18.2381 48.901 20.9995L48.901 32.5568C48.901 33.5506 47.8829 34.2252 46.9353 33.9257C46.3356 33.7361 45.9023 33.1901 45.9023 32.5611L45.9023 13.9996C45.9023 11.2608 43.7004 9.03637 40.9703 9C38.2402 9.03637 36.0382 11.2608 36.0382 13.9996L36.0382 32.5611C36.0382 33.1901 35.605 33.7361 35.0052 33.9257C34.0576 34.2252 33.0395 33.5506 33.0395 32.5568L33.0396 20.9995C33.0396 18.2381 30.801 15.9995 28.0395 15.9995C25.2781 15.9995 23.0395 18.2381 23.0395 20.9995L23.0395 43.8341C23.0395 44.1213 22.9743 44.4013 22.8544 44.6623ZM40.9703 44.9999C32.1659 45.0525 25.0403 54.9997 25.0403 54.9997C25.0403 54.9997 32.1659 64.9469 40.9703 64.9995C49.7746 64.9469 56.9002 54.9997 56.9002 54.9997C56.9002 54.9997 49.7746 45.0525 40.9703 44.9999Z",fill:"#FD4848"})]}),OtherWallets=({...et})=>{const o={position:"relative",display:"flex",flexDirection:"column",gap:2},tt={position:"relative",display:"flex",gap:2},rt={width:"50%",overflow:"hidden",borderRadius:"27.5%"};return jsxRuntimeExports.jsxs("div",{style:o,...et,children:[jsxRuntimeExports.jsxs("div",{style:tt,children:[jsxRuntimeExports.jsx("div",{style:rt,children:jsxRuntimeExports.jsx(WalletConnect,{background:!0})}),jsxRuntimeExports.jsx("div",{style:rt,children:isZerion()?jsxRuntimeExports.jsx(Phantom,{}):jsxRuntimeExports.jsx(Zerion,{})})]}),jsxRuntimeExports.jsxs("div",{style:tt,children:[jsxRuntimeExports.jsx("div",{style:rt,children:isFamily()?jsxRuntimeExports.jsx(ImToken,{}):jsxRuntimeExports.jsx(Family,{})}),jsxRuntimeExports.jsx("div",{style:rt,children:isRainbow()?jsxRuntimeExports.jsx(Trust,{}):jsxRuntimeExports.jsx(Rainbow,{})})]})]})},Fordefi=({...et})=>jsxRuntimeExports.jsxs("svg",{...et,width:"88",height:"88",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_14298_75627)",children:[jsxRuntimeExports.jsx("path",{d:"M43.5075 62.5508H6V73.5954C6 79.2046 10.5379 83.7515 16.1357 83.7515H32.9997L43.5075 62.5508Z",fill:"#7994FF"}),jsxRuntimeExports.jsx("path",{d:"M6.00098 39.1016H76.2075L68.0567 55.4841H6.00098V39.1016Z",fill:"#486DFF"}),jsxRuntimeExports.jsx("path",{d:"M30.6398 12H6.09766V32.0282H89.8447V12H65.3025V26.9577H60.2423V12H35.7001V26.9577H30.6398V12Z",fill:"#5CD1FA"})]}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_14298_75627",children:jsxRuntimeExports.jsx("rect",{width:"84",height:"72",fill:"white",transform:"translate(6 12)"})})})]});var Logos={Mock,Injected,OtherWallets,WalletConnect,MetaMask,Coinbase,Family,Trust,Argent,ImToken,Rainbow,Crypto,Ledger,Brave:Brave$1,Steak,Unstoppable,ONTO,Slope,Safe,Frontier,Zerion,Phantom,PlaceHolder,Frame,Dawn,InfinityWallet,Rabby,Fordefi,TokenPocket,Talisman};const truncateRegex=/^(0x[a-zA-Z0-9]{4})[a-zA-Z0-9]+([a-zA-Z0-9]{4})$/,truncateEthAddress=(et,o="••••")=>{if(!et)return"";const tt=et.match(truncateRegex);return tt?`${tt[1]}${o}${tt[2]}`:et},truncateENSAddress=(et,o)=>et.length>o?et.replace(".eth","").slice(0,o)+"...":et,nFormatter=(et,o=2)=>{if(et<1e4)return et.toFixed(2);const tt=[{value:1,symbol:""},{value:1e3,symbol:"k"},{value:1e6,symbol:"m"},{value:1e9,symbol:"g"},{value:1e12,symbol:"t"},{value:1e15,symbol:"p"},{value:1e18,symbol:"e"}],rt=/\.0+$|(\.[0-9]*[1-9])0+$/;var nt=tt.slice().reverse().find(function(ot){return et>=ot.value});return nt?(et/nt.value).toFixed(o).replace(rt,"$1")+nt.symbol:"0"},detectBrowser=()=>{var et;const o=detect();return(et=o==null?void 0:o.name)!==null&&et!==void 0?et:""},detectOS=()=>{var et;const o=detect();return(et=o==null?void 0:o.os)!==null&&et!==void 0?et:""},isIOS=()=>detectOS().toLowerCase().includes("ios"),isAndroid=()=>detectOS().toLowerCase().includes("android"),isMobile=()=>isAndroid()||isIOS();function flattenChildren(et){return React.Children.toArray(et).reduce((tt,rt)=>rt.type===React.Fragment?tt.concat(flattenChildren(rt.props.children)):(tt.push(rt),tt),[])}const isWalletConnectConnector=et=>et==="walletConnect",isCoinbaseWalletConnector=et=>et==="coinbaseWalletSDK",isSafeConnector=et=>et==="safe",isInjectedConnector=et=>et==="injected",walletConfigs={mock:{icon:jsxRuntimeExports.jsx(Logos.Mock,{})},argent:{name:"Argent",icon:jsxRuntimeExports.jsx(Logos.Argent,{}),downloadUrls:{download:"https://connect.family.co/v0/download/argent",android:"https://play.google.com/store/apps/details?id=im.argent.contractwalletclient",ios:"https://apps.apple.com/app/argent/id1358741926"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://argent.link/app/wc?uri=${encodeURIComponent(et)}`},"coinbaseWallet, coinbaseWalletSDK":{name:"Coinbase Wallet",shortName:"Coinbase",icon:jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0}),iconShape:"squircle",downloadUrls:{download:"https://connect.family.co/v0/download/coinbasewallet",website:"https://www.coinbase.com/wallet/getting-started-extension",android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/app/coinbase-wallet-store-crypto/id1278383455",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad"},getWalletConnectDeeplink:et=>`https://go.cb-w.com/wc?uri=${encodeURIComponent(et)}`},"com.coinbase.wallet":{name:"Coinbase Wallet",shortName:"Coinbase",icon:jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0}),iconShape:"circle",downloadUrls:{download:"https://connect.family.co/v0/download/coinbasewallet",website:"https://www.coinbase.com/wallet/getting-started-extension",android:"https://play.google.com/store/apps/details?id=org.toshi",ios:"https://apps.apple.com/app/coinbase-wallet-store-crypto/id1278383455",chrome:"https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad"},getWalletConnectDeeplink:et=>`https://go.cb-w.com/wc?uri=${encodeURIComponent(et)}`},"com.crypto.wallet":{name:"Crypto.com",shortName:"Crypto"},dawn:{name:"Dawn Wallet",shortName:"Dawn",downloadUrls:{download:"https://apps.apple.com/us/app/dawn-ethereum-wallet/id1673143782",website:"https://www.dawnwallet.xyz/",ios:"https://apps.apple.com/us/app/dawn-ethereum-wallet/id1673143782"}},"co.family.wallet":{name:"Family",shortName:"Family",icon:jsxRuntimeExports.jsx(Logos.Family,{}),iconShape:"squircle",downloadUrls:{download:"https://connect.family.co/v0/download/family",website:"https://family.co",ios:"https://family.co/download"},getWalletConnectDeeplink:et=>isAndroid()?et:`familywallet://wc?uri=${encodeURIComponent(et)}`},frame:{name:"Frame",icon:jsxRuntimeExports.jsx(Logos.Frame,{}),iconShouldShrink:!0,downloadUrls:{download:"https://connect.family.co/v0/download/frame",website:"https://frame.sh",chrome:"https://chrome.google.com/webstore/detail/frame-companion/ldcoohedfbjoobcadoglnnmmfbdlmmhf",firefox:"https://addons.mozilla.org/en-US/firefox/addon/frame-extension",brave:"https://chrome.google.com/webstore/detail/frame-companion/ldcoohedfbjoobcadoglnnmmfbdlmmhf"},getWalletConnectDeeplink:et=>et},frontier:{name:"Frontier Wallet",shortName:"Frontier",icon:jsxRuntimeExports.jsx(Logos.Frontier,{}),downloadUrls:{download:"https://connect.family.co/v0/download/frontier",ios:"https://apps.apple.com/app/frontier-crypto-defi-wallet/id1482380988",android:"https://play.google.com/store/apps/details?id=com.frontierwallet",website:"https://frontier.xyz/",chrome:"https://chrome.google.com/webstore/detail/frontier-wallet/kppfdiipphfccemcignhifpjkapfbihd"},getWalletConnectDeeplink:et=>isAndroid()?et:`frontier://wc?uri=${encodeURIComponent(et)}`},injected:{name:"Browser Wallet",shortName:"Browser",icon:jsxRuntimeExports.jsx(Logos.Injected,{})},"metaMask, metaMask-io, io.metamask, io.metamask.mobile, metaMaskSDK":{name:"MetaMask",icon:jsxRuntimeExports.jsx(Logos.MetaMask,{}),iconConnector:jsxRuntimeExports.jsx(Logos.MetaMask,{}),iconShouldShrink:!0,downloadUrls:{download:"https://connect.family.co/v0/download/metamask",website:"https://metamask.io/download/",android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/app/metamask/id1438144202",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask/",brave:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://metamask.app.link/wc?uri=${encodeURIComponent(et)}`},"app.phantom":{name:"Phantom",iconShape:"squircle"},"me.rainbow":{name:"Rainbow Wallet",shortName:"Rainbow",icon:jsxRuntimeExports.jsx(Logos.Rainbow,{}),iconShape:"squircle",downloadUrls:{download:"https://connect.family.co/v0/download/rainbow",website:"https://rainbow.me/?utm_source=connectkit",android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Dconnectkit&utm_source=connectkit",ios:"https://apps.apple.com/app/rainbow-ethereum-wallet/id1457119021?pt=119997837&ct=connectkit&mt=8",chrome:"https://rainbow.me/extension?utm_source=connectkit",edge:"https://rainbow.me/extension?utm_source=connectkit",brave:"https://rainbow.me/extension?utm_source=connectkit"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://rnbwapp.com/wc?uri=${encodeURIComponent(et)}&connector=connectkit`},"io.rabby":{name:"Rabby Wallet",shortName:"Rabby",downloadUrls:{website:"https://rabby.io",chrome:"https://chrome.google.com/webstore/detail/rabby-wallet/acmacodkjbdgmoleebolmdjonilkdbch"}},safe:{name:"Safe",icon:jsxRuntimeExports.jsx(Logos.Safe,{}),downloadUrls:{download:"https://connect.family.co/v0/download/safe",website:"https://safe.global/",ios:"https://apps.apple.com/app/id1515759131",android:"https://play.google.com/store/apps/details?id=io.gnosis.safe"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://gnosis-safe.io/wc?uri=${encodeURIComponent(et)}`},"xyz.talisman":{name:"Talisman",shortName:"Talisman",iconShape:"squircle",downloadUrls:{download:"https://talisman.xyz/download",website:"https://talisman.xyz",chrome:"https://chrome.google.com/webstore/detail/talisman-polkadot-wallet/fijngjgcjhjmmpcmkeiomlglpeiijkld",firefox:"https://addons.mozilla.org/en-US/firefox/addon/talisman-wallet-extension/"}},"com.trustwallet.app":{name:"Trust Wallet",shortName:"Trust",icon:jsxRuntimeExports.jsx(Logos.Trust,{}),iconShouldShrink:!0,downloadUrls:{download:"https://connect.family.co/v0/download/trust",android:"https://play.google.com/store/apps/details?id=com.wallet.crypto.trustapp",ios:"https://apps.apple.com/app/trust-crypto-bitcoin-wallet/id1288339409"},getWalletConnectDeeplink(et){return isAndroid()?et:`https://link.trustwallet.com/wc?uri=${encodeURIComponent(et)}`}},infinityWallet:{name:"Infinity Wallet",icon:jsxRuntimeExports.jsx(Logos.InfinityWallet,{}),downloadUrls:{download:"https://connect.family.co/v0/download/infinityWallet",website:"https://infinitywallet.io/download",chrome:"https://infinitywallet.io/download",firefox:"https://infinitywallet.io/download",brave:"https://infinitywallet.io/download",edge:"https://infinitywallet.io/download"}},imToken:{name:"imToken",icon:jsxRuntimeExports.jsx(Logos.ImToken,{}),downloadUrls:{download:"https://connect.family.co/v0/download/imToken",android:"https://play.google.com/store/apps/details?id=im.token.app",ios:"https://itunes.apple.com/us/app/imtoken2/id1384798940"},getWalletConnectDeeplink:et=>`imtokenv2://wc?uri=${encodeURIComponent(et)}`},unstoppable:{name:"Unstoppable",icon:jsxRuntimeExports.jsx(Logos.Unstoppable,{}),downloadUrls:{download:"https://connect.family.co/v0/download/unstoppable",ios:"https://apps.apple.com/app/bank-bitcoin-wallet/id1447619907",android:"https://play.google.com/store/apps/details?id=io.horizontalsystems.bankwallet"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://unstoppable.money/wc?uri=${encodeURIComponent(et)}`},onto:{name:"ONTO",icon:jsxRuntimeExports.jsx(Logos.ONTO,{}),downloadUrls:{download:"https://connect.family.co/v0/download/onto",ios:"https://apps.apple.com/app/onto-an-ontology-dapp/id1436009823",android:"https://play.google.com/store/apps/details?id=com.github.ontio.onto",website:"https://onto.app/en/download/"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://onto.app/wc?uri=${encodeURIComponent(et)}`},steak:{name:"Steak",icon:jsxRuntimeExports.jsx(Logos.Steak,{}),downloadUrls:{download:"https://connect.family.co/v0/download/steak",android:"https://play.google.com/store/apps/details?id=fi.steakwallet.app",ios:"https://apps.apple.com/app/steakwallet/id1569375204",website:"https://steakwallet.fi/download"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://links.steakwallet.fi/wc?uri=${encodeURIComponent(et)}`},ledger:{name:"Ledger Live",shortName:"Ledger",icon:jsxRuntimeExports.jsx(Logos.Ledger,{}),downloadUrls:{download:"https://connect.family.co/v0/download/ledger",website:"https://www.ledger.com/ledger-live/download#download-device-2",android:"https://play.google.com/store/apps/details?id=com.ledger.live",ios:"https://apps.apple.com/app/ledger-live-web3-wallet/id1361671700"},getWalletConnectDeeplink:et=>isAndroid()?et:`ledgerlive://wc?uri=${encodeURIComponent(et)}`,shouldDeeplinkDesktop:!0},zerion:{name:"Zerion",icon:jsxRuntimeExports.jsx(Logos.Zerion,{}),downloadUrls:{download:"https://connect.family.co/v0/download/zerion",ios:"https://apps.apple.com/app/apple-store/id1456732565",android:"https://play.google.com/store/apps/details?id=io.zerion.android",website:"https://zerion.io/"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://app.zerion.io/wc?uri=${encodeURIComponent(et)}`},slope:{name:"Slope",icon:jsxRuntimeExports.jsx(Logos.Slope,{}),downloadUrls:{download:"https://connect.family.co/v0/download/slope",ios:"https://apps.apple.com/app/slope-wallet/id1574624530",android:"https://play.google.com/store/apps/details?id=com.wd.wallet",chrome:"https://chrome.google.com/webstore/detail/slope-wallet/pocmplpaccanhmnllbbkpgfliimjljgo",website:"https://slope.finance/"},getWalletConnectDeeplink:et=>isAndroid()?et:`https://slope.finance/app/wc?uri=${encodeURIComponent(et)}`},tokenPocket:{name:"TokenPocket Wallet",icon:jsxRuntimeExports.jsx(Logos.TokenPocket,{}),downloadUrls:{website:"https://www.tokenpocket.pro/en/download/app",download:"https://www.tokenpocket.pro/en/download/app",android:"https://play.google.com/store/apps/details?id=vip.mytokenpocket",ios:"https://apps.apple.com/us/app/tp-global-wallet/id6444625622",chrome:"https://chrome.google.com/webstore/detail/tokenpocket/mfgccjchihfkkindfppnaooecgfneiii"}},talisman:{name:"Talisman",icon:jsxRuntimeExports.jsx(Logos.Talisman,{}),downloadUrls:{download:"https://talisman.xyz/download",website:"https://talisman.xyz",chrome:"https://chrome.google.com/webstore/detail/talisman-polkadot-wallet/fijngjgcjhjmmpcmkeiomlglpeiijkld",firefox:"https://addons.mozilla.org/en-US/firefox/addon/talisman-wallet-extension/"}},walletConnect:{name:"Other Wallets",shortName:"Other",icon:jsxRuntimeExports.jsx(Logos.WalletConnect,{background:!0}),iconConnector:jsxRuntimeExports.jsx(Logos.OtherWallets,{}),iconShape:"square",getWalletConnectDeeplink:et=>et}};Object.keys(walletConfigs).reduce((et,o)=>{var tt,rt,nt,ot,it,st;const at=walletConfigs[o];if(!(at!=null&&at.getWalletConnectDeeplink))return et;const ct=o.split(",")[0].trim(),lt=(rt=(tt=at.name)===null||tt===void 0?void 0:tt.replace("Wallet","").replace(" ",""))!==null&&rt!==void 0?rt:ct[0].toUpperCase()+ct.slice(1),dt=injected({target:{id:ct,name:(ot=(nt=at.name)!==null&&nt!==void 0?nt:at.shortName)!==null&&ot!==void 0?ot:o,provider:mt=>{var ft;return(ft=mt==null?void 0:mt.ethereum)===null||ft===void 0?void 0:ft[`is${lt}`]}}}),ht=((st=(it=at.name)!==null&&it!==void 0?it:at.shortName)!==null&&st!==void 0?st:o).toLowerCase().replace(/(?:^|\s)\S/g,mt=>mt.toUpperCase()).replace(/\s/g,"").replace(/(?:^|\s)\S/g,mt=>mt.toLowerCase());return et[ht]=dt,et},{});const defaultLightTheme={font:{family:"-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji'"},text:{primary:{color:"#373737"},secondary:{color:"#999999",hover:{color:"#111111"}},error:"#FC6464",valid:"#32D74B"},buttons:{primary:{borderRadius:16,color:"#000373737000",background:"#FFFFFF",border:"#F0F0F0",hover:{color:"#000000",border:"#1A88F8"}},secondary:{borderRadius:16,background:"#F6F7F9",color:"#000000"}},navigation:{color:"#999999"},modal:{background:"#ffffff",divider:"#f7f6f8"},tooltips:{color:"#999999",background:"#ffffff",hover:{background:"#f6f7f9"}},overlay:{background:"rgba(0, 0, 0, 0.06)"},qrCode:{accentColor:"#F7F6F8"}},parseTheme=et=>et,userPrefersDarkMode=()=>typeof window>"u"?!1:window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches;userPrefersDarkMode();const defaultTheme$1={connectKit:{options:{iconStyle:"light"},theme:{preferred:"dark",light:parseTheme(defaultLightTheme),dark:parseTheme(defaultLightTheme)}}};var styled=typeof qe.div=="function"?qe:qe.default;const hexToP3=et=>{const o=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(et);if(o==null)return et;const tt={r:parseInt(o[1],16),g:parseInt(o[2],16),b:parseInt(o[3],16)};return`color(display-p3 ${tt.r/255} ${tt.g/255} ${tt.b/255})`};var base$m={light:{"--ck-connectbutton-font-size":"15px","--ck-connectbutton-color":"#373737","--ck-connectbutton-background":"#F6F7F9","--ck-connectbutton-background-secondary":"#FFFFFF","--ck-connectbutton-hover-color":"#373737","--ck-connectbutton-hover-background":"#F0F2F5","--ck-connectbutton-active-color":"#373737","--ck-connectbutton-active-background":"#EAECF1","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#fff","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-background)","--ck-connectbutton-balance-hover-background":"#F6F7F9","--ck-connectbutton-balance-hover-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-hover-background)","--ck-connectbutton-balance-active-background":"#F0F2F5","--ck-connectbutton-balance-active-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-active-background)","--ck-primary-button-border-radius":"16px","--ck-primary-button-color":"#373737","--ck-primary-button-background":"#F6F7F9","--ck-primary-button-font-weight":"600","--ck-primary-button-hover-color":"#373737","--ck-primary-button-hover-background":"#F0F2F5","--ck-secondary-button-border-radius":"16px","--ck-secondary-button-color":"#373737","--ck-secondary-button-background":"#F6F7F9","--ck-tertiary-button-background":"#FFFFFF","--ck-secondary-button-hover-background":"#e0e4eb","--ck-modal-box-shadow":"0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-overlay-background":"rgba(71, 88, 107, 0.24)","--ck-body-color":"#373737","--ck-body-color-muted":"#999999","--ck-body-color-muted-hover":"#111111","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#F3F4F7","--ck-body-action-color":"#999999","--ck-body-divider":"#f7f6f8","--ck-body-divider-secondary":"rgba(0, 0, 0, 0.06)","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-siwe-border":"#F0F0F0","--ck-body-disclaimer-color":"#AAAAAB","--ck-body-disclaimer-link-color":"#838485","--ck-body-disclaimer-link-hover-color":"#000000","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0,0,0,0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#F5F7F9","--ck-qr-dot-color":"#000000","--ck-qr-border-color":"#f7f6f8","--ck-focus-color":"#1A88F8","--ck-spinner-color":"var(--ck-focus-color)","--ck-copytoclipboard-stroke":"#CCCCCC"},dark:{"--ck-connectbutton-font-size":"15px","--ck-connectbutton-color":"#ffffff","--ck-connectbutton-background":"#383838","--ck-connectbutton-background-secondary":"#282828","--ck-connectbutton-hover-background":"#404040","--ck-connectbutton-active-background":"#4D4D4D","--ck-connectbutton-balance-color":"#fff","--ck-connectbutton-balance-background":"#282828","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-background)","--ck-connectbutton-balance-hover-background":"#383838","--ck-connectbutton-balance-hover-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-hover-background)","--ck-connectbutton-balance-active-background":"#404040","--ck-connectbutton-balance-active-box-shadow":"inset 0 0 0 1px var(--ck-connectbutton-active-background)","--ck-primary-button-color":"#ffffff","--ck-primary-button-background":"#383838","--ck-primary-button-border-radius":"16px","--ck-primary-button-font-weight":"600","--ck-primary-button-hover-background":"#404040","--ck-primary-button-active-border-radius":"16px","--ck-secondary-button-color":"#ffffff","--ck-secondary-button-background":"#333333","--ck-secondary-button-hover-background":"#4D4D4D","--ck-tertiary-button-background":"#424242","--ck-focus-color":"#1A88F8","--ck-overlay-background":"rgba(0,0,0,0.4)","--ck-body-color":"#ffffff","--ck-body-color-muted":"rgba(255, 255, 255, 0.4)","--ck-body-color-muted-hover":"rgba(255, 255, 255, 0.8)","--ck-body-background":"#2B2B2B","--ck-body-background-transparent":"rgba(0,0,0,0)","--ck-body-background-secondary":"#333333","--ck-body-background-secondary-hover-background":"#4D4D4D","--ck-body-background-secondary-hover-outline":"#ffffff","--ck-body-background-tertiary":"#333333","--ck-body-action-color":"#808080","--ck-body-divider":"#383838","--ck-body-color-danger":"#FF4E4E","--ck-body-disclaimer-color":"#858585","--ck-body-disclaimer-link-color":"#ADADAD","--ck-body-disclaimer-link-hover-color":"#FFFFFF","--ck-modal-box-shadow":"0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-copytoclipboard-stroke":"#555555","--ck-tooltip-background":"#2B2B2B","--ck-tooltip-background-secondary":"#333333","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-dropdown-button-color":"#6C7381","--ck-spinner-color":"var(--ck-focus-color)","--ck-qr-dot-color":"#ffffff","--ck-qr-border-color":"#3d3d3d"}},web95={"--ck-font-family":"Lato","--ck-border-radius":"0px","--ck-connectbutton-color":"#373737","--ck-connectbutton-background":"linear-gradient(180deg, #F0F0EA 0%, #FFFFFF 50%, #F0F0EA 100%) 100% 100% / 200% 200%, #F5F5F1","--ck-connectbutton-box-shadow":" 0 0 0 1px #003C74, 2px 2px 0px rgba(255, 255, 255, 0.75), -2px -2px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 0px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-connectbutton-border-radius":"4.5px","--ck-connectbutton-hover-color":"#373737","--ck-connectbutton-hover-background":"linear-gradient(180deg, #F0F0EA 0%, #FFFFFF 50%, #F0F0EA 100%) 100% 0% / 200% 200%, #F5F5F1","--ck-connectbutton-active-background":"linear-gradient(180deg, #F0F0EA 0%, #FFFFFF 50%, #F0F0EA 100%) 100% 100% / 200% 200%, #F5F5F1","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#fff","--ck-connectbutton-balance-box-shadow":"0 0 0 1px #E4E7E7","--ck-connectbutton-balance-hover-box-shadow":"0 0 0 1px #d7dbdb","--ck-connectbutton-balance-active-box-shadow":"0 0 0 1px #bbc0c0","--ck-focus-color":"#1A88F8","--ck-overlay-background":"rgba(0, 127, 128, 0.8)","--ck-body-color":"#373737","--ck-body-color-muted":"#808080","--ck-body-color-muted-hover":"#111111","--ck-body-background":"#F0EDE2","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary-hover-background":"#FAFAFA","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-action-color":"#373737","--ck-body-color-danger":"#FC6464","--ck-body-color-valid":"#32D74B","--ck-body-divider":"#919B9C","--ck-body-divider-box-shadow":"0px 1px 0px #FBFBF8","--ck-primary-button-background":"linear-gradient(180deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-primary-button-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 0px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-primary-button-border-radius":"6px","--ck-primary-button-hover-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 5px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-primary-button-hover-border-radius":"6px","--ck-modal-heading-font-weight":400,"--ck-modal-box-shadow":` - inset 0px -3px 0px #0F37A9, - inset -2px 0px 0px #0F37A9, - inset 0px -4px 0px #0D5DDF, - inset -4px 0px 0px #0D5DDF, - inset 2px 0px 0px #0453DD, - inset 0px 2px 0px #044FD1, - inset 4px 0px 0px #4283EB, - inset 0px 4px 0px #4283EB - `,"--ck-modal-h1-font-weight":400,"--ck-secondary-button-color":"#373737","--ck-secondary-button-border-radius":"6px","--ck-secondary-button-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 0px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-secondary-button-background":"linear-gradient(180deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-secondary-button-hover-box-shadow":"inset 0 0 0 1px #003C74, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset 0px 0px 0px 4px #97B9EC, inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-body-background-secondary":"rgba(0, 0, 0, 0.1)","--ck-body-background-tertiary":"linear-gradient(180deg, #FBFBFB 0%, #EFEFEE 100%)","--ck-tertiary-border-radius":"0px","--ck-tertiary-box-shadow":"inset 0 0 0 1px #919B9C, 1px 1px 2px rgba(0, 0, 0, 0.15), inset -2px -2px 0px #FFFFFF","--ck-body-button-text-align":"left","--ck-body-button-box-shadow":"0 2px 4px rgba(0, 0, 0, 0.05 )","--ck-body-disclaimer-background":"linear-gradient(180deg, #FBFBFB 0%, #EFEFEE 100%)","--ck-body-disclaimer-box-shadow":` - inset 0px -3px 0px #0F37A9, - inset -2px 0px 0px #0F37A9, - inset 0px -4px 0px #0D5DDF, - inset -4px 0px 0px #0D5DDF, - inset 2px 0px 0px #0453DD, - inset 4px 0px 0px #4283EB, - inset 0 1px 0 0 #919B9C`,"--ck-body-disclaimer-font-size":"14px","--ck-body-disclaimer-color":"#959594","--ck-body-disclaimer-link-color":"#626262","--ck-body-disclaimer-link-hover-color":"#000000","--ck-qr-dot-color":"#000000","--ck-qr-border-color":"#919B9C","--ck-qr-border-radius":"0","--ck-qr-background":"#FFFFFF","--ck-copytoclipboard-stroke":"rgba(55, 55, 55, 0.4)","--ck-tooltip-background":"linear-gradient(270deg, #F7F3E6 7.69%, #F5F7DA 100%)","--ck-tooltip-background-secondary":"#f6f7f9","--ck-tooltip-color":"#000000","--ck-tooltip-shadow":" 0 0 0 1.5px #2b2622, 0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px #A0A0A0, 1px 1px 0px rgba(255, 255, 255, 0.75), -1px -1px 0px rgba(0, 0, 0, 0.05), inset -1px -2px 2px rgba(0, 0, 0, 0.2)","--ck-dropdown-button-background":"linear-gradient(180deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-dropdown-button-hover-background":"linear-gradient(0deg, #FFFFFF 0%, #F0F0EA 100%), #F5F5F1","--ck-dropdown-pending-color":"#ACA899","--ck-dropdown-active-color":"#FFFFFF","--ck-dropdown-active-static-color":"#ACA899","--ck-dropdown-active-background":"#3F69BF","--ck-dropdown-active-border-radius":"0","--ck-dropdown-active-inset":"-12px","--ck-dropdown-color":"#ACA899","--ck-dropdown-background":"#FFFFFF","--ck-dropdown-box-shadow":"inset 0 0 0 1px #ACA899, 2px 2px 7px rgba(0, 0, 0, 0.15)","--ck-dropdown-border-radius":"0","--ck-alert-color":"#ACA899","--ck-alert-background":"linear-gradient(180deg, #FBFBFB 0%, #EFEFEE 100%)","--ck-alert-box-shadow":"inset 0 0 0 1px #919B9C, 1px 1px 2px rgba(0, 0, 0, 0.15), inset -2px -2px 0px #FFFFFF","--ck-alert-border-radius":"0","--ck-recent-badge-border-radius":"32px","--ck-recent-badge-top-offset":"0px","--ck-graphic-primary-color":"#333333","--ck-graphic-primary-background":"#FFFFFF","--ck-graphic-compass-background":"#FFFFFF","--ck-siwe-border":"#919B9C"},retro={"--ck-font-family":'"SF Pro Rounded",ui-rounded,"Nunito",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"8px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-color":"#000000","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"-4px 4px 0px #000000, inset 0 0 0 2px #000000","--ck-connectbutton-border-radius":"8px","--ck-connectbutton-hover-background":"#F3EDE8","--ck-connectbutton-active-box-shadow":"0 0 0 0 #000000, inset 0 0 0 2px #000000","--ck-connectbutton-balance-color":"#000000","--ck-connectbutton-balance-background":"#F3EDE8","--ck-connectbutton-balance-box-shadow":"-4px 4px 0px #000000, inset 0 0 0 2px #000000","--ck-connectbutton-balance-hover-background":"#eee5dd","--ck-connectbutton-balance-connectbutton-box-shadow":"-4px 8px 0px -4px #000000, inset 0 0 0 2px #000000","--ck-connectbutton-balance-connectbutton-border-radius":"0px 8px 8px 0","--ck-primary-button-color":"#373737","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"inset 0 0 0 2px #000000, -4px 4px 0 0 #000000","--ck-primary-button-border-radius":"8px","--ck-primary-button-hover-background":"#F3EDE8","--ck-primary-button-hover-box-shadow":"inset 0 0 0 2px #000000, -0px 0px 0 0 #000000","--ck-secondary-button-border-radius":"8px","--ck-secondary-button-color":"#373737","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"-4px 4px 0 0 #000000, inset 0 0 0 2px #000000","--ck-secondary-button-hover-background":"#F3EDE8","--ck-secondary-button-hover-box-shadow":"0 0 0 0 #000000, inset 0 0 0 2px #000000","--ck-focus-color":"#3B99FC","--ck-overlay-background":"rgba(133, 120, 122, 0.8)","--ck-body-color":"#373737","--ck-body-color-muted":"rgba(0, 0, 0, 0.5)","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#EBE1D8","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"rgba(0,0,0,0.1)","--ck-body-background-secondary-hover-background":"#4D4D4D","--ck-body-background-secondary-hover-outline":"#373737","--ck-body-background-tertiary":"#ffffff","--ck-tertiary-border-radius":"8px","--ck-tertiary-box-shadow":"-4px 4px 0 0 #000000, inset 0 0 0 2px #000000","--ck-body-action-color":"#373737","--ck-body-divider":"#373737","--ck-body-color-danger":"#FF4E4E","--ck-body-disclaimer-background":"#E3D6C9","--ck-body-disclaimer-box-shadow":"-4px 4px 0 0 #000000, inset 2px 0 0 0 #000000, inset -2px 0 0 0 #000000, inset 0 -2px 0 0 #000000","--ck-body-disclaimer-font-weight":"500","--ck-body-disclaimer-color":"#888079","--ck-body-disclaimer-link-color":"#5B5650","--ck-body-disclaimer-link-hover-color":"#000000","--ck-modal-box-shadow":"-10px 10px 0px #000000, inset 0 0 0 2px #000000","--ck-copytoclipboard-stroke":"#555555","--ck-tooltip-border-radius":"8px","--ck-tooltip-color":"#373737","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#EBE1D8","--ck-tooltip-shadow":"-6px 6px 0 0 #000000, 0 0 0 2px #000000","--ck-spinner-color":"#1A88F8","--ck-dropdown-button-color":"#000","--ck-dropdown-button-box-shadow":"-2px 2px 0 2px #000000, 0 0 0 2px #000000","--ck-dropdown-button-background":"#ffffff","--ck-dropdown-button-hover-background":"#F3EDE8","--ck-dropdown-button-hover-box-shadow":"-2px 2px 0 0 #000000, 0 0 0 2px #000000","--ck-dropdown-pending-color":"rgba(0, 0, 0, 0.5)","--ck-dropdown-active-color":"#FFFFFF","--ck-dropdown-active-static-color":"rgba(0, 0, 0, 0.5)","--ck-dropdown-active-background":"#3B99FC","--ck-dropdown-active-box-shadow":"inset 0 0 0 2px #000000","--ck-dropdown-active-border-radius":"8px","--ck-dropdown-color":"rgba(0, 0, 0, 0.5)","--ck-dropdown-background":"#FFFFFF","--ck-dropdown-box-shadow":"-4px 4px 0 0 #000000, inset 0 0 0 2px #000000","--ck-dropdown-border-radius":"8px","--ck-alert-color":"rgba(0, 0, 0, 0.5)","--ck-alert-background":" #F5F5F5","--ck-alert-border-radius":"8px","--ck-qr-border-radius":"8px","--ck-qr-dot-color":"#000000","--ck-qr-border-color":"#000000","--ck-qr-background":"#ffffff","--ck-recent-badge-border-radius":"32px","--ck-recent-badge-box-shadow":"inset 0 0 0 2px currentColor","--ck-graphic-primary-color":"#000000","--ck-graphic-primary-background":"#ffffff","--ck-graphic-compass-background":"#FFFFFF","--ck-siwe-border":"#8E8985"},soft={"--ck-border-radius":"12px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-border-radius":"12px","--ck-connectbutton-color":"#414451","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-hover-background":"#F6F7F9","--ck-connectbutton-hover-box-shadow":"inset 0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#F6F7F9","--ck-connectbutton-balance-box-shadow":"none","--ck-connectbutton-balance-hover-background":"#f1f1f3","--ck-primary-button-border-radius":"12px","--ck-primary-button-color":"#414451","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-primary-button-hover-background":"#F6F7F9","--ck-primary-button-hover-box-shadow":"0 0 0 1px #D9DBDD, 0px 0 0 rgba(0, 0, 0, 0.02)","--ck-secondary-button-border-radius":"12px","--ck-secondary-button-color":"#414451","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"0 0 0 1px #E9EAEC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-secondary-button-hover-background":"#F6F7F9","--ck-secondary-button-hover-box-shadow":"0 0 0 1px #D9DBDD, 0px 0 0 rgba(0, 0, 0, 0.02)","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 3px 16px rgba(0, 0, 0, 0.08)","--ck-body-color":"#414451","--ck-body-color-muted":"#9196A1","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#F6F8FA","--ck-tertiary-border-radius":"13px","--ck-tertiary-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-body-action-color":"#999999","--ck-body-divider":"#f7f6f8","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#F9FAFA","--ck-body-disclaimer-color":"#AFB1B6","--ck-body-disclaimer-link-color":"#787B84","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#E7E7E7","--ck-dropdown-color":"rgba(55, 55, 55, 0.4)","--ck-dropdown-box-shadow":"0px 2px 15px rgba(0, 0, 0, 0.15)","--ck-alert-color":"#9196A1","--ck-alert-background":"#F6F8FA","--ck-alert-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-alert-border-radius":"8px","--ck-qr-border-radius":"12px","--ck-qr-dot-color":"#2E3138","--ck-qr-border-color":"#E9EAEC","--ck-siwe-border":"#EAEBED"},midnight={"--ck-font-family":'"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"10px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-border-radius":"8px","--ck-connectbutton-color":"#ffffff","--ck-connectbutton-background":"#313235","--ck-connectbutton-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-connectbutton-hover-background":"#414144","--ck-connectbutton-active-background":"#4C4D4F","--ck-connectbutton-balance-color":"#ffffff","--ck-connectbutton-balance-background":"#1F2023","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px #313235","--ck-connectbutton-balance-hover-background":"#313235","--ck-connectbutton-balance-active-background":"#414144","--ck-primary-button-border-radius":"8px","--ck-primary-button-color":"#ffffff","--ck-primary-button-background":"rgba(255, 255, 255, 0.08)","--ck-primary-button-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-primary-button-hover-background":"rgba(255, 255, 255, 0.2)","--ck-secondary-button-border-radius":"8px","--ck-secondary-button-color":"#ffffff","--ck-secondary-button-background":"#363638","--ck-secondary-button-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-secondary-button-hover-background":"#3c3c3e","--ck-overlay-background":"rgba(0,0,0,0.4)","--ck-modal-box-shadow":"inset 0 0 0 1px #38393C, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-focus-color":"#1A88F8","--ck-body-color":"#ffffff","--ck-body-color-muted":"#8B8F97","--ck-body-color-muted-hover":"#ffffff","--ck-body-background":"#1F2023","--ck-body-background-transparent":"rgba(31, 32, 35, 0)","--ck-body-background-secondary":"#313235","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"rgba(255, 255, 255, 0.02)","--ck-body-background-tertiary":"#313235","--ck-tertiary-border-radius":"12px","--ck-tertiary-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.02)","--ck-body-action-color":"#8B8F97","--ck-body-divider":"rgba(255,255,255,0.1)","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#2B2D31","--ck-body-disclaimer-box-shadow":"none","--ck-body-disclaimer-color":"#808183","--ck-body-disclaimer-link-color":"#AAABAD","--ck-body-disclaimer-link-hover-color":"#ffffff","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-background":"#1F2023","--ck-tooltip-background-secondary":"#1F2023","--ck-tooltip-color":"#ffffff","--ck-tooltip-shadow":" 0 0 0 1px rgba(255, 255, 255, 0.1), 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#6C7381","--ck-dropdown-button-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.05)","--ck-dropdown-button-background":"#313235","--ck-dropdown-pending-color":"#8B8F97","--ck-dropdown-active-color":"#FFF","--ck-dropdown-active-static-color":"#FFF","--ck-dropdown-active-background":"rgba(255, 255, 255, 0.07)","--ck-dropdown-color":"#8B8F97","--ck-dropdown-background":"#313235","--ck-dropdown-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.03)","--ck-dropdown-border-radius":"8px","--ck-alert-color":"#8B8F97","--ck-alert-background":"#404145","--ck-alert-box-shadow":"inset 0 0 0 1px rgba(255, 255, 255, 0.02)","--ck-qr-border-radius":"12px","--ck-qr-dot-color":"#ffffff","--ck-qr-border-color":"rgba(255,255,255,0.1)","--ck-recent-badge-border-radius":"32px"},minimal$1={"--ck-font-family":'"Inter",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"0px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-border-radius":"0px","--ck-connectbutton-color":"#414451","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-connectbutton-hover-color":"#111","--ck-connectbutton-hover-box-shadow":"inset 0 0 0 1px #111","--ck-connectbutton-balance-color":"#111111","--ck-connectbutton-balance-background":"#F7F7F7","--ck-connectbutton-balance-box-shadow":"inset 0 0 0 1px #F7F7F7","--ck-connectbutton-balance-hover-background":"#f1f1f3","--ck-connectbutton-balance-hover-box-shadow":"inset 0 0 0 1px #111","--ck-primary-button-border-radius":"0px","--ck-primary-button-color":"#111111","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-primary-button-hover-box-shadow":"inset 0 0 0 1px #111111","--ck-secondary-button-border-radius":"0px","--ck-secondary-button-color":"#111111","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-secondary-button-hover-box-shadow":"inset 0 0 0 1px #111111","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#E7E7E7","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 3px 16px rgba(0, 0, 0, 0.08)","--ck-body-color":"#111111","--ck-body-color-muted":"#A0A0A0","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#ffffff","--ck-tertiary-border-radius":"0px","--ck-tertiary-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-body-action-color":"#A0A0A0","--ck-body-divider":"#EBEBEB","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#FAFAFA","--ck-body-disclaimer-box-shadow":"inset 0 1px 0 0 #ECECEC","--ck-body-disclaimer-color":"#9D9D9D","--ck-body-disclaimer-link-color":"#6E6E6E","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-border-radius":"0px","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-active-border-radius":"0","--ck-dropdown-box-shadow":"0px 2px 15px rgba(0, 0, 0, 0.15)","--ck-dropdown-border-radius":"0","--ck-alert-color":"rgba(17, 17, 17, 0.4)","--ck-alert-background":"#fff","--ck-alert-box-shadow":"inset 0 0 0 1px #EBEBEB","--ck-alert-border-radius":"0","--ck-qr-border-radius":"0px","--ck-qr-dot-color":"#111111","--ck-qr-border-color":"#EBEBEB","--ck-modal-h1-font-weight":"400","--ck-modal-heading-font-weight":"400","--ck-primary-button-font-weight":"400","--ck-recent-badge-top-offset":"0px","--ck-siwe-border":"#EBEBEB"},rounded={"--ck-font-family":'"Nunito",ui-rounded,-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"24px","--ck-connectbutton-font-size":"17px","--ck-connectbutton-font-weight":"700","--ck-connectbutton-border-radius":"14px","--ck-connectbutton-color":"#000000","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 2px #DFE4EC, 0 2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-hover-background":"#F9FAFB","--ck-connectbutton-balance-color":"#414451","--ck-connectbutton-balance-background":"#F9FAFB","--ck-connectbutton-balance-box-shadow":"0 2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-balance-hover-background":"#F5F7F9","--ck-connectbutton-balance-hover-box-shadow":"0 2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-balance-active-box-shadow":"0 0 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-connectbutton-active-background":"#F5F7F9","--ck-connectbutton-active-box-shadow":"inset 0 0 0 2px #CFD7E2, 0 0px 0 0 #CFD7E2, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-primary-button-border-radius":"18px","--ck-primary-button-color":"#000000","--ck-primary-button-background":"#ffffff","--ck-primary-button-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -4px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-primary-button-hover-background":"#F5F7F9","--ck-primary-button-hover-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-secondary-button-border-radius":"16px","--ck-secondary-button-color":"#000000","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -4px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-secondary-button-hover-background":"#F5F7F9","--ck-secondary-button-hover-box-shadow":"inset 0 0 0 2px #DFE4EC, inset 0 -2px 0 0 #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 3px 16px rgba(0, 0, 0, 0.08)","--ck-body-color":"#000000","--ck-body-color-muted":"#93989F","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#ffffff","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#f6f7f9","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-secondary-hover-outline":"#4282FF","--ck-body-background-tertiary":"#ffffff","--ck-tertiary-border-radius":"22px","--ck-tertiary-box-shadow":"inset 0 0 0 2px #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-body-action-color":"#93989F","--ck-body-divider":"#DFE4EC","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#F9FAFB","--ck-body-disclaimer-font-size":"14px","--ck-body-disclaimer-font-weight":"700","--ck-body-disclaimer-color":"#959697","--ck-body-disclaimer-link-color":"#646464","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#CCCCCC","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":" 0 0 0 2px #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 2px #DFE4EC, 0 2px 0 2px #DFE4EC, 0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#F5F7F9","--ck-dropdown-pending-color":"#848D9A","--ck-dropdown-active-color":"#000000","--ck-dropdown-active-static-color":"#848D9A","--ck-dropdown-active-background":"#F5F7F9","--ck-dropdown-color":"#848D9A","--ck-dropdown-background":"#FFFFFF","--ck-dropdown-box-shadow":"0px 2px 15px rgba(0, 0, 0, 0.15)","--ck-dropdown-border-radius":"16px","--ck-alert-color":"#848D9A","--ck-alert-background":"#F5F7F9","--ck-qr-border-radius":"24px","--ck-qr-dot-color":"#111111","--ck-qr-border-color":"#DFE4EC","--ck-modal-h1-font-weight":"700","--ck-modal-heading-font-weight":"700","--ck-primary-button-font-weight":"700","--ck-recent-badge-box-shadow":"inset 0 0 0 2px currentColor","--ck-recent-badge-top-offset":"0px","--ck-siwe-border":"#DFE4EC"},nouns={"--ck-font-family":'"PT Root UI",ui-rounded,"Nunito",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,"Apple Color Emoji",Arial,sans-serif,"Segoe UI Emoji","Segoe UI Symbol"',"--ck-border-radius":"24px","--ck-connectbutton-font-size":"16px","--ck-connectbutton-font-weight":"700","--ck-connectbutton-border-radius":"10px","--ck-connectbutton-color":"#151C3B","--ck-connectbutton-background":"#ffffff","--ck-connectbutton-box-shadow":"inset 0 0 0 1px #D6D8E1","--ck-connectbutton-hover-background":"#E9EBF3","--ck-connectbutton-hover-box-shadow":"inset 0 0 0 1px #D4D8E8","--ck-connectbutton-active-background":"#D4D8E8","--ck-connectbutton-active-box-shadow":"inset 0 0 0 1px #D4D8E8","--ck-connectbutton-balance-color":"#373737","--ck-connectbutton-balance-background":"#F6F7F9","--ck-connectbutton-balance-box-shadow":"none","--ck-connectbutton-balance-hover-background":"#f1f1f3","--ck-primary-button-border-radius":"16px","--ck-primary-button-color":"#151C3B","--ck-primary-button-background":"#ffffff","--ck-primary-button-font-weight":"700","--ck-primary-button-hover-background":"#DEE1ED","--ck-secondary-button-border-radius":"16px","--ck-secondary-button-color":"#151C3B","--ck-secondary-button-background":"#ffffff","--ck-secondary-button-font-weight":"700","--ck-secondary-button-hover-background":"#DEE1ED","--ck-focus-color":"#1A88F8","--ck-modal-box-shadow":"0px 2px 4px rgba(0, 0, 0, 0.02)","--ck-overlay-background":"rgba(213, 215, 225, 0.8)","--ck-overlay-backdrop-filter":"blur(6px)","--ck-body-color":"#151C3B","--ck-body-color-muted":"#757A8E","--ck-body-color-muted-hover":"#000000","--ck-body-background":"#F4F4F8","--ck-body-background-transparent":"rgba(255,255,255,0)","--ck-body-background-secondary":"#E9E9F1","--ck-body-background-secondary-hover-background":"#e0e4eb","--ck-body-background-tertiary":"#E9E9F1","--ck-tertiary-border-radius":"24px","--ck-body-action-color":"#79809C","--ck-body-divider":"#D9DBE3","--ck-body-color-danger":"#FF4E4E","--ck-body-color-valid":"#32D74B","--ck-body-disclaimer-background":"#F9FAFA","--ck-body-disclaimer-color":"#AFB1B6","--ck-body-disclaimer-link-color":"#787B84","--ck-body-disclaimer-link-hover-color":"#000000","--ck-copytoclipboard-stroke":"#79809C","--ck-tooltip-background":"#ffffff","--ck-tooltip-background-secondary":"#ffffff","--ck-tooltip-color":"#999999","--ck-tooltip-shadow":"0px 2px 10px rgba(0, 0, 0, 0.08)","--ck-spinner-color":"var(--ck-focus-color)","--ck-dropdown-button-color":"#999999","--ck-dropdown-button-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-button-background":"#fff","--ck-dropdown-button-hover-color":"#8B8B8B","--ck-dropdown-button-hover-background":"#DEE1ED","--ck-dropdown-button-hover-box-shadow":"0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-dropdown-color":"#757A8E","--ck-dropdown-box-shadow":"0 0 0 1px rgba(0, 0, 0, 0.01), 0px 0px 7px rgba(0, 0, 0, 0.05)","--ck-alert-color":"#9196A1","--ck-alert-background":"#F6F8FA","--ck-alert-box-shadow":"inset 0 0 0 1px rgba(0, 0, 0, 0.04)","--ck-alert-border-radius":"8px","--ck-qr-border-radius":"24px","--ck-qr-dot-color":"#000000","--ck-qr-background":"#ffffff","--ck-recent-badge-color":"#79809C","--ck-recent-badge-background":"#F4F4F8","--ck-recent-badge-box-shadow":"none","--ck-siwe-border":"#DFE4EC","--ck-graphic-primary-background":"#fff","--ck-graphic-compass-background":"#fff","--ck-graphic-primary-box-shadow":"0px 2.94737px 14.7368px rgba(0, 0, 0, 0.1)","--ck-graphic-compass-box-shadow":"0px 2px 9px rgba(0, 0, 0, 0.15)"},predefinedThemes={base:base$m,web95,retro,soft,midnight,minimal:minimal$1,rounded,nouns};const themeGlobals={default:{"--ck-font-family":`-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, - 'Apple Color Emoji', Arial, sans-serif, 'Segoe UI Emoji', - 'Segoe UI Symbol'`,"--ck-border-radius":"20px","--ck-secondary-button-border-radius":"16px"},graphics:{light:{"--ck-graphic-wave-stop-01":"#E8F17D","--ck-graphic-wave-stop-02":"#A8ECDE","--ck-graphic-wave-stop-03":"#7AA1F2","--ck-graphic-wave-stop-04":"#DEA1E8","--ck-graphic-wave-stop-05":"#F46D98","--ck-graphic-scaniconwithlogos-01":"#4E4E4E","--ck-graphic-scaniconwithlogos-02":"#272727","--ck-graphic-scaniconwithlogos-03":"#F8D74A","--ck-graphic-scaniconwithlogos-04":"#F6F7F9","--ck-chain-ethereum-01":"#25292E","--ck-chain-ethereum-02":"#fff","--ck-chain-ethereum-03":"#DFE0E0"},dark:{"--ck-graphic-wave-stop-01":"#E8F17D","--ck-graphic-wave-stop-02":"#A8ECDE","--ck-graphic-wave-stop-03":"#7AA1F2","--ck-graphic-wave-stop-04":"#DEA1E8","--ck-graphic-wave-stop-05":"#F46D98","--ck-graphic-scaniconwithlogos-01":"#AFAFAF","--ck-graphic-scaniconwithlogos-02":"#696969","--ck-graphic-scaniconwithlogos-03":"#F8D74A","--ck-graphic-scaniconwithlogos-04":"#3D3D3D"}},ens:{light:{"--ck-ens-01-start":"#FF3B30","--ck-ens-01-stop":"#FF9500","--ck-ens-02-start":"#FF9500","--ck-ens-02-stop":"#FFCC00","--ck-ens-03-start":"#FFCC00","--ck-ens-03-stop":"#34C759","--ck-ens-04-start":"#5856D6","--ck-ens-04-stop":"#AF52DE","--ck-ens-05-start":"#5AC8FA","--ck-ens-05-stop":"#007AFF","--ck-ens-06-start":"#007AFF","--ck-ens-06-stop":"#5856D6","--ck-ens-07-start":"#5856D6","--ck-ens-07-stop":"#AF52DE","--ck-ens-08-start":"#AF52DE","--ck-ens-08-stop":"#FF2D55"},dark:{"--ck-ens-01-start":"#FF453A","--ck-ens-01-stop":"#FF9F0A","--ck-ens-02-start":"#FF9F0A","--ck-ens-02-stop":"#FFD60A","--ck-ens-03-start":"#FFD60A","--ck-ens-03-stop":"#32D74B","--ck-ens-04-start":"#32D74B","--ck-ens-04-stop":"#64D2FF","--ck-ens-05-start":"#64D2FF","--ck-ens-05-stop":"#0A84FF","--ck-ens-06-start":"#0A84FF","--ck-ens-06-stop":"#5E5CE6","--ck-ens-07-start":"#5E5CE6","--ck-ens-07-stop":"#BF5AF2","--ck-ens-08-start":"#BF5AF2","--ck-ens-08-stop":"#FF2D55"}},brand:{"--ck-family-brand":"#1A88F8","--ck-brand-walletConnect":"#3B99FC","--ck-brand-coinbaseWallet":"#0052FF","--ck-brand-metamask":"#f6851b","--ck-brand-metamask-01":"#F6851B","--ck-brand-metamask-02":"#E2761B","--ck-brand-metamask-03":"#CD6116","--ck-brand-metamask-04":"#161616","--ck-brand-metamask-05":"#763D16","--ck-brand-metamask-06":"#D7C1B3","--ck-brand-metamask-07":"#C0AD9E","--ck-brand-metamask-08":"#E4761B","--ck-brand-metamask-09":"#233447","--ck-brand-metamask-10":"#E4751F","--ck-brand-metamask-11":"#FEF5E7","--ck-brand-metamask-12":"#E3C8AB","--ck-brand-trust-01":"#3375BB","--ck-brand-trust-02":"#ffffff","--ck-brand-trust-01b":"#ffffff","--ck-brand-trust-02b":"#3375BB","--ck-brand-argent":"#f36a3d","--ck-brand-imtoken-01":"#11C4D1","--ck-brand-imtoken-02":"#0062AD","--ck-brand-safe":"#12FF80","--ck-brand-dawn":"#000000"}},themeColors={light:predefinedThemes.base.light,dark:predefinedThemes.base.dark,web95:predefinedThemes.web95,retro:predefinedThemes.retro,soft:predefinedThemes.soft,midnight:predefinedThemes.midnight,minimal:predefinedThemes.minimal,rounded:predefinedThemes.rounded,nouns:predefinedThemes.nouns},createCssVars=(et,o)=>Ae` - ${Object.keys(et).map(tt=>{const rt=et[tt];return rt&&`${tt}:${rt};`})} - `,createCssColors=(et,o)=>{const tt=o?" !important":"";return Ae` - ${Object.keys(et).map(rt=>{const nt=et[rt];return nt&&`${rt}:${nt}${tt};`})} - @supports (color: color(display-p3 1 1 1)) { - ${Object.keys(et).map(rt=>{const nt=et[rt];return`${rt}:${hexToP3(nt)}${tt};`})} - } - `},themes={default:createCssVars(themeGlobals.default),light:createCssColors(themeColors.light),dark:createCssColors(themeColors.dark),web95:createCssColors(themeColors.web95),retro:createCssColors(themeColors.retro),soft:createCssColors(themeColors.soft),midnight:createCssColors(themeColors.midnight),minimal:createCssColors(themeColors.minimal),rounded:createCssColors(themeColors.rounded),nouns:createCssColors(themeColors.nouns)},globals={brand:createCssVars(themeGlobals.brand),ensLight:createCssVars(themeGlobals.ens.light),ensDark:createCssVars(themeGlobals.ens.dark),graphicsLight:createCssVars(themeGlobals.graphics.light),graphicsDark:createCssVars(themeGlobals.graphics.dark)},globalsLight=Ae` - ${globals.brand} - ${globals.ensLight} - ${globals.graphicsLight} -`,globalsDark=Ae` - ${globals.brand} - ${globals.ensDark} - ${globals.graphicsDark} -`;let mode="auto";const ResetContainer=styled(motion.div)` - ${themes.default} - - ${et=>{switch(et.$useTheme){case"web95":return mode="light",themes.web95;case"retro":return mode="light",themes.retro;case"soft":return mode="light",themes.soft;case"midnight":return mode="dark",themes.midnight;case"minimal":return mode="light",themes.minimal;case"rounded":return mode="light",themes.rounded;case"nouns":return mode="light",themes.nouns;default:return et.$useMode==="light"?(mode="light",themes.light):et.$useMode==="dark"?(mode="dark",themes.dark):Ae` - @media (prefers-color-scheme: light) { - ${themes.light} - } - @media (prefers-color-scheme: dark) { - ${themes.dark} - } - `}}} - - ${et=>{switch(mode){case"light":return globalsLight;case"dark":return globalsDark;default:return Ae` - ${globalsLight} - @media (prefers-color-scheme: dark) { - ${globalsDark} - } - `}}} - - - ${et=>{var o;if(et.$customTheme&&et.$customTheme["--ck-accent-color"]&&["light","dark","auto","",void 0].includes(et.$useTheme)){const tt=et.$customTheme["--ck-accent-color"],rt=(o=et.$customTheme["--ck-accent-text-color"])!==null&&o!==void 0?o:"#ffffff";return{"--ck-accent-color":tt,"--ck-accent-text-color":rt,"--ck-secondary-button-background":tt,"--ck-secondary-button-hover-background":tt,"--ck-secondary-button-color":rt,"--ck-button-primary-color":rt,"--ck-focus-color":tt}}if(et.$customTheme)return createCssColors(et.$customTheme,!0)}} - - all: initial; - text-align: left; - text-direction: ltr; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - -webkit-text-stroke: 0.001px transparent; - text-size-adjust: none; - font-size: 16px; - - button { - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - -webkit-tap-highlight-color: rgba(0, 0, 0, 0); - -webkit-text-stroke: 0.001px transparent; - } - - &, - * { - font-family: var(--ck-font-family); - box-sizing: border-box; - outline: none; - border: none; - } - /* - @media (prefers-reduced-motion) { - * { - animation-duration: 60ms !important; - transition-duration: 60ms !important; - } - } - */ - img, - svg { - max-width: 100%; - } - strong { - font-weight: 600; - } - a:focus-visible, - button:focus-visible { - outline: 2px solid var(--ck-focus-color); - } -`,Portal$2=et=>{et={selector:"__CONNECTKIT__",...et};const{selector:o,children:tt}=et,rt=reactExports.useRef(null),[nt,ot]=reactExports.useState(!1);return reactExports.useEffect(()=>{const it="#"+o.replace(/^#/,"");if(rt.current=document.querySelector(it),!rt.current){const st=document.createElement("div");st.setAttribute("id",o),st.setAttribute("data-connectkit",`${CONNECTKIT_VERSION}`),document.body.appendChild(st),rt.current=st}ot(!0)},[o]),rt.current&&nt?reactDomExports.createPortal(tt,rt.current):null};var defaultTheme={mobileWidth:560};const ErrorMessage=styled(motion.div)` - z-index: -1; - pointer-events: auto; - position: absolute; - left: 50%; - transform: translateX(-50%); - width: var(--width); - top: 64px; - color: #fff; - font-size: 14px; - line-height: 20px; - font-weight: 500; - background: var(--ck-body-color-danger); - border-radius: 20px; - padding: 24px 46px 82px 24px; - transition: width var(--duration) var(--ease); - a { - font-weight: 700; - text-decoration: underline; - } - code { - font-size: 0.9em; - display: inline-block; - font-family: monospace; - margin: 1px; - padding: 0 4px; - border-radius: 8px; - font-weight: bold; - background: rgba(255, 255, 255, 0.1); - } -`,FadeIn=We` -from { opacity: 0; } - to { opacity: 1; } -`,FadeInScaleUp=We` -from { opacity: 0; transform: scale(0.85); } - to { opacity: 1; transform: scale(1); } -`,FadeInScaleDown=We` -from { opacity: 0; transform: scale(1.1); } - to { opacity: 1; transform: scale(1); } -`,FadeOut=We` -from { opacity: 1; } - to { opacity: 0; } -`,FadeOutScaleUp=We` -from { opacity: 1; transform: scale(1); } - to { opacity: 0; transform: scale(1.1); } -`,FadeOutScaleDown=We` -from { opacity: 1; transform: scale(1); } - to { opacity: 0; transform: scale(0.85); } -`,PageContent=styled(motion.div)` - max-width: 100%; - width: 295px; - padding-top: 48px; -`,TextWithHr=styled(motion.div)` - user-select: none; - position: relative; - display: block; - text-align: center; - color: var(--ck-body-color-muted); - font-size: 15px; - font-weight: 400; - line-height: 21px; - span { - z-index: 2; - position: relative; - display: inline-block; - user-select: none; - pointer-events: none; - padding: 0 14px; - background: var(--ck-body-background); - transition: background-color 200ms ease; - } - &:before { - z-index: 2; - content: ''; - position: absolute; - top: 50%; - left: 0; - right: 0; - height: 1px; - transform: translateY(-1px); - background: var(--ck-body-divider); - box-shadow: var(--ck-body-divider-box-shadow); - } -`,ModalHeading=styled(motion.div)` - z-index: 3; - pointer-events: none; - user-select: none; - position: absolute; - top: 25px; - left: 50%; - display: flex; - align-items: center; - justify-content: center; - height: 26px; - transform: translateX(-50%); - width: var(--width); - text-align: center; - font-size: 17px; - line-height: 20px; - font-weight: var(--ck-modal-heading-font-weight, 600); - color: var(--ck-body-color); - span { - display: inline-block; - } -`,ModalContentContainer=styled(motion.div)` - position: relative; - padding: 0; -`,ModalContent=styled(motion.div)` - left: 0; - right: 0; - text-align: center; - display: flex; - flex-direction: column; - gap: 12px; - padding: 0 0 16px; - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - display: block; - } -`,ModalH1=styled(motion.h1)` - margin: 0; - padding: 0; - line-height: ${et=>et.$small?20:22}px; - font-size: ${et=>et.$small?17:19}px; - font-weight: var(--ck-modal-h1-font-weight, 600); - color: ${et=>et.$error?"var(--ck-body-color-danger)":et.$valid?"var(--ck-body-color-valid)":"var(--ck-body-color)"}; - > svg { - position: relative; - top: -2px; - display: inline-block; - vertical-align: middle; - margin-right: 6px; - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - margin-bottom: 6px; - font-size: 17px; - } -`,ModalBody=styled.div` - font-size: 16px; - font-weight: 400; - line-height: 21px; - color: var(--ck-body-color-muted); - strong { - font-weight: 500; - color: var(--ck-body-color); - } -`;styled.div` - padding: 0 12px; - font-size: 13px; - font-weight: 400; - line-height: 16px; - color: var(--ck-body-color-muted); - strong { - font-weight: 500; - color: var(--ck-body-color); - } -`;const BackgroundOverlay=styled(motion.div)` - z-index: 1; - position: absolute; - top: 0; - left: 0; - right: 0; - bottom: 0; - background: var(--ck-overlay-background, rgba(71, 88, 107, 0.24)); - backdrop-filter: ${et=>et.$blur?`blur(${et.$blur}px)`:"var(--ck-overlay-backdrop-filter, none)"}; - opacity: 0; - animation: ${et=>et.$active?FadeIn:FadeOut} 150ms ease-out - both; -`,BoxIn=We` - from{ opacity: 0; transform: scale(0.97); } - to{ opacity: 1; transform: scale(1); } -`,BoxOut=We` - from{ opacity: 1; transform: scale(1); } - to{ opacity: 0; transform: scale(0.97); } -`,MobileBoxIn=We` - from { transform: translate3d(0, 100%, 0); } - to { transform: translate3d(0, 0%, 0); } -`,MobileBoxOut=We` - from { opacity: 1; } - to { opacity: 0; } -`,BoxContainer=styled(motion.div)` - z-index: 2; - position: relative; - color: var(--ck-body-color); - - animation: 150ms ease both; - animation-name: ${BoxOut}; - &.active { - animation-name: ${BoxIn}; - } - - &:before { - content: ''; - position: absolute; - top: 0; - bottom: 0; - left: 50%; - width: var(--width); - height: var(--height); - transform: translateX(-50%); - backface-visibility: hidden; - transition: all 200ms ease; - border-radius: var(--ck-border-radius, 20px); - background: var(--ck-body-background); - box-shadow: var(--ck-modal-box-shadow); - } - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - animation-name: ${MobileBoxOut}; - animation-duration: 130ms; - animation-timing-function: ease; - - &.active { - animation-name: ${MobileBoxIn}; - animation-duration: 300ms; - animation-delay: 32ms; - animation-timing-function: cubic-bezier(0.15, 1.15, 0.6, 1); - } - - &:before { - width: 100%; - transition: 0ms height cubic-bezier(0.15, 1.15, 0.6, 1); - will-change: height; - } - } -`,ControllerContainer=styled(motion.div)` - z-index: 3; - position: absolute; - top: 0; - left: 50%; - height: 64px; - transform: translateX(-50%); - backface-visibility: hidden; - width: var(--width); - transition: 0.2s ease width; - pointer-events: auto; - //border-bottom: 1px solid var(--ck-body-divider); -`,InnerContainer$1=styled(motion.div)` - position: relative; - overflow: hidden; - height: var(--height); - transition: 0.2s ease height; - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - transition: 0ms height cubic-bezier(0.15, 1.15, 0.6, 1); - /* animation-delay: 34ms; */ - } -`,PageContainer=styled(motion.div)` - z-index: 2; - position: relative; - top: 0; - left: 50%; - margin-left: calc(var(--width) / -2); - width: var(--width); - /* left: 0; */ - /* width: 100%; */ - display: flex; - justify-content: center; - align-items: center; - transform-origin: center center; - animation: 200ms ease both; - - &.active { - animation-name: ${FadeInScaleDown}; - } - &.active-scale-up { - animation-name: ${FadeInScaleUp}; - } - &.exit-scale-down { - z-index: 1; - pointer-events: none; - position: absolute; - /* top: 0; */ - /* left: 0; */ - animation-name: ${FadeOutScaleDown}; - } - &.exit { - z-index: 1; - pointer-events: none; - position: absolute; - /* top: 0; */ - /* left: 0; */ - /* left: 50%; */ - /* transform: translateX(-50%); */ - animation-name: ${FadeOutScaleUp}; - animation-delay: 16.6667ms; - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - /* animation: 0ms ease both; */ - /* animation-delay: 35ms; */ - animation: 0ms cubic-bezier(0.15, 1.15, 0.6, 1) both; - - &.active { - animation-name: ${FadeIn}; - } - &.active-scale-up { - animation-name: ${FadeIn}; - } - &.exit-scale-down { - z-index: 3; - animation-name: ${FadeOut}; - } - &.exit { - z-index: 3; - animation-name: ${FadeOut}; - animation-delay: 0ms; - } - } -`,PageContents=styled(motion.div)` - margin: 0 auto; - width: fit-content; - padding: 29px 24px 24px; - backface-visibility: hidden; -`,ModalContainer=styled.div` - z-index: 2147483646; // z-index set one below max (2147483647) for if we wish to layer things ontop of the modal in a seperate Portal - position: fixed; - inset: 0; -`,CloseButton=styled(motion.button)` - z-index: 3; - cursor: pointer; - position: absolute; - top: 22px; - right: 17px; - width: 32px; - height: 32px; - display: flex; - align-items: center; - justify-content: center; - border-radius: 16px; - padding: 0; - margin: 0; - color: var(--ck-body-action-color); - background: var(--ck-body-background); - transition: background-color 200ms ease, transform 100ms ease; - /* will-change: transform; */ - svg { - display: block; - } - - &:hover { - background: var(--ck-body-background-secondary); - } - &:active { - transform: scale(0.9); - } -`,SiweButton=styled(motion.button)` - z-index: 3; - position: absolute; - inset: 0; - width: 100%; // FireFox fix - display: flex; - align-items: center; - justify-content: center; - border-radius: 16px; - padding: 0; - margin: 0; - color: var(--ck-body-action-color); - background: var(--ck-body-background); - transition: background-color 200ms ease, transform 100ms ease; - /* will-change: transform; */ - svg { - display: block; - position: relative; - } - - &:enabled { - cursor: pointer; - &:hover { - background: var(--ck-body-background-secondary); - } - &:active { - transform: scale(0.9); - } - } -`,BackButton=styled(motion.button)` - z-index: 3; - position: absolute; - inset: 0; - width: 100%; // FireFox fix - display: flex; - align-items: center; - justify-content: center; - border-radius: 16px; - padding: 0; - margin: 0; - color: var(--ck-body-action-color); - background: var(--ck-body-background); - transition: background-color 200ms ease, transform 100ms ease; - /* will-change: transform; */ - svg { - display: block; - position: relative; - left: -1px; - } - - &:enabled { - cursor: pointer; - &:hover { - background: var(--ck-body-background-secondary); - } - &:active { - transform: scale(0.9); - } - } -`,InfoButton=styled(motion.button)` - z-index: 3; - position: absolute; - inset: 0; - width: 100%; // FireFox fix - transform: translateX(-1px); - display: flex; - align-items: center; - justify-content: center; - border-radius: 16px; - padding: 0; - margin: 0; - color: var(--ck-body-action-color); - background: var(--ck-body-background); - transition: background-color 200ms ease, transform 100ms ease; - /* will-change: transform; */ - svg { - display: block; - position: relative; - } - &:enabled { - cursor: pointer; - &:hover { - background: var(--ck-body-background-secondary); - } - &:active { - transform: scale(0.9); - } - } -`,Container$7=styled(motion.div)` - --ease: cubic-bezier(0.25, 0.1, 0.25, 1); - --duration: 200ms; - --transition: height var(--duration) var(--ease), - width var(--duration) var(--ease); - z-index: 3; - display: block; - pointer-events: none; - position: absolute; - left: 50%; - top: 50%; - width: 100%; - transform: translate3d(-50%, -50%, 0); - backface-visibility: hidden; - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - pointer-events: auto; - left: 0; - top: auto; - bottom: -5px; - transform: none; - ${BoxContainer} { - max-width: 448px; - margin: 0 auto; - &:before { - width: 100%; - border-radius: var(--ck-border-radius, 30px) - var(--ck-border-radius, 30px) 0 0; - } - } - ${PageContainer} { - left: 0; - right: 0; - margin: 0 auto; - width: auto; - } - ${PageContent} { - margin: 0 auto; - width: 100% !important; - } - ${ModalHeading} { - top: 29px; - } - ${ModalContent} { - gap: 12px; - } - ${ModalBody} { - margin: 0 auto; - max-width: 295px; - } - ${PageContents} { - width: 100%; - padding: 31px 24px; - } - ${ControllerContainer} { - width: 100%; - top: 4px; - border-bottom: 0; - } - ${CloseButton} { - right: 22px; - } - ${BackButton} { - top: -1px; - left: -3px; - } - ${InfoButton} { - top: -1px; - left: -3px; - svg { - width: 65%; - height: auto; - } - } - ${CloseButton}, - ${BackButton}, - ${InfoButton} { - // Quick hack for bigger tappable area on mobile - transform: scale(1.4) !important; - background: transparent !important; - svg { - transform: scale(0.8) !important; - } - } - } -`,Disclaimer=styled(motion.div)` - display: flex; - align-items: center; - justify-content: center; - margin: 16px -24px -24px -24px; - padding: 15px 40px 18px; - font-size: var(--ck-body-disclaimer-font-size, 13px); - font-weight: var(--ck-body-disclaimer-font-weight, 400); - text-align: center; - line-height: 19px; - color: var(--ck-body-disclaimer-color, var(--ck-body-color-muted, inherit)); - - & a { - color: var(--ck-body-disclaimer-link-color, inherit); - font-weight: var(--ck-body-disclaimer-font-weight, 400); - text-decoration: none; - transition: color 200ms ease; - &:hover { - color: var(--ck-body-disclaimer-link-hover-color, inherit); - } - } - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - margin: 24px -24px -26px -24px; - padding: 20px 42px 22px 42px; - } -`,DisclaimerBackground=styled(motion.div)` - pointer-events: all; - z-index: 9; - position: absolute; - bottom: 0; - left: 50%; - width: var(--width); - backface-visibility: hidden; - transform: translateX(-50%); - transform-origin: bottom center; - - border-radius: var(--ck-border-radius, 30px); - border-top-left-radius: 0; - border-top-right-radius: 0; - transition: width 200ms ease; - - background: var( - --ck-body-disclaimer-background, - var(--ck-body-background-secondary) - ); - box-shadow: var(--ck-body-disclaimer-box-shadow); - - ${Disclaimer} { - margin: 0 !important; - /* visibility: hidden; */ - } - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - border-radius: 0; - } -`,SignInTooltip=styled(motion.div)` - z-index: 2; - position: absolute; - top: 100%; - white-space: nowrap; - padding: 8px 16px; - color: #fff; - font-size: 13px; - line-height: 1.5; - background: #1a88f8; - border-radius: calc(var(--ck-border-radius) * 0.75); - transform: translateY(8px) translateX(-48px); - box-shadow: var(--ck-modal-box-shadow); - &:before { - content: ''; - position: absolute; - box-shadow: var(--shadow); - width: 18px; - height: 18px; - transform: translate(215%, -75%) rotate(45deg); - background: inherit; - border-radius: 3px 0 0 0; - } - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - transform: translateY(8px) translateX(-16px); - &:before { - transform: translate(40%, -75%) rotate(45deg); - } - } -`,useIsomorphicLayoutEffect$2=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function useLockBodyScroll(et){const[o,tt]=reactExports.useState(et),rt=useContext();return useIsomorphicLayoutEffect$2(()=>{var nt;if(!o)return;const ot={overflow:document.body.style.overflow,position:document.body.style.position,touchAction:document.body.style.touchAction,paddingRight:document.body.style.paddingRight},it=getComputedStyle(document.body),st=parseInt(it.marginRight)+parseInt(it.paddingRight)+parseInt(it.borderRight)+parseInt(it.marginLeft)+parseInt(it.paddingLeft)+parseInt(it.borderLeft),at=window.innerWidth-document.body.offsetWidth-st;return document.documentElement.style.setProperty("--ck-scrollbar-width",`${at}px`),document.body.style.overflow="hidden",document.body.style.position="relative",document.body.style.touchAction="none",!((nt=rt.options)===null||nt===void 0)&&nt.avoidLayoutShift&&(document.body.style.paddingRight=`${at}px`),()=>{var ct;document.documentElement.style.removeProperty("--ck-scrollbar-width"),document.body.style.overflow=ot.overflow,document.body.style.position=ot.position,document.body.style.touchAction=ot.touchAction,!((ct=rt.options)===null||ct===void 0)&&ct.avoidLayoutShift&&(document.body.style.paddingRight=ot.paddingRight)}},[o]),reactExports.useEffect(()=>{o!==et&&tt(et)},[et]),[o,tt]}const KEYCODE_TAB=9;function useFocusTrap(){const et=reactExports.useRef(null);function o(tt){if(et.current){var rt=et.current.querySelectorAll(` - a[href]:not(:disabled), - button:not(:disabled), - textarea:not(:disabled), - input[type="text"]:not(:disabled), - input[type="radio"]:not(:disabled), - input[type="checkbox"]:not(:disabled), - select:not(:disabled) - `),nt=rt[0],ot=rt[rt.length-1],it=tt.key==="Tab"||tt.keyCode===KEYCODE_TAB;it&&(tt.shiftKey?document.activeElement===nt&&(ot.focus(),tt.preventDefault()):document.activeElement===ot&&(nt.focus(),tt.preventDefault()))}}return reactExports.useEffect(()=>(et.current&&(et.current.addEventListener("keydown",o),et.current.focus({preventScroll:!0})),()=>{et.current&&et.current.removeEventListener("keydown",o)}),[]),et}function FocusTrap(et){const o=useFocusTrap();return reactExports.useEffect(()=>{o.current&&o.current.focus({preventScroll:!0})},[]),jsxRuntimeExports.jsx("div",{ref:o,tabIndex:0,children:et.children})}function usePrevious(et,o){const tt=reactExports.useRef({target:et,previous:o});return tt.current.target!==et&&(tt.current.previous=tt.current.target,tt.current.target=et),tt.current.previous}const Context$1=reactExports.createContext(null),ConnectKitThemeProvider=({children:et,theme:o="auto",mode:tt="auto",customTheme:rt})=>{const nt={theme:o,mode:tt,customTheme:rt};return reactExports.createElement(Context$1.Provider,{value:nt},jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:et}))},useThemeContext=()=>{const et=React.useContext(Context$1);if(!et)throw Error("ConnectKitThemeProvider must be inside a Provider.");return et},ExternalLinkIcon=({...et})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{left:0,top:0},...et,children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 4C2.89543 4 2 4.89543 2 6V12C2 13.1046 2.89543 14 4 14H10C11.1046 14 12 13.1046 12 12V9.66667C12 9.11438 12.4477 8.66667 13 8.66667C13.5523 8.66667 14 9.11438 14 9.66667V12C14 14.2091 12.2091 16 10 16H4C1.79086 16 0 14.2091 0 12V6C0 3.79086 1.79086 2 4 2H6.33333C6.88562 2 7.33333 2.44772 7.33333 3C7.33333 3.55228 6.88562 4 6.33333 4H4Z",fill:"currentColor",fillOpacity:.3}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.5 1C9.5 0.447715 9.94772 0 10.5 0H15C15.5523 0 16 0.447715 16 1V5.5C16 6.05228 15.5523 6.5 15 6.5C14.4477 6.5 14 6.05228 14 5.5V3.41421L8.70711 8.70711C8.31658 9.09763 7.68342 9.09763 7.29289 8.70711C6.90237 8.31658 6.90237 7.68342 7.29289 7.29289L12.5858 2H10.5C9.94772 2 9.5 1.55228 9.5 1Z",fill:"currentColor",fillOpacity:.3})]}),AlertIcon=({...et})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"19",height:"18",viewBox:"0 0 19 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.81753 1.60122C7.39283 0.530035 8.46953 0 9.50409 0C10.5507 0 11.6022 0.539558 12.1805 1.59767L18.6047 13.3334C18.882 13.8283 19 14.3568 19 14.8622C19 16.5296 17.7949 18 15.9149 18H3.08514C1.20508 18 0 16.5296 0 14.8622C0 14.3454 0.131445 13.8172 0.405555 13.3379L6.81753 1.60122ZM9.50409 2C9.13355 2 8.77256 2.18675 8.57866 2.54907L8.57458 2.5567L2.14992 14.3166L2.144 14.3268C2.04638 14.4959 2 14.6817 2 14.8622C2 15.5497 2.43032 16 3.08514 16H15.9149C16.5697 16 17 15.5497 17 14.8622C17 14.6681 16.9554 14.4805 16.8588 14.309L16.8529 14.2986L10.4259 2.55741C10.2191 2.1792 9.86395 2 9.50409 2Z",fill:"currentColor"}),jsxRuntimeExports.jsx("path",{d:"M9.5 11.2297C9.01639 11.2297 8.7459 10.9419 8.72951 10.4186L8.60656 6.4157C8.59016 5.88372 8.95902 5.5 9.4918 5.5C10.0164 5.5 10.4016 5.89244 10.3852 6.42442L10.2623 10.4099C10.2377 10.9419 9.96721 11.2297 9.5 11.2297ZM9.5 14.5C8.95082 14.5 8.5 14.0901 8.5 13.5058C8.5 12.9215 8.95082 12.5116 9.5 12.5116C10.0492 12.5116 10.5 12.9128 10.5 13.5058C10.5 14.0988 10.041 14.5 9.5 14.5Z",fill:"currentColor"})]}),DisconnectIcon=({...et})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"15",height:"14",viewBox:"0 0 15 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{left:0,top:0},...et,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 0C1.79086 0 0 1.79086 0 4V10C0 12.2091 1.79086 14 4 14H6C6.55228 14 7 13.5523 7 13C7 12.4477 6.55228 12 6 12H4C2.89543 12 2 11.1046 2 10V4C2 2.89543 2.89543 2 4 2H6C6.55228 2 7 1.55228 7 1C7 0.447715 6.55228 0 6 0H4ZM11.7071 3.29289C11.3166 2.90237 10.6834 2.90237 10.2929 3.29289C9.90237 3.68342 9.90237 4.31658 10.2929 4.70711L11.5858 6H9.5H6C5.44772 6 5 6.44772 5 7C5 7.55228 5.44772 8 6 8H9.5H11.5858L10.2929 9.29289C9.90237 9.68342 9.90237 10.3166 10.2929 10.7071C10.6834 11.0976 11.3166 11.0976 11.7071 10.7071L14.7071 7.70711C15.0976 7.31658 15.0976 6.68342 14.7071 6.29289L11.7071 3.29289Z",fill:"currentColor",fillOpacity:"0.4"})}),TickIcon=({...et})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02944 13.9706 0 9 0C4.02944 0 0 4.02944 0 9C0 13.9706 4.02944 18 9 18ZM13.274 7.13324C13.6237 6.70579 13.5607 6.07577 13.1332 5.72604C12.7058 5.37632 12.0758 5.43932 11.726 5.86676L7.92576 10.5115L6.20711 8.79289C5.81658 8.40237 5.18342 8.40237 4.79289 8.79289C4.40237 9.18342 4.40237 9.81658 4.79289 10.2071L7.29289 12.7071C7.49267 12.9069 7.76764 13.0128 8.04981 12.9988C8.33199 12.9847 8.59505 12.8519 8.77396 12.6332L13.274 7.13324Z",fill:"currentColor"})}),RetryIconCircle=({...et})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16ZM24.5001 8.74263C25.0834 8.74263 25.5563 9.21551 25.5563 9.79883V14.5997C25.5563 15.183 25.0834 15.6559 24.5001 15.6559H19.6992C19.1159 15.6559 18.643 15.183 18.643 14.5997C18.643 14.0164 19.1159 13.5435 19.6992 13.5435H21.8378L20.071 11.8798C20.0632 11.8724 20.0555 11.865 20.048 11.8574C19.1061 10.915 17.8835 10.3042 16.5643 10.1171C15.2452 9.92999 13.9009 10.1767 12.7341 10.82C11.5674 11.4634 10.6413 12.4685 10.0955 13.684C9.54968 14.8994 9.41368 16.2593 9.70801 17.5588C10.0023 18.8583 10.711 20.0269 11.7273 20.8885C12.7436 21.7502 14.0124 22.2582 15.3425 22.336C16.6726 22.4138 17.9919 22.0572 19.1017 21.3199C19.5088 21.0495 19.8795 20.7333 20.2078 20.3793C20.6043 19.9515 21.2726 19.9262 21.7004 20.3228C22.1282 20.7194 22.1534 21.3876 21.7569 21.8154C21.3158 22.2912 20.8176 22.7161 20.2706 23.0795C18.7793 24.0702 17.0064 24.5493 15.2191 24.4448C13.4318 24.3402 11.7268 23.6576 10.3612 22.4998C8.9956 21.3419 8.0433 19.7716 7.6478 18.0254C7.2523 16.2793 7.43504 14.4519 8.16848 12.8186C8.90192 11.1854 10.1463 9.83471 11.7142 8.97021C13.282 8.10572 15.0884 7.77421 16.861 8.02565C18.6282 8.27631 20.2664 9.09278 21.5304 10.3525L23.4439 12.1544V9.79883C23.4439 9.21551 23.9168 8.74263 24.5001 8.74263Z",fill:"currentColor"})}),RetryIcon=({...et})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"16",height:"14",viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:[jsxRuntimeExports.jsx("path",{d:"M14.5 2V6H10.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M14 5.66537L10.9899 2.75871C10.0931 1.83853 8.92897 1.24216 7.6729 1.05947C6.41683 0.876774 5.13688 1.11765 4.02592 1.7458C2.91497 2.37395 2.0332 3.35534 1.5135 4.54208C0.993792 5.72883 0.864305 7.05663 1.14455 8.3254C1.42479 9.59418 2.09958 10.7352 3.06724 11.5765C4.03489 12.4178 5.24298 12.9138 6.50946 12.9898C7.77594 13.0657 9.03219 12.7176 10.0889 11.9977C10.4765 11.7337 10.8295 11.4249 11.142 11.0792",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),CopyToClipboardIcon$1=({...et})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:[jsxRuntimeExports.jsx("path",{d:"M14 9.5V7C14 5.89543 13.1046 5 12 5H7C5.89543 5 5 5.89543 5 7V12C5 13.1046 5.89543 14 7 14H9.5",stroke:"var(--ck-body-color-muted)",strokeWidth:"2"}),jsxRuntimeExports.jsx("rect",{x:"10",y:"10",width:"9",height:"9",rx:"2",stroke:"var(--ck-body-color-muted)",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M1 3L3 5L7 1",stroke:"var(--ck-body-color)",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})]}),AuthIcon=({...et})=>jsxRuntimeExports.jsx("div",{...et,style:{zIndex:2,display:"flex",alignItems:"center",justifyContent:"center",position:"absolute",bottom:0,right:0,background:"#34C759",borderRadius:10,boxShadow:"0 0 0 1.5px var(--background)",width:10,height:10,...et==null?void 0:et.style},children:jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"6",height:"6",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M0.75 3L2.25 4.5L5.25 1.5",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})});var StatusState;(function(et){et.READY="ready",et.LOADING="loading",et.SUCCESS="success",et.REJECTED="rejected",et.ERROR="error"})(StatusState||(StatusState={}));const SIWEContext=reactExports.createContext(null),useSIWE=({onSignIn:et,onSignOut:o}={})=>{const tt=reactExports.useContext(SIWEContext);if(!tt)return{isSignedIn:!1,data:void 0,status:StatusState.ERROR,error:new Error("useSIWE hook must be inside a SIWEProvider."),isRejected:!1,isError:!0,isLoading:!1,isSuccess:!1,isReady:!1,reset:()=>{},signIn:()=>Promise.reject(),signOut:()=>Promise.reject()};const{session:rt,nonce:nt,status:ot,signOut:it,signIn:st,resetStatus:at}=tt,{address:ct,chainId:lt}=rt.data||{},dt=ct?StatusState.SUCCESS:rt.isLoading||nt.isLoading?StatusState.LOADING:ot,ht=dt===StatusState.LOADING,mt=dt===StatusState.SUCCESS,ft=dt===StatusState.REJECTED,pt=dt===StatusState.ERROR,yt=!ct||nt.isFetching||ht||mt,gt=()=>at(),bt=!!ct;return{isSignedIn:bt,data:bt?{address:ct,chainId:lt}:void 0,status:dt,error:rt.error||nt.error,isRejected:ft,isError:pt,isLoading:ht,isSuccess:mt,isReady:yt,signIn:async()=>{if(!bt){const xt=await st();xt&&(et==null||et(xt))}},signOut:async()=>{bt&&(await it(),o==null||o())},reset:gt}},arAE={connectWallet:"الاتصال بالمحفظة",disconnect:"قطع الاتصال",connected:"متصل",wrongNetwork:"شبكة خاطئة",switchNetworks:"تغيير الشبكات",chainNetwork:"شبكة {{ CHAIN }}",copyToClipboard:"نسخ إلى الحافظة",copyCode:"نسخ الكود",moreInformation:"مزيد من المعلومات",back:"عودة",close:"إغلاق",or:"أو",more:"المزيد",tryAgain:"حاول مجددًا",tryAgainQuestion:"هل نحاول مرة أخرى؟",dontHaveTheApp:"ليس لديك التطبيق؟",scanTheQRCode:"مسح رمز الاستجابة السريعة",useWalletConnectModal:"استخدم نموذج ولِيت‌كنيكت",useModal:"استخدم النموذج",installTheExtension:"تثبيت الإضافة",getWalletName:"الحصول على {{ CONNECTORNAME }}",otherWallets:"محافظ أخرى",learnMore:"تعرف على المزيد",getWallet:"الحصول على محفظة",approveInWallet:"الموافقة في المحفظة",confirmInWallet:"تأكيد في المحفظة",awaitingConfirmation:"بانتظار التأكيد",signIn:"تسجيل الدخول",signOut:"تسجيل الخروج",signedIn:"تم تسجيل الدخول",signedOut:"تم تسجيل الخروج",walletNotConnected:"المحفظة غير متصلة",warnings_walletSwitchingUnsupported:"عذرًا، لا تدعم محفظتك تغيير الشبكات من هذا التطبيق.",warnings_walletSwitchingUnsupportedResolve:"حاول تغيير الشبكات من داخل محفظتك بدلاً من ذلك.",warnings_chainUnsupported:"هذا التطبيق غير متوافق مع الشبكة المتصلة حاليًا.",warnings_chainUnsupportedResolve:"للمتابعة، قم بتغيير الشبكة أو قطع الاتصال.",onboardingScreen_heading:"الحصول على محفظة",onboardingScreen_h1:"ابدأ استكشاف الويب3",onboardingScreen_p:"تعتبر محفظتك بوابتك إلى عوالم إيثريوم، التكنولوجيا السحرية التي تمكن استكشاف الويب3.",onboardingScreen_ctaText:"اختر محفظتك الأولى",onboardingScreen_ctaUrl:"https://ethereum.org/ar/wallets/find-wallet/",aboutScreen_heading:"حول المحافظ",aboutScreen_a_h1:"حافظ على أصولك الرقمية",aboutScreen_a_p:"تمكنك المحافظ من إرسال واستقبال وتخزين والتفاعل مع الأصول الرقمية مثل NFTs ورموز إيثريوم الأخرى.",aboutScreen_b_h1:"وسيلة أفضل لتسجيل الدخول",aboutScreen_b_p:"في تطبيقات العصر الحديث، يمكن استخدام محفظتك كوسيلة سهلة لتسجيل الدخول بدلاً من الحاجة إلى تذكر كلمة مرور.",aboutScreen_c_h1:"استكشاف عالم الويب3",aboutScreen_c_p:"تعتبر محفظتك أداة أساسية تمكنك من استكشاف والمشاركة في عالم الويب3 الذي يتطور بسرعة.",aboutScreen_ctaText:"استزيد من المعرفة",aboutScreen_ctaUrl:"https://ethereum.org/ar/wallets/",connectorsScreen_heading:"الاتصال بالمحفظة",connectorsScreen_newcomer:"ليس لدي محفظة",connectorsScreen_h1:"ما هي المحافظ؟",connectorsScreen_p:"تُستخدم المحافظ لإرسال واستقبال وتخزين الأصول الرقمية. يمكنك الاتصال بمحفظة للتفاعل مع التطبيقات.",mobileConnectorsScreen_heading:"اختر محفظة",scanScreen_heading:"مسح باستخدام الهاتف",scanScreen_heading_withConnector:"مسح باستخدام {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`افتح محفظة تدعم ولِيت‌كنيكت - لبدء المسح.`,scanScreen_tooltip_default:"افتح {{ CONNECTORNAME }} على هاتفك للمسح",downloadAppScreen_heading:"الحصول على {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:`استخدم كاميرا هاتفك للمسح وتنزيله على نظامي iOS أو Android - -.`,downloadAppScreen_ios:"استخدم كاميرا هاتفك للمسح وتنزيله على نظام iOS.",downloadAppScreen_android:"استخدم كاميرا هاتفك للمسح وتنزيله على نظام Android.",injectionScreen_unavailable_h1:"المتصفح غير مدعوم",injectionScreen_unavailable_p:"لتوصيل محفظتك {{ CONNECTORSHORTNAME }}، قم بتثبيت الإضافة على متصفح {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"تثبيت {{ CONNECTORNAME }}",injectionScreen_install_p:"لتوصيل محفظتك {{ CONNECTORSHORTNAME }}، قم بتثبيت الإضافة على المتصفح.",injectionScreen_connecting_h1:"طلب الاتصال",injectionScreen_connecting_p:"افتح إضافة المتصفح {{ CONNECTORSHORTNAME }} لتوصيل محفظتك.",injectionScreen_connecting_injected_h1:"طلب الاتصال",injectionScreen_connecting_injected_p:"قبل الطلب من خلال محفظتك للاتصال بتطبيقنا.",injectionScreen_connected_h1:"الاتصال بالفعل",injectionScreen_connected_p:"من الآمن الآن إغلاق هذه النافذة المنبثقة.",injectionScreen_rejected_h1:"تم رفض الطلب",injectionScreen_rejected_p:"لقد قمت برفض الطلب. انقر أعلى للمحاولة مرة أخرى.",injectionScreen_failed_h1:"فشل الاتصال",injectionScreen_failed_p:"عذرًا، حدث خطأ ما. يُرجى المحاولة مرة أخرى للاتصال.",injectionScreen_notconnected_h1:"تسجيل الدخول إلى {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"للمتابعة، يُرجى تسجيل الدخول إلى إضافة {{ CONNECTORNAME }}.",profileScreen_heading:"متصل",switchNetworkScreen_heading:"تبديل الشبكات",signInWithEthereumScreen_tooltip:`أنت غير مسجل الدخول حاليًا إلى هذا التطبيق. -**سجل الدخول باستخدام إثيريوم** للمتابعة.`,signInWithEthereumScreen_signedOut_heading:"سجل الدخول باستخدام إثيريوم",signInWithEthereumScreen_signedOut_h1:`يود هذا التطبيق التحقق منك - كصاحب لهذه المحفظة.`,signInWithEthereumScreen_signedOut_p:"يرجى تأكيد طلب الرسالة في محفظتك للمتابعة.",signInWithEthereumScreen_signedOut_button:"سجل الدخول",signInWithEthereumScreen_signedIn_heading:"تم تسجيل الدخول باستخدام إثيريوم",signInWithEthereumScreen_signedIn_h1:"لقد قمت بتأكيد نفسك كصاحب لهذه المحفظة بنجاح.",signInWithEthereumScreen_signedIn_p:"سيتطلب تسجيل الخروج منك إعادة المصادقة مرة أخرى في المستقبل.",signInWithEthereumScreen_signedIn_button:"تسجيل الخروج"},enUS={connectWallet:"Connect Wallet",disconnect:"Disconnect",connected:"Connected",wrongNetwork:"Wrong Network",switchNetworks:"Switch Networks",chainNetwork:"{{ CHAIN }} Network",copyToClipboard:"Copy to Clipboard",copyCode:"Copy Code",moreInformation:"More Information",back:"Back",close:"Close",or:"or",more:"More",tryAgain:"Try Again",tryAgainQuestion:"Try Again?",dontHaveTheApp:"Don't have the app?",scanTheQRCode:"Scan the QR code",useWalletConnectModal:"Use WalletConnect Modal",useModal:"Use Modal",installTheExtension:"Install the Extension",getWalletName:"Get {{ CONNECTORNAME }}",otherWallets:"Other Wallets",learnMore:"Learn More",getWallet:"Get a Wallet",approveInWallet:"Approve in Wallet",confirmInWallet:"Confirm in Wallet",awaitingConfirmation:"Awaiting Confirmation",signIn:"Sign In",signOut:"Sign Out",signedIn:"Signed In",signedOut:"Signed Out",walletNotConnected:"Wallet Not Connected",warnings_walletSwitchingUnsupported:"Your wallet does not support switching networks from this app.",warnings_walletSwitchingUnsupportedResolve:"Try switching networks from within your wallet instead.",warnings_chainUnsupported:"This app does not support the current connected network.",warnings_chainUnsupportedResolve:"Switch or disconnect to continue.",onboardingScreen_heading:"Get a Wallet",onboardingScreen_h1:"Start Exploring Web3",onboardingScreen_p:"Your wallet is the gateway to all things Ethereum, the magical technology that makes it possible to explore web3.",onboardingScreen_ctaText:"Choose Your First Wallet",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"About Wallets",aboutScreen_a_h1:"For your digital assets",aboutScreen_a_p:"Wallets let you send, receive, store, and interact with digital assets like NFTs and other Ethereum tokens.",aboutScreen_b_h1:"A better way to login",aboutScreen_b_p:"With modern apps, your wallet can be used as an easy way to login, instead of having to remember a password.",aboutScreen_c_h1:"Explore the world of web3",aboutScreen_c_p:"Your wallet is an essential utility that lets you explore and participate in the fast evolving world of web3.",aboutScreen_ctaText:"Learn More",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Connect Wallet",connectorsScreen_newcomer:"I don’t have a wallet",connectorsScreen_h1:"What is a wallet?",connectorsScreen_p:"Wallets are used to send, receive, and store digital assets. Connecting a wallet lets you interact with apps.",mobileConnectorsScreen_heading:"Choose Wallet",scanScreen_heading:"Scan with Phone",scanScreen_heading_withConnector:"Scan with {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`Open a [WALLETCONNECTLOGO] WalletConnect -supported wallet to scan`,scanScreen_tooltip_default:`Open {{ CONNECTORNAME }} on -your mobile phone to scan`,downloadAppScreen_heading:"Get {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Scan with your phone camera to download on iOS or Android.",downloadAppScreen_ios:"Scan with your phone camera to download on iOS.",downloadAppScreen_android:"Scan with your phone camera to download Android.",injectionScreen_unavailable_h1:"Unsupported Browser",injectionScreen_unavailable_p:`To connect your {{ CONNECTORSHORTNAME }} wallet, -install the extension on {{ SUGGESTEDEXTENSIONBROWSER }}.`,injectionScreen_install_h1:"Install {{ CONNECTORNAME }}",injectionScreen_install_p:`To connect your {{ CONNECTORSHORTNAME }} wallet, -install the browser extension.`,injectionScreen_connecting_h1:"Requesting Connection",injectionScreen_connecting_p:`Open the {{ CONNECTORSHORTNAME }} browser -extension to connect your wallet.`,injectionScreen_connecting_injected_h1:"Requesting Connection",injectionScreen_connecting_injected_p:"Accept the request through your wallet to connect to this app.",injectionScreen_connected_h1:"Already Connected",injectionScreen_connected_p:"It is now okay to close this popup",injectionScreen_rejected_h1:"Request Cancelled",injectionScreen_rejected_p:`You cancelled the request. -Click above to try again.`,injectionScreen_failed_h1:"Connection Failed",injectionScreen_failed_p:`Sorry, something went wrong. -Please try connecting again.`,injectionScreen_notconnected_h1:"Login to {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"To continue, please login to your {{ CONNECTORNAME }} extension.",profileScreen_heading:"Connected",switchNetworkScreen_heading:"Switch Networks",signInWithEthereumScreen_tooltip:`You’re not signed in to this app. -**Sign In With Ethereum** to continue.`,signInWithEthereumScreen_signedOut_heading:"Sign In With Ethereum",signInWithEthereumScreen_signedOut_h1:`This app would like to verify you - as the owner of this wallet.`,signInWithEthereumScreen_signedOut_p:`Please sign the message request - in your wallet to continue.`,signInWithEthereumScreen_signedOut_button:"Sign In",signInWithEthereumScreen_signedIn_heading:"Signed In With Ethereum",signInWithEthereumScreen_signedIn_h1:`You successfully verified yourself - as the owner of this wallet.`,signInWithEthereumScreen_signedIn_p:`Signing out will require you to - authenticate again in the future.`,signInWithEthereumScreen_signedIn_button:"Sign Out"},eeEE={connectWallet:"Ühenda rahakott",disconnect:"Katkesta ühendus",connected:"Ühendatud",wrongNetwork:"Vale võrk",switchNetworks:"Vaheta võrke",chainNetwork:"{{ CHAIN }} Võrk",copyToClipboard:"Kopeeri lõikelauale",copyCode:"Kopeeri koodi",moreInformation:"Rohkem infot",back:"Tagasi",close:"Pane kinni",or:"või",more:"Rohkem",tryAgain:"Proovi uuesti",tryAgainQuestion:"Proovi uuesti?",dontHaveTheApp:"Kas teil pole rakendust?",scanTheQRCode:"Skaneeri QR-kood",useWalletConnectModal:"Kasuta WalletConnecti modalit",useModal:"Kasuta Modalit",installTheExtension:"Installi laiendust",getWalletName:"Hanki {{ CONNECTORNAME }}",otherWallets:"Teised rahakotid",learnMore:"Avasta rohkem",getWallet:"Lae alla rahakott",approveInWallet:"Kiita heaks rahakotis",confirmInWallet:"Kinnita rahakotis",awaitingConfirmation:"Kinnituse ootel",signIn:"Logi sisse",signOut:"Logi välja",signedIn:"Sisse logitud",signedOut:"Välja logitud",walletNotConnected:"Raakott pole ühendatud",warnings_walletSwitchingUnsupported:"Teie rahakott ei toeta võrgu vahetamist sellest rakendusest.",warnings_walletSwitchingUnsupportedResolve:"Proovige võrgu vahetamist teha oma rahakoti seest.",warnings_chainUnsupported:"See rakendus ei toeta praegu ühendatud võrku.",warnings_chainUnsupportedResolve:"Jätkamiseks vahetage või ühendage lahti.",onboardingScreen_heading:"Hankige rahakott",onboardingScreen_h1:"Alustage Web3 uurimist",onboardingScreen_p:"Teie rahakott on värav kõigele, mis puudutab Ethereumit, maagilist tehnoloogiat, mis võimaldab uurida Web3.",onboardingScreen_ctaText:"Valige oma esimene rahakott",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"Rahakottidest",aboutScreen_a_h1:"Teie digitaalsetele varadele",aboutScreen_a_p:"Rahakotid võimaldavad teil saata, vastu võtta, salvestada ja suhelda digitaalsete varadega nagu NFT-d ja teised Ethereumi tokenid.",aboutScreen_b_h1:"Parem viis sisse logimiseks",aboutScreen_b_p:"Kaasaegsete rakendustega saab teie rahakotti kasutada lihtsa sisselogimisviisina, ilma et peaksite meeles pidama parooli.",aboutScreen_c_h1:"Uurige Web3 maailma",aboutScreen_c_p:"Teie rahakott on oluline tööriist, mis võimaldab teil uurida ja osaleda kiiresti arenevas Web3 maailmas.",aboutScreen_ctaText:"Lisateavet saamiseks",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Ühendage rahakott",connectorsScreen_newcomer:"Mul pole rahakotti",connectorsScreen_h1:"Mis on rahakott?",connectorsScreen_p:"Rahakotte kasutatakse digitaalsete varade saatmiseks, vastuvõtmiseks ja salvestamiseks. Rahakoti ühendamine võimaldab teil rakendustega suhelda.",mobileConnectorsScreen_heading:"Valige rahakott",scanScreen_heading:"Skaneerige telefoni abil",scanScreen_heading_withConnector:"Skaneerige koos {{ CONNECTORNAME }}-ga",scanScreen_tooltip_walletConnect:`Ava [WALLETCONNECTLOGO] WalletConnect -toetatud rahakott skaneerimiseks`,scanScreen_tooltip_default:`Ava {{ CONNECTORNAME }} oma -mobiiltelefonil skaneerimiseks`,downloadAppScreen_heading:"Hankige {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Skaneerige oma telefoni kaameraga allalaadimiseks iOS-i või Androidi jaoks.",downloadAppScreen_ios:"Skaneerige oma telefoni kaameraga allalaadimiseks iOS-i jaoks.",downloadAppScreen_android:"Skaneerige oma telefoni kaameraga Androidi allalaadimiseks.",injectionScreen_unavailable_h1:"Toetuseta brauser",injectionScreen_unavailable_p:`Teie {{ CONNECTORSHORTNAME }} rahakoti ühendamiseks -installige laiendus {{ SUGGESTEDEXTENSIONBROWSER }}-le.`,injectionScreen_install_h1:"Installige {{ CONNECTORNAME }}",injectionScreen_install_p:`Teie {{ CONNECTORSHORTNAME }} rahakoti ühendamiseks -installige brauseri laiendus.`,injectionScreen_connecting_h1:"Ühenduse taotlemine",injectionScreen_connecting_p:`Ava {{ CONNECTORSHORTNAME }} brauseri -laiendus rahakoti ühendamiseks.`,injectionScreen_connecting_injected_h1:"Ühenduse taotlemine",injectionScreen_connecting_injected_p:"Nõustuge rakendusega ühendamiseks oma rahakotis.",injectionScreen_connected_h1:"Juba ühendatud",injectionScreen_connected_p:"Selle popup-i saab nüüd sulgeda",injectionScreen_rejected_h1:"Taotlus tühistatud",injectionScreen_rejected_p:`Tühistasite taotluse. -Klõpsake ülal, et uuesti proovida.`,injectionScreen_failed_h1:"Ühenduse loomine ebaõnnestus",injectionScreen_failed_p:`Vabandame, midagi läks valesti. -Proovige ühendust uuesti luua.`,injectionScreen_notconnected_h1:"Logige sisse {{ CONNECTORNAME }}-ga",injectionScreen_notconnected_p:"Jätkamiseks logige sisse oma {{ CONNECTORNAME }} laiendisse.",profileScreen_heading:"Ühendatud",switchNetworkScreen_heading:"Võrkude vahetamine",signInWithEthereumScreen_tooltip:`Te pole selle rakendusse sisse logitud. -**Logi sisse Ethereumiga** jätkamiseks.`,signInWithEthereumScreen_signedOut_heading:"Logi sisse Ethereumiga",signInWithEthereumScreen_signedOut_h1:`See rakendus soovib teid autentida - selle rahakoti omanikuna.`,signInWithEthereumScreen_signedOut_p:`Jätkamiseks allkirjastage sõnumipäring - oma rahakotis.`,signInWithEthereumScreen_signedOut_button:"Logi sisse",signInWithEthereumScreen_signedIn_heading:"Logi välja",signInWithEthereumScreen_signedIn_h1:`Olete edukalt autentinud end - selle rahakoti omanikuna.`,signInWithEthereumScreen_signedIn_p:`Välja logimine nõuab tulevikus - uuesti autentimist.`,signInWithEthereumScreen_signedIn_button:"Logi välja"},esES={connectWallet:"Conecta una cartera",disconnect:"Desconectar",connected:"Conectado",wrongNetwork:"Red incorrecta",switchNetworks:"Cambio de red",chainNetwork:"Red {{ CHAIN }}",copyToClipboard:"Copiar al portapapeles",copyCode:"Copiar código",moreInformation:"Más información",back:"Atrás",close:"Cerrar",or:"o",more:"Más",tryAgain:"Intentar de nuevo",tryAgainQuestion:"¿Intentar de nuevo?",dontHaveTheApp:"¿No tienes la aplicación?",scanTheQRCode:"Escanea el código QR",useWalletConnectModal:"Utilizar WalletConnect Modal",useModal:"Utilizar Modal",installTheExtension:"Instalar la extensión",getWalletName:"Obtén {{ CONNECTORNAME }}",otherWallets:"Otras carteras",learnMore:"Más información",getWallet:"Obtén una cartera",approveInWallet:"Aprobar en la cartera",confirmInWallet:"Confirmar en la cartera",awaitingConfirmation:"A la espera de confirmación",signIn:"Iniciar sesión",signOut:"Cerrar sesión",signedIn:"Sesión iniciada",signedOut:"Sesión cerrada",walletNotConnected:"Cartera no conectada",warnings_walletSwitchingUnsupported:"Tu cartera no permite cambiar de red desde esta aplicación.",warnings_walletSwitchingUnsupportedResolve:"Prueba a cambiar de red desde tu cartera.",warnings_chainUnsupported:"Esta aplicación no es compatible con la red conectada actualmente.",warnings_chainUnsupportedResolve:"Cambia o desconecta para continuar.",onboardingScreen_heading:"Obtén una cartera",onboardingScreen_h1:"Comienza a explorar la Web3",onboardingScreen_p:"Tu cartera es el portal de acceso a todo lo relacionado con Ethereum, la tecnología mágica que permite explorar la Web3.",onboardingScreen_ctaText:"Elige tu primera cartera",onboardingScreen_ctaUrl:"https://ethereum.org/es/wallets/find-wallet/",aboutScreen_heading:"Acerca de las carteras",aboutScreen_a_h1:"Para tus activos digitales",aboutScreen_a_p:"Las carteras te permiten enviar, recibir, almacenar e interactuar con activos digitales como los NFT y otros tokens de Ethereum.",aboutScreen_b_h1:"Una manera mejor de iniciar sesión",aboutScreen_b_p:"Con las aplicaciones modernas, puedes utilizar tu cartera para iniciar sesión fácilmente, en vez de tener que recordar una contraseña.",aboutScreen_c_h1:"Explora el mundo de la Web3",aboutScreen_c_p:"Tu cartera es una herramienta esencial que te permite explorar y participar en el mundo en rápida evolución de la Web3.",aboutScreen_ctaText:"Más información",aboutScreen_ctaUrl:"https://ethereum.org/es/wallets/",connectorsScreen_heading:"Conecta una cartera",connectorsScreen_newcomer:"No tengo una cartera",connectorsScreen_h1:"¿Qué es una cartera?",connectorsScreen_p:"Las carteras se utilizan para enviar, recibir y almacenar activos digitales. Si conectas una cartera, podrás interactuar con las aplicaciones.",mobileConnectorsScreen_heading:"Elige una cartera",scanScreen_heading:"Escanea con el teléfono",scanScreen_heading_withConnector:"Escanea con {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Abre una cartera compatible con WalletConnect [WALLETCONNECTLOGO] para escanear",scanScreen_tooltip_default:"Abre {{ CONNECTORNAME }} en tu teléfono móvil para escanear",downloadAppScreen_heading:"Obtén {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Escanea con la cámara de tu teléfono para descargarla en iOS o Android.",downloadAppScreen_ios:"Escanea con la cámara de tu teléfono para descargarla en iOS.",downloadAppScreen_android:"Escanea con la cámara de tu teléfono para descargarla en Android.",injectionScreen_unavailable_h1:"Navegador no compatible",injectionScreen_unavailable_p:"Para conectar tu cartera de {{ CONNECTORSHORTNAME }}, instala la extensión en {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Instala {{ CONNECTORNAME }}",injectionScreen_install_p:"Para conectar tu cartera de {{ CONNECTORSHORTNAME }}, instala la extensión del navegador.",injectionScreen_connecting_h1:"Solicitud de conexión",injectionScreen_connecting_p:"Abre la extensión del navegador de {{ CONNECTORSHORTNAME }} para conectar tu cartera.",injectionScreen_connecting_injected_h1:"Solicitud de conexión",injectionScreen_connecting_injected_p:"Acepta la solicitud a través de tu cartera para conectarte a esta aplicación.",injectionScreen_connected_h1:"Ya conectada",injectionScreen_connected_p:"Ya puedes cerrar esta ventana emergente",injectionScreen_rejected_h1:"Solicitud cancelada",injectionScreen_rejected_p:"Has cancelado la solicitud. Haz clic arriba para intentarlo de nuevo.",injectionScreen_failed_h1:"Error de conexión",injectionScreen_failed_p:"Lo sentimos, ha habido un problema. Intenta conectarte de nuevo.",injectionScreen_notconnected_h1:"Inicia sesión en {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Para continuar, inicia sesión en tu extensión de {{ CONNECTORNAME }}.",profileScreen_heading:"Conectado",switchNetworkScreen_heading:"Cambio de red",signInWithEthereumScreen_tooltip:`No has iniciado sesión en esta aplicación. -**Inicia sesión con Ethereum** para continuar.`,signInWithEthereumScreen_signedOut_heading:"Inicia sesión con Ethereum",signInWithEthereumScreen_signedOut_h1:"Esta aplicación desea verificar que eres el propietario de esta cartera.",signInWithEthereumScreen_signedOut_p:"Firma la solicitud de mensaje en tu cartera para continuar.",signInWithEthereumScreen_signedOut_button:"Iniciar sesión",signInWithEthereumScreen_signedIn_heading:"Sesión iniciada con Ethereum",signInWithEthereumScreen_signedIn_h1:"Te has verificado correctamente como propietario de esta cartera.",signInWithEthereumScreen_signedIn_p:"Si cierras la sesión, tendrás que volver a autenticarte más adelante.",signInWithEthereumScreen_signedIn_button:"Cerrar sesión"},faIR={connectWallet:"اتصال به کیف پول",disconnect:"قطع ارتباط",connected:"متصل شد",wrongNetwork:"شبکه نادرست",switchNetworks:"تغییر شبکه‌ها",chainNetwork:"{{ CHAIN }} شبکه",copyToClipboard:"کپی به کلیپ‌بورد",copyCode:"کپی کد",moreInformation:"اطلاعات بیشتر",back:"بازگشت",close:"بستن",or:"یا",more:"بیشتر",tryAgain:"تلاش دوباره",tryAgainQuestion:"آیا دوباره تلاش کنیم؟",dontHaveTheApp:"اپلیکیشن را ندارید؟",scanTheQRCode:"اسکن کیو‌آر کد",useWalletConnectModal:"استفاده از مودال والت‌‌کانکت",useModal:"استفاده از مودال",installTheExtension:"نصب افزونه",getWalletName:"دریافت {{ CONNECTORNAME }}",otherWallets:"کیف پول‌های دیگر",learnMore:"بیشتر بدانید",getWallet:"یک کیف پول دریافت کنید",approveInWallet:"در کیف پول تأیید کنید",confirmInWallet:"در کیف پول تأیید کنید",awaitingConfirmation:"در انتظار تأیید",signIn:"ورود",signOut:"خروج",signedIn:"وارد شده",signedOut:"خارج شده",walletNotConnected:"کیف پول متصل نیست",warnings_walletSwitchingUnsupported:"متاسفانه، کیف پول شما از تغییر شبکه در این برنامه پشتیبانی نمی‌کند.",warnings_walletSwitchingUnsupportedResolve:"بهتر است از داخل کیف پول خود تغییر شبکه دهید.",warnings_chainUnsupported:"این برنامه با شبکه‌ای که در حال حاضر متصل است، سازگاری ندارد.",warnings_chainUnsupportedResolve:"برای ادامه، شبکه را تغییر دهید یا اتصال را قطع کنید.",onboardingScreen_heading:"دریافت کیف پول",onboardingScreen_h1:"آغاز کاوش در وب3",onboardingScreen_p:"کیف پول شما دروازه‌ای است به دنیای اتریوم، فناوری جادویی که ممکن می‌سازد تا وب3 را کاوش کنید.",onboardingScreen_ctaText:"کیف پول نخست خود را انتخاب کنید",onboardingScreen_ctaUrl:"https://ethereum.org/fa/wallets/find-wallet/",aboutScreen_heading:"درباره کیف پول‌ها",aboutScreen_a_h1:"نگهبان دارایی‌های دیجیتالی شما",aboutScreen_a_p:"کیف پول‌ها به شما اجازه می‌دهند دارایی‌های دیجیتالی مانند ان‌اف‌تی و توکن‌های اتریومی دیگر را ارسال، دریافت، ذخیره و تعامل دهید.",aboutScreen_b_h1:"یک روش بهتر برای ورود",aboutScreen_b_p:"در برنامه‌های مدرن، کیف پول شما می‌تواند به عنوان یک راه ورود آسان به جای به یادآوری یک رمز عبور مورد استفاده قرار گیرد.",aboutScreen_c_h1:"جهان وب3 را کاوش کنید",aboutScreen_c_p:"کیف پول شما یک ابزار ضروری است که به شما اجازه می‌دهد جهان در حال تغییر سریع وب3 را کاوش و در آن شرکت کنید.",aboutScreen_ctaText:"دانش بیشتری بیافزایید",aboutScreen_ctaUrl:"https://ethereum.org/fa/wallets/",connectorsScreen_heading:"برقراری ارتباط با کیف پول",connectorsScreen_newcomer:"کیف پول ندارم",connectorsScreen_h1:"چیستی رمزگذاری کیف پول؟",connectorsScreen_p:"کیف پول‌ها برای ارسال، دریافت و نگهداری دارایی‌های دیجیتال استفاده می‌شوند. برقراری ارتباط با یک کیف پول به شما امکان تعامل با برنامه‌ها را می‌دهد.",mobileConnectorsScreen_heading:"انتخاب کیف پول",scanScreen_heading:"اسکن با گوشی",scanScreen_heading_withConnector:"اسکن با {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"یک کیف پول با پشتیبانی از والت‌‌کانکت را باز کنید تا اسکن را آغاز کنید",scanScreen_tooltip_default:"{{ CONNECTORNAME }} را روی گوشی خود باز کنید تا اسکن شود",downloadAppScreen_heading:"دریافت {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"از دوربین گوشی خود برای اسکن و دریافت نسخه iOS یا Android استفاده کنید.",downloadAppScreen_ios:"از دوربین گوشی خود برای دریافت نسخه iOS استفاده کنید.",downloadAppScreen_android:"از دوربین گوشی خود برای دریافت نسخه Android استفاده کنید.",injectionScreen_unavailable_h1:"مرورگر پشتیبانی نمی‌شود",injectionScreen_unavailable_p:"برای برقراری ارتباط با کیف پول {{ CONNECTORSHORTNAME }}، افزونه مرورگر را در {{ SUGGESTEDEXTENSIONBROWSER }} نصب کنید.",injectionScreen_install_h1:"نصب {{ CONNECTORNAME }}",injectionScreen_install_p:"برای برقراری ارتباط با کیف پول {{ CONNECTORSHORTNAME }}، افزونه مرورگر را نصب کنید.",injectionScreen_connecting_h1:"درخواست اتصال",injectionScreen_connecting_p:"افزونه مرورگر {{ CONNECTORSHORTNAME }} را باز کنید تا ارتباط با کیف پول ایجاد شود.",injectionScreen_connecting_injected_h1:"درخواست اتصال",injectionScreen_connecting_injected_p:"درخواست را از طریق کیف پول خود بپذیرید تا به این برنامه متصل شوید.",injectionScreen_connected_h1:"اتصال از قبل برقرار است",injectionScreen_connected_p:"اکنون می‌توانید این پنجره‌ی بازشو را ببندید.",injectionScreen_rejected_h1:"درخواست لغو شد",injectionScreen_rejected_p:"شما درخواست را لغو کرده‌اید. برای تلاش مجدد، بالا کلیک کنید.",injectionScreen_failed_h1:"ارتباط ناموفق",injectionScreen_failed_p:"متاسفانه، مشکلی بوجود آمد. لطفاً مجدداً اتصال برقرار کنید.",injectionScreen_notconnected_h1:"با ورود به {{ CONNECTORNAME }} وارد شوید",injectionScreen_notconnected_p:"برای ادامه، لطفاً وارد افزونه {{ CONNECTORNAME }} خود شوید.",profileScreen_heading:"اتصال‌ها",switchNetworkScreen_heading:"تغییر شبکه‌ها",signInWithEthereumScreen_tooltip:`شما در حال حاضر به این برنامه وارد نشده‌اید. -**با اتریوم وارد شوید** تا ادامه دهید.`,signInWithEthereumScreen_signedOut_heading:"با اتریوم وارد شوید",signInWithEthereumScreen_signedOut_h1:`این برنامه می‌خواهد هویت شما - به عنوان صاحب این کیف پول را تأیید کند.`,signInWithEthereumScreen_signedOut_p:"لطفاً درخواست پیام را در کیف پول خود تأیید کنید تا ادامه دهید.",signInWithEthereumScreen_signedOut_button:"با اتریوم وارد شوید",signInWithEthereumScreen_signedIn_heading:"با اتریوم وارد شده‌اید",signInWithEthereumScreen_signedIn_h1:"شما به عنوان صاحب این کیف پول هویت خود را با موفقیت تأیید کرده‌اید.",signInWithEthereumScreen_signedIn_p:"خروج از حساب کاربری شما در آینده نیاز به تأیید دوباره دارد.",signInWithEthereumScreen_signedIn_button:"خروج"},frFR={connectWallet:"Connecter le portefeuille",disconnect:"Déconnecter",connected:"Connecté",wrongNetwork:"Réseau incorrect",switchNetworks:"Changer de réseau",chainNetwork:"Réseau {{ CHAIN }}",copyToClipboard:"Copier dans le presse-papiers",copyCode:"Copier le code",moreInformation:"Plus d’informations",back:"Retour",close:"Fermer",or:"ou",more:"Plus",tryAgain:"Réessayer",tryAgainQuestion:"Réessayer ?",dontHaveTheApp:"Vous n’avez pas l’application ?",scanTheQRCode:"Scannez le code QR",useWalletConnectModal:"Utiliser la modale WalletConnect",useModal:"Utiliser la modale",installTheExtension:"Installer l’extension",getWalletName:"Obtenez {{ CONNECTORNAME }}",otherWallets:"Autres portefeuilles",learnMore:"En savoir plus",getWallet:"Obtenir un portefeuille",approveInWallet:"Approuver dans le portefeuille",confirmInWallet:"Confirmer dans le portefeuille",awaitingConfirmation:"En attente de confirmation",signIn:"Se connecter",signOut:"Se déconnecter",signedIn:"Connecté",signedOut:"Déconnecté",walletNotConnected:"Portefeuille non connecté",warnings_walletSwitchingUnsupported:"Votre portefeuille ne prend pas en charge le changement de réseau à partir de cette application.",warnings_walletSwitchingUnsupportedResolve:"Essayez plutôt de changer de réseau à partir de votre portefeuille.",warnings_chainUnsupported:"Cette application ne prend pas en charge le réseau connecté actuel.",warnings_chainUnsupportedResolve:"Changez ou déconnectez-vous pour continuer.",onboardingScreen_heading:"Obtenez un portefeuille",onboardingScreen_h1:"Commencez à explorer le Web3",onboardingScreen_p:"Votre portefeuille est la porte d'entrée vers tout ce qui concerne l'Ethereum, la technologie magique qui permet d'explorer le Web3.",onboardingScreen_ctaText:"Choisissez votre premier portefeuille",onboardingScreen_ctaUrl:"https://ethereum.org/fr/wallets/find-wallet/",aboutScreen_heading:"À propos des portefeuilles",aboutScreen_a_h1:"Pour vos actifs numériques",aboutScreen_a_p:"Les portefeuilles vous permettent d'envoyer, de recevoir, de stocker et d'interagir avec des actifs numériques tels que des NFT et d'autres jetons Ethereum.",aboutScreen_b_h1:"Une meilleure façon de se connecter",aboutScreen_b_p:"Avec les applications modernes, votre portefeuille peut s'utiliser pour vous connecter facilement, au lieu d'avoir à mémoriser un mot de passe.",aboutScreen_c_h1:"Explorez le monde du Web3",aboutScreen_c_p:"Votre portefeuille est un utilitaire essentiel qui vous permet d'explorer et de participer au monde en évolution rapide du Web3.",aboutScreen_ctaText:"En savoir plus",aboutScreen_ctaUrl:"https://ethereum.org/fr/wallets/",connectorsScreen_heading:"Connectez le portefeuille",connectorsScreen_newcomer:"Je n’ai pas de portefeuille",connectorsScreen_h1:"Qu’est-ce qu’un portefeuille ?",connectorsScreen_p:"Les portefeuilles s'utilisent pour envoyer, recevoir et stocker des actifs numériques. La connexion d'un portefeuille vous permet d'interagir avec les applications.",mobileConnectorsScreen_heading:"Choisissez le portefeuille",scanScreen_heading:"Scannez avec le téléphone",scanScreen_heading_withConnector:"Scannez avec {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Ouvrez un portefeuille pris en charge par WalletConnect [WALLETCONNECTLOGO] pour scanner",scanScreen_tooltip_default:"Ouvrez {{ CONNECTORNAME }} sur votre téléphone mobile pour scanner",downloadAppScreen_heading:"Obtenez {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Scannez avec l'appareil photo de votre téléphone pour le télécharger sur iOS ou Android.",downloadAppScreen_ios:"Scannez avec l'appareil photo de votre téléphone pour le télécharger sur iOS.",downloadAppScreen_android:"Scannez avec l'appareil photo de votre téléphone pour le télécharger sur Android.",injectionScreen_unavailable_h1:"Navigateur non pris en charge",injectionScreen_unavailable_p:"Pour connecter votre portefeuille {{ CONNECTORSHORTNAME }}, installez l’extension sur {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Installez {{ CONNECTORNAME }}",injectionScreen_install_p:"Pour connecter votre portefeuille {{ CONNECTORSHORTNAME }}, installez l’extension de navigateur.",injectionScreen_connecting_h1:"Demande de connexion",injectionScreen_connecting_p:"Ouvrez l’extension de navigateur {{ CONNECTORSHORTNAME }} pour connecter votre portefeuille.",injectionScreen_connecting_injected_h1:"Demande de connexion",injectionScreen_connecting_injected_p:"Acceptez la demande via votre portefeuille pour vous connecter à cette application.",injectionScreen_connected_h1:"Déjà connecté",injectionScreen_connected_p:"Vous pouvez maintenant fermer ce pop-up",injectionScreen_rejected_h1:"Demande annulée",injectionScreen_rejected_p:"Vous avez annulé la demande. Cliquez ci-dessus pour réessayer.",injectionScreen_failed_h1:"Échec de la connexion",injectionScreen_failed_p:"Malheureusement, un problème est survenu. Veuillez réessayer de vous connecter.",injectionScreen_notconnected_h1:"Connectez-vous à {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Pour continuer, veuillez vous connecter à votre extension {{ CONNECTORNAME }} .",profileScreen_heading:"Connecté",switchNetworkScreen_heading:"Changer de réseau",signInWithEthereumScreen_tooltip:`Vous n’êtes pas connecté à cette application. -**Connectez-vous avec Ethereum** pour continuer.`,signInWithEthereumScreen_signedOut_heading:"Connectez-vous avec Ethereum",signInWithEthereumScreen_signedOut_h1:"Cette application souhaite vérifier que vous êtes bien le propriétaire de ce portefeuille.",signInWithEthereumScreen_signedOut_p:"Veuillez signer la demande de message dans votre portefeuille pour continuer.",signInWithEthereumScreen_signedOut_button:"Se connecter",signInWithEthereumScreen_signedIn_heading:"Connecté avec Ethereum",signInWithEthereumScreen_signedIn_h1:"Vous avez réussi à vous identifier en tant que propriétaire de ce portefeuille.",signInWithEthereumScreen_signedIn_p:"La déconnexion vous obligera à vous authentifier à nouveau à l'avenir.",signInWithEthereumScreen_signedIn_button:"Se déconnecter"};var jaJP={connectWallet:"ウォレットの接続",disconnect:"切断",connected:"接続されました",wrongNetwork:"間違ったネットワーク",switchNetworks:"ネットワークの切り替え",chainNetwork:"{{ CHAIN }} ネットワーク",copyToClipboard:"クリップボードにコピー",copyCode:"コードをコピー",moreInformation:"詳細情報",back:"戻る",close:"閉じる",or:"または",more:"その他",tryAgain:"再試行",tryAgainQuestion:"もう一度試しますか?",dontHaveTheApp:"アプリをお持ちではありませんか?",scanTheQRCode:"QR コードをスキャン",useWalletConnectModal:"WalletConnect モーダルを使用",useModal:"モーダルを使用",installTheExtension:"拡張機能をインストール",getWalletName:"{{ CONNECTORNAME }} を取得",otherWallets:"その他のウォレット",learnMore:"詳細情報",getWallet:"ウォレットを入手",approveInWallet:"ウォレットで承認",confirmInWallet:"ウォレットで確認",awaitingConfirmation:"確認を待っています",signIn:"サインイン",signOut:"サインアウト",signedIn:"サインインしました",signedOut:"サインアウトしました",walletNotConnected:"ウォレットが接続されていません",warnings_walletSwitchingUnsupported:"お使いのウォレットは、このアプリからのネットワークの切り替えをサポートしていません。",warnings_walletSwitchingUnsupportedResolve:"代わりにウォレット内からネットワークを切り替えてみてください。",warnings_chainUnsupported:"このアプリは、現在接続されているネットワークをサポートしていません。",warnings_chainUnsupportedResolve:"切り替えるか切断して続行します。",onboardingScreen_heading:"ウォレットを入手",onboardingScreen_h1:"Web3 の探索を開始",onboardingScreen_p:"ウォレットは、web3 の探索を可能にする魔法のテクノロジーであるイーサリアムのすべてへのゲートウェイです。",onboardingScreen_ctaText:"最初のウォレットを選択してください",onboardingScreen_ctaUrl:"https://ethereum.org/ja/wallets/find-wallet/",aboutScreen_heading:"ウォレットについて",aboutScreen_a_h1:"デジタル資産用",aboutScreen_a_p:"ウォレットを使用すると、NFT やその他のイーサリアム トークンなどのデジタル資産を送信、受信、保存、および操作できます。",aboutScreen_b_h1:"より良いログイン方法",aboutScreen_b_p:"最新のアプリでは、パスワードを覚える必要がなく、ウォレットを簡単なログイン方法として使用できます。",aboutScreen_c_h1:"web3 の世界を探索",aboutScreen_c_p:"ウォレットは、急速に進化する web3 の世界を探索し、参加するために不可欠なユーティリティです。",aboutScreen_ctaText:"詳細情報",aboutScreen_ctaUrl:"https://ethereum.org/ja/wallets/",connectorsScreen_heading:"ウォレットの接続",connectorsScreen_newcomer:"ウォレットを持っていません",connectorsScreen_h1:"ウォレットとは何ですか?",connectorsScreen_p:"ウォレットは、デジタル資産の送信、受信、および保存に使用されます。 ウォレットを接続すると、アプリとやり取りできます。",mobileConnectorsScreen_heading:"ウォレットを選択",scanScreen_heading:"電話でスキャンする",scanScreen_heading_withConnector:"{{ CONNECTORNAME }}でスキャンする",scanScreen_tooltip_walletConnect:"[WALLETCONNECTLOGO] WalletConnect 対応の ウォレットを開いてスキャンします",scanScreen_tooltip_default:"携帯電話で {{ CONNECTORNAME }} を 開いてスキャンします",downloadAppScreen_heading:"{{ CONNECTORNAME }} を取得",downloadAppScreen_iosAndroid:"携帯電話のカメラでスキャンして、iOS または Android にダウンロードします。",downloadAppScreen_ios:"携帯電話のカメラでスキャンして、iOS にダウンロードします。",downloadAppScreen_android:"携帯電話のカメラでスキャンして、Android にダウンロードします。",injectionScreen_unavailable_h1:"サポートされていないブラウザ",injectionScreen_unavailable_p:"{{ CONNECTORSHORTNAME }} ウォレットを接続するには、{{ SUGGESTEDEXTENSIONBROWSER }} に拡張機能をインストールします。",injectionScreen_install_h1:"{{ CONNECTORNAME }} をインストール",injectionScreen_install_p:"{{ CONNECTORSHORTNAME }} ウォレットを接続するには、ブラウザ拡張機能をインストールします。",injectionScreen_connecting_h1:"接続を要求",injectionScreen_connecting_p:"{{ CONNECTORSHORTNAME }} ブラウザ拡張機能を 開いて、ウォレットを接続します。",injectionScreen_connecting_injected_h1:"接続を要求",injectionScreen_connecting_injected_p:"このアプリに接続するには、ウォレットを介して要求を受け入れます。",injectionScreen_connected_h1:"すでに接続済み",injectionScreen_connected_p:"このポップアップを閉じてもかまいません",injectionScreen_rejected_h1:"要求がキャンセルされました",injectionScreen_rejected_p:"要求をキャンセルしました。上をクリックしてもう一度お試しください。",injectionScreen_failed_h1:"接続に失敗しました",injectionScreen_failed_p:"申し訳ありませんが、問題が発生しました。もう一度接続してみてください。",injectionScreen_notconnected_h1:"{{ CONNECTORNAME }} にログイン",injectionScreen_notconnected_p:"続行するには、 {{ CONNECTORNAME }} 拡張機能にログインしてください。",profileScreen_heading:"接続されました",switchNetworkScreen_heading:"ネットワークの切り替え",signInWithEthereumScreen_tooltip:`このアプリにサインインしていません。 -続行するには、**イーサリアムでサインイン**してください。`,signInWithEthereumScreen_signedOut_heading:"イーサリアムでサインイン",signInWithEthereumScreen_signedOut_h1:"このアプリは、あなたがこのウォレットの 所有者であることを確認しようとしています。",signInWithEthereumScreen_signedOut_p:"続行するには、ウォレットで メッセージ リクエストに署名してください。",signInWithEthereumScreen_signedOut_button:"サインイン",signInWithEthereumScreen_signedIn_heading:"イーサリアムでサインインしました",signInWithEthereumScreen_signedIn_h1:"このウォレットの所有者であることが 正常に確認されました。",signInWithEthereumScreen_signedIn_p:"サインアウトすると、今後 再度認証する必要があります。",signInWithEthereumScreen_signedIn_button:"サインアウト"};const ptBR={connectWallet:"Conectar carteira",disconnect:"Desconectar",connected:"Conectado",wrongNetwork:"Rede incorreta",switchNetworks:"Alternar rede",chainNetwork:"Rede {{ CHAIN }}",copyToClipboard:"Copiar para a área de transferência",copyCode:"Copiar código",moreInformation:"Mais informações",back:"Voltar",close:"Fechar",or:"ou",more:"Mais",tryAgain:"Tentar novamente",tryAgainQuestion:"Tentar novamente?",dontHaveTheApp:"Não tem o aplicativo?",scanTheQRCode:"Escaneie o código QR",useWalletConnectModal:"Use o modal do WalletConnect",useModal:"Usar modal",installTheExtension:"Instale a extensão",getWalletName:"Obter {{ CONNECTORNAME }}",otherWallets:"Outras carteiras",learnMore:"Saiba mais",getWallet:"Obtenha uma carteira",approveInWallet:"Aprovar na carteira",confirmInWallet:"Confirmar na carteira",awaitingConfirmation:"Aguardando confirmação",signIn:"Entrar",signOut:"Sair",signedIn:"Conectado",signedOut:"Desconectado",walletNotConnected:"Carteira não conectada",warnings_walletSwitchingUnsupported:"A sua carteira não permite a troca de rede a partir deste aplicativo.",warnings_walletSwitchingUnsupportedResolve:"Tente trocar de rede de dentro da sua carteira.",warnings_chainUnsupported:"Este aplicativo não é compatível com a rede conectada.",warnings_chainUnsupportedResolve:"Altere a rede ou desconecte para continuar.",onboardingScreen_heading:"Obtenha uma carteira",onboardingScreen_h1:"Comece a explorar a Web3",onboardingScreen_p:"Sua carteira é a porta de entrada para todas as coisas Ethereum, a tecnologia mágica que torna possível explorar a web3.",onboardingScreen_ctaText:"Escolha sua primeira carteira",onboardingScreen_ctaUrl:"https://ethereum.org/pt-br/wallets/find-wallet/",aboutScreen_heading:"Sobre as carteiras",aboutScreen_a_h1:"Para seus ativos digitais",aboutScreen_a_p:"As carteiras permitem que você envie, receba, armazene e interaja com ativos digitais como NFTs e outros tokens Ethereum.",aboutScreen_b_h1:"Uma maneira melhor de fazer login",aboutScreen_b_p:"Com aplicativos modernos, sua carteira pode ser usada como uma maneira fácil de fazer login, em vez de ter que lembrar uma senha.",aboutScreen_c_h1:"Explore o mundo da Web3",aboutScreen_c_p:"Sua carteira é uma utilidade essencial que permite explorar e participar do mundo em rápida evolução da Web3.",aboutScreen_ctaText:"Saiba mais",aboutScreen_ctaUrl:"https://ethereum.org/pt-br/wallets/",connectorsScreen_heading:"Conectar carteira",connectorsScreen_newcomer:"Eu não tenho uma carteira",connectorsScreen_h1:"O que é uma carteira?",connectorsScreen_p:"As carteiras são usadas para enviar, receber e armazenar ativos digitais. A conexão de uma carteira permite que você interaja com aplicativos.",mobileConnectorsScreen_heading:"Escolha uma carteira",scanScreen_heading:"Escanear com o celular",scanScreen_heading_withConnector:"Escanear com o {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`Abra uma carteira compatível -com o WalletConnect [WALLETCONNECTLOGO] para escanear`,scanScreen_tooltip_default:`Abra o {{ CONNECTORNAME }} no -seu celular para escanear`,downloadAppScreen_heading:"Obter {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Escaneie com a câmera do seu celular para baixar no iOS ou Android.",downloadAppScreen_ios:"Escaneie com a câmera do seu celular para baixar no iOS.",downloadAppScreen_android:"Escaneie com a câmera do seu celular para baixar no Android.",injectionScreen_unavailable_h1:"Navegador não compatível",injectionScreen_unavailable_p:`Para conectar sua carteira {{ CONNECTORSHORTNAME }}, -instale a extensão no {{ SUGGESTEDEXTENSIONBROWSER }}.`,injectionScreen_install_h1:"Instalar {{ CONNECTORNAME }}",injectionScreen_install_p:`Para conectar sua carteira {{ CONNECTORSHORTNAME }}, -instale a extensão do navegador`,injectionScreen_connecting_h1:"Solicitando conexão",injectionScreen_connecting_p:`Abra a extensão do navegador do {{ CONNECTORSHORTNAME }} -para conectar a sua carteira.`,injectionScreen_connecting_injected_h1:"Solicitando conexão",injectionScreen_connecting_injected_p:"Aceite a solicitação por meio de sua carteira para se conectar a este aplicativo.",injectionScreen_connected_h1:"Já conectado",injectionScreen_connected_p:"Agora você já pode fechar esta janela",injectionScreen_rejected_h1:"Solicitação cancelada",injectionScreen_rejected_p:`Você cancelou a solicitação. -Clique acima para tentar novamente.`,injectionScreen_failed_h1:"A conexão falhou",injectionScreen_failed_p:`Desculpe, ocorreu um erro. -Por favor, tente conectar novamente.`,injectionScreen_notconnected_h1:"Faça login no {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Para continuar, faça login na sua extensão do {{ CONNECTORNAME }}.",profileScreen_heading:"Conectado",switchNetworkScreen_heading:"Alternar rede",signInWithEthereumScreen_tooltip:`Você não está conectado a este aplicativo. -**Entre com Ethereum** para continuar.`,signInWithEthereumScreen_signedOut_heading:"Entrar com Ethereum",signInWithEthereumScreen_signedOut_h1:`Este aplicativo gostaria de verificar você - como o proprietário desta carteira.`,signInWithEthereumScreen_signedOut_p:`Por favor, assine o pedido de mensagem - em sua carteira para continuar.`,signInWithEthereumScreen_signedOut_button:"Entrar",signInWithEthereumScreen_signedIn_heading:"Conectado com Ethereum",signInWithEthereumScreen_signedIn_h1:`Você se verificou com sucesso - como o proprietário desta carteira`,signInWithEthereumScreen_signedIn_p:`Se sair, será necessário que você - autentique novamente no futuro.`,signInWithEthereumScreen_signedIn_button:"Sair"},ruRU={connectWallet:"Подключить кошелек",disconnect:"Отключить",connected:"Подключена",wrongNetwork:"Неверная сеть",switchNetworks:"Переключение сети",chainNetwork:"Сеть {{ CHAIN }}",copyToClipboard:"Скопировать в буфер обмена",copyCode:"Скопировать код",moreInformation:"Больше информации",back:"Назад",close:"Закрыть",or:"или",more:"Еще",tryAgain:"Попробовать снова",tryAgainQuestion:"Попробовать снова?",dontHaveTheApp:"У вас нет приложения?",scanTheQRCode:"Отсканируйте QR-код",useWalletConnectModal:"Использовать окно WalletConnect",useModal:"Использовать модальное окно",installTheExtension:"Установить расширение",getWalletName:"Скачать {{ CONNECTORNAME }}",otherWallets:"Другие кошельки",learnMore:"Узнать больше",getWallet:"Завести кошелек",approveInWallet:"Подтвердите",confirmInWallet:"Подтвердите",awaitingConfirmation:"Ожидаем подтверждение",signIn:"Войти",signOut:"Выйти",signedIn:"Вошли",signedOut:"Вышли",walletNotConnected:"Кошелек не подключен",warnings_walletSwitchingUnsupported:"Ваш кошелек не поддерживает переключение сетей из этого приложения.",warnings_walletSwitchingUnsupportedResolve:"Попробуйте переключиться на другую сеть прямо в вашем кошельке.",warnings_chainUnsupported:"Это приложение не поддерживает текущую подключенную сеть.",warnings_chainUnsupportedResolve:"Для продолжения переключите сеть или отключите кошелек.",onboardingScreen_heading:"Завести кошелек",onboardingScreen_h1:"Начните исследовать веб3",onboardingScreen_p:"Ваш кошелек — это врата в мир Ethereum, волшебной технологии, которая позволяет исследовать веб3.",onboardingScreen_ctaText:"Выбрать свой первый кошелек",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"О кошельках",aboutScreen_a_h1:"Для ваших цифровых активов",aboutScreen_a_p:"Кошельки позволяют вам отправлять, получать, хранить и взаимодействовать с цифровыми активами, такими как NFT и другие токены Ethereum.",aboutScreen_b_h1:"Лучший способ входа",aboutScreen_b_p:"В современных приложениях ваш кошелек можно использовать как удобный способ входа без необходимости помнить пароль.",aboutScreen_c_h1:"Исследуйте мир веб3",aboutScreen_c_p:"Ваш кошелек - это неотъемлемый инструмент, который позволяет вам исследовать и участвовать в быстро развивающемся мире веб3.",aboutScreen_ctaText:"Узнать больше",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Подключение кошелька",connectorsScreen_newcomer:"У меня нет кошелька",connectorsScreen_h1:"Что такое кошелек?",connectorsScreen_p:"Кошельки используются для отправки, получения и хранения цифровых активов. Подключение кошелька позволяет вам взаимодействовать с приложениями.",mobileConnectorsScreen_heading:"Выберите кошелек",scanScreen_heading:"Сканирование с телефона",scanScreen_heading_withConnector:"Сканирование с помощью {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Откройте [WALLETCONNECTLOGO] поддерживаемый WalletConnect кошелек для сканирования",scanScreen_tooltip_default:"Откройте {{ CONNECTORNAME }} на вашем мобильном телефоне для сканирования",downloadAppScreen_heading:"Скачивание {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Отсканируйте камерой телефона для загрузки приложения на iOS или Android.",downloadAppScreen_ios:"Отсканируйте камерой телефона для загрузки приложения на iOS.",downloadAppScreen_android:"Сканируйте камерой телефона для загрузки приложения на Android.",injectionScreen_unavailable_h1:"Неподдерживаемый браузер",injectionScreen_unavailable_p:"Для подключения вашего кошелька {{ CONNECTORSHORTNAME }}, установите расширение для браузера {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Установите {{ CONNECTORNAME }}",injectionScreen_install_p:"Для подключения вашего кошелька {{ CONNECTORSHORTNAME }}, установите расширение для браузера.",injectionScreen_connecting_h1:"Запрос на подключение",injectionScreen_connecting_p:"Откройте расширение для браузера {{ CONNECTORSHORTNAME }} для подключения вашего кошелька.",injectionScreen_connecting_injected_h1:"Запрос на подключение",injectionScreen_connecting_injected_p:"Примите запрос в вашем кошельке, чтобы подключиться к приложению.",injectionScreen_connected_h1:"Уже подключен",injectionScreen_connected_p:"Можно закрыть это окно",injectionScreen_rejected_h1:"Запрос отменен",injectionScreen_rejected_p:`Вы отменили запрос. -Нажмите выше, чтобы попробовать снова.`,injectionScreen_failed_h1:"Сбой подключения",injectionScreen_failed_p:`Извините, что-то пошло не так. -Пожалуйста, попробуйте подключиться снова.`,injectionScreen_notconnected_h1:"Войдите в {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Для продолжения войдите в расширение {{ CONNECTORNAME }}.",profileScreen_heading:"Кошелек подключен",switchNetworkScreen_heading:"Переключение сетей",signInWithEthereumScreen_tooltip:`Вы не вошли в это приложение. -**Войдите с помощью Ethereum**, чтобы продолжить.`,signInWithEthereumScreen_signedOut_heading:"Войти с помощью Ethereum",signInWithEthereumScreen_signedOut_h1:`Это приложение хочет подтвердить вас - в качестве владельца этого кошелька.`,signInWithEthereumScreen_signedOut_p:`Пожалуйста, подпишите запрос на сообщение - в своем кошельке, чтобы продолжить.`,signInWithEthereumScreen_signedOut_button:"Войти",signInWithEthereumScreen_signedIn_heading:"Вошли с помощью Ethereum",signInWithEthereumScreen_signedIn_h1:`Вы успешно подтвердили себя - в качестве владельца этого кошелька.`,signInWithEthereumScreen_signedIn_p:`Выйти потребуется - повторная аутентификация в будущем.`,signInWithEthereumScreen_signedIn_button:"Выйти"},zhCN={connectWallet:"绑定钱包",disconnect:"解除绑定",connected:"已绑定",wrongNetwork:"错误网络",switchNetworks:"切换网络",chainNetwork:"{{ CHAIN }}网络",copyToClipboard:"复制到剪贴板",copyCode:"复制代码",moreInformation:"更多信息",back:"返回",close:"关闭",or:"或",more:"更多",tryAgain:"重试",tryAgainQuestion:"重试?",dontHaveTheApp:"没有该应用?",scanTheQRCode:"扫描二维码",useWalletConnectModal:"使用 WalletConnect 模态窗",useModal:"使用模态窗",installTheExtension:"安装扩展程序",getWalletName:"获取{{ CONNECTORNAME }}",otherWallets:"其他钱包",learnMore:"了解更多",getWallet:"获取钱包",approveInWallet:"在钱包中批准",confirmInWallet:"在钱包中确认",awaitingConfirmation:"等待确认",signIn:"登录",signOut:"登出",signedIn:"已登录",signedOut:"已登出",walletNotConnected:"钱包未绑定",warnings_walletSwitchingUnsupported:"您的钱包不支持从此应用切换网络。",warnings_walletSwitchingUnsupportedResolve:"请尝试从钱包中切换网络。",warnings_chainUnsupported:"此应用不支持当前连接的网络。",warnings_chainUnsupportedResolve:"请切换网络或断开连接以继续。",onboardingScreen_heading:"获取钱包",onboardingScreen_h1:"开始探索 Web3",onboardingScreen_p:"您的钱包是通往以太坊的一扇大门,而以太坊是探索 Web3 的一项神奇技术。",onboardingScreen_ctaText:"选择您的第一钱包",onboardingScreen_ctaUrl:"https://ethereum.org/zh/wallets/find-wallet/",aboutScreen_heading:"关于钱包",aboutScreen_a_h1:"对于您的数字资产",aboutScreen_a_p:"有了钱包,您可以发送、接收、存储数字资产及使用数字资产进行交互,例如 NFT 和其他以太坊通证等。",aboutScreen_b_h1:"更好的登录方式",aboutScreen_b_p:"使用现代应用,您的钱包可以用作简便的登录方法,而不必记住密码。",aboutScreen_c_h1:"探索 Web3 世界",aboutScreen_c_p:"您的钱包是一个重要的工具,可以让您探索并参与到快速发展的 Web3 世界。",aboutScreen_ctaText:"了解更多",aboutScreen_ctaUrl:"https://ethereum.org/zh/wallets/",connectorsScreen_heading:"绑定钱包",connectorsScreen_newcomer:"我没有钱包",connectorsScreen_h1:"什么是钱包?",connectorsScreen_p:"钱包可用于发送、接收和存储数字资产。通过绑定钱包,您可以与应用进行交互。",mobileConnectorsScreen_heading:"选择钱包",scanScreen_heading:"手机扫描",scanScreen_heading_withConnector:"手机扫描{{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"打开 [WALLETCONNECTLOGO] WalletConnect 支持的钱包进行扫描",scanScreen_tooltip_default:"打开您手机上的{{ CONNECTORNAME }} 进行扫描",downloadAppScreen_heading:"获取{{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"使用手机相机扫描以下载 iOS 或 Android 应用。",downloadAppScreen_ios:"使用手机相机扫描以下载 iOS 应用。",downloadAppScreen_android:"使用手机相机扫描以下载 Android 应用。",injectionScreen_unavailable_h1:"不支持的浏览器",injectionScreen_unavailable_p:"要绑定您的{{ CONNECTORSHORTNAME }}钱包,请在{{ SUGGESTEDEXTENSIONBROWSER }}上安装此扩展程序。",injectionScreen_install_h1:"安装{{ CONNECTORNAME }}",injectionScreen_install_p:"要绑定您的{{ CONNECTORSHORTNAME }}钱包,请安装此浏览器扩展程序。",injectionScreen_connecting_h1:"请求绑定",injectionScreen_connecting_p:"打开{{ CONNECTORSHORTNAME }}浏览器 扩展程序以绑定您的钱包。",injectionScreen_connecting_injected_h1:"请求绑定",injectionScreen_connecting_injected_p:"通过您的钱包接受请求,以绑定到此应用。",injectionScreen_connected_h1:"已绑定",injectionScreen_connected_p:"现在可以关闭此弹窗",injectionScreen_rejected_h1:"请求已取消",injectionScreen_rejected_p:"您已取消请求。点击上面可重试。",injectionScreen_failed_h1:"绑定失败",injectionScreen_failed_p:"抱歉,发生错误。请尝试重新绑定。",injectionScreen_notconnected_h1:"登录{{ CONNECTORNAME }}",injectionScreen_notconnected_p:"要继续,请登录到您的{{ CONNECTORNAME }}扩展程序。",profileScreen_heading:"已绑定",switchNetworkScreen_heading:"切换网络",signInWithEthereumScreen_tooltip:`您尚未登录到此应用。 -请选择**使用以太坊登录**以继续。`,signInWithEthereumScreen_signedOut_heading:"使用以太坊登录",signInWithEthereumScreen_signedOut_h1:"此应用希望验证您是 此钱包的所有者。",signInWithEthereumScreen_signedOut_p:"请签署钱包中的消息请求 以继续。",signInWithEthereumScreen_signedOut_button:"登录",signInWithEthereumScreen_signedIn_heading:"已使用以太坊登录",signInWithEthereumScreen_signedIn_h1:"您已成功验证自己 是此钱包的所有者。",signInWithEthereumScreen_signedIn_p:"登出后,将来您还需要 再次进行身份验证。",signInWithEthereumScreen_signedIn_button:"登出"},caAD={connectWallet:"Connecta la cartera",disconnect:"Desconnectar",connected:"Connectat",wrongNetwork:"Xarxa incorrecta",switchNetworks:"Canvi de xarxa",chainNetwork:"Xarxa {{ CHAIN }}",copyToClipboard:"Copia al portapapers",copyCode:"Copia codi",moreInformation:"Més informació",back:"Enrere",close:"Tanca",or:"o",more:"Més",tryAgain:"Torna-ho a intentar",tryAgainQuestion:"Tornar a intentar-ho?",dontHaveTheApp:"No tens l'aplicació?",scanTheQRCode:"Escaneja el codi QR",useWalletConnectModal:"Utilitza WalletConnect Modal",useModal:"Utilitza Modal",installTheExtension:"Instal·la l'extensió",getWalletName:"Obté {{ CONNECTORNAME }}",otherWallets:"Altres carteres",learnMore:"Més informació",getWallet:"Obté una cartera",approveInWallet:"Aprova a la cartera",confirmInWallet:"Confirma a la cartera",awaitingConfirmation:"Esperant confirmació",signIn:"Inicia sessió",signOut:"Tanca sessió",signedIn:"Sessió iniciada",signedOut:"Sessió tancada",walletNotConnected:"Cartera no connectada",warnings_walletSwitchingUnsupported:"La teva cartera no permet canviar de xarxa des d'aquesta aplicació.",warnings_walletSwitchingUnsupportedResolve:"Prova a canviar de xarxa des de la teva cartera.",warnings_chainUnsupported:"Aquesta aplicació no és compatible amb la xarxa connectada actualment.",warnings_chainUnsupportedResolve:"Canvia o desconnecta per continuar.",onboardingScreen_heading:"Obté una cartera",onboardingScreen_h1:"Comença a explorar la Web3",onboardingScreen_p:"La teva cartera és el portal d'accés a tot el relacionat amb Ethereum, la tecnologia màgica que permet explorar la Web3.",onboardingScreen_ctaText:"Tria la teva primera cartera",onboardingScreen_ctaUrl:"https://ethereum.org/es/wallets/find-wallet/",aboutScreen_heading:"Sobre les carteres",aboutScreen_a_h1:"Per als teus actius digitals",aboutScreen_a_p:"Les carteres et permeten enviar, rebre, emmagatzemar i interactuar amb actius digitals com els NFT i altres tokens d'Ethereum.",aboutScreen_b_h1:"Una manera millor d'iniciar sessió",aboutScreen_b_p:"Amb les aplicacions modernes, pots utilitzar la teva cartera per iniciar sessió fàcilment, en lloc de haver de recordar una contrasenya.",aboutScreen_c_h1:"Explora el món de la Web3",aboutScreen_c_p:"La teva cartera és una eina essencial que et permet explorar i participar en el món en ràpida evolució de la Web3.",aboutScreen_ctaText:"Més informació",aboutScreen_ctaUrl:"https://ethereum.org/es/wallets/",connectorsScreen_heading:"Connecta una cartera",connectorsScreen_newcomer:"No tinc una cartera",connectorsScreen_h1:"Què és una cartera?",connectorsScreen_p:"Les carteres s'utilitzen per enviar, rebre i emmagatzemar actius digitals. Si connectes una cartera, podràs interactuar amb les aplicacions.",mobileConnectorsScreen_heading:"Tria una cartera",scanScreen_heading:"Escaneja amb el telèfon",scanScreen_heading_withConnector:"Escaneja amb {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:"Obre una cartera compatible amb WalletConnect [WALLETCONNECTLOGO] per escanejar",scanScreen_tooltip_default:"Obre {{ CONNECTORNAME }} en el teu telèfon mòbil per escanejar",downloadAppScreen_heading:"Obté {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Escaneja amb la càmera del teu telèfon per descarregar-la en iOS o Android.",downloadAppScreen_ios:"Escaneja amb la càmera del teu telèfon per descarregar-la en iOS.",downloadAppScreen_android:"Escaneja amb la càmera del teu telèfon per descarregar-la en Android.",injectionScreen_unavailable_h1:"Navegador no compatible",injectionScreen_unavailable_p:"Per connectar la teva cartera de {{ CONNECTORSHORTNAME }}, instal·la l'extensió en {{ SUGGESTEDEXTENSIONBROWSER }}.",injectionScreen_install_h1:"Instal·la {{ CONNECTORNAME }}",injectionScreen_install_p:"Per connectar la teva cartera de {{ CONNECTORSHORTNAME }}, instal·la l'extensió del navegador.",injectionScreen_connecting_h1:"Sol·licitud de connexió",injectionScreen_connecting_p:"Obre l'extensió del navegador de {{ CONNECTORSHORTNAME }} per connectar la teva cartera.",injectionScreen_connecting_injected_h1:"Sol·licitud de connexió",injectionScreen_connecting_injected_p:"Accepta la sol·licitud a través de la teva cartera per connectar-te a aquesta aplicació.",injectionScreen_connected_h1:"Ja connectada",injectionScreen_connected_p:"Ja pots tancar aquesta finestra emergent",injectionScreen_rejected_h1:"Sol·licitud cancel·lada",injectionScreen_rejected_p:"Has cancel·lat la sol·licitud. Fes clic a dalt per tornar-ho a intentar.",injectionScreen_failed_h1:"Error de connexió",injectionScreen_failed_p:"Ho sentim, hi ha hagut un problema. Intenta connectar-te de nou.",injectionScreen_notconnected_h1:"Inicia sessió en {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Per continuar, inicia sessió en la teva extensió de {{ CONNECTORNAME }}.",profileScreen_heading:"Connectat",switchNetworkScreen_heading:"Canvi de xarxa",signInWithEthereumScreen_tooltip:`No has iniciat sessió en aquesta aplicació. -**Inicia sessió amb Ethereum** per continuar.`,signInWithEthereumScreen_signedOut_heading:"Inicia sessió amb Ethereum",signInWithEthereumScreen_signedOut_h1:"Aquesta aplicació vol verificar que ets el propietari d'aquesta cartera.",signInWithEthereumScreen_signedOut_p:"Signa la sol·licitud de missatge en la teva cartera per continuar.",signInWithEthereumScreen_signedOut_button:"Inicia sessió",signInWithEthereumScreen_signedIn_heading:"Sessió iniciada amb Ethereum",signInWithEthereumScreen_signedIn_h1:"T'has verificat correctament com a propietari d'aquesta cartera.",signInWithEthereumScreen_signedIn_p:"Si tanques la sessió, hauràs de tornar a autenticar-te més endavant.",signInWithEthereumScreen_signedIn_button:"Tanca sessió"},trTR={connectWallet:"Cüzdan Bağla",disconnect:"Bağlantıyı Kes",connected:"Bağlandı",wrongNetwork:"Yanlış Ağ",switchNetworks:"Ağ Değiştir",chainNetwork:"{{ CHAIN }} Ağı",copyToClipboard:"Panoya Kopyala",copyCode:"Kodu Kopyala",moreInformation:"Daha Fazla Bilgi",back:"Geri",close:"Kapat",or:"veya",more:"Daha Fazla",tryAgain:"Tekrar Dene",tryAgainQuestion:"Tekrar Dene?",dontHaveTheApp:"Uygulaman yok mu?",scanTheQRCode:"Karekodu tarat",useWalletConnectModal:"WalletConnect Modalini Kullan ",useModal:"Modal Kullan",installTheExtension:"Eklentiyi İndir",getWalletName:"{{ CONNECTORNAME }} Alın",otherWallets:"Diğer Cüzdanlar",learnMore:"Daha Fazlasını Öğren",getWallet:"Cüzdan Al",approveInWallet:"Cüzdanda Yetki Ver",confirmInWallet:"Cüzdanda Onayla",awaitingConfirmation:"Doğrulama Bekleniyor",signIn:"Giriş Yap",signOut:"Çıkış Yap",signedIn:"Giriş Yapıldı",signedOut:"Çıkış Yapıldı",walletNotConnected:"Cüzdan Bağlı Değil",warnings_walletSwitchingUnsupported:"Bu uygulamada ağ değiştirmeyi cüzdanın desteklemiyor.",warnings_walletSwitchingUnsupportedResolve:"Bunun yerine cüzdanınızdan ağları değiştirmeyi deneyin.",warnings_chainUnsupported:"Bu uygulama kullanmış olduğunuz ağı desteklemiyor.",warnings_chainUnsupportedResolve:"Devam etmek için ağ değiştir veya bağlantıyı kes.",onboardingScreen_heading:"Cüzdan Al",onboardingScreen_h1:"Web3'ü keşfetmeye başla",onboardingScreen_p:"Cüzdanınız, Web3'ü keşfetmeyi mümkün kılan sihirli teknoloji olan Ethereum'a açılan kapıdır.",onboardingScreen_ctaText:"İlk Cüzdanını Seç",onboardingScreen_ctaUrl:"https://ethereum.org/tr/wallets/find-wallet/",aboutScreen_heading:"Cüzdanlar Hakkında",aboutScreen_a_h1:"Dijital varlıkların için",aboutScreen_a_p:"Cüzdanlar, NFT'ler ve diğer Ethereum varlıkları gibi dijital varlıklar göndermenize, almanıza, saklamanıza ve bunlarla etkileşim kurmanıza olanak tanır.",aboutScreen_b_h1:"Giriş yapmanın daha iyi bir yolu",aboutScreen_b_p:"Modern uygulamalar ile parola hatırlamak yerine cüzdanınız ile kolayca giriş yapabilirsiniz.",aboutScreen_c_h1:"Web3 dünyasını keşfet",aboutScreen_c_p:"Cüzdanınız, hızla gelişen Web3 dünyasını keşfetmenizi ve bu dünyaya katılmanızı sağlayan temel bir yardımcı programdır.",aboutScreen_ctaText:"Daha Fazlasını Öğren",aboutScreen_ctaUrl:"https://ethereum.org/tr/wallets/",connectorsScreen_heading:"Cüzdan Bağla",connectorsScreen_newcomer:"Cüzdanım Yok",connectorsScreen_h1:"Cüzdan nedir?",connectorsScreen_p:"Cüzdanlar, dijital varlıkları göndermek, almak ve depolamak için kullanılır. Bir cüzdanı bağlamak, uygulamalarla etkileşime geçmenizi sağlar.",mobileConnectorsScreen_heading:"Cüzdan Seç",scanScreen_heading:"Telefon ile Tarat",scanScreen_heading_withConnector:"{{ CONNECTORNAME }} ile tarat",scanScreen_tooltip_walletConnect:`Desteklenen bir cüzdan taramak için - [WALLETCONNECTLOGO] WalletConnect uygulamasını aç`,scanScreen_tooltip_default:`Taramak için telefonunda - {{ CONNECTORNAME }} uygulamasını aç`,downloadAppScreen_heading:"{{ CONNECTORNAME }} İndir",downloadAppScreen_iosAndroid:"iOS ve Android'e indirmek için telefon kameran ile tarat.",downloadAppScreen_ios:"iOS'a indirmek için telefon kameran ile tarat.",downloadAppScreen_android:"Android'e indirmek için telefon kameran ile tarat.",injectionScreen_unavailable_h1:"Desteklenmeyen Tarayıcı",injectionScreen_unavailable_p:`{{ CONNECTORSHORTNAME }} cüzdanına bağlanmak için -{{ SUGGESTEDEXTENSIONBROWSER }} üzerinde indirmen gerekiyor.`,injectionScreen_install_h1:"{{ CONNECTORNAME }} İndir",injectionScreen_install_p:`{{ CONNECTORSHORTNAME }} cüzdanına bağlanmak için, -tarayıcı eklentisini indir.`,injectionScreen_connecting_h1:"Bağlantı İsteniyor.",injectionScreen_connecting_p:`Cüzdanını bağlamak için - tarayıcıdan {{ CONNECTORSHORTNAME }} uzantısını açın.`,injectionScreen_connecting_injected_h1:"Bağlantı İsteniyor.",injectionScreen_connecting_injected_p:"Bu uygulamaya bağlanmak için cüzdanına gelen isteği kabul et.",injectionScreen_connected_h1:"Zaten Bağlanmış",injectionScreen_connected_p:"Bu açılır pencereyi artık kapatabilirsin",injectionScreen_rejected_h1:"İstek iptal edildi.",injectionScreen_rejected_p:`İsteği iptal ettin. -Tekrar denemek için yukarıyı tıklayın.`,injectionScreen_failed_h1:"Bağlantı Başarısız",injectionScreen_failed_p:`Üzgünüz, bir şeyler ters gitti. -Lütfen daha sonra tekrar deneyin.`,injectionScreen_notconnected_h1:"{{ CONNECTORNAME }} ile giriş yap",injectionScreen_notconnected_p:"Devam etmek için, {{ CONNECTORNAME }} eklentisine giriş yapın.",profileScreen_heading:"Bağlandı",switchNetworkScreen_heading:"Ağ Değiştir",signInWithEthereumScreen_tooltip:`Bu uygulamada oturum açmadınız. - Devam etmek için **Ethereum İle Giriş Yap**.`,signInWithEthereumScreen_signedOut_heading:"Ethereum İle Giriş Yap",signInWithEthereumScreen_signedOut_h1:`Bu uygulama seni - bu cüzdanın sahibi olarak doğrulamak istiyor.`,signInWithEthereumScreen_signedOut_p:`Devam etmek için - cüzdanınızdaki isteği onaylayın.`,signInWithEthereumScreen_signedOut_button:"Giriş Yap",signInWithEthereumScreen_signedIn_heading:"Ethereum İle Giriş Yapıldı",signInWithEthereumScreen_signedIn_h1:`Bu cüzdanın sahibi olduğunu - başarıyla onayladın.`,signInWithEthereumScreen_signedIn_p:`Çıkış yaparsan ileride - tekrar giriş yapman gerekecek. `,signInWithEthereumScreen_signedIn_button:"Çıkış Yap"},viVN={connectWallet:"Kết nối ví",disconnect:"Ngắt kết nối",connected:"Đã kết nối",wrongNetwork:"Mạng không hỗ trợ",switchNetworks:"Đổi mạng",chainNetwork:"Mạng {{ CHAIN }}",copyToClipboard:"Sao chép",copyCode:"Sao chép mã",moreInformation:"Thêm thông tin",back:"Quay lại",close:"Đóng",or:"hoặc",more:"Thêm",tryAgain:"Thử lại",tryAgainQuestion:"Thử lại?",dontHaveTheApp:"Không có app?",scanTheQRCode:"Quét mã QR",useWalletConnectModal:"Dùng WalletConnect Modal",useModal:"Dùng Modal",installTheExtension:"Cài tiện ích",getWalletName:"Lấy {{ CONNECTORNAME }}",otherWallets:"Các ví khác",learnMore:"Xem thêm",getWallet:"Tạo một ví",approveInWallet:"Cấp quyền trong ví",confirmInWallet:"Xác nhận trong ví",awaitingConfirmation:"Đang chờ xác nhận",signIn:"Đăng nhập",signOut:"Đăng xuất",signedIn:"Đã đăng nhập",signedOut:"Đã đăng xuất",walletNotConnected:"Chưa kết nối ví",warnings_walletSwitchingUnsupported:"Ví của bạn không hỗ trợ đổi mạng từ ứng dụng.",warnings_walletSwitchingUnsupportedResolve:"Hãy thử đổi mạng từ phía ví của bạn.",warnings_chainUnsupported:"Ứng dụng này không hỗ trợ mạng hiện tại.",warnings_chainUnsupportedResolve:"Đổi hoặc ngắt kết nối để tiếp tục.",onboardingScreen_heading:"Tạo một ví",onboardingScreen_h1:"Bắt đầu khám khá Web3",onboardingScreen_p:"Ví của bạn là cổng giao tiếp mọi thứ trên Ethereum, công nghệ tuyệt vời giúp khám phá Web3.",onboardingScreen_ctaText:"Chọn ví đầu tiên của bạn",onboardingScreen_ctaUrl:"https://ethereum.org/en/wallets/find-wallet/",aboutScreen_heading:"Giới thiệu các ví",aboutScreen_a_h1:"Cho tài sản số của bạn",aboutScreen_a_p:"Các ví để bạn gửi, nhận, lưu trữ, và tương tác với các tài sản điện tử như NFTs và các loại tiền Ethereum khác.",aboutScreen_b_h1:"Một cách tốt hơn để đăng nhập",aboutScreen_b_p:"Với các ứng dụng hiện đại, ví của bạn có thể dùng để đăng nhập dễ dàng thay vì phải nhớ tài khoản và mật khẩu.",aboutScreen_c_h1:"Khám phá thế giới Web3",aboutScreen_c_p:"Ví của bạn là một tiện ích thiết yếu cho phép bạn khám phá và tham gia vào thế giới web3 đang phát triển nhanh chóng.",aboutScreen_ctaText:"Tìm hiểu thêm",aboutScreen_ctaUrl:"https://ethereum.org/en/wallets/",connectorsScreen_heading:"Kết nối Ví",connectorsScreen_newcomer:"Tôi chưa có ví",connectorsScreen_h1:"Ví là gì?",connectorsScreen_p:"Ví dùng để gửi, nhận, và lưu trữ các tài sản điện tử. Kết nối với một ví giúp bạn tương tác với các ứng dụng.",mobileConnectorsScreen_heading:"Chọn ví",scanScreen_heading:"Scan bằng điện thoại",scanScreen_heading_withConnector:"Quét với {{ CONNECTORNAME }}",scanScreen_tooltip_walletConnect:`Mở một [WALLETCONNECTLOGO] mà WalletConnect - hỗ trợ để quét`,scanScreen_tooltip_default:`Mở {{ CONNECTORNAME }} trong -điện thoại của bạn để quét`,downloadAppScreen_heading:"Lấy {{ CONNECTORNAME }}",downloadAppScreen_iosAndroid:"Quét bằng camera trên điện thoại của bạn để tải về cho iOS hoặc Android.",downloadAppScreen_ios:"Quét bằng camera trên điện thoại ủa bạn để tải về cho iOS.",downloadAppScreen_android:"Quét bằng camera trên điện thoại ủa bạn để tải về cho Android.",injectionScreen_unavailable_h1:"Trình duyệt không được hỗ trợ",injectionScreen_unavailable_p:`Để kết nối ví {{ CONNECTORSHORTNAME }} của bạn, -cài đặt tiện ích trên {{ SUGGESTEDEXTENSIONBROWSER }}.`,injectionScreen_install_h1:"Cài {{ CONNECTORNAME }}",injectionScreen_install_p:`Để kết nối ví {{ CONNECTORSHORTNAME }}, -cài đặt tiện ích trên trình duyệt.`,injectionScreen_connecting_h1:"Đang yêu cầu kết nối",injectionScreen_connecting_p:`Mở tiện ích {{ CONNECTORSHORTNAME }} - trên trình duyệt để kết nối.`,injectionScreen_connecting_injected_h1:"Đang yêu cầu kết nối",injectionScreen_connecting_injected_p:"Đồng ý yêu cầu từ phía ví của bạn để kết nối ứng dụng này.",injectionScreen_connected_h1:"Đã kết nối",injectionScreen_connected_p:"Đã có thể đóng popup",injectionScreen_rejected_h1:"Đã hủy yêu cầu",injectionScreen_rejected_p:`Bạn vừa hủy yêu cầu. -Nhấn phía trên để thử lại.`,injectionScreen_failed_h1:"Kết nối không thành công",injectionScreen_failed_p:`Xin lỗi, có gì đó không đúng. -Vui lòng thử lại.`,injectionScreen_notconnected_h1:"Đăng nhập vào {{ CONNECTORNAME }}",injectionScreen_notconnected_p:"Để tiếp tục, vui lòng đăng nhập bằng tiện ích {{ CONNECTORNAME }}.",profileScreen_heading:"Đã kết nối",switchNetworkScreen_heading:"Đổi mạng",signInWithEthereumScreen_tooltip:`Bạn chưa đăng nhập vào ứng dụng. -**Đăng nhập qua Ethereum** để tiếp tục.`,signInWithEthereumScreen_signedOut_heading:"Đăng nhập qua Ethereum",signInWithEthereumScreen_signedOut_h1:`Ứng dụng này muốn xác nhận bạn - là chủ sở hữu của ví.`,signInWithEthereumScreen_signedOut_p:`Vui lòng ký tin nhắn yêu cầu - trên ví của bạn để tiếp tục.`,signInWithEthereumScreen_signedOut_button:"Đăng nhập",signInWithEthereumScreen_signedIn_heading:"Đăng nhập qua Ethereum",signInWithEthereumScreen_signedIn_h1:"Bạn đã xác nhận thành công.",signInWithEthereumScreen_signedIn_p:`Sau khi Đăng xuất bạn sẽ cần - xác nhận lại trong làn tiếp theo.`,signInWithEthereumScreen_signedIn_button:"Đăng xuất"},getLocale=et=>{switch(et){case"ee-EE":return eeEE;case"ar-AE":return arAE;case"es-ES":return esES;case"fa-IR":return faIR;case"fr-FR":return frFR;case"ja-JP":return jaJP;case"pt-BR":return ptBR;case"ru-RU":return ruRU;case"zh-CN":return zhCN;case"ca-AD":return caAD;case"tr-TR":return trTR;case"vi-VN":return viVN;default:return enUS}};function useLocales(et){var o,tt;const nt=(tt=(o=useContext().options)===null||o===void 0?void 0:o.language)!==null&&tt!==void 0?tt:"en-US",ot=reactExports.useMemo(()=>getLocale(nt),[nt]);if(!ot)return console.error(`Missing translations for: ${nt}`),`Missing translations for: ${nt}`;const it={};return Object.keys(ot).map(st=>{const at=ot[st];return it[st]=localize(at,et)}),it}const localize=(et,o)=>{let tt=et;return o&&Object.keys(o).forEach(rt=>{tt=tt.replace(new RegExp(`({{ ${rt} }})`,"g"),o[rt])}),replaceMarkdown(tt)},replaceMarkdown=et=>{let o=et;return o=o.split(` -`),o=o.map((tt,rt)=>jsxRuntimeExports.jsxs(React.Fragment,{children:[wrapTags(tt),rtet.split(/(\*\*[^\*]*\*\*)/g).map((rt,nt)=>/(\*\*.*\*\*)/g.test(rt)?jsxRuntimeExports.jsx("strong",{children:rt.replace(/\*\*/g,"")},nt):`${rt}`).map(rt=>typeof rt=="string"?rt.split(/(\[WALLETCONNECTLOGO\])/g).map(nt=>nt==="[WALLETCONNECTLOGO]"?jsxRuntimeExports.jsx("span",{className:"ck-tt-logo",children:jsxRuntimeExports.jsx(Logos.WalletConnect,{})},nt):nt):rt),LOG_LEVEL={debug:10,info:20,warn:30,error:40,none:100},useIsoLayoutEffect=typeof window<"u"&&window.document&&window.document.createElement!==void 0?reactExports.useLayoutEffect:reactExports.useEffect,useFitText=({logLevel:et="info",maxFontSize:o=100,minFontSize:tt=20,onFinish:rt,onStart:nt,resolution:ot=5}={})=>{const it=LOG_LEVEL[et],st=reactExports.useCallback(()=>({calcKey:0,fontSize:o,fontSizePrev:tt,fontSizeMax:o,fontSizeMin:tt}),[o,tt]),at=reactExports.useRef(null),ct=reactExports.useRef(),lt=reactExports.useRef(!1),[dt,ht]=reactExports.useState(st),{calcKey:mt,fontSize:ft,fontSizeMax:pt,fontSizeMin:yt,fontSizePrev:gt}=dt;let bt=null;const[xt]=reactExports.useState(()=>new index$1(()=>{bt=window.requestAnimationFrame(()=>{lt.current||(nt&&nt(),lt.current=!0,ht({...st(),calcKey:mt+1}))})}));reactExports.useEffect(()=>(at.current&&xt.observe(at.current),()=>{bt&&window.cancelAnimationFrame(bt),xt.disconnect()}),[bt,xt]);const vt=at.current&&at.current.innerHTML;return reactExports.useEffect(()=>{mt===0||lt.current||(vt!==ct.current&&(nt&&nt(),ht({...st(),calcKey:mt+1})),ct.current=vt)},[mt,st,vt,nt]),useIsoLayoutEffect(()=>{if(mt===0)return;const Et=Math.abs(ft-gt)<=ot,Ct=!!at.current&&(at.current.scrollHeight>at.current.offsetHeight||at.current.scrollWidth>at.current.offsetWidth),St=Ct&&ft===gt,At=ft>gt;if(Et){St?(lt.current=!1,it<=LOG_LEVEL.info&&console.info(`[use-fit-text] reached \`minFontSize = ${tt}\` without fitting text`)):Ct?ht({fontSize:At?gt:yt,fontSizeMax:pt,fontSizeMin:yt,fontSizePrev:gt,calcKey:mt}):(lt.current=!1,rt&&rt(ft));return}let kt,It=pt,Nt=yt;Ct?(kt=At?gt-ft:yt-ft,It=Math.min(pt,ft)):(kt=At?pt-ft:gt-ft,Nt=Math.max(yt,ft)),ht({calcKey:mt,fontSize:ft+kt/2,fontSizeMax:It,fontSizeMin:Nt,fontSizePrev:ft})},[mt,ft,pt,yt,gt,rt,at,ot]),{fontSize:ft,ref:at}},FitText=({children:et})=>{const[o,tt]=React.useState(!1),{fontSize:rt,ref:nt}=useFitText({logLevel:"none",maxFontSize:100,minFontSize:70,onStart:()=>tt(!0),onFinish:()=>tt(!0)});return jsxRuntimeExports.jsx("div",{ref:nt,style:{visibility:o?"visible":"hidden",fontSize:`${rt}%`,maxHeight:"100%",maxWidth:"100%",display:"flex",justifyContent:"center",alignItems:"center"},children:et})};FitText.displayName="FitText";function useConnectors(){const et=useConnectors$1();return et??[]}function useConnector(et,o){const tt=useConnectors();return et==="injected"&&o?tt.find(rt=>rt.id===et&&rt.name===o):et==="injected"?tt.find(rt=>rt.id===et&&rt.name.includes("Injected")):tt.find(rt=>rt.id===et)}function useWalletConnectConnector(){return useConnector("walletConnect")}const useWallet=et=>{const tt=useWallets().find(rt=>rt.id===et);return tt||null},useWallets=()=>{const et=useConnectors(),o=useContext();return et.map(rt=>{var nt,ot;const it=Object.keys(walletConfigs).find(at=>at.split(",").map(ct=>ct.trim()).indexOf(rt.id)!==-1),st={id:rt.id,name:(ot=(nt=rt.name)!==null&&nt!==void 0?nt:rt.id)!==null&&ot!==void 0?ot:rt.type,icon:jsxRuntimeExports.jsx("img",{src:rt.icon,alt:rt.name,width:"100%",height:"100%"}),connector:rt,iconShape:"squircle",isInstalled:rt.type==="mock"||rt.type==="injected"&&rt.id!=="metaMask"||isCoinbaseWalletConnector(rt.id)};if(it){const at=walletConfigs[it];return{...st,iconConnector:rt.icon?jsxRuntimeExports.jsx("img",{src:rt.icon,alt:rt.name,width:"100%",height:"100%"}):void 0,...at}}return st}).filter((rt,nt,ot)=>ot.findIndex(it=>it.id===rt.id)===nt).map(rt=>{var nt,ot;return rt.id==="walletConnect"?{...rt,name:((nt=o.options)===null||nt===void 0?void 0:nt.walletConnectName)||rt.name,shortName:((ot=o.options)===null||ot===void 0?void 0:ot.walletConnectName)||rt.shortName}:rt}).filter((rt,nt,ot)=>!(rt.id==="coinbaseWalletSDK"&&ot.find(it=>it.id==="com.coinbase.wallet"))).filter((rt,nt,ot)=>!((rt.id==="metaMaskSDK"||rt.id==="metaMask")&&ot.find(it=>it.id==="io.metamask"||it.id==="io.metamask.mobile"))).sort((rt,nt)=>{const ot=rt.isInstalled&&isInjectedConnector(rt.connector.type),it=nt.isInstalled&&isInjectedConnector(nt.connector.type);return ot&&!it?-1:!ot&&it?1:0}).sort((rt,nt)=>rt.id==="walletConnect"?1:nt.id==="walletConnect"?-1:0)},ProfileIcon=({isSignedIn:et})=>jsxRuntimeExports.jsxs("div",{style:{position:"relative"},children:[et?jsxRuntimeExports.jsx(AuthIcon,{style:{bottom:-1,right:-1}}):jsxRuntimeExports.jsx("div",{style:{zIndex:2,position:"absolute",top:-2,right:-2,background:"#1A88F8",borderRadius:8,boxShadow:"0 0 0 2px var(--ck-body-background)",width:8,height:8}}),jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{overflow:"visible"},children:[jsxRuntimeExports.jsx("circle",{cx:"10",cy:"10",r:"9",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M16.5 16.775C14.8618 15.0649 12.5552 14 10 14C7.44477 14 5.13825 15.0649 3.5 16.775",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("circle",{cx:"10",cy:"8",r:"3",stroke:"currentColor",strokeWidth:"2"})]})]}),InfoIcon=({...et})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 11C20 15.9706 15.9706 20 11 20C6.02944 20 2 15.9706 2 11C2 6.02944 6.02944 2 11 2C15.9706 2 20 6.02944 20 11ZM22 11C22 17.0751 17.0751 22 11 22C4.92487 22 0 17.0751 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11ZM11.6445 12.7051C11.6445 13.1348 11.3223 13.4678 10.7744 13.4678C10.2266 13.4678 9.92578 13.1885 9.92578 12.6191V12.4795C9.92578 11.4268 10.4951 10.8574 11.2686 10.3203C12.2031 9.67578 12.665 9.32129 12.665 8.59082C12.665 7.76367 12.0205 7.21582 11.043 7.21582C10.3232 7.21582 9.80762 7.57031 9.45312 8.16113C9.38282 8.24242 9.32286 8.32101 9.2667 8.39461C9.04826 8.68087 8.88747 8.8916 8.40039 8.8916C8.0459 8.8916 7.66992 8.62305 7.66992 8.15039C7.66992 7.96777 7.70215 7.7959 7.75586 7.61328C8.05664 6.625 9.27051 5.75488 11.1182 5.75488C12.9336 5.75488 14.5234 6.71094 14.5234 8.50488C14.5234 9.7832 13.7822 10.417 12.7402 11.1045C11.999 11.5986 11.6445 11.9746 11.6445 12.5762V12.7051ZM11.9131 15.5625C11.9131 16.1855 11.376 16.6797 10.7529 16.6797C10.1299 16.6797 9.59277 16.1748 9.59277 15.5625C9.59277 14.9395 10.1191 14.4453 10.7529 14.4453C11.3867 14.4453 11.9131 14.9287 11.9131 15.5625Z",fill:"currentColor"})}),CloseIcon=({...et})=>jsxRuntimeExports.jsx(motion.svg,{width:14,height:14,viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{d:"M1 13L13 1M1 1L13 13",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}),BackIcon=({...et})=>jsxRuntimeExports.jsx(motion.svg,{width:9,height:16,viewBox:"0 0 9 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{d:"M8 1L1 8L8 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),contentTransitionDuration=.22,contentVariants$2={initial:{zIndex:2,opacity:0},animate:{opacity:1,scale:1,transition:{duration:contentTransitionDuration*.75,delay:contentTransitionDuration*.25,ease:[.26,.08,.25,1]}},exit:{zIndex:1,opacity:0,pointerEvents:"none",position:"absolute",left:["50%","50%"],x:["-50%","-50%"],transition:{duration:contentTransitionDuration,ease:[.26,.08,.25,1]}}},Modal=({open:et,pages:o,pageId:tt,positionInside:rt,inline:nt,demo:ot,onClose:it,onBack:st,onInfo:at})=>{var ct,lt,dt,ht,mt,ft,pt,yt,gt,bt,xt,vt;const Et=useContext(),Ct=useThemeContext(),St=isMobile(),{isSignedIn:At,reset:kt}=useSIWE(),It=useWallet((ct=Et.connector)===null||ct===void 0?void 0:ct.id),Nt={name:It==null?void 0:It.name,shortName:(lt=It==null?void 0:It.shortName)!==null&<!==void 0?lt:It==null?void 0:It.name,icon:(dt=It==null?void 0:It.iconConnector)!==null&&dt!==void 0?dt:It==null?void 0:It.icon,iconShape:(ht=It==null?void 0:It.iconShape)!==null&&ht!==void 0?ht:"circle",iconShouldShrink:It==null?void 0:It.iconShouldShrink},Lt=useLocales({CONNECTORNAME:Nt==null?void 0:Nt.name}),[Mt,zt]=useTransition({timeout:160,preEnter:!0,mountOnEnter:!0,unmountOnExit:!0}),Ut=!(Mt==="exited"||Mt==="unmounted"),Xt=Mt==="preEnter"||Mt!=="exiting",Wt=Et.route===routes.CONNECTORS?0:Et.route===routes.DOWNLOAD?2:1,Ft=usePrevious(Wt,Wt);rt||useLockBodyScroll(Ut),usePrevious(tt,tt),reactExports.useEffect(()=>{zt(et),et&&Qt(void 0)},[et]);const[qt,Pt]=reactExports.useState({width:void 0,height:void 0}),[Yt,Qt]=reactExports.useState(void 0),jt=Vt=>{const er={width:Vt==null?void 0:Vt.offsetWidth,height:Vt==null?void 0:Vt.offsetHeight};Pt({width:`${er==null?void 0:er.width}px`,height:`${er==null?void 0:er.height}px`})};let Gt;const rr=reactExports.useCallback(Vt=>{Vt&&(Zt.current=Vt,Qt(Yt!==void 0),clearTimeout(Gt),Gt=setTimeout(()=>Qt(!1),360),jt(Vt))},[et,Yt]),{chain:Ht}=useAccount(),{switchChain:dr}=useSwitchChain(),Zt=reactExports.useRef(null);reactExports.useEffect(()=>{Zt.current&&jt(Zt.current)},[Ht,dr,St,At,Et.options,Et.resize]),reactExports.useEffect(()=>{if(!Ut){Pt({width:void 0,height:void 0});return}const Vt=er=>{er.key==="Escape"&&it&&it()};return document.addEventListener("keydown",Vt),()=>{document.removeEventListener("keydown",Vt)}},[Ut,it]);const Jt={"--height":qt.height,"--width":qt.width};function tr(){return It?!(!It.getWalletConnectDeeplink||It.isInstalled):!1}function _t(){var Vt;switch(Et.route){case routes.ABOUT:return Lt.aboutScreen_heading;case routes.CONNECT:return tr()?isWalletConnectConnector((Vt=It==null?void 0:It.connector)===null||Vt===void 0?void 0:Vt.id)?Lt.scanScreen_heading:Lt.scanScreen_heading_withConnector:Nt==null?void 0:Nt.name;case routes.CONNECTORS:return Lt.connectorsScreen_heading;case routes.MOBILECONNECTORS:return Lt.mobileConnectorsScreen_heading;case routes.DOWNLOAD:return Lt.downloadAppScreen_heading;case routes.ONBOARDING:return Lt.onboardingScreen_heading;case routes.PROFILE:return Lt.profileScreen_heading;case routes.SWITCHNETWORKS:return Lt.switchNetworkScreen_heading;case routes.SIGNINWITHETHEREUM:return At?Lt.signInWithEthereumScreen_signedIn_heading:Lt.signInWithEthereumScreen_signedOut_heading;default:return""}}const Bt=jsxRuntimeExports.jsx(ResetContainer,{$useTheme:(mt=ot==null?void 0:ot.theme)!==null&&mt!==void 0?mt:Ct.theme,$useMode:(ft=ot==null?void 0:ot.mode)!==null&&ft!==void 0?ft:Ct.mode,$customTheme:(pt=ot==null?void 0:ot.customTheme)!==null&&pt!==void 0?pt:Ct.customTheme,children:jsxRuntimeExports.jsxs(ModalContainer,{role:"dialog",style:{pointerEvents:Xt?"auto":"none",position:rt?"absolute":void 0},children:[!nt&&jsxRuntimeExports.jsx(BackgroundOverlay,{$active:Xt,onClick:it,$blur:(yt=Et.options)===null||yt===void 0?void 0:yt.overlayBlur}),jsxRuntimeExports.jsxs(Container$7,{style:Jt,initial:!1,children:[jsxRuntimeExports.jsx("div",{style:{pointerEvents:Yt?"all":"none",position:"absolute",top:0,bottom:0,left:"50%",transform:"translateX(-50%)",width:"var(--width)",zIndex:9,transition:"width 200ms ease"}}),jsxRuntimeExports.jsxs(BoxContainer,{className:`${Xt&&"active"}`,children:[jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:((gt=Et.options)===null||gt===void 0?void 0:gt.disclaimer)&&Et.route===routes.CONNECTORS&&jsxRuntimeExports.jsx(DisclaimerBackground,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{delay:0,duration:.2,ease:[.25,.1,.25,1]},children:jsxRuntimeExports.jsx(Disclaimer,{children:jsxRuntimeExports.jsx("div",{children:(bt=Et.options)===null||bt===void 0?void 0:bt.disclaimer})})})}),jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:Et.errorMessage&&jsxRuntimeExports.jsxs(ErrorMessage,{initial:{y:"10%",x:"-50%"},animate:{y:"-100%"},exit:{y:"100%"},transition:{duration:.2,ease:"easeInOut"},children:[jsxRuntimeExports.jsx("span",{children:Et.errorMessage}),jsxRuntimeExports.jsx("div",{onClick:()=>Et.displayError(null),style:{position:"absolute",right:24,top:24,cursor:"pointer"},children:jsxRuntimeExports.jsx(CloseIcon,{})})]})}),jsxRuntimeExports.jsxs(ControllerContainer,{children:[it&&jsxRuntimeExports.jsx(CloseButton,{"aria-label":flattenChildren(Lt.close).toString(),onClick:it,children:jsxRuntimeExports.jsx(CloseIcon,{})}),jsxRuntimeExports.jsx("div",{style:{position:"absolute",top:23,left:20,width:32,height:32},children:jsxRuntimeExports.jsx(AnimatePresence,{children:st?jsxRuntimeExports.jsx(BackButton,{disabled:Yt,"aria-label":flattenChildren(Lt.back).toString(),onClick:st,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:St?0:.1,delay:St?.01:0},children:jsxRuntimeExports.jsx(BackIcon,{})},"backButton"):Et.route===routes.PROFILE&&Et.signInWithEthereum?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[!At&&!(!((xt=Et.options)===null||xt===void 0)&&xt.hideTooltips)&&jsxRuntimeExports.jsx(motion.div,{style:{position:"absolute",inset:0,pointerEvents:"none"},initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1,transition:{delay:.5,duration:.2}},exit:{opacity:0,scale:.6,transition:{delay:0,duration:St?0:.1}},children:jsxRuntimeExports.jsx(SignInTooltip,{children:Lt.signInWithEthereumScreen_tooltip})}),jsxRuntimeExports.jsx(SiweButton,{disabled:Yt,"aria-label":Lt.signInWithEthereumScreen_signedOut_heading,onClick:()=>{kt(),Et.setRoute(routes.SIGNINWITHETHEREUM)},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:St?0:.1,delay:St?.01:0},children:jsxRuntimeExports.jsx(ProfileIcon,{isSignedIn:At})},"siweButton")]}):at&&!(!((vt=Et.options)===null||vt===void 0)&&vt.hideQuestionMarkCTA)&&jsxRuntimeExports.jsx(InfoButton,{disabled:Yt,"aria-label":flattenChildren(Lt.moreInformation).toString(),onClick:at,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:St?0:.1,delay:St?.01:0},children:jsxRuntimeExports.jsx(InfoIcon,{})},"infoButton")})})]}),jsxRuntimeExports.jsx(ModalHeading,{children:jsxRuntimeExports.jsx(AnimatePresence,{children:jsxRuntimeExports.jsx(motion.div,{style:{position:"absolute",top:0,bottom:0,left:52,right:52,display:"flex",justifyContent:"center"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:St?0:.17,delay:St?.01:0},children:jsxRuntimeExports.jsx(FitText,{children:_t()})},`${Et.route}-${At?"signedIn":""}`)})}),jsxRuntimeExports.jsx(InnerContainer$1,{children:Object.keys(o).map(Vt=>{const er=o[Vt];return jsxRuntimeExports.jsx(Page,{open:Vt===tt,initial:!rt&&Mt!=="entered",enterAnim:Vt===tt?Wt>Ft?"active-scale-up":"active":"",exitAnim:Vt!==tt?Wt{const[st,at]=useTransition({timeout:400,preEnter:!0,initialEntered:o,mountOnEnter:!0,unmountOnExit:!0}),ct=!(st==="exited"||st==="unmounted"),lt=st==="preEnter"||st!=="exiting";return reactExports.useEffect(()=>{at(o)},[o]),ct?jsxRuntimeExports.jsx(PageContainer,{className:`${lt?ot:it}`,style:{animationDuration:tt?"0ms":void 0,animationDelay:tt?"0ms":void 0},children:et}):null},OrDivider=({children:et})=>{const o=useLocales();return jsxRuntimeExports.jsx(TextWithHr,{children:jsxRuntimeExports.jsx("span",{children:et??o.or})})},Graphic=styled(motion.div)` - position: relative; - margin: 16px auto 20px; - height: 190px; - max-width: 295px; - pointer-events: none; - user-select: none; - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - height: 200px; - max-width: 100%; - margin-bottom: 32px; - } -`,LogoGroup=styled(motion.div)` - position: absolute; - inset: 0; - z-index: 2; -`,graphicIn=We` - 0%{ - opacity:0; - transform:scale(0.9); - } - 100%{ - opacity:1; - transform:none; - } -`,GraphicBackground=styled(motion.div)` - z-index: 1; - position: absolute; - inset: 0; - top: -2px; - overflow: hidden; - &:before { - content: ''; - position: absolute; - inset: 0; - background: var(--ck-body-background); - background: radial-gradient( - closest-side, - var(--ck-body-background-transparent, transparent) 18.75%, - var(--ck-body-background) 100% - ); - background-size: 100%; - } - svg { - display: block; - width: 100%; - height: auto; - } - animation: ${graphicIn} 1000ms 100ms ease both; - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - animation: none; - } -`,logoIn=We` - 0%{ - opacity:0; - transform:scale(0) translateY(40%); - } - 100%{ - opacity:1; - transform:none; - } -`,LogoPosition=styled(motion.div)` - position: absolute; - inset: 0; - animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both; - animation-delay: inherit; -`,LogoInner=styled(motion.div)` - position: absolute; -`,LogoGraphic=styled(motion.div)` - position: relative; - overflow: hidden; - height: 58px; - width: 58px; - border-radius: 13.84px; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 2px 20px 0 rgba(0, 0, 0, 0.03); - - svg { - display: block; - width: 100%; - height: 100%; - } -`,float$1=We` - 0%,100%{ transform:none; } - 50%{ transform: translateY(-10%) } -`,FloatWrapper=styled(motion.div)` - position: relative; - animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both; - animation-name: ${float$1}; - animation-duration: 3600ms; -`,rotate=We` - 0%,100%{ transform:rotate(-3deg); } - 50%{ transform:rotate(3deg); } -`,RotateWrapper=styled(motion.div)` - position: relative; - animation: cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite both; - animation-name: ${rotate}; - animation-duration: 3200ms; -`,Logo$2=styled(motion.div)` - position: absolute; - inset: 0; - - animation: ${logoIn} 750ms cubic-bezier(0.19, 1, 0.22, 1) both; - &:nth-child(1){ z-index:2; animation-delay:0ms; } - &:nth-child(2){ z-index:1; animation-delay:60ms; } - &:nth-child(3){ z-index:1; animation-delay:30ms; } - &:nth-child(4){ z-index:1; animation-delay:90ms; } - &:nth-child(5){ z-index:1; animation-delay:120ms;} - - &:nth-child(1){ ${RotateWrapper}{ animation-delay:0ms; } } - &:nth-child(2){ ${RotateWrapper}{ animation-delay:-600ms; } } - &:nth-child(3){ ${RotateWrapper}{ animation-delay:-1200ms; } } - &:nth-child(4){ ${RotateWrapper}{ animation-delay:-1800ms; } } - &:nth-child(5){ ${RotateWrapper}{ animation-delay:-2400ms; } } - - &:nth-child(1){ ${FloatWrapper}{ animation-delay:-200ms; } } - &:nth-child(2){ ${FloatWrapper}{ animation-delay:-600ms; } } - &:nth-child(3){ ${FloatWrapper}{ animation-delay:-800ms; } } - &:nth-child(4){ ${FloatWrapper}{ animation-delay:-300ms; } } - &:nth-child(5){ ${FloatWrapper}{ animation-delay:-3200ms; } } - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - animation: none !important; - ${RotateWrapper},${FloatWrapper} { - animation: none !important; - } - } - - ${LogoInner} { - transform: translate(-50%, -50%); - } - - &:nth-child(1) ${LogoPosition} { - transform: translate(50%, 50%); - ${LogoGraphic} { - border-radius: 17.2px; - width: 72px; - height: 72px; - } - } - &:nth-child(2) ${LogoPosition} { - transform: translate(21%, 21.5%); - } - &:nth-child(3) ${LogoPosition} { - transform: translate(78%, 14%); - } - &:nth-child(4) ${LogoPosition} { - transform: translate(22.5%, 76%); - } - &:nth-child(5) ${LogoPosition} { - transform: translate(76%, 80%); - } -`;var wave=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"298",height:"188",viewBox:"0 0 298 188",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M1 55.2757L21.6438 46.0285C55.5896 30.8228 94.4104 30.8228 128.356 46.0286L169.644 64.5229C203.59 79.7287 242.41 79.7286 276.356 64.5229L297 55.2757M1 44.2118L21.6438 34.9646C55.5896 19.7589 94.4104 19.7589 128.356 34.9646L169.644 53.459C203.59 68.6647 242.41 68.6647 276.356 53.459L297 44.2118M1 33.1477L21.6438 23.9005C55.5896 8.69479 94.4104 8.69479 128.356 23.9005L169.644 42.3949C203.59 57.6006 242.41 57.6006 276.356 42.3949L297 33.1477M1 22.1477L21.6438 12.9005C55.5896 -2.30521 94.4104 -2.30521 128.356 12.9005L169.644 31.3949C203.59 46.6006 242.41 46.6006 276.356 31.3949L297 22.1477M1 66.3398L21.6438 57.0926C55.5896 41.8869 94.4104 41.8869 128.356 57.0926L169.644 75.587C203.59 90.7927 242.41 90.7927 276.356 75.587L297 66.3398M1 77.404L21.6438 68.1568C55.5896 52.9511 94.4104 52.9511 128.356 68.1569L169.644 86.6512C203.59 101.857 242.41 101.857 276.356 86.6512L297 77.404M1 88.4681L21.6438 79.2209C55.5896 64.0152 94.4104 64.0152 128.356 79.2209L169.644 97.7153C203.59 112.921 242.41 112.921 276.356 97.7153L297 88.4681M1 121.66L21.6438 112.413C55.5896 97.2075 94.4104 97.2075 128.356 112.413L169.644 130.908C203.59 146.113 242.41 146.113 276.356 130.908L297 121.66M1 110.596L21.6438 101.349C55.5896 86.1433 94.4104 86.1433 128.356 101.349L169.644 119.843C203.59 135.049 242.41 135.049 276.356 119.843L297 110.596M1 99.5321L21.6438 90.2849C55.5896 75.0792 94.4104 75.0792 128.356 90.2849L169.644 108.779C203.59 123.985 242.41 123.985 276.356 108.779L297 99.5321M1 132.724L21.6438 123.477C55.5896 108.271 94.4104 108.271 128.356 123.477L169.644 141.971C203.59 157.177 242.41 157.177 276.356 141.971L297 132.724M1 143.788L21.6438 134.541C55.5896 119.336 94.4104 119.336 128.356 134.541L169.644 153.036C203.59 168.241 242.41 168.241 276.356 153.036L297 143.788M1 154.853L21.6438 145.605C55.5896 130.4 94.4104 130.4 128.356 145.605L169.644 164.1C203.59 179.305 242.41 179.305 276.356 164.1L297 154.853M1 165.853L21.6438 156.605C55.5896 141.4 94.4104 141.4 128.356 156.605L169.644 175.1C203.59 190.305 242.41 190.305 276.356 175.1L297 165.853",stroke:"url(#paint0_linear_1094_2077)",strokeOpacity:"0.9",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1094_2077",x1:"1",y1:"112.587",x2:"297.034",y2:"79.6111",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-01)"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-02)",offset:"0.239583"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-03)",offset:"0.515625"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-04)",offset:"0.739583"}),jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-wave-stop-05)",offset:"1"})]})})]});const SpinnerContainer$3=styled(motion.div)` - position: absolute; - right: 16px; - top: 0; - bottom: 0; - display: flex; - align-items: center; - justify-content: center; -`,Arrow=styled.svg` - --x: -3px; - --stroke-width: 2; - position: relative; - top: 1px; - left: -0.5px; - display: inline-block; - vertical-align: middle; - margin-left: 9px; - margin-right: 1px; - transition: all 100ms ease; - transform: translateX(var(--x, -3px)); - color: currentColor; - opacity: 0.4; -`,ArrowChevron=styled.path``,ArrowLine=styled.line` - transition: inherit; - transition-property: transform; - transform-origin: 90% 50%; - transform: scaleX(0.1); -`,DownloadArrow=styled.div` - display: inline-block; - vertical-align: middle; - position: relative; - margin-right: 6px; - color: currentColor; -`,DownloadArrowInner=styled.div` - transform: rotate(90deg); - ${Arrow} { - margin: 0 auto; - } -`,ButtonContainerInner=styled(motion.div)` - display: flex; - align-items: center; - justify-content: center; - inset: 0; - height: 100%; -`,ButtonContainer$1=styled.button` - - ${({disabled:et})=>et&&Ae` - cursor: not-allowed; - pointer-events: none; - ${InnerContainer} { - opacity: 0.4; - } - `} - - ${({$variant:et})=>{if(et==="primary")return Ae` - --color: var(--ck-primary-button-color, var(--ck-body-color)); - --background: var( - --ck-primary-button-background, - var(--ck-body-background-primary) - ); - --box-shadow: var(--ck-primary-button-box-shadow); - --border-radius: var(--ck-primary-button-border-radius); - --font-weight: var(--ck-primary-button-font-weight, 500); - - --hover-color: var(--ck-button-primary-hover-color, var(--color)); - --hover-background: var( - --ck-primary-button-hover-background, - var(--background) - ); - --hover-box-shadow: var( - --ck-primary-button-hover-box-shadow, - var(--box-shadow) - ); - --hover-border-radius: var( - --ck-primary-button-hover-border-radius, - var(--border-radius) - ); - --hover-font-weight: var( - --ck-primary-button-font-weight, - var(--font-weight) - ); - `;if(et==="secondary")return Ae` - --color: var(--ck-secondary-button-color, var(--ck-body-color)); - --background: var( - --ck-secondary-button-background, - var(--ck-body-background-secondary) - ); - --box-shadow: var(--ck-secondary-button-box-shadow); - --border-radius: var(--ck-secondary-button-border-radius); - --font-weight: var(--ck-secondary-button-font-weight, 500); - - --hover-color: var(--ck-secondary-button-hover-color, var(--color)); - --hover-background: var( - --ck-secondary-button-hover-background, - var(--background) - ); - --hover-box-shadow: var( - --ck-secondary-button-hover-box-shadow, - var(--box-shadow) - ); - --hover-border-radius: var( - --ck-secondary-button-hover-border-radius, - var(--border-radius) - ); - --hover-font-weight: var( - --ck-secondary-button-font-weight, - var(--font-weight) - ); - `;if(et==="tertiary")return Ae` - --color: var( - --ck-tertiary-button-color, - var(--ck-secondary-button-color) - ); - --background: var( - --ck-tertiary-button-background, - var(--ck-secondary-button-background) - ); - --box-shadow: var( - --ck-tertiary-button-box-shadow, - var(--ck-secondary-button-box-shadow) - ); - --border-radius: var( - --ck-tertiary-button-border-radius, - var(--ck-secondary-button-border-radius) - ); - --font-weight: var( - --ck-tertiary-button-font-weight, - var(--ck-secondary-button-font-weight) - ); - - --hover-color: var( - --button-tertiary-hover-color, - var(--ck-tertiary-button-color) - ); - --hover-background: var( - --ck-tertiary-button-hover-background, - var(--ck-tertiary-button-background) - ); - --hover-box-shadow: var( - --ck-tertiary-button-hover-box-shadow, - var(--ck-tertiary-button-box-shadow) - ); - --hover-border-radius: var( - --ck-tertiary-button-hover-border-radius, - var(--ck-tertiary-button-border-radius, var(--border-radius)) - ); - --hover-font-weight: var( - --ck-tertiary-button-font-weight, - var(--ck-secondary-button-font-weight) - ); - `}} - - appearance: none; - cursor: pointer; - user-select: none; - min-width: fit-content; - width: 100%; - display:block; - text-align: center; - height: 48px; - margin: 12px 0 0; - line-height: 48px; - padding: 0 4px; - font-size: 16px; - font-weight: var(--font-weight,500); - text-decoration: none; - white-space: nowrap; - transition: 100ms ease; - transition-property: box-shadow, background-color; - color: var(--color); - background: var(--background); - border-radius: var(--border-radius); - box-shadow: var(--box-shadow); - will-change: transform, box-shadow, background-color, color; - - ${DownloadArrow} { - ${Arrow} { - transform: translateX(0); - ${ArrowLine} { - transform: none; - } - ${ArrowChevron} { - } - } - } -} - - @media only screen and (min-width: ${defaultTheme.mobileWidth+1}px) { - &:hover, - &:focus-visible { - color: var(--ck-accent-text-color, var(--hover-color)); - background: var(--ck-accent-color, var(--hover-background)); - border-radius: var(--hover-border-radius); - box-shadow: var(--hover-box-shadow); - - ${Arrow} { - transform: translateX(0); - ${ArrowLine} { - transform: none; - } - ${ArrowChevron} { - } - } - ${DownloadArrow} { - ${Arrow} { - transform: translateX(var(--x)); - ${ArrowLine} { - transform: scaleX(0.1); - } - ${ArrowChevron} { - } - } - } - } - &:active { - box-shadow: var(--ck-secondary-button-active-box-shadow, var(--hover-box-shadow)); - } - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - transition: transform 100ms ease; - transform: scale(1); - font-size: 17px; - &:active { - } - } -`,InnerContainer=styled.div` - transform: translateZ(0); // Shifting fix - position: relative; - display: inline-block; - vertical-align: middle; - max-width: calc(100% - 42px); - transition: opacity 300ms ease; - /* - overflow: hidden; - text-overflow: ellipsis; - */ -`,IconContainer$4=styled(motion.div)` - position: relative; - display: inline-block; - vertical-align: middle; - max-width: 20px; - max-height: 20px; - margin: 0 10px; - &:first-child { - margin-left: 0; - } - &:last-child { - margin-right: 0; - } - ${et=>et.$rounded&&Ae` - overflow: hidden; - border-radius: 5px; - `} - svg { - display: block; - position: relative; - max-width: 100%; - height: auto; - } -`,Spin$1=We` - 0%{ transform: rotate(0deg); } - 100%{ transform: rotate(360deg); } -`,SpinnerContainer$2=styled(motion.div)` - display: flex; - align-items: center; - justify-content: center; - animation: ${Spin$1} 1s linear infinite; - svg { - display: block; - position: relative; - animation: ${Spin$1} 1s ease-in-out infinite; - } -`,transition$2={duration:.4,ease:[.175,.885,.32,.98]},Spinner$4=()=>jsxRuntimeExports.jsx(SpinnerContainer$2,{initial:{opacity:0,rotate:180},animate:{opacity:1,rotate:0},exit:{position:"absolute",opacity:0,rotate:-180,transition:{...transition$2}},transition:{...transition$2,delay:.2},children:jsxRuntimeExports.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("circle",{cx:"9",cy:"9",r:"7",stroke:"currentColor",strokeOpacity:"0.1",strokeWidth:"2.5"}),jsxRuntimeExports.jsx("path",{d:"M16 9C16 5.13401 12.866 2 9 2",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})]})}),transition$1={duration:.4,ease:[.175,.885,.32,.98]},Button$1=({children:et,variant:o="secondary",disabled:tt,icon:rt,iconPosition:nt="left",roundedIcon:ot,waiting:it,arrow:st,download:at,href:ct,style:lt,onClick:dt})=>{const ht=typeof et=="string"?et:flattenChildren(et).join(""),mt=typeof ct=="string"?ct:flattenChildren(ct).join("");return jsxRuntimeExports.jsx(ButtonContainer$1,{as:ct?"a":void 0,onClick:ft=>{!tt&&dt&&dt(ft)},href:mt,target:ct&&"_blank",rel:ct&&"noopener noreferrer",disabled:tt,$variant:o,style:lt,children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[jsxRuntimeExports.jsxs(ButtonContainerInner,{initial:{opacity:0,y:-10},animate:{opacity:1,y:-1},exit:{position:"absolute",opacity:0,y:10,transition:{...transition$1}},transition:{...transition$1,delay:.2},children:[rt&&nt==="left"&&jsxRuntimeExports.jsx(IconContainer$4,{$rounded:ot,children:rt}),at&&jsxRuntimeExports.jsx(DownloadArrow,{children:jsxRuntimeExports.jsx(DownloadArrowInner,{children:jsxRuntimeExports.jsxs(Arrow,{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx(ArrowLine,{stroke:"currentColor",x1:"1",y1:"6",x2:"12",y2:"6",strokeWidth:"var(--stroke-width)",strokeLinecap:"round"}),jsxRuntimeExports.jsx(ArrowChevron,{stroke:"currentColor",d:"M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314",strokeWidth:"var(--stroke-width)",strokeLinecap:"round"})]})})}),jsxRuntimeExports.jsx(InnerContainer,{style:{paddingLeft:st?6:0},children:jsxRuntimeExports.jsx(FitText,{children:et})}),rt&&nt==="right"&&jsxRuntimeExports.jsx(IconContainer$4,{$rounded:ot,children:rt}),st&&jsxRuntimeExports.jsxs(Arrow,{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx(ArrowLine,{stroke:"currentColor",x1:"1",y1:"6",x2:"12",y2:"6",strokeWidth:"2",strokeLinecap:"round"}),jsxRuntimeExports.jsx(ArrowChevron,{stroke:"currentColor",d:"M7.51431 1.5L11.757 5.74264M7.5 10.4858L11.7426 6.24314",strokeWidth:"2",strokeLinecap:"round"})]})]},ht),it&&jsxRuntimeExports.jsx(SpinnerContainer$3,{children:jsxRuntimeExports.jsx(Spinner$4,{})})]})})},Introduction=()=>{var et,o;const tt=useContext(),rt=useLocales({}),nt=(o=(et=tt.options)===null||et===void 0?void 0:et.walletOnboardingUrl)!==null&&o!==void 0?o:rt.onboardingScreen_ctaUrl;return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(Graphic,{children:[jsxRuntimeExports.jsxs(LogoGroup,{children:[jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.MetaMask,{background:!0})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.Trust,{})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.Argent,{})})})})})})}),jsxRuntimeExports.jsx(Logo$2,{children:jsxRuntimeExports.jsx(LogoPosition,{children:jsxRuntimeExports.jsx(LogoInner,{children:jsxRuntimeExports.jsx(FloatWrapper,{children:jsxRuntimeExports.jsx(RotateWrapper,{children:jsxRuntimeExports.jsx(LogoGraphic,{children:jsxRuntimeExports.jsx(Logos.ImToken,{})})})})})})})]}),jsxRuntimeExports.jsx(GraphicBackground,{children:wave})]}),jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:18},children:[jsxRuntimeExports.jsx(ModalH1,{$small:!0,children:rt.onboardingScreen_h1}),jsxRuntimeExports.jsx(ModalBody,{children:rt.onboardingScreen_p})]}),jsxRuntimeExports.jsx(Button$1,{href:nt,arrow:!0,children:rt.onboardingScreen_ctaText})]})},imageHeight=208,ImageContainer$1=styled.div` - pointer-events: none; - user-select: none; - height: ${imageHeight}px; - padding: 0 0 12px; - display: flex; - align-items: center; - justify-content: center; - svg { - display: block; - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - display: none; - } -`,ImageContainerInner=styled(motion.div)``,MobileImageContainer=styled.div` - pointer-events: none; - user-select: none; - height: ${imageHeight}px; - padding: 0 0 12px; - display: none; - align-items: center; - justify-content: center; - svg { - display: block; - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - display: flex; - } -`,Slides=styled.div` - position: relative; -`,Slide=styled(motion.div)` - scroll-snap-type: x mandatory; - position: relative; - bottom: 0; - left: 0; - right: 0; - width: 100%; - padding: 0 4px 8px; - /* will-change: transform, opacity; */ - transition: 400ms 50ms cubic-bezier(0.16, 1, 0.3, 1); - transition-property: transform, opacity; - ${et=>!et.$active&&Ae` - pointer-events: none; - position: absolute; - opacity: 0; - transform: scale(0.95); - transition-duration: 300ms; - transition-delay: 0ms; - `} -`,Slider=styled.div` - --background: var(--ck-body-background-secondary); - --background-transparent: var(--ck-body-background-transparent, transparent); - position: relative; - padding: 0 0 4px; - border-radius: 16px; - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - margin: 0 -24px; - ${Slides} { - position: relative; - z-index: 3; - display: flex; - overflow: auto; - scroll-behavior: smooth; - scroll-snap-type: x mandatory; - margin-top: -${imageHeight}px; - padding-top: ${imageHeight}px; - -ms-overflow-style: none; /* Internet Explorer 10+ */ - scrollbar-width: none; /* Firefox */ - &::-webkit-scrollbar { - display: none; /* Safari and Chrome */ - } - } - ${Slide} { - position: relative; - opacity: 1; - transform: none; - flex-shrink: 0; - scroll-snap-align: start; - } - } -`,Dots=styled.div` - position: relative; - top: -1px; - display: flex; - justify-content: center; - pointer-events: auto; -`,Dot=styled.button` - display: flex; - align-items: center; - height: 28px; - padding: 2px; - background: none; - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - padding: 4px; - &:before { - transform: none !important; - } - } - &:before { - content: ''; - display: block; - width: 16px; - height: 3px; - opacity: 0.12; - border-radius: 4px; - background: var(--ck-accent-color, var(--ck-body-color)); - transition: transform 200ms ease, opacity 180ms ease; - } - ${et=>et.$active?Ae` - cursor: default; - &:before { - opacity: 1; - } - `:!et.disabled&&Ae` - cursor: pointer; - &:hover:before { - transform: scaleY(3.5); - } - &:active:before { - } - `} -`,pulseAnim={scale:[.9,1.25,1.6],opacity:[0,.11,0]},pulseTransition={ease:"linear",duration:2,repeat:1/0},Center=styled.div` - position: absolute; - left: 50%; - top: 50%; - transform: translateY(-50%) translateX(-50%); -`,spin=We` - from{ transform: rotate(0deg); } - to{ transform: rotate(360deg); } -`,SpinContainer=styled(motion.div)` - z-index: -1; - position: absolute; - inset: 0; - overflow: hidden; - border-radius: 100%; - animation: ${spin} 16s linear infinite; -`,BgLighten=styled(motion.div)` - overflow: hidden; - border-radius: inherit; - z-index: 0; - position: absolute; - inset: 0; - background: rgba(255, 255, 255, 0.1); -`,MainCircle=styled(motion.div)` - z-index: 2; - position: relative; - border-radius: 50%; - background: var(--ck-body-background); -`,MainCircleInner=styled(motion.div)` - position: absolute; - inset: 0; - display: flex; - align-items: center; - justify-content: center; - border-radius: 50%; -`,Compass=jsxRuntimeExports.jsxs("svg",{width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M17 34C26.3 34 34 26.2833 34 17C34 7.7 26.2833 0 16.9833 0C7.7 0 0 7.7 0 17C0 26.2833 7.71667 34 17 34ZM9.83333 25.6833C8.68333 26.2333 7.8 25.3333 8.33333 24.2L13.1667 14.3333C13.45 13.75 13.8167 13.3833 14.35 13.1333L24.1833 8.33333C25.4 7.75 26.25 8.65 25.6833 9.81667L20.8833 19.6667C20.6167 20.2 20.2333 20.6 19.6833 20.85L9.83333 25.6833ZM17.0167 19.1333C18.1833 19.1333 19.1333 18.1833 19.1333 17.0167C19.1333 15.85 18.1833 14.9167 17.0167 14.9167C15.8667 14.9167 14.9167 15.85 14.9167 17.0167C14.9167 18.1833 15.8667 19.1333 17.0167 19.1333Z",fill:"var(--ck-graphic-compass-color, var(--ck-body-color))"}),jsxRuntimeExports.jsx("path",{d:"M17 34C26.3 34 34 26.2833 34 17C34 7.7 26.2833 0 16.9833 0C7.7 0 0 7.7 0 17C0 26.2833 7.71667 34 17 34ZM9.83333 25.6833C8.68333 26.2333 7.8 25.3333 8.33333 24.2L13.1667 14.3333C13.45 13.75 13.8167 13.3833 14.35 13.1333L24.1833 8.33333C25.4 7.75 26.25 8.65 25.6833 9.81667L20.8833 19.6667C20.6167 20.2 20.2333 20.6 19.6833 20.85L9.83333 25.6833ZM17.0167 19.1333C18.1833 19.1333 19.1333 18.1833 19.1333 17.0167C19.1333 15.85 18.1833 14.9167 17.0167 14.9167C15.8667 14.9167 14.9167 15.85 14.9167 17.0167C14.9167 18.1833 15.8667 19.1333 17.0167 19.1333Z",fill:"url(#ck-compass-gradient)"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"ck-compass-gradient",x1:"17",y1:"0",x2:"17",y2:"34",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"rgba(0,0,0,0)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"rgba(0,0,0,0.05)"})]})})]}),Wallet=({inverted:et=!1})=>jsxRuntimeExports.jsxs("svg",{width:"58",height:"50",viewBox:"0 0 58 50",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M57.9332 20.3335V42.1113C57.9332 46.4069 54.451 49.8891 50.1555 49.8891H8.15546C3.85991 49.8891 0.377686 46.4069 0.377686 42.1113V25.0002V7.8891C0.377686 3.59355 3.85991 0.111328 8.15546 0.111328H47.0444C48.7626 0.111328 50.1555 1.50422 50.1555 3.22244C50.1555 4.94066 48.7626 6.33355 47.0443 6.33355H9.71102C7.9928 6.33355 6.59991 7.72644 6.59991 9.44466C6.59991 11.1629 7.9928 12.5558 9.71102 12.5558H50.1555C54.451 12.5558 57.9332 16.038 57.9332 20.3335ZM46.2667 34.3337C48.4145 34.3337 50.1556 32.5926 50.1556 30.4448C50.1556 28.297 48.4145 26.5559 46.2667 26.5559C44.1189 26.5559 42.3778 28.297 42.3778 30.4448C42.3778 32.5926 44.1189 34.3337 46.2667 34.3337Z",fill:et?"var(--ck-graphic-primary-color, var(--ck-body-background))":"var(--ck-graphic-primary-color, var(--ck-body-color))"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_2501_7732",x1:"29.1555",y1:"0.111328",x2:"29.1555",y2:"49.8891",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:et?"var(--ck-body-color-muted)":"var(--ck-body-background-transparent, transparent)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:et?"var(--ck-body-color)":"var(--ck-body-background)"})]})})]}),Send=jsxRuntimeExports.jsx("svg",{width:"41",height:"41",viewBox:"0 0 41 41",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M35.4446 0.839914L2.14484 10.7065C0.0395033 11.3303 -0.632966 13.9786 0.919705 15.5313L7.9624 22.574C9.47585 24.0874 11.8661 24.273 13.5951 23.0114L25.2866 14.4797C25.5558 14.2832 25.9281 14.3121 26.1638 14.5478C26.3998 14.7838 26.4285 15.1567 26.2313 15.426L17.6874 27.0937C16.4213 28.8228 16.6052 31.2168 18.1206 32.7322L25.1811 39.7926C26.7337 41.3453 29.382 40.6728 30.0058 38.5675L39.8724 5.2677C40.6753 2.55794 38.1544 0.037024 35.4446 0.839914Z",fill:"var(--ck-graphic-secondary-color, white)"})}),Receive=jsxRuntimeExports.jsx("svg",{width:"38",height:"44",viewBox:"0 0 38 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19 0.875C21.4853 0.875 23.5 2.88972 23.5 5.375V27.761L30.068 21.193C31.8254 19.4357 34.6746 19.4357 36.432 21.193C38.1893 22.9504 38.1893 25.7996 36.432 27.557L22.182 41.807C20.4246 43.5643 17.5754 43.5643 15.818 41.807L1.56802 27.557C-0.18934 25.7996 -0.18934 22.9504 1.56802 21.193C3.32538 19.4357 6.17462 19.4357 7.93198 21.193L14.5 27.761V5.375C14.5 2.88972 16.5147 0.875 19 0.875Z",fill:"var(--ck-graphic-secondary-color, white)"})}),Key$1=({...et})=>{var o;const tt=(o=et==null?void 0:et.id)!==null&&o!==void 0?o:"";return jsxRuntimeExports.jsxs("svg",{...et,width:"81",height:"81",viewBox:"0 0 81 81",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81 27C81 41.9117 68.9117 54 54 54C51.2722 54 48.6389 53.5955 46.1568 52.8432L36 63H27V72H18V81H4.5C2.01472 81 0 78.9853 0 76.5V64.864C0 63.6705 0.474103 62.5259 1.31802 61.682L28.1568 34.8432C27.4045 32.3611 27 29.7278 27 27C27 12.0883 39.0883 0 54 0C68.9117 0 81 12.0883 81 27ZM60.75 25.875C63.8566 25.875 66.375 23.3566 66.375 20.25C66.375 17.1434 63.8566 14.625 60.75 14.625C57.6434 14.625 55.125 17.1434 55.125 20.25C55.125 23.3566 57.6434 25.875 60.75 25.875Z",fill:`url(#${tt}paint0_linear_2509_6177)`}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81 27C81 41.9117 68.9117 54 54 54C51.2722 54 48.6389 53.5955 46.1568 52.8432L36 63H27V72H18V81H4.5C2.01472 81 0 78.9853 0 76.5V64.864C0 63.6705 0.474103 62.5259 1.31802 61.682L28.1568 34.8432C27.4045 32.3611 27 29.7278 27 27C27 12.0883 39.0883 0 54 0C68.9117 0 81 12.0883 81 27ZM60.75 25.875C63.8566 25.875 66.375 23.3566 66.375 20.25C66.375 17.1434 63.8566 14.625 60.75 14.625C57.6434 14.625 55.125 17.1434 55.125 20.25C55.125 23.3566 57.6434 25.875 60.75 25.875Z",fill:`url(#${tt}paint1_radial_2509_6177)`,fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.5658 51.2522C45.1527 50.6653 46.0151 50.4492 46.8095 50.6899C49.0823 51.3788 51.4958 51.75 54 51.75C67.6691 51.75 78.75 40.669 78.75 27C78.75 13.331 67.6691 2.25 54 2.25C40.331 2.25 29.25 13.331 29.25 27C29.25 29.5042 29.6212 31.9177 30.3101 34.1905C30.5508 34.9849 30.3347 35.8473 29.7478 36.4342L2.90901 63.273C2.48705 63.6949 2.25 64.2672 2.25 64.864V76.5C2.25 77.7426 3.25736 78.75 4.5 78.75H15.75V72C15.75 70.7574 16.7574 69.75 18 69.75H24.75V63C24.75 61.7574 25.7574 60.75 27 60.75H35.068L44.5658 51.2522ZM36 63H27V72H18V81H4.5C2.01472 81 0 78.9853 0 76.5V64.864C0 63.6705 0.474103 62.5259 1.31802 61.682L28.1568 34.8432C27.4045 32.3611 27 29.7278 27 27C27 12.0883 39.0883 0 54 0C68.9117 0 81 12.0883 81 27C81 41.9117 68.9117 54 54 54C51.2722 54 48.6389 53.5955 46.1568 52.8432L36 63ZM68.625 20.25C68.625 24.5992 65.0992 28.125 60.75 28.125C56.4008 28.125 52.875 24.5992 52.875 20.25C52.875 15.9008 56.4008 12.375 60.75 12.375C65.0992 12.375 68.625 15.9008 68.625 20.25ZM66.375 20.25C66.375 23.3566 63.8566 25.875 60.75 25.875C57.6434 25.875 55.125 23.3566 55.125 20.25C55.125 17.1434 57.6434 14.625 60.75 14.625C63.8566 14.625 66.375 17.1434 66.375 20.25Z",fill:"black",fillOpacity:"0.1"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.4205 47.5795C33.8598 48.0188 33.8598 48.7312 33.4205 49.1705L3.0455 79.5455C2.60616 79.9848 1.89384 79.9848 1.4545 79.5455C1.01517 79.1062 1.01517 78.3938 1.4545 77.9545L31.8295 47.5795C32.2688 47.1402 32.9812 47.1402 33.4205 47.5795Z",fill:"#A5A9AD"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:`${tt}paint0_linear_2509_6177`,x1:"72",y1:"5.625",x2:"2.25",y2:"78.75",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#D4DFE6"}),jsxRuntimeExports.jsx("stop",{offset:"0.0967282",stopColor:"#C6CACD"}),jsxRuntimeExports.jsx("stop",{offset:"0.526645",stopColor:"#BDBAC4"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"#939CA1"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`${tt}paint1_radial_2509_6177`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(52.875 12.375) rotate(93.2705) scale(39.4392)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white"})]})]})]})},VitalikAddress=jsxRuntimeExports.jsxs("svg",{width:"131",height:"14",viewBox:"0 0 131 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M5.74805 13.2549C8.86816 13.2549 10.7227 10.6973 10.7227 6.63672C10.7227 2.57617 8.85059 0.0625 5.74805 0.0625C2.63672 0.0625 0.755859 2.59375 0.755859 6.64551C0.755859 10.7148 2.61914 13.2549 5.74805 13.2549ZM5.74805 11.4004C4.02539 11.4004 3.04102 9.64258 3.04102 6.63672C3.04102 3.68359 4.04297 1.91699 5.74805 1.91699C7.44434 1.91699 8.4375 3.6748 8.4375 6.64551C8.4375 9.65137 7.46191 11.4004 5.74805 11.4004Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M13.0869 13.1758C13.4561 13.1758 13.6934 13.0439 13.9658 12.6221L15.9697 9.66016H16.0137L18.0264 12.6572C18.2549 13.0088 18.4922 13.1758 18.8965 13.1758C19.4854 13.1758 19.9424 12.7891 19.9424 12.209C19.9424 11.9805 19.8633 11.7695 19.7051 11.541L17.376 8.28906L19.6963 5.16016C19.8896 4.90527 19.9688 4.68555 19.9688 4.43066C19.9688 3.88574 19.5381 3.49902 18.9229 3.49902C18.5361 3.49902 18.2988 3.6748 18.0176 4.10547L16.1191 6.95312H16.0752L14.1328 4.08789C13.8516 3.64844 13.6318 3.49902 13.2012 3.49902C12.6035 3.49902 12.1465 3.91211 12.1465 4.44824C12.1465 4.70312 12.2256 4.92285 12.3838 5.13379L14.7129 8.35059L12.3486 11.5498C12.1641 11.8135 12.0762 12.0156 12.0762 12.2705C12.0762 12.7979 12.498 13.1758 13.0869 13.1758Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M26.2441 13.2549C29.1445 13.2549 31.1924 11.7432 31.1924 9.57227C31.1924 7.9375 30.0146 6.68066 28.3184 6.3291V6.27637C29.7773 5.87207 30.7178 4.7998 30.7178 3.45508C30.7178 1.48633 28.8633 0.0625 26.2441 0.0625C23.625 0.0625 21.7617 1.49512 21.7617 3.44629C21.7617 4.80859 22.7109 5.88965 24.1699 6.27637V6.3291C22.4736 6.67188 21.3047 7.92871 21.3047 9.57227C21.3047 11.7344 23.335 13.2549 26.2441 13.2549ZM26.2441 5.55566C24.9258 5.55566 24.0029 4.78223 24.0029 3.6748C24.0029 2.55859 24.9258 1.77637 26.2441 1.77637C27.5537 1.77637 28.4854 2.5498 28.4854 3.6748C28.4854 4.78223 27.5537 5.55566 26.2441 5.55566ZM26.2441 11.5234C24.7236 11.5234 23.6514 10.6357 23.6514 9.40527C23.6514 8.1748 24.7236 7.28711 26.2441 7.28711C27.7646 7.28711 28.8369 8.16602 28.8369 9.40527C28.8369 10.6357 27.7646 11.5234 26.2441 11.5234Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M36.3164 13.1494C37.7578 13.1494 38.7598 12.4199 39.208 11.3477H39.252V12.0771C39.252 12.7891 39.7266 13.1758 40.3594 13.1758C40.9922 13.1758 41.4404 12.7803 41.4404 12.0771V1.29297C41.4404 0.554688 40.9834 0.141602 40.3418 0.141602C39.7002 0.141602 39.252 0.554688 39.252 1.29297V5.24805H39.1992C38.707 4.21973 37.6523 3.52539 36.3164 3.52539C33.9697 3.52539 32.4492 5.38867 32.4492 8.33301C32.4492 11.2949 33.9697 13.1494 36.3164 13.1494ZM36.9756 11.3564C35.5605 11.3564 34.6904 10.1963 34.6904 8.3418C34.6904 6.49609 35.5693 5.32715 36.9756 5.32715C38.3555 5.32715 39.2607 6.51367 39.2607 8.3418C39.2607 10.1875 38.3555 11.3564 36.9756 11.3564Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M44.0508 13.1494C44.6396 13.1494 44.9736 12.8594 45.1846 12.1738L46.0195 9.76562H50.7568L51.5918 12.1914C51.7939 12.8682 52.1367 13.1494 52.752 13.1494C53.4111 13.1494 53.8857 12.7188 53.8857 12.1035C53.8857 11.9014 53.8418 11.6992 53.7363 11.4092L50.0449 1.38965C49.7285 0.537109 49.2188 0.167969 48.3838 0.167969C47.5576 0.167969 47.0479 0.554688 46.7402 1.39844L43.0576 11.4092C42.9521 11.6816 42.9082 11.9277 42.9082 12.1035C42.9082 12.7451 43.3564 13.1494 44.0508 13.1494ZM46.5557 7.97266L48.3398 2.55859H48.4014L50.2031 7.97266H46.5557Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M60.1172 13.2549C62.8594 13.2549 64.8545 11.4004 64.8545 8.8252C64.8545 6.42578 63.1406 4.66797 60.6973 4.66797C58.9746 4.66797 57.709 5.54688 57.208 6.71582H57.1641V6.58398C57.208 3.66602 58.2275 1.89941 60.1436 1.89941C61.084 1.89941 61.7607 2.26855 62.3496 3.07715C62.7012 3.52539 62.9824 3.73633 63.4307 3.73633C64.0283 3.73633 64.3975 3.34082 64.3975 2.82227C64.3975 2.57617 64.3359 2.35645 64.1953 2.10156C63.5625 0.897461 62.0859 0.0537109 60.1523 0.0537109C56.9268 0.0537109 54.9932 2.57617 54.9932 6.80371C54.9932 8.24512 55.2305 9.45801 55.6963 10.4336C56.5752 12.2881 58.1396 13.2549 60.1172 13.2549ZM60.082 11.4092C58.667 11.4092 57.5508 10.293 57.5508 8.86914C57.5508 7.4541 58.6494 6.41699 60.1084 6.41699C61.5674 6.41699 62.6309 7.4541 62.6221 8.91309C62.6221 10.3018 61.4971 11.4092 60.082 11.4092Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M68.1328 8.83398C68.8447 8.83398 69.416 8.27148 69.416 7.55078C69.416 6.83008 68.8447 6.25879 68.1328 6.25879C67.4121 6.25879 66.8408 6.83008 66.8408 7.55078C66.8408 8.27148 67.4121 8.83398 68.1328 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M73.3359 8.83398C74.0479 8.83398 74.6191 8.27148 74.6191 7.55078C74.6191 6.83008 74.0479 6.25879 73.3359 6.25879C72.6152 6.25879 72.0439 6.83008 72.0439 7.55078C72.0439 8.27148 72.6152 8.83398 73.3359 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M78.5391 8.83398C79.251 8.83398 79.8223 8.27148 79.8223 7.55078C79.8223 6.83008 79.251 6.25879 78.5391 6.25879C77.8184 6.25879 77.2471 6.83008 77.2471 7.55078C77.2471 8.27148 77.8184 8.83398 78.5391 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M83.7422 8.83398C84.4541 8.83398 85.0254 8.27148 85.0254 7.55078C85.0254 6.83008 84.4541 6.25879 83.7422 6.25879C83.0215 6.25879 82.4502 6.83008 82.4502 7.55078C82.4502 8.27148 83.0215 8.83398 83.7422 8.83398Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M92.2148 13.2549C94.957 13.2549 96.9521 11.4004 96.9521 8.8252C96.9521 6.42578 95.2383 4.66797 92.7949 4.66797C91.0723 4.66797 89.8066 5.54688 89.3057 6.71582H89.2617V6.58398C89.3057 3.66602 90.3252 1.89941 92.2412 1.89941C93.1816 1.89941 93.8584 2.26855 94.4473 3.07715C94.7988 3.52539 95.0801 3.73633 95.5283 3.73633C96.126 3.73633 96.4951 3.34082 96.4951 2.82227C96.4951 2.57617 96.4336 2.35645 96.293 2.10156C95.6602 0.897461 94.1836 0.0537109 92.25 0.0537109C89.0244 0.0537109 87.0908 2.57617 87.0908 6.80371C87.0908 8.24512 87.3281 9.45801 87.7939 10.4336C88.6729 12.2881 90.2373 13.2549 92.2148 13.2549ZM92.1797 11.4092C90.7646 11.4092 89.6484 10.293 89.6484 8.86914C89.6484 7.4541 90.7471 6.41699 92.2061 6.41699C93.665 6.41699 94.7285 7.4541 94.7197 8.91309C94.7197 10.3018 93.5947 11.4092 92.1797 11.4092Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M103.377 13.2549C106.497 13.2549 108.352 10.6973 108.352 6.63672C108.352 2.57617 106.479 0.0625 103.377 0.0625C100.266 0.0625 98.3848 2.59375 98.3848 6.64551C98.3848 10.7148 100.248 13.2549 103.377 13.2549ZM103.377 11.4004C101.654 11.4004 100.67 9.64258 100.67 6.63672C100.67 3.68359 101.672 1.91699 103.377 1.91699C105.073 1.91699 106.066 3.6748 106.066 6.64551C106.066 9.65137 105.091 11.4004 103.377 11.4004Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M117.167 13.1758C117.8 13.1758 118.248 12.7715 118.248 12.0596V10.5654H119.127C119.733 10.5654 120.094 10.1875 120.094 9.63379C120.094 9.08887 119.733 8.70215 119.136 8.70215H118.248V1.81152C118.248 0.756836 117.554 0.141602 116.385 0.141602C115.453 0.141602 114.899 0.52832 114.073 1.75879C112.553 3.99121 111.111 6.16211 110.224 7.75293C109.872 8.38574 109.731 8.79883 109.731 9.29102C109.731 10.0469 110.268 10.5654 111.085 10.5654H116.086V12.0596C116.086 12.7715 116.543 13.1758 117.167 13.1758ZM116.121 8.75488H111.788V8.69336C112.816 6.82129 114.073 4.92285 116.086 2.04004H116.121V8.75488Z",fill:"var(--ck-body-color)"}),jsxRuntimeExports.jsx("path",{d:"M126.105 13.2549C128.918 13.2549 130.869 11.4355 130.869 8.78125C130.869 6.35547 129.138 4.6416 126.712 4.6416C125.438 4.6416 124.392 5.13379 123.855 5.9248H123.812L124.146 2.17188H129.27C129.85 2.17188 130.228 1.80273 130.228 1.24023C130.228 0.686523 129.85 0.317383 129.27 0.317383H123.803C122.81 0.317383 122.3 0.72168 122.221 1.72363L121.816 6.51367C121.808 6.56641 121.808 6.60156 121.808 6.6543C121.79 7.26953 122.15 7.78809 122.88 7.78809C123.398 7.78809 123.618 7.67383 124.146 7.14648C124.629 6.67188 125.323 6.34668 126.123 6.34668C127.617 6.34668 128.681 7.38379 128.681 8.84277C128.681 10.3457 127.617 11.4092 126.114 11.4092C124.893 11.4092 124.049 10.8027 123.618 9.77441C123.381 9.30859 123.091 9.12402 122.616 9.12402C122.019 9.12402 121.641 9.49316 121.641 10.082C121.641 10.4072 121.72 10.6709 121.843 10.9434C122.467 12.3232 124.154 13.2549 126.105 13.2549Z",fill:"var(--ck-body-color)"})]}),SlideOne=({layoutId:et})=>jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[jsxRuntimeExports.jsx(motion.div,{initial:{rotate:90,scale:.2,x:"100%"},animate:{rotate:0,scale:1,x:0},exit:{rotate:40,scale:.1,x:"70%"},style:{zIndex:4,position:"relative",display:"flex",alignItems:"center",justifyContent:"center",width:76,height:76,background:"var(--ck-graphic-secondary-background, #6366F1)",borderRadius:"50%",boxShadow:"var(--ck-graphic-secondary-box-shadow, 0px 2px 10px rgba(99, 102, 241, 0.3))"},children:Receive}),jsxRuntimeExports.jsx(MainCircle,{layoutId:et,style:{position:"relative",zIndex:10,margin:"0 -8px",width:112,height:112},children:jsxRuntimeExports.jsxs(MainCircleInner,{style:{background:"var(--ck-graphic-primary-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-primary-box-shadow, 0px 3px 15px rgba(0, 0, 0, 0.1))"},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[jsxRuntimeExports.jsx(BgLighten,{}),jsxRuntimeExports.jsx(motion.div,{style:{zIndex:2,position:"relative"},children:jsxRuntimeExports.jsx(Wallet,{})})]},"SlideOneInner")},et),jsxRuntimeExports.jsx(motion.div,{initial:{rotate:-90,scale:.2,x:"-100%"},animate:{rotate:0,scale:1,x:0},exit:{rotate:-40,scale:.1,x:"-70%"},style:{zIndex:4,position:"relative",width:76,height:76,background:"var(--ck-graphic-secondary-background, #3897FB)",borderRadius:"50%",boxShadow:"var(--ck-graphic-secondary-box-shadow, 0px 2px 10px rgba(56, 151, 251, 0.3))"},children:jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx("div",{style:{position:"relative",left:-2,top:3},children:Send})})})]}),SlideTwo=({layoutId:et})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{style:{position:"relative",left:-14},children:[jsxRuntimeExports.jsx(MainCircle,{layoutId:et,style:{zIndex:10,position:"absolute",left:15,top:12,width:32,height:32},children:jsxRuntimeExports.jsx(MainCircleInner,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{background:"var(--ck-graphic-primary-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-primary-box-shadow, 0px 2px 5px rgba(37, 41, 46, 0.16))"},children:jsxRuntimeExports.jsx(Center,{children:jsxRuntimeExports.jsx(Wallet,{})})},"SlideTwoInner")},et),jsxRuntimeExports.jsxs(motion.div,{initial:{scale:.2},animate:{scale:1},exit:{scale:.2},style:{zIndex:7,position:"relative",display:"flex",alignItems:"center",padding:"21px 56px",paddingRight:52,background:"var(--ck-graphic-primary-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-primary-box-shadow, 0px 2px 9px rgba(0, 0, 0, 0.07))",borderRadius:"var(--ck-border-radius, 16px)"},children:[jsxRuntimeExports.jsx(BgLighten,{}),jsxRuntimeExports.jsx("div",{style:{position:"relative",zIndex:2,top:1,left:1},children:VitalikAddress})]}),jsxRuntimeExports.jsx(motion.div,{style:{zIndex:8,position:"absolute",top:-16,right:-28},initial:{rotate:90,x:-70,scale:.4},animate:{rotate:0,x:0,scale:1},exit:{rotate:0,x:-70,scale:.4},children:jsxRuntimeExports.jsx(Key$1,{id:et})})]})}),SlideThree=({layoutId:et})=>{const o=Math.random();return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(motion.div,{style:{position:"relative"},children:[jsxRuntimeExports.jsxs(MainCircle,{layoutId:et,initial:{rotate:80},style:{zIndex:10,position:"relative",width:128,height:128},children:[jsxRuntimeExports.jsx(MainCircleInner,{initial:{opacity:0,rotate:100},animate:{opacity:1},exit:{opacity:0},style:{overflow:"hidden",background:`var(--ck-graphic-globe-background, radial-gradient( - 82.42% 82.42% at 50% 86.72%, - rgba(255, 255, 255, 0.2) 0%, - rgba(0, 0, 0, 0) 100% - ), - linear-gradient(180deg, #3897FB 0%, #5004F1 100%))`,boxShadow:"var(--ck-graphic-globe-box-shadow, 0px -6px 20px rgba(56, 151, 251, 0.23))"},children:jsxRuntimeExports.jsx(SpinContainer,{style:et?void 0:{animationPlayState:"paused"},children:jsxRuntimeExports.jsxs("svg",{width:"128",height:"128",viewBox:"0 0 128 128",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{children:[jsxRuntimeExports.jsx("circle",{cx:"30",cy:"141",r:"64",stroke:`url(#networkRadialA-${o})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"78.8515",cy:"131.123",r:"54.1005",transform:"rotate(-37.4016 78.8515 131.123)",stroke:`url(#networkRadialB-${o})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"63.6053",cy:"2.12794",r:"50.8338",transform:"rotate(134.702 63.6053 2.12794)",stroke:`url(#networkRadialC-${o})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"126.658",cy:"56.6577",r:"50.3433",transform:"rotate(-105 126.658 56.6577)",stroke:`url(#networkRadialD-${o})`,strokeWidth:"3"}),jsxRuntimeExports.jsx("circle",{cx:"13.6619",cy:"18.9603",r:"46.0247",transform:"rotate(107.362 13.6619 18.9603)",stroke:`url(#networkRadialE-${o})`,strokeWidth:"3"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialA-${o}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(60.5 84) rotate(104.668) scale(77.0097)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialB-${o}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(96.1805 81.6717) rotate(97.125) scale(64.7443)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialC-${o}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(96.3816 -36.4455) rotate(114.614) scale(57.7177)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialD-${o}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(137.86 7.73234) rotate(92.3288) scale(62.743)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:`networkRadialE-${o}`,cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(35.3203 -21.566) rotate(104.513) scale(54.8617)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-globe-lines, white)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-globe-lines, white)",stopOpacity:"0"})]})]})]})})},"SlideThreeInner"),jsxRuntimeExports.jsxs(motion.div,{exit:{opacity:0},children:[jsxRuntimeExports.jsx(motion.div,{initial:et?void 0:{scale:1.1},animate:et?pulseAnim:void 0,transition:{...pulseTransition},style:{position:"absolute",inset:0,borderRadius:"50%",boxShadow:"0 0 0 2px var(--ck-graphic-globe-lines, rgba(126, 112, 243, 1))"}},"pulseA"),jsxRuntimeExports.jsx(motion.div,{initial:et?void 0:{scale:1.2,opacity:.25},animate:et?pulseAnim:void 0,transition:{...pulseTransition,delay:.5},style:{position:"absolute",inset:0,borderRadius:"50%",boxShadow:"0 0 0 2px var(--ck-graphic-globe-lines, rgba(126, 112, 243, 1))"}},"pulseB")]})]},et),jsxRuntimeExports.jsxs(motion.div,{initial:{rotate:-20,scale:.1,y:-10,x:-10},animate:{rotate:0,scale:1,y:0,x:0},exit:{zIndex:3,scale:.2,y:-25,x:15},style:{zIndex:12,borderRadius:"50%",position:"absolute",bottom:-4,right:-4,width:54,height:54,display:"flex",alignItems:"center",justifyContent:"center",padding:13,background:"var(--ck-graphic-compass-background, var(--ck-body-background))",boxShadow:"var(--ck-graphic-compass-box-shadow, 0px 2px 9px rgba(0, 0, 0, 0.15))"},children:[jsxRuntimeExports.jsx(BgLighten,{}),jsxRuntimeExports.jsx(motion.div,{style:{zIndex:2,position:"absolute"},initial:{rotate:-170},animate:{rotate:0},exit:{rotate:-180,transition:{duration:0}},transition:{type:"spring",stiffness:6,damping:.9,mass:.2},children:Compass})]})]},"SlideThree")})},About=()=>{var et,o;const tt=useLocales({}),rt=useContext(),nt=(o=(et=rt.options)===null||et===void 0?void 0:et.ethereumOnboardingUrl)!==null&&o!==void 0?o:tt.aboutScreen_ctaUrl,[ot,it]=reactExports.useState(!0),[st,at]=reactExports.useState(0),ct=reactExports.useRef(!1),lt=reactExports.useRef(0),dt=[.16,1,.3,1],ht=600;let mt;reactExports.useEffect(()=>()=>clearInterval(mt),[]);const ft=()=>{if(Et.current){const{overflow:It}=getComputedStyle(Et.current);return It!=="visible"}return!1},pt=It=>{it(!1),ft()?yt(It):at(It)},yt=It=>{if(Et.current){const{offsetWidth:Nt}=Et.current;Et.current.scrollLeft=Nt*It,setTimeout(()=>at(It),100)}},gt=()=>{if(!Et.current)return;const{offsetWidth:It,scrollLeft:Nt}=Et.current,Lt=lt.current;lt.current=Nt;const Mt=4;if(Lt-Nt>-Mt&&Lt-Nt{vt()},xt=()=>{const{offsetWidth:It,scrollLeft:Nt}=Et.current,Lt=Math.round(Nt/It);at(Lt)},vt=()=>{ct.current=!0,clearTimeout(mt)},Et=reactExports.useRef(null);reactExports.useEffect(()=>{if(Et.current)return Et.current.addEventListener("scroll",gt),Et.current.addEventListener("touchmove",bt),Et.current.addEventListener("touchend",xt),()=>{Et.current&&(Et.current.removeEventListener("scroll",gt),Et.current.removeEventListener("touchmove",bt),Et.current.removeEventListener("touchend",xt))}},[Et]);const Ct=[jsxRuntimeExports.jsx(SlideOne,{layoutId:"graphicCircle",duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideTwo,{layoutId:"graphicCircle",duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideThree,{layoutId:"graphicCircle",duration:ht,ease:dt})],St=[jsxRuntimeExports.jsx(SlideOne,{duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideTwo,{duration:ht,ease:dt}),jsxRuntimeExports.jsx(SlideThree,{duration:ht,ease:dt})],At=(()=>{var It;switch((It=rt.options)===null||It===void 0?void 0:It.language){case"en-US":case"zh-CN":return 64;default:return 84}})(),kt=[jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ModalH1,{style:{height:24},$small:!0,children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_a_h1})}),jsxRuntimeExports.jsx(ModalBody,{style:{height:At},children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_a_p})})]}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ModalH1,{style:{height:24},$small:!0,children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_b_h1})}),jsxRuntimeExports.jsx(ModalBody,{style:{height:At},children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_b_p})})]}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ModalH1,{style:{height:24},$small:!0,children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_c_h1})}),jsxRuntimeExports.jsx(ModalBody,{style:{height:At},children:jsxRuntimeExports.jsx(FitText,{children:tt.aboutScreen_c_p})})]})];return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(Slider,{children:[jsxRuntimeExports.jsx(ImageContainer$1,{children:jsxRuntimeExports.jsx(MotionConfig,{transition:{duration:ht/1e3,ease:dt},children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,onExitComplete:()=>it(!0),children:Ct.map((It,Nt)=>st===Nt&&jsxRuntimeExports.jsx(ImageContainerInner,{style:{position:"absolute"},children:It},Nt))})})}),jsxRuntimeExports.jsx(Slides,{ref:Et,children:jsxRuntimeExports.jsx(AnimatePresence,{children:kt.map((It,Nt)=>jsxRuntimeExports.jsxs(Slide,{$active:st===Nt,children:[jsxRuntimeExports.jsx(MobileImageContainer,{children:jsxRuntimeExports.jsx(MotionConfig,{transition:{duration:0},children:jsxRuntimeExports.jsx(ImageContainerInner,{children:St[Nt]})})}),jsxRuntimeExports.jsx(ModalContent,{style:{gap:8,paddingBottom:0},children:It})]},Nt))})})]}),jsxRuntimeExports.jsx(OrDivider,{children:jsxRuntimeExports.jsx(Dots,{children:kt.map((It,Nt)=>jsxRuntimeExports.jsx(Dot,{$active:st===Nt,onClick:()=>{vt(),pt(Nt)}},Nt))})}),jsxRuntimeExports.jsx(Button$1,{href:nt,arrow:!0,children:tt.aboutScreen_ctaText})]})},Shimmer$1=We` - 0%{ transform: translate(-100%) rotate(-45deg); } - 100%{ transform: translate(100%) rotate(-80deg); } -`,InfoBox=styled.div` - padding: 24px 24px 28px; - border-radius: var(--ck-tertiary-border-radius, 24px); - box-shadow: var(--ck-tertiary-box-shadow, none); - background: var(--ck-body-background-tertiary); - ${ModalBody} { - max-width: none; - } -`,InfoBoxButtons=styled.div` - display: grid; - grid-template-columns: 1fr 1fr; - gap: 16px; - margin: 5px -8px -12px; - button { - } -`,LearnMoreContainer=styled(motion.div)` - text-align: center; - margin-top: 16px; - margin-bottom: -6px; -`,LearnMoreButton=styled(motion.button)` - appearance: none; - user-select: none; - cursor: pointer; - display: inline-flex; - align-items: center; - justify-content: center; - gap: 10px; - height: 42px; - padding: 0 16px; - border-radius: 6px; - background: none; - color: var(--ck-body-color-muted); - font-size: 15px; - line-height: 18px; - font-weight: 500; - /* will-change: transform; */ - transition: color 200ms ease, transform 100ms ease; - svg { - transition: all 100ms ease-out; - display: block; - position: relative; - top: 2px; - left: 2px; - transform: translateZ(0px); - path, - circle { - transition: all 100ms ease-out; - } - path:last-of-type { - transform-origin: 0 0; - transform: scaleX(1.3) skewY(-12deg); - opacity: 0; - } - circle { - transform: translate(20%, -15%); - } - } - &:hover { - color: var(--ck-body-color-muted-hover); - svg { - path, - circle { - opacity: 1; - transform: none; - } - } - } - &:active { - transform: scale(0.96); - } -`;styled(motion.div)` - display: flex; - flex-direction: column; - gap: 12px; - padding: 0 0 16px; - overflow-y: scroll; - max-height: 20rem; - - &::-webkit-scrollbar { - display: none; - } -`;styled(motion.button)` - cursor: pointer; - user-select: none; - position: relative; - display: flex; - align-items: center; - padding: 0 20px; - width: 100%; - height: 64px; - font-size: 17px; - font-weight: var(--ck-primary-button-font-weight, 500); - line-height: 20px; - text-align: var(--ck-body-button-text-align, left); - transition: 180ms ease; - transition-property: background, color, box-shadow, transform, opacity; - will-change: transform, box-shadow, background-color, color, opacity; - - --fallback-color: var(--ck-primary-button-color); - --fallback-background: var(--ck-primary-button-background); - --fallback-box-shadow: var(--ck-primary-button-box-shadow); - --fallback-border-radius: var(--ck-primary-button-border-radius); - - --color: var(--ck-primary-button-color, var(--fallback-color)); - --background: var(--ck-primary-button-background, var(--fallback-background)); - --box-shadow: var(--ck-primary-button-box-shadow, var(--fallback-box-shadow)); - --border-radius: var( - --ck-primary-button-border-radius, - var(--fallback-border-radius) - ); - - --hover-color: var(--ck-primary-button-hover-color, var(--color)); - --hover-background: var( - --ck-primary-button-hover-background, - var(--background) - ); - --hover-box-shadow: var( - --ck-primary-button-hover-box-shadow, - var(--box-shadow) - ); - --hover-border-radius: var( - --ck-primary-button-hover-border-radius, - var(--border-radius) - ); - - --active-color: var(--ck-primary-button-active-color, var(--hover-color)); - --active-background: var( - --ck-primary-button-active-background, - var(--hover-background) - ); - --active-box-shadow: var( - --ck-primary-button-active-box-shadow, - var(--hover-box-shadow) - ); - --active-border-radius: var( - --ck-primary-button-active-border-radius, - var(--hover-border-radius) - ); - - color: var(--color); - background: var(--background); - box-shadow: var(--box-shadow); - border-radius: var(--border-radius); - - &:disabled { - transition: 180ms ease; - opacity: 0.4; - } - - --bg: var(--background); - &:not(:disabled) { - &:hover { - color: var(--hover-color); - background: var(--hover-background); - box-shadow: var(--hover-box-shadow); - border-radius: var(--hover-border-radius); - --bg: var(--hover-background, var(--background)); - } - &:focus-visible { - transition-duration: 100ms; - color: var(--hover-color); - background: var(--hover-background); - box-shadow: var(--hover-box-shadow); - border-radius: var(--hover-border-radius); - --bg: var(--hover-background, var(--background)); - } - &:active { - color: var(--active-color); - background: var(--active-background); - box-shadow: var(--active-box-shadow); - border-radius: var(--active-border-radius); - --bg: var(--active-background, var(--background)); - } - } -`;styled(motion.span)` - position: relative; - top: var(--ck-recent-badge-top-offset, 0.5px); - display: inline-block; - padding: 10px 7px; - line-height: 0; - font-size: 13px; - font-weight: 400; - border-radius: var(--ck-recent-badge-border-radius, var(--border-radius)); - color: var( - --ck-recent-badge-color, - var(--ck-accent-color, var(--ck-body-color-muted, currentColor)) - ); - background: var(--ck-recent-badge-background, transparent); - overflow: hidden; - span { - display: inline-block; - position: relative; - } - &:before { - z-index: 1; - content: ''; - position: absolute; - inset: 0; - opacity: 0.4; - box-shadow: var(--ck-recent-badge-box-shadow, inset 0 0 0 1px currentColor); - border-radius: inherit; - } - &:after { - z-index: 2; - content: ''; - position: absolute; - inset: -10%; - top: -110%; - aspect-ratio: 1/1; - opacity: 0.7; - background: linear-gradient( - 170deg, - transparent 10%, - var(--ck-recent-badge-background, var(--bg)) 50%, - transparent 90% - ); - animation: ${Shimmer$1} 2s linear infinite; - } -`;styled(motion.span)` - display: flex; - align-items: center; - gap: 9px; - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - padding: 2px 0; - padding-right: 38px; -`;styled(motion.div)` - position: absolute; - right: 20px; - width: 32px; - height: 32px; - overflow: hidden; - svg, - img { - display: block; - position: relative; - pointer-events: none; - overflow: hidden; - border-radius: 27.5%; - width: 100%; - height: 100%; - } -`;var WalletIcon$1=({...et})=>jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"20",height:"19",viewBox:"0 0 20 19",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:[jsxRuntimeExports.jsx("path",{d:"M1.57568 4.60616C1.57568 2.69827 3.12234 1.15161 5.03023 1.15161H15.3939C17.3018 1.15161 18.8484 2.69826 18.8484 4.60616V10.3637C18.8484 12.2716 17.3018 13.8183 15.3939 13.8183H5.03023C3.12234 13.8183 1.57568 12.2716 1.57568 10.3637V4.60616Z",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M1 4.79293C1 2.435 3.31004 0.770014 5.54697 1.51566L12.4561 3.81869C13.8667 4.2889 14.8182 5.60901 14.8182 7.09596V13.6313C14.8182 15.9892 12.5081 17.6542 10.2712 16.9086L3.36212 14.6056C1.95149 14.1353 1 12.8152 1 11.3283V4.79293Z",fill:"var(--ck-body-background)",stroke:"currentColor",strokeWidth:"2"}),jsxRuntimeExports.jsx("circle",{cx:"10.3863",cy:"10.1894",r:"1.32574",fill:"currentColor"})]});const Shimmer=We` - 0%{ transform: translate(-100%) rotate(-45deg); } - 100%{ transform: translate(100%) rotate(-80deg); } -`,ConnectorButton=styled(motion.button)` - display: block; - text-decoration: none; -`,ConnectorLabel=styled(motion.span)``,ConnectorIcon=styled(motion.div)``,styles={desktop:{ConnectorButton:Ae` - cursor: pointer; - user-select: none; - position: relative; - display: flex; - align-items: center; - padding: 0 20px; - width: 100%; - height: 64px; - font-size: 17px; - font-weight: var(--ck-primary-button-font-weight, 500); - line-height: 20px; - text-align: var(--ck-body-button-text-align, left); - transition: 180ms ease; - transition-property: background, color, box-shadow, transform, opacity; - will-change: transform, box-shadow, background-color, color, opacity; - - --fallback-color: var(--ck-primary-button-color); - --fallback-background: var(--ck-primary-button-background); - --fallback-box-shadow: var(--ck-primary-button-box-shadow); - --fallback-border-radius: var(--ck-primary-button-border-radius); - - --color: var(--ck-primary-button-color, var(--fallback-color)); - --background: var( - --ck-primary-button-background, - var(--fallback-background) - ); - --box-shadow: var( - --ck-primary-button-box-shadow, - var(--fallback-box-shadow) - ); - --border-radius: var( - --ck-primary-button-border-radius, - var(--fallback-border-radius) - ); - - --hover-color: var(--ck-primary-button-hover-color, var(--color)); - --hover-background: var( - --ck-primary-button-hover-background, - var(--background) - ); - --hover-box-shadow: var( - --ck-primary-button-hover-box-shadow, - var(--box-shadow) - ); - --hover-border-radius: var( - --ck-primary-button-hover-border-radius, - var(--border-radius) - ); - - --active-color: var(--ck-primary-button-active-color, var(--hover-color)); - --active-background: var( - --ck-primary-button-active-background, - var(--hover-background) - ); - --active-box-shadow: var( - --ck-primary-button-active-box-shadow, - var(--hover-box-shadow) - ); - --active-border-radius: var( - --ck-primary-button-active-border-radius, - var(--hover-border-radius) - ); - - color: var(--color); - background: var(--background); - box-shadow: var(--box-shadow); - border-radius: var(--border-radius); - - &:disabled { - transition: 180ms ease; - opacity: 0.4; - } - - --bg: var(--background); - &:not(:disabled) { - &:hover { - color: var(--hover-color); - background: var(--hover-background); - box-shadow: var(--hover-box-shadow); - border-radius: var(--hover-border-radius); - --bg: var(--hover-background, var(--background)); - } - &:focus-visible { - transition-duration: 100ms; - color: var(--hover-color); - background: var(--hover-background); - box-shadow: var(--hover-box-shadow); - border-radius: var(--hover-border-radius); - --bg: var(--hover-background, var(--background)); - } - &:active { - color: var(--active-color); - background: var(--active-background); - box-shadow: var(--active-box-shadow); - border-radius: var(--active-border-radius); - --bg: var(--active-background, var(--background)); - } - } - `,ConnectorLabel:Ae` - display: flex; - align-items: center; - gap: 9px; - width: 100%; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - padding: 2px 0; - padding-right: 38px; - `,ConnectorIcon:Ae` - position: absolute; - right: 20px; - width: 32px; - height: 32px; - overflow: hidden; - svg, - img { - display: block; - position: relative; - pointer-events: none; - overflow: hidden; - width: 100%; - height: 100%; - } - - &[data-shape='squircle'] { - border-radius: 22.5%; - } - &[data-shape='circle'] { - border-radius: 100%; - } - &[data-shape='square'] { - border-radius: 0; - } - `},mobile:{ConnectorButton:Ae` - text-align: center; - background: none; - max-width: 100%; - overflow: hidden; - `,ConnectorLabel:Ae` - display: block; - text-overflow: ellipsis; - max-width: 100%; - overflow: hidden; - padding: 10px 0 0; - color: var(--ck-body-color); - font-size: 13px; - line-height: 15px; - font-weight: 500; - opacity: 0.75; - `,ConnectorIcon:Ae` - position: relative; - margin: 0 auto; - width: 60px; - height: 60px; - overflow: hidden; - svg, - img { - display: block; - position: relative; - width: 100%; - height: auto; - } - &[data-small='true'] { - svg, - img { - transform: scale(0.8); - } - } - - &[data-shape='squircle'] { - border-radius: 22.5%; - &:before { - content: ''; - z-index: -1; - position: absolute; - inset: 0; - border-radius: inherit; - box-shadow: inset 0 0 0 1px var(--ck-body-background-tertiary); - } - } - &[data-shape='circle'] { - border-radius: 100%; - } - &[data-shape='square'] { - border-radius: 0; - } - `}},RecentlyUsedTag=styled(motion.span)` - position: relative; - top: var(--ck-recent-badge-top-offset, 0.5px); - display: inline-block; - padding: 10px 7px; - line-height: 0; - font-size: 13px; - font-weight: 400; - border-radius: var(--ck-recent-badge-border-radius, var(--border-radius)); - color: var( - --ck-recent-badge-color, - var(--ck-accent-color, var(--ck-body-color-muted, currentColor)) - ); - background: var(--ck-recent-badge-background, transparent); - overflow: hidden; - span { - display: inline-block; - position: relative; - } - &:before { - z-index: 1; - content: ''; - position: absolute; - inset: 0; - opacity: 0.4; - box-shadow: var(--ck-recent-badge-box-shadow, inset 0 0 0 1px currentColor); - border-radius: inherit; - } - &:after { - z-index: 2; - content: ''; - position: absolute; - inset: -10%; - top: -110%; - aspect-ratio: 1/1; - opacity: 0.7; - background: linear-gradient( - 170deg, - transparent 10%, - var(--ck-recent-badge-background, var(--bg)) 50%, - transparent 90% - ); - animation: ${Shimmer} 2s linear infinite; - } -`,ConnectorsContainer=styled.div` - transition: opacity 300ms ease; - min-width: fit-content; - - ${et=>et.$disabled&&Ae` - pointer-events: none; - opacity: 0.4; - `} - - ${et=>et.$mobile?Ae` - display: flex; - align-items: flex-start; - justify-content: space-around; - gap: 22px 6px; - //margin: 0px -10px -20px; - padding: 14px 0px 28px; - - ${ConnectorButton} { - flex-shrink: 0; - width: 80px; - ${styles.mobile.ConnectorButton} - ${ConnectorLabel} { - ${styles.mobile.ConnectorLabel} - ${RecentlyUsedTag} { - display: none; - width: fit-content; - margin: 0 auto; - } - } - ${ConnectorIcon} { - ${styles.mobile.ConnectorIcon} - } - } - `:Ae` - display: flex; - flex-direction: column; - gap: 12px; - - ${ConnectorButton} { - ${styles.desktop.ConnectorButton} - ${ConnectorLabel} { - ${styles.desktop.ConnectorLabel} - } - ${ConnectorIcon} { - ${styles.desktop.ConnectorIcon} - } - } - `} -`;function useChains(){var et;const o=useConfig();return((et=o==null?void 0:o.chains)!==null&&et!==void 0?et:[]).map(rt=>rt)}function useConnect({...et}={}){const o=useContext(),{connect:tt,connectAsync:rt,connectors:nt,...ot}=useConnect$1({...et,mutation:{...et.mutation,onError(it){it.message?it.message!=="User rejected request"&&o.log(it.message,it):o.log("Could not connect.",it)}}});return{connect:({connector:it,chainId:st,mutation:at})=>{var ct;return tt({connector:it,chainId:st??((ct=o.options)===null||ct===void 0?void 0:ct.initialChainId)},at)},connectAsync:async({connector:it,chainId:st,mutation:at})=>{var ct;return rt({connector:it,chainId:st??((ct=o.options)===null||ct===void 0?void 0:ct.initialChainId)},at)},connectors:nt,...ot}}function useWalletConnectUri({enabled:et}={enabled:!0}){const{log:o}=useContext(),[tt,rt]=reactExports.useState(void 0),nt=useWalletConnectConnector(),{isConnected:ot}=useAccount(),{connectAsync:it}=useConnect();return reactExports.useEffect(()=>{if(!et)return;async function st(dt){const{type:ht,data:mt}=dt;o("WC Message",ht,mt),ht==="display_uri"&&rt(mt)}async function at(){o("WC Disconnect"),nt&&ct(nt)}async function ct(dt){const ht=await it({connector:dt});return ht||!1}async function lt(dt){try{await ct(dt)}catch(ht){if(o("catch error"),o(ht),ht.code)switch(ht.code){case 4001:o("error.code - User rejected"),lt(dt);break;default:o("error.code - Unknown Error");break}else o("WalletConnect cannot connect.",ht)}}if(ot)rt(void 0);else{if(!nt||tt)return;if(nt&&!ot)return lt(nt),o("add wc listeners"),nt.emitter.on("message",st),nt.emitter.on("disconnect",at),()=>{o("remove wc listeners"),nt.emitter.off("message",st),nt.emitter.off("disconnect",at)}}},[et,nt,ot]),{uri:tt}}function useChainIsSupported(et){const{chains:o}=useConfig();return et?o.some(tt=>tt.id===et):!1}const Web3Context=React.createContext({connect:{getUri:()=>""},dapp:{chains:[]},account:void 0}),Web3ContextProvider=({enabled:et,children:o})=>{const{uri:tt}=useWalletConnectUri({enabled:et}),{address:rt,chain:nt}=useAccount(),ot=useChainIsSupported(nt==null?void 0:nt.id),it=useChains(),st={connect:{getUri:at=>tt},dapp:{chains:it},account:rt?{chain:nt,chainIsSupported:ot,address:rt}:void 0};return jsxRuntimeExports.jsx(Web3Context.Provider,{value:st,children:o})},useWeb3=()=>React.useContext(Web3Context);function useIsMobile(){const[et,o]=reactExports.useState(isMobile());return reactExports.useEffect(()=>{const tt=()=>{o(isMobile())};return window.addEventListener("resize",tt),()=>window.removeEventListener("resize",tt)},[]),et}const ScrollContainer=styled.div` - position: relative; -`,fadeIn=We` -0%{ opacity:0; } -100%{ opacity:1; } -`,MoreIndicator=styled.div` - z-index: 9; - position: absolute; - left: 0; - right: 0; - bottom: 0.75rem; - display: flex; - justify-content: center; - - transition: opacity 300ms ease; - - span { - cursor: pointer; - display: inline-flex; - align-items: center; - justify-content: center; - gap: 0.25rem; - padding: 0.3075rem 0.9375rem 0.375rem; - border-radius: 6rem; - background: var(--ck-tooltip-background); - color: var(--ck-tooltip-color); - font-weight: 500; - font-size: 0.8125rem; - letter-spacing: -0.01rem; - box-shadow: var(--ck-tooltip-shadow); - animation: ${fadeIn} 300ms ease 1000ms both; - - transition: transform 100ms ease; - - &:hover { - transform: scale(1.02); - } - &:active { - transform: scale(0.98); - } - svg { - display: block; - transform: translateX(-0.1875rem); - } - } - - &.hide { - opacity: 0; - pointer-events: none; - } -`,ScrollAreaContainer=styled.div` - --bg: ${({$backgroundColor:et})=>et||"var(--ck-body-background)"}; - --fade-height: 1px; - position: relative; - z-index: 1; - - ${({$mobile:et,$height:o,$mobileDirection:tt})=>et&&tt==="horizontal"?Ae` - overflow-x: scroll; - margin: 0 -24px; - padding: 0 24px; - - &:before, - &:after { - pointer-events: none; - z-index: 10; - content: ''; - display: block; - position: sticky; - top: 0; - bottom: 0; - width: var(--fade-height); - background: var( - --ck-body-divider-secondary, - var(--ck-body-divider) - ); - box-shadow: var(--ck-body-divider-box-shadow); - transition: opacity 300ms ease; - } - &:before { - left: 0; - } - &:after { - right: 0; - } - - &.scroll-start { - &:before { - opacity: 0; - } - } - - &.scroll-end { - &:after { - opacity: 0; - } - } - `:Ae` - max-height: ${o?`${o}px`:"310px"}; - overflow-y: scroll; - padding: 0 10px; - margin: calc(var(--fade-height) * -1) -16px 0 -10px; - - &:before, - &:after { - pointer-events: none; - z-index: 10; - content: ''; - display: block; - position: sticky; - left: 0; - right: 0; - height: var(--fade-height); - background: var( - --ck-body-divider-secondary, - var(--ck-body-divider) - ); - box-shadow: var(--ck-body-divider-box-shadow); - transition: opacity 300ms ease; - } - &:before { - top: 0; - } - &:after { - bottom: 0; - } - - &.scroll-start { - &:before { - opacity: 0; - } - } - - &.scroll-end { - &:after { - opacity: 0; - } - } - `} - - &::-webkit-scrollbar { - width: 6px; - height: 6px; - } - &::-webkit-scrollbar-track { - background: transparent; - } - &::-webkit-scrollbar-thumb { - background: rgba(0, 0, 0, 0); - border-radius: 100px; - } - &:hover::-webkit-scrollbar-thumb { - background: var(--ck-body-color-muted); - } - &::-webkit-scrollbar-thumb:hover { - background: var(--ck-body-color-muted-hover); - } -`,ArrowDown=()=>jsxRuntimeExports.jsx("svg",{width:"11",height:"12",viewBox:"0 0 11 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M5.49438 1L5.49438 11M5.49438 11L9.5 7M5.49438 11L1.5 7",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})}),ScrollArea$2=({children:et,height:o,backgroundColor:tt,mobileDirection:rt})=>{const nt=reactExports.useRef(null),ot=reactExports.useRef(null),it=useIsMobile();return reactExports.useEffect(()=>{const st=nt.current;if(!st)return;st.scrollHeight>st.clientHeight&&ot.current&&ot.current.classList.remove("hide");const at=ct=>{const{scrollTop:lt,scrollHeight:dt,clientHeight:ht,scrollLeft:mt,scrollWidth:ft,clientWidth:pt}=ct.target;ot.current&<>0&&ot.current.classList.add("hide"),lt===0&&mt===0?st.classList.add("scroll-start"):st.classList.remove("scroll-start"),dt-lt===ht&&ft-mt===pt?st.classList.add("scroll-end"):st.classList.remove("scroll-end")};return st.addEventListener("scroll",at),at({target:st}),()=>{st.removeEventListener("scroll",at)}},[nt.current]),jsxRuntimeExports.jsxs(ScrollContainer,{children:[jsxRuntimeExports.jsx(ScrollAreaContainer,{ref:nt,$mobile:it,$height:o,$backgroundColor:tt,$mobileDirection:rt,children:et}),jsxRuntimeExports.jsx(MoreIndicator,{ref:ot,className:"hide",onClick:()=>{nt.current&&nt.current.scrollTo({top:nt.current.scrollHeight,behavior:"smooth"})},children:jsxRuntimeExports.jsxs("span",{children:[jsxRuntimeExports.jsx(ArrowDown,{})," More Available"]})})]})},AlertContainer=styled(motion.div)` - display: flex; - gap: 8px; - position: relative; - border-radius: 9px; - margin: 0 auto; - padding: 10px; - text-align: left; - font-size: 14px; - line-height: 17px; - font-weight: 400; - max-width: 260px; - min-width: 100%; - - border-radius: var(--ck-alert-border-radius, 12px); - color: var(--ck-alert-color, var(--ck-body-color-muted)); - background: var(--ck-alert-background, var(--ck-body-background-secondary)); - box-shadow: var(--ck-alert-box-shadow, var(--ck-body-box-shadow)); - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - padding: 16px; - font-size: 16px; - line-height: 21px; - border-radius: 24px; - text-align: center; - } - - ${et=>{if(et)return Ae` - color: #fff; - background: var(--ck-body-color-danger, red); - `}} -`,IconContainer$3=styled(motion.div)` - width: 24px; - height: 24px; - display: flex; - align-items: center; - justify-content: center; - svg { - display: block; - width: 100%; - height: auto; - } -`,Alert=({children:et,error:o,icon:tt})=>jsxRuntimeExports.jsxs(AlertContainer,{$error:o,children:[tt&&jsxRuntimeExports.jsx(IconContainer$3,{children:tt}),jsxRuntimeExports.jsx("div",{children:et})]});Alert.displayName="Alert";const useLastConnector=()=>{const{storage:et}=useConfig(),[o,tt]=reactExports.useState(null);return reactExports.useEffect(()=>{(async()=>{const ot=await(et==null?void 0:et.getItem("recentConnectorId"));tt(ot??"")})()},[]),{lastConnectorId:o,updateLastConnectorId:nt=>{et==null||et.setItem("recentConnectorId",nt)}}},ConnectorList=()=>{var et;const o=useContext(),tt=useIsMobile(),rt=useWallets(),{lastConnectorId:nt}=useLastConnector(),ot=!((et=o.options)===null||et===void 0)&&et.hideRecentBadge||nt==="walletConnect"?rt:[...rt.filter(it=>nt===it.connector.id),...rt.filter(it=>nt!==it.connector.id)];return jsxRuntimeExports.jsxs(ScrollArea$2,{mobileDirection:"horizontal",children:[ot.length===0&&jsxRuntimeExports.jsx(Alert,{error:!0,children:"No connectors found in ConnectKit config."}),ot.length>0&&jsxRuntimeExports.jsx(ConnectorsContainer,{$mobile:tt,$totalResults:ot.length,children:ot.map(it=>jsxRuntimeExports.jsx(ConnectorItem,{wallet:it,isRecent:it.id===nt},it.id))})]})},ConnectorItem=({wallet:et,isRecent:o})=>{var tt,rt,nt,ot;const{connect:{getUri:it}}=useWeb3(),st=it(),at=useIsMobile(),ct=useContext(),{connect:lt}=useConnect();let dt=!et.isInstalled&&at||et.shouldDeeplinkDesktop&&!at?(tt=et.getWalletConnectDeeplink)===null||tt===void 0?void 0:tt.call(et,st??""):void 0;const ht=at&&isWalletConnectConnector(et.id),mt=(detectBrowser()==="safari"||detectBrowser()==="ios")&&isCoinbaseWalletConnector(et.connector.id);return(ht||mt)&&(dt=void 0),jsxRuntimeExports.jsxs(ConnectorButton,{type:"button",as:dt?"a":void 0,href:dt||void 0,disabled:ct.route!==routes.CONNECTORS,onClick:dt?void 0:()=>{ht?ct.setRoute(routes.MOBILECONNECTORS):(mt&<({connector:et==null?void 0:et.connector}),ct.setRoute(routes.CONNECT),ct.setConnector({id:et.id}))},children:[jsxRuntimeExports.jsx(ConnectorIcon,{"data-small":et.iconShouldShrink,"data-shape":et.iconShape,children:(rt=et.iconConnector)!==null&&rt!==void 0?rt:et.icon}),jsxRuntimeExports.jsxs(ConnectorLabel,{children:[at&&(nt=et.shortName)!==null&&nt!==void 0?nt:et.name,!(!((ot=ct.options)===null||ot===void 0)&&ot.hideRecentBadge)&&o&&jsxRuntimeExports.jsx(RecentlyUsedTag,{children:jsxRuntimeExports.jsx("span",{children:"Recent"})})]})]})},Wallets=()=>{var et,o,tt,rt,nt;const ot=useContext(),it=useLocales({}),st=useIsMobile();return jsxRuntimeExports.jsxs(PageContent,{style:{width:312},children:[jsxRuntimeExports.jsx(ConnectorList,{}),st?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(InfoBox,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{padding:0,textAlign:"left"},children:[jsxRuntimeExports.jsx(ModalH1,{$small:!0,children:it.connectorsScreen_h1}),jsxRuntimeExports.jsx(ModalBody,{children:it.connectorsScreen_p})]}),jsxRuntimeExports.jsxs(InfoBoxButtons,{children:[!(!((et=ot.options)===null||et===void 0)&&et.hideQuestionMarkCTA)&&jsxRuntimeExports.jsx(Button$1,{variant:"tertiary",onClick:()=>ot.setRoute(routes.ABOUT),children:it.learnMore}),!(!((o=ot.options)===null||o===void 0)&&o.hideNoWalletCTA)&&jsxRuntimeExports.jsx(Button$1,{variant:"tertiary",onClick:()=>ot.setRoute(routes.ONBOARDING),children:it.getWallet})]})]})}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:!(!((tt=ot.options)===null||tt===void 0)&&tt.hideNoWalletCTA)&&jsxRuntimeExports.jsx(LearnMoreContainer,{children:jsxRuntimeExports.jsxs(LearnMoreButton,{onClick:()=>ot.setRoute(routes.ONBOARDING),children:[jsxRuntimeExports.jsx(WalletIcon$1,{})," ",it.connectorsScreen_newcomer]})})}),((rt=ot.options)===null||rt===void 0?void 0:rt.disclaimer)&&jsxRuntimeExports.jsx(Disclaimer,{style:{visibility:"hidden",pointerEvents:"none"},children:jsxRuntimeExports.jsx("div",{children:(nt=ot.options)===null||nt===void 0?void 0:nt.disclaimer})})]})},WalletItem=styled.div` - text-align: center; - transition: opacity 100ms ease; - opacity: ${et=>et.$waiting?.4:1}; -`,WalletIcon=styled.div` - z-index: 9; - position: relative; - margin: 0 auto 10px; - border-radius: 16px; - width: 60px; - height: 60px; - overflow: hidden; - background: rgba(0, 0, 0, 0.04); - ${et=>et.$outline&&` - &:before { - content: ''; - z-index: 2; - position: absolute; - inset: 0; - border-radius: inherit; - box-shadow: inset 0 0 0 1px var(--ck-body-background-tertiary); - }`} - svg { - display: block; - position: relative; - width: 100%; - height: auto; - } -`,WalletLabel=styled.div` - color: var(--ck-body-color); - font-size: 13px; - line-height: 15px; - font-weight: 500; - opacity: 0.75; -`,PulseKeyframes=We` - 0%,100% { opacity:1; } - 50% { opacity:0.5; } -`,WalletList=styled.div` - display: grid; - grid-template-columns: repeat(4, 1fr); - gap: 22px 8px; - margin: 0 -10px; - padding: 4px 0 0; - transition: opacity 300ms ease; - ${et=>et.$disabled&&Ae` - pointer-events: none; - opacity: 0.4; - ${WalletItem} { - animation: ${PulseKeyframes} 1s infinite ease-in-out; - } - `} -`,Container$6=styled.div``;function useWalletConnectModal(){const{log:et}=useContext(),{connectAsync:o,connectors:tt}=useConnect(),[rt,nt]=reactExports.useState(!1);return{isOpen:rt,open:async()=>{const ot=document.createElement("style");ot.innerHTML="w3m-modal, wcm-modal{ --wcm-z-index: 2147483647; --w3m-z-index:2147483647; }",document.head.appendChild(ot);const it=tt.find(st=>isWalletConnectConnector(st.id));if(it)try{const at=(await it.getProvider()).rpc.projectId,ct=walletConnect({projectId:at,showQrModal:!0});nt(!0);try{await o({connector:ct})}catch(lt){et("WalletConnect",lt)}nt(!1),document.head.removeChild(ot)}catch(st){et("Could not get WalletConnect provider",st)}else et("No WalletConnect connector available")}}}const IconContainer$2=styled(motion.div)` - transition: all 220ms cubic-bezier(0.175, 0.885, 0.32, 1.1); - display: flex; - align-items: center; - justify-content: center; - width: 16px; - svg { - display: block; - } - svg, - svg path, - svg rect { - transition: inherit; - } - svg path:first-child { - transform-origin: 50% 50%; - fill: var(--bg); - stroke: var(--color); - } - svg rect { - transform-origin: 53% 63%; - fill: var(--bg); - stroke: var(--color); - } - svg path:last-child { - opacity: 0; - stroke: var(--bg); - transform: translate(11.75px, 10px) rotate(90deg) scale(0.6); - } - ${et=>et.$clipboard?Ae` - --color: var(--ck-focus-color) !important; - --bg: var(--ck-body-background); - svg { - transition-delay: 0ms; - path:first-child { - opacity: 0; - transform: rotate(-90deg) scale(0.2); - } - rect { - rx: 10px; - fill: var(--color); - transform: rotate(-90deg) scale(1.45); - } - path:last-child { - transition-delay: 100ms; - opacity: 1; - transform: translate(7.75px, 9.5px); - } - } - `:Ae` - &:hover { - } - &:hover:active { - } - `} -`,CopyToClipboardIcon=({copied:et,small:o})=>jsxRuntimeExports.jsx(IconContainer$2,{$clipboard:et,children:jsxRuntimeExports.jsx(CopyToClipboardIcon$1,{style:{transform:o?"scale(1)":"translateX(3px) scale(1.5)",opacity:o||et?1:.3}})}),Container$5=styled.div` - --color: var(--ck-copytoclipboard-stroke); - --bg: var(--ck-body-background); - transition: all 220ms cubic-bezier(0.175, 0.885, 0.32, 1.1); - - cursor: pointer; - display: inline-flex; - align-items: center; - justify-content: center; - - ${et=>et.$disabled?Ae` - cursor: not-allowed; - opacity: 0.4; - `:Ae` - &:hover { - --color: var(--ck-body-color-muted); - } - `} -`,OffsetContainer=styled.div` - display: block; - position: relative; - transition: inherit; - svg { - position: absolute; - left: 100%; - display: block; - top: -1px; - margin: 0; - margin-left: 4px; - } -`,CopyToClipboard=({string:et,children:o,variant:tt})=>{const[rt,nt]=reactExports.useState(!1);let ot;const it=()=>{if(!et)return;const st=et.trim();navigator.clipboard&&navigator.clipboard.writeText(st),nt(!0),clearTimeout(ot),ot=setTimeout(()=>nt(!1),1e3)};return tt==="button"?jsxRuntimeExports.jsx(Button$1,{disabled:!et,onClick:it,icon:jsxRuntimeExports.jsx(CopyToClipboardIcon,{copied:rt}),children:o}):jsxRuntimeExports.jsx(Container$5,{onClick:it,$disabled:!et,children:jsxRuntimeExports.jsxs(OffsetContainer,{children:[o,jsxRuntimeExports.jsx(CopyToClipboardIcon,{copied:rt,small:!0})]})})},MoreIcon=jsxRuntimeExports.jsx("svg",{width:"60",height:"60",viewBox:"0 0 60 60",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M30 42V19M19 30.5H42",stroke:"var(--ck-body-color-muted)",strokeWidth:"3",strokeLinecap:"round"})}),MobileConnectors=()=>{var et,o;const tt=useContext(),rt=useLocales(),{connect:{getUri:nt}}=useWeb3(),ot=nt(),{open:it,isOpen:st}=useWalletConnectModal(),at=useWallets(),ct=(et=Object.keys(walletConfigs).filter(dt=>{const ht=walletConfigs[dt];return!(at.find(mt=>mt.connector.id===dt)||!ht.getWalletConnectDeeplink)}))!==null&&et!==void 0?et:[],lt=dt=>{var ht;const mt=(ht=dt.getWalletConnectDeeplink)===null||ht===void 0?void 0:ht.call(dt,ot);mt&&(window.location.href=mt)};return jsxRuntimeExports.jsx(PageContent,{style:{width:312},children:jsxRuntimeExports.jsxs(Container$6,{children:[jsxRuntimeExports.jsx(ModalContent,{style:{paddingBottom:0},children:jsxRuntimeExports.jsx(ScrollArea$2,{height:340,children:jsxRuntimeExports.jsxs(WalletList,{$disabled:!ot,children:[ct.sort((dt,ht)=>{var mt,ft,pt,yt;const gt=walletConfigs[dt],bt=walletConfigs[ht],xt=(ft=(mt=gt.name)!==null&&mt!==void 0?mt:gt.shortName)!==null&&ft!==void 0?ft:dt,vt=(yt=(pt=bt.name)!==null&&pt!==void 0?pt:bt.shortName)!==null&&yt!==void 0?yt:ht;return xt.localeCompare(vt)}).filter(dt=>!(dt==="coinbaseWallet"||dt==="com.coinbase.wallet")).map((dt,ht)=>{const mt=walletConfigs[dt],{name:ft,shortName:pt,iconConnector:yt,icon:gt}=mt;return jsxRuntimeExports.jsxs(WalletItem,{onClick:()=>lt(mt),style:{animationDelay:`${ht*50}ms`},children:[jsxRuntimeExports.jsx(WalletIcon,{$outline:!0,children:yt??gt}),jsxRuntimeExports.jsx(WalletLabel,{children:pt??ft})]},ht)}),jsxRuntimeExports.jsxs(WalletItem,{onClick:it,$waiting:st,children:[jsxRuntimeExports.jsx(WalletIcon,{style:{background:"var(--ck-body-background-secondary)"},children:st?jsxRuntimeExports.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center"},children:jsxRuntimeExports.jsx("div",{style:{width:"50%"},children:jsxRuntimeExports.jsx(Spinner$4,{})})}):MoreIcon}),jsxRuntimeExports.jsx(WalletLabel,{children:rt.more})]})]})})}),((o=tt.options)===null||o===void 0?void 0:o.walletConnectCTA)!=="modal"&&jsxRuntimeExports.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:14,paddingTop:8},children:jsxRuntimeExports.jsx(CopyToClipboard,{variant:"button",string:ot,children:rt.copyToClipboard})})]})})},Content$1=styled(motion.div)` - display: flex; - flex-direction: column; - gap: 6px; - position: relative; - left: 0; - right: 0; - ${ModalContent} { - padding: 0 8px 32px; - gap: 12px; - } -`,dist$1=2,shakeKeyframes=We` - 0%{ transform:none; } - 25%{ transform:translateX(${dist$1}px); } - 50%{ transform:translateX(-${dist$1}px); } - 75%{ transform:translateX(${dist$1}px); } - 100%{ transform:none; } -`,outlineKeyframes=We` - 0%{ opacity:1; } - 100%{ opacity:0; } -`,Container$4=styled(motion.div)` - /* - background: var( - --ck-body-background - ); // To stop the overlay issue during transition for the squircle spinner - */ -`,ConnectingContainer=styled(motion.div)` - display: flex; - align-items: center; - justify-content: center; - margin: 10px auto 16px; - height: 120px; - //transform: scale(1.001); // fixes shifting issue between states -`,ConnectingAnimation=styled(motion.div)` - user-select: none; - position: relative; - --spinner-error-opacity: 0; - &:before { - content: ''; - position: absolute; - inset: 1px; - opacity: 0; - background: var(--ck-body-color-danger); - ${et=>et.$circle&&Ae` - inset: -5px; - border-radius: 50%; - background: none; - box-shadow: inset 0 0 0 3.5px var(--ck-body-color-danger); - `} - } - ${et=>et.$shake&&Ae` - animation: ${shakeKeyframes} 220ms ease-out both; - &:before { - animation: ${outlineKeyframes} 220ms ease-out 750ms both; - } - `} -`,RetryButton=styled(motion.button)` - z-index: 5; - appearance: none; - position: absolute; - right: 2px; - bottom: 2px; - padding: 0; - display: flex; - align-items: center; - justify-content: center; - width: 32px; - height: 32px; - border-radius: 16px; - cursor: pointer; - overflow: hidden; - background: none; - - color: var(--ck-body-background); - transition: color 200ms ease; - box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.15); - - &:before { - z-index: 3; - content: ''; - position: absolute; - inset: 0; - opacity: 0; - transition: opacity 200ms ease; - background: var(--ck-body-color); - } - - &:hover:before { - opacity: 0.1; - } -`,RetryIconContainer=styled(motion.div)` - position: absolute; - inset: 0; - - &:before { - z-index: 1; - content: ''; - position: absolute; - inset: 3px; - border-radius: 16px; - background: conic-gradient( - from 90deg, - currentColor 10%, - var(--ck-body-color) 80% - ); - } - - svg { - z-index: 2; - display: block; - position: relative; - width: 100%; - height: 100%; - } -`,TooltipWindow=styled(motion.div)` - z-index: 2147483647; - position: fixed; - inset: 0; - pointer-events: none; -`,TooltipContainer=styled(motion.div)` - --shadow: var(--ck-tooltip-shadow); - z-index: 2147483647; - position: absolute; - top: 0; - left: 0; - display: flex; - gap: 8px; - width: fit-content; - align-items: center; - justify-content: center; - border-radius: var( - --ck-tooltip-border-radius, - ${et=>et.$size==="small"?11:14}px - ); - border-radius: ; - padding: 10px 16px 10px 12px; - font-size: 14px; - line-height: 19px; - font-weight: 500; - letter-spacing: -0.1px; - color: var(--ck-tooltip-color); - background: var(--ck-tooltip-background); - box-shadow: var(--shadow); - > span { - z-index: 3; - position: relative; - } - > div { - margin: -4px 0; // offset for icon - } - strong { - color: var(--ck-spinner-color); - } - - .ck-tt-logo { - display: inline-block; - vertical-align: text-bottom; - height: 1em; - width: 1.25em; - svg { - display: block; - height: 100%; - transform: translate(0.5px, -1px) scale(1.75); - } - } -`,TooltipTail=styled(motion.div)` - z-index: 2; - position: absolute; - display: flex; - align-items: center; - justify-content: center; - width: ${et=>et.$size==="small"?14:18}px; - right: 100%; - top: 0; - bottom: 0; - overflow: hidden; - &:before { - content: ''; - position: absolute; - box-shadow: var(--shadow); - width: ${et=>et.$size==="small"?14:18}px; - height: ${et=>et.$size==="small"?14:18}px; - transform: translate(75%, 0) rotate(45deg); - background: var(--ck-tooltip-background); - border-radius: ${et=>et.$size==="small"?2:3}px 0 0 0; - } -`,Tooltip=({children:et,message:o,open:tt,xOffset:rt=0,yOffset:nt=0,delay:ot})=>{var it;const st=useContext(),at=useThemeContext();if(!((it=st.options)===null||it===void 0)&&it.hideTooltips)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:et});const[ct,lt]=reactExports.useState(!1),[dt,ht]=reactExports.useState(!1),[mt,ft]=reactExports.useState("small"),[pt,yt]=reactExports.useState(!1),[gt]=reactExports.useState(st.route),bt=reactExports.useRef(null),[xt,vt]=useMeasure({debounce:pt?0:220,offsetSize:!0,scroll:!0}),Et=()=>{let At=!1;const kt=rt+vt.left+vt.width,It=nt+vt.top+vt.height*.5;return(kt>window.innerWidth||kt<0||It>window.innerHeight||It<0)&&(At=!0),At};return(typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect)(()=>{if(!bt.current||vt.top+vt.bottom+vt.left+vt.right+vt.height+vt.width===0)return;const At=rt+vt.left+vt.width,kt=nt+vt.top+vt.height*.5;!pt&&At!==0&&kt!==0&&yt(!0),bt.current.style.left=`${At}px`,bt.current.style.top=`${kt}px`,ft(bt.current.offsetHeight<=40?"small":"large"),ht(Et())},[vt,tt,ct]),reactExports.useEffect(()=>{st.open||lt(!1)},[st.open]),reactExports.useEffect(()=>{lt(!!tt)},[tt]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(motion.div,{ref:xt,style:tt===void 0?{cursor:"help"}:{},onHoverStart:()=>lt(!0),onHoverEnd:()=>lt(!1),onClick:()=>lt(!1),children:et}),jsxRuntimeExports.jsx(Portal$2,{children:jsxRuntimeExports.jsx(AnimatePresence,{children:gt===st.route&&!dt&&ct&&jsxRuntimeExports.jsx(ResetContainer,{$useTheme:at.theme,$useMode:at.mode,$customTheme:at.customTheme,children:jsxRuntimeExports.jsx(TooltipWindow,{children:jsxRuntimeExports.jsxs(TooltipContainer,{role:"tooltip",$size:mt,ref:bt,initial:"collapsed",animate:pt?"open":{},exit:"collapsed",variants:{collapsed:{transformOrigin:"20px 50%",opacity:0,scale:.9,z:.01,y:"-50%",x:20,transition:{duration:.1}},open:{willChange:"opacity,transform",opacity:1,scale:1,z:.01,y:"-50%",x:20,transition:{ease:[.76,0,.24,1],duration:.15,delay:ot||.5}}},children:[o,jsxRuntimeExports.jsx(TooltipTail,{$size:mt})]})})})})})]})},LogoContainer$4=styled(motion.div)` - z-index: 4; - position: relative; - overflow: hidden; - svg { - z-index: 3; - position: relative; - display: block; - } -`,Logo$1=styled(motion.div)` - z-index: 2; - position: absolute; - overflow: hidden; - inset: 6px; - border-radius: 24px; - background: var(--ck-body-background); - svg, - img { - pointer-events: none; - display: block; - width: 100%; - height: 100%; - } -`,SpinnerContainer$1=styled(motion.div)` - position: absolute; - inset: 1px; - overflow: hidden; -`,Spinner$3=styled(motion.div)` - pointer-events: none; - user-select: none; - z-index: 1; - position: absolute; - inset: -25%; - &:before { - content: ''; - position: absolute; - inset: 0; - background: conic-gradient( - from -90deg, - transparent, - transparent, - transparent, - transparent, - transparent, - var(--ck-spinner-color) - ); - animation: rotateSpinner 1200ms linear infinite; - } - @keyframes rotateSpinner { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } - } -`,SquircleSpinner=({logo:et,connecting:o=!0})=>jsxRuntimeExports.jsxs(LogoContainer$4,{transition:{duration:.5,ease:[.175,.885,.32,.98]},children:[jsxRuntimeExports.jsx(Logo$1,{children:et}),jsxRuntimeExports.jsx(SpinnerContainer$1,{children:jsxRuntimeExports.jsx(AnimatePresence,{children:o&&jsxRuntimeExports.jsx(Spinner$3,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:0}}},"Spinner")})}),jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"102",height:"102",viewBox:"0 0 102 102",fill:"none",children:[jsxRuntimeExports.jsx("rect",{x:"7.57895",y:"7.57895",width:"86.8421",height:"86.8421",rx:"19.2211",stroke:"black",strokeOpacity:"0.02",strokeWidth:"1.15789"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M0 0H102V102H0V0ZM7 38.284C7 27.5684 7 22.2106 9.01905 18.0892C10.9522 14.1431 14.1431 10.9522 18.0892 9.01905C22.2106 7 27.5684 7 38.284 7H63.716C74.4316 7 79.7894 7 83.9108 9.01905C87.8569 10.9522 91.0478 14.1431 92.9809 18.0892C95 22.2106 95 27.5684 95 38.284V63.716C95 74.4316 95 79.7894 92.9809 83.9108C91.0478 87.8569 87.8569 91.0478 83.9108 92.9809C79.7894 95 74.4316 95 63.716 95H38.284C27.5684 95 22.2106 95 18.0892 92.9809C14.1431 91.0478 10.9522 87.8569 9.01905 83.9108C7 79.7894 7 74.4316 7 63.716V38.284ZM41.5 0.5H41.4325C34.7246 0.499996 29.6023 0.499994 25.5104 0.823325C21.388 1.14906 18.1839 1.80986 15.3416 3.20227C10.0602 5.78959 5.78959 10.0602 3.20227 15.3416C1.80986 18.1839 1.14906 21.388 0.823325 25.5104C0.499994 29.6023 0.499996 34.7246 0.5 41.4325V41.5V55.5938C0.5 55.6808 0.507407 55.766 0.521624 55.849C0.507407 55.9319 0.5 56.0172 0.5 56.1042V60.5V60.5675C0.499996 67.2754 0.499994 72.3977 0.823325 76.4896C1.14906 80.612 1.80986 83.8161 3.20227 86.6584C5.78959 91.9398 10.0602 96.2104 15.3416 98.7977C18.1839 100.19 21.388 100.851 25.5104 101.177C29.6022 101.5 34.7244 101.5 41.432 101.5H41.4324H41.5H43.4227H60.5H60.5675H60.568C67.2756 101.5 72.3977 101.5 76.4896 101.177C80.612 100.851 83.8161 100.19 86.6584 98.7977C91.9398 96.2104 96.2104 91.9398 98.7977 86.6584C100.19 83.8161 100.851 80.612 101.177 76.4896C101.5 72.3978 101.5 67.2756 101.5 60.568V60.5676V60.5V41.5V41.4324V41.432C101.5 34.7244 101.5 29.6022 101.177 25.5104C100.851 21.388 100.19 18.1839 98.7977 15.3416C96.2104 10.0602 91.9398 5.78959 86.6584 3.20227C83.8161 1.80986 80.612 1.14906 76.4896 0.823325C72.3977 0.499994 67.2754 0.499996 60.5675 0.5H60.5H41.5ZM3.5 56.1042C3.5 56.0172 3.49259 55.9319 3.47838 55.849C3.49259 55.766 3.5 55.6808 3.5 55.5938V41.5C3.5 34.7112 3.50109 29.7068 3.814 25.7467C4.1256 21.8032 4.73946 19.0229 5.89635 16.6614C8.19077 11.9779 11.9779 8.19077 16.6614 5.89635C19.0229 4.73946 21.8032 4.1256 25.7467 3.814C29.7068 3.50109 34.7112 3.5 41.5 3.5H60.5C67.2888 3.5 72.2932 3.50109 76.2533 3.814C80.1968 4.1256 82.977 4.73946 85.3386 5.89635C90.022 8.19077 93.8092 11.9779 96.1036 16.6614C97.2605 19.0229 97.8744 21.8032 98.186 25.7467C98.4989 29.7068 98.5 34.7112 98.5 41.5V60.5C98.5 67.2888 98.4989 72.2932 98.186 76.2533C97.8744 80.1968 97.2605 82.9771 96.1036 85.3386C93.8092 90.022 90.022 93.8092 85.3386 96.1036C82.977 97.2605 80.1968 97.8744 76.2533 98.186C72.2932 98.4989 67.2888 98.5 60.5 98.5H43.4227H41.5C34.7112 98.5 29.7068 98.4989 25.7467 98.186C21.8032 97.8744 19.0229 97.2605 16.6614 96.1036C11.9779 93.8092 8.19077 90.022 5.89635 85.3386C4.73946 82.9771 4.1256 80.1968 3.814 76.2533C3.50109 72.2932 3.5 67.2888 3.5 60.5V56.1042Z",fill:"var(--ck-body-background)"})]})]}),BrowserIconContainer=styled(motion.div)` - display: flex; - align-items: center; - justify-content: center; - max-width: 32px; - max-height: 32px; - width: 100%; - height: 100%; - svg { - display: block; - width: 100%; - height: 100%; - } -`,Chrome=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("g",{filter:"url(#filter0_ii_927_5781)",children:jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_927_5781)",children:[jsxRuntimeExports.jsx("path",{d:"M1.58771 0V12.2727H6.06498L10.0002 5.45455H20.0002V0H1.58771Z",fill:"#DB4437"}),jsxRuntimeExports.jsx("path",{d:"M1.58771 0V12.2727H6.06498L10.0002 5.45455H20.0002V0H1.58771Z",fill:"url(#paint0_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M6.17038 12.2272L1.64538 4.46582L1.57947 4.57946L6.07265 12.284L6.17038 12.2272Z",fill:"black",fillOpacity:"0.15"}),jsxRuntimeExports.jsx("path",{d:"M0 20.0003H9.51932L13.9375 15.5821V12.273H6.0625L0 1.87305V20.0003Z",fill:"#0F9D58"}),jsxRuntimeExports.jsx("path",{d:"M0 20.0003H9.51932L13.9375 15.5821V12.273H6.0625L0 1.87305V20.0003Z",fill:"url(#paint1_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M13.8412 12.4208L13.7469 12.3662L9.38324 19.9969H9.51392L13.8435 12.4242L13.8412 12.4208Z",fill:"#263238",fillOpacity:"0.15"}),jsxRuntimeExports.jsx("path",{d:"M10.0006 5.45459L13.9381 12.2728L9.51996 20H20.0006V5.45459H10.0006Z",fill:"#FFCD40"}),jsxRuntimeExports.jsx("path",{d:"M10.0006 5.45459L13.9381 12.2728L9.51996 20H20.0006V5.45459H10.0006Z",fill:"url(#paint2_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M9.9996 5.45459L13.9371 12.2728L9.51892 20H19.9996V5.45459H9.9996Z",fill:"#FFCD40"}),jsxRuntimeExports.jsx("path",{d:"M9.9996 5.45459L13.9371 12.2728L9.51892 20H19.9996V5.45459H9.9996Z",fill:"url(#paint3_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M1.58691 0V12.2727H6.06419L9.99941 5.45455H19.9994V0H1.58691Z",fill:"#DB4437"}),jsxRuntimeExports.jsx("path",{d:"M1.58691 0V12.2727H6.06419L9.99941 5.45455H19.9994V0H1.58691Z",fill:"url(#paint4_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M10 5.45459V7.83527L18.9091 5.45459H10Z",fill:"url(#paint5_radial_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M0 19.9998H9.51932L11.9318 15.9089L13.9375 12.2726H6.0625L0 1.87256V19.9998Z",fill:"#0F9D58"}),jsxRuntimeExports.jsx("path",{d:"M0 19.9998H9.51932L12.1023 15.5112L13.9375 12.2726H6.0625L0 1.87256V19.9998Z",fill:"url(#paint6_linear_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M1.58771 4.59668L8.09339 11.1012L6.06384 12.2728L1.58771 4.59668Z",fill:"url(#paint7_radial_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M9.52661 19.9884L11.9084 11.1021L13.938 12.2725L9.52661 19.9884Z",fill:"url(#paint8_radial_927_5781)"}),jsxRuntimeExports.jsx("path",{d:"M10.0003 14.5455C12.5107 14.5455 14.5458 12.5104 14.5458 10C14.5458 7.48966 12.5107 5.45459 10.0003 5.45459C7.48996 5.45459 5.4549 7.48966 5.4549 10C5.4549 12.5104 7.48996 14.5455 10.0003 14.5455Z",fill:"#F1F1F1"}),jsxRuntimeExports.jsx("path",{d:"M9.99995 13.6365C12.0083 13.6365 13.6363 12.0084 13.6363 10.0001C13.6363 7.99183 12.0083 6.36377 9.99995 6.36377C7.99164 6.36377 6.36359 7.99183 6.36359 10.0001C6.36359 12.0084 7.99164 13.6365 9.99995 13.6365Z",fill:"#4285F4"}),jsxRuntimeExports.jsx("path",{d:"M10.0003 5.34082C7.48899 5.34082 5.4549 7.37491 5.4549 9.88628V9.99991C5.4549 7.48855 7.48899 5.45446 10.0003 5.45446H20.0003V5.34082H10.0003Z",fill:"black",fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{d:"M13.9318 12.273C13.1455 13.6299 11.6818 14.5458 10 14.5458C8.31818 14.5458 6.85227 13.6299 6.06818 12.273H6.06364L0 1.87305V1.98668L6.06818 12.3867C6.85455 13.7435 8.31818 14.6594 10 14.6594C11.6818 14.6594 13.1455 13.7446 13.9318 12.3867H13.9375V12.273H13.9307H13.9318Z",fill:"white",fillOpacity:"0.1"}),jsxRuntimeExports.jsx("path",{opacity:"0.1",d:"M10.1133 5.45459C10.094 5.45459 10.0758 5.45686 10.0565 5.458C12.5406 5.48868 14.5452 7.50913 14.5452 10C14.5452 12.491 12.5406 14.5114 10.0565 14.5421C10.0758 14.5421 10.094 14.5455 10.1133 14.5455C12.6247 14.5455 14.6588 12.5114 14.6588 10C14.6588 7.48868 12.6247 5.45459 10.1133 5.45459Z",fill:"black"}),jsxRuntimeExports.jsx("path",{d:"M13.9769 12.4204C14.3632 11.7522 14.5871 10.9795 14.5871 10.1522C14.5874 9.68602 14.5157 9.22262 14.3746 8.77832C14.4826 9.16696 14.5451 9.57377 14.5451 9.99764C14.5451 10.8249 14.3212 11.5976 13.9348 12.2658L13.9371 12.2704L9.51892 19.9976H9.65074L13.9769 12.4204Z",fill:"white",fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{d:"M10 0.113636C15.5034 0.113636 19.9682 4.56023 20 10.0568C20 10.0375 20.0011 10.0193 20.0011 10C20.0011 4.47727 15.5239 0 10.0011 0C4.47841 0 0 4.47727 0 10C0 10.0193 0.00113639 10.0375 0.00113639 10.0568C0.0318182 4.56023 4.49659 0.113636 10 0.113636Z",fill:"white",fillOpacity:"0.2"}),jsxRuntimeExports.jsx("path",{d:"M10 19.8865C15.5034 19.8865 19.9682 15.4399 20 9.94336C20 9.96268 20.0011 9.98086 20.0011 10.0002C20.0011 15.5229 15.5239 20.0002 10.0011 20.0002C4.47841 20.0002 0 15.5229 0 10.0002C0 9.98086 0.00113639 9.96268 0.00113639 9.94336C0.0318182 15.4399 4.49659 19.8865 10.0011 19.8865H10Z",fill:"black",fillOpacity:"0.15"})]})}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("filter",{id:"filter0_ii_927_5781",x:0,y:"-0.235294",width:20,height:"20.4706",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB",children:[jsxRuntimeExports.jsx("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in:"SourceGraphic",in2:"BackgroundImageFix",result:"shape"}),jsxRuntimeExports.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),jsxRuntimeExports.jsx("feOffset",{dy:"0.235294"}),jsxRuntimeExports.jsx("feGaussianBlur",{stdDeviation:"0.235294"}),jsxRuntimeExports.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:-1,k3:1}),jsxRuntimeExports.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.25 0"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in2:"shape",result:"effect1_innerShadow_927_5781"}),jsxRuntimeExports.jsx("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),jsxRuntimeExports.jsx("feOffset",{dy:"-0.235294"}),jsxRuntimeExports.jsx("feGaussianBlur",{stdDeviation:"0.235294"}),jsxRuntimeExports.jsx("feComposite",{in2:"hardAlpha",operator:"arithmetic",k2:-1,k3:1}),jsxRuntimeExports.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0"}),jsxRuntimeExports.jsx("feBlend",{mode:"normal",in2:"effect1_innerShadow_927_5781",result:"effect2_innerShadow_927_5781"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5781",x1:"2.42521",y1:"7.61591",x2:"8.39112",y2:"4.13068",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#A52714",stopOpacity:"0.6"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#A52714",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_927_5781",x1:"11.6932",y1:"17.7844",x2:"5.06136",y2:"13.8981",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#055524",stopOpacity:"0.4"}),jsxRuntimeExports.jsx("stop",{offset:"0.33",stopColor:"#055524",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint2_linear_927_5781",x1:"12.9438",y1:"4.75004",x2:"14.6143",y2:"12.0569",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#EA6100",stopOpacity:"0.3"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#EA6100",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint3_linear_927_5781",x1:"12.9428",y1:"4.75004",x2:"14.6132",y2:"12.0569",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#EA6100",stopOpacity:"0.3"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#EA6100",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint4_linear_927_5781",x1:"2.42441",y1:"7.61591",x2:"8.39032",y2:"4.13068",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#A52714",stopOpacity:"0.6"}),jsxRuntimeExports.jsx("stop",{offset:"0.66",stopColor:"#A52714",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint5_radial_927_5781",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.56818 5.44891) scale(9.55455)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#3E2723",stopOpacity:"0.2"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#3E2723",stopOpacity:0})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint6_linear_927_5781",x1:"11.6932",y1:"17.7839",x2:"5.06136",y2:"13.8976",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#055524",stopOpacity:"0.4"}),jsxRuntimeExports.jsx("stop",{offset:"0.33",stopColor:"#055524",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint7_radial_927_5781",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(1.57975 4.60463) scale(8.86818)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#3E2723",stopOpacity:"0.2"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#3E2723",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint8_radial_927_5781",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.97775 10.0157) scale(9.98523)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#263238",stopOpacity:"0.2"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#263238",stopOpacity:0})]}),jsxRuntimeExports.jsx("clipPath",{id:"clip0_927_5781",children:jsxRuntimeExports.jsx("rect",{width:20,height:20,rx:10,fill:"white"})})]})]}),FireFox=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_927_5847)",children:[jsxRuntimeExports.jsx("path",{d:"M19.011 6.71023C18.5898 5.69685 17.7355 4.60269 17.0665 4.25681C17.5436 5.18063 17.8747 6.17276 18.0481 7.19792L18.0499 7.21417C16.954 4.48315 15.0963 3.38023 13.5782 0.981835C13.5014 0.860539 13.4246 0.738994 13.3498 0.610696C13.3071 0.537418 13.2728 0.471393 13.2431 0.410621C13.1801 0.288713 13.1316 0.159878 13.0985 0.0267267C13.0985 0.0205825 13.0963 0.0146369 13.0923 0.0100242C13.0882 0.00541151 13.0826 0.00245454 13.0765 0.00171737C13.0705 7.85858e-05 13.0642 7.85858e-05 13.0582 0.00171737C13.057 0.00171737 13.055 0.00396821 13.0535 0.0044684C13.052 0.00496859 13.0487 0.00721943 13.0465 0.00821981L13.0502 0.00171737C10.6156 1.42725 9.78901 4.06574 9.71399 5.38624C8.74136 5.45292 7.81141 5.81121 7.04549 6.41437C6.96561 6.34671 6.88212 6.28343 6.79539 6.2248C6.57456 5.45174 6.56514 4.6336 6.76813 3.85566C5.87401 4.28877 5.07954 4.90279 4.43501 5.65884H4.43051C4.04636 5.17191 4.07337 3.5663 4.09538 3.23093C3.98174 3.2766 3.87326 3.33419 3.77176 3.40274C3.43264 3.64477 3.11562 3.91635 2.8244 4.2143C2.49255 4.55075 2.18946 4.91441 1.91831 5.30146V5.30296V5.3012C1.29521 6.18444 0.853213 7.18234 0.617826 8.23731L0.604821 8.30133C0.586564 8.38661 0.52079 8.81377 0.509535 8.90656C0.509535 8.91381 0.508035 8.92056 0.507285 8.92781C0.42244 9.36882 0.369864 9.81542 0.349976 10.2641V10.3141C0.354259 12.7396 1.26772 15.0754 2.91002 16.8604C4.55233 18.6454 6.80415 19.7498 9.22094 19.9556C11.6377 20.1615 14.0439 19.4538 15.9644 17.9723C17.8849 16.4908 19.1803 14.3431 19.5947 11.9532C19.6109 11.8282 19.6242 11.7044 19.6387 11.5781C19.8384 9.92791 19.6222 8.25404 19.01 6.70873L19.011 6.71023ZM7.83928 14.2981C7.88455 14.3198 7.92707 14.3433 7.97358 14.3641L7.98034 14.3684C7.93332 14.3458 7.8863 14.3224 7.83928 14.2981ZM18.0501 7.21692V7.20767L18.0519 7.21792L18.0501 7.21692Z",fill:"url(#paint0_linear_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M19.0109 6.71026C18.5898 5.69688 17.7354 4.60272 17.0664 4.25684C17.5435 5.18066 17.8746 6.17278 18.0481 7.19794V7.20719L18.0498 7.21745C18.797 9.35551 18.689 11.6997 17.7482 13.7599C16.6373 16.1435 13.9493 18.5867 9.7402 18.4667C5.19349 18.3379 1.18699 14.9629 0.439211 10.5437C0.30291 9.84668 0.439211 9.4933 0.507737 8.92684C0.414265 9.36685 0.362102 9.81463 0.351929 10.2643V10.3144C0.356212 12.7399 1.26967 15.0757 2.91198 16.8607C4.55429 18.6456 6.8061 19.7501 9.2229 19.9559C11.6397 20.1617 14.0458 19.4541 15.9664 17.9725C17.8869 16.491 19.1822 14.3434 19.5966 11.9535C19.6129 11.8284 19.6262 11.7046 19.6407 11.5783C19.8403 9.92819 19.6242 8.25431 19.0119 6.70901L19.0109 6.71026Z",fill:"url(#paint1_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M19.0109 6.71026C18.5898 5.69688 17.7354 4.60272 17.0664 4.25684C17.5435 5.18066 17.8746 6.17278 18.0481 7.19794V7.20719L18.0498 7.21745C18.797 9.35551 18.689 11.6997 17.7482 13.7599C16.6373 16.1435 13.9493 18.5867 9.7402 18.4667C5.19349 18.3379 1.18699 14.9629 0.439211 10.5437C0.30291 9.84668 0.439211 9.4933 0.507737 8.92684C0.414265 9.36685 0.362102 9.81463 0.351929 10.2643V10.3144C0.356212 12.7399 1.26967 15.0757 2.91198 16.8607C4.55429 18.6456 6.8061 19.7501 9.2229 19.9559C11.6397 20.1617 14.0458 19.4541 15.9664 17.9725C17.8869 16.491 19.1822 14.3434 19.5966 11.9535C19.6129 11.8284 19.6262 11.7046 19.6407 11.5783C19.8403 9.92819 19.6242 8.25431 19.0119 6.70901L19.0109 6.71026Z",fill:"url(#paint2_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M14.2993 7.84794C14.3203 7.8627 14.3398 7.87745 14.3595 7.89221C14.1161 7.46047 13.813 7.06519 13.4592 6.71802C10.4456 3.70439 12.6696 0.18557 13.0445 0.00550206L13.0483 0C10.6136 1.42553 9.78706 4.06402 9.71204 5.38452C9.82508 5.37677 9.93712 5.36726 10.0527 5.36726C10.9164 5.36893 11.7644 5.59929 12.5103 6.03492C13.2562 6.47055 13.8734 7.09592 14.2993 7.84744V7.84794Z",fill:"url(#paint3_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M10.0577 8.45061C10.0417 8.6917 9.18992 9.52326 8.89206 9.52326C6.13602 9.52326 5.68835 11.1906 5.68835 11.1906C5.8104 12.5947 6.78877 13.7516 7.97146 14.3618C8.02548 14.3898 8.08025 14.4151 8.13502 14.4399C8.22989 14.4819 8.32476 14.5207 8.41963 14.5564C8.82553 14.7 9.25065 14.7821 9.68085 14.7997C14.5127 15.0263 15.448 9.02257 11.9615 7.27942C12.7839 7.1724 13.6168 7.37463 14.2986 7.84688C13.8727 7.09536 13.2555 6.46999 12.5096 6.03436C11.7637 5.59873 10.9158 5.36837 10.052 5.3667C9.93695 5.3667 9.82441 5.3762 9.71136 5.38396C8.73874 5.45064 7.80879 5.80893 7.04286 6.41209C7.19067 6.53714 7.35748 6.7042 7.70886 7.05058C8.36661 7.69857 10.0535 8.36983 10.0572 8.44861L10.0577 8.45061Z",fill:"url(#paint4_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M10.0577 8.45061C10.0417 8.6917 9.18992 9.52326 8.89206 9.52326C6.13602 9.52326 5.68835 11.1906 5.68835 11.1906C5.8104 12.5947 6.78877 13.7516 7.97146 14.3618C8.02548 14.3898 8.08025 14.4151 8.13502 14.4399C8.22989 14.4819 8.32476 14.5207 8.41963 14.5564C8.82553 14.7 9.25065 14.7821 9.68085 14.7997C14.5127 15.0263 15.448 9.02257 11.9615 7.27942C12.7839 7.1724 13.6168 7.37463 14.2986 7.84688C13.8727 7.09536 13.2555 6.46999 12.5096 6.03436C11.7637 5.59873 10.9158 5.36837 10.052 5.3667C9.93695 5.3667 9.82441 5.3762 9.71136 5.38396C8.73874 5.45064 7.80879 5.80893 7.04286 6.41209C7.19067 6.53714 7.35748 6.7042 7.70886 7.05058C8.36661 7.69857 10.0535 8.36983 10.0572 8.44861L10.0577 8.45061Z",fill:"url(#paint5_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M6.59134 6.0923C6.66987 6.14231 6.73464 6.18583 6.79141 6.2251C6.57058 5.45204 6.56117 4.63389 6.76415 3.85596C5.87003 4.28907 5.07556 4.90308 4.43103 5.65913C4.4783 5.65788 5.88432 5.63262 6.59134 6.0923Z",fill:"url(#paint6_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M0.437567 10.5439C1.1856 14.963 5.19185 18.3393 9.73855 18.4668C13.9476 18.5859 16.6361 16.1425 17.7466 13.7601C18.6873 11.6998 18.7954 9.35569 18.0482 7.21762V7.20837C18.0482 7.20111 18.0467 7.19686 18.0482 7.19911L18.0499 7.21537C18.3938 9.46046 17.2519 11.6345 15.4665 13.1076L15.4609 13.1201C11.9821 15.9536 8.6534 14.8292 7.98064 14.3706C7.93363 14.348 7.88661 14.3246 7.83959 14.3003C5.81158 13.3309 4.97352 11.4842 5.15358 9.89862C4.67218 9.90573 4.19905 9.77307 3.79151 9.51672C3.38397 9.26038 3.05952 8.89134 2.85747 8.45433C3.38987 8.1282 3.99692 7.94382 4.62077 7.91878C5.24461 7.89374 5.86448 8.02887 6.42131 8.31128C7.56906 8.83225 8.87507 8.8836 10.0602 8.45433C10.0564 8.37555 8.36954 7.70405 7.71179 7.05631C7.36041 6.70993 7.1936 6.54312 7.04579 6.41782C6.96591 6.35016 6.88243 6.28688 6.7957 6.22825C6.73818 6.18898 6.6734 6.14647 6.59562 6.09545C5.88861 5.63578 4.48258 5.66104 4.43607 5.66229H4.43156C4.04742 5.17535 4.07443 3.56975 4.09644 3.23438C3.9828 3.28005 3.87431 3.33764 3.77282 3.40619C3.4337 3.64822 3.11667 3.91979 2.82546 4.21774C2.49242 4.55325 2.18808 4.91607 1.91562 5.3024V5.3039V5.30215C1.29252 6.18539 0.850521 7.18329 0.615133 8.23825C0.610381 8.25801 0.266002 9.76357 0.435816 10.5444L0.437567 10.5439Z",fill:"url(#paint7_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M13.459 6.71761C13.8128 7.06516 14.1159 7.46087 14.3593 7.89305C14.4126 7.93331 14.4624 7.97333 14.5046 8.01209C16.7022 10.0378 15.5508 12.9014 15.465 13.104C17.2502 11.6332 18.3911 9.45763 18.0485 7.21179C16.952 4.47826 15.0923 3.37535 13.5768 0.976952C13.5 0.855657 13.4232 0.734111 13.3484 0.605813C13.3057 0.532535 13.2714 0.466511 13.2417 0.405738C13.1787 0.283831 13.1302 0.154995 13.0971 0.0218439C13.0971 0.0156997 13.0949 0.0097541 13.0909 0.0051414C13.0868 0.000528701 13.0812 -0.00242828 13.0751 -0.00316545C13.0691 -0.00480423 13.0628 -0.00480423 13.0568 -0.00316545C13.0556 -0.00316545 13.0536 -0.000914601 13.0521 -0.000414413C13.0506 8.57743e-05 13.0473 0.00233662 13.0451 0.00333699C12.6702 0.181154 10.4466 3.70222 13.4602 6.71335L13.459 6.71761Z",fill:"url(#paint8_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M14.5043 8.01315C14.462 7.97439 14.4122 7.93437 14.359 7.8941C14.3392 7.87935 14.3197 7.86459 14.2987 7.84984C13.6169 7.37759 12.784 7.17536 11.9616 7.28238C15.4479 9.02553 14.5125 15.0278 9.68095 14.8027C9.25075 14.785 8.82562 14.703 8.41973 14.5594C8.32486 14.5238 8.22999 14.485 8.13512 14.4428C8.08035 14.4178 8.02558 14.3928 7.97156 14.3648L7.97831 14.369C8.65206 14.829 11.9798 15.9526 15.4586 13.1186L15.4641 13.1061C15.5509 12.9035 16.7023 10.0399 14.5038 8.01415L14.5043 8.01315Z",fill:"url(#paint9_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M5.68842 11.1892C5.68842 11.1892 6.13583 9.52179 8.89212 9.52179C9.18998 9.52179 10.0425 8.69023 10.0578 8.44914C8.8727 8.8784 7.56669 8.82706 6.41894 8.30608C5.86211 8.02367 5.24224 7.88855 4.61839 7.91359C3.99455 7.93863 3.3875 8.123 2.8551 8.44914C3.05715 8.88615 3.3816 9.25518 3.78914 9.51153C4.19668 9.76787 4.66981 9.90053 5.15121 9.89343C4.97165 11.4783 5.80946 13.3247 7.83722 14.2951C7.88249 14.3168 7.925 14.3403 7.97152 14.3611C6.78783 13.7496 5.81046 12.5932 5.68842 11.1899V11.1892Z",fill:"url(#paint10_radial_927_5847)"}),jsxRuntimeExports.jsx("path",{d:"M19.0112 6.71023C18.59 5.69685 17.7357 4.60269 17.0667 4.25681C17.5438 5.18063 17.8749 6.17276 18.0483 7.19792L18.0501 7.21417C16.9542 4.48315 15.0965 3.38023 13.5784 0.981835C13.5016 0.860539 13.4249 0.738994 13.3501 0.610696C13.3073 0.537418 13.2731 0.471393 13.2433 0.410621C13.1803 0.288713 13.1318 0.159878 13.0987 0.0267267C13.0988 0.0205825 13.0966 0.0146369 13.0925 0.0100242C13.0884 0.00541151 13.0828 0.00245454 13.0767 0.00171737C13.0708 7.85859e-05 13.0644 7.85859e-05 13.0585 0.00171737C13.0572 0.00171737 13.0552 0.00396821 13.0537 0.0044684C13.0522 0.00496859 13.049 0.00721943 13.0467 0.00821981L13.0505 0.00171737C10.6158 1.42725 9.78925 4.06574 9.71422 5.38624C9.82726 5.37848 9.9393 5.36898 10.0548 5.36898C10.9186 5.37065 11.7666 5.60101 12.5125 6.03664C13.2584 6.47227 13.8756 7.09764 14.3014 7.84916C13.6196 7.37691 12.7868 7.17468 11.9643 7.2817C15.4506 9.02485 14.5153 15.0271 9.68371 14.802C9.25351 14.7843 8.82838 14.7023 8.42248 14.5587C8.32761 14.5232 8.23275 14.4843 8.13788 14.4421C8.08311 14.4171 8.02834 14.3921 7.97432 14.3641L7.98107 14.3684C7.93405 14.3458 7.88703 14.3224 7.84002 14.2981C7.88528 14.3198 7.9278 14.3433 7.97432 14.3641C6.79062 13.7524 5.81326 12.5959 5.69121 11.1929C5.69121 11.1929 6.13863 9.52554 8.89491 9.52554C9.19277 9.52554 10.0453 8.69398 10.0606 8.45289C10.0568 8.37411 8.36996 7.7026 7.71222 7.05486C7.36084 6.70848 7.19402 6.54167 7.04622 6.41637C6.96634 6.34871 6.88285 6.28543 6.79612 6.2268C6.57529 5.45374 6.56588 4.6356 6.76886 3.85766C5.87474 4.29077 5.08027 4.90479 4.43574 5.66084H4.43124C4.04709 5.17391 4.0741 3.5683 4.09611 3.23293C3.98247 3.2786 3.87399 3.33619 3.77249 3.40474C3.43337 3.64677 3.11635 3.91835 2.82514 4.2163C2.49328 4.55275 2.19019 4.91641 1.91905 5.30345V5.30496V5.30321C1.29595 6.18644 0.853946 7.18434 0.618558 8.23931L0.605554 8.30333C0.587297 8.38861 0.505516 8.82177 0.493762 8.91481C0.418959 9.36194 0.371188 9.81318 0.350708 10.2661V10.3161C0.354992 12.7416 1.26845 15.0774 2.91076 16.8624C4.55307 18.6474 6.80488 19.7518 9.22168 19.9576C11.6385 20.1635 14.0446 19.4558 15.9652 17.9743C17.8857 16.4928 19.181 14.3451 19.5954 11.9552C19.6117 11.8302 19.6249 11.7064 19.6394 11.5801C19.8391 9.92991 19.623 8.25604 19.0107 6.71073L19.0112 6.71023ZM18.0496 7.20817L18.0513 7.21842L18.0496 7.20817Z",fill:"url(#paint11_linear_927_5847)"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5847",x1:"17.728",y1:"3.09786",x2:"1.63621",y2:"18.6237",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.048",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.111",stopColor:"#FFE847"}),jsxRuntimeExports.jsx("stop",{offset:"0.225",stopColor:"#FFC830"}),jsxRuntimeExports.jsx("stop",{offset:"0.368",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.401",stopColor:"#FF8B16"}),jsxRuntimeExports.jsx("stop",{offset:"0.462",stopColor:"#FF672A"}),jsxRuntimeExports.jsx("stop",{offset:"0.534",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.705",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint1_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(17.1052 2.25108) scale(20.2076)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.129",stopColor:"#FFBD4F"}),jsxRuntimeExports.jsx("stop",{offset:"0.186",stopColor:"#FFAC31"}),jsxRuntimeExports.jsx("stop",{offset:"0.247",stopColor:"#FF9D17"}),jsxRuntimeExports.jsx("stop",{offset:"0.283",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.403",stopColor:"#FF563B"}),jsxRuntimeExports.jsx("stop",{offset:"0.467",stopColor:"#FF3750"}),jsxRuntimeExports.jsx("stop",{offset:"0.71",stopColor:"#F5156C"}),jsxRuntimeExports.jsx("stop",{offset:"0.782",stopColor:"#EB0878"}),jsxRuntimeExports.jsx("stop",{offset:"0.86",stopColor:"#E50080"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint2_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.6024 10.5042) scale(20.2076)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.3",stopColor:"#960E18"}),jsxRuntimeExports.jsx("stop",{offset:"0.351",stopColor:"#B11927",stopOpacity:"0.74"}),jsxRuntimeExports.jsx("stop",{offset:"0.435",stopColor:"#DB293D",stopOpacity:"0.343"}),jsxRuntimeExports.jsx("stop",{offset:"0.497",stopColor:"#F5334B",stopOpacity:"0.094"}),jsxRuntimeExports.jsx("stop",{offset:"0.53",stopColor:"#FF3750",stopOpacity:0})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint3_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12.1034 -2.25084) scale(14.638)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.132",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.252",stopColor:"#FFDC3E"}),jsxRuntimeExports.jsx("stop",{offset:"0.506",stopColor:"#FF9D12"}),jsxRuntimeExports.jsx("stop",{offset:"0.526",stopColor:"#FF980E"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint4_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(7.35173 15.7558) scale(9.62111)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.353",stopColor:"#3A8EE6"}),jsxRuntimeExports.jsx("stop",{offset:"0.472",stopColor:"#5C79F0"}),jsxRuntimeExports.jsx("stop",{offset:"0.669",stopColor:"#9059FF"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#C139E6"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint5_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(10.5799 8.76923) rotate(-13.5916) scale(5.10194 5.97309)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.206",stopColor:"#9059FF",stopOpacity:0}),jsxRuntimeExports.jsx("stop",{offset:"0.278",stopColor:"#8C4FF3",stopOpacity:"0.064"}),jsxRuntimeExports.jsx("stop",{offset:"0.747",stopColor:"#7716A8",stopOpacity:"0.45"}),jsxRuntimeExports.jsx("stop",{offset:"0.975",stopColor:"#6E008B",stopOpacity:"0.6"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint6_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.35238 1.50057) scale(6.9226)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FFE226"}),jsxRuntimeExports.jsx("stop",{offset:"0.121",stopColor:"#FFDB27"}),jsxRuntimeExports.jsx("stop",{offset:"0.295",stopColor:"#FFC82A"}),jsxRuntimeExports.jsx("stop",{offset:"0.502",stopColor:"#FFA930"}),jsxRuntimeExports.jsx("stop",{offset:"0.732",stopColor:"#FF7E37"}),jsxRuntimeExports.jsx("stop",{offset:"0.792",stopColor:"#FF7139"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint7_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(14.8545 -3.00121) scale(29.5361)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.113",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.456",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.622",stopColor:"#FF5634"}),jsxRuntimeExports.jsx("stop",{offset:"0.716",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.904",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint8_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12.3996 -1.36343) rotate(83.976) scale(21.6445 14.2051)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.06",stopColor:"#FFE847"}),jsxRuntimeExports.jsx("stop",{offset:"0.168",stopColor:"#FFC830"}),jsxRuntimeExports.jsx("stop",{offset:"0.304",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.356",stopColor:"#FF8B16"}),jsxRuntimeExports.jsx("stop",{offset:"0.455",stopColor:"#FF672A"}),jsxRuntimeExports.jsx("stop",{offset:"0.57",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.737",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint9_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(9.35233 4.00165) scale(18.4369)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.137",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.48",stopColor:"#FF980E"}),jsxRuntimeExports.jsx("stop",{offset:"0.592",stopColor:"#FF5634"}),jsxRuntimeExports.jsx("stop",{offset:"0.655",stopColor:"#FF3647"}),jsxRuntimeExports.jsx("stop",{offset:"0.904",stopColor:"#E31587"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint10_radial_927_5847",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(14.1041 5.00184) scale(20.1801)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.094",stopColor:"#FFF44F"}),jsxRuntimeExports.jsx("stop",{offset:"0.231",stopColor:"#FFE141"}),jsxRuntimeExports.jsx("stop",{offset:"0.509",stopColor:"#FFAF1E"}),jsxRuntimeExports.jsx("stop",{offset:"0.626",stopColor:"#FF980E"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint11_linear_927_5847",x1:"17.5331",y1:"3.01533",x2:"3.84302",y2:"16.708",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.167",stopColor:"#FFF44F",stopOpacity:"0.8"}),jsxRuntimeExports.jsx("stop",{offset:"0.266",stopColor:"#FFF44F",stopOpacity:"0.634"}),jsxRuntimeExports.jsx("stop",{offset:"0.489",stopColor:"#FFF44F",stopOpacity:"0.217"}),jsxRuntimeExports.jsx("stop",{offset:"0.6",stopColor:"#FFF44F",stopOpacity:0})]}),jsxRuntimeExports.jsx("clipPath",{id:"clip0_927_5847",children:jsxRuntimeExports.jsx("rect",{width:20,height:20,fill:"white"})})]})]}),Brave=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M17.2924 5.22043L17.7256 4.15905L16.4982 2.8883C15.8339 2.22404 14.4187 2.61393 14.4187 2.61393L12.8158 0.794434H7.16242L5.55231 2.62115C5.55231 2.62115 4.13715 2.23848 3.47289 2.8883L2.24545 4.15183L2.67866 5.21321L2.13715 6.78721L3.9422 13.6681C4.31765 15.141 4.57036 15.7114 5.63173 16.4623L8.93137 18.7006C9.24906 18.8955 9.63895 19.2349 9.99274 19.2349C10.3465 19.2349 10.7364 18.8955 11.0541 18.7006L14.3538 16.4623C15.4151 15.7114 15.6678 15.141 16.0433 13.6681L17.8483 6.78721L17.2924 5.22043Z",fill:"url(#paint0_linear_927_5861)"}),jsxRuntimeExports.jsx("path",{d:"M13.9711 3.78343C13.9711 3.78343 16.0433 6.28884 16.0433 6.81592C16.0433 7.35744 15.7834 7.49462 15.5234 7.77621L13.9711 9.43686C13.8267 9.58126 13.5162 9.82675 13.6967 10.2527C13.8772 10.686 14.1299 11.2203 13.8411 11.769C13.5523 12.3249 13.0469 12.6932 12.722 12.6354C12.2387 12.4786 11.7777 12.2602 11.3502 11.9856C11.0758 11.8051 10.1949 11.0758 10.1949 10.7943C10.1949 10.5127 11.1047 10 11.278 9.89895C11.444 9.78343 12.2166 9.33577 12.231 9.16249C12.2455 8.9892 12.2455 8.94588 12.0144 8.51267C11.7834 8.07946 11.379 7.50184 11.4368 7.12639C11.509 6.75094 12.1588 6.54877 12.6426 6.36827L14.1372 5.80509C14.2527 5.74733 14.2238 5.69679 13.8772 5.66068C13.5307 5.6318 12.5559 5.50184 12.1155 5.62458C11.6751 5.74733 10.9386 5.93505 10.8664 6.03614C10.8086 6.13722 10.7509 6.13722 10.8159 6.48379L11.2346 8.75816C11.2635 9.04697 11.3213 9.24191 11.018 9.31411C10.7003 9.38632 10.1733 9.50906 9.99276 9.50906C9.81225 9.50906 9.27796 9.38632 8.96749 9.31411C8.65702 9.24191 8.71478 9.04697 8.75088 8.75816C8.77976 8.46935 9.09745 6.82314 9.16243 6.48379C9.23464 6.13722 9.16965 6.13722 9.11189 6.03614C9.03969 5.93505 8.29601 5.74733 7.85558 5.62458C7.42236 5.50184 6.44041 5.6318 6.09384 5.66791C5.74727 5.69679 5.71839 5.74011 5.83391 5.81231L7.3285 6.36827C7.80503 6.54877 8.46929 6.75094 8.53428 7.12639C8.60648 7.50906 8.19493 8.07946 7.95666 8.51267C7.71839 8.94588 7.72561 8.9892 7.74005 9.16249C7.75449 9.33577 8.53428 9.78343 8.69312 9.89895C8.86641 10.0073 9.77615 10.5127 9.77615 10.7943C9.77615 11.0758 8.91695 11.8051 8.62814 11.9856C8.20063 12.2602 7.73957 12.4786 7.2563 12.6354C6.93139 12.6932 6.42597 12.3249 6.12994 11.769C5.84113 11.2203 6.10106 10.686 6.27435 10.2527C6.45485 9.81953 6.1516 9.58848 5.99998 9.43686L4.44763 7.77621C4.19493 7.50906 3.935 7.36466 3.935 6.83036C3.935 6.29606 6.0072 3.79787 6.0072 3.79787L7.97832 4.11556C8.20937 4.11556 8.722 3.92061 9.19132 3.75455C9.66063 3.61014 9.98554 3.5957 9.98554 3.5957C9.98554 3.5957 10.3032 3.5957 10.7798 3.75455C11.2563 3.91339 11.7617 4.11556 11.9928 4.11556C12.231 4.11556 13.9783 3.77621 13.9783 3.77621L13.9711 3.78343ZM12.4188 13.3719C12.5487 13.4441 12.4693 13.6029 12.3465 13.6896L10.5126 15.1192C10.3682 15.2636 10.1372 15.4802 9.98554 15.4802C9.83391 15.4802 9.61009 15.2636 9.45846 15.1192C8.8506 14.6351 8.23683 14.1586 7.61731 13.6896C7.50178 13.6029 7.42236 13.4513 7.54511 13.3719L8.62814 12.7943C9.05864 12.5665 9.51417 12.3897 9.98554 12.2672C10.0938 12.2672 10.7798 12.5127 11.3357 12.7943L12.4188 13.3719Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M14.4332 2.62115L12.8159 0.794434H7.16243L5.55232 2.62115C5.55232 2.62115 4.13716 2.23848 3.4729 2.8883C3.4729 2.8883 5.35016 2.72223 5.99998 3.77638L7.99276 4.11573C8.2238 4.11573 8.73644 3.92079 9.20575 3.75472C9.67507 3.61032 9.99998 3.59588 9.99998 3.59588C9.99998 3.59588 10.3177 3.59588 10.7942 3.75472C11.2707 3.91357 11.7761 4.11573 12.0072 4.11573C12.2455 4.11573 13.9928 3.77638 13.9928 3.77638C14.6426 2.72223 16.5198 2.8883 16.5198 2.8883C15.8556 2.22404 14.4404 2.61393 14.4404 2.61393",fill:"url(#paint1_linear_927_5861)"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5861",x1:"2.13715",y1:"10.1991",x2:"17.8483",y2:"10.1991",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{offset:"0.4",stopColor:"#FF5500"}),jsxRuntimeExports.jsx("stop",{offset:"0.6",stopColor:"#FF2000"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_927_5861",x1:"3.73384",y1:"2.4883",x2:"16.5198",y2:"2.4883",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#FF452A"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#FF2000"})]})]})]}),Edge=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:20,height:20,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{clipPath:"url(#clip0_927_5865)",children:[jsxRuntimeExports.jsx("path",{d:"M18.0547 14.8828C17.7865 15.0222 17.5099 15.1448 17.2266 15.25C16.3293 15.584 15.3792 15.7533 14.4219 15.75C10.7266 15.75 7.50781 13.2109 7.50781 9.94531C7.51262 9.50803 7.63385 9.07993 7.85905 8.70506C8.08424 8.33019 8.40526 8.0221 8.78906 7.8125C5.44531 7.95312 4.58594 11.4375 4.58594 13.4766C4.58594 19.2578 9.90625 19.8359 11.0547 19.8359C11.6719 19.8359 12.6016 19.6562 13.1641 19.4766L13.2656 19.4453C15.4183 18.7014 17.2534 17.2465 18.4688 15.3203C18.5041 15.2618 18.5192 15.1933 18.5119 15.1253C18.5046 15.0574 18.4752 14.9937 18.4282 14.944C18.3812 14.8944 18.3192 14.8615 18.2518 14.8505C18.1843 14.8394 18.1151 14.8508 18.0547 14.8828Z",fill:"url(#paint0_linear_927_5865)"}),jsxRuntimeExports.jsx("path",{opacity:"0.35",d:"M18.0547 14.8828C17.7865 15.0222 17.5099 15.1448 17.2266 15.25C16.3293 15.584 15.3792 15.7533 14.4219 15.75C10.7266 15.75 7.50781 13.2109 7.50781 9.94531C7.51262 9.50803 7.63385 9.07993 7.85905 8.70506C8.08424 8.33019 8.40526 8.0221 8.78906 7.8125C5.44531 7.95312 4.58594 11.4375 4.58594 13.4766C4.58594 19.2578 9.90625 19.8359 11.0547 19.8359C11.6719 19.8359 12.6016 19.6562 13.1641 19.4766L13.2656 19.4453C15.4183 18.7014 17.2534 17.2465 18.4688 15.3203C18.5041 15.2618 18.5192 15.1933 18.5119 15.1253C18.5046 15.0574 18.4752 14.9937 18.4282 14.944C18.3812 14.8944 18.3192 14.8615 18.2518 14.8505C18.1843 14.8394 18.1151 14.8508 18.0547 14.8828Z",fill:"url(#paint1_radial_927_5865)"}),jsxRuntimeExports.jsx("path",{d:"M8.2578 18.8516C7.56239 18.4196 6.95961 17.854 6.48436 17.1875C5.94166 16.4447 5.56809 15.5921 5.38987 14.6896C5.21165 13.787 5.23311 12.8565 5.45272 11.9631C5.67234 11.0697 6.08479 10.2353 6.66115 9.51826C7.23751 8.80123 7.96379 8.21903 8.78905 7.8125C9.03905 7.69531 9.45311 7.49219 10.0078 7.5C10.3981 7.50302 10.7824 7.59627 11.1308 7.77245C11.4791 7.94864 11.7819 8.20299 12.0156 8.51562C12.3299 8.93835 12.5023 9.4498 12.5078 9.97656C12.5078 9.96094 14.4219 3.75781 6.2578 3.75781C2.82811 3.75781 0.00780015 7.00781 0.00780015 9.86719C-0.00584162 11.3776 0.317079 12.8721 0.953112 14.2422C1.99473 16.4602 3.81447 18.2185 6.06689 19.1834C8.3193 20.1483 10.8476 20.2526 13.1719 19.4766C12.3576 19.7337 11.4972 19.811 10.6501 19.7031C9.80297 19.5952 8.98941 19.3047 8.26561 18.8516H8.2578Z",fill:"url(#paint2_linear_927_5865)"}),jsxRuntimeExports.jsx("path",{opacity:"0.41",d:"M8.2578 18.8516C7.56239 18.4196 6.95961 17.854 6.48436 17.1875C5.94166 16.4447 5.56809 15.5921 5.38987 14.6896C5.21165 13.787 5.23311 12.8565 5.45272 11.9631C5.67234 11.0697 6.08479 10.2353 6.66115 9.51826C7.23751 8.80123 7.96379 8.21903 8.78905 7.8125C9.03905 7.69531 9.45311 7.49219 10.0078 7.5C10.3981 7.50302 10.7824 7.59627 11.1308 7.77245C11.4791 7.94864 11.7819 8.20299 12.0156 8.51562C12.3299 8.93835 12.5023 9.4498 12.5078 9.97656C12.5078 9.96094 14.4219 3.75781 6.2578 3.75781C2.82811 3.75781 0.00780015 7.00781 0.00780015 9.86719C-0.00584162 11.3776 0.317079 12.8721 0.953112 14.2422C1.99473 16.4602 3.81447 18.2185 6.06689 19.1834C8.3193 20.1483 10.8476 20.2526 13.1719 19.4766C12.3576 19.7337 11.4972 19.811 10.6501 19.7031C9.80297 19.5952 8.98941 19.3047 8.26561 18.8516H8.2578Z",fill:"url(#paint3_radial_927_5865)"}),jsxRuntimeExports.jsx("path",{d:"M11.9062 11.625C11.8359 11.7031 11.6406 11.8203 11.6406 12.0625C11.6406 12.2656 11.7734 12.4688 12.0156 12.6328C13.1328 13.4141 15.25 13.3047 15.2578 13.3047C16.0907 13.3041 16.9081 13.0802 17.625 12.6562C18.3467 12.2341 18.9456 11.6307 19.3622 10.9057C19.7788 10.1808 19.9986 9.35955 20 8.52344C20.0234 6.77344 19.375 5.60937 19.1172 5.09375C17.4531 1.85937 13.8828 4.89564e-08 10 4.89564e-08C7.37202 -0.00025981 4.84956 1.03398 2.97819 2.87904C1.10682 4.7241 0.0369559 7.23166 0 9.85938C0.0390625 7.00781 2.875 4.70312 6.25 4.70312C6.52344 4.70312 8.08594 4.72656 9.53125 5.48438C10.5466 5.98895 11.3875 6.78627 11.9453 7.77344C12.4219 8.60156 12.5078 9.65625 12.5078 10.0781C12.5078 10.5 12.2969 11.1172 11.8984 11.6328L11.9062 11.625Z",fill:"url(#paint4_radial_927_5865)"}),jsxRuntimeExports.jsx("path",{d:"M11.9062 11.625C11.8359 11.7031 11.6406 11.8203 11.6406 12.0625C11.6406 12.2656 11.7734 12.4688 12.0156 12.6328C13.1328 13.4141 15.25 13.3047 15.2578 13.3047C16.0907 13.3041 16.9081 13.0802 17.625 12.6562C18.3467 12.2341 18.9456 11.6307 19.3622 10.9057C19.7788 10.1808 19.9986 9.35955 20 8.52344C20.0234 6.77344 19.375 5.60937 19.1172 5.09375C17.4531 1.85937 13.8828 4.89564e-08 10 4.89564e-08C7.37202 -0.00025981 4.84956 1.03398 2.97819 2.87904C1.10682 4.7241 0.0369559 7.23166 0 9.85938C0.0390625 7.00781 2.875 4.70312 6.25 4.70312C6.52344 4.70312 8.08594 4.72656 9.53125 5.48438C10.5466 5.98895 11.3875 6.78627 11.9453 7.77344C12.4219 8.60156 12.5078 9.65625 12.5078 10.0781C12.5078 10.5 12.2969 11.1172 11.8984 11.6328L11.9062 11.625Z",fill:"url(#paint5_radial_927_5865)"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_927_5865",x1:"4.58594",y1:"13.8281",x2:"18.5234",y2:"13.8281",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#0C59A4"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#114A8B"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint1_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12.2813 13.9332) scale(7.45313 7.08047)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.7",stopOpacity:0}),jsxRuntimeExports.jsx("stop",{offset:"0.9",stopOpacity:"0.5"}),jsxRuntimeExports.jsx("stop",{offset:1})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint2_linear_927_5865",x1:"11.9297",y1:"7.78125",x2:"3.23436",y2:"17.2578",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#1B9DE2"}),jsxRuntimeExports.jsx("stop",{offset:"0.2",stopColor:"#1595DF"}),jsxRuntimeExports.jsx("stop",{offset:"0.7",stopColor:"#0680D7"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#0078D4"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint3_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(5.51209 15.5419) rotate(-81.3844) scale(11.202 9.05011)",children:[jsxRuntimeExports.jsx("stop",{offset:"0.8",stopOpacity:0}),jsxRuntimeExports.jsx("stop",{offset:"0.9",stopOpacity:"0.5"}),jsxRuntimeExports.jsx("stop",{offset:1})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint4_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(2.02266 3.69656) rotate(92.2906) scale(15.8251 33.7043)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#35C1F1"}),jsxRuntimeExports.jsx("stop",{offset:"0.1",stopColor:"#34C1ED"}),jsxRuntimeExports.jsx("stop",{offset:"0.2",stopColor:"#2FC2DF"}),jsxRuntimeExports.jsx("stop",{offset:"0.3",stopColor:"#2BC3D2"}),jsxRuntimeExports.jsx("stop",{offset:"0.7",stopColor:"#36C752"})]}),jsxRuntimeExports.jsxs("radialGradient",{id:"paint5_radial_927_5865",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(18.7547 6.03906) rotate(73.7398) scale(7.60156 6.18159)",children:[jsxRuntimeExports.jsx("stop",{stopColor:"#66EB6E"}),jsxRuntimeExports.jsx("stop",{offset:1,stopColor:"#66EB6E",stopOpacity:0})]}),jsxRuntimeExports.jsx("clipPath",{id:"clip0_927_5865",children:jsxRuntimeExports.jsx("rect",{width:20,height:20,fill:"white"})})]})]});var browsers={Chrome,FireFox,Brave,Edge};const BrowserIcon=React.forwardRef(({browser:et},o)=>{const tt=et??detectBrowser();let rt;switch(tt){case"chrome":rt=browsers.Chrome;break;case"firefox":rt=browsers.FireFox;break;case"edge":rt=browsers.Edge;break}return rt?jsxRuntimeExports.jsx(BrowserIconContainer,{children:rt}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})});BrowserIcon.displayName="BrowserIcon";const LogoContainer$3=styled(motion.div)` - z-index: 4; - position: relative; - width: 100px; - height: 100px; - svg { - z-index: 3; - position: relative; - display: block; - } -`,Logo=styled(motion.div)` - z-index: 2; - position: absolute; - overflow: hidden; - inset: 6px; - border-radius: 50px; - background: var(--ck-body-background); - display: flex; - align-items: center; - justify-content: center; - svg, - img { - pointer-events: none; - display: block; - margin: 0 auto; - width: 100%; - height: 100%; - ${et=>et.$small&&Ae` - width: 85%; - height: 85%; - `} - } -`,SpinnerContainer=styled(motion.div)` - position: absolute; - inset: -5px; -`,ExpiringSpinner=styled(motion.div)` - pointer-events: none; - user-select: none; - z-index: 1; - position: absolute; - inset: -25%; - background: var(--ck-body-background); - div:first-child { - position: absolute; - left: 50%; - right: 0; - top: 0; - bottom: 0; - overflow: hidden; - &:before { - position: absolute; - content: ''; - inset: 0; - background: var(--ck-spinner-color); - transform-origin: 0% 50%; - animation: rotateExpiringSpinner 5000ms ease-in both; - } - } - div:last-child { - position: absolute; - left: 0; - right: 50%; - top: 0; - bottom: 0; - overflow: hidden; - &:before { - position: absolute; - content: ''; - inset: 0; - background: var(--ck-spinner-color); - transform-origin: 100% 50%; - animation: rotateExpiringSpinner 5000ms ease-out 5000ms both; - } - } - @keyframes rotateExpiringSpinner { - 0% { - transform: rotate(-180deg); - } - 100% { - transform: rotate(0deg); - } - } -`,Spinner$2=styled(motion.div)` - pointer-events: none; - user-select: none; - z-index: 1; - position: absolute; - inset: 0; - svg { - display: block; - position: absolute; - left: 0; - top: 0; - width: 100%; - height: 100%; - animation: rotateSpinner 1200ms linear infinite; - } - @keyframes rotateSpinner { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } - } -`,CircleSpinner=({logo:et,smallLogo:o,connecting:tt=!0,unavailable:rt=!1,countdown:nt=!1})=>jsxRuntimeExports.jsxs(LogoContainer$3,{transition:{duration:.5,ease:[.175,.885,.32,.98]},children:[jsxRuntimeExports.jsx(Logo,{$small:!rt&&o,style:rt?{borderRadius:0}:void 0,children:et}),jsxRuntimeExports.jsx(SpinnerContainer,{children:jsxRuntimeExports.jsxs(AnimatePresence,{children:[tt&&jsxRuntimeExports.jsx(Spinner$2,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:{duration:nt?1:0}},children:jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"102",height:"102",viewBox:"0 0 102 102",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M52 100C24.3858 100 2 77.6142 2 50",stroke:"url(#paint0_linear_1943_4139)",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1943_4139",x1:"2",y1:"48.5",x2:"53",y2:"100",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-spinner-color)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-spinner-color)",stopOpacity:"0"})]})})]})},"Spinner"),nt&&jsxRuntimeExports.jsxs(ExpiringSpinner,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.25},children:[jsxRuntimeExports.jsx("div",{}),jsxRuntimeExports.jsx("div",{})]},"ExpiringSpinner")]})})]}),states$1={CONNECTED:"connected",CONNECTING:"connecting",EXPIRING:"expiring",FAILED:"failed",REJECTED:"rejected",NOTCONNECTED:"notconnected",UNAVAILABLE:"unavailable"},contentVariants$1={initial:{willChange:"transform,opacity",position:"relative",opacity:0,scale:.95},animate:{position:"relative",opacity:1,scale:1,transition:{ease:[.16,1,.3,1],duration:.4,delay:.05,position:{delay:0}}},exit:{position:"absolute",opacity:0,scale:.95,transition:{ease:[.16,1,.3,1],duration:.3}}},ConnectWithInjector=({switchConnectMethod:et,forceState:o})=>{var tt,rt,nt,ot,it,st,at,ct;const{connect:lt}=useConnect({mutation:{onMutate:Nt=>{Nt.connector?St(states$1.CONNECTING):St(states$1.UNAVAILABLE)},onError(Nt){console.error(Nt)},onSettled(Nt,Lt){if(Lt){if(gt(!0),setTimeout(()=>gt(!1),3500),Lt.code)switch(Lt.code){case-32002:St(states$1.NOTCONNECTED);break;case 4001:St(states$1.REJECTED);break;default:St(states$1.FAILED);break}else if(Lt.message)switch(Lt.message){case"User rejected request":St(states$1.REJECTED);break;default:St(states$1.FAILED);break}}setTimeout(dt,100)}}}),{triggerResize:dt,connector:ht}=useContext(),mt=ht.id,ft=useWallet(mt),pt={name:ft==null?void 0:ft.name,shortName:(tt=ft==null?void 0:ft.shortName)!==null&&tt!==void 0?tt:ft==null?void 0:ft.name,icon:(rt=ft==null?void 0:ft.iconConnector)!==null&&rt!==void 0?rt:ft==null?void 0:ft.icon,iconShape:(nt=ft==null?void 0:ft.iconShape)!==null&&nt!==void 0?nt:"circle",iconShouldShrink:ft==null?void 0:ft.iconShouldShrink},[yt,gt]=reactExports.useState(!1);reactExports.useState(9);const xt=detectBrowser(),vt=(ot=ft==null?void 0:ft.downloadUrls)===null||ot===void 0?void 0:ot[xt],Et=ft!=null&&ft.downloadUrls?{name:Object.keys(ft==null?void 0:ft.downloadUrls)[0],label:((it=Object.keys(ft==null?void 0:ft.downloadUrls)[0])===null||it===void 0?void 0:it.charAt(0).toUpperCase())+((st=Object.keys(ft==null?void 0:ft.downloadUrls)[0])===null||st===void 0?void 0:st.slice(1)),url:ft==null?void 0:ft.downloadUrls[Object.keys(ft==null?void 0:ft.downloadUrls)[0]]}:void 0,[Ct,St]=reactExports.useState(o||(ft!=null&&ft.isInstalled?states$1.CONNECTING:states$1.UNAVAILABLE)),At=useLocales({CONNECTORNAME:pt.name,CONNECTORSHORTNAME:(at=pt.shortName)!==null&&at!==void 0?at:pt.name,SUGGESTEDEXTENSIONBROWSER:(ct=Et==null?void 0:Et.label)!==null&&ct!==void 0?ct:"your browser"}),kt=async()=>{ft!=null&&ft.isInstalled&&(ft!=null&&ft.connector)?lt({connector:ft==null?void 0:ft.connector}):St(states$1.UNAVAILABLE)};let It;return reactExports.useEffect(()=>{if(Ct!==states$1.UNAVAILABLE)return It=setTimeout(kt,600),()=>{clearTimeout(It)}},[]),ft?isWalletConnectConnector(ft==null?void 0:ft.connector.id)?jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(Container$4,{children:[jsxRuntimeExports.jsx(ModalHeading,{children:"Invalid State"}),jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsx(Alert,{children:"WalletConnect does not have an injection flow. This state should never happen."})})]})}):jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(Container$4,{children:[jsxRuntimeExports.jsx(ConnectingContainer,{children:jsxRuntimeExports.jsxs(ConnectingAnimation,{$shake:Ct===states$1.FAILED||Ct===states$1.REJECTED,$circle:pt.iconShape==="circle",children:[jsxRuntimeExports.jsx(AnimatePresence,{children:(Ct===states$1.FAILED||Ct===states$1.REJECTED)&&jsxRuntimeExports.jsx(RetryButton,{"aria-label":"Retry",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},whileTap:{scale:.9},transition:{duration:.1},onClick:kt,children:jsxRuntimeExports.jsx(RetryIconContainer,{children:jsxRuntimeExports.jsx(Tooltip,{open:yt&&(Ct===states$1.FAILED||Ct===states$1.REJECTED),message:At.tryAgainQuestion,xOffset:-6,children:jsxRuntimeExports.jsx(RetryIconCircle,{})})})})}),pt.iconShape==="circle"?jsxRuntimeExports.jsx(CircleSpinner,{logo:Ct===states$1.UNAVAILABLE?jsxRuntimeExports.jsx("div",{style:{transform:"scale(1.14)",position:"relative",width:"100%"},children:pt.icon}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pt.icon}),smallLogo:pt.iconShouldShrink,connecting:Ct===states$1.CONNECTING,unavailable:Ct===states$1.UNAVAILABLE}):jsxRuntimeExports.jsx(SquircleSpinner,{logo:Ct===states$1.UNAVAILABLE?jsxRuntimeExports.jsx("div",{style:{transform:"scale(1.14)",position:"relative",width:"100%"},children:pt.icon}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:pt.icon}),connecting:Ct===states$1.CONNECTING})]})}),jsxRuntimeExports.jsx(ModalContentContainer,{children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[Ct===states$1.FAILED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalH1,{$error:!0,children:[jsxRuntimeExports.jsx(AlertIcon,{}),At.injectionScreen_failed_h1]}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_failed_p})]})},states$1.FAILED),Ct===states$1.REJECTED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:28},children:[jsxRuntimeExports.jsx(ModalH1,{children:At.injectionScreen_rejected_h1}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_rejected_p})]})},states$1.REJECTED),(Ct===states$1.CONNECTING||Ct===states$1.EXPIRING)&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:28},children:[jsxRuntimeExports.jsx(ModalH1,{children:ft.connector.id==="injected"?At.injectionScreen_connecting_injected_h1:At.injectionScreen_connecting_h1}),jsxRuntimeExports.jsx(ModalBody,{children:ft.connector.id==="injected"?At.injectionScreen_connecting_injected_p:At.injectionScreen_connecting_p})]})},states$1.CONNECTING),Ct===states$1.CONNECTED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsxs(ModalH1,{$valid:!0,children:[jsxRuntimeExports.jsx(TickIcon,{})," ",At.injectionScreen_connected_h1]}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_connected_p})]})},states$1.CONNECTED),Ct===states$1.NOTCONNECTED&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:jsxRuntimeExports.jsxs(ModalContent,{children:[jsxRuntimeExports.jsx(ModalH1,{children:At.injectionScreen_notconnected_h1}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_notconnected_p})]})},states$1.NOTCONNECTED),Ct===states$1.UNAVAILABLE&&jsxRuntimeExports.jsx(Content$1,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$1,children:vt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:18},children:[jsxRuntimeExports.jsx(ModalH1,{children:At.injectionScreen_install_h1}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_install_p})]}),!ft.isInstalled&&vt&&jsxRuntimeExports.jsx(Button$1,{href:vt,icon:jsxRuntimeExports.jsx(BrowserIcon,{}),children:At.installTheExtension})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:12},children:[jsxRuntimeExports.jsx(ModalH1,{children:At.injectionScreen_unavailable_h1}),jsxRuntimeExports.jsx(ModalBody,{children:At.injectionScreen_unavailable_p})]}),!ft.isInstalled&&Et&&jsxRuntimeExports.jsxs(Button$1,{href:Et==null?void 0:Et.url,icon:jsxRuntimeExports.jsx(BrowserIcon,{browser:Et==null?void 0:Et.name}),children:["Install on ",Et==null?void 0:Et.label]})]})},states$1.UNAVAILABLE)]})})]})}):jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(Container$4,{children:[jsxRuntimeExports.jsx(ModalHeading,{children:"Invalid State"}),jsxRuntimeExports.jsx(ModalContent,{children:jsxRuntimeExports.jsx(Alert,{children:"No connectors match the id given. This state should never happen."})})]})})},QRCodeContainer=styled(motion.div)` - z-index: 3; - position: relative; - overflow: hidden; - height: 0; - padding-bottom: 100% !important; - display: flex; - align-items: center; - justify-content: center; - margin: 1px 0 2px; - border-radius: var(--ck-qr-border-radius, 24px); - background: var(--ck-qr-background, transparent); - box-shadow: 0 0 0 1px var(--ck-qr-border-color); - backface-visibility: hidden; - svg { - display: block; - max-width: 100%; - width: 100%; - height: auto; - } -`,QRCodeContent=styled(motion.div)` - position: absolute; - inset: 13px; - svg { - width: 100% !important; - height: auto !important; - } -`,PlaceholderKeyframes$2=We` - 0%{ background-position: 100% 0; } - 100%{ background-position: -100% 0; } -`,QRPlaceholder=styled(motion.div)` - --color: var(--ck-qr-dot-color); - --bg: var(--ck-qr-background, var(--ck-body-background)); - - position: absolute; - inset: 0; - display: flex; - align-items: center; - justify-content: center; - > div { - z-index: 4; - position: relative; - width: 28%; - height: 28%; - border-radius: 20px; - background: var(--bg); - box-shadow: 0 0 0 7px var(--bg); - } - > span { - z-index: 4; - position: absolute; - background: var(--color); - border-radius: 12px; - width: 13.25%; - height: 13.25%; - box-shadow: 0 0 0 4px var(--bg); - &:before { - content: ''; - position: absolute; - inset: 9px; - border-radius: 3px; - box-shadow: 0 0 0 4px var(--bg); - } - &:nth-child(1) { - top: 0; - left: 0; - } - &:nth-child(2) { - top: 0; - right: 0; - } - &:nth-child(3) { - bottom: 0; - left: 0; - } - } - &:before { - z-index: 3; - content: ''; - position: absolute; - inset: 0; - background: repeat; - background-size: 1.888% 1.888%; - background-image: radial-gradient(var(--color) 41%, transparent 41%); - } - &:after { - z-index: 5; - content: ''; - position: absolute; - inset: 0; - transform: scale(1.5) rotate(45deg); - background-image: linear-gradient( - 90deg, - rgba(255, 255, 255, 0) 50%, - rgba(255, 255, 255, 1), - rgba(255, 255, 255, 0) - ); - background-size: 200% 100%; - animation: ${PlaceholderKeyframes$2} 1000ms linear infinite both; - } -`,LogoContainer$2=styled(motion.div)` - z-index: 6; - position: absolute; - top: 0; - left: 0; - width: 100%; - height: 100%; - transform: translateY(50%) scale(0.9999); // Shifting fix -`,LogoIcon=styled(motion.div)` - z-index: 6; - position: absolute; - left: 50%; - overflow: hidden; - - transform: translate(-50%, -50%) scale(0.9999); // Shifting fix - - svg { - display: block; - position: relative; - width: 100%; - height: 100%; - } - - ${et=>et.$wcLogo?Ae` - width: 29%; - height: 20.5%; - `:Ae` - width: 28%; - height: 28%; - border-radius: 17px; - &:before { - pointer-events: none; - z-index: 2; - content: ''; - position: absolute; - inset: 0; - border-radius: inherit; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02); - } - `} -`,generateMatrix=(et,o)=>{const tt=Array.prototype.slice.call(browser$1.create(et,{errorCorrectionLevel:o}).modules.data,0),rt=Math.sqrt(tt.length);return tt.reduce((nt,ot,it)=>(it%rt===0?nt.push([ot]):nt[nt.length-1].push(ot))&&nt,[])};function QRCode$1({ecl:et="M",size:o=200,uri:tt,clearArea:rt=!1,image:nt,imageBackground:ot="transparent"}){const it=rt?76:0,st=o-10*2,at=reactExports.useMemo(()=>{const ct=[],lt=generateMatrix(tt,et),dt=st/lt.length;if([{x:0,y:0},{x:1,y:0},{x:0,y:1}].forEach(({x:yt,y:gt})=>{const bt=(lt.length-7)*dt*yt,xt=(lt.length-7)*dt*gt;for(let vt=0;vt<3;vt++)ct.push(jsxRuntimeExports.jsx("rect",{fill:vt%2!==0?"var(--ck-qr-background, var(--ck-body-background))":"var(--ck-qr-dot-color)",rx:(vt-2)*-5+(vt===0?2:3),ry:(vt-2)*-5+(vt===0?2:3),width:dt*(7-vt*2),height:dt*(7-vt*2),x:bt+dt*vt,y:xt+dt*vt},`${vt}-${yt}-${gt}`))}),nt){const yt=(lt.length-7)*dt*1,gt=(lt.length-7)*dt*1;ct.push(jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("rect",{fill:ot,rx:-2*-5+2,ry:-2*-5+2,width:dt*(7-0*2),height:dt*(7-0*2),x:yt+dt*0,y:gt+dt*0}),jsxRuntimeExports.jsx("foreignObject",{width:dt*(7-0*2),height:dt*(7-0*2),x:yt+dt*0,y:gt+dt*0,children:jsxRuntimeExports.jsx("div",{style:{borderRadius:-2*-5+2,overflow:"hidden"},children:nt})})]}))}const mt=Math.floor((it+25)/dt),ft=lt.length/2-mt/2,pt=lt.length/2+mt/2-1;return lt.forEach((yt,gt)=>{yt.forEach((bt,xt)=>{lt[gt][xt]&&(gt<7&&xt<7||gt>lt.length-8&&xt<7||gt<7&&xt>lt.length-8||(nt||!(gt>ft&>ft&&xt{function tt(){o({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",tt),tt(),()=>window.removeEventListener("resize",tt)},[]),et}function CustomQRCode({value:et,image:o,imageBackground:tt,imagePosition:rt="center",tooltipMessage:nt}){const it=useWindowSize().width>920&&nt?jsxRuntimeExports.jsx(Tooltip,{xOffset:139,yOffset:5,delay:.1,message:nt,children:o}):o;return jsxRuntimeExports.jsx(QRCodeContainer,{children:jsxRuntimeExports.jsxs(QRCodeContent,{children:[o&&jsxRuntimeExports.jsx(LogoContainer$2,{children:jsxRuntimeExports.jsx(LogoIcon,{$wcLogo:rt!=="center",style:{background:rt==="center"?tt:void 0},children:it})}),jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:et?jsxRuntimeExports.jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,position:"absolute",inset:[0,0]},transition:{duration:.2},children:jsxRuntimeExports.jsx(QRCode$1,{uri:et,size:288,ecl:"M",clearArea:!!(rt==="center"&&o)})},et):jsxRuntimeExports.jsxs(QRPlaceholder,{initial:{opacity:.1},animate:{opacity:.1},exit:{opacity:0,position:"absolute",inset:[0,0]},transition:{duration:.2},children:[jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("div",{})]})})]})})}CustomQRCode.displayName="CustomQRCode";const IconContainer$1=styled(motion.div)` - position: relative; - display: flex; - align-items: center; - justify-content: center; - width: 47px; - height: 52px; - min-width: 47px; - min-height: 52px; - svg { - display: block; - max-width: 100%; - height: auto; - } -`,ScanIconWithLogos=({logo:et})=>{const o=[jsxRuntimeExports.jsx(Logos.MetaMask,{background:!0}),jsxRuntimeExports.jsx(Logos.Coinbase,{background:!0}),jsxRuntimeExports.jsx(Logos.Crypto,{}),jsxRuntimeExports.jsx(Logos.ImToken,{}),jsxRuntimeExports.jsx(Logos.Argent,{}),jsxRuntimeExports.jsx(Logos.Trust,{})];return jsxRuntimeExports.jsx(IconContainer$1,{children:jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"47",height:"52",viewBox:"0 0 47 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsxs("g",{mask:"url(#gradient-mask)",children:[jsxRuntimeExports.jsx("path",{d:"M7 14.5C7 11.4624 9.46243 9 12.5 9H31.5C34.5376 9 37 11.4624 37 14.5V47H7V14.5Z",fill:"var(--ck-graphic-scaniconwithlogos-04)"}),et?jsxRuntimeExports.jsx("foreignObject",{x:"13",y:"21",width:"18",height:"18",rx:"5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:5},children:et})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("foreignObject",{x:"12",y:"15",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[0]})}),jsxRuntimeExports.jsx("foreignObject",{x:"23",y:"15",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[1]})}),jsxRuntimeExports.jsx("foreignObject",{x:"12",y:"26",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[2]})})}),jsxRuntimeExports.jsx("foreignObject",{x:"23",y:"26",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[3]})}),jsxRuntimeExports.jsx("foreignObject",{x:"12",y:"37",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[4]})}),jsxRuntimeExports.jsx("foreignObject",{x:"23",y:"37",width:"9",height:"9",rx:"2.5",children:jsxRuntimeExports.jsx("div",{style:{overflow:"hidden",borderRadius:2.5},children:o[5]})})]}),jsxRuntimeExports.jsx("path",{d:"M36 47V13.7143C36 11.1107 33.8893 9 31.2857 9H12.7143C10.1107 9 8 11.1107 8 13.7143V47",stroke:"url(#paint0_linear_924_12568)",strokeWidth:"2"}),jsxRuntimeExports.jsx("path",{d:"M15 10H29C29 11.1046 28.1046 12 27 12H17C15.8954 12 15 11.1046 15 10Z",fill:"var(--ck-graphic-scaniconwithlogos-01)"}),jsxRuntimeExports.jsx("rect",{x:"1",y:"47",width:"43",height:"5",fill:"var(--ck-tooltip-background)"}),jsxRuntimeExports.jsx("rect",{x:"22",y:"1",width:"24",height:"24",rx:"12",fill:"var(--ck-graphic-scaniconwithlogos-03)",stroke:"var(--ck-tooltip-background)",strokeWidth:"2"}),jsxRuntimeExports.jsx("rect",{x:"34.5",y:"10",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("rect",{x:"31",y:"10",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("rect",{x:"31",y:"13.5",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("rect",{x:"34.5",y:"13.5",width:"2.5",height:"2.5",rx:"0.75",fill:"#373737"}),jsxRuntimeExports.jsx("path",{d:"M28.5 10.5V9C28.5 8.17157 29.1716 7.5 30 7.5H31.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M36.5 7.5L38 7.5C38.8284 7.5 39.5 8.17157 39.5 9L39.5 10.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M39.5 15.5L39.5 17C39.5 17.8284 38.8284 18.5 38 18.5L36.5 18.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),jsxRuntimeExports.jsx("path",{d:"M31.5 18.5L30 18.5C29.1716 18.5 28.5 17.8284 28.5 17L28.5 15.5",stroke:"#373737",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_924_12568",x1:"22",y1:"8.2549",x2:"22",y2:"47",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-graphic-scaniconwithlogos-01)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-graphic-scaniconwithlogos-02)"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"linear-gradient-mask",x1:"47",y1:"42",x2:"47",y2:"47",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"black",stopOpacity:"0"})]}),jsxRuntimeExports.jsx("mask",{id:"gradient-mask",children:jsxRuntimeExports.jsx("rect",{x:"0",y:"0",width:"47",height:"52",fill:"url(#linear-gradient-mask)"})})]})]})})},ConnectWithQRCode=({switchConnectMethod:et})=>{var o,tt,rt,nt,ot,it,st,at;const ct=useContext(),lt=ct.connector.id,dt=useWallet(ct.connector.id),{open:ht,isOpen:mt}=useWalletConnectModal(),{connect:{getUri:ft}}=useWeb3(),pt=ft(lt),yt=pt?(tt=(o=dt==null?void 0:dt.getWalletConnectDeeplink)===null||o===void 0?void 0:o.call(dt,pt))!==null&&tt!==void 0?tt:pt:void 0,gt=useLocales({CONNECTORNAME:dt==null?void 0:dt.name});if(!dt)return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:["Wallet not found ",ct.connector.id]});const bt=dt==null?void 0:dt.downloadUrls,xt={chrome:bt==null?void 0:bt.chrome,firefox:bt==null?void 0:bt.firefox,brave:bt==null?void 0:bt.brave,edge:bt==null?void 0:bt.edge,safari:bt==null?void 0:bt.safari};detectBrowser();const vt=bt&&Object.keys(bt).length!==0;xt&&(Object.keys(xt)[0],((rt=Object.keys(xt)[0])===null||rt===void 0?void 0:rt.charAt(0).toUpperCase())+((nt=Object.keys(xt)[0])===null||nt===void 0?void 0:nt.slice(1)),xt[Object.keys(xt)[0]]);const Et=isWalletConnectConnector(lt);return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:8,gap:14},children:[jsxRuntimeExports.jsx(CustomQRCode,{value:yt,image:dt==null?void 0:dt.icon,tooltipMessage:isWalletConnectConnector(lt)?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScanIconWithLogos,{}),jsxRuntimeExports.jsx("span",{children:gt.scanScreen_tooltip_walletConnect})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScanIconWithLogos,{logo:dt==null?void 0:dt.icon}),jsxRuntimeExports.jsx("span",{children:gt.scanScreen_tooltip_default})]})}),Et?jsxRuntimeExports.jsx(OrDivider,{}):vt&&jsxRuntimeExports.jsx(OrDivider,{children:gt.dontHaveTheApp})]}),Et&&jsxRuntimeExports.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:14},children:[((ot=ct.options)===null||ot===void 0?void 0:ot.walletConnectCTA)!=="modal"&&jsxRuntimeExports.jsx(CopyToClipboard,{variant:"button",string:yt,children:((it=ct.options)===null||it===void 0?void 0:it.walletConnectCTA)==="link"?gt.copyToClipboard:gt.copyCode}),((st=ct.options)===null||st===void 0?void 0:st.walletConnectCTA)!=="link"&&jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(ExternalLinkIcon,{}),onClick:ht,disabled:mt,waiting:mt,children:((at=ct.options)===null||at===void 0?void 0:at.walletConnectCTA)==="modal"?gt.useWalletConnectModal:gt.useModal})]}),vt&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Button$1,{onClick:()=>{ct.setRoute(routes.DOWNLOAD)},download:!0,children:gt.getWalletName})})]})},states={QRCODE:"qrcode",INJECTOR:"injector"},ConnectUsing=()=>{const et=useContext(),o=useWallet(et.connector.id),tt=!(o!=null&&o.isInstalled)&&(o==null?void 0:o.getWalletConnectDeeplink),[rt,nt]=reactExports.useState(tt?states.QRCODE:states.INJECTOR);return reactExports.useEffect(()=>{const ot=async()=>{await(o==null?void 0:o.connector.getProvider())||(nt(states.QRCODE),setTimeout(et.triggerResize,10))};rt===states.INJECTOR&&ot()},[]),o?jsxRuntimeExports.jsxs(AnimatePresence,{children:[rt===states.QRCODE&&jsxRuntimeExports.jsx(motion.div,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$2,children:jsxRuntimeExports.jsx(ConnectWithQRCode,{switchConnectMethod:ot=>{nt(states.INJECTOR)}})},states.QRCODE),rt===states.INJECTOR&&jsxRuntimeExports.jsx(motion.div,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants$2,children:jsxRuntimeExports.jsx(ConnectWithInjector,{switchConnectMethod:ot=>{nt(states.QRCODE)}})},states.INJECTOR)]}):jsxRuntimeExports.jsxs(Alert,{children:["Connector not found ",et.connector.id]})},DownloadApp=()=>{var et,o,tt;const rt=useContext(),nt=useWallet(rt.connector.id),ot=useLocales({CONNECTORNAME:nt==null?void 0:nt.name});if(!nt)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"Wallet not found"});const it={ios:(et=nt.downloadUrls)===null||et===void 0?void 0:et.ios,android:(o=nt.downloadUrls)===null||o===void 0?void 0:o.android,redirect:(tt=nt.downloadUrls)===null||tt===void 0?void 0:tt.download},st=it.ios&&it.android?ot.downloadAppScreen_iosAndroid:it.ios?ot.downloadAppScreen_ios:ot.downloadAppScreen_android;return jsxRuntimeExports.jsx(PageContent,{children:jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:4,gap:14},children:[it.redirect&&jsxRuntimeExports.jsx(CustomQRCode,{value:it.redirect}),!it.redirect&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:"No download link available"}),jsxRuntimeExports.jsx(ModalBody,{style:{fontSize:15,lineHeight:"20px",padding:"0 12px"},children:st})]})})},AvatarContainer=styled(motion.div)` - padding: 18px 0 20px; - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - padding: 16px 0 20px; - } -`,AvatarInner=styled(motion.div)` - position: relative; - display: inline-block; -`,ChainSelectorContainer=styled(motion.div)` - z-index: 3; - position: absolute; - bottom: 0px; - right: -16px; -`,BalanceContainer=styled(motion.div)` - position: relative; -`,Balance$1=styled(motion.div)` - position: relative; -`,PlaceholderKeyframes$1=We` - 0%{ background-position: 100% 0; } - 100%{ background-position: -100% 0; } -`,LoadingBalance=styled(motion.div)` - width: 25%; - margin: 0 auto; - position: relative; - overflow: hidden; - border-radius: 10px; - background: var(--ck-body-background-secondary); - inset: 0; - &:before { - z-index: 4; - content: ''; - position: absolute; - inset: 0; - background-image: linear-gradient( - 90deg, - var(--ck-body-background-transparent) 50%, - var(--ck-body-background), - var(--ck-body-background-transparent) - ); - opacity: 0.75; - background-size: 200% 100%; - animation: ${PlaceholderKeyframes$1} 1000ms linear infinite both; - } -`;function addressToNumber(et){return et.split("").map(o=>o.charCodeAt(0)).reduce((o,tt)=>o+tt)%100/100}const EnsAvatar=styled(motion.div)` - will-change: transform; // Needed for Safari - pointer-events: none; - user-select: none; - position: relative; - overflow: hidden; - margin: 0; - border-radius: ${et=>`${et.$radius}px`}; - width: ${et=>`${et.$size}px`}; - height: ${et=>`${et.$size}px`}; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); - &:before { - content: ''; - z-index: 1; - position: absolute; - inset: 0; - border-radius: inherit; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02); - } - ${et=>{if(et.$seed){const o=Math.ceil(addressToNumber(et.$seed)*8),tt=`0${o===0?1:o}`;return Ae` - background: var(--ck-ens-${tt}-start); - background: linear-gradient( - 180deg, - var(--ck-ens-${tt}-start) 0%, - var(--ck-ens-${tt}-stop) 100% - ); - `}}} -`,ImageContainer=styled(motion.img)` - display: block; - position: relative; - width: 100%; - height: 100%; - opacity: ${et=>et.$loaded?1:0}; - will-change: opacity; // Needed for Safari - transition: opacity 500ms ease; - transform: scale(1.01); // fixes background color bleeding -`;function useIsMounted(){const[et,o]=reactExports.useState(!1);return reactExports.useEffect(()=>o(!0),[]),et}const ensFallbackConfig=createConfig({chains:[mainnet],transports:{[mainnet.id]:http()}});function useEnsFallbackConfig(){return useChainIsSupported(1)?void 0:ensFallbackConfig}const Avatar=({address:et,name:o,size:tt=96,radius:rt=96})=>{var nt,ot,it;const st=useIsMounted(),at=useContext(),ct=reactExports.useRef(null),[lt,dt]=reactExports.useState(!0),ht=useEnsFallbackConfig(),{data:mt}=useEnsAddress({chainId:1,name:o,config:ht}),{data:ft}=useEnsName({chainId:1,address:(nt=et??mt)!==null&&nt!==void 0?nt:void 0,config:ht}),{data:pt}=useEnsAvatar({chainId:1,name:normalize$2(ft??""),config:ht}),yt={address:mt??et,name:ft??o,avatar:pt??void 0};return reactExports.useEffect(()=>{ct.current&&ct.current.complete&&ct.current.naturalHeight!==0||dt(!1)},[pt]),st?!((ot=at.options)===null||ot===void 0)&&ot.customAvatar?jsxRuntimeExports.jsx("div",{style:{width:tt,height:tt,borderRadius:rt,overflow:"hidden"},children:(it=at.options)===null||it===void 0?void 0:it.customAvatar({address:et??(yt==null?void 0:yt.address),ensName:o??(yt==null?void 0:yt.name),ensImage:yt==null?void 0:yt.avatar,size:tt,radius:rt})}):!yt.name||!yt.avatar?jsxRuntimeExports.jsx(ResetContainer,{style:{pointerEvents:"none"},children:jsxRuntimeExports.jsx(EnsAvatar,{$size:tt,$seed:yt.address,$radius:rt})}):jsxRuntimeExports.jsx(ResetContainer,{style:{pointerEvents:"none"},children:jsxRuntimeExports.jsx(EnsAvatar,{$size:tt,$seed:yt.address,$radius:rt,children:jsxRuntimeExports.jsx(ImageContainer,{ref:ct,src:yt.avatar,alt:yt.name,onLoad:()=>dt(!0),$loaded:lt})})}):jsxRuntimeExports.jsx("div",{style:{width:tt,height:tt,borderRadius:rt}})},KnownChain=({testnet:et,...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"black"},children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.5611 8.12948C21.0082 7.90729 21.5007 7.79167 22 7.79167C22.4993 7.79167 22.9919 7.90729 23.439 8.12948L23.4408 8.1304L33.0387 12.9293C33.577 13.197 34.031 13.61 34.3478 14.121C34.6649 14.6323 34.833 15.2218 34.8333 15.8234V27.2595C34.833 27.8611 34.6649 28.4511 34.3478 28.9624C34.031 29.4733 33.578 29.8858 33.0398 30.1535L23.4411 34.9528C22.9919 35.1775 22.4963 35.2947 21.994 35.2947C21.4918 35.2947 20.9964 35.1777 20.5472 34.9529L10.9475 30.1531L10.9452 30.1519C10.4071 29.8808 9.95535 29.4646 9.6411 28.9504C9.32739 28.437 9.16312 27.8464 9.16673 27.2448L9.16675 27.2417L10.0004 27.2475H9.16673V27.2448V15.8239C9.16705 15.2223 9.33518 14.6322 9.65222 14.121C9.96906 13.61 10.4221 13.1976 10.9604 12.9298L20.5592 8.1304L20.5611 8.12948ZM21.3031 9.62267L11.8706 14.3389L22 19.4036L32.1294 14.3389L22.697 9.62267C22.4806 9.51531 22.2416 9.45905 22 9.45905C21.7585 9.45905 21.5194 9.51534 21.3031 9.62267ZM10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241ZM22.8337 33.3923L32.2967 28.6608C32.5576 28.5312 32.7772 28.3313 32.9308 28.0836C33.0844 27.836 33.1658 27.5504 33.166 27.259V15.8243C33.1659 15.7786 33.1639 15.7331 33.1599 15.6878L22.8337 20.8509V33.3923Z",fill:"url(#paint0_linear_3546_7073)"}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.8341 15.8241C10.8341 15.7785 10.8362 15.733 10.8401 15.6878L21.1663 20.8509V33.3983L11.6955 28.6629C11.4352 28.5315 11.2159 28.3297 11.0638 28.0809C10.9116 27.8318 10.8321 27.5452 10.8341 27.2533L10.8341 27.2475V15.8241Z",fill:"url(#paint1_linear_3546_7073)",fillOpacity:"0.3"}),jsxRuntimeExports.jsxs("defs",{children:[jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]}),jsxRuntimeExports.jsxs("linearGradient",{id:"paint1_linear_3546_7073",x1:"22",y1:"7.79167",x2:"22",y2:"35.2947",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"white"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0.7"})]})]})]}),UnknownChain=({testnet:et,...o})=>jsxRuntimeExports.jsx(KnownChain,{testnet:!0,...o}),Ethereum=({testnet:et,...o})=>{let tt="var(--ck-chain-ethereum-01, #25292E)",rt="var(--ck-chain-ethereum-02, #ffffff)";return et&&(tt="linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)",rt="#fff"),jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:tt},children:[jsxRuntimeExports.jsx("path",{d:"M21.9967 6.99621L21.7955 7.67987V27.5163L21.9967 27.7171L31.2044 22.2744L21.9967 6.99621Z",fill:rt}),jsxRuntimeExports.jsx("path",{d:"M21.9957 6.99621L12.7878 22.2744L21.9957 27.7171V18.0891V6.99621Z",fill:rt}),jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M21.9959 36.9996L21.9959 36.9997V36.9995L31.2091 24.0243L21.9959 29.4642L12.788 24.0243L21.9957 36.9993L21.9958 36.9997L21.9959 36.9996Z",fill:rt}),jsxRuntimeExports.jsx("path",{d:"M21.996 27.7181L31.2037 22.2753L21.996 18.09V27.7181Z",fill:rt}),jsxRuntimeExports.jsx("path",{d:"M12.7878 22.2753L21.9957 27.7181V18.09L12.7878 22.2753Z",fill:rt})]})},Polygon=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#6F41D8"},children:jsxRuntimeExports.jsx("path",{d:"M29.0015 17.4529C28.4941 17.1572 27.8355 17.1572 27.2773 17.4529L23.3186 19.7271L20.6305 21.2094L16.6719 23.4822C16.1645 23.7792 15.5059 23.7792 14.9476 23.4822L11.8016 21.703C11.2943 21.4074 10.9395 20.8642 10.9395 20.2702V16.7612C10.9395 16.1686 11.2434 15.6255 11.8016 15.3285L14.8954 13.5988C15.4041 13.3018 16.0641 13.3018 16.6224 13.5988L19.7161 15.3285C20.2249 15.6255 20.5796 16.1686 20.5796 16.7612V19.0355L23.2678 17.5024V15.2295C23.2707 14.9343 23.1917 14.6441 23.0395 14.3911C22.8873 14.1381 22.6679 13.9324 22.4056 13.7968L16.6719 10.5353C16.1645 10.2382 15.5059 10.2382 14.9476 10.5353L9.11214 13.7968C8.84992 13.9324 8.63049 14.1381 8.47828 14.3911C8.32607 14.6441 8.24705 14.9343 8.25002 15.2295V21.802C8.25002 22.396 8.55389 22.9391 9.11214 23.2361L14.9476 26.4976C15.455 26.7932 16.115 26.7932 16.6719 26.4976L20.6305 24.2729L23.3186 22.7411L27.2773 20.5177C27.7846 20.2207 28.4433 20.2207 29.0015 20.5177L32.0966 22.2475C32.6054 22.5431 32.9588 23.0863 32.9588 23.6803V27.1893C32.9588 27.7819 32.6563 28.325 32.0966 28.622L29.0029 30.4013C28.4941 30.6983 27.8341 30.6983 27.2773 30.4013L24.1821 28.6715C23.6734 28.3745 23.3186 27.8314 23.3186 27.2387V24.9645L20.6305 26.4976V28.7705C20.6305 29.3631 20.9344 29.9076 21.4926 30.2032L27.3281 33.4647C27.8355 33.7617 28.4941 33.7617 29.0524 33.4647L34.8879 30.2032C35.3953 29.9076 35.75 29.3645 35.75 28.7705V22.198C35.753 21.9028 35.674 21.6126 35.5218 21.3596C35.3695 21.1066 35.1501 20.9009 34.8879 20.7653L29.0029 17.4529H29.0015Z",fill:"white"})}),Optimism=({testnet:et,...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#FF0420"},children:[jsxRuntimeExports.jsx("path",{d:"M15.5877 27.8473C14.2777 27.8473 13.2045 27.539 12.3679 26.9226C11.5422 26.2952 11.1294 25.4035 11.1294 24.2477C11.1294 24.0055 11.157 23.7082 11.212 23.356C11.3552 22.5634 11.5588 21.6112 11.823 20.4994C12.5715 17.4722 14.5034 15.9586 17.6187 15.9586C18.4664 15.9586 19.2259 16.1017 19.8974 16.3879C20.5689 16.663 21.0973 17.0814 21.4826 17.6428C21.8678 18.1932 22.0605 18.8537 22.0605 19.6242C22.0605 19.8554 22.033 20.1471 21.9779 20.4994C21.8128 21.4791 21.6146 22.4313 21.3835 23.356C20.9982 24.8641 20.3322 25.9924 19.3855 26.741C18.4388 27.4785 17.1729 27.8473 15.5877 27.8473ZM15.8189 25.4695C16.4354 25.4695 16.9582 25.2879 17.3876 24.9247C17.8279 24.5614 18.1416 24.0055 18.3287 23.257C18.5819 22.2222 18.7746 21.3195 18.9067 20.5489C18.9507 20.3178 18.9727 20.0811 18.9727 19.8389C18.9727 18.8372 18.4498 18.3363 17.4041 18.3363C16.7876 18.3363 16.2592 18.5179 15.8189 18.8812C15.3896 19.2445 15.0813 19.8004 14.8943 20.5489C14.6961 21.2865 14.4979 22.1892 14.2998 23.257C14.2557 23.477 14.2337 23.7082 14.2337 23.9504C14.2337 24.9632 14.7622 25.4695 15.8189 25.4695Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M22.8188 27.6815C22.6977 27.6815 22.6041 27.6429 22.5381 27.5659C22.483 27.4778 22.4665 27.3788 22.4885 27.2687L24.7672 16.5358C24.7892 16.4147 24.8498 16.3156 24.9489 16.2385C25.0479 16.1615 25.1525 16.1229 25.2626 16.1229H29.6548C30.8767 16.1229 31.8564 16.3761 32.5939 16.8825C33.3426 17.3889 33.7168 18.1209 33.7168 19.0786C33.7168 19.3538 33.6838 19.64 33.6177 19.9372C33.3426 21.2032 32.7867 22.1389 31.95 22.7443C31.1244 23.3498 29.9905 23.6525 28.5485 23.6525H26.3194L25.5598 27.2687C25.5377 27.3898 25.4772 27.4888 25.3782 27.5659C25.2791 27.6429 25.1745 27.6815 25.0645 27.6815H22.8188ZM28.6641 21.3738C29.1264 21.3738 29.5282 21.2472 29.8695 20.994C30.2217 20.7408 30.4529 20.3776 30.563 19.9042C30.596 19.717 30.6125 19.552 30.6125 19.4089C30.6125 19.0896 30.519 18.8474 30.3318 18.6823C30.1446 18.5062 29.8255 18.4182 29.3741 18.4182H27.3926L26.7652 21.3738H28.6641Z",fill:"white"})]}),Arbitrum=({testnet:et,...o})=>{const tt=et?"#ffffff":"#28A0F0",rt=et?"#ffffff":"#96BEDC";return jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#2C364F"},children:[!et&&jsxRuntimeExports.jsx("path",{d:"M25.7948 20.5826L28.2683 16.3854L34.9355 26.7696L34.9386 28.7625L34.9168 15.0491C34.9011 14.7137 34.7231 14.407 34.4391 14.2261L22.4357 7.32182C22.1551 7.1838 21.7989 7.18546 21.5187 7.32618C21.4807 7.34524 21.4453 7.36576 21.4113 7.38835L21.3694 7.41467L9.71816 14.1664L9.67298 14.1871C9.61474 14.2137 9.55609 14.2479 9.50076 14.2872C9.27983 14.4456 9.1331 14.68 9.08564 14.9425C9.07859 14.9823 9.0732 15.023 9.07092 15.064L9.08916 26.239L15.2994 16.6138C16.0811 15.3376 17.7847 14.9262 19.3662 14.9488L21.2221 14.9977L10.2862 32.5356L11.5753 33.2778L22.6422 15.0155L27.5338 14.9977L16.4956 33.7209L21.0955 36.3668L21.6451 36.6827C21.8776 36.7772 22.1516 36.7819 22.386 36.6972L34.5581 29.6433L32.2309 30.9918L25.7948 20.5826ZM26.7384 34.175L22.0925 26.8829L24.9287 22.0702L31.0303 31.6876L26.7384 34.175Z",fill:"#2D374B"}),jsxRuntimeExports.jsx("path",{d:"M22.0924 26.8832L26.7385 34.1751L31.0302 31.6879L24.9286 22.0705L22.0924 26.8832Z",fill:tt}),jsxRuntimeExports.jsx("path",{d:"M34.9387 28.7627L34.9356 26.7698L28.2684 16.3856L25.7949 20.5828L32.2312 30.992L34.5584 29.6435C34.7866 29.4582 34.9248 29.1861 34.9393 28.8926L34.9387 28.7627Z",fill:tt}),jsxRuntimeExports.jsx("path",{d:"M7 30.642L10.2863 32.5356L21.2222 14.9976L19.3663 14.9487C17.785 14.9263 16.0814 15.3375 15.2995 16.6137L9.08927 26.239L7 29.449V30.642V30.642Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M27.534 14.9977L22.6423 15.0155L11.5754 33.2778L15.4437 35.5049L16.4955 33.7209L27.534 14.9977Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M37 14.9723C36.9592 13.9493 36.4052 13.013 35.5377 12.4677L23.377 5.47434C22.5187 5.04223 21.4466 5.04161 20.5868 5.47414C20.4852 5.52533 8.76078 12.3251 8.76078 12.3251C8.5985 12.4029 8.44224 12.4955 8.2953 12.6008C7.52081 13.156 7.0487 14.0186 7 14.9661V29.4492L9.08927 26.2392L9.07103 15.0639C9.07352 15.0231 9.0787 14.9827 9.08575 14.9431C9.133 14.6801 9.27994 14.4457 9.50086 14.2872C9.5562 14.2478 21.4806 7.34517 21.5186 7.32611C21.799 7.18538 22.155 7.18373 22.4356 7.32175L34.439 14.226C34.723 14.4069 34.901 14.7137 34.9167 15.049V28.8921C34.9022 29.1856 34.7862 29.4577 34.558 29.643L32.2308 30.9916L31.03 31.6875L26.7383 34.1747L22.3859 36.6969C22.1515 36.7817 21.8773 36.7769 21.645 36.6824L16.4955 33.7206L15.4435 35.5046L20.0713 38.169C20.2243 38.256 20.3607 38.3331 20.4726 38.3961C20.6458 38.4933 20.764 38.5582 20.8056 38.5785C21.1345 38.7383 21.6077 38.8311 22.0342 38.8311C22.4251 38.8311 22.8064 38.7594 23.1672 38.6181L35.8092 31.2971C36.5347 30.7348 36.9617 29.8869 37 28.9686V14.9723Z",fill:rt})]})},Telos=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#571AFF"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M26.1834 8.14754C25.6606 8.23504 25.3644 8.50235 24.9216 9.28591C24.5651 9.91722 24.4762 10.0244 24.2024 10.1592L23.9832 10.2668L19.2967 10.286L14.6097 10.3057L14.3875 10.3902C13.7059 10.6492 13.6192 10.7135 11.6291 12.4407C9.72243 14.0953 9.64893 14.1723 9.59249 14.5836C9.54437 14.9362 9.78981 15.6327 10.5191 17.2143C11.2847 18.8737 11.2839 18.8641 10.7444 19.5256C10.2645 20.1136 10.2269 20.2588 10.2041 21.5915C10.1717 23.502 10.2487 27.6023 10.3222 27.8591C10.3572 27.9816 10.7908 29.204 11.2861 30.5755C11.7813 31.9471 12.4192 33.715 12.704 34.5038C13.4281 36.5107 13.4814 36.5986 14.0392 36.7237C14.3066 36.7837 14.3206 36.781 18.9677 35.7258C24.4395 34.4837 23.7264 34.709 25.0739 33.7968C29.8732 30.5475 29.7337 30.66 29.8969 29.9083C30.0583 29.1642 30.1082 29.1379 31.8267 28.8999C34.6122 28.5145 34.6328 28.5083 34.8831 28.0109C35.0182 27.7423 35.7786 23.3406 35.8136 22.6209C35.8504 21.8828 36.042 22.221 33.3816 18.3395C30.022 13.4382 30.2381 13.7777 30.2399 13.4041C30.2407 13.1735 30.3366 12.9736 31.3236 11.1418C31.8236 10.2134 32.2742 9.35241 32.3254 9.22904C32.5236 8.74691 32.4204 8.3921 32.0301 8.21622L31.8267 8.12391L29.1102 8.11822C27.6048 8.11516 26.2997 8.12829 26.1834 8.14754ZM30.0474 9.4876C30.5623 9.72297 30.5382 9.82447 29.5119 11.7398C28.4317 13.7558 28.3157 13.2711 30.7154 16.7707C31.639 18.1173 32.8076 19.8218 33.3124 20.5581C34.6844 22.5592 34.6048 22.1799 34.1831 24.6903C33.7858 27.0602 33.7792 27.0817 33.3759 27.282C33.1506 27.394 33.2276 27.3813 30.8493 27.7117C28.9147 27.9803 28.8543 28.017 28.6719 29.0338C28.5778 29.557 28.4606 29.8169 28.2243 30.0247C28.0808 30.1512 24.8682 32.368 23.9451 32.9778C23.2587 33.4311 23.6861 33.3152 17.7471 34.6574C17.1997 34.7812 16.4079 34.9632 15.987 35.0617C14.4588 35.4195 14.4299 35.4033 13.8804 33.8948C12.9188 31.2528 11.6811 27.7957 11.6194 27.5787C11.5534 27.3463 11.549 27.1202 11.549 24.059V20.7878L11.6501 20.5966C11.7056 20.4912 11.8671 20.2759 12.0088 20.118C12.8418 19.19 12.8383 19.1183 11.8601 16.9907C10.7663 14.612 10.6797 14.9992 12.697 13.2501C14.2418 11.91 14.3048 11.8593 14.5905 11.7237L14.8394 11.6055L19.6983 11.5854C23.5417 11.5692 24.5891 11.5543 24.7103 11.515C25.1465 11.3728 25.4086 11.1094 25.7975 10.4203C26.3851 9.38041 26.3111 9.40797 28.4597 9.41891C29.6996 9.42547 29.9332 9.43554 30.0474 9.4876Z",fill:"#F7F5FC"})}),Aurora=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#6CD544"},children:jsxRuntimeExports.jsx("path",{d:"M22.0006 7.292C22.6198 7.29004 23.2271 7.46144 23.754 7.7868C24.2808 8.11216 24.706 8.57848 24.9816 9.133L34.3566 27.883C34.611 28.3912 34.7312 28.956 34.7058 29.5238C34.6805 30.0915 34.5103 30.6433 34.2116 31.1268C33.9129 31.6103 33.4956 32.0094 32.9992 32.2861C32.5028 32.5629 31.9439 32.7081 31.3756 32.708H12.6256C12.0573 32.7079 11.4985 32.5626 11.0023 32.2858C10.506 32.009 10.0888 31.6099 9.79022 31.1264C9.49163 30.6429 9.3216 30.0912 9.29628 29.5235C9.27096 28.9558 9.39119 28.3911 9.64556 27.883L19.0196 9.133C19.2951 8.57848 19.7203 8.11216 20.2472 7.7868C20.774 7.46144 21.3814 7.29004 22.0006 7.292ZM22.0006 5C20.9561 4.9999 19.9322 5.29059 19.0437 5.83952C18.1551 6.38846 17.4369 7.17394 16.9696 8.108L7.59456 26.858C7.16544 27.7156 6.96271 28.6687 7.00564 29.6268C7.04856 30.5848 7.33572 31.516 7.83982 32.3318C8.34392 33.1476 9.04823 33.821 9.88584 34.288C10.7235 34.755 11.6666 35.0001 12.6256 35H31.3756C32.3345 34.9999 33.2775 34.7547 34.1149 34.2876C34.9524 33.8206 35.6566 33.1472 36.1606 32.3314C36.6645 31.5156 36.9516 30.5845 36.9945 29.6265C37.0374 28.6686 36.8346 27.7156 36.4056 26.858L27.0316 8.108C26.5642 7.17394 25.846 6.38846 24.9574 5.83952C24.0689 5.29059 23.045 4.9999 22.0006 5Z",fill:"white"})}),Avalanche=({testnet:et,...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#E84142"},children:[jsxRuntimeExports.jsx("path",{d:"M11.0188 32.1528H15.4825C16.5334 32.1528 17.0589 32.1528 17.5278 32.023C18.042 31.8701 18.511 31.5991 18.9009 31.2261C19.2589 30.885 19.5173 30.4328 20.0269 29.5409L20.0272 29.5404L20.0422 29.5142L25.8314 19.2804C26.3456 18.3821 26.5999 17.93 26.7129 17.4554C26.8372 16.9412 26.8372 16.3988 26.7129 15.8847C26.6007 15.4136 26.3439 14.9648 25.8373 14.0798L25.8258 14.0597L23.56 10.1045C23.0911 9.27958 22.8538 8.86711 22.5543 8.71456C22.2323 8.55071 21.848 8.55071 21.526 8.71456C21.2265 8.86711 20.9892 9.27958 20.5202 10.1045L9.49892 29.5311C9.03561 30.3447 8.80392 30.7517 8.82089 31.0849C8.84349 31.4466 9.02994 31.7743 9.33507 31.9721C9.61756 32.1528 10.0809 32.1528 11.0188 32.1528Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M33.1506 32.1528H26.7547C25.8111 32.1528 25.3365 32.1528 25.0596 31.9721C24.7545 31.7743 24.5681 31.4411 24.5455 31.0794C24.5286 30.7486 24.7621 30.3456 25.2294 29.539L25.2295 29.5388L25.2404 29.5199L28.4328 24.0392C28.9018 23.2313 29.1391 22.8301 29.4329 22.6776C29.7548 22.5137 30.1336 22.5137 30.4555 22.6776C30.7472 22.8261 30.9744 23.2102 31.4241 23.9708L31.4248 23.9719L31.4613 24.0336L34.665 29.5143C34.6806 29.5413 34.696 29.5678 34.7113 29.5939L34.7113 29.594C35.1554 30.3603 35.382 30.7514 35.3657 31.0739C35.3486 31.4353 35.1566 31.7688 34.8515 31.9666C34.5689 32.1528 34.0942 32.1528 33.1506 32.1528Z",fill:"white"})]}),Celo=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#FCFE72"},children:jsxRuntimeExports.jsx("path",{d:"M9 9H34.5183V18.112H30.3564C28.896 14.7687 25.6102 12.4171 21.777 12.4171C16.593 12.4171 12.3948 16.6422 12.3948 21.823C12.3948 27.0039 16.593 31.2654 21.777 31.2654C25.5373 31.2654 28.8231 28.9876 30.2829 25.7172H34.5178V34.682H9V9Z",fill:et?"#ffffff":"black"})}),Gnosis=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#009CB4"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.3439 11.8664C17.9374 6.53462 26.7953 6.74397 32.1271 12.3374C32.4738 12.7038 32.8075 13.0832 33.1084 13.4823L22 24.5972L10.8916 13.4823C11.1991 13.0832 11.5262 12.7038 11.8729 12.3374C12.0234 12.1804 12.1804 12.0234 12.3439 11.8664ZM30.6094 13.3972C28.3196 11.0944 25.271 9.83182 22 9.83182C18.729 9.83182 15.6804 11.0944 13.3907 13.3972L22 22.0066L30.6094 13.3972ZM33.9785 14.7446L31.7215 17.0016C33.5402 19.1801 33.2523 22.425 31.0738 24.2437C29.1636 25.84 26.3897 25.84 24.4794 24.2437L22 26.7231L19.5271 24.2502C17.3486 26.0689 14.1037 25.7811 12.285 23.6026C10.6888 21.6923 10.6888 18.9185 12.285 17.0082L11.1271 15.8502L10.028 14.7446C8.7 16.9297 8 19.4418 8 21.9998C8 29.7325 14.2673 35.9998 22 35.9998C29.7327 35.9998 36 29.7325 36 21.9998C36.0065 19.4418 35.3 16.9297 33.9785 14.7446ZM30.6486 18.0747C31.1392 18.7093 31.4075 19.4943 31.4075 20.299C31.4075 21.1037 31.1392 21.8887 30.6486 22.5233C29.4187 24.113 27.1355 24.4074 25.5458 23.1775L30.6486 18.0747ZM18.4542 23.1839C17.8196 23.6745 17.0346 23.9427 16.2299 23.9427C15.4252 23.9427 14.6467 23.6745 14.0056 23.1904C12.4159 21.9605 12.1215 19.6708 13.3514 18.0811L18.4542 23.1839Z",fill:"white"})}),Evmos=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#2D2A25"},children:jsxRuntimeExports.jsx("path",{d:"M18.4916 12.6668C12.9416 14.806 12.4332 20.2846 10.8418 22.8432C9.23155 25.4322 5.54251 26.8607 6.04698 28.1801C6.55143 29.4994 10.2449 28.0824 13.1669 28.9242C16.0543 29.7561 20.0831 33.4862 25.633 31.3469C28.4603 30.2573 30.5076 28.0143 31.449 25.3574C31.5502 25.0723 31.361 24.7673 31.0606 24.7391C30.874 24.7215 30.6948 24.8196 30.6106 24.9877C29.759 26.6908 28.2981 28.0934 26.3864 28.8301C23.2303 30.0465 19.777 29.0915 17.6562 26.6961C17.1746 26.1522 16.7626 25.533 16.4374 24.8487C16.348 24.6603 16.2629 24.4689 16.1875 24.2708C16.1117 24.0728 16.0473 23.8735 15.9881 23.6732C17.6562 22.8925 19.5812 22.0656 21.7635 21.2246C23.903 20.3999 25.8505 19.731 27.5841 19.1958C28.7571 18.8341 29.8322 18.5331 30.8029 18.2871C30.8732 18.2695 30.9423 18.2519 31.0112 18.2347C31.158 18.1982 31.3088 18.2769 31.363 18.4186L31.364 18.4213C31.396 18.5053 31.4236 18.5898 31.4535 18.6743C31.6453 19.2196 31.7892 19.7706 31.8841 20.3229C31.9258 20.5645 32.1888 20.6961 32.4044 20.5799C33.2014 20.1504 33.9302 19.7314 34.5814 19.3283C37.0083 17.8276 38.3538 16.5549 38.0776 15.8336C37.802 15.1119 35.9541 15.0705 33.1503 15.5854C32.2593 15.7491 31.2716 15.9691 30.207 16.2416C30.0229 16.2886 29.8365 16.3375 29.6481 16.3877C28.7522 16.6262 27.8073 16.8995 26.8234 17.2053C24.9936 17.7744 23.0305 18.4561 21.0038 19.2372C19.1078 19.9682 17.3109 20.726 15.6629 21.4812C15.6428 18.2761 17.5725 15.2461 20.7286 14.0297C22.6399 13.293 24.6605 13.3533 26.4285 14.0473C26.6029 14.116 26.8015 14.0684 26.9291 13.9298C27.1331 13.7076 27.0706 13.3537 26.8053 13.2094C24.3353 11.8685 21.319 11.5771 18.4916 12.6668Z",fill:"#FAF1E4"})}),BinanceSmartChain=({testnet:et,...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#16181A"},children:[jsxRuntimeExports.jsx("path",{d:"M16.0445 19.6063L21.8705 13.7805L27.6996 19.6093L31.0896 16.2193L21.8705 7L12.6545 16.2163L16.0445 19.6063Z",fill:et?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M13.6505 21.9995L10.2606 18.6096L6.87046 21.9997L10.2604 25.3896L13.6505 21.9995Z",fill:et?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M16.0445 24.3937L21.8705 30.2195L27.6994 24.3909L31.0913 27.779L31.0896 27.7809L21.8705 37L12.6542 27.7839L12.6495 27.7792L16.0445 24.3937Z",fill:et?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M33.4808 25.3911L36.8709 22.001L33.481 18.6111L30.0909 22.0012L33.4808 25.3911Z",fill:et?"#fff":"#F3BA2F"}),jsxRuntimeExports.jsx("path",{d:"M25.3091 21.9982H25.3105L21.8705 18.5582L19.3283 21.1004H19.3281L19.0362 21.3926L18.4336 21.9951L18.4289 21.9999L18.4336 22.0048L21.8705 25.4418L25.3105 22.0018L25.3122 21.9999L25.3091 21.9982Z",fill:et?"#fff":"#F3BA2F"})]}),Canto=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"white"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35 8V36H9L13.875 35.9998V31.0586H9V12.9412H13.875V8H35ZM17.9373 12.9414H30.1247V17.8826H17.9373V12.9414ZM30.1247 26.9414H17.9373V17.8826L13.0623 17.8828V26.9416L17.9373 26.9414V31.8826H30.1247V26.9414Z",fill:"#06FC99"})}),Fantom=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#0911EF"},children:jsxRuntimeExports.jsx("path",{d:"M20.92 9.25864C21.5933 8.91379 22.6178 8.91379 23.2911 9.25864L30.1616 12.7775C30.5671 12.9852 30.7898 13.2947 30.8297 13.6142H30.8363V31.302C30.8274 31.6504 30.6025 31.9966 30.1616 32.2225L23.2911 35.7413C22.6178 36.0862 21.5933 36.0862 20.92 35.7413L14.0495 32.2225C13.6104 31.9976 13.3997 31.6489 13.3893 31.302C13.3883 31.2678 13.3881 31.2393 13.3891 31.2157L13.3891 13.7278C13.3884 13.7086 13.3883 13.6895 13.3889 13.6705L13.3893 13.6142L13.3924 13.6142C13.4229 13.2912 13.6355 12.9896 14.0495 12.7775L20.92 9.25864ZM29.7547 23.4821L23.2911 26.7926C22.6178 27.1374 21.5933 27.1374 20.92 26.7926L14.4706 23.4895V31.2669L20.92 34.5527C21.2842 34.7415 21.6622 34.9254 22.0318 34.9488L22.1056 34.9512C22.4907 34.9524 22.8646 34.7628 23.2438 34.5833L29.7547 31.2387V23.4821ZM11.3214 31.8437C11.3214 32.5212 11.4026 32.9667 11.5639 33.2806C11.6976 33.5407 11.8981 33.7394 12.2643 33.9813L12.2852 33.9951C12.3656 34.0476 12.4541 34.1026 12.5619 34.1672L12.689 34.2427L13.0792 34.4711L12.5195 35.3685L12.0827 35.1126L12.0093 35.0689C11.883 34.9932 11.7783 34.9284 11.6807 34.8645C10.637 34.1822 10.2478 33.4384 10.2401 31.8907L10.24 31.8437H11.3214ZM21.5647 18.7412C21.5147 18.7579 21.4678 18.7772 21.4251 18.7991L14.5546 22.318C14.5474 22.3216 14.5405 22.3253 14.534 22.3289L14.5281 22.3322L14.5389 22.3382L14.5546 22.3464L21.4251 25.8653C21.4678 25.8872 21.5147 25.9065 21.5647 25.9231V18.7412ZM22.6465 18.7412V25.9231C22.6965 25.9065 22.7433 25.8872 22.7861 25.8653L29.6566 22.3464C29.6638 22.3427 29.6707 22.3391 29.6772 22.3355L29.683 22.3322L29.6722 22.3262L29.6566 22.318L22.7861 18.7991C22.7433 18.7772 22.6965 18.7579 22.6465 18.7412ZM29.7547 14.8689L23.5915 18.0256L29.7547 21.1822V14.8689ZM14.4706 14.8763V21.1749L20.6195 18.0256L14.4706 14.8763ZM22.7861 10.1859C22.4288 10.0029 21.7824 10.0029 21.4251 10.1859L14.5546 13.7048C14.5474 13.7085 14.5405 13.7122 14.534 13.7158L14.5281 13.719L14.5389 13.725L14.5546 13.7333L21.4251 17.2522C21.7824 17.4352 22.4288 17.4352 22.7861 17.2522L29.6566 13.7333C29.6638 13.7296 29.6707 13.7259 29.6772 13.7223L29.683 13.719L29.6722 13.7131L29.6566 13.7048L22.7861 10.1859ZM31.7205 9.64552L32.1573 9.90132L32.2307 9.94503C32.357 10.0206 32.4616 10.0856 32.5593 10.1494C33.603 10.8317 33.9922 11.5756 33.9998 13.1231L34 13.1703H32.9186C32.9186 12.4926 32.8373 12.0472 32.6761 11.7334C32.5424 11.4733 32.3419 11.2745 31.9757 11.0327L31.9547 11.0189C31.8744 10.9664 31.7858 10.9113 31.6781 10.8466L31.551 10.7712L31.1608 10.5428L31.7205 9.64552Z",fill:"white"})}),Filecoin=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#0090FF"},children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.75 19.3069L23.15 22.5069L28.85 23.3069L28.45 24.8069L22.85 24.0069C22.45 25.3069 22.25 26.7069 21.75 27.9069C21.25 29.3069 20.75 30.7069 20.15 32.0069C19.35 33.7069 17.95 34.9069 16.05 35.2069C14.95 35.4069 13.75 35.3069 12.85 34.6069C12.55 34.4069 12.25 34.0069 12.25 33.7069C12.25 33.3069 12.45 32.8069 12.75 32.6069C12.95 32.5069 13.45 32.6069 13.75 32.7069C14.05 33.0069 14.35 33.4069 14.55 33.8069C15.15 34.6069 15.95 34.7069 16.75 34.1069C17.65 33.3069 18.15 32.2069 18.45 31.1069C19.05 28.7069 19.65 26.4069 20.15 24.0069V23.6069L14.85 22.8069L15.05 21.3069L20.55 22.1069L21.25 19.0069L15.55 18.1069L15.75 16.5069L21.65 17.3069C21.85 16.7069 21.95 16.2069 22.15 15.7069C22.65 13.9069 23.15 12.1069 24.35 10.5069C25.55 8.90687 26.95 7.90687 29.05 8.00687C29.95 8.00687 30.85 8.30687 31.45 9.00687C31.55 9.10687 31.75 9.30687 31.75 9.50687C31.75 9.90687 31.75 10.4069 31.45 10.7069C31.05 11.0069 30.55 10.9069 30.15 10.5069C29.85 10.2069 29.65 9.90687 29.35 9.60687C28.75 8.80687 27.85 8.70687 27.15 9.40687C26.65 9.90687 26.15 10.6069 25.85 11.3069C25.15 13.4069 24.65 15.6069 23.95 17.8069L29.45 18.6069L29.05 20.1069L23.75 19.3069Z",fill:"white"})}),IoTeX=({testnet:et,...o})=>jsxRuntimeExports.jsxs("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#00D4D5"},children:[jsxRuntimeExports.jsx("path",{d:"M23.7136 6.875V14.3784L30.2284 10.6315L23.7136 6.875Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M30.2284 10.6316V18.135L36.7418 14.3785L30.2284 10.6316Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.8",d:"M23.7136 14.3784V21.8818L30.2284 18.1349L23.7136 14.3784ZM30.2284 18.1349V25.6383L36.7417 21.8818L30.2284 18.1349Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.8",d:"M23.7136 21.8817V29.385L30.2284 25.6382L23.7136 21.8817Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M30.2284 25.6382V33.1416L36.7418 29.3851L30.2284 25.6382Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.4",d:"M6.87537 14.1253V21.6287L13.3901 17.8722L6.87537 14.1253Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.2",d:"M15.0938 16.9153V24.4186L21.5975 20.6718L15.0938 16.9153Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.3",d:"M10.2648 21.6604V29.1638L16.7781 25.4073L10.2648 21.6604Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M14.5575 27.3226V34.826L21.0612 31.0695L14.5575 27.3226Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.7",d:"M23.66 30.5525V38.0572L30.1637 34.2993L23.66 30.5525Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M16.1786 13.2097V20.7145L22.6824 16.9676L16.1786 13.2097Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.8",d:"M23.7136 6.875V14.3784L17.1989 10.6315L23.7136 6.875Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.6",d:"M16.1786 10.0649V17.5669L9.66248 13.8104L16.1786 10.0649Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.6",d:"M22.6934 13.7775V21.2823L16.1786 17.5244L22.6934 13.7775Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.95",d:"M15.0635 16.9153V24.4186L8.54877 20.6718L15.0635 16.9153Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.6",d:"M23.7136 21.8817V29.385L17.2099 25.6382L23.7136 21.8817Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.55",d:"M10.2648 23.6295V31.1328L3.75 27.375L10.2648 23.6295Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M36.7418 14.3784V21.8818L30.2284 18.1349L36.7418 14.3784Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.95",d:"M30.2284 18.1362V25.6382L23.7136 21.8817L30.2284 18.1362Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.9",d:"M36.7418 21.8817V29.385L30.2284 25.6382L36.7418 21.8817Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.7",d:"M30.2284 25.6382V33.1416L23.7136 29.3851L30.2284 25.6382Z",fill:"white"}),jsxRuntimeExports.jsx("path",{opacity:"0.4",d:"M22.2712 28.7651V36.2684L15.7579 32.5216L22.2712 28.7651Z",fill:"white"}),jsxRuntimeExports.jsx("path",{d:"M30.2284 10.6316V18.135L23.7136 14.3785L30.2284 10.6316Z",fill:"white"})]}),Metis=({testnet:et,...o})=>jsxRuntimeExports.jsx("svg",{...o,"aria-hidden":"true",width:"44",height:"44",viewBox:"0 0 44 44",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{background:et?"linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)":"#2F3140"},children:jsxRuntimeExports.jsx("path",{d:"M37.5175 22.0531C37.4579 19.2923 36.6563 16.5985 35.1968 14.2542C33.7374 11.91 31.674 10.0017 29.223 8.72965C26.772 7.45759 24.0238 6.86863 21.2668 7.02455C18.5098 7.18047 15.8456 8.07553 13.5537 9.61582C11.2617 11.1561 9.42659 13.2849 8.24079 15.7787C7.05498 18.2725 6.56222 21.0396 6.81419 23.7895C7.06617 26.5394 8.05359 29.1708 9.67288 31.4076C11.2922 33.6444 13.4836 35.4042 16.0173 36.5023C16.7657 35.3775 17.3385 34.1453 17.716 32.848C18.0245 32.0632 18.3595 31.2913 18.7067 30.5446C19.5444 30.7955 20.4345 30.8143 21.282 30.5989C22.1295 30.3835 22.9026 29.942 23.5188 29.3215L23.5704 29.2699C22.8136 28.9884 21.9979 28.9032 21.1993 29.022C20.4006 29.1408 19.6451 29.4598 19.0029 29.9494C19.4276 29.0613 19.891 28.1997 20.3667 27.3632C21.189 27.6541 22.075 27.7156 22.9296 27.541C23.7842 27.3665 24.5751 26.9626 25.2175 26.3726L25.2692 26.3209C24.538 26.0116 23.7416 25.8885 22.9513 25.9626C22.1609 26.0368 21.4013 26.3058 20.7404 26.7456C21.216 25.9608 21.7053 25.1889 22.2203 24.468C23.0713 24.6915 23.9672 24.6777 24.811 24.4282C25.6547 24.1787 26.414 23.703 27.0066 23.0526L27.0453 23.001C26.3425 22.7718 25.5958 22.7106 24.8651 22.8224C24.1344 22.9341 23.4401 23.2157 22.838 23.6444C22.8767 23.5928 22.9283 23.5289 22.9664 23.4773C23.2749 23.0784 23.5969 22.6796 23.9177 22.2936C24.8969 21.9731 25.7703 21.3916 26.4436 20.6117C27.117 19.8318 27.5649 18.883 27.7391 17.8674L27.752 17.79H27.7391C26.7194 18.0552 25.7944 18.6007 25.0689 19.3648C24.3434 20.1288 23.8464 21.0808 23.6343 22.1129C23.3258 22.4859 23.0167 22.8603 22.7211 23.2449C22.9706 22.5925 23.0724 21.893 23.0191 21.1966C22.9657 20.5002 22.7586 19.8243 22.4126 19.2176L22.3739 19.2692C21.8489 19.9862 21.5326 20.8345 21.4599 21.7201C21.3873 22.6058 21.5611 23.4942 21.9621 24.2872C21.4729 24.9823 20.9972 25.6897 20.5467 26.4357C20.6918 25.6858 20.6542 24.9118 20.4369 24.1795C20.2196 23.4471 19.8291 22.7779 19.2985 22.2284L19.2727 22.2929C18.9445 23.1107 18.8477 24.0031 18.9929 24.8723C19.1382 25.7415 19.5199 26.5539 20.0962 27.2205C19.6457 28.0054 19.2211 28.816 18.8093 29.6524C18.9344 28.8712 18.8712 28.0715 18.6251 27.3196C18.3789 26.5677 17.9568 25.8855 17.3939 25.3295L17.3681 25.3941C17.0745 26.2514 17.0201 27.1724 17.2105 28.0583C17.401 28.9442 17.8292 29.7614 18.4492 30.4223C18.1774 31.0012 17.9219 31.5774 17.6773 32.1849C17.61 32.1231 17.5313 32.0751 17.4456 32.0435C17.0066 31.916 16.5867 31.7299 16.1974 31.4904C15.8754 31.2994 15.5337 31.144 15.1781 31.027C13.7886 30.5765 13.9945 29.9079 13.2756 28.5564C13.0416 28.2781 12.7931 28.0125 12.5309 27.7607C12.2876 27.603 12.0884 27.386 11.9519 27.1302C11.7934 26.8107 11.6931 26.4656 11.6557 26.1109C11.6514 25.9148 11.5858 25.7249 11.4681 25.5679C11.3504 25.4109 11.1864 25.2948 10.9993 25.2358C8.95338 24.5284 9.86728 21.8778 9.94406 21.5299C9.91262 21.08 9.81271 20.6375 9.64781 20.2178C9.63057 20.1632 9.61763 20.1073 9.60908 20.0506C9.55449 19.776 9.56444 19.4924 9.63813 19.2223C9.71183 18.9521 9.84726 18.7028 10.0338 18.4939C10.2784 18.2493 11.1277 17.8505 11.3078 17.6188C11.4879 17.387 11.6163 17.1295 11.797 16.9114C12.3687 16.3412 13.0291 15.8675 13.7526 15.509C14.3444 15.1876 14.4477 14.364 14.6787 14.1065C15.0647 13.6689 15.6565 13.6689 16.0941 13.283C16.3129 13.09 16.6377 12.9867 16.8415 12.7815C17.8692 11.8403 19.1644 11.2423 20.5474 11.0706C21.5064 10.9924 22.4717 11.0795 23.4012 11.3281C23.5358 11.3507 23.669 11.3809 23.8001 11.4185C25.9228 11.4959 28.4709 11.9328 29.397 12.8338C29.8555 13.2744 30.1961 13.8229 30.3877 14.4293C30.5382 14.8988 30.7456 15.3481 31.0054 15.7672L31.5714 16.6933C31.932 17.2773 32.0475 17.9801 31.8928 18.6489C31.7885 18.974 31.7795 19.3223 31.8669 19.6525C32.1655 20.1031 32.5152 20.5177 32.9093 20.8878C33.0658 21.0427 33.2382 21.1807 33.4236 21.2995C33.8592 21.5594 34.2802 21.8429 34.6848 22.1489C34.698 22.2729 34.6775 22.3982 34.6254 22.5115C34.5732 22.6247 34.4914 22.7218 34.3885 22.7924C34.0284 23.1137 33.3333 23.6159 33.3333 23.6159C33.3584 23.758 33.4016 23.8964 33.4617 24.0276C33.5643 24.2077 33.796 24.4911 33.7192 24.735C33.6424 24.9789 33.1403 25.1855 33.2816 25.4552C33.423 25.7386 33.7831 25.8154 33.6805 26.0729C33.5779 26.3175 33.0757 26.7524 33.1274 26.9352C33.179 27.1179 33.5908 28.8377 32.6382 29.1353C31.4592 29.3685 30.2627 29.5019 29.0614 29.5342C28.8675 29.5454 28.6797 29.6055 28.5155 29.709C28.3513 29.8125 28.216 29.956 28.1223 30.126C27.9399 30.4661 27.8222 30.837 27.7751 31.22C27.4275 32.5896 26.9671 33.928 26.3985 35.2215C26.3985 35.2215 26.3597 35.2989 26.3081 35.4144C26.1833 35.6687 26.1048 35.9432 26.0764 36.2251C26.1573 36.4321 26.2799 36.6204 26.4365 36.7782C26.519 36.8726 26.6271 36.9411 26.7477 36.9753C26.8683 37.0096 26.9962 37.0081 27.116 36.9711C30.1997 35.8965 32.8655 33.8757 34.7332 31.197C36.601 28.5182 37.5754 25.3182 37.5175 22.0531Z",fill:et?"#ffffff":"#00DACC"})});var Chains={UnknownChain,Ethereum,Polygon,Optimism,Arbitrum,Aurora,Avalanche,Celo,Telos,Gnosis,Evmos,BinanceSmartChain,Foundry:KnownChain,Sepolia:KnownChain,Taraxa:KnownChain,zkSync:KnownChain,Flare:KnownChain,Canto,Fantom,Filecoin,Metis,IoTeX};const chainConfigs=[{id:1,name:"Ethereum",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{}),rpcUrls:{alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]}}},{id:3,name:"Rinkeby",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0}),rpcUrls:{}},{id:4,name:"Ropsten",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:5,name:"Görli",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:42,name:"Kovan",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:10,name:"Optimism",logo:jsxRuntimeExports.jsx(Chains.Optimism,{})},{id:69,name:"Optimism Kovan",logo:jsxRuntimeExports.jsx(Chains.Optimism,{testnet:!0})},{id:420,name:"Optimism Goerli",logo:jsxRuntimeExports.jsx(Chains.Optimism,{testnet:!0})},{id:137,name:"Polygon",logo:jsxRuntimeExports.jsx(Chains.Polygon,{})},{id:80001,name:"Polygon Mumbai",logo:jsxRuntimeExports.jsx(Chains.Polygon,{testnet:!0})},{id:31337,name:"Hardhat",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:1337,name:"Localhost",logo:jsxRuntimeExports.jsx(Chains.Ethereum,{testnet:!0})},{id:42161,name:"Arbitrum",logo:jsxRuntimeExports.jsx(Chains.Arbitrum,{}),rpcUrls:{alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]}}},{id:421611,name:"Arbitrum Rinkeby",logo:jsxRuntimeExports.jsx(Chains.Arbitrum,{testnet:!0})},{id:421613,name:"Arbitrum Goerli",logo:jsxRuntimeExports.jsx(Chains.Arbitrum,{testnet:!0}),rpcUrls:{alchemy:{http:["https://arb-goerli.g.alchemy.com/v2"],webSocket:["wss://arb-goerli.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-goerli.infura.io/v3"],webSocket:["wss://arbitrum-goerli.infura.io/ws/v3"]}}},{id:40,name:"Telos",logo:jsxRuntimeExports.jsx(Chains.Telos,{})},{id:41,name:"Telos Testnet",logo:jsxRuntimeExports.jsx(Chains.Telos,{testnet:!0})},{id:1313161554,name:"Aurora",logo:jsxRuntimeExports.jsx(Chains.Aurora,{})},{id:1313161555,name:"Aurora Testnet",logo:jsxRuntimeExports.jsx(Chains.Aurora,{testnet:!0})},{id:43114,name:"Avalanche",logo:jsxRuntimeExports.jsx(Chains.Avalanche,{})},{id:43113,name:"Avalanche Fuji",logo:jsxRuntimeExports.jsx(Chains.Avalanche,{testnet:!0})},{id:31337,name:"Foundry",logo:jsxRuntimeExports.jsx(Chains.Foundry,{testnet:!0})},{id:100,name:"Gnosis",logo:jsxRuntimeExports.jsx(Chains.Gnosis,{})},{id:9001,name:"Evmos",logo:jsxRuntimeExports.jsx(Chains.Evmos,{})},{id:9e3,name:"Evmos Testnet",logo:jsxRuntimeExports.jsx(Chains.Evmos,{testnet:!0})},{id:56,name:"BNB Smart Chain",logo:jsxRuntimeExports.jsx(Chains.BinanceSmartChain,{})},{id:97,name:"Binance Smart Chain Testnet",logo:jsxRuntimeExports.jsx(Chains.BinanceSmartChain,{testnet:!0})},{id:11155111,name:"Sepolia",logo:jsxRuntimeExports.jsx(Chains.Sepolia,{})},{id:841,name:"Taraxa",logo:jsxRuntimeExports.jsx(Chains.Taraxa,{})},{id:842,name:"Taraxa Testnet",logo:jsxRuntimeExports.jsx(Chains.Taraxa,{testnet:!0})},{id:324,name:"zkSync",logo:jsxRuntimeExports.jsx(Chains.zkSync,{})},{id:280,name:"zkSync Testnet",logo:jsxRuntimeExports.jsx(Chains.zkSync,{testnet:!0})},{id:42220,name:"Celo",logo:jsxRuntimeExports.jsx(Chains.Celo,{})},{id:44787,name:"Celo Alfajores",logo:jsxRuntimeExports.jsx(Chains.Celo,{testnet:!0})},{id:7700,name:"Canto",logo:jsxRuntimeExports.jsx(Chains.Canto,{})},{id:250,name:"Fantom",logo:jsxRuntimeExports.jsx(Chains.Fantom,{})},{id:4002,name:"Fantom Testnet",logo:jsxRuntimeExports.jsx(Chains.Fantom,{testnet:!0})},{id:14,name:"Flare",logo:jsxRuntimeExports.jsx(Chains.Flare,{})},{id:114,name:"Coston2",logo:jsxRuntimeExports.jsx(Chains.Flare,{})},{id:314,name:"Filecoin",logo:jsxRuntimeExports.jsx(Chains.Filecoin,{})},{id:3141,name:"Filecoin Hyperspace",logo:jsxRuntimeExports.jsx(Chains.Filecoin,{testnet:!0})},{id:314159,name:"Filecoin Calibration",logo:jsxRuntimeExports.jsx(Chains.Filecoin,{testnet:!0})},{id:1088,name:"Metis",logo:jsxRuntimeExports.jsx(Chains.Metis,{})},{id:599,name:"Metis Goerli",logo:jsxRuntimeExports.jsx(Chains.Metis,{testnet:!0})},{id:4689,name:"IoTeX",logo:jsxRuntimeExports.jsx(Chains.IoTeX,{})},{id:4690,name:"IoTeX Testnet",logo:jsxRuntimeExports.jsx(Chains.IoTeX,{testnet:!0})}],SwitchNetworksContainer=styled.div` - display: flex; - flex-direction: column; - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - flex-direction: column-reverse; - } -`,ChainIcon=styled(motion.div)` - display: block; - position: relative; - border-radius: 12px; - overflow: hidden; - width: 24px; - height: 24px; - min-width: 24px; - min-height: 24px; - background: var(--ck-body-background); - svg { - border-radius: inherit; - display: block; - position: relative; - transform: translate3d(0, 0, 0); - width: 100%; - height: auto; - } - ${et=>et.$empty&&Ae` - display: flex; - align-items: center; - justify-content: center; - &:before { - content: '?'; - color: var(--ck-body-color-muted); - font-weight: bold; - font-family: var(--ck-font-family); - } - `} - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - border-radius: 16px; - width: 32px; - height: 32px; - } -`,ChainLogoContainer=styled(motion.div)` - position: relative; -`,ChainLogoSpinner=styled(motion.div)` - position: absolute; - inset: -6px; - animation: rotateSpinner 1200ms linear infinite; - pointer-events: none; - svg { - display: block; - position: relative; - transform: translate3d(0, 0, 0); - width: 100%; - height: auto; - } - @keyframes rotateSpinner { - 0% { - transform: rotate(0deg); - } - 100% { - transform: rotate(360deg); - } - } -`,ChainButtonContainer=styled.div` - position: relative; - margin: -8px -8px; - &:after { - border-radius: var(--border-radius, 0); - z-index: 2; - content: ''; - pointer-events: none; - position: absolute; - inset: 0 2px; - box-shadow: inset 0 16px 8px -12px var(--background, var(--ck-body-background)), - inset 0 -16px 8px -12px var(--background, var(--ck-body-background)); - } -`,ChainButtons=styled(motion.div)` - padding: 8px; - overflow-x: hidden; - overflow-y: auto; - max-height: 242px; - - -ms-overflow-style: none; /* Internet Explorer 10+ */ - scrollbar-width: none; /* Firefox */ - &::-webkit-scrollbar { - display: none; /* Safari and Chrome */ - } - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - padding: 8px 14px; - margin: 2px -2px 0; - max-height: 60vh; - } -`,ChainButton=styled(motion.button)` - appearance: none; - cursor: pointer; - user-select: none; - position: relative; - display: flex; - align-items: center; - justify-content: space-between; - width: 100%; - border-radius: 11px; - margin: 0 0 1px; - padding: 8px 0; - padding-right: 154px; - font-size: 15px; - line-height: 18px; - font-weight: 500; - text-decoration: none; - color: var(--ck-body-color); - background: none; - white-space: nowrap; - transition: transform 100ms ease, background-color 100ms ease; - transform: translateZ(0px); - &:before { - content: ''; - background: currentColor; - position: absolute; - z-index: -1; - inset: 0 var(--ck-dropdown-active-inset, -8px); - border-radius: var(--ck-dropdown-active-border-radius, 12px); - opacity: 0; - transition: opacity 180ms ease; - } - &:after { - content: ''; - position: absolute; - z-index: -1; - inset: 0 var(--ck-dropdown-active-inset, -8px); - border-radius: 12px; - opacity: 0; - transition: opacity 180ms ease; - outline: 2px solid var(--ck-focus-color); - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - font-size: 17px; - padding: 8px 0; - } - @media only screen and (min-width: ${defaultTheme.mobileWidth}px) { - &:hover { - &:before { - transition-duration: 80ms; - opacity: 0.05; - } - } - } - &:active { - transform: scale(0.99) translateZ(0px); - } - &:disabled { - //opacity: 0.4; - pointer-events: none; - } - &:focus-visible { - outline: none !important; - &:after { - opacity: 1; - } - } - ${et=>et.$variant==="secondary"&&Ae` - padding: 12px 4px; - margin: 0 0 8px; - &:last-child { - margin-bottom: 0; - } - &:before { - opacity: 0.05; - } - &:hover:before { - opacity: 0.1; - } - `} -`,ChainButtonStatus=styled(motion.div)` - position: absolute; - top: 0; - bottom: 0; - right: 0; - display: flex; - align-items: center; - justify-content: center; - - color: var(--ck-body-color-muted); - font-size: 15px; - line-height: 18px; - font-weight: 500; - padding-right: 4px; - span { - display: block; - position: relative; - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - font-size: 17px; - padding: 0; - } -`,ChainButtonBg=styled(motion.div)` - position: absolute; - z-index: -1; - inset: 0 var(--ck-dropdown-active-inset, -8px); - background: var(--ck-dropdown-active-background, rgba(26, 136, 248, 0.1)); - box-shadow var(--ck-dropdown-active-box-shadow); - border-radius: var(--ck-dropdown-active-border-radius, 12px); - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - inset: 0 var(--ck-dropdown-active-inset, -8px); - } -`,Spinner$1=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 16.75C2.69036 16.75 3.25 17.3096 3.25 18V19C3.25 26.5939 9.40609 32.75 17 32.75V35.25C8.02537 35.25 0.75 27.9746 0.75 19V18C0.75 17.3096 1.30964 16.75 2 16.75Z",fill:"url(#paint0_linear_1288_18701)"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1288_18701",x1:"2",y1:"19.4884",x2:"16.8752",y2:"33.7485",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-spinner-color)"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-spinner-color)",stopOpacity:"0"})]})})]}),ChainSelectList=({variant:et})=>{const{connector:o,chain:tt}=useAccount(),{chains:rt,isPending:nt,switchChain:ot,error:it}=useSwitchChain(),[st,at]=reactExports.useState(void 0),ct=useLocales({}),lt=isMobile(),dt=(it==null?void 0:it.code)===4902,ht=dt||!ot,mt=pt=>{ot&&(at(pt),ot({chainId:pt}))},{triggerResize:ft}=useContext();return jsxRuntimeExports.jsxs(SwitchNetworksContainer,{style:{marginBottom:ot!==void 0?-8:0},children:[jsxRuntimeExports.jsx(ChainButtonContainer,{children:jsxRuntimeExports.jsx(ChainButtons,{children:rt.map(pt=>{var yt;const bt={...chainConfigs.find(xt=>xt.id===pt.id),...pt};return jsxRuntimeExports.jsxs(ChainButton,{$variant:et,disabled:ht||bt.id===(tt==null?void 0:tt.id)||nt&&st===bt.id,onClick:()=>mt==null?void 0:mt(bt.id),style:{opacity:ht&&bt.id!==(tt==null?void 0:tt.id)?.4:void 0},children:[jsxRuntimeExports.jsxs("span",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:12,color:bt.id===(tt==null?void 0:tt.id)?"var(--ck-dropdown-active-color, inherit)":"inherit"},children:[jsxRuntimeExports.jsxs(ChainLogoContainer,{children:[jsxRuntimeExports.jsx(ChainLogoSpinner,{initial:{opacity:0},animate:{opacity:nt&&st===bt.id?1:0},transition:{ease:[.76,0,.24,1],duration:.15,delay:.1},children:jsxRuntimeExports.jsx(motion.div,{animate:lt&&isCoinbaseWalletConnector(o==null?void 0:o.id)&&nt&&st===bt.id?{opacity:[1,0],transition:{delay:4,duration:3}}:{opacity:1},children:Spinner$1},`${bt==null?void 0:bt.id}-${bt==null?void 0:bt.name}`)}),jsxRuntimeExports.jsx(ChainIcon,{children:(yt=bt.logo)!==null&&yt!==void 0?yt:jsxRuntimeExports.jsx(Chains.UnknownChain,{})})]}),bt.name]}),et!=="secondary"&&jsxRuntimeExports.jsx(ChainButtonStatus,{children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,exitBeforeEnter:!0,children:[bt.id===(tt==null?void 0:tt.id)&&jsxRuntimeExports.jsx(motion.span,{style:{color:"var(--ck-dropdown-active-color, var(--ck-focus-color))",display:"block",position:"relative"},initial:{opacity:0,x:-4},animate:{opacity:1,x:0},exit:{opacity:0,x:4,transition:{duration:.1,delay:0}},transition:{ease:[.76,0,.24,1],duration:.3,delay:.2},children:ct.connected},"connectedText"),nt&&st===bt.id&&jsxRuntimeExports.jsx(motion.span,{style:{color:"var(--ck-dropdown-pending-color, inherit)",display:"block",position:"relative"},initial:{opacity:0,x:-4},animate:{opacity:1,x:0},exit:{opacity:0,x:4},transition:{ease:[.76,0,.24,1],duration:.3,delay:.1},children:jsxRuntimeExports.jsx(motion.span,{animate:lt&&isCoinbaseWalletConnector(o==null?void 0:o.id)&&{opacity:[1,0],transition:{delay:4,duration:4}},children:ct.approveInWallet})},"approveText")]})}),et==="secondary"?jsxRuntimeExports.jsx(ChainButtonBg,{initial:!1,animate:{opacity:bt.id===(tt==null?void 0:tt.id)?1:0},transition:{duration:.3,ease:"easeOut"}}):bt.id===(tt==null?void 0:tt.id)&&jsxRuntimeExports.jsx(ChainButtonBg,{layoutId:"activeChain",layout:"position",transition:{duration:.3,ease:"easeOut"}})]},`${bt==null?void 0:bt.id}-${bt==null?void 0:bt.name}`)})})}),jsxRuntimeExports.jsx(AnimatePresence,{children:dt&&jsxRuntimeExports.jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{ease:[.76,0,.24,1],duration:.3},onAnimationStart:ft,onAnimationComplete:ft,children:jsxRuntimeExports.jsx("div",{style:{paddingTop:10,paddingBottom:8},children:jsxRuntimeExports.jsxs(Alert,{children:[ct.warnings_walletSwitchingUnsupported," ",ct.warnings_walletSwitchingUnsupportedResolve]})})})})]})},DropdownWindow=styled(motion.div)` - z-index: 2147483647; - position: fixed; - inset: 0; -`,DropdownOverlay=styled(motion.div)` - position: absolute; - inset: 0; -`,DropdownContainer=styled(motion.div)` - --shadow: 0px 2px 15px rgba(0, 0, 0, 0.15); - --background: var(--ck-dropdown-background, var(--ck-tooltip-background)); - --border-radius: var( - --ck-dropdown-border-radius, - var(--ck-tooltip-border-radius, 12px) - ); - - pointer-events: auto; - z-index: 2147483647; - position: absolute; - top: 0; - left: 0; - width: 100%; - max-width: fit-content; - padding: 14px 16px 16px; - color: var(--ck-dropdown-color, var(--ck-tooltip-color)); - background: var(--background); - box-shadow: var( - --ck-dropdown-box-shadow, - var(--ck-tooltip-shadow, var(--shadow)) - ); - border-radius: var(--border-radius); -`,DropdownHeading=styled(motion.div)` - padding: 0 0 6px; - font-size: 14px; - line-height: 20px; - font-weight: 400; - user-select: none; - color: var(--ck-dropdown-color, var(--ck-tooltip-color)); -`,ChainSelectDropdown=({children:et,open:o,onClose:tt,offsetX:rt=0,offsetY:nt=8})=>{var ot,it,st;const at=useContext(),ct=useThemeContext(),lt=useLocales(),[dt,ht]=reactExports.useState({x:0,y:0});useLockBodyScroll(o);const mt=reactExports.useRef(null);reactExports.useEffect(()=>{const Ct=St=>{var At,kt,It;if(o&&(St.key==="Escape"&&tt(),St.key==="ArrowDown"||St.key==="ArrowUp")){if(!mt.current)return;St.preventDefault();const Nt=(At=mt.current)===null||At===void 0?void 0:At.querySelectorAll(` - a[href]:not(:disabled), - button:not(:disabled), - textarea:not(:disabled), - input[type="text"]:not(:disabled), - input[type="radio"]:not(:disabled), - input[type="checkbox"]:not(:disabled), - select:not(:disabled) - `),Lt=Nt[0],Mt=Nt[Nt.length-1];if(St.key==="ArrowUp")if(document.activeElement===Lt)Mt.focus();else{let zt=(kt=document==null?void 0:document.activeElement)===null||kt===void 0?void 0:kt.previousSibling;for(zt||(zt=Mt);zt.disabled;)zt=zt.previousSibling;zt.focus()}else if(document.activeElement===Mt)Lt.focus();else{let zt=(It=document==null?void 0:document.activeElement)===null||It===void 0?void 0:It.nextSibling;for(zt||(zt=Lt);zt.disabled;)zt=zt.nextSibling;zt.focus()}}};return document.addEventListener("keydown",Ct),()=>{document.removeEventListener("keydown",Ct)}},[o]);const ft=reactExports.useRef(null),pt=reactExports.useCallback(Ct=>{Ct&&(ft.current=Ct,bt())},[o]),[yt,gt]=useMeasure({debounce:120,offsetSize:!0,scroll:!0}),bt=()=>{if(!ft.current||gt.top+gt.bottom+gt.left+gt.right+gt.height+gt.width===0)return;let Ct=gt.left+rt,St=gt.top+gt.height+nt;ft.current.style.left=`${Ct}px`,ft.current.style.top=`${St}px`};(typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect)(bt,[ft.current,gt,o]),reactExports.useEffect(bt,[o,ft.current]);const vt=tt,Et=tt;return reactExports.useEffect(()=>(bt(),window.addEventListener("scroll",vt),window.addEventListener("resize",Et),()=>{window.removeEventListener("scroll",vt),window.removeEventListener("resize",Et)}),[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{ref:yt,children:et}),jsxRuntimeExports.jsx(AnimatePresence,{children:o&&jsxRuntimeExports.jsx(Portal$2,{children:jsxRuntimeExports.jsx(ResetContainer,{$useTheme:(ot=ct.theme)!==null&&ot!==void 0?ot:at.theme,$useMode:(it=ct.mode)!==null&&it!==void 0?it:at.mode,$customTheme:(st=ct.customTheme)!==null&&st!==void 0?st:at.customTheme,children:jsxRuntimeExports.jsx(FocusTrap,{children:jsxRuntimeExports.jsxs(DropdownWindow,{ref:mt,children:[jsxRuntimeExports.jsx(DropdownOverlay,{onClick:tt}),jsxRuntimeExports.jsxs(DropdownContainer,{ref:pt,style:{left:dt.x,top:dt.y},initial:"collapsed",animate:"open",exit:"collapsed",variants:{collapsed:{transformOrigin:"0 0",opacity:0,scale:.96,z:.01,y:-4,x:0,transition:{duration:.1}},open:{transformOrigin:"0 0",willChange:"opacity,transform",opacity:1,scale:1,z:.01,y:0,x:0,transition:{ease:[.76,0,.24,1],duration:.15}}},children:[jsxRuntimeExports.jsx(DropdownHeading,{children:lt.switchNetworks}),jsxRuntimeExports.jsx(ChainSelectList,{})]})]})})})})})]})},ChainContainer=styled.div` - --bg: transparent; - --color: #333; - ${et=>typeof et.size=="string"?Ae` - --width: ${et.size}; - --height: ${et.size}; - `:Ae` - --width: ${et.size>=0?`${et.size}px`:"24px"}; - --height: ${et.size>=0?`${et.size}px`:"24px"}; - `}; - ${et=>typeof et.radius=="string"?Ae` - --radius: ${et.radius}; - `:Ae` - --radius: ${et.radius>=0?`${et.radius}px`:"24px"}; - `}; - display: block; - position: relative; - width: var(--width); - height: var(--height); - min-width: var(--width); - min-height: var(--height); - border-radius: var(--radius); - background: var(--ck-body-background-secondary); - pointer-events: none; - user-select: none; - svg { - display: block; - width: 100%; - height: auto; - } - > div { - display: flex; - align-items: center; - justify-content: center; - } -`,LogoContainer$1=styled(motion.div)` - display: block; - position: absolute; - inset: 0; - overflow: hidden; - border-radius: inherit; - user-select: none; - display: flex; - align-items: center; - justify-content: center; - svg { - display: block; - width: 100%; - height: auto; - } -`,Spin=We` - 0%{ transform: rotate(0deg); } - 100%{ transform: rotate(360deg); } -`,LoadingContainer=styled(motion.div)` - position: absolute; - inset: 0; - animation: ${Spin} 1s linear infinite; - svg { - display: block; - position: absolute; - inset: 0; - } -`,Unsupported=styled(motion.div)` - z-index: 2; - position: absolute; - top: 0; - right: 0; - width: 40%; - height: 40%; - min-width: 13px; - min-height: 13px; - color: var(--ck-body-color-danger, red); - svg { - display: block; - position: relative; - top: -30%; - right: -30%; - } -`,Spinner=jsxRuntimeExports.jsxs("svg",{"aria-hidden":"true",width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.3592 30.1654C10.0472 29.4491 8.85718 28.524 7.83713 27.424C6.81708 26.324 5.98425 25.0677 5.36889 23.7054C5.20157 23.335 5.05033 22.9567 4.91578 22.5717C4.51465 21.4237 4.26735 20.2308 4.17794 19.0239C4.16599 18.8626 4.13894 18.7041 4.09809 18.5507C3.85023 17.6197 3.09399 16.8738 2.11531 16.7999C0.975331 16.7138 -0.0310983 17.5702 0.0141657 18.7125C0.0223289 18.9185 0.0340286 19.1243 0.049253 19.3298C0.165374 20.8971 0.486545 22.4464 1.00749 23.9373C1.10424 24.2142 1.20764 24.4884 1.31755 24.7596C2.13617 26.7799 3.31595 28.6371 4.80146 30.239C6.28696 31.841 8.04998 33.1573 10.0029 34.1258C10.2651 34.2558 10.5307 34.3796 10.7995 34.4969C12.247 35.1287 13.7676 35.5656 15.3217 35.7995C15.5255 35.8301 15.7298 35.8573 15.9346 35.881C17.0703 36.0122 18.0001 35.0731 18.0001 33.9299C18.0001 32.9484 17.3133 32.1381 16.4036 31.8208C16.2537 31.7685 16.0977 31.7296 15.9377 31.7056C14.7411 31.5255 13.5702 31.1891 12.4556 30.7026C12.0818 30.5394 11.716 30.3601 11.3592 30.1654Z",fill:"url(#paint0_linear_1288_1870)"}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsxs("linearGradient",{id:"paint0_linear_1288_1870",x1:"2",y1:"19.4884",x2:"16.8752",y2:"33.7485",gradientUnits:"userSpaceOnUse",children:[jsxRuntimeExports.jsx("stop",{stopColor:"var(--ck-connectbutton-balance-color,currentColor)",stopOpacity:"0.7"}),jsxRuntimeExports.jsx("stop",{offset:"1",stopColor:"var(--ck-connectbutton-balance-color,currentColor)",stopOpacity:"0"})]})})]}),Chain=({id:et,unsupported:o,radius:tt="50%",size:rt=24})=>{var nt;const ot=useChainIsSupported(et),it=o??!ot,st=chainConfigs.find(ct=>ct.id===et);return useIsMounted()?jsxRuntimeExports.jsx(ChainContainer,{size:rt,radius:tt,children:jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[it&&jsxRuntimeExports.jsx(Unsupported,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxRuntimeExports.jsxs("svg",{width:"13",height:"12",viewBox:"0 0 13 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M2.61317 11.2501H9.46246C10.6009 11.2501 11.3256 10.3506 11.3256 9.3549C11.3256 9.05145 11.255 8.73244 11.0881 8.43303L7.65903 2.14708C7.659 2.14702 7.65897 2.14696 7.65893 2.1469C7.65889 2.14682 7.65884 2.14673 7.65879 2.14664C7.31045 1.50746 6.6741 1.17871 6.04 1.17871C5.41478 1.17871 4.763 1.50043 4.41518 2.14968L0.993416 8.43476C0.828865 8.72426 0.75 9.04297 0.75 9.3549C0.75 10.3506 1.47471 11.2501 2.61317 11.2501Z",fill:"currentColor",stroke:"var(--ck-body-background, #fff)",strokeWidth:"1.5"}),jsxRuntimeExports.jsx("path",{d:"M6.03258 7.43916C5.77502 7.43916 5.63096 7.29153 5.62223 7.02311L5.55675 4.96973C5.54802 4.69684 5.74446 4.5 6.02821 4.5C6.3076 4.5 6.51277 4.70131 6.50404 4.9742L6.43856 7.01864C6.42546 7.29153 6.2814 7.43916 6.03258 7.43916ZM6.03258 9.11676C5.7401 9.11676 5.5 8.9065 5.5 8.60677C5.5 8.30704 5.7401 8.09678 6.03258 8.09678C6.32506 8.09678 6.56515 8.30256 6.56515 8.60677C6.56515 8.91097 6.32069 9.11676 6.03258 9.11676Z",fill:"white"})]})}),et?jsxRuntimeExports.jsx(LogoContainer$1,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:(nt=st==null?void 0:st.logo)!==null&&nt!==void 0?nt:jsxRuntimeExports.jsx(Chains.UnknownChain,{})},`${st==null?void 0:st.id}-${st==null?void 0:st.name}-${et}`):jsxRuntimeExports.jsx(LoadingContainer,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},children:Spinner},"loading")]})}):jsxRuntimeExports.jsx("div",{style:{width:rt,height:rt}})},Container$3=styled(motion.div)``,SwitchChainButton=styled(motion.button)` - --color: var( - --ck-dropdown-button-color, - var(--ck-button-primary-color, var(--ck-body-color)) - ); - --background: var( - --ck-dropdown-button-background, - var(--ck-secondary-button-background, var(--ck-body-background-secondary)) - ); - --box-shadow: var( - --ck-dropdown-button-box-shadow, - var( - --ck-secondary-button-box-shadow, - var(--ck-button-primary-box-shadow), - none - ) - ); - - --hover-color: var(--ck-dropdown-button-hover-color, var(--color)); - --hover-background: var( - --ck-dropdown-button-hover-background, - var(--background) - ); - --hover-box-shadow: var( - --ck-dropdown-button-hover-box-shadow, - var(--box-shadow) - ); - - --active-color: var(--ck-dropdown-button-active-color, var(--hover-color)); - --active-background: var( - --ck-dropdown-button-active-background, - var(--hover-background) - ); - --active-box-shadow: var( - --ck-dropdown-button-active-box-shadow, - var(--hover-box-shadow) - ); - - appearance: none; - user-select: none; - position: relative; - display: flex; - align-items: center; - justify-content: space-between; - border-radius: 15px; - width: 52px; - height: 30px; - padding: 2px 6px 2px 3px; - font-size: 16px; - line-height: 19px; - font-weight: 500; - text-decoration: none; - white-space: nowrap; - transform: translateZ(0px); - - transition: 100ms ease; - transition-property: transform, background-color, box-shadow, color; - - color: var(--color); - background: var(--background); - box-shadow: var(--box-shadow); - - svg { - position: relative; - display: block; - } - - ${et=>et.disabled?Ae` - width: auto; - padding: 3px; - position: relative; - left: -22px; - `:Ae` - cursor: pointer; - - @media only screen and (min-width: ${defaultTheme.mobileWidth+1}px) { - &:hover, - &:focus-visible { - color: var(--hover-color); - background: var(--hover-background); - box-shadow: var(--hover-box-shadow); - } - &:active { - color: var(--active-color); - background: var(--active-background); - box-shadow: var(--active-box-shadow); - } - } - `} -`,ChevronDown=({...et})=>jsxRuntimeExports.jsx("svg",{"aria-hidden":"true",width:"11",height:"6",viewBox:"0 0 11 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",...et,children:jsxRuntimeExports.jsx("path",{d:"M1.5 1L5.5 5L9.5 1",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),ChainSelector=()=>{const et=useContext(),[o,tt]=reactExports.useState(!1),{chain:rt}=useAccount(),{chains:nt}=useSwitchChain(),ot=useLocales({CHAIN:rt==null?void 0:rt.name}),it=isMobile()||(window==null?void 0:window.innerWidth){et.open||tt(!1)},[et.open]);const st=nt.length<=1;return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Container$3,{children:jsxRuntimeExports.jsx(ChainSelectDropdown,{offsetX:-12,open:!it&&o,onClose:()=>tt(!1),children:jsxRuntimeExports.jsxs(SwitchChainButton,{"aria-label":flattenChildren(ot.switchNetworks).toString(),disabled:st,onClick:()=>{it?et.setRoute(routes.SWITCHNETWORKS):tt(!o)},children:[st?jsxRuntimeExports.jsx(Tooltip,{message:ot.chainNetwork,xOffset:-6,delay:.01,children:jsxRuntimeExports.jsx(Chain,{id:rt==null?void 0:rt.id})}):jsxRuntimeExports.jsx(Chain,{id:rt==null?void 0:rt.id}),!st&&jsxRuntimeExports.jsx(ChevronDown,{style:{top:1,left:-3}})]})})})})},Profile=({closeModal:et})=>{var o,tt,rt;const nt=useContext(),ot=useThemeContext(),it=useLocales(),{reset:st}=useConnect$1(),{disconnect:at}=useDisconnect(),{address:ct,isConnected:lt,connector:dt,chain:ht}=useAccount(),mt=useEnsFallbackConfig(),{data:ft}=useEnsName({chainId:1,address:ct,config:mt}),{data:pt}=useBalance({address:ct}),[yt,gt]=reactExports.useState(!1);reactExports.useEffect(()=>{lt||nt.setOpen(!1)},[lt]),reactExports.useEffect(()=>{if(yt)return et?et():nt.setOpen(!1),()=>{at(),st()}},[yt,at,st]);const bt=["web95","rounded","minimal"].includes((tt=(o=ot.theme)!==null&&o!==void 0?o:nt.theme)!==null&&tt!==void 0?tt:"")?"....":void 0;return jsxRuntimeExports.jsxs(PageContent,{children:[jsxRuntimeExports.jsxs(ModalContent,{style:{paddingBottom:22,gap:6},children:[jsxRuntimeExports.jsx(AvatarContainer,{children:jsxRuntimeExports.jsxs(AvatarInner,{children:[jsxRuntimeExports.jsx(ChainSelectorContainer,{children:jsxRuntimeExports.jsx(ChainSelector,{})}),jsxRuntimeExports.jsx(Avatar,{address:ct})]})}),jsxRuntimeExports.jsx(ModalH1,{children:jsxRuntimeExports.jsx(CopyToClipboard,{string:ct,children:ft??truncateEthAddress(ct,bt)})}),!((rt=nt==null?void 0:nt.options)===null||rt===void 0)&&rt.hideBalance?null:jsxRuntimeExports.jsx(ModalBody,{children:jsxRuntimeExports.jsx(BalanceContainer,{children:jsxRuntimeExports.jsxs(AnimatePresence,{exitBeforeEnter:!0,initial:!1,children:[pt&&jsxRuntimeExports.jsxs(Balance$1,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:[nFormatter(Number(pt==null?void 0:pt.formatted))," ",pt==null?void 0:pt.symbol]},`chain-${ht==null?void 0:ht.id}`),!pt&&jsxRuntimeExports.jsx(LoadingBalance,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:" "})]})})})]}),!isSafeConnector(dt==null?void 0:dt.id)&&jsxRuntimeExports.jsx(Button$1,{onClick:()=>gt(!0),icon:jsxRuntimeExports.jsx(DisconnectIcon,{}),children:it.disconnect})]})},SwitchNetworks=()=>{const{reset:et}=useConnect$1(),{disconnect:o}=useDisconnect(),{connector:tt,chain:rt}=useAccount(),nt=useChainIsSupported(rt==null?void 0:rt.id),ot=useLocales({}),it=()=>{o(),et()};return jsxRuntimeExports.jsx(PageContent,{style:{width:278},children:jsxRuntimeExports.jsxs(ModalContent,{style:{padding:0,marginTop:-10},children:[!nt&&jsxRuntimeExports.jsxs(ModalBody,{children:[ot.warnings_chainUnsupported," ",ot.warnings_chainUnsupportedResolve]}),jsxRuntimeExports.jsx("div",{style:{padding:"6px 8px"},children:jsxRuntimeExports.jsx(ChainSelectList,{variant:"secondary"})}),!nt&&!isSafeConnector(tt==null?void 0:tt.id)&&jsxRuntimeExports.jsxs("div",{style:{paddingTop:12},children:[jsxRuntimeExports.jsx(OrDivider,{}),jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(DisconnectIcon,{}),variant:"secondary",onClick:it,children:ot.disconnect})]})]})})},spinKeyframes=We` - from{ transform: rotate(0deg); } - to{ transform: rotate(360deg); } -`,lineKeyframes=We` - from{ background-position: 0 0; } - to{ background-position: 100% 0; } -`,ContentContainer=styled.div` - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - margin: 5px auto 24px; - padding: 16px 16px; - border-radius: var(--ck-tertiary-border-radius, 24px); - box-shadow: var(--ck-tertiary-box-shadow, none); - background: var(--ck-body-background-tertiary); - } -`,LogoContainer=styled(motion.div)` - z-index: 2; - overflow: hidden; - position: relative; - display: flex; - align-items: center; - justify-content: center; - width: 52px; - height: 52px; - border-radius: 100%; - transition: inherit; - background: var(--ck-body-background-secondary); - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04); - svg, - img { - display: block; - width: 100%; - height: 100%; - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - width: 64px; - height: 64px; - } -`,StatusIcon=styled(motion.div)` - z-index: 2; - position: relative; - display: flex; - align-items: center; - justify-content: center; - width: 52px; - height: 52px; - color: currentColor; - border-radius: 100%; - transition: inherit; - svg { - z-index: 3; - position: relative; - transform: scale(0.89); - transition: inherit; - opacity: 0.5; - } - &:before { - z-index: 1; - content: ''; - position: absolute; - inset: 10px; - border-radius: inherit; - border: 1px dashed var(--border-color); - background: var(--ck-body-background); - transition: inherit; - animation: ${spinKeyframes} 10s linear infinite; - } - &:after { - z-index: 2; - content: ''; - position: absolute; - inset: 0; - border-radius: inherit; - background: #34c759; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04); - transform: scale(0); - transition: inherit; - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - width: 64px; - height: 64px; - svg { - transform: scale(1.1); - } - } -`,StatusGraphicBgSvg=styled(motion.svg)` - display: block; - position: relative; - margin: 0 auto; - transition: inherit; - overflow: visible; - rect { - stroke: var(--border-color); - rx: var(--ck-border-radius); - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - display: none; - } -`,StatusGraphic=styled(motion.div)` - --border-color: var(--ck-siwe-border, var(--ck-body-divider)); - --border-size: 0; - --border-style: dashed; - - user-select: none; - pointer-events: none; - position: relative; - display: flex; - align-items: center; - justify-content: center; - gap: 14px; - width: 100%; - margin: 12px auto; - padding: 42px 32px; - transition: all 320ms cubic-bezier(0.175, 0.885, 0.32, 1.1); - border: var(--border-size) var(--border-style) var(--border-color); - border-radius: var(--ck-border-radius); - - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - --border-size: 1px; - margin: 0 auto 20px; - padding: 38px 0; - gap: 18px; - + div { - // easier than wrapping in another styled component - padding-bottom: 10px; - } - } - - > div { - z-index: 2; - position: relative; - transition: inherit; - } - - &:before, - &:after { - z-index: 1; - content: ''; - position: absolute; - top: 50%; - left: 50%; - width: 120px; - height: 1px; - margin-left: -60px; - transition: inherit; - animation: ${lineKeyframes} 10s linear infinite; - background: linear-gradient( - 90deg, - var(--border-color), - var(--border-color) 50%, - transparent 50%, - transparent 100% - ); - background-size: 6px 1px; - } - - &:after { - background: var(--border-color); - transform: scaleX(0); - } - - ${({$connected:et})=>et&&Ae` - &:before { - opacity: 0; - } - &:after { - transform: none; - } - ${StatusGraphicBgSvg} { - rect { - stroke-dasharray: 0 0; - } - } - ${LogoContainer} { - transform: scale(0.62); - } - ${StatusIcon} { - svg { - transform: scale(1.5); - opacity: 1; - color: #fff; - } - &:before { - transform: scale(0); - } - &:after { - transform: scale(1); - } - } - @media only screen and (max-width: ${defaultTheme.mobileWidth}px) { - --border-size: 1px; - --border-style: solid; - ${StatusIcon} { - svg { - transform: scale(1.75); - } - } - } - `}; -`,SIWEButton=({showSignOutButton:et,onSignIn:o,onSignOut:tt})=>{const rt=useIsMounted(),nt=useLocales(),{setOpen:ot}=useModal(),{isSignedIn:it,isReady:st,isLoading:at,isRejected:ct,isSuccess:lt,isError:dt,signIn:ht,signOut:mt,error:ft}=useSIWE({onSignIn:gt=>o==null?void 0:o(gt),onSignOut:()=>tt==null?void 0:tt()}),{address:pt}=useAccount();function yt(){return lt?nt.signedIn:ct?nt.tryAgain:at?nt.awaitingConfirmation:dt?ft??"Unknown Error":nt.signIn}return rt?et&&it?jsxRuntimeExports.jsx(Button$1,{style:{margin:0},onClick:mt,icon:jsxRuntimeExports.jsx(DisconnectIcon,{}),children:nt.signOut},"button"):pt?jsxRuntimeExports.jsx(Button$1,{style:{margin:0},arrow:it?!1:!at&&!ct,onClick:!at&&!lt?ht:void 0,disabled:at,waiting:at,icon:ct&&jsxRuntimeExports.jsx(motion.div,{initial:{rotate:-270},animate:{rotate:0},transition:{duration:1,ease:[.175,.885,.32,.98]},children:jsxRuntimeExports.jsx(RetryIcon,{style:{opacity:.4}})}),children:yt()},"button"):jsxRuntimeExports.jsx(Button$1,{style:{margin:0},onClick:()=>ot(!0),arrow:!0,children:nt.walletNotConnected},"button"):jsxRuntimeExports.jsx(Button$1,{style:{margin:0},disabled:!0},"loading")},LazyImage=({src:et,alt:o,width:tt,height:rt})=>{const nt=reactExports.useRef(null),[ot,it]=reactExports.useState(!0);return reactExports.useEffect(()=>{nt.current&&nt.current.complete&&nt.current.naturalHeight!==0||it(!1)},[et]),jsxRuntimeExports.jsx("div",{style:{width:tt,height:rt,background:"rgba(0,0,0,0.02)",boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.02)"},children:jsxRuntimeExports.jsx("img",{ref:nt,src:et,alt:o,width:tt,height:rt,onLoad:()=>it(!0),style:{transition:"opacity 0.2s ease",opacity:ot?1:0}})})},transition={duration:.2,ease:[.26,.08,.25,1]},copyTransition={duration:.16,ease:[.26,.08,.25,1]},SignInWithEthereum=()=>{var et,o;const tt=useContext(),{isSignedIn:rt,reset:nt}=useSIWE(),ot=isMobile(),[it,st]=reactExports.useState(rt?"signedIn":"signedOut"),at=useLocales({}),ct=it==="signedIn"?{heading:at.signInWithEthereumScreen_signedIn_heading,h1:at.signInWithEthereumScreen_signedIn_h1,p:at.signInWithEthereumScreen_signedIn_p,button:at.signInWithEthereumScreen_signedIn_button}:{heading:at.signInWithEthereumScreen_signedOut_heading,h1:at.signInWithEthereumScreen_signedOut_h1,p:at.signInWithEthereumScreen_signedOut_p,button:at.signInWithEthereumScreen_signedOut_button};reactExports.useEffect(()=>{rt&&st("signedIn")},[]),reactExports.useEffect(()=>{rt||st("signedOut")},[rt]);const{address:lt}=useAccount(),ht=(()=>{const ft={svg:null,default:null},pt=document.getElementsByTagName("link");return Array.from(pt).forEach(yt=>{(yt.getAttribute("rel")==="icon"||yt.getAttribute("rel")==="shortcut icon")&&yt.getAttribute("href")&&(yt.getAttribute("type")==="image/svg+xml"?ft.svg=yt.getAttribute("href"):ft.default=yt.getAttribute("href"))}),ft})(),mt=(o=(et=getAppIcon())!==null&&et!==void 0?et:ht.svg)!==null&&o!==void 0?o:ht.default;return jsxRuntimeExports.jsx(PageContent,{style:{width:278},children:jsxRuntimeExports.jsxs(ModalContent,{style:{padding:0,marginTop:-10},children:[jsxRuntimeExports.jsx(ContentContainer,{children:jsxRuntimeExports.jsx(AnimatePresence,{exitBeforeEnter:!0,children:jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{opacity:0,scale:.94},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.94},transition:copyTransition,children:jsxRuntimeExports.jsx(ModalBody,{style:{height:42},children:jsxRuntimeExports.jsx(FitText,{children:ct.h1})})},flattenChildren(ct.h1).toString())})}),jsxRuntimeExports.jsxs(StatusGraphic,{$connected:rt,children:[jsxRuntimeExports.jsx("div",{style:{position:"absolute",inset:0},children:jsxRuntimeExports.jsx(StatusGraphicBgSvg,{width:"262",height:"134",viewBox:"0 0 262 134",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx(motion.rect,{x:"0",y:"0",rx:"12",width:"262",height:"134",strokeDasharray:"3 3",animate:{strokeDashoffset:[0,-6]},transition:{duration:.4,ease:"linear",repeat:1/0}})})}),jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{opacity:0,x:50,scale:.8},animate:{opacity:1,x:0,scale:1},transition,children:jsxRuntimeExports.jsx(LogoContainer,{children:jsxRuntimeExports.jsx(Avatar,{address:lt,size:64})})},"avatarImage"),jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{scale:.6},animate:{scale:1},transition:{...transition},children:jsxRuntimeExports.jsx(StatusIcon,{children:jsxRuntimeExports.jsx(TickIcon,{})})},"tickIcon"),jsxRuntimeExports.jsx(motion.div,{initial:ot?!1:{opacity:0,x:-40,scale:.8},animate:{opacity:1,x:0,scale:1},transition:{...transition},children:jsxRuntimeExports.jsx(LogoContainer,{children:mt?jsxRuntimeExports.jsx(LazyImage,{src:mt,alt:"app"}):jsxRuntimeExports.jsx(Chains.UnknownChain,{})})},"appLogo")]},"status"),jsxRuntimeExports.jsx(AnimatePresence,{exitBeforeEnter:!0,children:jsxRuntimeExports.jsx(motion.div,{style:{paddingBottom:ot?24:12},initial:ot?!1:{opacity:0,scale:.94},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.94},transition:copyTransition,children:jsxRuntimeExports.jsx(ModalBody,{style:{height:42,marginTop:-1,marginBottom:-3},children:jsxRuntimeExports.jsx(FitText,{children:ct.p})})},flattenChildren(ct.p).toString())}),jsxRuntimeExports.jsx(SIWEButton,{showSignOutButton:it==="signedIn",onSignIn:()=>{setTimeout(()=>{tt.setOpen(!1)},1e3)}})]})})},customThemeDefault$1={},ConnectModal$1=({mode:et="auto",theme:o="auto",customTheme:tt=customThemeDefault$1,lang:rt="en-US"})=>{var nt;const ot=useContext(),{isConnected:it,chain:st}=useAccount(),at=useChainIsSupported(st==null?void 0:st.id),ct=!(!((nt=ot.options)===null||nt===void 0)&&nt.enforceSupportedChains&&it&&!at),lt=ct&&ot.route!==routes.CONNECTORS&&ot.route!==routes.PROFILE,dt=ct&&ot.route!==routes.PROFILE,ht=()=>{ot.route===routes.SIGNINWITHETHEREUM||ot.route===routes.SWITCHNETWORKS?ot.setRoute(routes.PROFILE):ot.route===routes.DOWNLOAD?ot.setRoute(routes.CONNECT):ot.setRoute(routes.CONNECTORS)},mt={onboarding:jsxRuntimeExports.jsx(Introduction,{}),about:jsxRuntimeExports.jsx(About,{}),download:jsxRuntimeExports.jsx(DownloadApp,{}),connectors:jsxRuntimeExports.jsx(Wallets,{}),mobileConnectors:jsxRuntimeExports.jsx(MobileConnectors,{}),connect:jsxRuntimeExports.jsx(ConnectUsing,{}),profile:jsxRuntimeExports.jsx(Profile,{}),switchNetworks:jsxRuntimeExports.jsx(SwitchNetworks,{}),signInWithEthereum:jsxRuntimeExports.jsx(SignInWithEthereum,{})};function ft(){ot.setOpen(!1)}return reactExports.useEffect(()=>{var pt;it?(ot.route!==routes.PROFILE||ot.route!==routes.SIGNINWITHETHEREUM)&&(ot.signInWithEthereum&&!(!((pt=ot.options)===null||pt===void 0)&&pt.disableSiweRedirect)?ot.setRoute(routes.SIGNINWITHETHEREUM):ft()):ft()},[it]),reactExports.useEffect(()=>ot.setMode(et),[et]),reactExports.useEffect(()=>ot.setTheme(o),[o]),reactExports.useEffect(()=>ot.setCustomTheme(tt),[tt]),reactExports.useEffect(()=>ot.setLang(rt),[rt]),reactExports.useEffect(()=>{const pt=getAppName();if(!pt||!ot.open)return;const yt=document.createElement("meta");return yt.setAttribute("property","og:title"),yt.setAttribute("content",pt),document.head.prepend(yt),()=>{document.head.removeChild(yt)}},[ot.open]),jsxRuntimeExports.jsx(ConnectKitThemeProvider,{theme:o,customTheme:tt,mode:et,children:jsxRuntimeExports.jsx(Modal,{open:ot.open,pages:mt,pageId:ot.route,onClose:ct?ft:void 0,onInfo:dt?()=>ot.setRoute(routes.ABOUT):void 0,onBack:lt?ht:void 0})})};function useGoogleFont(et){reactExports.useEffect(()=>{if(!et)return;et=et.replace(/ /g,"+");const o=document.createElement("link");o.href="https://fonts.googleapis.com",o.rel="preconnect";const tt=document.createElement("link");tt.href="https://fonts.gstatic.com",tt.rel="preconnect",tt.crossOrigin="true";const rt=document.createElement("link");return rt.href=`https://fonts.googleapis.com/css2?family=${et}:wght@400;500;600&display=swap`,rt.rel="stylesheet",document.head.appendChild(o),document.head.appendChild(tt),document.head.appendChild(rt),()=>{document.head.removeChild(o),document.head.removeChild(tt),document.head.removeChild(rt)}},[et])}function useThemeFont(et){var o;const rt=(o={web95:"Lato",retro:"Nunito",midnight:"Inter",minimal:"Inter",rounded:"Nunito"}[et])!==null&&o!==void 0?o:null;useGoogleFont(rt??"")}const useConnectCallback=({onConnect:et,onDisconnect:o})=>{useAccountEffect({onConnect:({address:tt,connector:rt,isReconnected:nt})=>{nt||et==null||et({address:tt,connectorId:rt==null?void 0:rt.id})},onDisconnect:()=>o==null?void 0:o()})},routes={ONBOARDING:"onboarding",ABOUT:"about",CONNECTORS:"connectors",MOBILECONNECTORS:"mobileConnectors",CONNECT:"connect",DOWNLOAD:"download",PROFILE:"profile",SWITCHNETWORKS:"switchNetworks",SIGNINWITHETHEREUM:"signInWithEthereum"},Context=reactExports.createContext(null),ConnectKitProvider=({children:et,theme:o="auto",mode:tt="auto",customTheme:rt,options:nt,onConnect:ot,onDisconnect:it,debugMode:st=!1})=>{var at,ct,lt,dt;if(!React.useContext(WagmiContext))throw Error("ConnectKitProvider must be within a WagmiProvider");if(React.useContext(Context))throw new Error("Multiple, nested usages of ConnectKitProvider detected. Please use only one.");useConnectCallback({onConnect:ot,onDisconnect:it});const ht=useChains(),mt=useConnector("injected"),ft={language:"en-US",hideBalance:!1,hideTooltips:!1,hideQuestionMarkCTA:!1,hideNoWalletCTA:!1,walletConnectCTA:"link",hideRecentBadge:!1,avoidLayoutShift:!0,embedGoogleFonts:!1,truncateLongENSAddress:!0,walletConnectName:void 0,reducedMotion:!1,disclaimer:null,bufferPolyfill:!0,customAvatar:void 0,initialChainId:(at=ht==null?void 0:ht[0])===null||at===void 0?void 0:at.id,enforceSupportedChains:!1,ethereumOnboardingUrl:void 0,walletOnboardingUrl:void 0,disableSiweRedirect:!1},pt=Object.assign({},ft,nt);typeof window<"u"&&pt.bufferPolyfill&&(window.Buffer=(ct=window.Buffer)!==null&&ct!==void 0?ct:buffer$2.Buffer);const[yt,gt]=reactExports.useState(o),[bt,xt]=reactExports.useState(tt),[vt,Et]=reactExports.useState(rt??{}),[Ct,St]=reactExports.useState("en-US"),[At,kt]=reactExports.useState(!1),[It,Nt]=reactExports.useState({id:""}),[Lt,Mt]=reactExports.useState(routes.CONNECTORS),[zt,Ut]=reactExports.useState(""),[Xt,Wt]=reactExports.useState(0);pt.embedGoogleFonts&&useThemeFont(o),reactExports.useEffect(()=>gt(o),[o]),reactExports.useEffect(()=>St(pt.language||"en-US"),[pt.language]),reactExports.useEffect(()=>Ut(null),[Lt,At]);const{chain:Ft,isConnected:qt}=useAccount(),Pt=useChainIsSupported(Ft==null?void 0:Ft.id);reactExports.useEffect(()=>{qt&&pt.enforceSupportedChains&&!Pt&&(kt(!0),Mt(routes.SWITCHNETWORKS))},[qt,Pt,Ft,Lt,At]),reactExports.useEffect(()=>{isFamily()&&(mt==null||mt.connect())},[mt]);const Yt=st?console.log:()=>{},Qt={theme:yt,setTheme:gt,mode:bt,setMode:xt,customTheme:rt,setCustomTheme:Et,lang:Ct,setLang:St,open:At,setOpen:kt,route:Lt,setRoute:Mt,connector:It,setConnector:Nt,signInWithEthereum:(dt=(lt=React.useContext(SIWEContext))===null||lt===void 0?void 0:lt.enabled)!==null&&dt!==void 0?dt:!1,onConnect:ot,options:pt,errorMessage:zt,debugMode:st,log:Yt,displayError:(jt,Gt)=>{Ut(jt),console.log("---------CONNECTKIT DEBUG---------"),console.log(jt),Gt&&console.table(Gt),console.log("---------/CONNECTKIT DEBUG---------")},resize:Xt,triggerResize:()=>Wt(jt=>jt+1)};return reactExports.createElement(Context.Provider,{value:Qt},jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Web3ContextProvider,{enabled:At,children:jsxRuntimeExports.jsxs(Le,{theme:defaultTheme$1,children:[et,jsxRuntimeExports.jsx(ConnectModal$1,{lang:Ct,theme:yt,mode:tt,customTheme:vt})]})})}))},useContext=()=>{const et=React.useContext(Context);if(!et)throw Error("ConnectKit Hook must be inside a Provider.");return et},safeRoutes={disconnected:[routes.CONNECTORS,routes.ABOUT,routes.ONBOARDING,routes.MOBILECONNECTORS,routes.ONBOARDING],connected:[routes.PROFILE,routes.SWITCHNETWORKS,routes.SIGNINWITHETHEREUM]},allRoutes=[...safeRoutes.connected,...safeRoutes.disconnected],useModal=({onConnect:et,onDisconnect:o}={})=>{const tt=useContext();useConnectCallback({onConnect:et,onDisconnect:o});const{isConnected:rt}=useAccount(),{signIn:nt}=useSIWE(),ot=()=>{tt.setOpen(!1)},it=()=>{tt.setOpen(!0)},st=at=>{let ct=at;allRoutes.includes(at)?rt?safeRoutes.connected.includes(at)||(ct=routes.PROFILE,tt.log(`Route ${at} is not a valid route when connected, navigating to ${ct} instead.`)):safeRoutes.disconnected.includes(at)||(ct=routes.CONNECTORS,tt.log(`Route ${at} is not a valid route when disconnected, navigating to ${ct} instead.`)):(ct=rt?routes.PROFILE:routes.CONNECTORS,tt.log(`Route ${at} is not a valid route, navigating to ${ct} instead.`)),tt.setRoute(ct),it()};return{open:tt.open,setOpen:at=>{at?st(rt?routes.PROFILE:routes.CONNECTORS):ot()},openAbout:()=>st(routes.ABOUT),openOnboarding:()=>st(routes.ONBOARDING),openProfile:()=>st(routes.PROFILE),openSwitchNetworks:()=>st(routes.SWITCHNETWORKS),openSIWE:at=>{st(routes.SIGNINWITHETHEREUM),at&&nt()}}},TextContainer=styled(motion.div)` - top: 0; - bottom: 0; - left: 0; - display: inline-flex; - align-items: center; - justify-content: center; - white-space: nowrap; -`;styled(motion.div)` - position: relative; - width: 24px; - height: 24px; - border-radius: 12px; - overflow: hidden; - svg { - display: block; - } -`;const IconContainer=styled(motion.div)` - pointer-events: none; - user-select: none; - position: relative; - width: 24px; - height: 24px; - margin-right: 8px; -`,UnsupportedNetworkContainer=styled(motion.div)` - z-index: 1; - position: absolute; - inset: 0; - display: flex; - align-items: center; - justify-content: center; - border-radius: 100%; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02); - background: var(--ck-body-color-danger, red); - color: #fff; - svg { - display: block; - position: relative; - top: -1px; - } -`,Container$2=styled(motion.div)` - display: flex; - align-items: center; - justify-content: flex-start; - position: relative; - height: 40px; - padding: 0; - line-height: 0; - letter-spacing: -0.2px; - font-size: var(--ck-connectbutton-font-size, 16px); - font-weight: var(--ck-connectbutton-font-weight, 500); - text-align: center; - transition: 100ms ease; - transition-property: color, background, box-shadow, border-radius; - - color: var(--color); - background: var(--background); - box-shadow: var(--box-shadow); - border-radius: var(--border-radius); - - &.primary { - --color: var(--ck-connectbutton-color); - --background: var(--ck-connectbutton-background); - --box-shadow: var(--ck-connectbutton-box-shadow); - --border-radius: var(--ck-connectbutton-border-radius, 12px); - - --hover-color: var(--ck-connectbutton-hover-color, var(--color)); - --hover-background: var( - --ck-connectbutton-hover-background, - var(--background) - ); - --hover-box-shadow: var( - --ck-connectbutton-hover-box-shadow, - var(--box-shadow) - ); - --hover-border-radius: var( - --ck-connectbutton-hover-border-radius, - var(--border-radius) - ); - - --active-color: var(--ck-connectbutton-active-color, var(--hover-color)); - --active-background: var( - --ck-connectbutton-active-background, - var(--hover-background) - ); - --active-box-shadow: var( - --ck-connectbutton-active-box-shadow, - var(--hover-box-shadow) - ); - --active-border-radius: var( - --ck-connectbutton-active-border-radius, - var(--hover-border-radius) - ); - } - &.secondary { - --color: var(--ck-connectbutton-balance-color); - --background: var(--ck-connectbutton-balance-background); - --box-shadow: var(--ck-connectbutton-balance-box-shadow); - --border-radius: var( - --ck-connectbutton-balance-border-radius, - var(--ck-connectbutton-border-radius, 12px) - ); - - --hover-color: var(--ck-connectbutton-balance-hover-color, var(--color)); - --hover-background: var( - --ck-connectbutton-balance-hover-background, - var(--background) - ); - --hover-box-shadow: var( - --ck-connectbutton-balance-hover-box-shadow, - var(--box-shadow) - ); - --hover-border-radius: var( - --ck-connectbutton-balance-hover-border-radius, - var(--border-radius) - ); - - --active-color: var( - --ck-connectbutton-balance-active-color, - var(--hover-color) - ); - --active-background: var( - --ck-connectbutton-balance-active-background, - var(--hover-background) - ); - --active-box-shadow: var( - --ck-connectbutton-balance-active-box-shadow, - var(--hover-box-shadow) - ); - --active-border-radius: var( - --ck-connectbutton-balance-active-border-radius, - var(--hover-border-radius) - ); - } -`,ThemeContainer=styled.button` - all: initial; - appearance: none; - user-select: none; - position: relative; - padding: 0; - margin: 0; - background: none; - border-radius: var(--ck-border-radius); - - &:disabled { - pointer-events: none; - opacity: 0.3; - } - - display: flex; - flex-wrap: nowrap; - background: none; - cursor: pointer; - * { - cursor: pointer; - } - &:hover { - ${Container$2} { - color: var(--hover-color, var(--color)); - background: var(--hover-background, var(--background)); - box-shadow: var(--hover-box-shadow, var(--box-shadow)); - border-radius: var(--hover-border-radius, var(--border-radius)); - } - } - &:active { - ${Container$2} { - color: var(--active-color, var(--hover-color, var(--color))); - background: var( - --active-background, - var(--hover-background, var(--background)) - ); - box-shadow: var( - --active-box-shadow, - var(--hover-box-shadow, var(--box-shadow)) - ); - border-radius: var( - --active-border-radius, - var(--hover-border-radius, var(--border-radius)) - ); - } - } - &:focus-visible { - outline: 2px solid var(--ck-family-brand); - } -`,ThemedButton=({children:et,variant:o="primary",autoSize:tt=!0,duration:rt=.3,style:nt})=>{const[ot,it]=useMeasure();return jsxRuntimeExports.jsx(Container$2,{className:o,initial:!1,animate:tt?{width:it.width>10?it.width:"auto"}:void 0,transition:{duration:rt,ease:[.25,1,.5,1],delay:.01},style:nt,children:jsxRuntimeExports.jsx("div",{ref:ot,style:{whiteSpace:"nowrap",width:"fit-content",position:"relative",padding:"0 12px"},children:et})})},Container$1=styled(motion.div)` - display: flex; - align-items: center; - justify-content: center; - gap: 8px; -`,PlaceholderKeyframes=We` - 0%,100%{ opacity: 0.1; transform: scale(0.75); } - 50%{ opacity: 0.75; transform: scale(1.2) } -`,PulseContainer=styled.div` - pointer-events: none; - user-select: none; - padding: 0 5px; - span { - display: inline-block; - vertical-align: middle; - margin: 0 2px; - width: 3px; - height: 3px; - border-radius: 4px; - background: currentColor; - animation: ${PlaceholderKeyframes} 1000ms ease infinite both; - } -`,Balance=({hideIcon:et,hideSymbol:o})=>{const tt=useIsMounted(),[rt,nt]=reactExports.useState(!0),{address:ot,chain:it}=useAccount();useChains();const st=useChainIsSupported(it==null?void 0:it.id),at=useQueryClient(),{data:ct}=useBlockNumber({watch:!0}),{data:lt,queryKey:dt}=useBalance({address:ot,chainId:it==null?void 0:it.id});reactExports.useEffect(()=>{(ct??0%5===0)&&at.invalidateQueries({queryKey:dt})},[ct,dt]);const ht=chainConfigs.find(ft=>ft.id===(it==null?void 0:it.id)),mt=`${!tt||(lt==null?void 0:lt.formatted)===void 0?"balance-loading":`balance-${ht==null?void 0:ht.id}-${lt==null?void 0:lt.formatted}`}`;return reactExports.useEffect(()=>{nt(!1)},[]),jsxRuntimeExports.jsx("div",{style:{position:"relative"},children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:jsxRuntimeExports.jsx(motion.div,{initial:(lt==null?void 0:lt.formatted)!==void 0&&rt?{opacity:1}:{opacity:0,position:"absolute",top:0,left:0,bottom:0},animate:{opacity:1,position:"relative"},exit:{opacity:0,position:"absolute",top:0,left:0,bottom:0},transition:{duration:.4,ease:[.25,1,.5,1],delay:.4},children:!ot||!tt||(lt==null?void 0:lt.formatted)===void 0?jsxRuntimeExports.jsxs(Container$1,{children:[!et&&jsxRuntimeExports.jsx(Chain,{id:it==null?void 0:it.id}),jsxRuntimeExports.jsx("span",{style:{minWidth:32},children:jsxRuntimeExports.jsxs(PulseContainer,{children:[jsxRuntimeExports.jsx("span",{style:{animationDelay:"0ms"}}),jsxRuntimeExports.jsx("span",{style:{animationDelay:"50ms"}}),jsxRuntimeExports.jsx("span",{style:{animationDelay:"100ms"}})]})})]}):st?jsxRuntimeExports.jsxs(Container$1,{children:[!et&&jsxRuntimeExports.jsx(Chain,{id:it==null?void 0:it.id}),jsxRuntimeExports.jsx("span",{style:{minWidth:32},children:nFormatter(Number(lt==null?void 0:lt.formatted))}),!o&&` ${lt==null?void 0:lt.symbol}`]}):jsxRuntimeExports.jsxs(Container$1,{children:[!et&&jsxRuntimeExports.jsx(Chain,{id:it==null?void 0:it.id}),jsxRuntimeExports.jsx("span",{style:{minWidth:32},children:"???"})]})},mt)})})},contentVariants={initial:{zIndex:2,opacity:0,x:"-100%"},animate:{opacity:1,x:.1,transition:{duration:.4,ease:[.25,1,.5,1]}},exit:{zIndex:1,opacity:0,x:"-100%",pointerEvents:"none",position:"absolute",transition:{duration:.4,ease:[.25,1,.5,1]}}},addressVariants={initial:{zIndex:2,opacity:0,x:"100%"},animate:{x:.2,opacity:1,transition:{duration:.4,ease:[.25,1,.5,1]}},exit:{zIndex:1,x:"100%",opacity:0,pointerEvents:"none",position:"absolute",transition:{duration:.4,ease:[.25,1,.5,1]}}},textVariants={initial:{opacity:0},animate:{opacity:1,transition:{duration:.3,ease:[.25,1,.5,1]}},exit:{position:"absolute",opacity:0,transition:{duration:.3,ease:[.25,1,.5,1]}}},ConnectButtonRenderer=({children:et})=>{const o=useIsMounted(),tt=useContext(),{open:rt,setOpen:nt}=useModal(),{address:ot,isConnected:it,chain:st}=useAccount(),at=useChainIsSupported(st==null?void 0:st.id),ct=useEnsFallbackConfig(),{data:lt}=useEnsName({chainId:1,address:ot,config:ct});function dt(){nt(!1)}function ht(){nt(!0),tt.setRoute(it?routes.PROFILE:routes.CONNECTORS)}return!et||!o?null:jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:et({show:ht,hide:dt,chain:st,unsupported:!at,isConnected:!!ot,isConnecting:rt,address:ot,truncatedAddress:ot?truncateEthAddress(ot):void 0,ensName:lt==null?void 0:lt.toString()})})};ConnectButtonRenderer.displayName="ConnectKitButton.Custom";function ConnectKitButtonInner({label:et,showAvatar:o,separator:tt}){var rt;const nt=useLocales({}),ot=useContext(),{isSignedIn:it}=useSIWE(),{address:st,chain:at}=useAccount(),ct=useChainIsSupported(at==null?void 0:at.id),lt=useEnsFallbackConfig(),{data:dt}=useEnsName({chainId:1,address:st,config:lt}),ht=nt.connectWallet;return jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:st?jsxRuntimeExports.jsxs(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:addressVariants,style:{height:40},children:[o&&jsxRuntimeExports.jsxs(IconContainer,{children:[jsxRuntimeExports.jsxs(AnimatePresence,{initial:!1,children:[it&&jsxRuntimeExports.jsx(motion.div,{style:{zIndex:2,position:"absolute",bottom:0,right:0},initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxRuntimeExports.jsx(AuthIcon,{})}),!ct&&jsxRuntimeExports.jsx(UnsupportedNetworkContainer,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:jsxRuntimeExports.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M1.68831 13.5H12.0764C13.1026 13.5 13.7647 12.7197 13.7647 11.763C13.7647 11.4781 13.6985 11.1863 13.5462 10.9149L8.34225 1.37526C8.02445 0.791754 7.45505 0.5 6.88566 0.5C6.31627 0.5 5.73364 0.791754 5.42246 1.37526L0.225108 10.9217C0.0728291 11.1863 0 11.4781 0 11.763C0 12.7197 0.662083 13.5 1.68831 13.5ZM6.88566 8.8048C6.49503 8.8048 6.27655 8.5809 6.26331 8.1738L6.16399 5.0595C6.15075 4.64562 6.44869 4.34708 6.87904 4.34708C7.30278 4.34708 7.61396 4.6524 7.60071 5.06628L7.5014 8.16701C7.48154 8.5809 7.26305 8.8048 6.88566 8.8048ZM6.88566 11.3492C6.44207 11.3492 6.07792 11.0303 6.07792 10.5757C6.07792 10.1211 6.44207 9.80219 6.88566 9.80219C7.32926 9.80219 7.69341 10.1143 7.69341 10.5757C7.69341 11.0371 7.32264 11.3492 6.88566 11.3492Z",fill:"currentColor"})})})]}),jsxRuntimeExports.jsx(Avatar,{size:24,address:st})]}),jsxRuntimeExports.jsx("div",{style:{position:"relative",paddingRight:o?1:0},children:jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:dt?jsxRuntimeExports.jsx(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:textVariants,style:{position:dt?"relative":"absolute"},children:!((rt=ot.options)===null||rt===void 0)&&rt.truncateLongENSAddress?truncateENSAddress(dt,20):dt},"ckEnsName"):jsxRuntimeExports.jsxs(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:textVariants,style:{position:dt?"absolute":"relative"},children:[truncateEthAddress(st,tt)," "]},"ckTruncatedAddress")})})]},"connectedText"):jsxRuntimeExports.jsx(TextContainer,{initial:"initial",animate:"animate",exit:"exit",variants:contentVariants,style:{height:40},children:et||ht},"connectWalletText")})}function ConnectKitButton({label:et,showBalance:o=!1,showAvatar:tt=!0,theme:rt,mode:nt,customTheme:ot,onClick:it}){var st;const at=useIsMounted(),ct=useContext(),{isConnected:lt,address:dt,chain:ht}=useAccount(),mt=useChainIsSupported(ht==null?void 0:ht.id);function ft(){ct.setOpen(!0),ct.setRoute(lt?routes.PROFILE:routes.CONNECTORS)}const pt=["web95","rounded","minimal"].includes((st=rt??ct.theme)!==null&&st!==void 0?st:"")?"....":void 0;if(!at)return null;const yt=o&&mt,gt=dt&&yt;return jsxRuntimeExports.jsx(ResetContainer,{$useTheme:rt??ct.theme,$useMode:nt??ct.mode,$customTheme:ot??ct.customTheme,children:jsxRuntimeExports.jsxs(ThemeContainer,{onClick:()=>{it?it(ft):ft()},children:[yt&&jsxRuntimeExports.jsx(AnimatePresence,{initial:!1,children:gt&&jsxRuntimeExports.jsx(motion.div,{initial:{opacity:0,x:"100%",width:0,marginRight:0},animate:{opacity:1,x:0,width:"auto",marginRight:-24,transition:{duration:.4,ease:[.25,1,.5,1]}},exit:{opacity:0,x:"100%",width:0,marginRight:0,transition:{duration:.4,ease:[.25,1,.5,1]}},children:jsxRuntimeExports.jsx(ThemedButton,{variant:"secondary",theme:rt??ct.theme,mode:nt??ct.mode,customTheme:ot??ct.customTheme,style:{overflow:"hidden"},children:jsxRuntimeExports.jsx(motion.div,{style:{paddingRight:24},children:jsxRuntimeExports.jsx(Balance,{hideSymbol:!0})})})},"balance")}),jsxRuntimeExports.jsx(ThemedButton,{theme:rt??ct.theme,mode:nt??ct.mode,customTheme:ot??ct.customTheme,style:yt&&o&&dt&&(rt==="retro"||ct.theme==="retro")?{boxShadow:"var(--ck-connectbutton-balance-connectbutton-box-shadow)",borderRadius:"var(--ck-connectbutton-balance-connectbutton-border-radius)",overflow:"hidden"}:{overflow:"hidden"},children:jsxRuntimeExports.jsx(ConnectKitButtonInner,{separator:pt,showAvatar:tt,label:et})})]})})}ConnectKitButton.Custom=ConnectButtonRenderer;const dist=8,shake=We` - 0%{ transform:none; } - 25%{ transform:translateX(${dist}px); } - 50%{ transform:translateX(-${dist}px); } - 75%{ transform:translateX(${dist}px); } - 100%{ transform:none; } -`,cursorIn=We` - 0%{ transform:translate(500%,100%); opacity:0; } - 60%{ transform:translate(25%,-20%); opacity:1; } - 70%{ transform:translate(25%,-20%); } - 85%{ transform:translate(25%,-20%) scale(0.9); } - 100%{ transform:translate(25%,-20%) scale(1); opacity:1; } -`;styled.div` - z-index: 2; - position: absolute; - top: 50%; - left: 50%; - width: 32px; - height: 32px; - border-radius: 50%; - background: rgba(0, 0, 0, 0.5); - box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4), 0 4px 6px rgba(0, 0, 0, 0.1); - opacity: 0; - &.play { - animation: ${cursorIn} 1300ms 200ms cubic-bezier(0.16, 1, 0.6, 1) both; - } -`;styled.div` - z-index: 1; - position: absolute; - inset: 0; - &.shake { - animation: ${shake} 300ms 100ms cubic-bezier(0.16, 1, 0.6, 1) both; - } -`;styled.div` - z-index: 1; - position: absolute; - inset: 0; - display: flex; - align-items: center; - justify-content: center; - &:before { - z-index: 9; - content: ''; - position: absolute; - inset: 0; - } -`;const CONNECTKIT_VERSION="1.8.2";/** - * @remix-run/router v1.20.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function _extends$2(){return _extends$2=Object.assign?Object.assign.bind():function(et){for(var o=1;o"u")throw new Error(o)}function warning(et,o){if(!et){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function createKey(){return Math.random().toString(36).substr(2,8)}function getHistoryState(et,o){return{usr:et.state,key:et.key,idx:o}}function createLocation(et,o,tt,rt){return tt===void 0&&(tt=null),_extends$2({pathname:typeof et=="string"?et:et.pathname,search:"",hash:""},typeof o=="string"?parsePath(o):o,{state:tt,key:o&&o.key||rt||createKey()})}function createPath(et){let{pathname:o="/",search:tt="",hash:rt=""}=et;return tt&&tt!=="?"&&(o+=tt.charAt(0)==="?"?tt:"?"+tt),rt&&rt!=="#"&&(o+=rt.charAt(0)==="#"?rt:"#"+rt),o}function parsePath(et){let o={};if(et){let tt=et.indexOf("#");tt>=0&&(o.hash=et.substr(tt),et=et.substr(0,tt));let rt=et.indexOf("?");rt>=0&&(o.search=et.substr(rt),et=et.substr(0,rt)),et&&(o.pathname=et)}return o}function getUrlBasedHistory(et,o,tt,rt){rt===void 0&&(rt={});let{window:nt=document.defaultView,v5Compat:ot=!1}=rt,it=nt.history,st=Action.Pop,at=null,ct=lt();ct==null&&(ct=0,it.replaceState(_extends$2({},it.state,{idx:ct}),""));function lt(){return(it.state||{idx:null}).idx}function dt(){st=Action.Pop;let yt=lt(),gt=yt==null?null:yt-ct;ct=yt,at&&at({action:st,location:pt.location,delta:gt})}function ht(yt,gt){st=Action.Push;let bt=createLocation(pt.location,yt,gt);ct=lt()+1;let xt=getHistoryState(bt,ct),vt=pt.createHref(bt);try{it.pushState(xt,"",vt)}catch(Et){if(Et instanceof DOMException&&Et.name==="DataCloneError")throw Et;nt.location.assign(vt)}ot&&at&&at({action:st,location:pt.location,delta:1})}function mt(yt,gt){st=Action.Replace;let bt=createLocation(pt.location,yt,gt);ct=lt();let xt=getHistoryState(bt,ct),vt=pt.createHref(bt);it.replaceState(xt,"",vt),ot&&at&&at({action:st,location:pt.location,delta:0})}function ft(yt){let gt=nt.location.origin!=="null"?nt.location.origin:nt.location.href,bt=typeof yt=="string"?yt:createPath(yt);return bt=bt.replace(/ $/,"%20"),invariant(gt,"No window.location.(origin|href) available to create URL for href: "+bt),new URL(bt,gt)}let pt={get action(){return st},get location(){return et(nt,it)},listen(yt){if(at)throw new Error("A history only accepts one active listener");return nt.addEventListener(PopStateEventType,dt),at=yt,()=>{nt.removeEventListener(PopStateEventType,dt),at=null}},createHref(yt){return o(nt,yt)},createURL:ft,encodeLocation(yt){let gt=ft(yt);return{pathname:gt.pathname,search:gt.search,hash:gt.hash}},push:ht,replace:mt,go(yt){return it.go(yt)}};return pt}var ResultType;(function(et){et.data="data",et.deferred="deferred",et.redirect="redirect",et.error="error"})(ResultType||(ResultType={}));function matchRoutes(et,o,tt){return tt===void 0&&(tt="/"),matchRoutesImpl(et,o,tt,!1)}function matchRoutesImpl(et,o,tt,rt){let nt=typeof o=="string"?parsePath(o):o,ot=stripBasename(nt.pathname||"/",tt);if(ot==null)return null;let it=flattenRoutes(et);rankRouteBranches(it);let st=null;for(let at=0;st==null&&at{let at={relativePath:st===void 0?ot.path||"":st,caseSensitive:ot.caseSensitive===!0,childrenIndex:it,route:ot};at.relativePath.startsWith("/")&&(invariant(at.relativePath.startsWith(rt),'Absolute route path "'+at.relativePath+'" nested under path '+('"'+rt+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),at.relativePath=at.relativePath.slice(rt.length));let ct=joinPaths([rt,at.relativePath]),lt=tt.concat(at);ot.children&&ot.children.length>0&&(invariant(ot.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+ct+'".')),flattenRoutes(ot.children,o,lt,ct)),!(ot.path==null&&!ot.index)&&o.push({path:ct,score:computeScore(ct,ot.index),routesMeta:lt})};return et.forEach((ot,it)=>{var st;if(ot.path===""||!((st=ot.path)!=null&&st.includes("?")))nt(ot,it);else for(let at of explodeOptionalSegments(ot.path))nt(ot,it,at)}),o}function explodeOptionalSegments(et){let o=et.split("/");if(o.length===0)return[];let[tt,...rt]=o,nt=tt.endsWith("?"),ot=tt.replace(/\?$/,"");if(rt.length===0)return nt?[ot,""]:[ot];let it=explodeOptionalSegments(rt.join("/")),st=[];return st.push(...it.map(at=>at===""?ot:[ot,at].join("/"))),nt&&st.push(...it),st.map(at=>et.startsWith("/")&&at===""?"/":at)}function rankRouteBranches(et){et.sort((o,tt)=>o.score!==tt.score?tt.score-o.score:compareIndexes(o.routesMeta.map(rt=>rt.childrenIndex),tt.routesMeta.map(rt=>rt.childrenIndex)))}const paramRe=/^:[\w-]+$/,dynamicSegmentValue=3,indexRouteValue=2,emptySegmentValue=1,staticSegmentValue=10,splatPenalty=-2,isSplat=et=>et==="*";function computeScore(et,o){let tt=et.split("/"),rt=tt.length;return tt.some(isSplat)&&(rt+=splatPenalty),o&&(rt+=indexRouteValue),tt.filter(nt=>!isSplat(nt)).reduce((nt,ot)=>nt+(paramRe.test(ot)?dynamicSegmentValue:ot===""?emptySegmentValue:staticSegmentValue),rt)}function compareIndexes(et,o){return et.length===o.length&&et.slice(0,-1).every((rt,nt)=>rt===o[nt])?et[et.length-1]-o[o.length-1]:0}function matchRouteBranch(et,o,tt){let{routesMeta:rt}=et,nt={},ot="/",it=[];for(let st=0;st{let{paramName:ht,isOptional:mt}=lt;if(ht==="*"){let pt=st[dt]||"";it=ot.slice(0,ot.length-pt.length).replace(/(.)\/+$/,"$1")}const ft=st[dt];return mt&&!ft?ct[ht]=void 0:ct[ht]=(ft||"").replace(/%2F/g,"/"),ct},{}),pathname:ot,pathnameBase:it,pattern:et}}function compilePath(et,o,tt){o===void 0&&(o=!1),tt===void 0&&(tt=!0),warning(et==="*"||!et.endsWith("*")||et.endsWith("/*"),'Route path "'+et+'" will be treated as if it were '+('"'+et.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+et.replace(/\*$/,"/*")+'".'));let rt=[],nt="^"+et.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(it,st,at)=>(rt.push({paramName:st,isOptional:at!=null}),at?"/?([^\\/]+)?":"/([^\\/]+)"));return et.endsWith("*")?(rt.push({paramName:"*"}),nt+=et==="*"||et==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):tt?nt+="\\/*$":et!==""&&et!=="/"&&(nt+="(?:(?=\\/|$))"),[new RegExp(nt,o?void 0:"i"),rt]}function decodePath(et){try{return et.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return warning(!1,'The URL path "'+et+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+o+").")),et}}function stripBasename(et,o){if(o==="/")return et;if(!et.toLowerCase().startsWith(o.toLowerCase()))return null;let tt=o.endsWith("/")?o.length-1:o.length,rt=et.charAt(tt);return rt&&rt!=="/"?null:et.slice(tt)||"/"}function resolvePath(et,o){o===void 0&&(o="/");let{pathname:tt,search:rt="",hash:nt=""}=typeof et=="string"?parsePath(et):et;return{pathname:tt?tt.startsWith("/")?tt:resolvePathname(tt,o):o,search:normalizeSearch(rt),hash:normalizeHash(nt)}}function resolvePathname(et,o){let tt=o.replace(/\/+$/,"").split("/");return et.split("/").forEach(nt=>{nt===".."?tt.length>1&&tt.pop():nt!=="."&&tt.push(nt)}),tt.length>1?tt.join("/"):"/"}function getInvalidPathError(et,o,tt,rt){return"Cannot include a '"+et+"' character in a manually specified "+("`to."+o+"` field ["+JSON.stringify(rt)+"]. Please separate it out to the ")+("`to."+tt+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function getPathContributingMatches(et){return et.filter((o,tt)=>tt===0||o.route.path&&o.route.path.length>0)}function getResolveToMatches(et,o){let tt=getPathContributingMatches(et);return o?tt.map((rt,nt)=>nt===tt.length-1?rt.pathname:rt.pathnameBase):tt.map(rt=>rt.pathnameBase)}function resolveTo(et,o,tt,rt){rt===void 0&&(rt=!1);let nt;typeof et=="string"?nt=parsePath(et):(nt=_extends$2({},et),invariant(!nt.pathname||!nt.pathname.includes("?"),getInvalidPathError("?","pathname","search",nt)),invariant(!nt.pathname||!nt.pathname.includes("#"),getInvalidPathError("#","pathname","hash",nt)),invariant(!nt.search||!nt.search.includes("#"),getInvalidPathError("#","search","hash",nt)));let ot=et===""||nt.pathname==="",it=ot?"/":nt.pathname,st;if(it==null)st=tt;else{let dt=o.length-1;if(!rt&&it.startsWith("..")){let ht=it.split("/");for(;ht[0]==="..";)ht.shift(),dt-=1;nt.pathname=ht.join("/")}st=dt>=0?o[dt]:"/"}let at=resolvePath(nt,st),ct=it&&it!=="/"&&it.endsWith("/"),lt=(ot||it===".")&&tt.endsWith("/");return!at.pathname.endsWith("/")&&(ct||lt)&&(at.pathname+="/"),at}const joinPaths=et=>et.join("/").replace(/\/\/+/g,"/"),normalizePathname=et=>et.replace(/\/+$/,"").replace(/^\/*/,"/"),normalizeSearch=et=>!et||et==="?"?"":et.startsWith("?")?et:"?"+et,normalizeHash=et=>!et||et==="#"?"":et.startsWith("#")?et:"#"+et;function isRouteErrorResponse(et){return et!=null&&typeof et.status=="number"&&typeof et.statusText=="string"&&typeof et.internal=="boolean"&&"data"in et}const validMutationMethodsArr=["post","put","patch","delete"];new Set(validMutationMethodsArr);const validRequestMethodsArr=["get",...validMutationMethodsArr];new Set(validRequestMethodsArr);/** - * React Router v6.27.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(et){for(var o=1;o{st.current=!0}),reactExports.useCallback(function(ct,lt){if(lt===void 0&&(lt={}),!st.current)return;if(typeof ct=="number"){rt.go(ct);return}let dt=resolveTo(ct,JSON.parse(it),ot,lt.relative==="path");et==null&&o!=="/"&&(dt.pathname=dt.pathname==="/"?o:joinPaths([o,dt.pathname])),(lt.replace?rt.replace:rt.push)(dt,lt.state,lt)},[o,rt,it,ot,et])}function useParams(){let{matches:et}=reactExports.useContext(RouteContext),o=et[et.length-1];return o?o.params:{}}function useResolvedPath(et,o){let{relative:tt}=o===void 0?{}:o,{future:rt}=reactExports.useContext(NavigationContext),{matches:nt}=reactExports.useContext(RouteContext),{pathname:ot}=useLocation(),it=JSON.stringify(getResolveToMatches(nt,rt.v7_relativeSplatPath));return reactExports.useMemo(()=>resolveTo(et,JSON.parse(it),ot,tt==="path"),[et,it,ot,tt])}function useRoutes(et,o){return useRoutesImpl(et,o)}function useRoutesImpl(et,o,tt,rt){useInRouterContext()||invariant(!1);let{navigator:nt}=reactExports.useContext(NavigationContext),{matches:ot}=reactExports.useContext(RouteContext),it=ot[ot.length-1],st=it?it.params:{};it&&it.pathname;let at=it?it.pathnameBase:"/";it&&it.route;let ct=useLocation(),lt;if(o){var dt;let yt=typeof o=="string"?parsePath(o):o;at==="/"||(dt=yt.pathname)!=null&&dt.startsWith(at)||invariant(!1),lt=yt}else lt=ct;let ht=lt.pathname||"/",mt=ht;if(at!=="/"){let yt=at.replace(/^\//,"").split("/");mt="/"+ht.replace(/^\//,"").split("/").slice(yt.length).join("/")}let ft=matchRoutes(et,{pathname:mt}),pt=_renderMatches(ft&&ft.map(yt=>Object.assign({},yt,{params:Object.assign({},st,yt.params),pathname:joinPaths([at,nt.encodeLocation?nt.encodeLocation(yt.pathname).pathname:yt.pathname]),pathnameBase:yt.pathnameBase==="/"?at:joinPaths([at,nt.encodeLocation?nt.encodeLocation(yt.pathnameBase).pathname:yt.pathnameBase])})),ot,tt,rt);return o&&pt?reactExports.createElement(LocationContext.Provider,{value:{location:_extends$1({pathname:"/",search:"",hash:"",state:null,key:"default"},lt),navigationType:Action.Pop}},pt):pt}function DefaultErrorComponent(){let et=useRouteError(),o=isRouteErrorResponse(et)?et.status+" "+et.statusText:et instanceof Error?et.message:JSON.stringify(et),tt=et instanceof Error?et.stack:null,nt={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement("h2",null,"Unexpected Application Error!"),reactExports.createElement("h3",{style:{fontStyle:"italic"}},o),tt?reactExports.createElement("pre",{style:nt},tt):null,null)}const defaultErrorElement=reactExports.createElement(DefaultErrorComponent,null);class RenderErrorBoundary extends reactExports.Component{constructor(o){super(o),this.state={location:o.location,revalidation:o.revalidation,error:o.error}}static getDerivedStateFromError(o){return{error:o}}static getDerivedStateFromProps(o,tt){return tt.location!==o.location||tt.revalidation!=="idle"&&o.revalidation==="idle"?{error:o.error,location:o.location,revalidation:o.revalidation}:{error:o.error!==void 0?o.error:tt.error,location:tt.location,revalidation:o.revalidation||tt.revalidation}}componentDidCatch(o,tt){console.error("React Router caught the following error during render",o,tt)}render(){return this.state.error!==void 0?reactExports.createElement(RouteContext.Provider,{value:this.props.routeContext},reactExports.createElement(RouteErrorContext.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function RenderedRoute(et){let{routeContext:o,match:tt,children:rt}=et,nt=reactExports.useContext(DataRouterContext);return nt&&nt.static&&nt.staticContext&&(tt.route.errorElement||tt.route.ErrorBoundary)&&(nt.staticContext._deepestRenderedBoundaryId=tt.route.id),reactExports.createElement(RouteContext.Provider,{value:o},rt)}function _renderMatches(et,o,tt,rt){var nt;if(o===void 0&&(o=[]),tt===void 0&&(tt=null),rt===void 0&&(rt=null),et==null){var ot;if(!tt)return null;if(tt.errors)et=tt.matches;else if((ot=rt)!=null&&ot.v7_partialHydration&&o.length===0&&!tt.initialized&&tt.matches.length>0)et=tt.matches;else return null}let it=et,st=(nt=tt)==null?void 0:nt.errors;if(st!=null){let lt=it.findIndex(dt=>dt.route.id&&(st==null?void 0:st[dt.route.id])!==void 0);lt>=0||invariant(!1),it=it.slice(0,Math.min(it.length,lt+1))}let at=!1,ct=-1;if(tt&&rt&&rt.v7_partialHydration)for(let lt=0;lt=0?it=it.slice(0,ct+1):it=[it[0]];break}}}return it.reduceRight((lt,dt,ht)=>{let mt,ft=!1,pt=null,yt=null;tt&&(mt=st&&dt.route.id?st[dt.route.id]:void 0,pt=dt.route.errorElement||defaultErrorElement,at&&(ct<0&&ht===0?(ft=!0,yt=null):ct===ht&&(ft=!0,yt=dt.route.hydrateFallbackElement||null)));let gt=o.concat(it.slice(0,ht+1)),bt=()=>{let xt;return mt?xt=pt:ft?xt=yt:dt.route.Component?xt=reactExports.createElement(dt.route.Component,null):dt.route.element?xt=dt.route.element:xt=lt,reactExports.createElement(RenderedRoute,{match:dt,routeContext:{outlet:lt,matches:gt,isDataRoute:tt!=null},children:xt})};return tt&&(dt.route.ErrorBoundary||dt.route.errorElement||ht===0)?reactExports.createElement(RenderErrorBoundary,{location:tt.location,revalidation:tt.revalidation,component:pt,error:mt,children:bt(),routeContext:{outlet:null,matches:gt,isDataRoute:!0}}):bt()},null)}var DataRouterHook$1=function(et){return et.UseBlocker="useBlocker",et.UseRevalidator="useRevalidator",et.UseNavigateStable="useNavigate",et}(DataRouterHook$1||{}),DataRouterStateHook$1=function(et){return et.UseBlocker="useBlocker",et.UseLoaderData="useLoaderData",et.UseActionData="useActionData",et.UseRouteError="useRouteError",et.UseNavigation="useNavigation",et.UseRouteLoaderData="useRouteLoaderData",et.UseMatches="useMatches",et.UseRevalidator="useRevalidator",et.UseNavigateStable="useNavigate",et.UseRouteId="useRouteId",et}(DataRouterStateHook$1||{});function useDataRouterContext(et){let o=reactExports.useContext(DataRouterContext);return o||invariant(!1),o}function useDataRouterState(et){let o=reactExports.useContext(DataRouterStateContext);return o||invariant(!1),o}function useRouteContext(et){let o=reactExports.useContext(RouteContext);return o||invariant(!1),o}function useCurrentRouteId(et){let o=useRouteContext(),tt=o.matches[o.matches.length-1];return tt.route.id||invariant(!1),tt.route.id}function useRouteError(){var et;let o=reactExports.useContext(RouteErrorContext),tt=useDataRouterState(DataRouterStateHook$1.UseRouteError),rt=useCurrentRouteId(DataRouterStateHook$1.UseRouteError);return o!==void 0?o:(et=tt.errors)==null?void 0:et[rt]}function useNavigateStable(){let{router:et}=useDataRouterContext(DataRouterHook$1.UseNavigateStable),o=useCurrentRouteId(DataRouterStateHook$1.UseNavigateStable),tt=reactExports.useRef(!1);return useIsomorphicLayoutEffect$1(()=>{tt.current=!0}),reactExports.useCallback(function(nt,ot){ot===void 0&&(ot={}),tt.current&&(typeof nt=="number"?et.navigate(nt):et.navigate(nt,_extends$1({fromRouteId:o},ot)))},[et,o])}function Navigate(et){let{to:o,replace:tt,state:rt,relative:nt}=et;useInRouterContext()||invariant(!1);let{future:ot,static:it}=reactExports.useContext(NavigationContext),{matches:st}=reactExports.useContext(RouteContext),{pathname:at}=useLocation(),ct=useNavigate(),lt=resolveTo(o,getResolveToMatches(st,ot.v7_relativeSplatPath),at,nt==="path"),dt=JSON.stringify(lt);return reactExports.useEffect(()=>ct(JSON.parse(dt),{replace:tt,state:rt,relative:nt}),[ct,dt,nt,tt,rt]),null}function Route(et){invariant(!1)}function Router(et){let{basename:o="/",children:tt=null,location:rt,navigationType:nt=Action.Pop,navigator:ot,static:it=!1,future:st}=et;useInRouterContext()&&invariant(!1);let at=o.replace(/^\/*/,"/"),ct=reactExports.useMemo(()=>({basename:at,navigator:ot,static:it,future:_extends$1({v7_relativeSplatPath:!1},st)}),[at,st,ot,it]);typeof rt=="string"&&(rt=parsePath(rt));let{pathname:lt="/",search:dt="",hash:ht="",state:mt=null,key:ft="default"}=rt,pt=reactExports.useMemo(()=>{let yt=stripBasename(lt,at);return yt==null?null:{location:{pathname:yt,search:dt,hash:ht,state:mt,key:ft},navigationType:nt}},[at,lt,dt,ht,mt,ft,nt]);return pt==null?null:reactExports.createElement(NavigationContext.Provider,{value:ct},reactExports.createElement(LocationContext.Provider,{children:tt,value:pt}))}function Routes(et){let{children:o,location:tt}=et;return useRoutes(createRoutesFromChildren(o),tt)}new Promise(()=>{});function createRoutesFromChildren(et,o){o===void 0&&(o=[]);let tt=[];return reactExports.Children.forEach(et,(rt,nt)=>{if(!reactExports.isValidElement(rt))return;let ot=[...o,nt];if(rt.type===reactExports.Fragment){tt.push.apply(tt,createRoutesFromChildren(rt.props.children,ot));return}rt.type!==Route&&invariant(!1),!rt.props.index||!rt.props.children||invariant(!1);let it={id:rt.props.id||ot.join("-"),caseSensitive:rt.props.caseSensitive,element:rt.props.element,Component:rt.props.Component,index:rt.props.index,path:rt.props.path,loader:rt.props.loader,action:rt.props.action,errorElement:rt.props.errorElement,ErrorBoundary:rt.props.ErrorBoundary,hasErrorBoundary:rt.props.ErrorBoundary!=null||rt.props.errorElement!=null,shouldRevalidate:rt.props.shouldRevalidate,handle:rt.props.handle,lazy:rt.props.lazy};rt.props.children&&(it.children=createRoutesFromChildren(rt.props.children,ot)),tt.push(it)}),tt}/** - * React Router DOM v6.27.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function _extends(){return _extends=Object.assign?Object.assign.bind():function(et){for(var o=1;o=0)&&(tt[nt]=et[nt]);return tt}function isModifiedEvent(et){return!!(et.metaKey||et.altKey||et.ctrlKey||et.shiftKey)}function shouldProcessLinkClick(et,o){return et.button===0&&(!o||o==="_self")&&!isModifiedEvent(et)}const _excluded=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],REACT_ROUTER_VERSION="6";try{window.__reactRouterVersion=REACT_ROUTER_VERSION}catch{}const START_TRANSITION="startTransition",startTransitionImpl=React$1[START_TRANSITION];function BrowserRouter(et){let{basename:o,children:tt,future:rt,window:nt}=et,ot=reactExports.useRef();ot.current==null&&(ot.current=createBrowserHistory({window:nt,v5Compat:!0}));let it=ot.current,[st,at]=reactExports.useState({action:it.action,location:it.location}),{v7_startTransition:ct}=rt||{},lt=reactExports.useCallback(dt=>{ct&&startTransitionImpl?startTransitionImpl(()=>at(dt)):at(dt)},[at,ct]);return reactExports.useLayoutEffect(()=>it.listen(lt),[it,lt]),reactExports.createElement(Router,{basename:o,children:tt,location:st.location,navigationType:st.action,navigator:it,future:rt})}const isBrowser$1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ABSOLUTE_URL_REGEX=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Link=reactExports.forwardRef(function(o,tt){let{onClick:rt,relative:nt,reloadDocument:ot,replace:it,state:st,target:at,to:ct,preventScrollReset:lt,viewTransition:dt}=o,ht=_objectWithoutPropertiesLoose(o,_excluded),{basename:mt}=reactExports.useContext(NavigationContext),ft,pt=!1;if(typeof ct=="string"&&ABSOLUTE_URL_REGEX.test(ct)&&(ft=ct,isBrowser$1))try{let xt=new URL(window.location.href),vt=ct.startsWith("//")?new URL(xt.protocol+ct):new URL(ct),Et=stripBasename(vt.pathname,mt);vt.origin===xt.origin&&Et!=null?ct=Et+vt.search+vt.hash:pt=!0}catch{}let yt=useHref(ct,{relative:nt}),gt=useLinkClickHandler(ct,{replace:it,state:st,target:at,preventScrollReset:lt,relative:nt,viewTransition:dt});function bt(xt){rt&&rt(xt),xt.defaultPrevented||gt(xt)}return reactExports.createElement("a",_extends({},ht,{href:ft||yt,onClick:pt||ot?rt:bt,ref:tt,target:at}))});var DataRouterHook;(function(et){et.UseScrollRestoration="useScrollRestoration",et.UseSubmit="useSubmit",et.UseSubmitFetcher="useSubmitFetcher",et.UseFetcher="useFetcher",et.useViewTransitionState="useViewTransitionState"})(DataRouterHook||(DataRouterHook={}));var DataRouterStateHook;(function(et){et.UseFetcher="useFetcher",et.UseFetchers="useFetchers",et.UseScrollRestoration="useScrollRestoration"})(DataRouterStateHook||(DataRouterStateHook={}));function useLinkClickHandler(et,o){let{target:tt,replace:rt,state:nt,preventScrollReset:ot,relative:it,viewTransition:st}=o===void 0?{}:o,at=useNavigate(),ct=useLocation(),lt=useResolvedPath(et,{relative:it});return reactExports.useCallback(dt=>{if(shouldProcessLinkClick(dt,tt)){dt.preventDefault();let ht=rt!==void 0?rt:createPath(ct)===createPath(lt);at(et,{replace:ht,state:nt,preventScrollReset:ot,relative:it,viewTransition:st})}},[ct,at,lt,rt,nt,tt,et,ot,it,st])}function setRef(et,o){typeof et=="function"?et(o):et!=null&&(et.current=o)}function composeRefs(...et){return o=>et.forEach(tt=>setRef(tt,o))}function useComposedRefs(...et){return reactExports.useCallback(composeRefs(...et),et)}var Slot=reactExports.forwardRef((et,o)=>{const{children:tt,...rt}=et,nt=reactExports.Children.toArray(tt),ot=nt.find(isSlottable);if(ot){const it=ot.props.children,st=nt.map(at=>at===ot?reactExports.Children.count(it)>1?reactExports.Children.only(null):reactExports.isValidElement(it)?it.props.children:null:at);return jsxRuntimeExports.jsx(SlotClone,{...rt,ref:o,children:reactExports.isValidElement(it)?reactExports.cloneElement(it,void 0,st):null})}return jsxRuntimeExports.jsx(SlotClone,{...rt,ref:o,children:tt})});Slot.displayName="Slot";var SlotClone=reactExports.forwardRef((et,o)=>{const{children:tt,...rt}=et;if(reactExports.isValidElement(tt)){const nt=getElementRef$1(tt);return reactExports.cloneElement(tt,{...mergeProps(rt,tt.props),ref:o?composeRefs(o,nt):nt})}return reactExports.Children.count(tt)>1?reactExports.Children.only(null):null});SlotClone.displayName="SlotClone";var Slottable=({children:et})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:et});function isSlottable(et){return reactExports.isValidElement(et)&&et.type===Slottable}function mergeProps(et,o){const tt={...o};for(const rt in o){const nt=et[rt],ot=o[rt];/^on[A-Z]/.test(rt)?nt&&ot?tt[rt]=(...st)=>{ot(...st),nt(...st)}:nt&&(tt[rt]=nt):rt==="style"?tt[rt]={...nt,...ot}:rt==="className"&&(tt[rt]=[nt,ot].filter(Boolean).join(" "))}return{...et,...tt}}function getElementRef$1(et){var rt,nt;let o=(rt=Object.getOwnPropertyDescriptor(et.props,"ref"))==null?void 0:rt.get,tt=o&&"isReactWarning"in o&&o.isReactWarning;return tt?et.ref:(o=(nt=Object.getOwnPropertyDescriptor(et,"ref"))==null?void 0:nt.get,tt=o&&"isReactWarning"in o&&o.isReactWarning,tt?et.props.ref:et.props.ref||et.ref)}function r$1(et){var o,tt,rt="";if(typeof et=="string"||typeof et=="number")rt+=et;else if(typeof et=="object")if(Array.isArray(et))for(o=0;otypeof et=="boolean"?"".concat(et):et===0?"0":et,cx=clsx$1,cva=(et,o)=>tt=>{var rt;if((o==null?void 0:o.variants)==null)return cx(et,tt==null?void 0:tt.class,tt==null?void 0:tt.className);const{variants:nt,defaultVariants:ot}=o,it=Object.keys(nt).map(ct=>{const lt=tt==null?void 0:tt[ct],dt=ot==null?void 0:ot[ct];if(lt===null)return null;const ht=falsyToString(lt)||falsyToString(dt);return nt[ct][ht]}),st=tt&&Object.entries(tt).reduce((ct,lt)=>{let[dt,ht]=lt;return ht===void 0||(ct[dt]=ht),ct},{}),at=o==null||(rt=o.compoundVariants)===null||rt===void 0?void 0:rt.reduce((ct,lt)=>{let{class:dt,className:ht,...mt}=lt;return Object.entries(mt).every(ft=>{let[pt,yt]=ft;return Array.isArray(yt)?yt.includes({...ot,...st}[pt]):{...ot,...st}[pt]===yt})?[...ct,dt,ht]:ct},[]);return cx(et,it,at,tt==null?void 0:tt.class,tt==null?void 0:tt.className)};function r(et){var o,tt,rt="";if(typeof et=="string"||typeof et=="number")rt+=et;else if(typeof et=="object")if(Array.isArray(et)){var nt=et.length;for(o=0;o{const o=createClassMap(et),{conflictingClassGroups:tt,conflictingClassGroupModifiers:rt}=et;return{getClassGroupId:it=>{const st=it.split(CLASS_PART_SEPARATOR);return st[0]===""&&st.length!==1&&st.shift(),getGroupRecursive(st,o)||getGroupIdForArbitraryProperty(it)},getConflictingClassGroupIds:(it,st)=>{const at=tt[it]||[];return st&&rt[it]?[...at,...rt[it]]:at}}},getGroupRecursive=(et,o)=>{var it;if(et.length===0)return o.classGroupId;const tt=et[0],rt=o.nextPart.get(tt),nt=rt?getGroupRecursive(et.slice(1),rt):void 0;if(nt)return nt;if(o.validators.length===0)return;const ot=et.join(CLASS_PART_SEPARATOR);return(it=o.validators.find(({validator:st})=>st(ot)))==null?void 0:it.classGroupId},arbitraryPropertyRegex=/^\[(.+)\]$/,getGroupIdForArbitraryProperty=et=>{if(arbitraryPropertyRegex.test(et)){const o=arbitraryPropertyRegex.exec(et)[1],tt=o==null?void 0:o.substring(0,o.indexOf(":"));if(tt)return"arbitrary.."+tt}},createClassMap=et=>{const{theme:o,prefix:tt}=et,rt={nextPart:new Map,validators:[]};return getPrefixedClassGroupEntries(Object.entries(et.classGroups),tt).forEach(([ot,it])=>{processClassesRecursively(it,rt,ot,o)}),rt},processClassesRecursively=(et,o,tt,rt)=>{et.forEach(nt=>{if(typeof nt=="string"){const ot=nt===""?o:getPart(o,nt);ot.classGroupId=tt;return}if(typeof nt=="function"){if(isThemeGetter(nt)){processClassesRecursively(nt(rt),o,tt,rt);return}o.validators.push({validator:nt,classGroupId:tt});return}Object.entries(nt).forEach(([ot,it])=>{processClassesRecursively(it,getPart(o,ot),tt,rt)})})},getPart=(et,o)=>{let tt=et;return o.split(CLASS_PART_SEPARATOR).forEach(rt=>{tt.nextPart.has(rt)||tt.nextPart.set(rt,{nextPart:new Map,validators:[]}),tt=tt.nextPart.get(rt)}),tt},isThemeGetter=et=>et.isThemeGetter,getPrefixedClassGroupEntries=(et,o)=>o?et.map(([tt,rt])=>{const nt=rt.map(ot=>typeof ot=="string"?o+ot:typeof ot=="object"?Object.fromEntries(Object.entries(ot).map(([it,st])=>[o+it,st])):ot);return[tt,nt]}):et,createLruCache=et=>{if(et<1)return{get:()=>{},set:()=>{}};let o=0,tt=new Map,rt=new Map;const nt=(ot,it)=>{tt.set(ot,it),o++,o>et&&(o=0,rt=tt,tt=new Map)};return{get(ot){let it=tt.get(ot);if(it!==void 0)return it;if((it=rt.get(ot))!==void 0)return nt(ot,it),it},set(ot,it){tt.has(ot)?tt.set(ot,it):nt(ot,it)}}},IMPORTANT_MODIFIER="!",createParseClassName=et=>{const{separator:o,experimentalParseClassName:tt}=et,rt=o.length===1,nt=o[0],ot=o.length,it=st=>{const at=[];let ct=0,lt=0,dt;for(let yt=0;ytlt?dt-lt:void 0;return{modifiers:at,hasImportantModifier:mt,baseClassName:ft,maybePostfixModifierPosition:pt}};return tt?st=>tt({className:st,parseClassName:it}):it},sortModifiers=et=>{if(et.length<=1)return et;const o=[];let tt=[];return et.forEach(rt=>{rt[0]==="["?(o.push(...tt.sort(),rt),tt=[]):tt.push(rt)}),o.push(...tt.sort()),o},createConfigUtils=et=>({cache:createLruCache(et.cacheSize),parseClassName:createParseClassName(et),...createClassGroupUtils(et)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(et,o)=>{const{parseClassName:tt,getClassGroupId:rt,getConflictingClassGroupIds:nt}=o,ot=[],it=et.trim().split(SPLIT_CLASSES_REGEX);let st="";for(let at=it.length-1;at>=0;at-=1){const ct=it[at],{modifiers:lt,hasImportantModifier:dt,baseClassName:ht,maybePostfixModifierPosition:mt}=tt(ct);let ft=!!mt,pt=rt(ft?ht.substring(0,mt):ht);if(!pt){if(!ft){st=ct+(st.length>0?" "+st:st);continue}if(pt=rt(ht),!pt){st=ct+(st.length>0?" "+st:st);continue}ft=!1}const yt=sortModifiers(lt).join(":"),gt=dt?yt+IMPORTANT_MODIFIER:yt,bt=gt+pt;if(ot.includes(bt))continue;ot.push(bt);const xt=nt(pt,ft);for(let vt=0;vt0?" "+st:st)}return st};function twJoin(){let et=0,o,tt,rt="";for(;et{if(typeof et=="string")return et;let o,tt="";for(let rt=0;rtdt(lt),et());return tt=createConfigUtils(ct),rt=tt.cache.get,nt=tt.cache.set,ot=st,st(at)}function st(at){const ct=rt(at);if(ct)return ct;const lt=mergeClassList(at,tt);return nt(at,lt),lt}return function(){return ot(twJoin.apply(null,arguments))}}const fromTheme=et=>{const o=tt=>tt[et]||[];return o.isThemeGetter=!0,o},arbitraryValueRegex=/^\[(?:([a-z-]+):)?(.+)\]$/i,fractionRegex=/^\d+\/\d+$/,stringLengths=new Set(["px","full","screen"]),tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isLength=et=>isNumber(et)||stringLengths.has(et)||fractionRegex.test(et),isArbitraryLength=et=>getIsArbitraryValue(et,"length",isLengthOnly),isNumber=et=>!!et&&!Number.isNaN(Number(et)),isArbitraryNumber=et=>getIsArbitraryValue(et,"number",isNumber),isInteger$1=et=>!!et&&Number.isInteger(Number(et)),isPercent=et=>et.endsWith("%")&&isNumber(et.slice(0,-1)),isArbitraryValue=et=>arbitraryValueRegex.test(et),isTshirtSize=et=>tshirtUnitRegex.test(et),sizeLabels=new Set(["length","size","percentage"]),isArbitrarySize=et=>getIsArbitraryValue(et,sizeLabels,isNever),isArbitraryPosition=et=>getIsArbitraryValue(et,"position",isNever),imageLabels=new Set(["image","url"]),isArbitraryImage=et=>getIsArbitraryValue(et,imageLabels,isImage),isArbitraryShadow=et=>getIsArbitraryValue(et,"",isShadow),isAny=()=>!0,getIsArbitraryValue=(et,o,tt)=>{const rt=arbitraryValueRegex.exec(et);return rt?rt[1]?typeof o=="string"?rt[1]===o:o.has(rt[1]):tt(rt[2]):!1},isLengthOnly=et=>lengthUnitRegex.test(et)&&!colorFunctionRegex.test(et),isNever=()=>!1,isShadow=et=>shadowRegex.test(et),isImage=et=>imageRegex.test(et),getDefaultConfig=()=>{const et=fromTheme("colors"),o=fromTheme("spacing"),tt=fromTheme("blur"),rt=fromTheme("brightness"),nt=fromTheme("borderColor"),ot=fromTheme("borderRadius"),it=fromTheme("borderSpacing"),st=fromTheme("borderWidth"),at=fromTheme("contrast"),ct=fromTheme("grayscale"),lt=fromTheme("hueRotate"),dt=fromTheme("invert"),ht=fromTheme("gap"),mt=fromTheme("gradientColorStops"),ft=fromTheme("gradientColorStopPositions"),pt=fromTheme("inset"),yt=fromTheme("margin"),gt=fromTheme("opacity"),bt=fromTheme("padding"),xt=fromTheme("saturate"),vt=fromTheme("scale"),Et=fromTheme("sepia"),Ct=fromTheme("skew"),St=fromTheme("space"),At=fromTheme("translate"),kt=()=>["auto","contain","none"],It=()=>["auto","hidden","clip","visible","scroll"],Nt=()=>["auto",isArbitraryValue,o],Lt=()=>[isArbitraryValue,o],Mt=()=>["",isLength,isArbitraryLength],zt=()=>["auto",isNumber,isArbitraryValue],Ut=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Xt=()=>["solid","dashed","dotted","double","none"],Wt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ft=()=>["start","end","center","between","around","evenly","stretch"],qt=()=>["","0",isArbitraryValue],Pt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Yt=()=>[isNumber,isArbitraryValue];return{cacheSize:500,separator:":",theme:{colors:[isAny],spacing:[isLength,isArbitraryLength],blur:["none","",isTshirtSize,isArbitraryValue],brightness:Yt(),borderColor:[et],borderRadius:["none","","full",isTshirtSize,isArbitraryValue],borderSpacing:Lt(),borderWidth:Mt(),contrast:Yt(),grayscale:qt(),hueRotate:Yt(),invert:qt(),gap:Lt(),gradientColorStops:[et],gradientColorStopPositions:[isPercent,isArbitraryLength],inset:Nt(),margin:Nt(),opacity:Yt(),padding:Lt(),saturate:Yt(),scale:Yt(),sepia:qt(),skew:Yt(),space:Lt(),translate:Lt()},classGroups:{aspect:[{aspect:["auto","square","video",isArbitraryValue]}],container:["container"],columns:[{columns:[isTshirtSize]}],"break-after":[{"break-after":Pt()}],"break-before":[{"break-before":Pt()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...Ut(),isArbitraryValue]}],overflow:[{overflow:It()}],"overflow-x":[{"overflow-x":It()}],"overflow-y":[{"overflow-y":It()}],overscroll:[{overscroll:kt()}],"overscroll-x":[{"overscroll-x":kt()}],"overscroll-y":[{"overscroll-y":kt()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[pt]}],"inset-x":[{"inset-x":[pt]}],"inset-y":[{"inset-y":[pt]}],start:[{start:[pt]}],end:[{end:[pt]}],top:[{top:[pt]}],right:[{right:[pt]}],bottom:[{bottom:[pt]}],left:[{left:[pt]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",isInteger$1,isArbitraryValue]}],basis:[{basis:Nt()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",isArbitraryValue]}],grow:[{grow:qt()}],shrink:[{shrink:qt()}],order:[{order:["first","last","none",isInteger$1,isArbitraryValue]}],"grid-cols":[{"grid-cols":[isAny]}],"col-start-end":[{col:["auto",{span:["full",isInteger$1,isArbitraryValue]},isArbitraryValue]}],"col-start":[{"col-start":zt()}],"col-end":[{"col-end":zt()}],"grid-rows":[{"grid-rows":[isAny]}],"row-start-end":[{row:["auto",{span:[isInteger$1,isArbitraryValue]},isArbitraryValue]}],"row-start":[{"row-start":zt()}],"row-end":[{"row-end":zt()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",isArbitraryValue]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",isArbitraryValue]}],gap:[{gap:[ht]}],"gap-x":[{"gap-x":[ht]}],"gap-y":[{"gap-y":[ht]}],"justify-content":[{justify:["normal",...Ft()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Ft(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Ft(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[bt]}],px:[{px:[bt]}],py:[{py:[bt]}],ps:[{ps:[bt]}],pe:[{pe:[bt]}],pt:[{pt:[bt]}],pr:[{pr:[bt]}],pb:[{pb:[bt]}],pl:[{pl:[bt]}],m:[{m:[yt]}],mx:[{mx:[yt]}],my:[{my:[yt]}],ms:[{ms:[yt]}],me:[{me:[yt]}],mt:[{mt:[yt]}],mr:[{mr:[yt]}],mb:[{mb:[yt]}],ml:[{ml:[yt]}],"space-x":[{"space-x":[St]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[St]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",isArbitraryValue,o]}],"min-w":[{"min-w":[isArbitraryValue,o,"min","max","fit"]}],"max-w":[{"max-w":[isArbitraryValue,o,"none","full","min","max","fit","prose",{screen:[isTshirtSize]},isTshirtSize]}],h:[{h:[isArbitraryValue,o,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[isArbitraryValue,o,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[isArbitraryValue,o,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[isArbitraryValue,o,"auto","min","max","fit"]}],"font-size":[{text:["base",isTshirtSize,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",isArbitraryNumber]}],"font-family":[{font:[isAny]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",isArbitraryValue]}],"line-clamp":[{"line-clamp":["none",isNumber,isArbitraryNumber]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",isLength,isArbitraryValue]}],"list-image":[{"list-image":["none",isArbitraryValue]}],"list-style-type":[{list:["none","disc","decimal",isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[et]}],"placeholder-opacity":[{"placeholder-opacity":[gt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[et]}],"text-opacity":[{"text-opacity":[gt]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Xt(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",isLength,isArbitraryLength]}],"underline-offset":[{"underline-offset":["auto",isLength,isArbitraryValue]}],"text-decoration-color":[{decoration:[et]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Lt()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryValue]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[gt]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...Ut(),isArbitraryPosition]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",isArbitrarySize]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},isArbitraryImage]}],"bg-color":[{bg:[et]}],"gradient-from-pos":[{from:[ft]}],"gradient-via-pos":[{via:[ft]}],"gradient-to-pos":[{to:[ft]}],"gradient-from":[{from:[mt]}],"gradient-via":[{via:[mt]}],"gradient-to":[{to:[mt]}],rounded:[{rounded:[ot]}],"rounded-s":[{"rounded-s":[ot]}],"rounded-e":[{"rounded-e":[ot]}],"rounded-t":[{"rounded-t":[ot]}],"rounded-r":[{"rounded-r":[ot]}],"rounded-b":[{"rounded-b":[ot]}],"rounded-l":[{"rounded-l":[ot]}],"rounded-ss":[{"rounded-ss":[ot]}],"rounded-se":[{"rounded-se":[ot]}],"rounded-ee":[{"rounded-ee":[ot]}],"rounded-es":[{"rounded-es":[ot]}],"rounded-tl":[{"rounded-tl":[ot]}],"rounded-tr":[{"rounded-tr":[ot]}],"rounded-br":[{"rounded-br":[ot]}],"rounded-bl":[{"rounded-bl":[ot]}],"border-w":[{border:[st]}],"border-w-x":[{"border-x":[st]}],"border-w-y":[{"border-y":[st]}],"border-w-s":[{"border-s":[st]}],"border-w-e":[{"border-e":[st]}],"border-w-t":[{"border-t":[st]}],"border-w-r":[{"border-r":[st]}],"border-w-b":[{"border-b":[st]}],"border-w-l":[{"border-l":[st]}],"border-opacity":[{"border-opacity":[gt]}],"border-style":[{border:[...Xt(),"hidden"]}],"divide-x":[{"divide-x":[st]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[st]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[gt]}],"divide-style":[{divide:Xt()}],"border-color":[{border:[nt]}],"border-color-x":[{"border-x":[nt]}],"border-color-y":[{"border-y":[nt]}],"border-color-s":[{"border-s":[nt]}],"border-color-e":[{"border-e":[nt]}],"border-color-t":[{"border-t":[nt]}],"border-color-r":[{"border-r":[nt]}],"border-color-b":[{"border-b":[nt]}],"border-color-l":[{"border-l":[nt]}],"divide-color":[{divide:[nt]}],"outline-style":[{outline:["",...Xt()]}],"outline-offset":[{"outline-offset":[isLength,isArbitraryValue]}],"outline-w":[{outline:[isLength,isArbitraryLength]}],"outline-color":[{outline:[et]}],"ring-w":[{ring:Mt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[et]}],"ring-opacity":[{"ring-opacity":[gt]}],"ring-offset-w":[{"ring-offset":[isLength,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":[et]}],shadow:[{shadow:["","inner","none",isTshirtSize,isArbitraryShadow]}],"shadow-color":[{shadow:[isAny]}],opacity:[{opacity:[gt]}],"mix-blend":[{"mix-blend":[...Wt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Wt()}],filter:[{filter:["","none"]}],blur:[{blur:[tt]}],brightness:[{brightness:[rt]}],contrast:[{contrast:[at]}],"drop-shadow":[{"drop-shadow":["","none",isTshirtSize,isArbitraryValue]}],grayscale:[{grayscale:[ct]}],"hue-rotate":[{"hue-rotate":[lt]}],invert:[{invert:[dt]}],saturate:[{saturate:[xt]}],sepia:[{sepia:[Et]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[tt]}],"backdrop-brightness":[{"backdrop-brightness":[rt]}],"backdrop-contrast":[{"backdrop-contrast":[at]}],"backdrop-grayscale":[{"backdrop-grayscale":[ct]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[lt]}],"backdrop-invert":[{"backdrop-invert":[dt]}],"backdrop-opacity":[{"backdrop-opacity":[gt]}],"backdrop-saturate":[{"backdrop-saturate":[xt]}],"backdrop-sepia":[{"backdrop-sepia":[Et]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[it]}],"border-spacing-x":[{"border-spacing-x":[it]}],"border-spacing-y":[{"border-spacing-y":[it]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",isArbitraryValue]}],duration:[{duration:Yt()}],ease:[{ease:["linear","in","out","in-out",isArbitraryValue]}],delay:[{delay:Yt()}],animate:[{animate:["none","spin","ping","pulse","bounce",isArbitraryValue]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[vt]}],"scale-x":[{"scale-x":[vt]}],"scale-y":[{"scale-y":[vt]}],rotate:[{rotate:[isInteger$1,isArbitraryValue]}],"translate-x":[{"translate-x":[At]}],"translate-y":[{"translate-y":[At]}],"skew-x":[{"skew-x":[Ct]}],"skew-y":[{"skew-y":[Ct]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",isArbitraryValue]}],accent:[{accent:["auto",et]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",isArbitraryValue]}],"caret-color":[{caret:[et]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Lt()}],"scroll-mx":[{"scroll-mx":Lt()}],"scroll-my":[{"scroll-my":Lt()}],"scroll-ms":[{"scroll-ms":Lt()}],"scroll-me":[{"scroll-me":Lt()}],"scroll-mt":[{"scroll-mt":Lt()}],"scroll-mr":[{"scroll-mr":Lt()}],"scroll-mb":[{"scroll-mb":Lt()}],"scroll-ml":[{"scroll-ml":Lt()}],"scroll-p":[{"scroll-p":Lt()}],"scroll-px":[{"scroll-px":Lt()}],"scroll-py":[{"scroll-py":Lt()}],"scroll-ps":[{"scroll-ps":Lt()}],"scroll-pe":[{"scroll-pe":Lt()}],"scroll-pt":[{"scroll-pt":Lt()}],"scroll-pr":[{"scroll-pr":Lt()}],"scroll-pb":[{"scroll-pb":Lt()}],"scroll-pl":[{"scroll-pl":Lt()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",isArbitraryValue]}],fill:[{fill:[et,"none"]}],"stroke-w":[{stroke:[isLength,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:[et,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},twMerge=createTailwindMerge(getDefaultConfig);function cn(...et){return twMerge(clsx(et))}const buttonVariants=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Button=reactExports.forwardRef(({className:et,variant:o,size:tt,asChild:rt=!1,...nt},ot)=>{const it=rt?Slot:"button";return jsxRuntimeExports.jsx(it,{className:cn("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50","min-h-[44px] px-4 py-2 md:min-h-[36px] md:px-3 md:py-1.5",buttonVariants({variant:o,size:tt,className:et})),ref:ot,...nt})});Button.displayName="Button";function allocUnsafe$j(et=0){return new Uint8Array(et)}const N1$6=Math.pow(2,7),N2$6=Math.pow(2,14),N3$6=Math.pow(2,21),N4$6=Math.pow(2,28),N5$6=Math.pow(2,35),N6$6=Math.pow(2,42),N7$6=Math.pow(2,49),MSB$8=128,REST$8=127;function encodingLength$6(et){if(etNumber.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return 8}function encodeUint8Array(et,o,tt=0){switch(encodingLength$6(et)){case 8:o[tt++]=et&255|MSB$8,et/=128;case 7:o[tt++]=et&255|MSB$8,et/=128;case 6:o[tt++]=et&255|MSB$8,et/=128;case 5:o[tt++]=et&255|MSB$8,et/=128;case 4:o[tt++]=et&255|MSB$8,et>>>=7;case 3:o[tt++]=et&255|MSB$8,et>>>=7;case 2:o[tt++]=et&255|MSB$8,et>>>=7;case 1:{o[tt++]=et&255,et>>>=7;break}default:throw new Error("unreachable")}return o}function encodeUint8ArrayList(et,o,tt=0){switch(encodingLength$6(et)){case 8:o.set(tt++,et&255|MSB$8),et/=128;case 7:o.set(tt++,et&255|MSB$8),et/=128;case 6:o.set(tt++,et&255|MSB$8),et/=128;case 5:o.set(tt++,et&255|MSB$8),et/=128;case 4:o.set(tt++,et&255|MSB$8),et>>>=7;case 3:o.set(tt++,et&255|MSB$8),et>>>=7;case 2:o.set(tt++,et&255|MSB$8),et>>>=7;case 1:{o.set(tt++,et&255),et>>>=7;break}default:throw new Error("unreachable")}return o}function decodeUint8Array(et,o){let tt=et[o],rt=0;if(rt+=tt&REST$8,tt>>31>0){const tt=~this.lo+1>>>0;let rt=~this.hi>>>0;return tt===0&&(rt=rt+1>>>0),-(tt+rt*4294967296)}return this.lo+this.hi*4294967296}toBigInt(o=!1){if(o)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31){const tt=~this.lo+1>>>0;let rt=~this.hi>>>0;return tt===0&&(rt=rt+1>>>0),-(BigInt(tt)+(BigInt(rt)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}toString(o=!1){return this.toBigInt(o).toString()}zzEncode(){const o=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^o)>>>0,this.lo=(this.lo<<1^o)>>>0,this}zzDecode(){const o=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^o)>>>0,this.hi=(this.hi>>>1^o)>>>0,this}length(){const o=this.lo,tt=(this.lo>>>28|this.hi<<4)>>>0,rt=this.hi>>>24;return rt===0?tt===0?o<16384?o<128?1:2:o<2097152?3:4:tt<16384?tt<128?5:6:tt<2097152?7:8:rt<128?9:10}static fromBigInt(o){if(o===0n)return zero;if(oMIN_SAFE_NUMBER_INTEGER)return this.fromNumber(Number(o));const tt=o<0n;tt&&(o=-o);let rt=o>>32n,nt=o-(rt<<32n);return tt&&(rt=~rt|0n,nt=~nt|0n,++nt>TWO_32&&(nt=0n,++rt>TWO_32&&(rt=0n))),new Sn(Number(nt),Number(rt))}static fromNumber(o){if(o===0)return zero;const tt=o<0;tt&&(o=-o);let rt=o>>>0,nt=(o-rt)/4294967296>>>0;return tt&&(nt=~nt>>>0,rt=~rt>>>0,++rt>4294967295&&(rt=0,++nt>4294967295&&(nt=0))),new Sn(rt,nt)}static from(o){return typeof o=="number"?Sn.fromNumber(o):typeof o=="bigint"?Sn.fromBigInt(o):typeof o=="string"?Sn.fromBigInt(BigInt(o)):o.low!=null||o.high!=null?new Sn(o.low>>>0,o.high>>>0):zero}};const zero=new LongBits$2(0,0);zero.toBigInt=function(){return 0n};zero.zzEncode=zero.zzDecode=function(){return this};zero.length=function(){return 1};const TWO_32=4294967296n;function length$6(et){let o=0,tt=0;for(let rt=0;rt191&&st<224?ot[it++]=(st&31)<<6|et[o++]&63:st>239&&st<365?(st=((st&7)<<18|(et[o++]&63)<<12|(et[o++]&63)<<6|et[o++]&63)-65536,ot[it++]=55296+(st>>10),ot[it++]=56320+(st&1023)):ot[it++]=(st&15)<<12|(et[o++]&63)<<6|et[o++]&63,it>8191&&((nt??(nt=[])).push(String.fromCharCode.apply(String,ot)),it=0);return nt!=null?(it>0&&nt.push(String.fromCharCode.apply(String,ot.slice(0,it))),nt.join("")):String.fromCharCode.apply(String,ot.slice(0,it))}function write$2(et,o,tt){const rt=tt;let nt,ot;for(let it=0;it>6|192,o[tt++]=nt&63|128):(nt&64512)===55296&&((ot=et.charCodeAt(it+1))&64512)===56320?(nt=65536+((nt&1023)<<10)+(ot&1023),++it,o[tt++]=nt>>18|240,o[tt++]=nt>>12&63|128,o[tt++]=nt>>6&63|128,o[tt++]=nt&63|128):(o[tt++]=nt>>12|224,o[tt++]=nt>>6&63|128,o[tt++]=nt&63|128);return tt-rt}function indexOutOfRange$1(et,o){return RangeError(`index out of range: ${et.pos} + ${o??1} > ${et.len}`)}function readFixed32End(et,o){return(et[o-4]|et[o-3]<<8|et[o-2]<<16|et[o-1]<<24)>>>0}class Uint8ArrayReader{constructor(o){wt(this,"buf");wt(this,"pos");wt(this,"len");wt(this,"_slice",Uint8Array.prototype.subarray);this.buf=o,this.pos=0,this.len=o.length}uint32(){let o=4294967295;if(o=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(o=(o|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return o;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange$1(this,10);return o}int32(){return this.uint32()|0}sint32(){const o=this.uint32();return o>>>1^-(o&1)|0}bool(){return this.uint32()!==0}fixed32(){if(this.pos+4>this.len)throw indexOutOfRange$1(this,4);return readFixed32End(this.buf,this.pos+=4)}sfixed32(){if(this.pos+4>this.len)throw indexOutOfRange$1(this,4);return readFixed32End(this.buf,this.pos+=4)|0}float(){if(this.pos+4>this.len)throw indexOutOfRange$1(this,4);const o=readFloatLE(this.buf,this.pos);return this.pos+=4,o}double(){if(this.pos+8>this.len)throw indexOutOfRange$1(this,4);const o=readDoubleLE(this.buf,this.pos);return this.pos+=8,o}bytes(){const o=this.uint32(),tt=this.pos,rt=this.pos+o;if(rt>this.len)throw indexOutOfRange$1(this,o);return this.pos+=o,tt===rt?new Uint8Array(0):this.buf.subarray(tt,rt)}string(){const o=this.bytes();return read$7(o,0,o.length)}skip(o){if(typeof o=="number"){if(this.pos+o>this.len)throw indexOutOfRange$1(this,o);this.pos+=o}else do if(this.pos>=this.len)throw indexOutOfRange$1(this);while(this.buf[this.pos++]&128);return this}skipType(o){switch(o){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(o=this.uint32()&7)!==4;)this.skipType(o);break;case 5:this.skip(4);break;default:throw Error(`invalid wire type ${o} at offset ${this.pos}`)}return this}readLongVarint(){const o=new LongBits$2(0,0);let tt=0;if(this.len-this.pos>4){for(;tt<4;++tt)if(o.lo=(o.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o;if(o.lo=(o.lo|(this.buf[this.pos]&127)<<28)>>>0,o.hi=(o.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return o;tt=0}else{for(;tt<3;++tt){if(this.pos>=this.len)throw indexOutOfRange$1(this);if(o.lo=(o.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}return o.lo=(o.lo|(this.buf[this.pos++]&127)<>>0,o}if(this.len-this.pos>4){for(;tt<5;++tt)if(o.hi=(o.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}else for(;tt<5;++tt){if(this.pos>=this.len)throw indexOutOfRange$1(this);if(o.hi=(o.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return o}throw Error("invalid varint encoding")}readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange$1(this,8);const o=readFixed32End(this.buf,this.pos+=4),tt=readFixed32End(this.buf,this.pos+=4);return new LongBits$2(o,tt)}int64(){return this.readLongVarint().toBigInt()}int64Number(){return this.readLongVarint().toNumber()}int64String(){return this.readLongVarint().toString()}uint64(){return this.readLongVarint().toBigInt(!0)}uint64Number(){const o=decodeUint8Array(this.buf,this.pos);return this.pos+=encodingLength$6(o),o}uint64String(){return this.readLongVarint().toString(!0)}sint64(){return this.readLongVarint().zzDecode().toBigInt()}sint64Number(){return this.readLongVarint().zzDecode().toNumber()}sint64String(){return this.readLongVarint().zzDecode().toString()}fixed64(){return this.readFixed64().toBigInt()}fixed64Number(){return this.readFixed64().toNumber()}fixed64String(){return this.readFixed64().toString()}sfixed64(){return this.readFixed64().toBigInt()}sfixed64Number(){return this.readFixed64().toNumber()}sfixed64String(){return this.readFixed64().toString()}}function createReader(et){return new Uint8ArrayReader(et instanceof Uint8Array?et:et.subarray())}function decodeMessage(et,o,tt){const rt=createReader(et);return o.decode(rt,void 0,tt)}function allocUnsafe$i(et=0){return new Uint8Array(et)}function coerce$k(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$w(et){return new TextEncoder().encode(et)}function toString$x(et){return new TextDecoder().decode(et)}function base$l(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$l=base$l,_brrp__multiformats_scope_baseX$k=src$l;let Encoder$m=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$m=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$m(this,o)}},ComposedDecoder$k=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$m(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$m(et,o){return new ComposedDecoder$k({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$k=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$m(o,tt,rt),this.decoder=new Decoder$m(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$n({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$k(et,o,tt,rt)}function baseX$k({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$k(tt,et);return from$n({prefix:o,name:et,encode:rt,decode:ot=>coerce$k(nt(ot))})}function decode$Y(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$O(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$g=alphabet$g.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$N(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$g[tt],o),"")}function decode$X(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$g[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$w=from$n({prefix:"🚀",name:"base256emoji",encode:encode$N,decode:decode$X}),base256emoji$x=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$w},Symbol.toStringTag,{value:"Module"})),base32$A=rfc4648$j({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$g=rfc4648$j({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$g=rfc4648$j({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$g=rfc4648$j({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$g=rfc4648$j({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$g=rfc4648$j({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$g=rfc4648$j({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$g=rfc4648$j({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$g=rfc4648$j({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$B=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$A,base32hex:base32hex$g,base32hexpad:base32hexpad$g,base32hexpadupper:base32hexpadupper$g,base32hexupper:base32hexupper$g,base32pad:base32pad$g,base32padupper:base32padupper$g,base32upper:base32upper$g,base32z:base32z$g},Symbol.toStringTag,{value:"Module"})),base36$x=baseX$k({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$g=baseX$k({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$y=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$x,base36upper:base36upper$g},Symbol.toStringTag,{value:"Module"})),base58btc$k=baseX$k({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$g=baseX$k({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$g=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$k,base58flickr:base58flickr$g},Symbol.toStringTag,{value:"Module"})),base64$z=rfc4648$j({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$g=rfc4648$j({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$h=rfc4648$j({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$g=rfc4648$j({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$A=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$z,base64pad:base64pad$g,base64url:base64url$h,base64urlpad:base64urlpad$g},Symbol.toStringTag,{value:"Module"})),base8$w=rfc4648$j({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$x=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$w},Symbol.toStringTag,{value:"Module"})),identity$i=from$n({prefix:"\0",name:"identity",encode:et=>toString$x(et),decode:et=>fromString$w(et)}),identityBase$g=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$i},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$g={...identityBase$g,...base2$x,...base8$x,...base10$x,...base16$x,...base32$B,...base36$y,...base58$g,...base64$A,...base256emoji$x};function createCodec$h(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$k=createCodec$h("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$g=createCodec$h("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$i(et.length);for(let tt=0;tt4096)return allocUnsafe$i(it);nt+it>8192&&(rt=allocUnsafe$i(8192),nt=0);const st=rt.subarray(nt,nt+=it);return nt&7&&(nt=(nt|7)+1),st}}let Op$1=class{constructor(o,tt,rt){wt(this,"fn");wt(this,"len");wt(this,"next");wt(this,"val");this.fn=o,this.len=tt,this.next=void 0,this.val=rt}};function noop$2(){}let State$1=class{constructor(o){wt(this,"head");wt(this,"tail");wt(this,"len");wt(this,"next");this.head=o.head,this.tail=o.tail,this.len=o.len,this.next=o.states}};const bufferPool=pool$1();function alloc$7(et){return globalThis.Buffer!=null?allocUnsafe$i(et):bufferPool(et)}class Uint8ArrayWriter{constructor(){wt(this,"len");wt(this,"head");wt(this,"tail");wt(this,"states");this.len=0,this.head=new Op$1(noop$2,0,0),this.tail=this.head,this.states=null}_push(o,tt,rt){return this.tail=this.tail.next=new Op$1(o,tt,rt),this.len+=tt,this}uint32(o){return this.len+=(this.tail=this.tail.next=new VarintOp$1((o=o>>>0)<128?1:o<16384?2:o<2097152?3:o<268435456?4:5,o)).len,this}int32(o){return o<0?this._push(writeVarint64$1,10,LongBits$2.fromNumber(o)):this.uint32(o)}sint32(o){return this.uint32((o<<1^o>>31)>>>0)}uint64(o){const tt=LongBits$2.fromBigInt(o);return this._push(writeVarint64$1,tt.length(),tt)}uint64Number(o){return this._push(encodeUint8Array,encodingLength$6(o),o)}uint64String(o){return this.uint64(BigInt(o))}int64(o){return this.uint64(o)}int64Number(o){return this.uint64Number(o)}int64String(o){return this.uint64String(o)}sint64(o){const tt=LongBits$2.fromBigInt(o).zzEncode();return this._push(writeVarint64$1,tt.length(),tt)}sint64Number(o){const tt=LongBits$2.fromNumber(o).zzEncode();return this._push(writeVarint64$1,tt.length(),tt)}sint64String(o){return this.sint64(BigInt(o))}bool(o){return this._push(writeByte$1,1,o?1:0)}fixed32(o){return this._push(writeFixed32$1,4,o>>>0)}sfixed32(o){return this.fixed32(o)}fixed64(o){const tt=LongBits$2.fromBigInt(o);return this._push(writeFixed32$1,4,tt.lo)._push(writeFixed32$1,4,tt.hi)}fixed64Number(o){const tt=LongBits$2.fromNumber(o);return this._push(writeFixed32$1,4,tt.lo)._push(writeFixed32$1,4,tt.hi)}fixed64String(o){return this.fixed64(BigInt(o))}sfixed64(o){return this.fixed64(o)}sfixed64Number(o){return this.fixed64Number(o)}sfixed64String(o){return this.fixed64String(o)}float(o){return this._push(writeFloatLE,4,o)}double(o){return this._push(writeDoubleLE,8,o)}bytes(o){const tt=o.length>>>0;return tt===0?this._push(writeByte$1,1,0):this.uint32(tt)._push(writeBytes$1,tt,o)}string(o){const tt=length$6(o);return tt!==0?this.uint32(tt)._push(write$2,tt,o):this._push(writeByte$1,1,0)}fork(){return this.states=new State$1(this),this.head=this.tail=new Op$1(noop$2,0,0),this.len=0,this}reset(){return this.states!=null?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op$1(noop$2,0,0),this.len=0),this}ldelim(){const o=this.head,tt=this.tail,rt=this.len;return this.reset().uint32(rt),rt!==0&&(this.tail.next=o.next,this.tail=tt,this.len+=rt),this}finish(){let o=this.head.next;const tt=alloc$7(this.len);let rt=0;for(;o!=null;)o.fn(o.val,tt,rt),rt+=o.len,o=o.next;return tt}}function writeByte$1(et,o,tt){o[tt]=et&255}function writeVarint32$1(et,o,tt){for(;et>127;)o[tt++]=et&127|128,et>>>=7;o[tt]=et}let VarintOp$1=class extends Op$1{constructor(tt,rt){super(writeVarint32$1,tt,rt);wt(this,"next");this.next=void 0}};function writeVarint64$1(et,o,tt){for(;et.hi!==0;)o[tt++]=et.lo&127|128,et.lo=(et.lo>>>7|et.hi<<25)>>>0,et.hi>>>=7;for(;et.lo>127;)o[tt++]=et.lo&127|128,et.lo=et.lo>>>7;o[tt++]=et.lo}function writeFixed32$1(et,o,tt){o[tt]=et&255,o[tt+1]=et>>>8&255,o[tt+2]=et>>>16&255,o[tt+3]=et>>>24}function writeBytes$1(et,o,tt){o.set(et,tt)}globalThis.Buffer!=null&&(Uint8ArrayWriter.prototype.bytes=function(et){const o=et.length>>>0;return this.uint32(o),o>0&&this._push(writeBytesBuffer,o,et),this},Uint8ArrayWriter.prototype.string=function(et){const o=globalThis.Buffer.byteLength(et);return this.uint32(o),o>0&&this._push(writeStringBuffer$1,o,et),this});function writeBytesBuffer(et,o,tt){o.set(et,tt)}function writeStringBuffer$1(et,o,tt){et.length<40?write$2(et,o,tt):o.utf8Write!=null?o.utf8Write(et,tt):o.set(fromString$v(et),tt)}function createWriter(){return new Uint8ArrayWriter}function encodeMessage(et,o){const tt=createWriter();return o.encode(et,tt,{lengthDelimited:!1}),tt.finish()}var CODEC_TYPES;(function(et){et[et.VARINT=0]="VARINT",et[et.BIT64=1]="BIT64",et[et.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",et[et.START_GROUP=3]="START_GROUP",et[et.END_GROUP=4]="END_GROUP",et[et.BIT32=5]="BIT32"})(CODEC_TYPES||(CODEC_TYPES={}));function createCodec$g(et,o,tt,rt){return{name:et,type:o,encode:tt,decode:rt}}function enumeration(et){function o(nt){if(et[nt.toString()]==null)throw new Error("Invalid enum value");return et[nt]}const tt=function(ot,it){const st=o(ot);it.int32(st)},rt=function(ot){const it=ot.int32();return o(it)};return createCodec$g("enum",CODEC_TYPES.VARINT,tt,rt)}function message$1(et,o){return createCodec$g("message",CODEC_TYPES.LENGTH_DELIMITED,et,o)}class MaxLengthError extends Error{constructor(){super(...arguments);wt(this,"code","ERR_MAX_LENGTH");wt(this,"name","MaxLengthError")}}class MaxSizeError extends Error{constructor(){super(...arguments);wt(this,"code","ERR_MAX_SIZE");wt(this,"name","MaxSizeError")}}function alloc$6(et=0){return globalThis.Buffer!=null&&globalThis.Buffer.alloc!=null?globalThis.Buffer.alloc(et):new Uint8Array(et)}function allocUnsafe$h(et=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(et):new Uint8Array(et)}var RateLimitProof$4;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(rt.uint32(10),rt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(rt.uint32(18),rt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(rt.uint32(26),rt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(rt.uint32(34),rt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(rt.uint32(42),rt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(rt.uint32(50),rt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(rt.uint32(58),rt.bytes(tt.rlnIdentifier)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={proof:alloc$6(0),merkleRoot:alloc$6(0),epoch:alloc$6(0),shareX:alloc$6(0),shareY:alloc$6(0),nullifier:alloc$6(0),rlnIdentifier:alloc$6(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(RateLimitProof$4||(RateLimitProof$4={}));var WakuMessage$4;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(10),rt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),tt.version!=null&&(rt.uint32(24),rt.uint32(tt.version)),tt.timestamp!=null&&(rt.uint32(80),rt.sint64(tt.timestamp)),tt.meta!=null&&(rt.uint32(90),rt.bytes(tt.meta)),tt.rateLimitProof!=null&&(rt.uint32(170),RateLimitProof$4.codec().encode(tt.rateLimitProof,rt)),tt.ephemeral!=null&&(rt.uint32(248),rt.bool(tt.ephemeral)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={payload:alloc$6(0),contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$4.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessage$4||(WakuMessage$4={}));var FilterRequest;(function(et){(function(tt){let rt;tt.codec=()=>(rt==null&&(rt=message$1((nt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),nt.contentTopic!=null&&nt.contentTopic!==""&&(ot.uint32(10),ot.string(nt.contentTopic)),it.lengthDelimited!==!1&&ot.ldelim()},(nt,ot,it={})=>{const st={contentTopic:""},at=ot==null?nt.len:nt.pos+ot;for(;nt.pos>>3){case 1:{st.contentTopic=nt.string();break}default:{nt.skipType(ct&7);break}}}return st})),rt),tt.encode=nt=>encodeMessage(nt,tt.codec()),tt.decode=(nt,ot)=>decodeMessage(nt,tt.codec(),ot)})(et.ContentFilter||(et.ContentFilter={}));let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.subscribe!=null&&tt.subscribe!==!1&&(rt.uint32(8),rt.bool(tt.subscribe)),tt.topic!=null&&tt.topic!==""&&(rt.uint32(18),rt.string(tt.topic)),tt.contentFilters!=null)for(const ot of tt.contentFilters)rt.uint32(26),et.ContentFilter.codec().encode(ot,rt);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={subscribe:!1,topic:"",contentFilters:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.subscribe=tt.bool();break}case 2:{ot.topic=tt.string();break}case 3:{if(((st=nt.limits)==null?void 0:st.contentFilters)!=null&&ot.contentFilters.length===nt.limits.contentFilters)throw new MaxLengthError('Decode error - map field "contentFilters" had too many elements');ot.contentFilters.push(et.ContentFilter.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.contentFilters$}));break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(FilterRequest||(FilterRequest={}));var MessagePush$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.messages!=null)for(const ot of tt.messages)rt.uint32(10),WakuMessage$3.codec().encode(ot,rt);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={messages:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{if(((st=nt.limits)==null?void 0:st.messages)!=null&&ot.messages.length===nt.limits.messages)throw new MaxLengthError('Decode error - map field "messages" had too many elements');ot.messages.push(WakuMessage$3.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.messages$}));break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(MessagePush$1||(MessagePush$1={}));var FilterRpc;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.requestId!=null&&tt.requestId!==""&&(rt.uint32(10),rt.string(tt.requestId)),tt.request!=null&&(rt.uint32(18),FilterRequest.codec().encode(tt.request,rt)),tt.push!=null&&(rt.uint32(26),MessagePush$1.codec().encode(tt.push,rt)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={requestId:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.requestId=tt.string();break}case 2:{ot.request=FilterRequest.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.request});break}case 3:{ot.push=MessagePush$1.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.push});break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(FilterRpc||(FilterRpc={}));var RateLimitProof$3;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(rt.uint32(10),rt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(rt.uint32(18),rt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(rt.uint32(26),rt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(rt.uint32(34),rt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(rt.uint32(42),rt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(rt.uint32(50),rt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(rt.uint32(58),rt.bytes(tt.rlnIdentifier)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={proof:alloc$6(0),merkleRoot:alloc$6(0),epoch:alloc$6(0),shareX:alloc$6(0),shareY:alloc$6(0),nullifier:alloc$6(0),rlnIdentifier:alloc$6(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(RateLimitProof$3||(RateLimitProof$3={}));var WakuMessage$3;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(10),rt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),tt.version!=null&&(rt.uint32(24),rt.uint32(tt.version)),tt.timestamp!=null&&(rt.uint32(80),rt.sint64(tt.timestamp)),tt.meta!=null&&(rt.uint32(90),rt.bytes(tt.meta)),tt.rateLimitProof!=null&&(rt.uint32(170),RateLimitProof$3.codec().encode(tt.rateLimitProof,rt)),tt.ephemeral!=null&&(rt.uint32(248),rt.bool(tt.ephemeral)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={payload:alloc$6(0),contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$3.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessage$3||(WakuMessage$3={}));var TopicOnlyMessage;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 2:{ot.contentTopic=tt.string();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(TopicOnlyMessage||(TopicOnlyMessage={}));var FilterSubscribeRequest;(function(et){let o;(function(nt){nt.SUBSCRIBER_PING="SUBSCRIBER_PING",nt.SUBSCRIBE="SUBSCRIBE",nt.UNSUBSCRIBE="UNSUBSCRIBE",nt.UNSUBSCRIBE_ALL="UNSUBSCRIBE_ALL"})(o=et.FilterSubscribeType||(et.FilterSubscribeType={}));let tt;(function(nt){nt[nt.SUBSCRIBER_PING=0]="SUBSCRIBER_PING",nt[nt.SUBSCRIBE=1]="SUBSCRIBE",nt[nt.UNSUBSCRIBE=2]="UNSUBSCRIBE",nt[nt.UNSUBSCRIBE_ALL=3]="UNSUBSCRIBE_ALL"})(tt||(tt={})),function(nt){nt.codec=()=>enumeration(tt)}(o=et.FilterSubscribeType||(et.FilterSubscribeType={}));let rt;et.codec=()=>(rt==null&&(rt=message$1((nt,ot,it={})=>{if(it.lengthDelimited!==!1&&ot.fork(),nt.requestId!=null&&nt.requestId!==""&&(ot.uint32(10),ot.string(nt.requestId)),nt.filterSubscribeType!=null&&tt[nt.filterSubscribeType]!==0&&(ot.uint32(16),et.FilterSubscribeType.codec().encode(nt.filterSubscribeType,ot)),nt.pubsubTopic!=null&&(ot.uint32(82),ot.string(nt.pubsubTopic)),nt.contentTopics!=null)for(const st of nt.contentTopics)ot.uint32(90),ot.string(st);it.lengthDelimited!==!1&&ot.ldelim()},(nt,ot,it={})=>{var ct;const st={requestId:"",filterSubscribeType:o.SUBSCRIBER_PING,contentTopics:[]},at=ot==null?nt.len:nt.pos+ot;for(;nt.pos>>3){case 1:{st.requestId=nt.string();break}case 2:{st.filterSubscribeType=et.FilterSubscribeType.codec().decode(nt);break}case 10:{st.pubsubTopic=nt.string();break}case 11:{if(((ct=it.limits)==null?void 0:ct.contentTopics)!=null&&st.contentTopics.length===it.limits.contentTopics)throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');st.contentTopics.push(nt.string());break}default:{nt.skipType(lt&7);break}}}return st})),rt),et.encode=nt=>encodeMessage(nt,et.codec()),et.decode=(nt,ot)=>decodeMessage(nt,et.codec(),ot)})(FilterSubscribeRequest||(FilterSubscribeRequest={}));var FilterSubscribeResponse$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.requestId!=null&&tt.requestId!==""&&(rt.uint32(10),rt.string(tt.requestId)),tt.statusCode!=null&&tt.statusCode!==0&&(rt.uint32(80),rt.uint32(tt.statusCode)),tt.statusDesc!=null&&(rt.uint32(90),rt.string(tt.statusDesc)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={requestId:"",statusCode:0},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.requestId=tt.string();break}case 10:{ot.statusCode=tt.uint32();break}case 11:{ot.statusDesc=tt.string();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(FilterSubscribeResponse$1||(FilterSubscribeResponse$1={}));var MessagePush;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.wakuMessage!=null&&(rt.uint32(10),WakuMessage$2.codec().encode(tt.wakuMessage,rt)),tt.pubsubTopic!=null&&(rt.uint32(18),rt.string(tt.pubsubTopic)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.wakuMessage=WakuMessage$2.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.wakuMessage});break}case 2:{ot.pubsubTopic=tt.string();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(MessagePush||(MessagePush={}));var RateLimitProof$2;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(rt.uint32(10),rt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(rt.uint32(18),rt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(rt.uint32(26),rt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(rt.uint32(34),rt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(rt.uint32(42),rt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(rt.uint32(50),rt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(rt.uint32(58),rt.bytes(tt.rlnIdentifier)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={proof:alloc$6(0),merkleRoot:alloc$6(0),epoch:alloc$6(0),shareX:alloc$6(0),shareY:alloc$6(0),nullifier:alloc$6(0),rlnIdentifier:alloc$6(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(RateLimitProof$2||(RateLimitProof$2={}));var WakuMessage$2;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(10),rt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),tt.version!=null&&(rt.uint32(24),rt.uint32(tt.version)),tt.timestamp!=null&&(rt.uint32(80),rt.sint64(tt.timestamp)),tt.meta!=null&&(rt.uint32(90),rt.bytes(tt.meta)),tt.rateLimitProof!=null&&(rt.uint32(170),RateLimitProof$2.codec().encode(tt.rateLimitProof,rt)),tt.ephemeral!=null&&(rt.uint32(248),rt.bool(tt.ephemeral)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={payload:alloc$6(0),contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$2.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessage$2||(WakuMessage$2={}));var PushRequest;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.pubsubTopic!=null&&tt.pubsubTopic!==""&&(rt.uint32(10),rt.string(tt.pubsubTopic)),tt.message!=null&&(rt.uint32(18),WakuMessage$1.codec().encode(tt.message,rt)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={pubsubTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.pubsubTopic=tt.string();break}case 2:{ot.message=WakuMessage$1.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.message});break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PushRequest||(PushRequest={}));var PushResponse;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.isSuccess!=null&&tt.isSuccess!==!1&&(rt.uint32(8),rt.bool(tt.isSuccess)),tt.info!=null&&(rt.uint32(18),rt.string(tt.info)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={isSuccess:!1},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.isSuccess=tt.bool();break}case 2:{ot.info=tt.string();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PushResponse||(PushResponse={}));var PushRpc$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.requestId!=null&&tt.requestId!==""&&(rt.uint32(10),rt.string(tt.requestId)),tt.request!=null&&(rt.uint32(18),PushRequest.codec().encode(tt.request,rt)),tt.response!=null&&(rt.uint32(26),PushResponse.codec().encode(tt.response,rt)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={requestId:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.requestId=tt.string();break}case 2:{ot.request=PushRequest.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.request});break}case 3:{ot.response=PushResponse.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.response});break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PushRpc$1||(PushRpc$1={}));var RateLimitProof$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(rt.uint32(10),rt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(rt.uint32(18),rt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(rt.uint32(26),rt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(rt.uint32(34),rt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(rt.uint32(42),rt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(rt.uint32(50),rt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(rt.uint32(58),rt.bytes(tt.rlnIdentifier)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={proof:alloc$6(0),merkleRoot:alloc$6(0),epoch:alloc$6(0),shareX:alloc$6(0),shareY:alloc$6(0),nullifier:alloc$6(0),rlnIdentifier:alloc$6(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(RateLimitProof$1||(RateLimitProof$1={}));var WakuMessage$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(10),rt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),tt.version!=null&&(rt.uint32(24),rt.uint32(tt.version)),tt.timestamp!=null&&(rt.uint32(80),rt.sint64(tt.timestamp)),tt.meta!=null&&(rt.uint32(90),rt.bytes(tt.meta)),tt.rateLimitProof!=null&&(rt.uint32(170),RateLimitProof$1.codec().encode(tt.rateLimitProof,rt)),tt.ephemeral!=null&&(rt.uint32(248),rt.bool(tt.ephemeral)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={payload:alloc$6(0),contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof$1.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessage$1||(WakuMessage$1={}));var WakuMessageKeyValue;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.messageHash!=null&&(rt.uint32(10),rt.bytes(tt.messageHash)),tt.message!=null&&(rt.uint32(18),WakuMessage.codec().encode(tt.message,rt)),tt.pubsubTopic!=null&&(rt.uint32(26),rt.string(tt.pubsubTopic)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.messageHash=tt.bytes();break}case 2:{ot.message=WakuMessage.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.message});break}case 3:{ot.pubsubTopic=tt.string();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessageKeyValue||(WakuMessageKeyValue={}));var StoreQueryRequest$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.requestId!=null&&tt.requestId!==""&&(rt.uint32(10),rt.string(tt.requestId)),tt.includeData!=null&&tt.includeData!==!1&&(rt.uint32(16),rt.bool(tt.includeData)),tt.pubsubTopic!=null&&(rt.uint32(82),rt.string(tt.pubsubTopic)),tt.contentTopics!=null)for(const ot of tt.contentTopics)rt.uint32(90),rt.string(ot);if(tt.timeStart!=null&&(rt.uint32(96),rt.sint64(tt.timeStart)),tt.timeEnd!=null&&(rt.uint32(104),rt.sint64(tt.timeEnd)),tt.messageHashes!=null)for(const ot of tt.messageHashes)rt.uint32(162),rt.bytes(ot);tt.paginationCursor!=null&&(rt.uint32(410),rt.bytes(tt.paginationCursor)),tt.paginationForward!=null&&tt.paginationForward!==!1&&(rt.uint32(416),rt.bool(tt.paginationForward)),tt.paginationLimit!=null&&(rt.uint32(424),rt.uint64(tt.paginationLimit)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={requestId:"",includeData:!1,contentTopics:[],messageHashes:[],paginationForward:!1},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.requestId=tt.string();break}case 2:{ot.includeData=tt.bool();break}case 10:{ot.pubsubTopic=tt.string();break}case 11:{if(((st=nt.limits)==null?void 0:st.contentTopics)!=null&&ot.contentTopics.length===nt.limits.contentTopics)throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');ot.contentTopics.push(tt.string());break}case 12:{ot.timeStart=tt.sint64();break}case 13:{ot.timeEnd=tt.sint64();break}case 20:{if(((at=nt.limits)==null?void 0:at.messageHashes)!=null&&ot.messageHashes.length===nt.limits.messageHashes)throw new MaxLengthError('Decode error - map field "messageHashes" had too many elements');ot.messageHashes.push(tt.bytes());break}case 51:{ot.paginationCursor=tt.bytes();break}case 52:{ot.paginationForward=tt.bool();break}case 53:{ot.paginationLimit=tt.uint64();break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(StoreQueryRequest$1||(StoreQueryRequest$1={}));var StoreQueryResponse$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.requestId!=null&&tt.requestId!==""&&(rt.uint32(10),rt.string(tt.requestId)),tt.statusCode!=null&&(rt.uint32(80),rt.uint32(tt.statusCode)),tt.statusDesc!=null&&(rt.uint32(90),rt.string(tt.statusDesc)),tt.messages!=null)for(const ot of tt.messages)rt.uint32(162),WakuMessageKeyValue.codec().encode(ot,rt);tt.paginationCursor!=null&&(rt.uint32(410),rt.bytes(tt.paginationCursor)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={requestId:"",messages:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.requestId=tt.string();break}case 10:{ot.statusCode=tt.uint32();break}case 11:{ot.statusDesc=tt.string();break}case 20:{if(((st=nt.limits)==null?void 0:st.messages)!=null&&ot.messages.length===nt.limits.messages)throw new MaxLengthError('Decode error - map field "messages" had too many elements');ot.messages.push(WakuMessageKeyValue.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.messages$}));break}case 51:{ot.paginationCursor=tt.bytes();break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(StoreQueryResponse$1||(StoreQueryResponse$1={}));var RateLimitProof;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.proof!=null&&tt.proof.byteLength>0&&(rt.uint32(10),rt.bytes(tt.proof)),tt.merkleRoot!=null&&tt.merkleRoot.byteLength>0&&(rt.uint32(18),rt.bytes(tt.merkleRoot)),tt.epoch!=null&&tt.epoch.byteLength>0&&(rt.uint32(26),rt.bytes(tt.epoch)),tt.shareX!=null&&tt.shareX.byteLength>0&&(rt.uint32(34),rt.bytes(tt.shareX)),tt.shareY!=null&&tt.shareY.byteLength>0&&(rt.uint32(42),rt.bytes(tt.shareY)),tt.nullifier!=null&&tt.nullifier.byteLength>0&&(rt.uint32(50),rt.bytes(tt.nullifier)),tt.rlnIdentifier!=null&&tt.rlnIdentifier.byteLength>0&&(rt.uint32(58),rt.bytes(tt.rlnIdentifier)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={proof:alloc$6(0),merkleRoot:alloc$6(0),epoch:alloc$6(0),shareX:alloc$6(0),shareY:alloc$6(0),nullifier:alloc$6(0),rlnIdentifier:alloc$6(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.proof=tt.bytes();break}case 2:{ot.merkleRoot=tt.bytes();break}case 3:{ot.epoch=tt.bytes();break}case 4:{ot.shareX=tt.bytes();break}case 5:{ot.shareY=tt.bytes();break}case 6:{ot.nullifier=tt.bytes();break}case 7:{ot.rlnIdentifier=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(RateLimitProof||(RateLimitProof={}));var WakuMessage;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(10),rt.bytes(tt.payload)),tt.contentTopic!=null&&tt.contentTopic!==""&&(rt.uint32(18),rt.string(tt.contentTopic)),tt.version!=null&&(rt.uint32(24),rt.uint32(tt.version)),tt.timestamp!=null&&(rt.uint32(80),rt.sint64(tt.timestamp)),tt.meta!=null&&(rt.uint32(90),rt.bytes(tt.meta)),tt.rateLimitProof!=null&&(rt.uint32(170),RateLimitProof.codec().encode(tt.rateLimitProof,rt)),tt.ephemeral!=null&&(rt.uint32(248),rt.bool(tt.ephemeral)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={payload:alloc$6(0),contentTopic:""},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.payload=tt.bytes();break}case 2:{ot.contentTopic=tt.string();break}case 3:{ot.version=tt.uint32();break}case 10:{ot.timestamp=tt.sint64();break}case 11:{ot.meta=tt.bytes();break}case 21:{ot.rateLimitProof=RateLimitProof.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.rateLimitProof});break}case 31:{ot.ephemeral=tt.bool();break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMessage||(WakuMessage={}));var PeerInfo;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.enr!=null&&(rt.uint32(10),rt.bytes(tt.enr)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.enr=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PeerInfo||(PeerInfo={}));var PeerExchangeQuery;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.numPeers!=null&&(rt.uint32(8),rt.uint64(tt.numPeers)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.numPeers=tt.uint64();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PeerExchangeQuery||(PeerExchangeQuery={}));var PeerExchangeResponse;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.peerInfos!=null)for(const ot of tt.peerInfos)rt.uint32(10),PeerInfo.codec().encode(ot,rt);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={peerInfos:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{if(((st=nt.limits)==null?void 0:st.peerInfos)!=null&&ot.peerInfos.length===nt.limits.peerInfos)throw new MaxLengthError('Decode error - map field "peerInfos" had too many elements');ot.peerInfos.push(PeerInfo.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.peerInfos$}));break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PeerExchangeResponse||(PeerExchangeResponse={}));var PeerExchangeRPC$1;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.query!=null&&(rt.uint32(10),PeerExchangeQuery.codec().encode(tt.query,rt)),tt.response!=null&&(rt.uint32(18),PeerExchangeResponse.codec().encode(tt.response,rt)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.query=PeerExchangeQuery.codec().decode(tt,tt.uint32(),{limits:(st=nt.limits)==null?void 0:st.query});break}case 2:{ot.response=PeerExchangeResponse.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.response});break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PeerExchangeRPC$1||(PeerExchangeRPC$1={}));var WakuMetadataRequest;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.clusterId!=null&&(rt.uint32(8),rt.uint32(tt.clusterId)),tt.shards!=null)for(const ot of tt.shards)rt.uint32(16),rt.uint32(ot);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={shards:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.clusterId=tt.uint32();break}case 2:{if(((st=nt.limits)==null?void 0:st.shards)!=null&&ot.shards.length===nt.limits.shards)throw new MaxLengthError('Decode error - map field "shards" had too many elements');ot.shards.push(tt.uint32());break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMetadataRequest||(WakuMetadataRequest={}));var WakuMetadataResponse;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.clusterId!=null&&(rt.uint32(8),rt.uint32(tt.clusterId)),tt.shards!=null)for(const ot of tt.shards)rt.uint32(16),rt.uint32(ot);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st;const ot={shards:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.clusterId=tt.uint32();break}case 2:{if(((st=nt.limits)==null?void 0:st.shards)!=null&&ot.shards.length===nt.limits.shards)throw new MaxLengthError('Decode error - map field "shards" had too many elements');ot.shards.push(tt.uint32());break}default:{tt.skipType(at&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(WakuMetadataResponse||(WakuMetadataResponse={}));function isDefined(et){return!!et}function groupByContentTopic(et){const o=new Map;return et.forEach(tt=>{let rt=o.get(tt.contentTopic);rt||(o.set(tt.contentTopic,[]),rt=o.get(tt.contentTopic)),rt.push(tt)}),o}const FRAME_RATE=60;async function toAsyncIterator(et,o,tt){const rt=FRAME_RATE,nt=[];let ot;ot=await et.subscribeWithUnsubscribe(o,lt=>{nt.push(lt)});const it=Number.isInteger(tt==null?void 0:tt.timeoutMs),st=0,at=Date.now();async function*ct(){for(;;){if(it&&Date.now()-at>=st)return;await wait(rt);const lt=nt.shift();if(!ot&&nt.length===0)return lt;!lt&&ot||(yield lt)}}return{iterator:ct(),async stop(){ot&&(await ot(),ot=void 0)}}}function wait(et){return new Promise(o=>{setTimeout(o,et)})}const MB=1024**2,SIZE_CAP_IN_MB=1;async function isMessageSizeUnderCap(et,o){const tt=await et.toWire(o);return tt?isWireSizeUnderCap(tt):!1}const isWireSizeUnderCap=et=>et.length/MB<=SIZE_CAP_IN_MB;var Protocols;(function(et){et.Relay="relay",et.Store="store",et.LightPush="lightpush",et.Filter="filter"})(Protocols||(Protocols={}));var ProtocolError$1;(function(et){et.GENERIC_FAIL="Generic error",et.ENCODE_FAILED="Failed to encode",et.DECODE_FAILED="Failed to decode",et.EMPTY_PAYLOAD="Payload is empty",et.SIZE_TOO_BIG="Size is too big",et.TOPIC_NOT_CONFIGURED="Topic not configured",et.TOPIC_DECODER_MISMATCH="Topic decoder mismatch",et.INVALID_DECODER_TOPICS="Invalid decoder topics",et.NO_PEER_AVAILABLE="No peer available",et.NO_STREAM_AVAILABLE="No stream available",et.NO_RESPONSE="No response received",et.REMOTE_PEER_REJECTED="Remote peer rejected",et.REQUEST_TIMEOUT="Request timeout",et.RLN_IDENTITY_MISSING="Identity credentials are not set",et.RLN_MEMBERSHIP_INDEX="Membership index is not set",et.RLN_LIMIT_MISSING="User message limit is not set",et.RLN_PROOF_GENERATION="Proof generation failed"})(ProtocolError$1||(ProtocolError$1={}));var Tags;(function(et){et.BOOTSTRAP="bootstrap",et.PEER_EXCHANGE="peer-exchange",et.LOCAL="local-peer-cache"})(Tags||(Tags={}));var EPeersByDiscoveryEvents;(function(et){et.PEER_DISCOVERY_BOOTSTRAP="peer:discovery:bootstrap",et.PEER_DISCOVERY_PEER_EXCHANGE="peer:discovery:peer-exchange",et.PEER_CONNECT_BOOTSTRAP="peer:connected:bootstrap",et.PEER_CONNECT_PEER_EXCHANGE="peer:connected:peer-exchange"})(EPeersByDiscoveryEvents||(EPeersByDiscoveryEvents={}));var EConnectionStateEvents;(function(et){et.CONNECTION_STATUS="waku:connection"})(EConnectionStateEvents||(EConnectionStateEvents={}));const DNS_DISCOVERY_TAG="@waku/bootstrap",DEFAULT_CLUSTER_ID=1,DefaultShardInfo={clusterId:DEFAULT_CLUSTER_ID,shards:[0,1,2,3,4,5,6,7,8]},DefaultNetworkConfig=DefaultShardInfo;var HealthStatus;(function(et){et.Unhealthy="Unhealthy",et.MinimallyHealthy="MinimallyHealthy",et.SufficientlyHealthy="SufficientlyHealthy"})(HealthStatus||(HealthStatus={}));function coerce$j(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$u(et){return new TextEncoder().encode(et)}function toString$w(et){return new TextDecoder().decode(et)}function base$k(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$k=base$k,_brrp__multiformats_scope_baseX$j=src$k;let Encoder$l=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$l=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$l(this,o)}},ComposedDecoder$j=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$l(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$l(et,o){return new ComposedDecoder$j({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$j=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$l(o,tt,rt),this.decoder=new Decoder$l(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$m({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$j(et,o,tt,rt)}function baseX$j({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$j(tt,et);return from$m({prefix:o,name:et,encode:rt,decode:ot=>coerce$j(nt(ot))})}function decode$W(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$M(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$f=alphabet$f.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$L(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$f[tt],o),"")}function decode$V(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$f[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$u=from$m({prefix:"🚀",name:"base256emoji",encode:encode$L,decode:decode$V}),base256emoji$v=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$u},Symbol.toStringTag,{value:"Module"})),base32$y=rfc4648$i({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$f=rfc4648$i({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$f=rfc4648$i({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$f=rfc4648$i({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$f=rfc4648$i({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$f=rfc4648$i({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$f=rfc4648$i({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$f=rfc4648$i({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$f=rfc4648$i({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$z=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$y,base32hex:base32hex$f,base32hexpad:base32hexpad$f,base32hexpadupper:base32hexpadupper$f,base32hexupper:base32hexupper$f,base32pad:base32pad$f,base32padupper:base32padupper$f,base32upper:base32upper$f,base32z:base32z$f},Symbol.toStringTag,{value:"Module"})),base36$v=baseX$j({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$f=baseX$j({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$w=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$v,base36upper:base36upper$f},Symbol.toStringTag,{value:"Module"})),base58btc$j=baseX$j({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$f=baseX$j({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$f=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$j,base58flickr:base58flickr$f},Symbol.toStringTag,{value:"Module"})),base64$x=rfc4648$i({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$f=rfc4648$i({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$g=rfc4648$i({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$f=rfc4648$i({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$y=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$x,base64pad:base64pad$f,base64url:base64url$g,base64urlpad:base64urlpad$f},Symbol.toStringTag,{value:"Module"})),base8$u=rfc4648$i({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$v=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$u},Symbol.toStringTag,{value:"Module"})),identity$h=from$m({prefix:"\0",name:"identity",encode:et=>toString$w(et),decode:et=>fromString$u(et)}),identityBase$f=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$h},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$f={...identityBase$f,...base2$v,...base8$v,...base10$v,...base16$v,...base32$z,...base36$w,...base58$f,...base64$y,...base256emoji$v};function allocUnsafe$g(et=0){return new Uint8Array(et)}function createCodec$f(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$j=createCodec$f("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$f=createCodec$f("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$g(et.length);for(let tt=0;tttoString$v(et,"base16"),bytesToUtf8=et=>toString$v(et,"utf8"),utf8ToBytes$1=et=>fromString$t(et,"utf8");function concat$5(et,o){const tt=et.reduce((ot,it)=>ot+it.length,0),rt=new Uint8Array(tt);let nt=0;for(const ot of et)rt.set(ot,nt),nt+=ot.length;return rt}function isStaticSharding(et){return"clusterId"in et&&"shards"in et&&!("contentTopics"in et)}function isAutoSharding(et){return"contentTopics"in et}function derivePubsubTopicsFromNetworkConfig(et){if(isStaticSharding(et)){if(et.shards.length===0)throw new Error("Invalid shards configuration: please provide at least one shard");return shardInfoToPubsubTopics(et)}else if(isAutoSharding(et)){if(et.contentTopics.length===0)throw new Error("Invalid content topics configuration: please provide at least one content topic");return et.contentTopics.map(o=>contentTopicToPubsubTopic(o,et.clusterId))}else throw new Error("Unknown shard config. Please use ShardInfo or ContentTopicInfo")}const singleShardInfoToPubsubTopic=et=>{if(et.shard===void 0)throw new Error("Invalid shard");return`/waku/2/rs/${et.clusterId??DEFAULT_CLUSTER_ID}/${et.shard}`},shardInfoToPubsubTopics=et=>{if("contentTopics"in et&&et.contentTopics)return Array.from(new Set(et.contentTopics.map(o=>contentTopicToPubsubTopic(o,et.clusterId))));if("shards"in et){if(et.shards===void 0)throw new Error("Invalid shard");return Array.from(new Set(et.shards.map(o=>`/waku/2/rs/${et.clusterId??DEFAULT_CLUSTER_ID}/${o}`)))}else{if("application"in et&&"version"in et)return[contentTopicToPubsubTopic(`/${et.application}/${et.version}/default/default`,et.clusterId)];throw new Error("Missing required configuration in shard parameters")}},pubsubTopicToSingleShardInfo=et=>{const o=et.split("/");if(o.length!=6||o[1]!=="waku"||o[2]!=="2"||o[3]!=="rs")throw new Error("Invalid pubsub topic");const tt=parseInt(o[4]),rt=parseInt(o[5]);if(isNaN(tt)||isNaN(rt))throw new Error("Invalid clusterId or shard");return{clusterId:tt,shard:rt}},pubsubTopicsToShardInfo=et=>{const o=new Set,tt=new Set;for(const ot of et){const{clusterId:it,shard:st}=pubsubTopicToSingleShardInfo(ot);o.add(`${it}:${st}`),tt.add(it)}if(o.size===0)throw new Error("No valid pubsub topics provided");if(tt.size>1)throw new Error("Pubsub topics from multiple cluster IDs are not supported");const rt=tt.values().next().value,nt=Array.from(o).map(ot=>parseInt(ot.split(":")[1]));return{clusterId:rt,shards:nt}};function ensurePubsubTopicIsConfigured(et,o){if(!o.includes(et))throw new Error(`Pubsub topic ${et} has not been configured on this instance. Configured topics are: ${o}. Please update your configuration by passing in the topic during Waku node instantiation.`)}function ensureValidContentTopic(et){const o=et.split("/");if(o.length<5||o.length>6)throw Error("Content topic format is invalid");let tt=0;if(o.length==6){if(tt=parseInt(o[1]),isNaN(tt))throw new Error("Invalid generation field in content topic");if(tt>0)throw new Error("Generation greater than 0 is not supported")}const rt=o.splice(-4);if(rt[0].length==0)throw new Error("Application field cannot be empty");if(rt[1].length==0)throw new Error("Version field cannot be empty");if(rt[2].length==0)throw new Error("Topic name field cannot be empty");if(rt[3].length==0)throw new Error("Encoding field cannot be empty");return{generation:tt,application:rt[0],version:rt[1],topicName:rt[2],encoding:rt[3]}}function contentTopicToShardIndex(et,o=8){const{application:tt,version:rt}=ensureValidContentTopic(et),nt=sha256$3(concat$5([utf8ToBytes$1(tt),utf8ToBytes$1(rt)])),ot=new DataView(nt.buffer.slice(-8));return Number(ot.getBigUint64(0,!1)%BigInt(o))}function contentTopicToPubsubTopic(et,o=DEFAULT_CLUSTER_ID,tt=8){if(!et)throw Error("Content topic must be specified");const rt=contentTopicToShardIndex(et,tt);return`/waku/2/rs/${o}/${rt}`}function determinePubsubTopic(et,o){return typeof o=="string"?o:(o==null?void 0:o.shard)!==void 0?singleShardInfoToPubsubTopic(o):contentTopicToPubsubTopic(et,(o==null?void 0:o.clusterId)??DEFAULT_CLUSTER_ID)}const decodeRelayShard=et=>{if(et=new Uint8Array(et),et.length<3)throw new Error("Insufficient data");const o=new DataView(et.buffer),tt=o.getUint16(0),rt=[];if(et.length===130)for(let nt=0;nt<1024;nt++){const ot=Math.floor(nt/8)+2,it=7-nt%8;o.getUint8(ot)&1<=et.length)throw new Error("Unexpected end of data");rt.push(o.getUint16(it))}}return{clusterId:tt,shards:rt}},encodeRelayShard=et=>{const{clusterId:o,shards:tt}=et,rt=tt.length>=64?130:3+2*tt.length,nt=new ArrayBuffer(rt),ot=new DataView(nt);if(ot.setUint16(0,o),tt.length>=64)for(const it of tt){const st=Math.floor(it/8)+2,at=7-it%8;ot.setUint8(st,ot.getUint8(st)|1<tt.toString().includes("ws")||tt.toString().includes("wss"));if(!o)throw new Error("No ws multiaddr found in the given addresses");return o}var browser={exports:{}},ms$1,hasRequiredMs;function requireMs(){if(hasRequiredMs)return ms$1;hasRequiredMs=1;var et=1e3,o=et*60,tt=o*60,rt=tt*24,nt=rt*7,ot=rt*365.25;ms$1=function(lt,dt){dt=dt||{};var ht=typeof lt;if(ht==="string"&<.length>0)return it(lt);if(ht==="number"&&isFinite(lt))return dt.long?at(lt):st(lt);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(lt))};function it(lt){if(lt=String(lt),!(lt.length>100)){var dt=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(lt);if(dt){var ht=parseFloat(dt[1]),mt=(dt[2]||"ms").toLowerCase();switch(mt){case"years":case"year":case"yrs":case"yr":case"y":return ht*ot;case"weeks":case"week":case"w":return ht*nt;case"days":case"day":case"d":return ht*rt;case"hours":case"hour":case"hrs":case"hr":case"h":return ht*tt;case"minutes":case"minute":case"mins":case"min":case"m":return ht*o;case"seconds":case"second":case"secs":case"sec":case"s":return ht*et;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return ht;default:return}}}}function st(lt){var dt=Math.abs(lt);return dt>=rt?Math.round(lt/rt)+"d":dt>=tt?Math.round(lt/tt)+"h":dt>=o?Math.round(lt/o)+"m":dt>=et?Math.round(lt/et)+"s":lt+"ms"}function at(lt){var dt=Math.abs(lt);return dt>=rt?ct(lt,dt,rt,"day"):dt>=tt?ct(lt,dt,tt,"hour"):dt>=o?ct(lt,dt,o,"minute"):dt>=et?ct(lt,dt,et,"second"):lt+" ms"}function ct(lt,dt,ht,mt){var ft=dt>=ht*1.5;return Math.round(lt/ht)+" "+mt+(ft?"s":"")}return ms$1}function setup$1(et){tt.debug=tt,tt.default=tt,tt.coerce=at,tt.disable=ot,tt.enable=nt,tt.enabled=it,tt.humanize=requireMs(),tt.destroy=ct,Object.keys(et).forEach(lt=>{tt[lt]=et[lt]}),tt.names=[],tt.skips=[],tt.formatters={};function o(lt){let dt=0;for(let ht=0;ht{if(Ct==="%%")return"%";vt++;const At=tt.formatters[St];if(typeof At=="function"){const kt=yt[vt];Ct=At.call(gt,kt),yt.splice(vt,1),vt--}return Ct}),tt.formatArgs.call(gt,yt),(gt.log||tt.log).apply(gt,yt)}return pt.namespace=lt,pt.useColors=tt.useColors(),pt.color=tt.selectColor(lt),pt.extend=rt,pt.destroy=tt.destroy,Object.defineProperty(pt,"enabled",{enumerable:!0,configurable:!1,get:()=>ht!==null?ht:(mt!==tt.namespaces&&(mt=tt.namespaces,ft=tt.enabled(lt)),ft),set:yt=>{ht=yt}}),typeof tt.init=="function"&&tt.init(pt),pt}function rt(lt,dt){const ht=tt(this.namespace+(typeof dt>"u"?":":dt)+lt);return ht.log=this.log,ht}function nt(lt){tt.save(lt),tt.namespaces=lt,tt.names=[],tt.skips=[];let dt;const ht=(typeof lt=="string"?lt:"").split(/[\s,]+/),mt=ht.length;for(dt=0;dt"-"+dt)].join(",");return tt.enable(""),lt}function it(lt){if(lt[lt.length-1]==="*")return!0;let dt,ht;for(dt=0,ht=tt.skips.length;dt{let lt=!1;return()=>{lt||(lt=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),o.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function nt(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let lt;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(lt=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(lt[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function ot(lt){if(lt[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+lt[0]+(this.useColors?"%c ":" ")+"+"+et.exports.humanize(this.diff),!this.useColors)return;const dt="color: "+this.color;lt.splice(1,0,dt,"color: inherit");let ht=0,mt=0;lt[0].replace(/%[a-zA-Z%]/g,ft=>{ft!=="%%"&&(ht++,ft==="%c"&&(mt=ht))}),lt.splice(mt,0,dt)}o.log=console.debug||console.log||(()=>{});function it(lt){try{lt?o.storage.setItem("debug",lt):o.storage.removeItem("debug")}catch{}}function st(){let lt;try{lt=o.storage.getItem("debug")}catch{}return!lt&&typeof tt<"u"&&"env"in tt&&(lt=rt.DEBUG),lt}function at(){try{return localStorage}catch{}}et.exports=common$1(o);const{formatters:ct}=et.exports;ct.j=function(lt){try{return JSON.stringify(lt)}catch(dt){return"[UnexpectedJSONParseError]: "+dt.message}}})(browser,browser.exports);var browserExports=browser.exports;const debug=getDefaultExportFromCjs(browserExports),APP_NAME="waku";let Logger$1=class _i{constructor(o){wt(this,"_info");wt(this,"_warn");wt(this,"_error");this._info=debug(_i.createDebugNamespace("info",o)),this._warn=debug(_i.createDebugNamespace("warn",o)),this._error=debug(_i.createDebugNamespace("error",o))}static createDebugNamespace(o,tt){return tt?`${APP_NAME}:${o}:${tt}`:`${APP_NAME}:${o}`}get info(){return this._info}get warn(){return this._warn}get error(){return this._error}log(o,...tt){const rt=this[o];rt(...tt)}};const log$o=new Logger$1("message:version-0"),OneMillion=BigInt(1e6),Version=0;class DecodedMessage{constructor(o,tt){wt(this,"pubsubTopic");wt(this,"proto");this.pubsubTopic=o,this.proto=tt}get ephemeral(){return!!this.proto.ephemeral}get payload(){return this.proto.payload}get contentTopic(){return this.proto.contentTopic}get _rawTimestamp(){return this.proto.timestamp}get timestamp(){try{if(this.proto.timestamp){const o=this.proto.timestamp/OneMillion;return new Date(Number(o))}return}catch{return}}get meta(){return this.proto.meta}get version(){return this.proto.version??0}get rateLimitProof(){return this.proto.rateLimitProof}}let Encoder$k=class{constructor(o,tt=!1,rt,nt){wt(this,"contentTopic");wt(this,"ephemeral");wt(this,"pubsubTopic");wt(this,"metaSetter");if(this.contentTopic=o,this.ephemeral=tt,this.pubsubTopic=rt,this.metaSetter=nt,!o||o==="")throw new Error("Content topic must be specified")}async toWire(o){return WakuMessage$4.encode(await this.toProtoObj(o))}async toProtoObj(o){const tt=o.timestamp??new Date,rt={payload:o.payload,version:Version,contentTopic:this.contentTopic,timestamp:BigInt(tt.valueOf())*OneMillion,meta:void 0,rateLimitProof:o.rateLimitProof,ephemeral:this.ephemeral};if(this.metaSetter){const nt=this.metaSetter(rt);return{...rt,meta:nt}}return rt}};function createEncoder({pubsubTopic:et,pubsubTopicShardInfo:o,contentTopic:tt,ephemeral:rt,metaSetter:nt}){return new Encoder$k(tt,rt,determinePubsubTopic(tt,et??o),nt)}let Decoder$k=class{constructor(o,tt){wt(this,"pubsubTopic");wt(this,"contentTopic");if(this.pubsubTopic=o,this.contentTopic=tt,!tt||tt==="")throw new Error("Content topic must be specified")}fromWireToProtoObj(o){const tt=WakuMessage$4.decode(o);return Promise.resolve({payload:tt.payload,contentTopic:tt.contentTopic,version:tt.version??void 0,timestamp:tt.timestamp??void 0,meta:tt.meta??void 0,rateLimitProof:tt.rateLimitProof??void 0,ephemeral:tt.ephemeral??!1})}async fromProtoObj(o,tt){return tt.version??Version!==0?(log$o.error("Failed to decode due to incorrect version, expected:",Version,", actual:",tt.version),Promise.resolve(void 0)):new DecodedMessage(o,tt)}};function createDecoder(et,o){return new Decoder$k(determinePubsubTopic(et,o),et)}function isAsyncIterable$8(et){return et[Symbol.asyncIterator]!=null}function all$2(et){if(isAsyncIterable$8(et))return(async()=>{const tt=[];for await(const rt of et)tt.push(rt);return tt})();const o=[];for(const tt of et)o.push(tt);return o}function alloc$5(et=0){return new Uint8Array(et)}function allocUnsafe$f(et=0){return new Uint8Array(et)}function asUint8Array$3(et){return et}function concat$4(et,o){o==null&&(o=et.reduce((nt,ot)=>nt+ot.length,0));const tt=allocUnsafe$f(o);let rt=0;for(const nt of et)tt.set(nt,rt),rt+=nt.length;return tt}function equals$f(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt0&&this.appendAll(o)}*[(Zs=symbol$1,Symbol.iterator)](){yield*this.bufs}get byteLength(){return this.length}append(...o){this.appendAll(o)}appendAll(o){let tt=0;for(const rt of o)if(rt instanceof Uint8Array)tt+=rt.byteLength,this.bufs.push(rt);else if(isUint8ArrayList(rt))tt+=rt.byteLength,this.bufs.push(...rt.bufs);else throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");this.length+=tt}prepend(...o){this.prependAll(o)}prependAll(o){let tt=0;for(const rt of o.reverse())if(rt instanceof Uint8Array)tt+=rt.byteLength,this.bufs.unshift(rt);else if(isUint8ArrayList(rt))tt+=rt.byteLength,this.bufs.unshift(...rt.bufs);else throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");this.length+=tt}get(o){const tt=findBufAndOffset(this.bufs,o);return tt.buf[tt.index]}set(o,tt){const rt=findBufAndOffset(this.bufs,o);rt.buf[rt.index]=tt}write(o,tt=0){if(o instanceof Uint8Array)for(let rt=0;rt0;)if(o>=this.bufs[0].byteLength)o-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift();else{this.bufs[0]=this.bufs[0].subarray(o),this.length-=o;break}}}slice(o,tt){const{bufs:rt,length:nt}=this._subList(o,tt);return concat$4(rt,nt)}subarray(o,tt){const{bufs:rt,length:nt}=this._subList(o,tt);return rt.length===1?rt[0]:concat$4(rt,nt)}sublist(o,tt){const{bufs:rt,length:nt}=this._subList(o,tt),ot=new Uint8ArrayList;return ot.length=nt,ot.bufs=[...rt],ot}_subList(o,tt){if(o=o??0,tt=tt??this.length,o<0&&(o=this.length+o),tt<0&&(tt=this.length+tt),o<0||tt>this.length)throw new RangeError("index is out of bounds");if(o===tt)return{bufs:[],length:0};if(o===0&&tt===this.length)return{bufs:this.bufs,length:this.length};const rt=[];let nt=0;for(let ot=0;ot=at)continue;const ct=o>=st&&ost&&tt<=at;if(ct&<){if(o===st&&tt===at){rt.push(it);break}const dt=o-st;rt.push(it.subarray(dt,dt+(tt-o)));break}if(ct){if(o===0){rt.push(it);continue}rt.push(it.subarray(o-st));continue}if(lt){if(tt===at){rt.push(it);break}rt.push(it.subarray(0,tt-st));break}rt.push(it)}return{bufs:rt,length:tt-o}}indexOf(o,tt=0){if(!isUint8ArrayList(o)&&!(o instanceof Uint8Array))throw new TypeError('The "value" argument must be a Uint8ArrayList or Uint8Array');const rt=o instanceof Uint8Array?o:o.subarray();if(tt=Number(tt??0),isNaN(tt)&&(tt=0),tt<0&&(tt=this.length+tt),tt<0&&(tt=0),o.length===0)return tt>this.length?this.length:tt;const nt=rt.byteLength;if(nt===0)throw new TypeError("search must be at least 1 byte long");const ot=256,it=new Int32Array(ot);for(let dt=0;dt=0;ht--){const mt=this.get(dt+ht);if(rt[ht]!==mt){lt=Math.max(1,ht-st[mt]);break}}if(lt===0)return dt}return-1}getInt8(o){const tt=this.subarray(o,o+1);return new DataView(tt.buffer,tt.byteOffset,tt.byteLength).getInt8(0)}setInt8(o,tt){const rt=allocUnsafe$f(1);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setInt8(0,tt),this.write(rt,o)}getInt16(o,tt){const rt=this.subarray(o,o+2);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getInt16(0,tt)}setInt16(o,tt,rt){const nt=alloc$5(2);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setInt16(0,tt,rt),this.write(nt,o)}getInt32(o,tt){const rt=this.subarray(o,o+4);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getInt32(0,tt)}setInt32(o,tt,rt){const nt=alloc$5(4);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setInt32(0,tt,rt),this.write(nt,o)}getBigInt64(o,tt){const rt=this.subarray(o,o+8);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getBigInt64(0,tt)}setBigInt64(o,tt,rt){const nt=alloc$5(8);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setBigInt64(0,tt,rt),this.write(nt,o)}getUint8(o){const tt=this.subarray(o,o+1);return new DataView(tt.buffer,tt.byteOffset,tt.byteLength).getUint8(0)}setUint8(o,tt){const rt=allocUnsafe$f(1);new DataView(rt.buffer,rt.byteOffset,rt.byteLength).setUint8(0,tt),this.write(rt,o)}getUint16(o,tt){const rt=this.subarray(o,o+2);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getUint16(0,tt)}setUint16(o,tt,rt){const nt=alloc$5(2);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setUint16(0,tt,rt),this.write(nt,o)}getUint32(o,tt){const rt=this.subarray(o,o+4);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getUint32(0,tt)}setUint32(o,tt,rt){const nt=alloc$5(4);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setUint32(0,tt,rt),this.write(nt,o)}getBigUint64(o,tt){const rt=this.subarray(o,o+8);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getBigUint64(0,tt)}setBigUint64(o,tt,rt){const nt=alloc$5(8);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setBigUint64(0,tt,rt),this.write(nt,o)}getFloat32(o,tt){const rt=this.subarray(o,o+4);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getFloat32(0,tt)}setFloat32(o,tt,rt){const nt=alloc$5(4);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setFloat32(0,tt,rt),this.write(nt,o)}getFloat64(o,tt){const rt=this.subarray(o,o+8);return new DataView(rt.buffer,rt.byteOffset,rt.byteLength).getFloat64(0,tt)}setFloat64(o,tt,rt){const nt=alloc$5(8);new DataView(nt.buffer,nt.byteOffset,nt.byteLength).setFloat64(0,tt,rt),this.write(nt,o)}equals(o){if(o==null||!(o instanceof Uint8ArrayList)||o.bufs.length!==this.bufs.length)return!1;for(let tt=0;ttnt+ot.byteLength,0)),rt.length=tt,rt}}function allocUnsafe$e(et=0){return new Uint8Array(et)}function isAsyncIterable$7(et){return et[Symbol.asyncIterator]!=null}const defaultEncoder=et=>{const o=encodingLength$6(et),tt=allocUnsafe$e(o);return encode$P(et,tt),defaultEncoder.bytes=o,tt};defaultEncoder.bytes=0;function encode$K(et,o){o=o??{};const tt=o.lengthEncoder??defaultEncoder;function*rt(nt){const ot=tt(nt.byteLength);ot instanceof Uint8Array?yield ot:yield*ot,nt instanceof Uint8Array?yield nt:yield*nt}return isAsyncIterable$7(et)?async function*(){for await(const nt of et)yield*rt(nt)}():function*(){for(const nt of et)yield*rt(nt)}()}encode$K.single=(et,o)=>{o=o??{};const tt=o.lengthEncoder??defaultEncoder;return new Uint8ArrayList(tt(et.byteLength),et)};let InvalidMessageLengthError$1=class extends Error{constructor(){super(...arguments);wt(this,"name","InvalidMessageLengthError");wt(this,"code","ERR_INVALID_MSG_LENGTH")}},InvalidDataLengthError$1=class extends Error{constructor(){super(...arguments);wt(this,"name","InvalidDataLengthError");wt(this,"code","ERR_MSG_DATA_TOO_LONG")}},InvalidDataLengthLengthError$1=class extends Error{constructor(){super(...arguments);wt(this,"name","InvalidDataLengthLengthError");wt(this,"code","ERR_MSG_LENGTH_TOO_LONG")}},UnexpectedEOFError$1=class extends Error{constructor(){super(...arguments);wt(this,"name","UnexpectedEOFError");wt(this,"code","ERR_UNEXPECTED_EOF")}};const MAX_LENGTH_LENGTH=8,MAX_DATA_LENGTH=1024*1024*4;var ReadMode;(function(et){et[et.LENGTH=0]="LENGTH",et[et.DATA=1]="DATA"})(ReadMode||(ReadMode={}));const defaultDecoder=et=>{const o=decode$Z(et);return defaultDecoder.bytes=encodingLength$6(o),o};defaultDecoder.bytes=0;function decode$U(et,o){const tt=new Uint8ArrayList;let rt=ReadMode.LENGTH,nt=-1;const ot=(o==null?void 0:o.lengthDecoder)??defaultDecoder,it=(o==null?void 0:o.maxLengthLength)??MAX_LENGTH_LENGTH,st=(o==null?void 0:o.maxDataLength)??MAX_DATA_LENGTH;function*at(){for(;tt.byteLength>0;){if(rt===ReadMode.LENGTH)try{if(nt=ot(tt),nt<0)throw new InvalidMessageLengthError$1("Invalid message length");if(nt>st)throw new InvalidDataLengthError$1("Message length too long");const ct=ot.bytes;tt.consume(ct),(o==null?void 0:o.onLength)!=null&&o.onLength(nt),rt=ReadMode.DATA}catch(ct){if(ct instanceof RangeError){if(tt.byteLength>it)throw new InvalidDataLengthLengthError$1("Message length length too long");break}throw ct}if(rt===ReadMode.DATA){if(tt.byteLength0)throw new UnexpectedEOFError$1("Unexpected end of input")}():function*(){for(const ct of et)tt.append(ct),yield*at();if(tt.byteLength>0)throw new UnexpectedEOFError$1("Unexpected end of input")}()}decode$U.fromReader=(et,o)=>{let tt=1;const rt=async function*(){for(;;)try{const{done:ot,value:it}=await et.next(tt);if(ot===!0)return;it!=null&&(yield it)}catch(ot){if(ot.code==="ERR_UNDER_READ")return{done:!0,value:null};throw ot}finally{tt=1}}();return decode$U(rt,{...o??{},onLength:ot=>{tt=ot}})};function pDefer(){const et={};return et.promise=new Promise((o,tt)=>{et.resolve=o,et.reject=tt}),et}class FixedFIFO{constructor(o){wt(this,"buffer");wt(this,"mask");wt(this,"top");wt(this,"btm");wt(this,"next");if(!(o>0)||o-1&o)throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(o),this.mask=o-1,this.top=0,this.btm=0,this.next=null}push(o){return this.buffer[this.top]!==void 0?!1:(this.buffer[this.top]=o,this.top=this.top+1&this.mask,!0)}shift(){const o=this.buffer[this.btm];if(o!==void 0)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,o}isEmpty(){return this.buffer[this.btm]===void 0}}class FIFO{constructor(o={}){wt(this,"size");wt(this,"hwm");wt(this,"head");wt(this,"tail");this.hwm=o.splitLimit??16,this.head=new FixedFIFO(this.hwm),this.tail=this.head,this.size=0}calculateSize(o){return(o==null?void 0:o.byteLength)!=null?o.byteLength:1}push(o){if((o==null?void 0:o.value)!=null&&(this.size+=this.calculateSize(o.value)),!this.head.push(o)){const tt=this.head;this.head=tt.next=new FixedFIFO(2*this.head.buffer.length),this.head.push(o)}}shift(){let o=this.tail.shift();if(o===void 0&&this.tail.next!=null){const tt=this.tail.next;this.tail.next=null,this.tail=tt,o=this.tail.shift()}return(o==null?void 0:o.value)!=null&&(this.size-=this.calculateSize(o.value)),o}isEmpty(){return this.head.isEmpty()}}let AbortError$a=class extends Error{constructor(tt,rt){super(tt??"The operation was aborted");wt(this,"type");wt(this,"code");this.type="aborted",this.code=rt??"ABORT_ERR"}};function pushable(et={}){return _pushable(tt=>{const rt=tt.shift();if(rt==null)return{done:!0};if(rt.error!=null)throw rt.error;return{done:rt.done===!0,value:rt.value}},et)}function _pushable(et,o){o=o??{};let tt=o.onEnd,rt=new FIFO,nt,ot,it,st=pDefer();const at=async()=>{try{return rt.isEmpty()?it?{done:!0}:await new Promise((yt,gt)=>{ot=bt=>{ot=null,rt.push(bt);try{yt(et(rt))}catch(xt){gt(xt)}return nt}}):et(rt)}finally{rt.isEmpty()&&queueMicrotask(()=>{st.resolve(),st=pDefer()})}},ct=yt=>ot!=null?ot(yt):(rt.push(yt),nt),lt=yt=>(rt=new FIFO,ot!=null?ot({error:yt}):(rt.push({error:yt}),nt)),dt=yt=>{if(it)return nt;if((o==null?void 0:o.objectMode)!==!0&&(yt==null?void 0:yt.byteLength)==null)throw new Error("objectMode was not true but tried to push non-Uint8Array value");return ct({done:!1,value:yt})},ht=yt=>it?nt:(it=!0,yt!=null?lt(yt):ct({done:!0})),mt=()=>(rt=new FIFO,ht(),{done:!0}),ft=yt=>(ht(yt),{done:!0});if(nt={[Symbol.asyncIterator](){return this},next:at,return:mt,throw:ft,push:dt,end:ht,get readableLength(){return rt.size},onEmpty:async yt=>{const gt=yt==null?void 0:yt.signal;if(gt==null||gt.throwIfAborted(),rt.isEmpty())return;let bt,xt;gt!=null&&(bt=new Promise((vt,Et)=>{xt=()=>{Et(new AbortError$a)},gt.addEventListener("abort",xt)}));try{await Promise.race([st.promise,bt])}finally{xt!=null&>!=null&&(gt==null||gt.removeEventListener("abort",xt))}}},tt==null)return nt;const pt=nt;return nt={[Symbol.asyncIterator](){return this},next(){return pt.next()},throw(yt){return pt.throw(yt),tt!=null&&(tt(yt),tt=void 0),{done:!0}},return(){return pt.return(),tt!=null&&(tt(),tt=void 0),{done:!0}},push:dt,end(yt){return pt.end(yt),tt!=null&&(tt(yt),tt=void 0),nt},get readableLength(){return pt.readableLength},onEmpty:yt=>pt.onEmpty(yt)},nt}function isAsyncIterable$6(et){return et[Symbol.asyncIterator]!=null}function merge$2(...et){const o=[];for(const tt of et)isAsyncIterable$6(tt)||o.push(tt);return o.length===et.length?function*(){for(const tt of o)yield*tt}():async function*(){const tt=pushable({objectMode:!0});Promise.resolve().then(async()=>{try{await Promise.all(et.map(async rt=>{for await(const nt of rt)tt.push(nt)})),tt.end()}catch(rt){tt.end(rt)}}),yield*tt}()}function pipe(et,...o){if(et==null)throw new Error("Empty pipeline");if(isDuplex(et)){const rt=et;et=()=>rt.source}else if(isIterable(et)||isAsyncIterable$5(et)){const rt=et;et=()=>rt}const tt=[et,...o];if(tt.length>1&&isDuplex(tt[tt.length-1])&&(tt[tt.length-1]=tt[tt.length-1].sink),tt.length>2)for(let rt=1;rt{let o;for(;et.length>0;)o=et.shift()(o);return o},isAsyncIterable$5=et=>(et==null?void 0:et[Symbol.asyncIterator])!=null,isIterable=et=>(et==null?void 0:et[Symbol.iterator])!=null,isDuplex=et=>et==null?!1:et.sink!=null&&et.source!=null,duplexPipelineFn=et=>o=>{const tt=et.sink(o);if((tt==null?void 0:tt.then)!=null){const rt=pushable({objectMode:!0});tt.then(()=>{rt.end()},it=>{rt.end(it)});let nt;const ot=et.source;if(isAsyncIterable$5(ot))nt=async function*(){yield*ot,rt.end()};else if(isIterable(ot))nt=function*(){yield*ot,rt.end()};else throw new Error("Unknown duplex source type - must be Iterable or AsyncIterable");return merge$2(rt,nt())}return et.source};async function sortPeersByLatency(et,o){return o.length===0?[]:(await Promise.all(o.map(async nt=>{try{const ot=(await et.get(nt.id)).metadata.get("ping");if(!ot)return{peer:nt,ping:1/0};const it=Number(bytesToUtf8(ot));return{peer:nt,ping:it}}catch{return{peer:nt,ping:1/0}}}))).filter(nt=>nt!==null).sort((nt,ot)=>nt.ping-ot.ping).map(nt=>nt.peer)}async function getPeersForProtocol(et,o){const tt=[];return await et.forEach(rt=>{for(let nt=0;ntit.tags.has(Tags.BOOTSTRAP)).slice(0,tt);o>0&&o!it.tags.has(Tags.BOOTSTRAP));if(o===0)return[...rt,...nt];const ot=[...rt];for(;ot.length0;){const it=Math.floor(Math.random()*nt.length),st=nt.splice(it,1)[0];ot.push(st)}return ot}function selectOpenConnection(et){return et.filter(o=>o.status==="open").sort((o,tt)=>tt.timeline.open-o.timeline.open).at(0)}const STREAM_LOCK_KEY="consumed";class StreamManager{constructor(o,tt,rt){wt(this,"multicodec");wt(this,"getConnections");wt(this,"addEventListener");wt(this,"log");wt(this,"ongoingCreation",new Set);wt(this,"streamPool",new Map);wt(this,"handlePeerUpdateStreamPool",o=>{const{peer:tt}=o.detail;!tt.protocols.includes(this.multicodec)||this.getOpenStreamForCodec(tt.id)||this.scheduleNewStream(tt)});this.multicodec=o,this.getConnections=tt,this.addEventListener=rt,this.log=new Logger$1(`stream-manager:${o}`),this.addEventListener("peer:update",this.handlePeerUpdateStreamPool)}async getStream(o){const tt=o.id.toString(),rt=this.streamPool.get(tt);rt&&(this.streamPool.delete(tt),await rt);let nt=this.getOpenStreamForCodec(o.id);return nt?(this.log.info(`Found existing stream peerId=${o.id.toString()} multicodec=${this.multicodec}`),this.lockStream(o.id.toString(),nt),nt):(nt=await this.createStream(o),this.lockStream(o.id.toString(),nt),nt)}async createStream(o,tt=0){const rt=this.getConnections(o.id),nt=selectOpenConnection(rt);if(!nt)throw new Error(`Failed to get a connection to the peer peerId=${o.id.toString()} multicodec=${this.multicodec}`);let ot,it;for(let st=0;stit.protocol===this.multicodec);if(!(!nt||["done","closed","closing"].includes(nt.writeStatus||"")||this.isStreamLocked(nt)))return nt}lockStream(o,tt){this.log.info(`Locking stream for peerId:${o} streamId:${tt.id}`),tt.metadata[STREAM_LOCK_KEY]=!0}isStreamLocked(o){return!!o.metadata[STREAM_LOCK_KEY]}}class BaseProtocol{constructor(o,tt,rt,nt){wt(this,"multicodec");wt(this,"components");wt(this,"log");wt(this,"pubsubTopics");wt(this,"addLibp2pEventListener");wt(this,"removeLibp2pEventListener");wt(this,"streamManager");this.multicodec=o,this.components=tt,this.log=rt,this.pubsubTopics=nt,this.addLibp2pEventListener=tt.events.addEventListener.bind(tt.events),this.removeLibp2pEventListener=tt.events.removeEventListener.bind(tt.events),this.streamManager=new StreamManager(o,tt.connectionManager.getConnections.bind(tt.connectionManager),this.addLibp2pEventListener)}async getStream(o){return this.streamManager.getStream(o)}async allPeers(){return getPeersForProtocol(this.components.peerStore,[this.multicodec])}async connectedPeers(){return(await this.allPeers()).filter(tt=>this.components.connectionManager.getConnections(tt.id).length>0)}async getPeers({numPeers:o,maxBootstrapPeers:tt,peerIdStr:rt}={maxBootstrapPeers:0,numPeers:0}){if(rt){const st=(await this.connectedPeers()).find(at=>at.id.toString()===rt);return st?[st]:(this.log.warn(`Passed node to use for ${this.multicodec} not found: ${rt}. Attempting to use random peers.`),this.getPeers({numPeers:o,maxBootstrapPeers:tt}))}const nt=await this.connectedPeers(),ot=filterPeersByDiscovery(nt,o,tt),it=await sortPeersByLatency(this.components.peerStore,ot);return it.length===0&&this.log.warn("No peers found. Ensure you have a connection to the network."),it.length{log$n.error("Failed to register ",FilterCodecs.PUSH,ot)})}async subscribe(tt,rt,nt){const ot=await this.getStream(rt),it=FilterSubscribeRpc.createSubscribeRequest(tt,nt);let st;try{st=await pipe([it.encode()],encode$K,ot,decode$U,async dt=>await all$2(dt))}catch(dt){return log$n.error("Failed to send subscribe request",dt),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:rt.id}}}const{statusCode:at,requestId:ct,statusDesc:lt}=FilterSubscribeResponse.decode(st[0].slice());return at<200||at>=300?(log$n.error(`Filter subscribe request ${ct} failed with status code ${at}: ${lt}`),{failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:rt.id},success:null}):{failure:null,success:rt.id}}async unsubscribe(tt,rt,nt){let ot;try{ot=await this.getStream(rt)}catch(st){return log$n.error(`Failed to get a stream for remote peer${rt.id.toString()}`,st),{success:null,failure:{error:ProtocolError$1.NO_STREAM_AVAILABLE,peerId:rt.id}}}const it=FilterSubscribeRpc.createUnsubscribeRequest(tt,nt);try{await pipe([it.encode()],encode$K,ot.sink)}catch(st){return log$n.error("Failed to send unsubscribe request",st),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:rt.id}}}return{success:rt.id,failure:null}}async unsubscribeAll(tt,rt){const nt=await this.getStream(rt),ot=FilterSubscribeRpc.createUnsubscribeAllRequest(tt),it=await pipe([ot.encode()],encode$K,nt,decode$U,async lt=>await all$2(lt));if(!it||!it.length)return{failure:{error:ProtocolError$1.NO_RESPONSE,peerId:rt.id},success:null};const{statusCode:st,requestId:at,statusDesc:ct}=FilterSubscribeResponse.decode(it[0].slice());return st<200||st>=300?(log$n.error(`Filter unsubscribe all request ${at} failed with status code ${st}: ${ct}`),{failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:rt.id},success:null}):{failure:null,success:rt.id}}async ping(tt){let rt;try{rt=await this.getStream(tt)}catch(ct){return log$n.error(`Failed to get a stream for remote peer${tt.id.toString()}`,ct),{success:null,failure:{error:ProtocolError$1.NO_STREAM_AVAILABLE,peerId:tt.id}}}const nt=FilterSubscribeRpc.createSubscriberPingRequest();let ot;try{ot=await pipe([nt.encode()],encode$K,rt,decode$U,async ct=>await all$2(ct))}catch(ct){return log$n.error("Failed to send ping request",ct),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:tt.id}}}if(!ot||!ot.length)return{success:null,failure:{error:ProtocolError$1.NO_RESPONSE,peerId:tt.id}};const{statusCode:it,requestId:st,statusDesc:at}=FilterSubscribeResponse.decode(ot[0].slice());return it<200||it>=300?(log$n.error(`Filter ping request ${st} failed with status code ${it}: ${at}`),{success:null,failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:tt.id}}):{success:tt.id,failure:null}}onRequest(tt){const{connection:rt,stream:nt}=tt,{remotePeer:ot}=rt;log$n.info(`Received message from ${ot.toString()}`);try{pipe(nt,decode$U,async it=>{for await(const st of it){const at=FilterPushRpc.decode(st.slice()),{pubsubTopic:ct,wakuMessage:lt}=at;if(!lt){log$n.error("Received empty message");return}if(!ct){log$n.error("Pubsub topic missing from push message");return}await this.handleIncomingMessage(ct,lt,rt.remotePeer.toString())}}).then(()=>{log$n.info("Receiving pipe closed.")},async it=>{log$n.error(`Error with receiving pipe on peer:${rt.remotePeer.toString()} -- stream:${nt.id} -- protocol:${nt.protocol}: `,it)})}catch(it){log$n.error("Error decoding message",it)}}}class PushRpc{constructor(o){wt(this,"proto");this.proto=o}static createRequest(o,tt){return new PushRpc({requestId:v4$2(),request:{message:o,pubsubTopic:tt},response:void 0})}static decode(o){const tt=PushRpc$1.decode(o);return new PushRpc(tt)}encode(){return PushRpc$1.encode(this.proto)}get query(){return this.proto.request}get response(){return this.proto.response}}const RLN_GENERATION_PREFIX_ERROR="could not generate rln-v2 proof",isRLNResponseError=et=>et?et.includes(RLN_GENERATION_PREFIX_ERROR):!1,matchRLNErrorMessage=et=>{const o={[ProtocolError$1.RLN_IDENTITY_MISSING]:ProtocolError$1.RLN_IDENTITY_MISSING,[ProtocolError$1.RLN_MEMBERSHIP_INDEX]:ProtocolError$1.RLN_MEMBERSHIP_INDEX,[ProtocolError$1.RLN_LIMIT_MISSING]:ProtocolError$1.RLN_LIMIT_MISSING},tt=et.toLowerCase();for(const rt in o)if(tt.includes(rt.toLowerCase()))return o[rt];return ProtocolError$1.RLN_PROOF_GENERATION},log$m=new Logger$1("light-push"),LightPushCodec="/vac/waku/lightpush/2.0.0-beta1";class LightPushCore extends BaseProtocol{constructor(tt,rt){super(LightPushCodec,rt.components,log$m,tt);wt(this,"pubsubTopics");this.pubsubTopics=tt}async preparePushMessage(tt,rt){try{if(!rt.payload||rt.payload.length===0)return log$m.error("Failed to send waku light push: payload is empty"),{query:null,error:ProtocolError$1.EMPTY_PAYLOAD};if(!await isMessageSizeUnderCap(tt,rt))return log$m.error("Failed to send waku light push: message is bigger than 1MB"),{query:null,error:ProtocolError$1.SIZE_TOO_BIG};const nt=await tt.toProtoObj(rt);return nt?{query:PushRpc.createRequest(nt,tt.pubsubTopic),error:null}:(log$m.error("Failed to encode to protoMessage, aborting push"),{query:null,error:ProtocolError$1.ENCODE_FAILED})}catch(nt){return log$m.error("Failed to prepare push message",nt),{query:null,error:ProtocolError$1.GENERIC_FAIL}}}async send(tt,rt,nt){const{query:ot,error:it}=await this.preparePushMessage(tt,rt);if(it||!ot)return{success:null,failure:{error:it,peerId:nt.id}};let st;try{st=await this.getStream(nt)}catch(dt){return log$m.error("Failed to get stream",dt),{success:null,failure:{error:ProtocolError$1.NO_STREAM_AVAILABLE,peerId:nt.id}}}let at;try{at=await pipe([ot.encode()],encode$K,st,decode$U,async dt=>await all$2(dt))}catch(dt){return log$m.error("Failed to send waku light push request",dt),{success:null,failure:{error:ProtocolError$1.GENERIC_FAIL,peerId:nt.id}}}const ct=new Uint8ArrayList;at.forEach(dt=>{ct.append(dt)});let lt;try{lt=PushRpc.decode(ct).response}catch(dt){return log$m.error("Failed to decode push reply",dt),{success:null,failure:{error:ProtocolError$1.DECODE_FAILED,peerId:nt.id}}}if(!lt)return log$m.error("Remote peer fault: No response in PushRPC"),{success:null,failure:{error:ProtocolError$1.NO_RESPONSE,peerId:nt.id}};if(isRLNResponseError(lt.info)){const dt=matchRLNErrorMessage(lt.info);return log$m.error("Remote peer rejected the message: ",dt),{success:null,failure:{error:dt,peerId:nt.id}}}return lt.isSuccess?{success:nt.id,failure:null}:(log$m.error("Remote peer rejected the message: ",lt.info),{success:null,failure:{error:ProtocolError$1.REMOTE_PEER_REJECTED,peerId:nt.id}})}}const EmptyMessage={payload:new Uint8Array,contentTopic:"",version:void 0,timestamp:void 0,meta:void 0,rateLimitProof:void 0,ephemeral:void 0};function toProtoMessage(et){return{...EmptyMessage,...et}}const DEFAULT_PAGE_SIZE=20,MAX_PAGE_SIZE=100,ONE_MILLION=1e6;class StoreQueryRequest{constructor(o){wt(this,"proto");this.proto=o}static create(o){const tt=new StoreQueryRequest({...o,requestId:v4$2(),timeStart:o.timeStart?BigInt(o.timeStart.getTime()*ONE_MILLION):void 0,timeEnd:o.timeEnd?BigInt(o.timeEnd.getTime()*ONE_MILLION):void 0,messageHashes:o.messageHashes||[],paginationLimit:o.paginationLimit?BigInt(o.paginationLimit):void 0});if(o.pubsubTopic&&!o.contentTopics||!o.pubsubTopic&&o.contentTopics)throw new Error("Both pubsubTopic and contentTopics must be set or unset");if(o.messageHashes&&(o.pubsubTopic||o.contentTopics||o.timeStart||o.timeEnd))throw new Error("Message hash lookup queries cannot include content filter criteria");return tt}static decode(o){const tt=StoreQueryRequest$1.decode(o);return new StoreQueryRequest(tt)}encode(){return StoreQueryRequest$1.encode(this.proto)}}class StoreQueryResponse{constructor(o){wt(this,"proto");this.proto=o}static decode(o){const tt=StoreQueryResponse$1.decode(o);return new StoreQueryResponse(tt)}encode(){return StoreQueryResponse$1.encode(this.proto)}get statusCode(){return this.proto.statusCode}get statusDesc(){return this.proto.statusDesc}get messages(){return this.proto.messages}get paginationCursor(){return this.proto.paginationCursor}}const log$l=new Logger$1("store"),StoreCodec="/vac/waku/store-query/3.0.0";class StoreCore extends BaseProtocol{constructor(tt,rt){super(StoreCodec,rt.components,log$l,tt);wt(this,"pubsubTopics");this.pubsubTopics=tt}async*queryPerPage(tt,rt,nt){if(tt.contentTopics.toString()!==Array.from(rt.keys()).toString())throw new Error("Internal error, the decoders should match the query's content topics");let ot=tt.paginationCursor;for(;;){const it=StoreQueryRequest.create({...tt,paginationCursor:ot});let st;try{st=await this.getStream(nt)}catch(ht){log$l.error("Failed to get stream",ht);break}const at=await pipe([it.encode()],encode$K,st,decode$U,async ht=>await all$2(ht)),ct=new Uint8ArrayList;at.forEach(ht=>{ct.append(ht)});const lt=StoreQueryResponse.decode(ct);if(!lt.statusCode||lt.statusCode>=300){const ht=`Store query failed with status code: ${lt.statusCode}, description: ${lt.statusDesc}`;throw log$l.error(ht),new Error(ht)}if(!lt.messages||!lt.messages.length){log$l.warn("Stopping pagination due to empty messages in response");break}if(log$l.info(`${lt.messages.length} messages retrieved from store`),yield lt.messages.map(ht=>{if(!ht.message)return Promise.resolve(void 0);const mt=ht.message.contentTopic;if(mt){const ft=rt.get(mt);if(ft)return ft.fromProtoObj(ht.pubsubTopic||"",toProtoMessage(ht.message))}return Promise.resolve(void 0)}),tt.paginationForward?ot=lt.messages[lt.messages.length-1].messageHash:ot=lt.messages[0].messageHash,lt.messages.length>MAX_PAGE_SIZE&<.messages.length<(tt.paginationLimit||DEFAULT_PAGE_SIZE))break}}}const peerDiscoverySymbol$2=Symbol.for("@libp2p/peer-discovery"),peerIdSymbol$3=Symbol.for("@libp2p/peer-id");function isPeerId$2(et){return!!(et!=null&&et[peerIdSymbol$3])}var ls;let AbortError$9=(ls=class extends Error{constructor(o="The operation was aborted"){super(o),this.name="AbortError"}},wt(ls,"name","AbortError"),ls);class UnexpectedPeerError extends Error{constructor(o="Unexpected Peer"){super(o),this.name="UnexpectedPeerError"}}wt(UnexpectedPeerError,"name","UnexpectedPeerError");var us;let InvalidMessageError$3=(us=class extends Error{constructor(o="Invalid message"){super(o),this.name="InvalidMessageError"}},wt(us,"name","InvalidMessageError"),us);class ProtocolError extends Error{constructor(o="Protocol error"){super(o),this.name="ProtocolError"}}wt(ProtocolError,"name","ProtocolError");var ds;let TimeoutError$3=(ds=class extends Error{constructor(o="Timed out"){super(o),this.name="TimeoutError"}},wt(ds,"name","TimeoutError"),ds);function setMaxListeners$9(){}const setMaxListeners$8=(et,...o)=>{try{[...o]}catch{}};var Yr,Js;let TypedEventEmitter$3=(Js=class extends EventTarget{constructor(){super();fr(this,Yr,new Map);setMaxListeners$8(1/0,this)}listenerCount(tt){const rt=Ot(this,Yr).get(tt);return rt==null?0:rt.length}addEventListener(tt,rt,nt){super.addEventListener(tt,rt,nt);let ot=Ot(this,Yr).get(tt);ot==null&&(ot=[],Ot(this,Yr).set(tt,ot)),ot.push({callback:rt,once:(nt!==!0&&nt!==!1&&(nt==null?void 0:nt.once))??!1})}removeEventListener(tt,rt,nt){super.removeEventListener(tt.toString(),rt??null,nt);let ot=Ot(this,Yr).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==rt),Ot(this,Yr).set(tt,ot))}dispatchEvent(tt){const rt=super.dispatchEvent(tt);let nt=Ot(this,Yr).get(tt.type);return nt==null||(nt=nt.filter(({once:ot})=>!ot),Ot(this,Yr).set(tt.type,nt)),rt}safeDispatchEvent(tt,rt={}){return this.dispatchEvent(new CustomEvent(tt,rt))}},Yr=new WeakMap,Js);const serviceCapabilities$5=Symbol.for("@libp2p/service-capabilities"),RelayPingContentTopic="/relay-ping/1/ping/null",log$k=new Logger$1("keep-alive");class KeepAliveManager{constructor({options:o,relay:tt,libp2p:rt}){wt(this,"relay");wt(this,"libp2p");wt(this,"options");wt(this,"pingKeepAliveTimers",new Map);wt(this,"relayKeepAliveTimers",new Map);this.options=o,this.relay=tt,this.libp2p=rt}start(o){this.stop(o);const{pingKeepAlive:tt,relayKeepAlive:rt}=this.options,nt=o.toString();if(tt!==0){const it=setInterval(()=>{(async()=>{let st;try{try{st=await this.libp2p.services.ping.ping(o),log$k.info(`Ping succeeded (${nt})`,st)}catch{log$k.error(`Ping failed for peer (${nt}). - Next ping will be attempted in ${tt} seconds. - `);return}try{await this.libp2p.peerStore.merge(o,{metadata:{ping:utf8ToBytes$1(st.toString())}})}catch(at){log$k.error("Failed to update ping",at)}}catch(at){log$k.error(`Ping failed (${nt})`,at)}})()},tt*1e3);this.pingKeepAliveTimers.set(nt,it)}const ot=this.relay;if(ot&&rt!==0){const it=this.scheduleRelayPings(ot,rt,o.toString());this.relayKeepAliveTimers.set(o,it)}}stop(o){var rt;const tt=o.toString();this.pingKeepAliveTimers.has(tt)&&(clearInterval(this.pingKeepAliveTimers.get(tt)),this.pingKeepAliveTimers.delete(tt)),this.relayKeepAliveTimers.has(o)&&((rt=this.relayKeepAliveTimers.get(o))==null||rt.map(clearInterval),this.relayKeepAliveTimers.delete(o))}stopAll(){for(const o of[...Object.values(this.pingKeepAliveTimers),...Object.values(this.relayKeepAliveTimers)])clearInterval(o);this.pingKeepAliveTimers.clear(),this.relayKeepAliveTimers.clear()}connectionsExist(){return this.pingKeepAliveTimers.size>0||this.relayKeepAliveTimers.size>0}scheduleRelayPings(o,tt,rt){const nt=[];for(const ot of o.pubsubTopics){if(!o.getMeshPeers(ot).includes(rt))continue;const st=createEncoder({pubsubTopicShardInfo:pubsubTopicToSingleShardInfo(ot),contentTopic:RelayPingContentTopic,ephemeral:!0}),at=setInterval(()=>{log$k.info("Sending Waku Relay ping message"),o.send(st,{payload:new Uint8Array([1])}).catch(ct=>log$k.error("Failed to send relay ping",ct))},tt*1e3);nt.push(at)}return nt}}const log$j=new Logger$1("connection-manager"),DEFAULT_MAX_BOOTSTRAP_PEERS_ALLOWED=1,DEFAULT_MAX_DIAL_ATTEMPTS_FOR_PEER=3,DEFAULT_MAX_PARALLEL_DIALS=3,Nn=class Nn extends TypedEventEmitter$3{constructor(tt,rt,nt,ot,it){super();wt(this,"configuredPubsubTopics");wt(this,"keepAliveManager");wt(this,"options");wt(this,"libp2p");wt(this,"dialAttemptsForPeer",new Map);wt(this,"dialErrorsForPeer",new Map);wt(this,"currentActiveParallelDialCount",0);wt(this,"pendingPeerDialQueue",[]);wt(this,"isP2PNetworkConnected",!1);wt(this,"onEventHandlers",{"peer:discovery":tt=>{(async()=>{const{id:rt}=tt.detail;await this.dispatchDiscoveryEvent(rt);try{await this.attemptDial(rt)}catch(nt){log$j.error(`Error dialing peer ${rt.toString()} : ${nt}`)}})()},"peer:connect":tt=>{(async()=>{log$j.info(`Connected to peer ${tt.detail.toString()}`);const rt=tt.detail;this.keepAliveManager.start(rt),(await this.getTagNamesForPeer(rt)).includes(Tags.BOOTSTRAP)?this.libp2p.getConnections().filter(it=>it.tags.includes(Tags.BOOTSTRAP)).length>this.options.maxBootstrapPeersAllowed?await this.dropConnection(rt):this.dispatchEvent(new CustomEvent(EPeersByDiscoveryEvents.PEER_CONNECT_BOOTSTRAP,{detail:rt})):this.dispatchEvent(new CustomEvent(EPeersByDiscoveryEvents.PEER_CONNECT_PEER_EXCHANGE,{detail:rt})),this.setP2PNetworkConnected()})()},"peer:disconnect":tt=>{(async()=>(this.keepAliveManager.stop(tt.detail),this.setP2PNetworkDisconnected()))()},"browser:network":()=>{this.dispatchWakuConnectionEvent()}});this.configuredPubsubTopics=nt,this.libp2p=tt,this.configuredPubsubTopics=nt,this.options={maxDialAttemptsForPeer:DEFAULT_MAX_DIAL_ATTEMPTS_FOR_PEER,maxBootstrapPeersAllowed:DEFAULT_MAX_BOOTSTRAP_PEERS_ALLOWED,maxParallelDials:DEFAULT_MAX_PARALLEL_DIALS,...it},this.keepAliveManager=new KeepAliveManager({relay:ot,libp2p:tt,options:rt}),this.startEventListeners().then(()=>log$j.info("Connection Manager is now running")).catch(st=>log$j.error("Unexpected error while running service",st)),this.dialPeerStorePeers().catch(st=>log$j.error("Unexpected error while dialing peer store peers",st))}isConnected(){var tt;return globalThis!=null&&globalThis.navigator&&!((tt=globalThis==null?void 0:globalThis.navigator)!=null&&tt.onLine)?!1:this.isP2PNetworkConnected}static create(tt,rt,nt,ot,it,st){let at=Nn.instances.get(tt);return at||(at=new Nn(rt,nt,ot,it,st),Nn.instances.set(tt,at)),at}stop(){this.keepAliveManager.stopAll(),this.libp2p.removeEventListener("peer:connect",this.onEventHandlers["peer:connect"]),this.libp2p.removeEventListener("peer:disconnect",this.onEventHandlers["peer:disconnect"]),this.libp2p.removeEventListener("peer:discovery",this.onEventHandlers["peer:discovery"]),this.stopNetworkStatusListener()}async dropConnection(tt){try{this.keepAliveManager.stop(tt),await this.libp2p.hangUp(tt),log$j.info(`Dropped connection with peer ${tt.toString()}`)}catch(rt){log$j.error(`Error dropping connection with peer ${tt.toString()} - ${rt}`)}}async getPeersByDiscovery(){const tt=await this.libp2p.peerStore.all(),rt=this.libp2p.getConnections().map(lt=>lt.remotePeer),nt=[],ot=[],it=[],st=[],at=[],ct=[];for(const lt of tt){const dt=await this.getTagNamesForPeer(lt.id);dt.includes(Tags.BOOTSTRAP)?nt.push(lt):dt.includes(Tags.PEER_EXCHANGE)?ot.push(lt):dt.includes(Tags.LOCAL)&&it.push(lt)}for(const lt of rt){const dt=await this.libp2p.peerStore.get(lt),ht=await this.getTagNamesForPeer(lt);ht.includes(Tags.BOOTSTRAP)?st.push(dt):ht.includes(Tags.PEER_EXCHANGE)?at.push(dt):ht.includes(Tags.LOCAL)&&ct.push(dt)}return{DISCOVERED:{[Tags.BOOTSTRAP]:nt,[Tags.PEER_EXCHANGE]:ot,[Tags.LOCAL]:it},CONNECTED:{[Tags.BOOTSTRAP]:st,[Tags.PEER_EXCHANGE]:at,[Tags.LOCAL]:ct}}}async dialPeerStorePeers(){const tt=await this.libp2p.peerStore.all(),rt=[];for(const nt of tt)this.libp2p.getConnections().find(ot=>ot.remotePeer===nt.id)||rt.push(this.attemptDial(nt.id));try{await Promise.all(rt)}catch(nt){log$j.error("Unexpected error while dialing peer store peers",nt)}}async startEventListeners(){this.startPeerDiscoveryListener(),this.startPeerConnectionListener(),this.startPeerDisconnectionListener(),this.startNetworkStatusListener()}async dialPeer(tt){this.currentActiveParallelDialCount+=1;let rt=0;for(;rt{ot.tags=Array.from(new Set([...ot.tags,...nt]))}),this.dialAttemptsForPeer.set(tt.toString(),-1),this.keepAliveManager.start(tt);break}catch(nt){nt instanceof AggregateError?log$j.error(`Error dialing peer ${tt.toString()} - ${nt.errors}`):log$j.error(`Error dialing peer ${tt.toString()} - ${nt.message}`),this.dialErrorsForPeer.set(tt.toString(),nt),rt++,this.dialAttemptsForPeer.set(tt.toString(),rt)}if(this.currentActiveParallelDialCount--,this.processDialQueue(),rt===this.options.maxDialAttemptsForPeer)try{const nt=this.dialErrorsForPeer.get(tt.toString());if(nt){let ot;nt instanceof AggregateError?nt.errors?nt.errors.length===0?log$j.warn("Errors array is empty for AggregateError"):ot=JSON.stringify(nt.errors[0]):log$j.warn("No errors array found for AggregateError"):ot=nt.message,log$j.info(`Deleting undialable peer ${tt.toString()} from peer store. Reason: ${ot}`)}this.dialErrorsForPeer.delete(tt.toString()),await this.libp2p.peerStore.delete(tt),await this.attemptDnsDiscovery()}catch(nt){throw new Error(`Error deleting undialable peer ${tt.toString()} from peer store - ${nt}`)}}async attemptDnsDiscovery(){if(this.libp2p.getConnections().length>0||(await this.libp2p.peerStore.all()).length>0)return;log$j.info("Attempting to trigger DNS discovery.");const tt=Object.values(this.libp2p.components.components).find(rt=>rt&&rt.toString?rt.toString().includes(DNS_DISCOVERY_TAG):!1);tt&&await tt.findPeers()}processDialQueue(){if(this.pendingPeerDialQueue.length>0&&this.currentActiveParallelDialCount{log$j.error(rt)})}}startPeerDiscoveryListener(){this.libp2p.addEventListener("peer:discovery",this.onEventHandlers["peer:discovery"])}startPeerConnectionListener(){this.libp2p.addEventListener("peer:connect",this.onEventHandlers["peer:connect"])}startPeerDisconnectionListener(){this.libp2p.addEventListener("peer:disconnect",this.onEventHandlers["peer:disconnect"])}async attemptDial(tt){if(await this.shouldDialPeer(tt)){if(this.currentActiveParallelDialCount>=this.options.maxParallelDials){this.pendingPeerDialQueue.push(tt);return}await this.dialPeer(tt)}}async shouldDialPeer(tt){if(this.libp2p.getConnections(tt).length>0)return log$j.warn(`Already connected to peer ${tt.toString()}. Not dialing.`),!1;if(!await this.isPeerTopicConfigured(tt)){const st=await this.getPeerShardInfo(tt,this.libp2p.peerStore);return log$j.warn(`Discovered peer ${tt.toString()} with ShardInfo ${st} is not part of any of the configured pubsub topics (${this.configuredPubsubTopics}). - Not dialing.`),!1}return await this.isPeerDialableBasedOnBootstrapStatus(tt)?this.dialAttemptsForPeer.has(tt.toString())?(log$j.warn(`Peer ${tt.toString()} has already been attempted dial before, or already has a dial attempt in progress, skipping dial`),!1):!0:(log$j.warn(`Peer ${tt.toString()} is not dialable based on bootstrap status. Not dialing.`),!1)}async isPeerDialableBasedOnBootstrapStatus(tt){return(await this.getTagNamesForPeer(tt)).some(it=>it===Tags.BOOTSTRAP)?this.libp2p.getConnections().filter(it=>it.tags.find(st=>st===Tags.BOOTSTRAP)).lengththis.configuredPubsubTopics.includes(it)):!0}async getPeerShardInfo(tt,rt){const ot=(await rt.get(tt)).metadata.get("shardInfo");if(ot)return decodeRelayShard(ot)}startNetworkStatusListener(){try{globalThis.addEventListener("online",this.onEventHandlers["browser:network"]),globalThis.addEventListener("offline",this.onEventHandlers["browser:network"])}catch(tt){log$j.error(`Failed to start network listener: ${tt}`)}}stopNetworkStatusListener(){try{globalThis.removeEventListener("online",this.onEventHandlers["browser:network"]),globalThis.removeEventListener("offline",this.onEventHandlers["browser:network"])}catch(tt){log$j.error(`Failed to stop network listener: ${tt}`)}}setP2PNetworkConnected(){this.isP2PNetworkConnected||(this.isP2PNetworkConnected=!0,this.dispatchWakuConnectionEvent())}setP2PNetworkDisconnected(){this.isP2PNetworkConnected&&this.libp2p.getConnections().length===0&&(this.isP2PNetworkConnected=!1,this.dispatchWakuConnectionEvent())}dispatchWakuConnectionEvent(){this.dispatchEvent(new CustomEvent(EConnectionStateEvents.CONNECTION_STATUS,{detail:this.isConnected()}))}};wt(Nn,"instances",new Map);let ConnectionManager=Nn;const An=class An{constructor(){wt(this,"health");this.health={overallStatus:HealthStatus.Unhealthy,protocolStatuses:new Map}}static getInstance(){return An.instance||(An.instance=new An),An.instance}getHealthStatus(){return this.health.overallStatus}getProtocolStatus(o){return this.health.protocolStatuses.get(o)}updateProtocolHealth(o,tt){const rt=this.getNameFromMulticodec(o);let nt=HealthStatus.Unhealthy;tt==1?nt=HealthStatus.MinimallyHealthy:tt>=2&&(nt=HealthStatus.SufficientlyHealthy),this.health.protocolStatuses.set(rt,{name:rt,status:nt,lastUpdate:new Date}),this.updateOverallHealth()}getNameFromMulticodec(o){let tt;if(o.includes("filter"))tt=Protocols.Filter;else if(o.includes("lightpush"))tt=Protocols.LightPush;else if(o.includes("store"))tt=Protocols.Store;else throw new Error(`Unknown protocol: ${o}`);return tt}updateOverallHealth(){const tt=[Protocols.LightPush,Protocols.Filter].map(rt=>{var nt;return(nt=this.getProtocolStatus(rt))==null?void 0:nt.status});tt.some(rt=>rt===HealthStatus.Unhealthy)?this.health.overallStatus=HealthStatus.Unhealthy:tt.some(rt=>rt===HealthStatus.MinimallyHealthy)?this.health.overallStatus=HealthStatus.MinimallyHealthy:this.health.overallStatus=HealthStatus.SufficientlyHealthy}};wt(An,"instance");let HealthManager=An;const getHealthManager=()=>HealthManager.getInstance(),log$i=new Logger$1("metadata"),MetadataCodec="/vac/waku/metadata/1.0.0";class Metadata extends BaseProtocol{constructor(tt,rt){super(MetadataCodec,rt.components,log$i,tt);wt(this,"pubsubTopics");wt(this,"libp2pComponents");wt(this,"handshakesConfirmed",new Map);this.pubsubTopics=tt,this.libp2pComponents=rt,rt.registrar.handle(MetadataCodec,nt=>{this.onRequest(nt)})}async query(tt){const rt=WakuMetadataRequest.encode(pubsubTopicsToShardInfo(this.pubsubTopics)),nt=await this.libp2pComponents.peerStore.get(tt);if(!nt)return{shardInfo:null,error:ProtocolError$1.NO_PEER_AVAILABLE};let ot;try{ot=await this.getStream(nt)}catch(ct){return log$i.error("Failed to get stream",ct),{shardInfo:null,error:ProtocolError$1.NO_STREAM_AVAILABLE}}const it=await pipe([rt],encode$K,ot,decode$U,async ct=>await all$2(ct)),{error:st,shardInfo:at}=this.decodeMetadataResponse(it);return st?{shardInfo:null,error:st}:(await this.savePeerShardInfo(tt,at),{shardInfo:at,error:null})}async confirmOrAttemptHandshake(tt){const rt=this.handshakesConfirmed.get(tt.toString());return rt?{shardInfo:rt,error:null}:await this.query(tt)}async onRequest(tt){try{const{stream:rt,connection:nt}=tt,ot=WakuMetadataResponse.encode(pubsubTopicsToShardInfo(this.pubsubTopics)),it=await pipe([ot],encode$K,rt,decode$U,async ct=>await all$2(ct)),{error:st,shardInfo:at}=this.decodeMetadataResponse(it);if(st)return;await this.savePeerShardInfo(nt.remotePeer,at)}catch(rt){log$i.error("Error handling metadata request",rt)}}decodeMetadataResponse(tt){const rt=new Uint8ArrayList;tt.forEach(ot=>{rt.append(ot)});const nt=WakuMetadataResponse.decode(rt);return nt?{shardInfo:nt,error:null}:(log$i.error("Error decoding metadata response"),{shardInfo:null,error:ProtocolError$1.DECODE_FAILED})}async savePeerShardInfo(tt,rt){await this.libp2pComponents.peerStore.merge(tt,{metadata:{shardInfo:encodeRelayShard(rt)}}),this.handshakesConfirmed.set(tt.toString(),rt)}}function wakuMetadata(et){return o=>new Metadata(et,o)}function equals$e(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$j=base$j,_brrp__multiformats_scope_baseX$i=src$j;let Encoder$j=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$j=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$k(this,o)}},ComposedDecoder$i=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$k(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$k(et,o){return new ComposedDecoder$i({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$i=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$j(o,tt,rt),this.decoder=new Decoder$j(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$l({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$i(et,o,tt,rt)}function baseX$i({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$i(tt,et);return from$l({prefix:o,name:et,encode:rt,decode:ot=>coerce$i(nt(ot))})}function decode$T(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$J(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<=INT$5;)o[tt++]=et&255|MSB$7,et/=128;for(;et&MSBALL$5;)o[tt++]=et&255|MSB$7,et>>>=7;return o[tt]=et|0,encode$I.bytes=tt-rt+1,o}var decode$S=read$6,MSB$1$5=128,REST$1$5=127;function read$6(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$6.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1$5)<=MSB$1$5);return read$6.bytes=ot-rt,tt}var N1$5=Math.pow(2,7),N2$5=Math.pow(2,14),N3$5=Math.pow(2,21),N4$5=Math.pow(2,28),N5$5=Math.pow(2,35),N6$5=Math.pow(2,42),N7$5=Math.pow(2,49),N8$5=Math.pow(2,56),N9$5=Math.pow(2,63),length$5=function(et){return et{const[dt,ht]=decode$R(o.subarray(tt));return tt+=ht,dt};let nt=rt(),ot=DAG_PB_CODE$3;if(nt===18?(nt=0,tt=0):ot=rt(),nt!==0&&nt!==1)throw new RangeError(`Invalid CID version ${nt}`);const it=tt,st=rt(),at=rt(),ct=tt+at,lt=ct-it;return{version:nt,codec:ot,multihashCode:st,digestSize:at,multihashSize:lt,size:ct}}static parse(o,tt){const[rt,nt]=parseCIDtoBytes$3(o,tt),ot=jr.decode(nt);if(ot.version===0&&o[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$3(ot).set(rt,o),ot}};function parseCIDtoBytes$3(et,o){switch(et[0]){case"Q":{const tt=o??base58btc$i;return[base58btc$i.prefix,tt.decode(`${base58btc$i.prefix}${et}`)]}case base58btc$i.prefix:{const tt=o??base58btc$i;return[base58btc$i.prefix,tt.decode(et)]}case base32$w.prefix:{const tt=o??base32$w;return[base32$w.prefix,tt.decode(et)]}case base36$t.prefix:{const tt=o??base36$t;return[base36$t.prefix,tt.decode(et)]}default:{if(o==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[et[0],o.decode(et)]}}}function toStringV0$3(et,o,tt){const{prefix:rt}=tt;if(rt!==base58btc$i.prefix)throw Error(`Cannot string encode V0 in ${tt.name} encoding`);const nt=o.get(rt);if(nt==null){const ot=tt.encode(et).slice(1);return o.set(rt,ot),ot}else return nt}function toStringV1$3(et,o,tt){const{prefix:rt}=tt,nt=o.get(rt);if(nt==null){const ot=tt.encode(et);return o.set(rt,ot),ot}else return nt}const DAG_PB_CODE$3=112,SHA_256_CODE$3=18;function encodeCID$3(et,o,tt){const rt=encodingLength$5(et),nt=rt+encodingLength$5(o),ot=new Uint8Array(nt+tt.byteLength);return encodeTo$3(et,ot,0),encodeTo$3(o,ot,rt),ot.set(tt,nt),ot}const cidSymbol$3=Symbol.for("@ipld/js-cid/CID");function equals$c(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt(et[tt]=o,et),[]),alphabetCharsToBytes$e=alphabet$e.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$H(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$e[tt],o),"")}function decode$P(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$e[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$s=from$l({prefix:"🚀",name:"base256emoji",encode:encode$H,decode:decode$P}),base256emoji$t=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$s},Symbol.toStringTag,{value:"Module"})),base64$v=rfc4648$h({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$e=rfc4648$h({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$f=rfc4648$h({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$e=rfc4648$h({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$w=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$v,base64pad:base64pad$e,base64url:base64url$f,base64urlpad:base64urlpad$e},Symbol.toStringTag,{value:"Module"})),base8$s=rfc4648$h({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$t=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$s},Symbol.toStringTag,{value:"Module"})),identity$g=from$l({prefix:"\0",name:"identity",encode:et=>toString$u(et),decode:et=>fromString$s(et)}),identityBase$e=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$g},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$e={...identityBase$e,...base2$t,...base8$t,...base10$t,...base16$t,...base32$x,...base36$u,...base58$e,...base64$w,...base256emoji$t};function allocUnsafe$d(et=0){return new Uint8Array(et)}function createCodec$e(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$i=createCodec$e("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$e=createCodec$e("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$d(et.length);for(let tt=0;ttnt+ot.length,0));const tt=allocUnsafe$d(o);let rt=0;for(const nt of et)tt.set(nt,rt),rt+=nt.length;return tt}class Parser{constructor(){wt(this,"index",0);wt(this,"input","")}new(o){return this.index=0,this.input=o,this}readAtomically(o){const tt=this.index,rt=o();return rt===void 0&&(this.index=tt),rt}parseWith(o){const tt=o();if(this.index===this.input.length)return tt}peekChar(){if(!(this.index>=this.input.length))return this.input[this.index]}readChar(){if(!(this.index>=this.input.length))return this.input[this.index++]}readGivenChar(o){return this.readAtomically(()=>{const tt=this.readChar();if(tt===o)return tt})}readSeparator(o,tt,rt){return this.readAtomically(()=>{if(!(tt>0&&this.readGivenChar(o)===void 0))return rt()})}readNumber(o,tt,rt,nt){return this.readAtomically(()=>{let ot=0,it=0;const st=this.peekChar();if(st===void 0)return;const at=st==="0",ct=2**(8*nt)-1;for(;;){const lt=this.readAtomically(()=>{const dt=this.readChar();if(dt===void 0)return;const ht=Number.parseInt(dt,o);if(!Number.isNaN(ht))return ht});if(lt===void 0)break;if(ot*=o,ot+=lt,ot>ct||(it+=1,tt!==void 0&&it>tt))return}if(it!==0)return!rt&&at&&it>1?void 0:ot})}readIPv4Addr(){return this.readAtomically(()=>{const o=new Uint8Array(4);for(let tt=0;ttthis.readNumber(10,3,!1,1));if(rt===void 0)return;o[tt]=rt}return o})}readIPv6Addr(){const o=tt=>{for(let rt=0;rtthis.readIPv4Addr());if(it!==void 0)return tt[nt]=it[0],tt[nt+1]=it[1],tt[nt+2]=it[2],tt[nt+3]=it[3],[nt+4,!0]}const ot=this.readSeparator(":",rt,()=>this.readNumber(16,4,!0,2));if(ot===void 0)return[nt,!1];tt[nt]=ot>>8,tt[nt+1]=ot&255}return[tt.length,!1]};return this.readAtomically(()=>{const tt=new Uint8Array(16),[rt,nt]=o(tt);if(rt===16)return tt;if(nt||this.readGivenChar(":")===void 0||this.readGivenChar(":")===void 0)return;const ot=new Uint8Array(14),it=16-(rt+2),[st]=o(ot.subarray(0,it));return tt.set(ot.subarray(0,st),16-st),tt})}readIPAddr(){return this.readIPv4Addr()??this.readIPv6Addr()}}const MAX_IPV6_LENGTH=45,MAX_IPV4_LENGTH=15,parser=new Parser;function parseIPv4(et){if(!(et.length>MAX_IPV4_LENGTH))return parser.new(et).parseWith(()=>parser.readIPv4Addr())}function parseIPv6(et){if(et.includes("%")&&(et=et.split("%")[0]),!(et.length>MAX_IPV6_LENGTH))return parser.new(et).parseWith(()=>parser.readIPv6Addr())}function parseIP(et){if(et.includes("%")&&(et=et.split("%")[0]),!(et.length>MAX_IPV6_LENGTH))return parser.new(et).parseWith(()=>parser.readIPAddr())}function fromString$r(et,o="utf8"){const tt=BASES$e[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}function isIPv4(et){return!!parseIPv4(et)}function isIPv6(et){return!!parseIPv6(et)}function isIP(et){return!!parseIP(et)}const isV4=isIPv4,isV6=isIPv6,toBytes$1=function(et){let o=0;if(et=et.toString().trim(),isV4(et)){const tt=new Uint8Array(o+4);return et.split(/\./g).forEach(rt=>{tt[o++]=parseInt(rt,10)&255}),tt}if(isV6(et)){const tt=et.split(":",8);let rt;for(rt=0;rt0;rt--)ot.push("0");tt.splice.apply(tt,ot)}const nt=new Uint8Array(o+16);for(rt=0;rt>8&255,nt[o++]=ot&255}return nt}throw new Error("invalid ip address")},toString$s=function(et,o=0,tt){o=~~o,tt=tt??et.length-o;const rt=new DataView(et.buffer);if(tt===4){const nt=[];for(let ot=0;ot{const o=createProtocol(...et);codes[o.code]=o,names[o.name]=o});function createProtocol(et,o,tt,rt,nt){return{code:et,size:o,name:tt,resolvable:!!rt,path:!!nt}}function getProtocol(et){if(typeof et=="number"){if(codes[et]!=null)return codes[et];throw new Error(`no protocol with code: ${et}`)}else if(typeof et=="string"){if(names[et]!=null)return names[et];throw new Error(`no protocol with name: ${et}`)}throw new Error(`invalid protocol id type: ${typeof et}`)}getProtocol("ip4");getProtocol("ip6");getProtocol("ipcidr");function convertToString(et,o){switch(getProtocol(et).code){case 4:case 41:return bytes2ip(o);case 42:return bytes2str(o);case 6:case 273:case 33:case 132:return bytes2port(o).toString();case 53:case 54:case 55:case 56:case 400:case 449:case 777:return bytes2str(o);case 421:return bytes2mh(o);case 444:return bytes2onion(o);case 445:return bytes2onion(o);case 466:return bytes2mb(o);case 481:return globalThis.encodeURIComponent(bytes2str(o));default:return toString$t(o,"base16")}}function convertToBytes(et,o){switch(getProtocol(et).code){case 4:return ip2bytes(o);case 41:return ip2bytes(o);case 42:return str2bytes(o);case 6:case 273:case 33:case 132:return port2bytes(parseInt(o,10));case 53:case 54:case 55:case 56:case 400:case 449:case 777:return str2bytes(o);case 421:return mh2bytes(o);case 444:return onion2bytes(o);case 445:return onion32bytes(o);case 466:return mb2bytes(o);case 481:return str2bytes(globalThis.decodeURIComponent(o));default:return fromString$r(o,"base16")}}const decoders=Object.values(bases$e).map(et=>et.decoder),anybaseDecoder=function(){let et=decoders[0].or(decoders[1]);return decoders.slice(2).forEach(o=>et=et.or(o)),et}();function ip2bytes(et){if(!isIP(et))throw new Error("invalid ip address");return toBytes$1(et)}function bytes2ip(et){const o=toString$s(et,0,et.length);if(o==null)throw new Error("ipBuff is required");if(!isIP(o))throw new Error("invalid ip address");return o}function port2bytes(et){const o=new ArrayBuffer(2);return new DataView(o).setUint16(0,et),new Uint8Array(o)}function bytes2port(et){return new DataView(et.buffer).getUint16(et.byteOffset)}function str2bytes(et){const o=fromString$r(et),tt=Uint8Array.from(encode$P(o.length));return concat$3([tt,o],tt.length+o.length)}function bytes2str(et){const o=decode$Z(et);if(et=et.slice(encodingLength$6(o)),et.length!==o)throw new Error("inconsistent lengths");return toString$t(et)}function mh2bytes(et){let o;et[0]==="Q"||et[0]==="1"?o=decode$Q(base58btc$i.decode(`z${et}`)).bytes:o=CID$3.parse(et).multihash.bytes;const tt=Uint8Array.from(encode$P(o.length));return concat$3([tt,o],tt.length+o.length)}function mb2bytes(et){const o=anybaseDecoder.decode(et),tt=Uint8Array.from(encode$P(o.length));return concat$3([tt,o],tt.length+o.length)}function bytes2mb(et){const o=decode$Z(et),tt=et.slice(encodingLength$6(o));if(tt.length!==o)throw new Error("inconsistent lengths");return"u"+toString$t(tt,"base64url")}function bytes2mh(et){const o=decode$Z(et),tt=et.slice(encodingLength$6(o));if(tt.length!==o)throw new Error("inconsistent lengths");return toString$t(tt,"base58btc")}function onion2bytes(et){const o=et.split(":");if(o.length!==2)throw new Error(`failed to parse onion addr: ["'${o.join('", "')}'"]' does not contain a port number`);if(o[0].length!==16)throw new Error(`failed to parse onion addr: ${o[0]} not a Tor onion address.`);const tt=base32$w.decode("b"+o[0]),rt=parseInt(o[1],10);if(rt<1||rt>65536)throw new Error("Port number is not in range(1, 65536)");const nt=port2bytes(rt);return concat$3([tt,nt],tt.length+nt.length)}function onion32bytes(et){const o=et.split(":");if(o.length!==2)throw new Error(`failed to parse onion addr: ["'${o.join('", "')}'"]' does not contain a port number`);if(o[0].length!==56)throw new Error(`failed to parse onion addr: ${o[0]} not a Tor onion3 address.`);const tt=base32$w.decode(`b${o[0]}`),rt=parseInt(o[1],10);if(rt<1||rt>65536)throw new Error("Port number is not in range(1, 65536)");const nt=port2bytes(rt);return concat$3([tt,nt],tt.length+nt.length)}function bytes2onion(et){const o=et.slice(0,et.length-2),tt=et.slice(et.length-2),rt=toString$t(o,"base32"),nt=bytes2port(tt);return`${rt}:${nt}`}function stringToMultiaddrParts(et){et=cleanPath(et);const o=[],tt=[];let rt=null;const nt=et.split("/").slice(1);if(nt.length===1&&nt[0]==="")return{bytes:new Uint8Array,string:"/",tuples:[],stringTuples:[],path:null};for(let ot=0;ot=nt.length)throw ParseError("invalid address: "+et);if(st.path===!0){rt=cleanPath(nt.slice(ot).join("/")),o.push([st.code,convertToBytes(st.code,rt)]),tt.push([st.code,rt]);break}const at=convertToBytes(st.code,nt[ot]);o.push([st.code,at]),tt.push([st.code,convertToString(st.code,at)])}return{string:stringTuplesToString(tt),bytes:tuplesToBytes(o),tuples:o,stringTuples:tt,path:rt}}function bytesToMultiaddrParts(et){const o=[],tt=[];let rt=null,nt=0;for(;ntet.length)throw ParseError("Invalid address Uint8Array: "+toString$t(et,"base16"));o.push([ot,ct]);const lt=convertToString(ot,ct);if(tt.push([ot,lt]),st.path===!0){rt=lt;break}}return{bytes:Uint8Array.from(et),string:stringTuplesToString(tt),tuples:o,stringTuples:tt,path:rt}}function stringTuplesToString(et){const o=[];return et.map(tt=>{const rt=getProtocol(tt[0]);return o.push(rt.name),tt.length>1&&tt[1]!=null&&o.push(tt[1]),null}),cleanPath(o.join("/"))}function tuplesToBytes(et){return concat$3(et.map(o=>{const tt=getProtocol(o[0]);let rt=Uint8Array.from(encode$P(tt.code));return o.length>1&&o[1]!=null&&(rt=concat$3([rt,o[1]])),rt}))}function sizeForAddr(et,o){if(et.size>0)return et.size/8;if(et.size===0)return 0;{const tt=decode$Z(o instanceof Uint8Array?o:Uint8Array.from(o));return tt+encodingLength$6(tt)}}function cleanPath(et){return"/"+et.trim().split("/").filter(o=>o).join("/")}function ParseError(et){return new Error("Error parsing address: "+et)}const inspect$1=Symbol.for("nodejs.util.inspect.custom"),symbol=Symbol.for("@multiformats/js-multiaddr/multiaddr"),DNS_CODES=[getProtocol("dns").code,getProtocol("dns4").code,getProtocol("dns6").code,getProtocol("dnsaddr").code];class NoAvailableResolverError extends Error{constructor(o="No available resolver"){super(o),this.name="NoAvailableResolverError"}}var ga,Yn,wn,lo,uo;const Dn=class Dn{constructor(o){wt(this,"bytes");fr(this,Yn);fr(this,wn);fr(this,lo);fr(this,uo);wt(this,ga,!0);o==null&&(o="");let tt;if(o instanceof Uint8Array)tt=bytesToMultiaddrParts(o);else if(typeof o=="string"){if(o.length>0&&o.charAt(0)!=="/")throw new Error(`multiaddr "${o}" must start with a "/"`);tt=stringToMultiaddrParts(o)}else if(isMultiaddr(o))tt=bytesToMultiaddrParts(o.bytes);else throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=tt.bytes,lr(this,Yn,tt.string),lr(this,wn,tt.tuples),lr(this,lo,tt.stringTuples),lr(this,uo,tt.path)}toString(){return Ot(this,Yn)}toJSON(){return this.toString()}toOptions(){let o,tt,rt,nt,ot="";const it=getProtocol("tcp"),st=getProtocol("udp"),at=getProtocol("ip4"),ct=getProtocol("ip6"),lt=getProtocol("dns6"),dt=getProtocol("ip6zone");for(const[mt,ft]of this.stringTuples())mt===dt.code&&(ot=`%${ft??""}`),DNS_CODES.includes(mt)&&(tt=it.name,nt=443,rt=`${ft??""}${ot}`,o=mt===lt.code?6:4),(mt===it.code||mt===st.code)&&(tt=getProtocol(mt).name,nt=parseInt(ft??"")),(mt===at.code||mt===ct.code)&&(tt=getProtocol(mt).name,rt=`${ft??""}${ot}`,o=mt===ct.code?6:4);if(o==null||tt==null||rt==null||nt==null)throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');return{family:o,host:rt,transport:tt,port:nt}}protos(){return Ot(this,wn).map(([o])=>Object.assign({},getProtocol(o)))}protoCodes(){return Ot(this,wn).map(([o])=>o)}protoNames(){return Ot(this,wn).map(([o])=>getProtocol(o).name)}tuples(){return Ot(this,wn)}stringTuples(){return Ot(this,lo)}encapsulate(o){return o=new Dn(o),new Dn(this.toString()+o.toString())}decapsulate(o){const tt=o.toString(),rt=this.toString(),nt=rt.lastIndexOf(tt);if(nt<0)throw new Error(`Address ${this.toString()} does not contain subaddress: ${o.toString()}`);return new Dn(rt.slice(0,nt))}decapsulateCode(o){const tt=this.tuples();for(let rt=tt.length-1;rt>=0;rt--)if(tt[rt][0]===o)return new Dn(tuplesToBytes(tt.slice(0,rt)));return this}getPeerId(){try{let o=[];this.stringTuples().forEach(([rt,nt])=>{rt===names.p2p.code&&o.push([rt,nt]),rt===names["p2p-circuit"].code&&(o=[])});const tt=o.pop();if((tt==null?void 0:tt[1])!=null){const rt=tt[1];return rt[0]==="Q"||rt[0]==="1"?toString$t(base58btc$i.decode(`z${rt}`),"base58btc"):toString$t(CID$3.parse(rt).multihash.bytes,"base58btc")}return null}catch{return null}}getPath(){return Ot(this,uo)}equals(o){return equals$c(this.bytes,o.bytes)}async resolve(o){const tt=this.protos().find(ot=>ot.resolvable);if(tt==null)return[this];const rt=resolvers$1.get(tt.name);if(rt==null)throw new NoAvailableResolverError(`no available resolver for ${tt.name}`);return(await rt(this,o)).map(ot=>multiaddr(ot))}nodeAddress(){const o=this.toOptions();if(o.transport!=="tcp"&&o.transport!=="udp")throw new Error(`multiaddr must have a valid format - no protocol with name: "${o.transport}". Must have a valid transport protocol: "{tcp, udp}"`);return{family:o.family,address:o.host,port:o.port}}isThinWaistAddress(o){const tt=(o??this).protos();return!(tt.length!==2||tt[0].code!==4&&tt[0].code!==41||tt[1].code!==6&&tt[1].code!==273)}[(ga=symbol,inspect$1)](){return`Multiaddr(${Ot(this,Yn)})`}};Yn=new WeakMap,wn=new WeakMap,lo=new WeakMap,uo=new WeakMap;let Multiaddr=Dn;const resolvers$1=new Map;function isMultiaddr(et){return!!(et!=null&&et[symbol])}function multiaddr(et){return new Multiaddr(et)}const E_CANCELED=new Error("request for lock canceled");var __awaiter$2=function(et,o,tt,rt){function nt(ot){return ot instanceof tt?ot:new tt(function(it){it(ot)})}return new(tt||(tt=Promise))(function(ot,it){function st(lt){try{ct(rt.next(lt))}catch(dt){it(dt)}}function at(lt){try{ct(rt.throw(lt))}catch(dt){it(dt)}}function ct(lt){lt.done?ot(lt.value):nt(lt.value).then(st,at)}ct((rt=rt.apply(et,o||[])).next())})};class Semaphore{constructor(o,tt=E_CANCELED){this._value=o,this._cancelError=tt,this._queue=[],this._weightedWaiters=[]}acquire(o=1,tt=0){if(o<=0)throw new Error(`invalid weight ${o}: must be positive`);return new Promise((rt,nt)=>{const ot={resolve:rt,reject:nt,weight:o,priority:tt},it=findIndexFromEnd(this._queue,st=>tt<=st.priority);it===-1&&o<=this._value?this._dispatchItem(ot):this._queue.splice(it+1,0,ot)})}runExclusive(o){return __awaiter$2(this,arguments,void 0,function*(tt,rt=1,nt=0){const[ot,it]=yield this.acquire(rt,nt);try{return yield tt(ot)}finally{it()}})}waitForUnlock(o=1,tt=0){if(o<=0)throw new Error(`invalid weight ${o}: must be positive`);return this._couldLockImmediately(o,tt)?Promise.resolve():new Promise(rt=>{this._weightedWaiters[o-1]||(this._weightedWaiters[o-1]=[]),insertSorted(this._weightedWaiters[o-1],{resolve:rt,priority:tt})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(o){this._value=o,this._dispatchQueue()}release(o=1){if(o<=0)throw new Error(`invalid weight ${o}: must be positive`);this._value+=o,this._dispatchQueue()}cancel(){this._queue.forEach(o=>o.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(o){const tt=this._value;this._value-=o.weight,o.resolve([tt,this._newReleaser(o.weight)])}_newReleaser(o){let tt=!1;return()=>{tt||(tt=!0,this.release(o))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let o=this._value;o>0;o--){const tt=this._weightedWaiters[o-1];tt&&(tt.forEach(rt=>rt.resolve()),this._weightedWaiters[o-1]=[])}else{const o=this._queue[0].priority;for(let tt=this._value;tt>0;tt--){const rt=this._weightedWaiters[tt-1];if(!rt)continue;const nt=rt.findIndex(ot=>ot.priority<=o);(nt===-1?rt:rt.splice(0,nt)).forEach(ot=>ot.resolve())}}}_couldLockImmediately(o,tt){return(this._queue.length===0||this._queue[0].priorityo.priority<=rt.priority);et.splice(tt+1,0,o)}function findIndexFromEnd(et,o){for(let tt=et.length-1;tt>=0;tt--)if(o(et[tt]))return tt;return-1}var __awaiter$1=function(et,o,tt,rt){function nt(ot){return ot instanceof tt?ot:new tt(function(it){it(ot)})}return new(tt||(tt=Promise))(function(ot,it){function st(lt){try{ct(rt.next(lt))}catch(dt){it(dt)}}function at(lt){try{ct(rt.throw(lt))}catch(dt){it(dt)}}function ct(lt){lt.done?ot(lt.value):nt(lt.value).then(st,at)}ct((rt=rt.apply(et,o||[])).next())})};class Mutex{constructor(o){this._semaphore=new Semaphore(1,o)}acquire(){return __awaiter$1(this,arguments,void 0,function*(o=0){const[,tt]=yield this._semaphore.acquire(1,o);return tt})}runExclusive(o,tt=0){return this._semaphore.runExclusive(()=>o(),1,tt)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(o=0){return this._semaphore.waitForUnlock(1,o)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}class PeerManager{constructor(o,tt,rt){wt(this,"connectionManager");wt(this,"core");wt(this,"log");wt(this,"peers",new Map);wt(this,"healthManager");wt(this,"readMutex",new Mutex);wt(this,"writeMutex",new Mutex);wt(this,"writeLockHolder",null);this.connectionManager=o,this.core=tt,this.log=rt,this.healthManager=getHealthManager(),this.healthManager.updateProtocolHealth(this.core.multicodec,0)}getWriteLockHolder(){return this.writeLockHolder}getPeers(){return Array.from(this.peers.values())}async addPeer(o){return this.writeMutex.runExclusive(async()=>{this.writeLockHolder=`addPeer: ${o.id.toString()}`,await this.connectionManager.attemptDial(o.id),this.peers.set(o.id.toString(),o),this.log.info(`Added and dialed peer: ${o.id.toString()}`),this.healthManager.updateProtocolHealth(this.core.multicodec,this.peers.size),this.writeLockHolder=null})}async removePeer(o){return this.writeMutex.runExclusive(()=>{this.writeLockHolder=`removePeer: ${o.toString()}`,this.peers.delete(o.toString()),this.log.info(`Removed peer: ${o.toString()}`),this.healthManager.updateProtocolHealth(this.core.multicodec,this.peers.size),this.writeLockHolder=null})}async getPeerCount(){return this.readMutex.runExclusive(()=>this.peers.size)}async hasPeers(){return this.readMutex.runExclusive(()=>this.peers.size>0)}async removeExcessPeers(o){this.log.info(`Removing ${o} excess peer(s)`);const tt=Array.from(this.peers.values()).slice(0,o);for(const rt of tt)await this.removePeer(rt.id)}async findAndAddPeers(o){const tt=await this.findPeers(o);return tt.length===0?(this.log.warn("No additional peers found"),[]):this.addMultiplePeers(tt)}async findPeers(o){const tt=await this.core.getPeers();return this.readMutex.runExclusive(async()=>tt.filter(nt=>!this.peers.has(nt.id.toString())).slice(0,o))}async addMultiplePeers(o){const tt=[];for(const rt of o)await this.addPeer(rt),tt.push(rt);return tt}}const DEFAULT_NUM_PEERS_TO_USE=2,DEFAULT_MAINTAIN_PEERS_INTERVAL=3e4;class BaseProtocolSDK{constructor(o,tt,rt){wt(this,"core");wt(this,"connectionManager");wt(this,"peerManager");wt(this,"numPeersToUse");wt(this,"maintainPeersIntervalId",null);wt(this,"log");this.core=o,this.connectionManager=tt,this.log=new Logger$1(`sdk:${o.multicodec}`),this.numPeersToUse=(rt==null?void 0:rt.numPeersToUse)??DEFAULT_NUM_PEERS_TO_USE;const nt=(rt==null?void 0:rt.maintainPeersInterval)??DEFAULT_MAINTAIN_PEERS_INTERVAL;this.peerManager=new PeerManager(tt,o,this.log),this.log.info(`Initializing BaseProtocolSDK with numPeersToUse: ${this.numPeersToUse}, maintainPeersInterval: ${nt}ms`),this.startMaintainPeersInterval(nt)}get connectedPeers(){return this.peerManager.getPeers().slice(0,this.numPeersToUse)}async renewPeer(o){this.log.info(`Attempting to renew peer ${o}`);const tt=await this.peerManager.findPeers(1);if(tt.length===0){this.log.error("Failed to find a new peer to replace the disconnected one");return}return await this.peerManager.removePeer(o),await this.peerManager.addPeer(tt[0]),this.log.info(`Successfully renewed peer. New peer: ${tt[0].id}`),tt[0]}stopMaintainPeersInterval(){this.maintainPeersIntervalId?(clearInterval(this.maintainPeersIntervalId),this.maintainPeersIntervalId=null,this.log.info("Maintain peers interval stopped")):this.log.info("Maintain peers interval was not running")}async hasPeers(o={}){const{forceUseAllPeers:tt=!1,maxAttempts:rt=3}=o;this.log.info(`Checking for peers. forceUseAllPeers: ${tt}, maxAttempts: ${rt}`);for(let nt=0;nt0)return this.log.info(`At least one peer connected (${this.connectedPeers.length}), not forcing use of all peers`),!0;if(this.connectedPeers.length>=this.numPeersToUse)return this.log.info(`Required number of peers (${this.numPeersToUse}) reached`),!0;this.log.warn(`Found only ${this.connectedPeers.length}/${this.numPeersToUse} required peers. Retrying...`)}return this.log.error(`Failed to find required number of peers (${this.numPeersToUse}) after ${rt} attempts`),!1}async startMaintainPeersInterval(o){this.log.info(`Starting maintain peers interval with ${o}ms interval`);try{this.maintainPeersIntervalId=setInterval(()=>{this.log.info("Running scheduled peer maintenance"),this.maintainPeers().catch(tt=>{this.log.error("Error during scheduled peer maintenance:",tt)})},o),this.log.info("Maintain peers interval started successfully")}catch(tt){throw this.log.error("Error starting maintain peers interval:",tt),tt}}async maintainPeers(){try{const o=await this.peerManager.getPeerCount(),tt=this.numPeersToUse-o;if(this.log.info(`Current peer count: ${o}, target: ${this.numPeersToUse}`),tt===0){this.log.info("Peer count is at target, no maintenance required");return}tt>0?(this.log.info(`Attempting to add ${tt} peer(s)`),await this.peerManager.findAndAddPeers(tt)):(this.log.info(`Attempting to remove ${Math.abs(tt)} excess peer(s)`),await this.peerManager.removeExcessPeers(Math.abs(tt)));const rt=await this.peerManager.getPeerCount();this.log.info(`Peer maintenance completed. Initial count: ${o}, Final count: ${rt}`)}catch(o){this.log.error("Error during peer maintenance",{error:o})}}}const DEFAULT_KEEP_ALIVE=6e4,DEFAULT_LIGHT_PUSH_FILTER_CHECK=!1,DEFAULT_LIGHT_PUSH_FILTER_CHECK_INTERVAL=1e4,DEFAULT_SUBSCRIBE_OPTIONS={keepAlive:DEFAULT_KEEP_ALIVE,enableLightPushFilterCheck:DEFAULT_LIGHT_PUSH_FILTER_CHECK};function messageHash(et,o){const tt=utf8ToBytes$1(et),rt=utf8ToBytes$1(o.contentTopic),nt=tryConvertTimestampToBytes(o.timestamp),ot=concat$5([tt,o.payload,rt,o.meta,nt].filter(isDefined));return sha256$3(ot)}function tryConvertTimestampToBytes(et){if(!et)return;let o;return typeof et=="bigint"?o=et:o=BigInt(et.valueOf())*1000000n,numberToBytes(o)}function messageHashStr(et,o){const tt=messageHash(et,o);return bytesToHex$1(tt)}const log$h=new Logger$1("sdk:receiver:reliability_monitor"),DEFAULT_MAX_PINGS=3,MESSAGE_VERIFICATION_DELAY=5e3;class ReceiverReliabilityMonitor{constructor(o,tt,rt,nt,ot,it,st){wt(this,"pubsubTopic");wt(this,"getPeers");wt(this,"renewPeer");wt(this,"getContentTopics");wt(this,"protocolSubscribe");wt(this,"addLibp2pEventListener");wt(this,"sendLightPushMessage");wt(this,"receivedMessagesFormPeer",new Set);wt(this,"receivedMessages",new Set);wt(this,"scheduledVerification",new Map);wt(this,"verifiedPeers",new Set);wt(this,"peerFailures",new Map);wt(this,"maxPingFailures",DEFAULT_MAX_PINGS);wt(this,"peerRenewalLocks",new Set);this.pubsubTopic=o,this.getPeers=tt,this.renewPeer=rt,this.getContentTopics=nt,this.protocolSubscribe=ot,this.addLibp2pEventListener=it,this.sendLightPushMessage=st,this.addLibp2pEventListener("peer:disconnect",at=>{const ct=at.detail;this.getPeers().some(lt=>lt.id.equals(ct))&&this.renewAndSubscribePeer(ct)})}setMaxPingFailures(o){o!==void 0&&(this.maxPingFailures=o)}async handlePingResult(o,tt){if(tt!=null&&tt.success){this.peerFailures.delete(o.toString());return}const rt=(this.peerFailures.get(o.toString())||0)+1;if(this.peerFailures.set(o.toString(),rt),rt>=this.maxPingFailures)try{log$h.info(`Attempting to renew ${o.toString()} due to ping failures.`),await this.renewAndSubscribePeer(o),this.peerFailures.delete(o.toString())}catch(nt){log$h.error(`Failed to renew peer ${o.toString()}: ${nt}.`)}}notifyMessageReceived(o,tt){const rt=this.buildMessageHash(tt);return this.verifiedPeers.add(o),this.receivedMessagesFormPeer.add(`${o}-${rt}`),log$h.info(`notifyMessage received debug: ephemeral:${tt.ephemeral} ${bytesToUtf8(tt.payload)}`),log$h.info(`notifyMessage received: peer:${o} message:${rt}`),this.receivedMessages.has(rt)?!0:(this.receivedMessages.add(rt),!1)}notifyMessageSent(o,tt){const rt=o.toString(),nt=this.buildMessageHash(tt);if(log$h.info(`notifyMessage sent debug: ${bytesToUtf8(tt.payload)}`),this.scheduledVerification.has(rt)){log$h.warn(`notifyMessage sent: attempting to schedule verification for pending peer:${rt} message:${nt}`);return}const ot=window.setTimeout(async()=>{const it=this.verifiedPeers.has(rt),st=this.receivedMessagesFormPeer.has(`${rt}-${nt}`);if(it||st){log$h.info(`notifyMessage sent setTimeout: verified that peer pushes filter messages, peer:${rt} message:${nt}`);return}log$h.warn(`notifyMessage sent setTimeout: peer didn't return probe message, attempting renewAndSubscribe, peer:${rt} message:${nt}`),this.scheduledVerification.delete(rt),await this.renewAndSubscribePeer(o)},MESSAGE_VERIFICATION_DELAY);this.scheduledVerification.set(rt,ot)}shouldVerifyPeer(o){const tt=o.toString(),rt=this.verifiedPeers.has(tt),nt=this.scheduledVerification.has(tt);return!(rt||nt)}buildMessageHash(o){return messageHashStr(this.pubsubTopic,o)}async renewAndSubscribePeer(o){const tt=o.toString();try{if(this.peerRenewalLocks.has(tt)){log$h.info(`Peer ${tt} is already being renewed.`);return}this.peerRenewalLocks.add(tt);const rt=await this.renewPeer(o);if(!rt){log$h.warn(`Failed to renew peer ${tt}: No new peer found.`);return}return await this.protocolSubscribe(this.pubsubTopic,rt,this.getContentTopics()),await this.sendLightPushMessage(rt),this.peerFailures.delete(tt),rt}catch(rt){log$h.error(`Failed to renew peer ${tt}: ${rt}.`);return}finally{this.peerRenewalLocks.delete(tt)}}}const Ln=class Ln{static createReceiverMonitor(o,tt,rt,nt,ot,it,st){if(Ln.receiverMonitors.has(o))return Ln.receiverMonitors.get(o);const at=new ReceiverReliabilityMonitor(o,tt,rt,nt,ot,it,st);return Ln.receiverMonitors.set(o,at),at}constructor(){}static stop(o){this.receiverMonitors.delete(o)}static stopAll(){for(const[o,tt]of this.receiverMonitors)tt.setMaxPingFailures(void 0),this.receiverMonitors.delete(o)}};wt(Ln,"receiverMonitors",new Map);let ReliabilityMonitorManager=Ln;const log$g=new Logger$1("sdk:filter:subscription_manager");class SubscriptionManager{constructor(o,tt,rt,nt,ot,it,st){wt(this,"pubsubTopic");wt(this,"protocol");wt(this,"connectionManager");wt(this,"getPeers");wt(this,"renewPeer");wt(this,"libp2p");wt(this,"lightPush");wt(this,"reliabilityMonitor");wt(this,"keepAliveTimeout",DEFAULT_KEEP_ALIVE);wt(this,"keepAliveInterval",null);wt(this,"enableLightPushFilterCheck",DEFAULT_LIGHT_PUSH_FILTER_CHECK);wt(this,"subscriptionCallbacks");this.pubsubTopic=o,this.protocol=tt,this.connectionManager=rt,this.getPeers=nt,this.renewPeer=ot,this.libp2p=it,this.lightPush=st,this.pubsubTopic=o,this.subscriptionCallbacks=new Map,this.reliabilityMonitor=ReliabilityMonitorManager.createReceiverMonitor(this.pubsubTopic,this.getPeers.bind(this),this.renewPeer.bind(this),()=>Array.from(this.subscriptionCallbacks.keys()),this.protocol.subscribe.bind(this.protocol),this.protocol.addLibp2pEventListener.bind(this.protocol),this.sendLightPushCheckMessage.bind(this))}async subscribe(o,tt,rt=DEFAULT_SUBSCRIBE_OPTIONS){this.reliabilityMonitor.setMaxPingFailures(rt.pingsBeforePeerRenewed),this.keepAliveTimeout=rt.keepAlive||DEFAULT_KEEP_ALIVE,this.enableLightPushFilterCheck=(rt==null?void 0:rt.enableLightPushFilterCheck)||DEFAULT_LIGHT_PUSH_FILTER_CHECK;const nt=Array.isArray(o)?o:[o];for(const lt of nt)if(lt.pubsubTopic!==this.pubsubTopic)return{failures:[{error:ProtocolError$1.TOPIC_DECODER_MISMATCH}],successes:[]};this.enableLightPushFilterCheck&&nt.push(createDecoder(this.buildLightPushContentTopic(),this.pubsubTopic));const ot=groupByContentTopic(nt),it=Array.from(ot.keys()),st=this.getPeers().map(async lt=>this.subscribeWithPeerVerification(lt,it)),at=await Promise.allSettled(st),ct=this.handleResult(at,"subscribe");return ot.forEach((lt,dt)=>{const ht={decoders:lt,callback:tt};dt!==this.buildLightPushContentTopic()&&this.subscriptionCallbacks.set(dt,ht)}),this.startSubscriptionsMaintenance(this.keepAliveTimeout),ct}async unsubscribe(o){const tt=this.getPeers().map(async ot=>{const it=await this.protocol.unsubscribe(this.pubsubTopic,ot,o);return o.forEach(st=>{this.subscriptionCallbacks.delete(st)}),it}),rt=await Promise.allSettled(tt),nt=this.handleResult(rt,"unsubscribe");return this.subscriptionCallbacks.size===0&&this.stopSubscriptionsMaintenance(),nt}async ping(o){log$g.info("Sending keep-alive ping");const rt=(o?[o]:this.getPeers().map(ot=>ot.id)).map(ot=>this.pingSpecificPeer(ot)),nt=await Promise.allSettled(rt);return this.handleResult(nt,"ping")}async unsubscribeAll(){const o=this.getPeers().map(async nt=>this.protocol.unsubscribeAll(this.pubsubTopic,nt)),tt=await Promise.allSettled(o);this.subscriptionCallbacks.clear();const rt=this.handleResult(tt,"unsubscribeAll");return this.stopSubscriptionsMaintenance(),rt}async processIncomingMessage(o,tt){if(this.reliabilityMonitor.notifyMessageReceived(tt,o)){log$g.info("Message already received, skipping");return}const{contentTopic:nt}=o,ot=this.subscriptionCallbacks.get(nt);if(!ot){log$g.error("No subscription callback available for ",nt);return}log$g.info("Processing message with content topic ",nt," on pubsub topic ",this.pubsubTopic),await pushMessage(ot,this.pubsubTopic,o)}async subscribeWithPeerVerification(o,tt){const rt=await this.protocol.subscribe(this.pubsubTopic,o,tt);return await this.sendLightPushCheckMessage(o),rt}handleResult(o,tt){const rt={failures:[],successes:[]};for(const nt of o)if(nt.status==="rejected")log$g.error(`Failed to resolve ${tt} promise successfully: `,nt.reason),rt.failures.push({error:ProtocolError$1.GENERIC_FAIL});else{const ot=nt.value;ot.failure?rt.failures.push(ot.failure):rt.successes.push(ot.success)}return rt}async pingSpecificPeer(o){var nt,ot;const tt=this.getPeers().find(it=>it.id.equals(o));if(!tt)return{success:null,failure:{peerId:o,error:ProtocolError$1.NO_PEER_AVAILABLE}};let rt;try{rt=await this.protocol.ping(tt)}catch{rt={success:null,failure:{peerId:o,error:ProtocolError$1.GENERIC_FAIL}}}return log$g.info(`Received result from filter ping peerId:${o.toString()} success:${(nt=rt.success)==null?void 0:nt.toString()} failure:${(ot=rt.failure)==null?void 0:ot.error}`),await this.reliabilityMonitor.handlePingResult(o,rt),rt}startSubscriptionsMaintenance(o){log$g.info("Starting subscriptions maintenance"),this.startKeepAlivePings(o),this.startConnectionListener()}stopSubscriptionsMaintenance(){log$g.info("Stopping subscriptions maintenance"),this.stopKeepAlivePings(),this.stopConnectionListener()}startConnectionListener(){this.connectionManager.addEventListener(EConnectionStateEvents.CONNECTION_STATUS,this.connectionListener.bind(this))}stopConnectionListener(){this.connectionManager.removeEventListener(EConnectionStateEvents.CONNECTION_STATUS,this.connectionListener.bind(this))}async connectionListener({detail:o}){if(!o){this.stopKeepAlivePings();return}try{await this.ping()}catch(tt){log$g.error(`networkStateListener failed to recover: ${tt}`)}this.startKeepAlivePings(this.keepAliveTimeout)}startKeepAlivePings(o){if(this.keepAliveInterval){log$g.info("Recurring pings already set up.");return}this.keepAliveInterval=setInterval(()=>{this.ping()},o)}stopKeepAlivePings(){if(!this.keepAliveInterval){log$g.info("Already stopped recurring pings.");return}log$g.info("Stopping recurring pings."),clearInterval(this.keepAliveInterval),this.keepAliveInterval=null}async sendLightPushCheckMessage(o){if(this.lightPush&&this.libp2p&&this.reliabilityMonitor.shouldVerifyPeer(o.id)){const tt=createEncoder({contentTopic:this.buildLightPushContentTopic(),pubsubTopic:this.pubsubTopic,ephemeral:!0}),rt={payload:new Uint8Array(1)},nt=await tt.toProtoObj(rt);setTimeout(async()=>{const ot=await this.lightPush.protocol.send(tt,rt,o);if(this.reliabilityMonitor.notifyMessageSent(o.id,nt),ot.failure){log$g.error(`failed to send lightPush ping message to peer:${o.id.toString()} ${ot.failure.error}`);return}},DEFAULT_LIGHT_PUSH_FILTER_CHECK_INTERVAL)}}buildLightPushContentTopic(){return`/js-waku-subscription-ping/1/${this.libp2p.peerId.toString()}/utf8`}}async function pushMessage(et,o,tt){const{decoders:rt,callback:nt}=et,{contentTopic:ot}=tt;if(!ot){log$g.warn("Message has no content topic, skipping");return}try{const it=rt.map(at=>at.fromProtoObj(o,tt).then(ct=>ct||Promise.reject("Decoding failed"))),st=await Promise.any(it);await nt(st)}catch(it){log$g.error("Error decoding message",it)}}const log$f=new Logger$1("sdk:filter");class Filter extends BaseProtocolSDK{constructor(tt,rt,nt,ot){super(new FilterCore(async(it,st,at)=>{const ct=this.getActiveSubscription(it);if(!ct){log$f.error(`No subscription locally registered for topic ${it}`);return}await ct.processIncomingMessage(st,at)},tt.configuredPubsubTopics,rt),tt,{numPeersToUse:ot==null?void 0:ot.numPeersToUse});wt(this,"libp2p");wt(this,"lightPush");wt(this,"protocol");wt(this,"activeSubscriptions",new Map);this.libp2p=rt,this.lightPush=nt,this.protocol=this.core,this.activeSubscriptions=new Map}async subscribe(tt,rt,nt,ot=DEFAULT_SUBSCRIBE_OPTIONS){const it=this.getUniquePubsubTopics(tt);if(it.length!==1)return{subscription:null,error:ProtocolError$1.INVALID_DECODER_TOPICS,results:null};const st=it[0],{subscription:at,error:ct}=await this.createSubscription(st,nt);if(ct)return{subscription:null,error:ct,results:null};const{failures:lt,successes:dt}=await at.subscribe(tt,rt,ot);return{subscription:at,error:null,results:{failures:lt,successes:dt}}}async createSubscription(tt,rt){var st;rt={autoRetry:!0,...rt};const nt=typeof tt=="string"?tt:(st=shardInfoToPubsubTopics(tt))==null?void 0:st[0];return ensurePubsubTopicIsConfigured(nt,this.protocol.pubsubTopics),await this.hasPeers(rt)?(log$f.info(`Creating filter subscription with ${this.connectedPeers.length} peers: `,this.connectedPeers.map(at=>at.id.toString())),{error:null,subscription:this.getActiveSubscription(nt)??this.setActiveSubscription(nt,new SubscriptionManager(nt,this.protocol,this.connectionManager,()=>this.connectedPeers,this.renewPeer.bind(this),this.libp2p,this.lightPush))}):{error:ProtocolError$1.NO_PEER_AVAILABLE,subscription:null}}async subscribeWithUnsubscribe(tt,rt,nt=DEFAULT_SUBSCRIBE_OPTIONS){const ot=this.getUniquePubsubTopics(tt);if(ot.length===0)throw Error("Failed to subscribe: no pubsubTopic found on decoders provided.");if(ot.length>1)throw Error("Failed to subscribe: all decoders should have the same pubsub topic. Use createSubscription to be more agile.");const{subscription:it,error:st}=await this.createSubscription(ot[0]);if(st)throw Error(`Failed to create subscription: ${st}`);await it.subscribe(tt,rt,nt);const at=Array.from(groupByContentTopic(Array.isArray(tt)?tt:[tt]).keys());return async()=>{await it.unsubscribe(at)}}toSubscriptionIterator(tt){return toAsyncIterator(this,tt)}getActiveSubscription(tt){return this.activeSubscriptions.get(tt)}setActiveSubscription(tt,rt){return this.activeSubscriptions.set(tt,rt),rt}getUniquePubsubTopics(tt){return Array.isArray(tt)?tt.length===0?[]:[...new Set(tt.map(nt=>nt.pubsubTopic))]:[tt.pubsubTopic]}}function wakuFilter(et,o,tt){return rt=>new Filter(et,rt,o,tt)}const log$e=new Logger$1("sdk:light-push"),DEFAULT_MAX_ATTEMPTS=3,DEFAULT_SEND_OPTIONS={autoRetry:!1,maxAttempts:DEFAULT_MAX_ATTEMPTS};class LightPush{constructor(o,tt,rt){wt(this,"libp2p");wt(this,"numPeersToUse",DEFAULT_NUM_PEERS_TO_USE);wt(this,"protocol");this.libp2p=tt,this.numPeersToUse=(rt==null?void 0:rt.numPeersToUse)??DEFAULT_NUM_PEERS_TO_USE,this.protocol=new LightPushCore(o.configuredPubsubTopics,tt)}async send(o,tt,rt=DEFAULT_SEND_OPTIONS){const nt=[],ot=[],{pubsubTopic:it}=o;try{ensurePubsubTopicIsConfigured(it,this.protocol.pubsubTopics)}catch{return log$e.error("Failed to send waku light push: pubsub topic not configured"),{successes:nt,failures:[{error:ProtocolError$1.TOPIC_NOT_CONFIGURED}]}}const st=await this.getConnectedPeers();if(st.length===0)return{successes:nt,failures:[{error:ProtocolError$1.NO_PEER_AVAILABLE}]};const at=await Promise.allSettled(st.map(ct=>this.protocol.send(o,tt,ct)));for(const ct of at){if(ct.status!=="fulfilled"){log$e.error("Failed unexpectedly while sending:",ct.reason),ot.push({error:ProtocolError$1.GENERIC_FAIL});continue}const{failure:lt,success:dt}=ct.value;if(dt){nt.push(dt);continue}lt&&(ot.push(lt),rt!=null&&rt.autoRetry&&this.attemptRetries(ht=>this.protocol.send(o,tt,ht),rt.maxAttempts))}return getHealthManager().updateProtocolHealth(this.protocol.multicodec,nt.length),{successes:nt,failures:ot}}async attemptRetries(o,tt){var nt;tt=tt||DEFAULT_MAX_ATTEMPTS;const rt=await this.getConnectedPeers();if(rt.length===0){log$e.warn("Cannot retry with no connected peers.");return}for(let ot=0;ot{try{return await this.libp2p.peerStore.get(rt)}catch{return null}}))).filter(rt=>!!rt).filter(rt=>rt.protocols.includes(LightPushCodec)).slice(0,this.numPeersToUse)}}function wakuLightPush(et,o={}){return tt=>new LightPush(et,tt,o)}const DEFAULT_NUM_PEERS=1,log$d=new Logger$1("waku:store:sdk");class Store extends BaseProtocolSDK{constructor(tt,rt,nt){super(new StoreCore(tt.configuredPubsubTopics,rt),tt,{numPeersToUse:DEFAULT_NUM_PEERS});wt(this,"peerIdStrToUse");wt(this,"protocol");this.peerIdStrToUse=nt,this.protocol=this.core}async*queryGenerator(tt,rt){const{pubsubTopic:nt,contentTopics:ot,decodersAsMap:it}=this.validateDecodersAndPubsubTopic(tt),st={pubsubTopic:nt,contentTopics:ot,includeData:!0,paginationForward:!0,...rt},at=(await this.protocol.getPeers({numPeers:this.numPeersToUse,maxBootstrapPeers:1,peerIdStr:this.peerIdStrToUse}))[0];if(!at)throw log$d.error("No peers available to query"),new Error("No peers available to query");log$d.info(`Querying store with options: ${JSON.stringify(rt)}`);const ct=this.protocol.queryPerPage(st,it,at);for await(const lt of ct)yield lt}async queryWithOrderedCallback(tt,rt,nt){log$d.info("Querying store with ordered callback");for await(const ot of this.queryGenerator(tt,nt))if(await this.processMessages(ot,rt))break}async queryWithPromiseCallback(tt,rt,nt){log$d.info("Querying store with promise callback");let ot=!1;for await(const it of this.queryGenerator(tt,nt)){const st=it.map(async at=>{ot||(ot=!!await rt(at))});if(await Promise.all(st),ot)break}}async processMessages(tt,rt){let nt=!1;const it=(await Promise.all(tt)).filter(isDefined);return await Promise.all(it.map(async st=>{st&&!nt&&(nt=!!await rt(st))})),nt}createCursor(tt){return messageHash(tt.pubsubTopic,tt)}validateDecodersAndPubsubTopic(tt){if(tt.length===0)throw log$d.error("No decoders provided"),new Error("No decoders provided");const rt=Array.from(new Set(tt.map(st=>st.pubsubTopic)));if(rt.length>1)throw log$d.error("API does not support querying multiple pubsub topics at once"),new Error("API does not support querying multiple pubsub topics at once");const nt=rt[0];ensurePubsubTopicIsConfigured(nt,this.protocol.pubsubTopics);const ot=new Map;tt.forEach(st=>{if(ot.has(st.contentTopic))throw log$d.error("API does not support different decoder per content topic"),new Error("API does not support different decoder per content topic");ot.set(st.contentTopic,st)});const it=tt.filter(st=>st.pubsubTopic===nt).map(st=>st.contentTopic);if(it.length===0)throw log$d.error(`No decoders found for topic ${nt}`),new Error("No decoders found for topic "+nt);return{pubsubTopic:nt,contentTopics:it,decodersAsMap:ot}}}function wakuStore(et,o){return tt=>new Store(et,tt,o)}const log$c=new Logger$1("wait-for-remote-peer");async function waitForRemotePeer(et,o,tt){o=o!=null&&o.length?o:getEnabledProtocols(et);const rt=et.libp2p.getConnections();if(!et.isStarted())throw Error("Waku node is not started");if(rt.length>0&&!o.includes(Protocols.Relay)&&await waitForMetadata(et,o))return;const nt=[];if(o.includes(Protocols.Relay)){if(!et.relay)throw Error("Cannot wait for Relay peer: protocol not mounted");nt.push(et.relay.waitForPeers())}if(o.includes(Protocols.Store)){if(!et.store)throw Error("Cannot wait for Store peer: protocol not mounted");nt.push(waitForConnectedPeer(StoreCodec,et.libp2p))}if(o.includes(Protocols.LightPush)){if(!et.lightPush)throw Error("Cannot wait for LightPush peer: protocol not mounted");nt.push(waitForConnectedPeer(LightPushCodec,et.libp2p))}if(o.includes(Protocols.Filter)){if(!et.filter)throw new Error("Cannot wait for Filter peer: protocol not mounted");nt.push(waitForConnectedPeer(FilterCodecs.SUBSCRIBE,et.libp2p))}tt?await rejectOnTimeout(Promise.all(nt),tt,"Timed out waiting for a remote peer."):await Promise.all(nt)}async function waitForConnectedPeer(et,o){log$c.info(`Waiting for ${et} peer.`),await new Promise(tt=>{const rt=async nt=>{var ot,it;if((it=(ot=nt.detail)==null?void 0:ot.protocols)!=null&&it.includes(et)){const st=o.services.metadata;if(!st){o.removeEventListener("peer:identify",rt),tt();return}try{await st.confirmOrAttemptHandshake(nt.detail.peerId),o.removeEventListener("peer:identify",rt),tt()}catch(at){at.code==="ERR_CONNECTION_BEING_CLOSED"&&log$c.error("Connection closed. Some peers can be on different shard."),log$c.error(`Error waiting for metadata: ${at}`)}}};o.addEventListener("peer:identify",rt)})}async function waitForMetadata(et,o){const tt=et.libp2p.getPeers(),rt=et.libp2p.services.metadata,nt=mapProtocolsToCodecs(o);if(!tt.length||!rt)return log$c.info(`Skipping waitForMetadata due to missing connections:${tt.length} or metadataService:${!!rt}`),!1;for(const ot of tt)try{const it=await et.libp2p.peerStore.get(ot);if(it.protocols.some(at=>nt.has(at))&&!(await rt.confirmOrAttemptHandshake(ot)).error&&(it.protocols.forEach(lt=>{nt.has(lt)&&nt.set(lt,!0)}),Array.from(nt.values()).every(lt=>lt)))return!0}catch(it){it.code==="ERR_CONNECTION_BEING_CLOSED"&&log$c.error("Connection closed. Some peers can be on different shard."),log$c.error(`Error while iterating through peers: ${it}`);continue}return!1}const awaitTimeout=(et,o)=>new Promise((tt,rt)=>setTimeout(()=>rt(Error(o)),et));async function rejectOnTimeout(et,o,tt){await Promise.race([et,awaitTimeout(o,tt)])}function getEnabledProtocols(et){const o=[];return et.relay&&o.push(Protocols.Relay),et.filter&&o.push(Protocols.Filter),et.store&&o.push(Protocols.Store),et.lightPush&&o.push(Protocols.LightPush),o}function mapProtocolsToCodecs(et){const o=new Map,tt={[Protocols.Filter]:FilterCodecs.SUBSCRIBE,[Protocols.LightPush]:LightPushCodec,[Protocols.Store]:StoreCodec};for(const rt of et)tt[rt]&&o.set(tt[rt],!1);return o}const DefaultPingKeepAliveValueSecs=5*60,DefaultRelayKeepAliveValueSecs=5*60,DefaultUserAgent="js-waku",DefaultPingMaxInboundStreams=10,log$b=new Logger$1("waku");class WakuNode{constructor(o,tt,rt,nt,ot){wt(this,"pubsubTopics");wt(this,"libp2p");wt(this,"relay");wt(this,"store");wt(this,"filter");wt(this,"lightPush");wt(this,"connectionManager");wt(this,"health");var ct;this.pubsubTopics=o,this.relay=ot,this.libp2p=rt,nt={filter:!1,lightpush:!1,store:!1,...nt};const it=tt.pingKeepAlive||DefaultPingKeepAliveValueSecs,st=this.relay?tt.relayKeepAlive||DefaultRelayKeepAliveValueSecs:0,at=this.libp2p.peerId.toString();if(this.connectionManager=ConnectionManager.create(at,rt,{pingKeepAlive:it,relayKeepAlive:st},this.pubsubTopics,this.relay),this.health=getHealthManager(),nt.store){let lt;(ct=tt.nodeToUse)!=null&&ct.store&&this.dialMultiaddr(tt.nodeToUse.store,StoreCodec).catch(ht=>{log$b.error("Failed to dial store peer",ht)});const dt=wakuStore(this.connectionManager,lt);this.store=dt(rt)}if(nt.lightpush){const lt=wakuLightPush(this.connectionManager,tt);this.lightPush=lt(rt)}if(nt.filter){const lt=wakuFilter(this.connectionManager,this.lightPush,tt);this.filter=lt(rt)}log$b.info("Waku node created",at,`relay: ${!!this.relay}, store: ${!!this.store}, light push: ${!!this.lightPush}, filter: ${!!this.filter}`)}get peerId(){return this.libp2p.peerId}get protocols(){return this.libp2p.getProtocols()}async dial(o,tt){const rt=tt??[],nt=this.mapToPeerIdOrMultiaddr(o);typeof tt>"u"&&(this.relay&&rt.push(Protocols.Relay),this.store&&rt.push(Protocols.Store),this.filter&&rt.push(Protocols.Filter),this.lightPush&&rt.push(Protocols.LightPush));const ot=[];return rt.includes(Protocols.Relay)&&(this.relay?this.relay.gossipSub.multicodecs.forEach(it=>ot.push(it)):log$b.error("Relay codec not included in dial codec: protocol not mounted locally")),rt.includes(Protocols.Store)&&(this.store?ot.push(this.store.protocol.multicodec):log$b.error("Store codec not included in dial codec: protocol not mounted locally")),rt.includes(Protocols.LightPush)&&(this.lightPush?ot.push(this.lightPush.protocol.multicodec):log$b.error("Light Push codec not included in dial codec: protocol not mounted locally")),rt.includes(Protocols.Filter)&&(this.filter?ot.push(this.filter.protocol.multicodec):log$b.error("Filter codec not included in dial codec: protocol not mounted locally")),log$b.info(`Dialing to ${nt.toString()} with protocols ${rt}`),this.libp2p.dialProtocol(nt,ot)}async start(){await this.libp2p.start()}async stop(){ReliabilityMonitorManager.stopAll(),this.connectionManager.stop(),await this.libp2p.stop()}async waitForPeers(o,tt){return waitForRemotePeer(this,o,tt)}isStarted(){return this.libp2p.status=="started"}isConnected(){return this.connectionManager.isConnected()}async dialMultiaddr(o,tt){const rt=multiaddr(o);if(!rt.getPeerId())throw new Error("Failed to dial multiaddr: missing peer ID");return await this.libp2p.dialProtocol(rt,[tt]),rt.getPeerId()}mapToPeerIdOrMultiaddr(o){return isPeerId$2(o)?o:multiaddr(o)}}var hs;let InvalidParametersError$3=(hs=class extends Error{constructor(o="Invalid parameters"){super(o),this.name="InvalidParametersError"}},wt(hs,"name","InvalidParametersError"),hs);class InvalidPublicKeyError extends Error{constructor(o="Invalid public key"){super(o),this.name="InvalidPublicKeyError"}}wt(InvalidPublicKeyError,"name","InvalidPublicKeyError");var ps;let UnsupportedKeyTypeError$1=(ps=class extends Error{constructor(o="Unsupported key type"){super(o),this.name="UnsupportedKeyTypeError"}},wt(ps,"name","UnsupportedKeyTypeError"),ps);function equals$b(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$i=base$i,_brrp__multiformats_scope_baseX$h=src$i;let Encoder$i=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$i=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$j(this,o)}},ComposedDecoder$h=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$j(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$j(et,o){return new ComposedDecoder$h({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$h=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$i(o,tt,rt),this.decoder=new Decoder$i(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$k({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$h(et,o,tt,rt)}function baseX$h({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$h(tt,et);return from$k({prefix:o,name:et,encode:rt,decode:ot=>coerce$h(nt(ot))})}function decode$O(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$G(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<=INT$4;)o[tt++]=et&255|MSB$6,et/=128;for(;et&MSBALL$4;)o[tt++]=et&255|MSB$6,et>>>=7;return o[tt]=et|0,encode$F.bytes=tt-rt+1,o}var decode$N=read$5,MSB$1$4=128,REST$1$4=127;function read$5(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$5.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1$4)<=MSB$1$4);return read$5.bytes=ot-rt,tt}var N1$4=Math.pow(2,7),N2$4=Math.pow(2,14),N3$4=Math.pow(2,21),N4$4=Math.pow(2,28),N5$4=Math.pow(2,35),N6$4=Math.pow(2,42),N7$4=Math.pow(2,49),N8$4=Math.pow(2,56),N9$4=Math.pow(2,63),length$4=function(et){return et{const[dt,ht]=decode$M(o.subarray(tt));return tt+=ht,dt};let nt=rt(),ot=DAG_PB_CODE$2;if(nt===18?(nt=0,tt=0):ot=rt(),nt!==0&&nt!==1)throw new RangeError(`Invalid CID version ${nt}`);const it=tt,st=rt(),at=rt(),ct=tt+at,lt=ct-it;return{version:nt,codec:ot,multihashCode:st,digestSize:at,multihashSize:lt,size:ct}}static parse(o,tt){const[rt,nt]=parseCIDtoBytes$2(o,tt),ot=Nr.decode(nt);if(ot.version===0&&o[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$2(ot).set(rt,o),ot}};function parseCIDtoBytes$2(et,o){switch(et[0]){case"Q":{const tt=o??base58btc$h;return[base58btc$h.prefix,tt.decode(`${base58btc$h.prefix}${et}`)]}case base58btc$h.prefix:{const tt=o??base58btc$h;return[base58btc$h.prefix,tt.decode(et)]}case base32$u.prefix:{const tt=o??base32$u;return[base32$u.prefix,tt.decode(et)]}case base36$r.prefix:{const tt=o??base36$r;return[base36$r.prefix,tt.decode(et)]}default:{if(o==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[et[0],o.decode(et)]}}}function toStringV0$2(et,o,tt){const{prefix:rt}=tt;if(rt!==base58btc$h.prefix)throw Error(`Cannot string encode V0 in ${tt.name} encoding`);const nt=o.get(rt);if(nt==null){const ot=tt.encode(et).slice(1);return o.set(rt,ot),ot}else return nt}function toStringV1$2(et,o,tt){const{prefix:rt}=tt,nt=o.get(rt);if(nt==null){const ot=tt.encode(et);return o.set(rt,ot),ot}else return nt}const DAG_PB_CODE$2=112,SHA_256_CODE$2=18;function encodeCID$2(et,o,tt){const rt=encodingLength$4(et),nt=rt+encodingLength$4(o),ot=new Uint8Array(nt+tt.byteLength);return encodeTo$2(et,ot,0),encodeTo$2(o,ot,rt),ot.set(tt,nt),ot}const cidSymbol$2=Symbol.for("@ipld/js-cid/CID"),code$2=0,name$4="identity",encode$E=coerce$h;function digest$1(et){return create$5(code$2,encode$E(et))}const identity$f={code:code$2,name:name$4,encode:encode$E,digest:digest$1};function equals$9(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;ttBigInt(et))),SHA512_W_H=new Uint32Array(80),SHA512_W_L=new Uint32Array(80);class SHA512 extends HashMD{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(){const{Ah:o,Al:tt,Bh:rt,Bl:nt,Ch:ot,Cl:it,Dh:st,Dl:at,Eh:ct,El:lt,Fh:dt,Fl:ht,Gh:mt,Gl:ft,Hh:pt,Hl:yt}=this;return[o,tt,rt,nt,ot,it,st,at,ct,lt,dt,ht,mt,ft,pt,yt]}set(o,tt,rt,nt,ot,it,st,at,ct,lt,dt,ht,mt,ft,pt,yt){this.Ah=o|0,this.Al=tt|0,this.Bh=rt|0,this.Bl=nt|0,this.Ch=ot|0,this.Cl=it|0,this.Dh=st|0,this.Dl=at|0,this.Eh=ct|0,this.El=lt|0,this.Fh=dt|0,this.Fl=ht|0,this.Gh=mt|0,this.Gl=ft|0,this.Hh=pt|0,this.Hl=yt|0}process(o,tt){for(let xt=0;xt<16;xt++,tt+=4)SHA512_W_H[xt]=o.getUint32(tt),SHA512_W_L[xt]=o.getUint32(tt+=4);for(let xt=16;xt<80;xt++){const vt=SHA512_W_H[xt-15]|0,Et=SHA512_W_L[xt-15]|0,Ct=u64.rotrSH(vt,Et,1)^u64.rotrSH(vt,Et,8)^u64.shrSH(vt,Et,7),St=u64.rotrSL(vt,Et,1)^u64.rotrSL(vt,Et,8)^u64.shrSL(vt,Et,7),At=SHA512_W_H[xt-2]|0,kt=SHA512_W_L[xt-2]|0,It=u64.rotrSH(At,kt,19)^u64.rotrBH(At,kt,61)^u64.shrSH(At,kt,6),Nt=u64.rotrSL(At,kt,19)^u64.rotrBL(At,kt,61)^u64.shrSL(At,kt,6),Lt=u64.add4L(St,Nt,SHA512_W_L[xt-7],SHA512_W_L[xt-16]),Mt=u64.add4H(Lt,Ct,It,SHA512_W_H[xt-7],SHA512_W_H[xt-16]);SHA512_W_H[xt]=Mt|0,SHA512_W_L[xt]=Lt|0}let{Ah:rt,Al:nt,Bh:ot,Bl:it,Ch:st,Cl:at,Dh:ct,Dl:lt,Eh:dt,El:ht,Fh:mt,Fl:ft,Gh:pt,Gl:yt,Hh:gt,Hl:bt}=this;for(let xt=0;xt<80;xt++){const vt=u64.rotrSH(dt,ht,14)^u64.rotrSH(dt,ht,18)^u64.rotrBH(dt,ht,41),Et=u64.rotrSL(dt,ht,14)^u64.rotrSL(dt,ht,18)^u64.rotrBL(dt,ht,41),Ct=dt&mt^~dt&pt,St=ht&ft^~ht&yt,At=u64.add5L(bt,Et,St,SHA512_Kl[xt],SHA512_W_L[xt]),kt=u64.add5H(At,gt,vt,Ct,SHA512_Kh[xt],SHA512_W_H[xt]),It=At|0,Nt=u64.rotrSH(rt,nt,28)^u64.rotrBH(rt,nt,34)^u64.rotrBH(rt,nt,39),Lt=u64.rotrSL(rt,nt,28)^u64.rotrBL(rt,nt,34)^u64.rotrBL(rt,nt,39),Mt=rt&ot^rt&st^ot&st,zt=nt&it^nt&at^it&at;gt=pt|0,bt=yt|0,pt=mt|0,yt=ft|0,mt=dt|0,ft=ht|0,{h:dt,l:ht}=u64.add(ct|0,lt|0,kt|0,It|0),ct=st|0,lt=at|0,st=ot|0,at=it|0,ot=rt|0,it=nt|0;const Ut=u64.add3L(It,Lt,zt);rt=u64.add3H(Ut,kt,Nt,Mt),nt=Ut|0}({h:rt,l:nt}=u64.add(this.Ah|0,this.Al|0,rt|0,nt|0)),{h:ot,l:it}=u64.add(this.Bh|0,this.Bl|0,ot|0,it|0),{h:st,l:at}=u64.add(this.Ch|0,this.Cl|0,st|0,at|0),{h:ct,l:lt}=u64.add(this.Dh|0,this.Dl|0,ct|0,lt|0),{h:dt,l:ht}=u64.add(this.Eh|0,this.El|0,dt|0,ht|0),{h:mt,l:ft}=u64.add(this.Fh|0,this.Fl|0,mt|0,ft|0),{h:pt,l:yt}=u64.add(this.Gh|0,this.Gl|0,pt|0,yt|0),{h:gt,l:bt}=u64.add(this.Hh|0,this.Hl|0,gt|0,bt|0),this.set(rt,nt,ot,it,st,at,ct,lt,dt,ht,mt,ft,pt,yt,gt,bt)}roundClean(){SHA512_W_H.fill(0),SHA512_W_L.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)}}const sha512=wrapConstructor(()=>new SHA512);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$2=BigInt(0),_1n$3=BigInt(1),_2n$2=BigInt(2),_8n$2=BigInt(8),VERIFY_DEFAULT={zip215:!0};function validateOpts$1(et){const o=validateBasic(et);return validateObject(et,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...o})}function twistedEdwards(et){const o=validateOpts$1(et),{Fp:tt,n:rt,prehash:nt,hash:ot,randomBytes:it,nByteLength:st,h:at}=o,ct=_2n$2<{try{return{isValid:!0,value:tt.sqrt(Xt*tt.inv(Wt))}}catch{return{isValid:!1,value:_0n$2}}}),mt=o.adjustScalarBytes||(Xt=>Xt),ft=o.domain||((Xt,Wt,Ft)=>{if(abool("phflag",Ft),Wt.length||Ft)throw new Error("Contexts/pre-hash are not supported");return Xt});function pt(Xt,Wt){aInRange("coordinate "+Xt,Wt,_0n$2,ct)}function yt(Xt){if(!(Xt instanceof xt))throw new Error("ExtendedPoint expected")}const gt=memoized((Xt,Wt)=>{const{ex:Ft,ey:qt,ez:Pt}=Xt,Yt=Xt.is0();Wt==null&&(Wt=Yt?_8n$2:tt.inv(Pt));const Qt=lt(Ft*Wt),jt=lt(qt*Wt),Gt=lt(Pt*Wt);if(Yt)return{x:_0n$2,y:_1n$3};if(Gt!==_1n$3)throw new Error("invZ was invalid");return{x:Qt,y:jt}}),bt=memoized(Xt=>{const{a:Wt,d:Ft}=o;if(Xt.is0())throw new Error("bad point: ZERO");const{ex:qt,ey:Pt,ez:Yt,et:Qt}=Xt,jt=lt(qt*qt),Gt=lt(Pt*Pt),rr=lt(Yt*Yt),Ht=lt(rr*rr),dr=lt(jt*Wt),Zt=lt(rr*lt(dr+Gt)),Jt=lt(Ht+lt(Ft*lt(jt*Gt)));if(Zt!==Jt)throw new Error("bad point: equation left != right (1)");const tr=lt(qt*Pt),_t=lt(Yt*Qt);if(tr!==_t)throw new Error("bad point: equation left != right (2)");return!0});class xt{constructor(Wt,Ft,qt,Pt){this.ex=Wt,this.ey=Ft,this.ez=qt,this.et=Pt,pt("x",Wt),pt("y",Ft),pt("z",qt),pt("t",Pt),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(Wt){if(Wt instanceof xt)throw new Error("extended point not allowed");const{x:Ft,y:qt}=Wt||{};return pt("x",Ft),pt("y",qt),new xt(Ft,qt,_1n$3,lt(Ft*qt))}static normalizeZ(Wt){const Ft=tt.invertBatch(Wt.map(qt=>qt.ez));return Wt.map((qt,Pt)=>qt.toAffine(Ft[Pt])).map(xt.fromAffine)}static msm(Wt,Ft){return pippenger(xt,dt,Wt,Ft)}_setWindowSize(Wt){Ct.setWindowSize(this,Wt)}assertValidity(){bt(this)}equals(Wt){yt(Wt);const{ex:Ft,ey:qt,ez:Pt}=this,{ex:Yt,ey:Qt,ez:jt}=Wt,Gt=lt(Ft*jt),rr=lt(Yt*Pt),Ht=lt(qt*jt),dr=lt(Qt*Pt);return Gt===rr&&Ht===dr}is0(){return this.equals(xt.ZERO)}negate(){return new xt(lt(-this.ex),this.ey,this.ez,lt(-this.et))}double(){const{a:Wt}=o,{ex:Ft,ey:qt,ez:Pt}=this,Yt=lt(Ft*Ft),Qt=lt(qt*qt),jt=lt(_2n$2*lt(Pt*Pt)),Gt=lt(Wt*Yt),rr=Ft+qt,Ht=lt(lt(rr*rr)-Yt-Qt),dr=Gt+Qt,Zt=dr-jt,Jt=Gt-Qt,tr=lt(Ht*Zt),_t=lt(dr*Jt),Bt=lt(Ht*Jt),Vt=lt(Zt*dr);return new xt(tr,_t,Vt,Bt)}add(Wt){yt(Wt);const{a:Ft,d:qt}=o,{ex:Pt,ey:Yt,ez:Qt,et:jt}=this,{ex:Gt,ey:rr,ez:Ht,et:dr}=Wt;if(Ft===BigInt(-1)){const pr=lt((Yt-Pt)*(rr+Gt)),wr=lt((Yt+Pt)*(rr-Gt)),_r=lt(wr-pr);if(_r===_0n$2)return this.double();const Tr=lt(Qt*_2n$2*dr),gr=lt(jt*_2n$2*Ht),vr=gr+Tr,ir=wr+pr,Tt=gr-Tr,$t=lt(vr*_r),Rt=lt(ir*Tt),Dt=lt(vr*Tt),Kt=lt(_r*ir);return new xt($t,Rt,Kt,Dt)}const Zt=lt(Pt*Gt),Jt=lt(Yt*rr),tr=lt(jt*qt*dr),_t=lt(Qt*Ht),Bt=lt((Pt+Yt)*(Gt+rr)-Zt-Jt),Vt=_t-tr,er=_t+tr,ar=lt(Jt-Ft*Zt),ur=lt(Bt*Vt),cr=lt(er*ar),hr=lt(Bt*ar),Sr=lt(Vt*er);return new xt(ur,cr,Sr,hr)}subtract(Wt){return this.add(Wt.negate())}wNAF(Wt){return Ct.wNAFCached(this,Wt,xt.normalizeZ)}multiply(Wt){const Ft=Wt;aInRange("scalar",Ft,_1n$3,rt);const{p:qt,f:Pt}=this.wNAF(Ft);return xt.normalizeZ([qt,Pt])[0]}multiplyUnsafe(Wt){const Ft=Wt;return aInRange("scalar",Ft,_0n$2,rt),Ft===_0n$2?Et:this.equals(Et)||Ft===_1n$3?this:this.equals(vt)?this.wNAF(Ft).p:Ct.unsafeLadder(this,Ft)}isSmallOrder(){return this.multiplyUnsafe(at).is0()}isTorsionFree(){return Ct.unsafeLadder(this,rt).is0()}toAffine(Wt){return gt(this,Wt)}clearCofactor(){const{h:Wt}=o;return Wt===_1n$3?this:this.multiplyUnsafe(Wt)}static fromHex(Wt,Ft=!1){const{d:qt,a:Pt}=o,Yt=tt.BYTES;Wt=ensureBytes$1("pointHex",Wt,Yt),abool("zip215",Ft);const Qt=Wt.slice(),jt=Wt[Yt-1];Qt[Yt-1]=jt&-129;const Gt=bytesToNumberLE(Qt),rr=Ft?ct:tt.ORDER;aInRange("pointHex.y",Gt,_0n$2,rr);const Ht=lt(Gt*Gt),dr=lt(Ht-_1n$3),Zt=lt(qt*Ht-Pt);let{isValid:Jt,value:tr}=ht(dr,Zt);if(!Jt)throw new Error("Point.fromHex: invalid y coordinate");const _t=(tr&_1n$3)===_1n$3,Bt=(jt&128)!==0;if(!Ft&&tr===_0n$2&&Bt)throw new Error("Point.fromHex: x=0 and x_0=1");return Bt!==_t&&(tr=lt(-tr)),xt.fromAffine({x:tr,y:Gt})}static fromPrivateKey(Wt){return kt(Wt).point}toRawBytes(){const{x:Wt,y:Ft}=this.toAffine(),qt=numberToBytesLE(Ft,tt.BYTES);return qt[qt.length-1]|=Wt&_1n$3?128:0,qt}toHex(){return bytesToHex$2(this.toRawBytes())}}xt.BASE=new xt(o.Gx,o.Gy,_1n$3,lt(o.Gx*o.Gy)),xt.ZERO=new xt(_0n$2,_1n$3,_1n$3,_0n$2);const{BASE:vt,ZERO:Et}=xt,Ct=wNAF(xt,st*8);function St(Xt){return mod$1(Xt,rt)}function At(Xt){return St(bytesToNumberLE(Xt))}function kt(Xt){const Wt=st;Xt=ensureBytes$1("private key",Xt,Wt);const Ft=ensureBytes$1("hashed private key",ot(Xt),2*Wt),qt=mt(Ft.slice(0,Wt)),Pt=Ft.slice(Wt,2*Wt),Yt=At(qt),Qt=vt.multiply(Yt),jt=Qt.toRawBytes();return{head:qt,prefix:Pt,scalar:Yt,point:Qt,pointBytes:jt}}function It(Xt){return kt(Xt).pointBytes}function Nt(Xt=new Uint8Array,...Wt){const Ft=concatBytes$1(...Wt);return At(ot(ft(Ft,ensureBytes$1("context",Xt),!!nt)))}function Lt(Xt,Wt,Ft={}){Xt=ensureBytes$1("message",Xt),nt&&(Xt=nt(Xt));const{prefix:qt,scalar:Pt,pointBytes:Yt}=kt(Wt),Qt=Nt(Ft.context,qt,Xt),jt=vt.multiply(Qt).toRawBytes(),Gt=Nt(Ft.context,jt,Yt,Xt),rr=St(Qt+Gt*Pt);aInRange("signature.s",rr,_0n$2,rt);const Ht=concatBytes$1(jt,numberToBytesLE(rr,tt.BYTES));return ensureBytes$1("result",Ht,st*2)}const Mt=VERIFY_DEFAULT;function zt(Xt,Wt,Ft,qt=Mt){const{context:Pt,zip215:Yt}=qt,Qt=tt.BYTES;Xt=ensureBytes$1("signature",Xt,2*Qt),Wt=ensureBytes$1("message",Wt),Yt!==void 0&&abool("zip215",Yt),nt&&(Wt=nt(Wt));const jt=bytesToNumberLE(Xt.slice(Qt,2*Qt));let Gt,rr,Ht;try{Gt=xt.fromHex(Ft,Yt),rr=xt.fromHex(Xt.slice(0,Qt),Yt),Ht=vt.multiplyUnsafe(jt)}catch{return!1}if(!Yt&&Gt.isSmallOrder())return!1;const dr=Nt(Pt,rr.toRawBytes(),Gt.toRawBytes(),Wt);return rr.add(Gt.multiplyUnsafe(dr)).subtract(Ht).clearCofactor().equals(xt.ZERO)}return vt._setWindowSize(8),{CURVE:o,getPublicKey:It,sign:Lt,verify:zt,ExtendedPoint:xt,utils:{getExtendedPublicKey:kt,randomPrivateKey:()=>it(tt.BYTES),precompute(Xt=8,Wt=xt.BASE){return Wt._setWindowSize(Xt),Wt.multiply(BigInt(3)),Wt}}}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$1=BigInt(0),_1n$2=BigInt(1);function validateOpts(et){return validateObject(et,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...et})}function montgomery(et){const o=validateOpts(et),{P:tt}=o,rt=bt=>mod$1(bt,tt),nt=o.montgomeryBits,ot=Math.ceil(nt/8),it=o.nByteLength,st=o.adjustScalarBytes||(bt=>bt),at=o.powPminus2||(bt=>pow(bt,tt-BigInt(2),tt));function ct(bt,xt,vt){const Et=rt(bt*(xt-vt));return xt=rt(xt-Et),vt=rt(vt+Et),[xt,vt]}const lt=(o.a-BigInt(2))/BigInt(4);function dt(bt,xt){aInRange("u",bt,_0n$1,tt),aInRange("scalar",xt,_0n$1,tt);const vt=xt,Et=bt;let Ct=_1n$2,St=_0n$1,At=bt,kt=_1n$2,It=_0n$1,Nt;for(let Mt=BigInt(nt-1);Mt>=_0n$1;Mt--){const zt=vt>>Mt&_1n$2;It^=zt,Nt=ct(It,Ct,At),Ct=Nt[0],At=Nt[1],Nt=ct(It,St,kt),St=Nt[0],kt=Nt[1],It=zt;const Ut=Ct+St,Xt=rt(Ut*Ut),Wt=Ct-St,Ft=rt(Wt*Wt),qt=Xt-Ft,Pt=At+kt,Yt=At-kt,Qt=rt(Yt*Ut),jt=rt(Pt*Wt),Gt=Qt+jt,rr=Qt-jt;At=rt(Gt*Gt),kt=rt(Et*rt(rr*rr)),Ct=rt(Xt*Ft),St=rt(qt*(Xt+rt(lt*qt)))}Nt=ct(It,Ct,At),Ct=Nt[0],At=Nt[1],Nt=ct(It,St,kt),St=Nt[0],kt=Nt[1];const Lt=at(St);return rt(Ct*Lt)}function ht(bt){return numberToBytesLE(rt(bt),ot)}function mt(bt){const xt=ensureBytes$1("u coordinate",bt,ot);return it===32&&(xt[31]&=127),bytesToNumberLE(xt)}function ft(bt){const xt=ensureBytes$1("scalar",bt),vt=xt.length;if(vt!==ot&&vt!==it)throw new Error(`Expected ${ot} or ${it} bytes, got ${vt}`);return bytesToNumberLE(st(xt))}function pt(bt,xt){const vt=mt(xt),Et=ft(bt),Ct=dt(vt,Et);if(Ct===_0n$1)throw new Error("Invalid private or public key received");return ht(Ct)}const yt=ht(o.Gu);function gt(bt){return pt(bt,yt)}return{scalarMult:pt,scalarMultBase:gt,getSharedSecret:(bt,xt)=>pt(bt,xt),getPublicKey:bt=>gt(bt),utils:{randomPrivateKey:()=>o.randomBytes(o.nByteLength)},GuBytes:yt}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ED25519_P=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),ED25519_SQRT_M1=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const _1n$1=BigInt(1),_2n$1=BigInt(2),_3n$1=BigInt(3),_5n=BigInt(5),_8n$1=BigInt(8);function ed25519_pow_2_252_3(et){const o=BigInt(10),tt=BigInt(20),rt=BigInt(40),nt=BigInt(80),ot=ED25519_P,st=et*et%ot*et%ot,at=pow2$1(st,_2n$1,ot)*st%ot,ct=pow2$1(at,_1n$1,ot)*et%ot,lt=pow2$1(ct,_5n,ot)*ct%ot,dt=pow2$1(lt,o,ot)*lt%ot,ht=pow2$1(dt,tt,ot)*dt%ot,mt=pow2$1(ht,rt,ot)*ht%ot,ft=pow2$1(mt,nt,ot)*mt%ot,pt=pow2$1(ft,nt,ot)*mt%ot,yt=pow2$1(pt,o,ot)*lt%ot;return{pow_p_5_8:pow2$1(yt,_2n$1,ot)*et%ot,b2:st}}function adjustScalarBytes(et){return et[0]&=248,et[31]&=127,et[31]|=64,et}function uvRatio(et,o){const tt=ED25519_P,rt=mod$1(o*o*o,tt),nt=mod$1(rt*rt*o,tt),ot=ed25519_pow_2_252_3(et*nt).pow_p_5_8;let it=mod$1(et*rt*ot,tt);const st=mod$1(o*it*it,tt),at=it,ct=mod$1(it*ED25519_SQRT_M1,tt),lt=st===et,dt=st===mod$1(-et,tt),ht=st===mod$1(-et*ED25519_SQRT_M1,tt);return lt&&(it=at),(dt||ht)&&(it=ct),isNegativeLE(it,tt)&&(it=mod$1(-it,tt)),{isValid:lt||dt,value:it}}const Fp=Field$1(ED25519_P,void 0,!0),ed25519Defaults={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:_8n$1,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:sha512,randomBytes:randomBytes$1,adjustScalarBytes,uvRatio},ed25519=twistedEdwards(ed25519Defaults),x25519=montgomery({P:ED25519_P,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:et=>{const o=ED25519_P,{pow_p_5_8:tt,b2:rt}=ed25519_pow_2_252_3(et);return mod$1(pow2$1(tt,_3n$1,o)*rt,o)},adjustScalarBytes,randomBytes:randomBytes$1}),PUBLIC_KEY_BYTE_LENGTH=32,PRIVATE_KEY_BYTE_LENGTH=64,KEYS_BYTE_LENGTH=32;function generateKey(){const et=ed25519.utils.randomPrivateKey(),o=ed25519.getPublicKey(et);return{privateKey:concatKeys(et,o),publicKey:o}}function hashAndSign(et,o){const tt=et.subarray(0,KEYS_BYTE_LENGTH);return ed25519.sign(o instanceof Uint8Array?o:o.subarray(),tt)}function hashAndVerify$2(et,o,tt){return ed25519.verify(o,tt instanceof Uint8Array?tt:tt.subarray(),et)}function concatKeys(et,o){const tt=new Uint8Array(PRIVATE_KEY_BYTE_LENGTH);for(let rt=0;rtenumeration(__KeyTypeValues)})(KeyType||(KeyType={}));var PublicKey;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.Type!=null&&(rt.uint32(8),KeyType.codec().encode(tt.Type,rt)),tt.Data!=null&&(rt.uint32(18),rt.bytes(tt.Data)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.Type=KeyType.codec().decode(tt);break}case 2:{ot.Data=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PublicKey||(PublicKey={}));var PrivateKey;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.Type!=null&&(rt.uint32(8),KeyType.codec().encode(tt.Type,rt)),tt.Data!=null&&(rt.uint32(18),rt.bytes(tt.Data)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.Type=KeyType.codec().decode(tt);break}case 2:{ot.Data=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PrivateKey||(PrivateKey={}));/*! - * MIT License - * - * Copyright (c) 2017-2022 Peculiar Ventures, LLC - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */const ARRAY_BUFFER_NAME="[object ArrayBuffer]";class BufferSourceConverter{static isArrayBuffer(o){return Object.prototype.toString.call(o)===ARRAY_BUFFER_NAME}static toArrayBuffer(o){return this.isArrayBuffer(o)?o:o.byteLength===o.buffer.byteLength||o.byteOffset===0&&o.byteLength===o.buffer.byteLength?o.buffer:this.toUint8Array(o.buffer).slice(o.byteOffset,o.byteOffset+o.byteLength).buffer}static toUint8Array(o){return this.toView(o,Uint8Array)}static toView(o,tt){if(o.constructor===tt)return o;if(this.isArrayBuffer(o))return new tt(o);if(this.isArrayBufferView(o))return new tt(o.buffer,o.byteOffset,o.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(o){return this.isArrayBufferView(o)||this.isArrayBuffer(o)}static isArrayBufferView(o){return ArrayBuffer.isView(o)||o&&this.isArrayBuffer(o.buffer)}static isEqual(o,tt){const rt=BufferSourceConverter.toUint8Array(o),nt=BufferSourceConverter.toUint8Array(tt);if(rt.length!==nt.byteLength)return!1;for(let ot=0;ot=0;rt--)tt+=et[et.length-1-rt]*Math.pow(2,o*rt);return tt}function utilToBase(et,o,tt=-1){const rt=tt;let nt=et,ot=0,it=Math.pow(2,o);for(let st=1;st<8;st++){if(et=0;lt--){const dt=Math.pow(2,lt*o);ct[ot-lt-1]=Math.floor(nt/dt),nt-=ct[ot-lt-1]*dt}return at}it*=Math.pow(2,o)}return new ArrayBuffer(0)}function utilConcatView(...et){let o=0,tt=0;for(const ot of et)o+=ot.length;const rt=new ArrayBuffer(o),nt=new Uint8Array(rt);for(const ot of et)nt.set(ot,tt),tt+=ot.length;return nt}function utilDecodeTC(){const et=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const st=et[0]===255&&et[1]&128,at=et[0]===0&&(et[1]&128)===0;(st||at)&&this.warnings.push("Needlessly long format")}const o=new ArrayBuffer(this.valueHex.byteLength),tt=new Uint8Array(o);for(let st=0;st"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function concat$2(et){let o=0,tt=0;for(let nt=0;nt=ot.length)return this.error="End of input reached before message was fully decoded",-1;if(at===lt){lt+=255;const ht=new Uint8Array(lt);for(let mt=0;mt8)return this.error="Too big integer",-1;if(it+1>ot.length)return this.error="End of input reached before message was fully decoded",-1;const st=tt+1,at=nt.subarray(st,st+it);return at[it-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=utilFromBase(at,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=it+1,tt+this.blockLength}toBER(o=!1){let tt,rt;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return tt=new ArrayBuffer(1),o===!1&&(rt=new Uint8Array(tt),rt[0]=128),tt;if(this.longFormUsed){const nt=utilToBase(this.length,8);if(nt.byteLength>127)return this.error="Too big length",EMPTY_BUFFER$1;if(tt=new ArrayBuffer(nt.byteLength+1),o)return tt;const ot=new Uint8Array(nt);rt=new Uint8Array(tt),rt[0]=nt.byteLength|128;for(let it=0;it=37&&nt.idBlock.isHexOnly===!1)return nt.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:nt};switch(nt.idBlock.tagNumber){case 0:if(nt.idBlock.isConstructed&&nt.lenBlock.length>0)return nt.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:nt};at=typeStore.EndOfContent;break;case 1:at=typeStore.Boolean;break;case 2:at=typeStore.Integer;break;case 3:at=typeStore.BitString;break;case 4:at=typeStore.OctetString;break;case 5:at=typeStore.Null;break;case 6:at=typeStore.ObjectIdentifier;break;case 10:at=typeStore.Enumerated;break;case 12:at=typeStore.Utf8String;break;case 13:at=typeStore.RelativeObjectIdentifier;break;case 14:at=typeStore.TIME;break;case 15:return nt.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:nt};case 16:at=typeStore.Sequence;break;case 17:at=typeStore.Set;break;case 18:at=typeStore.NumericString;break;case 19:at=typeStore.PrintableString;break;case 20:at=typeStore.TeletexString;break;case 21:at=typeStore.VideotexString;break;case 22:at=typeStore.IA5String;break;case 23:at=typeStore.UTCTime;break;case 24:at=typeStore.GeneralizedTime;break;case 25:at=typeStore.GraphicString;break;case 26:at=typeStore.VisibleString;break;case 27:at=typeStore.GeneralString;break;case 28:at=typeStore.UniversalString;break;case 29:at=typeStore.CharacterString;break;case 30:at=typeStore.BmpString;break;case 31:at=typeStore.DATE;break;case 32:at=typeStore.TimeOfDay;break;case 33:at=typeStore.DateTime;break;case 34:at=typeStore.Duration;break;default:{const ct=nt.idBlock.isConstructed?new typeStore.Constructed:new typeStore.Primitive;ct.idBlock=nt.idBlock,ct.lenBlock=nt.lenBlock,ct.warnings=nt.warnings,nt=ct}}break;case 2:case 3:case 4:default:at=nt.idBlock.isConstructed?typeStore.Constructed:typeStore.Primitive}return nt=localChangeType(nt,at),st=nt.fromBER(et,o,nt.lenBlock.isIndefiniteForm?tt:nt.lenBlock.length),nt.valueBeforeDecodeView=et.subarray(rt,rt+nt.blockLength),{offset:st,result:nt}}function fromBER(et){if(!et.byteLength){const o=new BaseBlock({},ValueBlock);return o.error="Input buffer has zero length",{offset:-1,result:o}}return localFromBER(BufferSourceConverter.toUint8Array(et).slice(),0,et.byteLength)}function checkLen(et,o){return et?1:o}class LocalConstructedValueBlock extends ValueBlock{constructor({value:o=[],isIndefiniteForm:tt=!1,...rt}={}){super(rt),this.value=o,this.isIndefiniteForm=tt}fromBER(o,tt,rt){const nt=BufferSourceConverter.toUint8Array(o);if(!checkBufferParams(this,nt,tt,rt))return-1;if(this.valueBeforeDecodeView=nt.subarray(tt,tt+rt),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),tt;let ot=tt;for(;checkLen(this.isIndefiniteForm,rt)>0;){const it=localFromBER(nt,ot,rt);if(it.offset===-1)return this.error=it.result.error,this.warnings.concat(it.result.warnings),-1;if(ot=it.offset,this.blockLength+=it.result.blockLength,rt-=it.result.blockLength,this.value.push(it.result),this.isIndefiniteForm&&it.result.constructor.NAME===END_OF_CONTENT_NAME)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===END_OF_CONTENT_NAME?this.value.pop():this.warnings.push("No EndOfContent block encoded")),ot}toBER(o,tt){const rt=tt||new ViewWriter;for(let nt=0;nt` ${nt}`).join(` -`));const tt=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return o.length?`${tt} : -${o.join(` -`)}`:`${tt} :`}}_a$v=Constructed;typeStore.Constructed=_a$v;Constructed.NAME="CONSTRUCTED";class LocalEndOfContentValueBlock extends ValueBlock{fromBER(o,tt,rt){return tt}toBER(o){return EMPTY_BUFFER$1}}LocalEndOfContentValueBlock.override="EndOfContentValueBlock";var _a$u;class EndOfContent extends BaseBlock{constructor(o={}){super(o,LocalEndOfContentValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}_a$u=EndOfContent;typeStore.EndOfContent=_a$u;EndOfContent.NAME=END_OF_CONTENT_NAME;var _a$t;class Null extends BaseBlock{constructor(o={}){super(o,ValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(o,tt,rt){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=rt,tt+rt>o.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):tt+rt}toBER(o,tt){const rt=new ArrayBuffer(2);if(!o){const nt=new Uint8Array(rt);nt[0]=5,nt[1]=0}return tt&&tt.write(rt),rt}onAsciiEncoding(){return`${this.constructor.NAME}`}}_a$t=Null;typeStore.Null=_a$t;Null.NAME="NULL";class LocalBooleanValueBlock extends HexBlock(ValueBlock){constructor({value:o,...tt}={}){super(tt),tt.valueHex?this.valueHexView=BufferSourceConverter.toUint8Array(tt.valueHex):this.valueHexView=new Uint8Array(1),o&&(this.value=o)}get value(){for(const o of this.valueHexView)if(o>0)return!0;return!1}set value(o){this.valueHexView[0]=o?255:0}fromBER(o,tt,rt){const nt=BufferSourceConverter.toUint8Array(o);return checkBufferParams(this,nt,tt,rt)?(this.valueHexView=nt.subarray(tt,tt+rt),rt>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,utilDecodeTC.call(this),this.blockLength=rt,tt+rt):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}LocalBooleanValueBlock.NAME="BooleanValueBlock";var _a$s;let Boolean$1=class extends BaseBlock{constructor(o={}){super(o,LocalBooleanValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(o){this.valueBlock.value=o}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};_a$s=Boolean$1;typeStore.Boolean=_a$s;Boolean$1.NAME="BOOLEAN";class LocalOctetStringValueBlock extends HexBlock(LocalConstructedValueBlock){constructor({isConstructed:o=!1,...tt}={}){super(tt),this.isConstructed=o}fromBER(o,tt,rt){let nt=0;if(this.isConstructed){if(this.isHexOnly=!1,nt=LocalConstructedValueBlock.prototype.fromBER.call(this,o,tt,rt),nt===-1)return nt;for(let ot=0;ot0&&ct.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=ct.unusedBits}return nt}const ot=BufferSourceConverter.toUint8Array(o);if(!checkBufferParams(this,ot,tt,rt))return-1;const it=ot.subarray(tt,tt+rt);if(this.unusedBits=it[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const st=it.subarray(1);try{if(st.byteLength){const at=localFromBER(st,0,st.byteLength);at.offset!==-1&&at.offset===rt-1&&(this.value=[at.result])}}catch{}}return this.valueHexView=it.subarray(1),this.blockLength=it.length,tt+rt}toBER(o,tt){if(this.isConstructed)return LocalConstructedValueBlock.prototype.toBER.call(this,o,tt);if(o)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return EMPTY_BUFFER$1;const rt=new Uint8Array(this.valueHexView.length+1);return rt[0]=this.unusedBits,rt.set(this.valueHexView,1),rt.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}LocalBitStringValueBlock.NAME="BitStringValueBlock";var _a$q;class BitString extends BaseBlock{constructor({idBlock:o={},lenBlock:tt={},...rt}={}){var nt,ot;(nt=rt.isConstructed)!==null&&nt!==void 0||(rt.isConstructed=!!(!((ot=rt.value)===null||ot===void 0)&&ot.length)),super({idBlock:{isConstructed:rt.isConstructed,...o},lenBlock:{...tt,isIndefiniteForm:!!rt.isIndefiniteForm},...rt},LocalBitStringValueBlock),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(o,tt,rt){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(o,tt,rt)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Constructed.prototype.onAsciiEncoding.call(this);{const o=[],tt=this.valueBlock.valueHexView;for(const nt of tt)o.push(nt.toString(2).padStart(8,"0"));const rt=o.join("");return`${this.constructor.NAME} : ${rt.substring(0,rt.length-this.valueBlock.unusedBits)}`}}}_a$q=BitString;typeStore.BitString=_a$q;BitString.NAME=BIT_STRING_NAME;var _a$p;function viewAdd(et,o){const tt=new Uint8Array([0]),rt=new Uint8Array(et),nt=new Uint8Array(o);let ot=rt.slice(0);const it=ot.length-1,st=nt.slice(0),at=st.length-1;let ct=0;const lt=at=0;ht--,dt++){switch(!0){case dt=ot.length:ot=utilConcatView(new Uint8Array([ct%10]),ot);break;default:ot[it-dt]=ct%10}}return tt[0]>0&&(ot=utilConcatView(tt,ot)),ot}function power2(et){if(et>=powers2.length)for(let o=powers2.length;o<=et;o++){const tt=new Uint8Array([0]);let rt=powers2[o-1].slice(0);for(let nt=rt.length-1;nt>=0;nt--){const ot=new Uint8Array([(rt[nt]<<1)+tt[0]]);tt[0]=ot[0]/10,rt[nt]=ot[0]%10}tt[0]>0&&(rt=utilConcatView(tt,rt)),powers2.push(rt)}return powers2[et]}function viewSub(et,o){let tt=0;const rt=new Uint8Array(et),nt=new Uint8Array(o),ot=rt.slice(0),it=ot.length-1,st=nt.slice(0),at=st.length-1;let ct,lt=0;for(let dt=at;dt>=0;dt--,lt++)switch(ct=ot[it-lt]-st[at-lt]-tt,!0){case ct<0:tt=1,ot[it-lt]=ct+10;break;default:tt=0,ot[it-lt]=ct}if(tt>0)for(let dt=it-at+1;dt>=0;dt--,lt++)if(ct=ot[it-lt]-tt,ct<0)tt=1,ot[it-lt]=ct+10;else{tt=0,ot[it-lt]=ct;break}return ot.slice()}class LocalIntegerValueBlock extends HexBlock(ValueBlock){constructor({value:o,...tt}={}){super(tt),this._valueDec=0,tt.valueHex&&this.setValueHex(),o!==void 0&&(this.valueDec=o)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=utilDecodeTC.call(this)))}set valueDec(o){this._valueDec=o,this.isHexOnly=!1,this.valueHexView=new Uint8Array(utilEncodeTC(o))}get valueDec(){return this._valueDec}fromDER(o,tt,rt,nt=0){const ot=this.fromBER(o,tt,rt);if(ot===-1)return ot;const it=this.valueHexView;return it[0]===0&&it[1]&128?this.valueHexView=it.subarray(1):nt!==0&&it.length1&&(nt=it.length+1),this.valueHexView=it.subarray(nt-it.length)),ot}toDER(o=!1){const tt=this.valueHexView;switch(!0){case(tt[0]&128)!==0:{const rt=new Uint8Array(this.valueHexView.length+1);rt[0]=0,rt.set(tt,1),this.valueHexView=rt}break;case(tt[0]===0&&(tt[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(o)}fromBER(o,tt,rt){const nt=super.fromBER(o,tt,rt);return nt===-1||this.setValueHex(),nt}toBER(o){return o?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const o=this.valueHexView.length*8-1;let tt=new Uint8Array(this.valueHexView.length*8/3),rt=0,nt;const ot=this.valueHexView;let it="",st=!1;for(let at=ot.byteLength-1;at>=0;at--){nt=ot[at];for(let ct=0;ct<8;ct++){if((nt&1)===1)switch(rt){case o:tt=viewSub(power2(rt),tt),it="-";break;default:tt=viewAdd(tt,power2(rt))}rt++,nt>>=1}}for(let at=0;at0;){const ot=new LocalSidValueBlock;if(nt=ot.fromBER(o,nt,rt),nt===-1)return this.blockLength=0,this.error=ot.error,nt;this.value.length===0&&(ot.isFirstSid=!0),this.blockLength+=ot.blockLength,rt-=ot.blockLength,this.value.push(ot)}return nt}toBER(o){const tt=[];for(let rt=0;rtNumber.MAX_SAFE_INTEGER){assertBigInt();const st=BigInt(nt);it.valueBigInt=st}else if(it.valueDec=parseInt(nt,10),isNaN(it.valueDec))return;this.value.length||(it.isFirstSid=!0,ot=!0),this.value.push(it)}while(rt!==-1)}toString(){let o="",tt=!1;for(let rt=0;rt0;){const ot=new LocalRelativeSidValueBlock;if(nt=ot.fromBER(o,nt,rt),nt===-1)return this.blockLength=0,this.error=ot.error,nt;this.blockLength+=ot.blockLength,rt-=ot.blockLength,this.value.push(ot)}return nt}toBER(o,tt){const rt=[];for(let nt=0;nt4)continue;const st=4-it.length;for(let at=it.length-1;at>=0;at--)rt[nt*4+at+st]=it[at]}this.valueBlock.value=o}}LocalUniversalStringValueBlock.NAME="UniversalStringValueBlock";var _a$g;class UniversalString extends LocalUniversalStringValueBlock{constructor({...o}={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}_a$g=UniversalString;typeStore.UniversalString=_a$g;UniversalString.NAME="UniversalString";var _a$f;class NumericString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}_a$f=NumericString;typeStore.NumericString=_a$f;NumericString.NAME="NumericString";var _a$e;class PrintableString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}_a$e=PrintableString;typeStore.PrintableString=_a$e;PrintableString.NAME="PrintableString";var _a$d;class TeletexString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}_a$d=TeletexString;typeStore.TeletexString=_a$d;TeletexString.NAME="TeletexString";var _a$c;class VideotexString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}_a$c=VideotexString;typeStore.VideotexString=_a$c;VideotexString.NAME="VideotexString";var _a$b;class IA5String extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}_a$b=IA5String;typeStore.IA5String=_a$b;IA5String.NAME="IA5String";var _a$a;class GraphicString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}_a$a=GraphicString;typeStore.GraphicString=_a$a;GraphicString.NAME="GraphicString";var _a$9;class VisibleString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}_a$9=VisibleString;typeStore.VisibleString=_a$9;VisibleString.NAME="VisibleString";var _a$8;class GeneralString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}_a$8=GeneralString;typeStore.GeneralString=_a$8;GeneralString.NAME="GeneralString";var _a$7;class CharacterString extends LocalSimpleStringBlock{constructor(o={}){super(o),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}_a$7=CharacterString;typeStore.CharacterString=_a$7;CharacterString.NAME="CharacterString";var _a$6;class UTCTime extends VisibleString{constructor({value:o,valueDate:tt,...rt}={}){if(super(rt),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,o){this.fromString(o),this.valueBlock.valueHexView=new Uint8Array(o.length);for(let nt=0;nt=50?this.year=1900+nt:this.year=2e3+nt,this.month=parseInt(rt[2],10),this.day=parseInt(rt[3],10),this.hour=parseInt(rt[4],10),this.minute=parseInt(rt[5],10),this.second=parseInt(rt[6],10)}toString(o="iso"){if(o==="iso"){const tt=new Array(7);return tt[0]=padNumber(this.year<2e3?this.year-1900:this.year-2e3,2),tt[1]=padNumber(this.month,2),tt[2]=padNumber(this.day,2),tt[3]=padNumber(this.hour,2),tt[4]=padNumber(this.minute,2),tt[5]=padNumber(this.second,2),tt[6]="Z",tt.join("")}return super.toString(o)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}_a$6=UTCTime;typeStore.UTCTime=_a$6;UTCTime.NAME="UTCTime";var _a$5;class GeneralizedTime extends UTCTime{constructor(o={}){var tt;super(o),(tt=this.millisecond)!==null&&tt!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(o){super.fromDate(o),this.millisecond=o.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(o){let tt=!1,rt="",nt="",ot=0,it,st=0,at=0;if(o[o.length-1]==="Z")rt=o.substring(0,o.length-1),tt=!0;else{const dt=new Number(o[o.length-1]);if(isNaN(dt.valueOf()))throw new Error("Wrong input string for conversion");rt=o}if(tt){if(rt.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(rt.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let dt=1,ht=rt.indexOf("+"),mt="";if(ht===-1&&(ht=rt.indexOf("-"),dt=-1),ht!==-1){if(mt=rt.substring(ht+1),rt=rt.substring(0,ht),mt.length!==2&&mt.length!==4)throw new Error("Wrong input string for conversion");let ft=parseInt(mt.substring(0,2),10);if(isNaN(ft.valueOf()))throw new Error("Wrong input string for conversion");if(st=dt*ft,mt.length===4){if(ft=parseInt(mt.substring(2,4),10),isNaN(ft.valueOf()))throw new Error("Wrong input string for conversion");at=dt*ft}}}let ct=rt.indexOf(".");if(ct===-1&&(ct=rt.indexOf(",")),ct!==-1){const dt=new Number(`0${rt.substring(ct)}`);if(isNaN(dt.valueOf()))throw new Error("Wrong input string for conversion");ot=dt.valueOf(),nt=rt.substring(0,ct)}else nt=rt;switch(!0){case nt.length===8:if(it=/(\d{4})(\d{2})(\d{2})/ig,ct!==-1)throw new Error("Wrong input string for conversion");break;case nt.length===10:if(it=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,ct!==-1){let dt=60*ot;this.minute=Math.floor(dt),dt=60*(dt-this.minute),this.second=Math.floor(dt),dt=1e3*(dt-this.second),this.millisecond=Math.floor(dt)}break;case nt.length===12:if(it=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,ct!==-1){let dt=60*ot;this.second=Math.floor(dt),dt=1e3*(dt-this.second),this.millisecond=Math.floor(dt)}break;case nt.length===14:if(it=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,ct!==-1){const dt=1e3*ot;this.millisecond=Math.floor(dt)}break;default:throw new Error("Wrong input string for conversion")}const lt=it.exec(nt);if(lt===null)throw new Error("Wrong input string for conversion");for(let dt=1;dt(et[tt]=o,et),[]),alphabetCharsToBytes$d=alphabet$d.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$D(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$d[tt],o),"")}function decode$K(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$d[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$q=from$k({prefix:"🚀",name:"base256emoji",encode:encode$D,decode:decode$K}),base256emoji$r=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$q},Symbol.toStringTag,{value:"Module"})),base64$t=rfc4648$g({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$d=rfc4648$g({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$e=rfc4648$g({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$d=rfc4648$g({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$u=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$t,base64pad:base64pad$d,base64url:base64url$e,base64urlpad:base64urlpad$d},Symbol.toStringTag,{value:"Module"})),base8$q=rfc4648$g({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$r=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$q},Symbol.toStringTag,{value:"Module"})),identity$e=from$k({prefix:"\0",name:"identity",encode:et=>toString$r(et),decode:et=>fromString$q(et)}),identityBase$d=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;function from$j({name:et,code:o,encode:tt}){return new Hasher$1(et,o,tt)}let Hasher$1=class{constructor(o,tt,rt){wt(this,"name");wt(this,"code");wt(this,"encode");this.name=o,this.code=tt,this.encode=rt}digest(o){if(o instanceof Uint8Array){const tt=this.encode(o);return tt instanceof Uint8Array?create$5(this.code,tt):tt.then(rt=>create$5(this.code,rt))}else throw Error("Unknown type, must be binary type")}};function sha$1(et){return async o=>new Uint8Array(await crypto.subtle.digest(et,o))}const sha256$1=from$j({name:"sha2-256",code:18,encode:sha$1("SHA-256")}),bases$d={...identityBase$d,...base2$r,...base8$r,...base10$r,...base16$r,...base32$v,...base36$s,...base58$d,...base64$u,...base256emoji$r};function allocUnsafe$c(et=0){return new Uint8Array(et)}function createCodec$d(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$h=createCodec$d("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$d=createCodec$d("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$c(et.length);for(let tt=0;tt0&&(o=`0${o}`);const tt=o.length/2,rt=new Uint8Array(tt);let nt=0,ot=0;for(;nt0&&(rt=`0${rt}`),o.push(rt)}),BigInt("0x"+o.join(""))}function pkixToRSAPublicKey(et){const o=pkixToJwk(et);if(rsaKeySize(o)>MAX_RSA_KEY_SIZE)throw new InvalidPublicKeyError("Key size is too large");const tt=sha256$3(PublicKey.encode({Type:KeyType.RSA,Data:et})),rt=create$5(SHA2_256_CODE,tt);return new RSAPublicKey(o,rt)}function isPromise$3(et){return et==null?!1:typeof et.then=="function"&&typeof et.catch=="function"&&typeof et.finally=="function"}function hashAndVerify(et,o,tt){const rt=sha256$1.digest(tt instanceof Uint8Array?tt:tt.subarray());if(isPromise$3(rt))return rt.then(({digest:nt})=>secp256k1.verify(o,nt,et)).catch(nt=>{throw new VerificationError(String(nt))});try{return secp256k1.verify(o,rt.digest,et)}catch(nt){throw new VerificationError(String(nt))}}class Secp256k1PublicKey{constructor(o){wt(this,"type","secp256k1");wt(this,"raw");wt(this,"_key");this._key=validateSecp256k1PublicKey(o),this.raw=compressSecp256k1PublicKey(this._key)}toMultihash(){return identity$f.digest(publicKeyToProtobuf(this))}toCID(){return CID$2.createV1(114,this.toMultihash())}toString(){return base58btc$h.encode(this.toMultihash().bytes).substring(1)}equals(o){return o==null||!(o.raw instanceof Uint8Array)?!1:equals$9(this.raw,o.raw)}verify(o,tt){return hashAndVerify(this._key,tt,o)}}function unmarshalSecp256k1PublicKey(et){return new Secp256k1PublicKey(et)}function compressSecp256k1PublicKey(et){return secp256k1.ProjectivePoint.fromHex(et).toRawBytes(!0)}function validateSecp256k1PublicKey(et){try{return secp256k1.ProjectivePoint.fromHex(et),et}catch(o){throw new InvalidPublicKeyError(String(o))}}async function generateKeyPair(et,o){return generateEd25519KeyPair()}function publicKeyFromProtobuf(et){const{Type:o,Data:tt}=PublicKey.decode(et),rt=tt??new Uint8Array;switch(o){case KeyType.RSA:return pkixToRSAPublicKey(rt);case KeyType.Ed25519:return unmarshalEd25519PublicKey(rt);case KeyType.secp256k1:return unmarshalSecp256k1PublicKey(rt);default:throw new UnsupportedKeyTypeError$1}}function publicKeyFromRaw(et){return et.byteLength===32?unmarshalEd25519PublicKey(et):et.byteLength===33?unmarshalSecp256k1PublicKey(et):pkixToRSAPublicKey(et)}function publicKeyFromMultihash(et){const{Type:o,Data:tt}=PublicKey.decode(et.digest),rt=tt??new Uint8Array;switch(o){case KeyType.Ed25519:return unmarshalEd25519PublicKey(rt);case KeyType.secp256k1:return unmarshalSecp256k1PublicKey(rt);default:throw new UnsupportedKeyTypeError$1}}function publicKeyToProtobuf(et){return PublicKey.encode({Type:KeyType[et.type],Data:et.raw})}const peerIdSymbol$2=Symbol.for("@libp2p/peer-id");var gs;let InvalidParametersError$2=(gs=class extends Error{constructor(o="Invalid parameters"){super(o),this.name="InvalidParametersError"}},wt(gs,"name","InvalidParametersError"),gs);class InvalidCIDError extends Error{constructor(o="Invalid CID"){super(o),this.name="InvalidCIDError"}}wt(InvalidCIDError,"name","InvalidCIDError");class InvalidMultihashError extends Error{constructor(o="Invalid Multihash"){super(o),this.name="InvalidMultihashError"}}wt(InvalidMultihashError,"name","InvalidMultihashError");class UnsupportedKeyTypeError extends Error{constructor(o="Unsupported key type"){super(o),this.name="UnsupportedKeyTypeError"}}wt(UnsupportedKeyTypeError,"name","UnsupportedKeyTypeError");function equals$8(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$h=base$h,_brrp__multiformats_scope_baseX$g=src$h;let Encoder$h=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$h=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$i(this,o)}},ComposedDecoder$g=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$i(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$i(et,o){return new ComposedDecoder$g({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$g=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$h(o,tt,rt),this.decoder=new Decoder$h(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$i({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$g(et,o,tt,rt)}function baseX$g({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$g(tt,et);return from$i({prefix:o,name:et,encode:rt,decode:ot=>coerce$g(nt(ot))})}function decode$J(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$C(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<=INT$3;)o[tt++]=et&255|MSB$5,et/=128;for(;et&MSBALL$3;)o[tt++]=et&255|MSB$5,et>>>=7;return o[tt]=et|0,encode$B.bytes=tt-rt+1,o}var decode$I=read$4,MSB$1$3=128,REST$1$3=127;function read$4(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$4.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1$3)<=MSB$1$3);return read$4.bytes=ot-rt,tt}var N1$3=Math.pow(2,7),N2$3=Math.pow(2,14),N3$3=Math.pow(2,21),N4$3=Math.pow(2,28),N5$3=Math.pow(2,35),N6$3=Math.pow(2,42),N7$3=Math.pow(2,49),N8$3=Math.pow(2,56),N9$3=Math.pow(2,63),length$3=function(et){return et{const[dt,ht]=decode$H(o.subarray(tt));return tt+=ht,dt};let nt=rt(),ot=DAG_PB_CODE$1;if(nt===18?(nt=0,tt=0):ot=rt(),nt!==0&&nt!==1)throw new RangeError(`Invalid CID version ${nt}`);const it=tt,st=rt(),at=rt(),ct=tt+at,lt=ct-it;return{version:nt,codec:ot,multihashCode:st,digestSize:at,multihashSize:lt,size:ct}}static parse(o,tt){const[rt,nt]=parseCIDtoBytes$1(o,tt),ot=Dr.decode(nt);if(ot.version===0&&o[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache$1(ot).set(rt,o),ot}};function parseCIDtoBytes$1(et,o){switch(et[0]){case"Q":{const tt=o??base58btc$g;return[base58btc$g.prefix,tt.decode(`${base58btc$g.prefix}${et}`)]}case base58btc$g.prefix:{const tt=o??base58btc$g;return[base58btc$g.prefix,tt.decode(et)]}case base32$s.prefix:{const tt=o??base32$s;return[base32$s.prefix,tt.decode(et)]}case base36$p.prefix:{const tt=o??base36$p;return[base36$p.prefix,tt.decode(et)]}default:{if(o==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[et[0],o.decode(et)]}}}function toStringV0$1(et,o,tt){const{prefix:rt}=tt;if(rt!==base58btc$g.prefix)throw Error(`Cannot string encode V0 in ${tt.name} encoding`);const nt=o.get(rt);if(nt==null){const ot=tt.encode(et).slice(1);return o.set(rt,ot),ot}else return nt}function toStringV1$1(et,o,tt){const{prefix:rt}=tt,nt=o.get(rt);if(nt==null){const ot=tt.encode(et);return o.set(rt,ot),ot}else return nt}const DAG_PB_CODE$1=112,SHA_256_CODE$1=18;function encodeCID$1(et,o,tt){const rt=encodingLength$3(et),nt=rt+encodingLength$3(o),ot=new Uint8Array(nt+tt.byteLength);return encodeTo$1(et,ot,0),encodeTo$1(o,ot,rt),ot.set(tt,nt),ot}const cidSymbol$1=Symbol.for("@ipld/js-cid/CID"),code$1=0,name$3="identity",encode$A=coerce$g;function digest(et){return create$4(code$1,encode$A(et))}const identity$d={code:code$1,name:name$3,encode:encode$A,digest};function from$h({name:et,code:o,encode:tt}){return new Hasher(et,o,tt)}class Hasher{constructor(o,tt,rt){wt(this,"name");wt(this,"code");wt(this,"encode");this.name=o,this.code=tt,this.encode=rt}digest(o){if(o instanceof Uint8Array){const tt=this.encode(o);return tt instanceof Uint8Array?create$4(this.code,tt):tt.then(rt=>create$4(this.code,rt))}else throw Error("Unknown type, must be binary type")}}function sha(et){return async o=>new Uint8Array(await crypto.subtle.digest(et,o))}const sha256=from$h({name:"sha2-256",code:18,encode:sha("SHA-256")}),base10$o=baseX$g({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$p=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$o},Symbol.toStringTag,{value:"Module"})),base16$o=rfc4648$f({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$c=rfc4648$f({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$p=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$o,base16upper:base16upper$c},Symbol.toStringTag,{value:"Module"})),base2$o=rfc4648$f({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$p=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$o},Symbol.toStringTag,{value:"Module"})),alphabet$c=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$c=alphabet$c.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$c=alphabet$c.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$z(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$c[tt],o),"")}function decode$F(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$c[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$o=from$i({prefix:"🚀",name:"base256emoji",encode:encode$z,decode:decode$F}),base256emoji$p=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$o},Symbol.toStringTag,{value:"Module"})),base64$r=rfc4648$f({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$c=rfc4648$f({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$d=rfc4648$f({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$c=rfc4648$f({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$s=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$r,base64pad:base64pad$c,base64url:base64url$d,base64urlpad:base64urlpad$c},Symbol.toStringTag,{value:"Module"})),base8$o=rfc4648$f({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$p=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$o},Symbol.toStringTag,{value:"Module"})),identity$c=from$i({prefix:"\0",name:"identity",encode:et=>toString$p(et),decode:et=>fromString$o(et)}),identityBase$c=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$c},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$c={...identityBase$c,...base2$p,...base8$p,...base10$p,...base16$p,...base32$t,...base36$q,...base58$c,...base64$s,...base256emoji$p};function allocUnsafe$b(et=0){return new Uint8Array(et)}function createCodec$c(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$g=createCodec$c("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$c=createCodec$c("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$b(et.length);for(let tt=0;tt{rt=()=>{it(nt)},o.addEventListener("abort",rt)})])}finally{rt!=null&&o.removeEventListener("abort",rt)}}class QueuelessPushable{constructor(){wt(this,"readNext");wt(this,"haveNext");wt(this,"ended");wt(this,"nextResult");this.ended=!1,this.readNext=pDefer(),this.haveNext=pDefer()}[Symbol.asyncIterator](){return this}async next(){if(this.nextResult==null&&await this.haveNext.promise,this.nextResult==null)throw new Error("HaveNext promise resolved but nextResult was undefined");const o=this.nextResult;return this.nextResult=void 0,this.readNext.resolve(),this.readNext=pDefer(),o}async throw(o){return this.ended=!0,o!=null&&(this.haveNext.promise.catch(()=>{}),this.haveNext.reject(o)),{done:!0,value:void 0}}async return(){const o={done:!0,value:void 0};return await this._push(void 0),o}async push(o,tt){await this._push(o,tt)}async end(o,tt){o!=null?await this.throw(o):await this._push(void 0,tt)}async _push(o,tt){if(o!=null&&this.ended)throw new Error("Cannot push value onto an ended pushable");for(;this.nextResult!=null;)await this.readNext.promise;o!=null?this.nextResult={done:!1,value:o}:(this.ended=!0,this.nextResult={done:!0,value:void 0}),this.haveNext.resolve(),this.haveNext=pDefer(),await raceSignal(this.readNext.promise,tt==null?void 0:tt.signal,tt)}}function queuelessPushable(){return new QueuelessPushable}class UnexpectedEOFError extends Error{constructor(){super(...arguments);wt(this,"name","UnexpectedEOFError");wt(this,"code","ERR_UNEXPECTED_EOF")}}class CodeError extends Error{constructor(tt,rt){super(tt);wt(this,"code");this.code=rt}}let AbortError$7=class extends CodeError{constructor(tt){super(tt,"ABORT_ERR");wt(this,"type");this.type="aborted",this.name="AbortError"}};function byteStream(et,o){const tt=queuelessPushable();et.sink(tt).catch(async it=>{await tt.end(it)}),et.sink=async it=>{for await(const st of it)await tt.push(st);await tt.end()};let rt=et.source;et.source[Symbol.iterator]!=null?rt=et.source[Symbol.iterator]():et.source[Symbol.asyncIterator]!=null&&(rt=et.source[Symbol.asyncIterator]());const nt=new Uint8ArrayList;return{read:async(it,st)=>{var lt,dt;(lt=st==null?void 0:st.signal)==null||lt.throwIfAborted();let at;const ct=new Promise((ht,mt)=>{var ft;at=()=>{mt(new AbortError$7("Read aborted"))},(ft=st==null?void 0:st.signal)==null||ft.addEventListener("abort",at)});try{if(it==null){const{done:mt,value:ft}=await Promise.race([rt.next(),ct]);return mt===!0?new Uint8ArrayList:ft}for(;nt.byteLength{var at;(at=st==null?void 0:st.signal)==null||at.throwIfAborted(),it instanceof Uint8Array?await tt.push(it,st):await tt.push(it.subarray(),st)},unwrap:()=>{if(nt.byteLength>0){const it=et.source;et.source=async function*(){(o==null?void 0:o.yieldBytes)===!1?yield nt:yield*nt,yield*it}()}return et}}}class InvalidMessageLengthError extends Error{constructor(){super(...arguments);wt(this,"name","InvalidMessageLengthError");wt(this,"code","ERR_INVALID_MSG_LENGTH")}}class InvalidDataLengthError extends Error{constructor(){super(...arguments);wt(this,"name","InvalidDataLengthError");wt(this,"code","ERR_MSG_DATA_TOO_LONG")}}class InvalidDataLengthLengthError extends Error{constructor(){super(...arguments);wt(this,"name","InvalidDataLengthLengthError");wt(this,"code","ERR_MSG_LENGTH_TOO_LONG")}}function lpStream(et,o={}){const tt=byteStream(et,o);o.maxDataLength!=null&&o.maxLengthLength==null&&(o.maxLengthLength=encodingLength$6(o.maxDataLength));const rt=(o==null?void 0:o.lengthDecoder)??decode$Z,nt=(o==null?void 0:o.lengthEncoder)??encode$P;return{read:async it=>{let st=-1;const at=new Uint8ArrayList;for(;;){at.append(await tt.read(1,it));try{st=rt(at)}catch(ct){if(ct instanceof RangeError)continue;throw ct}if(st<0)throw new InvalidMessageLengthError("Invalid message length");if((o==null?void 0:o.maxLengthLength)!=null&&at.byteLength>o.maxLengthLength)throw new InvalidDataLengthLengthError("message length length too long");if(st>-1)break}if((o==null?void 0:o.maxDataLength)!=null&&st>o.maxDataLength)throw new InvalidDataLengthError("message length too long");return tt.read(st,it)},write:async(it,st)=>{await tt.write(new Uint8ArrayList(nt(it.byteLength),it),st)},writeV:async(it,st)=>{const at=new Uint8ArrayList(...it.flatMap(ct=>[nt(ct.byteLength),ct]));await tt.write(at,st)},unwrap:()=>tt.unwrap()}}function pair(){const et=pDefer();let o=!1;return{sink:async tt=>{if(o)throw new Error("already piped");o=!0,et.resolve(tt)},source:async function*(){yield*await et.promise}()}}function duplexPair(){const et=pair(),o=pair();return[{source:et.source,sink:o.sink},{source:o.source,sink:et.sink}]}function alloc$4(et=0){return new Uint8Array(et)}function allocUnsafe$a(et=0){return new Uint8Array(et)}var define_globalThis_process_env_default$2={};const NOISE_MSG_MAX_LENGTH_BYTES=65535,NOISE_MSG_MAX_LENGTH_BYTES_WITHOUT_TAG=NOISE_MSG_MAX_LENGTH_BYTES-16,DUMP_SESSION_KEYS=!!(define_globalThis_process_env_default$2!=null&&define_globalThis_process_env_default$2.DUMP_SESSION_KEYS);function number$2(et){if(!Number.isSafeInteger(et)||et<0)throw new Error(`positive integer expected, not ${et}`)}function bool(et){if(typeof et!="boolean")throw new Error(`boolean expected, not ${et}`)}function isBytes$1(et){return et instanceof Uint8Array||et!=null&&typeof et=="object"&&et.constructor.name==="Uint8Array"}function bytes(et,...o){if(!isBytes$1(et))throw new Error("Uint8Array expected");if(o.length>0&&!o.includes(et.length))throw new Error(`Uint8Array expected of length ${o}, not of length=${et.length}`)}function exists(et,o=!0){if(et.destroyed)throw new Error("Hash instance has been destroyed");if(o&&et.finished)throw new Error("Hash#digest() has already been called")}function output(et,o){bytes(et);const tt=o.outputLen;if(et.lengthnew Uint32Array(et.buffer,et.byteOffset,Math.floor(et.byteLength/4)),createView=et=>new DataView(et.buffer,et.byteOffset,et.byteLength),isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes(et){if(typeof et!="string")throw new Error(`string expected, got ${typeof et}`);return new Uint8Array(new TextEncoder().encode(et))}function toBytes(et){if(typeof et=="string")et=utf8ToBytes(et);else if(isBytes$1(et))et=copyBytes(et);else throw new Error(`Uint8Array expected, got ${typeof et}`);return et}function checkOpts(et,o){if(o==null||typeof o!="object")throw new Error("options must be defined");return Object.assign(et,o)}function equalBytes(et,o){if(et.length!==o.length)return!1;let tt=0;for(let rt=0;rt(Object.assign(o,et),o);function setBigUint64(et,o,tt,rt){if(typeof et.setBigUint64=="function")return et.setBigUint64(o,tt,rt);const nt=BigInt(32),ot=BigInt(4294967295),it=Number(tt>>nt&ot),st=Number(tt&ot),at=4,ct=0;et.setUint32(o+at,it,rt),et.setUint32(o+ct,st,rt)}function copyBytes(et){return Uint8Array.from(et)}function clean(...et){for(let o=0;oUint8Array.from(et.split("").map(o=>o.charCodeAt(0))),sigma16=_utf8ToBytes("expand 16-byte k"),sigma32=_utf8ToBytes("expand 32-byte k"),sigma16_32=u32(sigma16),sigma32_32=u32(sigma32);sigma32_32.slice();function rotl(et,o){return et<>>32-o}function isAligned32(et){return et.byteOffset%4===0}const BLOCK_LEN=64,BLOCK_LEN32=16,MAX_COUNTER=2**32-1,U32_EMPTY=new Uint32Array;function runCipher(et,o,tt,rt,nt,ot,it,st){const at=nt.length,ct=new Uint8Array(BLOCK_LEN),lt=u32(ct),dt=isAligned32(nt)&&isAligned32(ot),ht=dt?u32(nt):U32_EMPTY,mt=dt?u32(ot):U32_EMPTY;for(let ft=0;ft=MAX_COUNTER)throw new Error("arx: counter overflow");const pt=Math.min(BLOCK_LEN,at-ft);if(dt&&pt===BLOCK_LEN){const yt=ft/4;if(ft%4!==0)throw new Error("arx: invalid block position");for(let gt=0,bt;gt{bytes(st),bytes(at),bytes(ct);const ht=ct.length;if(lt===void 0&&(lt=new Uint8Array(ht)),bytes(lt),number$2(dt),dt<0||dt>=MAX_COUNTER)throw new Error("arx: counter overflow");if(lt.lengthet[o++]&255|(et[o++]&255)<<8;class Poly1305{constructor(o){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,o=toBytes(o),bytes(o,32);const tt=u8to16(o,0),rt=u8to16(o,2),nt=u8to16(o,4),ot=u8to16(o,6),it=u8to16(o,8),st=u8to16(o,10),at=u8to16(o,12),ct=u8to16(o,14);this.r[0]=tt&8191,this.r[1]=(tt>>>13|rt<<3)&8191,this.r[2]=(rt>>>10|nt<<6)&7939,this.r[3]=(nt>>>7|ot<<9)&8191,this.r[4]=(ot>>>4|it<<12)&255,this.r[5]=it>>>1&8190,this.r[6]=(it>>>14|st<<2)&8191,this.r[7]=(st>>>11|at<<5)&8065,this.r[8]=(at>>>8|ct<<8)&8191,this.r[9]=ct>>>5&127;for(let lt=0;lt<8;lt++)this.pad[lt]=u8to16(o,16+2*lt)}process(o,tt,rt=!1){const nt=rt?0:2048,{h:ot,r:it}=this,st=it[0],at=it[1],ct=it[2],lt=it[3],dt=it[4],ht=it[5],mt=it[6],ft=it[7],pt=it[8],yt=it[9],gt=u8to16(o,tt+0),bt=u8to16(o,tt+2),xt=u8to16(o,tt+4),vt=u8to16(o,tt+6),Et=u8to16(o,tt+8),Ct=u8to16(o,tt+10),St=u8to16(o,tt+12),At=u8to16(o,tt+14);let kt=ot[0]+(gt&8191),It=ot[1]+((gt>>>13|bt<<3)&8191),Nt=ot[2]+((bt>>>10|xt<<6)&8191),Lt=ot[3]+((xt>>>7|vt<<9)&8191),Mt=ot[4]+((vt>>>4|Et<<12)&8191),zt=ot[5]+(Et>>>1&8191),Ut=ot[6]+((Et>>>14|Ct<<2)&8191),Xt=ot[7]+((Ct>>>11|St<<5)&8191),Wt=ot[8]+((St>>>8|At<<8)&8191),Ft=ot[9]+(At>>>5|nt),qt=0,Pt=qt+kt*st+It*(5*yt)+Nt*(5*pt)+Lt*(5*ft)+Mt*(5*mt);qt=Pt>>>13,Pt&=8191,Pt+=zt*(5*ht)+Ut*(5*dt)+Xt*(5*lt)+Wt*(5*ct)+Ft*(5*at),qt+=Pt>>>13,Pt&=8191;let Yt=qt+kt*at+It*st+Nt*(5*yt)+Lt*(5*pt)+Mt*(5*ft);qt=Yt>>>13,Yt&=8191,Yt+=zt*(5*mt)+Ut*(5*ht)+Xt*(5*dt)+Wt*(5*lt)+Ft*(5*ct),qt+=Yt>>>13,Yt&=8191;let Qt=qt+kt*ct+It*at+Nt*st+Lt*(5*yt)+Mt*(5*pt);qt=Qt>>>13,Qt&=8191,Qt+=zt*(5*ft)+Ut*(5*mt)+Xt*(5*ht)+Wt*(5*dt)+Ft*(5*lt),qt+=Qt>>>13,Qt&=8191;let jt=qt+kt*lt+It*ct+Nt*at+Lt*st+Mt*(5*yt);qt=jt>>>13,jt&=8191,jt+=zt*(5*pt)+Ut*(5*ft)+Xt*(5*mt)+Wt*(5*ht)+Ft*(5*dt),qt+=jt>>>13,jt&=8191;let Gt=qt+kt*dt+It*lt+Nt*ct+Lt*at+Mt*st;qt=Gt>>>13,Gt&=8191,Gt+=zt*(5*yt)+Ut*(5*pt)+Xt*(5*ft)+Wt*(5*mt)+Ft*(5*ht),qt+=Gt>>>13,Gt&=8191;let rr=qt+kt*ht+It*dt+Nt*lt+Lt*ct+Mt*at;qt=rr>>>13,rr&=8191,rr+=zt*st+Ut*(5*yt)+Xt*(5*pt)+Wt*(5*ft)+Ft*(5*mt),qt+=rr>>>13,rr&=8191;let Ht=qt+kt*mt+It*ht+Nt*dt+Lt*lt+Mt*ct;qt=Ht>>>13,Ht&=8191,Ht+=zt*at+Ut*st+Xt*(5*yt)+Wt*(5*pt)+Ft*(5*ft),qt+=Ht>>>13,Ht&=8191;let dr=qt+kt*ft+It*mt+Nt*ht+Lt*dt+Mt*lt;qt=dr>>>13,dr&=8191,dr+=zt*ct+Ut*at+Xt*st+Wt*(5*yt)+Ft*(5*pt),qt+=dr>>>13,dr&=8191;let Zt=qt+kt*pt+It*ft+Nt*mt+Lt*ht+Mt*dt;qt=Zt>>>13,Zt&=8191,Zt+=zt*lt+Ut*ct+Xt*at+Wt*st+Ft*(5*yt),qt+=Zt>>>13,Zt&=8191;let Jt=qt+kt*yt+It*pt+Nt*ft+Lt*mt+Mt*ht;qt=Jt>>>13,Jt&=8191,Jt+=zt*dt+Ut*lt+Xt*ct+Wt*at+Ft*st,qt+=Jt>>>13,Jt&=8191,qt=(qt<<2)+qt|0,qt=qt+Pt|0,Pt=qt&8191,qt=qt>>>13,Yt+=qt,ot[0]=Pt,ot[1]=Yt,ot[2]=Qt,ot[3]=jt,ot[4]=Gt,ot[5]=rr,ot[6]=Ht,ot[7]=dr,ot[8]=Zt,ot[9]=Jt}finalize(){const{h:o,pad:tt}=this,rt=new Uint16Array(10);let nt=o[1]>>>13;o[1]&=8191;for(let st=2;st<10;st++)o[st]+=nt,nt=o[st]>>>13,o[st]&=8191;o[0]+=nt*5,nt=o[0]>>>13,o[0]&=8191,o[1]+=nt,nt=o[1]>>>13,o[1]&=8191,o[2]+=nt,rt[0]=o[0]+5,nt=rt[0]>>>13,rt[0]&=8191;for(let st=1;st<10;st++)rt[st]=o[st]+nt,nt=rt[st]>>>13,rt[st]&=8191;rt[9]-=8192;let ot=(nt^1)-1;for(let st=0;st<10;st++)rt[st]&=ot;ot=~ot;for(let st=0;st<10;st++)o[st]=o[st]&ot|rt[st];o[0]=(o[0]|o[1]<<13)&65535,o[1]=(o[1]>>>3|o[2]<<10)&65535,o[2]=(o[2]>>>6|o[3]<<7)&65535,o[3]=(o[3]>>>9|o[4]<<4)&65535,o[4]=(o[4]>>>12|o[5]<<1|o[6]<<14)&65535,o[5]=(o[6]>>>2|o[7]<<11)&65535,o[6]=(o[7]>>>5|o[8]<<8)&65535,o[7]=(o[8]>>>8|o[9]<<5)&65535;let it=o[0]+tt[0];o[0]=it&65535;for(let st=1;st<8;st++)it=(o[st]+tt[st]|0)+(it>>>16)|0,o[st]=it&65535;clean(rt)}update(o){exists(this);const{buffer:tt,blockLen:rt}=this;o=toBytes(o);const nt=o.length;for(let ot=0;ot>>0,o[ot++]=rt[it]>>>8;return o}digest(){const{buffer:o,outputLen:tt}=this;this.digestInto(o);const rt=o.slice(0,tt);return this.destroy(),rt}}function wrapConstructorWithKey(et){const o=(rt,nt)=>et(nt).update(toBytes(rt)).digest(),tt=et(new Uint8Array(32));return o.outputLen=tt.outputLen,o.blockLen=tt.blockLen,o.create=rt=>et(rt),o}const poly1305=wrapConstructorWithKey(et=>new Poly1305(et));function chachaCore(et,o,tt,rt,nt,ot=20){let it=et[0],st=et[1],at=et[2],ct=et[3],lt=o[0],dt=o[1],ht=o[2],mt=o[3],ft=o[4],pt=o[5],yt=o[6],gt=o[7],bt=nt,xt=tt[0],vt=tt[1],Et=tt[2],Ct=it,St=st,At=at,kt=ct,It=lt,Nt=dt,Lt=ht,Mt=mt,zt=ft,Ut=pt,Xt=yt,Wt=gt,Ft=bt,qt=xt,Pt=vt,Yt=Et;for(let jt=0;jt{et.update(o);const tt=o.length%16;tt&&et.update(ZEROS16.subarray(tt))},ZEROS32=new Uint8Array(32);function computeTag(et,o,tt,rt,nt){const ot=et(o,tt,ZEROS32),it=poly1305.create(ot);nt&&updatePadded(it,nt),updatePadded(it,rt);const st=new Uint8Array(16),at=createView(st);setBigUint64(at,0,BigInt(nt?nt.length:0),!0),setBigUint64(at,8,BigInt(rt.length),!0),it.update(st);const ct=it.digest();return clean(ot,st),ct}const _poly1305_aead=et=>(o,tt,rt)=>(bytes(o,32),bytes(tt),{encrypt(ot,it){const st=ot.length,at=st+16;it?bytes(it,at):it=new Uint8Array(at),et(o,tt,ot,it,1);const ct=computeTag(et,o,tt,it.subarray(0,-16),rt);return it.set(ct,st),clean(ct),it},decrypt(ot,it){const st=ot.length,at=st-16;if(st<16)throw new Error("encrypted data must be at least 16 bytes");it?bytes(it,at):it=new Uint8Array(at);const ct=ot.subarray(0,-16),lt=ot.subarray(-16),dt=computeTag(et,o,tt,ct,rt);if(!equalBytes(lt,dt))throw new Error("invalid tag");return et(o,tt,ct,it,1),clean(dt),it}}),chacha20poly1305=wrapCipher({blockSize:64,nonceLength:12,tagLength:16},_poly1305_aead(chacha20));function extract(et,o,tt){return hash$1(et),tt===void 0&&(tt=new Uint8Array(et.outputLen)),hmac(et,toBytes$2(tt),toBytes$2(o))}const HKDF_COUNTER=new Uint8Array([0]),EMPTY_BUFFER=new Uint8Array;function expand(et,o,tt,rt=32){if(hash$1(et),number$4(rt),rt>255*et.outputLen)throw new Error("Length should be <= 255*HashLen");const nt=Math.ceil(rt/et.outputLen);tt===void 0&&(tt=EMPTY_BUFFER);const ot=new Uint8Array(nt*et.outputLen),it=hmac.create(et,o),st=it._cloneInto(),at=new Uint8Array(it.outputLen);for(let ct=0;ctet.generateX25519SharedKey(o.privateKey,tt).subarray(0,32),encrypt:et.chaCha20Poly1305Encrypt,decrypt:et.chaCha20Poly1305Decrypt,hash:et.hashSHA256,hkdf:et.getHKDF}}const uint16BEEncode=et=>{const o=allocUnsafe$a(2);return o[0]=et>>8,o[1]=et,o};uint16BEEncode.bytes=2;const uint16BEDecode=et=>{if(et.length<2)throw RangeError("Could not decode int16BE");if(et instanceof Uint8Array){let o=0;return o+=et[0]<<8,o+=et[1],o}return et.getUint16(0)};uint16BEDecode.bytes=2;function registerMetrics(et){return{xxHandshakeSuccesses:et.registerCounter("libp2p_noise_xxhandshake_successes_total",{help:"Total count of noise xxHandshakes successes_"}),xxHandshakeErrors:et.registerCounter("libp2p_noise_xxhandshake_error_total",{help:"Total count of noise xxHandshakes errors"}),encryptedPackets:et.registerCounter("libp2p_noise_encrypted_packets_total",{help:"Total count of noise encrypted packets successfully"}),decryptedPackets:et.registerCounter("libp2p_noise_decrypted_packets_total",{help:"Total count of noise decrypted packets"}),decryptErrors:et.registerCounter("libp2p_noise_decrypt_errors_total",{help:"Total count of noise decrypt errors"})}}function coerce$f(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$m(et){return new TextEncoder().encode(et)}function toString$n(et){return new TextDecoder().decode(et)}function base$g(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$g=base$g,_brrp__multiformats_scope_baseX$f=src$g;let Encoder$g=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$g=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$h(this,o)}},ComposedDecoder$f=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$h(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$h(et,o){return new ComposedDecoder$f({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$f=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$g(o,tt,rt),this.decoder=new Decoder$g(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$g({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$f(et,o,tt,rt)}function baseX$f({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$f(tt,et);return from$g({prefix:o,name:et,encode:rt,decode:ot=>coerce$f(nt(ot))})}function decode$E(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$y(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$b=alphabet$b.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$x(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$b[tt],o),"")}function decode$D(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$b[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$m=from$g({prefix:"🚀",name:"base256emoji",encode:encode$x,decode:decode$D}),base256emoji$n=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$m},Symbol.toStringTag,{value:"Module"})),base32$q=rfc4648$e({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$b=rfc4648$e({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$b=rfc4648$e({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$b=rfc4648$e({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$b=rfc4648$e({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$b=rfc4648$e({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$b=rfc4648$e({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$b=rfc4648$e({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$b=rfc4648$e({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$r=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$q,base32hex:base32hex$b,base32hexpad:base32hexpad$b,base32hexpadupper:base32hexpadupper$b,base32hexupper:base32hexupper$b,base32pad:base32pad$b,base32padupper:base32padupper$b,base32upper:base32upper$b,base32z:base32z$b},Symbol.toStringTag,{value:"Module"})),base36$n=baseX$f({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$b=baseX$f({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$o=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$n,base36upper:base36upper$b},Symbol.toStringTag,{value:"Module"})),base58btc$f=baseX$f({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$b=baseX$f({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$b=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$f,base58flickr:base58flickr$b},Symbol.toStringTag,{value:"Module"})),base64$p=rfc4648$e({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$b=rfc4648$e({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$c=rfc4648$e({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$b=rfc4648$e({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$q=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$p,base64pad:base64pad$b,base64url:base64url$c,base64urlpad:base64urlpad$b},Symbol.toStringTag,{value:"Module"})),base8$m=rfc4648$e({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$n=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$m},Symbol.toStringTag,{value:"Module"})),identity$b=from$g({prefix:"\0",name:"identity",encode:et=>toString$n(et),decode:et=>fromString$m(et)}),identityBase$b=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$b},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$b={...identityBase$b,...base2$n,...base8$n,...base10$n,...base16$n,...base32$r,...base36$o,...base58$b,...base64$q,...base256emoji$n};function createCodec$b(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$f=createCodec$b("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$b=createCodec$b("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$a(et.length);for(let tt=0;ttnt+ot.length,0));const tt=allocUnsafe$a(o);let rt=0;for(const nt of et)tt.set(nt,rt),rt+=nt.length;return tt}function fromString$l(et,o="utf8"){const tt=BASES$b[o];if(tt==null)throw new Error(`Unsupported encoding "${o}"`);return tt.decoder.decode(`${tt.prefix}${et}`)}const ss=class ss extends Error{constructor(tt="Invalid crypto exchange"){super(tt);wt(this,"code");this.code=ss.code}};wt(ss,"code","ERR_INVALID_CRYPTO_EXCHANGE");let InvalidCryptoExchangeError=ss;const MIN_NONCE=0,MAX_NONCE=4294967295,ERR_MAX_NONCE="Cipherstate has reached maximum n, a new handshake must be performed";class Nonce{constructor(o=MIN_NONCE){wt(this,"n");wt(this,"bytes");wt(this,"view");this.n=o,this.bytes=alloc$4(12),this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.view.setUint32(4,o,!0)}increment(){this.n++,this.view.setUint32(4,this.n,!0)}getBytes(){return this.bytes}getUint64(){return this.n}assertValue(){if(this.n>MAX_NONCE)throw new Error(ERR_MAX_NONCE)}}const ZEROLEN=alloc$4(0);class CipherState{constructor(o,tt=void 0,rt=0){wt(this,"k");wt(this,"n");wt(this,"crypto");this.crypto=o,this.k=tt,this.n=new Nonce(rt)}hasKey(){return!!this.k}encryptWithAd(o,tt){if(!this.hasKey())return tt;this.n.assertValue();const rt=this.crypto.encrypt(tt,this.n.getBytes(),o,this.k);return this.n.increment(),rt}decryptWithAd(o,tt,rt){if(!this.hasKey())return tt;this.n.assertValue();const nt=this.crypto.decrypt(tt,this.n.getBytes(),o,this.k,rt);return this.n.increment(),nt}}class SymmetricState{constructor(o,tt){wt(this,"cs");wt(this,"ck");wt(this,"h");wt(this,"crypto");this.crypto=o;const rt=fromString$l(tt,"utf-8");this.h=hashProtocolName(o,rt),this.ck=this.h,this.cs=new CipherState(o)}mixKey(o){const[tt,rt]=this.crypto.hkdf(this.ck,o);this.ck=tt,this.cs=new CipherState(this.crypto,rt)}mixHash(o){this.h=this.crypto.hash(new Uint8ArrayList(this.h,o))}encryptAndHash(o){const tt=this.cs.encryptWithAd(this.h,o);return this.mixHash(tt),tt}decryptAndHash(o){const tt=this.cs.decryptWithAd(this.h,o);return this.mixHash(o),tt}split(){const[o,tt]=this.crypto.hkdf(this.ck,ZEROLEN);return[new CipherState(this.crypto,o),new CipherState(this.crypto,tt)]}}class AbstractHandshakeState{constructor(o){wt(this,"ss");wt(this,"s");wt(this,"e");wt(this,"rs");wt(this,"re");wt(this,"initiator");wt(this,"crypto");const{crypto:tt,protocolName:rt,prologue:nt,initiator:ot,s:it,e:st,rs:at,re:ct}=o;this.crypto=tt,this.ss=new SymmetricState(tt,rt),this.ss.mixHash(nt),this.initiator=ot,this.s=it,this.e=st,this.rs=at,this.re=ct}writeE(){if(this.e)throw new Error("ephemeral keypair is already set");const o=this.crypto.generateKeypair();return this.ss.mixHash(o.publicKey),this.e=o,o.publicKey}writeS(){if(!this.s)throw new Error("static keypair is not set");return this.ss.encryptAndHash(this.s.publicKey)}writeEE(){if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.re))}writeES(){if(this.initiator){if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.rs)throw new Error("remote static public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.rs))}else{if(!this.s)throw new Error("static keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.s,this.re))}}writeSE(){if(this.initiator){if(!this.s)throw new Error("static keypair is not set");if(!this.re)throw new Error("remote ephemeral public key is not set");this.ss.mixKey(this.crypto.dh(this.s,this.re))}else{if(!this.e)throw new Error("ephemeral keypair is not set");if(!this.rs)throw new Error("remote static public key is not set");this.ss.mixKey(this.crypto.dh(this.e,this.rs))}}readE(o,tt=0){if(this.re)throw new Error("remote ephemeral public key is already set");if(o.byteLength(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.webtransportCerthashes!=null)for(const ot of tt.webtransportCerthashes)rt.uint32(10),rt.bytes(ot);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt)=>{const nt={webtransportCerthashes:[]},ot=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{nt.webtransportCerthashes.push(tt.bytes());break}default:{tt.skipType(it&7);break}}}return nt})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=tt=>decodeMessage(tt,et.codec())})(NoiseExtensions||(NoiseExtensions={}));var NoiseHandshakePayload;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.identityKey!=null&&tt.identityKey.byteLength>0&&(rt.uint32(10),rt.bytes(tt.identityKey)),tt.identitySig!=null&&tt.identitySig.byteLength>0&&(rt.uint32(18),rt.bytes(tt.identitySig)),tt.extensions!=null&&(rt.uint32(34),NoiseExtensions.codec().encode(tt.extensions,rt)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt)=>{const nt={identityKey:alloc$4(0),identitySig:alloc$4(0)},ot=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{nt.identityKey=tt.bytes();break}case 2:{nt.identitySig=tt.bytes();break}case 4:{nt.extensions=NoiseExtensions.codec().decode(tt,tt.uint32());break}default:{tt.skipType(it&7);break}}}return nt})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=tt=>decodeMessage(tt,et.codec())})(NoiseHandshakePayload||(NoiseHandshakePayload={}));async function createHandshakePayload(et,o,tt){const rt=await et.sign(getSignaturePayload(o));return NoiseHandshakePayload.encode({identityKey:publicKeyToProtobuf(et.publicKey),identitySig:rt,extensions:tt})}async function decodeHandshakePayload(et,o,tt){try{const rt=NoiseHandshakePayload.decode(et),nt=publicKeyFromProtobuf(rt.identityKey);if((tt==null?void 0:tt.equals(nt))===!1)throw new Error(`Payload identity key ${nt} does not match expected remote identity key ${tt}`);if(!o)throw new Error("Remote static does not exist");const ot=getSignaturePayload(o);if(!await nt.verify(ot,rt.identitySig))throw new Error("Invalid payload signature");return rt}catch(rt){throw new UnexpectedPeerError(rt.message)}}function getSignaturePayload(et){const o=fromString$l("noise-libp2p-static-key:");return et instanceof Uint8Array?concat$1([o,et],o.length+et.length):(et.prepend(o),et)}async function performHandshakeInitiator(et,o){const{log:tt,connection:rt,crypto:nt,privateKey:ot,prologue:it,s:st,remoteIdentityKey:at,extensions:ct}=et,lt=await createHandshakePayload(ot,st.publicKey,ct),dt=new XXHandshakeState({crypto:nt,protocolName:"Noise_XX_25519_ChaChaPoly_SHA256",initiator:!0,prologue:it,s:st});logLocalStaticKeys(dt.s,tt),tt.trace("Stage 0 - Initiator starting to send first message."),await rt.write(dt.writeMessageA(ZEROLEN),o),tt.trace("Stage 0 - Initiator finished sending first message."),logLocalEphemeralKeys(dt.e,tt),tt.trace("Stage 1 - Initiator waiting to receive first message from responder...");const ht=dt.readMessageB(await rt.read(o));tt.trace("Stage 1 - Initiator received the message."),logRemoteEphemeralKey(dt.re,tt),logRemoteStaticKey(dt.rs,tt),tt.trace("Initiator going to check remote's signature...");const mt=await decodeHandshakePayload(ht,dt.rs,at);tt.trace("All good with the signature!"),tt.trace("Stage 2 - Initiator sending third handshake message."),await rt.write(dt.writeMessageC(lt),o),tt.trace("Stage 2 - Initiator sent message with signed payload.");const[ft,pt]=dt.ss.split();return logCipherState(ft,pt,tt),{payload:mt,encrypt:yt=>ft.encryptWithAd(ZEROLEN,yt),decrypt:(yt,gt)=>pt.decryptWithAd(ZEROLEN,yt,gt)}}async function performHandshakeResponder(et,o){const{log:tt,connection:rt,crypto:nt,privateKey:ot,prologue:it,s:st,remoteIdentityKey:at,extensions:ct}=et,lt=await createHandshakePayload(ot,st.publicKey,ct),dt=new XXHandshakeState({crypto:nt,protocolName:"Noise_XX_25519_ChaChaPoly_SHA256",initiator:!1,prologue:it,s:st});logLocalStaticKeys(dt.s,tt),tt.trace("Stage 0 - Responder waiting to receive first message."),dt.readMessageA(await rt.read(o)),tt.trace("Stage 0 - Responder received first message."),logRemoteEphemeralKey(dt.re,tt),tt.trace("Stage 1 - Responder sending out first message with signed payload and static key."),await rt.write(dt.writeMessageB(lt),o),tt.trace("Stage 1 - Responder sent the second handshake message with signed payload."),logLocalEphemeralKeys(dt.e,tt),tt.trace("Stage 2 - Responder waiting for third handshake message...");const ht=dt.readMessageC(await rt.read(o));tt.trace("Stage 2 - Responder received the message, finished handshake.");const mt=await decodeHandshakePayload(ht,dt.rs,at),[ft,pt]=dt.ss.split();return logCipherState(ft,pt,tt),{payload:mt,encrypt:yt=>pt.encryptWithAd(ZEROLEN,yt),decrypt:(yt,gt)=>ft.decryptWithAd(ZEROLEN,yt,gt)}}const CHACHA_TAG_LENGTH=16;function encryptStream(et,o){return async function*(tt){for await(const rt of tt)for(let nt=0;ntrt.length&&(ot=rt.length);let it;rt instanceof Uint8Array?it=et.encrypt(rt.subarray(nt,ot)):it=et.encrypt(rt.sublist(nt,ot)),o==null||o.encryptedPackets.increment(),yield new Uint8ArrayList(uint16BEEncode(it.byteLength),it)}}}function decryptStream(et,o){return async function*(tt){for await(const rt of tt)for(let nt=0;ntrt.length&&(ot=rt.length),ot-CHACHA_TAG_LENGTHdecode$U(it,{lengthDecoder:uint16BEDecode}),decryptStream(tt,this.metrics),rt),nt}}function noise(et={}){return o=>new Noise(o,et)}const peerDiscoverySymbol$1=Symbol.for("@libp2p/peer-discovery");function setMaxListeners$7(){}const setMaxListeners$6=(et,...o)=>{try{[...o]}catch{}};var Zr,El;let TypedEventEmitter$2=(El=class extends EventTarget{constructor(){super();fr(this,Zr,new Map);setMaxListeners$6(1/0,this)}listenerCount(tt){const rt=Ot(this,Zr).get(tt);return rt==null?0:rt.length}addEventListener(tt,rt,nt){super.addEventListener(tt,rt,nt);let ot=Ot(this,Zr).get(tt);ot==null&&(ot=[],Ot(this,Zr).set(tt,ot)),ot.push({callback:rt,once:(nt!==!0&&nt!==!1&&(nt==null?void 0:nt.once))??!1})}removeEventListener(tt,rt,nt){super.removeEventListener(tt.toString(),rt??null,nt);let ot=Ot(this,Zr).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==rt),Ot(this,Zr).set(tt,ot))}dispatchEvent(tt){const rt=super.dispatchEvent(tt);let nt=Ot(this,Zr).get(tt.type);return nt==null||(nt=nt.filter(({once:ot})=>!ot),Ot(this,Zr).set(tt.type,nt)),rt}safeDispatchEvent(tt,rt={}){return this.dispatchEvent(new CustomEvent(tt,rt))}},Zr=new WeakMap,El);const serviceCapabilities$4=Symbol.for("@libp2p/service-capabilities"),DNS4=base$f("dns4"),DNS6=base$f("dns6"),DNSADDR=base$f("dnsaddr"),DNS$1=or$g(base$f("dns"),DNSADDR,DNS4,DNS6),IP=or$g(base$f("ip4"),base$f("ip6")),TCP$1=or$g(and$1(IP,base$f("tcp")),and$1(DNS$1,base$f("tcp"))),UDP=and$1(IP,base$f("udp")),UTP=and$1(UDP,base$f("utp")),QUIC=and$1(UDP,base$f("quic")),QUICV1=and$1(UDP,base$f("quic-v1")),_WebSockets$1=or$g(and$1(TCP$1,base$f("ws")),and$1(DNS$1,base$f("ws"))),WebSockets$2=or$g(and$1(_WebSockets$1,base$f("p2p")),_WebSockets$1),_WebSocketsSecure$1=or$g(and$1(TCP$1,base$f("wss")),and$1(DNS$1,base$f("wss")),and$1(TCP$1,base$f("tls"),base$f("ws")),and$1(DNS$1,base$f("tls"),base$f("ws"))),WebSocketsSecure$1=or$g(and$1(_WebSocketsSecure$1,base$f("p2p")),_WebSocketsSecure$1),HTTP=or$g(and$1(TCP$1,base$f("http")),and$1(IP,base$f("http")),and$1(DNS$1,base$f("http"))),HTTPS=or$g(and$1(TCP$1,base$f("https")),and$1(IP,base$f("https")),and$1(DNS$1,base$f("https"))),_WebRTCDirect$1=and$1(UDP,base$f("webrtc-direct"),base$f("certhash")),WebRTCDirect$1=or$g(and$1(_WebRTCDirect$1,base$f("p2p")),_WebRTCDirect$1),_WebTransport$1=and$1(QUICV1,base$f("webtransport"),base$f("certhash"),base$f("certhash")),WebTransport$1=or$g(and$1(_WebTransport$1,base$f("p2p")),_WebTransport$1),P2PWebRTCStar=or$g(and$1(WebSockets$2,base$f("p2p-webrtc-star"),base$f("p2p")),and$1(WebSocketsSecure$1,base$f("p2p-webrtc-star"),base$f("p2p")),and$1(WebSockets$2,base$f("p2p-webrtc-star")),and$1(WebSocketsSecure$1,base$f("p2p-webrtc-star"))),P2PWebRTCDirect=or$g(and$1(HTTP,base$f("p2p-webrtc-direct"),base$f("p2p")),and$1(HTTPS,base$f("p2p-webrtc-direct"),base$f("p2p")),and$1(HTTP,base$f("p2p-webrtc-direct")),and$1(HTTPS,base$f("p2p-webrtc-direct"))),Reliable=or$g(_WebSockets$1,_WebSocketsSecure$1,HTTP,HTTPS,P2PWebRTCStar,P2PWebRTCDirect,TCP$1,UTP,QUIC,DNS$1,WebRTCDirect$1,WebTransport$1),_P2P$1=or$g(and$1(Reliable,base$f("p2p")),P2PWebRTCStar,P2PWebRTCDirect,WebRTCDirect$1,WebTransport$1,base$f("p2p")),_Circuit$1=or$g(and$1(_P2P$1,base$f("p2p-circuit"),_P2P$1),and$1(_P2P$1,base$f("p2p-circuit")),and$1(base$f("p2p-circuit"),_P2P$1),and$1(Reliable,base$f("p2p-circuit")),and$1(base$f("p2p-circuit"),Reliable),base$f("p2p-circuit")),CircuitRecursive=()=>or$g(and$1(_Circuit$1,CircuitRecursive),_Circuit$1),Circuit$1=CircuitRecursive(),P2P=or$g(and$1(Circuit$1,_P2P$1,Circuit$1),and$1(_P2P$1,Circuit$1),and$1(Circuit$1,_P2P$1),Circuit$1,_P2P$1);function makeMatchesFunction(et){function o(tt){let rt;try{rt=multiaddr(tt)}catch{return!1}const nt=et(rt.protoNames());return nt===null?!1:nt===!0||nt===!1?nt:nt.length===0}return o}function and$1(...et){function o(tt){if(tt.length(rt=typeof nt=="function"?nt().partialMatch(tt):nt.partialMatch(tt),Array.isArray(rt)&&(tt=rt),rt===null)),rt}return{toString:function(){return"{ "+et.join(" ")+" }"},input:et,matches:makeMatchesFunction(o),partialMatch:o}}function or$g(...et){function o(rt){let nt=null;return et.some(ot=>{const it=typeof ot=="function"?ot().partialMatch(rt):ot.partialMatch(rt);return it!=null?(nt=it,!0):!1}),nt}return{toString:function(){return"{ "+et.join(" ")+" }"},input:et,matches:makeMatchesFunction(o),partialMatch:o}}function base$f(et){const o=et;function tt(nt){let ot;try{ot=multiaddr(nt)}catch{return!1}const it=ot.protoNames();return it.length===1&&it[0]===o}function rt(nt){return nt.length===0?null:nt[0]===o?nt.slice(1):null}return{toString:function(){return o},matches:tt,partialMatch:rt}}const DEFAULT_BOOTSTRAP_TAG_NAME$1="bootstrap",DEFAULT_BOOTSTRAP_TAG_VALUE$1=50,DEFAULT_BOOTSTRAP_DISCOVERY_TIMEOUT=1e3;var Cl,Sl,Al,$l;class Bootstrap extends($l=TypedEventEmitter$2,Al=peerDiscoverySymbol$1,Sl=Symbol.toStringTag,Cl=serviceCapabilities$4,$l){constructor(tt,rt={list:[]}){if(rt.list==null||rt.list.length===0)throw new Error("Bootstrap requires a list of peer addresses");super();wt(this,"log");wt(this,"timer");wt(this,"list");wt(this,"timeout");wt(this,"components");wt(this,"_init");wt(this,Al,this);wt(this,Sl,"@libp2p/bootstrap");wt(this,Cl,["@libp2p/peer-discovery"]);this.components=tt,this.log=tt.logger.forComponent("libp2p:bootstrap"),this.timeout=rt.timeout??DEFAULT_BOOTSTRAP_DISCOVERY_TIMEOUT,this.list=[];for(const nt of rt.list){if(!P2P.matches(nt)){this.log.error("Invalid multiaddr");continue}const ot=multiaddr(nt),it=ot.getPeerId();if(it==null){this.log.error("Invalid bootstrap multiaddr without peer id");continue}const st={id:peerIdFromString$1(it),multiaddrs:[ot]};this.list.push(st)}this._init=rt}isStarted(){return!!this.timer}start(){this.isStarted()||(this.log("Starting bootstrap node discovery, discovering peers after %s ms",this.timeout),this.timer=setTimeout(()=>{this._discoverBootstrapPeers().catch(tt=>{this.log.error(tt)})},this.timeout))}async _discoverBootstrapPeers(){if(this.timer!=null)for(const tt of this.list){if(await this.components.peerStore.merge(tt.id,{tags:{[this._init.tagName??DEFAULT_BOOTSTRAP_TAG_NAME$1]:{value:this._init.tagValue??DEFAULT_BOOTSTRAP_TAG_VALUE$1,ttl:this._init.tagTTL}},multiaddrs:tt.multiaddrs}),this.timer==null)return;this.safeDispatchEvent("peer",{detail:tt}),this.components.connectionManager.openConnection(tt.id).catch(rt=>{this.log.error("could not dial bootstrap peer %p",tt.id,rt)})}}stop(){this.timer!=null&&clearTimeout(this.timer),this.timer=void 0}}wt(Bootstrap,"tag","bootstrap");function bootstrap(et){return o=>new Bootstrap(o,et)}var bs;let UnsupportedProtocolError$1=(bs=class extends Error{constructor(o="Unsupported protocol error"){super(o),this.name="UnsupportedProtocolError"}},wt(bs,"name","UnsupportedProtocolError"),bs);var ys;let InvalidMessageError$2=(ys=class extends Error{constructor(o="Invalid message"){super(o),this.name="InvalidMessageError"}},wt(ys,"name","InvalidMessageError"),ys);function setMaxListeners$5(){}const setMaxListeners$4=(et,...o)=>{try{[...o]}catch{}},serviceCapabilities$3=Symbol.for("@libp2p/service-capabilities");function equals$5(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$f=base$e,_brrp__multiformats_scope_baseX$e=src$f;let Encoder$f=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$f=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$f(this,o)}},ComposedDecoder$e=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$f(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$f(et,o){return new ComposedDecoder$e({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$e=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$f(o,tt,rt),this.decoder=new Decoder$f(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$f({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$e(et,o,tt,rt)}function baseX$e({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$e(tt,et);return from$f({prefix:o,name:et,encode:rt,decode:ot=>coerce$e(nt(ot))})}function decode$C(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$w(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$a=alphabet$a.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$v(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$a[tt],o),"")}function decode$B(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$a[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$k=from$f({prefix:"🚀",name:"base256emoji",encode:encode$v,decode:decode$B}),base256emoji$l=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$k},Symbol.toStringTag,{value:"Module"})),base32$o=rfc4648$d({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$a=rfc4648$d({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$a=rfc4648$d({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$a=rfc4648$d({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$a=rfc4648$d({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$a=rfc4648$d({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$a=rfc4648$d({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$a=rfc4648$d({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$a=rfc4648$d({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$p=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$o,base32hex:base32hex$a,base32hexpad:base32hexpad$a,base32hexpadupper:base32hexpadupper$a,base32hexupper:base32hexupper$a,base32pad:base32pad$a,base32padupper:base32padupper$a,base32upper:base32upper$a,base32z:base32z$a},Symbol.toStringTag,{value:"Module"})),base36$l=baseX$e({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$a=baseX$e({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$m=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$l,base36upper:base36upper$a},Symbol.toStringTag,{value:"Module"})),base58btc$e=baseX$e({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$a=baseX$e({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$a=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$e,base58flickr:base58flickr$a},Symbol.toStringTag,{value:"Module"})),base64$n=rfc4648$d({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$a=rfc4648$d({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$b=rfc4648$d({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$a=rfc4648$d({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$o=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$n,base64pad:base64pad$a,base64url:base64url$b,base64urlpad:base64urlpad$a},Symbol.toStringTag,{value:"Module"})),base8$k=rfc4648$d({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$l=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$k},Symbol.toStringTag,{value:"Module"})),identity$a=from$f({prefix:"\0",name:"identity",encode:et=>toString$l(et),decode:et=>fromString$k(et)}),identityBase$a=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$a},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;var encode_1$2=encode$u,MSB$4=128,REST$4=127,MSBALL$2=~REST$4,INT$2=Math.pow(2,31);function encode$u(et,o,tt){o=o||[],tt=tt||0;for(var rt=tt;et>=INT$2;)o[tt++]=et&255|MSB$4,et/=128;for(;et&MSBALL$2;)o[tt++]=et&255|MSB$4,et>>>=7;return o[tt]=et|0,encode$u.bytes=tt-rt+1,o}var decode$A=read$3,MSB$1$2=128,REST$1$2=127;function read$3(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$3.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1$2)<=MSB$1$2);return read$3.bytes=ot-rt,tt}var N1$2=Math.pow(2,7),N2$2=Math.pow(2,14),N3$2=Math.pow(2,21),N4$2=Math.pow(2,28),N5$2=Math.pow(2,35),N6$2=Math.pow(2,42),N7$2=Math.pow(2,49),N8$2=Math.pow(2,56),N9$2=Math.pow(2,63),length$2=function(et){return et"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$a=createCodec$a("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$9(et.length);for(let tt=0;tt(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.publicKey!=null&&tt.publicKey.byteLength>0&&(rt.uint32(10),rt.bytes(tt.publicKey)),tt.payloadType!=null&&tt.payloadType.byteLength>0&&(rt.uint32(18),rt.bytes(tt.payloadType)),tt.payload!=null&&tt.payload.byteLength>0&&(rt.uint32(26),rt.bytes(tt.payload)),tt.signature!=null&&tt.signature.byteLength>0&&(rt.uint32(42),rt.bytes(tt.signature)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={publicKey:alloc$3(0),payloadType:alloc$3(0),payload:alloc$3(0),signature:alloc$3(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.publicKey=tt.bytes();break}case 2:{ot.payloadType=tt.bytes();break}case 3:{ot.payload=tt.bytes();break}case 5:{ot.signature=tt.bytes();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(Envelope||(Envelope={}));class InvalidSignatureError extends Error{constructor(o="Invalid signature"){super(o),this.name="InvalidSignatureError"}}const dn=class dn{constructor(o){wt(this,"publicKey");wt(this,"payloadType");wt(this,"payload");wt(this,"signature");wt(this,"marshaled");const{publicKey:tt,payloadType:rt,payload:nt,signature:ot}=o;this.publicKey=tt,this.payloadType=rt,this.payload=nt,this.signature=ot}marshal(){return this.marshaled==null&&(this.marshaled=Envelope.encode({publicKey:publicKeyToProtobuf(this.publicKey),payloadType:this.payloadType,payload:this.payload.subarray(),signature:this.signature})),this.marshaled}equals(o){return equals$5(this.marshal(),o.marshal())}async validate(o){const tt=formatSignaturePayload(o,this.payloadType,this.payload);return this.publicKey.verify(tt.subarray(),this.signature)}};wt(dn,"createFromProtobuf",async o=>{const tt=Envelope.decode(o),rt=publicKeyFromProtobuf(tt.publicKey);return new dn({publicKey:rt,payloadType:tt.payloadType,payload:tt.payload,signature:tt.signature})}),wt(dn,"seal",async(o,tt)=>{if(tt==null)throw new Error("Missing private key");const rt=o.domain,nt=o.codec,ot=o.marshal(),it=formatSignaturePayload(rt,nt,ot),st=await tt.sign(it.subarray());return new dn({publicKey:tt.publicKey,payloadType:nt,payload:ot,signature:st})}),wt(dn,"openAndCertify",async(o,tt)=>{const rt=await dn.createFromProtobuf(o);if(!await rt.validate(tt))throw new InvalidSignatureError("Envelope signature is not valid for the given domain");return rt});let RecordEnvelope=dn;const formatSignaturePayload=(et,o,tt)=>{const rt=fromString$j(et),nt=encode$P(rt.byteLength),ot=encode$P(o.length),it=encode$P(tt.length);return new Uint8ArrayList(nt,rt,ot,o,it,tt)};function arrayEquals(et,o){const tt=(rt,nt)=>rt.toString().localeCompare(nt.toString());return et.length!==o.length?!1:(o.sort(tt),et.sort(tt).every((rt,nt)=>o[nt].equals(rt)))}const ENVELOPE_DOMAIN_PEER_RECORD="libp2p-peer-record",ENVELOPE_PAYLOAD_TYPE_PEER_RECORD=Uint8Array.from([3,1]);var PeerRecord$1;(function(et){(function(tt){let rt;tt.codec=()=>(rt==null&&(rt=message$1((nt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),nt.multiaddr!=null&&nt.multiaddr.byteLength>0&&(ot.uint32(10),ot.bytes(nt.multiaddr)),it.lengthDelimited!==!1&&ot.ldelim()},(nt,ot,it={})=>{const st={multiaddr:alloc$3(0)},at=ot==null?nt.len:nt.pos+ot;for(;nt.pos>>3){case 1:{st.multiaddr=nt.bytes();break}default:{nt.skipType(ct&7);break}}}return st})),rt),tt.encode=nt=>encodeMessage(nt,tt.codec()),tt.decode=(nt,ot)=>decodeMessage(nt,tt.codec(),ot)})(et.AddressInfo||(et.AddressInfo={}));let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.peerId!=null&&tt.peerId.byteLength>0&&(rt.uint32(10),rt.bytes(tt.peerId)),tt.seq!=null&&tt.seq!==0n&&(rt.uint32(16),rt.uint64(tt.seq)),tt.addresses!=null)for(const ot of tt.addresses)rt.uint32(26),et.AddressInfo.codec().encode(ot,rt);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={peerId:alloc$3(0),seq:0n,addresses:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.peerId=tt.bytes();break}case 2:{ot.seq=tt.uint64();break}case 3:{if(((st=nt.limits)==null?void 0:st.addresses)!=null&&ot.addresses.length===nt.limits.addresses)throw new MaxLengthError('Decode error - map field "addresses" had too many elements');ot.addresses.push(et.AddressInfo.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.addresses$}));break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(PeerRecord$1||(PeerRecord$1={}));const on=class on{constructor(o){wt(this,"peerId");wt(this,"multiaddrs");wt(this,"seqNumber");wt(this,"domain",on.DOMAIN);wt(this,"codec",on.CODEC);wt(this,"marshaled");const{peerId:tt,multiaddrs:rt,seqNumber:nt}=o;this.peerId=tt,this.multiaddrs=rt??[],this.seqNumber=nt??BigInt(Date.now())}marshal(){return this.marshaled==null&&(this.marshaled=PeerRecord$1.encode({peerId:this.peerId.toMultihash().bytes,seq:BigInt(this.seqNumber),addresses:this.multiaddrs.map(o=>({multiaddr:o.bytes}))})),this.marshaled}equals(o){return!(!(o instanceof on)||!this.peerId.equals(o.peerId)||this.seqNumber!==o.seqNumber||!arrayEquals(this.multiaddrs,o.multiaddrs))}};wt(on,"createFromProtobuf",o=>{const tt=PeerRecord$1.decode(o),rt=peerIdFromMultihash(decode$y(tt.peerId)),nt=(tt.addresses??[]).map(it=>multiaddr(it.multiaddr)),ot=tt.seq;return new on({peerId:rt,multiaddrs:nt,seqNumber:ot})}),wt(on,"DOMAIN",ENVELOPE_DOMAIN_PEER_RECORD),wt(on,"CODEC",ENVELOPE_PAYLOAD_TYPE_PEER_RECORD);let PeerRecord=on;function isAsyncIterable$4(et){return et[Symbol.asyncIterator]!=null}function drain(et){if(isAsyncIterable$4(et))return(async()=>{for await(const o of et);})();for(const o of et);}const CustomEvent$1=globalThis.CustomEvent??Event;async function*parallel(et,o={}){let tt=o.concurrency??1/0;tt<1&&(tt=1/0);const rt=o.ordered==null?!1:o.ordered,nt=new EventTarget,ot=[];let it=pDefer(),st=pDefer(),at=!1,ct,lt=!1;nt.addEventListener("task-complete",()=>{st.resolve()}),Promise.resolve().then(async()=>{try{for await(const ft of et){if(ot.length===tt&&(it=pDefer(),await it.promise),lt)break;const pt={done:!1};ot.push(pt),ft().then(yt=>{pt.done=!0,pt.ok=!0,pt.value=yt,nt.dispatchEvent(new CustomEvent$1("task-complete"))},yt=>{pt.done=!0,pt.err=yt,nt.dispatchEvent(new CustomEvent$1("task-complete"))})}at=!0,nt.dispatchEvent(new CustomEvent$1("task-complete"))}catch(ft){ct=ft,nt.dispatchEvent(new CustomEvent$1("task-complete"))}});function dt(){var ft;return rt?(ft=ot[0])==null?void 0:ft.done:!!ot.find(pt=>pt.done)}function*ht(){for(;ot.length>0&&ot[0].done;){const ft=ot[0];if(ot.shift(),ft.ok)yield ft.value;else throw lt=!0,it.resolve(),ft.err;it.resolve()}}function*mt(){for(;dt();)for(let ft=0;ft{const it=await tt.read(ot);return nt.decode(it)},write:async(nt,ot,it)=>{await tt.write(ot.encode(nt),it)},writeV:async(nt,ot,it)=>{await tt.writeV(nt.map(st=>ot.encode(st)),it)},pb:nt=>({read:async ot=>rt.read(nt,ot),write:async(ot,it)=>rt.write(ot,nt,it),writeV:async(ot,it)=>rt.writeV(ot,nt,it),unwrap:()=>rt}),unwrap:()=>tt.unwrap()};return rt}function coerce$d(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$i(et){return new TextEncoder().encode(et)}function toString$k(et){return new TextDecoder().decode(et)}function base$d(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$e=base$d,_brrp__multiformats_scope_baseX$d=src$e;let Encoder$e=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$e=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$e(this,o)}},ComposedDecoder$d=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$e(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$e(et,o){return new ComposedDecoder$d({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$d=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$e(o,tt,rt),this.decoder=new Decoder$e(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$e({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$d(et,o,tt,rt)}function baseX$d({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$d(tt,et);return from$e({prefix:o,name:et,encode:rt,decode:ot=>coerce$d(nt(ot))})}function decode$x(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$t(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$9=alphabet$9.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$s(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$9[tt],o),"")}function decode$w(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$9[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$i=from$e({prefix:"🚀",name:"base256emoji",encode:encode$s,decode:decode$w}),base256emoji$j=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$i},Symbol.toStringTag,{value:"Module"})),base32$m=rfc4648$c({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$9=rfc4648$c({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$9=rfc4648$c({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$9=rfc4648$c({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$9=rfc4648$c({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$9=rfc4648$c({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$9=rfc4648$c({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$9=rfc4648$c({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$9=rfc4648$c({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$n=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$m,base32hex:base32hex$9,base32hexpad:base32hexpad$9,base32hexpadupper:base32hexpadupper$9,base32hexupper:base32hexupper$9,base32pad:base32pad$9,base32padupper:base32padupper$9,base32upper:base32upper$9,base32z:base32z$9},Symbol.toStringTag,{value:"Module"})),base36$j=baseX$d({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$9=baseX$d({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$k=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$j,base36upper:base36upper$9},Symbol.toStringTag,{value:"Module"})),base58btc$d=baseX$d({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$9=baseX$d({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$9=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$d,base58flickr:base58flickr$9},Symbol.toStringTag,{value:"Module"})),base64$l=rfc4648$c({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$9=rfc4648$c({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$a=rfc4648$c({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$9=rfc4648$c({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$m=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$l,base64pad:base64pad$9,base64url:base64url$a,base64urlpad:base64urlpad$9},Symbol.toStringTag,{value:"Module"})),base8$i=rfc4648$c({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$j=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$i},Symbol.toStringTag,{value:"Module"})),identity$9=from$e({prefix:"\0",name:"identity",encode:et=>toString$k(et),decode:et=>fromString$i(et)}),identityBase$9=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$9},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$9={...identityBase$9,...base2$j,...base8$j,...base10$j,...base16$j,...base32$n,...base36$k,...base58$9,...base64$m,...base256emoji$j};function allocUnsafe$8(et=0){return new Uint8Array(et)}function createCodec$9(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$d=createCodec$9("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$9=createCodec$9("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$8(et.length);for(let tt=0;tt(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.protocolVersion!=null&&(rt.uint32(42),rt.string(tt.protocolVersion)),tt.agentVersion!=null&&(rt.uint32(50),rt.string(tt.agentVersion)),tt.publicKey!=null&&(rt.uint32(10),rt.bytes(tt.publicKey)),tt.listenAddrs!=null)for(const ot of tt.listenAddrs)rt.uint32(18),rt.bytes(ot);if(tt.observedAddr!=null&&(rt.uint32(34),rt.bytes(tt.observedAddr)),tt.protocols!=null)for(const ot of tt.protocols)rt.uint32(26),rt.string(ot);tt.signedPeerRecord!=null&&(rt.uint32(66),rt.bytes(tt.signedPeerRecord)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at;const ot={listenAddrs:[],protocols:[]},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 5:{ot.protocolVersion=tt.string();break}case 6:{ot.agentVersion=tt.string();break}case 1:{ot.publicKey=tt.bytes();break}case 2:{if(((st=nt.limits)==null?void 0:st.listenAddrs)!=null&&ot.listenAddrs.length===nt.limits.listenAddrs)throw new MaxLengthError('Decode error - map field "listenAddrs" had too many elements');ot.listenAddrs.push(tt.bytes());break}case 4:{ot.observedAddr=tt.bytes();break}case 3:{if(((at=nt.limits)==null?void 0:at.protocols)!=null&&ot.protocols.length===nt.limits.protocols)throw new MaxLengthError('Decode error - map field "protocols" had too many elements');ot.protocols.push(tt.string());break}case 8:{ot.signedPeerRecord=tt.bytes();break}default:{tt.skipType(ct&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(Identify$1||(Identify$1={}));var define_process_default={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};function isElectron$1(){return!!(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof define_process_default<"u"&&typeof define_process_default.versions=="object"&&define_process_default.versions.electron||typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent.indexOf("Electron")>=0)}var isElectron_1=isElectron$1;const detectElectron=getDefaultExportFromCjs(isElectron_1),isEnvWithDom=typeof window=="object"&&typeof document=="object"&&document.nodeType===9,isElectron=detectElectron(),isBrowser=isEnvWithDom&&!isElectron,isElectronMain=isElectron&&!isEnvWithDom,isElectronRenderer=isElectron&&isEnvWithDom,isNode=typeof globalThis.process<"u"&&typeof globalThis.process.release<"u"&&globalThis.process.release.name==="node"&&!isElectron,isWebWorker=typeof importScripts=="function"&&typeof self<"u"&&typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative",defaultValues={protocolPrefix:"ipfs",timeout:5e3,maxInboundStreams:1,maxOutboundStreams:1,maxObservedAddresses:10,maxMessageSize:MAX_IDENTIFY_MESSAGE_SIZE,runOnConnectionOpen:!0,runOnSelfUpdate:!0,runOnLimitedConnection:!0,concurrency:MAX_PUSH_CONCURRENCY};function getCleanMultiaddr(et){if(et!=null&&et.length>0)try{return multiaddr(et)}catch{}}function getAgentVersion(et,o){return o!=null||(o=`${et.name}/${et.version}`,isNode||isElectronMain?o+=` UserAgent=${globalThis.process.version}`:(isBrowser||isWebWorker||isElectronRenderer||isReactNative)&&(o+=` UserAgent=${globalThis.navigator.userAgent}`)),o}async function consumeIdentifyMessage(et,o,tt,rt,nt){if(tt("received identify from %p",rt.remotePeer),nt==null)throw new InvalidMessageError$2("message was null or undefined");const ot={};if(nt.listenAddrs.length>0&&(ot.addresses=nt.listenAddrs.map(at=>({isCertified:!1,multiaddr:multiaddr(at)}))),nt.protocols.length>0&&(ot.protocols=nt.protocols),nt.publicKey!=null){const at=publicKeyFromProtobuf(nt.publicKey);if(!peerIdFromPublicKey(at).equals(rt.remotePeer))throw new InvalidMessageError$2("public key did not match remote PeerId");ot.publicKey=at}let it;if(nt.signedPeerRecord!=null){tt.trace("received signedPeerRecord from %p",rt.remotePeer);let at=nt.signedPeerRecord;const ct=await RecordEnvelope.openAndCertify(at,PeerRecord.DOMAIN);let lt=PeerRecord.createFromProtobuf(ct.payload);const dt=peerIdFromCID(ct.publicKey.toCID());if(!lt.peerId.equals(dt))throw new InvalidMessageError$2("signing key does not match PeerId in the PeerRecord");if(!rt.remotePeer.equals(lt.peerId))throw new InvalidMessageError$2("signing key does not match remote PeerId");let ht;try{ht=await et.get(lt.peerId)}catch(mt){if(mt.name!=="NotFoundError")throw mt}if(ht!=null&&(ot.metadata=ht.metadata,ht.peerRecordEnvelope!=null)){const mt=await RecordEnvelope.createFromProtobuf(ht.peerRecordEnvelope),ft=PeerRecord.createFromProtobuf(mt.payload);ft.seqNumber>=lt.seqNumber&&(tt("sequence number was lower or equal to existing sequence number - stored: %d received: %d",ft.seqNumber,lt.seqNumber),lt=ft,at=ht.peerRecordEnvelope)}ot.peerRecordEnvelope=at,ot.addresses=lt.multiaddrs.map(mt=>({isCertified:!0,multiaddr:mt})),it={seq:lt.seqNumber,addresses:lt.multiaddrs}}else tt("%p did not send a signed peer record",rt.remotePeer);if(tt.trace("patching %p with",rt.remotePeer,ot),await et.patch(rt.remotePeer,ot),nt.agentVersion!=null||nt.protocolVersion!=null){const at={};nt.agentVersion!=null&&(at.AgentVersion=fromString$h(nt.agentVersion)),nt.protocolVersion!=null&&(at.ProtocolVersion=fromString$h(nt.protocolVersion)),tt.trace("merging %p metadata",rt.remotePeer,at),await et.merge(rt.remotePeer,{metadata:at})}const st={peerId:rt.remotePeer,protocolVersion:nt.protocolVersion,agentVersion:nt.agentVersion,publicKey:nt.publicKey,listenAddrs:nt.listenAddrs.map(at=>multiaddr(at)),observedAddr:nt.observedAddr==null?void 0:multiaddr(nt.observedAddr),protocols:nt.protocols,signedPeerRecord:it,connection:rt};return o.safeDispatchEvent("peer:identify",{detail:st}),st}class AbstractIdentify{constructor(o,tt){wt(this,"host");wt(this,"protocol");wt(this,"started");wt(this,"timeout");wt(this,"peerId");wt(this,"privateKey");wt(this,"peerStore");wt(this,"registrar");wt(this,"addressManager");wt(this,"maxInboundStreams");wt(this,"maxOutboundStreams");wt(this,"maxMessageSize");wt(this,"maxObservedAddresses");wt(this,"events");wt(this,"runOnLimitedConnection");wt(this,"log");this.protocol=tt.protocol,this.started=!1,this.peerId=o.peerId,this.privateKey=o.privateKey,this.peerStore=o.peerStore,this.registrar=o.registrar,this.addressManager=o.addressManager,this.events=o.events,this.log=tt.log,this.timeout=tt.timeout??defaultValues.timeout,this.maxInboundStreams=tt.maxInboundStreams??defaultValues.maxInboundStreams,this.maxOutboundStreams=tt.maxOutboundStreams??defaultValues.maxOutboundStreams,this.maxMessageSize=tt.maxMessageSize??defaultValues.maxMessageSize,this.maxObservedAddresses=tt.maxObservedAddresses??defaultValues.maxObservedAddresses,this.runOnLimitedConnection=tt.runOnLimitedConnection??defaultValues.runOnLimitedConnection,this.host={protocolVersion:`${tt.protocolPrefix??defaultValues.protocolPrefix}/${IDENTIFY_PROTOCOL_VERSION}`,agentVersion:getAgentVersion(o.nodeInfo,tt.agentVersion)}}isStarted(){return this.started}async start(){this.started||(await this.peerStore.merge(this.peerId,{metadata:{AgentVersion:fromString$h(this.host.agentVersion),ProtocolVersion:fromString$h(this.host.protocolVersion)}}),await this.registrar.handle(this.protocol,o=>{this.handleProtocol(o).catch(tt=>{this.log.error(tt)})},{maxInboundStreams:this.maxInboundStreams,maxOutboundStreams:this.maxOutboundStreams,runOnLimitedConnection:this.runOnLimitedConnection}),this.started=!0)}async stop(){await this.registrar.unhandle(this.protocol),this.started=!1}}var Netmask_1;(function(){var et,o,tt,rt,nt,ot,it,st;st=function(at){var ct,lt,dt,ht;return ct=(at&255<<24)>>>24,lt=(at&255<<16)>>>16,dt=(at&65280)>>>8,ht=at&255,[ct,lt,dt,ht].join(".")},it=function(at){var ct,lt,dt,ht,mt,ft;for(ct=[],dt=ht=0;ht<=3&&at.length!==0;dt=++ht){if(dt>0){if(at[0]!==".")throw new Error("Invalid IP");at=at.substring(1)}ft=o(at),mt=ft[0],lt=ft[1],at=at.substring(lt),ct.push(mt)}if(at.length!==0)throw new Error("Invalid IP");switch(ct.length){case 1:if(ct[0]>4294967295)throw new Error("Invalid IP");return ct[0]>>>0;case 2:if(ct[0]>255||ct[1]>16777215)throw new Error("Invalid IP");return(ct[0]<<24|ct[1])>>>0;case 3:if(ct[0]>255||ct[1]>255||ct[2]>65535)throw new Error("Invalid IP");return(ct[0]<<24|ct[1]<<16|ct[2])>>>0;case 4:if(ct[0]>255||ct[1]>255||ct[2]>255||ct[3]>255)throw new Error("Invalid IP");return(ct[0]<<24|ct[1]<<16|ct[2]<<8|ct[3])>>>0;default:throw new Error("Invalid IP")}},tt=function(at){return at.charCodeAt(0)},rt=tt("0"),ot=tt("a"),nt=tt("A"),o=function(at){var ct,lt,dt,ht,mt;for(ht=0,ct=10,lt="9",dt=0,at.length>1&&at[dt]==="0"&&(at[dt+1]==="x"||at[dt+1]==="X"?(dt+=2,ct=16):"0"<=at[dt+1]&&at[dt+1]<="9"&&(dt++,ct=8,lt="7")),mt=dt;dt>>0;else if(ct===16)if("a"<=at[dt]&&at[dt]<="f")ht=ht*ct+(10+tt(at[dt])-ot)>>>0;else if("A"<=at[dt]&&at[dt]<="F")ht=ht*ct+(10+tt(at[dt])-nt)>>>0;else break;else break;if(ht>4294967295)throw new Error("too large");dt++}if(dt===mt)throw new Error("empty octet");return[ht,dt]},et=function(){function at(ct,lt){var dt,ht,mt;if(typeof ct!="string")throw new Error("Missing `net' parameter");if(lt||(mt=ct.split("/",2),ct=mt[0],lt=mt[1]),lt||(lt=32),typeof lt=="string"&<.indexOf(".")>-1){try{this.maskLong=it(lt)}catch{throw new Error("Invalid mask: "+lt)}for(dt=ht=32;ht>=0;dt=--ht)if(this.maskLong===4294967295<<32-dt>>>0){this.bitmask=dt;break}}else if(lt||lt===0)this.bitmask=parseInt(lt,10),this.maskLong=0,this.bitmask>0&&(this.maskLong=4294967295<<32-this.bitmask>>>0);else throw new Error("Invalid mask: empty");try{this.netLong=(it(ct)&this.maskLong)>>>0}catch{throw new Error("Invalid net address: "+ct)}if(!(this.bitmask<=32))throw new Error("Invalid mask for ip4: "+lt);this.size=Math.pow(2,32-this.bitmask),this.base=st(this.netLong),this.mask=st(this.maskLong),this.hostmask=st(~this.maskLong),this.first=this.bitmask<=30?st(this.netLong+1):this.base,this.last=this.bitmask<=30?st(this.netLong+this.size-2):st(this.netLong+this.size-1),this.broadcast=this.bitmask<=30?st(this.netLong+this.size-1):void 0}return at.prototype.contains=function(ct){return typeof ct=="string"&&(ct.indexOf("/")>0||ct.split(".").length!==4)&&(ct=new at(ct)),ct instanceof at?this.contains(ct.base)&&this.contains(ct.broadcast||ct.last):(it(ct)&this.maskLong)>>>0===(this.netLong&this.maskLong)>>>0},at.prototype.next=function(ct){return ct==null&&(ct=1),new at(st(this.netLong+this.size*ct),this.mask)},at.prototype.forEach=function(ct){var lt,dt,ht;for(ht=it(this.first),dt=it(this.last),lt=0;ht<=dt;)ct(st(ht),ht,lt),lt++,ht++},at.prototype.toString=function(){return this.base+"/"+this.bitmask},at}(),Netmask_1=et}).call(commonjsGlobal);const PRIVATE_IP_RANGES=["0.0.0.0/8","10.0.0.0/8","100.64.0.0/10","127.0.0.0/8","169.254.0.0/16","172.16.0.0/12","192.0.0.0/24","192.0.0.0/29","192.0.0.8/32","192.0.0.9/32","192.0.0.10/32","192.0.0.170/32","192.0.0.171/32","192.0.2.0/24","192.31.196.0/24","192.52.193.0/24","192.88.99.0/24","192.168.0.0/16","192.175.48.0/24","198.18.0.0/15","198.51.100.0/24","203.0.113.0/24","240.0.0.0/4","255.255.255.255/32"],NETMASK_RANGES=PRIVATE_IP_RANGES.map(et=>new Netmask_1(et));function ipv4Check(et){for(const o of NETMASK_RANGES)if(o.contains(et))return!0;return!1}function isIpv4MappedIpv6(et){return/^::ffff:([0-9a-fA-F]{1,4}):([0-9a-fA-F]{1,4})$/.test(et)}function ipv4MappedIpv6Check(et){const o=et.split(":");if(o.length<2)return!1;const tt=o[o.length-1].padStart(4,"0"),rt=o[o.length-2].padStart(4,"0"),nt=`${parseInt(rt.substring(0,2),16)}.${parseInt(rt.substring(2),16)}.${parseInt(tt.substring(0,2),16)}.${parseInt(tt.substring(2),16)}`;return ipv4Check(nt)}function isIpv4EmbeddedIpv6(et){return/^::ffff:([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(et)}function ipv4EmbeddedIpv6Check(et){const o=et.split(":"),tt=o[o.length-1];return ipv4Check(tt)}function ipv6Check(et){return/^::$/.test(et)||/^::1$/.test(et)||/^64:ff9b::([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/.test(et)||/^100::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(et)||/^2001::([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(et)||/^2001:2[0-9a-fA-F]:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(et)||/^2001:db8:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(et)||/^2002:([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4}):?([0-9a-fA-F]{0,4})$/.test(et)||/^f[c-d]([0-9a-fA-F]{2,2}):/i.test(et)||/^fe[8-9a-bA-B][0-9a-fA-F]:/i.test(et)||/^ff([0-9a-fA-F]{2,2}):/i.test(et)}function isPrivateIp(et){return isIPv4(et)?ipv4Check(et):isIpv4MappedIpv6(et)?ipv4MappedIpv6Check(et):isIpv4EmbeddedIpv6(et)?ipv4EmbeddedIpv6Check(et):isIPv6(et)?ipv6Check(et):void 0}function coerce$c(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function base$c(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$d=base$c,_brrp__multiformats_scope_baseX$c=src$d;let Encoder$d=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$d=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$d(this,o)}},ComposedDecoder$c=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$d(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$d(et,o){return new ComposedDecoder$c({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$c=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$d(o,tt,rt),this.decoder=new Decoder$d(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$d({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$c(et,o,tt,rt)}function baseX$c({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$c(tt,et);return from$d({prefix:o,name:et,encode:rt,decode:ot=>coerce$c(nt(ot))})}function decode$v(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$r(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<et.toString().split("/").slice(1),func=et=>({match:o=>o.length<1?!1:et(o[0])?o.slice(1):!1,pattern:"fn"}),literal=et=>({match:o=>func(tt=>tt===et).match(o),pattern:et}),string$c=()=>({match:et=>func(o=>typeof o=="string").match(et),pattern:"{string}"}),number$1=()=>({match:et=>func(o=>!isNaN(parseInt(o))).match(et),pattern:"{number}"}),peerId=()=>({match:et=>{if(et.length<2||et[0]!=="p2p"&&et[0]!=="ipfs")return!1;if(et[1].startsWith("Q")||et[1].startsWith("1"))try{base58btc$c.decode(`z${et[1]}`)}catch{return!1}else return!1;return et.slice(2)},pattern:"/p2p/{peerid}"}),certhash=()=>({match:et=>{if(et.length<2||et[0]!=="certhash")return!1;try{base64url$9.decode(et[1])}catch{return!1}return et.slice(2)},pattern:"/certhash/{certhash}"}),optional=et=>({match:o=>{const tt=et.match(o);return tt===!1?o:tt},pattern:`optional(${et.pattern})`}),or$c=(...et)=>({match:o=>{let tt;for(const rt of et){const nt=rt.match(o);nt!==!1&&(tt==null||nt.lengtho.pattern).join(", ")})`}),and=(...et)=>({match:o=>{for(const tt of et){const rt=tt.match(o);if(rt===!1)return!1;o=rt}return o},pattern:`and(${et.map(o=>o.pattern).join(", ")})`});function fmt(...et){function o(nt){let ot=toParts(nt);for(const it of et){const st=it.match(ot);if(st===!1)return!1;ot=st}return ot}function tt(nt){return o(nt)!==!1}function rt(nt){const ot=o(nt);return ot===!1?!1:ot.length===0}return{matchers:et,matches:tt,exactMatch:rt}}const _DNS4=and(literal("dns4"),string$c()),_DNS6=and(literal("dns6"),string$c()),_DNSADDR=and(literal("dnsaddr"),string$c()),_DNS=and(literal("dns"),string$c());fmt(_DNS4,optional(peerId()));fmt(_DNS6,optional(peerId()));fmt(_DNSADDR,optional(peerId()));fmt(or$c(_DNS,_DNSADDR,_DNS4,_DNS6),optional(peerId()));const _IP4=and(literal("ip4"),func(isIPv4)),_IP6=and(literal("ip6"),func(isIPv6)),_IP=or$c(_IP4,_IP6),_IP_OR_DOMAIN=or$c(_IP,_DNS,_DNS4,_DNS6,_DNSADDR),IP_OR_DOMAIN=fmt(or$c(_IP,and(or$c(_DNS,_DNSADDR,_DNS4,_DNS6),optional(peerId())))),_TCP=and(_IP_OR_DOMAIN,literal("tcp"),number$1()),_UDP=and(_IP_OR_DOMAIN,literal("udp"),number$1()),TCP=fmt(and(_TCP,optional(peerId()))),_QUIC=and(_UDP,literal("quic")),_QUICV1=and(_UDP,literal("quic-v1")),QUIC_V0_OR_V1=or$c(_QUIC,_QUICV1),_WEB=or$c(_IP_OR_DOMAIN,_TCP,_UDP,_QUIC,_QUICV1),_WebSockets=or$c(and(_WEB,literal("ws"),optional(peerId()))),WebSockets$1=fmt(_WebSockets),_WebSocketsSecure=or$c(and(_WEB,literal("wss"),optional(peerId())),and(_WEB,literal("tls"),literal("ws"),optional(peerId()))),WebSocketsSecure=fmt(_WebSocketsSecure),_WebRTCDirect=and(_UDP,literal("webrtc-direct"),optional(certhash()),optional(certhash()),optional(peerId())),WebRTCDirect=fmt(_WebRTCDirect),_WebTransport=and(_QUICV1,literal("webtransport"),optional(certhash()),optional(certhash()),optional(peerId())),WebTransport=fmt(_WebTransport),_P2P=or$c(_WebSockets,_WebSocketsSecure,and(_TCP,optional(peerId())),and(QUIC_V0_OR_V1,optional(peerId())),and(_IP_OR_DOMAIN,optional(peerId())),_WebRTCDirect,_WebTransport,peerId()),_Circuit=and(_P2P,literal("p2p-circuit"),peerId()),Circuit=fmt(_Circuit),_WebRTC=or$c(and(_P2P,literal("p2p-circuit"),literal("webrtc"),optional(peerId())),and(_P2P,literal("webrtc"),optional(peerId())),literal("webrtc")),WebRTC=fmt(_WebRTC);or$c(and(_IP_OR_DOMAIN,literal("tcp"),number$1(),literal("http"),optional(peerId())),and(_IP_OR_DOMAIN,literal("http"),optional(peerId())));or$c(and(_IP_OR_DOMAIN,literal("tcp"),or$c(and(literal("443"),literal("http")),and(number$1(),literal("https"))),optional(peerId())),and(_IP_OR_DOMAIN,literal("tls"),literal("http"),optional(peerId())),and(_IP_OR_DOMAIN,literal("https"),optional(peerId())));var Rl,_l;class Identify extends(_l=AbstractIdentify,Rl=serviceCapabilities$3,_l){constructor(tt,rt={}){super(tt,{...rt,protocol:`/${rt.protocolPrefix??defaultValues.protocolPrefix}/${MULTICODEC_IDENTIFY_PROTOCOL_NAME}/${MULTICODEC_IDENTIFY_PROTOCOL_VERSION}`,log:tt.logger.forComponent("libp2p:identify")});wt(this,Rl,["@libp2p/identify"]);(rt.runOnConnectionOpen??defaultValues.runOnConnectionOpen)&&tt.events.addEventListener("connection:open",nt=>{const ot=nt.detail;this.identify(ot).catch(it=>{it.name!==UnsupportedProtocolError$1.name&&this.log.error("error during identify trigged by connection:open",it)})})}async _identify(tt,rt={}){let nt;if(rt.signal==null){const ot=AbortSignal.timeout(this.timeout);setMaxListeners$4(1/0,ot),rt={...rt,signal:ot}}try{nt=await tt.newStream(this.protocol,{...rt,runOnLimitedConnection:this.runOnLimitedConnection});const it=await pbStream(nt,{maxDataLength:this.maxMessageSize}).pb(Identify$1).read(rt);return await nt.close(rt),it}catch(ot){throw nt==null||nt.abort(ot),ot}}async identify(tt,rt={}){const nt=await this._identify(tt,rt),{publicKey:ot,protocols:it,observedAddr:st}=nt;if(ot==null)throw new InvalidMessageError$2("public key was missing from identify message");const at=publicKeyFromProtobuf(ot),ct=peerIdFromCID(at.toCID());if(!tt.remotePeer.equals(ct))throw new InvalidMessageError$2("identified peer does not match the expected peer");if(this.peerId.equals(ct))throw new InvalidMessageError$2("identified peer is our own peer id?");const lt=getCleanMultiaddr(st);return this.log("identify completed for peer %p and protocols %o",ct,it),lt!=null&&(this.log("our observed address was %a",lt),isPrivateIp(lt==null?void 0:lt.nodeAddress().address)===!0?this.log("our observed address was private"):this.addressManager.getObservedAddrs().length<(this.maxObservedAddresses??1/0)&&(this.log("storing our observed address"),this.addressManager.addObservedAddr(lt))),consumeIdentifyMessage(this.peerStore,this.events,this.log,tt,nt)}async handleProtocol(tt){const{connection:rt,stream:nt}=tt,ot=AbortSignal.timeout(this.timeout);setMaxListeners$4(1/0,ot);try{const it=await this.peerStore.get(this.peerId),st=this.addressManager.getAddresses().map(dt=>dt.decapsulateCode(getProtocol("p2p").code));let at=it.peerRecordEnvelope;if(st.length>0&&at==null){const dt=new PeerRecord({peerId:this.peerId,multiaddrs:st});at=(await RecordEnvelope.seal(dt,this.privateKey)).marshal().subarray()}let ct=rt.remoteAddr.bytes;IP_OR_DOMAIN.matches(rt.remoteAddr)||(ct=void 0),await pbStream(nt).pb(Identify$1).write({protocolVersion:this.host.protocolVersion,agentVersion:this.host.agentVersion,publicKey:publicKeyToProtobuf(this.privateKey.publicKey),listenAddrs:st.map(dt=>dt.bytes),signedPeerRecord:at,observedAddr:ct,protocols:it.protocols},{signal:ot}),await nt.close({signal:ot})}catch(it){this.log.error("could not respond to identify request",it),nt.abort(it)}}}function identify(et={}){return o=>new Identify(o,et)}class MuxerClosedError extends Error{constructor(o="The muxer is closed"){super(o),this.name="MuxerClosedError"}}wt(MuxerClosedError,"name","MuxerClosedError");var xs;let InvalidMessageError$1=(xs=class extends Error{constructor(o="Invalid message"){super(o),this.name="InvalidMessageError"}},wt(xs,"name","InvalidMessageError"),xs);var vs;let TooManyOutboundProtocolStreamsError$1=(vs=class extends Error{constructor(o="Too many outbound protocol streams"){super(o),this.name="TooManyOutboundProtocolStreamsError"}},wt(vs,"name","TooManyOutboundProtocolStreamsError"),vs);const serviceCapabilities$2=Symbol.for("@libp2p/service-capabilities");function getIterator(et){if(et!=null){if(typeof et[Symbol.iterator]=="function")return et[Symbol.iterator]();if(typeof et[Symbol.asyncIterator]=="function")return et[Symbol.asyncIterator]();if(typeof et.next=="function")return et}throw new Error("argument is not an iterator or iterable")}function isPromise$2(et){return et==null?!1:typeof et.then=="function"&&typeof et.catch=="function"&&typeof et.finally=="function"}function closeSource(et,o){var rt,nt;const tt=(nt=(rt=getIterator(et)).return)==null?void 0:nt.call(rt);isPromise$2(tt)&&tt.catch(ot=>{o.error("could not cause iterator to return",ot)})}const createAbortError=()=>{const et=new Error("Delay aborted");return et.name="AbortError",et},clearMethods=new WeakMap;function createDelay({clearTimeout:et,setTimeout:o}={}){return(tt,{value:rt,signal:nt}={})=>{if(nt!=null&&nt.aborted)return Promise.reject(createAbortError());let ot,it,st;const at=et??clearTimeout,ct=()=>{at(ot),st(createAbortError())},lt=()=>{nt&&nt.removeEventListener("abort",ct)},dt=new Promise((ht,mt)=>{it=()=>{lt(),ht(rt)},st=mt,ot=(o??setTimeout)(it,tt)});return nt&&nt.addEventListener("abort",ct,{once:!0}),clearMethods.set(dt,()=>{at(ot),ot=null,it()}),dt}}const delay=createDelay();class RateLimitError extends Error{constructor(tt="Rate limit exceeded",rt){super(tt);wt(this,"remainingPoints");wt(this,"msBeforeNext");wt(this,"consumedPoints");wt(this,"isFirstInDuration");this.name="RateLimitError",this.remainingPoints=rt.remainingPoints,this.msBeforeNext=rt.msBeforeNext,this.consumedPoints=rt.consumedPoints,this.isFirstInDuration=rt.isFirstInDuration}}class QueueFullError extends Error{constructor(o="The queue was full"){super(o),this.name="QueueFullError"}}wt(QueueFullError,"name","QueueFullError");class RateLimiter{constructor(o={}){wt(this,"memoryStorage");wt(this,"points");wt(this,"duration");wt(this,"blockDuration");wt(this,"execEvenly");wt(this,"execEvenlyMinDelayMs");wt(this,"keyPrefix");this.points=o.points??4,this.duration=o.duration??1,this.blockDuration=o.blockDuration??0,this.execEvenly=o.execEvenly??!1,this.execEvenlyMinDelayMs=o.execEvenlyMinDelayMs??this.duration*1e3/this.points,this.keyPrefix=o.keyPrefix??"rlflx",this.memoryStorage=new MemoryStorage}async consume(o,tt=1,rt={}){const nt=this.getKey(o),ot=this._getKeySecDuration(rt);let it=this.memoryStorage.incrby(nt,tt,ot);if(it.remainingPoints=Math.max(this.points-it.consumedPoints,0),it.consumedPoints>this.points)throw this.blockDuration>0&&it.consumedPoints<=this.points+tt&&(it=this.memoryStorage.set(nt,it.consumedPoints,this.blockDuration)),new RateLimitError("Rate limit exceeded",it);if(this.execEvenly&&it.msBeforeNext>0&&!it.isFirstInDuration){let st=Math.ceil(it.msBeforeNext/(it.remainingPoints+2));st=0?rt:this.duration)*1e3;return this.memoryStorage.set(this.getKey(o),tt,rt),{remainingPoints:0,msBeforeNext:nt===0?-1:nt,consumedPoints:tt,isFirstInDuration:!1}}get(o){const tt=this.memoryStorage.get(this.getKey(o));return tt!=null&&(tt.remainingPoints=Math.max(this.points-tt.consumedPoints,0)),tt}delete(o){this.memoryStorage.delete(this.getKey(o))}_getKeySecDuration(o){return(o==null?void 0:o.customDuration)!=null&&o.customDuration>=0?o.customDuration:this.duration}getKey(o){return this.keyPrefix.length>0?`${this.keyPrefix}:${o}`:o}parseKey(o){return o.substring(this.keyPrefix.length)}}class MemoryStorage{constructor(){wt(this,"storage");this.storage=new Map}incrby(o,tt,rt){const nt=this.storage.get(o);if(nt!=null){const ot=nt.expiresAt!=null?nt.expiresAt.getTime()-new Date().getTime():-1;return nt.expiresAt==null||ot>0?(nt.value+=tt,{remainingPoints:0,msBeforeNext:ot,consumedPoints:nt.value,isFirstInDuration:!1}):this.set(o,tt,rt)}return this.set(o,tt,rt)}set(o,tt,rt){const nt=rt*1e3,ot=this.storage.get(o);ot!=null&&clearTimeout(ot.timeoutId);const it={value:tt,expiresAt:nt>0?new Date(Date.now()+nt):void 0};return this.storage.set(o,it),nt>0&&(it.timeoutId=setTimeout(()=>{this.storage.delete(o)},nt),it.timeoutId.unref!=null&&it.timeoutId.unref()),{remainingPoints:0,msBeforeNext:nt===0?-1:nt,consumedPoints:it.value,isFirstInDuration:!0}}get(o){const tt=this.storage.get(o);if(tt!=null)return{remainingPoints:0,msBeforeNext:tt.expiresAt!=null?tt.expiresAt.getTime()-new Date().getTime():-1,consumedPoints:tt.value,isFirstInDuration:!1}}delete(o){const tt=this.storage.get(o);return tt!=null?(tt.timeoutId!=null&&clearTimeout(tt.timeoutId),this.storage.delete(o),!0):!1}}function allocUnsafe$7(et=0){return new Uint8Array(et)}function coerce$b(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$g(et){return new TextEncoder().encode(et)}function toString$j(et){return new TextDecoder().decode(et)}function base$b(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$c=base$b,_brrp__multiformats_scope_baseX$b=src$c;let Encoder$c=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$c=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$b(this,o)}},ComposedDecoder$b=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$b(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$b(et,o){return new ComposedDecoder$b({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$b=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$c(o,tt,rt),this.decoder=new Decoder$c(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$c({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$b(et,o,tt,rt)}function baseX$b({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$b(tt,et);return from$c({prefix:o,name:et,encode:rt,decode:ot=>coerce$b(nt(ot))})}function decode$u(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$q(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$8=alphabet$8.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$p(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$8[tt],o),"")}function decode$t(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$8[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$g=from$c({prefix:"🚀",name:"base256emoji",encode:encode$p,decode:decode$t}),base256emoji$h=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$g},Symbol.toStringTag,{value:"Module"})),base32$k=rfc4648$a({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$8=rfc4648$a({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$8=rfc4648$a({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$8=rfc4648$a({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$8=rfc4648$a({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$8=rfc4648$a({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$8=rfc4648$a({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$8=rfc4648$a({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$8=rfc4648$a({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$l=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$k,base32hex:base32hex$8,base32hexpad:base32hexpad$8,base32hexpadupper:base32hexpadupper$8,base32hexupper:base32hexupper$8,base32pad:base32pad$8,base32padupper:base32padupper$8,base32upper:base32upper$8,base32z:base32z$8},Symbol.toStringTag,{value:"Module"})),base36$h=baseX$b({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$8=baseX$b({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$i=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$h,base36upper:base36upper$8},Symbol.toStringTag,{value:"Module"})),base58btc$b=baseX$b({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$8=baseX$b({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$8=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$b,base58flickr:base58flickr$8},Symbol.toStringTag,{value:"Module"})),base64$j=rfc4648$a({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$8=rfc4648$a({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$8=rfc4648$a({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$8=rfc4648$a({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$k=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$j,base64pad:base64pad$8,base64url:base64url$8,base64urlpad:base64urlpad$8},Symbol.toStringTag,{value:"Module"})),base8$g=rfc4648$a({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$h=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$g},Symbol.toStringTag,{value:"Module"})),identity$8=from$c({prefix:"\0",name:"identity",encode:et=>toString$j(et),decode:et=>fromString$g(et)}),identityBase$8=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$8},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$8={...identityBase$8,...base2$h,...base8$h,...base10$h,...base16$h,...base32$l,...base36$i,...base58$8,...base64$k,...base256emoji$h};function createCodec$8(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$b=createCodec$8("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$8=createCodec$8("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$7(et.length);for(let tt=0;ttthis._maxUnprocessedMessageQueueSize)throw new InvalidMessageError$1("Unprocessed message queue size too large!");const tt=[];for(;this._buffer.length!==0;){if(this._headerInfo==null)try{this._headerInfo=this._decodeHeader(this._buffer)}catch(ct){if(ct.name==="InvalidMessageError")throw ct;break}const{id:rt,type:nt,length:ot,offset:it}=this._headerInfo;if(this._buffer.length-itthis._maxMessageSize)throw new InvalidMessageError$1("Message size too large");return{id:tt>>3,type:it,offset:rt+ot,length:nt}}};const MSB$3=128,REST$3=127;function readVarInt(et,o=0){let tt=0,rt=0,nt=o,ot;const it=et.length;do{if(nt>=it||rt>49)throw o=0,new RangeError("Could not decode varint");ot=et.get(nt++),tt+=rt<28?(ot&REST$3)<=MSB$3);return o=nt-o,{value:tt,offset:o}}const POOL_SIZE=10*1024;let Encoder$b=class{constructor(){wt(this,"_pool");wt(this,"_poolOffset");this._pool=allocUnsafe$7(POOL_SIZE),this._poolOffset=0}write(o,tt){const rt=this._pool;let nt=this._poolOffset;encode$P(o.id<<3|o.type,rt,nt),nt+=encodingLength$6(o.id<<3|o.type),(o.type===MessageTypes.NEW_STREAM||o.type===MessageTypes.MESSAGE_INITIATOR||o.type===MessageTypes.MESSAGE_RECEIVER)&&o.data!=null?(encode$P(o.data.length,rt,nt),nt+=encodingLength$6(o.data.length)):(encode$P(0,rt,nt),nt+=encodingLength$6(0));const ot=rt.subarray(this._poolOffset,nt);POOL_SIZE-nt<100?(this._pool=allocUnsafe$7(POOL_SIZE),this._poolOffset=0):this._poolOffset=nt,tt.append(ot),(o.type===MessageTypes.NEW_STREAM||o.type===MessageTypes.MESSAGE_INITIATOR||o.type===MessageTypes.MESSAGE_RECEIVER)&&o.data!=null&&tt.append(o.data)}};const encoder$1=new Encoder$b;async function*encode$o(et){for await(const o of et){const tt=new Uint8ArrayList;encoder$1.write(o,tt),yield tt}}class StreamInputBufferError extends Error{constructor(o="Stream input buffer error"){super(o),this.name="StreamInputBufferError"}}var ws;let AbortError$6=(ws=class extends Error{constructor(o="The operation was aborted"){super(o),this.name="AbortError"}},wt(ws,"name","AbortError"),ws);class StreamResetError extends Error{constructor(o="The stream has been reset"){super(o),this.name="StreamResetError"}}wt(StreamResetError,"name","StreamResetError");class StreamStateError extends Error{constructor(o="The stream is in an invalid state"){super(o),this.name="StreamStateError"}}wt(StreamStateError,"name","StreamStateError");function setMaxListeners$3(){}const setMaxListeners$2=(et,...o)=>{try{[...o]}catch{}};var Jr,Tl;let TypedEventEmitter$1=(Tl=class extends EventTarget{constructor(){super();fr(this,Jr,new Map);setMaxListeners$2(1/0,this)}listenerCount(tt){const rt=Ot(this,Jr).get(tt);return rt==null?0:rt.length}addEventListener(tt,rt,nt){super.addEventListener(tt,rt,nt);let ot=Ot(this,Jr).get(tt);ot==null&&(ot=[],Ot(this,Jr).set(tt,ot)),ot.push({callback:rt,once:(nt!==!0&&nt!==!1&&(nt==null?void 0:nt.once))??!1})}removeEventListener(tt,rt,nt){super.removeEventListener(tt.toString(),rt??null,nt);let ot=Ot(this,Jr).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==rt),Ot(this,Jr).set(tt,ot))}dispatchEvent(tt){const rt=super.dispatchEvent(tt);let nt=Ot(this,Jr).get(tt.type);return nt==null||(nt=nt.filter(({once:ot})=>!ot),Ot(this,Jr).set(tt.type,nt)),rt}safeDispatchEvent(tt,rt={}){return this.dispatchEvent(new CustomEvent(tt,rt))}},Jr=new WeakMap,Tl);const DEFAULT_SEND_CLOSE_WRITE_TIMEOUT=5e3;function isPromise$1(et){return et==null?!1:typeof et.then=="function"&&typeof et.catch=="function"&&typeof et.finally=="function"}class AbstractStream{constructor(o){wt(this,"id");wt(this,"direction");wt(this,"timeline");wt(this,"protocol");wt(this,"metadata");wt(this,"source");wt(this,"status");wt(this,"readStatus");wt(this,"writeStatus");wt(this,"log");wt(this,"sinkController");wt(this,"sinkEnd");wt(this,"closed");wt(this,"endErr");wt(this,"streamSource");wt(this,"onEnd");wt(this,"onCloseRead");wt(this,"onCloseWrite");wt(this,"onReset");wt(this,"onAbort");wt(this,"sendCloseWriteTimeout");wt(this,"sendingData");this.sinkController=new AbortController,this.sinkEnd=pDefer(),this.closed=pDefer(),this.log=o.log,this.status="open",this.readStatus="ready",this.writeStatus="ready",this.id=o.id,this.metadata=o.metadata??{},this.direction=o.direction,this.timeline={open:Date.now()},this.sendCloseWriteTimeout=o.sendCloseWriteTimeout??DEFAULT_SEND_CLOSE_WRITE_TIMEOUT,this.onEnd=o.onEnd,this.onCloseRead=o==null?void 0:o.onCloseRead,this.onCloseWrite=o==null?void 0:o.onCloseWrite,this.onReset=o==null?void 0:o.onReset,this.onAbort=o==null?void 0:o.onAbort,this.source=this.streamSource=pushable({onEnd:tt=>{tt!=null?this.log.trace("source ended with error",tt):this.log.trace("source ended"),this.onSourceEnd(tt)}}),this.sink=this.sink.bind(this)}async sink(o){if(this.writeStatus!=="ready")throw new StreamStateError(`writable end state is "${this.writeStatus}" not "ready"`);try{this.writeStatus="writing";const tt={signal:this.sinkController.signal};if(this.direction==="outbound"){const nt=this.sendNewStream(tt);isPromise$1(nt)&&await nt}const rt=()=>{closeSource(o,this.log)};try{this.sinkController.signal.addEventListener("abort",rt),this.log.trace("sink reading from source");for await(let nt of o){nt=nt instanceof Uint8Array?new Uint8ArrayList(nt):nt;const ot=this.sendData(nt,tt);isPromise$1(ot)&&(this.sendingData=pDefer(),await ot,this.sendingData.resolve(),this.sendingData=void 0)}}finally{this.sinkController.signal.removeEventListener("abort",rt)}this.log.trace('sink finished reading from source, write status is "%s"',this.writeStatus),this.writeStatus==="writing"&&(this.writeStatus="closing",this.log.trace("send close write to remote"),await this.sendCloseWrite({signal:AbortSignal.timeout(this.sendCloseWriteTimeout)}),this.writeStatus="closed"),this.onSinkEnd()}catch(tt){throw this.log.trace("sink ended with error, calling abort with error",tt),this.abort(tt),tt}finally{this.log.trace("resolve sink end"),this.sinkEnd.resolve()}}onSourceEnd(o){var tt;this.timeline.closeRead==null&&(this.timeline.closeRead=Date.now(),this.readStatus="closed",o!=null&&this.endErr==null&&(this.endErr=o),(tt=this.onCloseRead)==null||tt.call(this),this.timeline.closeWrite!=null?(this.log.trace("source and sink ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("source ended, waiting for sink to end"))}onSinkEnd(o){var tt;this.timeline.closeWrite==null&&(this.timeline.closeWrite=Date.now(),this.writeStatus="closed",o!=null&&this.endErr==null&&(this.endErr=o),(tt=this.onCloseWrite)==null||tt.call(this),this.timeline.closeRead!=null?(this.log.trace("sink and source ended"),this.timeline.close=Date.now(),this.status!=="aborted"&&this.status!=="reset"&&(this.status="closed"),this.onEnd!=null&&this.onEnd(this.endErr),this.closed.resolve()):this.log.trace("sink ended, waiting for source to end"))}async close(o){this.log.trace("closing gracefully"),this.status="closing",await raceSignal(Promise.all([this.closeWrite(o),this.closeRead(o),this.closed.promise]),o==null?void 0:o.signal),this.status="closed",this.log.trace("closed gracefully")}async closeRead(o={}){if(this.readStatus==="closing"||this.readStatus==="closed")return;this.log.trace('closing readable end of stream with starting read status "%s"',this.readStatus);const tt=this.readStatus;this.readStatus="closing",this.status!=="reset"&&this.status!=="aborted"&&this.timeline.closeRead==null&&(this.log.trace("send close read to remote"),await this.sendCloseRead(o)),tt==="ready"&&(this.log.trace("ending internal source queue with %d queued bytes",this.streamSource.readableLength),this.streamSource.end()),this.log.trace("closed readable end of stream")}async closeWrite(o={}){this.writeStatus==="closing"||this.writeStatus==="closed"||(this.log.trace('closing writable end of stream with starting write status "%s"',this.writeStatus),this.writeStatus==="ready"&&(this.log.trace("sink was never sunk, sink an empty array"),await raceSignal(this.sink([]),o.signal)),this.writeStatus==="writing"&&(this.sendingData!=null&&await raceSignal(this.sendingData.promise,o.signal),this.log.trace("aborting source passed to .sink"),this.sinkController.abort(),await raceSignal(this.sinkEnd.promise,o.signal)),this.writeStatus="closed",this.log.trace("closed writable end of stream"))}abort(o){var rt;if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;this.log("abort with error",o),this.log("try to send reset to remote");const tt=this.sendReset();isPromise$1(tt)&&tt.catch(nt=>{this.log.error("error sending reset message",nt)}),this.status="aborted",this.timeline.abort=Date.now(),this._closeSinkAndSource(o),(rt=this.onAbort)==null||rt.call(this,o)}reset(){var tt;if(this.status==="closed"||this.status==="aborted"||this.status==="reset")return;const o=new StreamResetError("stream reset");this.status="reset",this.timeline.reset=Date.now(),this._closeSinkAndSource(o),(tt=this.onReset)==null||tt.call(this)}_closeSinkAndSource(o){this._closeSink(o),this._closeSource(o)}_closeSink(o){this.writeStatus==="writing"&&(this.log.trace("end sink source"),this.sinkController.abort()),this.onSinkEnd(o)}_closeSource(o){this.readStatus!=="closing"&&this.readStatus!=="closed"&&(this.log.trace("ending source with %d bytes to be read by consumer",this.streamSource.readableLength),this.readStatus="closing",this.streamSource.end(o))}remoteCloseWrite(){if(this.readStatus==="closing"||this.readStatus==="closed"){this.log("received remote close write but local source is already closed");return}this.log.trace("remote close write"),this._closeSource()}remoteCloseRead(){if(this.writeStatus==="closing"||this.writeStatus==="closed"){this.log("received remote close read but local sink is already closed");return}this.log.trace("remote close read"),this._closeSink()}destroy(){if(this.status==="closed"||this.status==="aborted"||this.status==="reset"){this.log("received destroy but we are already closed");return}this.log.trace("stream destroyed"),this._closeSinkAndSource()}sourcePush(o){this.streamSource.push(o)}sourceReadableLength(){return this.streamSource.readableLength}}class MplexStream extends AbstractStream{constructor(tt){super(tt);wt(this,"name");wt(this,"streamId");wt(this,"send");wt(this,"types");wt(this,"maxDataSize");this.types=tt.direction==="outbound"?InitiatorMessageTypes:ReceiverMessageTypes,this.send=tt.send,this.name=tt.name,this.streamId=tt.streamId,this.maxDataSize=tt.maxDataSize}async sendNewStream(){await this.send({id:this.streamId,type:InitiatorMessageTypes.NEW_STREAM,data:new Uint8ArrayList(fromString$f(this.name))})}async sendData(tt){for(tt=tt.sublist();tt.byteLength>0;){const rt=Math.min(tt.byteLength,this.maxDataSize);await this.send({id:this.streamId,type:this.types.MESSAGE,data:tt.sublist(0,rt)}),tt.consume(rt)}}async sendReset(){await this.send({id:this.streamId,type:this.types.RESET})}async sendCloseWrite(){await this.send({id:this.streamId,type:this.types.CLOSE})}async sendCloseRead(){}}function createStream(et){const{id:o,name:tt,send:rt,onEnd:nt,type:ot="initiator",maxMsgSize:it=MAX_MSG_SIZE}=et;return new MplexStream({id:ot==="initiator"?`i${o}`:`r${o}`,streamId:o,name:`${tt??o}`,direction:ot==="initiator"?"outbound":"inbound",maxDataSize:it,onEnd:nt,send:rt,log:et.logger.forComponent(`libp2p:mplex:stream:${ot}:${o}`)})}const MAX_STREAMS_INBOUND_STREAMS_PER_CONNECTION=1024,MAX_STREAMS_OUTBOUND_STREAMS_PER_CONNECTION=1024,MAX_STREAM_BUFFER_SIZE=1024*1024*4,DISCONNECT_THRESHOLD=5,CLOSE_TIMEOUT$2=500;function printMessage(et){const o={...et,type:`${MessageTypeNames[et.type]} (${et.type})`};return et.type===MessageTypes.NEW_STREAM&&(o.data=toString$i(et.data instanceof Uint8Array?et.data:et.data.subarray())),(et.type===MessageTypes.MESSAGE_INITIATOR||et.type===MessageTypes.MESSAGE_RECEIVER)&&(o.data=toString$i(et.data instanceof Uint8Array?et.data:et.data.subarray(),"base16")),o}class MplexStreamMuxer{constructor(o,tt){wt(this,"protocol","/mplex/6.7.0");wt(this,"sink");wt(this,"source");wt(this,"log");wt(this,"_streamId");wt(this,"_streams");wt(this,"_init");wt(this,"_source");wt(this,"closeController");wt(this,"rateLimiter");wt(this,"closeTimeout");wt(this,"logger");tt=tt??{},this.log=o.logger.forComponent("libp2p:mplex"),this.logger=o.logger,this._streamId=0,this._streams={initiators:new Map,receivers:new Map},this._init=tt,this.closeTimeout=tt.closeTimeout??CLOSE_TIMEOUT$2,this.sink=this._createSink(),this._source=pushable({objectMode:!0,onEnd:()=>{for(const rt of this._streams.initiators.values())rt.destroy();for(const rt of this._streams.receivers.values())rt.destroy()}}),this.source=pipe(this._source,rt=>encode$o(rt)),this.closeController=new AbortController,this.rateLimiter=new RateLimiter({points:tt.disconnectThreshold??DISCONNECT_THRESHOLD,duration:1})}get streams(){const o=[];for(const tt of this._streams.initiators.values())o.push(tt);for(const tt of this._streams.receivers.values())o.push(tt);return o}newStream(o){if(this.closeController.signal.aborted)throw new MuxerClosedError("Muxer already closed");const tt=this._streamId++;o=o==null?tt.toString():o.toString();const rt=this._streams.initiators;return this._newStream({id:tt,name:o,type:"initiator",registry:rt})}async close(o){if(this.closeController.signal.aborted)return;const tt=(o==null?void 0:o.signal)??AbortSignal.timeout(this.closeTimeout);try{await Promise.all(this.streams.map(async rt=>rt.close({signal:tt}))),this._source.end(),await this._source.onEmpty({signal:tt}),this.closeController.abort()}catch(rt){this.abort(rt)}}abort(o){this.closeController.signal.aborted||(this.streams.forEach(tt=>{tt.abort(o)}),this.closeController.abort(o))}_newReceiverStream(o){const{id:tt,name:rt}=o,nt=this._streams.receivers;return this._newStream({id:tt,name:rt,type:"receiver",registry:nt})}_newStream(o){const{id:tt,name:rt,type:nt,registry:ot}=o;if(this.log("new %s stream %s",nt,tt),nt==="initiator"&&this._streams.initiators.size===(this._init.maxOutboundStreams??MAX_STREAMS_OUTBOUND_STREAMS_PER_CONNECTION))throw new TooManyOutboundProtocolStreamsError$1("Too many outbound streams open");if(ot.has(tt))throw new Error(`${nt} stream ${tt} already exists!`);const at=createStream({id:tt,name:rt,send:async ct=>{this.log.enabled&&this.log.trace("%s stream %s send",nt,tt,printMessage(ct)),this._source.push(ct)},type:nt,onEnd:()=>{this.log("%s stream with id %s and protocol %s ended",nt,tt,at.protocol),ot.delete(tt),this._init.onStreamEnd!=null&&this._init.onStreamEnd(at)},maxMsgSize:this._init.maxMsgSize,logger:this.logger});return ot.set(tt,at),at}_createSink(){return async tt=>{const rt=()=>{closeSource(tt,this.log)};this.closeController.signal.addEventListener("abort",rt);try{const nt=new Decoder$b(this._init.maxMsgSize,this._init.maxUnprocessedMessageQueueSize);for await(const ot of tt)for(const it of nt.write(ot))await this._handleIncoming(it);this._source.end()}catch(nt){this.log("error in sink",nt),this._source.end(nt)}finally{this.closeController.signal.removeEventListener("abort",rt)}}}async _handleIncoming(o){const{id:tt,type:rt}=o;if(this.log.enabled&&this.log.trace("incoming message",printMessage(o)),o.type===MessageTypes.NEW_STREAM){if(this._streams.receivers.size===(this._init.maxInboundStreams??MAX_STREAMS_INBOUND_STREAMS_PER_CONNECTION)){this.log("too many inbound streams open"),this._source.push({id:tt,type:MessageTypes.RESET_RECEIVER});try{await this.rateLimiter.consume("new-stream",1)}catch{this.log("rate limit hit when opening too many new streams over the inbound stream limit - closing remote connection"),this.abort(new Error("Too many open streams"));return}return}const st=this._newReceiverStream({id:tt,name:toString$i(o.data instanceof Uint8Array?o.data:o.data.subarray())});this._init.onIncomingStream!=null&&this._init.onIncomingStream(st);return}const ot=((rt&1)===1?this._streams.initiators:this._streams.receivers).get(tt);if(ot==null){this.log("missing stream %s for message type %s",tt,MessageTypeNames[rt]);try{await this.rateLimiter.consume("missing-stream",1)}catch{this.log("rate limit hit when receiving messages for streams that do not exist - closing remote connection"),this.abort(new Error("Too many messages for missing streams"));return}return}const it=this._init.maxStreamBufferSize??MAX_STREAM_BUFFER_SIZE;try{switch(rt){case MessageTypes.MESSAGE_INITIATOR:case MessageTypes.MESSAGE_RECEIVER:if(ot.sourceReadableLength()>it)throw this._source.push({id:o.id,type:rt===MessageTypes.MESSAGE_INITIATOR?MessageTypes.RESET_RECEIVER:MessageTypes.RESET_INITIATOR}),new StreamInputBufferError("Input buffer full - increase Mplex maxBufferSize to accommodate slow consumers");ot.sourcePush(o.data);break;case MessageTypes.CLOSE_INITIATOR:case MessageTypes.CLOSE_RECEIVER:ot.remoteCloseWrite();break;case MessageTypes.RESET_INITIATOR:case MessageTypes.RESET_RECEIVER:ot.reset();break;default:this.log("unknown message type %s",rt)}}catch(st){this.log.error("error while processing message",st),ot.abort(st)}}}var Il,Pl;Pl=Symbol.toStringTag,Il=serviceCapabilities$2;class Mplex{constructor(o,tt={}){wt(this,"protocol","/mplex/6.7.0");wt(this,"_init");wt(this,"components");wt(this,Pl,"@libp2p/mplex");wt(this,Il,["@libp2p/stream-multiplexing"]);this.components=o,this._init=tt}createStreamMuxer(o={}){return new MplexStreamMuxer(this.components,{...o,...this._init})}}function mplex(et={}){return o=>new Mplex(o,et)}function isAsyncIterable$3(et){return et[Symbol.asyncIterator]!=null}function first(et){if(isAsyncIterable$3(et))return(async()=>{for await(const o of et)return o})();for(const o of et)return o}function equals$4(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt{tt==null||tt.abort(new TimeoutError$3("ping timeout"))}),pipe(tt,async function*(ot){let it=0;for await(const st of ot){if(it+=st.byteLength,it>PING_LENGTH$1){tt==null||tt.abort(new InvalidMessageError$3("Too much data received"));return}yield st}},tt).catch(ot=>{this.log.error("incoming ping from %p failed with error",o.connection.remotePeer,ot),tt==null||tt.abort(ot)}).finally(()=>{const ot=Date.now()-rt;this.log("incoming ping from %p complete in %dms",o.connection.remotePeer,ot)})}async ping(o,tt={}){var at,ct;this.log("pinging %p",o);const rt=Date.now(),nt=randomBytes(PING_LENGTH$1),ot=await this.components.connectionManager.openConnection(o,tt);let it,st=()=>{};if(tt.signal==null){const lt=AbortSignal.timeout(this.timeout);tt={...tt,signal:lt}}try{it=await ot.newStream(this.protocol,{...tt,runOnLimitedConnection:this.runOnLimitedConnection}),st=()=>{it==null||it.abort(new AbortError$9)},(at=tt.signal)==null||at.addEventListener("abort",st,{once:!0});const lt=await pipe([nt],it,async ht=>first(ht)),dt=Date.now()-rt;if(lt==null)throw new ProtocolError(`Did not receive a ping ack after ${dt}ms`);if(!equals$4(nt,lt.subarray()))throw new ProtocolError(`Received wrong ping ack after ${dt}ms`);return this.log("ping %p complete in %dms",ot.remotePeer,dt),dt}catch(lt){throw this.log.error("error while pinging %p",ot.remotePeer,lt),it==null||it.abort(lt),lt}finally{(ct=tt.signal)==null||ct.removeEventListener("abort",st),it!=null&&await it.close()}}}function ping(et={}){return o=>new PingService(o,et)}const transportSymbol=Symbol.for("@libp2p/transport");var FaultTolerance$1;(function(et){et[et.FATAL_ALL=0]="FATAL_ALL",et[et.NO_FATAL=1]="NO_FATAL"})(FaultTolerance$1||(FaultTolerance$1={}));var Es;let AbortError$5=(Es=class extends Error{constructor(o="The operation was aborted"){super(o),this.name="AbortError"}},wt(Es,"name","AbortError"),Es);class ConnectionFailedError extends Error{constructor(o="Connection failed"){super(o),this.name="ConnectionFailedError"}}wt(ConnectionFailedError,"name","ConnectionFailedError");const serviceCapabilities$1=Symbol.for("@libp2p/service-capabilities"),ASSUME_HTTP_CODES=[getProtocol("tcp").code,getProtocol("dns").code,getProtocol("dnsaddr").code,getProtocol("dns4").code,getProtocol("dns6").code];function extractSNI(et){let o;try{o=getProtocol("sni").code}catch{return null}for(const[tt,rt]of et)if(tt===o&&rt!==void 0)return rt;return null}function hasTLS(et){return et.some(([o,tt])=>o===getProtocol("tls").code)}function interpretNext(et,o,tt){const rt=interpreters[getProtocol(et).name];if(rt===void 0)throw new Error(`Can't interpret protocol ${getProtocol(et).name}`);const nt=rt(o,tt);return et===getProtocol("ip6").code?`[${nt}]`:nt}const interpreters={ip4:(et,o)=>et,ip6:(et,o)=>o.length===0?et:`[${et}]`,tcp:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`tcp://${interpretNext(tt[0],tt[1]??"",o)}:${et}`},udp:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`udp://${interpretNext(tt[0],tt[1]??"",o)}:${et}`},dnsaddr:(et,o)=>et,dns4:(et,o)=>et,dns6:(et,o)=>et,dns:(et,o)=>et,ipfs:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",o)}/ipfs/${et}`},p2p:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",o)}/p2p/${et}`},http:(et,o)=>{const tt=hasTLS(o),rt=extractSNI(o);if(tt&&rt!==null)return`https://${rt}`;const nt=tt?"https://":"http://",ot=o.pop();if(ot===void 0)throw new Error("Unexpected end of multiaddr");let it=interpretNext(ot[0],ot[1]??"",o);return it=it.replace("tcp://",""),`${nt}${it}`},"http-path":(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");const rt=interpretNext(tt[0],tt[1]??"",o),nt=decodeURIComponent(et);return`${rt}/${nt}`},tls:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return interpretNext(tt[0],tt[1]??"",o)},sni:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return interpretNext(tt[0],tt[1]??"",o)},https:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");let rt=interpretNext(tt[0],tt[1]??"",o);return rt=rt.replace("tcp://",""),`https://${rt}`},ws:(et,o)=>{const tt=hasTLS(o),rt=extractSNI(o);if(tt&&rt!==null)return`wss://${rt}`;const nt=tt?"wss://":"ws://",ot=o.pop();if(ot===void 0)throw new Error("Unexpected end of multiaddr");let it=interpretNext(ot[0],ot[1]??"",o);return it=it.replace("tcp://",""),`${nt}${it}`},wss:(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");let rt=interpretNext(tt[0],tt[1]??"",o);return rt=rt.replace("tcp://",""),`wss://${rt}`},"p2p-websocket-star":(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",o)}/p2p-websocket-star`},"p2p-webrtc-star":(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",o)}/p2p-webrtc-star`},"p2p-webrtc-direct":(et,o)=>{const tt=o.pop();if(tt===void 0)throw new Error("Unexpected end of multiaddr");return`${interpretNext(tt[0],tt[1]??"",o)}/p2p-webrtc-direct`}};function multiaddrToUri(et,o){const rt=multiaddr(et).stringTuples(),nt=rt.pop();if(nt===void 0)throw new Error("Unexpected end of multiaddr");const ot=getProtocol(nt[0]),it=interpreters[ot.name];if(it==null)throw new Error(`No interpreter found for ${ot.name}`);let st=it(nt[1]??"",rt);return ASSUME_HTTP_CODES.includes(nt[0])&&(st=st.replace(/^.*:\/\//,""),nt[1]==="443"?st=`https://${st}`:st=`http://${st}`),(st.startsWith("http://")||st.startsWith("https://"))&&(st=new URL(st).toString(),st.endsWith("/")&&(st=st.substring(0,st.length-1))),st}const ready=async et=>{if(et.readyState>=2)throw new Error("socket closed");et.readyState!==1&&await new Promise((o,tt)=>{function rt(){et.removeEventListener("open",nt),et.removeEventListener("error",ot)}function nt(){rt(),o()}function ot(it){rt(),tt(it.error??new Error(`connect ECONNREFUSED ${et.url}`))}et.addEventListener("open",nt),et.addEventListener("error",ot)})},sink=(et,o)=>(o=o??{},o.closeOnEnd=o.closeOnEnd!==!1,async rt=>{for await(const nt of rt){try{await ready(et)}catch(ot){if(ot.message==="socket closed")break;throw ot}if(et.readyState===et.CLOSING||et.readyState===et.CLOSED)break;et.send(nt)}o.closeOnEnd!=null&&et.readyState<=1&&await new Promise((nt,ot)=>{et.addEventListener("close",it=>{if(it.wasClean||it.code===1006)nt();else{const st=Object.assign(new Error("ws error"),{event:it});ot(st)}}),setTimeout(()=>{et.close()})})});var dom={},eventIterator={};Object.defineProperty(eventIterator,"__esModule",{value:!0});class EventQueue{constructor(){this.pullQueue=[],this.pushQueue=[],this.eventHandlers={},this.isPaused=!1,this.isStopped=!1}push(o){if(this.isStopped)return;const tt={value:o,done:!1};if(this.pullQueue.length){const rt=this.pullQueue.shift();rt&&rt.resolve(tt)}else this.pushQueue.push(Promise.resolve(tt)),this.highWaterMark!==void 0&&this.pushQueue.length>=this.highWaterMark&&!this.isPaused&&(this.isPaused=!0,this.eventHandlers.highWater?this.eventHandlers.highWater():console&&console.warn(`EventIterator queue reached ${this.pushQueue.length} items`))}stop(){if(!this.isStopped){this.isStopped=!0,this.remove();for(const o of this.pullQueue)o.resolve({value:void 0,done:!0});this.pullQueue.length=0}}fail(o){if(!this.isStopped)if(this.isStopped=!0,this.remove(),this.pullQueue.length){for(const tt of this.pullQueue)tt.reject(o);this.pullQueue.length=0}else{const tt=Promise.reject(o);tt.catch(()=>{}),this.pushQueue.push(tt)}}remove(){Promise.resolve().then(()=>{this.removeCallback&&this.removeCallback()})}[Symbol.asyncIterator](){return{next:o=>{const tt=this.pushQueue.shift();return tt?(this.lowWaterMark!==void 0&&this.pushQueue.length<=this.lowWaterMark&&this.isPaused&&(this.isPaused=!1,this.eventHandlers.lowWater&&this.eventHandlers.lowWater()),tt):this.isStopped?Promise.resolve({value:void 0,done:!0}):new Promise((rt,nt)=>{this.pullQueue.push({resolve:rt,reject:nt})})},return:()=>(this.isStopped=!0,this.pushQueue.length=0,this.remove(),Promise.resolve({value:void 0,done:!0}))}}}let EventIterator$1=class{constructor(o,{highWaterMark:tt=100,lowWaterMark:rt=1}={}){const nt=new EventQueue;nt.highWaterMark=tt,nt.lowWaterMark=rt,nt.removeCallback=o({push:ot=>nt.push(ot),stop:()=>nt.stop(),fail:ot=>nt.fail(ot),on:(ot,it)=>{nt.eventHandlers[ot]=it}})||(()=>{}),this[Symbol.asyncIterator]=()=>nt[Symbol.asyncIterator](),Object.freeze(this)}};eventIterator.EventIterator=EventIterator$1;eventIterator.default=EventIterator$1;Object.defineProperty(dom,"__esModule",{value:!0});const event_iterator_1=eventIterator;var EventIterator=dom.EventIterator=event_iterator_1.EventIterator;function subscribe(et,o,tt){return new event_iterator_1.EventIterator(({push:rt})=>(this.addEventListener(et,rt,o),()=>this.removeEventListener(et,rt,o)),tt)}dom.subscribe=subscribe;dom.default=event_iterator_1.EventIterator;function coerce$a(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$e(et){return new TextEncoder().encode(et)}function toString$h(et){return new TextDecoder().decode(et)}function base$a(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$b=base$a,_brrp__multiformats_scope_baseX$a=src$b;let Encoder$a=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$a=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$a(this,o)}},ComposedDecoder$a=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$a(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$a(et,o){return new ComposedDecoder$a({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$a=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$a(o,tt,rt),this.decoder=new Decoder$a(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$b({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$a(et,o,tt,rt)}function baseX$a({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$a(tt,et);return from$b({prefix:o,name:et,encode:rt,decode:ot=>coerce$a(nt(ot))})}function decode$s(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$n(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$7=alphabet$7.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$m(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$7[tt],o),"")}function decode$r(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$7[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$e=from$b({prefix:"🚀",name:"base256emoji",encode:encode$m,decode:decode$r}),base256emoji$f=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$e},Symbol.toStringTag,{value:"Module"})),base32$i=rfc4648$9({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$7=rfc4648$9({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$7=rfc4648$9({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$7=rfc4648$9({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$7=rfc4648$9({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$7=rfc4648$9({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$7=rfc4648$9({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$7=rfc4648$9({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$7=rfc4648$9({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$j=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$i,base32hex:base32hex$7,base32hexpad:base32hexpad$7,base32hexpadupper:base32hexpadupper$7,base32hexupper:base32hexupper$7,base32pad:base32pad$7,base32padupper:base32padupper$7,base32upper:base32upper$7,base32z:base32z$7},Symbol.toStringTag,{value:"Module"})),base36$f=baseX$a({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$7=baseX$a({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$g=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$f,base36upper:base36upper$7},Symbol.toStringTag,{value:"Module"})),base58btc$a=baseX$a({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$7=baseX$a({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$7=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$a,base58flickr:base58flickr$7},Symbol.toStringTag,{value:"Module"})),base64$h=rfc4648$9({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$7=rfc4648$9({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$7=rfc4648$9({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$7=rfc4648$9({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$i=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$h,base64pad:base64pad$7,base64url:base64url$7,base64urlpad:base64urlpad$7},Symbol.toStringTag,{value:"Module"})),base8$e=rfc4648$9({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$f=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$e},Symbol.toStringTag,{value:"Module"})),identity$7=from$b({prefix:"\0",name:"identity",encode:et=>toString$h(et),decode:et=>fromString$e(et)}),identityBase$7=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$7},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$7={...identityBase$7,...base2$f,...base8$f,...base10$f,...base16$f,...base32$j,...base36$g,...base58$7,...base64$i,...base256emoji$f};function allocUnsafe$6(et=0){return new Uint8Array(et)}function createCodec$7(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$a=createCodec$7("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$7=createCodec$7("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$6(et.length);for(let tt=0;tt{et.binaryType="arraybuffer";const o=async()=>{await new Promise((ot,it)=>{if(rt){ot();return}if(nt!=null){it(nt);return}const st=lt=>{et.removeEventListener("open",at),et.removeEventListener("error",ct),lt()},at=()=>{st(ot)},ct=lt=>{st(()=>{it(lt.error??new Error(`connect ECONNREFUSED ${et.url}`))})};et.addEventListener("open",at),et.addEventListener("error",ct)})},tt=async function*(){const ot=new EventIterator(({push:it,stop:st,fail:at})=>{const ct=dt=>{let ht=null;typeof dt.data=="string"&&(ht=fromString$d(dt.data)),isArrayBuffer(dt.data)&&(ht=new Uint8Array(dt.data)),dt.data instanceof Uint8Array&&(ht=dt.data),ht!=null&&it(ht)},lt=dt=>{at(dt.error??new Error("Socket error"))};return et.addEventListener("message",ct),et.addEventListener("error",lt),et.addEventListener("close",st),()=>{et.removeEventListener("message",ct),et.removeEventListener("error",lt),et.removeEventListener("close",st)}},{highWaterMark:1/0});await o();for await(const it of ot)yield isArrayBuffer(it)?new Uint8Array(it):it}();let rt=et.readyState===1,nt;return et.addEventListener("open",()=>{rt=!0,nt=null}),et.addEventListener("close",()=>{rt=!1,nt=null}),et.addEventListener("error",ot=>{rt||(nt=ot.error??new Error(`connect ECONNREFUSED ${et.url}`))}),Object.assign(tt,{connected:o})},duplex=(et,o)=>{o=o??{};const tt=source(et);let rt=o.remoteAddress,nt=o.remotePort;if(et.url!=null)try{const it=new URL(et.url);rt=it.hostname,nt=parseInt(it.port,10)}catch{}if(rt==null||nt==null)throw new Error("Remote connection did not have address and/or port");return{sink:sink(et,o),source:tt,connected:async()=>{await tt.connected()},close:async()=>{(et.readyState===et.CONNECTING||et.readyState===et.OPEN)&&await new Promise(it=>{et.addEventListener("close",()=>{it()}),et.close()})},destroy:()=>{et.terminate!=null?et.terminate():et.close()},remoteAddress:rt,remotePort:nt,socket:et}},WebSocket$1=WebSocket,map={"http:":"ws:","https:":"wss:"},defaultProtocol="ws:",wsurl=(et,o)=>{if(et.startsWith("//")&&(et=`${(o==null?void 0:o.protocol)??defaultProtocol}${et}`),et.startsWith("/")&&o!=null){const rt=o.protocol??defaultProtocol,nt=o.host,ot=o.port!=null&&(nt==null?void 0:nt.endsWith(`:${o.port}`))!==!0?`:${o.port}`:"";et=`${rt}//${nt}${ot}${et}`}const tt=new URL(et);for(const[rt,nt]of Object.entries(map))tt.protocol===rt&&(tt.protocol=nt);return tt};function connect(et,o){const tt=typeof window>"u"?void 0:window.location;o=o??{};const rt=wsurl(et,tt),nt=new WebSocket$1(rt.toString(),o.websocket);return duplex(nt,o)}class CustomProgressEvent extends Event{constructor(tt,rt){super(tt);wt(this,"type");wt(this,"detail");this.type=tt,this.detail=rt}}const CODE_P2P=421,CODE_CIRCUIT=290,CLOSE_TIMEOUT$1=500;function all$1(et){return et.filter(o=>{if(o.protoCodes().includes(CODE_CIRCUIT))return!1;const tt=o.decapsulateCode(CODE_P2P);return WebSockets$2.matches(tt)||WebSocketsSecure$1.matches(tt)})}function wss(et){return et.filter(o=>{if(o.protoCodes().includes(CODE_CIRCUIT))return!1;const tt=o.decapsulateCode(CODE_P2P);return WebSocketsSecure$1.matches(tt)})}function createListener(){throw new Error("WebSocket Servers can not be created in the browser!")}function socketToMaConn(et,o,tt){const rt=tt.logger.forComponent("libp2p:websockets:maconn"),nt=tt.metrics,ot=tt.metricPrefix??"",it={log:rt,async sink(st){try{await et.sink(async function*(){for await(const at of st)at instanceof Uint8Array?yield at:yield at.subarray()}())}catch(at){at.type!=="aborted"&&rt.error(at)}},source:et.source,remoteAddr:o,timeline:{open:Date.now()},async close(st={}){var lt,dt;const at=Date.now();if(st.signal==null){const ht=AbortSignal.timeout(CLOSE_TIMEOUT$1);st={...st,signal:ht}}const ct=()=>{const{host:ht,port:mt}=it.remoteAddr.toOptions();rt("timeout closing stream to %s:%s after %dms, destroying it manually",ht,mt,Date.now()-at),this.abort(new AbortError$5("Socket close timeout"))};(lt=st.signal)==null||lt.addEventListener("abort",ct);try{await et.close()}catch(ht){rt.error("error closing WebSocket gracefully",ht),this.abort(ht)}finally{(dt=st.signal)==null||dt.removeEventListener("abort",ct),it.timeline.close=Date.now()}},abort(st){const{host:at,port:ct}=it.remoteAddr.toOptions();rt("timeout closing stream to %s:%s due to error",at,ct,st),et.destroy(),it.timeline.close=Date.now(),nt==null||nt.increment({[`${ot}error`]:!0})}};return et.socket.addEventListener("close",()=>{nt==null||nt.increment({[`${ot}close`]:!0}),it.timeline.close==null&&(it.timeline.close=Date.now())},{once:!0}),it}var Dl,Ll,Ol;Ol=transportSymbol,Ll=Symbol.toStringTag,Dl=serviceCapabilities$1;class WebSockets{constructor(o,tt){wt(this,"log");wt(this,"init");wt(this,"logger");wt(this,"metrics");wt(this,"components");wt(this,Ol,!0);wt(this,Ll,"@libp2p/websockets");wt(this,Dl,["@libp2p/transport"]);this.log=o.logger.forComponent("libp2p:websockets"),this.logger=o.logger,this.components=o,this.init=tt,o.metrics!=null&&(this.metrics={dialerEvents:o.metrics.registerCounterGroup("libp2p_websockets_dialer_events_total",{label:"event",help:"Total count of WebSockets dialer events by type"})})}async dial(o,tt){var it;this.log("dialing %s",o),tt=tt??{};const rt=await this._connect(o,tt),nt=socketToMaConn(rt,o,{logger:this.logger,metrics:(it=this.metrics)==null?void 0:it.dialerEvents});this.log("new outbound connection %s",nt.remoteAddr);const ot=await tt.upgrader.upgradeOutbound(nt,tt);return this.log("outbound connection %s upgraded",nt.remoteAddr),ot}async _connect(o,tt){var it,st,at,ct,lt;(it=tt==null?void 0:tt.signal)==null||it.throwIfAborted();const rt=o.toOptions();this.log("dialing %s:%s",rt.host,rt.port);const nt=pDefer(),ot=connect(multiaddrToUri(o),this.init);ot.socket.addEventListener("error",()=>{var ht;const dt=new ConnectionFailedError(`Could not connect to ${o.toString()}`);this.log.error("connection error:",dt),(ht=this.metrics)==null||ht.dialerEvents.increment({error:!0}),nt.reject(dt)});try{(st=tt.onProgress)==null||st.call(tt,new CustomProgressEvent("websockets:open-connection")),await raceSignal(Promise.race([ot.connected(),nt.promise]),tt.signal)}catch(dt){throw((at=tt.signal)==null?void 0:at.aborted)===!0&&((ct=this.metrics)==null||ct.dialerEvents.increment({abort:!0})),ot.close().catch(ht=>{this.log.error("error closing raw socket",ht)}),dt}return this.log("connected %s",o),(lt=this.metrics)==null||lt.dialerEvents.increment({connect:!0}),ot}createListener(o){return createListener({logger:this.logger,metrics:this.components.metrics},{...this.init,...o})}listenFilter(o){var tt,rt;return o=Array.isArray(o)?o:[o],((tt=this.init)==null?void 0:tt.filter)!=null?(rt=this.init)==null?void 0:rt.filter(o):isBrowser||isWebWorker?wss(o):all$1(o)}dialFilter(o){return this.listenFilter(o)}}function webSockets(et={}){return o=>new WebSockets(o,et)}const connectionSymbol=Symbol.for("@libp2p/connection"),contentRoutingSymbol=Symbol.for("@libp2p/content-routing"),peerDiscoverySymbol=Symbol.for("@libp2p/peer-discovery"),peerIdSymbol$1=Symbol.for("@libp2p/peer-id");function isPeerId$1(et){return!!(et!=null&&et[peerIdSymbol$1])}const peerRoutingSymbol=Symbol.for("@libp2p/peer-routing"),KEEP_ALIVE="keep-alive";var FaultTolerance;(function(et){et[et.FATAL_ALL=0]="FATAL_ALL",et[et.NO_FATAL=1]="NO_FATAL"})(FaultTolerance||(FaultTolerance={}));var Cs;let AbortError$4=(Cs=class extends Error{constructor(o="The operation was aborted"){super(o),this.name="AbortError"}},wt(Cs,"name","AbortError"),Cs);var Ss;let InvalidParametersError$1=(Ss=class extends Error{constructor(o="Invalid parameters"){super(o),this.name="InvalidParametersError"}},wt(Ss,"name","InvalidParametersError"),Ss);class ConnectionClosingError extends Error{constructor(o="The connection is closing"){super(o),this.name="ConnectionClosingError"}}wt(ConnectionClosingError,"name","ConnectionClosingError");class ConnectionClosedError extends Error{constructor(o="The connection is closed"){super(o),this.name="ConnectionClosedError"}}wt(ConnectionClosedError,"name","ConnectionClosedError");var As;let NotFoundError$1=(As=class extends Error{constructor(o="Not found"){super(o),this.name="NotFoundError"}},wt(As,"name","NotFoundError"),As);class InvalidPeerIdError extends Error{constructor(o="Invalid PeerID"){super(o),this.name="InvalidPeerIdError"}}wt(InvalidPeerIdError,"name","InvalidPeerIdError");class InvalidMultiaddrError extends Error{constructor(o="Invalid multiaddr"){super(o),this.name="InvalidMultiaddrError"}}wt(InvalidMultiaddrError,"name","InvalidMultiaddrError");var $s;let TimeoutError$2=($s=class extends Error{constructor(o="Timed out"){super(o),this.name="TimeoutError"}},wt($s,"name","TimeoutError"),$s);class NotStartedError extends Error{constructor(o="Not started"){super(o),this.name="NotStartedError"}}wt(NotStartedError,"name","NotStartedError");class DialError extends Error{constructor(o="Dial error"){super(o),this.name="DialError"}}wt(DialError,"name","DialError");class LimitedConnectionError extends Error{constructor(o="Limited connection"){super(o),this.name="LimitedConnectionError"}}wt(LimitedConnectionError,"name","LimitedConnectionError");class TooManyInboundProtocolStreamsError extends Error{constructor(o="Too many inbound protocol streams"){super(o),this.name="TooManyInboundProtocolStreamsError"}}wt(TooManyInboundProtocolStreamsError,"name","TooManyInboundProtocolStreamsError");class TooManyOutboundProtocolStreamsError extends Error{constructor(o="Too many outbound protocol streams"){super(o),this.name="TooManyOutboundProtocolStreamsError"}}wt(TooManyOutboundProtocolStreamsError,"name","TooManyOutboundProtocolStreamsError");function setMaxListeners$1(){}const setMaxListeners=(et,...o)=>{try{[...o]}catch{}};var en;class TypedEventEmitter extends EventTarget{constructor(){super();fr(this,en,new Map);setMaxListeners(1/0,this)}listenerCount(tt){const rt=Ot(this,en).get(tt);return rt==null?0:rt.length}addEventListener(tt,rt,nt){super.addEventListener(tt,rt,nt);let ot=Ot(this,en).get(tt);ot==null&&(ot=[],Ot(this,en).set(tt,ot)),ot.push({callback:rt,once:(nt!==!0&&nt!==!1&&(nt==null?void 0:nt.once))??!1})}removeEventListener(tt,rt,nt){super.removeEventListener(tt.toString(),rt??null,nt);let ot=Ot(this,en).get(tt);ot!=null&&(ot=ot.filter(({callback:it})=>it!==rt),Ot(this,en).set(tt,ot))}dispatchEvent(tt){const rt=super.dispatchEvent(tt);let nt=Ot(this,en).get(tt.type);return nt==null||(nt=nt.filter(({once:ot})=>!ot),Ot(this,en).set(tt.type,nt)),rt}safeDispatchEvent(tt,rt={}){return this.dispatchEvent(new CustomEvent(tt,rt))}}en=new WeakMap;function isStartable(et){return et!=null&&typeof et.start=="function"&&typeof et.stop=="function"}async function start(...et){const o=[];for(const tt of et)isStartable(tt)&&o.push(tt);await Promise.all(o.map(async tt=>{tt.beforeStart!=null&&await tt.beforeStart()})),await Promise.all(o.map(async tt=>{await tt.start()})),await Promise.all(o.map(async tt=>{tt.afterStart!=null&&await tt.afterStart()}))}async function stop(...et){const o=[];for(const tt of et)isStartable(tt)&&o.push(tt);await Promise.all(o.map(async tt=>{tt.beforeStop!=null&&await tt.beforeStop()})),await Promise.all(o.map(async tt=>{await tt.stop()})),await Promise.all(o.map(async tt=>{tt.afterStop!=null&&await tt.afterStop()}))}const serviceCapabilities=Symbol.for("@libp2p/service-capabilities"),serviceDependencies=Symbol.for("@libp2p/service-dependencies");let TimeoutError$1=class extends Error{constructor(o){super(o),this.name="TimeoutError"}},AbortError$3=class extends Error{constructor(o){super(),this.name="AbortError",this.message=o}};const getDOMException=et=>globalThis.DOMException===void 0?new AbortError$3(et):new DOMException(et),getAbortedReason=et=>{const o=et.reason===void 0?getDOMException("This operation was aborted."):et.reason;return o instanceof Error?o:getDOMException(o)};function pTimeout(et,o){const{milliseconds:tt,fallback:rt,message:nt,customTimers:ot={setTimeout,clearTimeout}}=o;let it;const at=new Promise((ct,lt)=>{if(typeof tt!="number"||Math.sign(tt)!==1)throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${tt}\``);if(o.signal){const{signal:ht}=o;ht.aborted&<(getAbortedReason(ht));const mt=()=>{lt(getAbortedReason(ht))};ht.addEventListener("abort",mt,{once:!0}),et.finally(()=>{ht.removeEventListener("abort",mt)})}if(tt===Number.POSITIVE_INFINITY){et.then(ct,lt);return}const dt=new TimeoutError$1;it=ot.setTimeout.call(void 0,()=>{if(rt){try{ct(rt())}catch(ht){lt(ht)}return}typeof et.cancel=="function"&&et.cancel(),nt===!1?ct():nt instanceof Error?lt(nt):(dt.message=nt??`Promise timed out after ${tt} milliseconds`,lt(dt))},tt),(async()=>{try{ct(await et)}catch(ht){lt(ht)}})()}).finally(()=>{at.clear()});return at.clear=()=>{ot.clearTimeout.call(void 0,it),it=void 0},at}function lowerBound(et,o,tt){let rt=0,nt=et.length;for(;nt>0;){const ot=Math.trunc(nt/2);let it=rt+ot;tt(et[it],o)<=0?(rt=++it,nt-=ot+1):nt=ot}return rt}var tn,Ml;let PriorityQueue$1=(Ml=class{constructor(){fr(this,tn,[])}enqueue(o,tt){tt={priority:0,...tt};const rt={priority:tt.priority,run:o};if(this.size&&Ot(this,tn)[this.size-1].priority>=tt.priority){Ot(this,tn).push(rt);return}const nt=lowerBound(Ot(this,tn),rt,(ot,it)=>it.priority-ot.priority);Ot(this,tn).splice(nt,0,rt)}dequeue(){const o=Ot(this,tn).shift();return o==null?void 0:o.run}filter(o){return Ot(this,tn).filter(tt=>tt.priority===o.priority).map(tt=>tt.run)}get size(){return Ot(this,tn).length}},tn=new WeakMap,Ml);var Zn,Jn,En,ho,eo,fo,Hr,to,Ur,po,Wr,ro,an,mo,kr,ru,nu,ou,iu,su,es,Ms,Bs,ts,au,rs;class PQueue extends EventEmitter$1{constructor(tt){var rt,nt;super();fr(this,kr);fr(this,Zn);fr(this,Jn);fr(this,En,0);fr(this,ho);fr(this,eo);fr(this,fo,0);fr(this,Hr);fr(this,to);fr(this,Ur);fr(this,po);fr(this,Wr,0);fr(this,ro);fr(this,an);fr(this,mo);wt(this,"timeout");if(tt={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:PriorityQueue$1,...tt},!(typeof tt.intervalCap=="number"&&tt.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${((rt=tt.intervalCap)==null?void 0:rt.toString())??""}\` (${typeof tt.intervalCap})`);if(tt.interval===void 0||!(Number.isFinite(tt.interval)&&tt.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${((nt=tt.interval)==null?void 0:nt.toString())??""}\` (${typeof tt.interval})`);lr(this,Zn,tt.carryoverConcurrencyCount),lr(this,Jn,tt.intervalCap===Number.POSITIVE_INFINITY||tt.interval===0),lr(this,ho,tt.intervalCap),lr(this,eo,tt.interval),lr(this,Ur,new tt.queueClass),lr(this,po,tt.queueClass),this.concurrency=tt.concurrency,this.timeout=tt.timeout,lr(this,mo,tt.throwOnTimeout===!0),lr(this,an,tt.autoStart===!1)}get concurrency(){return Ot(this,ro)}set concurrency(tt){if(!(typeof tt=="number"&&tt>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${tt}\` (${typeof tt})`);lr(this,ro,tt),mr(this,kr,ts).call(this)}async add(tt,rt={}){return rt={timeout:this.timeout,throwOnTimeout:Ot(this,mo),...rt},new Promise((nt,ot)=>{Ot(this,Ur).enqueue(async()=>{var it;Cn(this,Wr)._++,Cn(this,En)._++;try{(it=rt.signal)==null||it.throwIfAborted();let st=tt({signal:rt.signal});rt.timeout&&(st=pTimeout(Promise.resolve(st),{milliseconds:rt.timeout})),rt.signal&&(st=Promise.race([st,mr(this,kr,au).call(this,rt.signal)]));const at=await st;nt(at),this.emit("completed",at)}catch(st){if(st instanceof TimeoutError$1&&!rt.throwOnTimeout){nt();return}ot(st),this.emit("error",st)}finally{mr(this,kr,ou).call(this)}},rt),this.emit("add"),mr(this,kr,es).call(this)})}async addAll(tt,rt){return Promise.all(tt.map(async nt=>this.add(nt,rt)))}start(){return Ot(this,an)?(lr(this,an,!1),mr(this,kr,ts).call(this),this):this}pause(){lr(this,an,!0)}clear(){lr(this,Ur,new(Ot(this,po)))}async onEmpty(){Ot(this,Ur).size!==0&&await mr(this,kr,rs).call(this,"empty")}async onSizeLessThan(tt){Ot(this,Ur).sizeOt(this,Ur).size{mr(this,kr,iu).call(this)},rt)),!0}return!1},es=function(){if(Ot(this,Ur).size===0)return Ot(this,Hr)&&clearInterval(Ot(this,Hr)),lr(this,Hr,void 0),this.emit("empty"),Ot(this,Wr)===0&&this.emit("idle"),!1;if(!Ot(this,an)){const tt=!Ot(this,kr,su);if(Ot(this,kr,ru)&&Ot(this,kr,nu)){const rt=Ot(this,Ur).dequeue();return rt?(this.emit("active"),rt(),tt&&mr(this,kr,Ms).call(this),!0):!1}}return!1},Ms=function(){Ot(this,Jn)||Ot(this,Hr)!==void 0||(lr(this,Hr,setInterval(()=>{mr(this,kr,Bs).call(this)},Ot(this,eo))),lr(this,fo,Date.now()+Ot(this,eo)))},Bs=function(){Ot(this,En)===0&&Ot(this,Wr)===0&&Ot(this,Hr)&&(clearInterval(Ot(this,Hr)),lr(this,Hr,void 0)),lr(this,En,Ot(this,Zn)?Ot(this,Wr):0),mr(this,kr,ts).call(this)},ts=function(){for(;mr(this,kr,es).call(this););},au=async function(tt){return new Promise((rt,nt)=>{tt.addEventListener("abort",()=>{nt(tt.reason)},{once:!0})})},rs=async function(tt,rt){return new Promise(nt=>{const ot=()=>{rt&&!rt()||(this.off(tt,ot),nt())};this.on(tt,ot)})};function getTypes(et){const o=[RecordType.A];return et==null?o:Array.isArray(et)?et.length===0?o:et:[et]}function coerce$9(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$c(et){return new TextEncoder().encode(et)}function toString$g(et){return new TextDecoder().decode(et)}function base$9(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$a=base$9,_brrp__multiformats_scope_baseX$9=src$a;let Encoder$9=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$9=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$9(this,o)}},ComposedDecoder$9=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$9(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$9(et,o){return new ComposedDecoder$9({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$9=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$9(o,tt,rt),this.decoder=new Decoder$9(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$a({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$9(et,o,tt,rt)}function baseX$9({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$9(tt,et);return from$a({prefix:o,name:et,encode:rt,decode:ot=>coerce$9(nt(ot))})}function decode$q(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$l(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$6=alphabet$6.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$k(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$6[tt],o),"")}function decode$p(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$6[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$c=from$a({prefix:"🚀",name:"base256emoji",encode:encode$k,decode:decode$p}),base256emoji$d=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$c},Symbol.toStringTag,{value:"Module"})),base32$g=rfc4648$8({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$6=rfc4648$8({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$6=rfc4648$8({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$6=rfc4648$8({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$6=rfc4648$8({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$6=rfc4648$8({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$6=rfc4648$8({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$6=rfc4648$8({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$6=rfc4648$8({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$h=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$g,base32hex:base32hex$6,base32hexpad:base32hexpad$6,base32hexpadupper:base32hexpadupper$6,base32hexupper:base32hexupper$6,base32pad:base32pad$6,base32padupper:base32padupper$6,base32upper:base32upper$6,base32z:base32z$6},Symbol.toStringTag,{value:"Module"})),base36$d=baseX$9({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$6=baseX$9({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$e=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$d,base36upper:base36upper$6},Symbol.toStringTag,{value:"Module"})),base58btc$9=baseX$9({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$6=baseX$9({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$6=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$9,base58flickr:base58flickr$6},Symbol.toStringTag,{value:"Module"})),base64$f=rfc4648$8({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$6=rfc4648$8({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$6=rfc4648$8({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$6=rfc4648$8({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$g=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$f,base64pad:base64pad$6,base64url:base64url$6,base64urlpad:base64urlpad$6},Symbol.toStringTag,{value:"Module"})),base8$c=rfc4648$8({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$d=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$c},Symbol.toStringTag,{value:"Module"})),identity$6=from$a({prefix:"\0",name:"identity",encode:et=>toString$g(et),decode:et=>fromString$c(et)}),identityBase$6=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$6},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$6={...identityBase$6,...base2$d,...base8$d,...base10$d,...base16$d,...base32$h,...base36$e,...base58$6,...base64$g,...base256emoji$d};function allocUnsafe$5(et=0){return new Uint8Array(et)}function createCodec$6(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$9=createCodec$6("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$6=createCodec$6("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$5(et.length);for(let tt=0;tt({name:o.name,type:RecordType[o.type]})),Answer:(et.Answer??et.answers??[]).map(o=>({name:o.name,type:RecordType[o.type],TTL:o.TTL??o.ttl??DEFAULT_TTL,data:o.data instanceof Uint8Array?toString$f(o.data):o.data}))}}const DEFAULT_QUERY_CONCURRENCY=4;function dnsJsonOverHttps(et,o={}){const tt=new PQueue({concurrency:o.queryConcurrency??DEFAULT_QUERY_CONCURRENCY});return async(rt,nt={})=>{var st;const ot=new URLSearchParams;ot.set("name",rt),getTypes(nt.types).forEach(at=>{ot.append("type",RecordType[at])}),(st=nt.onProgress)==null||st.call(nt,new CustomProgressEvent("dns:query",{detail:rt}));const it=await tt.add(async()=>{var lt;const at=await fetch(`${et}?${ot}`,{headers:{accept:"application/dns-json"},signal:nt==null?void 0:nt.signal});if(at.status!==200)throw new Error(`Unexpected HTTP status: ${at.status} - ${at.statusText}`);const ct=toDNSResponse(await at.json());return(lt=nt.onProgress)==null||lt.call(nt,new CustomProgressEvent("dns:response",{detail:ct})),ct},{signal:nt.signal});if(it==null)throw new Error("No DNS response received");return it}}function defaultResolver(){return[dnsJsonOverHttps("https://cloudflare-dns.com/dns-query"),dnsJsonOverHttps("https://dns.google/resolve")]}var hashlru=function(et){if(!et)throw Error("hashlru must have a max value, of type number, greater than 0");var o=0,tt=Object.create(null),rt=Object.create(null);function nt(ot,it){tt[ot]=it,o++,o>=et&&(o=0,rt=tt,tt=Object.create(null))}return{has:function(ot){return tt[ot]!==void 0||rt[ot]!==void 0},remove:function(ot){tt[ot]!==void 0&&(tt[ot]=void 0),rt[ot]!==void 0&&(rt[ot]=void 0)},get:function(ot){var it=tt[ot];if(it!==void 0)return it;if((it=rt[ot])!==void 0)return nt(ot,it),it},set:function(ot,it){tt[ot]!==void 0?tt[ot]=it:nt(ot,it)},clear:function(){tt=Object.create(null),rt=Object.create(null)}}};const hashlru$1=getDefaultExportFromCjs(hashlru);class CachedAnswers{constructor(o){wt(this,"lru");this.lru=hashlru$1(o)}get(o,tt){let rt=!0;const nt=[];for(const ot of tt){const it=this.getAnswers(o,ot);if(it.length===0){rt=!1;break}nt.push(...it)}if(rt)return toDNSResponse({answers:nt})}getAnswers(o,tt){const rt=`${o.toLowerCase()}-${tt}`,nt=this.lru.get(rt);if(nt!=null){const ot=nt.filter(it=>it.expires>Date.now()).map(({expires:it,value:st})=>({...st,TTL:Math.round((it-Date.now())/1e3),type:RecordType[st.type]}));return ot.length===0&&this.lru.remove(rt),ot}return[]}add(o,tt){const rt=`${o.toLowerCase()}-${tt.type}`,nt=this.lru.get(rt)??[];nt.push({expires:Date.now()+(tt.TTL??DEFAULT_TTL)*1e3,value:tt}),this.lru.set(rt,nt)}remove(o,tt){const rt=`${o.toLowerCase()}-${tt}`;this.lru.remove(rt)}clear(){this.lru.clear()}}function cache$1(et){return new CachedAnswers(et)}const DEFAULT_ANSWER_CACHE_SIZE=1e3;class DNS{constructor(o){wt(this,"resolvers");wt(this,"cache");this.resolvers={},this.cache=cache$1(o.cacheSize??DEFAULT_ANSWER_CACHE_SIZE),Object.entries(o.resolvers??{}).forEach(([tt,rt])=>{Array.isArray(rt)||(rt=[rt]),tt.endsWith(".")||(tt=`${tt}.`),this.resolvers[tt]=rt}),this.resolvers["."]==null&&(this.resolvers["."]=defaultResolver())}async query(o,tt={}){var at,ct,lt;const rt=getTypes(tt.types),nt=tt.cached!==!1?this.cache.get(o,rt):void 0;if(nt!=null)return(at=tt.onProgress)==null||at.call(tt,new CustomProgressEvent("dns:cache",{detail:nt})),nt;const ot=`${o.split(".").pop()}.`,it=(this.resolvers[ot]??this.resolvers["."]).sort(()=>Math.random()>.5?-1:1),st=[];for(const dt of it){if(((ct=tt.signal)==null?void 0:ct.aborted)===!0)break;try{const ht=await dt(o,{...tt,types:rt});for(const mt of ht.Answer)this.cache.add(o,mt);return ht}catch(ht){st.push(ht),(lt=tt.onProgress)==null||lt.call(tt,new CustomProgressEvent("dns:error",{detail:ht}))}}throw st.length===1?st[0]:new AggregateError(st,`DNS lookup of ${o} ${rt} failed`)}}var RecordType;(function(et){et[et.A=1]="A",et[et.CNAME=5]="CNAME",et[et.TXT=16]="TXT",et[et.AAAA=28]="AAAA"})(RecordType||(RecordType={}));function dns(et={}){return new DNS(et)}const MAX_RECURSIVE_DEPTH=32,{code:dnsaddrCode}=getProtocol("dnsaddr");class RecursionLimitError extends Error{constructor(o="Max recursive depth reached"){super(o),this.name="RecursionLimitError"}}const dnsaddrResolver=async function(o,tt={}){const rt=tt.maxRecursiveDepth??MAX_RECURSIVE_DEPTH;if(rt===0)throw new RecursionLimitError("Max recursive depth reached");const[,nt]=o.stringTuples().find(([ct])=>ct===dnsaddrCode)??[],it=await((tt==null?void 0:tt.dns)??dns()).query(`_dnsaddr.${nt}`,{signal:tt==null?void 0:tt.signal,types:[RecordType.TXT]}),st=o.getPeerId(),at=[];for(const ct of it.Answer){const lt=ct.data.replace(/["']/g,"").trim().split("=")[1];if(lt==null||st!=null&&!lt.includes(st))continue;const dt=multiaddr(lt);if(lt.startsWith("/dnsaddr")){const ht=await dt.resolve({...tt,maxRecursiveDepth:rt-1});at.push(...ht.map(mt=>mt.toString()))}else at.push(dt.toString())}return at};var isPlainObj=et=>{if(Object.prototype.toString.call(et)!=="[object Object]")return!1;const o=Object.getPrototypeOf(et);return o===null||o===Object.prototype};const isOptionObject=isPlainObj,{hasOwnProperty:hasOwnProperty$1}=Object.prototype,{propertyIsEnumerable}=Object,defineProperty$1=(et,o,tt)=>Object.defineProperty(et,o,{value:tt,writable:!0,enumerable:!0,configurable:!0}),globalThis$1=commonjsGlobal,defaultMergeOptions={concatArrays:!1,ignoreUndefined:!1},getEnumerableOwnPropertyKeys=et=>{const o=[];for(const tt in et)hasOwnProperty$1.call(et,tt)&&o.push(tt);if(Object.getOwnPropertySymbols){const tt=Object.getOwnPropertySymbols(et);for(const rt of tt)propertyIsEnumerable.call(et,rt)&&o.push(rt)}return o};function clone(et){return Array.isArray(et)?cloneArray(et):isOptionObject(et)?cloneOptionObject(et):et}function cloneArray(et){const o=et.slice(0,0);return getEnumerableOwnPropertyKeys(et).forEach(tt=>{defineProperty$1(o,tt,clone(et[tt]))}),o}function cloneOptionObject(et){const o=Object.getPrototypeOf(et)===null?Object.create(null):{};return getEnumerableOwnPropertyKeys(et).forEach(tt=>{defineProperty$1(o,tt,clone(et[tt]))}),o}const mergeKeys=(et,o,tt,rt)=>(tt.forEach(nt=>{typeof o[nt]>"u"&&rt.ignoreUndefined||(nt in et&&et[nt]!==Object.getPrototypeOf(et)?defineProperty$1(et,nt,merge$1(et[nt],o[nt],rt)):defineProperty$1(et,nt,clone(o[nt])))}),et),concatArrays=(et,o,tt)=>{let rt=et.slice(0,0),nt=0;return[et,o].forEach(ot=>{const it=[];for(let st=0;st!it.includes(st)),tt)}),rt};function merge$1(et,o,tt){return tt.concatArrays&&Array.isArray(et)&&Array.isArray(o)?concatArrays(et,o,tt):!isOptionObject(o)||!isOptionObject(et)?clone(o):mergeKeys(et,o,getEnumerableOwnPropertyKeys(o),tt)}var mergeOptions=function(...et){const o=merge$1(clone(defaultMergeOptions),this!==globalThis$1&&this||{},defaultMergeOptions);let tt={_:{}};for(const rt of et)if(rt!==void 0){if(!isOptionObject(rt))throw new TypeError("`"+rt+"` is not an Option Object");tt=merge$1(tt,{_:rt},o)}return tt._};const mergeOptions$1=getDefaultExportFromCjs(mergeOptions);var define_globalThis_process_env_default$1={};const DefaultConfig={addresses:{listen:[],announce:[],noAnnounce:[],announceFilter:et=>et},connectionManager:{resolvers:{dnsaddr:dnsaddrResolver}},transportManager:{faultTolerance:FaultTolerance.FATAL_ALL}};async function validateConfig(et){const o=mergeOptions$1(DefaultConfig,et);if(o.connectionProtector===null&&(define_globalThis_process_env_default$1==null?void 0:define_globalThis_process_env_default$1.LIBP2P_FORCE_PNET)!=null)throw new InvalidParametersError$1("Private network is enforced, but no protector was provided");return o}function coerce$8(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function base$8(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$9=base$8,_brrp__multiformats_scope_baseX$8=src$9;let Encoder$8=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$8=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$8(this,o)}},ComposedDecoder$8=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$8(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$8(et,o){return new ComposedDecoder$8({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$8=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$8(o,tt,rt),this.decoder=new Decoder$8(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$9({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$8(et,o,tt,rt)}function baseX$8({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$8(tt,et);return from$9({prefix:o,name:et,encode:rt,decode:ot=>coerce$8(nt(ot))})}function decode$o(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$j(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<0)return parse$3(et);if(typeof et=="number"&&isFinite(et))return o!=null&&o.long?fmtLong(et):fmtShort(et);throw new Error("Value is not a string or number.")}catch(tt){const rt=isError$1(tt)?`${tt.message}. value=${JSON.stringify(et)}`:"An unknown error has occured.";throw new Error(rt)}}function parse$3(et){if(et=String(et),et.length>100)throw new Error("Value exceeds the maximum length of 100 characters.");const o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(et);if(!o)return NaN;const tt=parseFloat(o[1]),rt=(o[2]||"ms").toLowerCase();switch(rt){case"years":case"year":case"yrs":case"yr":case"y":return tt*y;case"weeks":case"week":case"w":return tt*w;case"days":case"day":case"d":return tt*d;case"hours":case"hour":case"hrs":case"hr":case"h":return tt*h;case"minutes":case"minute":case"mins":case"min":case"m":return tt*m;case"seconds":case"second":case"secs":case"sec":case"s":return tt*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return tt;default:throw new Error(`The unit ${rt} was matched, but no matching case exists.`)}}function fmtShort(et){const o=Math.abs(et);return o>=d?`${Math.round(et/d)}d`:o>=h?`${Math.round(et/h)}h`:o>=m?`${Math.round(et/m)}m`:o>=s?`${Math.round(et/s)}s`:`${et}ms`}function fmtLong(et){const o=Math.abs(et);return o>=d?plural(et,o,d,"day"):o>=h?plural(et,o,h,"hour"):o>=m?plural(et,o,m,"minute"):o>=s?plural(et,o,s,"second"):`${et} ms`}function plural(et,o,tt,rt){const nt=o>=tt*1.5;return`${Math.round(et/tt)} ${rt}${nt?"s":""}`}function isError$1(et){return typeof et=="object"&&et!==null&&"message"in et}function setup(et){tt.debug=tt,tt.default=tt,tt.coerce=at,tt.disable=ot,tt.enable=nt,tt.enabled=it,tt.humanize=ms,tt.destroy=ct,Object.keys(et).forEach(lt=>{tt[lt]=et[lt]}),tt.names=[],tt.skips=[],tt.formatters={};function o(lt){let dt=0;for(let ht=0;ht{if(Ct==="%%")return"%";vt++;const At=tt.formatters[St];if(typeof At=="function"){const kt=yt[vt];Ct=At.call(gt,kt),yt.splice(vt,1),vt--}return Ct}),tt.formatArgs.call(gt,yt),(gt.log||tt.log).apply(gt,yt)}return pt.namespace=lt,pt.useColors=tt.useColors(),pt.color=tt.selectColor(lt),pt.extend=rt,pt.destroy=tt.destroy,Object.defineProperty(pt,"enabled",{enumerable:!0,configurable:!1,get:()=>ht!==null?ht:(mt!==tt.namespaces&&(mt=tt.namespaces,ft=tt.enabled(lt)),ft),set:yt=>{ht=yt}}),typeof tt.init=="function"&&tt.init(pt),pt}function rt(lt,dt){const ht=tt(this.namespace+(typeof dt>"u"?":":dt)+lt);return ht.log=this.log,ht}function nt(lt){tt.save(lt),tt.namespaces=lt,tt.names=[],tt.skips=[];let dt;const ht=(typeof lt=="string"?lt:"").split(/[\s,]+/),mt=ht.length;for(dt=0;dt"-"+dt)].join(",");return tt.enable(""),lt}function it(lt){if(lt[lt.length-1]==="*")return!0;let dt,ht;for(dt=0,ht=tt.skips.length;dt=31||typeof navigator<"u"&&((nt=navigator.userAgent)==null?void 0:nt.toLowerCase().match(/applewebkit\/(\d+)/))}function formatArgs(et){if(et[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+et[0]+(this.useColors?"%c ":" ")+"+"+ms(this.diff),!this.useColors)return;const o="color: "+this.color;et.splice(1,0,o,"color: inherit");let tt=0,rt=0;et[0].replace(/%[a-zA-Z%]/g,nt=>{nt!=="%%"&&(tt++,nt==="%c"&&(rt=tt))}),et.splice(rt,0,o)}const log$a=console.debug??console.log??(()=>{});function save(et){try{et?storage==null||storage.setItem("debug",et):storage==null||storage.removeItem("debug")}catch{}}function load$1(){let et;try{et=storage==null?void 0:storage.getItem("debug")}catch{}return!et&&typeof globalThis.process<"u"&&"env"in globalThis.process&&(et=define_globalThis_process_env_default.DEBUG),et}function localstorage(){try{return localStorage}catch{}}function setupFormatters(et){et.j=function(o){try{return JSON.stringify(o)}catch(tt){return"[UnexpectedJSONParseError]: "+tt.message}}}const weald=setup({formatArgs,save,load:load$1,useColors,setupFormatters,colors,storage,log:log$a});weald.formatters.b=et=>et==null?"undefined":base58btc$8.baseEncode(et);weald.formatters.t=et=>et==null?"undefined":base32$f.baseEncode(et);weald.formatters.m=et=>et==null?"undefined":base64$e.baseEncode(et);weald.formatters.p=et=>et==null?"undefined":et.toString();weald.formatters.c=et=>et==null?"undefined":et.toString();weald.formatters.k=et=>et==null?"undefined":et.toString();weald.formatters.a=et=>et==null?"undefined":et.toString();weald.formatters.e=et=>et==null?"undefined":notEmpty(et.stack)??notEmpty(et.message)??et.toString();function createDisabledLogger(et){const o=()=>{};return o.enabled=!1,o.color="",o.diff=0,o.log=()=>{},o.namespace=et,o.destroy=()=>!0,o.extend=()=>o,o}function defaultLogger(){return{forComponent(et){return logger$2(et)}}}function logger$2(et){let o=createDisabledLogger(`${et}:trace`);return weald.enabled(`${et}:trace`)&&weald.names.map(tt=>tt.toString()).find(tt=>tt.includes(":trace"))!=null&&(o=weald(`${et}:trace`)),Object.assign(weald(et),{error:weald(`${et}:error`),trace:o})}function notEmpty(et){if(et!=null&&(et=et.trim(),et.length!==0))return et}function coerce$7(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function base$7(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$8=base$7,_brrp__multiformats_scope_baseX$7=src$8;let Encoder$7=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$7=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$7(this,o)}},ComposedDecoder$7=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$7(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$7(et,o){return new ComposedDecoder$7({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$7=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$7(o,tt,rt),this.decoder=new Decoder$7(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$8({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$7(et,o,tt,rt)}function baseX$7({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$7(tt,et);return from$8({prefix:o,name:et,encode:rt,decode:ot=>coerce$7(nt(ot))})}const base58btc$7=baseX$7({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"});baseX$7({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var encode_1$1=encode$i,MSB$2=128,REST$2=127,MSBALL$1=~REST$2,INT$1=Math.pow(2,31);function encode$i(et,o,tt){o=o||[],tt=tt||0;for(var rt=tt;et>=INT$1;)o[tt++]=et&255|MSB$2,et/=128;for(;et&MSBALL$1;)o[tt++]=et&255|MSB$2,et>>>=7;return o[tt]=et|0,encode$i.bytes=tt-rt+1,o}var decode$n=read$2,MSB$1$1=128,REST$1$1=127;function read$2(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$2.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1$1)<=MSB$1$1);return read$2.bytes=ot-rt,tt}var N1$1=Math.pow(2,7),N2$1=Math.pow(2,14),N3$1=Math.pow(2,21),N4$1=Math.pow(2,28),N5$1=Math.pow(2,35),N6$1=Math.pow(2,42),N7$1=Math.pow(2,49),N8$1=Math.pow(2,56),N9$1=Math.pow(2,63),length$1=function(et){return ettt,next:()=>{const rt=et.next(),nt=rt.value;return rt.done===!0||nt==null?{done:!0,value:void 0}:{done:!1,value:o(nt)}}};return tt}function peerIdFromString(et){const o=decode$l(base58btc$7.decode(`z${et}`));return peerIdFromMultihash(o)}class PeerMap{constructor(o){wt(this,"map");if(this.map=new Map,o!=null)for(const[tt,rt]of o.entries())this.map.set(tt.toString(),{key:tt,value:rt})}[Symbol.iterator](){return this.entries()}clear(){this.map.clear()}delete(o){return this.map.delete(o.toString())}entries(){return mapIterable(this.map.entries(),o=>[o[1].key,o[1].value])}forEach(o){this.map.forEach((tt,rt)=>{o(tt.value,tt.key,this)})}get(o){var tt;return(tt=this.map.get(o.toString()))==null?void 0:tt.value}has(o){return this.map.has(o.toString())}set(o,tt){this.map.set(o.toString(),{key:o,value:tt})}keys(){return mapIterable(this.map.values(),o=>o.key)}values(){return mapIterable(this.map.values(),o=>o.value)}get size(){return this.map.size}}class PeerSet{constructor(o){wt(this,"set");if(this.set=new Set,o!=null)for(const tt of o)this.set.add(tt.toString())}get size(){return this.set.size}[Symbol.iterator](){return this.values()}add(o){this.set.add(o.toString())}clear(){this.set.clear()}delete(o){this.set.delete(o.toString())}entries(){return mapIterable(this.set.entries(),o=>{const tt=peerIdFromString(o[0]);return[tt,tt]})}forEach(o){this.set.forEach(tt=>{const rt=peerIdFromString(tt);o(rt,rt,this)})}has(o){return this.set.has(o.toString())}values(){return mapIterable(this.set.values(),o=>peerIdFromString(o))}intersection(o){const tt=new PeerSet;for(const rt of o)this.has(rt)&&tt.add(rt);return tt}difference(o){const tt=new PeerSet;for(const rt of this)o.has(rt)||tt.add(rt);return tt}union(o){const tt=new PeerSet;for(const rt of o)tt.add(rt);for(const rt of this)tt.add(rt);return tt}}var murmurHash3js={exports:{}};(function(et,o){(function(tt,rt){var nt={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function ot(pt){if(!Array.isArray(pt)&&!ArrayBuffer.isView(pt))return!1;for(var yt=0;yt255)return!1;return!0}function it(pt,yt){return(pt&65535)*yt+(((pt>>>16)*yt&65535)<<16)}function st(pt,yt){return pt<>>32-yt}function at(pt){return pt^=pt>>>16,pt=it(pt,2246822507),pt^=pt>>>13,pt=it(pt,3266489909),pt^=pt>>>16,pt}function ct(pt,yt){pt=[pt[0]>>>16,pt[0]&65535,pt[1]>>>16,pt[1]&65535],yt=[yt[0]>>>16,yt[0]&65535,yt[1]>>>16,yt[1]&65535];var gt=[0,0,0,0];return gt[3]+=pt[3]+yt[3],gt[2]+=gt[3]>>>16,gt[3]&=65535,gt[2]+=pt[2]+yt[2],gt[1]+=gt[2]>>>16,gt[2]&=65535,gt[1]+=pt[1]+yt[1],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[0]+=pt[0]+yt[0],gt[0]&=65535,[gt[0]<<16|gt[1],gt[2]<<16|gt[3]]}function lt(pt,yt){pt=[pt[0]>>>16,pt[0]&65535,pt[1]>>>16,pt[1]&65535],yt=[yt[0]>>>16,yt[0]&65535,yt[1]>>>16,yt[1]&65535];var gt=[0,0,0,0];return gt[3]+=pt[3]*yt[3],gt[2]+=gt[3]>>>16,gt[3]&=65535,gt[2]+=pt[2]*yt[3],gt[1]+=gt[2]>>>16,gt[2]&=65535,gt[2]+=pt[3]*yt[2],gt[1]+=gt[2]>>>16,gt[2]&=65535,gt[1]+=pt[1]*yt[3],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[1]+=pt[2]*yt[2],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[1]+=pt[3]*yt[1],gt[0]+=gt[1]>>>16,gt[1]&=65535,gt[0]+=pt[0]*yt[3]+pt[1]*yt[2]+pt[2]*yt[1]+pt[3]*yt[0],gt[0]&=65535,[gt[0]<<16|gt[1],gt[2]<<16|gt[3]]}function dt(pt,yt){return yt%=64,yt===32?[pt[1],pt[0]]:yt<32?[pt[0]<>>32-yt,pt[1]<>>32-yt]:(yt-=32,[pt[1]<>>32-yt,pt[0]<>>32-yt])}function ht(pt,yt){return yt%=64,yt===0?pt:yt<32?[pt[0]<>>32-yt,pt[1]<>>1]),pt=lt(pt,[4283543511,3981806797]),pt=mt(pt,[0,pt[0]>>>1]),pt=lt(pt,[3301882366,444984403]),pt=mt(pt,[0,pt[0]>>>1]),pt}nt.x86.hash32=function(pt,yt){if(nt.inputValidation&&!ot(pt))return rt;yt=yt||0;for(var gt=pt.length%4,bt=pt.length-gt,xt=yt,vt=0,Et=3432918353,Ct=461845907,St=0;St>>0},nt.x86.hash128=function(pt,yt){if(nt.inputValidation&&!ot(pt))return rt;yt=yt||0;for(var gt=pt.length%16,bt=pt.length-gt,xt=yt,vt=yt,Et=yt,Ct=yt,St=0,At=0,kt=0,It=0,Nt=597399067,Lt=2869860233,Mt=951274213,zt=2716044179,Ut=0;Ut>>0).toString(16)).slice(-8)+("00000000"+(vt>>>0).toString(16)).slice(-8)+("00000000"+(Et>>>0).toString(16)).slice(-8)+("00000000"+(Ct>>>0).toString(16)).slice(-8)},nt.x64.hash128=function(pt,yt){if(nt.inputValidation&&!ot(pt))return rt;yt=yt||0;for(var gt=pt.length%16,bt=pt.length-gt,xt=[0,yt],vt=[0,yt],Et=[0,0],Ct=[0,0],St=[2277735313,289559509],At=[1291169091,658871167],kt=0;kt>>0).toString(16)).slice(-8)+("00000000"+(xt[1]>>>0).toString(16)).slice(-8)+("00000000"+(vt[0]>>>0).toString(16)).slice(-8)+("00000000"+(vt[1]>>>0).toString(16)).slice(-8)},et.exports&&(o=et.exports=nt),o.murmurHash3=nt})()})(murmurHash3js,murmurHash3js.exports);function alloc$2(et=0){return new Uint8Array(et)}function allocUnsafe$4(et=0){return new Uint8Array(et)}function coerce$6(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$b(et){return new TextEncoder().encode(et)}function toString$e(et){return new TextDecoder().decode(et)}function base$6(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$7=base$6,_brrp__multiformats_scope_baseX$6=src$7;let Encoder$6=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$6=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$6(this,o)}},ComposedDecoder$6=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$6(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$6(et,o){return new ComposedDecoder$6({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$6=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$6(o,tt,rt),this.decoder=new Decoder$6(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$7({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$6(et,o,tt,rt)}function baseX$6({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$6(tt,et);return from$7({prefix:o,name:et,encode:rt,decode:ot=>coerce$6(nt(ot))})}function decode$k(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$h(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$5=alphabet$5.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$g(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$5[tt],o),"")}function decode$j(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$5[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$a=from$7({prefix:"🚀",name:"base256emoji",encode:encode$g,decode:decode$j}),base256emoji$b=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$a},Symbol.toStringTag,{value:"Module"})),base32$d=rfc4648$6({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$5=rfc4648$6({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$5=rfc4648$6({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$5=rfc4648$6({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$5=rfc4648$6({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$5=rfc4648$6({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$5=rfc4648$6({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$5=rfc4648$6({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$5=rfc4648$6({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$e=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$d,base32hex:base32hex$5,base32hexpad:base32hexpad$5,base32hexpadupper:base32hexpadupper$5,base32hexupper:base32hexupper$5,base32pad:base32pad$5,base32padupper:base32padupper$5,base32upper:base32upper$5,base32z:base32z$5},Symbol.toStringTag,{value:"Module"})),base36$b=baseX$6({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$5=baseX$6({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$c=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$b,base36upper:base36upper$5},Symbol.toStringTag,{value:"Module"})),base58btc$6=baseX$6({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$5=baseX$6({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$5=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$6,base58flickr:base58flickr$5},Symbol.toStringTag,{value:"Module"})),base64$c=rfc4648$6({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$5=rfc4648$6({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$5=rfc4648$6({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$5=rfc4648$6({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$d=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$c,base64pad:base64pad$5,base64url:base64url$5,base64urlpad:base64urlpad$5},Symbol.toStringTag,{value:"Module"})),base8$a=rfc4648$6({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$b=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$a},Symbol.toStringTag,{value:"Module"})),identity$5=from$7({prefix:"\0",name:"identity",encode:et=>toString$e(et),decode:et=>fromString$b(et)}),identityBase$5=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$5},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$5={...identityBase$5,...base2$b,...base8$b,...base10$b,...base16$b,...base32$e,...base36$c,...base58$5,...base64$d,...base256emoji$b};function createCodec$5(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$8=createCodec$5("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$5=createCodec$5("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$4(et.length);for(let tt=0;ttMAX_FINGERPRINT_SIZE)throw new TypeError("Invalid Fingerprint Size");const ot=tt.hashV(o,rt),it=alloc$2(nt);for(let st=0;sto.equals(tt))}add(o){if(!(o instanceof Fingerprint))throw new TypeError("Invalid Fingerprint");for(let tt=0;tto.equals(rt));return tt>-1?(this.contents[tt]=null,!0):!1}}const FNV_PRIMES={32:16777619n,64:1099511628211n,128:309485009821345068724781371n,256:374144419156711147060143317175368453031918731002211n,512:35835915874844867368919076489095108449946327955754392558399825615420669938882575126094039892345713852759n,1024:5016456510113118655434598811035278955030765345404790744303017523831112055108147451509157692220295382716162651878526895249385292291816524375083746691371804094271873160484737966720260389217684476157468082573n},FNV_OFFSETS={32:2166136261n,64:14695981039346656037n,128:144066263297769815596495629667062367629n,256:100029257958052580907070968620625704837092796014241193945225284501741471925557n,512:9659303129496669498009435400716310466090418745672637896108374329434462657994582932197716438449813051892206539805784495328239340083876191928701583869517785n,1024:14197795064947621068722070641403218320880622795441933960878474914617582723252296732303717722150864096521202355549365628174669108571814760471015076148029755969804077320157692458563003215304957150157403644460363550505412711285966361610267868082893823963790439336411086884584107735010676915n},cachedEncoder=new globalThis.TextEncoder;function fnv1aUint8Array(et,o){const tt=FNV_PRIMES[o];let rt=FNV_OFFSETS[o];for(let nt=0;nt0;){const it=cachedEncoder.encodeInto(ot,tt);ot=ot.slice(it.read);for(let st=0;stNumber(fnv1a$1(et,{size:32})),hashV:(et,o)=>numberToBuffer(fnv1a.hash(et,o))};function numberToBuffer(et){let o=et.toString(16);return o.length%2===1&&(o=`0${o}`),fromString$a(o,"base16")}const maxCuckooCount=500;class CuckooFilter{constructor(o){wt(this,"bucketSize");wt(this,"filterSize");wt(this,"fingerprintSize");wt(this,"buckets");wt(this,"count");wt(this,"hash");wt(this,"seed");this.filterSize=o.filterSize,this.bucketSize=o.bucketSize??4,this.fingerprintSize=o.fingerprintSize??2,this.count=0,this.buckets=[],this.hash=o.hash??fnv1a,this.seed=o.seed??getRandomInt(0,Math.pow(2,10))}add(o){typeof o=="string"&&(o=fromString$a(o));const tt=new Fingerprint(o,this.hash,this.seed,this.fingerprintSize),rt=this.hash.hash(o,this.seed)%this.filterSize,nt=(rt^tt.hash())%this.filterSize;if(this.buckets[rt]==null&&(this.buckets[rt]=new Bucket(this.bucketSize)),this.buckets[nt]==null&&(this.buckets[nt]=new Bucket(this.bucketSize)),this.buckets[rt].add(tt)||this.buckets[nt].add(tt))return this.count++,!0;const ot=[rt,nt];let it=ot[getRandomInt(0,ot.length-1)];this.buckets[it]==null&&(this.buckets[it]=new Bucket(this.bucketSize));for(let st=0;st.002?2:et>1e-5?4:8}function optimize(et,o=.001){const tt=calculateBucketSize(o),rt=MAX_LOAD[tt],nt=Math.round(et/rt),ot=Math.min(Math.ceil(Math.log2(1/o)+Math.log2(2*tt)),MAX_FINGERPRINT_SIZE);return{filterSize:nt,bucketSize:tt,fingerprintSize:ot}}class ScalableCuckooFilter{constructor(o){wt(this,"filterSize");wt(this,"bucketSize");wt(this,"fingerprintSize");wt(this,"scale");wt(this,"filterSeries");wt(this,"hash");wt(this,"seed");this.bucketSize=o.bucketSize??4,this.filterSize=o.filterSize??(1<<18)/this.bucketSize,this.fingerprintSize=o.fingerprintSize??2,this.scale=o.scale??2,this.hash=o.hash??fnv1a,this.seed=o.seed??getRandomInt(0,Math.pow(2,10)),this.filterSeries=[new CuckooFilter({filterSize:this.filterSize,bucketSize:this.bucketSize,fingerprintSize:this.fingerprintSize,hash:this.hash,seed:this.seed})]}add(o){if(typeof o=="string"&&(o=fromString$a(o)),this.has(o))return!0;let tt=this.filterSeries.find(rt=>rt.reliable);if(tt==null){const rt=this.filterSize*Math.pow(this.scale,this.filterSeries.length);tt=new CuckooFilter({filterSize:rt,bucketSize:this.bucketSize,fingerprintSize:this.fingerprintSize,hash:this.hash,seed:this.seed}),this.filterSeries.push(tt)}return tt.add(o)}has(o){typeof o=="string"&&(o=fromString$a(o));for(let tt=0;tto+tt.count,0)}}function createScalableCuckooFilter(et,o=.001,tt){return new ScalableCuckooFilter({...optimize(et,o)})}const peerIdSymbol=Symbol.for("@libp2p/peer-id");function isPeerId(et){return!!(et!=null&&et[peerIdSymbol])}class InvalidParametersError extends Error{constructor(o="Invalid parameters"){super(o),this.name="InvalidParametersError"}}wt(InvalidParametersError,"name","InvalidParametersError");const events={},observable=et=>{et.addEventListener("message",o=>{observable.dispatchEvent("message",et,o)}),et.port!=null&&et.port.addEventListener("message",o=>{observable.dispatchEvent("message",et,o)})};observable.addEventListener=(et,o)=>{events[et]==null&&(events[et]=[]),events[et].push(o)};observable.removeEventListener=(et,o)=>{events[et]!=null&&(events[et]=events[et].filter(tt=>tt===o))};observable.dispatchEvent=function(et,o,tt){events[et]!=null&&events[et].forEach(rt=>rt(o,tt))};const WORKER_REQUEST_READ_LOCK="lock:worker:request-read",WORKER_RELEASE_READ_LOCK="lock:worker:release-read",MASTER_GRANT_READ_LOCK="lock:master:grant-read",WORKER_REQUEST_WRITE_LOCK="lock:worker:request-write",WORKER_RELEASE_WRITE_LOCK="lock:worker:release-write",MASTER_GRANT_WRITE_LOCK="lock:master:grant-write",nanoid=(et=21)=>Math.random().toString().substring(2),handleWorkerLockRequest=(et,o,tt,rt,nt)=>(ot,it)=>{if(it.data.type!==tt)return;const st={type:it.data.type,name:it.data.name,identifier:it.data.identifier};et.dispatchEvent(new MessageEvent(o,{data:{name:st.name,handler:async()=>{ot.postMessage({type:nt,name:st.name,identifier:st.identifier}),await new Promise(at=>{const ct=lt=>{if((lt==null?void 0:lt.data)==null)return;const dt={type:lt.data.type,name:lt.data.name,identifier:lt.data.identifier};dt.type===rt&&dt.identifier===st.identifier&&(ot.removeEventListener("message",ct),at())};ot.addEventListener("message",ct)})}}}))},makeWorkerLockRequest=(et,o,tt,rt)=>async()=>{const nt=nanoid();return globalThis.postMessage({type:o,identifier:nt,name:et}),new Promise(ot=>{const it=st=>{if((st==null?void 0:st.data)==null)return;const at={type:st.data.type,identifier:st.data.identifier};at.type===tt&&at.identifier===nt&&(globalThis.removeEventListener("message",it),ot(()=>{globalThis.postMessage({type:rt,identifier:nt,name:et})}))};globalThis.addEventListener("message",it)})},defaultOptions$4={singleProcess:!1},impl=et=>{if(et=Object.assign({},defaultOptions$4,et),!!globalThis.document||et.singleProcess){const tt=new EventTarget;return observable.addEventListener("message",handleWorkerLockRequest(tt,"requestReadLock",WORKER_REQUEST_READ_LOCK,WORKER_RELEASE_READ_LOCK,MASTER_GRANT_READ_LOCK)),observable.addEventListener("message",handleWorkerLockRequest(tt,"requestWriteLock",WORKER_REQUEST_WRITE_LOCK,WORKER_RELEASE_WRITE_LOCK,MASTER_GRANT_WRITE_LOCK)),tt}return{isWorker:!0,readLock:tt=>makeWorkerLockRequest(tt,WORKER_REQUEST_READ_LOCK,MASTER_GRANT_READ_LOCK,WORKER_RELEASE_READ_LOCK),writeLock:tt=>makeWorkerLockRequest(tt,WORKER_REQUEST_WRITE_LOCK,MASTER_GRANT_WRITE_LOCK,WORKER_RELEASE_WRITE_LOCK)}},mutexes={};let implementation;async function createReleaseable(et,o){let tt;const rt=new Promise(nt=>{tt=nt});return et.add(async()=>pTimeout((async()=>{await new Promise(nt=>{tt(()=>{nt()})})})(),{milliseconds:o.timeout})),rt}const createMutex=(et,o)=>{if(implementation.isWorker===!0)return{readLock:implementation.readLock(et,o),writeLock:implementation.writeLock(et,o)};const tt=new PQueue({concurrency:1});let rt;return{async readLock(){if(rt!=null)return createReleaseable(rt,o);rt=new PQueue({concurrency:o.concurrency,autoStart:!1});const nt=rt,ot=createReleaseable(rt,o);return tt.add(async()=>{nt.start(),await nt.onIdle().then(()=>{rt===nt&&(rt=null)})}),ot},async writeLock(){return rt=null,createReleaseable(tt,o)}}},defaultOptions$3={name:"lock",concurrency:1/0,timeout:846e5,singleProcess:!1};function createMortice(et){const o=Object.assign({},defaultOptions$3,et);return implementation==null&&(implementation=impl(o),implementation.isWorker!==!0&&(implementation.addEventListener("requestReadLock",tt=>{mutexes[tt.data.name]!=null&&mutexes[tt.data.name].readLock().then(async rt=>tt.data.handler().finally(()=>{rt()}))}),implementation.addEventListener("requestWriteLock",async tt=>{mutexes[tt.data.name]!=null&&mutexes[tt.data.name].writeLock().then(async rt=>tt.data.handler().finally(()=>{rt()}))}))),mutexes[o.name]==null&&(mutexes[o.name]=createMutex(o.name,o)),mutexes[o.name]}function equals$2(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$6=base$5,_brrp__multiformats_scope_baseX$5=src$6;let Encoder$5=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$5=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$5(this,o)}},ComposedDecoder$5=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$5(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$5(et,o){return new ComposedDecoder$5({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$5=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$5(o,tt,rt),this.decoder=new Decoder$5(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$6({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$5(et,o,tt,rt)}function baseX$5({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$5(tt,et);return from$6({prefix:o,name:et,encode:rt,decode:ot=>coerce$5(nt(ot))})}function decode$i(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$f(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<=INT;)o[tt++]=et&255|MSB,et/=128;for(;et&MSBALL;)o[tt++]=et&255|MSB,et>>>=7;return o[tt]=et|0,encode$e.bytes=tt-rt+1,o}var decode$h=read$1,MSB$1=128,REST$1=127;function read$1(et,rt){var tt=0,rt=rt||0,nt=0,ot=rt,it,st=et.length;do{if(ot>=st)throw read$1.bytes=0,new RangeError("Could not decode varint");it=et[ot++],tt+=nt<28?(it&REST$1)<=MSB$1);return read$1.bytes=ot-rt,tt}var N1=Math.pow(2,7),N2=Math.pow(2,14),N3=Math.pow(2,21),N4=Math.pow(2,28),N5=Math.pow(2,35),N6=Math.pow(2,42),N7=Math.pow(2,49),N8=Math.pow(2,56),N9=Math.pow(2,63),length=function(et){return et{const[dt,ht]=decode$g(o.subarray(tt));return tt+=ht,dt};let nt=rt(),ot=DAG_PB_CODE;if(nt===18?(nt=0,tt=0):ot=rt(),nt!==0&&nt!==1)throw new RangeError(`Invalid CID version ${nt}`);const it=tt,st=rt(),at=rt(),ct=tt+at,lt=ct-it;return{version:nt,codec:ot,multihashCode:st,digestSize:at,multihashSize:lt,size:ct}}static parse(o,tt){const[rt,nt]=parseCIDtoBytes(o,tt),ot=CID.decode(nt);if(ot.version===0&&o[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return baseCache(ot).set(rt,o),ot}}function parseCIDtoBytes(et,o){switch(et[0]){case"Q":{const tt=o??base58btc$5;return[base58btc$5.prefix,tt.decode(`${base58btc$5.prefix}${et}`)]}case base58btc$5.prefix:{const tt=o??base58btc$5;return[base58btc$5.prefix,tt.decode(et)]}case base32$c.prefix:{const tt=o??base32$c;return[base32$c.prefix,tt.decode(et)]}case base36$a.prefix:{const tt=o??base36$a;return[base36$a.prefix,tt.decode(et)]}default:{if(o==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[et[0],o.decode(et)]}}}function toStringV0(et,o,tt){const{prefix:rt}=tt;if(rt!==base58btc$5.prefix)throw Error(`Cannot string encode V0 in ${tt.name} encoding`);const nt=o.get(rt);if(nt==null){const ot=tt.encode(et).slice(1);return o.set(rt,ot),ot}else return nt}function toStringV1(et,o,tt){const{prefix:rt}=tt,nt=o.get(rt);if(nt==null){const ot=tt.encode(et);return o.set(rt,ot),ot}else return nt}const DAG_PB_CODE=112,SHA_256_CODE=18;function encodeCID(et,o,tt){const rt=encodingLength$2(et),nt=rt+encodingLength$2(o),ot=new Uint8Array(nt+tt.byteLength);return encodeTo(et,ot,0),encodeTo(o,ot,rt),ot.set(tt,nt),ot}const cidSymbol=Symbol.for("@ipld/js-cid/CID");function equals(et,o){if(et===o)return!0;if(et.byteLength!==o.byteLength)return!1;for(let tt=0;tt(rt==null&&(rt=message$1((nt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),nt.key!=null&&nt.key!==""&&(ot.uint32(10),ot.string(nt.key)),nt.value!=null&&nt.value.byteLength>0&&(ot.uint32(18),ot.bytes(nt.value)),it.lengthDelimited!==!1&&ot.ldelim()},(nt,ot,it={})=>{const st={key:"",value:alloc$1(0)},at=ot==null?nt.len:nt.pos+ot;for(;nt.pos>>3){case 1:{st.key=nt.string();break}case 2:{st.value=nt.bytes();break}default:{nt.skipType(ct&7);break}}}return st})),rt),tt.encode=nt=>encodeMessage(nt,tt.codec()),tt.decode=(nt,ot)=>decodeMessage(nt,tt.codec(),ot)})(et.Peer$metadataEntry||(et.Peer$metadataEntry={})),function(tt){let rt;tt.codec=()=>(rt==null&&(rt=message$1((nt,ot,it={})=>{it.lengthDelimited!==!1&&ot.fork(),nt.key!=null&&nt.key!==""&&(ot.uint32(10),ot.string(nt.key)),nt.value!=null&&(ot.uint32(18),Tag.codec().encode(nt.value,ot)),it.lengthDelimited!==!1&&ot.ldelim()},(nt,ot,it={})=>{var ct;const st={key:""},at=ot==null?nt.len:nt.pos+ot;for(;nt.pos>>3){case 1:{st.key=nt.string();break}case 2:{st.value=Tag.codec().decode(nt,nt.uint32(),{limits:(ct=it.limits)==null?void 0:ct.value});break}default:{nt.skipType(lt&7);break}}}return st})),rt),tt.encode=nt=>encodeMessage(nt,tt.codec()),tt.decode=(nt,ot)=>decodeMessage(nt,tt.codec(),ot)}(et.Peer$tagsEntry||(et.Peer$tagsEntry={}));let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{if(nt.lengthDelimited!==!1&&rt.fork(),tt.addresses!=null)for(const ot of tt.addresses)rt.uint32(10),Address.codec().encode(ot,rt);if(tt.protocols!=null)for(const ot of tt.protocols)rt.uint32(18),rt.string(ot);if(tt.publicKey!=null&&(rt.uint32(34),rt.bytes(tt.publicKey)),tt.peerRecordEnvelope!=null&&(rt.uint32(42),rt.bytes(tt.peerRecordEnvelope)),tt.metadata!=null&&tt.metadata.size!==0)for(const[ot,it]of tt.metadata.entries())rt.uint32(50),et.Peer$metadataEntry.codec().encode({key:ot,value:it},rt);if(tt.tags!=null&&tt.tags.size!==0)for(const[ot,it]of tt.tags.entries())rt.uint32(58),et.Peer$tagsEntry.codec().encode({key:ot,value:it},rt);nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{var st,at,ct,lt,dt,ht;const ot={addresses:[],protocols:[],metadata:new Map,tags:new Map},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{if(((st=nt.limits)==null?void 0:st.addresses)!=null&&ot.addresses.length===nt.limits.addresses)throw new MaxLengthError('Decode error - map field "addresses" had too many elements');ot.addresses.push(Address.codec().decode(tt,tt.uint32(),{limits:(at=nt.limits)==null?void 0:at.addresses$}));break}case 2:{if(((ct=nt.limits)==null?void 0:ct.protocols)!=null&&ot.protocols.length===nt.limits.protocols)throw new MaxLengthError('Decode error - map field "protocols" had too many elements');ot.protocols.push(tt.string());break}case 4:{ot.publicKey=tt.bytes();break}case 5:{ot.peerRecordEnvelope=tt.bytes();break}case 6:{if(((lt=nt.limits)==null?void 0:lt.metadata)!=null&&ot.metadata.size===nt.limits.metadata)throw new MaxSizeError('Decode error - map field "metadata" had too many elements');const ft=et.Peer$metadataEntry.codec().decode(tt,tt.uint32());ot.metadata.set(ft.key,ft.value);break}case 7:{if(((dt=nt.limits)==null?void 0:dt.tags)!=null&&ot.tags.size===nt.limits.tags)throw new MaxSizeError('Decode error - map field "tags" had too many elements');const ft=et.Peer$tagsEntry.codec().decode(tt,tt.uint32(),{limits:{value:(ht=nt.limits)==null?void 0:ht.tags$value}});ot.tags.set(ft.key,ft.value);break}default:{tt.skipType(mt&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(Peer||(Peer={}));var Address;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.multiaddr!=null&&tt.multiaddr.byteLength>0&&(rt.uint32(10),rt.bytes(tt.multiaddr)),tt.isCertified!=null&&(rt.uint32(16),rt.bool(tt.isCertified)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={multiaddr:alloc$1(0)},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.multiaddr=tt.bytes();break}case 2:{ot.isCertified=tt.bool();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(Address||(Address={}));var Tag;(function(et){let o;et.codec=()=>(o==null&&(o=message$1((tt,rt,nt={})=>{nt.lengthDelimited!==!1&&rt.fork(),tt.value!=null&&tt.value!==0&&(rt.uint32(8),rt.uint32(tt.value)),tt.expiry!=null&&(rt.uint32(16),rt.uint64(tt.expiry)),nt.lengthDelimited!==!1&&rt.ldelim()},(tt,rt,nt={})=>{const ot={value:0},it=rt==null?tt.len:tt.pos+rt;for(;tt.pos>>3){case 1:{ot.value=tt.uint32();break}case 2:{ot.expiry=tt.uint64();break}default:{tt.skipType(st&7);break}}}return ot})),o),et.encode=tt=>encodeMessage(tt,et.codec()),et.decode=(tt,rt)=>decodeMessage(tt,et.codec(),rt)})(Tag||(Tag={}));function bytesToPeer(et,o){const tt=Peer.decode(o);if(tt.publicKey!=null&&et.publicKey==null){const ot=publicKeyFromProtobuf(tt.publicKey);et=peerIdFromPublicKey(ot)}const rt=new Map,nt=BigInt(Date.now());for(const[ot,it]of tt.tags.entries())it.expiry!=null&&it.expiry({multiaddr:multiaddr(ot),isCertified:it??!1})),metadata:tt.metadata,peerRecordEnvelope:tt.peerRecordEnvelope??void 0,tags:rt}}function coerce$4(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$9(et){return new TextEncoder().encode(et)}function toString$d(et){return new TextDecoder().decode(et)}function base$4(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$5=base$4,_brrp__multiformats_scope_baseX$4=src$5;let Encoder$4=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$4=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$4(this,o)}},ComposedDecoder$4=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$4(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$4(et,o){return new ComposedDecoder$4({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$4=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$4(o,tt,rt),this.decoder=new Decoder$4(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$5({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$4(et,o,tt,rt)}function baseX$4({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$4(tt,et);return from$5({prefix:o,name:et,encode:rt,decode:ot=>coerce$4(nt(ot))})}function decode$e(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$d(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$4=alphabet$4.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$c(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$4[tt],o),"")}function decode$d(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$4[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$8=from$5({prefix:"🚀",name:"base256emoji",encode:encode$c,decode:decode$d}),base256emoji$9=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$8},Symbol.toStringTag,{value:"Module"})),base32$a=rfc4648$4({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$4=rfc4648$4({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$4=rfc4648$4({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$4=rfc4648$4({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$4=rfc4648$4({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$4=rfc4648$4({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$4=rfc4648$4({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$4=rfc4648$4({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$4=rfc4648$4({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$b=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$a,base32hex:base32hex$4,base32hexpad:base32hexpad$4,base32hexpadupper:base32hexpadupper$4,base32hexupper:base32hexupper$4,base32pad:base32pad$4,base32padupper:base32padupper$4,base32upper:base32upper$4,base32z:base32z$4},Symbol.toStringTag,{value:"Module"})),base36$8=baseX$4({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$4=baseX$4({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$9=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$8,base36upper:base36upper$4},Symbol.toStringTag,{value:"Module"})),base58btc$4=baseX$4({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$4=baseX$4({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$4=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$4,base58flickr:base58flickr$4},Symbol.toStringTag,{value:"Module"})),base64$a=rfc4648$4({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$4=rfc4648$4({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$4=rfc4648$4({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$4=rfc4648$4({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$b=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$a,base64pad:base64pad$4,base64url:base64url$4,base64urlpad:base64urlpad$4},Symbol.toStringTag,{value:"Module"})),base8$8=rfc4648$4({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$9=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$8},Symbol.toStringTag,{value:"Module"})),identity$4=from$5({prefix:"\0",name:"identity",encode:et=>toString$d(et),decode:et=>fromString$9(et)}),identityBase$4=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$4},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$4={...identityBase$4,...base2$9,...base8$9,...base10$9,...base16$9,...base32$b,...base36$9,...base58$4,...base64$b,...base256emoji$9};function allocUnsafe$3(et=0){return new Uint8Array(et)}function createCodec$4(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$7=createCodec$4("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$4=createCodec$4("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$3(et.length);for(let tt=0;tt1&&this._buf[this._buf.byteLength-1]===pathSep;)this._buf=this._buf.subarray(0,-1)}less(o){const tt=this.list(),rt=o.list();for(let nt=0;ntit)return!1}return tt.lengthtt.namespaces()))])}}function namespaceType(et){const o=et.split(":");return o.length<2?"":o.slice(0,-1).join(":")}function namespaceValue(et){const o=et.split(":");return o[o.length-1]}function flatten(et){return[].concat(...et)}const NAMESPACE_COMMON="/peers/";function peerIdToDatastoreKey(et){if(!isPeerId(et)||et.type==null)throw new InvalidParametersError("Invalid PeerId");const o=et.toCID().toString();return new Key(`${NAMESPACE_COMMON}${o}`)}async function dedupeFilterAndSortAddresses(et,o,tt){const rt=new Map;for(const nt of tt){if(nt==null)continue;if(nt.multiaddr instanceof Uint8Array&&(nt.multiaddr=multiaddr(nt.multiaddr)),!isMultiaddr(nt.multiaddr))throw new InvalidParametersError("Multiaddr was invalid");if(!await o(et,nt.multiaddr))continue;const ot=nt.isCertified??!1,it=nt.multiaddr.toString(),st=rt.get(it);st!=null?nt.isCertified=st.isCertified||ot:rt.set(it,{multiaddr:nt.multiaddr,isCertified:ot})}return[...rt.values()].sort((nt,ot)=>nt.multiaddr.toString().localeCompare(ot.multiaddr.toString())).map(({isCertified:nt,multiaddr:ot})=>({isCertified:nt,multiaddr:ot.bytes}))}async function toPeerPB(et,o,tt,rt){if(o==null)throw new InvalidParametersError("Invalid PeerData");if(o.publicKey!=null&&et.publicKey!=null&&!o.publicKey.equals(et.publicKey))throw new InvalidParametersError("publicKey bytes do not match peer id publicKey bytes");const nt=rt.existingPeer;if(nt!=null&&!et.equals(nt.id))throw new InvalidParametersError("peer id did not match existing peer id");let ot=(nt==null?void 0:nt.addresses)??[],it=new Set((nt==null?void 0:nt.protocols)??[]),st=(nt==null?void 0:nt.metadata)??new Map,at=(nt==null?void 0:nt.tags)??new Map,ct=nt==null?void 0:nt.peerRecordEnvelope;if(tt==="patch"){if((o.multiaddrs!=null||o.addresses!=null)&&(ot=[],o.multiaddrs!=null&&ot.push(...o.multiaddrs.map(ht=>({isCertified:!1,multiaddr:ht}))),o.addresses!=null&&ot.push(...o.addresses)),o.protocols!=null&&(it=new Set(o.protocols)),o.metadata!=null){const ht=o.metadata instanceof Map?[...o.metadata.entries()]:Object.entries(o.metadata);st=createSortedMap(ht,{validate:validateMetadata})}if(o.tags!=null){const ht=o.tags instanceof Map?[...o.tags.entries()]:Object.entries(o.tags);at=createSortedMap(ht,{validate:validateTag,map:mapTag})}o.peerRecordEnvelope!=null&&(ct=o.peerRecordEnvelope)}if(tt==="merge"){if(o.multiaddrs!=null&&ot.push(...o.multiaddrs.map(ht=>({isCertified:!1,multiaddr:ht}))),o.addresses!=null&&ot.push(...o.addresses),o.protocols!=null&&(it=new Set([...it,...o.protocols])),o.metadata!=null){const ht=o.metadata instanceof Map?[...o.metadata.entries()]:Object.entries(o.metadata);for(const[mt,ft]of ht)ft==null?st.delete(mt):st.set(mt,ft);st=createSortedMap([...st.entries()],{validate:validateMetadata})}if(o.tags!=null){const ht=o.tags instanceof Map?[...o.tags.entries()]:Object.entries(o.tags),mt=new Map(at);for(const[ft,pt]of ht)pt==null?mt.delete(ft):mt.set(ft,pt);at=createSortedMap([...mt.entries()],{validate:validateTag,map:mapTag})}o.peerRecordEnvelope!=null&&(ct=o.peerRecordEnvelope)}let lt;(nt==null?void 0:nt.id.publicKey)!=null?lt=publicKeyToProtobuf(nt.id.publicKey):o.publicKey!=null?lt=publicKeyToProtobuf(o.publicKey):et.publicKey!=null&&(lt=publicKeyToProtobuf(et.publicKey));const dt={addresses:await dedupeFilterAndSortAddresses(et,rt.addressFilter??(async()=>!0),ot),protocols:[...it.values()].sort((ht,mt)=>ht.localeCompare(mt)),metadata:st,tags:at,publicKey:lt,peerRecordEnvelope:ct};return et.type!=="RSA"&&delete dt.publicKey,dt}function createSortedMap(et,o){var rt;const tt=new Map;for(const[nt,ot]of et)ot!=null&&o.validate(nt,ot);for(const[nt,ot]of et.sort(([it],[st])=>it.localeCompare(st)))ot!=null&&tt.set(nt,((rt=o.map)==null?void 0:rt.call(o,nt,ot))??ot);return tt}function validateMetadata(et,o){if(typeof et!="string")throw new InvalidParametersError("Metadata key must be a string");if(!(o instanceof Uint8Array))throw new InvalidParametersError("Metadata value must be a Uint8Array")}function validateTag(et,o){if(typeof et!="string")throw new InvalidParametersError("Tag name must be a string");if(o.value!=null){if(parseInt(`${o.value}`,10)!==o.value)throw new InvalidParametersError("Tag value must be an integer");if(o.value<0||o.value>100)throw new InvalidParametersError("Tag value must be between 0-100")}if(o.ttl!=null){if(parseInt(`${o.ttl}`,10)!==o.ttl)throw new InvalidParametersError("Tag ttl must be an integer");if(o.ttl<0)throw new InvalidParametersError("Tag ttl must be between greater than 0")}}function mapTag(et,o){let tt;return o.expiry!=null&&(tt=o.expiry),o.ttl!=null&&(tt=BigInt(Date.now()+Number(o.ttl))),{value:o.value??0,expiry:tt}}function decodePeer(et,o,tt){const rt=et.toString().split("/")[2],nt=CID.parse(rt,base32$c),ot=peerIdFromCID(nt),it=tt.get(ot);if(it!=null)return it;const st=bytesToPeer(ot,o);return tt.set(ot,st),st}function mapQuery(et,o){return et==null?{}:{prefix:NAMESPACE_COMMON,filters:(et.filters??[]).map(tt=>({key:rt,value:nt})=>tt(decodePeer(rt,nt,o))),orders:(et.orders??[]).map(tt=>(rt,nt)=>tt(decodePeer(rt.key,rt.value,o),decodePeer(nt.key,nt.value,o)))}}var rn,ns,os;class PersistentStore{constructor(o,tt={}){fr(this,rn);wt(this,"peerId");wt(this,"datastore");wt(this,"lock");wt(this,"addressFilter");this.peerId=o.peerId,this.datastore=o.datastore,this.addressFilter=tt.addressFilter,this.lock=createMortice({name:"peer-store",singleProcess:!0})}async has(o){return this.datastore.has(peerIdToDatastoreKey(o))}async delete(o){if(this.peerId.equals(o))throw new InvalidParametersError("Cannot delete self peer");await this.datastore.delete(peerIdToDatastoreKey(o))}async load(o){const tt=await this.datastore.get(peerIdToDatastoreKey(o));return bytesToPeer(o,tt)}async save(o,tt){const{existingBuf:rt,existingPeer:nt}=await mr(this,rn,ns).call(this,o),ot=await toPeerPB(o,tt,"patch",{addressFilter:this.addressFilter});return mr(this,rn,os).call(this,o,ot,rt,nt)}async patch(o,tt){const{existingBuf:rt,existingPeer:nt}=await mr(this,rn,ns).call(this,o),ot=await toPeerPB(o,tt,"patch",{addressFilter:this.addressFilter,existingPeer:nt});return mr(this,rn,os).call(this,o,ot,rt,nt)}async merge(o,tt){const{existingBuf:rt,existingPeer:nt}=await mr(this,rn,ns).call(this,o),ot=await toPeerPB(o,tt,"merge",{addressFilter:this.addressFilter,existingPeer:nt});return mr(this,rn,os).call(this,o,ot,rt,nt)}async*all(o){const tt=new PeerMap;for await(const{key:rt,value:nt}of this.datastore.query(mapQuery(o??{},tt))){const ot=decodePeer(rt,nt,tt);ot.id.equals(this.peerId)||(yield ot)}}}rn=new WeakSet,ns=async function(o){try{const tt=await this.datastore.get(peerIdToDatastoreKey(o)),rt=bytesToPeer(o,tt);return{existingBuf:tt,existingPeer:rt}}catch(tt){if(tt.name!=="NotFoundError")throw tt}return{}},os=async function(o,tt,rt,nt){const ot=Peer.encode(tt);return rt!=null&&equals(ot,rt)?{peer:bytesToPeer(o,ot),previous:nt,updated:!1}:(await this.datastore.put(peerIdToDatastoreKey(o),ot),{peer:bytesToPeer(o,ot),previous:nt,updated:!0})};var Fl,no,is;Fl=Symbol.toStringTag;class PersistentPeerStore{constructor(o,tt={}){fr(this,no);wt(this,"store");wt(this,"events");wt(this,"peerId");wt(this,"log");wt(this,Fl,"@libp2p/peer-store");this.log=o.logger.forComponent("libp2p:peer-store"),this.events=o.events,this.peerId=o.peerId,this.store=new PersistentStore(o,tt)}async forEach(o,tt){this.log.trace("forEach await read lock");const rt=await this.store.lock.readLock();this.log.trace("forEach got read lock");try{for await(const nt of this.store.all(tt))o(nt)}finally{this.log.trace("forEach release read lock"),rt()}}async all(o){this.log.trace("all await read lock");const tt=await this.store.lock.readLock();this.log.trace("all got read lock");try{return await all$2(this.store.all(o))}finally{this.log.trace("all release read lock"),tt()}}async delete(o){this.log.trace("delete await write lock");const tt=await this.store.lock.writeLock();this.log.trace("delete got write lock");try{await this.store.delete(o)}finally{this.log.trace("delete release write lock"),tt()}}async has(o){this.log.trace("has await read lock");const tt=await this.store.lock.readLock();this.log.trace("has got read lock");try{return await this.store.has(o)}finally{this.log.trace("has release read lock"),tt()}}async get(o){this.log.trace("get await read lock");const tt=await this.store.lock.readLock();this.log.trace("get got read lock");try{return await this.store.load(o)}finally{this.log.trace("get release read lock"),tt()}}async save(o,tt){this.log.trace("save await write lock");const rt=await this.store.lock.writeLock();this.log.trace("save got write lock");try{const nt=await this.store.save(o,tt);return mr(this,no,is).call(this,o,nt),nt.peer}finally{this.log.trace("save release write lock"),rt()}}async patch(o,tt){this.log.trace("patch await write lock");const rt=await this.store.lock.writeLock();this.log.trace("patch got write lock");try{const nt=await this.store.patch(o,tt);return mr(this,no,is).call(this,o,nt),nt.peer}finally{this.log.trace("patch release write lock"),rt()}}async merge(o,tt){this.log.trace("merge await write lock");const rt=await this.store.lock.writeLock();this.log.trace("merge got write lock");try{const nt=await this.store.merge(o,tt);return mr(this,no,is).call(this,o,nt),nt.peer}finally{this.log.trace("merge release write lock"),rt()}}async consumePeerRecord(o,tt){const rt=await RecordEnvelope.openAndCertify(o,PeerRecord.DOMAIN),nt=peerIdFromCID(rt.publicKey.toCID());if((tt==null?void 0:tt.equals(nt))===!1)return this.log("envelope peer id was not the expected peer id - expected: %p received: %p",tt,nt),!1;const ot=PeerRecord.createFromProtobuf(rt.payload);let it;try{it=await this.get(nt)}catch(st){if(st.name!=="NotFoundError")throw st}if((it==null?void 0:it.peerRecordEnvelope)!=null){const st=await RecordEnvelope.createFromProtobuf(it.peerRecordEnvelope),at=PeerRecord.createFromProtobuf(st.payload);if(at.seqNumber>=ot.seqNumber)return this.log("sequence number was lower or equal to existing sequence number - stored: %d received: %d",at.seqNumber,ot.seqNumber),!1}return await this.patch(ot.peerId,{peerRecordEnvelope:o,addresses:ot.multiaddrs.map(st=>({isCertified:!0,multiaddr:st}))}),!0}}no=new WeakSet,is=function(o,tt){tt.updated&&(this.peerId.equals(o)?this.events.safeDispatchEvent("self:peer:update",{detail:tt}):this.events.safeDispatchEvent("peer:update",{detail:tt}))};function persistentPeerStore(et,o={}){return new PersistentPeerStore(et,o)}const On=class On extends Error{constructor(tt="Not Found"){super(tt);wt(this,"name",On.name);wt(this,"code",On.code)}};wt(On,"name","NotFoundError"),wt(On,"code","ERR_NOT_FOUND");let NotFoundError=On;function peekable(et){const[o,tt]=et[Symbol.asyncIterator]!=null?[et[Symbol.asyncIterator](),Symbol.asyncIterator]:[et[Symbol.iterator](),Symbol.iterator],rt=[];return{peek:()=>o.next(),push:nt=>{rt.push(nt)},next:()=>rt.length>0?{done:!1,value:rt.shift()}:o.next(),[tt](){return this}}}function isAsyncIterable$2(et){return et[Symbol.asyncIterator]!=null}function filter(et,o){let tt=0;if(isAsyncIterable$2(et))return async function*(){for await(const at of et)await o(at,tt++)&&(yield at)}();const rt=peekable(et),{value:nt,done:ot}=rt.next();if(ot===!0)return function*(){}();const it=o(nt,tt++);if(typeof it.then=="function")return async function*(){await it&&(yield nt);for await(const at of rt)await o(at,tt++)&&(yield at)}();const st=o;return function*(){it===!0&&(yield nt);for(const at of rt)st(at,tt++)&&(yield at)}()}function isAsyncIterable$1(et){return et[Symbol.asyncIterator]!=null}function sort(et,o){return isAsyncIterable$1(et)?async function*(){yield*(await all$2(et)).sort(o)}():function*(){yield*all$2(et).sort(o)}()}function isAsyncIterable(et){return et[Symbol.asyncIterator]!=null}function take(et,o){return isAsyncIterable(et)?async function*(){let tt=0;if(!(o<1)){for await(const rt of et)if(yield rt,tt++,tt===o)return}}():function*(){let tt=0;if(!(o<1)){for(const rt of et)if(yield rt,tt++,tt===o)return}}()}class BaseDatastore{put(o,tt,rt){return Promise.reject(new Error(".put is not implemented"))}get(o,tt){return Promise.reject(new Error(".get is not implemented"))}has(o,tt){return Promise.reject(new Error(".has is not implemented"))}delete(o,tt){return Promise.reject(new Error(".delete is not implemented"))}async*putMany(o,tt={}){for await(const{key:rt,value:nt}of o)await this.put(rt,nt,tt),yield rt}async*getMany(o,tt={}){for await(const rt of o)yield{key:rt,value:await this.get(rt,tt)}}async*deleteMany(o,tt={}){for await(const rt of o)await this.delete(rt,tt),yield rt}batch(){let o=[],tt=[];return{put(rt,nt){o.push({key:rt,value:nt})},delete(rt){tt.push(rt)},commit:async rt=>{await drain(this.putMany(o,rt)),o=[],await drain(this.deleteMany(tt,rt)),tt=[]}}}async*_all(o,tt){throw new Error("._all is not implemented")}async*_allKeys(o,tt){throw new Error("._allKeys is not implemented")}query(o,tt){let rt=this._all(o,tt);if(o.prefix!=null){const nt=o.prefix;rt=filter(rt,ot=>ot.key.toString().startsWith(nt))}if(Array.isArray(o.filters)&&(rt=o.filters.reduce((nt,ot)=>filter(nt,ot),rt)),Array.isArray(o.orders)&&(rt=o.orders.reduce((nt,ot)=>sort(nt,ot),rt)),o.offset!=null){let nt=0;const ot=o.offset;rt=filter(rt,()=>nt++>=ot)}return o.limit!=null&&(rt=take(rt,o.limit)),rt}queryKeys(o,tt){let rt=this._allKeys(o,tt);if(o.prefix!=null){const nt=o.prefix;rt=filter(rt,ot=>ot.toString().startsWith(nt))}if(Array.isArray(o.filters)&&(rt=o.filters.reduce((nt,ot)=>filter(nt,ot),rt)),Array.isArray(o.orders)&&(rt=o.orders.reduce((nt,ot)=>sort(nt,ot),rt)),o.offset!=null){const nt=o.offset;let ot=0;rt=filter(rt,()=>ot++>=nt)}return o.limit!=null&&(rt=take(rt,o.limit)),rt}}class MemoryDatastore extends BaseDatastore{constructor(){super();wt(this,"data");this.data=new Map}put(tt,rt){return this.data.set(tt.toString(),rt),tt}get(tt){const rt=this.data.get(tt.toString());if(rt==null)throw new NotFoundError;return rt}has(tt){return this.data.has(tt.toString())}delete(tt){this.data.delete(tt.toString())}*_all(){for(const[tt,rt]of this.data.entries())yield{key:new Key(tt),value:rt}}*_allKeys(){for(const tt of this.data.keys())yield new Key(tt)}}function allocUnsafe$2(et=0){return new Uint8Array(et)}function asUint8Array(et){return et}function concat(et,o){o==null&&(o=et.reduce((nt,ot)=>nt+ot.length,0));const tt=allocUnsafe$2(o);let rt=0;for(const nt of et)tt.set(nt,rt),rt+=nt.length;return tt}function coerce$3(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$7(et){return new TextEncoder().encode(et)}function toString$b(et){return new TextDecoder().decode(et)}function base$3(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$4=base$3,_brrp__multiformats_scope_baseX$3=src$4;let Encoder$3=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$3=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$3(this,o)}},ComposedDecoder$3=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$3(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$3(et,o){return new ComposedDecoder$3({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$3=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$3(o,tt,rt),this.decoder=new Decoder$3(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$4({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$3(et,o,tt,rt)}function baseX$3({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$3(tt,et);return from$4({prefix:o,name:et,encode:rt,decode:ot=>coerce$3(nt(ot))})}function decode$c(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$b(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$3=alphabet$3.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$a(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$3[tt],o),"")}function decode$b(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$3[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$6=from$4({prefix:"🚀",name:"base256emoji",encode:encode$a,decode:decode$b}),base256emoji$7=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$6},Symbol.toStringTag,{value:"Module"})),base32$8=rfc4648$3({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$3=rfc4648$3({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$3=rfc4648$3({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$3=rfc4648$3({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$3=rfc4648$3({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$3=rfc4648$3({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$3=rfc4648$3({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$3=rfc4648$3({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$3=rfc4648$3({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$9=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$8,base32hex:base32hex$3,base32hexpad:base32hexpad$3,base32hexpadupper:base32hexpadupper$3,base32hexupper:base32hexupper$3,base32pad:base32pad$3,base32padupper:base32padupper$3,base32upper:base32upper$3,base32z:base32z$3},Symbol.toStringTag,{value:"Module"})),base36$6=baseX$3({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$3=baseX$3({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$7=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$6,base36upper:base36upper$3},Symbol.toStringTag,{value:"Module"})),base58btc$3=baseX$3({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$3=baseX$3({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$3=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$3,base58flickr:base58flickr$3},Symbol.toStringTag,{value:"Module"})),base64$8=rfc4648$3({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$3=rfc4648$3({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$3=rfc4648$3({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$3=rfc4648$3({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$9=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$8,base64pad:base64pad$3,base64url:base64url$3,base64urlpad:base64urlpad$3},Symbol.toStringTag,{value:"Module"})),base8$6=rfc4648$3({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$7=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$6},Symbol.toStringTag,{value:"Module"})),identity$3=from$4({prefix:"\0",name:"identity",encode:et=>toString$b(et),decode:et=>fromString$7(et)}),identityBase$3=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$3},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$3={...identityBase$3,...base2$7,...base8$7,...base10$7,...base16$7,...base32$9,...base36$7,...base58$3,...base64$9,...base256emoji$7};function createCodec$3(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$6=createCodec$3("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$3=createCodec$3("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$2(et.length);for(let tt=0;ttet;function stripPeerId(et,o){const tt=et.getPeerId();return tt!=null&&peerIdFromString$1(tt).equals(o)&&(et=et.decapsulate(multiaddr(`/p2p/${o.toString()}`))),et}var Ul;Ul=Symbol.toStringTag;class DefaultAddressManager{constructor(o,tt={}){wt(this,"log");wt(this,"components");wt(this,"listen");wt(this,"announce");wt(this,"observed");wt(this,"announceFilter");wt(this,Ul,"@libp2p/address-manager");const{listen:rt=[],announce:nt=[]}=tt;this.components=o,this.log=o.logger.forComponent("libp2p:address-manager"),this.listen=rt.map(ot=>ot.toString()),this.announce=new Set(nt.map(ot=>ot.toString())),this.observed=new Map,this.announceFilter=tt.announceFilter??defaultAddressFilter,this._updatePeerStoreAddresses=debounce(this._updatePeerStoreAddresses.bind(this),1e3),o.events.addEventListener("transport:listening",()=>{this._updatePeerStoreAddresses()}),o.events.addEventListener("transport:close",()=>{this._updatePeerStoreAddresses()})}_updatePeerStoreAddresses(){const o=this.getAnnounceAddrs().concat(this.components.transportManager.getAddrs()).concat([...this.observed.entries()].filter(([tt,rt])=>rt.confident).map(([tt])=>multiaddr(tt))).map(tt=>tt.getPeerId()===this.components.peerId.toString()?tt.decapsulate(`/p2p/${this.components.peerId.toString()}`):tt);this.components.peerStore.patch(this.components.peerId,{multiaddrs:o}).catch(tt=>{this.log.error("error updating addresses",tt)})}getListenAddrs(){return Array.from(this.listen).map(o=>multiaddr(o))}getAnnounceAddrs(){return Array.from(this.announce).map(o=>multiaddr(o))}getObservedAddrs(){return Array.from(this.observed).map(([o])=>multiaddr(o))}addObservedAddr(o){o=stripPeerId(o,this.components.peerId);const tt=o.toString();this.observed.has(tt)||this.observed.set(tt,{confident:!1})}confirmObservedAddr(o){o=stripPeerId(o,this.components.peerId);const tt=o.toString(),nt=(this.observed.get(tt)??{confident:!1}).confident;this.observed.set(tt,{confident:!0}),nt||this._updatePeerStoreAddresses()}removeObservedAddr(o){o=stripPeerId(o,this.components.peerId);const tt=o.toString();this.observed.delete(tt)}getAddresses(){let o=this.getAnnounceAddrs().map(rt=>rt.toString());o.length===0&&(o=this.components.transportManager.getAddrs().map(rt=>rt.toString())),o=o.concat(Array.from(this.observed).filter(([rt,nt])=>nt.confident).map(([rt])=>rt));const tt=new Set(o);return this.announceFilter(Array.from(tt).map(rt=>multiaddr(rt))).map(rt=>{var nt;return((nt=rt.protos().pop())==null?void 0:nt.path)===!0||rt.getPeerId()===this.components.peerId.toString()?rt:rt.encapsulate(`/p2p/${this.components.peerId.toString()}`)})}}var messages;(function(et){et.NOT_STARTED_YET="The libp2p node is not started yet",et.NOT_FOUND="Not found"})(messages||(messages={}));class MissingServiceError extends Error{constructor(o="Missing service"){super(o),this.name="MissingServiceError"}}class UnmetServiceDependenciesError extends Error{constructor(o="Unmet service dependencies"){super(o),this.name="UnmetServiceDependenciesError"}}class NoContentRoutersError extends Error{constructor(o="No content routers available"){super(o),this.name="NoContentRoutersError"}}class NoPeerRoutersError extends Error{constructor(o="No peer routers available"){super(o),this.name="NoPeerRoutersError"}}class QueriedForSelfError extends Error{constructor(o="Should not try to find self"){super(o),this.name="QueriedForSelfError"}}class UnhandledProtocolError extends Error{constructor(o="Unhandled protocol error"){super(o),this.name="UnhandledProtocolError"}}class DuplicateProtocolHandlerError extends Error{constructor(o="Duplicate protocol handler error"){super(o),this.name="DuplicateProtocolHandlerError"}}class DialDeniedError extends Error{constructor(o="Dial denied error"){super(o),this.name="DialDeniedError"}}class NoValidAddressesError extends Error{constructor(o="No valid addresses"){super(o),this.name="NoValidAddressesError"}}class ConnectionInterceptedError extends Error{constructor(o="Connection intercepted"){super(o),this.name="ConnectionInterceptedError"}}class ConnectionDeniedError extends Error{constructor(o="Connection denied"){super(o),this.name="ConnectionDeniedError"}}class MuxerUnavailableError extends Error{constructor(o="Stream is not multiplexed"){super(o),this.name="MuxerUnavailableError"}}class EncryptionFailedError extends Error{constructor(o="Encryption failed"){super(o),this.name="EncryptionFailedError"}}class TransportUnavailableError extends Error{constructor(o="Transport unavailable"){super(o),this.name="TransportUnavailableError"}}class DefaultComponents{constructor(o={}){wt(this,"components",{});wt(this,"_started",!1);this.components={};for(const[tt,rt]of Object.entries(o))this.components[tt]=rt;this.components.logger==null&&(this.components.logger=defaultLogger())}isStarted(){return this._started}async _invokeStartableMethod(o){await Promise.all(Object.values(this.components).filter(tt=>isStartable(tt)).map(async tt=>{var rt;await((rt=tt[o])==null?void 0:rt.call(tt))}))}async beforeStart(){await this._invokeStartableMethod("beforeStart")}async start(){await this._invokeStartableMethod("start"),this._started=!0}async afterStart(){await this._invokeStartableMethod("afterStart")}async beforeStop(){await this._invokeStartableMethod("beforeStop")}async stop(){await this._invokeStartableMethod("stop"),this._started=!1}async afterStop(){await this._invokeStartableMethod("afterStop")}}const OPTIONAL_SERVICES=["metrics","connectionProtector","dns"],NON_SERVICE_PROPERTIES=["components","isStarted","beforeStart","start","afterStart","beforeStop","stop","afterStop","then","_invokeStartableMethod"];function defaultComponents(et={}){const o=new DefaultComponents(et);return new Proxy(o,{get(rt,nt,ot){if(typeof nt=="string"&&!NON_SERVICE_PROPERTIES.includes(nt)){const it=o.components[nt];if(it==null&&!OPTIONAL_SERVICES.includes(nt))throw new MissingServiceError(`${nt} not set`);return it}return Reflect.get(rt,nt,ot)},set(rt,nt,ot){return typeof nt=="string"?o.components[nt]=ot:Reflect.set(rt,nt,ot),!0}})}function checkServiceDependencies(et){const o={};for(const tt of Object.values(et.components))for(const rt of getServiceCapabilities(tt))o[rt]=!0;for(const tt of Object.values(et.components))for(const rt of getServiceDependencies(tt))if(o[rt]!==!0)throw new UnmetServiceDependenciesError(`Service "${getServiceName(tt)}" required capability "${rt}" but it was not provided by any component, you may need to add additional configuration when creating your node.`)}function getServiceCapabilities(et){return Array.isArray(et==null?void 0:et[serviceCapabilities])?et[serviceCapabilities]:[]}function getServiceDependencies(et){return Array.isArray(et==null?void 0:et[serviceDependencies])?et[serviceDependencies]:[]}function getServiceName(et){return(et==null?void 0:et[Symbol.toStringTag])??(et==null?void 0:et.toString())??"unknown"}function connectionGater(et={}){return{denyDialPeer:async()=>!1,denyDialMultiaddr:async o=>{const tt=o.stringTuples();return tt[0][0]===4||tt[0][0]===41?!!isPrivateIp(`${tt[0][1]}`):!1},denyInboundConnection:async()=>!1,denyOutboundConnection:async()=>!1,denyInboundEncryptedConnection:async()=>!1,denyOutboundEncryptedConnection:async()=>!1,denyInboundUpgradedConnection:async()=>!1,denyOutboundUpgradedConnection:async()=>!1,filterMultiaddrForPeer:async()=>!0,...et}}function getPeerAddress(et){if(isPeerId$1(et))return{peerId:et,multiaddrs:[]};Array.isArray(et)||(et=[et]);let o;if(et.length>0){const tt=et[0].getPeerId();o=tt==null?void 0:peerIdFromString$1(tt),et.forEach(rt=>{if(!isMultiaddr(rt))throw new InvalidMultiaddrError("Invalid multiaddr");const nt=rt.getPeerId();if(nt==null){if(o!=null)throw new InvalidParametersError$1("Multiaddrs must all have the same peer id or have no peer id")}else{const ot=peerIdFromString$1(nt);if((o==null?void 0:o.equals(ot))!==!0)throw new InvalidParametersError$1("Multiaddrs must all have the same peer id or have no peer id")}})}return{peerId:o,multiaddrs:et}}const DEFAULT_CLOSABLE_PROTOCOLS=["/ipfs/id/1.0.0","/ipfs/id/push/1.0.0","/libp2p/autonat/1.0.0","/libp2p/dcutr"];async function safelyCloseConnectionIfUnused(et,o){var nt;const tt=((nt=et==null?void 0:et.streams)==null?void 0:nt.map(ot=>ot.protocol))??[],rt=(o==null?void 0:o.closableProtocols)??DEFAULT_CLOSABLE_PROTOCOLS;if(!(tt.filter(ot=>ot!=null&&!rt.includes(ot)).length>0))try{await(et==null?void 0:et.close(o))}catch(ot){et==null||et.abort(ot)}}const DIAL_TIMEOUT=5e3,UPGRADE_TIMEOUT=3e3,PROTOCOL_NEGOTIATION_TIMEOUT=2e3,MAX_PEER_ADDRS_TO_DIAL=25,INBOUND_CONNECTION_THRESHOLD=5,MAX_INCOMING_PENDING_CONNECTIONS=10,MAX_PARALLEL_RECONNECTS=5,LAST_DIAL_FAILURE_KEY="last-dial-failure",LAST_DIAL_SUCCESS_KEY="last-dial-success",MAX_DIAL_QUEUE_LENGTH=500,MAX_CONNECTIONS=100,MAX_PARALLEL_DIALS=50,defaultOptions$2={maxConnections:MAX_CONNECTIONS,allow:[]};class ConnectionPruner{constructor(o,tt={}){wt(this,"maxConnections");wt(this,"connectionManager");wt(this,"peerStore");wt(this,"allow");wt(this,"events");wt(this,"log");this.maxConnections=tt.maxConnections??defaultOptions$2.maxConnections,this.allow=tt.allow??defaultOptions$2.allow,this.connectionManager=o.connectionManager,this.peerStore=o.peerStore,this.events=o.events,this.log=o.logger.forComponent("libp2p:connection-manager:connection-pruner"),this.maybePruneConnections=this.maybePruneConnections.bind(this)}start(){this.events.addEventListener("connection:open",this.maybePruneConnections)}stop(){this.events.removeEventListener("connection:open",this.maybePruneConnections)}maybePruneConnections(){this._maybePruneConnections().catch(o=>{this.log.error("error while pruning connections %e",o)})}async _maybePruneConnections(){const o=this.connectionManager.getConnections(),tt=o.length;if(this.log("checking max connections limit %d/%d",tt,this.maxConnections),tt<=this.maxConnections)return;const rt=new PeerMap;for(const st of o){const at=st.remotePeer;if(!rt.has(at)){rt.set(at,0);try{const ct=await this.peerStore.get(at);rt.set(at,[...ct.tags.values()].reduce((lt,dt)=>lt+dt.value,0))}catch(ct){ct.name!=="NotFoundError"&&this.log.error("error loading peer tags",ct)}}}const nt=this.sortConnections(o,rt),ot=Math.max(tt-this.maxConnections,0),it=[];for(const st of nt)if(this.log("too many connections open - closing a connection to %p",st.remotePeer),this.allow.some(ct=>st.remoteAddr.toString().startsWith(ct.toString()))||it.push(st),it.length===ot)break;await Promise.all(it.map(async st=>{await safelyCloseConnectionIfUnused(st,{signal:AbortSignal.timeout(1e3)})})),this.events.safeDispatchEvent("connection:prune",{detail:it})}sortConnections(o,tt){return o.sort((rt,nt)=>{const ot=rt.timeline.open,it=nt.timeline.open;return otit?-1:0}).sort((rt,nt)=>rt.direction==="outbound"&&nt.direction==="inbound"?1:rt.direction==="inbound"&&nt.direction==="outbound"?-1:0).sort((rt,nt)=>rt.streams.length>nt.streams.length?1:rt.streams.length{const ot=tt.get(rt.remotePeer)??0,it=tt.get(nt.remotePeer)??0;return ot>it?1:ot{function st(){tt==null||tt.removeEventListener("abort",lt),et.removeEventListener(o,at),(rt==null?void 0:rt.errorEvent)!=null&&et.removeEventListener(rt.errorEvent,ct)}const at=dt=>{var ht;try{if(((ht=rt==null?void 0:rt.filter)==null?void 0:ht.call(rt,dt))===!1)return}catch(mt){st(),it(mt);return}st(),ot(dt)},ct=dt=>{st(),it(dt.detail)},lt=()=>{st(),it(nt)};tt==null||tt.addEventListener("abort",lt),et.addEventListener(o,at),(rt==null?void 0:rt.errorEvent)!=null&&et.addEventListener(rt.errorEvent,ct)})}class JobRecipient{constructor(o){wt(this,"deferred");wt(this,"signal");var tt;this.signal=o,this.deferred=pDefer(),this.onAbort=this.onAbort.bind(this),(tt=this.signal)==null||tt.addEventListener("abort",this.onAbort)}onAbort(){var o;this.deferred.reject(((o=this.signal)==null?void 0:o.reason)??new AbortError$6)}cleanup(){var o;(o=this.signal)==null||o.removeEventListener("abort",this.onAbort)}}function randomId(){return`${parseInt(String(Math.random()*1e9),10).toString()}${Date.now()}`}class Job{constructor(o,tt){wt(this,"id");wt(this,"fn");wt(this,"options");wt(this,"recipients");wt(this,"status");wt(this,"timeline");wt(this,"controller");this.id=randomId(),this.status="queued",this.fn=o,this.options=tt,this.recipients=[],this.timeline={created:Date.now()},this.controller=new AbortController,setMaxListeners$2(1/0,this.controller.signal),this.onAbort=this.onAbort.bind(this)}abort(o){this.controller.abort(o)}onAbort(){this.recipients.reduce((tt,rt)=>{var nt;return tt&&((nt=rt.signal)==null?void 0:nt.aborted)===!0},!0)&&(this.controller.abort(new AbortError$6),this.cleanup())}async join(o={}){var rt;const tt=new JobRecipient(o.signal);return this.recipients.push(tt),(rt=o.signal)==null||rt.addEventListener("abort",this.onAbort),tt.deferred.promise}async run(){this.status="running",this.timeline.started=Date.now();try{this.controller.signal.throwIfAborted();const o=await raceSignal(this.fn({...this.options??{},signal:this.controller.signal}),this.controller.signal);this.recipients.forEach(tt=>{tt.deferred.resolve(o)}),this.status="complete"}catch(o){this.recipients.forEach(tt=>{tt.deferred.reject(o)}),this.status="errored"}finally{this.timeline.finished=Date.now(),this.cleanup()}}cleanup(){this.recipients.forEach(o=>{var tt;o.cleanup(),(tt=o.signal)==null||tt.removeEventListener("abort",this.onAbort)})}}class Queue extends TypedEventEmitter$1{constructor(tt={}){var rt;super();wt(this,"concurrency");wt(this,"maxSize");wt(this,"queue");wt(this,"pending");wt(this,"sort");this.concurrency=tt.concurrency??Number.POSITIVE_INFINITY,this.maxSize=tt.maxSize??Number.POSITIVE_INFINITY,this.pending=0,tt.metricName!=null&&((rt=tt.metrics)==null||rt.registerMetricGroup(tt.metricName,{calculate:()=>({size:this.queue.length,running:this.pending,queued:this.queue.length-this.pending})})),this.sort=tt.sort,this.queue=[]}tryToStartAnother(){if(this.size===0)return queueMicrotask(()=>{this.safeDispatchEvent("empty")}),this.running===0&&queueMicrotask(()=>{this.safeDispatchEvent("idle")}),!1;if(this.pending{for(let rt=0;rt(this.safeDispatchEvent("completed",{detail:it}),this.safeDispatchEvent("success",{detail:{job:nt,result:it}}),it)).catch(it=>{if(nt.status==="queued"){for(let st=0;st{tt.abort(new AbortError$6)}),this.clear()}async onEmpty(tt){this.size!==0&&await raceEvent(this,"empty",tt==null?void 0:tt.signal)}async onSizeLessThan(tt,rt){this.sizethis.size{ht!=null?this.abort():this.clear(),rt.end(ht)},ot=ht=>{ht.detail!=null&&rt.push(ht.detail)},it=ht=>{nt(ht.detail)},st=()=>{nt()},at=()=>{nt(new AbortError$6("Queue aborted"))};this.addEventListener("completed",ot),this.addEventListener("error",it),this.addEventListener("idle",st),(lt=tt==null?void 0:tt.signal)==null||lt.addEventListener("abort",at);try{yield*rt}finally{this.removeEventListener("completed",ot),this.removeEventListener("error",it),this.removeEventListener("idle",st),(dt=tt==null?void 0:tt.signal)==null||dt.removeEventListener("abort",at),nt()}}}class PriorityQueue extends Queue{constructor(o={}){super({...o,sort:(tt,rt)=>tt.options.priority>rt.options.priority?-1:tt.options.prioritynt.toString())),rt}const defaultOptions$1={maxParallelDials:MAX_PARALLEL_DIALS,maxDialQueueLength:MAX_DIAL_QUEUE_LENGTH,maxPeerAddrsToDial:MAX_PEER_ADDRS_TO_DIAL,dialTimeout:DIAL_TIMEOUT,resolvers:{dnsaddr:dnsaddrResolver}};class DialQueue{constructor(o,tt={}){wt(this,"queue");wt(this,"components");wt(this,"addressSorter");wt(this,"maxPeerAddrsToDial");wt(this,"maxDialQueueLength");wt(this,"dialTimeout");wt(this,"shutDownController");wt(this,"connections");wt(this,"log");this.addressSorter=tt.addressSorter,this.maxPeerAddrsToDial=tt.maxPeerAddrsToDial??defaultOptions$1.maxPeerAddrsToDial,this.maxDialQueueLength=tt.maxDialQueueLength??defaultOptions$1.maxDialQueueLength,this.dialTimeout=tt.dialTimeout??defaultOptions$1.dialTimeout,this.connections=tt.connections??new PeerMap,this.log=o.logger.forComponent("libp2p:connection-manager:dial-queue"),this.components=o,this.shutDownController=new AbortController,setMaxListeners(1/0,this.shutDownController.signal);for(const[rt,nt]of Object.entries(tt.resolvers??{}))resolvers$1.set(rt,nt);this.queue=new PriorityQueue({concurrency:tt.maxParallelDials??defaultOptions$1.maxParallelDials,metricName:"libp2p_dial_queue",metrics:o.metrics}),this.queue.addEventListener("error",rt=>{rt.detail.name!==AbortError$4.name&&this.log.error("error in dial queue - %e",rt.detail)})}start(){this.shutDownController=new AbortController,setMaxListeners(1/0,this.shutDownController.signal)}stop(){this.shutDownController.abort(),this.queue.abort()}async dial(o,tt={}){var st,at,ct;const{peerId:rt,multiaddrs:nt}=getPeerAddress(o),ot=Array.from(this.connections.values()).flat().find(lt=>tt.force===!0?!1:lt.remotePeer.equals(rt)?!0:nt.find(dt=>dt.equals(lt.remoteAddr)));if((ot==null?void 0:ot.status)==="open")return this.log("already connected to %a",ot.remoteAddr),(st=tt.onProgress)==null||st.call(tt,new CustomProgressEvent("dial-queue:already-connected")),ot;const it=this.queue.queue.find(lt=>{if((rt==null?void 0:rt.equals(lt.options.peerId))===!0)return!0;const dt=lt.options.multiaddrs;if(dt==null)return!1;for(const ht of nt)if(dt.has(ht.toString()))return!0;return!1});if(it!=null){this.log("joining existing dial target for %p",rt);for(const lt of nt)it.options.multiaddrs.add(lt.toString());return(at=tt.onProgress)==null||at.call(tt,new CustomProgressEvent("dial-queue:already-in-dial-queue")),it.join(tt)}if(this.queue.size>=this.maxDialQueueLength)throw new DialError("Dial queue is full");return this.log("creating dial target for %p",rt,nt.map(lt=>lt.toString())),(ct=tt.onProgress)==null||ct.call(tt,new CustomProgressEvent("dial-queue:add-to-dial-queue")),this.queue.add(async lt=>{var mt,ft;(mt=lt==null?void 0:lt.onProgress)==null||mt.call(lt,new CustomProgressEvent("dial-queue:start-dial"));const dt=this.createDialAbortController(lt==null?void 0:lt.signal);let ht;try{ht=await this.calculateMultiaddrs(rt,lt==null?void 0:lt.multiaddrs,{...lt,signal:dt}),(ft=lt==null?void 0:lt.onProgress)==null||ft.call(lt,new CustomProgressEvent("dial-queue:calculated-addresses",ht)),ht.map(({multiaddr:pt})=>pt.toString()).forEach(pt=>{lt==null||lt.multiaddrs.add(pt)})}catch(pt){throw dt.clear(),pt}try{let pt=0;const yt=[];for(const gt of ht){if(pt===this.maxPeerAddrsToDial)throw this.log("dialed maxPeerAddrsToDial (%d) addresses for %p, not trying any others",pt,rt),new DialError("Peer had more than maxPeerAddrsToDial");pt++;try{const bt=await this.components.transportManager.dial(gt.multiaddr,{...lt,signal:dt});this.log("dial to %a succeeded",gt.multiaddr);try{await this.components.peerStore.merge(bt.remotePeer,{multiaddrs:[bt.remoteAddr],metadata:{[LAST_DIAL_SUCCESS_KEY]:fromString$6(Date.now().toString())}})}catch(xt){this.log.error("could not update last dial failure key for %p",rt,xt)}return bt}catch(bt){if(this.log.error("dial failed to %a",gt.multiaddr,bt),rt!=null)try{await this.components.peerStore.merge(rt,{metadata:{[LAST_DIAL_FAILURE_KEY]:fromString$6(Date.now().toString())}})}catch(xt){this.log.error("could not update last dial failure key for %p",rt,xt)}if(dt.aborted)throw new TimeoutError$2(bt.message);yt.push(bt)}}throw yt.length===1?yt[0]:new AggregateError(yt,"All multiaddr dials failed")}finally{dt.clear()}},{peerId:rt,priority:tt.priority??DEFAULT_DIAL_PRIORITY,multiaddrs:new Set(nt.map(lt=>lt.toString())),signal:tt.signal,onProgress:tt.onProgress})}createDialAbortController(o){const tt=anySignal([AbortSignal.timeout(this.dialTimeout),this.shutDownController.signal,o]);return setMaxListeners(1/0,tt),tt}async calculateMultiaddrs(o,tt=new Set,rt={}){var dt,ht;const nt=[...tt].map(mt=>({multiaddr:multiaddr(mt),isCertified:!1}));if(o!=null){if(this.components.peerId.equals(o))throw new DialError("Tried to dial self");if(await((ht=(dt=this.components.connectionGater).denyDialPeer)==null?void 0:ht.call(dt,o))===!0)throw new DialDeniedError("The dial request is blocked by gater.allowDialPeer");if(nt.length===0){this.log("loading multiaddrs for %p",o);try{const mt=await this.components.peerStore.get(o);nt.push(...mt.addresses),this.log("loaded multiaddrs for %p",o,nt.map(({multiaddr:ft})=>ft.toString()))}catch(mt){if(mt.name!=="NotFoundError")throw mt}}if(nt.length===0){this.log("looking up multiaddrs for %p in the peer routing",o);try{const mt=await this.components.peerRouting.findPeer(o);this.log("found multiaddrs for %p in the peer routing",o,nt.map(({multiaddr:ft})=>ft.toString())),nt.push(...mt.multiaddrs.map(ft=>({multiaddr:ft,isCertified:!1})))}catch(mt){mt.name!=="NoPeerRoutersError"&&this.log.error("looking up multiaddrs for %p in the peer routing failed",o,mt)}}}let ot=(await Promise.all(nt.map(async mt=>{const ft=await resolveMultiaddrs(mt.multiaddr,{dns:this.components.dns,...rt,log:this.log});return ft.length===1&&ft[0].equals(mt.multiaddr)?mt:ft.map(pt=>({multiaddr:pt,isCertified:!1}))}))).flat();if(o!=null){const mt=`/p2p/${o.toString()}`;ot=ot.map(ft=>{const pt=ft.multiaddr.protos().pop();return(pt==null?void 0:pt.path)===!0?ft:ft.multiaddr.getPeerId()==null?{multiaddr:ft.multiaddr.encapsulate(mt),isCertified:ft.isCertified}:ft})}const it=ot.filter(mt=>{if(this.components.transportManager.dialTransportForMultiaddr(mt.multiaddr)==null)return!1;const ft=mt.multiaddr.getPeerId();return o!=null&&ft!=null?o.equals(ft):!0}),st=new Map;for(const mt of it){const ft=mt.multiaddr.toString(),pt=st.get(ft);if(pt!=null){pt.isCertified=pt.isCertified||mt.isCertified||!1;continue}st.set(ft,mt)}const at=[...st.values()];if(at.length===0)throw new NoValidAddressesError("The dial request has no valid addresses");const ct=[];for(const mt of at)this.components.connectionGater.denyDialMultiaddr!=null&&await this.components.connectionGater.denyDialMultiaddr(mt.multiaddr)||ct.push(mt);const lt=this.addressSorter==null?defaultAddressSorter(ct):ct.sort(this.addressSorter);if(lt.length===0)throw new DialDeniedError("The connection gater denied all addresses in the dial request");return this.log.trace("addresses for %p before filtering",o??"unknown peer",ot.map(({multiaddr:mt})=>mt.toString())),this.log.trace("addresses for %p after filtering",o??"unknown peer",lt.map(({multiaddr:mt})=>mt.toString())),lt}async isDialable(o,tt={}){Array.isArray(o)||(o=[o]);try{const rt=await this.calculateMultiaddrs(void 0,new Set(o.map(nt=>nt.toString())),tt);return tt.runOnLimitedConnection===!1?rt.find(nt=>!Circuit.matches(nt.multiaddr))!=null:!0}catch(rt){this.log.trace("error calculating if multiaddr(s) were dialable",rt)}return!1}}class PeerQueue extends Queue{has(o){return this.find(o)!=null}find(o){return this.queue.find(tt=>o.equals(tt.options.peerId))}}var retry$2={};function RetryOperation(et,o){typeof o=="boolean"&&(o={forever:o}),this._originalTimeouts=JSON.parse(JSON.stringify(et)),this._timeouts=et,this._options=o||{},this._maxRetryTime=o&&o.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var retry_operation=RetryOperation;RetryOperation.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};RetryOperation.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};RetryOperation.prototype.retry=function(et){if(this._timeout&&clearTimeout(this._timeout),!et)return!1;var o=new Date().getTime();if(et&&o-this._operationStart>=this._maxRetryTime)return this._errors.push(et),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(et);var tt=this._timeouts.shift();if(tt===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),tt=this._cachedTimeouts.slice(-1);else return!1;var rt=this;return this._timer=setTimeout(function(){rt._attempts++,rt._operationTimeoutCb&&(rt._timeout=setTimeout(function(){rt._operationTimeoutCb(rt._attempts)},rt._operationTimeout),rt._options.unref&&rt._timeout.unref()),rt._fn(rt._attempts)},tt),this._options.unref&&this._timer.unref(),!0};RetryOperation.prototype.attempt=function(et,o){this._fn=et,o&&(o.timeout&&(this._operationTimeout=o.timeout),o.cb&&(this._operationTimeoutCb=o.cb));var tt=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){tt._operationTimeoutCb()},tt._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};RetryOperation.prototype.try=function(et){console.log("Using RetryOperation.try() is deprecated"),this.attempt(et)};RetryOperation.prototype.start=function(et){console.log("Using RetryOperation.start() is deprecated"),this.attempt(et)};RetryOperation.prototype.start=RetryOperation.prototype.try;RetryOperation.prototype.errors=function(){return this._errors};RetryOperation.prototype.attempts=function(){return this._attempts};RetryOperation.prototype.mainError=function(){if(this._errors.length===0)return null;for(var et={},o=null,tt=0,rt=0;rt=tt&&(o=nt,tt=it)}return o};(function(et){var o=retry_operation;et.operation=function(tt){var rt=et.timeouts(tt);return new o(rt,{forever:tt&&(tt.forever||tt.retries===1/0),unref:tt&&tt.unref,maxRetryTime:tt&&tt.maxRetryTime})},et.timeouts=function(tt){if(tt instanceof Array)return[].concat(tt);var rt={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var nt in tt)rt[nt]=tt[nt];if(rt.minTimeout>rt.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var ot=[],it=0;itobjectToString.call(et)==="[object Error]",errorMessages=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function isNetworkError(et){return et&&isError(et)&&et.name==="TypeError"&&typeof et.message=="string"?et.message==="Load failed"?et.stack===void 0:errorMessages.has(et.message):!1}let AbortError$1=class extends Error{constructor(o){super(),o instanceof Error?(this.originalError=o,{message:o}=o):(this.originalError=new Error(o),this.originalError.stack=this.stack),this.name="AbortError",this.message=o}};const decorateErrorWithCounts=(et,o,tt)=>{const rt=tt.retries-(o-1);return et.attemptNumber=o,et.retriesLeft=rt,et};async function pRetry(et,o){return new Promise((tt,rt)=>{o={onFailedAttempt(){},retries:10,shouldRetry:()=>!0,...o};const nt=retry$1.operation(o),ot=()=>{var st;nt.stop(),rt((st=o.signal)==null?void 0:st.reason)};o.signal&&!o.signal.aborted&&o.signal.addEventListener("abort",ot,{once:!0});const it=()=>{var st;(st=o.signal)==null||st.removeEventListener("abort",ot),nt.stop()};nt.attempt(async st=>{try{const at=await et(st);it(),tt(at)}catch(at){try{if(!(at instanceof Error))throw new TypeError(`Non-error was thrown: "${at}". You should only throw errors.`);if(at instanceof AbortError$1)throw at.originalError;if(at instanceof TypeError&&!isNetworkError(at))throw at;if(decorateErrorWithCounts(at,st,o),await o.shouldRetry(at)||(nt.stop(),rt(at)),await o.onFailedAttempt(at),!nt.retry(at))throw nt.mainError()}catch(ct){decorateErrorWithCounts(ct,st,o),it(),rt(ct)}}})})}class ReconnectQueue{constructor(o,tt={}){wt(this,"log");wt(this,"queue");wt(this,"started");wt(this,"peerStore");wt(this,"retries");wt(this,"retryInterval");wt(this,"backoffFactor");wt(this,"connectionManager");wt(this,"events");this.log=o.logger.forComponent("libp2p:reconnect-queue"),this.peerStore=o.peerStore,this.connectionManager=o.connectionManager,this.queue=new PeerQueue({concurrency:tt.maxParallelReconnects??MAX_PARALLEL_RECONNECTS,metricName:"libp2p_reconnect_queue",metrics:o.metrics}),this.started=!1,this.retries=tt.retries??5,this.backoffFactor=tt.backoffFactor,this.retryInterval=tt.retryInterval,this.events=o.events,o.events.addEventListener("peer:disconnect",rt=>{this.maybeReconnect(rt.detail).catch(nt=>{this.log.error("failed to maybe reconnect to %p - %e",rt.detail,nt)})})}async maybeReconnect(o){if(!this.started)return;const tt=await this.peerStore.get(o);hasKeepAliveTag(tt)&&(this.queue.has(o)||this.queue.add(async rt=>{await pRetry(async nt=>{if(this.started)try{await this.connectionManager.openConnection(o,{signal:rt==null?void 0:rt.signal})}catch(ot){throw this.log("reconnecting to %p attempt %d of %d failed - %e",o,nt,this.retries,ot),ot}},{signal:rt==null?void 0:rt.signal,retries:this.retries,factor:this.backoffFactor,minTimeout:this.retryInterval})},{peerId:o}).catch(async rt=>{this.log.error("failed to reconnect to %p - %e",o,rt);const nt={};[...tt.tags.keys()].forEach(ot=>{ot.startsWith(KEEP_ALIVE)&&(nt[ot]=void 0)}),await this.peerStore.merge(o,{tags:nt}),this.events.safeDispatchEvent("peer:reconnect-failure",{detail:o})}).catch(async rt=>{this.log.error("failed to remove keep-alive tag from %p - %e",o,rt)}))}start(){this.started=!0}async afterStart(){Promise.resolve().then(async()=>{const o=await this.peerStore.all({filters:[tt=>hasKeepAliveTag(tt)]});await Promise.all(o.map(async tt=>{await this.connectionManager.openConnection(tt.id).catch(rt=>{this.log.error(rt)})}))}).catch(o=>{this.log.error(o)})}stop(){this.started=!1,this.queue.abort()}}function hasKeepAliveTag(et){for(const o of et.tags.keys())if(o.startsWith(KEEP_ALIVE))return!0;return!1}const DEFAULT_DIAL_PRIORITY=50,defaultOptions={maxConnections:MAX_CONNECTIONS,inboundConnectionThreshold:INBOUND_CONNECTION_THRESHOLD,maxIncomingPendingConnections:MAX_INCOMING_PENDING_CONNECTIONS};var zl;zl=Symbol.toStringTag;class DefaultConnectionManager{constructor(o,tt={}){wt(this,"started");wt(this,"connections");wt(this,"allow");wt(this,"deny");wt(this,"maxIncomingPendingConnections");wt(this,"incomingPendingConnections");wt(this,"outboundPendingConnections");wt(this,"maxConnections");wt(this,"dialQueue");wt(this,"reconnectQueue");wt(this,"connectionPruner");wt(this,"inboundConnectionRateLimiter");wt(this,"peerStore");wt(this,"metrics");wt(this,"events");wt(this,"log");wt(this,"peerId");wt(this,zl,"@libp2p/connection-manager");if(this.maxConnections=tt.maxConnections??defaultOptions.maxConnections,this.maxConnections<1)throw new InvalidParametersError$1("Connection Manager maxConnections must be greater than 0");this.connections=new PeerMap,this.started=!1,this.peerId=o.peerId,this.peerStore=o.peerStore,this.metrics=o.metrics,this.events=o.events,this.log=o.logger.forComponent("libp2p:connection-manager"),this.onConnect=this.onConnect.bind(this),this.onDisconnect=this.onDisconnect.bind(this),this.allow=(tt.allow??[]).map(rt=>multiaddr(rt)),this.deny=(tt.deny??[]).map(rt=>multiaddr(rt)),this.incomingPendingConnections=0,this.maxIncomingPendingConnections=tt.maxIncomingPendingConnections??defaultOptions.maxIncomingPendingConnections,this.outboundPendingConnections=0,this.inboundConnectionRateLimiter=new RateLimiter({points:tt.inboundConnectionThreshold??defaultOptions.inboundConnectionThreshold,duration:1}),this.connectionPruner=new ConnectionPruner({connectionManager:this,peerStore:o.peerStore,events:o.events,logger:o.logger},{maxConnections:this.maxConnections,allow:this.allow}),this.dialQueue=new DialQueue(o,{addressSorter:tt.addressSorter,maxParallelDials:tt.maxParallelDials??MAX_PARALLEL_DIALS,maxDialQueueLength:tt.maxDialQueueLength??MAX_DIAL_QUEUE_LENGTH,maxPeerAddrsToDial:tt.maxPeerAddrsToDial??MAX_PEER_ADDRS_TO_DIAL,dialTimeout:tt.dialTimeout??DIAL_TIMEOUT,resolvers:tt.resolvers??{dnsaddr:dnsaddrResolver},connections:this.connections}),this.reconnectQueue=new ReconnectQueue({events:o.events,peerStore:o.peerStore,logger:o.logger,connectionManager:this},{retries:tt.reconnectRetries,retryInterval:tt.reconnectRetryInterval,backoffFactor:tt.reconnectBackoffFactor,maxParallelReconnects:tt.maxParallelReconnects})}async start(){var o,tt,rt;(o=this.metrics)==null||o.registerMetricGroup("libp2p_connection_manager_connections",{calculate:()=>{const nt={inbound:0,"inbound pending":this.incomingPendingConnections,outbound:0,"outbound pending":this.outboundPendingConnections};for(const ot of this.connections.values())for(const it of ot)nt[it.direction]++;return nt}}),(tt=this.metrics)==null||tt.registerMetricGroup("libp2p_protocol_streams_total",{label:"protocol",calculate:()=>{const nt={};for(const ot of this.connections.values())for(const it of ot)for(const st of it.streams){const at=`${st.direction} ${st.protocol??"unnegotiated"}`;nt[at]=(nt[at]??0)+1}return nt}}),(rt=this.metrics)==null||rt.registerMetricGroup("libp2p_connection_manager_protocol_streams_per_connection_90th_percentile",{label:"protocol",calculate:()=>{const nt={};for(const it of this.connections.values())for(const st of it){const at={};for(const ct of st.streams){const lt=`${ct.direction} ${ct.protocol??"unnegotiated"}`;at[lt]=(at[lt]??0)+1}for(const[ct,lt]of Object.entries(at))nt[ct]=nt[ct]??[],nt[ct].push(lt)}const ot={};for(let[it,st]of Object.entries(nt)){st=st.sort((ct,lt)=>ct-lt);const at=Math.floor(st.length*.9);ot[it]=st[at]}return ot}}),this.events.addEventListener("connection:open",this.onConnect),this.events.addEventListener("connection:close",this.onDisconnect),await start(this.dialQueue,this.reconnectQueue,this.connectionPruner),this.started=!0,this.log("started")}async stop(){this.events.removeEventListener("connection:open",this.onConnect),this.events.removeEventListener("connection:close",this.onDisconnect),await stop(this.reconnectQueue,this.dialQueue,this.connectionPruner);const o=[];for(const tt of this.connections.values())for(const rt of tt)o.push((async()=>{try{await rt.close()}catch(nt){this.log.error(nt)}})());this.log("closing %d connections",o.length),await Promise.all(o),this.connections.clear(),this.log("stopped")}onConnect(o){this._onConnect(o).catch(tt=>{this.log.error(tt)})}async _onConnect(o){const{detail:tt}=o;if(!this.started){await tt.close();return}if(tt.status!=="open")return;const rt=tt.remotePeer,nt=!this.connections.has(rt),ot=this.connections.get(rt)??[];ot.push(tt),this.connections.set(rt,ot),rt.publicKey!=null&&rt.type==="RSA"&&await this.peerStore.patch(rt,{publicKey:rt.publicKey}),nt&&this.events.safeDispatchEvent("peer:connect",{detail:tt.remotePeer})}onDisconnect(o){const{detail:tt}=o,rt=tt.remotePeer,ot=(this.connections.get(rt)??[]).filter(it=>it.id!==tt.id);this.connections.set(rt,ot),ot.length===0&&(this.log("onDisconnect remove all connections for peer %p",rt),this.connections.delete(rt),this.events.safeDispatchEvent("peer:disconnect",{detail:tt.remotePeer}))}getConnections(o){if(o!=null)return this.connections.get(o)??[];let tt=[];for(const rt of this.connections.values())tt=tt.concat(rt);return tt}getConnectionsMap(){return this.connections}async openConnection(o,tt={}){var rt,nt;if(!this.started)throw new NotStartedError("Not started");this.outboundPendingConnections++;try{(rt=tt.signal)==null||rt.throwIfAborted();const{peerId:ot}=getPeerAddress(o);if(this.peerId.equals(ot))throw new InvalidPeerIdError("Can not dial self");if(ot!=null&&tt.force!==!0){this.log("dial %p",ot);const ct=this.getConnections(ot).find(lt=>lt.limits==null);if(ct!=null)return this.log("had an existing non-limited connection to %p",ot),(nt=tt.onProgress)==null||nt.call(tt,new CustomProgressEvent("dial-queue:already-connected")),ct}const it=await this.dialQueue.dial(o,{...tt,priority:tt.priority??DEFAULT_DIAL_PRIORITY});if(it.status!=="open")throw new ConnectionClosedError("Remote closed connection during opening");let st=this.connections.get(it.remotePeer);st==null&&(st=[],this.connections.set(it.remotePeer,st));let at=!1;for(const ct of st)if(ct.id===it.id&&(at=!0),tt.force!==!0&&ct.id!==it.id&&ct.remoteAddr.equals(it.remoteAddr))return it.abort(new InvalidMultiaddrError("Duplicate multiaddr connection")),ct;return at||st.push(it),it}finally{this.outboundPendingConnections--}}async closeConnections(o,tt={}){const rt=this.connections.get(o)??[];await Promise.all(rt.map(async nt=>{try{await nt.close(tt)}catch(ot){nt.abort(ot)}}))}async acceptIncomingConnection(o){if(this.deny.some(nt=>o.remoteAddr.toString().startsWith(nt.toString())))return this.log("connection from %a refused - connection remote address was in deny list",o.remoteAddr),!1;if(this.allow.some(nt=>o.remoteAddr.toString().startsWith(nt.toString())))return this.incomingPendingConnections++,!0;if(this.incomingPendingConnections===this.maxIncomingPendingConnections)return this.log("connection from %a refused - incomingPendingConnections exceeded by host",o.remoteAddr),!1;if(o.remoteAddr.isThinWaistAddress()){const nt=o.remoteAddr.nodeAddress().address;try{await this.inboundConnectionRateLimiter.consume(nt,1)}catch{return this.log("connection from %a refused - inboundConnectionThreshold exceeded by host %s",o.remoteAddr,nt),!1}}return this.getConnections().length({id:tt.id,status:o[tt.status],peerId:tt.options.peerId,multiaddrs:[...tt.options.multiaddrs].map(rt=>multiaddr(rt))}))}async isDialable(o,tt={}){return this.dialQueue.isDialable(o,tt)}}class MovingAverage{constructor(o){wt(this,"movingAverage");wt(this,"variance");wt(this,"deviation");wt(this,"forecast");wt(this,"timespan");wt(this,"previousTime");this.timespan=o,this.movingAverage=0,this.variance=0,this.deviation=0,this.forecast=0}alpha(o,tt){return 1-Math.exp(-(o-tt)/this.timespan)}push(o,tt=Date.now()){if(this.previousTime!=null){const rt=this.alpha(tt,this.previousTime),nt=o-this.movingAverage,ot=rt*nt;this.movingAverage=rt*o+(1-rt)*this.movingAverage,this.variance=(1-rt)*(this.variance+nt*ot),this.deviation=Math.sqrt(this.variance),this.forecast=this.movingAverage+rt*nt}else this.movingAverage=o;this.previousTime=tt}}const DEFAULT_TIMEOUT_MULTIPLIER=1.2,DEFAULT_FAILURE_MULTIPLIER=2,DEFAULT_MIN_TIMEOUT=2e3;class AdaptiveTimeout{constructor(o={}){wt(this,"success");wt(this,"failure");wt(this,"next");wt(this,"metric");wt(this,"timeoutMultiplier");wt(this,"failureMultiplier");wt(this,"minTimeout");var tt;this.success=new MovingAverage(o.interval??5e3),this.failure=new MovingAverage(o.interval??5e3),this.next=new MovingAverage(o.interval??5e3),this.failureMultiplier=o.failureMultiplier??DEFAULT_FAILURE_MULTIPLIER,this.timeoutMultiplier=o.timeoutMultiplier??DEFAULT_TIMEOUT_MULTIPLIER,this.minTimeout=o.minTimeout??DEFAULT_MIN_TIMEOUT,o.metricName!=null&&(this.metric=(tt=o.metrics)==null?void 0:tt.registerMetricGroup(o.metricName))}getTimeoutSignal(o={}){const tt=Math.max(Math.round(this.next.movingAverage*(o.timeoutFactor??this.timeoutMultiplier)),this.minTimeout),rt=AbortSignal.timeout(tt),nt=anySignal([o.signal,rt]);return setMaxListeners$2(1/0,nt,rt),nt.start=Date.now(),nt.timeout=tt,nt}cleanUp(o){var rt,nt;const tt=Date.now()-o.start;o.aborted?(this.failure.push(tt),this.next.push(tt*this.failureMultiplier),(rt=this.metric)==null||rt.update({failureMovingAverage:this.failure.movingAverage,failureDeviation:this.failure.deviation,failureForecast:this.failure.forecast,failureVariance:this.failure.variance,failure:tt})):(this.success.push(tt),this.next.push(tt),(nt=this.metric)==null||nt.update({successMovingAverage:this.success.movingAverage,successDeviation:this.success.deviation,successForecast:this.success.forecast,successVariance:this.success.variance,success:tt}))}}const DEFAULT_PING_INTERVAL_MS=1e4,PROTOCOL_VERSION="1.0.0",PROTOCOL_NAME="ping",PROTOCOL_PREFIX="ipfs",PING_LENGTH=32,DEFAULT_ABORT_CONNECTION_ON_PING_FAILURE=!0;var Vl,Hl;Hl=Symbol.toStringTag,Vl=serviceCapabilities;class ConnectionMonitor{constructor(o,tt={}){wt(this,"protocol");wt(this,"components");wt(this,"log");wt(this,"heartbeatInterval");wt(this,"pingIntervalMs");wt(this,"abortController");wt(this,"timeout");wt(this,"abortConnectionOnPingFailure");wt(this,Hl,"@libp2p/connection-monitor");wt(this,Vl,["@libp2p/connection-monitor"]);this.components=o,this.protocol=`/${tt.protocolPrefix??PROTOCOL_PREFIX}/${PROTOCOL_NAME}/${PROTOCOL_VERSION}`,this.log=o.logger.forComponent("libp2p:connection-monitor"),this.pingIntervalMs=tt.pingInterval??DEFAULT_PING_INTERVAL_MS,this.abortConnectionOnPingFailure=tt.abortConnectionOnPingFailure??DEFAULT_ABORT_CONNECTION_ON_PING_FAILURE,this.timeout=new AdaptiveTimeout({...tt.pingTimeout??{},metrics:o.metrics,metricName:"libp2p_connection_monitor_ping_time_milliseconds"})}start(){this.abortController=new AbortController,setMaxListeners(1/0,this.abortController.signal),this.heartbeatInterval=setInterval(()=>{this.components.connectionManager.getConnections().forEach(o=>{Promise.resolve().then(async()=>{var rt;let tt=Date.now();try{const nt=this.timeout.getTimeoutSignal({signal:(rt=this.abortController)==null?void 0:rt.signal}),ot=await o.newStream(this.protocol,{signal:nt,runOnLimitedConnection:!0}),it=byteStream(ot);tt=Date.now(),await Promise.all([it.write(randomBytes(PING_LENGTH),{signal:nt}),it.read(PING_LENGTH,{signal:nt})]),o.rtt=Date.now()-tt,await it.unwrap().close({signal:nt})}catch(nt){if(nt.name!=="UnsupportedProtocolError")throw nt;o.rtt=(Date.now()-tt)/2}}).catch(tt=>{this.log.error("error during heartbeat",tt),this.abortConnectionOnPingFailure?(this.log.error("aborting connection due to ping failure"),o.abort(tt)):this.log("connection ping failed, but not aborting due to abortConnectionOnPingFailure flag")})})},this.pingIntervalMs)}stop(){var o;(o=this.abortController)==null||o.abort(),this.heartbeatInterval!=null&&clearInterval(this.heartbeatInterval)}}var Wl;Wl=Symbol.toStringTag;class CompoundContentRouting{constructor(o,tt){wt(this,"routers");wt(this,"started");wt(this,"components");wt(this,Wl,"@libp2p/content-routing");this.routers=tt.routers??[],this.started=!1,this.components=o}isStarted(){return this.started}async start(){this.started=!0}async stop(){this.started=!1}async*findProviders(o,tt={}){if(this.routers.length===0)throw new NoContentRoutersError("No content routers available");const rt=this,nt=new PeerSet;for await(const ot of merge$2(...rt.routers.map(it=>it.findProviders(o,tt))))ot!=null&&(ot.multiaddrs.length>0&&await this.components.peerStore.merge(ot.id,{multiaddrs:ot.multiaddrs}),!nt.has(ot.id)&&(nt.add(ot.id),yield ot))}async provide(o,tt={}){if(this.routers.length===0)throw new NoContentRoutersError("No content routers available");await Promise.all(this.routers.map(async rt=>{await rt.provide(o,tt)}))}async put(o,tt,rt){if(!this.isStarted())throw new NotStartedError;await Promise.all(this.routers.map(async nt=>{await nt.put(o,tt,rt)}))}async get(o,tt){if(!this.isStarted())throw new NotStartedError;return Promise.any(this.routers.map(async rt=>rt.get(o,tt)))}}var Gl;Gl=Symbol.toStringTag;class DefaultPeerRouting{constructor(o,tt={}){wt(this,"log");wt(this,"peerId");wt(this,"peerStore");wt(this,"routers");wt(this,Gl,"@libp2p/peer-routing");this.log=o.logger.forComponent("libp2p:peer-routing"),this.peerId=o.peerId,this.peerStore=o.peerStore,this.routers=tt.routers??[]}async findPeer(o,tt){if(this.routers.length===0)throw new NoPeerRoutersError("No peer routers available");if(o.toString()===this.peerId.toString())throw new QueriedForSelfError("Should not try to find self");const rt=this,nt=merge$2(...this.routers.map(ot=>async function*(){try{yield await ot.findPeer(o,tt)}catch(it){rt.log.error(it)}}()));for await(const ot of nt)if(ot!=null)return ot.multiaddrs.length>0&&await this.peerStore.merge(ot.id,{multiaddrs:ot.multiaddrs}),ot;throw new NotFoundError$1}async*getClosestPeers(o,tt={}){if(this.routers.length===0)throw new NoPeerRoutersError("No peer routers available");const rt=this,nt=createScalableCuckooFilter(1024);for await(const ot of parallel(async function*(){const it=merge$2(...rt.routers.map(st=>st.getClosestPeers(o,tt)));for await(let st of it)yield async()=>{if(st.multiaddrs.length===0)try{st=await rt.findPeer(st.id,{...tt,useCache:!1})}catch(at){rt.log.error("could not find peer multiaddrs",at);return}return st}}()))ot!=null&&(ot.multiaddrs.length>0&&await this.peerStore.merge(ot.id,{multiaddrs:ot.multiaddrs}),!nt.has(ot.id.toMultihash().bytes)&&(nt.add(ot.id.toMultihash().bytes),yield ot))}}var Kl,Ql;class RandomWalk extends(Ql=TypedEventEmitter,Kl=Symbol.toStringTag,Ql){constructor(tt){super();wt(this,"peerRouting");wt(this,"log");wt(this,"walking");wt(this,"walkers");wt(this,"shutdownController");wt(this,"walkController");wt(this,"needNext");wt(this,Kl,"@libp2p/random-walk");this.log=tt.logger.forComponent("libp2p:random-walk"),this.peerRouting=tt.peerRouting,this.walkers=0,this.walking=!1,this.shutdownController=new AbortController,setMaxListeners(1/0,this.shutdownController.signal)}start(){this.shutdownController=new AbortController,setMaxListeners(1/0,this.shutdownController.signal)}stop(){this.shutdownController.abort()}async*walk(tt){var nt,ot;this.walking||this.startWalk(),this.walkers++;const rt=anySignal([this.shutdownController.signal,tt==null?void 0:tt.signal]);setMaxListeners(1/0,rt);try{for(;;)(nt=this.needNext)==null||nt.resolve(),this.needNext=pDefer(),yield(await raceEvent(this,"walk:peer",rt,{errorEvent:"walk:error"})).detail}finally{rt.clear(),this.walkers--,this.walkers===0&&((ot=this.walkController)==null||ot.abort(),this.walkController=void 0)}}startWalk(){this.walking=!0,this.walkController=new AbortController,setMaxListeners(1/0,this.walkController.signal);const tt=anySignal([this.walkController.signal,this.shutdownController.signal]);setMaxListeners(1/0,tt);const rt=Date.now();let nt=0;Promise.resolve().then(async()=>{for(this.log("start walk");this.walkers>0;)try{const ot=randomBytes(32);let it=Date.now();for await(const st of this.peerRouting.getClosestPeers(ot,{signal:tt}))tt.aborted&&this.log("aborting walk"),tt.throwIfAborted(),this.log("found peer %p after %dms for %d walkers",st.id,Date.now()-it,this.walkers),nt++,this.safeDispatchEvent("walk:peer",{detail:st}),this.walkers===1&&this.needNext!=null&&(this.log("wait for need next"),await raceSignal(this.needNext.promise,tt)),it=Date.now();this.log("walk iteration for %b and %d walkers finished, found %d peers",ot,this.walkers,nt)}catch(ot){this.log.error("randomwalk errored",ot),this.safeDispatchEvent("walk:error",{detail:ot})}this.log("no walkers left, ended walk")}).catch(ot=>{this.log.error("randomwalk errored",ot)}).finally(()=>{this.log("finished walk, found %d peers after %dms",nt,Date.now()-rt),this.walking=!1})}}const DEFAULT_MAX_INBOUND_STREAMS=32,DEFAULT_MAX_OUTBOUND_STREAMS=64;var Xl;Xl=Symbol.toStringTag;class DefaultRegistrar{constructor(o){wt(this,"log");wt(this,"topologies");wt(this,"handlers");wt(this,"components");wt(this,Xl,"@libp2p/registrar");this.log=o.logger.forComponent("libp2p:registrar"),this.topologies=new Map,this.handlers=new Map,this.components=o,this._onDisconnect=this._onDisconnect.bind(this),this._onPeerUpdate=this._onPeerUpdate.bind(this),this._onPeerIdentify=this._onPeerIdentify.bind(this),this.components.events.addEventListener("peer:disconnect",this._onDisconnect),this.components.events.addEventListener("peer:update",this._onPeerUpdate),this.components.events.addEventListener("peer:identify",this._onPeerIdentify)}getProtocols(){return Array.from(new Set([...this.handlers.keys()])).sort()}getHandler(o){const tt=this.handlers.get(o);if(tt==null)throw new UnhandledProtocolError(`No handler registered for protocol ${o}`);return tt}getTopologies(o){const tt=this.topologies.get(o);return tt==null?[]:[...tt.values()]}async handle(o,tt,rt){if(this.handlers.has(o))throw new DuplicateProtocolHandlerError(`Handler already registered for protocol ${o}`);const nt=mergeOptions$1.bind({ignoreUndefined:!0})({maxInboundStreams:DEFAULT_MAX_INBOUND_STREAMS,maxOutboundStreams:DEFAULT_MAX_OUTBOUND_STREAMS},rt);this.handlers.set(o,{handler:tt,options:nt}),await this.components.peerStore.merge(this.components.peerId,{protocols:[o]})}async unhandle(o){(Array.isArray(o)?o:[o]).forEach(rt=>{this.handlers.delete(rt)}),await this.components.peerStore.patch(this.components.peerId,{protocols:this.getProtocols()})}async register(o,tt){if(tt==null)throw new InvalidParametersError$1("invalid topology");const rt=`${(Math.random()*1e9).toString(36)}${Date.now()}`;let nt=this.topologies.get(o);return nt==null&&(nt=new Map,this.topologies.set(o,nt)),nt.set(rt,tt),rt}unregister(o){for(const[tt,rt]of this.topologies.entries())rt.has(o)&&(rt.delete(o),rt.size===0&&this.topologies.delete(tt))}_onDisconnect(o){const tt=o.detail;this.components.peerStore.get(tt).then(rt=>{var nt,ot,it;for(const st of rt.protocols){const at=this.topologies.get(st);if(at!=null)for(const ct of at.values())((nt=ct.filter)==null?void 0:nt.has(tt))!==!1&&((ot=ct.filter)==null||ot.remove(tt),(it=ct.onDisconnect)==null||it.call(ct,tt))}}).catch(rt=>{rt.name!=="NotFoundError"&&this.log.error("could not inform topologies of disconnecting peer %p",tt,rt)})}_onPeerUpdate(o){var ot,it,st;const{peer:tt,previous:rt}=o.detail,nt=((rt==null?void 0:rt.protocols)??[]).filter(at=>!tt.protocols.includes(at));for(const at of nt){const ct=this.topologies.get(at);if(ct!=null)for(const lt of ct.values())((ot=lt.filter)==null?void 0:ot.has(tt.id))!==!1&&((it=lt.filter)==null||it.remove(tt.id),(st=lt.onDisconnect)==null||st.call(lt,tt.id))}}_onPeerIdentify(o){var ot,it,st;const tt=o.detail.protocols,rt=o.detail.connection,nt=o.detail.peerId;for(const at of tt){const ct=this.topologies.get(at);if(ct!=null)for(const lt of ct.values())rt.limits!=null&<.notifyOnLimitedConnection!==!0||((ot=lt.filter)==null?void 0:ot.has(nt))!==!0&&((it=lt.filter)==null||it.add(nt),(st=lt.onConnect)==null||st.call(lt,nt,rt))}}}class TrackedMap extends Map{constructor(tt){super();wt(this,"metric");const{name:rt,metrics:nt}=tt;this.metric=nt.registerMetric(rt),this.updateComponentMetric()}set(tt,rt){return super.set(tt,rt),this.updateComponentMetric(),this}delete(tt){const rt=super.delete(tt);return this.updateComponentMetric(),rt}clear(){super.clear(),this.updateComponentMetric()}updateComponentMetric(){this.metric.update(this.size)}}function trackedMap(et){const{name:o,metrics:tt}=et;let rt;return tt!=null?rt=new TrackedMap({name:o,metrics:tt}):rt=new Map,rt}var Yl;Yl=Symbol.toStringTag;class DefaultTransportManager{constructor(o,tt={}){wt(this,"log");wt(this,"components");wt(this,"transports");wt(this,"listeners");wt(this,"faultTolerance");wt(this,"started");wt(this,Yl,"@libp2p/transport-manager");this.log=o.logger.forComponent("libp2p:transports"),this.components=o,this.started=!1,this.transports=new Map,this.listeners=trackedMap({name:"libp2p_transport_manager_listeners",metrics:this.components.metrics}),this.faultTolerance=tt.faultTolerance??FaultTolerance.FATAL_ALL}add(o){const tt=o[Symbol.toStringTag];if(tt==null)throw new InvalidParametersError$1("Transport must have a valid tag");if(this.transports.has(tt))throw new InvalidParametersError$1(`There is already a transport with the tag ${tt}`);this.log("adding transport %s",tt),this.transports.set(tt,o),this.listeners.has(tt)||this.listeners.set(tt,[])}isStarted(){return this.started}start(){this.started=!0}async afterStart(){const o=this.components.addressManager.getListenAddrs();await this.listen(o)}async stop(){const o=[];for(const[tt,rt]of this.listeners)for(this.log("closing listeners for %s",tt);rt.length>0;){const nt=rt.pop();nt!=null&&o.push(nt.close())}await Promise.all(o),this.log("all listeners closed");for(const tt of this.listeners.keys())this.listeners.set(tt,[]);this.started=!1}async dial(o,tt){var nt;const rt=this.dialTransportForMultiaddr(o);if(rt==null)throw new TransportUnavailableError(`No transport available for address ${String(o)}`);return(nt=tt==null?void 0:tt.onProgress)==null||nt.call(tt,new CustomProgressEvent("transport-manager:selected-transport",rt[Symbol.toStringTag])),rt.dial(o,{...tt,upgrader:this.components.upgrader})}getAddrs(){let o=[];for(const tt of this.listeners.values())for(const rt of tt)o=[...o,...rt.getAddrs()];return o}getTransports(){return Array.of(...this.transports.values())}getListeners(){return Array.of(...this.listeners.values()).flat()}dialTransportForMultiaddr(o){for(const tt of this.transports.values())if(tt.dialFilter([o]).length>0)return tt}listenTransportForMultiaddr(o){for(const tt of this.transports.values())if(tt.listenFilter([o]).length>0)return tt}async listen(o){if(!this.isStarted())throw new NotStartedError("Not started");if(o==null||o.length===0){this.log("no addresses were provided for listening, this node is dial only");return}const tt=[];for(const[rt,nt]of this.transports.entries()){const ot=nt.listenFilter(o),it=[];for(const ct of ot){this.log("creating listener for %s on %a",rt,ct);const lt=nt.createListener({upgrader:this.components.upgrader});let dt=this.listeners.get(rt)??[];dt==null&&(dt=[],this.listeners.set(rt,dt)),dt.push(lt),lt.addEventListener("listening",()=>{this.components.events.safeDispatchEvent("transport:listening",{detail:lt})}),lt.addEventListener("close",()=>{const ht=dt.findIndex(mt=>mt===lt);dt.splice(ht,1),this.components.events.safeDispatchEvent("transport:close",{detail:lt})}),it.push(lt.listen(ct))}if(it.length===0){tt.push(rt);continue}if((await Promise.allSettled(it)).find(ct=>ct.status==="fulfilled")==null&&this.faultTolerance!==FaultTolerance.NO_FATAL)throw new NoValidAddressesError(`Transport (${rt}) could not listen on any available address`)}if(tt.length===this.transports.size){const rt=`no valid addresses were provided for transports [${tt.join(", ")}]`;if(this.faultTolerance===FaultTolerance.FATAL_ALL)throw new NoValidAddressesError(rt);this.log(`libp2p in dial mode only: ${rt}`)}}async remove(o){const tt=this.listeners.get(o)??[];this.log.trace("removing transport %s",o);const rt=[];for(this.log.trace("closing listeners for %s",o);tt.length>0;){const nt=tt.pop();nt!=null&&rt.push(nt.close())}await Promise.all(rt),this.transports.delete(o),this.listeners.delete(o)}async removeAll(){const o=[];for(const tt of this.transports.keys())o.push(this.remove(tt));await Promise.all(o)}}const PROTOCOL_ID="/multistream/1.0.0",MAX_PROTOCOL_LENGTH=1024;class UnsupportedProtocolError extends Error{constructor(o="Unsupported protocol error"){super(o),this.name="UnsupportedProtocolError"}}wt(UnsupportedProtocolError,"name","UnsupportedProtocolError");class InvalidMessageError extends Error{constructor(o="Invalid message"){super(o),this.name="InvalidMessageError"}}wt(InvalidMessageError,"name","InvalidMessageError");function coerce$2(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$5(et){return new TextEncoder().encode(et)}function toString$a(et){return new TextDecoder().decode(et)}function base$2(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$3=base$2,_brrp__multiformats_scope_baseX$2=src$3;let Encoder$2=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$2=class{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$2(this,o)}},ComposedDecoder$2=class{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or$2(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function or$2(et,o){return new ComposedDecoder$2({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}let Codec$2=class{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$2(o,tt,rt),this.decoder=new Decoder$2(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};function from$3({name:et,prefix:o,encode:tt,decode:rt}){return new Codec$2(et,o,tt,rt)}function baseX$2({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$2(tt,et);return from$3({prefix:o,name:et,encode:rt,decode:ot=>coerce$2(nt(ot))})}function decode$a(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$9(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes$2=alphabet$2.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode$8(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$2[tt],o),"")}function decode$9(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes$2[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji$4=from$3({prefix:"🚀",name:"base256emoji",encode:encode$8,decode:decode$9}),base256emoji$5=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$4},Symbol.toStringTag,{value:"Module"})),base32$6=rfc4648$2({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$2=rfc4648$2({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$2=rfc4648$2({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$2=rfc4648$2({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$2=rfc4648$2({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$2=rfc4648$2({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$2=rfc4648$2({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$2=rfc4648$2({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$2=rfc4648$2({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$7=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$6,base32hex:base32hex$2,base32hexpad:base32hexpad$2,base32hexpadupper:base32hexpadupper$2,base32hexupper:base32hexupper$2,base32pad:base32pad$2,base32padupper:base32padupper$2,base32upper:base32upper$2,base32z:base32z$2},Symbol.toStringTag,{value:"Module"})),base36$4=baseX$2({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$2=baseX$2({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$5=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$4,base36upper:base36upper$2},Symbol.toStringTag,{value:"Module"})),base58btc$2=baseX$2({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$2=baseX$2({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$2=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$2,base58flickr:base58flickr$2},Symbol.toStringTag,{value:"Module"})),base64$6=rfc4648$2({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$2=rfc4648$2({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$2=rfc4648$2({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$2=rfc4648$2({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$7=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$6,base64pad:base64pad$2,base64url:base64url$2,base64urlpad:base64urlpad$2},Symbol.toStringTag,{value:"Module"})),base8$4=rfc4648$2({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$5=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$4},Symbol.toStringTag,{value:"Module"})),identity$2=from$3({prefix:"\0",name:"identity",encode:et=>toString$a(et),decode:et=>fromString$5(et)}),identityBase$2=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$2},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$2={...identityBase$2,...base2$5,...base8$5,...base10$5,...base16$5,...base32$7,...base36$5,...base58$2,...base64$7,...base256emoji$5};function allocUnsafe$1(et=0){return new Uint8Array(et)}function createCodec$2(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$5=createCodec$2("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$2=createCodec$2("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$1(et.length);for(let tt=0;tt{const{sink:xt}=ft.unwrap();await xt(async function*(){let vt=!1;for await(const Et of bt){if(ct&&await lt.promise,at)yield Et;else{ct=!0,tt.log.trace('optimistic: write ["%s", "%s", data(%d)] in sink',PROTOCOL_ID,o,Et.byteLength);const Ct=`${o} -`;yield new Uint8ArrayList(Uint8Array.from([19]),fromString$4(`${PROTOCOL_ID} -`),encode$P(Ct.length),fromString$4(Ct),Et).subarray(),tt.log.trace('optimistic: wrote ["%s", "%s", data(%d)] in sink',PROTOCOL_ID,o,Et.byteLength),at=!0,ct=!1,lt.resolve(),pt().catch(St=>{tt.log.error("could not finish optimistic protocol negotiation of %s",o,St)})}vt=!0}vt||await pt()}())};async function pt(){if(it){tt.log.trace("optimistic: already negotiating %s stream",o),await st.promise;return}it=!0;try{at||(tt.log.trace("optimistic: doing send protocol for %s stream",o),await yt()),dt||(tt.log.trace("optimistic: doing read protocol for %s stream",o),await gt())}finally{it=!1,ot=!0,st.resolve()}}async function yt(){if(ct){await lt.promise;return}ct=!0;try{tt.log.trace('optimistic: write ["%s", "%s", data] in source',PROTOCOL_ID,o),await ft.writeV([fromString$4(`${PROTOCOL_ID} -`),fromString$4(`${o} -`)]),tt.log.trace('optimistic: wrote ["%s", "%s", data] in source',PROTOCOL_ID,o)}finally{at=!0,ct=!1,lt.resolve()}}async function gt(){if(ht){await mt.promise;return}ht=!0;try{tt.log.trace("optimistic: reading multistream select header");let bt=await readString(ft,tt);if(tt.log.trace('optimistic: read multistream select header "%s"',bt),bt===PROTOCOL_ID&&(bt=await readString(ft,tt)),tt.log.trace('optimistic: read protocol "%s", expecting "%s"',bt,o),bt!==o)throw new UnsupportedProtocolError("protocol selection failed")}finally{dt=!0,ht=!1,mt.resolve()}}if(et.source=async function*(){await pt(),tt.log.trace('optimistic: reading data from "%s" stream',o),yield*ft.unwrap().source}(),et.closeRead!=null){const bt=et.closeRead.bind(et);et.closeRead=async xt=>{ot||await pt().catch(vt=>{tt.log.error("could not negotiate protocol before close read",vt)}),await bt(xt)}}if(et.closeWrite!=null){const bt=et.closeWrite.bind(et);et.closeWrite=async xt=>{ot||await pt().catch(vt=>{tt.log.error("could not negotiate protocol before close write",vt)}),await bt(xt)}}if(et.close!=null){const bt=et.close.bind(et);et.close=async xt=>{const vt=[];ct&&vt.push(lt.promise),ht&&vt.push(mt.promise),vt.length>0?await raceSignal(Promise.all(vt),xt==null?void 0:xt.signal):(ot=!0,it=!1,st.resolve()),await bt(xt)}}return{stream:et,protocol:o}}async function handle(et,o,tt){o=Array.isArray(o)?o:[o],tt.log.trace("handle: available protocols %s",o);const rt=lpStream(et,{...tt,maxDataLength:MAX_PROTOCOL_LENGTH,maxLengthLength:2});for(;;){tt.log.trace("handle: reading incoming string");const nt=await readString(rt,tt);if(tt.log.trace('handle: read "%s"',nt),nt===PROTOCOL_ID){tt.log.trace('handle: respond with "%s" for "%s"',PROTOCOL_ID,nt),await write$1(rt,fromString$4(`${PROTOCOL_ID} -`),tt),tt.log.trace('handle: responded with "%s" for "%s"',PROTOCOL_ID,nt);continue}if(o.includes(nt))return tt.log.trace('handle: respond with "%s" for "%s"',nt,nt),await write$1(rt,fromString$4(`${nt} -`),tt),tt.log.trace('handle: responded with "%s" for "%s"',nt,nt),{stream:rt.unwrap(),protocol:nt};if(nt==="ls"){const ot=new Uint8ArrayList(...o.map(it=>encode$K.single(fromString$4(`${it} -`))),fromString$4(` -`));tt.log.trace('handle: respond with "%s" for %s',o,nt),await write$1(rt,ot,tt),tt.log.trace('handle: responded with "%s" for %s',o,nt);continue}tt.log.trace('handle: respond with "na" for "%s"',nt),await write$1(rt,fromString$4(`na -`),tt),tt.log('handle: responded with "na" for "%s"',nt)}}const CLOSE_TIMEOUT=500;var Zl,Jl;Jl=Symbol.toStringTag,Zl=connectionSymbol;class ConnectionImpl{constructor(o){wt(this,"id");wt(this,"remoteAddr");wt(this,"remotePeer");wt(this,"direction");wt(this,"timeline");wt(this,"multiplexer");wt(this,"encryption");wt(this,"status");wt(this,"limits");wt(this,"log");wt(this,"tags");wt(this,"_newStream");wt(this,"_close");wt(this,"_abort");wt(this,"_getStreams");wt(this,Jl,"Connection");wt(this,Zl,!0);const{remoteAddr:tt,remotePeer:rt,newStream:nt,close:ot,abort:it,getStreams:st}=o;this.id=`${parseInt(String(Math.random()*1e9)).toString(36)}${Date.now()}`,this.remoteAddr=tt,this.remotePeer=rt,this.direction=o.direction,this.status="open",this.timeline=o.timeline,this.multiplexer=o.multiplexer,this.encryption=o.encryption,this.limits=o.limits,this.log=o.logger.forComponent(`libp2p:connection:${this.direction}:${this.id}`),this.remoteAddr.getPeerId()==null&&(this.remoteAddr=this.remoteAddr.encapsulate(`/p2p/${this.remotePeer}`)),this._newStream=nt,this._close=ot,this._abort=it,this._getStreams=st,this.tags=[]}get streams(){return this._getStreams()}async newStream(o,tt){if(this.status==="closing")throw new ConnectionClosingError("the connection is being closed");if(this.status==="closed")throw new ConnectionClosedError("the connection is closed");if(Array.isArray(o)||(o=[o]),this.limits!=null&&(tt==null?void 0:tt.runOnLimitedConnection)!==!0)throw new LimitedConnectionError("Cannot open protocol stream on limited connection");const rt=await this._newStream(o,tt);return rt.direction="outbound",rt}async close(o={}){if(!(this.status==="closed"||this.status==="closing")){if(this.log("closing connection to %a",this.remoteAddr),this.status="closing",o.signal==null){const tt=AbortSignal.timeout(CLOSE_TIMEOUT);setMaxListeners(1/0,tt),o={...o,signal:tt}}try{this.log.trace("closing underlying transport"),await this._close(o),this.log.trace("updating timeline with close time"),this.status="closed",this.timeline.close=Date.now()}catch(tt){this.log.error("error encountered during graceful close of connection to %a",this.remoteAddr,tt),this.abort(tt)}}}abort(o){this.status!=="closed"&&(this.log.error("aborting connection to %a due to error",this.remoteAddr,o),this.status="closing",this._abort(o),this.status="closed",this.timeline.close=Date.now())}}function createConnection(et){return new ConnectionImpl(et)}function findIncomingStreamLimit(et,o){try{const{options:tt}=o.getHandler(et);return tt.maxInboundStreams}catch(tt){if(tt.name!=="UnhandledProtocolError")throw tt}return DEFAULT_MAX_INBOUND_STREAMS}function findOutgoingStreamLimit(et,o,tt={}){try{const{options:rt}=o.getHandler(et);if(rt.maxOutboundStreams!=null)return rt.maxOutboundStreams}catch(rt){if(rt.name!=="UnhandledProtocolError")throw rt}return tt.maxOutboundStreams??DEFAULT_MAX_OUTBOUND_STREAMS}function countStreams(et,o,tt){let rt=0;return tt.streams.forEach(nt=>{nt.direction===o&&nt.protocol===et&&rt++}),rt}var eu;eu=Symbol.toStringTag;class DefaultUpgrader{constructor(o,tt){wt(this,"components");wt(this,"connectionEncrypters");wt(this,"streamMuxers");wt(this,"inboundUpgradeTimeout");wt(this,"outboundUpgradeTimeout");wt(this,"inboundStreamProtocolNegotiationTimeout");wt(this,"outboundStreamProtocolNegotiationTimeout");wt(this,"events");wt(this,"metrics");wt(this,eu,"@libp2p/upgrader");var rt,nt;this.components=o,this.connectionEncrypters=new Map,tt.connectionEncrypters.forEach(ot=>{this.connectionEncrypters.set(ot.protocol,ot)}),this.streamMuxers=new Map,tt.streamMuxers.forEach(ot=>{this.streamMuxers.set(ot.protocol,ot)}),this.inboundUpgradeTimeout=tt.inboundUpgradeTimeout??UPGRADE_TIMEOUT,this.outboundUpgradeTimeout=tt.outboundUpgradeTimeout??UPGRADE_TIMEOUT,this.inboundStreamProtocolNegotiationTimeout=tt.inboundStreamProtocolNegotiationTimeout??PROTOCOL_NEGOTIATION_TIMEOUT,this.outboundStreamProtocolNegotiationTimeout=tt.outboundStreamProtocolNegotiationTimeout??PROTOCOL_NEGOTIATION_TIMEOUT,this.events=o.events,this.metrics={dials:(rt=o.metrics)==null?void 0:rt.registerCounterGroup("libp2p_connection_manager_dials_total"),errors:(nt=o.metrics)==null?void 0:nt.registerCounterGroup("libp2p_connection_manager_dial_errors_total")}}async shouldBlockConnection(o,...tt){const rt=this.components.connectionGater[o];if(rt==null)return;if(await rt.apply(this.components.connectionGater,tt)===!0)throw new ConnectionInterceptedError(`The multiaddr connection is blocked by gater.${o}`)}async upgradeInbound(o,tt={}){var rt,nt;try{if((rt=this.metrics.dials)==null||rt.increment({inbound:!0}),!await this.components.connectionManager.acceptIncomingConnection(o))throw new ConnectionDeniedError("connection denied");return await this.shouldBlockConnection("denyInboundConnection",o),await this._performUpgrade(o,"inbound",tt)}catch(ot){throw(nt=this.metrics.errors)==null||nt.increment({inbound:!0}),ot}finally{this.components.connectionManager.afterUpgradeInbound()}}async upgradeOutbound(o,tt={}){var rt,nt;try{(rt=this.metrics.dials)==null||rt.increment({outbound:!0});const ot=o.remoteAddr.getPeerId();let it;return ot!=null&&(it=peerIdFromString$1(ot),await this.shouldBlockConnection("denyOutboundConnection",it,o)),await this._performUpgrade(o,"outbound",tt)}catch(ot){throw(nt=this.metrics.errors)==null||nt.increment({outbound:!0}),ot}}async _performUpgrade(o,tt,rt){var ht,mt,ft;let nt,ot,it,st,at;const ct=AbortSignal.timeout(tt==="inbound"?this.inboundUpgradeTimeout:this.outboundUpgradeTimeout),lt=anySignal([ct,rt.signal]);setMaxListeners(1/0,ct,lt),rt.signal=lt,(ht=this.components.metrics)==null||ht.trackMultiaddrConnection(o),o.log.trace("starting the %s connection upgrade",tt);let dt=o;if((rt==null?void 0:rt.skipProtection)!==!0){const pt=this.components.connectionProtector;pt!=null&&(o.log("protecting the %s connection",tt),dt=await pt.protect(o,rt))}try{if(nt=dt,(rt==null?void 0:rt.skipEncryption)!==!0){(mt=rt==null?void 0:rt.onProgress)==null||mt.call(rt,new CustomProgressEvent(`upgrader:encrypt-${tt}-connection`)),{conn:nt,remotePeer:ot,protocol:at}=await(tt==="inbound"?this._encryptInbound(dt,{...rt,signal:lt}):this._encryptOutbound(dt,{...rt,signal:lt}));const pt={...dt,...nt};await this.shouldBlockConnection(tt==="inbound"?"denyInboundEncryptedConnection":"denyOutboundEncryptedConnection",ot,pt)}else{const pt=o.remoteAddr.getPeerId();if(pt==null)throw new InvalidMultiaddrError(`${tt} connection that skipped encryption must have a peer id`);const yt=peerIdFromString$1(pt);at="native",ot=yt}if(ot.equals(this.components.peerId)){const pt=new InvalidPeerIdError("Can not dial self");throw o.abort(pt),pt}if(it=nt,(rt==null?void 0:rt.muxerFactory)!=null)st=rt.muxerFactory;else if(this.streamMuxers.size>0){(ft=rt==null?void 0:rt.onProgress)==null||ft.call(rt,new CustomProgressEvent(`upgrader:multiplex-${tt}-connection`));const pt=await(tt==="inbound"?this._multiplexInbound({...dt,...nt},this.streamMuxers,rt):this._multiplexOutbound({...dt,...nt},this.streamMuxers,rt));st=pt.muxerFactory,it=pt.stream}}catch(pt){throw o.log.error("failed to upgrade inbound connection %s %a - %e",tt==="inbound"?"from":"to",o.remoteAddr,pt),pt}finally{lt.clear()}return await this.shouldBlockConnection(tt==="inbound"?"denyInboundUpgradedConnection":"denyOutboundUpgradedConnection",ot,o),o.log("successfully upgraded %s connection",tt),this._createConnection({cryptoProtocol:at,direction:tt,maConn:o,upgradedConn:it,muxerFactory:st,remotePeer:ot,limits:rt==null?void 0:rt.limits})}_createConnection(o){const{cryptoProtocol:tt,direction:rt,maConn:nt,upgradedConn:ot,remotePeer:it,muxerFactory:st,limits:at}=o;let ct,lt,dt;st!=null&&(ct=st.createStreamMuxer({direction:rt,onIncomingStream:ft=>{dt!=null&&Promise.resolve().then(async()=>{var Et;const pt=this.components.registrar.getProtocols(),yt=AbortSignal.timeout(this.inboundStreamProtocolNegotiationTimeout);setMaxListeners(1/0,yt);const{stream:gt,protocol:bt}=await handle(ft,pt,{signal:yt,log:ft.log,yieldBytes:!1});if(dt==null)return;dt.log("incoming stream opened on %s",bt);const xt=findIncomingStreamLimit(bt,this.components.registrar);if(countStreams(bt,"inbound",dt)===xt){const Ct=new TooManyInboundProtocolStreamsError(`Too many inbound protocol streams for protocol "${bt}" - limit ${xt}`);throw ft.abort(Ct),Ct}ft.source=gt.source,ft.sink=gt.sink,ft.protocol=bt,gt.closeWrite!=null&&(ft.closeWrite=gt.closeWrite),gt.closeRead!=null&&(ft.closeRead=gt.closeRead),gt.close!=null&&(ft.close=gt.close),await this.components.peerStore.merge(it,{protocols:[bt]}),(Et=this.components.metrics)==null||Et.trackProtocolStream(ft,dt),this._onStream({connection:dt,stream:ft,protocol:bt})}).catch(async pt=>{dt.log.error("error handling incoming stream id %s - %e",ft.id,pt),ft.timeline.close==null&&await ft.close()})}}),lt=async(ft,pt={})=>{var gt;if(ct==null)throw new MuxerUnavailableError("Connection is not multiplexed");dt.log.trace("starting new stream for protocols %s",ft);const yt=await ct.newStream();dt.log.trace("started new stream %s for protocols %s",yt.id,ft);try{if(pt.signal==null){yt.log("no abort signal was passed while trying to negotiate protocols %s falling back to default timeout",ft);const Ct=AbortSignal.timeout(this.outboundStreamProtocolNegotiationTimeout);setMaxListeners(1/0,Ct),pt={...pt,signal:Ct}}yt.log.trace("selecting protocol from protocols %s",ft);const{stream:bt,protocol:xt}=await select(yt,ft,{...pt,log:yt.log,yieldBytes:!0});yt.log.trace("selected protocol %s",xt);const vt=findOutgoingStreamLimit(xt,this.components.registrar,pt),Et=countStreams(xt,"outbound",dt);if(Et>=vt){const Ct=new TooManyOutboundProtocolStreamsError(`Too many outbound protocol streams for protocol "${xt}" - ${Et}/${vt}`);throw yt.abort(Ct),Ct}return await this.components.peerStore.merge(it,{protocols:[xt]}),yt.source=bt.source,yt.sink=bt.sink,yt.protocol=xt,bt.closeWrite!=null&&(yt.closeWrite=bt.closeWrite),bt.closeRead!=null&&(yt.closeRead=bt.closeRead),bt.close!=null&&(yt.close=bt.close),(gt=this.components.metrics)==null||gt.trackProtocolStream(yt,dt),yt}catch(bt){throw dt.log.error("could not create new outbound stream on connection %s %a for protocols %s - %e",rt==="inbound"?"from":"to",o.maConn.remoteAddr,ft,bt),yt.timeline.close==null&&yt.abort(bt),bt}},Promise.all([ct.sink(ot.source),ot.sink(ct.source)]).catch(ft=>{dt.log.error("error piping data through muxer - %e",ft)}));const ht=nt.timeline;nt.timeline=new Proxy(ht,{set:(...ft)=>(ft[1]==="close"&&ft[2]!=null&&ht.close==null&&(async()=>{try{dt.status==="open"&&await dt.close()}catch(pt){dt.log.error("error closing connection after timeline close %e",pt)}finally{this.events.safeDispatchEvent("connection:close",{detail:dt})}})().catch(pt=>{dt.log.error("error thrown while dispatching connection:close event %e",pt)}),Reflect.set(...ft))}),nt.timeline.upgraded=Date.now();const mt=()=>{throw new MuxerUnavailableError("Connection is not multiplexed")};return dt=createConnection({remoteAddr:nt.remoteAddr,remotePeer:it,status:"open",direction:rt,timeline:nt.timeline,multiplexer:ct==null?void 0:ct.protocol,encryption:tt,limits:at,logger:this.components.logger,newStream:lt??mt,getStreams:()=>(ct==null?void 0:ct.streams)??[],close:async ft=>{await(ct==null?void 0:ct.close(ft)),await nt.close(ft)},abort:ft=>{nt.abort(ft),ct==null||ct.abort(ft)}}),this.events.safeDispatchEvent("connection:open",{detail:dt}),dt.__maConnTimeline=ht,dt}_onStream(o){const{connection:tt,stream:rt,protocol:nt}=o,{handler:ot,options:it}=this.components.registrar.getHandler(nt);if(tt.limits!=null&&it.runOnLimitedConnection!==!0)throw new LimitedConnectionError("Cannot open protocol stream on limited connection");ot({connection:tt,stream:rt})}async _encryptInbound(o,tt){const rt=Array.from(this.connectionEncrypters.keys());try{const{stream:nt,protocol:ot}=await handle(o,rt,{...tt,log:o.log}),it=this.connectionEncrypters.get(ot);if(it==null)throw new EncryptionFailedError(`no crypto module found for ${ot}`);return o.log("encrypting inbound connection to %a using %s",o.remoteAddr,ot),{...await it.secureInbound(nt,tt),protocol:ot}}catch(nt){throw o.log.error("encrypting inbound connection from %a failed",o.remoteAddr,nt),new EncryptionFailedError(nt.message)}}async _encryptOutbound(o,tt){const rt=Array.from(this.connectionEncrypters.keys());try{o.log.trace("selecting encrypter from %s",rt);const{stream:nt,protocol:ot}=await select(o,rt,{...tt,log:o.log,yieldBytes:!0}),it=this.connectionEncrypters.get(ot);if(it==null)throw new EncryptionFailedError(`no crypto module found for ${ot}`);return o.log("encrypting outbound connection to %a using %s",o.remoteAddr,ot),{...await it.secureOutbound(nt,tt),protocol:ot}}catch(nt){throw o.log.error("encrypting outbound connection to %a failed",o.remoteAddr,nt),new EncryptionFailedError(nt.message)}}async _multiplexOutbound(o,tt,rt){const nt=Array.from(tt.keys());o.log("outbound selecting muxer %s",nt);try{o.log.trace("selecting stream muxer from %s",nt);const{stream:ot,protocol:it}=await select(o,nt,{...rt,log:o.log,yieldBytes:!0});o.log("selected %s as muxer protocol",it);const st=tt.get(it);return{stream:ot,muxerFactory:st}}catch(ot){throw o.log.error("error multiplexing outbound connection",ot),new MuxerUnavailableError(String(ot))}}async _multiplexInbound(o,tt,rt){const nt=Array.from(tt.keys());o.log("inbound handling muxers %s",nt);try{const{stream:ot,protocol:it}=await handle(o,nt,{...rt,log:o.log}),st=tt.get(it);return{stream:ot,muxerFactory:st}}catch(ot){throw o.log.error("error multiplexing inbound connection",ot),new MuxerUnavailableError(String(ot))}}}const version$3="2.1.8",name$2="libp2p";var go,Fs;class Libp2p extends TypedEventEmitter{constructor(tt){var at,ct,lt,dt,ht,mt;super();fr(this,go);wt(this,"peerId");wt(this,"peerStore");wt(this,"contentRouting");wt(this,"peerRouting");wt(this,"metrics");wt(this,"services");wt(this,"logger");wt(this,"status");wt(this,"components");wt(this,"log");this.status="stopped";const rt=new TypedEventEmitter,nt=rt.dispatchEvent.bind(rt);rt.dispatchEvent=ft=>{const pt=nt(ft),yt=this.dispatchEvent(new CustomEvent(ft.type,{detail:ft.detail}));return pt||yt},setMaxListeners(1/0,rt),this.peerId=tt.peerId,this.logger=tt.logger??defaultLogger(),this.log=this.logger.forComponent("libp2p"),this.services={};const ot=this.components=defaultComponents({peerId:tt.peerId,privateKey:tt.privateKey,nodeInfo:tt.nodeInfo??{name:name$2,version:version$3},logger:this.logger,events:rt,datastore:tt.datastore??new MemoryDatastore,connectionGater:connectionGater(tt.connectionGater),dns:tt.dns});this.peerStore=this.configureComponent("peerStore",persistentPeerStore(ot,{addressFilter:this.components.connectionGater.filterMultiaddrForPeer,...tt.peerStore})),tt.metrics!=null&&(this.metrics=this.configureComponent("metrics",tt.metrics(this.components))),ot.events.addEventListener("peer:update",ft=>{if(ft.detail.previous==null){const pt={id:ft.detail.peer.id,multiaddrs:ft.detail.peer.addresses.map(yt=>yt.multiaddr)};ot.events.safeDispatchEvent("peer:discovery",{detail:pt})}}),tt.connectionProtector!=null&&this.configureComponent("connectionProtector",tt.connectionProtector(ot)),this.components.upgrader=new DefaultUpgrader(this.components,{connectionEncrypters:(tt.connectionEncrypters??[]).map((ft,pt)=>this.configureComponent(`connection-encryption-${pt}`,ft(this.components))),streamMuxers:(tt.streamMuxers??[]).map((ft,pt)=>this.configureComponent(`stream-muxers-${pt}`,ft(this.components))),inboundUpgradeTimeout:(at=tt.connectionManager)==null?void 0:at.inboundUpgradeTimeout,outboundUpgradeTimeout:(ct=tt.connectionManager)==null?void 0:ct.outboundUpgradeTimeout}),this.configureComponent("transportManager",new DefaultTransportManager(this.components,tt.transportManager)),this.configureComponent("connectionManager",new DefaultConnectionManager(this.components,tt.connectionManager)),((lt=tt.connectionMonitor)==null?void 0:lt.enabled)!==!1&&this.configureComponent("connectionMonitor",new ConnectionMonitor(this.components,tt.connectionMonitor)),this.configureComponent("registrar",new DefaultRegistrar(this.components)),this.configureComponent("addressManager",new DefaultAddressManager(this.components,tt.addresses));const it=(tt.peerRouters??[]).map((ft,pt)=>this.configureComponent(`peer-router-${pt}`,ft(this.components)));this.peerRouting=this.components.peerRouting=this.configureComponent("peerRouting",new DefaultPeerRouting(this.components,{routers:it}));const st=(tt.contentRouters??[]).map((ft,pt)=>this.configureComponent(`content-router-${pt}`,ft(this.components)));if(this.contentRouting=this.components.contentRouting=this.configureComponent("contentRouting",new CompoundContentRouting(this.components,{routers:st})),this.configureComponent("randomWalk",new RandomWalk(this.components)),(tt.peerDiscovery??[]).forEach((ft,pt)=>{this.configureComponent(`peer-discovery-${pt}`,ft(this.components)).addEventListener("peer",gt=>{mr(this,go,Fs).call(this,gt)})}),(dt=tt.transports)==null||dt.forEach((ft,pt)=>{this.components.transportManager.add(this.configureComponent(`transport-${pt}`,ft(this.components)))}),tt.services!=null)for(const ft of Object.keys(tt.services)){const pt=tt.services[ft],yt=pt(this.components);if(yt==null){this.log.error("service factory %s returned null or undefined instance",ft);continue}this.services[ft]=yt,this.configureComponent(ft,yt),yt[contentRoutingSymbol]!=null&&(this.log("registering service %s for content routing",ft),st.push(yt[contentRoutingSymbol])),yt[peerRoutingSymbol]!=null&&(this.log("registering service %s for peer routing",ft),it.push(yt[peerRoutingSymbol])),yt[peerDiscoverySymbol]!=null&&(this.log("registering service %s for peer discovery",ft),(mt=(ht=yt[peerDiscoverySymbol]).addEventListener)==null||mt.call(ht,"peer",gt=>{mr(this,go,Fs).call(this,gt)}))}checkServiceDependencies(ot)}configureComponent(tt,rt){return rt==null&&this.log.error("component %s was null or undefined",tt),this.components[tt]=rt,rt}async start(){var tt,rt,nt,ot;if(this.status==="stopped"){this.status="starting",this.log("libp2p is starting");try{await((rt=(tt=this.components).beforeStart)==null?void 0:rt.call(tt)),await this.components.start(),await((ot=(nt=this.components).afterStart)==null?void 0:ot.call(nt)),this.status="started",this.safeDispatchEvent("start",{detail:this}),this.log("libp2p has started")}catch(it){throw this.log.error("An error occurred starting libp2p",it),this.status="started",await this.stop(),it}}}async stop(){var tt,rt,nt,ot;this.status==="started"&&(this.log("libp2p is stopping"),this.status="stopping",await((rt=(tt=this.components).beforeStop)==null?void 0:rt.call(tt)),await this.components.stop(),await((ot=(nt=this.components).afterStop)==null?void 0:ot.call(nt)),this.status="stopped",this.safeDispatchEvent("stop",{detail:this}),this.log("libp2p has stopped"))}getConnections(tt){return this.components.connectionManager.getConnections(tt)}getDialQueue(){return this.components.connectionManager.getDialQueue()}getPeers(){const tt=new PeerSet;for(const rt of this.components.connectionManager.getConnections())tt.add(rt.remotePeer);return Array.from(tt)}async dial(tt,rt={}){return this.components.connectionManager.openConnection(tt,{priority:75,...rt})}async dialProtocol(tt,rt,nt={}){if(rt==null)throw new InvalidParametersError$1("no protocols were provided to open a stream");if(rt=Array.isArray(rt)?rt:[rt],rt.length===0)throw new InvalidParametersError$1("no protocols were provided to open a stream");return(await this.dial(tt,nt)).newStream(rt,nt)}getMultiaddrs(){return this.components.addressManager.getAddresses()}getProtocols(){return this.components.registrar.getProtocols()}async hangUp(tt,rt={}){isMultiaddr(tt)&&(tt=peerIdFromString$1(tt.getPeerId()??"")),await this.components.connectionManager.closeConnections(tt,rt)}async getPublicKey(tt,rt={}){if(this.log("getPublicKey %p",tt),tt.publicKey!=null)return tt.publicKey;try{const st=await this.peerStore.get(tt);if(st.id.publicKey!=null)return st.id.publicKey}catch(st){if(st.name!=="NotFoundError")throw st}const nt=concat([fromString$6("/pk/"),tt.toMultihash().bytes]),ot=await this.contentRouting.get(nt,rt),it=publicKeyFromProtobuf(ot);return await this.peerStore.patch(tt,{publicKey:it}),it}async handle(tt,rt,nt){Array.isArray(tt)||(tt=[tt]),await Promise.all(tt.map(async ot=>{await this.components.registrar.handle(ot,rt,nt)}))}async unhandle(tt){Array.isArray(tt)||(tt=[tt]),await Promise.all(tt.map(async rt=>{await this.components.registrar.unhandle(rt)}))}async register(tt,rt){return this.components.registrar.register(tt,rt)}unregister(tt){this.components.registrar.unregister(tt)}async isDialable(tt,rt={}){return this.components.connectionManager.isDialable(tt,rt)}}go=new WeakSet,Fs=function(tt){const{detail:rt}=tt;if(rt.id.toString()===this.peerId.toString()){this.log.error("peer discovery mechanism discovered self");return}this.components.peerStore.merge(rt.id,{multiaddrs:rt.multiaddrs}).catch(nt=>{this.log.error(nt)})};async function createLibp2p(et={}){et.privateKey??(et.privateKey=await generateKeyPair());const o=new Libp2p({...await validateConfig(et),peerId:peerIdFromPrivateKey(et.privateKey)});return et.start!==!1&&await o.start(),o}const enrTree={SANDBOX:"enrtree://AIRVQ5DDA4FFWLRBCHJWUWOO6X6S4ZTZ5B667LQ6AJU6PEYDLRD5O@sandbox.waku.nodes.status.im",TEST:"enrtree://AOGYWMBYOUIMOENHXCHILPKY3ZRFEULMFI4DOM442QSZ73TT2A7VI@test.waku.nodes.status.im"},DEFAULT_BOOTSTRAP_TAG_NAME="bootstrap",DEFAULT_BOOTSTRAP_TAG_VALUE=50,DEFAULT_BOOTSTRAP_TAG_TTL=1e8,DEFAULT_NODE_REQUIREMENTS={store:1,filter:2,lightPush:2},ERR_INVALID_ID="Invalid record id",MULTIADDR_LENGTH_SIZE=2,__viteBrowserExternal={},__viteBrowserExternal$1=Object.freeze(Object.defineProperty({__proto__:null,default:__viteBrowserExternal},Symbol.toStringTag,{value:"Module"}));/*! noble-secp256k1 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const _0n=BigInt(0),_1n=BigInt(1),_2n=BigInt(2),_3n=BigInt(3),_8n=BigInt(8),CURVE=Object.freeze({a:_0n,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:_1n,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")}),divNearest=(et,o)=>(et+o/_2n)/o,endo={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar(et){const{n:o}=CURVE,tt=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),rt=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),nt=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),ot=tt,it=BigInt("0x100000000000000000000000000000000"),st=divNearest(ot*et,o),at=divNearest(-rt*et,o);let ct=mod(et-st*tt-at*nt,o),lt=mod(-st*rt-at*ot,o);const dt=ct>it,ht=lt>it;if(dt&&(ct=o-ct),ht&&(lt=o-lt),ct>it||lt>it)throw new Error("splitScalarEndo: Endomorphism failed, k="+et);return{k1neg:dt,k1:ct,k2neg:ht,k2:lt}}},fieldLen=32,groupLen=32,hashLen=32,compressedLen=fieldLen+1,uncompressedLen=2*fieldLen+1;function weierstrass(et){const{a:o,b:tt}=CURVE,rt=mod(et*et),nt=mod(rt*et);return mod(nt+o*et+tt)}const USE_ENDOMORPHISM=CURVE.a===_0n;class ShaError extends Error{constructor(o){super(o)}}function assertJacPoint(et){if(!(et instanceof JacobianPoint))throw new TypeError("JacobianPoint expected")}class JacobianPoint{constructor(o,tt,rt){this.x=o,this.y=tt,this.z=rt}static fromAffine(o){if(!(o instanceof Point))throw new TypeError("JacobianPoint#fromAffine: expected Point");return o.equals(Point.ZERO)?JacobianPoint.ZERO:new JacobianPoint(o.x,o.y,_1n)}static toAffineBatch(o){const tt=invertBatch(o.map(rt=>rt.z));return o.map((rt,nt)=>rt.toAffine(tt[nt]))}static normalizeZ(o){return JacobianPoint.toAffineBatch(o).map(JacobianPoint.fromAffine)}equals(o){assertJacPoint(o);const{x:tt,y:rt,z:nt}=this,{x:ot,y:it,z:st}=o,at=mod(nt*nt),ct=mod(st*st),lt=mod(tt*ct),dt=mod(ot*at),ht=mod(mod(rt*st)*ct),mt=mod(mod(it*nt)*at);return lt===dt&&ht===mt}negate(){return new JacobianPoint(this.x,mod(-this.y),this.z)}double(){const{x:o,y:tt,z:rt}=this,nt=mod(o*o),ot=mod(tt*tt),it=mod(ot*ot),st=o+ot,at=mod(_2n*(mod(st*st)-nt-it)),ct=mod(_3n*nt),lt=mod(ct*ct),dt=mod(lt-_2n*at),ht=mod(ct*(at-dt)-_8n*it),mt=mod(_2n*tt*rt);return new JacobianPoint(dt,ht,mt)}add(o){assertJacPoint(o);const{x:tt,y:rt,z:nt}=this,{x:ot,y:it,z:st}=o;if(ot===_0n||it===_0n)return this;if(tt===_0n||rt===_0n)return o;const at=mod(nt*nt),ct=mod(st*st),lt=mod(tt*ct),dt=mod(ot*at),ht=mod(mod(rt*st)*ct),mt=mod(mod(it*nt)*at),ft=mod(dt-lt),pt=mod(mt-ht);if(ft===_0n)return pt===_0n?this.double():JacobianPoint.ZERO;const yt=mod(ft*ft),gt=mod(ft*yt),bt=mod(lt*yt),xt=mod(pt*pt-gt-_2n*bt),vt=mod(pt*(bt-xt)-ht*gt),Et=mod(nt*st*ft);return new JacobianPoint(xt,vt,Et)}subtract(o){return this.add(o.negate())}multiplyUnsafe(o){const tt=JacobianPoint.ZERO;if(typeof o=="bigint"&&o===_0n)return tt;let rt=normalizeScalar(o);if(rt===_1n)return this;if(!USE_ENDOMORPHISM){let dt=tt,ht=this;for(;rt>_0n;)rt&_1n&&(dt=dt.add(ht)),ht=ht.double(),rt>>=_1n;return dt}let{k1neg:nt,k1:ot,k2neg:it,k2:st}=endo.splitScalar(rt),at=tt,ct=tt,lt=this;for(;ot>_0n||st>_0n;)ot&_1n&&(at=at.add(lt)),st&_1n&&(ct=ct.add(lt)),lt=lt.double(),ot>>=_1n,st>>=_1n;return nt&&(at=at.negate()),it&&(ct=ct.negate()),ct=new JacobianPoint(mod(ct.x*endo.beta),ct.y,ct.z),at.add(ct)}precomputeWindow(o){const tt=USE_ENDOMORPHISM?128/o+1:256/o+1,rt=[];let nt=this,ot=nt;for(let it=0;it>=dt,ft>at&&(ft-=lt,o+=_1n);const pt=mt,yt=mt+Math.abs(ft)-1,gt=ht%2!==0,bt=ft<0;ft===0?it=it.add(constTimeNegate(gt,nt[pt])):ot=ot.add(constTimeNegate(bt,nt[yt]))}return{p:ot,f:it}}multiply(o,tt){let rt=normalizeScalar(o),nt,ot;if(USE_ENDOMORPHISM){const{k1neg:it,k1:st,k2neg:at,k2:ct}=endo.splitScalar(rt);let{p:lt,f:dt}=this.wNAF(st,tt),{p:ht,f:mt}=this.wNAF(ct,tt);lt=constTimeNegate(it,lt),ht=constTimeNegate(at,ht),ht=new JacobianPoint(mod(ht.x*endo.beta),ht.y,ht.z),nt=lt.add(ht),ot=dt.add(mt)}else{const{p:it,f:st}=this.wNAF(rt,tt);nt=it,ot=st}return JacobianPoint.normalizeZ([nt,ot])[0]}toAffine(o){const{x:tt,y:rt,z:nt}=this,ot=this.equals(JacobianPoint.ZERO);o==null&&(o=ot?_8n:invert(nt));const it=o,st=mod(it*it),at=mod(st*it),ct=mod(tt*st),lt=mod(rt*at),dt=mod(nt*it);if(ot)return Point.ZERO;if(dt!==_1n)throw new Error("invZ was invalid");return new Point(ct,lt)}}JacobianPoint.BASE=new JacobianPoint(CURVE.Gx,CURVE.Gy,_1n);JacobianPoint.ZERO=new JacobianPoint(_0n,_1n,_0n);function constTimeNegate(et,o){const tt=o.negate();return et?tt:o}const pointPrecomputes=new WeakMap;class Point{constructor(o,tt){this.x=o,this.y=tt}_setWindowSize(o){this._WINDOW_SIZE=o,pointPrecomputes.delete(this)}hasEvenY(){return this.y%_2n===_0n}static fromCompressedHex(o){const tt=o.length===32,rt=bytesToNumber(tt?o:o.subarray(1));if(!isValidFieldElement(rt))throw new Error("Point is not on curve");const nt=weierstrass(rt);let ot=sqrtMod(nt);const it=(ot&_1n)===_1n;tt?it&&(ot=mod(-ot)):(o[0]&1)===1!==it&&(ot=mod(-ot));const st=new Point(rt,ot);return st.assertValidity(),st}static fromUncompressedHex(o){const tt=bytesToNumber(o.subarray(1,fieldLen+1)),rt=bytesToNumber(o.subarray(fieldLen+1,fieldLen*2+1)),nt=new Point(tt,rt);return nt.assertValidity(),nt}static fromHex(o){const tt=ensureBytes(o),rt=tt.length,nt=tt[0];if(rt===fieldLen)return this.fromCompressedHex(tt);if(rt===compressedLen&&(nt===2||nt===3))return this.fromCompressedHex(tt);if(rt===uncompressedLen&&nt===4)return this.fromUncompressedHex(tt);throw new Error(`Point.fromHex: received invalid point. Expected 32-${compressedLen} compressed bytes or ${uncompressedLen} uncompressed bytes, not ${rt}`)}static fromPrivateKey(o){return Point.BASE.multiply(normalizePrivateKey(o))}static fromSignature(o,tt,rt){const{r:nt,s:ot}=normalizeSignature(tt);if(![0,1,2,3].includes(rt))throw new Error("Cannot recover: invalid recovery bit");const it=truncateHash(ensureBytes(o)),{n:st}=CURVE,at=rt===2||rt===3?nt+st:nt,ct=invert(at,st),lt=mod(-it*ct,st),dt=mod(ot*ct,st),ht=rt&1?"03":"02",mt=Point.fromHex(ht+numTo32bStr(at)),ft=Point.BASE.multiplyAndAddUnsafe(mt,lt,dt);if(!ft)throw new Error("Cannot recover signature: point at infinify");return ft.assertValidity(),ft}toRawBytes(o=!1){return hexToBytes(this.toHex(o))}toHex(o=!1){const tt=numTo32bStr(this.x);return o?`${this.hasEvenY()?"02":"03"}${tt}`:`04${tt}${numTo32bStr(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const o="Point is not on elliptic curve",{x:tt,y:rt}=this;if(!isValidFieldElement(tt)||!isValidFieldElement(rt))throw new Error(o);const nt=mod(rt*rt),ot=weierstrass(tt);if(mod(nt-ot)!==_0n)throw new Error(o)}equals(o){return this.x===o.x&&this.y===o.y}negate(){return new Point(this.x,mod(-this.y))}double(){return JacobianPoint.fromAffine(this).double().toAffine()}add(o){return JacobianPoint.fromAffine(this).add(JacobianPoint.fromAffine(o)).toAffine()}subtract(o){return this.add(o.negate())}multiply(o){return JacobianPoint.fromAffine(this).multiply(o,this).toAffine()}multiplyAndAddUnsafe(o,tt,rt){const nt=JacobianPoint.fromAffine(this),ot=tt===_0n||tt===_1n||this!==Point.BASE?nt.multiplyUnsafe(tt):nt.multiply(tt),it=JacobianPoint.fromAffine(o).multiplyUnsafe(rt),st=ot.add(it);return st.equals(JacobianPoint.ZERO)?void 0:st.toAffine()}}Point.BASE=new Point(CURVE.Gx,CURVE.Gy);Point.ZERO=new Point(_0n,_0n);function sliceDER(et){return Number.parseInt(et[0],16)>=8?"00"+et:et}function parseDERInt(et){if(et.length<2||et[0]!==2)throw new Error(`Invalid signature integer tag: ${bytesToHex(et)}`);const o=et[1],tt=et.subarray(2,o+2);if(!o||tt.length!==o)throw new Error("Invalid signature integer: wrong length");if(tt[0]===0&&tt[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:bytesToNumber(tt),left:et.subarray(o+2)}}function parseDERSignature(et){if(et.length<2||et[0]!=48)throw new Error(`Invalid signature tag: ${bytesToHex(et)}`);if(et[1]!==et.length-2)throw new Error("Invalid signature: incorrect length");const{data:o,left:tt}=parseDERInt(et.subarray(2)),{data:rt,left:nt}=parseDERInt(tt);if(nt.length)throw new Error(`Invalid signature: left bytes after parsing: ${bytesToHex(nt)}`);return{r:o,s:rt}}class Signature{constructor(o,tt){this.r=o,this.s=tt,this.assertValidity()}static fromCompact(o){const tt=o instanceof Uint8Array,rt="Signature.fromCompact";if(typeof o!="string"&&!tt)throw new TypeError(`${rt}: Expected string or Uint8Array`);const nt=tt?bytesToHex(o):o;if(nt.length!==128)throw new Error(`${rt}: Expected 64-byte hex`);return new Signature(hexToNumber(nt.slice(0,64)),hexToNumber(nt.slice(64,128)))}static fromDER(o){const tt=o instanceof Uint8Array;if(typeof o!="string"&&!tt)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r:rt,s:nt}=parseDERSignature(tt?o:hexToBytes(o));return new Signature(rt,nt)}static fromHex(o){return this.fromDER(o)}assertValidity(){const{r:o,s:tt}=this;if(!isWithinCurveOrder(o))throw new Error("Invalid Signature: r must be 0 < r < n");if(!isWithinCurveOrder(tt))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const o=CURVE.n>>_1n;return this.s>o}normalizeS(){return this.hasHighS()?new Signature(this.r,mod(-this.s,CURVE.n)):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){const o=sliceDER(numberToHexUnpadded(this.s)),tt=sliceDER(numberToHexUnpadded(this.r)),rt=o.length/2,nt=tt.length/2,ot=numberToHexUnpadded(rt),it=numberToHexUnpadded(nt);return`30${numberToHexUnpadded(nt+rt+4)}02${it}${tt}02${ot}${o}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return numTo32bStr(this.r)+numTo32bStr(this.s)}}function concatBytes(...et){if(!et.every(rt=>rt instanceof Uint8Array))throw new Error("Uint8Array list expected");if(et.length===1)return et[0];const o=et.reduce((rt,nt)=>rt+nt.length,0),tt=new Uint8Array(o);for(let rt=0,nt=0;rto.toString(16).padStart(2,"0"));function bytesToHex(et){if(!(et instanceof Uint8Array))throw new Error("Expected Uint8Array");let o="";for(let tt=0;tt0)return BigInt(et);if(typeof et=="bigint"&&isWithinCurveOrder(et))return et;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function mod(et,o=CURVE.P){const tt=et%o;return tt>=_0n?tt:o+tt}function pow2(et,o){const{P:tt}=CURVE;let rt=et;for(;o-- >_0n;)rt*=rt,rt%=tt;return rt}function sqrtMod(et){const{P:o}=CURVE,tt=BigInt(6),rt=BigInt(11),nt=BigInt(22),ot=BigInt(23),it=BigInt(44),st=BigInt(88),at=et*et*et%o,ct=at*at*et%o,lt=pow2(ct,_3n)*ct%o,dt=pow2(lt,_3n)*ct%o,ht=pow2(dt,_2n)*at%o,mt=pow2(ht,rt)*ht%o,ft=pow2(mt,nt)*mt%o,pt=pow2(ft,it)*ft%o,yt=pow2(pt,st)*pt%o,gt=pow2(yt,it)*ft%o,bt=pow2(gt,_3n)*ct%o,xt=pow2(bt,ot)*mt%o,vt=pow2(xt,tt)*at%o,Et=pow2(vt,_2n);if(Et*Et%o!==et)throw new Error("Cannot find square root");return Et}function invert(et,o=CURVE.P){if(et===_0n||o<=_0n)throw new Error(`invert: expected positive integers, got n=${et} mod=${o}`);let tt=mod(et,o),rt=o,nt=_0n,ot=_1n;for(;tt!==_0n;){const st=rt/tt,at=rt%tt,ct=nt-ot*st;rt=tt,tt=at,nt=ot,ot=ct}if(rt!==_1n)throw new Error("invert: does not exist");return mod(nt,o)}function invertBatch(et,o=CURVE.P){const tt=new Array(et.length),rt=et.reduce((ot,it,st)=>it===_0n?ot:(tt[st]=ot,mod(ot*it,o)),_1n),nt=invert(rt,o);return et.reduceRight((ot,it,st)=>it===_0n?ot:(tt[st]=mod(ot*tt[st],o),mod(ot*it,o)),nt),tt}function bits2int_2(et){const o=et.length*8-groupLen*8,tt=bytesToNumber(et);return o>0?tt>>BigInt(o):tt}function truncateHash(et,o=!1){const tt=bits2int_2(et);if(o)return tt;const{n:rt}=CURVE;return tt>=rt?tt-rt:tt}let _sha256Sync,_hmacSha256Sync;class HmacDrbg{constructor(o,tt){if(this.hashLen=o,this.qByteLen=tt,typeof o!="number"||o<2)throw new Error("hashLen must be a number");if(typeof tt!="number"||tt<2)throw new Error("qByteLen must be a number");this.v=new Uint8Array(o).fill(1),this.k=new Uint8Array(o).fill(0),this.counter=0}hmac(...o){return utils.hmacSha256(this.k,...o)}hmacSync(...o){return _hmacSha256Sync(this.k,...o)}checkSync(){if(typeof _hmacSha256Sync!="function")throw new ShaError("hmacSha256Sync needs to be set")}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(o=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),o),this.v=await this.hmac(this.v),o.length!==0&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),o),this.v=await this.hmac(this.v))}reseedSync(o=new Uint8Array){this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),o),this.v=this.hmacSync(this.v),o.length!==0&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),o),this.v=this.hmacSync(this.v))}async generate(){this.incr();let o=0;const tt=[];for(;o0)o=BigInt(et);else if(typeof et=="string"){if(et.length!==2*groupLen)throw new Error("Expected 32 bytes of private key");o=hexToNumber(et)}else if(et instanceof Uint8Array){if(et.length!==groupLen)throw new Error("Expected 32 bytes of private key");o=bytesToNumber(et)}else throw new TypeError("Expected valid private key");if(!isWithinCurveOrder(o))throw new Error("Expected private key: 0 < key < n");return o}function normalizePublicKey(et){return et instanceof Point?(et.assertValidity(),et):Point.fromHex(et)}function normalizeSignature(et){if(et instanceof Signature)return et.assertValidity(),et;try{return Signature.fromDER(et)}catch{return Signature.fromCompact(et)}}function bits2int(et){const o=et.length>fieldLen?et.slice(0,fieldLen):et;return bytesToNumber(o)}function bits2octets(et){const o=bits2int(et),tt=mod(o,CURVE.n);return int2octets(tt<_0n?o:tt)}function int2octets(et){return numTo32b(et)}function initSigArgs(et,o,tt){if(et==null)throw new Error(`sign: expected valid message hash, not "${et}"`);const rt=ensureBytes(et),nt=normalizePrivateKey(o),ot=[int2octets(nt),bits2octets(rt)];if(tt!=null){tt===!0&&(tt=utils.randomBytes(fieldLen));const at=ensureBytes(tt);if(at.length!==fieldLen)throw new Error(`sign: Expected ${fieldLen} bytes of extra data`);ot.push(at)}const it=concatBytes(...ot),st=bits2int(rt);return{seed:it,m:st,d:nt}}function finalizeSig(et,o){const{sig:tt,recovery:rt}=et,{der:nt,recovered:ot}=Object.assign({canonical:!0,der:!0},o),it=nt?tt.toDERRawBytes():tt.toCompactRawBytes();return ot?[it,rt]:it}async function sign$1(et,o,tt={}){const{seed:rt,m:nt,d:ot}=initSigArgs(et,o,tt.extraEntropy),it=new HmacDrbg(hashLen,groupLen);await it.reseed(rt);let st;for(;!(st=kmdToSig(await it.generate(),nt,ot,tt.canonical));)await it.reseed();return finalizeSig(st,tt)}const vopts={strict:!0};function verify(et,o,tt,rt=vopts){let nt;try{nt=normalizeSignature(et),o=ensureBytes(o)}catch{return!1}const{r:ot,s:it}=nt;if(rt.strict&&nt.hasHighS())return!1;const st=truncateHash(o);let at;try{at=normalizePublicKey(tt)}catch{return!1}const{n:ct}=CURVE,lt=invert(it,ct),dt=mod(st*lt,ct),ht=mod(ot*lt,ct),mt=Point.BASE.multiplyAndAddUnsafe(at,dt,ht);return mt?mod(mt.x,ct)===ot:!1}Point.BASE._setWindowSize(8);const crypto$1={node:__viteBrowserExternal$1,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},TAGGED_HASH_PREFIXES={},utils={bytesToHex,hexToBytes,concatBytes,mod,invert,isValidPrivateKey(et){try{return normalizePrivateKey(et),!0}catch{return!1}},_bigintTo32Bytes:numTo32b,_normalizePrivateKey:normalizePrivateKey,hashToPrivateKey:et=>{et=ensureBytes(et);const o=groupLen+8;if(et.length1024)throw new Error("Expected valid bytes of private key as per FIPS 186");const tt=mod(bytesToNumber(et),CURVE.n-_1n)+_1n;return numTo32b(tt)},randomBytes:(et=32)=>{if(crypto$1.web)return crypto$1.web.getRandomValues(new Uint8Array(et));if(crypto$1.node){const{randomBytes:o}=crypto$1.node;return Uint8Array.from(o(et))}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>utils.hashToPrivateKey(utils.randomBytes(groupLen+8)),precompute(et=8,o=Point.BASE){const tt=o===Point.BASE?o:new Point(o.x,o.y);return tt._setWindowSize(et),tt.multiply(_3n),tt},sha256:async(...et)=>{if(crypto$1.web){const o=await crypto$1.web.subtle.digest("SHA-256",concatBytes(...et));return new Uint8Array(o)}else if(crypto$1.node){const{createHash:o}=crypto$1.node,tt=o("sha256");return et.forEach(rt=>tt.update(rt)),Uint8Array.from(tt.digest())}else throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(et,...o)=>{if(crypto$1.web){const tt=await crypto$1.web.subtle.importKey("raw",et,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),rt=concatBytes(...o),nt=await crypto$1.web.subtle.sign("HMAC",tt,rt);return new Uint8Array(nt)}else if(crypto$1.node){const{createHmac:tt}=crypto$1.node,rt=tt("sha256",et);return o.forEach(nt=>rt.update(nt)),Uint8Array.from(rt.digest())}else throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:async(et,...o)=>{let tt=TAGGED_HASH_PREFIXES[et];if(tt===void 0){const rt=await utils.sha256(Uint8Array.from(et,nt=>nt.charCodeAt(0)));tt=concatBytes(rt,rt),TAGGED_HASH_PREFIXES[et]=tt}return utils.sha256(tt,...o)},taggedHashSync:(et,...o)=>{if(typeof _sha256Sync!="function")throw new ShaError("sha256Sync is undefined, you need to set it");let tt=TAGGED_HASH_PREFIXES[et];if(tt===void 0){const rt=_sha256Sync(Uint8Array.from(et,nt=>nt.charCodeAt(0)));tt=concatBytes(rt,rt),TAGGED_HASH_PREFIXES[et]=tt}return _sha256Sync(tt,...o)},_JacobianPoint:JacobianPoint};Object.defineProperties(utils,{sha256Sync:{configurable:!1,get(){return _sha256Sync},set(et){_sha256Sync||(_sha256Sync=et)}},hmacSha256Sync:{configurable:!1,get(){return _hmacSha256Sync},set(et){_hmacSha256Sync||(_hmacSha256Sync=et)}}});var sha3$1={exports:{}};(function(et){var o={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};/** - * [js-sha3]{@link https://github.com/emn178/js-sha3} - * - * @version 0.9.3 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2015-2023 - * @license MIT - */(function(){var tt="input is invalid type",rt="finalize already called",nt=typeof window=="object",ot=nt?window:{};ot.JS_SHA3_NO_WINDOW&&(nt=!1);var it=!nt&&typeof self=="object",st=!ot.JS_SHA3_NO_NODE_JS&&typeof o=="object"&&o.versions&&o.versions.node;st?ot=globalThis:it&&(ot=self);for(var at=!ot.JS_SHA3_NO_COMMON_JS&&!0&&et.exports,ct=!ot.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",lt="0123456789abcdef".split(""),dt=[31,7936,2031616,520093696],ht=[4,1024,262144,67108864],mt=[1,256,65536,16777216],ft=[6,1536,393216,100663296],pt=[0,8,16,24],yt=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],gt=[224,256,384,512],bt=[128,256],xt=["hex","buffer","arrayBuffer","array","digest"],vt={128:168,256:136},Et=ot.JS_SHA3_NO_NODE_JS||!Array.isArray?function(_t){return Object.prototype.toString.call(_t)==="[object Array]"}:Array.isArray,Ct=ct&&(ot.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)?function(_t){return typeof _t=="object"&&_t.buffer&&_t.buffer.constructor===ArrayBuffer}:ArrayBuffer.isView,St=function(_t){var Bt=typeof _t;if(Bt==="string")return[_t,!0];if(Bt!=="object"||_t===null)throw new Error(tt);if(ct&&_t.constructor===ArrayBuffer)return[new Uint8Array(_t),!1];if(!Et(_t)&&!Ct(_t))throw new Error(tt);return[_t,!1]},At=function(_t){return St(_t)[0].length===0},kt=function(_t){for(var Bt=[],Vt=0;Vt<_t.length;++Vt)Bt[Vt]=_t[Vt];return Bt},It=function(_t,Bt,Vt){return function(er){return new Zt(_t,Bt,_t).update(er)[Vt]()}},Nt=function(_t,Bt,Vt){return function(er,ar){return new Zt(_t,Bt,ar).update(er)[Vt]()}},Lt=function(_t,Bt,Vt){return function(er,ar,ur,cr){return Pt["cshake"+_t].update(er,ar,ur,cr)[Vt]()}},Mt=function(_t,Bt,Vt){return function(er,ar,ur,cr){return Pt["kmac"+_t].update(er,ar,ur,cr)[Vt]()}},zt=function(_t,Bt,Vt,er){for(var ar=0;ar>5,this.byteCount=this.blockCount<<2,this.outputBlocks=Vt>>5,this.extraBytes=(Vt&31)>>3;for(var er=0;er<50;++er)this.s[er]=0}Zt.prototype.update=function(_t){if(this.finalized)throw new Error(rt);var Bt=St(_t);_t=Bt[0];for(var Vt=Bt[1],er=this.blocks,ar=this.byteCount,ur=_t.length,cr=this.blockCount,hr=0,Sr=this.s,pr,wr;hr>2]|=wr<>2]|=(192|wr>>6)<>2]|=(128|wr&63)<=57344?(er[pr>>2]|=(224|wr>>12)<>2]|=(128|wr>>6&63)<>2]|=(128|wr&63)<>2]|=(240|wr>>18)<>2]|=(128|wr>>12&63)<>2]|=(128|wr>>6&63)<>2]|=(128|wr&63)<>2]|=_t[hr]<=ar){for(this.start=pr-ar,this.block=er[cr],pr=0;pr>8,Vt=_t&255;Vt>0;)ar.unshift(Vt),_t=_t>>8,Vt=_t&255,++er;return Bt?ar.push(er):ar.unshift(er),this.update(ar),ar.length},Zt.prototype.encodeString=function(_t){var Bt=St(_t);_t=Bt[0];var Vt=Bt[1],er=0,ar=_t.length;if(Vt)for(var ur=0;ur<_t.length;++ur){var cr=_t.charCodeAt(ur);cr<128?er+=1:cr<2048?er+=2:cr<55296||cr>=57344?er+=3:(cr=65536+((cr&1023)<<10|_t.charCodeAt(++ur)&1023),er+=4)}else er=ar;return er+=this.encode(er*8),this.update(_t),er},Zt.prototype.bytepad=function(_t,Bt){for(var Vt=this.encode(Bt),er=0;er<_t.length;++er)Vt+=this.encodeString(_t[er]);var ar=(Bt-Vt%Bt)%Bt,ur=[];return ur.length=ar,this.update(ur),this},Zt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var _t=this.blocks,Bt=this.lastByteIndex,Vt=this.blockCount,er=this.s;if(_t[Bt>>2]|=this.padding[Bt&3],this.lastByteIndex===this.byteCount)for(_t[0]=_t[Vt],Bt=1;Bt>4&15]+lt[hr&15]+lt[hr>>12&15]+lt[hr>>8&15]+lt[hr>>20&15]+lt[hr>>16&15]+lt[hr>>28&15]+lt[hr>>24&15];ur%_t===0&&(Bt=kt(Bt),tr(Bt),ar=0)}return er&&(hr=Bt[ar],cr+=lt[hr>>4&15]+lt[hr&15],er>1&&(cr+=lt[hr>>12&15]+lt[hr>>8&15]),er>2&&(cr+=lt[hr>>20&15]+lt[hr>>16&15])),cr},Zt.prototype.arrayBuffer=function(){this.finalize();var _t=this.blockCount,Bt=this.s,Vt=this.outputBlocks,er=this.extraBytes,ar=0,ur=0,cr=this.outputBits>>3,hr;er?hr=new ArrayBuffer(Vt+1<<2):hr=new ArrayBuffer(cr);for(var Sr=new Uint32Array(hr);ur>8&255,cr[hr+2]=Sr>>16&255,cr[hr+3]=Sr>>24&255;ur%_t===0&&(Bt=kt(Bt),tr(Bt))}return er&&(hr=ur<<2,Sr=Bt[ar],cr[hr]=Sr&255,er>1&&(cr[hr+1]=Sr>>8&255),er>2&&(cr[hr+2]=Sr>>16&255)),cr};function Jt(_t,Bt,Vt){Zt.call(this,_t,Bt,Vt)}Jt.prototype=new Zt,Jt.prototype.finalize=function(){return this.encode(this.outputBits,!0),Zt.prototype.finalize.call(this)};var tr=function(_t){var Bt,Vt,er,ar,ur,cr,hr,Sr,pr,wr,_r,Tr,gr,vr,ir,Tt,$t,Rt,Dt,Kt,nr,sr,br,$r,yr,Ar,xr,bo,yo,xo,vo,wo,Eo,Co,So,Ao,$o,ko,Ro,_o,To,Io,Po,jo,No,Do,Lo,Oo,Mo,Bo,Fo,Uo,zo,Vo,Ho,Wo,Go,qo,Ko,Qo,Xo,Yo,Zo;for(er=0;er<48;er+=2)ar=_t[0]^_t[10]^_t[20]^_t[30]^_t[40],ur=_t[1]^_t[11]^_t[21]^_t[31]^_t[41],cr=_t[2]^_t[12]^_t[22]^_t[32]^_t[42],hr=_t[3]^_t[13]^_t[23]^_t[33]^_t[43],Sr=_t[4]^_t[14]^_t[24]^_t[34]^_t[44],pr=_t[5]^_t[15]^_t[25]^_t[35]^_t[45],wr=_t[6]^_t[16]^_t[26]^_t[36]^_t[46],_r=_t[7]^_t[17]^_t[27]^_t[37]^_t[47],Tr=_t[8]^_t[18]^_t[28]^_t[38]^_t[48],gr=_t[9]^_t[19]^_t[29]^_t[39]^_t[49],Bt=Tr^(cr<<1|hr>>>31),Vt=gr^(hr<<1|cr>>>31),_t[0]^=Bt,_t[1]^=Vt,_t[10]^=Bt,_t[11]^=Vt,_t[20]^=Bt,_t[21]^=Vt,_t[30]^=Bt,_t[31]^=Vt,_t[40]^=Bt,_t[41]^=Vt,Bt=ar^(Sr<<1|pr>>>31),Vt=ur^(pr<<1|Sr>>>31),_t[2]^=Bt,_t[3]^=Vt,_t[12]^=Bt,_t[13]^=Vt,_t[22]^=Bt,_t[23]^=Vt,_t[32]^=Bt,_t[33]^=Vt,_t[42]^=Bt,_t[43]^=Vt,Bt=cr^(wr<<1|_r>>>31),Vt=hr^(_r<<1|wr>>>31),_t[4]^=Bt,_t[5]^=Vt,_t[14]^=Bt,_t[15]^=Vt,_t[24]^=Bt,_t[25]^=Vt,_t[34]^=Bt,_t[35]^=Vt,_t[44]^=Bt,_t[45]^=Vt,Bt=Sr^(Tr<<1|gr>>>31),Vt=pr^(gr<<1|Tr>>>31),_t[6]^=Bt,_t[7]^=Vt,_t[16]^=Bt,_t[17]^=Vt,_t[26]^=Bt,_t[27]^=Vt,_t[36]^=Bt,_t[37]^=Vt,_t[46]^=Bt,_t[47]^=Vt,Bt=wr^(ar<<1|ur>>>31),Vt=_r^(ur<<1|ar>>>31),_t[8]^=Bt,_t[9]^=Vt,_t[18]^=Bt,_t[19]^=Vt,_t[28]^=Bt,_t[29]^=Vt,_t[38]^=Bt,_t[39]^=Vt,_t[48]^=Bt,_t[49]^=Vt,vr=_t[0],ir=_t[1],Do=_t[11]<<4|_t[10]>>>28,Lo=_t[10]<<4|_t[11]>>>28,bo=_t[20]<<3|_t[21]>>>29,yo=_t[21]<<3|_t[20]>>>29,Qo=_t[31]<<9|_t[30]>>>23,Xo=_t[30]<<9|_t[31]>>>23,Io=_t[40]<<18|_t[41]>>>14,Po=_t[41]<<18|_t[40]>>>14,Co=_t[2]<<1|_t[3]>>>31,So=_t[3]<<1|_t[2]>>>31,Tt=_t[13]<<12|_t[12]>>>20,$t=_t[12]<<12|_t[13]>>>20,Oo=_t[22]<<10|_t[23]>>>22,Mo=_t[23]<<10|_t[22]>>>22,xo=_t[33]<<13|_t[32]>>>19,vo=_t[32]<<13|_t[33]>>>19,Yo=_t[42]<<2|_t[43]>>>30,Zo=_t[43]<<2|_t[42]>>>30,Vo=_t[5]<<30|_t[4]>>>2,Ho=_t[4]<<30|_t[5]>>>2,Ao=_t[14]<<6|_t[15]>>>26,$o=_t[15]<<6|_t[14]>>>26,Rt=_t[25]<<11|_t[24]>>>21,Dt=_t[24]<<11|_t[25]>>>21,Bo=_t[34]<<15|_t[35]>>>17,Fo=_t[35]<<15|_t[34]>>>17,wo=_t[45]<<29|_t[44]>>>3,Eo=_t[44]<<29|_t[45]>>>3,$r=_t[6]<<28|_t[7]>>>4,yr=_t[7]<<28|_t[6]>>>4,Wo=_t[17]<<23|_t[16]>>>9,Go=_t[16]<<23|_t[17]>>>9,ko=_t[26]<<25|_t[27]>>>7,Ro=_t[27]<<25|_t[26]>>>7,Kt=_t[36]<<21|_t[37]>>>11,nr=_t[37]<<21|_t[36]>>>11,Uo=_t[47]<<24|_t[46]>>>8,zo=_t[46]<<24|_t[47]>>>8,jo=_t[8]<<27|_t[9]>>>5,No=_t[9]<<27|_t[8]>>>5,Ar=_t[18]<<20|_t[19]>>>12,xr=_t[19]<<20|_t[18]>>>12,qo=_t[29]<<7|_t[28]>>>25,Ko=_t[28]<<7|_t[29]>>>25,_o=_t[38]<<8|_t[39]>>>24,To=_t[39]<<8|_t[38]>>>24,sr=_t[48]<<14|_t[49]>>>18,br=_t[49]<<14|_t[48]>>>18,_t[0]=vr^~Tt&Rt,_t[1]=ir^~$t&Dt,_t[10]=$r^~Ar&bo,_t[11]=yr^~xr&yo,_t[20]=Co^~Ao&ko,_t[21]=So^~$o&Ro,_t[30]=jo^~Do&Oo,_t[31]=No^~Lo&Mo,_t[40]=Vo^~Wo&qo,_t[41]=Ho^~Go&Ko,_t[2]=Tt^~Rt&Kt,_t[3]=$t^~Dt&nr,_t[12]=Ar^~bo&xo,_t[13]=xr^~yo&vo,_t[22]=Ao^~ko&_o,_t[23]=$o^~Ro&To,_t[32]=Do^~Oo&Bo,_t[33]=Lo^~Mo&Fo,_t[42]=Wo^~qo&Qo,_t[43]=Go^~Ko&Xo,_t[4]=Rt^~Kt&sr,_t[5]=Dt^~nr&br,_t[14]=bo^~xo&wo,_t[15]=yo^~vo&Eo,_t[24]=ko^~_o&Io,_t[25]=Ro^~To&Po,_t[34]=Oo^~Bo&Uo,_t[35]=Mo^~Fo&zo,_t[44]=qo^~Qo&Yo,_t[45]=Ko^~Xo&Zo,_t[6]=Kt^~sr&vr,_t[7]=nr^~br&ir,_t[16]=xo^~wo&$r,_t[17]=vo^~Eo&yr,_t[26]=_o^~Io&Co,_t[27]=To^~Po&So,_t[36]=Bo^~Uo&jo,_t[37]=Fo^~zo&No,_t[46]=Qo^~Yo&Vo,_t[47]=Xo^~Zo&Ho,_t[8]=sr^~vr&Tt,_t[9]=br^~ir&$t,_t[18]=wo^~$r&Ar,_t[19]=Eo^~yr&xr,_t[28]=Io^~Co&Ao,_t[29]=Po^~So&$o,_t[38]=Uo^~jo&Do,_t[39]=zo^~No&Lo,_t[48]=Yo^~Vo&Wo,_t[49]=Zo^~Ho&Go,_t[0]^=yt[er],_t[1]^=yt[er+1]};if(at)et.exports=Pt;else for(Qt=0;Qtot+MULTIADDR_LENGTH_SIZE+it.bytes.length,0),tt=new Uint8Array(o),rt=new DataView(tt.buffer);let nt=0;return et.forEach(ot=>{if(ot.getPeerId())throw new Error("`multiaddr` field MUST not contain peer id");rt.setUint16(nt,ot.bytes.length),nt+=MULTIADDR_LENGTH_SIZE,tt.set(ot.bytes,nt),nt+=ot.bytes.length}),tt}function encodeWaku2(et){let o=0;return et.lightPush&&(o+=1),o=o<<1,et.filter&&(o+=1),o=o<<1,et.store&&(o+=1),o=o<<1,et.relay&&(o+=1),o}function decodeWaku2(et){const o={relay:!1,store:!1,filter:!1,lightPush:!1};return et%2&&(o.relay=!0),et=et>>1,et%2&&(o.store=!0),et=et>>1,et%2&&(o.filter=!0),et=et>>1,et%2&&(o.lightPush=!0),o}class RawEnr extends Map{constructor(tt={},rt=BigInt(1),nt){super(Object.entries(tt));wt(this,"seq");wt(this,"signature");this.seq=rt,this.signature=nt}set(tt,rt){return this.signature=void 0,this.seq++,super.set(tt,rt)}get id(){const tt=this.get("id");if(!tt)throw new Error("id not found.");return bytesToUtf8(tt)}get publicKey(){switch(this.id){case"v4":return this.get("secp256k1");default:throw new Error(ERR_INVALID_ID)}}get rs(){const tt=this.get("rs");if(tt)return decodeRelayShard(tt)}get rsv(){const tt=this.get("rsv");if(tt)return decodeRelayShard(tt)}get ip(){return getStringValue(this,"ip","ip4")}set ip(tt){setStringValue(this,"ip","ip4",tt)}get tcp(){return getNumberAsStringValue(this,"tcp","tcp")}set tcp(tt){setNumberAsStringValue(this,"tcp","tcp",tt)}get udp(){return getNumberAsStringValue(this,"udp","udp")}set udp(tt){setNumberAsStringValue(this,"udp","udp",tt)}get ip6(){return getStringValue(this,"ip6","ip6")}set ip6(tt){setStringValue(this,"ip6","ip6",tt)}get tcp6(){return getNumberAsStringValue(this,"tcp6","tcp")}set tcp6(tt){setNumberAsStringValue(this,"tcp6","tcp",tt)}get udp6(){return getNumberAsStringValue(this,"udp6","udp")}set udp6(tt){setNumberAsStringValue(this,"udp6","udp",tt)}get multiaddrs(){const tt=this.get("multiaddrs");if(tt)return decodeMultiaddrs(tt)}set multiaddrs(tt){deleteUndefined(this,"multiaddrs",tt,encodeMultiaddrs)}get waku2(){const tt=this.get("waku2");if(tt)return decodeWaku2(tt[0])}set waku2(tt){deleteUndefined(this,"waku2",tt,rt=>new Uint8Array([encodeWaku2(rt)]))}}function getStringValue(et,o,tt){const rt=et.get(o);if(rt)return convertToString(tt,rt)}function getNumberAsStringValue(et,o,tt){const rt=et.get(o);if(rt)return Number(convertToString(tt,rt))}function setStringValue(et,o,tt,rt){deleteUndefined(et,o,rt,convertToBytes.bind({},tt))}function setNumberAsStringValue(et,o,tt,rt){setStringValue(et,o,tt,rt==null?void 0:rt.toString(10))}function deleteUndefined(et,o,tt,rt){tt!==void 0?et.set(o,rt(tt)):et.delete(o)}async function sign(et,o){return sign$1(keccak256(o),et,{der:!1})}function nodeId(et){const tt=Point.fromHex(et).toRawBytes(!1);return bytesToHex$1(keccak256(tt.slice(1)))}const log$9=new Logger$1("enr");var TransportProtocol;(function(et){et.TCP="tcp",et.UDP="udp"})(TransportProtocol||(TransportProtocol={}));var TransportProtocolPerIpVersion;(function(et){et.TCP4="tcp4",et.UDP4="udp4",et.TCP6="tcp6",et.UDP6="udp6"})(TransportProtocolPerIpVersion||(TransportProtocolPerIpVersion={}));const as=class as extends RawEnr{constructor(){super(...arguments);wt(this,"peerId");wt(this,"getLocationMultiaddr",locationMultiaddrFromEnrFields.bind({},this))}static create(tt={},rt=BigInt(1),nt){const ot=new as(tt,rt,nt);try{const it=ot.publicKey;it&&(ot.peerId=createPeerIdFromPublicKey(it))}catch(it){log$9.error("Could not calculate peer id for ENR",it)}return ot}get nodeId(){switch(this.id){case"v4":return this.publicKey?nodeId(this.publicKey):void 0;default:throw new Error(ERR_INVALID_ID)}}get shardInfo(){return this.rs&&this.rsv&&log$9.warn("ENR contains both `rs` and `rsv` fields."),this.rs||this.rsv}setLocationMultiaddr(tt){const rt=tt.protoNames();if(rt.length!==2&&rt[1]!=="udp"&&rt[1]!=="tcp")throw new Error("Invalid multiaddr");const nt=tt.tuples();if(!nt[0][1]||!nt[1][1])throw new Error("Invalid multiaddr");nt[0][0]===4?(this.set("ip",nt[0][1]),this.set(rt[1],nt[1][1])):(this.set("ip6",nt[0][1]),this.set(rt[1]+"6",nt[1][1]))}getAllLocationMultiaddrs(){const tt=[];for(const nt of Object.values(TransportProtocolPerIpVersion)){const ot=this.getLocationMultiaddr(nt);ot&&tt.push(ot)}const rt=this.multiaddrs??[];return tt.concat(rt).map(nt=>this.peerId?nt.encapsulate(`/p2p/${this.peerId.toString()}`):nt)}get peerInfo(){const tt=this.peerId;if(tt)return{id:tt,multiaddrs:this.getAllLocationMultiaddrs()}}getFullMultiaddr(tt){if(this.peerId){const rt=this.getLocationMultiaddr(tt);if(rt)return rt.encapsulate(`/p2p/${this.peerId.toString()}`)}}getFullMultiaddrs(){if(this.peerId&&this.multiaddrs){const tt=this.peerId;return this.multiaddrs.map(rt=>rt.encapsulate(`/p2p/${tt.toString()}`))}return[]}verify(tt,rt){if(!this.get("id")||this.id!=="v4")throw new Error(ERR_INVALID_ID);if(!this.publicKey)throw new Error("Failed to verify ENR: No public key");return verifySignature(rt,keccak256(tt),this.publicKey)}async sign(tt,rt){switch(this.id){case"v4":this.signature=await sign(rt,tt);break;default:throw new Error(ERR_INVALID_ID)}return this.signature}};wt(as,"RECORD_PREFIX","enr:");let ENR=as;const version$2="logger/5.7.0";let _permanentCensorErrors=!1,_censorErrors=!1;const LogLevels={debug:1,default:2,info:2,warning:3,error:4,off:5};let _logLevel=LogLevels.default,_globalLogger=null;function _checkNormalize(){try{const et=[];if(["NFD","NFC","NFKD","NFKC"].forEach(o=>{try{if("test".normalize(o)!=="test")throw new Error("bad normalize")}catch{et.push(o)}}),et.length)throw new Error("missing "+et.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(et){return et.message}return null}const _normalizeError=_checkNormalize();var LogLevel;(function(et){et.DEBUG="DEBUG",et.INFO="INFO",et.WARNING="WARNING",et.ERROR="ERROR",et.OFF="OFF"})(LogLevel||(LogLevel={}));var ErrorCode;(function(et){et.UNKNOWN_ERROR="UNKNOWN_ERROR",et.NOT_IMPLEMENTED="NOT_IMPLEMENTED",et.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",et.NETWORK_ERROR="NETWORK_ERROR",et.SERVER_ERROR="SERVER_ERROR",et.TIMEOUT="TIMEOUT",et.BUFFER_OVERRUN="BUFFER_OVERRUN",et.NUMERIC_FAULT="NUMERIC_FAULT",et.MISSING_NEW="MISSING_NEW",et.INVALID_ARGUMENT="INVALID_ARGUMENT",et.MISSING_ARGUMENT="MISSING_ARGUMENT",et.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",et.CALL_EXCEPTION="CALL_EXCEPTION",et.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",et.NONCE_EXPIRED="NONCE_EXPIRED",et.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",et.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",et.TRANSACTION_REPLACED="TRANSACTION_REPLACED",et.ACTION_REJECTED="ACTION_REJECTED"})(ErrorCode||(ErrorCode={}));const HEX="0123456789abcdef";class Logger{constructor(o){Object.defineProperty(this,"version",{enumerable:!0,value:o,writable:!1})}_log(o,tt){const rt=o.toLowerCase();LogLevels[rt]==null&&this.throwArgumentError("invalid log level name","logLevel",o),!(_logLevel>LogLevels[rt])&&console.log.apply(console,tt)}debug(...o){this._log(Logger.levels.DEBUG,o)}info(...o){this._log(Logger.levels.INFO,o)}warn(...o){this._log(Logger.levels.WARNING,o)}makeError(o,tt,rt){if(_censorErrors)return this.makeError("censored error",tt,{});tt||(tt=Logger.errors.UNKNOWN_ERROR),rt||(rt={});const nt=[];Object.keys(rt).forEach(at=>{const ct=rt[at];try{if(ct instanceof Uint8Array){let lt="";for(let dt=0;dt>4],lt+=HEX[ct[dt]&15];nt.push(at+"=Uint8Array(0x"+lt+")")}else nt.push(at+"="+JSON.stringify(ct))}catch{nt.push(at+"="+JSON.stringify(rt[at].toString()))}}),nt.push(`code=${tt}`),nt.push(`version=${this.version}`);const ot=o;let it="";switch(tt){case ErrorCode.NUMERIC_FAULT:{it="NUMERIC_FAULT";const at=o;switch(at){case"overflow":case"underflow":case"division-by-zero":it+="-"+at;break;case"negative-power":case"negative-width":it+="-unsupported";break;case"unbound-bitwise-result":it+="-unbound-result";break}break}case ErrorCode.CALL_EXCEPTION:case ErrorCode.INSUFFICIENT_FUNDS:case ErrorCode.MISSING_NEW:case ErrorCode.NONCE_EXPIRED:case ErrorCode.REPLACEMENT_UNDERPRICED:case ErrorCode.TRANSACTION_REPLACED:case ErrorCode.UNPREDICTABLE_GAS_LIMIT:it=tt;break}it&&(o+=" [ See: https://links.ethers.org/v5-errors-"+it+" ]"),nt.length&&(o+=" ("+nt.join(", ")+")");const st=new Error(o);return st.reason=ot,st.code=tt,Object.keys(rt).forEach(function(at){st[at]=rt[at]}),st}throwError(o,tt,rt){throw this.makeError(o,tt,rt)}throwArgumentError(o,tt,rt){return this.throwError(o,Logger.errors.INVALID_ARGUMENT,{argument:tt,value:rt})}assert(o,tt,rt,nt){o||this.throwError(tt,rt,nt)}assertArgument(o,tt,rt,nt){o||this.throwArgumentError(tt,rt,nt)}checkNormalize(o){_normalizeError&&this.throwError("platform missing String.prototype.normalize",Logger.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:_normalizeError})}checkSafeUint53(o,tt){typeof o=="number"&&(tt==null&&(tt="value not safe"),(o<0||o>=9007199254740991)&&this.throwError(tt,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:o}),o%1&&this.throwError(tt,Logger.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:o}))}checkArgumentCount(o,tt,rt){rt?rt=": "+rt:rt="",ott&&this.throwError("too many arguments"+rt,Logger.errors.UNEXPECTED_ARGUMENT,{count:o,expectedCount:tt})}checkNew(o,tt){(o===Object||o==null)&&this.throwError("missing new",Logger.errors.MISSING_NEW,{name:tt.name})}checkAbstract(o,tt){o===tt?this.throwError("cannot instantiate abstract class "+JSON.stringify(tt.name)+" directly; use a sub-class",Logger.errors.UNSUPPORTED_OPERATION,{name:o.name,operation:"new"}):(o===Object||o==null)&&this.throwError("missing new",Logger.errors.MISSING_NEW,{name:tt.name})}static globalLogger(){return _globalLogger||(_globalLogger=new Logger(version$2)),_globalLogger}static setCensorship(o,tt){if(!o&&tt&&this.globalLogger().throwError("cannot permanently disable censorship",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),_permanentCensorErrors){if(!o)return;this.globalLogger().throwError("error censorship permanent",Logger.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}_censorErrors=!!o,_permanentCensorErrors=!!tt}static setLogLevel(o){const tt=LogLevels[o.toLowerCase()];if(tt==null){Logger.globalLogger().warn("invalid log level - "+o);return}_logLevel=tt}static from(o){return new Logger(o)}}Logger.errors=ErrorCode;Logger.levels=LogLevel;const version$1="bytes/5.7.0",logger$1=new Logger(version$1);function isHexable(et){return!!et.toHexString}function addSlice(et){return et.slice||(et.slice=function(){const o=Array.prototype.slice.call(arguments);return addSlice(new Uint8Array(Array.prototype.slice.apply(et,o)))}),et}function isBytesLike(et){return isHexString(et)&&!(et.length%2)||isBytes(et)}function isInteger(et){return typeof et=="number"&&et==et&&et%1===0}function isBytes(et){if(et==null)return!1;if(et.constructor===Uint8Array)return!0;if(typeof et=="string"||!isInteger(et.length)||et.length<0)return!1;for(let o=0;o=256)return!1}return!0}function arrayify(et,o){if(o||(o={}),typeof et=="number"){logger$1.checkSafeUint53(et,"invalid arrayify value");const tt=[];for(;et;)tt.unshift(et&255),et=parseInt(String(et/256));return tt.length===0&&tt.push(0),addSlice(new Uint8Array(tt))}if(o.allowMissingPrefix&&typeof et=="string"&&et.substring(0,2)!=="0x"&&(et="0x"+et),isHexable(et)&&(et=et.toHexString()),isHexString(et)){let tt=et.substring(2);tt.length%2&&(o.hexPad==="left"?tt="0"+tt:o.hexPad==="right"?tt+="0":logger$1.throwArgumentError("hex data is odd-length","value",et));const rt=[];for(let nt=0;nt>4]+HexCharacters[nt&15]}return tt}return logger$1.throwArgumentError("invalid hexlify value","value",et)}const version="rlp/5.7.0",logger=new Logger(version);function arrayifyInteger(et){const o=[];for(;et;)o.unshift(et&255),et>>=8;return o}function unarrayifyInteger(et,o,tt){let rt=0;for(let nt=0;nto+1+rt&&logger.throwError("child data too short",Logger.errors.BUFFER_OVERRUN,{})}return{consumed:1+rt,result:nt}}function _decode(et,o){if(et.length===0&&logger.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{}),et[o]>=248){const tt=et[o]-247;o+1+tt>et.length&&logger.throwError("data short segment too short",Logger.errors.BUFFER_OVERRUN,{});const rt=unarrayifyInteger(et,o+1,tt);return o+1+tt+rt>et.length&&logger.throwError("data long segment too short",Logger.errors.BUFFER_OVERRUN,{}),_decodeChildren(et,o,o+1+tt,tt+rt)}else if(et[o]>=192){const tt=et[o]-192;return o+1+tt>et.length&&logger.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{}),_decodeChildren(et,o,o+1,tt)}else if(et[o]>=184){const tt=et[o]-183;o+1+tt>et.length&&logger.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const rt=unarrayifyInteger(et,o+1,tt);o+1+tt+rt>et.length&&logger.throwError("data array too short",Logger.errors.BUFFER_OVERRUN,{});const nt=hexlify(et.slice(o+1+tt,o+1+tt+rt));return{consumed:1+tt+rt,result:nt}}else if(et[o]>=128){const tt=et[o]-128;o+1+tt>et.length&&logger.throwError("data too short",Logger.errors.BUFFER_OVERRUN,{});const rt=hexlify(et.slice(o+1,o+1+tt));return{consumed:1+tt,result:rt}}return{consumed:1,result:hexlify(et[o])}}function decode$8(et){const o=arrayify(et),tt=_decode(o,0);return tt.consumed!==o.length&&logger.throwArgumentError("invalid rlp data","data",et),tt.result}function base$1(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$2=base$1,_brrp__multiformats_scope_baseX$1=src$2;const coerce$1=et=>{if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")},fromString$3=et=>new TextEncoder().encode(et),toString$8=et=>new TextDecoder().decode(et);let Encoder$1=class{constructor(o,tt,rt){this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}},Decoder$1=class{constructor(o,tt,rt){if(this.name=o,this.prefix=tt,tt.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=tt.codePointAt(0),this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or$1(this,o)}},ComposedDecoder$1=class{constructor(o){this.decoders=o}or(o){return or$1(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const or$1=(et,o)=>new ComposedDecoder$1({...et.decoders||{[et.prefix]:et},...o.decoders||{[o.prefix]:o}});let Codec$1=class{constructor(o,tt,rt,nt){this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder$1(o,tt,rt),this.decoder=new Decoder$1(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}};const from$2=({name:et,prefix:o,encode:tt,decode:rt})=>new Codec$1(et,o,tt,rt),baseX$1=({prefix:et,name:o,alphabet:tt})=>{const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX$1(tt,o);return from$2({prefix:et,name:o,encode:rt,decode:ot=>coerce$1(nt(ot))})},decode$7=(et,o,tt,rt)=>{const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it},encode$6=(et,o,tt)=>{const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it&&(ot+=o[nt&st<from$2({prefix:o,name:et,encode(nt){return encode$6(nt,rt,tt)},decode(nt){return decode$7(nt,rt,tt,et)}}),identity$1=from$2({prefix:"\0",name:"identity",encode:et=>toString$8(et),decode:et=>fromString$3(et)}),identityBase$1=Object.freeze(Object.defineProperty({__proto__:null,identity:identity$1},Symbol.toStringTag,{value:"Module"})),base2$2=rfc4648$1({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),base2$3=Object.freeze(Object.defineProperty({__proto__:null,base2:base2$2},Symbol.toStringTag,{value:"Module"})),base8$2=rfc4648$1({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$3=Object.freeze(Object.defineProperty({__proto__:null,base8:base8$2},Symbol.toStringTag,{value:"Module"})),base10$2=baseX$1({prefix:"9",name:"base10",alphabet:"0123456789"}),base10$3=Object.freeze(Object.defineProperty({__proto__:null,base10:base10$2},Symbol.toStringTag,{value:"Module"})),base16$2=rfc4648$1({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper$1=rfc4648$1({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),base16$3=Object.freeze(Object.defineProperty({__proto__:null,base16:base16$2,base16upper:base16upper$1},Symbol.toStringTag,{value:"Module"})),base32$4=rfc4648$1({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper$1=rfc4648$1({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad$1=rfc4648$1({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper$1=rfc4648$1({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex$1=rfc4648$1({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper$1=rfc4648$1({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad$1=rfc4648$1({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper$1=rfc4648$1({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z$1=rfc4648$1({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$5=Object.freeze(Object.defineProperty({__proto__:null,base32:base32$4,base32hex:base32hex$1,base32hexpad:base32hexpad$1,base32hexpadupper:base32hexpadupper$1,base32hexupper:base32hexupper$1,base32pad:base32pad$1,base32padupper:base32padupper$1,base32upper:base32upper$1,base32z:base32z$1},Symbol.toStringTag,{value:"Module"})),base36$2=baseX$1({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper$1=baseX$1({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$3=Object.freeze(Object.defineProperty({__proto__:null,base36:base36$2,base36upper:base36upper$1},Symbol.toStringTag,{value:"Module"})),base58btc$1=baseX$1({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr$1=baseX$1({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58$1=Object.freeze(Object.defineProperty({__proto__:null,base58btc:base58btc$1,base58flickr:base58flickr$1},Symbol.toStringTag,{value:"Module"})),base64$4=rfc4648$1({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad$1=rfc4648$1({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url$1=rfc4648$1({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad$1=rfc4648$1({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$5=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$4,base64pad:base64pad$1,base64url:base64url$1,base64urlpad:base64urlpad$1},Symbol.toStringTag,{value:"Module"})),alphabet$1=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),alphabetBytesToChars$1=alphabet$1.reduce((et,o,tt)=>(et[tt]=o,et),[]),alphabetCharsToBytes$1=alphabet$1.reduce((et,o,tt)=>(et[o.codePointAt(0)]=tt,et),[]);function encode$5(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars$1[tt],o),"")}function decode$6(et){const o=[];for(const tt of et){const rt=alphabetCharsToBytes$1[tt.codePointAt(0)];if(rt===void 0)throw new Error(`Non-base256emoji character: ${tt}`);o.push(rt)}return new Uint8Array(o)}const base256emoji$2=from$2({prefix:"🚀",name:"base256emoji",encode:encode$5,decode:decode$6}),base256emoji$3=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:base256emoji$2},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases$1={...identityBase$1,...base2$3,...base8$3,...base10$3,...base16$3,...base32$5,...base36$3,...base58$1,...base64$5,...base256emoji$3};function createCodec$1(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$4=createCodec$1("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii$1=createCodec$1("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe$h(et.length);for(let tt=0;ttv4Regex$1.test(et),encode(et,o,tt){tt=~~tt,o=o||new Uint8Array(tt+v4Size);const rt=et.length;let nt=0;for(let ot=0;otet.length>0&&v6Regex$1.test(et),encode(et,o,tt){tt=~~tt;let rt=tt+v6Size,nt=-1,ot=0,it=0,st=!0,at=!1;o=o||new Uint8Array(tt+v6Size);for(let ct=0;ct>8),tt=97?lt-=87:lt>=65?lt-=55:(lt-=48,it=it*10+lt),ot=(ot<<4)+lt)}if(st===!1)at===!0?(tt>8),tt=nt+2;ct--)o[ct]=o[ct-2];o[nt]=0,o[nt+1]=0,nt=tt}if(nt!==tt&&nt!==-1)for(tt>rt-2&&(tt=rt-2);rt>nt;)o[--rt]=ttnt?o[--tt]:0;else for(;tt=SURROGATE_B||(et.charCodeAt(ot)&64512)!==SURROGATE_B?o+=3:(rt=ot,o+=4)}}return o}function encode$3(et,o,tt){const rt=et.length;tt==null&&(tt=0),o===void 0&&(o=new Uint8Array(encodingLength$1(et)+tt));let nt=tt;for(let ot=0;ot>6,o[nt++]=128|it&63;else if((it&63488)!==SURROGATE_A)o[nt++]=224|(it&61440)>>12,o[nt++]=128|(it&4032)>>6,o[nt++]=128|it&63;else{const st=ot+1;if(st===rt||it>=SURROGATE_B)o[nt++]=239,o[nt++]=191,o[nt++]=189;else{const at=et.charCodeAt(st);(at&64512)!==SURROGATE_B?(o[nt++]=239,o[nt++]=191,o[nt++]=189):(ot=st,it=65536|(it&1023)<<10|at&1023,o[nt++]=240|(it&1835008)>>18,o[nt++]=128|(it&258048)>>12,o[nt++]=128|(it&4032)>>6,o[nt++]=128|it&63)}}}return encode$3.bytes=nt-tt,o}encode$3.bytes=0;function decode$4(et,o,tt){let rt="";o==null&&(o=0),tt==null&&(tt=et.length);for(let nt=o;nt191&&ot<224)it=(ot&31)<<6|et[nt++]&63;else if(ot>239&&ot<365){it=((ot&7)<<18|(et[nt++]&63)<<12|(et[nt++]&63)<<6|et[nt++]&63)-65536;const st=SURROGATE_A|it>>10&1023;rt+=String.fromCharCode(st),it=SURROGATE_B|it&1023}else it=(ot&15)<<12|(et[nt++]&63)<<6|et[nt++]&63;rt+=String.fromCharCode(it)}return decode$4.bytes=tt-o,rt}decode$4.bytes=0;const isU8Arr=et=>et instanceof Uint8Array;function bytelength(et){return typeof et=="string"?encodingLength$1(et):et.byteLength}function from$1(et){return et instanceof Uint8Array?et:Array.isArray(et)?new Uint8Array(et):encode$3(et)}function write(et,o,tt){if(typeof o!="string")throw new Error("unknown input type");return encode$3(o,et,tt),encode$3.bytes}const P_24=Math.pow(2,24),P_16=Math.pow(2,16),P_8=Math.pow(2,8),readUInt32BE=(et,o)=>et[o]*P_24+et[o+1]*P_16+et[o+2]*P_8+et[o+3],readUInt16BE=(et,o)=>et[o]<<8|et[o+1],writeUInt32BE=(et,o,tt)=>(o=+o,et[tt+3]=o,o=o>>>8,et[tt+2]=o,o=o>>>8,et[tt+1]=o,o=o>>>8,et[tt]=o,tt+4),writeUInt16BE=(et,o,tt)=>(et[tt]=o>>8,et[tt+1]=o&255,tt+2);function copy(et,o,tt,rt,nt){return tt<0&&(rt-=tt,tt=0),rt<0&&(rt=0),nt<0?new Uint8Array(0):tt>=o.length||rt>=nt?0:_copyActual(et,o,tt,rt,nt)}function _copyActual(et,o,tt,rt,nt){nt-rt>o.length-tt&&(nt=rt+o.length-tt);let ot=nt-rt;const it=et.length-rt;return ot>it&&(ot=it),(rt!==0||ntet)}}const name$1=codec({encode(et,o,tt){o||(o=new Uint8Array(name$1.encodingLength(et))),tt||(tt=0);const rt=tt,nt=et.replace(/^\.|\.$/gm,"");if(nt.length){const ot=nt.split(".");for(let it=0;it=et.length)throw new Error("Cannot decode name (buffer overflow)");const st=et[o++];if(ot+=it?0:1,st===0)break;if(st&192)if((st&192)===192){if(o+1>et.length)throw new Error("Cannot decode name (buffer overflow)");const at=readUInt16BE(et,o-1)-49152;if(at>=rt)throw new Error("Cannot decode name (bad pointer)");o=at,rt=at,ot+=it?0:1,it=!0}else throw new Error("Cannot decode name (bad label)");else{if(o+st>et.length)throw new Error("Cannot decode name (buffer overflow)");if(nt+=st+1,nt>254)throw new Error("Cannot decode name (name too long)");tt.push(decode$4(et,o,o+st)),o+=st,ot+=it?0:st}}return name$1.decode.bytes=ot,tt.length===0?".":tt.join(".")},encodingLength(et){return et==="."||et===".."?1:bytelength(et.replace(/^\.|\.$/gm,""))+2}}),string$3=codec({encode(et,o,tt){o||(o=new Uint8Array(string$3.encodingLength(et))),tt||(tt=0);const rt=write(o,et,tt+1);return o[tt]=rt,string$3.encode.bytes=rt+1,o},decode(et,o){o||(o=0);const tt=et[o],rt=decode$4(et,o+1,o+1+tt);return string$3.decode.bytes=tt+1,rt},encodingLength(et){return bytelength(et)+1}}),header=codec({bytes:12,encode(et,o,tt){o||(o=new Uint8Array(header.encodingLength(et))),tt||(tt=0);const rt=(et.flags||0)&32767,nt=et.type==="response"?RESPONSE_FLAG:QUERY_FLAG;return writeUInt16BE(o,et.id||0,tt),writeUInt16BE(o,rt|nt,tt+2),writeUInt16BE(o,et.questions.length,tt+4),writeUInt16BE(o,et.answers.length,tt+6),writeUInt16BE(o,et.authorities.length,tt+8),writeUInt16BE(o,et.additionals.length,tt+10),o},decode(et,o){if(o||(o=0),et.length<12)throw new Error("Header must be 12 bytes");const tt=readUInt16BE(et,o+2);return{id:readUInt16BE(et,o),type:tt&RESPONSE_FLAG?"response":"query",flags:tt&32767,flag_qr:(tt>>15&1)===1,opcode:toString$5(tt>>11&15),flag_aa:(tt>>10&1)===1,flag_tc:(tt>>9&1)===1,flag_rd:(tt>>8&1)===1,flag_ra:(tt>>7&1)===1,flag_z:(tt>>6&1)===1,flag_ad:(tt>>5&1)===1,flag_cd:(tt>>4&1)===1,rcode:toString$6(tt&15),questions:new Array(readUInt16BE(et,o+4)),answers:new Array(readUInt16BE(et,o+6)),authorities:new Array(readUInt16BE(et,o+8)),additionals:new Array(readUInt16BE(et,o+10))}},encodingLength(){return 12}}),runknown=codec({encode(et,o,tt){o||(o=new Uint8Array(runknown.encodingLength(et))),tt||(tt=0);const rt=et.length;return writeUInt16BE(o,rt,tt),copy(et,o,tt+2,0,rt),runknown.encode.bytes=rt+2,o},decode(et,o){o||(o=0);const tt=readUInt16BE(et,o),rt=et.slice(o+2,o+2+tt);return runknown.decode.bytes=tt+2,rt},encodingLength(et){return et.length+2}}),rns=codec({encode(et,o,tt){return o||(o=new Uint8Array(rns.encodingLength(et))),tt||(tt=0),name$1.encode(et,o,tt+2),writeUInt16BE(o,name$1.encode.bytes,tt),rns.encode.bytes=name$1.encode.bytes+2,o},decode(et,o){o||(o=0);const tt=readUInt16BE(et,o),rt=name$1.decode(et,o+2);return rns.decode.bytes=tt+2,rt},encodingLength(et){return name$1.encodingLength(et)+2}}),rsoa=codec({encode(et,o,tt){o||(o=new Uint8Array(rsoa.encodingLength(et))),tt||(tt=0);const rt=tt;return tt+=2,name$1.encode(et.mname,o,tt),tt+=name$1.encode.bytes,name$1.encode(et.rname,o,tt),tt+=name$1.encode.bytes,writeUInt32BE(o,et.serial||0,tt),tt+=4,writeUInt32BE(o,et.refresh||0,tt),tt+=4,writeUInt32BE(o,et.retry||0,tt),tt+=4,writeUInt32BE(o,et.expire||0,tt),tt+=4,writeUInt32BE(o,et.minimum||0,tt),tt+=4,writeUInt16BE(o,tt-rt-2,rt),rsoa.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt=o,rt={};return o+=2,rt.mname=name$1.decode(et,o),o+=name$1.decode.bytes,rt.rname=name$1.decode(et,o),o+=name$1.decode.bytes,rt.serial=readUInt32BE(et,o),o+=4,rt.refresh=readUInt32BE(et,o),o+=4,rt.retry=readUInt32BE(et,o),o+=4,rt.expire=readUInt32BE(et,o),o+=4,rt.minimum=readUInt32BE(et,o),o+=4,rsoa.decode.bytes=o-tt,rt},encodingLength(et){return 22+name$1.encodingLength(et.mname)+name$1.encodingLength(et.rname)}}),rtxt=codec({encode(et,o,tt){Array.isArray(et)||(et=[et]);for(let nt=0;nt0;){const ot=et[o++];if(--rt,rtnew Uint8Array(et),roption=codec({encode(et,o,tt){o||(o=new Uint8Array(roption.encodingLength(et))),tt||(tt=0);const rt=tt,nt=toCode(et.code);if(writeUInt16BE(o,nt,tt),tt+=2,et.data)writeUInt16BE(o,et.data.length,tt),tt+=2,copy(et.data,o,tt),tt+=et.data.length;else switch(nt){case 8:{const ot=et.sourcePrefixLength||0,it=et.family||familyOf(et.ip),st=encode$4(et.ip,alloc),at=Math.ceil(ot/8);writeUInt16BE(o,at+4,tt),tt+=2,writeUInt16BE(o,it,tt),tt+=2,o[tt++]=ot,o[tt++]=et.scopePrefixLength||0,copy(st,o,tt,0,at),tt+=at}break;case 11:et.timeout?(writeUInt16BE(o,2,tt),tt+=2,writeUInt16BE(o,et.timeout,tt),tt+=2):(writeUInt16BE(o,0,tt),tt+=2);break;case 12:{const ot=et.length||0;writeUInt16BE(o,ot,tt),tt+=2,o.fill(0,tt,tt+ot),tt+=ot}break;case 14:{const ot=et.tags.length*2;writeUInt16BE(o,ot,tt),tt+=2;for(const it of et.tags)writeUInt16BE(o,it,tt),tt+=2}break;default:throw new Error(`Unknown roption code: ${et.code}`)}return roption.encode.bytes=tt-rt,o},decode(et,o){o||(o=0);const tt={};tt.code=readUInt16BE(et,o),tt.type=toString$3(tt.code),o+=2;const rt=readUInt16BE(et,o);switch(o+=2,tt.data=et.slice(o,o+rt),tt.code){case 8:tt.family=readUInt16BE(et,o),o+=2,tt.sourcePrefixLength=et[o++],tt.scopePrefixLength=et[o++];{const nt=new Uint8Array(tt.family===1?4:16);copy(et,nt,0,o,o+rt-4),tt.ip=decode$5(nt)}break;case 11:rt>0&&(tt.timeout=readUInt16BE(et,o),o+=2);break;case 14:tt.tags=[];for(let nt=0;nt0;)rt[ot++]=roption.decode(et,o),o+=roption.decode.bytes,nt-=roption.decode.bytes;return ropt.decode.bytes=o-tt,rt},encodingLength(et){return 2+encodingLengthList(et||[],roption)}}),rdnskey=codec({encode(et,o,tt){o||(o=new Uint8Array(rdnskey.encodingLength(et))),tt||(tt=0);const rt=tt,nt=et.key;if(!isU8Arr(nt))throw new Error("Key must be a Buffer");return tt+=2,writeUInt16BE(o,et.flags,tt),tt+=2,o[tt]=rdnskey.PROTOCOL_DNSSEC,tt+=1,o[tt]=et.algorithm,tt+=1,copy(nt,o,tt,0,nt.length),tt+=nt.length,rdnskey.encode.bytes=tt-rt,writeUInt16BE(o,rdnskey.encode.bytes-2,rt),o},decode(et,o){o||(o=0);const tt=o,rt={},nt=readUInt16BE(et,o);if(o+=2,rt.flags=readUInt16BE(et,o),o+=2,et[o]!==rdnskey.PROTOCOL_DNSSEC)throw new Error("Protocol must be 3");return o+=1,rt.algorithm=et[o],o+=1,rt.key=et.slice(o,tt+nt+2),o+=rt.key.length,rdnskey.decode.bytes=o-tt,rt},encodingLength(et){return 6+bytelength(et.key)}});rdnskey.PROTOCOL_DNSSEC=3;rdnskey.ZONE_KEY=128;rdnskey.SECURE_ENTRYPOINT=32768;const rrrsig=codec({encode(et,o,tt){o||(o=new Uint8Array(rrrsig.encodingLength(et))),tt||(tt=0);const rt=tt,nt=et.signature;if(!isU8Arr(nt))throw new Error("Signature must be a Buffer");return tt+=2,writeUInt16BE(o,toType(et.typeCovered),tt),tt+=2,o[tt]=et.algorithm,tt+=1,o[tt]=et.labels,tt+=1,writeUInt32BE(o,et.originalTTL,tt),tt+=4,writeUInt32BE(o,et.expiration,tt),tt+=4,writeUInt32BE(o,et.inception,tt),tt+=4,writeUInt16BE(o,et.keyTag,tt),tt+=2,name$1.encode(et.signersName,o,tt),tt+=name$1.encode.bytes,copy(nt,o,tt,0,nt.length),tt+=nt.length,rrrsig.encode.bytes=tt-rt,writeUInt16BE(o,rrrsig.encode.bytes-2,rt),o},decode(et,o){o||(o=0);const tt=o,rt={},nt=readUInt16BE(et,o);return o+=2,rt.typeCovered=toString$7(readUInt16BE(et,o)),o+=2,rt.algorithm=et[o],o+=1,rt.labels=et[o],o+=1,rt.originalTTL=readUInt32BE(et,o),o+=4,rt.expiration=readUInt32BE(et,o),o+=4,rt.inception=readUInt32BE(et,o),o+=4,rt.keyTag=readUInt16BE(et,o),o+=2,rt.signersName=name$1.decode(et,o),o+=name$1.decode.bytes,rt.signature=et.slice(o,tt+nt+2),o+=rt.signature.length,rrrsig.decode.bytes=o-tt,rt},encodingLength(et){return 20+name$1.encodingLength(et.signersName)+bytelength(et.signature)}}),rrp=codec({encode(et,o,tt){o||(o=new Uint8Array(rrp.encodingLength(et))),tt||(tt=0);const rt=tt;return tt+=2,name$1.encode(et.mbox||".",o,tt),tt+=name$1.encode.bytes,name$1.encode(et.txt||".",o,tt),tt+=name$1.encode.bytes,rrp.encode.bytes=tt-rt,writeUInt16BE(o,rrp.encode.bytes-2,rt),o},decode(et,o){o||(o=0);const tt=o,rt={};return o+=2,rt.mbox=name$1.decode(et,o)||".",o+=name$1.decode.bytes,rt.txt=name$1.decode(et,o)||".",o+=name$1.decode.bytes,rrp.decode.bytes=o-tt,rt},encodingLength(et){return 2+name$1.encodingLength(et.mbox||".")+name$1.encodingLength(et.txt||".")}}),typebitmap=codec({encode(et,o,tt){o||(o=new Uint8Array(typebitmap.encodingLength(et))),tt||(tt=0);const rt=tt,nt=[];for(let ot=0;ot>8]===void 0&&(nt[it>>8]=[]),nt[it>>8][it>>3&31]|=1<<7-(it&7)}for(let ot=0;ot>8]=Math.max(o[nt>>8]||0,nt&255)}let tt=0;for(let rt=0;rt>15&1)===1,tt.options=ropt.decode(et,o+8),o+=8+ropt.decode.bytes;else{const nt=readUInt16BE(et,o+2);tt.ttl=readUInt32BE(et,o+4),tt.class=toString$4(nt&NOT_FLUSH_MASK),tt.flush=!!(nt&FLUSH_MASK);const ot=renc(tt.type);tt.data=ot.decode(et,o+8),o+=8+ot.decode.bytes}return answer.decode.bytes=o-rt,tt},encodingLength(et){const o=et.data!==null&&et.data!==void 0?et.data:et.options;return name$1.encodingLength(et.name)+8+renc(et.type).encodingLength(o)}}),question=codec({encode(et,o,tt){o||(o=new Uint8Array(question.encodingLength(et))),tt||(tt=0);const rt=tt;return name$1.encode(et.name,o,tt),tt+=name$1.encode.bytes,writeUInt16BE(o,toType(et.type),tt),tt+=2,writeUInt16BE(o,toClass(et.class===void 0?"IN":et.class),tt),tt+=2,question.encode.bytes=tt-rt,et},decode(et,o){o||(o=0);const tt=o,rt={};return rt.name=name$1.decode(et,o),o+=name$1.decode.bytes,rt.type=toString$7(readUInt16BE(et,o)),o+=2,rt.class=toString$4(readUInt16BE(et,o)),o+=2,!!(rt.class&QU_MASK)&&(rt.class&=NOT_QU_MASK),question.decode.bytes=o-tt,rt},encodingLength(et){return name$1.encodingLength(et.name)+4}}),RECURSION_DESIRED=256,packet={encode:function(et,o,tt){const rt=!o;rt&&(o=new Uint8Array(encodingLength(et))),tt||(tt=0);const nt=tt;return et.questions||(et.questions=[]),et.answers||(et.answers=[]),et.authorities||(et.authorities=[]),et.additionals||(et.additionals=[]),header.encode(et,o,tt),tt+=header.encode.bytes,tt=encodeList(et.questions,question,o,tt),tt=encodeList(et.answers,answer,o,tt),tt=encodeList(et.authorities,answer,o,tt),tt=encodeList(et.additionals,answer,o,tt),packet.encode.bytes=tt-nt,rt&&encode$2.bytes!==o.length?o.slice(0,encode$2.bytes):o},decode:function(et,o){o||(o=0);const tt=o,rt=header.decode(et,o);return o+=header.decode.bytes,o=decodeList(rt.questions,question,et,o),o=decodeList(rt.answers,answer,et,o),o=decodeList(rt.authorities,answer,et,o),o=decodeList(rt.additionals,answer,et,o),packet.decode.bytes=o-tt,rt},encodingLength:function(et){return header.encodingLength(et)+encodingLengthList(et.questions||[],question)+encodingLengthList(et.answers||[],answer)+encodingLengthList(et.authorities||[],answer)+encodingLengthList(et.additionals||[],answer)}};packet.encode.bytes=0;packet.decode.bytes=0;const encode$2=packet.encode,decode$3=packet.decode,encodingLength=packet.encodingLength;function encodingLengthList(et,o){let tt=0;for(let rt=0;rt255)throw new Error(`Character #${at} in charset [code=${ct}, char=${o.charAt(at)}] is too high! (max=255)`);if(nt[ct]!==0)throw new Error(`Character [code=${ct}, char=${o.charAt(at)}] is more than once in the charset!`);nt[ct]=at,ot[at]=ct}const it=tt.charCodeAt(0),st={name:et,encodingLength(at){const ct=at.length,lt=ct*.75|0;return at.charCodeAt(ct-1)===it?at.charCodeAt(ct-2)===it?lt-2:lt-1:lt},encode(at,ct,lt){ct==null&&(ct=new Uint8Array(st.encodingLength(at))),lt==null&&(lt=0);let dt=at.length;at.charCodeAt(dt-1)===it&&(at.charCodeAt(dt-2)===it?dt-=2:dt-=1);const ht=dt%4,mt=dt-ht;let ft=lt,pt=0;for(;pt>16,ct[ft++]=yt>>8,ct[ft++]=yt,pt+=4}if(ht===3){const yt=nt[at.charCodeAt(pt)]<<10|nt[at.charCodeAt(pt+1)]<<4|nt[at.charCodeAt(pt+2)]>>2;ct[ft++]=yt>>8,ct[ft++]=yt}else ht===2&&(ct[ft++]=nt[at.charCodeAt(pt)]<<2|nt[at.charCodeAt(pt+1)]>>4);return st.encode.bytes=ft-lt,ct},decode(at,ct,lt){ct==null&&(ct=0),lt==null&&(lt=at.length);const dt=lt-ct,ht=dt%3,mt=ct+dt-ht,ft=[];for(let pt=ct;pt>18&63],ot[yt>>12&63],ot[yt>>6&63],ot[yt&63])}if(ht===2){const pt=(at[lt-2]<<8)+at[lt-1];ft.push(ot[pt>>10],ot[pt>>4&63],ot[pt<<2&63]),rt===PREFERS_PADDING&&ft.push(it)}else if(ht===1){const pt=at[lt-1];ft.push(ot[pt>>2],ot[pt<<4&63]),rt===PREFERS_PADDING&&ft.push(it,it)}return st.decode.bytes=dt,String.fromCharCode.apply(String,ft)}};return st}make("base64","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","=",PREFERS_PADDING);const base64URL=make("base64-url","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_","=",PREFERS_NO_PADDING);let AbortError=typeof globalThis<"u"?globalThis.AbortError:typeof window<"u"?window.AbortError:null;AbortError||(AbortError=class extends Error{constructor(o="Request aborted."){super(o)}});AbortError.prototype.name="AbortError";AbortError.prototype.code="ABORT_ERR";const URL$1=typeof globalThis<"u"&&globalThis.URL||require("url").URL;class HTTPStatusError extends Error{constructor(o,tt,rt){super("status="+tt+" while requesting "+o+" ["+rt+"]"),this.uri=o,this.status=tt,this.method=rt}toJSON(){return{code:this.code,uri:this.uri,status:this.status,method:this.method,endpoint:this.endpoint}}}HTTPStatusError.prototype.name="HTTPStatusError";HTTPStatusError.prototype.code="HTTP_STATUS";class ResponseError extends Error{constructor(o,tt){super(o),this.cause=tt}toJSON(){return{message:this.message,endpoint:this.endpoint,code:this.code,cause:reduceError(this.cause)}}}ResponseError.prototype.name="ResponseError";ResponseError.prototype.code="RESPONSE_ERR";class TimeoutError extends Error{constructor(o){super("Timeout (t="+o+")."),this.timeout=o}toJSON(){return{code:this.code,endpoint:this.endpoint,timeout:this.timeout}}}TimeoutError.prototype.name="TimeoutError";TimeoutError.prototype.code="ETIMEOUT";const v4Regex=/^((\d{1,3}\.){3,3}\d{1,3})(:(\d{2,5}))?$/,v6Regex=/^((::)?(((\d{1,3}\.){3}(\d{1,3}){1})?([0-9a-f]){0,4}:{0,2}){1,8}(::)?)(:(\d{2,5}))?$/i;function reduceError(et){if(typeof et=="string")return{message:et};try{const tt=JSON.stringify(et);if(tt!=="{}")return JSON.parse(tt)}catch{}const o={message:String(et.message||et)};return et.code!==void 0&&(o.code=String(et.code)),o}const baseParts=/^(([a-z0-9]+:)\/\/)?([^/[\s:]+|\[[^\]]+\])?(:([^/\s]+))?(\/[^\s]*)?(.*)$/,httpFlags=/\[(post|get|((ipv4|ipv6|name)=([^\]]+)))\]/ig,updFlags=/\[(((pk|name)=([^\]]+)))\]/ig;function parseEndpoint(et){const o=baseParts.exec(et),tt=o[2]||"https:",rt=o[3],nt=o[5],ot=o[6],it=o[7];if(tt==="https:"||tt==="http:"){const st=parseFlags(it,httpFlags);return{name:st.name,protocol:tt,ipv4:st.ipv4,ipv6:st.ipv6,host:rt,port:nt,path:ot,method:st.post?"POST":"GET"}}if(tt==="udp:"||tt==="udp4:"||tt==="udp6:"){const st=parseFlags(it,updFlags),at=/^\[(.*)\]$/.exec(rt);if(at&&tt==="udp4:")throw new Error(`Endpoint parsing error: Cannot use ipv6 host with udp4: (endpoint=${et})`);if(!at&&tt==="udp6:")throw new Error(`Endpoint parsing error: Incorrectly formatted host for udp6: (endpoint=${et})`);return at?new UDP6Endpoint({protocol:"udp6:",ipv6:at[1],port:nt,pk:st.pk,name:st.name}):new UDP4Endpoint({protocol:"udp4:",ipv4:rt,port:nt,pk:st.pk,name:st.name})}throw new InvalidProtocolError(tt,et)}function parseFlags(et,o){o.lastIndex=0;const tt={};for(;;){const rt=o.exec(et);if(!rt)break;rt[2]?tt[rt[3].toLowerCase()]=rt[4]:tt[rt[1].toLowerCase()]=!0}return tt}class InvalidProtocolError extends Error{constructor(o,tt){super(`Invalid Endpoint: unsupported protocol "${o}" for endpoint: ${tt}, supported protocols: ${supportedProtocols.join(", ")}`),this.protocol=o,this.endpoint=tt}toJSON(){return{code:this.code,endpoint:this.endpoint,timeout:this.timeout}}}InvalidProtocolError.prototype.name="InvalidProtocolError";InvalidProtocolError.prototype.code="EPROTOCOL";const supportedProtocols=["http:","https:","udp4:","udp6:"];class BaseEndpoint{constructor(o,tt){this.name=o.name||null,this.protocol=o.protocol;const rt=typeof o.port=="string"?o.port=parseInt(o.port,10):o.port;if(rt==null)this.port=tt?this.protocol==="https:"?443:80:o.pk?443:53;else{if(typeof rt!="number"&&!isNaN(rt))throw new Error(`Invalid Endpoint: port "${o.port}" needs to be a number: ${JSON.stringify(o)}`);this.port=rt}}toJSON(){return this.toString()}}class UDPEndpoint extends BaseEndpoint{constructor(o){super(o,!1),this.pk=o.pk||null}toString(){const o=this.port!==(this.pk?443:53)?`:${this.port}`:"",tt=this.pk?` [pk=${this.pk}]`:"",rt=this.name?` [name=${this.name}]`:"";return`udp://${this.ipv4||`[${this.ipv6}]`}${o}${tt}${rt}`}}class UDP4Endpoint extends UDPEndpoint{constructor(o){if(super(Object.assign({protocol:"udp4:"},o)),!o.ipv4||typeof o.ipv4!="string")throw new Error(`Invalid Endpoint: .ipv4 "${o.ipv4}" needs to be set: ${JSON.stringify(o)}`);this.ipv4=o.ipv4}}class UDP6Endpoint extends UDPEndpoint{constructor(o){if(super(Object.assign({protocol:"udp6:"},o)),!o.ipv6||typeof o.ipv6!="string")throw new Error(`Invalid Endpoint: .ipv6 "${o.ipv6}" needs to be set: ${JSON.stringify(o)}`);this.ipv6=o.ipv6}}function safeHost(et){return v6Regex.test(et)&&!v4Regex.test(et)?`[${et}]`:et}class HTTPEndpoint extends BaseEndpoint{constructor(o){if(super(Object.assign({protocol:"https:"},o),!0),o.host||(o.ipv4&&(o.host=o.ipv4),o.ipv6&&(o.host=`[${o.ipv6}]`)),!o.host||typeof o.host!="string")throw new Error(`Invalid Endpoint: host "${o.path}" needs to be set: ${JSON.stringify(o)}`);if(this.host=o.host,this.path=o.path||"/dns-query",this.method=/^post$/i.test(o.method)?"POST":"GET",this.ipv4=o.ipv4,this.ipv6=o.ipv6,!this.ipv6){const rt=v6Regex.exec(this.host);rt&&(this.ipv6=rt[1])}this.ipv4||v4Regex.test(this.host)&&(this.ipv4=this.host);const tt=`${this.protocol}//${safeHost(this.host)}:${this.port}${this.path}`;try{this.url=new URL$1(tt)}catch(rt){throw new Error(rt.message+` [${tt}]`)}}toString(){const o=this.protocol==="https:"?"":"http://",tt=this.port!==(this.protocol==="https:"?443:80)?`:${this.port}`:"",rt=this.method!=="GET"?" [post]":"",nt=this.path==="/dns-query"?"":this.path,ot=this.name?` [name=${this.name}]`:"",it=this.ipv4&&this.ipv4!==this.host?` [ipv4=${this.ipv4}]`:"",st=this.ipv6&&this.ipv6!==this.host?` [ipv6=${this.ipv6}]`:"";return`${o}${safeHost(this.host)}${tt}${nt}${rt}${it}${st}${ot}`}}function toEndpoint(et){let o;if(typeof et=="string")o=parseEndpoint(et);else{if(typeof et!="object"||et===null||Array.isArray(et))throw new Error(`Can not convert ${et} to an endpoint`);if(et instanceof BaseEndpoint)return et;o=et}(o.protocol===null||o.protocol===void 0)&&(o.protocol="https:");const tt=o.protocol;if(tt==="udp4:")return new UDP4Endpoint(o);if(tt==="udp6:")return new UDP6Endpoint(o);if(tt==="https:"||tt==="http:")return new HTTPEndpoint(o);throw new InvalidProtocolError(tt,JSON.stringify(o))}const contentType="application/dns-message";function noop$1(){}function queryDns(){throw new Error('Only "doh" endpoints are supported in the browser')}async function loadJSON(et,o,tt,rt){const nt=o?o.localStoragePrefix+o.name:null;if(nt)try{const st=JSON.parse(localStorage.getItem(nt));if(st&&st.time>o.maxTime)return st}catch{}const{data:ot}=await requestRaw(et,"GET",null,tt,rt),it={time:Date.now(),data:JSON.parse(decode$4(ot))};if(nt)try{localStorage.setItem(nt,JSON.stringify(it))}catch{it.time=null}return it}function requestRaw(et,o,tt,rt,nt){return new Promise((ot,it)=>{const st=new URL$1(et);o==="GET"&&tt&&(st.search="?dns="+base64URL.decode(tt));const at=st.toString(),ct=new XMLHttpRequest;ct.open(o,at,!0),ct.setRequestHeader("Accept",contentType),o==="POST"&&ct.setRequestHeader("Content-Type",contentType),ct.responseType="arraybuffer",ct.timeout=rt,ct.ontimeout=lt,ct.onreadystatechange=ht,ct.onerror=ft,ct.onload=dt,o==="POST"?ct.send(tt):ct.send(),nt&&nt.addEventListener("abort",pt);function lt(){mt(new TimeoutError(rt));try{ct.abort()}catch{}}function dt(){if(ct.status!==200)mt(new HTTPStatusError(at,ct.status,o));else{let yt;if(typeof ct.response=="string")yt=encode$3(ct.response);else if(ct.response instanceof Uint8Array)yt=ct.response;else if(Array.isArray(ct.response)||ct.response instanceof ArrayBuffer)yt=new Uint8Array(ct.response);else throw new Error("Unprocessable response "+ct.response);mt(null,yt)}}function ht(){if(ct.readyState>1&&ct.status!==200&&ct.status!==0){mt(new HTTPStatusError(at,ct.status,o));try{ct.abort()}catch{}}}let mt=function(yt,gt){mt=noop$1,nt&&nt.removeEventListener("abort",pt),ot(yt?{error:yt,response:ct}:{data:gt,response:ct})};function ft(){mt(ct.status===200?new Error("Inexplicable XHR Error"):new HTTPStatusError(at,ct.status,o))}function pt(){mt(new AbortError);try{ct.abort()}catch{}}})}function request(et,o,tt,rt,nt){return requestRaw(et,o,tt,rt,nt)}function processResolvers$1(et){return et.filter(o=>o.cors||o.endpoint.cors)}const resolvers={data:[{name:"adfree.usableprivacy.net",endpoint:{protocol:"https:",host:"adfree.usableprivacy.net"},description:`Public updns DoH service with advertising, tracker and malware filters. -Hosted in Europe by @usableprivacy, details see: https://docs.usableprivacy.com`,country:"Germany",location:{lat:51.2993,long:9.491},filter:!0},{name:"adguard-dns-doh",endpoint:{protocol:"https:",host:"dns.adguard.com",ipv4:"94.140.15.15"},description:"Remove ads and protect your computer from malware (over DoH)",country:"France",location:{lat:48.8582,long:2.3387},filter:!0},{name:"adguard-dns-family-doh",endpoint:{protocol:"https:",host:"dns-family.adguard.com",ipv4:"94.140.15.16"},description:"Adguard DNS with safesearch and adult content blocking (over DoH)",country:"France",location:{lat:48.8582,long:2.3387},filter:!0},{name:"adguard-dns-unfiltered-doh",endpoint:{protocol:"https:",host:"dns-unfiltered.adguard.com",ipv4:"94.140.14.140"},description:"AdGuard public DNS servers without filters (over DoH)",country:"France",location:{lat:48.8582,long:2.3387}},{name:"ahadns-doh-chi",endpoint:{protocol:"https:",host:"doh.chi.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Chicago, USA. By https://ahadns.com/ -Server statistics can be seen at: https://statistics.ahadns.com/?server=chi`,country:"United States",location:{lat:41.8483,long:-87.6517},filter:!0,cors:!0},{name:"ahadns-doh-in",endpoint:{protocol:"https:",host:"doh.in.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Mumbai, India. By https://ahadns.com/ -Server statistics can be seen at: https://statistics.ahadns.com/?server=in`,country:"India",location:{lat:19.0748,long:72.8856},filter:!0,cors:!0},{name:"ahadns-doh-la",endpoint:{protocol:"https:",host:"doh.la.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Los Angeles, USA. By https://ahadns.com/ -Server statistics can be seen at: https://statistics.ahadns.com/?server=la`,country:"United States",location:{lat:34.0549,long:-118.2578},filter:!0,cors:!0},{name:"ahadns-doh-nl",endpoint:{protocol:"https:",host:"doh.nl.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Amsterdam, Netherlands. By https://ahadns.com/ -Server statistics can be seen at: https://statistics.ahadns.com/?server=nl`,country:"Netherlands",location:{lat:52.3824,long:4.8995},filter:!0,cors:!0},{name:"ahadns-doh-ny",endpoint:{protocol:"https:",host:"doh.ny.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in New York. By https://ahadns.com/ -Server statistics can be seen at: https://statistics.ahadns.com/?server=ny`,country:"United States",location:{lat:40.7308,long:-73.9975},filter:!0,cors:!0},{name:"ahadns-doh-pl",endpoint:{protocol:"https:",host:"doh.pl.ahadns.net",cors:!0},description:`A zero logging DNS with support for DNS-over-HTTPS (DoH) & DNS-over-TLS (DoT). Blocks ads, malware, trackers, viruses, ransomware, telemetry and more. No persistent logs. DNSSEC. Hosted in Poland. By https://ahadns.com/ -Server statistics can be seen at: https://statistics.ahadns.com/?server=pl`,country:"Netherlands",location:{lat:52.3824,long:4.8995},filter:!0,cors:!0},{name:"alidns-doh",endpoint:{protocol:"https:",host:"dns.alidns.com",ipv4:"223.5.5.5",cors:!0},description:`A public DNS resolver that supports DoH/DoT in mainland China, provided by Alibaba-Cloud. -Warning: GFW filtering rules are applied by that resolver. -Homepage: https://alidns.com/`,country:"China",location:{lat:34.7725,long:113.7266},filter:!0,log:!0,cors:!0},{name:"ams-ads-doh-nl",endpoint:{protocol:"https:",host:"dnsnl-noads.alekberg.net"},description:"Resolver in Amsterdam. DoH protocol. Non-logging. Blocks ads, malware and trackers. DNSSEC enabled.",country:"Romania",location:{lat:45.9968,long:24.997},filter:!0},{name:"ams-doh-nl",endpoint:{protocol:"https:",host:"dnsnl.alekberg.net"},description:"Resolver in Amsterdam. DoH protocol. Non-logging, non-filtering, DNSSEC.",country:"Romania",location:{lat:45.9968,long:24.997}},{name:"att",endpoint:{protocol:"https:",host:"dohtrial.att.net"},description:"AT&T test DoH server.",log:!0},{name:"bcn-ads-doh",endpoint:{protocol:"https:",host:"dnses-noads.alekberg.net"},description:"Resolver in Spain. DoH protocol. Non-logging, remove ads and malware, DNSSEC.",country:"Spain",location:{lat:41.3891,long:2.1611},filter:!0},{name:"bcn-doh",endpoint:{protocol:"https:",host:"dnses.alekberg.net"},description:"Resolver in Spain. DoH protocol. Non-logging, non-filtering, DNSSEC.",country:"Spain",location:{lat:41.3891,long:2.1611}},{name:"brahma-world",endpoint:{protocol:"https:",host:"dns.brahma.world"},description:`DNS-over-HTTPS server. Non Logging, filters ads, trackers and malware. DNSSEC ready, QNAME Minimization, No EDNS Client-Subnet. -Hosted in Stockholm, Sweden. (https://dns.brahma.world)`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"cisco-doh",endpoint:{protocol:"https:",host:"doh.opendns.com",ipv4:"146.112.41.2"},description:`Remove your DNS blind spot (DoH protocol) -Warning: modifies your queries to include a copy of your network -address when forwarding them to a selection of companies and organizations.`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0,log:!0},{name:"cloudflare",endpoint:{protocol:"https:",host:"dns.cloudflare.com",ipv4:"1.0.0.1",cors:!0},description:"Cloudflare DNS (anycast) - aka 1.1.1.1 / 1.0.0.1",country:"Australia",location:{lat:-33.494,long:143.2104},cors:!0},{name:"cloudflare-family",endpoint:{protocol:"https:",host:"family.cloudflare-dns.com",ipv4:"1.0.0.3",cors:!0},description:"Cloudflare DNS (anycast) with malware protection and parental control - aka 1.1.1.3 / 1.0.0.3",country:"Australia",location:{lat:-33.494,long:143.2104},filter:!0,cors:!0},{name:"cloudflare-ipv6",endpoint:{protocol:"https:",host:"1dot1dot1dot1.cloudflare-dns.com",cors:!0},description:"Cloudflare DNS over IPv6 (anycast)",country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"cloudflare-security",endpoint:{protocol:"https:",host:"security.cloudflare-dns.com",ipv4:"1.0.0.2",cors:!0},description:"Cloudflare DNS (anycast) with malware blocking - aka 1.1.1.2 / 1.0.0.2",country:"Australia",location:{lat:-33.494,long:143.2104},filter:!0,cors:!0},{name:"controld-block-malware",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p1"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns -This DNS blocks Malware domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-block-malware-ad",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p2"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns -This DNS blocks Malware, Ads & Tracking domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-block-malware-ad-social",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p3"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns -This DNS blocks Malware, Ads & Tracking and Social Networks domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-family-friendly",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/family"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns -This DNS blocks Malware, Ads & Tracking, Adult Content and Drugs domains.`,country:"Canada",location:{lat:43.6319,long:-79.3716},filter:!0},{name:"controld-uncensored",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/uncensored"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns -This DNS unblocks censored domains from various countries.`,country:"Canada",location:{lat:43.6319,long:-79.3716}},{name:"controld-unfiltered",endpoint:{protocol:"https:",host:"freedns.controld.com",path:"/p0"},description:`ControlD Free DNS. Take CONTROL of your Internet. Block unwanted content, bypass geo-restrictions and be more productive. DoH protocol and No logging. - https://controld.com/free-dns -This is a Unfiltered DNS, no DNS record blocking or manipulation here, if you want to block Malware, Ads & Tracking or Social Network domains, use the other ControlD DNS configs.`,country:"Canada",location:{lat:43.6319,long:-79.3716}},{name:"dns.digitale-gesellschaft.ch",endpoint:{protocol:"https:",host:"dns.digitale-gesellschaft.ch"},description:`Public DoH resolver operated by the Digital Society (https://www.digitale-gesellschaft.ch). -Hosted in Zurich, Switzerland. -Non-logging, non-filtering, supports DNSSEC.`,country:"Switzerland",location:{lat:47.1449,long:8.1551}},{name:"dns.ryan-palmer",endpoint:{protocol:"https:",host:"dns1.ryan-palmer.com"},description:"Non-logging, non-filtering, DNSSEC DoH Server. Hosted in the UK.",country:"United Kingdom",location:{lat:51.5164,long:-.093}},{name:"dns.sb",endpoint:{protocol:"https:",host:"doh.sb",ipv4:"185.222.222.222",cors:!0},description:`DNSSEC-enabled DoH server by https://xtom.com/ -https://dns.sb/doh/`,country:"Unknown",location:{lat:47,long:8},cors:!0},{name:"dns.therifleman.name",endpoint:{protocol:"https:",host:"dns.therifleman.name"},description:`DNS-over-HTTPS DNS forwarder from Mumbai, India. Blocks web and Android trackers and ads. -IP addresses are not logged, but queries are logged for 24 hours for debugging. -Report issues, send suggestions @ joker349 at protonmail.com. -Also supports DoT (for android) @ dns.therifleman.name and plain DNS @ 172.104.206.174`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"dnsforfamily-doh",endpoint:{protocol:"https:",host:"dns-doh.dnsforfamily.com"},description:`(DoH Protocol) (Now supports DNSSEC). Block adult websites, gambling websites, malwares and advertisements. -It also enforces safe search in: Google, YouTube, Bing, DuckDuckGo and Yandex. -Social websites like Facebook and Instagram are not blocked. No DNS queries are logged. -As of 26-May-2022 5.9 million websites are blocked and new websites are added to blacklist daily. -Completely free, no ads or any commercial motive. Operating for 4 years now. -Provided by: https://dnsforfamily.com`,country:"Finland",location:{lat:60.1758,long:24.9349},filter:!0},{name:"dnsforfamily-doh-no-safe-search",endpoint:{protocol:"https:",host:"dns-doh-no-safe-search.dnsforfamily.com"},description:`(DoH Protocol) (Now supports DNSSEC) Block adult websites, gambling websites, malwares and advertisements. -Unlike other dnsforfamily servers, this one does not enforces safe search. So Google, YouTube, Bing, DuckDuckGo and Yandex are completely accessible without any restriction. -Social websites like Facebook and Instagram are not blocked. No DNS queries are logged. -As of 26-May-2022 5.9 million websites are blocked and new websites are added to blacklist daily. -Completely free, no ads or any commercial motive. Operating for 4 years now. -Warning: This server is incompatible with anonymization. -Provided by: https://dnsforfamily.com`,country:"Finland",location:{lat:60.1758,long:24.9349},filter:!0},{name:"dnsforge.de",endpoint:{protocol:"https:",host:"dnsforge.de",cors:!0},description:`Public DoH resolver running with Pihole for Adblocking (https://dnsforge.de). -Non-logging, AD-filtering, supports DNSSEC. Hosted in Germany.`,country:"Germany",location:{lat:52.2998,long:9.447},filter:!0,cors:!0},{name:"dnshome-doh",endpoint:{protocol:"https:",host:"dns.dnshome.de"},description:"https://www.dnshome.de/ public resolver in Germany"},{name:"dnspod-doh",endpoint:{protocol:"https:",host:"doh.pub",cors:!0},description:`A public DNS resolver in mainland China provided by DNSPod (Tencent Cloud). -https://www.dnspod.cn/Products/Public.DNS?lang=en`,filter:!0,log:!0,cors:!0},{name:"dnswarden-asia-adblock-dohv4",endpoint:{protocol:"https:",host:"doh.asia.dnswarden.com",path:"/adblock"},description:"Hosted in Singapore. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Singapore",location:{lat:1.2929,long:103.8547},filter:!0},{name:"dnswarden-asia-adultfilter-dohv4",endpoint:{protocol:"https:",host:"doh.asia.dnswarden.com",path:"/adultfilter"},description:"Hosted in Singapore. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Singapore",location:{lat:1.2929,long:103.8547},filter:!0},{name:"dnswarden-asia-uncensor-dohv4",endpoint:{protocol:"https:",host:"doh.asia.dnswarden.com",path:"/uncensored"},description:"Hosted in Singapore. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Singapore",location:{lat:1.2929,long:103.8547}},{name:"dnswarden-eu-adblock-dohv4",endpoint:{protocol:"https:",host:"doh.eu.dnswarden.com"},description:"Hosted in Germany. For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"Germany",location:{lat:50.1103,long:8.7147},filter:!0},{name:"dnswarden-us-adblock-dohv4",endpoint:{protocol:"https:",host:"doh.us.dnswarden.com"},description:"Hosted in USA (Dallas) . For more information look [here](https://github.com/bhanupratapys/dnswarden) or [here](https://dnswarden.com).",country:"United States",location:{lat:32.7889,long:-96.8021},filter:!0},{name:"doh-ch-blahdns",endpoint:{protocol:"https:",host:"doh-ch.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Switzerland. By https://blahdns.com/",country:"Netherlands",location:{lat:52.3824,long:4.8995},filter:!0,cors:!0},{name:"doh-cleanbrowsing-adult",endpoint:{protocol:"https:",host:"doh.cleanbrowsing.org",path:"/doh/adult-filter/",cors:!0},description:`Blocks access to all adult, pornographic and explicit sites. It does -not block proxy or VPNs, nor mixed-content sites. Sites like Reddit -are allowed. Google and Bing are set to the Safe Mode. -By https://cleanbrowsing.org/`,filter:!0,cors:!0},{name:"doh-cleanbrowsing-family",endpoint:{protocol:"https:",host:"doh.cleanbrowsing.org",path:"/doh/family-filter/",cors:!0},description:`Blocks access to all adult, pornographic and explicit sites. It also -blocks proxy and VPN domains that are used to bypass the filters. -Mixed content sites (like Reddit) are also blocked. Google, Bing and -Youtube are set to the Safe Mode. -By https://cleanbrowsing.org/`,filter:!0,cors:!0},{name:"doh-cleanbrowsing-security",endpoint:{protocol:"https:",host:"doh.cleanbrowsing.org",path:"/doh/security-filter/",cors:!0},description:`Block access to phishing, malware and malicious domains. It does not block adult content. -By https://cleanbrowsing.org/`,filter:!0,cors:!0},{name:"doh-crypto-sx",endpoint:{protocol:"https:",host:"doh.crypto.sx",cors:!0},description:`DNS-over-HTTPS server. Anycast, no logs, no censorship, DNSSEC. -Backend hosted by Scaleway, globally cached via Cloudflare. -Maintained by Frank Denis.`,country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"doh-crypto-sx-ipv6",endpoint:{protocol:"https:",host:"doh-ipv6.crypto.sx",cors:!0},description:`DNS-over-HTTPS server accessible over IPv6. Anycast, no logs, no censorship, DNSSEC. -Backend hosted by Scaleway, globally cached via Cloudflare. -Maintained by Frank Denis.`,country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"doh-de-blahdns",endpoint:{protocol:"https:",host:"doh-de.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Germany. By https://blahdns.com/",country:"Germany",location:{lat:51.2993,long:9.491},filter:!0,cors:!0},{name:"doh-fi-blahdns",endpoint:{protocol:"https:",host:"doh-fi.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Finland. By https://blahdns.com/",country:"Finland",location:{lat:60.1758,long:24.9349},filter:!0,cors:!0},{name:"doh-ibksturm",endpoint:{protocol:"https:",host:"ibksturm.synology.me"},description:`DoH & DoT Server, No Logging, No Filters, DNSSEC -Running privately by ibksturm in Thurgau, Switzerland`},{name:"doh-jp-blahdns",endpoint:{protocol:"https:",host:"doh-jp.blahdns.com",cors:!0},description:"Blocks ad and Tracking, no Logging, DNSSEC, Hosted in Japan. By https://blahdns.com/",country:"Japan",location:{lat:35.6882,long:139.7532},filter:!0,cors:!0},{name:"doh.ffmuc.net",endpoint:{protocol:"https:",host:"doh.ffmuc.net"},description:`An open (non-logging, non-filtering, non-censoring) DoH resolver operated by Freifunk Munich with nodes in DE. -https://ffmuc.net/`,country:"Germany",location:{lat:51.2993,long:9.491}},{name:"doh.tiarap.org",endpoint:{protocol:"https:",host:"doh.tiarap.org"},description:`Non-Logging DNS-over-HTTPS server, cached via Cloudflare. -Filters out ads, trackers and malware, NO ECS, supports DNSSEC.`,country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"google",endpoint:{protocol:"https:",host:"dns.google",ipv4:"8.8.8.8",cors:!0},description:"Google DNS (anycast)",country:"United States",location:{lat:37.751,long:-97.822},log:!0,cors:!0},{name:"hdns",endpoint:{protocol:"https:",host:"query.hdns.io",cors:!0},description:`HDNS is a public DNS resolver that supports Handshake domains. -https://www.hdns.io`,country:"United States",location:{lat:37.7771,long:-122.406},cors:!0},{name:"he",endpoint:{protocol:"https:",host:"ordns.he.net"},description:`Hurricane Electric DoH server (anycast) -Unknown logging policy.`,country:"United States",location:{lat:37.751,long:-97.822},log:!0},{name:"id-gmail-doh",endpoint:{protocol:"https:",host:"doh.tiar.app"},description:`Non-Logging DNS-over-HTTPS server located in Singapore. -Filters out ads, trackers and malware, supports DNSSEC, provided by id-gmail.`,country:"Singapore",location:{lat:1.2929,long:103.8547},filter:!0},{name:"iij",endpoint:{protocol:"https:",host:"public.dns.iij.jp"},description:`DoH server operated by Internet Initiative Japan in Tokyo. -https://www.iij.ad.jp/`,country:"Japan",location:{lat:35.69,long:139.69},log:!0},{name:"iqdns-doh",endpoint:{protocol:"https:",host:"a.passcloud.xyz"},description:`Non-logging DoH service runned by V2EX.com user johnsonwil. -Returns "no such domain" for anti-Chinese government websites. Supports DNSSEC. -For more information: https://www.v2ex.com/t/785666`,filter:!0},{name:"jp.tiar.app-doh",endpoint:{protocol:"https:",host:"jp.tiar.app"},description:`Non-Logging, Non-Filtering DNS-over-HTTPS server in Japan. -No ECS, Support DNSSEC`,country:"Japan",location:{lat:35.6882,long:139.7532}},{name:"jp.tiarap.org",endpoint:{protocol:"https:",host:"jp.tiarap.org"},description:`DNS-over-HTTPS Server. Non-Logging, Non-Filtering, No ECS, Support DNSSEC. -Cached via Cloudflare.`},{name:"libredns",endpoint:{protocol:"https:",host:"doh.libredns.gr"},description:`DoH server in Germany. No logging, but no DNS padding and no DNSSEC support. -https://libredns.gr/`,country:"Germany",location:{lat:51.2993,long:9.491}},{name:"nextdns",endpoint:{protocol:"https:",host:"anycsast.dns.nextdns.io"},description:`NextDNS is a cloud-based private DNS service that gives you full control -over what is allowed and what is blocked on the Internet. -DNSSEC, Anycast, Non-logging, NoFilters -https://www.nextdns.io/`,country:"Netherlands",location:{lat:52.3891,long:4.6563}},{name:"nextdns-ultralow",endpoint:{protocol:"https:",host:"dns.nextdns.io",path:"/dnscrypt-proxy"},description:`NextDNS is a cloud-based private DNS service that gives you full control -over what is allowed and what is blocked on the Internet. -https://www.nextdns.io/ -To select the server location, the "-ultralow" variant relies on bootstrap servers -instead of anycast.`},{name:"njalla-doh",endpoint:{protocol:"https:",host:"dns.njal.la",cors:!0},description:`Non-logging DoH server in Sweden operated by Njalla. -https://dns.njal.la/`,country:"Sweden",location:{lat:59.3247,long:18.056},cors:!0},{name:"odoh-cloudflare",endpoint:{protocol:"https:",host:"odoh.cloudflare-dns.com",cors:!0},description:`Cloudflare ODoH server. -https://cloudflare.com`,cors:!0},{name:"odoh-crypto-sx",endpoint:{protocol:"https:",host:"odoh.crypto.sx",cors:!0},description:`ODoH target server. Anycast, no logs. -Backend hosted by Scaleway. Maintained by Frank Denis.`,cors:!0},{name:"odoh-id-gmail",endpoint:{protocol:"https:",host:"doh.tiar.app",path:"/odoh"},description:`ODoH target server. Based in Singapore, no logs. -Filter ads, trackers and malware.`,filter:!0},{name:"odoh-jp.tiar.app",endpoint:{protocol:"https:",host:"jp.tiar.app",path:"/odoh"},description:"ODoH target server. no logs."},{name:"odoh-jp.tiarap.org",endpoint:{protocol:"https:",host:"jp.tiarap.org",path:"/odoh"},description:"ODoH target server via Cloudflare, no logs."},{name:"odoh-resolver4.dns.openinternet.io",endpoint:{protocol:"https:",host:"resolver4.dns.openinternet.io"},description:`ODoH target server. no logs, no filter, DNSSEC. -Running on dedicated hardware colocated at Sonic.net in Santa Rosa, CA in the United States. -Uses Sonic's recusrive DNS servers as upstream resolvers (but is not affiliated with Sonic -in any way). Provided by https://openinternet.io`},{name:"odoh-tiarap.org",endpoint:{protocol:"https:",host:"doh.tiarap.org",path:"/odoh"},description:`ODoH target server via Cloudflare, no logs. -Filter ads, trackers and malware.`,filter:!0},{name:"publicarray-au2-doh",endpoint:{protocol:"https:",host:"doh-2.seby.io",cors:!0},description:`DNSSEC • OpenNIC • Non-logging • Uncensored - hosted on ovh.com.au -Maintained by publicarray - https://dns.seby.io`,country:"Australia",location:{lat:-33.8591,long:151.2002},cors:!0},{name:"puredns-doh",endpoint:{protocol:"https:",host:"puredns.org",ipv4:"146.190.6.13",cors:!0},description:`Public uncensored DNS resolver in Singapore - https://puredns.org -** Only available in Indonesia and Singapore **`,country:"United States",location:{lat:37.751,long:-97.822},cors:!0},{name:"quad101",endpoint:{protocol:"https:",host:"dns.twnic.tw",cors:!0},description:`DNSSEC-aware public resolver by the Taiwan Network Information Center (TWNIC) -https://101.101.101.101/index_en.html`,cors:!0},{name:"quad9-doh-ip4-port443-filter-ecs-pri",endpoint:{protocol:"https:",host:"dns11.quad9.net",ipv4:"149.112.112.11"},description:"Quad9 (anycast) dnssec/no-log/filter/ecs 9.9.9.11 - 149.112.112.11",country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"quad9-doh-ip4-port443-filter-pri",endpoint:{protocol:"https:",host:"dns.quad9.net",ipv4:"149.112.112.112"},description:"Quad9 (anycast) dnssec/no-log/filter 9.9.9.9 - 149.112.112.9 - 149.112.112.112",country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"quad9-doh-ip4-port443-nofilter-ecs-pri",endpoint:{protocol:"https:",host:"dns12.quad9.net",ipv4:"9.9.9.12"},description:"Quad9 (anycast) no-dnssec/no-log/no-filter/ecs 9.9.9.12 - 149.112.112.12",country:"United States",location:{lat:37.751,long:-97.822}},{name:"quad9-doh-ip4-port443-nofilter-pri",endpoint:{protocol:"https:",host:"dns10.quad9.net",ipv4:"149.112.112.10"},description:"Quad9 (anycast) no-dnssec/no-log/no-filter 9.9.9.10 - 149.112.112.10",country:"United States",location:{lat:37.751,long:-97.822}},{name:"quad9-doh-ip6-port5053-filter-pri",endpoint:{protocol:"https:",host:"dns9.quad9.net"},description:"Quad9 (anycast) dnssec/no-log/filter 2620:fe::fe - 2620:fe::9 - 2620:fe::fe:9",country:"United States",location:{lat:37.751,long:-97.822},filter:!0},{name:"safesurfer-doh",endpoint:{protocol:"https:",host:"doh.safesurfer.io"},description:`Family safety focused blocklist for over 2 million adult sites, as well as phishing and malware and more. -Free to use, paid for customizing blocking for more categories+sites and viewing usage at my.safesurfer.io. Logs taken for viewing -usage, data never sold - https://safesurfer.io`,filter:!0,log:!0},{name:"sth-ads-doh-se",endpoint:{protocol:"https:",host:"dnsse-noads.alekberg.net"},description:"Resolver in Stockholm, Sweden. DoH server. Non-logging, remove ads and malware, DNSSEC.",country:"Bulgaria",location:{lat:42.696,long:23.332},filter:!0},{name:"sth-doh-se",endpoint:{protocol:"https:",host:"dnsse.alekberg.net"},description:"Resolver in Stockholm, Sweden. DoH server. Non-logging, non-filtering, DNSSEC.",country:"Bulgaria",location:{lat:42.696,long:23.332}},{name:"switch",endpoint:{protocol:"https:",host:"dns.switch.ch"},description:`Public DoH service provided by SWITCH in Switzerland -https://www.switch.ch -Provides protection against malware, but does not block ads.`,filter:!0},{name:"uncensoreddns-dk-ipv4",endpoint:{protocol:"https:",host:"unicast.uncensoreddns.org"},description:`Also known as censurfridns. -DoH, no logs, no filter, DNSSEC, unicast hosted in Denmark - https://blog.uncensoreddns.org`,country:"Denmark",location:{lat:55.7123,long:12.0564}},{name:"uncensoreddns-ipv4",endpoint:{protocol:"https:",host:"anycast.uncensoreddns.org"},description:`Also known as censurfridns. -DoH, no logs, no filter, DNSSEC, anycast - https://blog.uncensoreddns.org`,country:"Denmark",location:{lat:55.7123,long:12.0564}},{name:"v.dnscrypt.uk-doh-ipv4",endpoint:{protocol:"https:",host:"v.dnscrypt.uk"},description:`DoH, no logs, uncensored, DNSSEC. Hosted in London UK on Digital Ocean -https://www.dnscrypt.uk`,country:"United Kingdom",location:{lat:51.4964,long:-.1224}}],time:1654187067783};function processResolvers(et){const o=et.time===null||et.time===void 0?Date.now():et.time,tt=processResolvers$1(et.data.map(nt=>(nt.endpoint=toEndpoint(Object.assign({name:nt.name},nt.endpoint)),nt))),rt=tt.map(nt=>nt.endpoint);return{data:{resolvers:tt,resolverByName:tt.reduce((nt,ot)=>(nt[ot.name]=ot,nt),{}),endpoints:rt,endpointByName:rt.reduce((nt,ot)=>(nt[ot.name]=ot,nt),{})},time:o}}const backup=processResolvers(resolvers);function toMultiQuery(et){const o=Object.assign({type:"query"},et);return delete o.question,o.questions=[],et.question&&o.questions.push(et.question),o}function queryOne(et,o,tt,rt){return rt&&rt.aborted?Promise.reject(new AbortError):et.protocol==="udp4:"||et.protocol==="udp6:"?queryDns():queryDoh(et,o,tt,rt)}function queryDoh(et,o,tt,rt){return request(et.url,et.method,encode$2(Object.assign({flags:RECURSION_DESIRED},o)),tt,rt).then(function(nt){const ot=nt.data,it=nt.response;let st=nt.error;if(st===void 0)if(ot.length===0)st=new ResponseError("Empty.");else try{const at=decode$3(ot);return at.response=it,at}catch(at){st=new ResponseError("Invalid packet (cause="+at.message+")",at)}throw Object.assign(st,{response:it})})}const UPDATE_URL=new URL$1("https://martinheidegger.github.io/dns-query/resolvers.json");function isNameString(et){return/^@/.test(et)}class Wellknown{constructor(o){this.opts=Object.assign({timeout:5e3,update:!0,updateURL:UPDATE_URL,persist:!1,localStoragePrefix:"dnsquery_",maxAge:3e5},o),this._dataP=null}_data(o,tt){return!o&&this._dataP!==null?this._dataP.then(rt=>rt.timeprocessResolvers({data:rt.data.resolvers,time:rt.time})).catch(()=>tt||backup):Promise.resolve(backup),this._dataP)}data(){return this._data(!1).then(o=>o.data)}endpoints(o){if(o==null)return this.data().then(tt=>tt.endpoints);if(o==="doh"&&(o=filterDoh),o==="dns"&&(o=filterDns),typeof o=="function")return this.data().then(tt=>tt.endpoints.filter(o));if(typeof o=="string"||typeof o[Symbol.iterator]!="function")return Promise.reject(new Error(`Endpoints (${o}) needs to be iterable (array).`));if(o=Array.from(o).filter(Boolean),o.findIndex(isNameString)===-1)try{return Promise.resolve(o.map(toEndpoint))}catch(tt){return Promise.reject(tt)}return this.data().then(tt=>o.map(rt=>{if(isNameString(rt)){const nt=tt.endpointByName[rt.substring(1)];if(!nt)throw new Error(`Endpoint ${rt} is not known.`);return nt}return toEndpoint(rt)}))}}const wellknown=new Wellknown;function isPromise(et){return et===null||typeof et!="object"?!1:typeof et.then=="function"}function toPromise(et){return isPromise(et)?et:Promise.resolve(et)}function query(et,o){return o=Object.assign({retries:5,timeout:3e4},o),et.question?toPromise(o.endpoints).then(tt=>{if(!Array.isArray(tt)||tt.length===0)throw new Error("No endpoints defined to lookup dns records.");return queryN(tt.map(toEndpoint),toMultiQuery(et),o)}).then(tt=>(tt.question=tt.questions[0],delete tt.questions,tt)):Promise.reject(new Error("To request data you need to specify a .question!"))}function queryN(et,o,tt){const rt=et.length===1?et[0]:et[Math.floor(Math.random()*et.length)%et.length];return queryOne(rt,o,tt.timeout,tt.signal).then(nt=>(nt.endpoint=rt.toString(),nt),nt=>{if(nt.name==="AbortError"||tt.retries===0)throw nt.endpoint=rt.toString(),nt;return tt.retries>0&&(tt.retries-=1),queryN(et,o,tt)})}function filterDoh(et){return et.protocol==="https:"||et.protocol==="http:"}function filterDns(et){return et.protocol==="udp4:"||et.protocol==="udp6:"}const log$7=new Logger$1("dns-over-https");class DnsOverHttps{constructor(o,tt=3){wt(this,"endpoints");wt(this,"retries");this.endpoints=o,this.retries=tt}static async create(o,tt){const rt=o??await wellknown.endpoints("doh");return new DnsOverHttps(rt,tt)}async resolveTXT(o){let tt;try{tt=(await query({question:{type:"TXT",name:o}},{endpoints:this.endpoints,retries:this.retries})).answers}catch(ot){throw log$7.error("query failed: ",ot),new Error("DNS query failed")}if(!tt)throw new Error(`Could not resolve ${o}`);const rt=tt.map(ot=>ot.data),nt=[];return rt.forEach(ot=>{typeof ot=="string"?nt.push(ot):Array.isArray(ot)?ot.forEach(it=>{typeof it=="string"?nt.push(it):nt.push(bytesToUtf8(it))}):nt.push(bytesToUtf8(ot))}),nt}}var base32$3={exports:{}};(function(et){var o={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};/* - * [hi-base32]{@link https://github.com/emn178/hi-base32} - * - * @version 0.5.0 - * @author Chen, Yi-Cyuan [emn178@gmail.com] - * @copyright Chen, Yi-Cyuan 2015-2018 - * @license MIT - */(function(){var tt=typeof window=="object"?window:{},rt=!tt.HI_BASE32_NO_NODE_JS&&typeof o=="object"&&o.versions&&o.versions.node;rt&&(tt=globalThis);var nt=!tt.HI_BASE32_NO_COMMON_JS&&!0&&et.exports,ot="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".split(""),it={A:0,B:1,C:2,D:3,E:4,F:5,G:6,H:7,I:8,J:9,K:10,L:11,M:12,N:13,O:14,P:15,Q:16,R:17,S:18,T:19,U:20,V:21,W:22,X:23,Y:24,Z:25,2:26,3:27,4:28,5:29,6:30,7:31},st=[0,0,0,0,0,0,0,0],at=function(gt,bt){bt.length>10&&(bt="..."+bt.substr(-10));var xt=new Error("Decoded data is not valid UTF-8. Maybe try base32.decode.asBytes()? Partial data after reading "+gt+" bytes: "+bt+" <-");throw xt.position=gt,xt},ct=function(gt){for(var bt="",xt=gt.length,vt=0,Et=0,Ct,St;vt191&&Ct<=223?(St=Ct&31,Et=1):Ct<=239?(St=Ct&15,Et=2):Ct<=247?(St=Ct&7,Et=3):at(vt,bt);for(var At=0;At191)&&at(vt,bt),St<<=6,St+=Ct&63;St>=55296&&St<=57343&&at(vt,bt),St>1114111&&at(vt,bt),St<=65535?bt+=String.fromCharCode(St):(St-=65536,bt+=String.fromCharCode((St>>10)+55296),bt+=String.fromCharCode((St&1023)+56320))}return bt},lt=function(gt){if(gt==="")return[];if(!/^[A-Z2-7=]+$/.test(gt))throw new Error("Invalid base32 characters");gt=gt.replace(/=/g,"");for(var bt,xt,vt,Et,Ct,St,At,kt,It=[],Nt=0,Lt=gt.length,Mt=0,zt=Lt>>3<<3;Mt>>2)&255,It[Nt++]=(xt<<6|vt<<1|Et>>>4)&255,It[Nt++]=(Et<<4|Ct>>>1)&255,It[Nt++]=(Ct<<7|St<<2|At>>>3)&255,It[Nt++]=(At<<5|kt)&255;var Ut=Lt-zt;return Ut===2?(bt=it[gt.charAt(Mt++)],xt=it[gt.charAt(Mt++)],It[Nt++]=(bt<<3|xt>>>2)&255):Ut===4?(bt=it[gt.charAt(Mt++)],xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],It[Nt++]=(bt<<3|xt>>>2)&255,It[Nt++]=(xt<<6|vt<<1|Et>>>4)&255):Ut===5?(bt=it[gt.charAt(Mt++)],xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],It[Nt++]=(bt<<3|xt>>>2)&255,It[Nt++]=(xt<<6|vt<<1|Et>>>4)&255,It[Nt++]=(Et<<4|Ct>>>1)&255):Ut===7&&(bt=it[gt.charAt(Mt++)],xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],St=it[gt.charAt(Mt++)],At=it[gt.charAt(Mt++)],It[Nt++]=(bt<<3|xt>>>2)&255,It[Nt++]=(xt<<6|vt<<1|Et>>>4)&255,It[Nt++]=(Et<<4|Ct>>>1)&255,It[Nt++]=(Ct<<7|St<<2|At>>>3)&255),It},dt=function(gt){for(var bt,xt,vt,Et,Ct,St="",At=gt.length,kt=0,It=parseInt(At/5)*5;kt>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[(Et<<3|Ct>>>5)&31]+ot[Ct&31];var Nt=At-It;return Nt===1?(bt=gt.charCodeAt(kt),St+=ot[bt>>>3]+ot[bt<<2&31]+"======"):Nt===2?(bt=gt.charCodeAt(kt++),xt=gt.charCodeAt(kt),St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[xt<<4&31]+"===="):Nt===3?(bt=gt.charCodeAt(kt++),xt=gt.charCodeAt(kt++),vt=gt.charCodeAt(kt),St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[vt<<1&31]+"==="):Nt===4&&(bt=gt.charCodeAt(kt++),xt=gt.charCodeAt(kt++),vt=gt.charCodeAt(kt++),Et=gt.charCodeAt(kt),St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[Et<<3&31]+"="),St},ht=function(gt){var bt,xt,vt,Et,Ct,St,At=!1,kt="",It=0,Nt,Lt=0,Mt=gt.length;if(gt==="")return kt;do{for(st[0]=st[5],st[1]=st[6],st[2]=st[7],Nt=Lt;It>6,st[Nt++]=128|St&63):St<55296||St>=57344?(st[Nt++]=224|St>>12,st[Nt++]=128|St>>6&63,st[Nt++]=128|St&63):(St=65536+((St&1023)<<10|gt.charCodeAt(++It)&1023),st[Nt++]=240|St>>18,st[Nt++]=128|St>>12&63,st[Nt++]=128|St>>6&63,st[Nt++]=128|St&63);Lt=Nt-5,It===Mt&&++It,It>Mt&&Nt<6&&(At=!0),bt=st[0],Nt>4?(xt=st[1],vt=st[2],Et=st[3],Ct=st[4],kt+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[(Et<<3|Ct>>>5)&31]+ot[Ct&31]):Nt===1?kt+=ot[bt>>>3]+ot[bt<<2&31]+"======":Nt===2?(xt=st[1],kt+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[xt<<4&31]+"===="):Nt===3?(xt=st[1],vt=st[2],kt+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[vt<<1&31]+"==="):(xt=st[1],vt=st[2],Et=st[3],kt+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[Et<<3&31]+"=")}while(!At);return kt},mt=function(gt){for(var bt,xt,vt,Et,Ct,St="",At=gt.length,kt=0,It=parseInt(At/5)*5;kt>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[(Et<<3|Ct>>>5)&31]+ot[Ct&31];var Nt=At-It;return Nt===1?(bt=gt[kt],St+=ot[bt>>>3]+ot[bt<<2&31]+"======"):Nt===2?(bt=gt[kt++],xt=gt[kt],St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[xt<<4&31]+"===="):Nt===3?(bt=gt[kt++],xt=gt[kt++],vt=gt[kt],St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[vt<<1&31]+"==="):Nt===4&&(bt=gt[kt++],xt=gt[kt++],vt=gt[kt++],Et=gt[kt],St+=ot[bt>>>3]+ot[(bt<<2|xt>>>6)&31]+ot[xt>>>1&31]+ot[(xt<<4|vt>>>4)&31]+ot[(vt<<1|Et>>>7)&31]+ot[Et>>>2&31]+ot[Et<<3&31]+"="),St},ft=function(gt,bt){var xt=typeof gt!="string";return xt&>.constructor===ArrayBuffer&&(gt=new Uint8Array(gt)),xt?mt(gt):bt?dt(gt):ht(gt)},pt=function(gt,bt){if(!bt)return ct(lt(gt));if(gt==="")return"";if(!/^[A-Z2-7=]+$/.test(gt))throw new Error("Invalid base32 characters");var xt,vt,Et,Ct,St,At,kt,It,Nt="",Lt=gt.indexOf("=");Lt===-1&&(Lt=gt.length);for(var Mt=0,zt=Lt>>3<<3;Mt>>2)&255)+String.fromCharCode((vt<<6|Et<<1|Ct>>>4)&255)+String.fromCharCode((Ct<<4|St>>>1)&255)+String.fromCharCode((St<<7|At<<2|kt>>>3)&255)+String.fromCharCode((kt<<5|It)&255);var Ut=Lt-zt;return Ut===2?(xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Nt+=String.fromCharCode((xt<<3|vt>>>2)&255)):Ut===4?(xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],Nt+=String.fromCharCode((xt<<3|vt>>>2)&255)+String.fromCharCode((vt<<6|Et<<1|Ct>>>4)&255)):Ut===5?(xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],St=it[gt.charAt(Mt++)],Nt+=String.fromCharCode((xt<<3|vt>>>2)&255)+String.fromCharCode((vt<<6|Et<<1|Ct>>>4)&255)+String.fromCharCode((Ct<<4|St>>>1)&255)):Ut===7&&(xt=it[gt.charAt(Mt++)],vt=it[gt.charAt(Mt++)],Et=it[gt.charAt(Mt++)],Ct=it[gt.charAt(Mt++)],St=it[gt.charAt(Mt++)],At=it[gt.charAt(Mt++)],kt=it[gt.charAt(Mt++)],Nt+=String.fromCharCode((xt<<3|vt>>>2)&255)+String.fromCharCode((vt<<6|Et<<1|Ct>>>4)&255)+String.fromCharCode((Ct<<4|St>>>1)&255)+String.fromCharCode((St<<7|At<<2|kt>>>3)&255)),Nt},yt={encode:ft,decode:pt};pt.asBytes=lt,nt?et.exports=yt:tt.base32=yt})()})(base32$3);var base32Exports=base32$3.exports;const base32$2=getDefaultExportFromCjs(base32Exports);function coerce(et){if(et instanceof Uint8Array&&et.constructor.name==="Uint8Array")return et;if(et instanceof ArrayBuffer)return new Uint8Array(et);if(ArrayBuffer.isView(et))return new Uint8Array(et.buffer,et.byteOffset,et.byteLength);throw new Error("Unknown type, must be binary type")}function fromString$1(et){return new TextEncoder().encode(et)}function toString$2(et){return new TextDecoder().decode(et)}function base(et,o){if(et.length>=255)throw new TypeError("Alphabet too long");for(var tt=new Uint8Array(256),rt=0;rt>>0,vt=new Uint8Array(xt);gt!==bt;){for(var Et=ft[gt],Ct=0,St=xt-1;(Et!==0||Ct>>0,vt[St]=Et%st>>>0,Et=Et/st>>>0;if(Et!==0)throw new Error("Non-zero carry");yt=Ct,gt++}for(var At=xt-yt;At!==xt&&vt[At]===0;)At++;for(var kt=at.repeat(pt);At>>0,xt=new Uint8Array(bt);ft[pt];){var vt=tt[ft.charCodeAt(pt)];if(vt===255)return;for(var Et=0,Ct=bt-1;(vt!==0||Et>>0,xt[Ct]=vt%256>>>0,vt=vt/256>>>0;if(vt!==0)throw new Error("Non-zero carry");gt=Et,pt++}if(ft[pt]!==" "){for(var St=bt-gt;St!==bt&&xt[St]===0;)St++;for(var At=new Uint8Array(yt+(bt-St)),kt=yt;St!==bt;)At[kt++]=xt[St++];return At}}}function mt(ft){var pt=ht(ft);if(pt)return pt;throw new Error(`Non-${o} character`)}return{encode:dt,decodeUnsafe:ht,decode:mt}}var src$1=base,_brrp__multiformats_scope_baseX=src$1;class Encoder{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");this.name=o,this.prefix=tt,this.baseEncode=rt}encode(o){if(o instanceof Uint8Array)return`${this.prefix}${this.baseEncode(o)}`;throw Error("Unknown type, must be binary type")}}class Decoder{constructor(o,tt,rt){wt(this,"name");wt(this,"prefix");wt(this,"baseDecode");wt(this,"prefixCodePoint");this.name=o,this.prefix=tt;const nt=tt.codePointAt(0);if(nt===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=nt,this.baseDecode=rt}decode(o){if(typeof o=="string"){if(o.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(o)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(o.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(o){return or(this,o)}}class ComposedDecoder{constructor(o){wt(this,"decoders");this.decoders=o}or(o){return or(this,o)}decode(o){const tt=o[0],rt=this.decoders[tt];if(rt!=null)return rt.decode(o);throw RangeError(`Unable to decode multibase string ${JSON.stringify(o)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}function or(et,o){return new ComposedDecoder({...et.decoders??{[et.prefix]:et},...o.decoders??{[o.prefix]:o}})}class Codec{constructor(o,tt,rt,nt){wt(this,"name");wt(this,"prefix");wt(this,"baseEncode");wt(this,"baseDecode");wt(this,"encoder");wt(this,"decoder");this.name=o,this.prefix=tt,this.baseEncode=rt,this.baseDecode=nt,this.encoder=new Encoder(o,tt,rt),this.decoder=new Decoder(o,tt,nt)}encode(o){return this.encoder.encode(o)}decode(o){return this.decoder.decode(o)}}function from({name:et,prefix:o,encode:tt,decode:rt}){return new Codec(et,o,tt,rt)}function baseX({name:et,prefix:o,alphabet:tt}){const{encode:rt,decode:nt}=_brrp__multiformats_scope_baseX(tt,et);return from({prefix:o,name:et,encode:rt,decode:ot=>coerce(nt(ot))})}function decode$2(et,o,tt,rt){const nt={};for(let lt=0;lt=8&&(st-=8,it[ct++]=255&at>>st)}if(st>=tt||255&at<<8-st)throw new SyntaxError("Unexpected end of data");return it}function encode$1(et,o,tt){const rt=o[o.length-1]==="=",nt=(1<tt;)it-=tt,ot+=o[nt&st>>it];if(it!==0&&(ot+=o[nt&st<(et[tt]=o,et),[]),alphabetCharsToBytes=alphabet.reduce((et,o,tt)=>{const rt=o.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${o}`);return et[rt]=tt,et},[]);function encode(et){return et.reduce((o,tt)=>(o+=alphabetBytesToChars[tt],o),"")}function decode$1(et){const o=[];for(const tt of et){const rt=tt.codePointAt(0);if(rt==null)throw new Error(`Invalid character: ${tt}`);const nt=alphabetCharsToBytes[rt];if(nt==null)throw new Error(`Non-base256emoji character: ${tt}`);o.push(nt)}return new Uint8Array(o)}const base256emoji=from({prefix:"🚀",name:"base256emoji",encode,decode:decode$1}),base256emoji$1=Object.freeze(Object.defineProperty({__proto__:null,base256emoji},Symbol.toStringTag,{value:"Module"})),base32=rfc4648({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),base32upper=rfc4648({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),base32pad=rfc4648({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),base32padupper=rfc4648({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),base32hex=rfc4648({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),base32hexupper=rfc4648({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),base32hexpad=rfc4648({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper=rfc4648({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z=rfc4648({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),base32$1=Object.freeze(Object.defineProperty({__proto__:null,base32,base32hex,base32hexpad,base32hexpadupper,base32hexupper,base32pad,base32padupper,base32upper,base32z},Symbol.toStringTag,{value:"Module"})),base36=baseX({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper=baseX({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),base36$1=Object.freeze(Object.defineProperty({__proto__:null,base36,base36upper},Symbol.toStringTag,{value:"Module"})),base58btc=baseX({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr=baseX({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),base58=Object.freeze(Object.defineProperty({__proto__:null,base58btc,base58flickr},Symbol.toStringTag,{value:"Module"})),base64$2=rfc4648({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),base64pad=rfc4648({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url=rfc4648({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad=rfc4648({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),base64$3=Object.freeze(Object.defineProperty({__proto__:null,base64:base64$2,base64pad,base64url,base64urlpad},Symbol.toStringTag,{value:"Module"})),base8=rfc4648({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),base8$1=Object.freeze(Object.defineProperty({__proto__:null,base8},Symbol.toStringTag,{value:"Module"})),identity=from({prefix:"\0",name:"identity",encode:et=>toString$2(et),decode:et=>fromString$1(et)}),identityBase=Object.freeze(Object.defineProperty({__proto__:null,identity},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const bases={...identityBase,...base2$1,...base8$1,...base10$1,...base16$1,...base32$1,...base36$1,...base58,...base64$3,...base256emoji$1};function allocUnsafe(et=0){return new Uint8Array(et)}function createCodec(et,o,tt,rt){return{name:et,prefix:o,encoder:{name:et,prefix:o,encode:tt},decoder:{decode:rt}}}const string$2=createCodec("utf8","u",et=>"u"+new TextDecoder("utf8").decode(et),et=>new TextEncoder().encode(et.substring(1))),ascii=createCodec("ascii","a",et=>{let o="a";for(let tt=0;tt{et=et.substring(1);const o=allocUnsafe(et.length);for(let tt=0;tt=et.relay&&o.store>=et.store&&o.filter>=et.filter&&o.lightPush>=et.lightPush}function isNewPeer(et,o){if(!et.nodeId)return!1;for(const tt of o)if(et.nodeId===tt.nodeId)return!1;return!0}function addCapabilities(et,o){et.relay&&(o.relay+=1),et.store&&(o.store+=1),et.filter&&(o.filter+=1),et.lightPush&&(o.lightPush+=1)}function helpsSatisfyCapabilities(et,o,tt){if(isSatisfied(o,tt))throw"Internal Error: Waku2 wanted capabilities are already fulfilled";const rt=missingCapabilities(o,tt);return rt.relay&&et.relay||rt.store&&et.store||rt.filter&&et.filter||rt.lightPush&&et.lightPush}function missingCapabilities(et,o){return{relay:o.relaythis._search(ot,it));return log$5.info("retrieved peers: ",st.map(at=>{var ct,lt;return{id:(ct=at.peerId)==null?void 0:ct.toString(),multiaddrs:(lt=at.multiaddrs)==null?void 0:lt.map(dt=>dt.toString())}})),st}async*getNextPeer(o,tt){const rt=Math.floor(Math.random()*o.length),{publicKey:nt,domain:ot}=ENRTree.parseTree(o[rt]),it={domain:ot,publicKey:nt,visits:{}};for await(const st of yieldNodesUntilCapabilitiesFulfilled(tt,this._errorTolerance,()=>this._search(ot,it)))yield st}async _search(o,tt){try{const rt=await this._getTXTRecord(o,tt);tt.visits[o]=!0;let nt,ot;const it=getEntryType(rt);try{switch(it){case ENRTree.ROOT_PREFIX:return nt=ENRTree.parseAndVerifyRoot(rt,tt.publicKey),await this._search(nt,tt);case ENRTree.BRANCH_PREFIX:return ot=ENRTree.parseBranch(rt),nt=selectRandomPath(ot,tt),await this._search(nt,tt);case ENRTree.RECORD_PREFIX:return EnrDecoder.fromString(rt);default:return null}}catch(st){return log$5.error(`Failed to search DNS tree ${it} at subdomain ${o}: ${st}`),null}}catch(rt){return log$5.error(`Failed to retrieve TXT record at subdomain ${o}: ${rt}`),null}}async _getTXTRecord(o,tt){if(this._DNSTreeCache[o])return this._DNSTreeCache[o];const rt=o!==tt.domain?`${o}.${tt.domain}`:tt.domain,nt=await this.dns.resolveTXT(rt);if(!nt.length)throw new Error("Received empty result array while fetching TXT record");if(!nt[0].length)throw new Error("Received empty TXT record");const ot=nt.join("");return this._DNSTreeCache[o]=ot,ot}}function getEntryType(et){return et.startsWith(ENRTree.ROOT_PREFIX)?ENRTree.ROOT_PREFIX:et.startsWith(ENRTree.BRANCH_PREFIX)?ENRTree.BRANCH_PREFIX:et.startsWith(ENRTree.RECORD_PREFIX)?ENRTree.RECORD_PREFIX:""}function selectRandomPath(et,o){const tt={};for(const[nt,ot]of et.entries())o.visits[ot]&&(tt[nt]=!0);if(Object.keys(tt).length===et.length)throw new Error("Unresolvable circular path detected");let rt;do rt=Math.floor(Math.random()*et.length);while(tt[rt]);return et[rt]}const log$4=new Logger$1("peer-discovery-dns");class PeerDiscoveryDns extends TypedEventEmitter$3{constructor(tt,rt){super();wt(this,"nextPeer");wt(this,"_started");wt(this,"_components");wt(this,"_options");this._started=!1,this._components=tt,this._options=rt;const{enrUrls:nt}=rt;log$4.info("Use following EIP-1459 ENR Tree URLs: ",nt)}async start(){log$4.info("Starting peer discovery via dns"),this._started=!0,await this.findPeers()}async findPeers(){if(!this.nextPeer){let{enrUrls:tt}=this._options;Array.isArray(tt)||(tt=[tt]);const{wantedNodeCapabilityCount:rt}=this._options,nt=await DnsNodeDiscovery.dnsOverHttp();this.nextPeer=nt.getNextPeer.bind(nt,tt,rt)}for await(const tt of this.nextPeer()){if(!this._started)return;const{peerInfo:rt,shardInfo:nt}=tt;if(!rt)continue;const ot={[DEFAULT_BOOTSTRAP_TAG_NAME]:{value:this._options.tagValue??DEFAULT_BOOTSTRAP_TAG_VALUE,ttl:this._options.tagTTL??DEFAULT_BOOTSTRAP_TAG_TTL}};let it=!1;await this._components.peerStore.has(rt.id)?(await this._components.peerStore.get(rt.id)).tags.has(DEFAULT_BOOTSTRAP_TAG_NAME)||(it=!0,await this._components.peerStore.merge(rt.id,{tags:ot})):(it=!0,await this._components.peerStore.save(rt.id,{tags:ot,...nt&&{metadata:{shardInfo:encodeRelayShard(nt)}}})),it&&this.dispatchEvent(new CustomEvent("peer",{detail:rt}))}}stop(){this._started=!1}get[peerDiscoverySymbol$2](){return!0}get[Symbol.toStringTag](){return DNS_DISCOVERY_TAG}}function wakuDnsDiscovery(et,o=DEFAULT_NODE_REQUIREMENTS){return tt=>new PeerDiscoveryDns(tt,{enrUrls:et,wantedNodeCapabilityCount:o})}class PeerExchangeRPC{constructor(o){wt(this,"proto");this.proto=o}static createRequest(o){const{numPeers:tt}=o;return new PeerExchangeRPC({query:{numPeers:tt},response:void 0})}encode(){return PeerExchangeRPC$1.encode(this.proto)}static decode(o){const tt=PeerExchangeRPC$1.decode(o);return new PeerExchangeRPC(tt)}get query(){return this.proto.query}get response(){return this.proto.response}}const PeerExchangeCodec="/vac/waku/peer-exchange/2.0.0-alpha1",log$3=new Logger$1("peer-exchange");class WakuPeerExchange extends BaseProtocol{constructor(o,tt){super(PeerExchangeCodec,o,log$3,tt)}async query(o){const{numPeers:tt,peerId:rt}=o,nt=PeerExchangeRPC.createRequest({numPeers:BigInt(tt)}),ot=await this.components.peerStore.get(rt);if(!ot)return{peerInfos:null,error:ProtocolError$1.NO_PEER_AVAILABLE};let it;try{it=await this.getStream(ot)}catch(at){return log$3.error("Failed to get stream",at),{peerInfos:null,error:ProtocolError$1.NO_STREAM_AVAILABLE}}const st=await pipe([nt.encode()],encode$K,it,decode$U,async at=>await all$2(at));try{const at=new Uint8ArrayList;st.forEach(dt=>{at.append(dt)});const{response:ct}=PeerExchangeRPC.decode(at);return ct?{peerInfos:await Promise.all(ct.peerInfos.map(dt=>dt.enr).filter(isDefined).map(async dt=>({ENR:await EnrDecoder.fromRLP(dt)}))),error:null}:(log$3.error("PeerExchangeRPC message did not contains a `response` field"),{peerInfos:null,error:ProtocolError$1.EMPTY_PAYLOAD})}catch(at){return log$3.error("Failed to decode push reply",at),{peerInfos:null,error:ProtocolError$1.DECODE_FAILED}}}}const log$2=new Logger$1("peer-exchange-discovery"),DEFAULT_PEER_EXCHANGE_REQUEST_NODES=10,DEFAULT_PEER_EXCHANGE_QUERY_INTERVAL_MS=10*1e3,DEFAULT_MAX_RETRIES=3,DEFAULT_PEER_EXCHANGE_TAG_NAME=Tags.PEER_EXCHANGE,DEFAULT_PEER_EXCHANGE_TAG_VALUE=50,DEFAULT_PEER_EXCHANGE_TAG_TTL=1e8;class PeerExchangeDiscovery extends TypedEventEmitter$3{constructor(tt,rt,nt={}){super();wt(this,"components");wt(this,"peerExchange");wt(this,"options");wt(this,"isStarted");wt(this,"queryingPeers",new Set);wt(this,"queryAttempts",new Map);wt(this,"handleDiscoveredPeer",tt=>{const{protocols:rt,peerId:nt}=tt.detail;!rt.includes(PeerExchangeCodec)||this.queryingPeers.has(nt.toString())||(this.queryingPeers.add(nt.toString()),this.startRecurringQueries(nt).catch(ot=>log$2.error(`Error querying peer ${ot}`)))});wt(this,"startRecurringQueries",async tt=>{const rt=tt.toString(),{queryInterval:nt=DEFAULT_PEER_EXCHANGE_QUERY_INTERVAL_MS,maxRetries:ot=DEFAULT_MAX_RETRIES}=this.options;log$2.info(`Querying peer: ${rt} (attempt ${this.queryAttempts.get(rt)??1})`),await this.query(tt);const it=this.queryAttempts.get(rt)??1;if(it>ot){this.abortQueriesForPeer(rt);return}setTimeout(()=>{this.queryAttempts.set(rt,it+1),this.startRecurringQueries(tt).catch(st=>{log$2.error(`Error in startRecurringQueries: ${st}`)})},nt*it)});this.components=tt,this.peerExchange=new WakuPeerExchange(tt,rt),this.options=nt,this.isStarted=!1}start(){this.isStarted||(this.dispatchEvent(new CustomEvent("waku:peer-exchange:started",{detail:!0})),log$2.info("Starting peer exchange node discovery, discovering peers"),this.components.events.addEventListener("peer:identify",this.handleDiscoveredPeer))}stop(){this.isStarted&&(log$2.info("Stopping peer exchange node discovery"),this.isStarted=!1,this.queryingPeers.clear(),this.components.events.removeEventListener("peer:identify",this.handleDiscoveredPeer))}get[peerDiscoverySymbol$2](){return!0}get[Symbol.toStringTag](){return"@waku/peer-exchange"}async query(tt){const{error:rt,peerInfos:nt}=await this.peerExchange.query({numPeers:DEFAULT_PEER_EXCHANGE_REQUEST_NODES,peerId:tt});if(rt)return log$2.error("Peer exchange query failed",rt),{error:rt,peerInfos:null};for(const ot of nt){const{ENR:it}=ot;if(!it){log$2.warn("No ENR in peerInfo object, skipping");continue}const{peerId:st,peerInfo:at,shardInfo:ct}=it;if(!st||!at)continue;if(await this.components.peerStore.has(st)){const{hasMultiaddrDiff:dt,hasShardDiff:ht}=await this.checkPeerInfoDiff(at,ct);if(dt||ht){log$2.info(`Peer ${st.toString()} has updated multiaddrs or shardInfo, updating`),dt&&(log$2.info(`Peer ${st.toString()} has updated multiaddrs, updating`),await this.components.peerStore.patch(st,{multiaddrs:at.multiaddrs})),ht&&ct&&(log$2.info(`Peer ${st.toString()} has updated shardInfo, updating`),await this.components.peerStore.merge(st,{metadata:{shardInfo:encodeRelayShard(ct)}}),this.dispatchEvent(new CustomEvent("peer",{detail:{id:st,multiaddrs:at.multiaddrs}})));continue}}await this.components.peerStore.save(st,{tags:{[DEFAULT_PEER_EXCHANGE_TAG_NAME]:{value:this.options.tagValue??DEFAULT_PEER_EXCHANGE_TAG_VALUE,ttl:this.options.tagTTL??DEFAULT_PEER_EXCHANGE_TAG_TTL}},...ct&&{metadata:{shardInfo:encodeRelayShard(ct)}},...at.multiaddrs&&{multiaddrs:at.multiaddrs}}),log$2.info(`Discovered peer: ${st.toString()}`),this.dispatchEvent(new CustomEvent("peer",{detail:{id:st,multiaddrs:at.multiaddrs}}))}return{error:null,peerInfos:nt}}abortQueriesForPeer(tt){log$2.info(`Aborting queries for peer: ${tt}`),this.queryingPeers.delete(tt),this.queryAttempts.delete(tt)}async checkPeerInfoDiff(tt,rt){const{id:nt}=tt,ot=await this.components.peerStore.get(nt),it=ot.addresses.map(dt=>dt.multiaddr.toString()),st=tt.multiaddrs.map(dt=>dt.toString()),at=it.some(dt=>!st.includes(dt));let ct=!1;const lt=ot.metadata.get("shardInfo");if(lt){const dt=decodeRelayShard(lt);(dt||rt)&&(ct=dt.clusterId!==(rt==null?void 0:rt.clusterId)||dt.shards.some(ht=>!(rt!=null&&rt.shards.includes(ht))))}return{hasMultiaddrDiff:at,hasShardDiff:ct}}}function wakuPeerExchangeDiscovery(et){return o=>new PeerExchangeDiscovery(o,et)}const log$1=new Logger$1("peer-exchange-discovery"),DEFAULT_LOCAL_TAG_NAME=Tags.LOCAL,DEFAULT_LOCAL_TAG_VALUE=50,DEFAULT_LOCAL_TAG_TTL=1e8;class LocalPeerCacheDiscovery extends TypedEventEmitter$3{constructor(tt,rt){super();wt(this,"components");wt(this,"options");wt(this,"isStarted");wt(this,"peers",[]);wt(this,"handleNewPeers",tt=>{const{peerId:rt,listenAddrs:nt}=tt.detail,ot=getWsMultiaddrFromMultiaddrs(nt),it=this.getPeersFromLocalStorage(),st=it.findIndex(at=>at.id===rt.toString());st>=0?it[st].address=ot.toString():it.push({id:rt.toString(),address:ot.toString()}),this.peers=it,this.savePeersToLocalStorage()});this.components=tt,this.options=rt,this.isStarted=!1,this.peers=this.getPeersFromLocalStorage()}get[Symbol.toStringTag](){return"@waku/local-peer-cache-discovery"}async start(){var tt,rt,nt;if(!this.isStarted){log$1.info("Starting Local Storage Discovery"),this.components.events.addEventListener("peer:identify",this.handleNewPeers);for(const{id:ot,address:it}of this.peers){const st=peerIdFromString$1(ot);await this.components.peerStore.has(st)||(await this.components.peerStore.save(st,{multiaddrs:[multiaddr(it)],tags:{[((tt=this.options)==null?void 0:tt.tagName)??DEFAULT_LOCAL_TAG_NAME]:{value:((rt=this.options)==null?void 0:rt.tagValue)??DEFAULT_LOCAL_TAG_VALUE,ttl:((nt=this.options)==null?void 0:nt.tagTTL)??DEFAULT_LOCAL_TAG_TTL}}}),this.dispatchEvent(new CustomEvent("peer",{detail:{id:st,multiaddrs:[multiaddr(it)]}})))}log$1.info(`Discovered ${this.peers.length} peers`),this.isStarted=!0}}stop(){this.isStarted&&(log$1.info("Stopping Local Storage Discovery"),this.components.events.removeEventListener("peer:identify",this.handleNewPeers),this.isStarted=!1,this.savePeersToLocalStorage())}getPeersFromLocalStorage(){try{const tt=localStorage.getItem("waku:peers");return tt?JSON.parse(tt).filter(isValidStoredPeer):[]}catch(tt){return log$1.error("Error parsing peers from local storage:",tt),[]}}savePeersToLocalStorage(){try{localStorage.setItem("waku:peers",JSON.stringify(this.peers))}catch(tt){log$1.error("Error saving peers to local storage:",tt)}}}function isValidStoredPeer(et){return et&&typeof et=="object"&&typeof et.id=="string"&&typeof et.address=="string"}function wakuLocalPeerCacheDiscovery(){return(et,o)=>new LocalPeerCacheDiscovery(et,o)}function defaultPeerDiscoveries(et){const o=[enrTree.SANDBOX,enrTree.TEST];return[wakuDnsDiscovery(o),wakuLocalPeerCacheDiscovery(),wakuPeerExchangeDiscovery(et)]}const log=new Logger$1("sdk:create");async function defaultLibp2p(et,o,tt){o!=null&&o.hideWebSocketInfo||(console.info("%cIgnore WebSocket connection failures","background: gray; color: white; font-size: x-large"),console.info("%cWaku tries to discover peers and some of them are expected to fail","background: gray; color: white; font-size: x-large"));const rt=et?{metadata:wakuMetadata(et)}:{},nt=(o==null?void 0:o.filterMultiaddrs)===!1?all$1:wss;return createLibp2p({transports:[webSockets({filter:nt})],streamMuxers:[mplex()],connectionEncrypters:[noise()],...o,services:{identify:identify({agentVersion:tt??DefaultUserAgent}),ping:ping({maxInboundStreams:(o==null?void 0:o.pingMaxInboundStreams)??DefaultPingMaxInboundStreams}),...rt,...o==null?void 0:o.services}})}async function createLibp2pAndUpdateOptions(et){const{networkConfig:o}=et,tt=derivePubsubTopicsFromNetworkConfig(o??DefaultNetworkConfig);log.info("Creating Waku node with pubsub topics",tt);const rt=(et==null?void 0:et.libp2p)??{},nt=rt.peerDiscovery??[];return et!=null&&et.defaultBootstrap&&nt.push(...defaultPeerDiscoveries(tt)),et!=null&&et.bootstrapPeers&&nt.push(bootstrap({list:et.bootstrapPeers})),rt.peerDiscovery=nt,{libp2p:await defaultLibp2p(tt,rt,et==null?void 0:et.userAgent),pubsubTopics:tt}}async function createLightNode(et={}){const{libp2p:o,pubsubTopics:tt}=await createLibp2pAndUpdateOptions(et);return new WakuNode(tt,et,o,{store:!0,lightpush:!0,filter:!0})}React.createContext({decoder:void 0,encoder:void 0});const useCreateNode=et=>{const{factory:o,options:tt,protocols:rt=[]}=et,[nt,ot]=React.useState(void 0),[it,st]=React.useState(!0),[at,ct]=React.useState(void 0);return React.useEffect(()=>{let lt=!1;return st(!0),o(tt).then(async dt=>{lt||(await dt.start(),await waitForRemotePeer(dt,rt),ot(dt),st(!1))}).catch(dt=>{st(!1),ct(`Failed at creating node: ${(dt==null?void 0:dt.message)||"no message"}`)}),()=>{lt=!0}},[]),{node:nt,error:at,isLoading:it}},useCreateLightNode=et=>useCreateNode({...et,factory:createLightNode}),WakuContext=React.createContext({node:void 0,isLoading:!1,error:void 0}),useWaku=()=>React.useContext(WakuContext),LightNodeProvider=et=>{const o=useCreateLightNode({options:et.options,protocols:et.protocols});return React.createElement(WakuContext.Provider,{value:o},et.children)};/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const toKebabCase=et=>et.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),mergeClasses=(...et)=>et.filter((o,tt,rt)=>!!o&&rt.indexOf(o)===tt).join(" ");/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var defaultAttributes={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Icon=reactExports.forwardRef(({color:et="currentColor",size:o=24,strokeWidth:tt=2,absoluteStrokeWidth:rt,className:nt="",children:ot,iconNode:it,...st},at)=>reactExports.createElement("svg",{ref:at,...defaultAttributes,width:o,height:o,stroke:et,strokeWidth:rt?Number(tt)*24/Number(o):tt,className:mergeClasses("lucide",nt),...st},[...it.map(([ct,lt])=>reactExports.createElement(ct,lt)),...Array.isArray(ot)?ot:[ot]]));/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const createLucideIcon=(et,o)=>{const tt=reactExports.forwardRef(({className:rt,...nt},ot)=>reactExports.createElement(Icon,{ref:ot,iconNode:o,className:mergeClasses(`lucide-${toKebabCase(et)}`,rt),...nt}));return tt.displayName=`${et}`,tt};/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Check=createLucideIcon("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Copy=createLucideIcon("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const LoaderCircle=createLucideIcon("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Header=({wakuStatus:et})=>{const{address:o,isConnected:tt}=useAccount(),{disconnect:rt}=useDisconnect(),{isLoading:nt,error:ot,node:it}=useWaku(),[st,at]=reactExports.useState(0),ct=useLocation(),{data:lt}=useEnsName({address:o});reactExports.useEffect(()=>{if(it){const ht=()=>{at(it.libp2p.getConnections().length)};return ht(),it.libp2p.addEventListener("peer:connect",ht),it.libp2p.addEventListener("peer:disconnect",ht),()=>{it.libp2p.removeEventListener("peer:connect",ht),it.libp2p.removeEventListener("peer:disconnect",ht)}}},[it]);const dt=ht=>{switch(ht){case"success":return"bg-green-500";case"in-progress":return"bg-yellow-500";case"error":return"bg-red-500"}};return jsxRuntimeExports.jsx("header",{className:"sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:jsxRuntimeExports.jsx("div",{className:"container",children:jsxRuntimeExports.jsx("div",{className:"h-14",children:jsxRuntimeExports.jsxs("div",{className:"flex h-14 items-center justify-between gap-4",children:[jsxRuntimeExports.jsxs("nav",{className:"flex items-center gap-2 md:gap-4",children:[jsxRuntimeExports.jsx(Link,{to:"",className:`text-sm font-medium ${ct.pathname===""?"text-foreground":"text-muted-foreground"}`,children:"Home"}),jsxRuntimeExports.jsx(Link,{to:"create",className:`text-sm font-medium ${ct.pathname==="/create"?"text-foreground":"text-muted-foreground"}`,children:"Create"}),jsxRuntimeExports.jsx(Link,{to:"view",className:`text-sm font-medium ${ct.pathname==="/view"?"text-foreground":"text-muted-foreground"}`,children:"View"})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2 md:gap-4",children:[jsxRuntimeExports.jsx("div",{className:"hidden md:flex items-center gap-2",children:!nt&&!ot&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntimeExports.jsx("span",{className:"text-muted-foreground",children:"Filter:"}),jsxRuntimeExports.jsx("div",{className:`w-2 h-2 md:w-3 md:h-3 rounded-full ${dt(et.filter)}`})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1",children:[jsxRuntimeExports.jsx("span",{className:"text-muted-foreground",children:"Store:"}),jsxRuntimeExports.jsx("div",{className:`w-2 h-2 md:w-3 md:h-3 rounded-full ${dt(et.store)}`})]})]})}),jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[nt?jsxRuntimeExports.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}):ot?jsxRuntimeExports.jsx("span",{className:"text-xs text-red-500",children:"Error"}):jsxRuntimeExports.jsx("div",{className:`w-2 h-2 rounded-full ${st>0?"bg-green-500":"bg-yellow-500"}`}),tt?jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("span",{className:"text-xs md:text-sm text-muted-foreground truncate max-w-[80px] md:max-w-[120px]",children:lt||(o?`${o.slice(0,4)}...${o.slice(-4)}`:"")}),jsxRuntimeExports.jsxs(Button,{variant:"outline",size:"sm",onClick:()=>rt(),children:[jsxRuntimeExports.jsx("span",{className:"md:hidden",children:"×"}),jsxRuntimeExports.jsx("span",{className:"hidden md:inline",children:"Logout"})]})]}):jsxRuntimeExports.jsx(ConnectKitButton,{})]})]})]})})})})},Input=reactExports.forwardRef(({className:et,type:o,...tt},rt)=>jsxRuntimeExports.jsx("input",{type:o,className:cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base md:text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50","touch-manipulation min-h-[44px] md:min-h-[36px]",et),ref:rt,...tt}));Input.displayName="Input";const Textarea=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("textarea",{className:cn("flex min-h-[80px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base md:text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50","touch-manipulation resize-y",et),ref:tt,...o}));Textarea.displayName="Textarea";var NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Primitive=NODES.reduce((et,o)=>{const tt=reactExports.forwardRef((rt,nt)=>{const{asChild:ot,...it}=rt,st=ot?Slot:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),jsxRuntimeExports.jsx(st,{...it,ref:nt})});return tt.displayName=`Primitive.${o}`,{...et,[o]:tt}},{});function dispatchDiscreteCustomEvent(et,o){et&&reactDomExports.flushSync(()=>et.dispatchEvent(o))}var NAME="Label",Label$1=reactExports.forwardRef((et,o)=>jsxRuntimeExports.jsx(Primitive.label,{...et,ref:o,onMouseDown:tt=>{var nt;tt.target.closest("button, input, select, textarea")||((nt=et.onMouseDown)==null||nt.call(et,tt),!tt.defaultPrevented&&tt.detail>1&&tt.preventDefault())}}));Label$1.displayName=NAME;var Root$3=Label$1;const labelVariants=cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Label=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx(Root$3,{ref:tt,className:cn(labelVariants(),et),...o}));Label.displayName=Root$3.displayName;const Card=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("rounded-lg border bg-card text-card-foreground shadow-sm p-4 md:p-6 w-full max-w-[95vw] mx-auto",et),...o}));Card.displayName="Card";const CardHeader=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("flex flex-col space-y-1.5 p-4 md:p-6",et),...o}));CardHeader.displayName="CardHeader";const CardTitle=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("h3",{ref:tt,className:cn("font-semibold leading-none tracking-tight",et),...o}));CardTitle.displayName="CardTitle";const CardDescription=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("p",{ref:tt,className:cn("text-sm text-muted-foreground",et),...o}));CardDescription.displayName="CardDescription";const CardContent=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("p-6 pt-0",et),...o}));CardContent.displayName="CardContent";const CardFooter=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx("div",{ref:tt,className:cn("flex items-center p-6 pt-0",et),...o}));CardFooter.displayName="CardFooter";function composeEventHandlers(et,o,{checkForDefaultPrevented:tt=!0}={}){return function(nt){if(et==null||et(nt),tt===!1||!nt.defaultPrevented)return o==null?void 0:o(nt)}}function createContext2(et,o){const tt=reactExports.createContext(o),rt=ot=>{const{children:it,...st}=ot,at=reactExports.useMemo(()=>st,Object.values(st));return jsxRuntimeExports.jsx(tt.Provider,{value:at,children:it})};rt.displayName=et+"Provider";function nt(ot){const it=reactExports.useContext(tt);if(it)return it;if(o!==void 0)return o;throw new Error(`\`${ot}\` must be used within \`${et}\``)}return[rt,nt]}function createContextScope(et,o=[]){let tt=[];function rt(ot,it){const st=reactExports.createContext(it),at=tt.length;tt=[...tt,it];const ct=dt=>{var gt;const{scope:ht,children:mt,...ft}=dt,pt=((gt=ht==null?void 0:ht[et])==null?void 0:gt[at])||st,yt=reactExports.useMemo(()=>ft,Object.values(ft));return jsxRuntimeExports.jsx(pt.Provider,{value:yt,children:mt})};ct.displayName=ot+"Provider";function lt(dt,ht){var pt;const mt=((pt=ht==null?void 0:ht[et])==null?void 0:pt[at])||st,ft=reactExports.useContext(mt);if(ft)return ft;if(it!==void 0)return it;throw new Error(`\`${dt}\` must be used within \`${ot}\``)}return[ct,lt]}const nt=()=>{const ot=tt.map(it=>reactExports.createContext(it));return function(st){const at=(st==null?void 0:st[et])||ot;return reactExports.useMemo(()=>({[`__scope${et}`]:{...st,[et]:at}}),[st,at])}};return nt.scopeName=et,[rt,composeContextScopes(nt,...o)]}function composeContextScopes(...et){const o=et[0];if(et.length===1)return o;const tt=()=>{const rt=et.map(nt=>({useScope:nt(),scopeName:nt.scopeName}));return function(ot){const it=rt.reduce((st,{useScope:at,scopeName:ct})=>{const dt=at(ot)[`__scope${ct}`];return{...st,...dt}},{});return reactExports.useMemo(()=>({[`__scope${o.scopeName}`]:it}),[it])}};return tt.scopeName=o.scopeName,tt}var useLayoutEffect2=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:()=>{},useReactId=React$1.useId||(()=>{}),count$1=0;function useId(et){const[o,tt]=reactExports.useState(useReactId());return useLayoutEffect2(()=>{et||tt(rt=>rt??String(count$1++))},[et]),et||(o?`radix-${o}`:"")}function useCallbackRef$1(et){const o=reactExports.useRef(et);return reactExports.useEffect(()=>{o.current=et}),reactExports.useMemo(()=>(...tt)=>{var rt;return(rt=o.current)==null?void 0:rt.call(o,...tt)},[])}function useControllableState({prop:et,defaultProp:o,onChange:tt=()=>{}}){const[rt,nt]=useUncontrolledState({defaultProp:o,onChange:tt}),ot=et!==void 0,it=ot?et:rt,st=useCallbackRef$1(tt),at=reactExports.useCallback(ct=>{if(ot){const dt=typeof ct=="function"?ct(et):ct;dt!==et&&st(dt)}else nt(ct)},[ot,et,nt,st]);return[it,at]}function useUncontrolledState({defaultProp:et,onChange:o}){const tt=reactExports.useState(et),[rt]=tt,nt=reactExports.useRef(rt),ot=useCallbackRef$1(o);return reactExports.useEffect(()=>{nt.current!==rt&&(ot(rt),nt.current=rt)},[rt,nt,ot]),tt}function useEscapeKeydown(et,o=globalThis==null?void 0:globalThis.document){const tt=useCallbackRef$1(et);reactExports.useEffect(()=>{const rt=nt=>{nt.key==="Escape"&&tt(nt)};return o.addEventListener("keydown",rt,{capture:!0}),()=>o.removeEventListener("keydown",rt,{capture:!0})},[tt,o])}var DISMISSABLE_LAYER_NAME="DismissableLayer",CONTEXT_UPDATE="dismissableLayer.update",POINTER_DOWN_OUTSIDE="dismissableLayer.pointerDownOutside",FOCUS_OUTSIDE="dismissableLayer.focusOutside",originalBodyPointerEvents,DismissableLayerContext=reactExports.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),DismissableLayer=reactExports.forwardRef((et,o)=>{const{disableOutsidePointerEvents:tt=!1,onEscapeKeyDown:rt,onPointerDownOutside:nt,onFocusOutside:ot,onInteractOutside:it,onDismiss:st,...at}=et,ct=reactExports.useContext(DismissableLayerContext),[lt,dt]=reactExports.useState(null),ht=(lt==null?void 0:lt.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,mt]=reactExports.useState({}),ft=useComposedRefs(o,St=>dt(St)),pt=Array.from(ct.layers),[yt]=[...ct.layersWithOutsidePointerEventsDisabled].slice(-1),gt=pt.indexOf(yt),bt=lt?pt.indexOf(lt):-1,xt=ct.layersWithOutsidePointerEventsDisabled.size>0,vt=bt>=gt,Et=usePointerDownOutside(St=>{const At=St.target,kt=[...ct.branches].some(It=>It.contains(At));!vt||kt||(nt==null||nt(St),it==null||it(St),St.defaultPrevented||st==null||st())},ht),Ct=useFocusOutside(St=>{const At=St.target;[...ct.branches].some(It=>It.contains(At))||(ot==null||ot(St),it==null||it(St),St.defaultPrevented||st==null||st())},ht);return useEscapeKeydown(St=>{bt===ct.layers.size-1&&(rt==null||rt(St),!St.defaultPrevented&&st&&(St.preventDefault(),st()))},ht),reactExports.useEffect(()=>{if(lt)return tt&&(ct.layersWithOutsidePointerEventsDisabled.size===0&&(originalBodyPointerEvents=ht.body.style.pointerEvents,ht.body.style.pointerEvents="none"),ct.layersWithOutsidePointerEventsDisabled.add(lt)),ct.layers.add(lt),dispatchUpdate(),()=>{tt&&ct.layersWithOutsidePointerEventsDisabled.size===1&&(ht.body.style.pointerEvents=originalBodyPointerEvents)}},[lt,ht,tt,ct]),reactExports.useEffect(()=>()=>{lt&&(ct.layers.delete(lt),ct.layersWithOutsidePointerEventsDisabled.delete(lt),dispatchUpdate())},[lt,ct]),reactExports.useEffect(()=>{const St=()=>mt({});return document.addEventListener(CONTEXT_UPDATE,St),()=>document.removeEventListener(CONTEXT_UPDATE,St)},[]),jsxRuntimeExports.jsx(Primitive.div,{...at,ref:ft,style:{pointerEvents:xt?vt?"auto":"none":void 0,...et.style},onFocusCapture:composeEventHandlers(et.onFocusCapture,Ct.onFocusCapture),onBlurCapture:composeEventHandlers(et.onBlurCapture,Ct.onBlurCapture),onPointerDownCapture:composeEventHandlers(et.onPointerDownCapture,Et.onPointerDownCapture)})});DismissableLayer.displayName=DISMISSABLE_LAYER_NAME;var BRANCH_NAME="DismissableLayerBranch",DismissableLayerBranch=reactExports.forwardRef((et,o)=>{const tt=reactExports.useContext(DismissableLayerContext),rt=reactExports.useRef(null),nt=useComposedRefs(o,rt);return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return tt.branches.add(ot),()=>{tt.branches.delete(ot)}},[tt.branches]),jsxRuntimeExports.jsx(Primitive.div,{...et,ref:nt})});DismissableLayerBranch.displayName=BRANCH_NAME;function usePointerDownOutside(et,o=globalThis==null?void 0:globalThis.document){const tt=useCallbackRef$1(et),rt=reactExports.useRef(!1),nt=reactExports.useRef(()=>{});return reactExports.useEffect(()=>{const ot=st=>{if(st.target&&!rt.current){let at=function(){handleAndDispatchCustomEvent(POINTER_DOWN_OUTSIDE,tt,ct,{discrete:!0})};const ct={originalEvent:st};st.pointerType==="touch"?(o.removeEventListener("click",nt.current),nt.current=at,o.addEventListener("click",nt.current,{once:!0})):at()}else o.removeEventListener("click",nt.current);rt.current=!1},it=window.setTimeout(()=>{o.addEventListener("pointerdown",ot)},0);return()=>{window.clearTimeout(it),o.removeEventListener("pointerdown",ot),o.removeEventListener("click",nt.current)}},[o,tt]),{onPointerDownCapture:()=>rt.current=!0}}function useFocusOutside(et,o=globalThis==null?void 0:globalThis.document){const tt=useCallbackRef$1(et),rt=reactExports.useRef(!1);return reactExports.useEffect(()=>{const nt=ot=>{ot.target&&!rt.current&&handleAndDispatchCustomEvent(FOCUS_OUTSIDE,tt,{originalEvent:ot},{discrete:!1})};return o.addEventListener("focusin",nt),()=>o.removeEventListener("focusin",nt)},[o,tt]),{onFocusCapture:()=>rt.current=!0,onBlurCapture:()=>rt.current=!1}}function dispatchUpdate(){const et=new CustomEvent(CONTEXT_UPDATE);document.dispatchEvent(et)}function handleAndDispatchCustomEvent(et,o,tt,{discrete:rt}){const nt=tt.originalEvent.target,ot=new CustomEvent(et,{bubbles:!1,cancelable:!0,detail:tt});o&&nt.addEventListener(et,o,{once:!0}),rt?dispatchDiscreteCustomEvent(nt,ot):nt.dispatchEvent(ot)}var AUTOFOCUS_ON_MOUNT="focusScope.autoFocusOnMount",AUTOFOCUS_ON_UNMOUNT="focusScope.autoFocusOnUnmount",EVENT_OPTIONS={bubbles:!1,cancelable:!0},FOCUS_SCOPE_NAME="FocusScope",FocusScope=reactExports.forwardRef((et,o)=>{const{loop:tt=!1,trapped:rt=!1,onMountAutoFocus:nt,onUnmountAutoFocus:ot,...it}=et,[st,at]=reactExports.useState(null),ct=useCallbackRef$1(nt),lt=useCallbackRef$1(ot),dt=reactExports.useRef(null),ht=useComposedRefs(o,pt=>at(pt)),mt=reactExports.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;reactExports.useEffect(()=>{if(rt){let pt=function(xt){if(mt.paused||!st)return;const vt=xt.target;st.contains(vt)?dt.current=vt:focus(dt.current,{select:!0})},yt=function(xt){if(mt.paused||!st)return;const vt=xt.relatedTarget;vt!==null&&(st.contains(vt)||focus(dt.current,{select:!0}))},gt=function(xt){if(document.activeElement===document.body)for(const Et of xt)Et.removedNodes.length>0&&focus(st)};document.addEventListener("focusin",pt),document.addEventListener("focusout",yt);const bt=new MutationObserver(gt);return st&&bt.observe(st,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",pt),document.removeEventListener("focusout",yt),bt.disconnect()}}},[rt,st,mt.paused]),reactExports.useEffect(()=>{if(st){focusScopesStack.add(mt);const pt=document.activeElement;if(!st.contains(pt)){const gt=new CustomEvent(AUTOFOCUS_ON_MOUNT,EVENT_OPTIONS);st.addEventListener(AUTOFOCUS_ON_MOUNT,ct),st.dispatchEvent(gt),gt.defaultPrevented||(focusFirst(removeLinks(getTabbableCandidates(st)),{select:!0}),document.activeElement===pt&&focus(st))}return()=>{st.removeEventListener(AUTOFOCUS_ON_MOUNT,ct),setTimeout(()=>{const gt=new CustomEvent(AUTOFOCUS_ON_UNMOUNT,EVENT_OPTIONS);st.addEventListener(AUTOFOCUS_ON_UNMOUNT,lt),st.dispatchEvent(gt),gt.defaultPrevented||focus(pt??document.body,{select:!0}),st.removeEventListener(AUTOFOCUS_ON_UNMOUNT,lt),focusScopesStack.remove(mt)},0)}}},[st,ct,lt,mt]);const ft=reactExports.useCallback(pt=>{if(!tt&&!rt||mt.paused)return;const yt=pt.key==="Tab"&&!pt.altKey&&!pt.ctrlKey&&!pt.metaKey,gt=document.activeElement;if(yt&>){const bt=pt.currentTarget,[xt,vt]=getTabbableEdges(bt);xt&&vt?!pt.shiftKey&>===vt?(pt.preventDefault(),tt&&focus(xt,{select:!0})):pt.shiftKey&>===xt&&(pt.preventDefault(),tt&&focus(vt,{select:!0})):gt===bt&&pt.preventDefault()}},[tt,rt,mt.paused]);return jsxRuntimeExports.jsx(Primitive.div,{tabIndex:-1,...it,ref:ht,onKeyDown:ft})});FocusScope.displayName=FOCUS_SCOPE_NAME;function focusFirst(et,{select:o=!1}={}){const tt=document.activeElement;for(const rt of et)if(focus(rt,{select:o}),document.activeElement!==tt)return}function getTabbableEdges(et){const o=getTabbableCandidates(et),tt=findVisible(o,et),rt=findVisible(o.reverse(),et);return[tt,rt]}function getTabbableCandidates(et){const o=[],tt=document.createTreeWalker(et,NodeFilter.SHOW_ELEMENT,{acceptNode:rt=>{const nt=rt.tagName==="INPUT"&&rt.type==="hidden";return rt.disabled||rt.hidden||nt?NodeFilter.FILTER_SKIP:rt.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;tt.nextNode();)o.push(tt.currentNode);return o}function findVisible(et,o){for(const tt of et)if(!isHidden(tt,{upTo:o}))return tt}function isHidden(et,{upTo:o}){if(getComputedStyle(et).visibility==="hidden")return!0;for(;et;){if(o!==void 0&&et===o)return!1;if(getComputedStyle(et).display==="none")return!0;et=et.parentElement}return!1}function isSelectableInput(et){return et instanceof HTMLInputElement&&"select"in et}function focus(et,{select:o=!1}={}){if(et&&et.focus){const tt=document.activeElement;et.focus({preventScroll:!0}),et!==tt&&isSelectableInput(et)&&o&&et.select()}}var focusScopesStack=createFocusScopesStack();function createFocusScopesStack(){let et=[];return{add(o){const tt=et[0];o!==tt&&(tt==null||tt.pause()),et=arrayRemove(et,o),et.unshift(o)},remove(o){var tt;et=arrayRemove(et,o),(tt=et[0])==null||tt.resume()}}}function arrayRemove(et,o){const tt=[...et],rt=tt.indexOf(o);return rt!==-1&&tt.splice(rt,1),tt}function removeLinks(et){return et.filter(o=>o.tagName!=="A")}var PORTAL_NAME$1="Portal",Portal$1=reactExports.forwardRef((et,o)=>{var st;const{container:tt,...rt}=et,[nt,ot]=reactExports.useState(!1);useLayoutEffect2(()=>ot(!0),[]);const it=tt||nt&&((st=globalThis==null?void 0:globalThis.document)==null?void 0:st.body);return it?ReactDOM.createPortal(jsxRuntimeExports.jsx(Primitive.div,{...rt,ref:o}),it):null});Portal$1.displayName=PORTAL_NAME$1;function useStateMachine$1(et,o){return reactExports.useReducer((tt,rt)=>o[tt][rt]??tt,et)}var Presence=et=>{const{present:o,children:tt}=et,rt=usePresence(o),nt=typeof tt=="function"?tt({present:rt.isPresent}):reactExports.Children.only(tt),ot=useComposedRefs(rt.ref,getElementRef(nt));return typeof tt=="function"||rt.isPresent?reactExports.cloneElement(nt,{ref:ot}):null};Presence.displayName="Presence";function usePresence(et){const[o,tt]=reactExports.useState(),rt=reactExports.useRef({}),nt=reactExports.useRef(et),ot=reactExports.useRef("none"),it=et?"mounted":"unmounted",[st,at]=useStateMachine$1(it,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const ct=getAnimationName(rt.current);ot.current=st==="mounted"?ct:"none"},[st]),useLayoutEffect2(()=>{const ct=rt.current,lt=nt.current;if(lt!==et){const ht=ot.current,mt=getAnimationName(ct);et?at("MOUNT"):mt==="none"||(ct==null?void 0:ct.display)==="none"?at("UNMOUNT"):at(lt&&ht!==mt?"ANIMATION_OUT":"UNMOUNT"),nt.current=et}},[et,at]),useLayoutEffect2(()=>{if(o){let ct;const lt=o.ownerDocument.defaultView??window,dt=mt=>{const pt=getAnimationName(rt.current).includes(mt.animationName);if(mt.target===o&&pt&&(at("ANIMATION_END"),!nt.current)){const yt=o.style.animationFillMode;o.style.animationFillMode="forwards",ct=lt.setTimeout(()=>{o.style.animationFillMode==="forwards"&&(o.style.animationFillMode=yt)})}},ht=mt=>{mt.target===o&&(ot.current=getAnimationName(rt.current))};return o.addEventListener("animationstart",ht),o.addEventListener("animationcancel",dt),o.addEventListener("animationend",dt),()=>{lt.clearTimeout(ct),o.removeEventListener("animationstart",ht),o.removeEventListener("animationcancel",dt),o.removeEventListener("animationend",dt)}}else at("ANIMATION_END")},[o,at]),{isPresent:["mounted","unmountSuspended"].includes(st),ref:reactExports.useCallback(ct=>{ct&&(rt.current=getComputedStyle(ct)),tt(ct)},[])}}function getAnimationName(et){return(et==null?void 0:et.animationName)||"none"}function getElementRef(et){var rt,nt;let o=(rt=Object.getOwnPropertyDescriptor(et.props,"ref"))==null?void 0:rt.get,tt=o&&"isReactWarning"in o&&o.isReactWarning;return tt?et.ref:(o=(nt=Object.getOwnPropertyDescriptor(et,"ref"))==null?void 0:nt.get,tt=o&&"isReactWarning"in o&&o.isReactWarning,tt?et.props.ref:et.props.ref||et.ref)}var count=0;function useFocusGuards(){reactExports.useEffect(()=>{const et=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",et[0]??createFocusGuard()),document.body.insertAdjacentElement("beforeend",et[1]??createFocusGuard()),count++,()=>{count===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),count--}},[])}function createFocusGuard(){const et=document.createElement("span");return et.setAttribute("data-radix-focus-guard",""),et.tabIndex=0,et.style.outline="none",et.style.opacity="0",et.style.position="fixed",et.style.pointerEvents="none",et}var zeroRightClassName="right-scroll-bar-position",fullWidthClassName="width-before-scroll-bar",noScrollbarsClassName="with-scroll-bars-hidden",removedBarSizeVariable="--removed-body-scroll-bar-size";function assignRef(et,o){return typeof et=="function"?et(o):et&&(et.current=o),et}function useCallbackRef(et,o){var tt=reactExports.useState(function(){return{value:et,callback:o,facade:{get current(){return tt.value},set current(rt){var nt=tt.value;nt!==rt&&(tt.value=rt,tt.callback(rt,nt))}}}})[0];return tt.callback=o,tt.facade}var useIsomorphicLayoutEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect,currentValues=new WeakMap;function useMergeRefs(et,o){var tt=useCallbackRef(null,function(rt){return et.forEach(function(nt){return assignRef(nt,rt)})});return useIsomorphicLayoutEffect(function(){var rt=currentValues.get(tt);if(rt){var nt=new Set(rt),ot=new Set(et),it=tt.current;nt.forEach(function(st){ot.has(st)||assignRef(st,null)}),ot.forEach(function(st){nt.has(st)||assignRef(st,it)})}currentValues.set(tt,et)},[et]),tt}function ItoI(et){return et}function innerCreateMedium(et,o){o===void 0&&(o=ItoI);var tt=[],rt=!1,nt={read:function(){if(rt)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return tt.length?tt[tt.length-1]:et},useMedium:function(ot){var it=o(ot,rt);return tt.push(it),function(){tt=tt.filter(function(st){return st!==it})}},assignSyncMedium:function(ot){for(rt=!0;tt.length;){var it=tt;tt=[],it.forEach(ot)}tt={push:function(st){return ot(st)},filter:function(){return tt}}},assignMedium:function(ot){rt=!0;var it=[];if(tt.length){var st=tt;tt=[],st.forEach(ot),it=tt}var at=function(){var lt=it;it=[],lt.forEach(ot)},ct=function(){return Promise.resolve().then(at)};ct(),tt={push:function(lt){it.push(lt),ct()},filter:function(lt){return it=it.filter(lt),tt}}}};return nt}function createSidecarMedium(et){et===void 0&&(et={});var o=innerCreateMedium(null);return o.options=__assign({async:!0,ssr:!1},et),o}var SideCar$1=function(et){var o=et.sideCar,tt=__rest(et,["sideCar"]);if(!o)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var rt=o.read();if(!rt)throw new Error("Sidecar medium not found");return reactExports.createElement(rt,__assign({},tt))};SideCar$1.isSideCarExport=!0;function exportSidecar(et,o){return et.useMedium(o),SideCar$1}var effectCar=createSidecarMedium(),nothing=function(){},RemoveScroll=reactExports.forwardRef(function(et,o){var tt=reactExports.useRef(null),rt=reactExports.useState({onScrollCapture:nothing,onWheelCapture:nothing,onTouchMoveCapture:nothing}),nt=rt[0],ot=rt[1],it=et.forwardProps,st=et.children,at=et.className,ct=et.removeScrollBar,lt=et.enabled,dt=et.shards,ht=et.sideCar,mt=et.noIsolation,ft=et.inert,pt=et.allowPinchZoom,yt=et.as,gt=yt===void 0?"div":yt,bt=et.gapMode,xt=__rest(et,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),vt=ht,Et=useMergeRefs([tt,o]),Ct=__assign(__assign({},xt),nt);return reactExports.createElement(reactExports.Fragment,null,lt&&reactExports.createElement(vt,{sideCar:effectCar,removeScrollBar:ct,shards:dt,noIsolation:mt,inert:ft,setCallbacks:ot,allowPinchZoom:!!pt,lockRef:tt,gapMode:bt}),it?reactExports.cloneElement(reactExports.Children.only(st),__assign(__assign({},Ct),{ref:Et})):reactExports.createElement(gt,__assign({},Ct,{className:at,ref:Et}),st))});RemoveScroll.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};RemoveScroll.classNames={fullWidth:fullWidthClassName,zeroRight:zeroRightClassName};var getNonce=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function makeStyleTag(){if(!document)return null;var et=document.createElement("style");et.type="text/css";var o=getNonce();return o&&et.setAttribute("nonce",o),et}function injectStyles(et,o){et.styleSheet?et.styleSheet.cssText=o:et.appendChild(document.createTextNode(o))}function insertStyleTag(et){var o=document.head||document.getElementsByTagName("head")[0];o.appendChild(et)}var stylesheetSingleton=function(){var et=0,o=null;return{add:function(tt){et==0&&(o=makeStyleTag())&&(injectStyles(o,tt),insertStyleTag(o)),et++},remove:function(){et--,!et&&o&&(o.parentNode&&o.parentNode.removeChild(o),o=null)}}},styleHookSingleton=function(){var et=stylesheetSingleton();return function(o,tt){reactExports.useEffect(function(){return et.add(o),function(){et.remove()}},[o&&tt])}},styleSingleton=function(){var et=styleHookSingleton(),o=function(tt){var rt=tt.styles,nt=tt.dynamic;return et(rt,nt),null};return o},zeroGap={left:0,top:0,right:0,gap:0},parse$2=function(et){return parseInt(et||"",10)||0},getOffset=function(et){var o=window.getComputedStyle(document.body),tt=o[et==="padding"?"paddingLeft":"marginLeft"],rt=o[et==="padding"?"paddingTop":"marginTop"],nt=o[et==="padding"?"paddingRight":"marginRight"];return[parse$2(tt),parse$2(rt),parse$2(nt)]},getGapWidth=function(et){if(et===void 0&&(et="margin"),typeof window>"u")return zeroGap;var o=getOffset(et),tt=document.documentElement.clientWidth,rt=window.innerWidth;return{left:o[0],top:o[1],right:o[2],gap:Math.max(0,rt-tt+o[2]-o[0])}},Style=styleSingleton(),lockAttribute="data-scroll-locked",getStyles=function(et,o,tt,rt){var nt=et.left,ot=et.top,it=et.right,st=et.gap;return tt===void 0&&(tt="margin"),` - .`.concat(noScrollbarsClassName,` { - overflow: hidden `).concat(rt,`; - padding-right: `).concat(st,"px ").concat(rt,`; - } - body[`).concat(lockAttribute,`] { - overflow: hidden `).concat(rt,`; - overscroll-behavior: contain; - `).concat([o&&"position: relative ".concat(rt,";"),tt==="margin"&&` - padding-left: `.concat(nt,`px; - padding-top: `).concat(ot,`px; - padding-right: `).concat(it,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(st,"px ").concat(rt,`; - `),tt==="padding"&&"padding-right: ".concat(st,"px ").concat(rt,";")].filter(Boolean).join(""),` - } - - .`).concat(zeroRightClassName,` { - right: `).concat(st,"px ").concat(rt,`; - } - - .`).concat(fullWidthClassName,` { - margin-right: `).concat(st,"px ").concat(rt,`; - } - - .`).concat(zeroRightClassName," .").concat(zeroRightClassName,` { - right: 0 `).concat(rt,`; - } - - .`).concat(fullWidthClassName," .").concat(fullWidthClassName,` { - margin-right: 0 `).concat(rt,`; - } - - body[`).concat(lockAttribute,`] { - `).concat(removedBarSizeVariable,": ").concat(st,`px; - } -`)},getCurrentUseCounter=function(){var et=parseInt(document.body.getAttribute(lockAttribute)||"0",10);return isFinite(et)?et:0},useLockAttribute=function(){reactExports.useEffect(function(){return document.body.setAttribute(lockAttribute,(getCurrentUseCounter()+1).toString()),function(){var et=getCurrentUseCounter()-1;et<=0?document.body.removeAttribute(lockAttribute):document.body.setAttribute(lockAttribute,et.toString())}},[])},RemoveScrollBar=function(et){var o=et.noRelative,tt=et.noImportant,rt=et.gapMode,nt=rt===void 0?"margin":rt;useLockAttribute();var ot=reactExports.useMemo(function(){return getGapWidth(nt)},[nt]);return reactExports.createElement(Style,{styles:getStyles(ot,!o,nt,tt?"":"!important")})},passiveSupported=!1;if(typeof window<"u")try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveSupported=!1}var nonPassive=passiveSupported?{passive:!1}:!1,alwaysContainsScroll=function(et){return et.tagName==="TEXTAREA"},elementCanBeScrolled=function(et,o){if(!(et instanceof Element))return!1;var tt=window.getComputedStyle(et);return tt[o]!=="hidden"&&!(tt.overflowY===tt.overflowX&&!alwaysContainsScroll(et)&&tt[o]==="visible")},elementCouldBeVScrolled=function(et){return elementCanBeScrolled(et,"overflowY")},elementCouldBeHScrolled=function(et){return elementCanBeScrolled(et,"overflowX")},locationCouldBeScrolled=function(et,o){var tt=o.ownerDocument,rt=o;do{typeof ShadowRoot<"u"&&rt instanceof ShadowRoot&&(rt=rt.host);var nt=elementCouldBeScrolled(et,rt);if(nt){var ot=getScrollVariables(et,rt),it=ot[1],st=ot[2];if(it>st)return!0}rt=rt.parentNode}while(rt&&rt!==tt.body);return!1},getVScrollVariables=function(et){var o=et.scrollTop,tt=et.scrollHeight,rt=et.clientHeight;return[o,tt,rt]},getHScrollVariables=function(et){var o=et.scrollLeft,tt=et.scrollWidth,rt=et.clientWidth;return[o,tt,rt]},elementCouldBeScrolled=function(et,o){return et==="v"?elementCouldBeVScrolled(o):elementCouldBeHScrolled(o)},getScrollVariables=function(et,o){return et==="v"?getVScrollVariables(o):getHScrollVariables(o)},getDirectionFactor=function(et,o){return et==="h"&&o==="rtl"?-1:1},handleScroll=function(et,o,tt,rt,nt){var ot=getDirectionFactor(et,window.getComputedStyle(o).direction),it=ot*rt,st=tt.target,at=o.contains(st),ct=!1,lt=it>0,dt=0,ht=0;do{var mt=getScrollVariables(et,st),ft=mt[0],pt=mt[1],yt=mt[2],gt=pt-yt-ot*ft;(ft||gt)&&elementCouldBeScrolled(et,st)&&(dt+=gt,ht+=ft),st instanceof ShadowRoot?st=st.host:st=st.parentNode}while(!at&&st!==document.body||at&&(o.contains(st)||o===st));return(lt&&(Math.abs(dt)<1||!nt)||!lt&&(Math.abs(ht)<1||!nt))&&(ct=!0),ct},getTouchXY=function(et){return"changedTouches"in et?[et.changedTouches[0].clientX,et.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(et){return[et.deltaX,et.deltaY]},extractRef=function(et){return et&&"current"in et?et.current:et},deltaCompare=function(et,o){return et[0]===o[0]&&et[1]===o[1]},generateStyle=function(et){return` - .block-interactivity-`.concat(et,` {pointer-events: none;} - .allow-interactivity-`).concat(et,` {pointer-events: all;} -`)},idCounter=0,lockStack=[];function RemoveScrollSideCar(et){var o=reactExports.useRef([]),tt=reactExports.useRef([0,0]),rt=reactExports.useRef(),nt=reactExports.useState(idCounter++)[0],ot=reactExports.useState(styleSingleton)[0],it=reactExports.useRef(et);reactExports.useEffect(function(){it.current=et},[et]),reactExports.useEffect(function(){if(et.inert){document.body.classList.add("block-interactivity-".concat(nt));var pt=__spreadArray([et.lockRef.current],(et.shards||[]).map(extractRef),!0).filter(Boolean);return pt.forEach(function(yt){return yt.classList.add("allow-interactivity-".concat(nt))}),function(){document.body.classList.remove("block-interactivity-".concat(nt)),pt.forEach(function(yt){return yt.classList.remove("allow-interactivity-".concat(nt))})}}},[et.inert,et.lockRef.current,et.shards]);var st=reactExports.useCallback(function(pt,yt){if("touches"in pt&&pt.touches.length===2||pt.type==="wheel"&&pt.ctrlKey)return!it.current.allowPinchZoom;var gt=getTouchXY(pt),bt=tt.current,xt="deltaX"in pt?pt.deltaX:bt[0]-gt[0],vt="deltaY"in pt?pt.deltaY:bt[1]-gt[1],Et,Ct=pt.target,St=Math.abs(xt)>Math.abs(vt)?"h":"v";if("touches"in pt&&St==="h"&&Ct.type==="range")return!1;var At=locationCouldBeScrolled(St,Ct);if(!At)return!0;if(At?Et=St:(Et=St==="v"?"h":"v",At=locationCouldBeScrolled(St,Ct)),!At)return!1;if(!rt.current&&"changedTouches"in pt&&(xt||vt)&&(rt.current=Et),!Et)return!0;var kt=rt.current||Et;return handleScroll(kt,yt,pt,kt==="h"?xt:vt,!0)},[]),at=reactExports.useCallback(function(pt){var yt=pt;if(!(!lockStack.length||lockStack[lockStack.length-1]!==ot)){var gt="deltaY"in yt?getDeltaXY(yt):getTouchXY(yt),bt=o.current.filter(function(Et){return Et.name===yt.type&&(Et.target===yt.target||yt.target===Et.shadowParent)&&deltaCompare(Et.delta,gt)})[0];if(bt&&bt.should){yt.cancelable&&yt.preventDefault();return}if(!bt){var xt=(it.current.shards||[]).map(extractRef).filter(Boolean).filter(function(Et){return Et.contains(yt.target)}),vt=xt.length>0?st(yt,xt[0]):!it.current.noIsolation;vt&&yt.cancelable&&yt.preventDefault()}}},[]),ct=reactExports.useCallback(function(pt,yt,gt,bt){var xt={name:pt,delta:yt,target:gt,should:bt,shadowParent:getOutermostShadowParent(gt)};o.current.push(xt),setTimeout(function(){o.current=o.current.filter(function(vt){return vt!==xt})},1)},[]),lt=reactExports.useCallback(function(pt){tt.current=getTouchXY(pt),rt.current=void 0},[]),dt=reactExports.useCallback(function(pt){ct(pt.type,getDeltaXY(pt),pt.target,st(pt,et.lockRef.current))},[]),ht=reactExports.useCallback(function(pt){ct(pt.type,getTouchXY(pt),pt.target,st(pt,et.lockRef.current))},[]);reactExports.useEffect(function(){return lockStack.push(ot),et.setCallbacks({onScrollCapture:dt,onWheelCapture:dt,onTouchMoveCapture:ht}),document.addEventListener("wheel",at,nonPassive),document.addEventListener("touchmove",at,nonPassive),document.addEventListener("touchstart",lt,nonPassive),function(){lockStack=lockStack.filter(function(pt){return pt!==ot}),document.removeEventListener("wheel",at,nonPassive),document.removeEventListener("touchmove",at,nonPassive),document.removeEventListener("touchstart",lt,nonPassive)}},[]);var mt=et.removeScrollBar,ft=et.inert;return reactExports.createElement(reactExports.Fragment,null,ft?reactExports.createElement(ot,{styles:generateStyle(nt)}):null,mt?reactExports.createElement(RemoveScrollBar,{gapMode:et.gapMode}):null)}function getOutermostShadowParent(et){for(var o=null;et!==null;)et instanceof ShadowRoot&&(o=et.host,et=et.host),et=et.parentNode;return o}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=reactExports.forwardRef(function(et,o){return reactExports.createElement(RemoveScroll,__assign({},et,{ref:o,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;var getDefaultParent=function(et){if(typeof document>"u")return null;var o=Array.isArray(et)?et[0]:et;return o.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(et){return et&&(et.host||unwrapHost(et.parentNode))},correctTargets=function(et,o){return o.map(function(tt){if(et.contains(tt))return tt;var rt=unwrapHost(tt);return rt&&et.contains(rt)?rt:(console.error("aria-hidden",tt,"in not contained inside",et,". Doing nothing"),null)}).filter(function(tt){return!!tt})},applyAttributeToOthers=function(et,o,tt,rt){var nt=correctTargets(o,Array.isArray(et)?et:[et]);markerMap[tt]||(markerMap[tt]=new WeakMap);var ot=markerMap[tt],it=[],st=new Set,at=new Set(nt),ct=function(dt){!dt||st.has(dt)||(st.add(dt),ct(dt.parentNode))};nt.forEach(ct);var lt=function(dt){!dt||at.has(dt)||Array.prototype.forEach.call(dt.children,function(ht){if(st.has(ht))lt(ht);else try{var mt=ht.getAttribute(rt),ft=mt!==null&&mt!=="false",pt=(counterMap.get(ht)||0)+1,yt=(ot.get(ht)||0)+1;counterMap.set(ht,pt),ot.set(ht,yt),it.push(ht),pt===1&&ft&&uncontrolledNodes.set(ht,!0),yt===1&&ht.setAttribute(tt,"true"),ft||ht.setAttribute(rt,"true")}catch(gt){console.error("aria-hidden: cannot operate on ",ht,gt)}})};return lt(o),st.clear(),lockCount++,function(){it.forEach(function(dt){var ht=counterMap.get(dt)-1,mt=ot.get(dt)-1;counterMap.set(dt,ht),ot.set(dt,mt),ht||(uncontrolledNodes.has(dt)||dt.removeAttribute(rt),uncontrolledNodes.delete(dt)),mt||dt.removeAttribute(tt)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(et,o,tt){tt===void 0&&(tt="data-aria-hidden");var rt=Array.from(Array.isArray(et)?et:[et]),nt=getDefaultParent(et);return nt?(rt.push.apply(rt,Array.from(nt.querySelectorAll("[aria-live]"))),applyAttributeToOthers(rt,nt,tt,"aria-hidden")):function(){return null}},DIALOG_NAME="Dialog",[createDialogContext,createDialogScope]=createContextScope(DIALOG_NAME),[DialogProvider,useDialogContext]=createDialogContext(DIALOG_NAME),Dialog$1=et=>{const{__scopeDialog:o,children:tt,open:rt,defaultOpen:nt,onOpenChange:ot,modal:it=!0}=et,st=reactExports.useRef(null),at=reactExports.useRef(null),[ct=!1,lt]=useControllableState({prop:rt,defaultProp:nt,onChange:ot});return jsxRuntimeExports.jsx(DialogProvider,{scope:o,triggerRef:st,contentRef:at,contentId:useId(),titleId:useId(),descriptionId:useId(),open:ct,onOpenChange:lt,onOpenToggle:reactExports.useCallback(()=>lt(dt=>!dt),[lt]),modal:it,children:tt})};Dialog$1.displayName=DIALOG_NAME;var TRIGGER_NAME="DialogTrigger",DialogTrigger$1=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,...rt}=et,nt=useDialogContext(TRIGGER_NAME,tt),ot=useComposedRefs(o,nt.triggerRef);return jsxRuntimeExports.jsx(Primitive.button,{type:"button","aria-haspopup":"dialog","aria-expanded":nt.open,"aria-controls":nt.contentId,"data-state":getState(nt.open),...rt,ref:ot,onClick:composeEventHandlers(et.onClick,nt.onOpenToggle)})});DialogTrigger$1.displayName=TRIGGER_NAME;var PORTAL_NAME="DialogPortal",[PortalProvider,usePortalContext]=createDialogContext(PORTAL_NAME,{forceMount:void 0}),DialogPortal$1=et=>{const{__scopeDialog:o,forceMount:tt,children:rt,container:nt}=et,ot=useDialogContext(PORTAL_NAME,o);return jsxRuntimeExports.jsx(PortalProvider,{scope:o,forceMount:tt,children:reactExports.Children.map(rt,it=>jsxRuntimeExports.jsx(Presence,{present:tt||ot.open,children:jsxRuntimeExports.jsx(Portal$1,{asChild:!0,container:nt,children:it})}))})};DialogPortal$1.displayName=PORTAL_NAME;var OVERLAY_NAME="DialogOverlay",DialogOverlay$1=reactExports.forwardRef((et,o)=>{const tt=usePortalContext(OVERLAY_NAME,et.__scopeDialog),{forceMount:rt=tt.forceMount,...nt}=et,ot=useDialogContext(OVERLAY_NAME,et.__scopeDialog);return ot.modal?jsxRuntimeExports.jsx(Presence,{present:rt||ot.open,children:jsxRuntimeExports.jsx(DialogOverlayImpl,{...nt,ref:o})}):null});DialogOverlay$1.displayName=OVERLAY_NAME;var DialogOverlayImpl=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,...rt}=et,nt=useDialogContext(OVERLAY_NAME,tt);return jsxRuntimeExports.jsx(ReactRemoveScroll,{as:Slot,allowPinchZoom:!0,shards:[nt.contentRef],children:jsxRuntimeExports.jsx(Primitive.div,{"data-state":getState(nt.open),...rt,ref:o,style:{pointerEvents:"auto",...rt.style}})})}),CONTENT_NAME="DialogContent",DialogContent$1=reactExports.forwardRef((et,o)=>{const tt=usePortalContext(CONTENT_NAME,et.__scopeDialog),{forceMount:rt=tt.forceMount,...nt}=et,ot=useDialogContext(CONTENT_NAME,et.__scopeDialog);return jsxRuntimeExports.jsx(Presence,{present:rt||ot.open,children:ot.modal?jsxRuntimeExports.jsx(DialogContentModal,{...nt,ref:o}):jsxRuntimeExports.jsx(DialogContentNonModal,{...nt,ref:o})})});DialogContent$1.displayName=CONTENT_NAME;var DialogContentModal=reactExports.forwardRef((et,o)=>{const tt=useDialogContext(CONTENT_NAME,et.__scopeDialog),rt=reactExports.useRef(null),nt=useComposedRefs(o,tt.contentRef,rt);return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return hideOthers(ot)},[]),jsxRuntimeExports.jsx(DialogContentImpl,{...et,ref:nt,trapFocus:tt.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(et.onCloseAutoFocus,ot=>{var it;ot.preventDefault(),(it=tt.triggerRef.current)==null||it.focus()}),onPointerDownOutside:composeEventHandlers(et.onPointerDownOutside,ot=>{const it=ot.detail.originalEvent,st=it.button===0&&it.ctrlKey===!0;(it.button===2||st)&&ot.preventDefault()}),onFocusOutside:composeEventHandlers(et.onFocusOutside,ot=>ot.preventDefault())})}),DialogContentNonModal=reactExports.forwardRef((et,o)=>{const tt=useDialogContext(CONTENT_NAME,et.__scopeDialog),rt=reactExports.useRef(!1),nt=reactExports.useRef(!1);return jsxRuntimeExports.jsx(DialogContentImpl,{...et,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:ot=>{var it,st;(it=et.onCloseAutoFocus)==null||it.call(et,ot),ot.defaultPrevented||(rt.current||(st=tt.triggerRef.current)==null||st.focus(),ot.preventDefault()),rt.current=!1,nt.current=!1},onInteractOutside:ot=>{var at,ct;(at=et.onInteractOutside)==null||at.call(et,ot),ot.defaultPrevented||(rt.current=!0,ot.detail.originalEvent.type==="pointerdown"&&(nt.current=!0));const it=ot.target;((ct=tt.triggerRef.current)==null?void 0:ct.contains(it))&&ot.preventDefault(),ot.detail.originalEvent.type==="focusin"&&nt.current&&ot.preventDefault()}})}),DialogContentImpl=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,trapFocus:rt,onOpenAutoFocus:nt,onCloseAutoFocus:ot,...it}=et,st=useDialogContext(CONTENT_NAME,tt),at=reactExports.useRef(null),ct=useComposedRefs(o,at);return useFocusGuards(),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FocusScope,{asChild:!0,loop:!0,trapped:rt,onMountAutoFocus:nt,onUnmountAutoFocus:ot,children:jsxRuntimeExports.jsx(DismissableLayer,{role:"dialog",id:st.contentId,"aria-describedby":st.descriptionId,"aria-labelledby":st.titleId,"data-state":getState(st.open),...it,ref:ct,onDismiss:()=>st.onOpenChange(!1)})}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(TitleWarning,{titleId:st.titleId}),jsxRuntimeExports.jsx(DescriptionWarning,{contentRef:at,descriptionId:st.descriptionId})]})]})}),TITLE_NAME="DialogTitle",DialogTitle$1=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,...rt}=et,nt=useDialogContext(TITLE_NAME,tt);return jsxRuntimeExports.jsx(Primitive.h2,{id:nt.titleId,...rt,ref:o})});DialogTitle$1.displayName=TITLE_NAME;var DESCRIPTION_NAME="DialogDescription",DialogDescription$1=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,...rt}=et,nt=useDialogContext(DESCRIPTION_NAME,tt);return jsxRuntimeExports.jsx(Primitive.p,{id:nt.descriptionId,...rt,ref:o})});DialogDescription$1.displayName=DESCRIPTION_NAME;var CLOSE_NAME="DialogClose",DialogClose=reactExports.forwardRef((et,o)=>{const{__scopeDialog:tt,...rt}=et,nt=useDialogContext(CLOSE_NAME,tt);return jsxRuntimeExports.jsx(Primitive.button,{type:"button",...rt,ref:o,onClick:composeEventHandlers(et.onClick,()=>nt.onOpenChange(!1))})});DialogClose.displayName=CLOSE_NAME;function getState(et){return et?"open":"closed"}var TITLE_WARNING_NAME="DialogTitleWarning",[WarningProvider,useWarningContext]=createContext2(TITLE_WARNING_NAME,{contentName:CONTENT_NAME,titleName:TITLE_NAME,docsSlug:"dialog"}),TitleWarning=({titleId:et})=>{const o=useWarningContext(TITLE_WARNING_NAME),tt=`\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return reactExports.useEffect(()=>{et&&(document.getElementById(et)||console.error(tt))},[tt,et]),null},DESCRIPTION_WARNING_NAME="DialogDescriptionWarning",DescriptionWarning=({contentRef:et,descriptionId:o})=>{const rt=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;return reactExports.useEffect(()=>{var ot;const nt=(ot=et.current)==null?void 0:ot.getAttribute("aria-describedby");o&&nt&&(document.getElementById(o)||console.warn(rt))},[rt,et,o]),null},Root$2=Dialog$1,Trigger=DialogTrigger$1,Portal=DialogPortal$1,Overlay=DialogOverlay$1,Content=DialogContent$1,Title=DialogTitle$1,Description=DialogDescription$1;const Dialog=Root$2,DialogTrigger=Trigger,DialogPortal=Portal,DialogOverlay=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx(Overlay,{ref:tt,className:cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",et),...o}));DialogOverlay.displayName=Overlay.displayName;const DialogContent=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsxs(DialogPortal,{children:[jsxRuntimeExports.jsx(DialogOverlay,{}),jsxRuntimeExports.jsx(Content,{ref:tt,className:cn("fixed left-[50%] top-[50%] z-50 grid w-full translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200","rounded-lg","max-h-[85vh] overflow-y-auto",et),...o})]}));DialogContent.displayName=Content.displayName;const DialogHeader=({className:et,...o})=>jsxRuntimeExports.jsx("div",{className:cn("flex flex-col space-y-1.5 text-center sm:text-left",et),...o});DialogHeader.displayName="DialogHeader";const DialogFooter=({className:et,...o})=>jsxRuntimeExports.jsx("div",{className:cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",et),...o});DialogFooter.displayName="DialogFooter";const DialogTitle=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx(Title,{ref:tt,className:cn("text-lg font-semibold leading-none tracking-tight",et),...o}));DialogTitle.displayName=Title.displayName;const DialogDescription=reactExports.forwardRef(({className:et,...o},tt)=>jsxRuntimeExports.jsx(Description,{ref:tt,className:cn("text-sm text-muted-foreground",et),...o}));DialogDescription.displayName=Description.displayName;var __defProp=Object.defineProperty,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(et,o,tt)=>o in et?__defProp(et,o,{enumerable:!0,configurable:!0,writable:!0,value:tt}):et[o]=tt,__spreadValues=(et,o)=>{for(var tt in o||(o={}))__hasOwnProp.call(o,tt)&&__defNormalProp(et,tt,o[tt]);if(__getOwnPropSymbols)for(var tt of __getOwnPropSymbols(o))__propIsEnum.call(o,tt)&&__defNormalProp(et,tt,o[tt]);return et},__objRest=(et,o)=>{var tt={};for(var rt in et)__hasOwnProp.call(et,rt)&&o.indexOf(rt)<0&&(tt[rt]=et[rt]);if(et!=null&&__getOwnPropSymbols)for(var rt of __getOwnPropSymbols(et))o.indexOf(rt)<0&&__propIsEnum.call(et,rt)&&(tt[rt]=et[rt]);return tt};/** - * @license QR Code generator library (TypeScript) - * Copyright (c) Project Nayuki. - * SPDX-License-Identifier: MIT - */var qrcodegen;(et=>{const o=class Er{constructor(at,ct,lt,dt){if(this.version=at,this.errorCorrectionLevel=ct,this.modules=[],this.isFunction=[],atEr.MAX_VERSION)throw new RangeError("Version value out of range");if(dt<-1||dt>7)throw new RangeError("Mask value out of range");this.size=at*4+17;let ht=[];for(let ft=0;ft7)throw new RangeError("Invalid value");let ft,pt;for(ft=lt;;ft++){const xt=Er.getNumDataCodewords(ft,ct)*8,vt=it.getTotalBits(at,ft);if(vt<=xt){pt=vt;break}if(ft>=dt)throw new RangeError("Data too long")}for(const xt of[Er.Ecc.MEDIUM,Er.Ecc.QUARTILE,Er.Ecc.HIGH])mt&&pt<=Er.getNumDataCodewords(ft,xt)*8&&(ct=xt);let yt=[];for(const xt of at){tt(xt.mode.modeBits,4,yt),tt(xt.numChars,xt.mode.numCharCountBits(ft),yt);for(const vt of xt.getData())yt.push(vt)}nt(yt.length==pt);const gt=Er.getNumDataCodewords(ft,ct)*8;nt(yt.length<=gt),tt(0,Math.min(4,gt-yt.length),yt),tt(0,(8-yt.length%8)%8,yt),nt(yt.length%8==0);for(let xt=236;yt.lengthbt[vt>>>3]|=xt<<7-(vt&7)),new Er(ft,ct,bt,ht)}getModule(at,ct){return 0<=at&&at>>9)*1335;const dt=(ct<<10|lt)^21522;nt(dt>>>15==0);for(let ht=0;ht<=5;ht++)this.setFunctionModule(8,ht,rt(dt,ht));this.setFunctionModule(8,7,rt(dt,6)),this.setFunctionModule(8,8,rt(dt,7)),this.setFunctionModule(7,8,rt(dt,8));for(let ht=9;ht<15;ht++)this.setFunctionModule(14-ht,8,rt(dt,ht));for(let ht=0;ht<8;ht++)this.setFunctionModule(this.size-1-ht,8,rt(dt,ht));for(let ht=8;ht<15;ht++)this.setFunctionModule(8,this.size-15+ht,rt(dt,ht));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let at=this.version;for(let lt=0;lt<12;lt++)at=at<<1^(at>>>11)*7973;const ct=this.version<<12|at;nt(ct>>>18==0);for(let lt=0;lt<18;lt++){const dt=rt(ct,lt),ht=this.size-11+lt%3,mt=Math.floor(lt/3);this.setFunctionModule(ht,mt,dt),this.setFunctionModule(mt,ht,dt)}}drawFinderPattern(at,ct){for(let lt=-4;lt<=4;lt++)for(let dt=-4;dt<=4;dt++){const ht=Math.max(Math.abs(dt),Math.abs(lt)),mt=at+dt,ft=ct+lt;0<=mt&&mt{(xt!=pt-ht||Et>=ft)&&bt.push(vt[xt])});return nt(bt.length==mt),bt}drawCodewords(at){if(at.length!=Math.floor(Er.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let ct=0;for(let lt=this.size-1;lt>=1;lt-=2){lt==6&&(lt=5);for(let dt=0;dt>>3],7-(ct&7)),ct++)}}nt(ct==at.length*8)}applyMask(at){if(at<0||at>7)throw new RangeError("Mask value out of range");for(let ct=0;ct5&&at++):(this.finderPenaltyAddHistory(ft,pt),mt||(at+=this.finderPenaltyCountPatterns(pt)*Er.PENALTY_N3),mt=this.modules[ht][yt],ft=1);at+=this.finderPenaltyTerminateAndCount(mt,ft,pt)*Er.PENALTY_N3}for(let ht=0;ht5&&at++):(this.finderPenaltyAddHistory(ft,pt),mt||(at+=this.finderPenaltyCountPatterns(pt)*Er.PENALTY_N3),mt=this.modules[yt][ht],ft=1);at+=this.finderPenaltyTerminateAndCount(mt,ft,pt)*Er.PENALTY_N3}for(let ht=0;htmt+(ft?1:0),ct);const lt=this.size*this.size,dt=Math.ceil(Math.abs(ct*20-lt*10)/lt)-1;return nt(0<=dt&&dt<=9),at+=dt*Er.PENALTY_N4,nt(0<=at&&at<=2568888),at}getAlignmentPatternPositions(){if(this.version==1)return[];{const at=Math.floor(this.version/7)+2,ct=this.version==32?26:Math.ceil((this.version*4+4)/(at*2-2))*2;let lt=[6];for(let dt=this.size-7;lt.lengthEr.MAX_VERSION)throw new RangeError("Version number out of range");let ct=(16*at+128)*at+64;if(at>=2){const lt=Math.floor(at/7)+2;ct-=(25*lt-10)*lt-55,at>=7&&(ct-=36)}return nt(208<=ct&&ct<=29648),ct}static getNumDataCodewords(at,ct){return Math.floor(Er.getNumRawDataModules(at)/8)-Er.ECC_CODEWORDS_PER_BLOCK[ct.ordinal][at]*Er.NUM_ERROR_CORRECTION_BLOCKS[ct.ordinal][at]}static reedSolomonComputeDivisor(at){if(at<1||at>255)throw new RangeError("Degree out of range");let ct=[];for(let dt=0;dt0);for(const dt of at){const ht=dt^lt.shift();lt.push(0),ct.forEach((mt,ft)=>lt[ft]^=Er.reedSolomonMultiply(mt,ht))}return lt}static reedSolomonMultiply(at,ct){if(at>>>8||ct>>>8)throw new RangeError("Byte out of range");let lt=0;for(let dt=7;dt>=0;dt--)lt=lt<<1^(lt>>>7)*285,lt^=(ct>>>dt&1)*at;return nt(lt>>>8==0),lt}finderPenaltyCountPatterns(at){const ct=at[1];nt(ct<=this.size*3);const lt=ct>0&&at[2]==ct&&at[3]==ct*3&&at[4]==ct&&at[5]==ct;return(lt&&at[0]>=ct*4&&at[6]>=ct?1:0)+(lt&&at[6]>=ct*4&&at[0]>=ct?1:0)}finderPenaltyTerminateAndCount(at,ct,lt){return at&&(this.finderPenaltyAddHistory(ct,lt),ct=0),ct+=this.size,this.finderPenaltyAddHistory(ct,lt),this.finderPenaltyCountPatterns(lt)}finderPenaltyAddHistory(at,ct){ct[0]==0&&(at+=this.size),ct.pop(),ct.unshift(at)}};o.MIN_VERSION=1,o.MAX_VERSION=40,o.PENALTY_N1=3,o.PENALTY_N2=3,o.PENALTY_N3=40,o.PENALTY_N4=10,o.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],o.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],et.QrCode=o;function tt(st,at,ct){if(at<0||at>31||st>>>at)throw new RangeError("Value out of range");for(let lt=at-1;lt>=0;lt--)ct.push(st>>>lt&1)}function rt(st,at){return(st>>>at&1)!=0}function nt(st){if(!st)throw new Error("Assertion error")}const ot=class Ir{constructor(at,ct,lt){if(this.mode=at,this.numChars=ct,this.bitData=lt,ct<0)throw new RangeError("Invalid argument");this.bitData=lt.slice()}static makeBytes(at){let ct=[];for(const lt of at)tt(lt,8,ct);return new Ir(Ir.Mode.BYTE,at.length,ct)}static makeNumeric(at){if(!Ir.isNumeric(at))throw new RangeError("String contains non-numeric characters");let ct=[];for(let lt=0;lt=1<{(o=>{const tt=class{constructor(nt,ot){this.ordinal=nt,this.formatBits=ot}};tt.LOW=new tt(0,1),tt.MEDIUM=new tt(1,0),tt.QUARTILE=new tt(2,3),tt.HIGH=new tt(3,2),o.Ecc=tt})(et.QrCode||(et.QrCode={}))})(qrcodegen||(qrcodegen={}));(et=>{(o=>{const tt=class{constructor(nt,ot){this.modeBits=nt,this.numBitsCharCount=ot}numCharCountBits(nt){return this.numBitsCharCount[Math.floor((nt+7)/17)]}};tt.NUMERIC=new tt(1,[10,12,14]),tt.ALPHANUMERIC=new tt(2,[9,11,13]),tt.BYTE=new tt(4,[8,16,16]),tt.KANJI=new tt(8,[8,10,12]),tt.ECI=new tt(7,[0,0,0]),o.Mode=tt})(et.QrSegment||(et.QrSegment={}))})(qrcodegen||(qrcodegen={}));var qrcodegen_default=qrcodegen;/** - * @license qrcode.react - * Copyright (c) Paul O'Shannessy - * SPDX-License-Identifier: ISC - */var ERROR_LEVEL_MAP={L:qrcodegen_default.QrCode.Ecc.LOW,M:qrcodegen_default.QrCode.Ecc.MEDIUM,Q:qrcodegen_default.QrCode.Ecc.QUARTILE,H:qrcodegen_default.QrCode.Ecc.HIGH},DEFAULT_SIZE=128,DEFAULT_LEVEL="L",DEFAULT_BGCOLOR="#FFFFFF",DEFAULT_FGCOLOR="#000000",DEFAULT_INCLUDEMARGIN=!1,DEFAULT_MINVERSION=1,SPEC_MARGIN_SIZE=4,DEFAULT_MARGIN_SIZE=0,DEFAULT_IMG_SCALE=.1;function generatePath(et,o=0){const tt=[];return et.forEach(function(rt,nt){let ot=null;rt.forEach(function(it,st){if(!it&&ot!==null){tt.push(`M${ot+o} ${nt+o}h${st-ot}v1H${ot+o}z`),ot=null;return}if(st===rt.length-1){if(!it)return;ot===null?tt.push(`M${st+o},${nt+o} h1v1H${st+o}z`):tt.push(`M${ot+o},${nt+o} h${st+1-ot}v1H${ot+o}z`);return}it&&ot===null&&(ot=st)})}),tt.join("")}function excavateModules(et,o){return et.slice().map((tt,rt)=>rt=o.y+o.h?tt:tt.map((nt,ot)=>ot=o.x+o.w?nt:!1))}function getImageSettings(et,o,tt,rt){if(rt==null)return null;const nt=et.length+tt*2,ot=Math.floor(o*DEFAULT_IMG_SCALE),it=nt/o,st=(rt.width||ot)*it,at=(rt.height||ot)*it,ct=rt.x==null?et.length/2-st/2:rt.x*it,lt=rt.y==null?et.length/2-at/2:rt.y*it,dt=rt.opacity==null?1:rt.opacity;let ht=null;if(rt.excavate){let ft=Math.floor(ct),pt=Math.floor(lt),yt=Math.ceil(st+ct-ft),gt=Math.ceil(at+lt-pt);ht={x:ft,y:pt,w:yt,h:gt}}const mt=rt.crossOrigin;return{x:ct,y:lt,h:at,w:st,excavation:ht,opacity:dt,crossOrigin:mt}}function getMarginSize(et,o){return o!=null?Math.max(Math.floor(o),0):et?SPEC_MARGIN_SIZE:DEFAULT_MARGIN_SIZE}function useQRCode({value:et,level:o,minVersion:tt,includeMargin:rt,marginSize:nt,imageSettings:ot,size:it}){let st=React.useMemo(()=>{const ht=qrcodegen_default.QrSegment.makeSegments(et);return qrcodegen_default.QrCode.encodeSegments(ht,ERROR_LEVEL_MAP[o],tt)},[et,o,tt]);const{cells:at,margin:ct,numCells:lt,calculatedImageSettings:dt}=React.useMemo(()=>{let ht=st.getModules();const mt=getMarginSize(rt,nt),ft=ht.length+mt*2,pt=getImageSettings(ht,it,mt,ot);return{cells:ht,margin:mt,numCells:ft,calculatedImageSettings:pt}},[st,it,ot,rt,nt]);return{qrcode:st,margin:ct,cells:at,numCells:lt,calculatedImageSettings:dt}}var SUPPORTS_PATH2D=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),QRCodeCanvas=React.forwardRef(function(o,tt){const rt=o,{value:nt,size:ot=DEFAULT_SIZE,level:it=DEFAULT_LEVEL,bgColor:st=DEFAULT_BGCOLOR,fgColor:at=DEFAULT_FGCOLOR,includeMargin:ct=DEFAULT_INCLUDEMARGIN,minVersion:lt=DEFAULT_MINVERSION,marginSize:dt,imageSettings:ht}=rt,ft=__objRest(rt,["value","size","level","bgColor","fgColor","includeMargin","minVersion","marginSize","imageSettings"]),{style:pt}=ft,yt=__objRest(ft,["style"]),gt=ht==null?void 0:ht.src,bt=React.useRef(null),xt=React.useRef(null),vt=React.useCallback(Mt=>{bt.current=Mt,typeof tt=="function"?tt(Mt):tt&&(tt.current=Mt)},[tt]),[Et,Ct]=React.useState(!1),{margin:St,cells:At,numCells:kt,calculatedImageSettings:It}=useQRCode({value:nt,level:it,minVersion:lt,includeMargin:ct,marginSize:dt,imageSettings:ht,size:ot});React.useEffect(()=>{if(bt.current!=null){const Mt=bt.current,zt=Mt.getContext("2d");if(!zt)return;let Ut=At;const Xt=xt.current,Wt=It!=null&&Xt!==null&&Xt.complete&&Xt.naturalHeight!==0&&Xt.naturalWidth!==0;Wt&&It.excavation!=null&&(Ut=excavateModules(At,It.excavation));const Ft=window.devicePixelRatio||1;Mt.height=Mt.width=ot*Ft;const qt=ot/kt*Ft;zt.scale(qt,qt),zt.fillStyle=st,zt.fillRect(0,0,kt,kt),zt.fillStyle=at,SUPPORTS_PATH2D?zt.fill(new Path2D(generatePath(Ut,St))):At.forEach(function(Pt,Yt){Pt.forEach(function(Qt,jt){Qt&&zt.fillRect(jt+St,Yt+St,1,1)})}),It&&(zt.globalAlpha=It.opacity),Wt&&zt.drawImage(Xt,It.x+St,It.y+St,It.w,It.h)}}),React.useEffect(()=>{Ct(!1)},[gt]);const Nt=__spreadValues({height:ot,width:ot},pt);let Lt=null;return gt!=null&&(Lt=React.createElement("img",{src:gt,key:gt,style:{display:"none"},onLoad:()=>{Ct(!0)},ref:xt,crossOrigin:It==null?void 0:It.crossOrigin})),React.createElement(React.Fragment,null,React.createElement("canvas",__spreadValues({style:Nt,height:ot,width:ot,ref:vt,role:"img"},yt)),Lt)});QRCodeCanvas.displayName="QRCodeCanvas";var QRCodeSVG=React.forwardRef(function(o,tt){const rt=o,{value:nt,size:ot=DEFAULT_SIZE,level:it=DEFAULT_LEVEL,bgColor:st=DEFAULT_BGCOLOR,fgColor:at=DEFAULT_FGCOLOR,includeMargin:ct=DEFAULT_INCLUDEMARGIN,minVersion:lt=DEFAULT_MINVERSION,title:dt,marginSize:ht,imageSettings:mt}=rt,ft=__objRest(rt,["value","size","level","bgColor","fgColor","includeMargin","minVersion","title","marginSize","imageSettings"]),{margin:pt,cells:yt,numCells:gt,calculatedImageSettings:bt}=useQRCode({value:nt,level:it,minVersion:lt,includeMargin:ct,marginSize:ht,imageSettings:mt,size:ot});let xt=yt,vt=null;mt!=null&&bt!=null&&(bt.excavation!=null&&(xt=excavateModules(yt,bt.excavation)),vt=React.createElement("image",{href:mt.src,height:bt.h,width:bt.w,x:bt.x+pt,y:bt.y+pt,preserveAspectRatio:"none",opacity:bt.opacity,crossOrigin:bt.crossOrigin}));const Et=generatePath(xt,pt);return React.createElement("svg",__spreadValues({height:ot,width:ot,viewBox:`0 0 ${gt} ${gt}`,ref:tt,role:"img"},ft),!!dt&&React.createElement("title",null,dt),React.createElement("path",{fill:st,d:`M0,0 h${gt}v${gt}H0z`,shapeRendering:"crispEdges"}),React.createElement("path",{fill:at,d:Et,shapeRendering:"crispEdges"}),vt)});QRCodeSVG.displayName="QRCodeSVG";const QRCode=({text:et,width:o=256,height:tt=256})=>{const[rt,nt]=reactExports.useState(!1),ot=window.innerWidth<640,it=async()=>{await navigator.clipboard.writeText(et),nt(!0),setTimeout(()=>nt(!1),2e3)};return jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntimeExports.jsx(QRCodeSVG,{value:et,size:ot?Math.min(o*.8,window.innerWidth-64):Math.min(o,tt)}),jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2 w-full max-w-[300px]",children:[jsxRuntimeExports.jsx("input",{type:"text",value:et,readOnly:!0,className:"flex-1 px-3 py-2 text-xs sm:text-sm border rounded-md bg-muted truncate"}),jsxRuntimeExports.jsx(Button,{variant:"outline",size:"icon",onClick:it,className:"shrink-0",children:rt?jsxRuntimeExports.jsx(Check,{className:"h-4 w-4"}):jsxRuntimeExports.jsx(Copy,{className:"h-4 w-4"})})]})]})};var byteToHex=[];for(var i=0;i<256;++i)byteToHex.push((i+256).toString(16).slice(1));function unsafeStringify(et,o=0){return(byteToHex[et[o+0]]+byteToHex[et[o+1]]+byteToHex[et[o+2]]+byteToHex[et[o+3]]+"-"+byteToHex[et[o+4]]+byteToHex[et[o+5]]+"-"+byteToHex[et[o+6]]+byteToHex[et[o+7]]+"-"+byteToHex[et[o+8]]+byteToHex[et[o+9]]+"-"+byteToHex[et[o+10]]+byteToHex[et[o+11]]+byteToHex[et[o+12]]+byteToHex[et[o+13]]+byteToHex[et[o+14]]+byteToHex[et[o+15]]).toLowerCase()}var getRandomValues,rnds8=new Uint8Array(16);function rng(){if(!getRandomValues&&(getRandomValues=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!getRandomValues))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return getRandomValues(rnds8)}var randomUUID=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const native={randomUUID};function v4(et,o,tt){if(native.randomUUID&&!o&&!et)return native.randomUUID();et=et||{};var rt=et.random||(et.rng||rng)();return rt[6]=rt[6]&15|64,rt[8]=rt[8]&63|128,unsafeStringify(rt)}var src={exports:{}},indexLight={exports:{}},indexMinimal={},minimal={},aspromise=asPromise$1;function asPromise$1(et,o){for(var tt=new Array(arguments.length-1),rt=0,nt=2,ot=!0;nt1&&st.charAt(at)==="=";)++ct;return Math.ceil(st.length*3)/4-ct};for(var tt=new Array(64),rt=new Array(123),nt=0;nt<64;)rt[tt[nt]=nt<26?nt+65:nt<52?nt+71:nt<62?nt-4:nt-59|43]=nt++;o.encode=function(st,at,ct){for(var lt=null,dt=[],ht=0,mt=0,ft;at>2],ft=(pt&3)<<4,mt=1;break;case 1:dt[ht++]=tt[ft|pt>>4],ft=(pt&15)<<2,mt=2;break;case 2:dt[ht++]=tt[ft|pt>>6],dt[ht++]=tt[pt&63],mt=0;break}ht>8191&&((lt||(lt=[])).push(String.fromCharCode.apply(String,dt)),ht=0)}return mt&&(dt[ht++]=tt[ft],dt[ht++]=61,mt===1&&(dt[ht++]=61)),lt?(ht&<.push(String.fromCharCode.apply(String,dt.slice(0,ht))),lt.join("")):String.fromCharCode.apply(String,dt.slice(0,ht))};var ot="invalid encoding";o.decode=function(st,at,ct){for(var lt=ct,dt=0,ht,mt=0;mt1)break;if((ft=rt[ft])===void 0)throw Error(ot);switch(dt){case 0:ht=ft,dt=1;break;case 1:at[ct++]=ht<<2|(ft&48)>>4,ht=ft,dt=2;break;case 2:at[ct++]=(ht&15)<<4|(ft&60)>>2,ht=ft,dt=3;break;case 3:at[ct++]=(ht&3)<<6|ft,dt=0;break}}if(dt===1)throw Error(ot);return ct-lt},o.test=function(st){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(st)}})(base64$1);var eventemitter=EventEmitter;function EventEmitter(){this._listeners={}}EventEmitter.prototype.on=function(o,tt,rt){return(this._listeners[o]||(this._listeners[o]=[])).push({fn:tt,ctx:rt||this}),this};EventEmitter.prototype.off=function(o,tt){if(o===void 0)this._listeners={};else if(tt===void 0)this._listeners[o]=[];else for(var rt=this._listeners[o],nt=0;nt0?0:2147483648,ot,it);else if(isNaN(nt))rt(2143289344,ot,it);else if(nt>34028234663852886e22)rt((st<<31|2139095040)>>>0,ot,it);else if(nt<11754943508222875e-54)rt((st<<31|Math.round(nt/1401298464324817e-60))>>>0,ot,it);else{var at=Math.floor(Math.log(nt)/Math.LN2),ct=Math.round(nt*Math.pow(2,-at)*8388608)&8388607;rt((st<<31|at+127<<23|ct)>>>0,ot,it)}}et.writeFloatLE=o.bind(null,writeUintLE),et.writeFloatBE=o.bind(null,writeUintBE);function tt(rt,nt,ot){var it=rt(nt,ot),st=(it>>31)*2+1,at=it>>>23&255,ct=it&8388607;return at===255?ct?NaN:st*(1/0):at===0?st*1401298464324817e-60*ct:st*Math.pow(2,at-150)*(ct+8388608)}et.readFloatLE=tt.bind(null,readUintLE),et.readFloatBE=tt.bind(null,readUintBE)}(),typeof Float64Array<"u"?function(){var o=new Float64Array([-0]),tt=new Uint8Array(o.buffer),rt=tt[7]===128;function nt(at,ct,lt){o[0]=at,ct[lt]=tt[0],ct[lt+1]=tt[1],ct[lt+2]=tt[2],ct[lt+3]=tt[3],ct[lt+4]=tt[4],ct[lt+5]=tt[5],ct[lt+6]=tt[6],ct[lt+7]=tt[7]}function ot(at,ct,lt){o[0]=at,ct[lt]=tt[7],ct[lt+1]=tt[6],ct[lt+2]=tt[5],ct[lt+3]=tt[4],ct[lt+4]=tt[3],ct[lt+5]=tt[2],ct[lt+6]=tt[1],ct[lt+7]=tt[0]}et.writeDoubleLE=rt?nt:ot,et.writeDoubleBE=rt?ot:nt;function it(at,ct){return tt[0]=at[ct],tt[1]=at[ct+1],tt[2]=at[ct+2],tt[3]=at[ct+3],tt[4]=at[ct+4],tt[5]=at[ct+5],tt[6]=at[ct+6],tt[7]=at[ct+7],o[0]}function st(at,ct){return tt[7]=at[ct],tt[6]=at[ct+1],tt[5]=at[ct+2],tt[4]=at[ct+3],tt[3]=at[ct+4],tt[2]=at[ct+5],tt[1]=at[ct+6],tt[0]=at[ct+7],o[0]}et.readDoubleLE=rt?it:st,et.readDoubleBE=rt?st:it}():function(){function o(rt,nt,ot,it,st,at){var ct=it<0?1:0;if(ct&&(it=-it),it===0)rt(0,st,at+nt),rt(1/it>0?0:2147483648,st,at+ot);else if(isNaN(it))rt(0,st,at+nt),rt(2146959360,st,at+ot);else if(it>17976931348623157e292)rt(0,st,at+nt),rt((ct<<31|2146435072)>>>0,st,at+ot);else{var lt;if(it<22250738585072014e-324)lt=it/5e-324,rt(lt>>>0,st,at+nt),rt((ct<<31|lt/4294967296)>>>0,st,at+ot);else{var dt=Math.floor(Math.log(it)/Math.LN2);dt===1024&&(dt=1023),lt=it*Math.pow(2,-dt),rt(lt*4503599627370496>>>0,st,at+nt),rt((ct<<31|dt+1023<<20|lt*1048576&1048575)>>>0,st,at+ot)}}}et.writeDoubleLE=o.bind(null,writeUintLE,0,4),et.writeDoubleBE=o.bind(null,writeUintBE,4,0);function tt(rt,nt,ot,it,st){var at=rt(it,st+nt),ct=rt(it,st+ot),lt=(ct>>31)*2+1,dt=ct>>>20&2047,ht=4294967296*(ct&1048575)+at;return dt===2047?ht?NaN:lt*(1/0):dt===0?lt*5e-324*ht:lt*Math.pow(2,dt-1075)*(ht+4503599627370496)}et.readDoubleLE=tt.bind(null,readUintLE,0,4),et.readDoubleBE=tt.bind(null,readUintBE,4,0)}(),et}function writeUintLE(et,o,tt){o[tt]=et&255,o[tt+1]=et>>>8&255,o[tt+2]=et>>>16&255,o[tt+3]=et>>>24}function writeUintBE(et,o,tt){o[tt]=et>>>24,o[tt+1]=et>>>16&255,o[tt+2]=et>>>8&255,o[tt+3]=et&255}function readUintLE(et,o){return(et[o]|et[o+1]<<8|et[o+2]<<16|et[o+3]<<24)>>>0}function readUintBE(et,o){return(et[o]<<24|et[o+1]<<16|et[o+2]<<8|et[o+3])>>>0}var inquire_1=inquire$1;function inquire$1(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(et){}return null}var utf8$2={};(function(et){var o=et;o.length=function(rt){for(var nt=0,ot=0,it=0;it191&<<224?at[ct++]=(lt&31)<<6|rt[nt++]&63:lt>239&<<365?(lt=((lt&7)<<18|(rt[nt++]&63)<<12|(rt[nt++]&63)<<6|rt[nt++]&63)-65536,at[ct++]=55296+(lt>>10),at[ct++]=56320+(lt&1023)):at[ct++]=(lt&15)<<12|(rt[nt++]&63)<<6|rt[nt++]&63,ct>8191&&((st||(st=[])).push(String.fromCharCode.apply(String,at)),ct=0);return st?(ct&&st.push(String.fromCharCode.apply(String,at.slice(0,ct))),st.join("")):String.fromCharCode.apply(String,at.slice(0,ct))},o.write=function(rt,nt,ot){for(var it=ot,st,at,ct=0;ct>6|192,nt[ot++]=st&63|128):(st&64512)===55296&&((at=rt.charCodeAt(ct+1))&64512)===56320?(st=65536+((st&1023)<<10)+(at&1023),++ct,nt[ot++]=st>>18|240,nt[ot++]=st>>12&63|128,nt[ot++]=st>>6&63|128,nt[ot++]=st&63|128):(nt[ot++]=st>>12|224,nt[ot++]=st>>6&63|128,nt[ot++]=st&63|128);return ot-it}})(utf8$2);var pool_1=pool;function pool(et,o,tt){var rt=tt||8192,nt=rt>>>1,ot=null,it=rt;return function(at){if(at<1||at>nt)return et(at);it+at>rt&&(ot=et(rt),it=0);var ct=o.call(ot,it,it+=at);return it&7&&(it=(it|7)+1),ct}}var longbits,hasRequiredLongbits;function requireLongbits(){if(hasRequiredLongbits)return longbits;hasRequiredLongbits=1,longbits=o;var et=requireMinimal();function o(ot,it){this.lo=ot>>>0,this.hi=it>>>0}var tt=o.zero=new o(0,0);tt.toNumber=function(){return 0},tt.zzEncode=tt.zzDecode=function(){return this},tt.length=function(){return 1};var rt=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(it){if(it===0)return tt;var st=it<0;st&&(it=-it);var at=it>>>0,ct=(it-at)/4294967296>>>0;return st&&(ct=~ct>>>0,at=~at>>>0,++at>4294967295&&(at=0,++ct>4294967295&&(ct=0))),new o(at,ct)},o.from=function(it){if(typeof it=="number")return o.fromNumber(it);if(et.isString(it))if(et.Long)it=et.Long.fromString(it);else return o.fromNumber(parseInt(it,10));return it.low||it.high?new o(it.low>>>0,it.high>>>0):tt},o.prototype.toNumber=function(it){if(!it&&this.hi>>>31){var st=~this.lo+1>>>0,at=~this.hi>>>0;return st||(at=at+1>>>0),-(st+at*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(it){return et.Long?new et.Long(this.lo|0,this.hi|0,!!it):{low:this.lo|0,high:this.hi|0,unsigned:!!it}};var nt=String.prototype.charCodeAt;return o.fromHash=function(it){return it===rt?tt:new o((nt.call(it,0)|nt.call(it,1)<<8|nt.call(it,2)<<16|nt.call(it,3)<<24)>>>0,(nt.call(it,4)|nt.call(it,5)<<8|nt.call(it,6)<<16|nt.call(it,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var it=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^it)>>>0,this.lo=(this.lo<<1^it)>>>0,this},o.prototype.zzDecode=function(){var it=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^it)>>>0,this.hi=(this.hi>>>1^it)>>>0,this},o.prototype.length=function(){var it=this.lo,st=(this.lo>>>28|this.hi<<4)>>>0,at=this.hi>>>24;return at===0?st===0?it<16384?it<128?1:2:it<2097152?3:4:st<16384?st<128?5:6:st<2097152?7:8:at<128?9:10},longbits}var hasRequiredMinimal;function requireMinimal(){return hasRequiredMinimal||(hasRequiredMinimal=1,function(et){var o=et;o.asPromise=aspromise,o.base64=base64$1,o.EventEmitter=eventemitter,o.float=float,o.inquire=inquire_1,o.utf8=utf8$2,o.pool=pool_1,o.LongBits=requireLongbits(),o.isNode=!!(typeof globalThis<"u"&&globalThis&&globalThis.process&&globalThis.process.versions&&globalThis.process.versions.node),o.global=o.isNode&&globalThis||typeof window<"u"&&window||typeof self<"u"&&self||commonjsGlobal,o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isInteger=Number.isInteger||function(ot){return typeof ot=="number"&&isFinite(ot)&&Math.floor(ot)===ot},o.isString=function(ot){return typeof ot=="string"||ot instanceof String},o.isObject=function(ot){return ot&&typeof ot=="object"},o.isset=o.isSet=function(ot,it){var st=ot[it];return st!=null&&ot.hasOwnProperty(it)?typeof st!="object"||(Array.isArray(st)?st.length:Object.keys(st).length)>0:!1},o.Buffer=function(){try{var nt=o.inquire("buffer").Buffer;return nt.prototype.utf8Write?nt:null}catch{return null}}(),o._Buffer_from=null,o._Buffer_allocUnsafe=null,o.newBuffer=function(ot){return typeof ot=="number"?o.Buffer?o._Buffer_allocUnsafe(ot):new o.Array(ot):o.Buffer?o._Buffer_from(ot):typeof Uint8Array>"u"?ot:new Uint8Array(ot)},o.Array=typeof Uint8Array<"u"?Uint8Array:Array,o.Long=o.global.dcodeIO&&o.global.dcodeIO.Long||o.global.Long||o.inquire("long"),o.key2Re=/^true|false|0|1$/,o.key32Re=/^-?(?:0|[1-9][0-9]*)$/,o.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,o.longToHash=function(ot){return ot?o.LongBits.from(ot).toHash():o.LongBits.zeroHash},o.longFromHash=function(ot,it){var st=o.LongBits.fromHash(ot);return o.Long?o.Long.fromBits(st.lo,st.hi,it):st.toNumber(!!it)};function tt(nt,ot,it){for(var st=Object.keys(ot),at=0;at-1;--ct)if(it[at[ct]]===1&&this[at[ct]]!==void 0&&this[at[ct]]!==null)return at[ct]}},o.oneOfSetter=function(ot){return function(it){for(var st=0;st127;)o[tt++]=et&127|128,et>>>=7;o[tt]=et}function VarintOp(et,o){this.len=et,this.next=void 0,this.val=o}VarintOp.prototype=Object.create(Op.prototype);VarintOp.prototype.fn=writeVarint32;Writer$1.prototype.uint32=function et(o){return this.len+=(this.tail=this.tail.next=new VarintOp((o=o>>>0)<128?1:o<16384?2:o<2097152?3:o<268435456?4:5,o)).len,this};Writer$1.prototype.int32=function et(o){return o<0?this._push(writeVarint64,10,LongBits$1.fromNumber(o)):this.uint32(o)};Writer$1.prototype.sint32=function et(o){return this.uint32((o<<1^o>>31)>>>0)};function writeVarint64(et,o,tt){for(;et.hi;)o[tt++]=et.lo&127|128,et.lo=(et.lo>>>7|et.hi<<25)>>>0,et.hi>>>=7;for(;et.lo>127;)o[tt++]=et.lo&127|128,et.lo=et.lo>>>7;o[tt++]=et.lo}Writer$1.prototype.uint64=function et(o){var tt=LongBits$1.from(o);return this._push(writeVarint64,tt.length(),tt)};Writer$1.prototype.int64=Writer$1.prototype.uint64;Writer$1.prototype.sint64=function et(o){var tt=LongBits$1.from(o).zzEncode();return this._push(writeVarint64,tt.length(),tt)};Writer$1.prototype.bool=function et(o){return this._push(writeByte,1,o?1:0)};function writeFixed32(et,o,tt){o[tt]=et&255,o[tt+1]=et>>>8&255,o[tt+2]=et>>>16&255,o[tt+3]=et>>>24}Writer$1.prototype.fixed32=function et(o){return this._push(writeFixed32,4,o>>>0)};Writer$1.prototype.sfixed32=Writer$1.prototype.fixed32;Writer$1.prototype.fixed64=function et(o){var tt=LongBits$1.from(o);return this._push(writeFixed32,4,tt.lo)._push(writeFixed32,4,tt.hi)};Writer$1.prototype.sfixed64=Writer$1.prototype.fixed64;Writer$1.prototype.float=function et(o){return this._push(util$7.float.writeFloatLE,4,o)};Writer$1.prototype.double=function et(o){return this._push(util$7.float.writeDoubleLE,8,o)};var writeBytes=util$7.Array.prototype.set?function et(o,tt,rt){tt.set(o,rt)}:function et(o,tt,rt){for(var nt=0;nt>>0;if(!tt)return this._push(writeByte,1,0);if(util$7.isString(o)){var rt=Writer$1.alloc(tt=base64.length(o));base64.decode(o,rt,0),o=rt}return this.uint32(tt)._push(writeBytes,tt,o)};Writer$1.prototype.string=function et(o){var tt=utf8$1.length(o);return tt?this.uint32(tt)._push(utf8$1.write,tt,o):this._push(writeByte,1,0)};Writer$1.prototype.fork=function et(){return this.states=new State(this),this.head=this.tail=new Op(noop,0,0),this.len=0,this};Writer$1.prototype.reset=function et(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Op(noop,0,0),this.len=0),this};Writer$1.prototype.ldelim=function et(){var o=this.head,tt=this.tail,rt=this.len;return this.reset().uint32(rt),rt&&(this.tail.next=o.next,this.tail=tt,this.len+=rt),this};Writer$1.prototype.finish=function et(){for(var o=this.head.next,tt=this.constructor.alloc(this.len),rt=0;o;)o.fn(o.val,tt,rt),rt+=o.len,o=o.next;return tt};Writer$1._configure=function(et){BufferWriter$1=et,Writer$1.create=create$2(),BufferWriter$1._configure()};var writer_buffer=BufferWriter,Writer=writer;(BufferWriter.prototype=Object.create(Writer.prototype)).constructor=BufferWriter;var util$6=requireMinimal();function BufferWriter(){Writer.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=util$6._Buffer_allocUnsafe,BufferWriter.writeBytesBuffer=util$6.Buffer&&util$6.Buffer.prototype instanceof Uint8Array&&util$6.Buffer.prototype.set.name==="set"?function(o,tt,rt){tt.set(o,rt)}:function(o,tt,rt){if(o.copy)o.copy(tt,rt,0,o.length);else for(var nt=0;nt>>0;return this.uint32(tt),tt&&this._push(BufferWriter.writeBytesBuffer,tt,o),this};function writeStringBuffer(et,o,tt){et.length<40?util$6.utf8.write(et,o,tt):o.utf8Write?o.utf8Write(et,tt):o.write(et,tt)}BufferWriter.prototype.string=function et(o){var tt=util$6.Buffer.byteLength(o);return this.uint32(tt),tt&&this._push(writeStringBuffer,tt,o),this};BufferWriter._configure();var reader=Reader$1,util$5=requireMinimal(),BufferReader$1,LongBits=util$5.LongBits,utf8=util$5.utf8;function indexOutOfRange(et,o){return RangeError("index out of range: "+et.pos+" + "+(o||1)+" > "+et.len)}function Reader$1(et){this.buf=et,this.pos=0,this.len=et.length}var create_array=typeof Uint8Array<"u"?function et(o){if(o instanceof Uint8Array||Array.isArray(o))return new Reader$1(o);throw Error("illegal buffer")}:function et(o){if(Array.isArray(o))return new Reader$1(o);throw Error("illegal buffer")},create$1=function et(){return util$5.Buffer?function(tt){return(Reader$1.create=function(nt){return util$5.Buffer.isBuffer(nt)?new BufferReader$1(nt):create_array(nt)})(tt)}:create_array};Reader$1.create=create$1();Reader$1.prototype._slice=util$5.Array.prototype.subarray||util$5.Array.prototype.slice;Reader$1.prototype.uint32=function et(){var o=4294967295;return function(){if(o=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(o=(o|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(o=(o|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return o;if((this.pos+=5)>this.len)throw this.pos=this.len,indexOutOfRange(this,10);return o}}();Reader$1.prototype.int32=function et(){return this.uint32()|0};Reader$1.prototype.sint32=function et(){var o=this.uint32();return o>>>1^-(o&1)|0};function readLongVarint(){var et=new LongBits(0,0),o=0;if(this.len-this.pos>4){for(;o<4;++o)if(et.lo=(et.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return et;if(et.lo=(et.lo|(this.buf[this.pos]&127)<<28)>>>0,et.hi=(et.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return et;o=0}else{for(;o<3;++o){if(this.pos>=this.len)throw indexOutOfRange(this);if(et.lo=(et.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return et}return et.lo=(et.lo|(this.buf[this.pos++]&127)<>>0,et}if(this.len-this.pos>4){for(;o<5;++o)if(et.hi=(et.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return et}else for(;o<5;++o){if(this.pos>=this.len)throw indexOutOfRange(this);if(et.hi=(et.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return et}throw Error("invalid varint encoding")}Reader$1.prototype.bool=function et(){return this.uint32()!==0};function readFixed32_end(et,o){return(et[o-4]|et[o-3]<<8|et[o-2]<<16|et[o-1]<<24)>>>0}Reader$1.prototype.fixed32=function et(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)};Reader$1.prototype.sfixed32=function et(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)|0};function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new LongBits(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}Reader$1.prototype.float=function et(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var o=util$5.float.readFloatLE(this.buf,this.pos);return this.pos+=4,o};Reader$1.prototype.double=function et(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var o=util$5.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,o};Reader$1.prototype.bytes=function et(){var o=this.uint32(),tt=this.pos,rt=this.pos+o;if(rt>this.len)throw indexOutOfRange(this,o);if(this.pos+=o,Array.isArray(this.buf))return this.buf.slice(tt,rt);if(tt===rt){var nt=util$5.Buffer;return nt?nt.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,tt,rt)};Reader$1.prototype.string=function et(){var o=this.bytes();return utf8.read(o,0,o.length)};Reader$1.prototype.skip=function et(o){if(typeof o=="number"){if(this.pos+o>this.len)throw indexOutOfRange(this,o);this.pos+=o}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(this.buf[this.pos++]&128);return this};Reader$1.prototype.skipType=function(et){switch(et){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(et=this.uint32()&7)!==4;)this.skipType(et);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+et+" at offset "+this.pos)}return this};Reader$1._configure=function(et){BufferReader$1=et,Reader$1.create=create$1(),BufferReader$1._configure();var o=util$5.Long?"toLong":"toNumber";util$5.merge(Reader$1.prototype,{int64:function(){return readLongVarint.call(this)[o](!1)},uint64:function(){return readLongVarint.call(this)[o](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[o](!1)},fixed64:function(){return readFixed64.call(this)[o](!0)},sfixed64:function(){return readFixed64.call(this)[o](!1)}})};var reader_buffer=BufferReader,Reader=reader;(BufferReader.prototype=Object.create(Reader.prototype)).constructor=BufferReader;var util$4=requireMinimal();function BufferReader(et){Reader.call(this,et)}BufferReader._configure=function(){util$4.Buffer&&(BufferReader.prototype._slice=util$4.Buffer.prototype.slice)};BufferReader.prototype.string=function et(){var o=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+o,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+o,this.len))};BufferReader._configure();var rpc={},service$1=Service$1,util$3=requireMinimal();(Service$1.prototype=Object.create(util$3.EventEmitter.prototype)).constructor=Service$1;function Service$1(et,o,tt){if(typeof et!="function")throw TypeError("rpcImpl must be a function");util$3.EventEmitter.call(this),this.rpcImpl=et,this.requestDelimited=!!o,this.responseDelimited=!!tt}Service$1.prototype.rpcCall=function et(o,tt,rt,nt,ot){if(!nt)throw TypeError("request must be specified");var it=this;if(!ot)return util$3.asPromise(et,it,o,tt,rt,nt);if(!it.rpcImpl){setTimeout(function(){ot(Error("already ended"))},0);return}try{return it.rpcImpl(o,tt[it.requestDelimited?"encodeDelimited":"encode"](nt).finish(),function(at,ct){if(at)return it.emit("error",at,o),ot(at);if(ct===null){it.end(!0);return}if(!(ct instanceof rt))try{ct=rt[it.responseDelimited?"decodeDelimited":"decode"](ct)}catch(lt){return it.emit("error",lt,o),ot(lt)}return it.emit("data",ct,o),ot(null,ct)})}catch(st){it.emit("error",st,o),setTimeout(function(){ot(st)},0);return}};Service$1.prototype.end=function et(o){return this.rpcImpl&&(o||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};(function(et){var o=et;o.Service=service$1})(rpc);var roots={};(function(et){var o=et;o.build="minimal",o.Writer=writer,o.BufferWriter=writer_buffer,o.Reader=reader,o.BufferReader=reader_buffer,o.util=requireMinimal(),o.rpc=rpc,o.roots=roots,o.configure=tt;function tt(){o.util._configure(),o.Writer._configure(o.BufferWriter),o.Reader._configure(o.BufferReader)}tt()})(indexMinimal);var util$2={exports:{}},codegen_1=codegen;function codegen(et,o){typeof et=="string"&&(o=et,et=void 0);var tt=[];function rt(ot){if(typeof ot!="string"){var it=nt();if(codegen.verbose&&console.log("codegen: "+it),it="return "+it,ot){for(var st=Object.keys(ot),at=new Array(st.length+1),ct=new Array(st.length),lt=0;lt0&&it[ct-1]!==".."?it.splice(--ct,2):st?it.splice(ct,1):++ct:it[ct]==="."?it.splice(ct,1):++ct;return at+it.join("/")};o.resolve=function(ot,it,st){return st||(it=rt(it)),tt(it)?it:(st||(ot=rt(ot)),(ot=ot.replace(/(?:\/|^)[^/]+$/,"")).length?rt(ot+"/"+it):it)}})(path);var types$2={},hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,function(et){var o=et,tt=requireUtil(),rt=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function nt(ot,it){var st=0,at={};for(it|=0;st-1&&this.oneof.splice(st,1),it.partOf=null,this},rt.prototype.onAdd=function(it){et.prototype.onAdd.call(this,it);for(var st=this,at=0;atht)return!0}return!1},at.isReservedName=function(dt,ht){if(dt){for(var mt=0;mt0;){var ft=dt.shift();if(mt.nested&&mt.nested[ft]){if(mt=mt.nested[ft],!(mt instanceof at))throw Error("path conflicts with non-namespace objects")}else mt.add(mt=new at(ft))}return ht&&mt.addJSON(ht),mt},at.prototype.resolveAll=function(){for(var dt=this.nestedArray,ht=0;ht-1)return ft}else if(ft instanceof at&&(ft=ft.lookup(dt.slice(1),ht,!0)))return ft}else for(var pt=0;pt>>3){");for(var st=0;st>>3){")("case 1: k=r.%s(); break",at.keyType)("case 2:"),o.basic[ct]===void 0?it("value=types[%i].decode(r,r.uint32())",st):it("value=r.%s()",ct),it("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),o.long[at.keyType]!==void 0?it('%s[typeof k==="object"?util.longToHash(k):k]=value',lt):it("%s[k]=value",lt)):at.repeated?(it("if(!(%s&&%s.length))",lt,lt)("%s=[]",lt),o.packed[ct]!==void 0&&it("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos>>0",ct,ct);break;case"int32":case"sint32":case"sfixed32":it("m%s=d%s|0",ct,ct);break;case"uint64":ft=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":it("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",ct,ct,ft)('else if(typeof d%s==="string")',ct)("m%s=parseInt(d%s,10)",ct,ct)('else if(typeof d%s==="number")',ct)("m%s=d%s",ct,ct)('else if(typeof d%s==="object")',ct)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",ct,ct,ct,ft?"true":"");break;case"bytes":it('if(typeof d%s==="string")',ct)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",ct,ct,ct)("else if(d%s.length >= 0)",ct)("m%s=d%s",ct,ct);break;case"string":it("m%s=String(d%s)",ct,ct);break;case"bool":it("m%s=Boolean(d%s)",ct,ct);break}}return it}o.fromObject=function(st){var at=st.fieldsArray,ct=rt.codegen(["d"],st.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!at.length)return ct("return new this.ctor");ct("var m=new this.ctor");for(var lt=0;lt>>0,m%s.high>>>0).toNumber(%s):m%s",ct,ct,ct,ct,lt?"true":"",ct);break;case"bytes":it("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",ct,ct,ct,ct,ct);break;default:it("d%s=m%s",ct,ct);break}}return it}o.toObject=function(st){var at=st.fieldsArray.slice().sort(rt.compareFieldsById);if(!at.length)return rt.codegen()("return {}");for(var ct=rt.codegen(["m","o"],st.name+"$toObject")("if(!o)")("o={}")("var d={}"),lt=[],dt=[],ht=[],mt=0;mt-1){var Nt=kt.substring(It);if(Nt in st)return Nt}return null}function vt(kt,It){try{if(nt.isString(It)&&It.charAt(0)==="{"&&(It=JSON.parse(It)),!nt.isString(It))yt.setOptions(It.options).addJSON(It.nested);else{it.filename=kt;var Nt=it(It,yt,ft),Lt,Mt=0;if(Nt.imports)for(;Mt-1)){if(yt.files.push(kt),kt in st){gt?vt(kt,st[kt]):(++Ct,setTimeout(function(){--Ct,vt(kt,st[kt])}));return}if(gt){var Nt;try{Nt=nt.fs.readFileSync(kt).toString("utf8")}catch(Lt){It||bt(Lt);return}vt(kt,Nt)}else++Ct,yt.fetch(kt,function(Lt,Mt){if(--Ct,!!pt){if(Lt){It?Ct||bt(null,yt):bt(Lt);return}vt(kt,Mt)}})}}var Ct=0;nt.isString(mt)&&(mt=[mt]);for(var St=0,At;St-1&&this.deferred.splice(ft,1)}}else if(mt instanceof tt)lt.test(mt.name)&&delete mt.parent[mt.name];else if(mt instanceof et){for(var pt=0;pt0)mt[yt]=ht(mt[yt]||{},ft,pt);else{var gt=mt[yt];gt&&(pt=[].concat(gt).concat(pt)),mt[yt]=pt}return mt}if(typeof ct!="object")throw TypeError("dst must be an object");if(!lt)throw TypeError("path must be specified");return lt=lt.split("."),ht(ct,lt,dt)},Object.defineProperty(et,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(requireRoot()))}}),util$2.exports}var object,hasRequiredObject;function requireObject(){if(hasRequiredObject)return object;hasRequiredObject=1,object=tt,tt.className="ReflectionObject";var et=requireUtil(),o;function tt(rt,nt){if(!et.isString(rt))throw TypeError("name must be a string");if(nt&&!et.isObject(nt))throw TypeError("options must be an object");this.options=nt,this.parsedOptions=null,this.name=rt,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}return Object.defineProperties(tt.prototype,{root:{get:function(){for(var rt=this;rt.parent!==null;)rt=rt.parent;return rt}},fullName:{get:function(){for(var rt=[this.name],nt=this.parent;nt;)rt.unshift(nt.name),nt=nt.parent;return rt.join(".")}}}),tt.prototype.toJSON=function(){throw Error()},tt.prototype.onAdd=function(nt){this.parent&&this.parent!==nt&&this.parent.remove(this),this.parent=nt,this.resolved=!1;var ot=nt.root;ot instanceof o&&ot._handleAdd(this)},tt.prototype.onRemove=function(nt){var ot=nt.root;ot instanceof o&&ot._handleRemove(this),this.parent=null,this.resolved=!1},tt.prototype.resolve=function(){return this.resolved?this:(this.root instanceof o&&(this.resolved=!0),this)},tt.prototype.getOption=function(nt){if(this.options)return this.options[nt]},tt.prototype.setOption=function(nt,ot,it){return(!it||!this.options||this.options[nt]===void 0)&&((this.options||(this.options={}))[nt]=ot),this},tt.prototype.setParsedOption=function(nt,ot,it){this.parsedOptions||(this.parsedOptions=[]);var st=this.parsedOptions;if(it){var at=st.find(function(dt){return Object.prototype.hasOwnProperty.call(dt,nt)});if(at){var ct=at[nt];et.setProperty(ct,it,ot)}else at={},at[nt]=et.setProperty({},it,ot),st.push(at)}else{var lt={};lt[nt]=ot,st.push(lt)}return this},tt.prototype.setOptions=function(nt,ot){if(nt)for(var it=Object.keys(nt),st=0;st>>0,(it.id<<3|4)>>>0):ot("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",st,at,(it.id<<3|2)>>>0)}function nt(ot){for(var it=tt.codegen(["m","w"],ot.name+"$encode")("if(!w)")("w=Writer.create()"),st,at,ct=ot.fieldsArray.slice().sort(tt.compareFieldsById),st=0;st>>0,8|o.mapKey[lt.keyType],lt.keyType),mt===void 0?it("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",dt,at):it(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|mt,ht,at),it("}")("}")):lt.repeated?(it("if(%s!=null&&%s.length){",at,at),lt.packed&&o.packed[ht]!==void 0?it("w.uint32(%i).fork()",(lt.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",at)("w.%s(%s[i])",ht,at)("w.ldelim()"):(it("for(var i=0;i<%s.length;++i)",at),mt===void 0?rt(it,lt,dt,at+"[i]"):it("w.uint32(%i).%s(%s[i])",(lt.id<<3|mt)>>>0,ht,at)),it("}")):(lt.optional&&it("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",at,lt.name),mt===void 0?rt(it,lt,dt,at):it("w.uint32(%i).%s(%s)",(lt.id<<3|mt)>>>0,ht,at))}return it("return w")}return encoder_1}var protobuf$2=indexLight.exports=indexMinimal;protobuf$2.build="light";function load(et,o,tt){return typeof o=="function"?(tt=o,o=new protobuf$2.Root):o||(o=new protobuf$2.Root),o.load(et,tt)}protobuf$2.load=load;function loadSync(et,o){return o||(o=new protobuf$2.Root),o.loadSync(et)}protobuf$2.loadSync=loadSync;protobuf$2.encoder=requireEncoder();protobuf$2.decoder=requireDecoder();protobuf$2.verifier=requireVerifier();protobuf$2.converter=requireConverter();protobuf$2.ReflectionObject=requireObject();protobuf$2.Namespace=requireNamespace();protobuf$2.Root=requireRoot();protobuf$2.Enum=require_enum();protobuf$2.Type=requireType();protobuf$2.Field=requireField();protobuf$2.OneOf=requireOneof();protobuf$2.MapField=requireMapfield();protobuf$2.Service=requireService();protobuf$2.Method=requireMethod();protobuf$2.Message=message;protobuf$2.wrappers=wrappers;protobuf$2.types=requireTypes();protobuf$2.util=requireUtil();protobuf$2.ReflectionObject._configure(protobuf$2.Root);protobuf$2.Namespace._configure(protobuf$2.Type,protobuf$2.Service,protobuf$2.Enum);protobuf$2.Root._configure(protobuf$2.Type);protobuf$2.Field._configure(protobuf$2.Type);var indexLightExports=indexLight.exports,tokenize_1=tokenize$1,delimRe=/[\s{}=;:[\],'"()<>]/g,stringDoubleRe=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,stringSingleRe=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,setCommentRe=/^ *[*/]+ */,setCommentAltRe=/^\s*\*?\/*/,setCommentSplitRe=/\n/g,whitespaceRe=/\s/,unescapeRe=/\\(.?)/g,unescapeMap={0:"\0",r:"\r",n:` -`,t:" "};function unescape$1(et){return et.replace(unescapeRe,function(o,tt){switch(tt){case"\\":case"":return tt;default:return unescapeMap[tt]||""}})}tokenize$1.unescape=unescape$1;function tokenize$1(et,o){et=et.toString();var tt=0,rt=et.length,nt=1,ot=0,it={},st=[],at=null;function ct(vt){return Error("illegal "+vt+" (line "+nt+")")}function lt(){var vt=at==="'"?stringSingleRe:stringDoubleRe;vt.lastIndex=tt-1;var Et=vt.exec(et);if(!Et)throw ct("string");return tt=vt.lastIndex,yt(at),at=null,unescape$1(Et[1])}function dt(vt){return et.charAt(vt)}function ht(vt,Et,Ct){var St={type:et.charAt(vt++),lineEmpty:!1,leading:Ct},At;o?At=2:At=3;var kt=vt-At,It;do if(--kt<0||(It=et.charAt(kt))===` -`){St.lineEmpty=!0;break}while(It===" "||It===" ");for(var Nt=et.substring(vt,Et).split(setCommentSplitRe),Lt=0;Lt0)return st.shift();if(at)return lt();var vt,Et,Ct,St,At,kt=tt===0;do{if(tt===rt)return null;for(vt=!1;whitespaceRe.test(Ct=dt(tt));)if(Ct===` -`&&(kt=!0,++nt),++tt===rt)return null;if(dt(tt)==="/"){if(++tt===rt)throw ct("comment");if(dt(tt)==="/")if(o){if(St=tt,At=!1,mt(tt-1)){At=!0;do if(tt=ft(tt),tt===rt||(tt++,!kt))break;while(mt(tt))}else tt=Math.min(rt,ft(tt)+1);At&&(ht(St,tt,kt),kt=!0),nt++,vt=!0}else{for(At=dt(St=tt+1)==="/";dt(++tt)!==` -`;)if(tt===rt)return null;++tt,At&&(ht(St,tt-1,kt),kt=!0),++nt,vt=!0}else if((Ct=dt(tt))==="*"){St=tt+1,At=o||dt(St)==="*";do{if(Ct===` -`&&++nt,++tt===rt)throw ct("comment");Et=Ct,Ct=dt(tt)}while(Et!=="*"||Ct!=="/");++tt,At&&(ht(St,tt-2,kt),kt=!0),vt=!0}else return"/"}}while(vt);var It=tt;delimRe.lastIndex=0;var Nt=delimRe.test(dt(It++));if(!Nt)for(;It");var Bt=ot();if(!nameRe$1.test(Bt))throw bt(Bt,"name");at("=");var Vt=new MapField(gt(Bt),St(ot()),tr,_t);Lt(Vt,function(ar){if(ar==="option")Pt(Vt,ar),at(";");else throw bt(ar)},function(){Gt(Vt)}),Jt.add(Vt)}function Wt(Jt,tr){if(!nameRe$1.test(tr=ot()))throw bt(tr,"name");var _t=new OneOf(gt(tr));Lt(_t,function(Vt){Vt==="option"?(Pt(_t,Vt),at(";")):(it(Vt),zt(_t,"optional"))}),Jt.add(_t)}function Ft(Jt,tr){if(!nameRe$1.test(tr=ot()))throw bt(tr,"name");var _t=new Enum(tr);Lt(_t,function(Vt){switch(Vt){case"option":Pt(_t,Vt),at(";");break;case"reserved":Et(_t.reserved||(_t.reserved=[]),!0);break;default:qt(_t,Vt)}}),Jt.add(_t)}function qt(Jt,tr){if(!nameRe$1.test(tr))throw bt(tr,"name");at("=");var _t=St(ot(),!0),Bt={options:void 0};Bt.setOption=function(Vt,er){this.options===void 0&&(this.options={}),this.options[Vt]=er},Lt(Bt,function(er){if(er==="option")Pt(Bt,er),at(";");else throw bt(er)},function(){Gt(Bt)}),Jt.add(tr,_t,Bt.comment,Bt.options)}function Pt(Jt,tr){var _t=at("(",!0);if(!typeRefRe.test(tr=ot()))throw bt(tr,"name");var Bt=tr,Vt=Bt,er;_t&&(at(")"),Bt="("+Bt+")",Vt=Bt,tr=st(),fqTypeRefRe.test(tr)&&(er=tr.slice(1),Bt+=tr,ot())),at("=");var ar=Yt(Jt,Bt);jt(Jt,Vt,ar,er)}function Yt(Jt,tr){if(at("{",!0)){for(var _t={};!at("}",!0);){if(!nameRe$1.test(Zt=ot()))throw bt(Zt,"name");if(Zt===null)throw bt(Zt,"end of input");var Bt,Vt=Zt;if(at(":",!0),st()==="{")Bt=Yt(Jt,tr+"."+Zt);else if(st()==="["){Bt=[];var er;if(at("[",!0)){do er=vt(),Bt.push(er);while(at(",",!0));at("]"),typeof er<"u"&&Qt(Jt,tr+"."+Zt,er)}}else Bt=vt(),Qt(Jt,tr+"."+Zt,Bt);var ar=_t[Vt];ar&&(Bt=[].concat(ar).concat(Bt)),_t[Vt]=Bt,at(",",!0),at(";",!0)}return _t}var ur=vt();return Qt(Jt,tr,ur),ur}function Qt(Jt,tr,_t){Jt.setOption&&Jt.setOption(tr,_t)}function jt(Jt,tr,_t,Bt){Jt.setParsedOption&&Jt.setParsedOption(tr,_t,Bt)}function Gt(Jt){if(at("[",!0)){do Pt(Jt,"option");while(at(",",!0));at("]")}return Jt}function rr(Jt,tr){if(!nameRe$1.test(tr=ot()))throw bt(tr,"service name");var _t=new Service(tr);Lt(_t,function(Vt){if(!Nt(_t,Vt))if(Vt==="rpc")Ht(_t,Vt);else throw bt(Vt)}),Jt.add(_t)}function Ht(Jt,tr){var _t=ct(),Bt=tr;if(!nameRe$1.test(tr=ot()))throw bt(tr,"name");var Vt=tr,er,ar,ur,cr;if(at("("),at("stream",!0)&&(ar=!0),!typeRefRe.test(tr=ot())||(er=tr,at(")"),at("returns"),at("("),at("stream",!0)&&(cr=!0),!typeRefRe.test(tr=ot())))throw bt(tr);ur=tr,at(")");var hr=new Method(Vt,Bt,er,ur,ar,cr);hr.comment=_t,Lt(hr,function(pr){if(pr==="option")Pt(hr,pr),at(";");else throw bt(pr)}),Jt.add(hr)}function dr(Jt,tr){if(!typeRefRe.test(tr=ot()))throw bt(tr,"reference");var _t=tr;Lt(null,function(Vt){switch(Vt){case"required":case"repeated":zt(Jt,Vt,_t);break;case"optional":pt?zt(Jt,"proto3_optional",_t):zt(Jt,"optional",_t);break;default:if(!pt||!typeRefRe.test(Vt))throw bt(Vt);it(Vt),zt(Jt,"optional",_t);break}})}for(var Zt;(Zt=ot())!==null;)switch(Zt){case"package":if(!lt)throw bt(Zt);At();break;case"import":if(!lt)throw bt(Zt);kt();break;case"syntax":if(!lt)throw bt(Zt);It();break;case"option":Pt(yt,Zt),at(";");break;default:if(Nt(yt,Zt)){lt=!1;continue}throw bt(Zt)}return parse$1.filename=null,{package:dt,imports:ht,weakImports:mt,syntax:ft,root:o}}var common_1=common,commonRe=/\/|\./;function common(et,o){commonRe.test(et)||(et="google/protobuf/"+et+".proto",o={nested:{google:{nested:{protobuf:{nested:o}}}}}),common[et]=o}common("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var timeType;common("duration",{Duration:timeType={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});common("timestamp",{Timestamp:timeType});common("empty",{Empty:{fields:{}}});common("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});common("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});common("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});common.get=function et(o){return common[o]||null};var protobuf$1=src.exports=indexLightExports;protobuf$1.build="full";protobuf$1.tokenize=tokenize_1;protobuf$1.parse=parse_1;protobuf$1.common=common_1;protobuf$1.Root._configure(protobuf$1.Type,protobuf$1.parse,protobuf$1.common);var srcExports=src.exports,protobufjs=srcExports;const protobuf=getDefaultExportFromCjs(protobufjs),contentTopic="/buddybook-dogfood/1/chain/proto",encoder=createEncoder({contentTopic,ephemeral:!1}),decoder=createDecoder(contentTopic),block=new protobuf.Type("block").add(new protobuf.Field("chainUUID",1,"string")).add(new protobuf.Field("blockUUID",2,"string")).add(new protobuf.Field("title",3,"string")).add(new protobuf.Field("description",4,"string")).add(new protobuf.Field("signedMessage",5,"string")).add(new protobuf.Field("timestamp",6,"uint64")).add(new protobuf.Field("signatures",7,"string","repeated")).add(new protobuf.Field("parentBlockUUID",8,"string"));function createMessage({chainUUID:et,blockUUID:o,title:tt,description:rt,signedMessage:nt,timestamp:ot,signatures:it,parentBlockUUID:st}){const at=block.create({chainUUID:et,blockUUID:o,title:tt,description:rt,signedMessage:nt,timestamp:ot,signatures:it.map(lt=>JSON.stringify(lt)),parentBlockUUID:st});return{payload:block.encode(at).finish()}}async function*getMessagesFromStore(et){console.time("getMessagesFromStore");for await(const o of et.store.queryGenerator([decoder])){const tt=await Promise.all(o);for(const rt of tt){if(console.log(rt),!(rt!=null&&rt.payload))continue;const nt=block.decode(rt.payload);nt.signatures=nt.signatures.map(ot=>JSON.parse(ot)),yield nt}}console.timeEnd("getMessagesFromStore")}async function subscribeToFilter(et,o){const{error:tt,subscription:rt,results:nt}=await et.filter.subscribe([decoder],ot=>{if(console.log("message received from filter",ot),ot.payload){const it=block.decode(ot.payload);it.signatures=it.signatures.map(st=>JSON.parse(st)),o(it)}},{forceUseAllPeers:!0});if(console.log("results",nt),tt&&console.log("Error subscribing to filter",tt),!rt||tt||nt.successes.length===0||nt.failures.length>0)throw new Error("Failed to subscribe to filter")}function useWalletPrompt(){const{isConnected:et}=useAccount(),{connect:o,connectors:tt}=useConnect$1();return{ensureWalletConnected:async()=>{if(!et)try{const nt=tt[0];return nt&&await o({connector:nt}),await new Promise(ot=>setTimeout(ot,1e3)),!0}catch(nt){return console.error("Error connecting wallet:",nt),!1}return!0}}}const DEFAULT_FORM_DATA={title:"Devcon24 DeFi Dynamo",description:"A revolutionary blockchain for Devcon 24, focusing on scalable DeFi solutions and cross-chain interoperability.",uuid:v4()},ChainCreationForm=()=>{const[et,o]=reactExports.useState(DEFAULT_FORM_DATA),[tt,rt]=reactExports.useState({}),[nt,ot]=reactExports.useState(!1),[it,st]=reactExports.useState(!1),[at,ct]=reactExports.useState(!1),[lt,dt]=reactExports.useState(null),[ht,mt]=reactExports.useState(null),[ft,pt]=reactExports.useState(null),{node:yt}=useWaku(),{address:gt}=useAccount(),{signMessage:bt}=useSignMessage({mutation:{async onSuccess(kt){if(!gt||!yt)return;mt(kt);const It=v4();pt(It);const Nt=createMessage({chainUUID:et.uuid,blockUUID:It,title:et.title,description:et.description,signedMessage:kt,timestamp:Date.now(),signatures:[{address:gt,signature:kt}],parentBlockUUID:null});await(yt==null?void 0:yt.lightPush.send(encoder,Nt)),ct(!0),st(!1)},onError(kt){console.error("Error signing message:",kt),st(!1),dt("Error signing message. Please try again.")}}}),{ensureWalletConnected:xt}=useWalletPrompt(),vt=kt=>{const{name:It,value:Nt}=kt.target;o(Lt=>({...Lt,[It]:Nt})),tt[It]&&rt(Lt=>({...Lt,[It]:void 0}))},Et=()=>{const kt={};return et.title.trim()||(kt.title="Title is required"),et.description.trim()||(kt.description="Description is required"),rt(kt),Object.keys(kt).length===0},Ct=kt=>{kt.preventDefault(),xt()&&Et()&&ot(!0)},St=async()=>{st(!0),dt(null);const kt=`Create Chain: - Chain UUID: ${et.uuid} - Title: ${et.title} - Description: ${et.description} - Timestamp: ${new Date().getTime()} - Signed by: ${gt}`;bt({message:kt})},At=()=>{ot(!1),ct(!1),st(!1),dt(null),pt(null)};return jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-2xl mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:"Create a New Chain"})}),jsxRuntimeExports.jsx(CardContent,{children:jsxRuntimeExports.jsxs("form",{onSubmit:Ct,className:"space-y-6",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx(Label,{htmlFor:"title",children:"Chain Title"}),jsxRuntimeExports.jsx(Input,{type:"text",id:"title",name:"title",value:et.title,onChange:vt,maxLength:50,className:"text-base sm:text-sm"}),tt.title&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:tt.title})]}),jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx(Label,{htmlFor:"description",children:"Chain Description"}),jsxRuntimeExports.jsx(Textarea,{id:"description",name:"description",value:et.description,onChange:vt,maxLength:500,className:"min-h-[100px] text-base sm:text-sm"}),tt.description&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:tt.description})]}),jsxRuntimeExports.jsx(Button,{type:"submit",className:"w-full py-6 text-base sm:py-2 sm:text-sm",children:"Create Chain"})]})}),jsxRuntimeExports.jsx(Dialog,{open:nt,onOpenChange:At,children:jsxRuntimeExports.jsxs(DialogContent,{className:"sm:max-w-md",children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsx(DialogTitle,{children:at?"Chain Created":"Chain Preview"})}),at?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:ht&&ft&&jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntimeExports.jsx(QRCode,{text:`${window.location.origin}/sign/${et.uuid}/${ft}`,width:200,height:200}),jsxRuntimeExports.jsx("p",{className:"text-sm text-center break-all",children:`${window.location.origin}/sign/${et.uuid}/${ft}`}),jsxRuntimeExports.jsx(Button,{onClick:()=>navigator.clipboard.writeText(`${window.location.origin}/sign/${et.uuid}/${ft}`),variant:"outline",children:"Copy Link"})]})})}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("h4",{className:"text-xl font-semibold",children:et.title}),jsxRuntimeExports.jsx("p",{className:"text-muted-foreground",children:et.description}),lt&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:lt})]}),jsxRuntimeExports.jsxs(DialogFooter,{className:"sm:justify-start",children:[jsxRuntimeExports.jsx(Button,{type:"button",variant:"secondary",onClick:At,children:"Edit"}),jsxRuntimeExports.jsx(Button,{type:"button",onClick:St,disabled:it,children:it?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing..."]}):"Sign"})]})]})]})})]})},SignChain=({block:et,chainsData:o,onSuccess:tt})=>{const[rt,nt]=reactExports.useState(!1),[ot,it]=reactExports.useState(!1),[st,at]=reactExports.useState(null),[ct,lt]=reactExports.useState(!1),{address:dt}=useAccount(),{data:ht}=useEnsName({address:dt}),{node:mt}=useWaku(),{ensureWalletConnected:ft}=useWalletPrompt();reactExports.useEffect(()=>{if(dt){const gt=xt=>{if(xt.signatures.some(Ct=>Ct.address.toLowerCase()===dt.toLowerCase()))return!0;const vt=o.find(Ct=>Ct.blockUUID===xt.parentBlockUUID);return vt&>(vt)?!0:o.filter(Ct=>Ct.parentBlockUUID===xt.blockUUID).some(Ct=>gt(Ct))},bt=gt(et);lt(bt)}},[dt,et,o]);const{signMessage:pt}=useSignMessage({mutation:{onMutate(){at(null),it(!0)},async onSuccess(gt){if(!(!dt||!mt))try{if(et.signatures.some(Ct=>Ct.address.toLowerCase()===dt.toLowerCase())){at("You have already signed this chain.");return}const bt={chainUUID:et.chainUUID,blockUUID:v4(),title:et.title,description:et.description,signedMessage:gt,timestamp:Date.now(),signatures:[{address:dt,signature:gt}],parentBlockUUID:et.blockUUID},xt=createMessage(bt),{failures:vt,successes:Et}=await mt.lightPush.send(encoder,xt);if(vt.length>0||Et.length===0)throw new Error("Failed to send message to Waku network");tt(bt),nt(!1)}catch(bt){console.error("Error creating new block:",bt),at("Failed to create new block. Please try again.")}},onError(gt){console.error("Error signing message:",gt),at("Error signing message. Please try again. If using a mobile wallet, please ensure your wallet app is open.")},onSettled(){it(!1)}}}),yt=async()=>{try{if(!dt&&!await ft())return;if(ct){at("You have already signed this chain.");return}const gt=`Sign Block: -Chain UUID: ${et.chainUUID} -Block UUID: ${et.blockUUID} -Title: ${et.title} -Description: ${et.description} -Timestamp: ${new Date().getTime()} -Parent Block UUID: ${et.parentBlockUUID} -Signed by: ${ht||dt}`;pt({message:gt})}catch(gt){console.error("Error in sign flow:",gt),at("Failed to initiate signing. Please try again."),it(!1)}};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button,{onClick:()=>nt(!0),disabled:ct,children:ct?"Already Signed":dt?"Sign Chain":"Connect Wallet"}),jsxRuntimeExports.jsx(Dialog,{open:rt,onOpenChange:nt,children:jsxRuntimeExports.jsxs(DialogContent,{className:"sm:max-w-md",children:[jsxRuntimeExports.jsxs(DialogHeader,{children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Sign Chain"}),jsxRuntimeExports.jsx(DialogDescription,{children:ct?"You have already signed this chain.":"Review the block details and sign to add your signature to the chain."})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-4",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-2",children:[jsxRuntimeExports.jsx("h4",{className:"font-medium",children:"Block Details"}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:et.title}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:et.description})]}),jsxRuntimeExports.jsx(QRCode,{text:`${window.location.origin}/sign/${et.chainUUID}/${et.blockUUID}`})]}),st&&jsxRuntimeExports.jsx("p",{className:"text-sm text-destructive",children:st}),jsxRuntimeExports.jsxs(DialogFooter,{children:[jsxRuntimeExports.jsx(Button,{variant:"secondary",onClick:()=>nt(!1),children:"Cancel"}),jsxRuntimeExports.jsx(Button,{onClick:yt,disabled:ot||ct,children:ot?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing..."]}):ct?"Already Signed":dt?"Sign":"Connect Wallet"})]})]})})]})},ChainList=({chainsData:et,onChainUpdate:o,isLoading:tt})=>{const rt=it=>{o(it)},nt=(it,st=0)=>{const at=et.filter(dt=>dt.parentBlockUUID===it.blockUUID),ct=it.signatures.length+at.reduce((dt,ht)=>dt+ht.signatures.length,0),lt=`${window.location.origin}/sign/${it.chainUUID??it.blockUUID}/${it.blockUUID}`;return jsxRuntimeExports.jsxs("li",{className:"mb-4",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-start",children:[jsxRuntimeExports.jsx("div",{className:"mr-4 mt-2",children:st>0&&jsxRuntimeExports.jsx("div",{className:"w-6 h-6 border-l-2 border-b-2 border-gray-300"})}),st===0?jsxRuntimeExports.jsxs(Card,{className:"flex-grow",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:it.title})}),jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsx("p",{children:it.description}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col space-y-2 mt-2",children:[jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:jsxRuntimeExports.jsx(SignerName,{address:it.signatures[0].address,prefix:"Created by"})}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-muted-foreground",children:["Created at: ",new Date(it.timestamp).toLocaleString()]}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-muted-foreground",children:["Total Signatures: ",ct]}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-muted-foreground",children:["Block UUID: ",it.blockUUID]})]}),jsxRuntimeExports.jsxs("div",{className:"mt-2 space-x-2",children:[jsxRuntimeExports.jsx(SignChain,{block:it,chainsData:et,onSuccess:rt}),jsxRuntimeExports.jsxs(Dialog,{children:[jsxRuntimeExports.jsx(DialogTrigger,{asChild:!0,children:jsxRuntimeExports.jsx(Button,{variant:"outline",children:"Share"})}),jsxRuntimeExports.jsxs(DialogContent,{className:"sm:max-w-md",children:[jsxRuntimeExports.jsxs(DialogHeader,{children:[jsxRuntimeExports.jsx(DialogTitle,{children:"Share this Chain"}),jsxRuntimeExports.jsx(DialogDescription,{children:"Share this chain with others to collect their signatures."})]}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-4",children:[jsxRuntimeExports.jsx(QRCode,{text:lt,width:200,height:200}),jsxRuntimeExports.jsx("p",{className:"text-sm text-center break-all",children:lt}),jsxRuntimeExports.jsx(Button,{onClick:()=>navigator.clipboard.writeText(lt),variant:"outline",children:"Copy Link"})]})]})]})]})]})]}):jsxRuntimeExports.jsx("div",{className:"flex-grow",children:jsxRuntimeExports.jsx("p",{className:"text-sm",children:jsxRuntimeExports.jsx(SignerName,{address:it.signatures[0].address,prefix:"Signed by"})})})]}),at.length>0&&jsxRuntimeExports.jsx("ul",{className:"ml-8 mt-2",children:at.map(dt=>nt(dt,st+1))})]},`${it.blockUUID}-${st}`)},ot=et.filter(it=>!it.parentBlockUUID);return jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-4xl mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsxs(CardTitle,{children:["Existing Chains",tt&&jsxRuntimeExports.jsxs("span",{className:"ml-2 inline-flex items-center text-muted-foreground text-sm font-normal",children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin mr-2"}),"Loading more chains..."]})]})}),jsxRuntimeExports.jsx(CardContent,{children:ot.length===0&&!tt?jsxRuntimeExports.jsx("p",{children:"No chains found."}):jsxRuntimeExports.jsx("ul",{className:"space-y-4",children:ot.map(it=>nt(it,0))})})]})},SignerName=({address:et,prefix:o})=>{const{data:tt}=useEnsName({address:et});return jsxRuntimeExports.jsxs("span",{className:"text-sm",children:[o&&`${o}: `,tt||`${et.slice(0,6)}...${et.slice(-4)}`]})};var DirectionContext=reactExports.createContext(void 0);function useDirection(et){const o=reactExports.useContext(DirectionContext);return et||o||"ltr"}function clamp(et,[o,tt]){return Math.min(tt,Math.max(o,et))}function useStateMachine(et,o){return reactExports.useReducer((tt,rt)=>o[tt][rt]??tt,et)}var SCROLL_AREA_NAME="ScrollArea",[createScrollAreaContext,createScrollAreaScope]=createContextScope(SCROLL_AREA_NAME),[ScrollAreaProvider,useScrollAreaContext]=createScrollAreaContext(SCROLL_AREA_NAME),ScrollArea$1=reactExports.forwardRef((et,o)=>{const{__scopeScrollArea:tt,type:rt="hover",dir:nt,scrollHideDelay:ot=600,...it}=et,[st,at]=reactExports.useState(null),[ct,lt]=reactExports.useState(null),[dt,ht]=reactExports.useState(null),[mt,ft]=reactExports.useState(null),[pt,yt]=reactExports.useState(null),[gt,bt]=reactExports.useState(0),[xt,vt]=reactExports.useState(0),[Et,Ct]=reactExports.useState(!1),[St,At]=reactExports.useState(!1),kt=useComposedRefs(o,Nt=>at(Nt)),It=useDirection(nt);return jsxRuntimeExports.jsx(ScrollAreaProvider,{scope:tt,type:rt,dir:It,scrollHideDelay:ot,scrollArea:st,viewport:ct,onViewportChange:lt,content:dt,onContentChange:ht,scrollbarX:mt,onScrollbarXChange:ft,scrollbarXEnabled:Et,onScrollbarXEnabledChange:Ct,scrollbarY:pt,onScrollbarYChange:yt,scrollbarYEnabled:St,onScrollbarYEnabledChange:At,onCornerWidthChange:bt,onCornerHeightChange:vt,children:jsxRuntimeExports.jsx(Primitive.div,{dir:It,...it,ref:kt,style:{position:"relative","--radix-scroll-area-corner-width":gt+"px","--radix-scroll-area-corner-height":xt+"px",...et.style}})})});ScrollArea$1.displayName=SCROLL_AREA_NAME;var VIEWPORT_NAME="ScrollAreaViewport",ScrollAreaViewport=reactExports.forwardRef((et,o)=>{const{__scopeScrollArea:tt,children:rt,asChild:nt,nonce:ot,...it}=et,st=useScrollAreaContext(VIEWPORT_NAME,tt),at=reactExports.useRef(null),ct=useComposedRefs(o,at,st.onViewportChange);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("style",{dangerouslySetInnerHTML:{__html:` -[data-radix-scroll-area-viewport] { - scrollbar-width: none; - -ms-overflow-style: none; - -webkit-overflow-scrolling: touch; -} -[data-radix-scroll-area-viewport]::-webkit-scrollbar { - display: none; -} -:where([data-radix-scroll-area-viewport]) { - display: flex; - flex-direction: column; - align-items: stretch; -} -:where([data-radix-scroll-area-content]) { - flex-grow: 1; -} -`},nonce:ot}),jsxRuntimeExports.jsx(Primitive.div,{"data-radix-scroll-area-viewport":"",...it,asChild:nt,ref:ct,style:{overflowX:st.scrollbarXEnabled?"scroll":"hidden",overflowY:st.scrollbarYEnabled?"scroll":"hidden",...et.style},children:getSubtree({asChild:nt,children:rt},lt=>jsxRuntimeExports.jsx("div",{"data-radix-scroll-area-content":"",ref:st.onContentChange,style:{minWidth:st.scrollbarXEnabled?"fit-content":void 0},children:lt}))})]})});ScrollAreaViewport.displayName=VIEWPORT_NAME;var SCROLLBAR_NAME="ScrollAreaScrollbar",ScrollAreaScrollbar=reactExports.forwardRef((et,o)=>{const{forceMount:tt,...rt}=et,nt=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),{onScrollbarXEnabledChange:ot,onScrollbarYEnabledChange:it}=nt,st=et.orientation==="horizontal";return reactExports.useEffect(()=>(st?ot(!0):it(!0),()=>{st?ot(!1):it(!1)}),[st,ot,it]),nt.type==="hover"?jsxRuntimeExports.jsx(ScrollAreaScrollbarHover,{...rt,ref:o,forceMount:tt}):nt.type==="scroll"?jsxRuntimeExports.jsx(ScrollAreaScrollbarScroll,{...rt,ref:o,forceMount:tt}):nt.type==="auto"?jsxRuntimeExports.jsx(ScrollAreaScrollbarAuto,{...rt,ref:o,forceMount:tt}):nt.type==="always"?jsxRuntimeExports.jsx(ScrollAreaScrollbarVisible,{...rt,ref:o}):null});ScrollAreaScrollbar.displayName=SCROLLBAR_NAME;var ScrollAreaScrollbarHover=reactExports.forwardRef((et,o)=>{const{forceMount:tt,...rt}=et,nt=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),[ot,it]=reactExports.useState(!1);return reactExports.useEffect(()=>{const st=nt.scrollArea;let at=0;if(st){const ct=()=>{window.clearTimeout(at),it(!0)},lt=()=>{at=window.setTimeout(()=>it(!1),nt.scrollHideDelay)};return st.addEventListener("pointerenter",ct),st.addEventListener("pointerleave",lt),()=>{window.clearTimeout(at),st.removeEventListener("pointerenter",ct),st.removeEventListener("pointerleave",lt)}}},[nt.scrollArea,nt.scrollHideDelay]),jsxRuntimeExports.jsx(Presence,{present:tt||ot,children:jsxRuntimeExports.jsx(ScrollAreaScrollbarAuto,{"data-state":ot?"visible":"hidden",...rt,ref:o})})}),ScrollAreaScrollbarScroll=reactExports.forwardRef((et,o)=>{const{forceMount:tt,...rt}=et,nt=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),ot=et.orientation==="horizontal",it=useDebounceCallback(()=>at("SCROLL_END"),100),[st,at]=useStateMachine("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return reactExports.useEffect(()=>{if(st==="idle"){const ct=window.setTimeout(()=>at("HIDE"),nt.scrollHideDelay);return()=>window.clearTimeout(ct)}},[st,nt.scrollHideDelay,at]),reactExports.useEffect(()=>{const ct=nt.viewport,lt=ot?"scrollLeft":"scrollTop";if(ct){let dt=ct[lt];const ht=()=>{const mt=ct[lt];dt!==mt&&(at("SCROLL"),it()),dt=mt};return ct.addEventListener("scroll",ht),()=>ct.removeEventListener("scroll",ht)}},[nt.viewport,ot,at,it]),jsxRuntimeExports.jsx(Presence,{present:tt||st!=="hidden",children:jsxRuntimeExports.jsx(ScrollAreaScrollbarVisible,{"data-state":st==="hidden"?"hidden":"visible",...rt,ref:o,onPointerEnter:composeEventHandlers(et.onPointerEnter,()=>at("POINTER_ENTER")),onPointerLeave:composeEventHandlers(et.onPointerLeave,()=>at("POINTER_LEAVE"))})})}),ScrollAreaScrollbarAuto=reactExports.forwardRef((et,o)=>{const tt=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),{forceMount:rt,...nt}=et,[ot,it]=reactExports.useState(!1),st=et.orientation==="horizontal",at=useDebounceCallback(()=>{if(tt.viewport){const ct=tt.viewport.offsetWidth{const{orientation:tt="vertical",...rt}=et,nt=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),ot=reactExports.useRef(null),it=reactExports.useRef(0),[st,at]=reactExports.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),ct=getThumbRatio(st.viewport,st.content),lt={...rt,sizes:st,onSizesChange:at,hasThumb:ct>0&&ct<1,onThumbChange:ht=>ot.current=ht,onThumbPointerUp:()=>it.current=0,onThumbPointerDown:ht=>it.current=ht};function dt(ht,mt){return getScrollPositionFromPointer(ht,it.current,st,mt)}return tt==="horizontal"?jsxRuntimeExports.jsx(ScrollAreaScrollbarX,{...lt,ref:o,onThumbPositionChange:()=>{if(nt.viewport&&ot.current){const ht=nt.viewport.scrollLeft,mt=getThumbOffsetFromScroll(ht,st,nt.dir);ot.current.style.transform=`translate3d(${mt}px, 0, 0)`}},onWheelScroll:ht=>{nt.viewport&&(nt.viewport.scrollLeft=ht)},onDragScroll:ht=>{nt.viewport&&(nt.viewport.scrollLeft=dt(ht,nt.dir))}}):tt==="vertical"?jsxRuntimeExports.jsx(ScrollAreaScrollbarY,{...lt,ref:o,onThumbPositionChange:()=>{if(nt.viewport&&ot.current){const ht=nt.viewport.scrollTop,mt=getThumbOffsetFromScroll(ht,st);ot.current.style.transform=`translate3d(0, ${mt}px, 0)`}},onWheelScroll:ht=>{nt.viewport&&(nt.viewport.scrollTop=ht)},onDragScroll:ht=>{nt.viewport&&(nt.viewport.scrollTop=dt(ht))}}):null}),ScrollAreaScrollbarX=reactExports.forwardRef((et,o)=>{const{sizes:tt,onSizesChange:rt,...nt}=et,ot=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),[it,st]=reactExports.useState(),at=reactExports.useRef(null),ct=useComposedRefs(o,at,ot.onScrollbarXChange);return reactExports.useEffect(()=>{at.current&&st(getComputedStyle(at.current))},[at]),jsxRuntimeExports.jsx(ScrollAreaScrollbarImpl,{"data-orientation":"horizontal",...nt,ref:ct,sizes:tt,style:{bottom:0,left:ot.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:ot.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":getThumbSize(tt)+"px",...et.style},onThumbPointerDown:lt=>et.onThumbPointerDown(lt.x),onDragScroll:lt=>et.onDragScroll(lt.x),onWheelScroll:(lt,dt)=>{if(ot.viewport){const ht=ot.viewport.scrollLeft+lt.deltaX;et.onWheelScroll(ht),isScrollingWithinScrollbarBounds(ht,dt)&<.preventDefault()}},onResize:()=>{at.current&&ot.viewport&&it&&rt({content:ot.viewport.scrollWidth,viewport:ot.viewport.offsetWidth,scrollbar:{size:at.current.clientWidth,paddingStart:toInt(it.paddingLeft),paddingEnd:toInt(it.paddingRight)}})}})}),ScrollAreaScrollbarY=reactExports.forwardRef((et,o)=>{const{sizes:tt,onSizesChange:rt,...nt}=et,ot=useScrollAreaContext(SCROLLBAR_NAME,et.__scopeScrollArea),[it,st]=reactExports.useState(),at=reactExports.useRef(null),ct=useComposedRefs(o,at,ot.onScrollbarYChange);return reactExports.useEffect(()=>{at.current&&st(getComputedStyle(at.current))},[at]),jsxRuntimeExports.jsx(ScrollAreaScrollbarImpl,{"data-orientation":"vertical",...nt,ref:ct,sizes:tt,style:{top:0,right:ot.dir==="ltr"?0:void 0,left:ot.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":getThumbSize(tt)+"px",...et.style},onThumbPointerDown:lt=>et.onThumbPointerDown(lt.y),onDragScroll:lt=>et.onDragScroll(lt.y),onWheelScroll:(lt,dt)=>{if(ot.viewport){const ht=ot.viewport.scrollTop+lt.deltaY;et.onWheelScroll(ht),isScrollingWithinScrollbarBounds(ht,dt)&<.preventDefault()}},onResize:()=>{at.current&&ot.viewport&&it&&rt({content:ot.viewport.scrollHeight,viewport:ot.viewport.offsetHeight,scrollbar:{size:at.current.clientHeight,paddingStart:toInt(it.paddingTop),paddingEnd:toInt(it.paddingBottom)}})}})}),[ScrollbarProvider,useScrollbarContext]=createScrollAreaContext(SCROLLBAR_NAME),ScrollAreaScrollbarImpl=reactExports.forwardRef((et,o)=>{const{__scopeScrollArea:tt,sizes:rt,hasThumb:nt,onThumbChange:ot,onThumbPointerUp:it,onThumbPointerDown:st,onThumbPositionChange:at,onDragScroll:ct,onWheelScroll:lt,onResize:dt,...ht}=et,mt=useScrollAreaContext(SCROLLBAR_NAME,tt),[ft,pt]=reactExports.useState(null),yt=useComposedRefs(o,kt=>pt(kt)),gt=reactExports.useRef(null),bt=reactExports.useRef(""),xt=mt.viewport,vt=rt.content-rt.viewport,Et=useCallbackRef$1(lt),Ct=useCallbackRef$1(at),St=useDebounceCallback(dt,10);function At(kt){if(gt.current){const It=kt.clientX-gt.current.left,Nt=kt.clientY-gt.current.top;ct({x:It,y:Nt})}}return reactExports.useEffect(()=>{const kt=It=>{const Nt=It.target;(ft==null?void 0:ft.contains(Nt))&&Et(It,vt)};return document.addEventListener("wheel",kt,{passive:!1}),()=>document.removeEventListener("wheel",kt,{passive:!1})},[xt,ft,vt,Et]),reactExports.useEffect(Ct,[rt,Ct]),useResizeObserver(ft,St),useResizeObserver(mt.content,St),jsxRuntimeExports.jsx(ScrollbarProvider,{scope:tt,scrollbar:ft,hasThumb:nt,onThumbChange:useCallbackRef$1(ot),onThumbPointerUp:useCallbackRef$1(it),onThumbPositionChange:Ct,onThumbPointerDown:useCallbackRef$1(st),children:jsxRuntimeExports.jsx(Primitive.div,{...ht,ref:yt,style:{position:"absolute",...ht.style},onPointerDown:composeEventHandlers(et.onPointerDown,kt=>{kt.button===0&&(kt.target.setPointerCapture(kt.pointerId),gt.current=ft.getBoundingClientRect(),bt.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",mt.viewport&&(mt.viewport.style.scrollBehavior="auto"),At(kt))}),onPointerMove:composeEventHandlers(et.onPointerMove,At),onPointerUp:composeEventHandlers(et.onPointerUp,kt=>{const It=kt.target;It.hasPointerCapture(kt.pointerId)&&It.releasePointerCapture(kt.pointerId),document.body.style.webkitUserSelect=bt.current,mt.viewport&&(mt.viewport.style.scrollBehavior=""),gt.current=null})})})}),THUMB_NAME="ScrollAreaThumb",ScrollAreaThumb=reactExports.forwardRef((et,o)=>{const{forceMount:tt,...rt}=et,nt=useScrollbarContext(THUMB_NAME,et.__scopeScrollArea);return jsxRuntimeExports.jsx(Presence,{present:tt||nt.hasThumb,children:jsxRuntimeExports.jsx(ScrollAreaThumbImpl,{ref:o,...rt})})}),ScrollAreaThumbImpl=reactExports.forwardRef((et,o)=>{const{__scopeScrollArea:tt,style:rt,...nt}=et,ot=useScrollAreaContext(THUMB_NAME,tt),it=useScrollbarContext(THUMB_NAME,tt),{onThumbPositionChange:st}=it,at=useComposedRefs(o,dt=>it.onThumbChange(dt)),ct=reactExports.useRef(),lt=useDebounceCallback(()=>{ct.current&&(ct.current(),ct.current=void 0)},100);return reactExports.useEffect(()=>{const dt=ot.viewport;if(dt){const ht=()=>{if(lt(),!ct.current){const mt=addUnlinkedScrollListener(dt,st);ct.current=mt,st()}};return st(),dt.addEventListener("scroll",ht),()=>dt.removeEventListener("scroll",ht)}},[ot.viewport,lt,st]),jsxRuntimeExports.jsx(Primitive.div,{"data-state":it.hasThumb?"visible":"hidden",...nt,ref:at,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...rt},onPointerDownCapture:composeEventHandlers(et.onPointerDownCapture,dt=>{const mt=dt.target.getBoundingClientRect(),ft=dt.clientX-mt.left,pt=dt.clientY-mt.top;it.onThumbPointerDown({x:ft,y:pt})}),onPointerUp:composeEventHandlers(et.onPointerUp,it.onThumbPointerUp)})});ScrollAreaThumb.displayName=THUMB_NAME;var CORNER_NAME="ScrollAreaCorner",ScrollAreaCorner=reactExports.forwardRef((et,o)=>{const tt=useScrollAreaContext(CORNER_NAME,et.__scopeScrollArea),rt=!!(tt.scrollbarX&&tt.scrollbarY);return tt.type!=="scroll"&&rt?jsxRuntimeExports.jsx(ScrollAreaCornerImpl,{...et,ref:o}):null});ScrollAreaCorner.displayName=CORNER_NAME;var ScrollAreaCornerImpl=reactExports.forwardRef((et,o)=>{const{__scopeScrollArea:tt,...rt}=et,nt=useScrollAreaContext(CORNER_NAME,tt),[ot,it]=reactExports.useState(0),[st,at]=reactExports.useState(0),ct=!!(ot&&st);return useResizeObserver(nt.scrollbarX,()=>{var dt;const lt=((dt=nt.scrollbarX)==null?void 0:dt.offsetHeight)||0;nt.onCornerHeightChange(lt),at(lt)}),useResizeObserver(nt.scrollbarY,()=>{var dt;const lt=((dt=nt.scrollbarY)==null?void 0:dt.offsetWidth)||0;nt.onCornerWidthChange(lt),it(lt)}),ct?jsxRuntimeExports.jsx(Primitive.div,{...rt,ref:o,style:{width:ot,height:st,position:"absolute",right:nt.dir==="ltr"?0:void 0,left:nt.dir==="rtl"?0:void 0,bottom:0,...et.style}}):null});function toInt(et){return et?parseInt(et,10):0}function getThumbRatio(et,o){const tt=et/o;return isNaN(tt)?0:tt}function getThumbSize(et){const o=getThumbRatio(et.viewport,et.content),tt=et.scrollbar.paddingStart+et.scrollbar.paddingEnd,rt=(et.scrollbar.size-tt)*o;return Math.max(rt,18)}function getScrollPositionFromPointer(et,o,tt,rt="ltr"){const nt=getThumbSize(tt),ot=nt/2,it=o||ot,st=nt-it,at=tt.scrollbar.paddingStart+it,ct=tt.scrollbar.size-tt.scrollbar.paddingEnd-st,lt=tt.content-tt.viewport,dt=rt==="ltr"?[0,lt]:[lt*-1,0];return linearScale([at,ct],dt)(et)}function getThumbOffsetFromScroll(et,o,tt="ltr"){const rt=getThumbSize(o),nt=o.scrollbar.paddingStart+o.scrollbar.paddingEnd,ot=o.scrollbar.size-nt,it=o.content-o.viewport,st=ot-rt,at=tt==="ltr"?[0,it]:[it*-1,0],ct=clamp(et,at);return linearScale([0,it],[0,st])(ct)}function linearScale(et,o){return tt=>{if(et[0]===et[1]||o[0]===o[1])return o[0];const rt=(o[1]-o[0])/(et[1]-et[0]);return o[0]+rt*(tt-et[0])}}function isScrollingWithinScrollbarBounds(et,o){return et>0&&et{})=>{let tt={left:et.scrollLeft,top:et.scrollTop},rt=0;return function nt(){const ot={left:et.scrollLeft,top:et.scrollTop},it=tt.left!==ot.left,st=tt.top!==ot.top;(it||st)&&o(),tt=ot,rt=window.requestAnimationFrame(nt)}(),()=>window.cancelAnimationFrame(rt)};function useDebounceCallback(et,o){const tt=useCallbackRef$1(et),rt=reactExports.useRef(0);return reactExports.useEffect(()=>()=>window.clearTimeout(rt.current),[]),reactExports.useCallback(()=>{window.clearTimeout(rt.current),rt.current=window.setTimeout(tt,o)},[tt,o])}function useResizeObserver(et,o){const tt=useCallbackRef$1(o);useLayoutEffect2(()=>{let rt=0;if(et){const nt=new ResizeObserver(()=>{cancelAnimationFrame(rt),rt=window.requestAnimationFrame(tt)});return nt.observe(et),()=>{window.cancelAnimationFrame(rt),nt.unobserve(et)}}},[et,tt])}function getSubtree(et,o){const{asChild:tt,children:rt}=et;if(!tt)return typeof o=="function"?o(rt):o;const nt=reactExports.Children.only(rt);return reactExports.cloneElement(nt,{children:typeof o=="function"?o(nt.props.children):o})}var Root=ScrollArea$1,Viewport=ScrollAreaViewport,Corner=ScrollAreaCorner;const ScrollArea=reactExports.forwardRef(({className:et,children:o,...tt},rt)=>jsxRuntimeExports.jsxs(Root,{ref:rt,className:cn("relative overflow-hidden",et),...tt,children:[jsxRuntimeExports.jsx(Viewport,{className:"h-full w-full rounded-[inherit]",children:o}),jsxRuntimeExports.jsx(ScrollBar,{}),jsxRuntimeExports.jsx(Corner,{})]}));ScrollArea.displayName=Root.displayName;const ScrollBar=reactExports.forwardRef(({className:et,orientation:o="vertical",...tt},rt)=>jsxRuntimeExports.jsx(ScrollAreaScrollbar,{ref:rt,orientation:o,className:cn("flex touch-none select-none transition-colors",o==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",o==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",et),...tt,children:jsxRuntimeExports.jsx(ScrollAreaThumb,{className:"relative flex-1 rounded-full bg-border"})}));ScrollBar.displayName=ScrollAreaScrollbar.displayName;const privacyPolicy=` -# Waku - Dogfooding Website - -*Last updated: 22 August 2024* - -This Privacy Policy is intended to inform users of our approach to privacy in respect of this website ("Website"). In this regard, if you are visiting or interacting with our Website, this Privacy Policy applies to you. - -This Website has been set-up by us for the purposes of gathering telemetry data from users of the Website about the reliability protocols utilised by Waku (such activity and related activity, being referred to as "Dogfooding"). - -Waku is a family of robust, censorship-resistant communication protocols designed to enable privacy-focused messaging for web3 apps. You can read more about Waku here: https://waku.org/. - -## Who we are - -For the purposes of this Privacy Policy and the collection and processing of personal data as a controller, the relevant entity is the Logos Collective Association, which has its registered office in Zug and its legal domicile address at - -Logos Collective Association -c/o PST Consulting GmbH -Baarerstrasse 10 -6300 Zug -Switzerland - -Whenever we refer to "Logos", "we" or other similar references, we are referring to the Logos Collective Association. - -## We limit the collection and processing of personal data from your use of the Website and for "Dogfooding" purposes - -We aim to limit the collection and processing of personal data from users of the Website and your participation in Dogfooding. We only collect and process certain personal data for specific purposes and where we have the legal basis to do so under applicable privacy legislation. We will not collect or process any personal data that we don't need and where we do store any personal data, we will only store it for the least amount of time needed for the indicated purpose and in any event no longer than thirty (30) days. - -In this regard, we collect and process the following personal data from your use of the Website and your participation in Dogfooding: - -**IP address**: As part of such use of the Website, we briefly process your IP address. We however have a legitimate interest in processing such IP addresses to ensure the technical functionality and enhance the security measures of the Website. This IP address is not stored by us over time. - -**Telemetry data**: We collect certain technical information (also referred to as telemetry data) to primarily determine the reliability (including, the performance and usage patterns) of the Waku reliability protocols for light clients. This information is only collected once you have accepted the prompt on the Website to participate in Dogfooding. Once you've accepted this prompt, a Waku node will start operating on your browser and then the technical information will start being collected by us. - -The information collected includes: - -- timestamps of receiving and sending messages; -- size of message packets; -- content topics/pubsub topics of the messages; -- code logs of errors and warnings; and -- a randomly generated temporary peer ID that represents your Waku node. - -The temporary peer ID is a seeded identifier used for the duration of your participation in Dogfooding and allows us to correlate the obtained technical information with a particular session and with the additional information collected, could be potentially considered personal data. We process such data based on our legitimate interest to improve our software and the user's experience in respect of Waku. - -If you do not agree to this data collection and processing, please do not interact with the Website or proceed with your participation in Dogfooding. - -## Personal data sharing with third party service providers - -We may share personal data with third party service providers in order for us to fulfil the above purposes. Such third party service providers act as data processors on our behalf and are only permitted to process personal data in accordance with our instructions and for the purposes specified above. - -## Security measures we take in respect of the Website - -As a general approach, we take data security seriously and we have implemented a variety of security measures on the Website that are reasonably designed to maintain the safety of your personal data when you submit such information to us. - -In addition to the security measures of the Website, personal data is also protected by Waku (protocol) itself. You can read more about the security features implemented by the Waku protocol here. - -## Exporting data outside the European Union and Switzerland - -We are obliged to protect the privacy of personal data that you may have submitted in the unlikely event that we export your personal data to places outside the European Union or Switzerland. This means that personal data will only be processed in countries or by parties that provide an adequate level of protection as deemed by Switzerland or the European Commission. Otherwise, we will use other forms of protections, such as specific forms of contractual clauses to ensure such personal data is provided the same protection as required in Switzerland or Europe. In any event, the transmission of personal data outside the European Union and Switzerland will always occur in conformity with applicable privacy legislation. - -## Your choices and rights - -As explained in this Privacy Policy, we limit our collection and processing of your personal data wherever possible. Nonetheless, you still have certain choices and rights in respect of the personal data which we do collect and process. As laid out in relevant privacy legislation, you have the right to: - -- Ask us to correct or update your personal data (where reasonably possible); -- Ask us to remove your personal data from our systems; -- Ask us for a copy of your personal data, which may also be transferred to another data controller at your request; -- Withdraw your consent to process your personal data (only if consent was asked for a processing activity), which only affects processing activities that are based on your consent and doesn't affect the validity of such processing activities before you have withdrawn your consent; -- Object to the processing of your personal data; and -- File a complaint with the Federal Data Protection and Information Commissioner (FDPIC), if you believe that your personal data has been processed unlawfully. - -## Third party links - -On this Website, you may come across links to third party websites. These third party sites have separate and independent privacy policies. We therefore have no responsibility or liability for the content and activities of these third party websites. - -## This Privacy Policy might change - -We may modify or replace any part of this Privacy Policy at any time and without notice. Please check the Website periodically for any changes. The new Privacy Policy will be effective immediately upon its posting on our Website. - -## Contact information - -To the extent that you have any questions about the Privacy Policy, please contact us at legal@free.technology. - -This document is licensed under CC-BY-SA. -`;function ok$1(){}function unreachable(){}function stringify$1(et,o){const tt={};return(et[et.length-1]===""?[...et,""]:et).join((tt.padRight?" ":"")+","+(tt.padLeft===!1?"":" ")).trim()}const nameRe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nameReJsx=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,emptyOptions$2={};function name(et,o){return(emptyOptions$2.jsx?nameReJsx:nameRe).test(et)}const re=/[ \t\n\f\r]/g;function whitespace(et){return typeof et=="object"?et.type==="text"?empty$1(et.value):!1:empty$1(et)}function empty$1(et){return et.replace(re,"")===""}class Schema{constructor(o,tt,rt){this.property=o,this.normal=tt,rt&&(this.space=rt)}}Schema.prototype.property={};Schema.prototype.normal={};Schema.prototype.space=null;function merge(et,o){const tt={},rt={};let nt=-1;for(;++nt4&&tt.slice(0,4)==="data"&&valid.test(o)){if(o.charAt(4)==="-"){const ot=o.slice(5).replace(dash,camelcase);rt="data"+ot.charAt(0).toUpperCase()+ot.slice(1)}else{const ot=o.slice(4);if(!dash.test(ot)){let it=ot.replace(cap$1,kebab);it.charAt(0)!=="-"&&(it="-"+it),o="data"+it}}nt=DefinedInfo}return new nt(rt,o)}function kebab(et){return"-"+et.toLowerCase()}function camelcase(et){return et.charAt(1).toUpperCase()}const hastToReact={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},html$1=merge([xml,xlink,xmlns,aria,html$2],"html"),svg=merge([xml,xlink,xmlns,aria,svg$1],"svg");function stringify(et){return et.join(" ").trim()}var cjs={},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=` -`,FORWARD_SLASH="/",ASTERISK="*",EMPTY_STRING="",TYPE_COMMENT="comment",TYPE_DECLARATION="declaration",inlineStyleParser=function(et,o){if(typeof et!="string")throw new TypeError("First argument must be a string");if(!et)return[];o=o||{};var tt=1,rt=1;function nt(ft){var pt=ft.match(NEWLINE_REGEX);pt&&(tt+=pt.length);var yt=ft.lastIndexOf(NEWLINE);rt=~yt?ft.length-yt:rt+ft.length}function ot(){var ft={line:tt,column:rt};return function(pt){return pt.position=new it(ft),ct(),pt}}function it(ft){this.start=ft,this.end={line:tt,column:rt},this.source=o.source}it.prototype.content=et;function st(ft){var pt=new Error(o.source+":"+tt+":"+rt+": "+ft);if(pt.reason=ft,pt.filename=o.source,pt.line=tt,pt.column=rt,pt.source=et,!o.silent)throw pt}function at(ft){var pt=ft.exec(et);if(pt){var yt=pt[0];return nt(yt),et=et.slice(yt.length),pt}}function ct(){at(WHITESPACE_REGEX)}function lt(ft){var pt;for(ft=ft||[];pt=dt();)pt!==!1&&ft.push(pt);return ft}function dt(){var ft=ot();if(!(FORWARD_SLASH!=et.charAt(0)||ASTERISK!=et.charAt(1))){for(var pt=2;EMPTY_STRING!=et.charAt(pt)&&(ASTERISK!=et.charAt(pt)||FORWARD_SLASH!=et.charAt(pt+1));)++pt;if(pt+=2,EMPTY_STRING===et.charAt(pt-1))return st("End of comment missing");var yt=et.slice(2,pt-2);return rt+=2,nt(yt),et=et.slice(pt),rt+=2,ft({type:TYPE_COMMENT,comment:yt})}}function ht(){var ft=ot(),pt=at(PROPERTY_REGEX);if(pt){if(dt(),!at(COLON_REGEX))return st("property missing ':'");var yt=at(VALUE_REGEX),gt=ft({type:TYPE_DECLARATION,property:trim(pt[0].replace(COMMENT_REGEX,EMPTY_STRING)),value:yt?trim(yt[0].replace(COMMENT_REGEX,EMPTY_STRING)):EMPTY_STRING});return at(SEMICOLON_REGEX),gt}}function mt(){var ft=[];lt(ft);for(var pt;pt=ht();)pt!==!1&&(ft.push(pt),lt(ft));return ft}return ct(),mt()};function trim(et){return et?et.replace(TRIM_REGEX,EMPTY_STRING):EMPTY_STRING}var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(et){return et&&et.__esModule?et:{default:et}};Object.defineProperty(cjs,"__esModule",{value:!0});var _default=cjs.default=StyleToObject,inline_style_parser_1=__importDefault(inlineStyleParser);function StyleToObject(et,o){var tt=null;if(!et||typeof et!="string")return tt;var rt=(0,inline_style_parser_1.default)(et),nt=typeof o=="function";return rt.forEach(function(ot){if(ot.type==="declaration"){var it=ot.property,st=ot.value;nt?o(it,st,ot):st&&(tt=tt||{},tt[it]=st)}}),tt}const styleToObject=_default.default||_default,pointEnd=point$2("end"),pointStart=point$2("start");function point$2(et){return o;function o(tt){const rt=tt&&tt.position&&tt.position[et]||{};if(typeof rt.line=="number"&&rt.line>0&&typeof rt.column=="number"&&rt.column>0)return{line:rt.line,column:rt.column,offset:typeof rt.offset=="number"&&rt.offset>-1?rt.offset:void 0}}}function position$1(et){const o=pointStart(et),tt=pointEnd(et);if(o&&tt)return{start:o,end:tt}}function stringifyPosition(et){return!et||typeof et!="object"?"":"position"in et||"type"in et?position(et.position):"start"in et||"end"in et?position(et):"line"in et||"column"in et?point$1(et):""}function point$1(et){return index(et&&et.line)+":"+index(et&&et.column)}function position(et){return point$1(et&&et.start)+"-"+point$1(et&&et.end)}function index(et){return et&&typeof et=="number"?et:1}class VFileMessage extends Error{constructor(o,tt,rt){super(),typeof tt=="string"&&(rt=tt,tt=void 0);let nt="",ot={},it=!1;if(tt&&("line"in tt&&"column"in tt?ot={place:tt}:"start"in tt&&"end"in tt?ot={place:tt}:"type"in tt?ot={ancestors:[tt],place:tt.position}:ot={...tt}),typeof o=="string"?nt=o:!ot.cause&&o&&(it=!0,nt=o.message,ot.cause=o),!ot.ruleId&&!ot.source&&typeof rt=="string"){const at=rt.indexOf(":");at===-1?ot.ruleId=rt:(ot.source=rt.slice(0,at),ot.ruleId=rt.slice(at+1))}if(!ot.place&&ot.ancestors&&ot.ancestors){const at=ot.ancestors[ot.ancestors.length-1];at&&(ot.place=at.position)}const st=ot.place&&"start"in ot.place?ot.place.start:ot.place;this.ancestors=ot.ancestors||void 0,this.cause=ot.cause||void 0,this.column=st?st.column:void 0,this.fatal=void 0,this.file,this.message=nt,this.line=st?st.line:void 0,this.name=stringifyPosition(ot.place)||"1:1",this.place=ot.place||void 0,this.reason=this.message,this.ruleId=ot.ruleId||void 0,this.source=ot.source||void 0,this.stack=it&&ot.cause&&typeof ot.cause.stack=="string"?ot.cause.stack:"",this.actual,this.expected,this.note,this.url}}VFileMessage.prototype.file="";VFileMessage.prototype.name="";VFileMessage.prototype.reason="";VFileMessage.prototype.message="";VFileMessage.prototype.stack="";VFileMessage.prototype.column=void 0;VFileMessage.prototype.line=void 0;VFileMessage.prototype.ancestors=void 0;VFileMessage.prototype.cause=void 0;VFileMessage.prototype.fatal=void 0;VFileMessage.prototype.place=void 0;VFileMessage.prototype.ruleId=void 0;VFileMessage.prototype.source=void 0;const own$3={}.hasOwnProperty,emptyMap=new Map,cap=/[A-Z]/g,dashSomething=/-([a-z])/g,tableElements=new Set(["table","tbody","thead","tfoot","tr"]),tableCellElement=new Set(["td","th"]),docs="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function toJsxRuntime(et,o){if(!o||o.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const tt=o.filePath||void 0;let rt;if(o.development){if(typeof o.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");rt=developmentCreate(tt,o.jsxDEV)}else{if(typeof o.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof o.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");rt=productionCreate(tt,o.jsx,o.jsxs)}const nt={Fragment:o.Fragment,ancestors:[],components:o.components||{},create:rt,elementAttributeNameCase:o.elementAttributeNameCase||"react",evaluater:o.createEvaluater?o.createEvaluater():void 0,filePath:tt,ignoreInvalidStyle:o.ignoreInvalidStyle||!1,passKeys:o.passKeys!==!1,passNode:o.passNode||!1,schema:o.space==="svg"?svg:html$1,stylePropertyNameCase:o.stylePropertyNameCase||"dom",tableCellAlignToStyle:o.tableCellAlignToStyle!==!1},ot=one$1(nt,et,void 0);return ot&&typeof ot!="string"?ot:nt.create(et,nt.Fragment,{children:ot||void 0},void 0)}function one$1(et,o,tt){if(o.type==="element")return element$1(et,o,tt);if(o.type==="mdxFlowExpression"||o.type==="mdxTextExpression")return mdxExpression(et,o);if(o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement")return mdxJsxElement(et,o,tt);if(o.type==="mdxjsEsm")return mdxEsm(et,o);if(o.type==="root")return root$1(et,o,tt);if(o.type==="text")return text$3(et,o)}function element$1(et,o,tt){const rt=et.schema;let nt=rt;o.tagName.toLowerCase()==="svg"&&rt.space==="html"&&(nt=svg,et.schema=nt),et.ancestors.push(o);const ot=findComponentFromName(et,o.tagName,!1),it=createElementProps(et,o);let st=createChildren(et,o);return tableElements.has(o.tagName)&&(st=st.filter(function(at){return typeof at=="string"?!whitespace(at):!0})),addNode(et,it,ot,o),addChildren(it,st),et.ancestors.pop(),et.schema=rt,et.create(o,ot,it,tt)}function mdxExpression(et,o){if(o.data&&o.data.estree&&et.evaluater){const rt=o.data.estree.body[0];return rt.type,et.evaluater.evaluateExpression(rt.expression)}crashEstree(et,o.position)}function mdxEsm(et,o){if(o.data&&o.data.estree&&et.evaluater)return et.evaluater.evaluateProgram(o.data.estree);crashEstree(et,o.position)}function mdxJsxElement(et,o,tt){const rt=et.schema;let nt=rt;o.name==="svg"&&rt.space==="html"&&(nt=svg,et.schema=nt),et.ancestors.push(o);const ot=o.name===null?et.Fragment:findComponentFromName(et,o.name,!0),it=createJsxElementProps(et,o),st=createChildren(et,o);return addNode(et,it,ot,o),addChildren(it,st),et.ancestors.pop(),et.schema=rt,et.create(o,ot,it,tt)}function root$1(et,o,tt){const rt={};return addChildren(rt,createChildren(et,o)),et.create(o,et.Fragment,rt,tt)}function text$3(et,o){return o.value}function addNode(et,o,tt,rt){typeof tt!="string"&&tt!==et.Fragment&&et.passNode&&(o.node=rt)}function addChildren(et,o){if(o.length>0){const tt=o.length>1?o:o[0];tt&&(et.children=tt)}}function productionCreate(et,o,tt){return rt;function rt(nt,ot,it,st){const ct=Array.isArray(it.children)?tt:o;return st?ct(ot,it,st):ct(ot,it)}}function developmentCreate(et,o){return tt;function tt(rt,nt,ot,it){const st=Array.isArray(ot.children),at=pointStart(rt);return o(nt,ot,it,st,{columnNumber:at?at.column-1:void 0,fileName:et,lineNumber:at?at.line:void 0},void 0)}}function createElementProps(et,o){const tt={};let rt,nt;for(nt in o.properties)if(nt!=="children"&&own$3.call(o.properties,nt)){const ot=createProperty(et,nt,o.properties[nt]);if(ot){const[it,st]=ot;et.tableCellAlignToStyle&&it==="align"&&typeof st=="string"&&tableCellElement.has(o.tagName)?rt=st:tt[it]=st}}if(rt){const ot=tt.style||(tt.style={});ot[et.stylePropertyNameCase==="css"?"text-align":"textAlign"]=rt}return tt}function createJsxElementProps(et,o){const tt={};for(const rt of o.attributes)if(rt.type==="mdxJsxExpressionAttribute")if(rt.data&&rt.data.estree&&et.evaluater){const ot=rt.data.estree.body[0];ot.type;const it=ot.expression;it.type;const st=it.properties[0];st.type,Object.assign(tt,et.evaluater.evaluateExpression(st.argument))}else crashEstree(et,o.position);else{const nt=rt.name;let ot;if(rt.value&&typeof rt.value=="object")if(rt.value.data&&rt.value.data.estree&&et.evaluater){const st=rt.value.data.estree.body[0];st.type,ot=et.evaluater.evaluateExpression(st.expression)}else crashEstree(et,o.position);else ot=rt.value===null?!0:rt.value;tt[nt]=ot}return tt}function createChildren(et,o){const tt=[];let rt=-1;const nt=et.passKeys?new Map:emptyMap;for(;++rtnt?0:nt+o:o=o>nt?nt:o,tt=tt>0?tt:0,rt.length<1e4)it=Array.from(rt),it.unshift(o,tt),et.splice(...it);else for(tt&&et.splice(o,tt);ot0?(splice(et,et.length,0,o),et):o}const hasOwnProperty={}.hasOwnProperty;function combineExtensions(et){const o={};let tt=-1;for(;++tt13&&tt<32||tt>126&&tt<160||tt>55295&&tt<57344||tt>64975&&tt<65008||(tt&65535)===65535||(tt&65535)===65534||tt>1114111?"�":String.fromCodePoint(tt)}function normalizeIdentifier(et){return et.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const asciiAlpha=regexCheck(/[A-Za-z]/),asciiAlphanumeric=regexCheck(/[\dA-Za-z]/),asciiAtext=regexCheck(/[#-'*+\--9=?A-Z^-~]/);function asciiControl(et){return et!==null&&(et<32||et===127)}const asciiDigit=regexCheck(/\d/),asciiHexDigit=regexCheck(/[\dA-Fa-f]/),asciiPunctuation=regexCheck(/[!-/:-@[-`{-~]/);function markdownLineEnding(et){return et!==null&&et<-2}function markdownLineEndingOrSpace(et){return et!==null&&(et<0||et===32)}function markdownSpace(et){return et===-2||et===-1||et===32}const unicodePunctuation=regexCheck(new RegExp("\\p{P}|\\p{S}","u")),unicodeWhitespace=regexCheck(/\s/);function regexCheck(et){return o;function o(tt){return tt!==null&&tt>-1&&et.test(String.fromCharCode(tt))}}function normalizeUri(et){const o=[];let tt=-1,rt=0,nt=0;for(;++tt55295&&ot<57344){const st=et.charCodeAt(tt+1);ot<56320&&st>56319&&st<57344?(it=String.fromCharCode(ot,st),nt=1):it="�"}else it=String.fromCharCode(ot);it&&(o.push(et.slice(rt,tt),encodeURIComponent(it)),rt=tt+nt+1,it=""),nt&&(tt+=nt,nt=0)}return o.join("")+et.slice(rt)}function factorySpace(et,o,tt,rt){const nt=rt?rt-1:Number.POSITIVE_INFINITY;let ot=0;return it;function it(at){return markdownSpace(at)?(et.enter(tt),st(at)):o(at)}function st(at){return markdownSpace(at)&&ot++it))return;const St=o.events.length;let At=St,kt,It;for(;At--;)if(o.events[At][0]==="exit"&&o.events[At][1].type==="chunkFlow"){if(kt){It=o.events[At][1].end;break}kt=!0}for(gt(rt),Ct=St;Ctxt;){const Et=tt[vt];o.containerState=Et[1],Et[0].exit.call(o,et)}tt.length=xt}function bt(){nt.write([null]),ot=void 0,nt=void 0,o.containerState._closeFlow=void 0}}function tokenizeContainer(et,o,tt){return factorySpace(et,et.attempt(this.parser.constructs.document,o,tt),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function classifyCharacter(et){if(et===null||markdownLineEndingOrSpace(et)||unicodeWhitespace(et))return 1;if(unicodePunctuation(et))return 2}function resolveAll(et,o,tt){const rt=[];let nt=-1;for(;++nt1&&et[tt][1].end.offset-et[tt][1].start.offset>1?2:1;const dt=Object.assign({},et[rt][1].end),ht=Object.assign({},et[tt][1].start);movePoint(dt,-at),movePoint(ht,at),it={type:at>1?"strongSequence":"emphasisSequence",start:dt,end:Object.assign({},et[rt][1].end)},st={type:at>1?"strongSequence":"emphasisSequence",start:Object.assign({},et[tt][1].start),end:ht},ot={type:at>1?"strongText":"emphasisText",start:Object.assign({},et[rt][1].end),end:Object.assign({},et[tt][1].start)},nt={type:at>1?"strong":"emphasis",start:Object.assign({},it.start),end:Object.assign({},st.end)},et[rt][1].end=Object.assign({},it.start),et[tt][1].start=Object.assign({},st.end),ct=[],et[rt][1].end.offset-et[rt][1].start.offset&&(ct=push(ct,[["enter",et[rt][1],o],["exit",et[rt][1],o]])),ct=push(ct,[["enter",nt,o],["enter",it,o],["exit",it,o],["enter",ot,o]]),ct=push(ct,resolveAll(o.parser.constructs.insideSpan.null,et.slice(rt+1,tt),o)),ct=push(ct,[["exit",ot,o],["enter",st,o],["exit",st,o],["exit",nt,o]]),et[tt][1].end.offset-et[tt][1].start.offset?(lt=2,ct=push(ct,[["enter",et[tt][1],o],["exit",et[tt][1],o]])):lt=0,splice(et,rt-1,tt-rt+3,ct),tt=rt+ct.length-lt-2;break}}for(tt=-1;++tt0&&markdownSpace(Ct)?factorySpace(et,bt,"linePrefix",ot+1)(Ct):bt(Ct)}function bt(Ct){return Ct===null||markdownLineEnding(Ct)?et.check(nonLazyContinuation,pt,vt)(Ct):(et.enter("codeFlowValue"),xt(Ct))}function xt(Ct){return Ct===null||markdownLineEnding(Ct)?(et.exit("codeFlowValue"),bt(Ct)):(et.consume(Ct),xt)}function vt(Ct){return et.exit("codeFenced"),o(Ct)}function Et(Ct,St,At){let kt=0;return It;function It(Ut){return Ct.enter("lineEnding"),Ct.consume(Ut),Ct.exit("lineEnding"),Nt}function Nt(Ut){return Ct.enter("codeFencedFence"),markdownSpace(Ut)?factorySpace(Ct,Lt,"linePrefix",rt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Ut):Lt(Ut)}function Lt(Ut){return Ut===st?(Ct.enter("codeFencedFenceSequence"),Mt(Ut)):At(Ut)}function Mt(Ut){return Ut===st?(kt++,Ct.consume(Ut),Mt):kt>=it?(Ct.exit("codeFencedFenceSequence"),markdownSpace(Ut)?factorySpace(Ct,zt,"whitespace")(Ut):zt(Ut)):At(Ut)}function zt(Ut){return Ut===null||markdownLineEnding(Ut)?(Ct.exit("codeFencedFence"),St(Ut)):At(Ut)}}}function tokenizeNonLazyContinuation(et,o,tt){const rt=this;return nt;function nt(it){return it===null?tt(it):(et.enter("lineEnding"),et.consume(it),et.exit("lineEnding"),ot)}function ot(it){return rt.parser.lazy[rt.now().line]?tt(it):o(it)}}const codeIndented={name:"codeIndented",tokenize:tokenizeCodeIndented},furtherStart={tokenize:tokenizeFurtherStart,partial:!0};function tokenizeCodeIndented(et,o,tt){const rt=this;return nt;function nt(ct){return et.enter("codeIndented"),factorySpace(et,ot,"linePrefix",5)(ct)}function ot(ct){const lt=rt.events[rt.events.length-1];return lt&<[1].type==="linePrefix"&<[2].sliceSerialize(lt[1],!0).length>=4?it(ct):tt(ct)}function it(ct){return ct===null?at(ct):markdownLineEnding(ct)?et.attempt(furtherStart,it,at)(ct):(et.enter("codeFlowValue"),st(ct))}function st(ct){return ct===null||markdownLineEnding(ct)?(et.exit("codeFlowValue"),it(ct)):(et.consume(ct),st)}function at(ct){return et.exit("codeIndented"),o(ct)}}function tokenizeFurtherStart(et,o,tt){const rt=this;return nt;function nt(it){return rt.parser.lazy[rt.now().line]?tt(it):markdownLineEnding(it)?(et.enter("lineEnding"),et.consume(it),et.exit("lineEnding"),nt):factorySpace(et,ot,"linePrefix",5)(it)}function ot(it){const st=rt.events[rt.events.length-1];return st&&st[1].type==="linePrefix"&&st[2].sliceSerialize(st[1],!0).length>=4?o(it):markdownLineEnding(it)?nt(it):tt(it)}}const codeText={name:"codeText",tokenize:tokenizeCodeText,resolve:resolveCodeText,previous};function resolveCodeText(et){let o=et.length-4,tt=3,rt,nt;if((et[tt][1].type==="lineEnding"||et[tt][1].type==="space")&&(et[o][1].type==="lineEnding"||et[o][1].type==="space")){for(rt=tt;++rt=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+o+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return othis.left.length?this.right.slice(this.right.length-rt+this.left.length,this.right.length-o+this.left.length).reverse():this.left.slice(o).concat(this.right.slice(this.right.length-rt+this.left.length).reverse())}splice(o,tt,rt){const nt=tt||0;this.setCursor(Math.trunc(o));const ot=this.right.splice(this.right.length-nt,Number.POSITIVE_INFINITY);return rt&&chunkedPush(this.left,rt),ot.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(o){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(o)}pushMany(o){this.setCursor(Number.POSITIVE_INFINITY),chunkedPush(this.left,o)}unshift(o){this.setCursor(0),this.right.push(o)}unshiftMany(o){this.setCursor(0),chunkedPush(this.right,o.reverse())}setCursor(o){if(!(o===this.left.length||o>this.left.length&&this.right.length===0||o<0&&this.left.length===0))if(o=4?o(it):et.interrupt(rt.parser.constructs.flow,tt,o)(it)}}function factoryDestination(et,o,tt,rt,nt,ot,it,st,at){const ct=at||Number.POSITIVE_INFINITY;let lt=0;return dt;function dt(gt){return gt===60?(et.enter(rt),et.enter(nt),et.enter(ot),et.consume(gt),et.exit(ot),ht):gt===null||gt===32||gt===41||asciiControl(gt)?tt(gt):(et.enter(rt),et.enter(it),et.enter(st),et.enter("chunkString",{contentType:"string"}),pt(gt))}function ht(gt){return gt===62?(et.enter(ot),et.consume(gt),et.exit(ot),et.exit(nt),et.exit(rt),o):(et.enter(st),et.enter("chunkString",{contentType:"string"}),mt(gt))}function mt(gt){return gt===62?(et.exit("chunkString"),et.exit(st),ht(gt)):gt===null||gt===60||markdownLineEnding(gt)?tt(gt):(et.consume(gt),gt===92?ft:mt)}function ft(gt){return gt===60||gt===62||gt===92?(et.consume(gt),mt):mt(gt)}function pt(gt){return!lt&&(gt===null||gt===41||markdownLineEndingOrSpace(gt))?(et.exit("chunkString"),et.exit(st),et.exit(it),et.exit(rt),o(gt)):lt999||mt===null||mt===91||mt===93&&!at||mt===94&&!st&&"_hiddenFootnoteSupport"in it.parser.constructs?tt(mt):mt===93?(et.exit(ot),et.enter(nt),et.consume(mt),et.exit(nt),et.exit(rt),o):markdownLineEnding(mt)?(et.enter("lineEnding"),et.consume(mt),et.exit("lineEnding"),lt):(et.enter("chunkString",{contentType:"string"}),dt(mt))}function dt(mt){return mt===null||mt===91||mt===93||markdownLineEnding(mt)||st++>999?(et.exit("chunkString"),lt(mt)):(et.consume(mt),at||(at=!markdownSpace(mt)),mt===92?ht:dt)}function ht(mt){return mt===91||mt===92||mt===93?(et.consume(mt),st++,dt):dt(mt)}}function factoryTitle(et,o,tt,rt,nt,ot){let it;return st;function st(ht){return ht===34||ht===39||ht===40?(et.enter(rt),et.enter(nt),et.consume(ht),et.exit(nt),it=ht===40?41:ht,at):tt(ht)}function at(ht){return ht===it?(et.enter(nt),et.consume(ht),et.exit(nt),et.exit(rt),o):(et.enter(ot),ct(ht))}function ct(ht){return ht===it?(et.exit(ot),at(it)):ht===null?tt(ht):markdownLineEnding(ht)?(et.enter("lineEnding"),et.consume(ht),et.exit("lineEnding"),factorySpace(et,ct,"linePrefix")):(et.enter("chunkString",{contentType:"string"}),lt(ht))}function lt(ht){return ht===it||ht===null||markdownLineEnding(ht)?(et.exit("chunkString"),ct(ht)):(et.consume(ht),ht===92?dt:lt)}function dt(ht){return ht===it||ht===92?(et.consume(ht),lt):lt(ht)}}function factoryWhitespace(et,o){let tt;return rt;function rt(nt){return markdownLineEnding(nt)?(et.enter("lineEnding"),et.consume(nt),et.exit("lineEnding"),tt=!0,rt):markdownSpace(nt)?factorySpace(et,rt,tt?"linePrefix":"lineSuffix")(nt):o(nt)}}const definition={name:"definition",tokenize:tokenizeDefinition},titleBefore={tokenize:tokenizeTitleBefore,partial:!0};function tokenizeDefinition(et,o,tt){const rt=this;let nt;return ot;function ot(mt){return et.enter("definition"),it(mt)}function it(mt){return factoryLabel.call(rt,et,st,tt,"definitionLabel","definitionLabelMarker","definitionLabelString")(mt)}function st(mt){return nt=normalizeIdentifier(rt.sliceSerialize(rt.events[rt.events.length-1][1]).slice(1,-1)),mt===58?(et.enter("definitionMarker"),et.consume(mt),et.exit("definitionMarker"),at):tt(mt)}function at(mt){return markdownLineEndingOrSpace(mt)?factoryWhitespace(et,ct)(mt):ct(mt)}function ct(mt){return factoryDestination(et,lt,tt,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(mt)}function lt(mt){return et.attempt(titleBefore,dt,dt)(mt)}function dt(mt){return markdownSpace(mt)?factorySpace(et,ht,"whitespace")(mt):ht(mt)}function ht(mt){return mt===null||markdownLineEnding(mt)?(et.exit("definition"),rt.parser.defined.push(nt),o(mt)):tt(mt)}}function tokenizeTitleBefore(et,o,tt){return rt;function rt(st){return markdownLineEndingOrSpace(st)?factoryWhitespace(et,nt)(st):tt(st)}function nt(st){return factoryTitle(et,ot,tt,"definitionTitle","definitionTitleMarker","definitionTitleString")(st)}function ot(st){return markdownSpace(st)?factorySpace(et,it,"whitespace")(st):it(st)}function it(st){return st===null||markdownLineEnding(st)?o(st):tt(st)}}const hardBreakEscape={name:"hardBreakEscape",tokenize:tokenizeHardBreakEscape};function tokenizeHardBreakEscape(et,o,tt){return rt;function rt(ot){return et.enter("hardBreakEscape"),et.consume(ot),nt}function nt(ot){return markdownLineEnding(ot)?(et.exit("hardBreakEscape"),o(ot)):tt(ot)}}const headingAtx={name:"headingAtx",tokenize:tokenizeHeadingAtx,resolve:resolveHeadingAtx};function resolveHeadingAtx(et,o){let tt=et.length-2,rt=3,nt,ot;return et[rt][1].type==="whitespace"&&(rt+=2),tt-2>rt&&et[tt][1].type==="whitespace"&&(tt-=2),et[tt][1].type==="atxHeadingSequence"&&(rt===tt-1||tt-4>rt&&et[tt-2][1].type==="whitespace")&&(tt-=rt+1===tt?2:4),tt>rt&&(nt={type:"atxHeadingText",start:et[rt][1].start,end:et[tt][1].end},ot={type:"chunkText",start:et[rt][1].start,end:et[tt][1].end,contentType:"text"},splice(et,rt,tt-rt+1,[["enter",nt,o],["enter",ot,o],["exit",ot,o],["exit",nt,o]])),et}function tokenizeHeadingAtx(et,o,tt){let rt=0;return nt;function nt(lt){return et.enter("atxHeading"),ot(lt)}function ot(lt){return et.enter("atxHeadingSequence"),it(lt)}function it(lt){return lt===35&&rt++<6?(et.consume(lt),it):lt===null||markdownLineEndingOrSpace(lt)?(et.exit("atxHeadingSequence"),st(lt)):tt(lt)}function st(lt){return lt===35?(et.enter("atxHeadingSequence"),at(lt)):lt===null||markdownLineEnding(lt)?(et.exit("atxHeading"),o(lt)):markdownSpace(lt)?factorySpace(et,st,"whitespace")(lt):(et.enter("atxHeadingText"),ct(lt))}function at(lt){return lt===35?(et.consume(lt),at):(et.exit("atxHeadingSequence"),st(lt))}function ct(lt){return lt===null||lt===35||markdownLineEndingOrSpace(lt)?(et.exit("atxHeadingText"),st(lt)):(et.consume(lt),ct)}}const htmlBlockNames=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],htmlRawNames=["pre","script","style","textarea"],htmlFlow={name:"htmlFlow",tokenize:tokenizeHtmlFlow,resolveTo:resolveToHtmlFlow,concrete:!0},blankLineBefore={tokenize:tokenizeBlankLineBefore,partial:!0},nonLazyContinuationStart={tokenize:tokenizeNonLazyContinuationStart,partial:!0};function resolveToHtmlFlow(et){let o=et.length;for(;o--&&!(et[o][0]==="enter"&&et[o][1].type==="htmlFlow"););return o>1&&et[o-2][1].type==="linePrefix"&&(et[o][1].start=et[o-2][1].start,et[o+1][1].start=et[o-2][1].start,et.splice(o-2,2)),et}function tokenizeHtmlFlow(et,o,tt){const rt=this;let nt,ot,it,st,at;return ct;function ct(jt){return lt(jt)}function lt(jt){return et.enter("htmlFlow"),et.enter("htmlFlowData"),et.consume(jt),dt}function dt(jt){return jt===33?(et.consume(jt),ht):jt===47?(et.consume(jt),ot=!0,pt):jt===63?(et.consume(jt),nt=3,rt.interrupt?o:Pt):asciiAlpha(jt)?(et.consume(jt),it=String.fromCharCode(jt),yt):tt(jt)}function ht(jt){return jt===45?(et.consume(jt),nt=2,mt):jt===91?(et.consume(jt),nt=5,st=0,ft):asciiAlpha(jt)?(et.consume(jt),nt=4,rt.interrupt?o:Pt):tt(jt)}function mt(jt){return jt===45?(et.consume(jt),rt.interrupt?o:Pt):tt(jt)}function ft(jt){const Gt="CDATA[";return jt===Gt.charCodeAt(st++)?(et.consume(jt),st===Gt.length?rt.interrupt?o:Lt:ft):tt(jt)}function pt(jt){return asciiAlpha(jt)?(et.consume(jt),it=String.fromCharCode(jt),yt):tt(jt)}function yt(jt){if(jt===null||jt===47||jt===62||markdownLineEndingOrSpace(jt)){const Gt=jt===47,rr=it.toLowerCase();return!Gt&&!ot&&htmlRawNames.includes(rr)?(nt=1,rt.interrupt?o(jt):Lt(jt)):htmlBlockNames.includes(it.toLowerCase())?(nt=6,Gt?(et.consume(jt),gt):rt.interrupt?o(jt):Lt(jt)):(nt=7,rt.interrupt&&!rt.parser.lazy[rt.now().line]?tt(jt):ot?bt(jt):xt(jt))}return jt===45||asciiAlphanumeric(jt)?(et.consume(jt),it+=String.fromCharCode(jt),yt):tt(jt)}function gt(jt){return jt===62?(et.consume(jt),rt.interrupt?o:Lt):tt(jt)}function bt(jt){return markdownSpace(jt)?(et.consume(jt),bt):It(jt)}function xt(jt){return jt===47?(et.consume(jt),It):jt===58||jt===95||asciiAlpha(jt)?(et.consume(jt),vt):markdownSpace(jt)?(et.consume(jt),xt):It(jt)}function vt(jt){return jt===45||jt===46||jt===58||jt===95||asciiAlphanumeric(jt)?(et.consume(jt),vt):Et(jt)}function Et(jt){return jt===61?(et.consume(jt),Ct):markdownSpace(jt)?(et.consume(jt),Et):xt(jt)}function Ct(jt){return jt===null||jt===60||jt===61||jt===62||jt===96?tt(jt):jt===34||jt===39?(et.consume(jt),at=jt,St):markdownSpace(jt)?(et.consume(jt),Ct):At(jt)}function St(jt){return jt===at?(et.consume(jt),at=null,kt):jt===null||markdownLineEnding(jt)?tt(jt):(et.consume(jt),St)}function At(jt){return jt===null||jt===34||jt===39||jt===47||jt===60||jt===61||jt===62||jt===96||markdownLineEndingOrSpace(jt)?Et(jt):(et.consume(jt),At)}function kt(jt){return jt===47||jt===62||markdownSpace(jt)?xt(jt):tt(jt)}function It(jt){return jt===62?(et.consume(jt),Nt):tt(jt)}function Nt(jt){return jt===null||markdownLineEnding(jt)?Lt(jt):markdownSpace(jt)?(et.consume(jt),Nt):tt(jt)}function Lt(jt){return jt===45&&nt===2?(et.consume(jt),Xt):jt===60&&nt===1?(et.consume(jt),Wt):jt===62&&nt===4?(et.consume(jt),Yt):jt===63&&nt===3?(et.consume(jt),Pt):jt===93&&nt===5?(et.consume(jt),qt):markdownLineEnding(jt)&&(nt===6||nt===7)?(et.exit("htmlFlowData"),et.check(blankLineBefore,Qt,Mt)(jt)):jt===null||markdownLineEnding(jt)?(et.exit("htmlFlowData"),Mt(jt)):(et.consume(jt),Lt)}function Mt(jt){return et.check(nonLazyContinuationStart,zt,Qt)(jt)}function zt(jt){return et.enter("lineEnding"),et.consume(jt),et.exit("lineEnding"),Ut}function Ut(jt){return jt===null||markdownLineEnding(jt)?Mt(jt):(et.enter("htmlFlowData"),Lt(jt))}function Xt(jt){return jt===45?(et.consume(jt),Pt):Lt(jt)}function Wt(jt){return jt===47?(et.consume(jt),it="",Ft):Lt(jt)}function Ft(jt){if(jt===62){const Gt=it.toLowerCase();return htmlRawNames.includes(Gt)?(et.consume(jt),Yt):Lt(jt)}return asciiAlpha(jt)&&it.length<8?(et.consume(jt),it+=String.fromCharCode(jt),Ft):Lt(jt)}function qt(jt){return jt===93?(et.consume(jt),Pt):Lt(jt)}function Pt(jt){return jt===62?(et.consume(jt),Yt):jt===45&&nt===2?(et.consume(jt),Pt):Lt(jt)}function Yt(jt){return jt===null||markdownLineEnding(jt)?(et.exit("htmlFlowData"),Qt(jt)):(et.consume(jt),Yt)}function Qt(jt){return et.exit("htmlFlow"),o(jt)}}function tokenizeNonLazyContinuationStart(et,o,tt){const rt=this;return nt;function nt(it){return markdownLineEnding(it)?(et.enter("lineEnding"),et.consume(it),et.exit("lineEnding"),ot):tt(it)}function ot(it){return rt.parser.lazy[rt.now().line]?tt(it):o(it)}}function tokenizeBlankLineBefore(et,o,tt){return rt;function rt(nt){return et.enter("lineEnding"),et.consume(nt),et.exit("lineEnding"),et.attempt(blankLine,o,tt)}}const htmlText={name:"htmlText",tokenize:tokenizeHtmlText};function tokenizeHtmlText(et,o,tt){const rt=this;let nt,ot,it;return st;function st(Pt){return et.enter("htmlText"),et.enter("htmlTextData"),et.consume(Pt),at}function at(Pt){return Pt===33?(et.consume(Pt),ct):Pt===47?(et.consume(Pt),Et):Pt===63?(et.consume(Pt),xt):asciiAlpha(Pt)?(et.consume(Pt),At):tt(Pt)}function ct(Pt){return Pt===45?(et.consume(Pt),lt):Pt===91?(et.consume(Pt),ot=0,ft):asciiAlpha(Pt)?(et.consume(Pt),bt):tt(Pt)}function lt(Pt){return Pt===45?(et.consume(Pt),mt):tt(Pt)}function dt(Pt){return Pt===null?tt(Pt):Pt===45?(et.consume(Pt),ht):markdownLineEnding(Pt)?(it=dt,Wt(Pt)):(et.consume(Pt),dt)}function ht(Pt){return Pt===45?(et.consume(Pt),mt):dt(Pt)}function mt(Pt){return Pt===62?Xt(Pt):Pt===45?ht(Pt):dt(Pt)}function ft(Pt){const Yt="CDATA[";return Pt===Yt.charCodeAt(ot++)?(et.consume(Pt),ot===Yt.length?pt:ft):tt(Pt)}function pt(Pt){return Pt===null?tt(Pt):Pt===93?(et.consume(Pt),yt):markdownLineEnding(Pt)?(it=pt,Wt(Pt)):(et.consume(Pt),pt)}function yt(Pt){return Pt===93?(et.consume(Pt),gt):pt(Pt)}function gt(Pt){return Pt===62?Xt(Pt):Pt===93?(et.consume(Pt),gt):pt(Pt)}function bt(Pt){return Pt===null||Pt===62?Xt(Pt):markdownLineEnding(Pt)?(it=bt,Wt(Pt)):(et.consume(Pt),bt)}function xt(Pt){return Pt===null?tt(Pt):Pt===63?(et.consume(Pt),vt):markdownLineEnding(Pt)?(it=xt,Wt(Pt)):(et.consume(Pt),xt)}function vt(Pt){return Pt===62?Xt(Pt):xt(Pt)}function Et(Pt){return asciiAlpha(Pt)?(et.consume(Pt),Ct):tt(Pt)}function Ct(Pt){return Pt===45||asciiAlphanumeric(Pt)?(et.consume(Pt),Ct):St(Pt)}function St(Pt){return markdownLineEnding(Pt)?(it=St,Wt(Pt)):markdownSpace(Pt)?(et.consume(Pt),St):Xt(Pt)}function At(Pt){return Pt===45||asciiAlphanumeric(Pt)?(et.consume(Pt),At):Pt===47||Pt===62||markdownLineEndingOrSpace(Pt)?kt(Pt):tt(Pt)}function kt(Pt){return Pt===47?(et.consume(Pt),Xt):Pt===58||Pt===95||asciiAlpha(Pt)?(et.consume(Pt),It):markdownLineEnding(Pt)?(it=kt,Wt(Pt)):markdownSpace(Pt)?(et.consume(Pt),kt):Xt(Pt)}function It(Pt){return Pt===45||Pt===46||Pt===58||Pt===95||asciiAlphanumeric(Pt)?(et.consume(Pt),It):Nt(Pt)}function Nt(Pt){return Pt===61?(et.consume(Pt),Lt):markdownLineEnding(Pt)?(it=Nt,Wt(Pt)):markdownSpace(Pt)?(et.consume(Pt),Nt):kt(Pt)}function Lt(Pt){return Pt===null||Pt===60||Pt===61||Pt===62||Pt===96?tt(Pt):Pt===34||Pt===39?(et.consume(Pt),nt=Pt,Mt):markdownLineEnding(Pt)?(it=Lt,Wt(Pt)):markdownSpace(Pt)?(et.consume(Pt),Lt):(et.consume(Pt),zt)}function Mt(Pt){return Pt===nt?(et.consume(Pt),nt=void 0,Ut):Pt===null?tt(Pt):markdownLineEnding(Pt)?(it=Mt,Wt(Pt)):(et.consume(Pt),Mt)}function zt(Pt){return Pt===null||Pt===34||Pt===39||Pt===60||Pt===61||Pt===96?tt(Pt):Pt===47||Pt===62||markdownLineEndingOrSpace(Pt)?kt(Pt):(et.consume(Pt),zt)}function Ut(Pt){return Pt===47||Pt===62||markdownLineEndingOrSpace(Pt)?kt(Pt):tt(Pt)}function Xt(Pt){return Pt===62?(et.consume(Pt),et.exit("htmlTextData"),et.exit("htmlText"),o):tt(Pt)}function Wt(Pt){return et.exit("htmlTextData"),et.enter("lineEnding"),et.consume(Pt),et.exit("lineEnding"),Ft}function Ft(Pt){return markdownSpace(Pt)?factorySpace(et,qt,"linePrefix",rt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Pt):qt(Pt)}function qt(Pt){return et.enter("htmlTextData"),it(Pt)}}const labelEnd={name:"labelEnd",tokenize:tokenizeLabelEnd,resolveTo:resolveToLabelEnd,resolveAll:resolveAllLabelEnd},resourceConstruct={tokenize:tokenizeResource},referenceFullConstruct={tokenize:tokenizeReferenceFull},referenceCollapsedConstruct={tokenize:tokenizeReferenceCollapsed};function resolveAllLabelEnd(et){let o=-1;for(;++o=3&&(ct===null||markdownLineEnding(ct))?(et.exit("thematicBreak"),o(ct)):tt(ct)}function at(ct){return ct===nt?(et.consume(ct),rt++,at):(et.exit("thematicBreakSequence"),markdownSpace(ct)?factorySpace(et,st,"whitespace")(ct):st(ct))}}const list$1={name:"list",tokenize:tokenizeListStart,continuation:{tokenize:tokenizeListContinuation},exit:tokenizeListEnd},listItemPrefixWhitespaceConstruct={tokenize:tokenizeListItemPrefixWhitespace,partial:!0},indentConstruct={tokenize:tokenizeIndent,partial:!0};function tokenizeListStart(et,o,tt){const rt=this,nt=rt.events[rt.events.length-1];let ot=nt&&nt[1].type==="linePrefix"?nt[2].sliceSerialize(nt[1],!0).length:0,it=0;return st;function st(mt){const ft=rt.containerState.type||(mt===42||mt===43||mt===45?"listUnordered":"listOrdered");if(ft==="listUnordered"?!rt.containerState.marker||mt===rt.containerState.marker:asciiDigit(mt)){if(rt.containerState.type||(rt.containerState.type=ft,et.enter(ft,{_container:!0})),ft==="listUnordered")return et.enter("listItemPrefix"),mt===42||mt===45?et.check(thematicBreak$1,tt,ct)(mt):ct(mt);if(!rt.interrupt||mt===49)return et.enter("listItemPrefix"),et.enter("listItemValue"),at(mt)}return tt(mt)}function at(mt){return asciiDigit(mt)&&++it<10?(et.consume(mt),at):(!rt.interrupt||it<2)&&(rt.containerState.marker?mt===rt.containerState.marker:mt===41||mt===46)?(et.exit("listItemValue"),ct(mt)):tt(mt)}function ct(mt){return et.enter("listItemMarker"),et.consume(mt),et.exit("listItemMarker"),rt.containerState.marker=rt.containerState.marker||mt,et.check(blankLine,rt.interrupt?tt:lt,et.attempt(listItemPrefixWhitespaceConstruct,ht,dt))}function lt(mt){return rt.containerState.initialBlankLine=!0,ot++,ht(mt)}function dt(mt){return markdownSpace(mt)?(et.enter("listItemPrefixWhitespace"),et.consume(mt),et.exit("listItemPrefixWhitespace"),ht):tt(mt)}function ht(mt){return rt.containerState.size=ot+rt.sliceSerialize(et.exit("listItemPrefix"),!0).length,o(mt)}}function tokenizeListContinuation(et,o,tt){const rt=this;return rt.containerState._closeFlow=void 0,et.check(blankLine,nt,ot);function nt(st){return rt.containerState.furtherBlankLines=rt.containerState.furtherBlankLines||rt.containerState.initialBlankLine,factorySpace(et,o,"listItemIndent",rt.containerState.size+1)(st)}function ot(st){return rt.containerState.furtherBlankLines||!markdownSpace(st)?(rt.containerState.furtherBlankLines=void 0,rt.containerState.initialBlankLine=void 0,it(st)):(rt.containerState.furtherBlankLines=void 0,rt.containerState.initialBlankLine=void 0,et.attempt(indentConstruct,o,it)(st))}function it(st){return rt.containerState._closeFlow=!0,rt.interrupt=void 0,factorySpace(et,et.attempt(list$1,o,tt),"linePrefix",rt.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(st)}}function tokenizeIndent(et,o,tt){const rt=this;return factorySpace(et,nt,"listItemIndent",rt.containerState.size+1);function nt(ot){const it=rt.events[rt.events.length-1];return it&&it[1].type==="listItemIndent"&&it[2].sliceSerialize(it[1],!0).length===rt.containerState.size?o(ot):tt(ot)}}function tokenizeListEnd(et){et.exit(this.containerState.type)}function tokenizeListItemPrefixWhitespace(et,o,tt){const rt=this;return factorySpace(et,nt,"listItemPrefixWhitespace",rt.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function nt(ot){const it=rt.events[rt.events.length-1];return!markdownSpace(ot)&&it&&it[1].type==="listItemPrefixWhitespace"?o(ot):tt(ot)}}const setextUnderline={name:"setextUnderline",tokenize:tokenizeSetextUnderline,resolveTo:resolveToSetextUnderline};function resolveToSetextUnderline(et,o){let tt=et.length,rt,nt,ot;for(;tt--;)if(et[tt][0]==="enter"){if(et[tt][1].type==="content"){rt=tt;break}et[tt][1].type==="paragraph"&&(nt=tt)}else et[tt][1].type==="content"&&et.splice(tt,1),!ot&&et[tt][1].type==="definition"&&(ot=tt);const it={type:"setextHeading",start:Object.assign({},et[nt][1].start),end:Object.assign({},et[et.length-1][1].end)};return et[nt][1].type="setextHeadingText",ot?(et.splice(nt,0,["enter",it,o]),et.splice(ot+1,0,["exit",et[rt][1],o]),et[rt][1].end=Object.assign({},et[ot][1].end)):et[rt][1]=it,et.push(["exit",it,o]),et}function tokenizeSetextUnderline(et,o,tt){const rt=this;let nt;return ot;function ot(ct){let lt=rt.events.length,dt;for(;lt--;)if(rt.events[lt][1].type!=="lineEnding"&&rt.events[lt][1].type!=="linePrefix"&&rt.events[lt][1].type!=="content"){dt=rt.events[lt][1].type==="paragraph";break}return!rt.parser.lazy[rt.now().line]&&(rt.interrupt||dt)?(et.enter("setextHeadingLine"),nt=ct,it(ct)):tt(ct)}function it(ct){return et.enter("setextHeadingLineSequence"),st(ct)}function st(ct){return ct===nt?(et.consume(ct),st):(et.exit("setextHeadingLineSequence"),markdownSpace(ct)?factorySpace(et,at,"lineSuffix")(ct):at(ct))}function at(ct){return ct===null||markdownLineEnding(ct)?(et.exit("setextHeadingLine"),o(ct)):tt(ct)}}const flow$1={tokenize:initializeFlow};function initializeFlow(et){const o=this,tt=et.attempt(blankLine,rt,et.attempt(this.parser.constructs.flowInitial,nt,factorySpace(et,et.attempt(this.parser.constructs.flow,nt,et.attempt(content,nt)),"linePrefix")));return tt;function rt(ot){if(ot===null){et.consume(ot);return}return et.enter("lineEndingBlank"),et.consume(ot),et.exit("lineEndingBlank"),o.currentConstruct=void 0,tt}function nt(ot){if(ot===null){et.consume(ot);return}return et.enter("lineEnding"),et.consume(ot),et.exit("lineEnding"),o.currentConstruct=void 0,tt}}const resolver={resolveAll:createResolver()},string$1=initializeFactory("string"),text$2=initializeFactory("text");function initializeFactory(et){return{tokenize:o,resolveAll:createResolver(et==="text"?resolveAllLineSuffixes:void 0)};function o(tt){const rt=this,nt=this.parser.constructs[et],ot=tt.attempt(nt,it,st);return it;function it(lt){return ct(lt)?ot(lt):st(lt)}function st(lt){if(lt===null){tt.consume(lt);return}return tt.enter("data"),tt.consume(lt),at}function at(lt){return ct(lt)?(tt.exit("data"),ot(lt)):(tt.consume(lt),at)}function ct(lt){if(lt===null)return!0;const dt=nt[lt];let ht=-1;if(dt)for(;++ht-1){const st=it[0];typeof st=="string"?it[0]=st.slice(rt):it.shift()}ot>0&&it.push(et[nt].slice(0,ot))}return it}function serializeChunks(et,o){let tt=-1;const rt=[];let nt;for(;++tt0){const Kt=$t.tokenStack[$t.tokenStack.length-1];(Kt[1]||defaultOnError).call($t,void 0,Kt[0])}for(Tt.position={start:point(ir.length>0?ir[0][1].start:{line:1,column:1,offset:0}),end:point(ir.length>0?ir[ir.length-2][1].end:{line:1,column:1,offset:0})},Dt=-1;++Dt1?"-"+st:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(it)}]};et.patch(o,at);const ct={type:"element",tagName:"sup",properties:{},children:[at]};return et.patch(o,ct),et.applyData(o,ct)}function heading(et,o){const tt={type:"element",tagName:"h"+o.depth,properties:{},children:et.all(o)};return et.patch(o,tt),et.applyData(o,tt)}function html(et,o){if(et.options.allowDangerousHtml){const tt={type:"raw",value:o.value};return et.patch(o,tt),et.applyData(o,tt)}}function revert(et,o){const tt=o.referenceType;let rt="]";if(tt==="collapsed"?rt+="[]":tt==="full"&&(rt+="["+(o.label||o.identifier)+"]"),o.type==="imageReference")return[{type:"text",value:"!["+o.alt+rt}];const nt=et.all(o),ot=nt[0];ot&&ot.type==="text"?ot.value="["+ot.value:nt.unshift({type:"text",value:"["});const it=nt[nt.length-1];return it&&it.type==="text"?it.value+=rt:nt.push({type:"text",value:rt}),nt}function imageReference(et,o){const tt=String(o.identifier).toUpperCase(),rt=et.definitionById.get(tt);if(!rt)return revert(et,o);const nt={src:normalizeUri(rt.url||""),alt:o.alt};rt.title!==null&&rt.title!==void 0&&(nt.title=rt.title);const ot={type:"element",tagName:"img",properties:nt,children:[]};return et.patch(o,ot),et.applyData(o,ot)}function image(et,o){const tt={src:normalizeUri(o.url)};o.alt!==null&&o.alt!==void 0&&(tt.alt=o.alt),o.title!==null&&o.title!==void 0&&(tt.title=o.title);const rt={type:"element",tagName:"img",properties:tt,children:[]};return et.patch(o,rt),et.applyData(o,rt)}function inlineCode(et,o){const tt={type:"text",value:o.value.replace(/\r?\n|\r/g," ")};et.patch(o,tt);const rt={type:"element",tagName:"code",properties:{},children:[tt]};return et.patch(o,rt),et.applyData(o,rt)}function linkReference(et,o){const tt=String(o.identifier).toUpperCase(),rt=et.definitionById.get(tt);if(!rt)return revert(et,o);const nt={href:normalizeUri(rt.url||"")};rt.title!==null&&rt.title!==void 0&&(nt.title=rt.title);const ot={type:"element",tagName:"a",properties:nt,children:et.all(o)};return et.patch(o,ot),et.applyData(o,ot)}function link(et,o){const tt={href:normalizeUri(o.url)};o.title!==null&&o.title!==void 0&&(tt.title=o.title);const rt={type:"element",tagName:"a",properties:tt,children:et.all(o)};return et.patch(o,rt),et.applyData(o,rt)}function listItem(et,o,tt){const rt=et.all(o),nt=tt?listLoose(tt):listItemLoose(o),ot={},it=[];if(typeof o.checked=="boolean"){const lt=rt[0];let dt;lt&<.type==="element"&<.tagName==="p"?dt=lt:(dt={type:"element",tagName:"p",properties:{},children:[]},rt.unshift(dt)),dt.children.length>0&&dt.children.unshift({type:"text",value:" "}),dt.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:o.checked,disabled:!0},children:[]}),ot.className=["task-list-item"]}let st=-1;for(;++st1}function list(et,o){const tt={},rt=et.all(o);let nt=-1;for(typeof o.start=="number"&&o.start!==1&&(tt.start=o.start);++nt0){const it={type:"element",tagName:"tbody",properties:{},children:et.wrap(tt,!0)},st=pointStart(o.children[1]),at=pointEnd(o.children[o.children.length-1]);st&&at&&(it.position={start:st,end:at}),nt.push(it)}const ot={type:"element",tagName:"table",properties:{},children:et.wrap(nt,!0)};return et.patch(o,ot),et.applyData(o,ot)}function tableRow(et,o,tt){const rt=tt?tt.children:void 0,ot=(rt?rt.indexOf(o):1)===0?"th":"td",it=tt&&tt.type==="table"?tt.align:void 0,st=it?it.length:o.children.length;let at=-1;const ct=[];for(;++at0,!0),rt[0]),nt=rt.index+rt[0].length,rt=tt.exec(o);return ot.push(trimLine(o.slice(nt),nt>0,!1)),ot.join("")}function trimLine(et,o,tt){let rt=0,nt=et.length;if(o){let ot=et.codePointAt(rt);for(;ot===tab||ot===space;)rt++,ot=et.codePointAt(rt)}if(tt){let ot=et.codePointAt(nt-1);for(;ot===tab||ot===space;)nt--,ot=et.codePointAt(nt-1)}return nt>rt?et.slice(rt,nt):""}function text(et,o){const tt={type:"text",value:trimLines(String(o.value))};return et.patch(o,tt),et.applyData(o,tt)}function thematicBreak(et,o){const tt={type:"element",tagName:"hr",properties:{},children:[]};return et.patch(o,tt),et.applyData(o,tt)}const handlers={blockquote,break:hardBreak,code,delete:strikethrough,emphasis,footnoteReference,heading,html,imageReference,image,inlineCode,linkReference,link,listItem,list,paragraph,root,strong,table,tableCell,tableRow,text,thematicBreak,toml:ignore,yaml:ignore,definition:ignore,footnoteDefinition:ignore};function ignore(){}const VOID=-1,PRIMITIVE=0,ARRAY=1,OBJECT=2,DATE=3,REGEXP=4,MAP=5,SET=6,ERROR=7,BIGINT=8,env=typeof self=="object"?self:globalThis,deserializer=(et,o)=>{const tt=(nt,ot)=>(et.set(ot,nt),nt),rt=nt=>{if(et.has(nt))return et.get(nt);const[ot,it]=o[nt];switch(ot){case PRIMITIVE:case VOID:return tt(it,nt);case ARRAY:{const st=tt([],nt);for(const at of it)st.push(rt(at));return st}case OBJECT:{const st=tt({},nt);for(const[at,ct]of it)st[rt(at)]=rt(ct);return st}case DATE:return tt(new Date(it),nt);case REGEXP:{const{source:st,flags:at}=it;return tt(new RegExp(st,at),nt)}case MAP:{const st=tt(new Map,nt);for(const[at,ct]of it)st.set(rt(at),rt(ct));return st}case SET:{const st=tt(new Set,nt);for(const at of it)st.add(rt(at));return st}case ERROR:{const{name:st,message:at}=it;return tt(new env[st](at),nt)}case BIGINT:return tt(BigInt(it),nt);case"BigInt":return tt(Object(BigInt(it)),nt)}return tt(new env[ot](it),nt)};return rt},deserialize=et=>deserializer(new Map,et)(0),EMPTY="",{toString}={},{keys}=Object,typeOf=et=>{const o=typeof et;if(o!=="object"||!et)return[PRIMITIVE,o];const tt=toString.call(et).slice(8,-1);switch(tt){case"Array":return[ARRAY,EMPTY];case"Object":return[OBJECT,EMPTY];case"Date":return[DATE,EMPTY];case"RegExp":return[REGEXP,EMPTY];case"Map":return[MAP,EMPTY];case"Set":return[SET,EMPTY]}return tt.includes("Array")?[ARRAY,tt]:tt.includes("Error")?[ERROR,tt]:[OBJECT,tt]},shouldSkip=([et,o])=>et===PRIMITIVE&&(o==="function"||o==="symbol"),serializer=(et,o,tt,rt)=>{const nt=(it,st)=>{const at=rt.push(it)-1;return tt.set(st,at),at},ot=it=>{if(tt.has(it))return tt.get(it);let[st,at]=typeOf(it);switch(st){case PRIMITIVE:{let lt=it;switch(at){case"bigint":st=BIGINT,lt=it.toString();break;case"function":case"symbol":if(et)throw new TypeError("unable to serialize "+at);lt=null;break;case"undefined":return nt([VOID],it)}return nt([st,lt],it)}case ARRAY:{if(at)return nt([at,[...it]],it);const lt=[],dt=nt([st,lt],it);for(const ht of it)lt.push(ot(ht));return dt}case OBJECT:{if(at)switch(at){case"BigInt":return nt([at,it.toString()],it);case"Boolean":case"Number":case"String":return nt([at,it.valueOf()],it)}if(o&&"toJSON"in it)return ot(it.toJSON());const lt=[],dt=nt([st,lt],it);for(const ht of keys(it))(et||!shouldSkip(typeOf(it[ht])))&<.push([ot(ht),ot(it[ht])]);return dt}case DATE:return nt([st,it.toISOString()],it);case REGEXP:{const{source:lt,flags:dt}=it;return nt([st,{source:lt,flags:dt}],it)}case MAP:{const lt=[],dt=nt([st,lt],it);for(const[ht,mt]of it)(et||!(shouldSkip(typeOf(ht))||shouldSkip(typeOf(mt))))&<.push([ot(ht),ot(mt)]);return dt}case SET:{const lt=[],dt=nt([st,lt],it);for(const ht of it)(et||!shouldSkip(typeOf(ht)))&<.push(ot(ht));return dt}}const{message:ct}=it;return nt([st,{name:at,message:ct}],it)};return ot},serialize=(et,{json:o,lossy:tt}={})=>{const rt=[];return serializer(!(o||tt),!!o,new Map,rt)(et),rt},structuredClone$1=typeof structuredClone=="function"?(et,o)=>o&&("json"in o||"lossy"in o)?deserialize(serialize(et,o)):structuredClone(et):(et,o)=>deserialize(serialize(et,o));function defaultFootnoteBackContent(et,o){const tt=[{type:"text",value:"↩"}];return o>1&&tt.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(o)}]}),tt}function defaultFootnoteBackLabel(et,o){return"Back to reference "+(et+1)+(o>1?"-"+o:"")}function footer(et){const o=typeof et.options.clobberPrefix=="string"?et.options.clobberPrefix:"user-content-",tt=et.options.footnoteBackContent||defaultFootnoteBackContent,rt=et.options.footnoteBackLabel||defaultFootnoteBackLabel,nt=et.options.footnoteLabel||"Footnotes",ot=et.options.footnoteLabelTagName||"h2",it=et.options.footnoteLabelProperties||{className:["sr-only"]},st=[];let at=-1;for(;++at0&&ft.push({type:"text",value:" "});let bt=typeof tt=="string"?tt:tt(at,mt);typeof bt=="string"&&(bt={type:"text",value:bt}),ft.push({type:"element",tagName:"a",properties:{href:"#"+o+"fnref-"+ht+(mt>1?"-"+mt:""),dataFootnoteBackref:"",ariaLabel:typeof rt=="string"?rt:rt(at,mt),className:["data-footnote-backref"]},children:Array.isArray(bt)?bt:[bt]})}const yt=lt[lt.length-1];if(yt&&yt.type==="element"&&yt.tagName==="p"){const bt=yt.children[yt.children.length-1];bt&&bt.type==="text"?bt.value+=" ":yt.children.push({type:"text",value:" "}),yt.children.push(...ft)}else lt.push(...ft);const gt={type:"element",tagName:"li",properties:{id:o+"fn-"+ht},children:et.wrap(lt,!0)};et.patch(ct,gt),st.push(gt)}if(st.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:ot,properties:{...structuredClone$1(it),id:"footnote-label"},children:[{type:"text",value:nt}]},{type:"text",value:` -`},{type:"element",tagName:"ol",properties:{},children:et.wrap(st,!0)},{type:"text",value:` -`}]}}const convert=function(et){if(et==null)return ok;if(typeof et=="function")return castFactory(et);if(typeof et=="object")return Array.isArray(et)?anyFactory(et):propsFactory(et);if(typeof et=="string")return typeFactory(et);throw new Error("Expected function, string, or object as test")};function anyFactory(et){const o=[];let tt=-1;for(;++tt":""))+")"})}return ht;function ht(){let mt=empty,ft,pt,yt;if((!o||ot(at,ct,lt[lt.length-1]||void 0))&&(mt=toResult(tt(at,lt)),mt[0]===EXIT))return mt;if("children"in at&&at.children){const gt=at;if(gt.children&&mt[0]!==SKIP)for(pt=(rt?gt.children.length:-1)+it,yt=lt.concat(gt);pt>-1&&pt0&&tt.push({type:"text",value:` -`}),tt}function trimMarkdownSpaceStart(et){let o=0,tt=et.charCodeAt(o);for(;tt===9||tt===32;)o++,tt=et.charCodeAt(o);return et.slice(o)}function toHast(et,o){const tt=createState(et,o),rt=tt.one(et,void 0),nt=footer(tt),ot=Array.isArray(rt)?{type:"root",children:rt}:rt||{type:"root",children:[]};return nt&&ot.children.push({type:"text",value:` -`},nt),ot}function remarkRehype(et,o){return et&&"run"in et?async function(tt,rt){const nt=toHast(tt,{file:rt,...o});await et.run(nt,rt)}:function(tt,rt){return toHast(tt,{file:rt,...et||o})}}function bail(et){if(et)throw et}var hasOwn=Object.prototype.hasOwnProperty,toStr=Object.prototype.toString,defineProperty=Object.defineProperty,gOPD=Object.getOwnPropertyDescriptor,isArray=function et(o){return typeof Array.isArray=="function"?Array.isArray(o):toStr.call(o)==="[object Array]"},isPlainObject$1=function et(o){if(!o||toStr.call(o)!=="[object Object]")return!1;var tt=hasOwn.call(o,"constructor"),rt=o.constructor&&o.constructor.prototype&&hasOwn.call(o.constructor.prototype,"isPrototypeOf");if(o.constructor&&!tt&&!rt)return!1;var nt;for(nt in o);return typeof nt>"u"||hasOwn.call(o,nt)},setProperty=function et(o,tt){defineProperty&&tt.name==="__proto__"?defineProperty(o,tt.name,{enumerable:!0,configurable:!0,value:tt.newValue,writable:!0}):o[tt.name]=tt.newValue},getProperty=function et(o,tt){if(tt==="__proto__")if(hasOwn.call(o,tt)){if(gOPD)return gOPD(o,tt).value}else return;return o[tt]},extend=function et(){var o,tt,rt,nt,ot,it,st=arguments[0],at=1,ct=arguments.length,lt=!1;for(typeof st=="boolean"&&(lt=st,st=arguments[1]||{},at=2),(st==null||typeof st!="object"&&typeof st!="function")&&(st={});atit.length;let at;st&&it.push(nt);try{at=et.apply(this,it)}catch(ct){const lt=ct;if(st&&tt)throw lt;return nt(lt)}st||(at&&at.then&&typeof at.then=="function"?at.then(ot,nt):at instanceof Error?nt(at):ot(at))}function nt(it,...st){tt||(tt=!0,o(it,...st))}function ot(it){nt(null,it)}}const minpath={basename,dirname,extname,join,sep:"/"};function basename(et,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');assertPath$1(et);let tt=0,rt=-1,nt=et.length,ot;if(o===void 0||o.length===0||o.length>et.length){for(;nt--;)if(et.codePointAt(nt)===47){if(ot){tt=nt+1;break}}else rt<0&&(ot=!0,rt=nt+1);return rt<0?"":et.slice(tt,rt)}if(o===et)return"";let it=-1,st=o.length-1;for(;nt--;)if(et.codePointAt(nt)===47){if(ot){tt=nt+1;break}}else it<0&&(ot=!0,it=nt+1),st>-1&&(et.codePointAt(nt)===o.codePointAt(st--)?st<0&&(rt=nt):(st=-1,rt=it));return tt===rt?rt=it:rt<0&&(rt=et.length),et.slice(tt,rt)}function dirname(et){if(assertPath$1(et),et.length===0)return".";let o=-1,tt=et.length,rt;for(;--tt;)if(et.codePointAt(tt)===47){if(rt){o=tt;break}}else rt||(rt=!0);return o<0?et.codePointAt(0)===47?"/":".":o===1&&et.codePointAt(0)===47?"//":et.slice(0,o)}function extname(et){assertPath$1(et);let o=et.length,tt=-1,rt=0,nt=-1,ot=0,it;for(;o--;){const st=et.codePointAt(o);if(st===47){if(it){rt=o+1;break}continue}tt<0&&(it=!0,tt=o+1),st===46?nt<0?nt=o:ot!==1&&(ot=1):nt>-1&&(ot=-1)}return nt<0||tt<0||ot===0||ot===1&&nt===tt-1&&nt===rt+1?"":et.slice(nt,tt)}function join(...et){let o=-1,tt;for(;++o0&&et.codePointAt(et.length-1)===47&&(tt+="/"),o?"/"+tt:tt}function normalizeString(et,o){let tt="",rt=0,nt=-1,ot=0,it=-1,st,at;for(;++it<=et.length;){if(it2){if(at=tt.lastIndexOf("/"),at!==tt.length-1){at<0?(tt="",rt=0):(tt=tt.slice(0,at),rt=tt.length-1-tt.lastIndexOf("/")),nt=it,ot=0;continue}}else if(tt.length>0){tt="",rt=0,nt=it,ot=0;continue}}o&&(tt=tt.length>0?tt+"/..":"..",rt=2)}else tt.length>0?tt+="/"+et.slice(nt+1,it):tt=et.slice(nt+1,it),rt=it-nt-1;nt=it,ot=0}else st===46&&ot>-1?ot++:ot=-1}return tt}function assertPath$1(et){if(typeof et!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(et))}const minproc={cwd};function cwd(){return"/"}function isUrl(et){return!!(et!==null&&typeof et=="object"&&"href"in et&&et.href&&"protocol"in et&&et.protocol&&et.auth===void 0)}function urlToPath(et){if(typeof et=="string")et=new URL(et);else if(!isUrl(et)){const o=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+et+"`");throw o.code="ERR_INVALID_ARG_TYPE",o}if(et.protocol!=="file:"){const o=new TypeError("The URL must be of scheme file");throw o.code="ERR_INVALID_URL_SCHEME",o}return getPathFromURLPosix(et)}function getPathFromURLPosix(et){if(et.hostname!==""){const rt=new TypeError('File URL host must be "localhost" or empty on darwin');throw rt.code="ERR_INVALID_FILE_URL_HOST",rt}const o=et.pathname;let tt=-1;for(;++tt0){let[mt,...ft]=lt;const pt=rt[ht][1];isPlainObject(pt)&&isPlainObject(mt)&&(mt=extend$1(!0,pt,mt)),rt[ht]=[ct,mt,...ft]}}}}const unified=new Processor().freeze();function assertParser(et,o){if(typeof o!="function")throw new TypeError("Cannot `"+et+"` without `parser`")}function assertCompiler(et,o){if(typeof o!="function")throw new TypeError("Cannot `"+et+"` without `compiler`")}function assertUnfrozen(et,o){if(o)throw new Error("Cannot call `"+et+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function assertNode(et){if(!isPlainObject(et)||typeof et.type!="string")throw new TypeError("Expected node, got `"+et+"`")}function assertDone(et,o,tt){if(!tt)throw new Error("`"+et+"` finished async. Use `"+o+"` instead")}function vfile(et){return looksLikeAVFile(et)?et:new VFile(et)}function looksLikeAVFile(et){return!!(et&&typeof et=="object"&&"message"in et&&"messages"in et)}function looksLikeAValue(et){return typeof et=="string"||isUint8Array(et)}function isUint8Array(et){return!!(et&&typeof et=="object"&&"byteLength"in et&&"byteOffset"in et)}const changelog="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",emptyPlugins=[],emptyRemarkRehypeOptions={allowDangerousHtml:!0},safeProtocol=/^(https?|ircs?|mailto|xmpp)$/i,deprecations=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Markdown(et){const o=et.allowedElements,tt=et.allowElement,rt=et.children||"",nt=et.className,ot=et.components,it=et.disallowedElements,st=et.rehypePlugins||emptyPlugins,at=et.remarkPlugins||emptyPlugins,ct=et.remarkRehypeOptions?{...et.remarkRehypeOptions,...emptyRemarkRehypeOptions}:emptyRemarkRehypeOptions,lt=et.skipHtml,dt=et.unwrapDisallowed,ht=et.urlTransform||defaultUrlTransform,mt=unified().use(remarkParse).use(at).use(remarkRehype,ct).use(st),ft=new VFile;typeof rt=="string"&&(ft.value=rt);for(const bt of deprecations)Object.hasOwn(et,bt.from)&&(""+bt.from+(bt.to?"use `"+bt.to+"` instead":"remove it")+changelog+bt.id,void 0);const pt=mt.parse(ft);let yt=mt.runSync(pt,ft);return nt&&(yt={type:"element",tagName:"div",properties:{className:nt},children:yt.type==="root"?yt.children:[yt]}),visit(yt,gt),toJsxRuntime(yt,{Fragment:jsxRuntimeExports.Fragment,components:ot,ignoreInvalidStyle:!0,jsx:jsxRuntimeExports.jsx,jsxs:jsxRuntimeExports.jsxs,passKeys:!0,passNode:!0});function gt(bt,xt,vt){if(bt.type==="raw"&&vt&&typeof xt=="number")return lt?vt.children.splice(xt,1):vt.children[xt]={type:"text",value:bt.value},xt;if(bt.type==="element"){let Et;for(Et in urlAttributes)if(Object.hasOwn(urlAttributes,Et)&&Object.hasOwn(bt.properties,Et)){const Ct=bt.properties[Et],St=urlAttributes[Et];(St===null||St.includes(bt.tagName))&&(bt.properties[Et]=ht(String(Ct||""),Et,bt))}}if(bt.type==="element"){let Et=o?!o.includes(bt.tagName):it?it.includes(bt.tagName):!1;if(!Et&&tt&&typeof xt=="number"&&(Et=!tt(bt,xt,vt)),Et&&vt&&typeof xt=="number")return dt&&bt.children?vt.children.splice(xt,1,...bt.children):vt.children.splice(xt,1),xt}}}function defaultUrlTransform(et){const o=et.indexOf(":"),tt=et.indexOf("?"),rt=et.indexOf("#"),nt=et.indexOf("/");return o<0||nt>-1&&o>nt||tt>-1&&o>tt||rt>-1&&o>rt||safeProtocol.test(et.slice(0,o))?et:""}const PrivacyPolicyOptIn=({onOptIn:et})=>{const[o,tt]=reactExports.useState(!1);return jsxRuntimeExports.jsxs("div",{className:"min-h-screen flex items-center justify-center bg-background p-4",children:[jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-md",children:[jsxRuntimeExports.jsx(CardHeader,{className:"space-y-2",children:jsxRuntimeExports.jsx(CardTitle,{className:"text-xl sm:text-2xl",children:"Privacy Policy & Data Collection"})}),jsxRuntimeExports.jsx(CardContent,{children:jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"We collect data to improve our services. This data is anonymous and helps us understand how our application is used. You can opt-in or opt-out of this data collection."}),jsxRuntimeExports.jsx(Button,{variant:"link",onClick:()=>tt(!0),className:"px-0 text-sm sm:text-base",children:"View Full Privacy Policy"})]})}),jsxRuntimeExports.jsxs(CardFooter,{className:"flex flex-col sm:flex-row gap-3 sm:gap-4",children:[jsxRuntimeExports.jsx(Button,{variant:"outline",onClick:()=>et(!1),className:"w-full sm:w-auto",children:"Opt Out"}),jsxRuntimeExports.jsx(Button,{onClick:()=>et(!0),className:"w-full sm:w-auto",children:"Opt In"})]})]}),jsxRuntimeExports.jsx(Dialog,{open:o,onOpenChange:tt,children:jsxRuntimeExports.jsxs(DialogContent,{className:"w-[95vw] max-w-4xl max-h-[90vh] p-4 sm:p-6",children:[jsxRuntimeExports.jsx(DialogHeader,{children:jsxRuntimeExports.jsx(DialogTitle,{className:"text-xl sm:text-2xl",children:"Privacy Policy"})}),jsxRuntimeExports.jsx(ScrollArea,{className:"mt-4 h-[50vh] sm:h-[60vh]",children:jsxRuntimeExports.jsx(DialogDescription,{className:"space-y-4",children:jsxRuntimeExports.jsx(Markdown,{className:"prose dark:prose-invert max-w-none text-sm sm:text-base",children:privacyPolicy})})})]})})]})},PrivacyPolicyPage=()=>{const[et,o]=reactExports.useState(!1);reactExports.useEffect(()=>{const rt=localStorage.getItem("privacyPolicyOptIn");rt!==null&&o(rt==="true")},[]);const tt=()=>{const rt=!et;o(rt),localStorage.setItem("privacyPolicyOptIn",rt.toString())};return jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-4xl mx-auto p-4 sm:p-6",children:[jsxRuntimeExports.jsx(CardHeader,{className:"space-y-2",children:jsxRuntimeExports.jsx(CardTitle,{className:"text-2xl sm:text-3xl",children:"Privacy Policy Settings"})}),jsxRuntimeExports.jsx(CardContent,{children:jsxRuntimeExports.jsxs("div",{className:"space-y-6 sm:space-y-8",children:[jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsx("p",{className:"text-sm sm:text-base text-muted-foreground",children:"We collect data to improve our services. This data is anonymous and helps us understand how our application is used."}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[jsxRuntimeExports.jsxs("p",{className:"font-semibold",children:["Current status: ",et?"Opted In":"Opted Out"]}),jsxRuntimeExports.jsx(Button,{onClick:tt,className:"w-full sm:w-auto",children:et?"Opt Out":"Opt In"})]})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{className:"text-lg sm:text-xl font-semibold mb-4",children:"Privacy Policy"}),jsxRuntimeExports.jsx(ScrollArea,{className:"h-[50vh] sm:h-[60vh] border rounded-md p-2 sm:p-4",children:jsxRuntimeExports.jsx(Markdown,{className:"prose dark:prose-invert max-w-none text-sm sm:text-base",children:privacyPolicy})})]})]})})]})},SignSharedChain=({chainsData:et,onChainUpdate:o,isLoading:tt})=>{const{chainUUID:rt,blockUUID:nt}=useParams(),[ot,it]=reactExports.useState(null),st=useNavigate();return reactExports.useEffect(()=>{const at=et.find(ct=>ct.chainUUID===rt&&ct.blockUUID===nt);at&&it(at)},[et,rt,nt]),tt&&!ot?jsxRuntimeExports.jsx(Card,{className:"w-full max-w-md mx-auto",children:jsxRuntimeExports.jsxs(CardContent,{className:"flex flex-col items-center justify-center py-8 space-y-4",children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin"}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:"Looking for chain..."})]})}):ot?jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-2xl mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:"Sign Shared Chain"})}),jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsx("h2",{className:"text-xl font-semibold mb-2",children:ot.title}),jsxRuntimeExports.jsx("p",{className:"mb-4",children:ot.description}),jsxRuntimeExports.jsx(SignChain,{block:ot,chainsData:et,onSuccess:o})]})]}):jsxRuntimeExports.jsxs(Card,{className:"w-full max-w-md mx-auto",children:[jsxRuntimeExports.jsx(CardHeader,{children:jsxRuntimeExports.jsx(CardTitle,{children:"Chain Not Found"})}),jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsx("p",{className:"mb-4",children:"The requested chain or block could not be found."}),jsxRuntimeExports.jsx(Button,{onClick:()=>st("/view"),children:"View All Chains"})]})]})};function App(){const[et,o]=reactExports.useState(!1),[tt,rt]=reactExports.useState([]),{isLoading:nt,error:ot,node:it}=useWaku(),[st,at]=reactExports.useState({filter:"in-progress",store:"in-progress"}),[ct,lt]=reactExports.useState(null),[dt,ht]=reactExports.useState(!0);reactExports.useEffect(()=>{const yt=localStorage.getItem("telemetryOptIn");yt!==null&<(yt==="true")},[]),reactExports.useEffect(()=>{nt||!it||it.libp2p.getConnections().length===0||tt.length>0||et||(o(!0),ft())},[it,nt,st]);const mt=yt=>{lt(yt),localStorage.setItem("telemetryOptIn",yt.toString())};if(nt)return jsxRuntimeExports.jsx("div",{className:"min-h-screen bg-background text-foreground",children:jsxRuntimeExports.jsxs("div",{className:"container mx-auto px-4 py-16 flex flex-col items-center justify-center space-y-4",children:[jsxRuntimeExports.jsx("h1",{className:"text-2xl md:text-4xl font-bold",children:"BuddyBook"}),jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center space-y-2",children:[jsxRuntimeExports.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin"}),jsxRuntimeExports.jsx("p",{className:"text-muted-foreground",children:"Connecting to Waku's decentralized network..."})]})]})});const ft=async()=>{console.log("Starting message listening");try{at(gt=>({...gt,store:"in-progress"})),ht(!0);const yt=getMessagesFromStore(it);try{for await(const gt of yt)rt(bt=>bt.some(vt=>vt.blockUUID===gt.blockUUID)?bt:[...bt,gt])}catch(gt){console.error("Error processing message:",gt)}at(gt=>({...gt,store:"success"}))}catch(yt){console.error("Error fetching messages from store:",yt),at(gt=>({...gt,store:"error"}))}finally{ht(!1)}try{at(yt=>({...yt,filter:"in-progress"})),await subscribeToFilter(it,yt=>{pt(yt)}),at(yt=>({...yt,filter:"success"}))}catch(yt){console.error("Error subscribing to filter:",yt),at(gt=>({...gt,filter:"error"}))}};if(ot)return console.error("Waku error:",ot),jsxRuntimeExports.jsxs("div",{className:"min-h-screen bg-background text-foreground flex flex-col justify-center items-center",children:[jsxRuntimeExports.jsx("p",{className:"text-red-500",children:"Error connecting to Waku network"}),jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:ot.toString()})]});const pt=yt=>{rt(gt=>gt.some(xt=>xt.blockUUID===yt.blockUUID)?gt:[...gt,yt])};return ct===null?jsxRuntimeExports.jsx(PrivacyPolicyOptIn,{onOptIn:mt}):jsxRuntimeExports.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[jsxRuntimeExports.jsx(Header,{wakuStatus:st}),jsxRuntimeExports.jsx("main",{className:"container mx-auto px-4 py-4 md:py-8 max-w-7xl",children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{path:"",element:jsxRuntimeExports.jsx(Home,{})}),jsxRuntimeExports.jsx(Route,{path:"create",element:jsxRuntimeExports.jsx(ChainCreationForm,{})}),jsxRuntimeExports.jsx(Route,{path:"view",element:jsxRuntimeExports.jsx(ChainList,{chainsData:tt,onChainUpdate:pt,isLoading:dt})}),jsxRuntimeExports.jsx(Route,{path:"sign/:chainUUID/:blockUUID",element:jsxRuntimeExports.jsx(SignSharedChain,{chainsData:tt,onChainUpdate:pt,isLoading:dt})}),jsxRuntimeExports.jsx(Route,{path:"telemetry",element:jsxRuntimeExports.jsx(PrivacyPolicyPage,{})}),jsxRuntimeExports.jsx(Route,{path:"*",element:jsxRuntimeExports.jsx(Navigate,{to:"",replace:!0})})]})})]})}const Home=()=>jsxRuntimeExports.jsxs("div",{className:"space-y-4 md:space-y-6 p-4 md:p-6",children:[jsxRuntimeExports.jsx("h1",{className:"text-2xl md:text-4xl font-bold",children:"BuddyBook"}),jsxRuntimeExports.jsxs("div",{className:"w-full max-w-sm mx-auto p-4 md:p-6 bg-card rounded-lg shadow-md",children:[jsxRuntimeExports.jsx(Link,{to:"create",children:jsxRuntimeExports.jsx(Button,{className:"w-full mb-4",children:"Create New Chain"})}),jsxRuntimeExports.jsx("p",{className:"text-sm md:text-base text-muted-foreground",children:"Click the button above to start creating a new chain."})]}),jsxRuntimeExports.jsx("p",{className:"text-xs md:text-sm text-muted-foreground text-center",children:"Welcome to BuddyBook - Create and share your chains!"})]}),projectId="1d93edc21291f98e3bed6ff7617ff539",config=createConfig(defaultConfig({appName:"BuddyBook",walletConnectProjectId:projectId,chains:[mainnet],transports:{[mainnet.id]:http()}})),WAKU_NODE_OPTIONS={defaultBootstrap:!0,protocols:[Protocols.Store,Protocols.Filter,Protocols.LightPush]};typeof globalThis>"u"&&(window.global=window);typeof buffer$2.Buffer>"u"&&(window.Buffer=buffer$2.Buffer);const queryClient=new QueryClient;createRoot(document.getElementById("root")).render(jsxRuntimeExports.jsx(reactExports.StrictMode,{children:jsxRuntimeExports.jsx(WagmiProvider,{config,children:jsxRuntimeExports.jsx(QueryClientProvider,{client:queryClient,children:jsxRuntimeExports.jsx(ConnectKitProvider,{children:jsxRuntimeExports.jsx(LightNodeProvider,{options:WAKU_NODE_OPTIONS,children:jsxRuntimeExports.jsx(BrowserRouter,{basename:"/",children:jsxRuntimeExports.jsx(App,{})})})})})})}));export{isHex as A,BytesSizeMismatchError as B,dijkstraExports as C,EventEmitter$1 as E,HttpRequestError as H,InvalidAddressError as I,__vitePreload as _,stringToHex as a,bytesToHex$3 as b,concat$6 as c,commonjsGlobal as d,encodeAbiParameters as e,encodeFunctionData as f,getAugmentedNamespace as g,getDefaultExportFromCjs as h,isAddress as i,browserExports as j,keccak256$1 as k,tslib_es6$1 as l,buffer$2 as m,numberToHex as n,allocUnsafe$h as o,BASES$1 as p,fromString$2 as q,detect as r,size$2 as s,toHex as t,__viteBrowserExternal$1 as u,BaseError$3 as v,getUrl as w,stringify$2 as x,decodeErrorResult as y,call as z}; diff --git a/buddybook/assets/index-c_vQ90mY.js b/buddybook/assets/index-c_vQ90mY.js new file mode 100644 index 0000000..a702002 --- /dev/null +++ b/buddybook/assets/index-c_vQ90mY.js @@ -0,0 +1 @@ +import{h as p}from"./index-Cye4tEiE.js";import{e as _}from"./events-EbrwmdBG.js";function m(n,a){for(var i=0;ie[s]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}var l={},g={},f={};Object.defineProperty(f,"__esModule",{value:!0});f.getLowerCase=void 0;function w(n){return n&&n.toLowerCase()}f.getLowerCase=w;Object.defineProperty(g,"__esModule",{value:!0});g.SafeAppProvider=void 0;const k=_,u=f;class y extends k.EventEmitter{constructor(a,i){super(),this.submittedTxs=new Map,this.safe=a,this.sdk=i}async connect(){this.emit("connect",{chainId:this.chainId})}async disconnect(){}get chainId(){return this.safe.chainId}async request(a){const{method:i,params:e=[]}=a;switch(i){case"eth_accounts":return[this.safe.safeAddress];case"net_version":case"eth_chainId":return`0x${this.chainId.toString(16)}`;case"personal_sign":{const[t,r]=e;if(this.safe.safeAddress.toLowerCase()!==r.toLowerCase())throw new Error("The address or message hash is invalid");const h=await this.sdk.txs.signMessage(t);return("signature"in h?h.signature:void 0)||"0x"}case"eth_sign":{const[t,r]=e;if(this.safe.safeAddress.toLowerCase()!==t.toLowerCase()||!r.startsWith("0x"))throw new Error("The address or message hash is invalid");const h=await this.sdk.txs.signMessage(r);return("signature"in h?h.signature:void 0)||"0x"}case"eth_signTypedData":case"eth_signTypedData_v4":{const[t,r]=e,h=typeof r=="string"?JSON.parse(r):r;if(this.safe.safeAddress.toLowerCase()!==t.toLowerCase())throw new Error("The address is invalid");const c=await this.sdk.txs.signTypedMessage(h);return("signature"in c?c.signature:void 0)||"0x"}case"eth_sendTransaction":const s={...e[0],value:e[0].value||"0",data:e[0].data||"0x"};typeof s.gas=="string"&&s.gas.startsWith("0x")&&(s.gas=parseInt(s.gas,16));const o=await this.sdk.txs.send({txs:[s],params:{safeTxGas:s.gas}});return this.submittedTxs.set(o.safeTxHash,{from:this.safe.safeAddress,hash:o.safeTxHash,gas:0,gasPrice:"0x00",nonce:0,input:s.data,value:s.value,to:s.to,blockHash:null,blockNumber:null,transactionIndex:null}),o.safeTxHash;case"eth_blockNumber":return(await this.sdk.eth.getBlockByNumber(["latest"])).number;case"eth_getBalance":return this.sdk.eth.getBalance([(0,u.getLowerCase)(e[0]),e[1]]);case"eth_getCode":return this.sdk.eth.getCode([(0,u.getLowerCase)(e[0]),e[1]]);case"eth_getTransactionCount":return this.sdk.eth.getTransactionCount([(0,u.getLowerCase)(e[0]),e[1]]);case"eth_getStorageAt":return this.sdk.eth.getStorageAt([(0,u.getLowerCase)(e[0]),e[1],e[2]]);case"eth_getBlockByNumber":return this.sdk.eth.getBlockByNumber([e[0],e[1]]);case"eth_getBlockByHash":return this.sdk.eth.getBlockByHash([e[0],e[1]]);case"eth_getTransactionByHash":let d=e[0];try{d=(await this.sdk.txs.getBySafeTxHash(d)).txHash||d}catch{}return this.submittedTxs.has(d)?this.submittedTxs.get(d):this.sdk.eth.getTransactionByHash([d]).then(t=>(t&&(t.hash=e[0]),t));case"eth_getTransactionReceipt":{let t=e[0];try{t=(await this.sdk.txs.getBySafeTxHash(t)).txHash||t}catch{}return this.sdk.eth.getTransactionReceipt([t]).then(r=>(r&&(r.transactionHash=e[0]),r))}case"eth_estimateGas":return this.sdk.eth.getEstimateGas(e[0]);case"eth_call":return this.sdk.eth.call([e[0],e[1]]);case"eth_getLogs":return this.sdk.eth.getPastLogs([e[0]]);case"eth_gasPrice":return this.sdk.eth.getGasPrice();case"wallet_getPermissions":return this.sdk.wallet.getPermissions();case"wallet_requestPermissions":return this.sdk.wallet.requestPermissions(e[0]);case"safe_setSettings":return this.sdk.eth.setSafeSettings([e[0]]);default:throw Error(`"${a.method}" not implemented`)}}send(a,i){a||i("Undefined request"),this.request(a).then(e=>i(null,{jsonrpc:"2.0",id:a.id,result:e})).catch(e=>i(e,null))}}g.SafeAppProvider=y;(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.SafeAppProvider=void 0;var a=g;Object.defineProperty(n,"SafeAppProvider",{enumerable:!0,get:function(){return a.SafeAppProvider}})})(l);const x=p(l),C=m({__proto__:null,default:x},[l]);export{C as i}; diff --git a/buddybook/assets/index.es-BocJIoGE.js b/buddybook/assets/index.es-BocJIoGE.js new file mode 100644 index 0000000..8be2b86 --- /dev/null +++ b/buddybook/assets/index.es-BocJIoGE.js @@ -0,0 +1,70 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C91wHTLi.js","assets/index-Cye4tEiE.js","assets/index-CwoEHhxw.css"])))=>i.map(i=>d[i]); +import{j as ev,f as tv,u as w4,h as Ld,_ as _4}from"./index-Cye4tEiE.js";import{e as Vi,J as Fd}from"./events-EbrwmdBG.js";import{r as zd,i as Pf}from"./inherits_browser-DKXdsDax.js";var Ae={};/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var ad=function(r,e){return ad=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},ad(r,e)};function D4(r,e){ad(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var od=function(){return od=Object.assign||function(e){for(var t,i=1,n=arguments.length;i=0;f--)(c=r[f])&&(a=(n<3?c(a):n>3?c(e,t,a):c(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a}function x4(r,e){return function(t,i){e(t,i,r)}}function S4(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function M4(r,e,t,i){function n(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function f(m){try{d(i.next(m))}catch(w){c(w)}}function g(m){try{d(i.throw(m))}catch(w){c(w)}}function d(m){m.done?a(m.value):n(m.value).then(f,g)}d((i=i.apply(r,e||[])).next())})}function I4(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,c;return c={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function f(d){return function(m){return g([d,m])}}function g(d){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(a=d[0]&2?n.return:d[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,d[1])).done)return a;switch(n=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,n=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function rv(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],c;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(f){c={error:f}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(c)throw c.error}}return a}function O4(){for(var r=[],e=0;e1||f(O,C)})})}function f(O,C){try{g(i[O](C))}catch(P){w(a[0][3],P)}}function g(O){O.value instanceof bc?Promise.resolve(O.value.v).then(d,m):w(a[0][2],O)}function d(O){f("next",O)}function m(O){f("throw",O)}function w(O,C){O(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function N4(r){var e,t;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,a){e[n]=r[n]?function(c){return(t=!t)?{value:bc(r[n](c)),done:n==="return"}:a?a(c):c}:a}}function B4(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof cd=="function"?cd(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(c){return new Promise(function(f,g){c=r[a](c),n(f,g,c.done,c.value)})}}function n(a,c,f,g){Promise.resolve(g).then(function(d){a({value:d,done:f})},c)}}function $4(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function U4(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function q4(r){return r&&r.__esModule?r:{default:r}}function L4(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function F4(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const z4=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return od},__asyncDelegator:N4,__asyncGenerator:R4,__asyncValues:B4,__await:bc,__awaiter:M4,__classPrivateFieldGet:L4,__classPrivateFieldSet:F4,__createBinding:C4,__decorate:A4,__exportStar:P4,__extends:D4,__generator:I4,__importDefault:q4,__importStar:U4,__makeTemplateObject:$4,__metadata:S4,__param:x4,__read:rv,__rest:E4,__spread:O4,__spreadArrays:T4,__values:cd},Symbol.toStringTag,{value:"Module"})),Of=ev(z4);var gl={},Go={},w1;function j4(){if(w1)return Go;w1=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return Go.delay=r,Go}var sa={},bl={},aa={},_1;function k4(){return _1||(_1=1,Object.defineProperty(aa,"__esModule",{value:!0}),aa.ONE_THOUSAND=aa.ONE_HUNDRED=void 0,aa.ONE_HUNDRED=100,aa.ONE_THOUSAND=1e3),aa}var vl={},D1;function H4(){return D1||(D1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(vl)),vl}var E1;function iv(){return E1||(E1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Of;e.__exportStar(k4(),r),e.__exportStar(H4(),r)}(bl)),bl}var A1;function K4(){if(A1)return sa;A1=1,Object.defineProperty(sa,"__esModule",{value:!0}),sa.fromMiliseconds=sa.toMiliseconds=void 0;const r=iv();function e(i){return i*r.ONE_THOUSAND}sa.toMiliseconds=e;function t(i){return Math.floor(i/r.ONE_THOUSAND)}return sa.fromMiliseconds=t,sa}var x1;function V4(){return x1||(x1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Of;e.__exportStar(j4(),r),e.__exportStar(K4(),r)}(gl)),gl}var Ga={},S1;function G4(){if(S1)return Ga;S1=1,Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const i=this.get(t);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const n=Date.now()-i.started;this.timestamps.set(t,{started:i.started,elapsed:n})}get(t){const i=this.timestamps.get(t);if(typeof i>"u")throw new Error(`No timestamp found for label: ${t}`);return i}elapsed(t){const i=this.get(t);return i.elapsed||Date.now()-i.started}}return Ga.Watch=r,Ga.default=r,Ga}var ml={},Jo={},M1;function J4(){if(M1)return Jo;M1=1,Object.defineProperty(Jo,"__esModule",{value:!0}),Jo.IWatch=void 0;class r{}return Jo.IWatch=r,Jo}var I1;function W4(){return I1||(I1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Of.__exportStar(J4(),r)}(ml)),ml}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Of;e.__exportStar(V4(),r),e.__exportStar(G4(),r),e.__exportStar(W4(),r),e.__exportStar(iv(),r)})(Ae);var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.getLocalStorage=Vt.getLocalStorageOrThrow=Vt.getCrypto=Vt.getCryptoOrThrow=nv=Vt.getLocation=Vt.getLocationOrThrow=jd=Vt.getNavigator=Vt.getNavigatorOrThrow=Tf=Vt.getDocument=Vt.getDocumentOrThrow=Vt.getFromWindowOrThrow=Vt.getFromWindow=void 0;function _a(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}Vt.getFromWindow=_a;function ho(r){const e=_a(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}Vt.getFromWindowOrThrow=ho;function Y4(){return ho("document")}Vt.getDocumentOrThrow=Y4;function Q4(){return _a("document")}var Tf=Vt.getDocument=Q4;function X4(){return ho("navigator")}Vt.getNavigatorOrThrow=X4;function Z4(){return _a("navigator")}var jd=Vt.getNavigator=Z4;function e_(){return ho("location")}Vt.getLocationOrThrow=e_;function t_(){return _a("location")}var nv=Vt.getLocation=t_;function r_(){return ho("crypto")}Vt.getCryptoOrThrow=r_;function i_(){return _a("crypto")}Vt.getCrypto=i_;function n_(){return ho("localStorage")}Vt.getLocalStorageOrThrow=n_;function s_(){return _a("localStorage")}Vt.getLocalStorage=s_;var kd={};Object.defineProperty(kd,"__esModule",{value:!0});var sv=kd.getWindowMetadata=void 0;const C1=Vt;function a_(){let r,e;try{r=C1.getDocumentOrThrow(),e=C1.getLocationOrThrow()}catch{return null}function t(){const w=r.getElementsByTagName("link"),O=[];for(let C=0;C-1){const K=P.getAttribute("href");if(K)if(K.toLowerCase().indexOf("https:")===-1&&K.toLowerCase().indexOf("http:")===-1&&K.indexOf("//")!==0){let Y=e.protocol+"//"+e.host;if(K.indexOf("/")===0)Y+=K;else{const z=e.pathname.split("/");z.pop();const W=z.join("/");Y+=W+"/"+K}O.push(Y)}else if(K.indexOf("//")===0){const Y=e.protocol+K;O.push(Y)}else O.push(K)}}return O}function i(...w){const O=r.getElementsByTagName("meta");for(let C=0;CP.getAttribute(K)).filter(K=>K?w.includes(K):!1);if(q.length&&q){const K=P.getAttribute("content");if(K)return K}}return""}function n(){let w=i("name","og:site_name","og:title","twitter:title");return w||(w=r.title),w}function a(){return i("description","og:description","twitter:description","keywords")}const c=n(),f=a(),g=e.origin,d=t();return{description:f,url:g,icons:d,name:c}}sv=kd.getWindowMetadata=a_;var vc={},o_=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),av="%[a-f0-9]{2}",P1=new RegExp("("+av+")|([^%]+?)","gi"),O1=new RegExp("("+av+")+","gi");function ud(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),i=r.slice(e);return Array.prototype.concat.call([],ud(t),ud(i))}function c_(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(P1)||[],t=1;t{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},l_=function(r,e){for(var t={},i=Object.keys(r),n=Array.isArray(e),a=0;az==null,c=Symbol("encodeFragmentIdentifier");function f(z){switch(z.arrayFormat){case"index":return W=>(B,j)=>{const k=B.length;return j===void 0||z.skipNull&&j===null||z.skipEmptyString&&j===""?B:j===null?[...B,[m(W,z),"[",k,"]"].join("")]:[...B,[m(W,z),"[",m(k,z),"]=",m(j,z)].join("")]};case"bracket":return W=>(B,j)=>j===void 0||z.skipNull&&j===null||z.skipEmptyString&&j===""?B:j===null?[...B,[m(W,z),"[]"].join("")]:[...B,[m(W,z),"[]=",m(j,z)].join("")];case"colon-list-separator":return W=>(B,j)=>j===void 0||z.skipNull&&j===null||z.skipEmptyString&&j===""?B:j===null?[...B,[m(W,z),":list="].join("")]:[...B,[m(W,z),":list=",m(j,z)].join("")];case"comma":case"separator":case"bracket-separator":{const W=z.arrayFormat==="bracket-separator"?"[]=":"=";return B=>(j,k)=>k===void 0||z.skipNull&&k===null||z.skipEmptyString&&k===""?j:(k=k===null?"":k,j.length===0?[[m(B,z),W,m(k,z)].join("")]:[[j,m(k,z)].join(z.arrayFormatSeparator)])}default:return W=>(B,j)=>j===void 0||z.skipNull&&j===null||z.skipEmptyString&&j===""?B:j===null?[...B,m(W,z)]:[...B,[m(W,z),"=",m(j,z)].join("")]}}function g(z){let W;switch(z.arrayFormat){case"index":return(B,j,k)=>{if(W=/\[(\d*)\]$/.exec(B),B=B.replace(/\[\d*\]$/,""),!W){k[B]=j;return}k[B]===void 0&&(k[B]={}),k[B][W[1]]=j};case"bracket":return(B,j,k)=>{if(W=/(\[\])$/.exec(B),B=B.replace(/\[\]$/,""),!W){k[B]=j;return}if(k[B]===void 0){k[B]=[j];return}k[B]=[].concat(k[B],j)};case"colon-list-separator":return(B,j,k)=>{if(W=/(:list)$/.exec(B),B=B.replace(/:list$/,""),!W){k[B]=j;return}if(k[B]===void 0){k[B]=[j];return}k[B]=[].concat(k[B],j)};case"comma":case"separator":return(B,j,k)=>{const _=typeof j=="string"&&j.includes(z.arrayFormatSeparator),N=typeof j=="string"&&!_&&w(j,z).includes(z.arrayFormatSeparator);j=N?w(j,z):j;const se=_||N?j.split(z.arrayFormatSeparator).map(le=>w(le,z)):j===null?j:w(j,z);k[B]=se};case"bracket-separator":return(B,j,k)=>{const _=/(\[\])$/.test(B);if(B=B.replace(/\[\]$/,""),!_){k[B]=j&&w(j,z);return}const N=j===null?[]:j.split(z.arrayFormatSeparator).map(se=>w(se,z));if(k[B]===void 0){k[B]=N;return}k[B]=[].concat(k[B],N)};default:return(B,j,k)=>{if(k[B]===void 0){k[B]=j;return}k[B]=[].concat(k[B],j)}}}function d(z){if(typeof z!="string"||z.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function m(z,W){return W.encode?W.strict?e(z):encodeURIComponent(z):z}function w(z,W){return W.decode?t(z):z}function O(z){return Array.isArray(z)?z.sort():typeof z=="object"?O(Object.keys(z)).sort((W,B)=>Number(W)-Number(B)).map(W=>z[W]):z}function C(z){const W=z.indexOf("#");return W!==-1&&(z=z.slice(0,W)),z}function P(z){let W="";const B=z.indexOf("#");return B!==-1&&(W=z.slice(B)),W}function q(z){z=C(z);const W=z.indexOf("?");return W===-1?"":z.slice(W+1)}function K(z,W){return W.parseNumbers&&!Number.isNaN(Number(z))&&typeof z=="string"&&z.trim()!==""?z=Number(z):W.parseBooleans&&z!==null&&(z.toLowerCase()==="true"||z.toLowerCase()==="false")&&(z=z.toLowerCase()==="true"),z}function Y(z,W){W=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},W),d(W.arrayFormatSeparator);const B=g(W),j=Object.create(null);if(typeof z!="string"||(z=z.trim().replace(/^[?#&]/,""),!z))return j;for(const k of z.split("&")){if(k==="")continue;let[_,N]=i(W.decode?k.replace(/\+/g," "):k,"=");N=N===void 0?null:["comma","separator","bracket-separator"].includes(W.arrayFormat)?N:w(N,W),B(w(_,W),N,j)}for(const k of Object.keys(j)){const _=j[k];if(typeof _=="object"&&_!==null)for(const N of Object.keys(_))_[N]=K(_[N],W);else j[k]=K(_,W)}return W.sort===!1?j:(W.sort===!0?Object.keys(j).sort():Object.keys(j).sort(W.sort)).reduce((k,_)=>{const N=j[_];return N&&typeof N=="object"&&!Array.isArray(N)?k[_]=O(N):k[_]=N,k},Object.create(null))}r.extract=q,r.parse=Y,r.stringify=(z,W)=>{if(!z)return"";W=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},W),d(W.arrayFormatSeparator);const B=N=>W.skipNull&&a(z[N])||W.skipEmptyString&&z[N]==="",j=f(W),k={};for(const N of Object.keys(z))B(N)||(k[N]=z[N]);const _=Object.keys(k);return W.sort!==!1&&_.sort(W.sort),_.map(N=>{const se=z[N];return se===void 0?"":se===null?m(N,W):Array.isArray(se)?se.length===0&&W.arrayFormat==="bracket-separator"?m(N,W)+"[]":se.reduce(j(N),[]).join("&"):m(N,W)+"="+m(se,W)}).filter(N=>N.length>0).join("&")},r.parseUrl=(z,W)=>{W=Object.assign({decode:!0},W);const[B,j]=i(z,"#");return Object.assign({url:B.split("?")[0]||"",query:Y(q(z),W)},W&&W.parseFragmentIdentifier&&j?{fragmentIdentifier:w(j,W)}:{})},r.stringifyUrl=(z,W)=>{W=Object.assign({encode:!0,strict:!0,[c]:!0},W);const B=C(z.url).split("?")[0]||"",j=r.extract(z.url),k=r.parse(j,{sort:!1}),_=Object.assign(k,z.query);let N=r.stringify(_,W);N&&(N=`?${N}`);let se=P(z.url);return z.fragmentIdentifier&&(se=`#${W[c]?m(z.fragmentIdentifier,W):z.fragmentIdentifier}`),`${B}${N}${se}`},r.pick=(z,W,B)=>{B=Object.assign({parseFragmentIdentifier:!0,[c]:!1},B);const{url:j,query:k,fragmentIdentifier:_}=r.parseUrl(z,B);return r.stringifyUrl({url:j,query:n(k,W),fragmentIdentifier:_},B)},r.exclude=(z,W,B)=>{const j=Array.isArray(W)?k=>!W.includes(k):(k,_)=>!W(k,_);return r.pick(z,j,B)}})(vc);var Hd={},Rf={},mt={},ov={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(f,g){var d=f>>>16&65535,m=f&65535,w=g>>>16&65535,O=g&65535;return m*O+(d*O+m*w<<16>>>0)|0}r.mul=Math.imul||e;function t(f,g){return f+g|0}r.add=t;function i(f,g){return f-g|0}r.sub=i;function n(f,g){return f<>>32-g}r.rotl=n;function a(f,g){return f<<32-g|f>>>g}r.rotr=a;function c(f){return typeof f=="number"&&isFinite(f)&&Math.floor(f)===f}r.isInteger=Number.isInteger||c,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(f){return r.isInteger(f)&&f>=-r.MAX_SAFE_INTEGER&&f<=r.MAX_SAFE_INTEGER}})(ov);Object.defineProperty(mt,"__esModule",{value:!0});var cv=ov;function d_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}mt.readInt16BE=d_;function p_(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}mt.readUint16BE=p_;function g_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}mt.readInt16LE=g_;function b_(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}mt.readUint16LE=b_;function uv(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}mt.writeUint16BE=uv;mt.writeInt16BE=uv;function fv(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}mt.writeUint16LE=fv;mt.writeInt16LE=fv;function fd(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}mt.readInt32BE=fd;function hd(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}mt.readUint32BE=hd;function ld(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}mt.readInt32LE=ld;function dd(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}mt.readUint32LE=dd;function lf(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}mt.writeUint32BE=lf;mt.writeInt32BE=lf;function df(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}mt.writeUint32LE=df;mt.writeInt32LE=df;function v_(r,e){e===void 0&&(e=0);var t=fd(r,e),i=fd(r,e+4);return t*4294967296+i-(i>>31)*4294967296}mt.readInt64BE=v_;function m_(r,e){e===void 0&&(e=0);var t=hd(r,e),i=hd(r,e+4);return t*4294967296+i}mt.readUint64BE=m_;function y_(r,e){e===void 0&&(e=0);var t=ld(r,e),i=ld(r,e+4);return i*4294967296+t-(t>>31)*4294967296}mt.readInt64LE=y_;function w_(r,e){e===void 0&&(e=0);var t=dd(r,e),i=dd(r,e+4);return i*4294967296+t}mt.readUint64LE=w_;function hv(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),lf(r/4294967296>>>0,e,t),lf(r>>>0,e,t+4),e}mt.writeUint64BE=hv;mt.writeInt64BE=hv;function lv(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),df(r>>>0,e,t),df(r/4294967296>>>0,e,t+4),e}mt.writeUint64LE=lv;mt.writeInt64LE=lv;function __(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,a=r/8+t-1;a>=t;a--)i+=e[a]*n,n*=256;return i}mt.readUintBE=__;function D_(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,a=t;a=i;a--)t[a]=e/n&255,n*=256;return t}mt.writeUintBE=E_;function A_(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!cv.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var n=1,a=i;a>>16|v<<16,U=U+v|0,_^=U,_=_>>>20|_<<12,B=B+N|0,E^=B,E=E>>>16|E<<16,y=y+E|0,N^=y,N=N>>>20|N<<12,j=j+se|0,S^=j,S=S>>>16|S<<16,u=u+S|0,se^=u,se=se>>>20|se<<12,k=k+le|0,M^=k,M=M>>>16|M<<16,h=h+M|0,le^=h,le=le>>>20|le<<12,j=j+se|0,S^=j,S=S>>>24|S<<8,u=u+S|0,se^=u,se=se>>>25|se<<7,k=k+le|0,M^=k,M=M>>>24|M<<8,h=h+M|0,le^=h,le=le>>>25|le<<7,B=B+N|0,E^=B,E=E>>>24|E<<8,y=y+E|0,N^=y,N=N>>>25|N<<7,W=W+_|0,v^=W,v=v>>>24|v<<8,U=U+v|0,_^=U,_=_>>>25|_<<7,W=W+N|0,M^=W,M=M>>>16|M<<16,u=u+M|0,N^=u,N=N>>>20|N<<12,B=B+se|0,v^=B,v=v>>>16|v<<16,h=h+v|0,se^=h,se=se>>>20|se<<12,j=j+le|0,E^=j,E=E>>>16|E<<16,U=U+E|0,le^=U,le=le>>>20|le<<12,k=k+_|0,S^=k,S=S>>>16|S<<16,y=y+S|0,_^=y,_=_>>>20|_<<12,j=j+le|0,E^=j,E=E>>>24|E<<8,U=U+E|0,le^=U,le=le>>>25|le<<7,k=k+_|0,S^=k,S=S>>>24|S<<8,y=y+S|0,_^=y,_=_>>>25|_<<7,B=B+se|0,v^=B,v=v>>>24|v<<8,h=h+v|0,se^=h,se=se>>>25|se<<7,W=W+N|0,M^=W,M=M>>>24|M<<8,u=u+M|0,N^=u,N=N>>>25|N<<7;Fr.writeUint32LE(W+i|0,r,0),Fr.writeUint32LE(B+n|0,r,4),Fr.writeUint32LE(j+a|0,r,8),Fr.writeUint32LE(k+c|0,r,12),Fr.writeUint32LE(_+f|0,r,16),Fr.writeUint32LE(N+g|0,r,20),Fr.writeUint32LE(se+d|0,r,24),Fr.writeUint32LE(le+m|0,r,28),Fr.writeUint32LE(U+w|0,r,32),Fr.writeUint32LE(y+O|0,r,36),Fr.writeUint32LE(u+C|0,r,40),Fr.writeUint32LE(h+P|0,r,44),Fr.writeUint32LE(v+q|0,r,48),Fr.writeUint32LE(E+K|0,r,52),Fr.writeUint32LE(S+Y|0,r,56),Fr.writeUint32LE(M+z|0,r,60)}function dv(r,e,t,i,n){if(n===void 0&&(n=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}var pv={},js={};Object.defineProperty(js,"__esModule",{value:!0});function q_(r,e,t){return~(r-1)&e|r-1&t}js.select=q_;function L_(r,e){return(r|0)-(e|0)-1>>>31&1}js.lessOrEqual=L_;function gv(r,e){if(r.length!==e.length)return 0;for(var t=0,i=0;i>>8}js.compare=gv;function F_(r,e){return r.length===0||e.length===0?!1:gv(r,e)!==0}js.equal=F_;(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=js,t=xi;r.DIGEST_LENGTH=16;var i=function(){function c(f){this.digestLength=r.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var g=f[0]|f[1]<<8;this._r[0]=g&8191;var d=f[2]|f[3]<<8;this._r[1]=(g>>>13|d<<3)&8191;var m=f[4]|f[5]<<8;this._r[2]=(d>>>10|m<<6)&7939;var w=f[6]|f[7]<<8;this._r[3]=(m>>>7|w<<9)&8191;var O=f[8]|f[9]<<8;this._r[4]=(w>>>4|O<<12)&255,this._r[5]=O>>>1&8190;var C=f[10]|f[11]<<8;this._r[6]=(O>>>14|C<<2)&8191;var P=f[12]|f[13]<<8;this._r[7]=(C>>>11|P<<5)&8065;var q=f[14]|f[15]<<8;this._r[8]=(P>>>8|q<<8)&8191,this._r[9]=q>>>5&127,this._pad[0]=f[16]|f[17]<<8,this._pad[1]=f[18]|f[19]<<8,this._pad[2]=f[20]|f[21]<<8,this._pad[3]=f[22]|f[23]<<8,this._pad[4]=f[24]|f[25]<<8,this._pad[5]=f[26]|f[27]<<8,this._pad[6]=f[28]|f[29]<<8,this._pad[7]=f[30]|f[31]<<8}return c.prototype._blocks=function(f,g,d){for(var m=this._fin?0:2048,w=this._h[0],O=this._h[1],C=this._h[2],P=this._h[3],q=this._h[4],K=this._h[5],Y=this._h[6],z=this._h[7],W=this._h[8],B=this._h[9],j=this._r[0],k=this._r[1],_=this._r[2],N=this._r[3],se=this._r[4],le=this._r[5],U=this._r[6],y=this._r[7],u=this._r[8],h=this._r[9];d>=16;){var v=f[g+0]|f[g+1]<<8;w+=v&8191;var E=f[g+2]|f[g+3]<<8;O+=(v>>>13|E<<3)&8191;var S=f[g+4]|f[g+5]<<8;C+=(E>>>10|S<<6)&8191;var M=f[g+6]|f[g+7]<<8;P+=(S>>>7|M<<9)&8191;var x=f[g+8]|f[g+9]<<8;q+=(M>>>4|x<<12)&8191,K+=x>>>1&8191;var p=f[g+10]|f[g+11]<<8;Y+=(x>>>14|p<<2)&8191;var b=f[g+12]|f[g+13]<<8;z+=(p>>>11|b<<5)&8191;var R=f[g+14]|f[g+15]<<8;W+=(b>>>8|R<<8)&8191,B+=R>>>5|m;var Z=0,ae=Z;ae+=w*j,ae+=O*(5*h),ae+=C*(5*u),ae+=P*(5*y),ae+=q*(5*U),Z=ae>>>13,ae&=8191,ae+=K*(5*le),ae+=Y*(5*se),ae+=z*(5*N),ae+=W*(5*_),ae+=B*(5*k),Z+=ae>>>13,ae&=8191;var I=Z;I+=w*k,I+=O*j,I+=C*(5*h),I+=P*(5*u),I+=q*(5*y),Z=I>>>13,I&=8191,I+=K*(5*U),I+=Y*(5*le),I+=z*(5*se),I+=W*(5*N),I+=B*(5*_),Z+=I>>>13,I&=8191;var ee=Z;ee+=w*_,ee+=O*k,ee+=C*j,ee+=P*(5*h),ee+=q*(5*u),Z=ee>>>13,ee&=8191,ee+=K*(5*y),ee+=Y*(5*U),ee+=z*(5*le),ee+=W*(5*se),ee+=B*(5*N),Z+=ee>>>13,ee&=8191;var L=Z;L+=w*N,L+=O*_,L+=C*k,L+=P*j,L+=q*(5*h),Z=L>>>13,L&=8191,L+=K*(5*u),L+=Y*(5*y),L+=z*(5*U),L+=W*(5*le),L+=B*(5*se),Z+=L>>>13,L&=8191;var V=Z;V+=w*se,V+=O*N,V+=C*_,V+=P*k,V+=q*j,Z=V>>>13,V&=8191,V+=K*(5*h),V+=Y*(5*u),V+=z*(5*y),V+=W*(5*U),V+=B*(5*le),Z+=V>>>13,V&=8191;var G=Z;G+=w*le,G+=O*se,G+=C*N,G+=P*_,G+=q*k,Z=G>>>13,G&=8191,G+=K*j,G+=Y*(5*h),G+=z*(5*u),G+=W*(5*y),G+=B*(5*U),Z+=G>>>13,G&=8191;var D=Z;D+=w*U,D+=O*le,D+=C*se,D+=P*N,D+=q*_,Z=D>>>13,D&=8191,D+=K*k,D+=Y*j,D+=z*(5*h),D+=W*(5*u),D+=B*(5*y),Z+=D>>>13,D&=8191;var H=Z;H+=w*y,H+=O*U,H+=C*le,H+=P*se,H+=q*N,Z=H>>>13,H&=8191,H+=K*_,H+=Y*k,H+=z*j,H+=W*(5*h),H+=B*(5*u),Z+=H>>>13,H&=8191;var ne=Z;ne+=w*u,ne+=O*y,ne+=C*U,ne+=P*le,ne+=q*se,Z=ne>>>13,ne&=8191,ne+=K*N,ne+=Y*_,ne+=z*k,ne+=W*j,ne+=B*(5*h),Z+=ne>>>13,ne&=8191;var ce=Z;ce+=w*h,ce+=O*u,ce+=C*y,ce+=P*U,ce+=q*le,Z=ce>>>13,ce&=8191,ce+=K*se,ce+=Y*N,ce+=z*_,ce+=W*k,ce+=B*j,Z+=ce>>>13,ce&=8191,Z=(Z<<2)+Z|0,Z=Z+ae|0,ae=Z&8191,Z=Z>>>13,I+=Z,w=ae,O=I,C=ee,P=L,q=V,K=G,Y=D,z=H,W=ne,B=ce,g+=16,d-=16}this._h[0]=w,this._h[1]=O,this._h[2]=C,this._h[3]=P,this._h[4]=q,this._h[5]=K,this._h[6]=Y,this._h[7]=z,this._h[8]=W,this._h[9]=B},c.prototype.finish=function(f,g){g===void 0&&(g=0);var d=new Uint16Array(10),m,w,O,C;if(this._leftover){for(C=this._leftover,this._buffer[C++]=1;C<16;C++)this._buffer[C]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(m=this._h[1]>>>13,this._h[1]&=8191,C=2;C<10;C++)this._h[C]+=m,m=this._h[C]>>>13,this._h[C]&=8191;for(this._h[0]+=m*5,m=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=m,m=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=m,d[0]=this._h[0]+5,m=d[0]>>>13,d[0]&=8191,C=1;C<10;C++)d[C]=this._h[C]+m,m=d[C]>>>13,d[C]&=8191;for(d[9]-=8192,w=(m^1)-1,C=0;C<10;C++)d[C]&=w;for(w=~w,C=0;C<10;C++)this._h[C]=this._h[C]&w|d[C];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,O=this._h[0]+this._pad[0],this._h[0]=O&65535,C=1;C<8;C++)O=(this._h[C]+this._pad[C]|0)+(O>>>16)|0,this._h[C]=O&65535;return f[g+0]=this._h[0]>>>0,f[g+1]=this._h[0]>>>8,f[g+2]=this._h[1]>>>0,f[g+3]=this._h[1]>>>8,f[g+4]=this._h[2]>>>0,f[g+5]=this._h[2]>>>8,f[g+6]=this._h[3]>>>0,f[g+7]=this._h[3]>>>8,f[g+8]=this._h[4]>>>0,f[g+9]=this._h[4]>>>8,f[g+10]=this._h[5]>>>0,f[g+11]=this._h[5]>>>8,f[g+12]=this._h[6]>>>0,f[g+13]=this._h[6]>>>8,f[g+14]=this._h[7]>>>0,f[g+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(f){var g=0,d=f.length,m;if(this._leftover){m=16-this._leftover,m>d&&(m=d);for(var w=0;w=16&&(m=d-d%16,this._blocks(f,g,m),g+=m,d-=m),d){for(var w=0;w16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var C=new Uint8Array(16);C.set(d,C.length-d.length);var P=new Uint8Array(32);e.stream(this._key,C,P,4);var q=m.length+this.tagLength,K;if(O){if(O.length!==q)throw new Error("ChaCha20Poly1305: incorrect destination length");K=O}else K=new Uint8Array(q);return e.streamXOR(this._key,C,m,K,4),this._authenticate(K.subarray(K.length-this.tagLength,K.length),P,K.subarray(0,K.length-this.tagLength),w),i.wipe(C),K},g.prototype.open=function(d,m,w,O){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(m.length0&&C.update(c.subarray(O.length%16))),C.update(w),w.length%16>0&&C.update(c.subarray(w.length%16));var P=new Uint8Array(8);O&&n.writeUint64LE(O.length,P),C.update(P),n.writeUint64LE(w.length,P),C.update(P);for(var q=C.digest(),K=0;Kthis.blockSize?this._inner.update(t).finish(i).clean():i.set(t);for(var n=0;n1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},r.prototype.expand=function(e){for(var t=new Uint8Array(e),i=0;i256)throw new Error("randomString charset is too long");let O="";const C=m.length,P=256-256%C;for(;d>0;){const q=n(Math.ceil(d*256/P),w);for(let K=0;K0;K++){const Y=q[K];Y0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=g[m++],d--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(m=a(this._temp,this._state,g,m,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=g[m++],d--;return this},f.prototype.finish=function(g){if(!this._finished){var d=this._bytesHashed,m=this._bufferLength,w=d/536870912|0,O=d<<3,C=d%64<56?64:128;this._buffer[m]=128;for(var P=m+1;P0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(g){return this._state.set(g.state),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(g){t.wipe(g.state),g.buffer&&t.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},f}();r.SHA256=i;var n=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(f,g,d,m,w){for(;w>=64;){for(var O=g[0],C=g[1],P=g[2],q=g[3],K=g[4],Y=g[5],z=g[6],W=g[7],B=0;B<16;B++){var j=m+B*4;f[B]=e.readUint32BE(d,j)}for(var B=16;B<64;B++){var k=f[B-2],_=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10;k=f[B-15];var N=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3;f[B]=(_+f[B-7]|0)+(N+f[B-16]|0)}for(var B=0;B<64;B++){var _=(((K>>>6|K<<26)^(K>>>11|K<<21)^(K>>>25|K<<7))+(K&Y^~K&z)|0)+(W+(n[B]+f[B]|0)|0)|0,N=((O>>>2|O<<30)^(O>>>13|O<<19)^(O>>>22|O<<10))+(O&C^O&P^C&P)|0;W=z,z=Y,Y=K,K=q+_|0,q=P,P=C,C=O,O=_+N|0}g[0]+=O,g[1]+=C,g[2]+=P,g[3]+=q,g[4]+=K,g[5]+=Y,g[6]+=z,g[7]+=W,m+=64,w-=64}return m}function c(f){var g=new i;g.update(f);var d=g.digest();return g.clean(),d}r.hash=c})(Sc);var Vd={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=ks,t=xi;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function i(B){const j=new Float64Array(16);if(B)for(let k=0;k>16&1),k[le-1]&=65535;k[15]=_[15]-32767-(k[14]>>16&1);const se=k[15]>>16&1;k[14]&=65535,f(_,k,1-se)}for(let N=0;N<16;N++)B[2*N]=_[N]&255,B[2*N+1]=_[N]>>8}function d(B,j){for(let k=0;k<16;k++)B[k]=j[2*k]+(j[2*k+1]<<8);B[15]&=32767}function m(B,j,k){for(let _=0;_<16;_++)B[_]=j[_]+k[_]}function w(B,j,k){for(let _=0;_<16;_++)B[_]=j[_]-k[_]}function O(B,j,k){let _,N,se=0,le=0,U=0,y=0,u=0,h=0,v=0,E=0,S=0,M=0,x=0,p=0,b=0,R=0,Z=0,ae=0,I=0,ee=0,L=0,V=0,G=0,D=0,H=0,ne=0,ce=0,fe=0,ye=0,we=0,Te=0,Qe=0,Ce=0,Re=k[0],Se=k[1],me=k[2],Pe=k[3],Ne=k[4],be=k[5],Oe=k[6],xe=k[7],ve=k[8],qe=k[9],Me=k[10],_e=k[11],He=k[12],Ve=k[13],Ee=k[14],Ke=k[15];_=j[0],se+=_*Re,le+=_*Se,U+=_*me,y+=_*Pe,u+=_*Ne,h+=_*be,v+=_*Oe,E+=_*xe,S+=_*ve,M+=_*qe,x+=_*Me,p+=_*_e,b+=_*He,R+=_*Ve,Z+=_*Ee,ae+=_*Ke,_=j[1],le+=_*Re,U+=_*Se,y+=_*me,u+=_*Pe,h+=_*Ne,v+=_*be,E+=_*Oe,S+=_*xe,M+=_*ve,x+=_*qe,p+=_*Me,b+=_*_e,R+=_*He,Z+=_*Ve,ae+=_*Ee,I+=_*Ke,_=j[2],U+=_*Re,y+=_*Se,u+=_*me,h+=_*Pe,v+=_*Ne,E+=_*be,S+=_*Oe,M+=_*xe,x+=_*ve,p+=_*qe,b+=_*Me,R+=_*_e,Z+=_*He,ae+=_*Ve,I+=_*Ee,ee+=_*Ke,_=j[3],y+=_*Re,u+=_*Se,h+=_*me,v+=_*Pe,E+=_*Ne,S+=_*be,M+=_*Oe,x+=_*xe,p+=_*ve,b+=_*qe,R+=_*Me,Z+=_*_e,ae+=_*He,I+=_*Ve,ee+=_*Ee,L+=_*Ke,_=j[4],u+=_*Re,h+=_*Se,v+=_*me,E+=_*Pe,S+=_*Ne,M+=_*be,x+=_*Oe,p+=_*xe,b+=_*ve,R+=_*qe,Z+=_*Me,ae+=_*_e,I+=_*He,ee+=_*Ve,L+=_*Ee,V+=_*Ke,_=j[5],h+=_*Re,v+=_*Se,E+=_*me,S+=_*Pe,M+=_*Ne,x+=_*be,p+=_*Oe,b+=_*xe,R+=_*ve,Z+=_*qe,ae+=_*Me,I+=_*_e,ee+=_*He,L+=_*Ve,V+=_*Ee,G+=_*Ke,_=j[6],v+=_*Re,E+=_*Se,S+=_*me,M+=_*Pe,x+=_*Ne,p+=_*be,b+=_*Oe,R+=_*xe,Z+=_*ve,ae+=_*qe,I+=_*Me,ee+=_*_e,L+=_*He,V+=_*Ve,G+=_*Ee,D+=_*Ke,_=j[7],E+=_*Re,S+=_*Se,M+=_*me,x+=_*Pe,p+=_*Ne,b+=_*be,R+=_*Oe,Z+=_*xe,ae+=_*ve,I+=_*qe,ee+=_*Me,L+=_*_e,V+=_*He,G+=_*Ve,D+=_*Ee,H+=_*Ke,_=j[8],S+=_*Re,M+=_*Se,x+=_*me,p+=_*Pe,b+=_*Ne,R+=_*be,Z+=_*Oe,ae+=_*xe,I+=_*ve,ee+=_*qe,L+=_*Me,V+=_*_e,G+=_*He,D+=_*Ve,H+=_*Ee,ne+=_*Ke,_=j[9],M+=_*Re,x+=_*Se,p+=_*me,b+=_*Pe,R+=_*Ne,Z+=_*be,ae+=_*Oe,I+=_*xe,ee+=_*ve,L+=_*qe,V+=_*Me,G+=_*_e,D+=_*He,H+=_*Ve,ne+=_*Ee,ce+=_*Ke,_=j[10],x+=_*Re,p+=_*Se,b+=_*me,R+=_*Pe,Z+=_*Ne,ae+=_*be,I+=_*Oe,ee+=_*xe,L+=_*ve,V+=_*qe,G+=_*Me,D+=_*_e,H+=_*He,ne+=_*Ve,ce+=_*Ee,fe+=_*Ke,_=j[11],p+=_*Re,b+=_*Se,R+=_*me,Z+=_*Pe,ae+=_*Ne,I+=_*be,ee+=_*Oe,L+=_*xe,V+=_*ve,G+=_*qe,D+=_*Me,H+=_*_e,ne+=_*He,ce+=_*Ve,fe+=_*Ee,ye+=_*Ke,_=j[12],b+=_*Re,R+=_*Se,Z+=_*me,ae+=_*Pe,I+=_*Ne,ee+=_*be,L+=_*Oe,V+=_*xe,G+=_*ve,D+=_*qe,H+=_*Me,ne+=_*_e,ce+=_*He,fe+=_*Ve,ye+=_*Ee,we+=_*Ke,_=j[13],R+=_*Re,Z+=_*Se,ae+=_*me,I+=_*Pe,ee+=_*Ne,L+=_*be,V+=_*Oe,G+=_*xe,D+=_*ve,H+=_*qe,ne+=_*Me,ce+=_*_e,fe+=_*He,ye+=_*Ve,we+=_*Ee,Te+=_*Ke,_=j[14],Z+=_*Re,ae+=_*Se,I+=_*me,ee+=_*Pe,L+=_*Ne,V+=_*be,G+=_*Oe,D+=_*xe,H+=_*ve,ne+=_*qe,ce+=_*Me,fe+=_*_e,ye+=_*He,we+=_*Ve,Te+=_*Ee,Qe+=_*Ke,_=j[15],ae+=_*Re,I+=_*Se,ee+=_*me,L+=_*Pe,V+=_*Ne,G+=_*be,D+=_*Oe,H+=_*xe,ne+=_*ve,ce+=_*qe,fe+=_*Me,ye+=_*_e,we+=_*He,Te+=_*Ve,Qe+=_*Ee,Ce+=_*Ke,se+=38*I,le+=38*ee,U+=38*L,y+=38*V,u+=38*G,h+=38*D,v+=38*H,E+=38*ne,S+=38*ce,M+=38*fe,x+=38*ye,p+=38*we,b+=38*Te,R+=38*Qe,Z+=38*Ce,N=1,_=se+N+65535,N=Math.floor(_/65536),se=_-N*65536,_=le+N+65535,N=Math.floor(_/65536),le=_-N*65536,_=U+N+65535,N=Math.floor(_/65536),U=_-N*65536,_=y+N+65535,N=Math.floor(_/65536),y=_-N*65536,_=u+N+65535,N=Math.floor(_/65536),u=_-N*65536,_=h+N+65535,N=Math.floor(_/65536),h=_-N*65536,_=v+N+65535,N=Math.floor(_/65536),v=_-N*65536,_=E+N+65535,N=Math.floor(_/65536),E=_-N*65536,_=S+N+65535,N=Math.floor(_/65536),S=_-N*65536,_=M+N+65535,N=Math.floor(_/65536),M=_-N*65536,_=x+N+65535,N=Math.floor(_/65536),x=_-N*65536,_=p+N+65535,N=Math.floor(_/65536),p=_-N*65536,_=b+N+65535,N=Math.floor(_/65536),b=_-N*65536,_=R+N+65535,N=Math.floor(_/65536),R=_-N*65536,_=Z+N+65535,N=Math.floor(_/65536),Z=_-N*65536,_=ae+N+65535,N=Math.floor(_/65536),ae=_-N*65536,se+=N-1+37*(N-1),N=1,_=se+N+65535,N=Math.floor(_/65536),se=_-N*65536,_=le+N+65535,N=Math.floor(_/65536),le=_-N*65536,_=U+N+65535,N=Math.floor(_/65536),U=_-N*65536,_=y+N+65535,N=Math.floor(_/65536),y=_-N*65536,_=u+N+65535,N=Math.floor(_/65536),u=_-N*65536,_=h+N+65535,N=Math.floor(_/65536),h=_-N*65536,_=v+N+65535,N=Math.floor(_/65536),v=_-N*65536,_=E+N+65535,N=Math.floor(_/65536),E=_-N*65536,_=S+N+65535,N=Math.floor(_/65536),S=_-N*65536,_=M+N+65535,N=Math.floor(_/65536),M=_-N*65536,_=x+N+65535,N=Math.floor(_/65536),x=_-N*65536,_=p+N+65535,N=Math.floor(_/65536),p=_-N*65536,_=b+N+65535,N=Math.floor(_/65536),b=_-N*65536,_=R+N+65535,N=Math.floor(_/65536),R=_-N*65536,_=Z+N+65535,N=Math.floor(_/65536),Z=_-N*65536,_=ae+N+65535,N=Math.floor(_/65536),ae=_-N*65536,se+=N-1+37*(N-1),B[0]=se,B[1]=le,B[2]=U,B[3]=y,B[4]=u,B[5]=h,B[6]=v,B[7]=E,B[8]=S,B[9]=M,B[10]=x,B[11]=p,B[12]=b,B[13]=R,B[14]=Z,B[15]=ae}function C(B,j){O(B,j,j)}function P(B,j){const k=i();for(let _=0;_<16;_++)k[_]=j[_];for(let _=253;_>=0;_--)C(k,k),_!==2&&_!==4&&O(k,k,j);for(let _=0;_<16;_++)B[_]=k[_]}function q(B,j){const k=new Uint8Array(32),_=new Float64Array(80),N=i(),se=i(),le=i(),U=i(),y=i(),u=i();for(let S=0;S<31;S++)k[S]=B[S];k[31]=B[31]&127|64,k[0]&=248,d(_,j);for(let S=0;S<16;S++)se[S]=_[S];N[0]=U[0]=1;for(let S=254;S>=0;--S){const M=k[S>>>3]>>>(S&7)&1;f(N,se,M),f(le,U,M),m(y,N,le),w(N,N,le),m(le,se,U),w(se,se,U),C(U,y),C(u,N),O(N,le,N),O(le,se,y),m(y,N,le),w(N,N,le),C(se,N),w(le,U,u),O(N,le,a),m(N,N,U),O(le,le,N),O(N,U,u),O(U,se,_),C(se,y),f(N,se,M),f(le,U,M)}for(let S=0;S<16;S++)_[S+16]=N[S],_[S+32]=le[S],_[S+48]=se[S],_[S+64]=U[S];const h=_.subarray(32),v=_.subarray(16);P(h,h),O(v,v,h);const E=new Uint8Array(32);return g(E,v),E}r.scalarMult=q;function K(B){return q(B,n)}r.scalarMultBase=K;function Y(B){if(B.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const j=new Uint8Array(B);return{publicKey:K(j),secretKey:j}}r.generateKeyPairFromSeed=Y;function z(B){const j=(0,e.randomBytes)(32,B),k=Y(j);return(0,t.wipe)(j),k}r.generateKeyPair=z;function W(B,j,k=!1){if(B.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(j.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const _=q(B,j);if(k){let N=0;for(let se=0;se<_.length;se++)N|=_[se];if(N===0)throw new Error("X25519: invalid shared key")}return _}r.sharedKey=W})(Vd);function mv(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function yl(r,e){e||(e=r.reduce((n,a)=>n+a.length,0));const t=mv(e);let i=0;for(const n of r)t.set(n,i),i+=n.length;return t}function e7(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i>>0,B=new Uint8Array(W);Y!==z;){for(var j=P[Y],k=0,_=W-1;(j!==0||k>>0,B[_]=j%f>>>0,j=j/f>>>0;if(j!==0)throw new Error("Non-zero carry");K=k,Y++}for(var N=W-K;N!==W&&B[N]===0;)N++;for(var se=g.repeat(q);N>>0,W=new Uint8Array(z);P[q];){var B=t[P.charCodeAt(q)];if(B===255)return;for(var j=0,k=z-1;(B!==0||j>>0,W[k]=B%256>>>0,B=B/256>>>0;if(B!==0)throw new Error("Non-zero carry");Y=j,q++}if(P[q]!==" "){for(var _=z-Y;_!==z&&W[_]===0;)_++;for(var N=new Uint8Array(K+(z-_)),se=K;_!==z;)N[se++]=W[_++];return N}}}function C(P){var q=O(P);if(q)return q;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:O,decode:C}}var t7=e7,r7=t7;const i7=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},n7=r=>new TextEncoder().encode(r),s7=r=>new TextDecoder().decode(r);let a7=class{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},o7=class{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}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 yv(this,e)}},c7=class{constructor(e){this.decoders=e}or(e){return yv(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const yv=(r,e)=>new c7({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});let u7=class{constructor(e,t,i,n){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=n,this.encoder=new a7(e,t,i),this.decoder=new o7(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const Uf=({name:r,prefix:e,encode:t,decode:i})=>new u7(r,e,t,i),Mc=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:n}=r7(t,e);return Uf({prefix:r,name:e,encode:i,decode:a=>i7(n(a))})},f7=(r,e,t,i)=>{const n={};for(let m=0;m=8&&(f-=8,c[d++]=255&g>>f)}if(f>=t||255&g<<8-f)throw new SyntaxError("Unexpected end of data");return c},h7=(r,e,t)=>{const i=e[e.length-1]==="=",n=(1<t;)c-=t,a+=e[n&f>>c];if(c&&(a+=e[n&f<Uf({prefix:e,name:r,encode(n){return h7(n,i,t)},decode(n){return f7(n,i,t,r)}}),l7=Uf({prefix:"\0",name:"identity",encode:r=>s7(r),decode:r=>n7(r)}),d7=Object.freeze(Object.defineProperty({__proto__:null,identity:l7},Symbol.toStringTag,{value:"Module"})),p7=Ir({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),g7=Object.freeze(Object.defineProperty({__proto__:null,base2:p7},Symbol.toStringTag,{value:"Module"})),b7=Ir({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),v7=Object.freeze(Object.defineProperty({__proto__:null,base8:b7},Symbol.toStringTag,{value:"Module"})),m7=Mc({prefix:"9",name:"base10",alphabet:"0123456789"}),y7=Object.freeze(Object.defineProperty({__proto__:null,base10:m7},Symbol.toStringTag,{value:"Module"})),w7=Ir({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),_7=Ir({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),D7=Object.freeze(Object.defineProperty({__proto__:null,base16:w7,base16upper:_7},Symbol.toStringTag,{value:"Module"})),E7=Ir({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),A7=Ir({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),x7=Ir({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),S7=Ir({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),M7=Ir({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),I7=Ir({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),C7=Ir({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),P7=Ir({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),O7=Ir({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),T7=Object.freeze(Object.defineProperty({__proto__:null,base32:E7,base32hex:M7,base32hexpad:C7,base32hexpadupper:P7,base32hexupper:I7,base32pad:x7,base32padupper:S7,base32upper:A7,base32z:O7},Symbol.toStringTag,{value:"Module"})),R7=Mc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),N7=Mc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),B7=Object.freeze(Object.defineProperty({__proto__:null,base36:R7,base36upper:N7},Symbol.toStringTag,{value:"Module"})),$7=Mc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),U7=Mc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),q7=Object.freeze(Object.defineProperty({__proto__:null,base58btc:$7,base58flickr:U7},Symbol.toStringTag,{value:"Module"})),L7=Ir({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),F7=Ir({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),z7=Ir({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),j7=Ir({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),k7=Object.freeze(Object.defineProperty({__proto__:null,base64:L7,base64pad:F7,base64url:z7,base64urlpad:j7},Symbol.toStringTag,{value:"Module"})),wv=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),H7=wv.reduce((r,e,t)=>(r[t]=e,r),[]),K7=wv.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function V7(r){return r.reduce((e,t)=>(e+=H7[t],e),"")}function G7(r){const e=[];for(const t of r){const i=K7[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const J7=Uf({prefix:"🚀",name:"base256emoji",encode:V7,decode:G7}),W7=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:J7},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const B1={...d7,...g7,...v7,...y7,...D7,...T7,...B7,...q7,...k7,...W7};function _v(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const $1=_v("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),wl=_v("ascii","a",r=>{let e="a";for(let t=0;t{r=r.substring(1);const e=mv(r.length);for(let t=0;t",s9="MIT",a9={url:"https://github.com/indutny/elliptic/issues"},o9="https://github.com/indutny/elliptic",c9={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},u9={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},f9={name:Y7,version:Q7,description:X7,main:Z7,files:e9,scripts:t9,repository:r9,keywords:i9,author:n9,license:s9,bugs:a9,homepage:o9,devDependencies:c9,dependencies:u9};var Si={},Gd={exports:{}};Gd.exports;(function(r){(function(e,t){function i(U,y){if(!U)throw new Error(y||"Assertion failed")}function n(U,y){U.super_=y;var u=function(){};u.prototype=y.prototype,U.prototype=new u,U.prototype.constructor=U}function a(U,y,u){if(a.isBN(U))return U;this.negative=0,this.words=null,this.length=0,this.red=null,U!==null&&((y==="le"||y==="be")&&(u=y,y=10),this._init(U||0,y||10,u||"be"))}typeof e=="object"?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=zd.Buffer}catch{}a.isBN=function(y){return y instanceof a?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===a.wordSize&&Array.isArray(y.words)},a.max=function(y,u){return y.cmp(u)>0?y:u},a.min=function(y,u){return y.cmp(u)<0?y:u},a.prototype._init=function(y,u,h){if(typeof y=="number")return this._initNumber(y,u,h);if(typeof y=="object")return this._initArray(y,u,h);u==="hex"&&(u=16),i(u===(u|0)&&u>=2&&u<=36),y=y.toString().replace(/\s+/g,"");var v=0;y[0]==="-"&&(v++,this.negative=1),v=0;v-=3)S=y[v]|y[v-1]<<8|y[v-2]<<16,this.words[E]|=S<>>26-M&67108863,M+=24,M>=26&&(M-=26,E++);else if(h==="le")for(v=0,E=0;v>>26-M&67108863,M+=24,M>=26&&(M-=26,E++);return this.strip()};function f(U,y){var u=U.charCodeAt(y);return u>=65&&u<=70?u-55:u>=97&&u<=102?u-87:u-48&15}function g(U,y,u){var h=f(U,u);return u-1>=y&&(h|=f(U,u-1)<<4),h}a.prototype._parseHex=function(y,u,h){this.length=Math.ceil((y.length-u)/6),this.words=new Array(this.length);for(var v=0;v=u;v-=2)M=g(y,u,v)<=18?(E-=18,S+=1,this.words[S]|=M>>>26):E+=8;else{var x=y.length-u;for(v=x%2===0?u+1:u;v=18?(E-=18,S+=1,this.words[S]|=M>>>26):E+=8}this.strip()};function d(U,y,u,h){for(var v=0,E=Math.min(U.length,u),S=y;S=49?v+=M-49+10:M>=17?v+=M-17+10:v+=M}return v}a.prototype._parseBase=function(y,u,h){this.words=[0],this.length=1;for(var v=0,E=1;E<=67108863;E*=u)v++;v--,E=E/u|0;for(var S=y.length-h,M=S%v,x=Math.min(S,S-M)+h,p=0,b=h;b1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var m=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],O=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(y,u){y=y||10,u=u|0||1;var h;if(y===16||y==="hex"){h="";for(var v=0,E=0,S=0;S>>24-v&16777215,E!==0||S!==this.length-1?h=m[6-x.length]+x+h:h=x+h,v+=2,v>=26&&(v-=26,S--)}for(E!==0&&(h=E.toString(16)+h);h.length%u!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(y===(y|0)&&y>=2&&y<=36){var p=w[y],b=O[y];h="";var R=this.clone();for(R.negative=0;!R.isZero();){var Z=R.modn(b).toString(y);R=R.idivn(b),R.isZero()?h=Z+h:h=m[p-Z.length]+Z+h}for(this.isZero()&&(h="0"+h);h.length%u!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(y,u){return i(typeof c<"u"),this.toArrayLike(c,y,u)},a.prototype.toArray=function(y,u){return this.toArrayLike(Array,y,u)},a.prototype.toArrayLike=function(y,u,h){var v=this.byteLength(),E=h||Math.max(1,v);i(v<=E,"byte array longer than desired length"),i(E>0,"Requested array length <= 0"),this.strip();var S=u==="le",M=new y(E),x,p,b=this.clone();if(S){for(p=0;!b.isZero();p++)x=b.andln(255),b.iushrn(8),M[p]=x;for(;p=4096&&(h+=13,u>>>=13),u>=64&&(h+=7,u>>>=7),u>=8&&(h+=4,u>>>=4),u>=2&&(h+=2,u>>>=2),h+u},a.prototype._zeroBits=function(y){if(y===0)return 26;var u=y,h=0;return u&8191||(h+=13,u>>>=13),u&127||(h+=7,u>>>=7),u&15||(h+=4,u>>>=4),u&3||(h+=2,u>>>=2),u&1||h++,h},a.prototype.bitLength=function(){var y=this.words[this.length-1],u=this._countBits(y);return(this.length-1)*26+u};function C(U){for(var y=new Array(U.bitLength()),u=0;u>>v}return y}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,u=0;uy.length?this.clone().ior(y):y.clone().ior(this)},a.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},a.prototype.iuand=function(y){var u;this.length>y.length?u=y:u=this;for(var h=0;hy.length?this.clone().iand(y):y.clone().iand(this)},a.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},a.prototype.iuxor=function(y){var u,h;this.length>y.length?(u=this,h=y):(u=y,h=this);for(var v=0;vy.length?this.clone().ixor(y):y.clone().ixor(this)},a.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},a.prototype.inotn=function(y){i(typeof y=="number"&&y>=0);var u=Math.ceil(y/26)|0,h=y%26;this._expand(u),h>0&&u--;for(var v=0;v0&&(this.words[v]=~this.words[v]&67108863>>26-h),this.strip()},a.prototype.notn=function(y){return this.clone().inotn(y)},a.prototype.setn=function(y,u){i(typeof y=="number"&&y>=0);var h=y/26|0,v=y%26;return this._expand(h+1),u?this.words[h]=this.words[h]|1<y.length?(h=this,v=y):(h=y,v=this);for(var E=0,S=0;S>>26;for(;E!==0&&S>>26;if(this.length=h.length,E!==0)this.words[this.length]=E,this.length++;else if(h!==this)for(;Sy.length?this.clone().iadd(y):y.clone().iadd(this)},a.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var u=this.iadd(y);return y.negative=1,u._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var h=this.cmp(y);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,E;h>0?(v=this,E=y):(v=y,E=this);for(var S=0,M=0;M>26,this.words[M]=u&67108863;for(;S!==0&&M>26,this.words[M]=u&67108863;if(S===0&&M>>26,R=x&67108863,Z=Math.min(p,y.length-1),ae=Math.max(0,p-U.length+1);ae<=Z;ae++){var I=p-ae|0;v=U.words[I]|0,E=y.words[ae]|0,S=v*E+R,b+=S/67108864|0,R=S&67108863}u.words[p]=R|0,x=b|0}return x!==0?u.words[p]=x|0:u.length--,u.strip()}var q=function(y,u,h){var v=y.words,E=u.words,S=h.words,M=0,x,p,b,R=v[0]|0,Z=R&8191,ae=R>>>13,I=v[1]|0,ee=I&8191,L=I>>>13,V=v[2]|0,G=V&8191,D=V>>>13,H=v[3]|0,ne=H&8191,ce=H>>>13,fe=v[4]|0,ye=fe&8191,we=fe>>>13,Te=v[5]|0,Qe=Te&8191,Ce=Te>>>13,Re=v[6]|0,Se=Re&8191,me=Re>>>13,Pe=v[7]|0,Ne=Pe&8191,be=Pe>>>13,Oe=v[8]|0,xe=Oe&8191,ve=Oe>>>13,qe=v[9]|0,Me=qe&8191,_e=qe>>>13,He=E[0]|0,Ve=He&8191,Ee=He>>>13,Ke=E[1]|0,ht=Ke&8191,Ge=Ke>>>13,_t=E[2]|0,lt=_t&8191,We=_t>>>13,Et=E[3]|0,St=Et&8191,Be=Et>>>13,Xe=E[4]|0,tt=Xe&8191,$e=Xe>>>13,et=E[5]|0,Ze=et&8191,Fe=et>>>13,ut=E[6]|0,rt=ut&8191,ze=ut>>>13,it=E[7]|0,st=it&8191,Ue=it>>>13,Ye=E[8]|0,ft=Ye&8191,je=Ye>>>13,Rt=E[9]|0,Nt=Rt&8191,at=Rt>>>13;h.negative=y.negative^u.negative,h.length=19,x=Math.imul(Z,Ve),p=Math.imul(Z,Ee),p=p+Math.imul(ae,Ve)|0,b=Math.imul(ae,Ee);var vt=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(vt>>>26)|0,vt&=67108863,x=Math.imul(ee,Ve),p=Math.imul(ee,Ee),p=p+Math.imul(L,Ve)|0,b=Math.imul(L,Ee),x=x+Math.imul(Z,ht)|0,p=p+Math.imul(Z,Ge)|0,p=p+Math.imul(ae,ht)|0,b=b+Math.imul(ae,Ge)|0;var Rr=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,x=Math.imul(G,Ve),p=Math.imul(G,Ee),p=p+Math.imul(D,Ve)|0,b=Math.imul(D,Ee),x=x+Math.imul(ee,ht)|0,p=p+Math.imul(ee,Ge)|0,p=p+Math.imul(L,ht)|0,b=b+Math.imul(L,Ge)|0,x=x+Math.imul(Z,lt)|0,p=p+Math.imul(Z,We)|0,p=p+Math.imul(ae,lt)|0,b=b+Math.imul(ae,We)|0;var Nr=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,x=Math.imul(ne,Ve),p=Math.imul(ne,Ee),p=p+Math.imul(ce,Ve)|0,b=Math.imul(ce,Ee),x=x+Math.imul(G,ht)|0,p=p+Math.imul(G,Ge)|0,p=p+Math.imul(D,ht)|0,b=b+Math.imul(D,Ge)|0,x=x+Math.imul(ee,lt)|0,p=p+Math.imul(ee,We)|0,p=p+Math.imul(L,lt)|0,b=b+Math.imul(L,We)|0,x=x+Math.imul(Z,St)|0,p=p+Math.imul(Z,Be)|0,p=p+Math.imul(ae,St)|0,b=b+Math.imul(ae,Be)|0;var Br=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Br>>>26)|0,Br&=67108863,x=Math.imul(ye,Ve),p=Math.imul(ye,Ee),p=p+Math.imul(we,Ve)|0,b=Math.imul(we,Ee),x=x+Math.imul(ne,ht)|0,p=p+Math.imul(ne,Ge)|0,p=p+Math.imul(ce,ht)|0,b=b+Math.imul(ce,Ge)|0,x=x+Math.imul(G,lt)|0,p=p+Math.imul(G,We)|0,p=p+Math.imul(D,lt)|0,b=b+Math.imul(D,We)|0,x=x+Math.imul(ee,St)|0,p=p+Math.imul(ee,Be)|0,p=p+Math.imul(L,St)|0,b=b+Math.imul(L,Be)|0,x=x+Math.imul(Z,tt)|0,p=p+Math.imul(Z,$e)|0,p=p+Math.imul(ae,tt)|0,b=b+Math.imul(ae,$e)|0;var $r=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+($r>>>26)|0,$r&=67108863,x=Math.imul(Qe,Ve),p=Math.imul(Qe,Ee),p=p+Math.imul(Ce,Ve)|0,b=Math.imul(Ce,Ee),x=x+Math.imul(ye,ht)|0,p=p+Math.imul(ye,Ge)|0,p=p+Math.imul(we,ht)|0,b=b+Math.imul(we,Ge)|0,x=x+Math.imul(ne,lt)|0,p=p+Math.imul(ne,We)|0,p=p+Math.imul(ce,lt)|0,b=b+Math.imul(ce,We)|0,x=x+Math.imul(G,St)|0,p=p+Math.imul(G,Be)|0,p=p+Math.imul(D,St)|0,b=b+Math.imul(D,Be)|0,x=x+Math.imul(ee,tt)|0,p=p+Math.imul(ee,$e)|0,p=p+Math.imul(L,tt)|0,b=b+Math.imul(L,$e)|0,x=x+Math.imul(Z,Ze)|0,p=p+Math.imul(Z,Fe)|0,p=p+Math.imul(ae,Ze)|0,b=b+Math.imul(ae,Fe)|0;var Ur=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,x=Math.imul(Se,Ve),p=Math.imul(Se,Ee),p=p+Math.imul(me,Ve)|0,b=Math.imul(me,Ee),x=x+Math.imul(Qe,ht)|0,p=p+Math.imul(Qe,Ge)|0,p=p+Math.imul(Ce,ht)|0,b=b+Math.imul(Ce,Ge)|0,x=x+Math.imul(ye,lt)|0,p=p+Math.imul(ye,We)|0,p=p+Math.imul(we,lt)|0,b=b+Math.imul(we,We)|0,x=x+Math.imul(ne,St)|0,p=p+Math.imul(ne,Be)|0,p=p+Math.imul(ce,St)|0,b=b+Math.imul(ce,Be)|0,x=x+Math.imul(G,tt)|0,p=p+Math.imul(G,$e)|0,p=p+Math.imul(D,tt)|0,b=b+Math.imul(D,$e)|0,x=x+Math.imul(ee,Ze)|0,p=p+Math.imul(ee,Fe)|0,p=p+Math.imul(L,Ze)|0,b=b+Math.imul(L,Fe)|0,x=x+Math.imul(Z,rt)|0,p=p+Math.imul(Z,ze)|0,p=p+Math.imul(ae,rt)|0,b=b+Math.imul(ae,ze)|0;var er=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(er>>>26)|0,er&=67108863,x=Math.imul(Ne,Ve),p=Math.imul(Ne,Ee),p=p+Math.imul(be,Ve)|0,b=Math.imul(be,Ee),x=x+Math.imul(Se,ht)|0,p=p+Math.imul(Se,Ge)|0,p=p+Math.imul(me,ht)|0,b=b+Math.imul(me,Ge)|0,x=x+Math.imul(Qe,lt)|0,p=p+Math.imul(Qe,We)|0,p=p+Math.imul(Ce,lt)|0,b=b+Math.imul(Ce,We)|0,x=x+Math.imul(ye,St)|0,p=p+Math.imul(ye,Be)|0,p=p+Math.imul(we,St)|0,b=b+Math.imul(we,Be)|0,x=x+Math.imul(ne,tt)|0,p=p+Math.imul(ne,$e)|0,p=p+Math.imul(ce,tt)|0,b=b+Math.imul(ce,$e)|0,x=x+Math.imul(G,Ze)|0,p=p+Math.imul(G,Fe)|0,p=p+Math.imul(D,Ze)|0,b=b+Math.imul(D,Fe)|0,x=x+Math.imul(ee,rt)|0,p=p+Math.imul(ee,ze)|0,p=p+Math.imul(L,rt)|0,b=b+Math.imul(L,ze)|0,x=x+Math.imul(Z,st)|0,p=p+Math.imul(Z,Ue)|0,p=p+Math.imul(ae,st)|0,b=b+Math.imul(ae,Ue)|0;var Xr=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,x=Math.imul(xe,Ve),p=Math.imul(xe,Ee),p=p+Math.imul(ve,Ve)|0,b=Math.imul(ve,Ee),x=x+Math.imul(Ne,ht)|0,p=p+Math.imul(Ne,Ge)|0,p=p+Math.imul(be,ht)|0,b=b+Math.imul(be,Ge)|0,x=x+Math.imul(Se,lt)|0,p=p+Math.imul(Se,We)|0,p=p+Math.imul(me,lt)|0,b=b+Math.imul(me,We)|0,x=x+Math.imul(Qe,St)|0,p=p+Math.imul(Qe,Be)|0,p=p+Math.imul(Ce,St)|0,b=b+Math.imul(Ce,Be)|0,x=x+Math.imul(ye,tt)|0,p=p+Math.imul(ye,$e)|0,p=p+Math.imul(we,tt)|0,b=b+Math.imul(we,$e)|0,x=x+Math.imul(ne,Ze)|0,p=p+Math.imul(ne,Fe)|0,p=p+Math.imul(ce,Ze)|0,b=b+Math.imul(ce,Fe)|0,x=x+Math.imul(G,rt)|0,p=p+Math.imul(G,ze)|0,p=p+Math.imul(D,rt)|0,b=b+Math.imul(D,ze)|0,x=x+Math.imul(ee,st)|0,p=p+Math.imul(ee,Ue)|0,p=p+Math.imul(L,st)|0,b=b+Math.imul(L,Ue)|0,x=x+Math.imul(Z,ft)|0,p=p+Math.imul(Z,je)|0,p=p+Math.imul(ae,ft)|0,b=b+Math.imul(ae,je)|0;var Wi=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,x=Math.imul(Me,Ve),p=Math.imul(Me,Ee),p=p+Math.imul(_e,Ve)|0,b=Math.imul(_e,Ee),x=x+Math.imul(xe,ht)|0,p=p+Math.imul(xe,Ge)|0,p=p+Math.imul(ve,ht)|0,b=b+Math.imul(ve,Ge)|0,x=x+Math.imul(Ne,lt)|0,p=p+Math.imul(Ne,We)|0,p=p+Math.imul(be,lt)|0,b=b+Math.imul(be,We)|0,x=x+Math.imul(Se,St)|0,p=p+Math.imul(Se,Be)|0,p=p+Math.imul(me,St)|0,b=b+Math.imul(me,Be)|0,x=x+Math.imul(Qe,tt)|0,p=p+Math.imul(Qe,$e)|0,p=p+Math.imul(Ce,tt)|0,b=b+Math.imul(Ce,$e)|0,x=x+Math.imul(ye,Ze)|0,p=p+Math.imul(ye,Fe)|0,p=p+Math.imul(we,Ze)|0,b=b+Math.imul(we,Fe)|0,x=x+Math.imul(ne,rt)|0,p=p+Math.imul(ne,ze)|0,p=p+Math.imul(ce,rt)|0,b=b+Math.imul(ce,ze)|0,x=x+Math.imul(G,st)|0,p=p+Math.imul(G,Ue)|0,p=p+Math.imul(D,st)|0,b=b+Math.imul(D,Ue)|0,x=x+Math.imul(ee,ft)|0,p=p+Math.imul(ee,je)|0,p=p+Math.imul(L,ft)|0,b=b+Math.imul(L,je)|0,x=x+Math.imul(Z,Nt)|0,p=p+Math.imul(Z,at)|0,p=p+Math.imul(ae,Nt)|0,b=b+Math.imul(ae,at)|0;var Zr=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,x=Math.imul(Me,ht),p=Math.imul(Me,Ge),p=p+Math.imul(_e,ht)|0,b=Math.imul(_e,Ge),x=x+Math.imul(xe,lt)|0,p=p+Math.imul(xe,We)|0,p=p+Math.imul(ve,lt)|0,b=b+Math.imul(ve,We)|0,x=x+Math.imul(Ne,St)|0,p=p+Math.imul(Ne,Be)|0,p=p+Math.imul(be,St)|0,b=b+Math.imul(be,Be)|0,x=x+Math.imul(Se,tt)|0,p=p+Math.imul(Se,$e)|0,p=p+Math.imul(me,tt)|0,b=b+Math.imul(me,$e)|0,x=x+Math.imul(Qe,Ze)|0,p=p+Math.imul(Qe,Fe)|0,p=p+Math.imul(Ce,Ze)|0,b=b+Math.imul(Ce,Fe)|0,x=x+Math.imul(ye,rt)|0,p=p+Math.imul(ye,ze)|0,p=p+Math.imul(we,rt)|0,b=b+Math.imul(we,ze)|0,x=x+Math.imul(ne,st)|0,p=p+Math.imul(ne,Ue)|0,p=p+Math.imul(ce,st)|0,b=b+Math.imul(ce,Ue)|0,x=x+Math.imul(G,ft)|0,p=p+Math.imul(G,je)|0,p=p+Math.imul(D,ft)|0,b=b+Math.imul(D,je)|0,x=x+Math.imul(ee,Nt)|0,p=p+Math.imul(ee,at)|0,p=p+Math.imul(L,Nt)|0,b=b+Math.imul(L,at)|0;var Yi=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,x=Math.imul(Me,lt),p=Math.imul(Me,We),p=p+Math.imul(_e,lt)|0,b=Math.imul(_e,We),x=x+Math.imul(xe,St)|0,p=p+Math.imul(xe,Be)|0,p=p+Math.imul(ve,St)|0,b=b+Math.imul(ve,Be)|0,x=x+Math.imul(Ne,tt)|0,p=p+Math.imul(Ne,$e)|0,p=p+Math.imul(be,tt)|0,b=b+Math.imul(be,$e)|0,x=x+Math.imul(Se,Ze)|0,p=p+Math.imul(Se,Fe)|0,p=p+Math.imul(me,Ze)|0,b=b+Math.imul(me,Fe)|0,x=x+Math.imul(Qe,rt)|0,p=p+Math.imul(Qe,ze)|0,p=p+Math.imul(Ce,rt)|0,b=b+Math.imul(Ce,ze)|0,x=x+Math.imul(ye,st)|0,p=p+Math.imul(ye,Ue)|0,p=p+Math.imul(we,st)|0,b=b+Math.imul(we,Ue)|0,x=x+Math.imul(ne,ft)|0,p=p+Math.imul(ne,je)|0,p=p+Math.imul(ce,ft)|0,b=b+Math.imul(ce,je)|0,x=x+Math.imul(G,Nt)|0,p=p+Math.imul(G,at)|0,p=p+Math.imul(D,Nt)|0,b=b+Math.imul(D,at)|0;var Qi=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,x=Math.imul(Me,St),p=Math.imul(Me,Be),p=p+Math.imul(_e,St)|0,b=Math.imul(_e,Be),x=x+Math.imul(xe,tt)|0,p=p+Math.imul(xe,$e)|0,p=p+Math.imul(ve,tt)|0,b=b+Math.imul(ve,$e)|0,x=x+Math.imul(Ne,Ze)|0,p=p+Math.imul(Ne,Fe)|0,p=p+Math.imul(be,Ze)|0,b=b+Math.imul(be,Fe)|0,x=x+Math.imul(Se,rt)|0,p=p+Math.imul(Se,ze)|0,p=p+Math.imul(me,rt)|0,b=b+Math.imul(me,ze)|0,x=x+Math.imul(Qe,st)|0,p=p+Math.imul(Qe,Ue)|0,p=p+Math.imul(Ce,st)|0,b=b+Math.imul(Ce,Ue)|0,x=x+Math.imul(ye,ft)|0,p=p+Math.imul(ye,je)|0,p=p+Math.imul(we,ft)|0,b=b+Math.imul(we,je)|0,x=x+Math.imul(ne,Nt)|0,p=p+Math.imul(ne,at)|0,p=p+Math.imul(ce,Nt)|0,b=b+Math.imul(ce,at)|0;var ei=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(ei>>>26)|0,ei&=67108863,x=Math.imul(Me,tt),p=Math.imul(Me,$e),p=p+Math.imul(_e,tt)|0,b=Math.imul(_e,$e),x=x+Math.imul(xe,Ze)|0,p=p+Math.imul(xe,Fe)|0,p=p+Math.imul(ve,Ze)|0,b=b+Math.imul(ve,Fe)|0,x=x+Math.imul(Ne,rt)|0,p=p+Math.imul(Ne,ze)|0,p=p+Math.imul(be,rt)|0,b=b+Math.imul(be,ze)|0,x=x+Math.imul(Se,st)|0,p=p+Math.imul(Se,Ue)|0,p=p+Math.imul(me,st)|0,b=b+Math.imul(me,Ue)|0,x=x+Math.imul(Qe,ft)|0,p=p+Math.imul(Qe,je)|0,p=p+Math.imul(Ce,ft)|0,b=b+Math.imul(Ce,je)|0,x=x+Math.imul(ye,Nt)|0,p=p+Math.imul(ye,at)|0,p=p+Math.imul(we,Nt)|0,b=b+Math.imul(we,at)|0;var Mi=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,x=Math.imul(Me,Ze),p=Math.imul(Me,Fe),p=p+Math.imul(_e,Ze)|0,b=Math.imul(_e,Fe),x=x+Math.imul(xe,rt)|0,p=p+Math.imul(xe,ze)|0,p=p+Math.imul(ve,rt)|0,b=b+Math.imul(ve,ze)|0,x=x+Math.imul(Ne,st)|0,p=p+Math.imul(Ne,Ue)|0,p=p+Math.imul(be,st)|0,b=b+Math.imul(be,Ue)|0,x=x+Math.imul(Se,ft)|0,p=p+Math.imul(Se,je)|0,p=p+Math.imul(me,ft)|0,b=b+Math.imul(me,je)|0,x=x+Math.imul(Qe,Nt)|0,p=p+Math.imul(Qe,at)|0,p=p+Math.imul(Ce,Nt)|0,b=b+Math.imul(Ce,at)|0;var Ii=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,x=Math.imul(Me,rt),p=Math.imul(Me,ze),p=p+Math.imul(_e,rt)|0,b=Math.imul(_e,ze),x=x+Math.imul(xe,st)|0,p=p+Math.imul(xe,Ue)|0,p=p+Math.imul(ve,st)|0,b=b+Math.imul(ve,Ue)|0,x=x+Math.imul(Ne,ft)|0,p=p+Math.imul(Ne,je)|0,p=p+Math.imul(be,ft)|0,b=b+Math.imul(be,je)|0,x=x+Math.imul(Se,Nt)|0,p=p+Math.imul(Se,at)|0,p=p+Math.imul(me,Nt)|0,b=b+Math.imul(me,at)|0;var lr=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(lr>>>26)|0,lr&=67108863,x=Math.imul(Me,st),p=Math.imul(Me,Ue),p=p+Math.imul(_e,st)|0,b=Math.imul(_e,Ue),x=x+Math.imul(xe,ft)|0,p=p+Math.imul(xe,je)|0,p=p+Math.imul(ve,ft)|0,b=b+Math.imul(ve,je)|0,x=x+Math.imul(Ne,Nt)|0,p=p+Math.imul(Ne,at)|0,p=p+Math.imul(be,Nt)|0,b=b+Math.imul(be,at)|0;var Xi=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,x=Math.imul(Me,ft),p=Math.imul(Me,je),p=p+Math.imul(_e,ft)|0,b=Math.imul(_e,je),x=x+Math.imul(xe,Nt)|0,p=p+Math.imul(xe,at)|0,p=p+Math.imul(ve,Nt)|0,b=b+Math.imul(ve,at)|0;var Zi=(M+x|0)+((p&8191)<<13)|0;M=(b+(p>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,x=Math.imul(Me,Nt),p=Math.imul(Me,at),p=p+Math.imul(_e,Nt)|0,b=Math.imul(_e,at);var en=(M+x|0)+((p&8191)<<13)|0;return M=(b+(p>>>13)|0)+(en>>>26)|0,en&=67108863,S[0]=vt,S[1]=Rr,S[2]=Nr,S[3]=Br,S[4]=$r,S[5]=Ur,S[6]=er,S[7]=Xr,S[8]=Wi,S[9]=Zr,S[10]=Yi,S[11]=Qi,S[12]=ei,S[13]=Mi,S[14]=Ii,S[15]=lr,S[16]=Xi,S[17]=Zi,S[18]=en,M!==0&&(S[19]=M,h.length++),h};Math.imul||(q=P);function K(U,y,u){u.negative=y.negative^U.negative,u.length=U.length+y.length;for(var h=0,v=0,E=0;E>>26)|0,v+=S>>>26,S&=67108863}u.words[E]=M,h=S,S=v}return h!==0?u.words[E]=h:u.length--,u.strip()}function Y(U,y,u){var h=new z;return h.mulp(U,y,u)}a.prototype.mulTo=function(y,u){var h,v=this.length+y.length;return this.length===10&&y.length===10?h=q(this,y,u):v<63?h=P(this,y,u):v<1024?h=K(this,y,u):h=Y(this,y,u),h};function z(U,y){this.x=U,this.y=y}z.prototype.makeRBT=function(y){for(var u=new Array(y),h=a.prototype._countBits(y)-1,v=0;v>=1;return v},z.prototype.permute=function(y,u,h,v,E,S){for(var M=0;M>>1)E++;return 1<>>13,h[2*S+1]=E&8191,E=E>>>13;for(S=2*u;S>=26,u+=v/67108864|0,u+=E>>>26,this.words[h]=E&67108863}return u!==0&&(this.words[h]=u,this.length++),this},a.prototype.muln=function(y){return this.clone().imuln(y)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(y){var u=C(y);if(u.length===0)return new a(1);for(var h=this,v=0;v=0);var u=y%26,h=(y-u)/26,v=67108863>>>26-u<<26-u,E;if(u!==0){var S=0;for(E=0;E>>26-u}S&&(this.words[E]=S,this.length++)}if(h!==0){for(E=this.length-1;E>=0;E--)this.words[E+h]=this.words[E];for(E=0;E=0);var v;u?v=(u-u%26)/26:v=0;var E=y%26,S=Math.min((y-E)/26,this.length),M=67108863^67108863>>>E<S)for(this.length-=S,p=0;p=0&&(b!==0||p>=v);p--){var R=this.words[p]|0;this.words[p]=b<<26-E|R>>>E,b=R&M}return x&&b!==0&&(x.words[x.length++]=b),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(y,u,h){return i(this.negative===0),this.iushrn(y,u,h)},a.prototype.shln=function(y){return this.clone().ishln(y)},a.prototype.ushln=function(y){return this.clone().iushln(y)},a.prototype.shrn=function(y){return this.clone().ishrn(y)},a.prototype.ushrn=function(y){return this.clone().iushrn(y)},a.prototype.testn=function(y){i(typeof y=="number"&&y>=0);var u=y%26,h=(y-u)/26,v=1<=0);var u=y%26,h=(y-u)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(u!==0&&h++,this.length=Math.min(h,this.length),u!==0){var v=67108863^67108863>>>u<=67108864;u++)this.words[u]-=67108864,u===this.length-1?this.words[u+1]=1:this.words[u+1]++;return this.length=Math.max(this.length,u+1),this},a.prototype.isubn=function(y){if(i(typeof y=="number"),i(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var u=0;u>26)-(x/67108864|0),this.words[E+h]=S&67108863}for(;E>26,this.words[E+h]=S&67108863;if(M===0)return this.strip();for(i(M===-1),M=0,E=0;E>26,this.words[E]=S&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(y,u){var h=this.length-y.length,v=this.clone(),E=y,S=E.words[E.length-1]|0,M=this._countBits(S);h=26-M,h!==0&&(E=E.ushln(h),v.iushln(h),S=E.words[E.length-1]|0);var x=v.length-E.length,p;if(u!=="mod"){p=new a(null),p.length=x+1,p.words=new Array(p.length);for(var b=0;b=0;Z--){var ae=(v.words[E.length+Z]|0)*67108864+(v.words[E.length+Z-1]|0);for(ae=Math.min(ae/S|0,67108863),v._ishlnsubmul(E,ae,Z);v.negative!==0;)ae--,v.negative=0,v._ishlnsubmul(E,1,Z),v.isZero()||(v.negative^=1);p&&(p.words[Z]=ae)}return p&&p.strip(),v.strip(),u!=="div"&&h!==0&&v.iushrn(h),{div:p||null,mod:v}},a.prototype.divmod=function(y,u,h){if(i(!y.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var v,E,S;return this.negative!==0&&y.negative===0?(S=this.neg().divmod(y,u),u!=="mod"&&(v=S.div.neg()),u!=="div"&&(E=S.mod.neg(),h&&E.negative!==0&&E.iadd(y)),{div:v,mod:E}):this.negative===0&&y.negative!==0?(S=this.divmod(y.neg(),u),u!=="mod"&&(v=S.div.neg()),{div:v,mod:S.mod}):this.negative&y.negative?(S=this.neg().divmod(y.neg(),u),u!=="div"&&(E=S.mod.neg(),h&&E.negative!==0&&E.isub(y)),{div:S.div,mod:E}):y.length>this.length||this.cmp(y)<0?{div:new a(0),mod:this}:y.length===1?u==="div"?{div:this.divn(y.words[0]),mod:null}:u==="mod"?{div:null,mod:new a(this.modn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new a(this.modn(y.words[0]))}:this._wordDiv(y,u)},a.prototype.div=function(y){return this.divmod(y,"div",!1).div},a.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},a.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},a.prototype.divRound=function(y){var u=this.divmod(y);if(u.mod.isZero())return u.div;var h=u.div.negative!==0?u.mod.isub(y):u.mod,v=y.ushrn(1),E=y.andln(1),S=h.cmp(v);return S<0||E===1&&S===0?u.div:u.div.negative!==0?u.div.isubn(1):u.div.iaddn(1)},a.prototype.modn=function(y){i(y<=67108863);for(var u=(1<<26)%y,h=0,v=this.length-1;v>=0;v--)h=(u*h+(this.words[v]|0))%y;return h},a.prototype.idivn=function(y){i(y<=67108863);for(var u=0,h=this.length-1;h>=0;h--){var v=(this.words[h]|0)+u*67108864;this.words[h]=v/y|0,u=v%y}return this.strip()},a.prototype.divn=function(y){return this.clone().idivn(y)},a.prototype.egcd=function(y){i(y.negative===0),i(!y.isZero());var u=this,h=y.clone();u.negative!==0?u=u.umod(y):u=u.clone();for(var v=new a(1),E=new a(0),S=new a(0),M=new a(1),x=0;u.isEven()&&h.isEven();)u.iushrn(1),h.iushrn(1),++x;for(var p=h.clone(),b=u.clone();!u.isZero();){for(var R=0,Z=1;!(u.words[0]&Z)&&R<26;++R,Z<<=1);if(R>0)for(u.iushrn(R);R-- >0;)(v.isOdd()||E.isOdd())&&(v.iadd(p),E.isub(b)),v.iushrn(1),E.iushrn(1);for(var ae=0,I=1;!(h.words[0]&I)&&ae<26;++ae,I<<=1);if(ae>0)for(h.iushrn(ae);ae-- >0;)(S.isOdd()||M.isOdd())&&(S.iadd(p),M.isub(b)),S.iushrn(1),M.iushrn(1);u.cmp(h)>=0?(u.isub(h),v.isub(S),E.isub(M)):(h.isub(u),S.isub(v),M.isub(E))}return{a:S,b:M,gcd:h.iushln(x)}},a.prototype._invmp=function(y){i(y.negative===0),i(!y.isZero());var u=this,h=y.clone();u.negative!==0?u=u.umod(y):u=u.clone();for(var v=new a(1),E=new a(0),S=h.clone();u.cmpn(1)>0&&h.cmpn(1)>0;){for(var M=0,x=1;!(u.words[0]&x)&&M<26;++M,x<<=1);if(M>0)for(u.iushrn(M);M-- >0;)v.isOdd()&&v.iadd(S),v.iushrn(1);for(var p=0,b=1;!(h.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(h.iushrn(p);p-- >0;)E.isOdd()&&E.iadd(S),E.iushrn(1);u.cmp(h)>=0?(u.isub(h),v.isub(E)):(h.isub(u),E.isub(v))}var R;return u.cmpn(1)===0?R=v:R=E,R.cmpn(0)<0&&R.iadd(y),R},a.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var u=this.clone(),h=y.clone();u.negative=0,h.negative=0;for(var v=0;u.isEven()&&h.isEven();v++)u.iushrn(1),h.iushrn(1);do{for(;u.isEven();)u.iushrn(1);for(;h.isEven();)h.iushrn(1);var E=u.cmp(h);if(E<0){var S=u;u=h,h=S}else if(E===0||h.cmpn(1)===0)break;u.isub(h)}while(!0);return h.iushln(v)},a.prototype.invm=function(y){return this.egcd(y).a.umod(y)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(y){return this.words[0]&y},a.prototype.bincn=function(y){i(typeof y=="number");var u=y%26,h=(y-u)/26,v=1<>>26,M&=67108863,this.words[S]=M}return E!==0&&(this.words[S]=E,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(y){var u=y<0;if(this.negative!==0&&!u)return-1;if(this.negative===0&&u)return 1;this.strip();var h;if(this.length>1)h=1;else{u&&(y=-y),i(y<=67108863,"Number is too big");var v=this.words[0]|0;h=v===y?0:vy.length)return 1;if(this.length=0;h--){var v=this.words[h]|0,E=y.words[h]|0;if(v!==E){vE&&(u=1);break}}return u},a.prototype.gtn=function(y){return this.cmpn(y)===1},a.prototype.gt=function(y){return this.cmp(y)===1},a.prototype.gten=function(y){return this.cmpn(y)>=0},a.prototype.gte=function(y){return this.cmp(y)>=0},a.prototype.ltn=function(y){return this.cmpn(y)===-1},a.prototype.lt=function(y){return this.cmp(y)===-1},a.prototype.lten=function(y){return this.cmpn(y)<=0},a.prototype.lte=function(y){return this.cmp(y)<=0},a.prototype.eqn=function(y){return this.cmpn(y)===0},a.prototype.eq=function(y){return this.cmp(y)===0},a.red=function(y){return new se(y)},a.prototype.toRed=function(y){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(y){return this.red=y,this},a.prototype.forceRed=function(y){return i(!this.red,"Already a number in reduction context"),this._forceRed(y)},a.prototype.redAdd=function(y){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},a.prototype.redIAdd=function(y){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},a.prototype.redSub=function(y){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},a.prototype.redISub=function(y){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},a.prototype.redShl=function(y){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},a.prototype.redMul=function(y){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},a.prototype.redIMul=function(y){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(y){return i(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var W={k256:null,p224:null,p192:null,p25519:null};function B(U,y){this.name=U,this.p=new a(y,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}B.prototype._tmp=function(){var y=new a(null);return y.words=new Array(Math.ceil(this.n/13)),y},B.prototype.ireduce=function(y){var u=y,h;do this.split(u,this.tmp),u=this.imulK(u),u=u.iadd(this.tmp),h=u.bitLength();while(h>this.n);var v=h0?u.isub(this.p):u.strip!==void 0?u.strip():u._strip(),u},B.prototype.split=function(y,u){y.iushrn(this.n,0,u)},B.prototype.imulK=function(y){return y.imul(this.k)};function j(){B.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(j,B),j.prototype.split=function(y,u){for(var h=4194303,v=Math.min(y.length,9),E=0;E>>22,S=M}S>>>=22,y.words[E-10]=S,S===0&&y.length>10?y.length-=10:y.length-=9},j.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var u=0,h=0;h>>=26,y.words[h]=E,u=v}return u!==0&&(y.words[y.length++]=u),y},a._prime=function(y){if(W[y])return W[y];var u;if(y==="k256")u=new j;else if(y==="p224")u=new k;else if(y==="p192")u=new _;else if(y==="p25519")u=new N;else throw new Error("Unknown prime "+y);return W[y]=u,u};function se(U){if(typeof U=="string"){var y=a._prime(U);this.m=y.p,this.prime=y}else i(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}se.prototype._verify1=function(y){i(y.negative===0,"red works only with positives"),i(y.red,"red works only with red numbers")},se.prototype._verify2=function(y,u){i((y.negative|u.negative)===0,"red works only with positives"),i(y.red&&y.red===u.red,"red works only with red numbers")},se.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):y.umod(this.m)._forceRed(this)},se.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},se.prototype.add=function(y,u){this._verify2(y,u);var h=y.add(u);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},se.prototype.iadd=function(y,u){this._verify2(y,u);var h=y.iadd(u);return h.cmp(this.m)>=0&&h.isub(this.m),h},se.prototype.sub=function(y,u){this._verify2(y,u);var h=y.sub(u);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},se.prototype.isub=function(y,u){this._verify2(y,u);var h=y.isub(u);return h.cmpn(0)<0&&h.iadd(this.m),h},se.prototype.shl=function(y,u){return this._verify1(y),this.imod(y.ushln(u))},se.prototype.imul=function(y,u){return this._verify2(y,u),this.imod(y.imul(u))},se.prototype.mul=function(y,u){return this._verify2(y,u),this.imod(y.mul(u))},se.prototype.isqr=function(y){return this.imul(y,y.clone())},se.prototype.sqr=function(y){return this.mul(y,y)},se.prototype.sqrt=function(y){if(y.isZero())return y.clone();var u=this.m.andln(3);if(i(u%2===1),u===3){var h=this.m.add(new a(1)).iushrn(2);return this.pow(y,h)}for(var v=this.m.subn(1),E=0;!v.isZero()&&v.andln(1)===0;)E++,v.iushrn(1);i(!v.isZero());var S=new a(1).toRed(this),M=S.redNeg(),x=this.m.subn(1).iushrn(1),p=this.m.bitLength();for(p=new a(2*p*p).toRed(this);this.pow(p,x).cmp(M)!==0;)p.redIAdd(M);for(var b=this.pow(p,v),R=this.pow(y,v.addn(1).iushrn(1)),Z=this.pow(y,v),ae=E;Z.cmp(S)!==0;){for(var I=Z,ee=0;I.cmp(S)!==0;ee++)I=I.redSqr();i(ee=0;E--){for(var b=u.words[E],R=p-1;R>=0;R--){var Z=b>>R&1;if(S!==v[0]&&(S=this.sqr(S)),Z===0&&M===0){x=0;continue}M<<=1,M|=Z,x++,!(x!==h&&(E!==0||R!==0))&&(S=this.mul(S,v[M]),x=0,M=0)}p=26}return S},se.prototype.convertTo=function(y){var u=y.umod(this.m);return u===y?u.clone():u},se.prototype.convertFrom=function(y){var u=y.clone();return u.red=null,u},a.mont=function(y){return new le(y)};function le(U){se.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(le,se),le.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},le.prototype.convertFrom=function(y){var u=this.imod(y.mul(this.rinv));return u.red=null,u},le.prototype.imul=function(y,u){if(y.isZero()||u.isZero())return y.words[0]=0,y.length=1,y;var h=y.imul(u),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=h.isub(v).iushrn(this.shift),S=E;return E.cmp(this.m)>=0?S=E.isub(this.m):E.cmpn(0)<0&&(S=E.iadd(this.m)),S._forceRed(this)},le.prototype.mul=function(y,u){if(y.isZero()||u.isZero())return new a(0)._forceRed(this);var h=y.mul(u),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=h.isub(v).iushrn(this.shift),S=E;return E.cmp(this.m)>=0?S=E.isub(this.m):E.cmpn(0)<0&&(S=E.iadd(this.m)),S._forceRed(this)},le.prototype.invm=function(y){var u=this.imod(y._invmp(this.m).mul(this.r2));return u._forceRed(this)}})(r,tv)})(Gd);var ws=Gd.exports,Da=Av;function Av(r,e){if(!r)throw new Error(e||"Assertion failed")}Av.equal=function(e,t,i){if(e!=t)throw new Error(i||"Assertion failed: "+e+" != "+t)};var Jd={};(function(r){var e=r;function t(a,c){if(Array.isArray(a))return a.slice();if(!a)return[];var f=[];if(typeof a!="string"){for(var g=0;g>8,w=d&255;m?f.push(m,w):f.push(w)}return f}e.toArray=t;function i(a){return a.length===1?"0"+a:a}e.zero2=i;function n(a){for(var c="",f=0;f(q>>1)-1?Y=(q>>1)-z:Y=z,K.isubn(Y)):Y=0,C[P]=Y,K.iushrn(1)}return C}e.getNAF=a;function c(m,w){var O=[[],[]];m=m.clone(),w=w.clone();for(var C=0,P=0,q;m.cmpn(-C)>0||w.cmpn(-P)>0;){var K=m.andln(3)+C&3,Y=w.andln(3)+P&3;K===3&&(K=-1),Y===3&&(Y=-1);var z;K&1?(q=m.andln(7)+C&7,(q===3||q===5)&&Y===2?z=-K:z=K):z=0,O[0].push(z);var W;Y&1?(q=w.andln(7)+P&7,(q===3||q===5)&&K===2?W=-Y:W=Y):W=0,O[1].push(W),2*C===z+1&&(C=1-C),2*P===W+1&&(P=1-P),m.iushrn(1),w.iushrn(1)}return O}e.getJSF=c;function f(m,w,O){var C="_"+w;m.prototype[w]=function(){return this[C]!==void 0?this[C]:this[C]=O.call(this)}}e.cachedProperty=f;function g(m){return typeof m=="string"?e.toArray(m,"hex"):m}e.parseBytes=g;function d(m){return new t(m,"hex","le")}e.intFromLE=d})(Si);var Wd={exports:{}},_l;Wd.exports=function(e){return _l||(_l=new qs(null)),_l.generate(e)};function qs(r){this.rand=r}Wd.exports.Rand=qs;qs.prototype.generate=function(e){return this._rand(e)};qs.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var qf=Hs;Hs.prototype.point=function(){throw new Error("Not implemented")};Hs.prototype.validate=function(){throw new Error("Not implemented")};Hs.prototype._fixedNafMul=function(e,t){gf(e.precomputed);var i=e._getDoubles(),n=pf(t,1,this._bitLength),a=(1<=f;d--)g=(g<<1)+n[d];c.push(g)}for(var m=this.jpoint(null,null,null),w=this.jpoint(null,null,null),O=a;O>0;O--){for(f=0;f=0;g--){for(var d=0;g>=0&&c[g]===0;g--)d++;if(g>=0&&d++,f=f.dblp(d),g<0)break;var m=c[g];gf(m!==0),e.type==="affine"?m>0?f=f.mixedAdd(a[m-1>>1]):f=f.mixedAdd(a[-m-1>>1].neg()):m>0?f=f.add(a[m-1>>1]):f=f.add(a[-m-1>>1].neg())}return e.type==="affine"?f.toP():f};Hs.prototype._wnafMulAdd=function(e,t,i,n,a){var c=this._wnafT1,f=this._wnafT2,g=this._wnafT3,d=0,m,w,O;for(m=0;m=1;m-=2){var P=m-1,q=m;if(c[P]!==1||c[q]!==1){g[P]=pf(i[P],c[P],this._bitLength),g[q]=pf(i[q],c[q],this._bitLength),d=Math.max(g[P].length,d),d=Math.max(g[q].length,d);continue}var K=[t[P],null,null,t[q]];t[P].y.cmp(t[q].y)===0?(K[1]=t[P].add(t[q]),K[2]=t[P].toJ().mixedAdd(t[q].neg())):t[P].y.cmp(t[q].y.redNeg())===0?(K[1]=t[P].toJ().mixedAdd(t[q]),K[2]=t[P].add(t[q].neg())):(K[1]=t[P].toJ().mixedAdd(t[q]),K[2]=t[P].toJ().mixedAdd(t[q].neg()));var Y=[-3,-1,-5,-7,0,7,5,1,3],z=h9(i[P],i[q]);for(d=Math.max(z[0].length,d),g[P]=new Array(d),g[q]=new Array(d),w=0;w=0;m--){for(var _=0;m>=0;){var N=!0;for(w=0;w=0&&_++,j=j.dblp(_),m<0)break;for(w=0;w0?O=f[w][se-1>>1]:se<0&&(O=f[w][-se-1>>1].neg()),O.type==="affine"?j=j.mixedAdd(O):j=j.add(O))}}for(m=0;m=Math.ceil((e.bitLength()+1)/t.step):!1};Gi.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,a=0;a=0&&(C=d,P=m),w.negative&&(w=w.neg(),O=O.neg()),C.negative&&(C=C.neg(),P=P.neg()),[{a:w,b:O},{a:C,b:P}]};Ji.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),c=i.b.neg().mul(e).divRound(this.n),f=a.mul(i.a),g=c.mul(n.a),d=a.mul(i.b),m=c.mul(n.b),w=e.sub(f).sub(g),O=d.add(m).neg();return{k1:w,k2:O}};Ji.prototype.pointFromX=function(e,t){e=new nr(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var a=n.fromRed().isOdd();return(t&&!a||!t&&a)&&(n=n.redNeg()),this.point(e,n)};Ji.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,n=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(a).cmpn(0)===0};Ji.prototype._endoWnafMulAdd=function(e,t,i){for(var n=this._endoWnafT1,a=this._endoWnafT2,c=0;c":""};Ar.prototype.isInfinity=function(){return this.inf};Ar.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)};Ar.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),a=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(n),c=a.redSqr().redISub(this.x.redAdd(this.x)),f=a.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,f)};Ar.prototype.getX=function(){return this.x.fromRed()};Ar.prototype.getY=function(){return this.y.fromRed()};Ar.prototype.mul=function(e){return e=new nr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Ar.prototype.mulAdd=function(e,t,i){var n=[this,t],a=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,a):this.curve._wnafMulAdd(1,n,a,2)};Ar.prototype.jmulAdd=function(e,t,i){var n=[this,t],a=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,a,!0):this.curve._wnafMulAdd(1,n,a,2,!0)};Ar.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Ar.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(a){return a.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return t};Ar.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Cr(r,e,t,i){lo.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new nr(0)):(this.x=new nr(e,16),this.y=new nr(t,16),this.z=new nr(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Qd(Cr,lo.BasePoint);Ji.prototype.jpoint=function(e,t,i){return new Cr(this,e,t,i)};Cr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(i,n)};Cr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Cr.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(i),c=this.y.redMul(t.redMul(e.z)),f=e.y.redMul(i.redMul(this.z)),g=n.redSub(a),d=c.redSub(f);if(g.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var m=g.redSqr(),w=m.redMul(g),O=n.redMul(m),C=d.redSqr().redIAdd(w).redISub(O).redISub(O),P=d.redMul(O.redISub(C)).redISub(c.redMul(w)),q=this.z.redMul(e.z).redMul(g);return this.curve.jpoint(C,P,q)};Cr.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,n=e.x.redMul(t),a=this.y,c=e.y.redMul(t).redMul(this.z),f=i.redSub(n),g=a.redSub(c);if(f.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var d=f.redSqr(),m=d.redMul(f),w=i.redMul(d),O=g.redSqr().redIAdd(m).redISub(w).redISub(w),C=g.redMul(w.redISub(O)).redISub(a.redMul(m)),P=this.z.redMul(f);return this.curve.jpoint(O,C,P)};Cr.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t=0)return!1;if(i.redIAdd(a),this.x.cmp(i)===0)return!0}};Cr.prototype.inspect=function(){return this.isInfinity()?"":""};Cr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var to=ws,Sv=Pf,Lf=qf,g9=Si;function po(r){Lf.call(this,"mont",r),this.a=new to(r.a,16).toRed(this.red),this.b=new to(r.b,16).toRed(this.red),this.i4=new to(4).toRed(this.red).redInvm(),this.two=new to(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Sv(po,Lf);var b9=po;po.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),n=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t),a=n.redSqrt();return a.redSqr().cmp(n)===0};function Er(r,e,t){Lf.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new to(e,16),this.z=new to(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Sv(Er,Lf.BasePoint);po.prototype.decodePoint=function(e,t){return this.point(g9.toArray(e,t),1)};po.prototype.point=function(e,t){return new Er(this,e,t)};po.prototype.pointFromJSON=function(e){return Er.fromJSON(this,e)};Er.prototype.precompute=function(){};Er.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Er.fromJSON=function(e,t){return new Er(e,t[0],t[1]||e.one)};Er.prototype.inspect=function(){return this.isInfinity()?"":""};Er.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Er.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),a=t.redSub(n),c=t.redMul(n),f=a.redMul(n.redAdd(this.curve.a24.redMul(a)));return this.curve.point(c,f)};Er.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Er.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),a=e.x.redAdd(e.z),c=e.x.redSub(e.z),f=c.redMul(i),g=a.redMul(n),d=t.z.redMul(f.redAdd(g).redSqr()),m=t.x.redMul(f.redISub(g).redSqr());return this.curve.point(d,m)};Er.prototype.mul=function(e){for(var t=e.clone(),i=this,n=this.curve.point(null,null),a=this,c=[];t.cmpn(0)!==0;t.iushrn(1))c.push(t.andln(1));for(var f=c.length-1;f>=0;f--)c[f]===0?(i=i.diffAdd(n,a),n=n.dbl()):(n=i.diffAdd(n,a),i=i.dbl());return n};Er.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Er.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Er.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};Er.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Er.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var v9=Si,ps=ws,Mv=Pf,Ff=qf,m9=v9.assert;function Vn(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,Ff.call(this,"edwards",r),this.a=new ps(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new ps(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new ps(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),m9(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}Mv(Vn,Ff);var y9=Vn;Vn.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Vn.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Vn.prototype.jpoint=function(e,t,i,n){return this.point(e,t,i,n)};Vn.prototype.pointFromX=function(e,t){e=new ps(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),a=this.one.redSub(this.c2.redMul(this.d).redMul(i)),c=n.redMul(a.redInvm()),f=c.redSqrt();if(f.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");var g=f.fromRed().isOdd();return(t&&!g||!t&&g)&&(f=f.redNeg()),this.point(e,f)};Vn.prototype.pointFromY=function(e,t){e=new ps(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),a=i.redMul(this.d).redMul(this.c2).redSub(this.a),c=n.redMul(a.redInvm());if(c.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var f=c.redSqrt();if(f.redSqr().redSub(c).cmp(this.zero)!==0)throw new Error("invalid point");return f.fromRed().isOdd()!==t&&(f=f.redNeg()),this.point(f,e)};Vn.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),n=t.redMul(this.a).redAdd(i),a=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return n.cmp(a)===0};function Jt(r,e,t,i,n){Ff.BasePoint.call(this,r,"projective"),e===null&&t===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new ps(e,16),this.y=new ps(t,16),this.z=i?new ps(i,16):this.curve.one,this.t=n&&new ps(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Mv(Jt,Ff.BasePoint);Vn.prototype.pointFromJSON=function(e){return Jt.fromJSON(this,e)};Vn.prototype.point=function(e,t,i,n){return new Jt(this,e,t,i,n)};Jt.fromJSON=function(e,t){return new Jt(e,t[0],t[1],t[2])};Jt.prototype.inspect=function(){return this.isInfinity()?"":""};Jt.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Jt.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),c=n.redAdd(t),f=c.redSub(i),g=n.redSub(t),d=a.redMul(f),m=c.redMul(g),w=a.redMul(g),O=f.redMul(c);return this.curve.point(d,m,O,w)};Jt.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),i=this.y.redSqr(),n,a,c,f,g,d;if(this.curve.twisted){f=this.curve._mulA(t);var m=f.redAdd(i);this.zOne?(n=e.redSub(t).redSub(i).redMul(m.redSub(this.curve.two)),a=m.redMul(f.redSub(i)),c=m.redSqr().redSub(m).redSub(m)):(g=this.z.redSqr(),d=m.redSub(g).redISub(g),n=e.redSub(t).redISub(i).redMul(d),a=m.redMul(f.redSub(i)),c=m.redMul(d))}else f=t.redAdd(i),g=this.curve._mulC(this.z).redSqr(),d=f.redSub(g).redSub(g),n=this.curve._mulC(e.redISub(f)).redMul(d),a=this.curve._mulC(f).redMul(t.redISub(i)),c=f.redMul(d);return this.curve.point(n,a,c)};Jt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Jt.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),c=i.redSub(t),f=a.redSub(n),g=a.redAdd(n),d=i.redAdd(t),m=c.redMul(f),w=g.redMul(d),O=c.redMul(d),C=f.redMul(g);return this.curve.point(m,w,C,O)};Jt.prototype._projAdd=function(e){var t=this.z.redMul(e.z),i=t.redSqr(),n=this.x.redMul(e.x),a=this.y.redMul(e.y),c=this.curve.d.redMul(n).redMul(a),f=i.redSub(c),g=i.redAdd(c),d=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(a),m=t.redMul(f).redMul(d),w,O;return this.curve.twisted?(w=t.redMul(g).redMul(a.redSub(this.curve._mulA(n))),O=f.redMul(g)):(w=t.redMul(g).redMul(a.redSub(n)),O=this.curve._mulC(f).redMul(g)),this.curve.point(m,w,O)};Jt.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};Jt.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};Jt.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)};Jt.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)};Jt.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};Jt.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Jt.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Jt.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Jt.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Jt.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),this.x.cmp(t)===0)return!0}};Jt.prototype.toP=Jt.prototype.normalize;Jt.prototype.mixedAdd=Jt.prototype.add;(function(r){var e=r;e.base=qf,e.short=p9,e.mont=b9,e.edwards=y9})(Yd);var zf={},jf={},Ct={},w9=Da,_9=Pf;Ct.inherits=_9;function D9(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}function E9(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),n=0;n>6|192,t[i++]=a&63|128):D9(r,n)?(a=65536+((a&1023)<<10)+(r.charCodeAt(++n)&1023),t[i++]=a>>18|240,t[i++]=a>>12&63|128,t[i++]=a>>6&63|128,t[i++]=a&63|128):(t[i++]=a>>12|224,t[i++]=a>>6&63|128,t[i++]=a&63|128)}else for(n=0;n>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}Ct.htonl=Iv;function x9(r,e){for(var t="",i=0;i>>0}return a}Ct.join32=S9;function M9(r,e){for(var t=new Array(r.length*4),i=0,n=0;i>>24,t[n+1]=a>>>16&255,t[n+2]=a>>>8&255,t[n+3]=a&255):(t[n+3]=a>>>24,t[n+2]=a>>>16&255,t[n+1]=a>>>8&255,t[n]=a&255)}return t}Ct.split32=M9;function I9(r,e){return r>>>e|r<<32-e}Ct.rotr32=I9;function C9(r,e){return r<>>32-e}Ct.rotl32=C9;function P9(r,e){return r+e>>>0}Ct.sum32=P9;function O9(r,e,t){return r+e+t>>>0}Ct.sum32_3=O9;function T9(r,e,t,i){return r+e+t+i>>>0}Ct.sum32_4=T9;function R9(r,e,t,i,n){return r+e+t+i+n>>>0}Ct.sum32_5=R9;function N9(r,e,t,i){var n=r[e],a=r[e+1],c=i+a>>>0,f=(c>>0,r[e+1]=c}Ct.sum64=N9;function B9(r,e,t,i){var n=e+i>>>0,a=(n>>0}Ct.sum64_hi=B9;function $9(r,e,t,i){var n=e+i;return n>>>0}Ct.sum64_lo=$9;function U9(r,e,t,i,n,a,c,f){var g=0,d=e;d=d+i>>>0,g+=d>>0,g+=d>>0,g+=d>>0}Ct.sum64_4_hi=U9;function q9(r,e,t,i,n,a,c,f){var g=e+i+a+f;return g>>>0}Ct.sum64_4_lo=q9;function L9(r,e,t,i,n,a,c,f,g,d){var m=0,w=e;w=w+i>>>0,m+=w>>0,m+=w>>0,m+=w>>0,m+=w>>0}Ct.sum64_5_hi=L9;function F9(r,e,t,i,n,a,c,f,g,d){var m=e+i+a+f+d;return m>>>0}Ct.sum64_5_lo=F9;function z9(r,e,t){var i=e<<32-t|r>>>t;return i>>>0}Ct.rotr64_hi=z9;function j9(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Ct.rotr64_lo=j9;function k9(r,e,t){return r>>>t}Ct.shr64_hi=k9;function H9(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Ct.shr64_lo=H9;var go={},q1=Ct,K9=Da;function kf(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}go.BlockHash=kf;kf.prototype.update=function(e,t){if(e=q1.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var i=e.length%this._delta8;this.pending=e.slice(e.length-i,e.length),this.pending.length===0&&(this.pending=null),e=q1.join32(e,0,e.length-i,this.endian);for(var n=0;n>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=e&255}else for(n[a++]=e&255,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,c=8;c>>3}Gn.g0_256=Y9;function Q9(r){return Rn(r,17)^Rn(r,19)^r>>>10}Gn.g1_256=Q9;var so=Ct,X9=go,Z9=Gn,Dl=so.rotl32,Wo=so.sum32,eD=so.sum32_5,tD=Z9.ft_1,Nv=X9.BlockHash,rD=[1518500249,1859775393,2400959708,3395469782];function zn(){if(!(this instanceof zn))return new zn;Nv.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}so.inherits(zn,Nv);var iD=zn;zn.blockSize=512;zn.outSize=160;zn.hmacStrength=80;zn.padLength=64;zn.prototype._update=function(e,t){for(var i=this.W,n=0;n<16;n++)i[n]=e[t+n];for(;nthis.blockSize&&(e=new this.Hash().update(e).digest()),HD(e.length<=this.blockSize);for(var t=e.length;t=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}var JD=zs;zs.prototype._init=function(e,t,i){var n=e.concat(t).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1};zs.prototype.generate=function(e,t,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(n=i,i=t,t=null),i&&(i=pa.toArray(i,n||"hex"),this._update(i));for(var a=[];a.length"};var bf=ws,Xd=Si,XD=Xd.assert;function Hf(r,e){if(r instanceof Hf)return r;this._importDER(r,e)||(XD(r.r&&r.s,"Signature without r or s"),this.r=new bf(r.r,16),this.s=new bf(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var ZD=Hf;function eE(){this.place=0}function Sl(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4||r[e.place]===0)return!1;for(var n=0,a=0,c=e.place;a>>=0;return n<=127?!1:(e.place=c,n)}function k1(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}Hf.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),i[0]&128&&(i=[0].concat(i)),t=k1(t),i=k1(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];Ml(n,t.length),n=n.concat(t),n.push(2),Ml(n,i.length);var a=n.concat(i),c=[48];return Ml(c,a.length),c=c.concat(a),Xd.encode(c,e)};var gs=ws,Vv=JD,tE=Si,Il=zf,rE=xv,Gv=tE.assert,Zd=QD,Kf=ZD;function Ki(r){if(!(this instanceof Ki))return new Ki(r);typeof r=="string"&&(Gv(Object.prototype.hasOwnProperty.call(Il,r),"Unknown curve "+r),r=Il[r]),r instanceof Il.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var iE=Ki;Ki.prototype.keyPair=function(e){return new Zd(this,e)};Ki.prototype.keyFromPrivate=function(e,t){return Zd.fromPrivate(this,e,t)};Ki.prototype.keyFromPublic=function(e,t){return Zd.fromPublic(this,e,t)};Ki.prototype.genKeyPair=function(e){e||(e={});for(var t=new Vv({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||rE(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new gs(2));;){var a=new gs(t.generate(i));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}};Ki.prototype._truncateToN=function(e,t,i){var n;if(gs.isBN(e)||typeof e=="number")e=new gs(e,16),n=e.byteLength();else if(typeof e=="object")n=e.length,e=new gs(e,16);else{var a=e.toString();n=a.length+1>>>1,e=new gs(a,16)}typeof i!="number"&&(i=n*8);var c=i-this.n.bitLength();return c>0&&(e=e.ushrn(c)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e};Ki.prototype.sign=function(e,t,i,n){typeof i=="object"&&(n=i,i=null),n||(n={}),t=this.keyFromPrivate(t,i),e=this._truncateToN(e,!1,n.msgBitLength);for(var a=this.n.byteLength(),c=t.getPrivate().toArray("be",a),f=e.toArray("be",a),g=new Vv({hash:this.hash,entropy:c,nonce:f,pers:n.pers,persEnc:n.persEnc||"utf8"}),d=this.n.sub(new gs(1)),m=0;;m++){var w=n.k?n.k(m):new gs(g.generate(this.n.byteLength()));if(w=this._truncateToN(w,!0),!(w.cmpn(1)<=0||w.cmp(d)>=0)){var O=this.g.mul(w);if(!O.isInfinity()){var C=O.getX(),P=C.umod(this.n);if(P.cmpn(0)!==0){var q=w.invm(this.n).mul(P.mul(t.getPrivate()).iadd(e));if(q=q.umod(this.n),q.cmpn(0)!==0){var K=(O.getY().isOdd()?1:0)|(C.cmp(P)!==0?2:0);return n.canonical&&q.cmp(this.nh)>0&&(q=this.n.sub(q),K^=1),new Kf({r:P,s:q,recoveryParam:K})}}}}}};Ki.prototype.verify=function(e,t,i,n,a){a||(a={}),e=this._truncateToN(e,!1,a.msgBitLength),i=this.keyFromPublic(i,n),t=new Kf(t,"hex");var c=t.r,f=t.s;if(c.cmpn(1)<0||c.cmp(this.n)>=0||f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;var g=f.invm(this.n),d=g.mul(e).umod(this.n),m=g.mul(c).umod(this.n),w;return this.curve._maxwellTrick?(w=this.g.jmulAdd(d,i.getPublic(),m),w.isInfinity()?!1:w.eqXToP(c)):(w=this.g.mulAdd(d,i.getPublic(),m),w.isInfinity()?!1:w.getX().umod(this.n).cmp(c)===0)};Ki.prototype.recoverPubKey=function(r,e,t,i){Gv((3&t)===t,"The recovery param is more than two bits"),e=new Kf(e,i);var n=this.n,a=new gs(r),c=e.r,f=e.s,g=t&1,d=t>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");d?c=this.curve.pointFromX(c.add(this.curve.n),g):c=this.curve.pointFromX(c,g);var m=e.r.invm(n),w=n.sub(a).mul(m).umod(n),O=f.mul(m).umod(n);return this.g.mulAdd(w,c,O)};Ki.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new Kf(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(r,e,n)}catch{continue}if(a.eq(t))return n}throw new Error("Unable to find valid recovery factor")};var Cc=Si,Jv=Cc.assert,H1=Cc.parseBytes,mo=Cc.cachedProperty;function Dr(r,e){this.eddsa=r,this._secret=H1(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=H1(e.pub)}Dr.fromPublic=function(e,t){return t instanceof Dr?t:new Dr(e,{pub:t})};Dr.fromSecret=function(e,t){return t instanceof Dr?t:new Dr(e,{secret:t})};Dr.prototype.secret=function(){return this._secret};mo(Dr,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});mo(Dr,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});mo(Dr,"privBytes",function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n});mo(Dr,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});mo(Dr,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});mo(Dr,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});Dr.prototype.sign=function(e){return Jv(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};Dr.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)};Dr.prototype.getSecret=function(e){return Jv(this._secret,"KeyPair is public only"),Cc.encode(this.secret(),e)};Dr.prototype.getPublic=function(e){return Cc.encode(this.pubBytes(),e)};var nE=Dr,sE=ws,Vf=Si,K1=Vf.assert,Gf=Vf.cachedProperty,aE=Vf.parseBytes;function Ea(r,e){this.eddsa=r,typeof e!="object"&&(e=aE(e)),Array.isArray(e)&&(K1(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),K1(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof sE&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}Gf(Ea,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});Gf(Ea,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});Gf(Ea,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});Gf(Ea,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});Ea.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};Ea.prototype.toHex=function(){return Vf.encode(this.toBytes(),"hex").toUpperCase()};var oE=Ea,cE=jf,uE=zf,co=Si,fE=co.assert,Wv=co.parseBytes,Yv=nE,V1=oE;function li(r){if(fE(r==="ed25519","only tested with ed25519 so far"),!(this instanceof li))return new li(r);r=uE[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=cE.sha512}var hE=li;li.prototype.sign=function(e,t){e=Wv(e);var i=this.keyFromSecret(t),n=this.hashInt(i.messagePrefix(),e),a=this.g.mul(n),c=this.encodePoint(a),f=this.hashInt(c,i.pubBytes(),e).mul(i.priv()),g=n.add(f).umod(this.curve.n);return this.makeSignature({R:a,S:g,Rencoded:c})};li.prototype.verify=function(e,t,i){if(e=Wv(e),t=this.makeSignature(t),t.S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(i),a=this.hashInt(t.Rencoded(),n.pubBytes(),e),c=this.g.mul(t.S()),f=t.R().add(n.pub().mul(a));return f.eq(c)};li.prototype.hashInt=function(){for(var e=this.hash(),t=0;t0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=g[m++],d--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(m=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,g,m,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=g[m++],d--;return this},f.prototype.finish=function(g){if(!this._finished){var d=this._bytesHashed,m=this._bufferLength,w=d/536870912|0,O=d<<3,C=d%128<112?128:256;this._buffer[m]=128;for(var P=m+1;P0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},f.prototype.restoreState=function(g){return this._stateHi.set(g.stateHi),this._stateLo.set(g.stateLo),this._bufferLength=g.bufferLength,g.buffer&&this._buffer.set(g.buffer),this._bytesHashed=g.bytesHashed,this._finished=!1,this},f.prototype.cleanSavedState=function(g){t.wipe(g.stateHi),t.wipe(g.stateLo),g.buffer&&t.wipe(g.buffer),g.bufferLength=0,g.bytesHashed=0},f}();r.SHA512=i;var n=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(f,g,d,m,w,O,C){for(var P=d[0],q=d[1],K=d[2],Y=d[3],z=d[4],W=d[5],B=d[6],j=d[7],k=m[0],_=m[1],N=m[2],se=m[3],le=m[4],U=m[5],y=m[6],u=m[7],h,v,E,S,M,x,p,b;C>=128;){for(var R=0;R<16;R++){var Z=8*R+O;f[R]=e.readUint32BE(w,Z),g[R]=e.readUint32BE(w,Z+4)}for(var R=0;R<80;R++){var ae=P,I=q,ee=K,L=Y,V=z,G=W,D=B,H=j,ne=k,ce=_,fe=N,ye=se,we=le,Te=U,Qe=y,Ce=u;if(h=j,v=u,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=(z>>>14|le<<18)^(z>>>18|le<<14)^(le>>>9|z<<23),v=(le>>>14|z<<18)^(le>>>18|z<<14)^(z>>>9|le<<23),M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,h=z&W^~z&B,v=le&U^~le&y,M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,h=n[R*2],v=n[R*2+1],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,h=f[R%16],v=g[R%16],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,E=p&65535|b<<16,S=M&65535|x<<16,h=E,v=S,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=(P>>>28|k<<4)^(k>>>2|P<<30)^(k>>>7|P<<25),v=(k>>>28|P<<4)^(P>>>2|k<<30)^(P>>>7|k<<25),M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,h=P&q^P&K^q&K,v=k&_^k&N^_&N,M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,H=p&65535|b<<16,Ce=M&65535|x<<16,h=L,v=ye,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=E,v=S,M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,L=p&65535|b<<16,ye=M&65535|x<<16,q=ae,K=I,Y=ee,z=L,W=V,B=G,j=D,P=H,_=ne,N=ce,se=fe,le=ye,U=we,y=Te,u=Qe,k=Ce,R%16===15)for(var Z=0;Z<16;Z++)h=f[Z],v=g[Z],M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=f[(Z+9)%16],v=g[(Z+9)%16],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,E=f[(Z+1)%16],S=g[(Z+1)%16],h=(E>>>1|S<<31)^(E>>>8|S<<24)^E>>>7,v=(S>>>1|E<<31)^(S>>>8|E<<24)^(S>>>7|E<<25),M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,E=f[(Z+14)%16],S=g[(Z+14)%16],h=(E>>>19|S<<13)^(S>>>29|E<<3)^E>>>6,v=(S>>>19|E<<13)^(E>>>29|S<<3)^(S>>>6|E<<26),M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,f[Z]=p&65535|b<<16,g[Z]=M&65535|x<<16}h=P,v=k,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=d[0],v=m[0],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,d[0]=P=p&65535|b<<16,m[0]=k=M&65535|x<<16,h=q,v=_,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=d[1],v=m[1],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,d[1]=q=p&65535|b<<16,m[1]=_=M&65535|x<<16,h=K,v=N,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=d[2],v=m[2],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,d[2]=K=p&65535|b<<16,m[2]=N=M&65535|x<<16,h=Y,v=se,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=d[3],v=m[3],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,d[3]=Y=p&65535|b<<16,m[3]=se=M&65535|x<<16,h=z,v=le,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=d[4],v=m[4],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,d[4]=z=p&65535|b<<16,m[4]=le=M&65535|x<<16,h=W,v=U,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=d[5],v=m[5],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,d[5]=W=p&65535|b<<16,m[5]=U=M&65535|x<<16,h=B,v=y,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=d[6],v=m[6],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,d[6]=B=p&65535|b<<16,m[6]=y=M&65535|x<<16,h=j,v=u,M=v&65535,x=v>>>16,p=h&65535,b=h>>>16,h=d[7],v=m[7],M+=v&65535,x+=v>>>16,p+=h&65535,b+=h>>>16,x+=M>>>16,p+=x>>>16,b+=p>>>16,d[7]=j=p&65535|b<<16,m[7]=u=M&65535|x<<16,O+=128,C-=128}return O}function c(f){var g=new i;g.update(f);var d=g.digest();return g.clean(),d}r.hash=c})(Qv);(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=ks,t=Qv,i=xi;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function n(L){const V=new Float64Array(16);if(L)for(let G=0;G>16&1),G[ce-1]&=65535;G[15]=D[15]-32767-(G[14]>>16&1);const ne=G[15]>>16&1;G[14]&=65535,q(D,G,1-ne)}for(let H=0;H<16;H++)L[2*H]=D[H]&255,L[2*H+1]=D[H]>>8}function Y(L,V){let G=0;for(let D=0;D<32;D++)G|=L[D]^V[D];return(1&G-1>>>8)-1}function z(L,V){const G=new Uint8Array(32),D=new Uint8Array(32);return K(G,L),K(D,V),Y(G,D)}function W(L){const V=new Uint8Array(32);return K(V,L),V[0]&1}function B(L,V){for(let G=0;G<16;G++)L[G]=V[2*G]+(V[2*G+1]<<8);L[15]&=32767}function j(L,V,G){for(let D=0;D<16;D++)L[D]=V[D]+G[D]}function k(L,V,G){for(let D=0;D<16;D++)L[D]=V[D]-G[D]}function _(L,V,G){let D,H,ne=0,ce=0,fe=0,ye=0,we=0,Te=0,Qe=0,Ce=0,Re=0,Se=0,me=0,Pe=0,Ne=0,be=0,Oe=0,xe=0,ve=0,qe=0,Me=0,_e=0,He=0,Ve=0,Ee=0,Ke=0,ht=0,Ge=0,_t=0,lt=0,We=0,Et=0,St=0,Be=G[0],Xe=G[1],tt=G[2],$e=G[3],et=G[4],Ze=G[5],Fe=G[6],ut=G[7],rt=G[8],ze=G[9],it=G[10],st=G[11],Ue=G[12],Ye=G[13],ft=G[14],je=G[15];D=V[0],ne+=D*Be,ce+=D*Xe,fe+=D*tt,ye+=D*$e,we+=D*et,Te+=D*Ze,Qe+=D*Fe,Ce+=D*ut,Re+=D*rt,Se+=D*ze,me+=D*it,Pe+=D*st,Ne+=D*Ue,be+=D*Ye,Oe+=D*ft,xe+=D*je,D=V[1],ce+=D*Be,fe+=D*Xe,ye+=D*tt,we+=D*$e,Te+=D*et,Qe+=D*Ze,Ce+=D*Fe,Re+=D*ut,Se+=D*rt,me+=D*ze,Pe+=D*it,Ne+=D*st,be+=D*Ue,Oe+=D*Ye,xe+=D*ft,ve+=D*je,D=V[2],fe+=D*Be,ye+=D*Xe,we+=D*tt,Te+=D*$e,Qe+=D*et,Ce+=D*Ze,Re+=D*Fe,Se+=D*ut,me+=D*rt,Pe+=D*ze,Ne+=D*it,be+=D*st,Oe+=D*Ue,xe+=D*Ye,ve+=D*ft,qe+=D*je,D=V[3],ye+=D*Be,we+=D*Xe,Te+=D*tt,Qe+=D*$e,Ce+=D*et,Re+=D*Ze,Se+=D*Fe,me+=D*ut,Pe+=D*rt,Ne+=D*ze,be+=D*it,Oe+=D*st,xe+=D*Ue,ve+=D*Ye,qe+=D*ft,Me+=D*je,D=V[4],we+=D*Be,Te+=D*Xe,Qe+=D*tt,Ce+=D*$e,Re+=D*et,Se+=D*Ze,me+=D*Fe,Pe+=D*ut,Ne+=D*rt,be+=D*ze,Oe+=D*it,xe+=D*st,ve+=D*Ue,qe+=D*Ye,Me+=D*ft,_e+=D*je,D=V[5],Te+=D*Be,Qe+=D*Xe,Ce+=D*tt,Re+=D*$e,Se+=D*et,me+=D*Ze,Pe+=D*Fe,Ne+=D*ut,be+=D*rt,Oe+=D*ze,xe+=D*it,ve+=D*st,qe+=D*Ue,Me+=D*Ye,_e+=D*ft,He+=D*je,D=V[6],Qe+=D*Be,Ce+=D*Xe,Re+=D*tt,Se+=D*$e,me+=D*et,Pe+=D*Ze,Ne+=D*Fe,be+=D*ut,Oe+=D*rt,xe+=D*ze,ve+=D*it,qe+=D*st,Me+=D*Ue,_e+=D*Ye,He+=D*ft,Ve+=D*je,D=V[7],Ce+=D*Be,Re+=D*Xe,Se+=D*tt,me+=D*$e,Pe+=D*et,Ne+=D*Ze,be+=D*Fe,Oe+=D*ut,xe+=D*rt,ve+=D*ze,qe+=D*it,Me+=D*st,_e+=D*Ue,He+=D*Ye,Ve+=D*ft,Ee+=D*je,D=V[8],Re+=D*Be,Se+=D*Xe,me+=D*tt,Pe+=D*$e,Ne+=D*et,be+=D*Ze,Oe+=D*Fe,xe+=D*ut,ve+=D*rt,qe+=D*ze,Me+=D*it,_e+=D*st,He+=D*Ue,Ve+=D*Ye,Ee+=D*ft,Ke+=D*je,D=V[9],Se+=D*Be,me+=D*Xe,Pe+=D*tt,Ne+=D*$e,be+=D*et,Oe+=D*Ze,xe+=D*Fe,ve+=D*ut,qe+=D*rt,Me+=D*ze,_e+=D*it,He+=D*st,Ve+=D*Ue,Ee+=D*Ye,Ke+=D*ft,ht+=D*je,D=V[10],me+=D*Be,Pe+=D*Xe,Ne+=D*tt,be+=D*$e,Oe+=D*et,xe+=D*Ze,ve+=D*Fe,qe+=D*ut,Me+=D*rt,_e+=D*ze,He+=D*it,Ve+=D*st,Ee+=D*Ue,Ke+=D*Ye,ht+=D*ft,Ge+=D*je,D=V[11],Pe+=D*Be,Ne+=D*Xe,be+=D*tt,Oe+=D*$e,xe+=D*et,ve+=D*Ze,qe+=D*Fe,Me+=D*ut,_e+=D*rt,He+=D*ze,Ve+=D*it,Ee+=D*st,Ke+=D*Ue,ht+=D*Ye,Ge+=D*ft,_t+=D*je,D=V[12],Ne+=D*Be,be+=D*Xe,Oe+=D*tt,xe+=D*$e,ve+=D*et,qe+=D*Ze,Me+=D*Fe,_e+=D*ut,He+=D*rt,Ve+=D*ze,Ee+=D*it,Ke+=D*st,ht+=D*Ue,Ge+=D*Ye,_t+=D*ft,lt+=D*je,D=V[13],be+=D*Be,Oe+=D*Xe,xe+=D*tt,ve+=D*$e,qe+=D*et,Me+=D*Ze,_e+=D*Fe,He+=D*ut,Ve+=D*rt,Ee+=D*ze,Ke+=D*it,ht+=D*st,Ge+=D*Ue,_t+=D*Ye,lt+=D*ft,We+=D*je,D=V[14],Oe+=D*Be,xe+=D*Xe,ve+=D*tt,qe+=D*$e,Me+=D*et,_e+=D*Ze,He+=D*Fe,Ve+=D*ut,Ee+=D*rt,Ke+=D*ze,ht+=D*it,Ge+=D*st,_t+=D*Ue,lt+=D*Ye,We+=D*ft,Et+=D*je,D=V[15],xe+=D*Be,ve+=D*Xe,qe+=D*tt,Me+=D*$e,_e+=D*et,He+=D*Ze,Ve+=D*Fe,Ee+=D*ut,Ke+=D*rt,ht+=D*ze,Ge+=D*it,_t+=D*st,lt+=D*Ue,We+=D*Ye,Et+=D*ft,St+=D*je,ne+=38*ve,ce+=38*qe,fe+=38*Me,ye+=38*_e,we+=38*He,Te+=38*Ve,Qe+=38*Ee,Ce+=38*Ke,Re+=38*ht,Se+=38*Ge,me+=38*_t,Pe+=38*lt,Ne+=38*We,be+=38*Et,Oe+=38*St,H=1,D=ne+H+65535,H=Math.floor(D/65536),ne=D-H*65536,D=ce+H+65535,H=Math.floor(D/65536),ce=D-H*65536,D=fe+H+65535,H=Math.floor(D/65536),fe=D-H*65536,D=ye+H+65535,H=Math.floor(D/65536),ye=D-H*65536,D=we+H+65535,H=Math.floor(D/65536),we=D-H*65536,D=Te+H+65535,H=Math.floor(D/65536),Te=D-H*65536,D=Qe+H+65535,H=Math.floor(D/65536),Qe=D-H*65536,D=Ce+H+65535,H=Math.floor(D/65536),Ce=D-H*65536,D=Re+H+65535,H=Math.floor(D/65536),Re=D-H*65536,D=Se+H+65535,H=Math.floor(D/65536),Se=D-H*65536,D=me+H+65535,H=Math.floor(D/65536),me=D-H*65536,D=Pe+H+65535,H=Math.floor(D/65536),Pe=D-H*65536,D=Ne+H+65535,H=Math.floor(D/65536),Ne=D-H*65536,D=be+H+65535,H=Math.floor(D/65536),be=D-H*65536,D=Oe+H+65535,H=Math.floor(D/65536),Oe=D-H*65536,D=xe+H+65535,H=Math.floor(D/65536),xe=D-H*65536,ne+=H-1+37*(H-1),H=1,D=ne+H+65535,H=Math.floor(D/65536),ne=D-H*65536,D=ce+H+65535,H=Math.floor(D/65536),ce=D-H*65536,D=fe+H+65535,H=Math.floor(D/65536),fe=D-H*65536,D=ye+H+65535,H=Math.floor(D/65536),ye=D-H*65536,D=we+H+65535,H=Math.floor(D/65536),we=D-H*65536,D=Te+H+65535,H=Math.floor(D/65536),Te=D-H*65536,D=Qe+H+65535,H=Math.floor(D/65536),Qe=D-H*65536,D=Ce+H+65535,H=Math.floor(D/65536),Ce=D-H*65536,D=Re+H+65535,H=Math.floor(D/65536),Re=D-H*65536,D=Se+H+65535,H=Math.floor(D/65536),Se=D-H*65536,D=me+H+65535,H=Math.floor(D/65536),me=D-H*65536,D=Pe+H+65535,H=Math.floor(D/65536),Pe=D-H*65536,D=Ne+H+65535,H=Math.floor(D/65536),Ne=D-H*65536,D=be+H+65535,H=Math.floor(D/65536),be=D-H*65536,D=Oe+H+65535,H=Math.floor(D/65536),Oe=D-H*65536,D=xe+H+65535,H=Math.floor(D/65536),xe=D-H*65536,ne+=H-1+37*(H-1),L[0]=ne,L[1]=ce,L[2]=fe,L[3]=ye,L[4]=we,L[5]=Te,L[6]=Qe,L[7]=Ce,L[8]=Re,L[9]=Se,L[10]=me,L[11]=Pe,L[12]=Ne,L[13]=be,L[14]=Oe,L[15]=xe}function N(L,V){_(L,V,V)}function se(L,V){const G=n();let D;for(D=0;D<16;D++)G[D]=V[D];for(D=253;D>=0;D--)N(G,G),D!==2&&D!==4&&_(G,G,V);for(D=0;D<16;D++)L[D]=G[D]}function le(L,V){const G=n();let D;for(D=0;D<16;D++)G[D]=V[D];for(D=250;D>=0;D--)N(G,G),D!==1&&_(G,G,V);for(D=0;D<16;D++)L[D]=G[D]}function U(L,V){const G=n(),D=n(),H=n(),ne=n(),ce=n(),fe=n(),ye=n(),we=n(),Te=n();k(G,L[1],L[0]),k(Te,V[1],V[0]),_(G,G,Te),j(D,L[0],L[1]),j(Te,V[0],V[1]),_(D,D,Te),_(H,L[3],V[3]),_(H,H,d),_(ne,L[2],V[2]),j(ne,ne,ne),k(ce,D,G),k(fe,ne,H),j(ye,ne,H),j(we,D,G),_(L[0],ce,fe),_(L[1],we,ye),_(L[2],ye,fe),_(L[3],ce,we)}function y(L,V,G){for(let D=0;D<4;D++)q(L[D],V[D],G)}function u(L,V){const G=n(),D=n(),H=n();se(H,V[2]),_(G,V[0],H),_(D,V[1],H),K(L,D),L[31]^=W(G)<<7}function h(L,V,G){C(L[0],c),C(L[1],f),C(L[2],f),C(L[3],c);for(let D=255;D>=0;--D){const H=G[D/8|0]>>(D&7)&1;y(L,V,H),U(V,L),U(L,L),y(L,V,H)}}function v(L,V){const G=[n(),n(),n(),n()];C(G[0],m),C(G[1],w),C(G[2],f),_(G[3],m,w),h(L,G,V)}function E(L){if(L.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const V=(0,t.hash)(L);V[0]&=248,V[31]&=127,V[31]|=64;const G=new Uint8Array(32),D=[n(),n(),n(),n()];v(D,V),u(G,D);const H=new Uint8Array(64);return H.set(L),H.set(G,32),{publicKey:G,secretKey:H}}r.generateKeyPairFromSeed=E;function S(L){const V=(0,e.randomBytes)(32,L),G=E(V);return(0,i.wipe)(V),G}r.generateKeyPair=S;function M(L){if(L.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(L.subarray(32))}r.extractPublicKeyFromSecretKey=M;const x=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function p(L,V){let G,D,H,ne;for(D=63;D>=32;--D){for(G=0,H=D-32,ne=D-12;H>4)*x[H],G=V[H]>>8,V[H]&=255;for(H=0;H<32;H++)V[H]-=G*x[H];for(D=0;D<32;D++)V[D+1]+=V[D]>>8,L[D]=V[D]&255}function b(L){const V=new Float64Array(64);for(let G=0;G<64;G++)V[G]=L[G];for(let G=0;G<64;G++)L[G]=0;p(L,V)}function R(L,V){const G=new Float64Array(64),D=[n(),n(),n(),n()],H=(0,t.hash)(L.subarray(0,32));H[0]&=248,H[31]&=127,H[31]|=64;const ne=new Uint8Array(64);ne.set(H.subarray(32),32);const ce=new t.SHA512;ce.update(ne.subarray(32)),ce.update(V);const fe=ce.digest();ce.clean(),b(fe),v(D,fe),u(ne,D),ce.reset(),ce.update(ne.subarray(0,32)),ce.update(L.subarray(32)),ce.update(V);const ye=ce.digest();b(ye);for(let we=0;we<32;we++)G[we]=fe[we];for(let we=0;we<32;we++)for(let Te=0;Te<32;Te++)G[we+Te]+=ye[we]*H[Te];return p(ne.subarray(32),G),ne}r.sign=R;function Z(L,V){const G=n(),D=n(),H=n(),ne=n(),ce=n(),fe=n(),ye=n();return C(L[2],f),B(L[1],V),N(H,L[1]),_(ne,H,g),k(H,H,L[2]),j(ne,L[2],ne),N(ce,ne),N(fe,ce),_(ye,fe,ce),_(G,ye,H),_(G,G,ne),le(G,G),_(G,G,H),_(G,G,ne),_(G,G,ne),_(L[0],G,ne),N(D,L[0]),_(D,D,ne),z(D,H)&&_(L[0],L[0],O),N(D,L[0]),_(D,D,ne),z(D,H)?-1:(W(L[0])===V[31]>>7&&k(L[0],c,L[0]),_(L[3],L[0],L[1]),0)}function ae(L,V,G){const D=new Uint8Array(32),H=[n(),n(),n(),n()],ne=[n(),n(),n(),n()];if(G.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(Z(ne,L))return!1;const ce=new t.SHA512;ce.update(G.subarray(0,32)),ce.update(L),ce.update(V);const fe=ce.digest();return b(fe),h(H,ne,fe),v(ne,G.subarray(32)),U(H,ne),u(D,H),!Y(G,D)}r.verify=ae;function I(L){let V=[n(),n(),n(),n()];if(Z(V,L))throw new Error("Ed25519: invalid public key");let G=n(),D=n(),H=V[1];j(G,f,H),k(D,f,H),se(D,D),_(G,G,D);let ne=new Uint8Array(32);return K(ne,G),ne}r.convertPublicKeyToX25519=I;function ee(L){const V=(0,t.hash)(L.subarray(0,32));V[0]&=248,V[31]&=127,V[31]|=64;const G=new Uint8Array(V.subarray(0,32));return(0,i.wipe)(V),G}r.convertSecretKeyToX25519=ee})(e0);const lE="EdDSA",dE="JWT",vf=".",Jf="base64url",Xv="utf8",Zv="utf8",pE=":",gE="did",bE="key",G1="base58btc",vE="z",mE="K36",yE=32;function t0(r){return globalThis.Buffer!=null?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):r}function e3(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?t0(globalThis.Buffer.allocUnsafe(r)):new Uint8Array(r)}function wE(r,e){e||(e=r.reduce((n,a)=>n+a.length,0));const t=e3(e);let i=0;for(const n of r)t.set(n,i),i+=n.length;return t0(t)}function _E(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i>>0,B=new Uint8Array(W);Y!==z;){for(var j=P[Y],k=0,_=W-1;(j!==0||k>>0,B[_]=j%f>>>0,j=j/f>>>0;if(j!==0)throw new Error("Non-zero carry");K=k,Y++}for(var N=W-K;N!==W&&B[N]===0;)N++;for(var se=g.repeat(q);N>>0,W=new Uint8Array(z);P[q];){var B=t[P.charCodeAt(q)];if(B===255)return;for(var j=0,k=z-1;(B!==0||j>>0,W[k]=B%256>>>0,B=B/256>>>0;if(B!==0)throw new Error("Non-zero carry");Y=j,q++}if(P[q]!==" "){for(var _=z-Y;_!==z&&W[_]===0;)_++;for(var N=new Uint8Array(K+(z-_)),se=K;_!==z;)N[se++]=W[_++];return N}}}function C(P){var q=O(P);if(q)return q;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:O,decode:C}}var DE=_E,EE=DE;const AE=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},xE=r=>new TextEncoder().encode(r),SE=r=>new TextDecoder().decode(r);let ME=class{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},IE=class{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}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 t3(this,e)}},CE=class{constructor(e){this.decoders=e}or(e){return t3(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};const t3=(r,e)=>new CE({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});let PE=class{constructor(e,t,i,n){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=n,this.encoder=new ME(e,t,i),this.decoder=new IE(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};const Wf=({name:r,prefix:e,encode:t,decode:i})=>new PE(r,e,t,i),Pc=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:n}=EE(t,e);return Wf({prefix:r,name:e,encode:i,decode:a=>AE(n(a))})},OE=(r,e,t,i)=>{const n={};for(let m=0;m=8&&(f-=8,c[d++]=255&g>>f)}if(f>=t||255&g<<8-f)throw new SyntaxError("Unexpected end of data");return c},TE=(r,e,t)=>{const i=e[e.length-1]==="=",n=(1<t;)c-=t,a+=e[n&f>>c];if(c&&(a+=e[n&f<Wf({prefix:e,name:r,encode(n){return TE(n,i,t)},decode(n){return OE(n,i,t,r)}}),RE=Wf({prefix:"\0",name:"identity",encode:r=>SE(r),decode:r=>xE(r)}),NE=Object.freeze(Object.defineProperty({__proto__:null,identity:RE},Symbol.toStringTag,{value:"Module"})),BE=Pr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),$E=Object.freeze(Object.defineProperty({__proto__:null,base2:BE},Symbol.toStringTag,{value:"Module"})),UE=Pr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),qE=Object.freeze(Object.defineProperty({__proto__:null,base8:UE},Symbol.toStringTag,{value:"Module"})),LE=Pc({prefix:"9",name:"base10",alphabet:"0123456789"}),FE=Object.freeze(Object.defineProperty({__proto__:null,base10:LE},Symbol.toStringTag,{value:"Module"})),zE=Pr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),jE=Pr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),kE=Object.freeze(Object.defineProperty({__proto__:null,base16:zE,base16upper:jE},Symbol.toStringTag,{value:"Module"})),HE=Pr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),KE=Pr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),VE=Pr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),GE=Pr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),JE=Pr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),WE=Pr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),YE=Pr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),QE=Pr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),XE=Pr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),ZE=Object.freeze(Object.defineProperty({__proto__:null,base32:HE,base32hex:JE,base32hexpad:YE,base32hexpadupper:QE,base32hexupper:WE,base32pad:VE,base32padupper:GE,base32upper:KE,base32z:XE},Symbol.toStringTag,{value:"Module"})),eA=Pc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),tA=Pc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),rA=Object.freeze(Object.defineProperty({__proto__:null,base36:eA,base36upper:tA},Symbol.toStringTag,{value:"Module"})),iA=Pc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),nA=Pc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),sA=Object.freeze(Object.defineProperty({__proto__:null,base58btc:iA,base58flickr:nA},Symbol.toStringTag,{value:"Module"})),aA=Pr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),oA=Pr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),cA=Pr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),uA=Pr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),fA=Object.freeze(Object.defineProperty({__proto__:null,base64:aA,base64pad:oA,base64url:cA,base64urlpad:uA},Symbol.toStringTag,{value:"Module"})),r3=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),hA=r3.reduce((r,e,t)=>(r[t]=e,r),[]),lA=r3.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function dA(r){return r.reduce((e,t)=>(e+=hA[t],e),"")}function pA(r){const e=[];for(const t of r){const i=lA[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const gA=Wf({prefix:"🚀",name:"base256emoji",encode:dA,decode:pA}),bA=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:gA},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const J1={...NE,...$E,...qE,...FE,...kE,...ZE,...rA,...sA,...fA,...bA};function i3(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const W1=i3("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Cl=i3("ascii","a",r=>{let e="a";for(let t=0;t{r=r.substring(1);const e=e3(r.length);for(let t=0;tJSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),mA=r=>{const e=/([\[:])?(\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,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(i,n)=>typeof n=="string"&&n.match(/^\d+n$/)?BigInt(n.substring(0,n.length-1)):n)};function ma(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return mA(r)}catch{return r}}function ys(r){return typeof r=="string"?r:vA(r)||""}function Y1(r){return ma(Yf(yo(r,Jf),Xv))}function mf(r){return Yf(yo(ys(r),Xv),Jf)}function s3(r){const e=yo(mE,G1),t=vE+Yf(wE([e,r]),G1);return[gE,bE,t].join(pE)}function yA(r){return Yf(r,Jf)}function wA(r){return yo(r,Jf)}function _A(r){return yo([mf(r.header),mf(r.payload)].join(vf),Zv)}function DA(r){return[mf(r.header),mf(r.payload),yA(r.signature)].join(vf)}function md(r){const e=r.split(vf),t=Y1(e[0]),i=Y1(e[1]),n=wA(e[2]),a=yo(e.slice(0,2).join(vf),Zv);return{header:t,payload:i,signature:n,data:a}}function Q1(r=ks.randomBytes(yE)){return e0.generateKeyPairFromSeed(r)}async function EA(r,e,t,i,n=Ae.fromMiliseconds(Date.now())){const a={alg:lE,typ:dE},c=s3(i.publicKey),f=n+t,g={iss:c,sub:r,aud:e,iat:n,exp:f},d=_A({header:a,payload:g}),m=e0.sign(i.secretKey,d);return DA({header:a,payload:g,signature:m})}const AA={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"}};var ga={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},xA={};const SA=":";function fc(r){const[e,t]=r.split(SA);return{namespace:e,reference:t}}function X1(r,e=[]){const t=[];return Object.keys(r).forEach(i=>{if(e.length&&!e.includes(i))return;const n=r[i];t.push(...n.accounts)}),t}function a3(r,e){return r.includes(":")?[r]:e.chains||[]}var MA=Object.defineProperty,Z1=Object.getOwnPropertySymbols,IA=Object.prototype.hasOwnProperty,CA=Object.prototype.propertyIsEnumerable,eg=(r,e,t)=>e in r?MA(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,tg=(r,e)=>{for(var t in e||(e={}))IA.call(e,t)&&eg(r,t,e[t]);if(Z1)for(var t of Z1(e))CA.call(e,t)&&eg(r,t,e[t]);return r};const PA="ReactNative",_i={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},OA="js";function yf(){return typeof ga<"u"&&typeof ga.versions<"u"&&typeof ga.versions.node<"u"}function wo(){return!Tf()&&!!jd()&&navigator.product===PA}function Oc(){return!yf()&&!!jd()&&!!Tf()}function Tc(){return wo()?_i.reactNative:yf()?_i.node:Oc()?_i.browser:_i.unknown}function TA(){var r;try{return wo()&&typeof globalThis<"u"&&typeof(globalThis==null?void 0:globalThis.Application)<"u"?(r=globalThis.Application)==null?void 0:r.applicationId:void 0}catch{return}}function RA(r,e){let t=vc.parse(r);return t=tg(tg({},t),e),r=vc.stringify(t),r}function o3(){return sv()||{name:"",description:"",url:"",icons:[""]}}function NA(){if(Tc()===_i.reactNative&&typeof globalThis<"u"&&typeof(globalThis==null?void 0:globalThis.Platform)<"u"){const{OS:t,Version:i}=globalThis.Platform;return[t,i].join("-")}const r=w4();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function BA(){var r;const e=Tc();return e===_i.browser?[e,((r=nv())==null?void 0:r.host)||"unknown"].join(":"):e}function c3(r,e,t){const i=NA(),n=BA();return[[r,e].join("-"),[OA,t].join("-"),i,n].join("/")}function $A({protocol:r,version:e,relayUrl:t,sdkVersion:i,auth:n,projectId:a,useOnCloseEvent:c,bundleId:f}){const g=t.split("?"),d=c3(r,e,i),m={auth:n,ua:d,projectId:a,useOnCloseEvent:c||void 0,origin:f||void 0},w=RA(g[1]||"",m);return g[0]+"?"+w}function la(r,e){return r.filter(t=>e.includes(t)).length===r.length}function u3(r){return Object.fromEntries(r.entries())}function f3(r){return new Map(Object.entries(r))}function fa(r=Ae.FIVE_MINUTES,e){const t=Ae.toMiliseconds(r||Ae.FIVE_MINUTES);let i,n,a;return{resolve:c=>{a&&i&&(clearTimeout(a),i(c))},reject:c=>{a&&n&&(clearTimeout(a),n(c))},done:()=>new Promise((c,f)=>{a=setTimeout(()=>{f(new Error(e))},t),i=c,n=f})}}function ro(r,e,t){return new Promise(async(i,n)=>{const a=setTimeout(()=>n(new Error(t)),e);try{const c=await r;i(c)}catch(c){n(c)}clearTimeout(a)})}function h3(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${r}`)}function UA(r){return h3("topic",r)}function qA(r){return h3("id",r)}function l3(r){const[e,t]=r.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")i.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))i.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return i}function br(r,e){return Ae.fromMiliseconds(Date.now()+Ae.toMiliseconds(r))}function Rs(r){return Date.now()>=Ae.toMiliseconds(r)}function xt(r,e){return`${r}${e?`:${e}`:""}`}function rf(r=[],e=[]){return[...new Set([...r,...e])]}async function LA({id:r,topic:e,wcDeepLink:t}){var i;try{if(!t)return;const n=typeof t=="string"?JSON.parse(t):t,a=n==null?void 0:n.href;if(typeof a!="string")return;const c=FA(a,r,e),f=Tc();if(f===_i.browser){if(!((i=Tf())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}c.startsWith("https://")||c.startsWith("http://")?window.open(c,"_blank","noreferrer noopener"):window.open(c,jA()?"_blank":"_self","noreferrer noopener")}else f===_i.reactNative&&typeof(globalThis==null?void 0:globalThis.Linking)<"u"&&await globalThis.Linking.openURL(c)}catch(n){console.error(n)}}function FA(r,e,t){const i=`requestId=${e}&sessionTopic=${t}`;r.endsWith("/")&&(r=r.slice(0,-1));let n=`${r}`;if(r.startsWith("https://t.me")){const a=r.includes("?")?"&startapp=":"?startapp=";n=`${n}${a}${kA(i,!0)}`}else n=`${n}/wc?${i}`;return n}async function zA(r,e){let t="";try{if(Oc()&&(t=localStorage.getItem(e),t))return t;t=await r.getItem(e)}catch(i){console.error(i)}return t}function rg(r,e){if(!r.includes(e))return null;const t=r.split(/([&,?,=])/),i=t.indexOf(e);return t[i+2]}function ig(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,r=>{const e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}function r0(){return typeof ga<"u"&&xA.IS_VITEST==="true"}function jA(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function kA(r,e=!1){const t=Buffer.from(r).toString("base64");return e?t.replace(/[=]/g,""):t}function d3(r){return Buffer.from(r,"base64").toString("utf-8")}var p3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function HA(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),t}var g3={exports:{}};/** +* [js-sha3]{@link https://github.com/emn178/js-sha3} +* +* @version 0.8.0 +* @author Chen, Yi-Cyuan [emn178@gmail.com] +* @copyright Chen, Yi-Cyuan 2015-2018 +* @license MIT +*/(function(r){(function(){var e="input is invalid type",t="finalize already called",i=typeof window=="object",n=i?window:{};n.JS_SHA3_NO_WINDOW&&(i=!1);var a=!i&&typeof self=="object",c=!n.JS_SHA3_NO_NODE_JS&&typeof ga=="object"&&ga.versions&&ga.versions.node;c?n=p3:a&&(n=self);var f=!n.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,g=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",d="0123456789abcdef".split(""),m=[31,7936,2031616,520093696],w=[4,1024,262144,67108864],O=[1,256,65536,16777216],C=[6,1536,393216,100663296],P=[0,8,16,24],q=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],K=[224,256,384,512],Y=[128,256],z=["hex","buffer","arrayBuffer","array","digest"],W={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(I){return Object.prototype.toString.call(I)==="[object Array]"}),g&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(I){return typeof I=="object"&&I.buffer&&I.buffer.constructor===ArrayBuffer});for(var B=function(I,ee,L){return function(V){return new R(I,ee,I).update(V)[L]()}},j=function(I,ee,L){return function(V,G){return new R(I,ee,G).update(V)[L]()}},k=function(I,ee,L){return function(V,G,D,H){return h["cshake"+I].update(V,G,D,H)[L]()}},_=function(I,ee,L){return function(V,G,D,H){return h["kmac"+I].update(V,G,D,H)[L]()}},N=function(I,ee,L,V){for(var G=0;G>5,this.byteCount=this.blockCount<<2,this.outputBlocks=L>>5,this.extraBytes=(L&31)>>3;for(var V=0;V<50;++V)this.s[V]=0}R.prototype.update=function(I){if(this.finalized)throw new Error(t);var ee,L=typeof I;if(L!=="string"){if(L==="object"){if(I===null)throw new Error(e);if(g&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!Array.isArray(I)&&(!g||!ArrayBuffer.isView(I)))throw new Error(e)}else throw new Error(e);ee=!0}for(var V=this.blocks,G=this.byteCount,D=I.length,H=this.blockCount,ne=0,ce=this.s,fe,ye;ne>2]|=I[ne]<>2]|=ye<>2]|=(192|ye>>6)<>2]|=(128|ye&63)<=57344?(V[fe>>2]|=(224|ye>>12)<>2]|=(128|ye>>6&63)<>2]|=(128|ye&63)<>2]|=(240|ye>>18)<>2]|=(128|ye>>12&63)<>2]|=(128|ye>>6&63)<>2]|=(128|ye&63)<=G){for(this.start=fe-G,this.block=V[H],fe=0;fe>8,L=I&255;L>0;)G.unshift(L),I=I>>8,L=I&255,++V;return ee?G.push(V):G.unshift(V),this.update(G),G.length},R.prototype.encodeString=function(I){var ee,L=typeof I;if(L!=="string"){if(L==="object"){if(I===null)throw new Error(e);if(g&&I.constructor===ArrayBuffer)I=new Uint8Array(I);else if(!Array.isArray(I)&&(!g||!ArrayBuffer.isView(I)))throw new Error(e)}else throw new Error(e);ee=!0}var V=0,G=I.length;if(ee)V=G;else for(var D=0;D=57344?V+=3:(H=65536+((H&1023)<<10|I.charCodeAt(++D)&1023),V+=4)}return V+=this.encode(V*8),this.update(I),V},R.prototype.bytepad=function(I,ee){for(var L=this.encode(ee),V=0;V>2]|=this.padding[ee&3],this.lastByteIndex===this.byteCount)for(I[0]=I[L],ee=1;ee>4&15]+d[ne&15]+d[ne>>12&15]+d[ne>>8&15]+d[ne>>20&15]+d[ne>>16&15]+d[ne>>28&15]+d[ne>>24&15];D%I===0&&(ae(ee),G=0)}return V&&(ne=ee[G],H+=d[ne>>4&15]+d[ne&15],V>1&&(H+=d[ne>>12&15]+d[ne>>8&15]),V>2&&(H+=d[ne>>20&15]+d[ne>>16&15])),H},R.prototype.arrayBuffer=function(){this.finalize();var I=this.blockCount,ee=this.s,L=this.outputBlocks,V=this.extraBytes,G=0,D=0,H=this.outputBits>>3,ne;V?ne=new ArrayBuffer(L+1<<2):ne=new ArrayBuffer(H);for(var ce=new Uint32Array(ne);D>8&255,H[ne+2]=ce>>16&255,H[ne+3]=ce>>24&255;D%I===0&&ae(ee)}return V&&(ne=D<<2,ce=ee[G],H[ne]=ce&255,V>1&&(H[ne+1]=ce>>8&255),V>2&&(H[ne+2]=ce>>16&255)),H};function Z(I,ee,L){R.call(this,I,ee,L)}Z.prototype=new R,Z.prototype.finalize=function(){return this.encode(this.outputBits,!0),R.prototype.finalize.call(this)};var ae=function(I){var ee,L,V,G,D,H,ne,ce,fe,ye,we,Te,Qe,Ce,Re,Se,me,Pe,Ne,be,Oe,xe,ve,qe,Me,_e,He,Ve,Ee,Ke,ht,Ge,_t,lt,We,Et,St,Be,Xe,tt,$e,et,Ze,Fe,ut,rt,ze,it,st,Ue,Ye,ft,je,Rt,Nt,at,vt,Rr,Nr,Br,$r,Ur,er;for(V=0;V<48;V+=2)G=I[0]^I[10]^I[20]^I[30]^I[40],D=I[1]^I[11]^I[21]^I[31]^I[41],H=I[2]^I[12]^I[22]^I[32]^I[42],ne=I[3]^I[13]^I[23]^I[33]^I[43],ce=I[4]^I[14]^I[24]^I[34]^I[44],fe=I[5]^I[15]^I[25]^I[35]^I[45],ye=I[6]^I[16]^I[26]^I[36]^I[46],we=I[7]^I[17]^I[27]^I[37]^I[47],Te=I[8]^I[18]^I[28]^I[38]^I[48],Qe=I[9]^I[19]^I[29]^I[39]^I[49],ee=Te^(H<<1|ne>>>31),L=Qe^(ne<<1|H>>>31),I[0]^=ee,I[1]^=L,I[10]^=ee,I[11]^=L,I[20]^=ee,I[21]^=L,I[30]^=ee,I[31]^=L,I[40]^=ee,I[41]^=L,ee=G^(ce<<1|fe>>>31),L=D^(fe<<1|ce>>>31),I[2]^=ee,I[3]^=L,I[12]^=ee,I[13]^=L,I[22]^=ee,I[23]^=L,I[32]^=ee,I[33]^=L,I[42]^=ee,I[43]^=L,ee=H^(ye<<1|we>>>31),L=ne^(we<<1|ye>>>31),I[4]^=ee,I[5]^=L,I[14]^=ee,I[15]^=L,I[24]^=ee,I[25]^=L,I[34]^=ee,I[35]^=L,I[44]^=ee,I[45]^=L,ee=ce^(Te<<1|Qe>>>31),L=fe^(Qe<<1|Te>>>31),I[6]^=ee,I[7]^=L,I[16]^=ee,I[17]^=L,I[26]^=ee,I[27]^=L,I[36]^=ee,I[37]^=L,I[46]^=ee,I[47]^=L,ee=ye^(G<<1|D>>>31),L=we^(D<<1|G>>>31),I[8]^=ee,I[9]^=L,I[18]^=ee,I[19]^=L,I[28]^=ee,I[29]^=L,I[38]^=ee,I[39]^=L,I[48]^=ee,I[49]^=L,Ce=I[0],Re=I[1],rt=I[11]<<4|I[10]>>>28,ze=I[10]<<4|I[11]>>>28,Ve=I[20]<<3|I[21]>>>29,Ee=I[21]<<3|I[20]>>>29,Br=I[31]<<9|I[30]>>>23,$r=I[30]<<9|I[31]>>>23,et=I[40]<<18|I[41]>>>14,Ze=I[41]<<18|I[40]>>>14,lt=I[2]<<1|I[3]>>>31,We=I[3]<<1|I[2]>>>31,Se=I[13]<<12|I[12]>>>20,me=I[12]<<12|I[13]>>>20,it=I[22]<<10|I[23]>>>22,st=I[23]<<10|I[22]>>>22,Ke=I[33]<<13|I[32]>>>19,ht=I[32]<<13|I[33]>>>19,Ur=I[42]<<2|I[43]>>>30,er=I[43]<<2|I[42]>>>30,Rt=I[5]<<30|I[4]>>>2,Nt=I[4]<<30|I[5]>>>2,Et=I[14]<<6|I[15]>>>26,St=I[15]<<6|I[14]>>>26,Pe=I[25]<<11|I[24]>>>21,Ne=I[24]<<11|I[25]>>>21,Ue=I[34]<<15|I[35]>>>17,Ye=I[35]<<15|I[34]>>>17,Ge=I[45]<<29|I[44]>>>3,_t=I[44]<<29|I[45]>>>3,qe=I[6]<<28|I[7]>>>4,Me=I[7]<<28|I[6]>>>4,at=I[17]<<23|I[16]>>>9,vt=I[16]<<23|I[17]>>>9,Be=I[26]<<25|I[27]>>>7,Xe=I[27]<<25|I[26]>>>7,be=I[36]<<21|I[37]>>>11,Oe=I[37]<<21|I[36]>>>11,ft=I[47]<<24|I[46]>>>8,je=I[46]<<24|I[47]>>>8,Fe=I[8]<<27|I[9]>>>5,ut=I[9]<<27|I[8]>>>5,_e=I[18]<<20|I[19]>>>12,He=I[19]<<20|I[18]>>>12,Rr=I[29]<<7|I[28]>>>25,Nr=I[28]<<7|I[29]>>>25,tt=I[38]<<8|I[39]>>>24,$e=I[39]<<8|I[38]>>>24,xe=I[48]<<14|I[49]>>>18,ve=I[49]<<14|I[48]>>>18,I[0]=Ce^~Se&Pe,I[1]=Re^~me&Ne,I[10]=qe^~_e&Ve,I[11]=Me^~He&Ee,I[20]=lt^~Et&Be,I[21]=We^~St&Xe,I[30]=Fe^~rt&it,I[31]=ut^~ze&st,I[40]=Rt^~at&Rr,I[41]=Nt^~vt&Nr,I[2]=Se^~Pe&be,I[3]=me^~Ne&Oe,I[12]=_e^~Ve&Ke,I[13]=He^~Ee&ht,I[22]=Et^~Be&tt,I[23]=St^~Xe&$e,I[32]=rt^~it&Ue,I[33]=ze^~st&Ye,I[42]=at^~Rr&Br,I[43]=vt^~Nr&$r,I[4]=Pe^~be&xe,I[5]=Ne^~Oe&ve,I[14]=Ve^~Ke&Ge,I[15]=Ee^~ht&_t,I[24]=Be^~tt&et,I[25]=Xe^~$e&Ze,I[34]=it^~Ue&ft,I[35]=st^~Ye&je,I[44]=Rr^~Br&Ur,I[45]=Nr^~$r&er,I[6]=be^~xe&Ce,I[7]=Oe^~ve&Re,I[16]=Ke^~Ge&qe,I[17]=ht^~_t&Me,I[26]=tt^~et<,I[27]=$e^~Ze&We,I[36]=Ue^~ft&Fe,I[37]=Ye^~je&ut,I[46]=Br^~Ur&Rt,I[47]=$r^~er&Nt,I[8]=xe^~Ce&Se,I[9]=ve^~Re&me,I[18]=Ge^~qe&_e,I[19]=_t^~Me&He,I[28]=et^~lt&Et,I[29]=Ze^~We&St,I[38]=ft^~Fe&rt,I[39]=je^~ut&ze,I[48]=Ur^~Rt&at,I[49]=er^~Nt&vt,I[0]^=q[V],I[1]^=q[V+1]};if(f)r.exports=h;else for(E=0;E{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const og=GA();var yd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(yd||(yd={}));var ln;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(ln||(ln={}));const cg="0123456789abcdef";let Mr=class gr{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const i=e.toLowerCase();nf[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(ag>nf[i])&&console.log.apply(console,t)}debug(...e){this._log(gr.levels.DEBUG,e)}info(...e){this._log(gr.levels.INFO,e)}warn(...e){this._log(gr.levels.WARNING,e)}makeError(e,t,i){if(sg)return this.makeError("censored error",t,{});t||(t=gr.errors.UNKNOWN_ERROR),i||(i={});const n=[];Object.keys(i).forEach(g=>{const d=i[g];try{if(d instanceof Uint8Array){let m="";for(let w=0;w>4],m+=cg[d[w]&15];n.push(g+"=Uint8Array(0x"+m+")")}else n.push(g+"="+JSON.stringify(d))}catch{n.push(g+"="+JSON.stringify(i[g].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);const a=e;let c="";switch(t){case ln.NUMERIC_FAULT:{c="NUMERIC_FAULT";const g=e;switch(g){case"overflow":case"underflow":case"division-by-zero":c+="-"+g;break;case"negative-power":case"negative-width":c+="-unsupported";break;case"unbound-bitwise-result":c+="-unbound-result";break}break}case ln.CALL_EXCEPTION:case ln.INSUFFICIENT_FUNDS:case ln.MISSING_NEW:case ln.NONCE_EXPIRED:case ln.REPLACEMENT_UNDERPRICED:case ln.TRANSACTION_REPLACED:case ln.UNPREDICTABLE_GAS_LIMIT:c=t;break}c&&(e+=" [ See: https://links.ethers.org/v5-errors-"+c+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const f=new Error(e);return f.reason=a,f.code=t,Object.keys(i).forEach(function(g){f[g]=i[g]}),f}throwError(e,t,i){throw this.makeError(e,t,i)}throwArgumentError(e,t,i){return this.throwError(e,gr.errors.INVALID_ARGUMENT,{argument:t,value:i})}assert(e,t,i,n){e||this.throwError(t,i,n)}assertArgument(e,t,i,n){e||this.throwArgumentError(t,i,n)}checkNormalize(e){og&&this.throwError("platform missing String.prototype.normalize",gr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:og})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,gr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,gr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,i){i?i=": "+i:i="",et&&this.throwError("too many arguments"+i,gr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",gr.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",gr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",gr.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Pl||(Pl=new gr(VA)),Pl}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",gr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),ng){if(!e)return;this.globalLogger().throwError("error censorship permanent",gr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}sg=!!e,ng=!!t}static setLogLevel(e){const t=nf[e.toLowerCase()];if(t==null){gr.globalLogger().warn("invalid log level - "+e);return}ag=t}static from(e){return new gr(e)}};Mr.errors=ln,Mr.levels=yd;const JA="bytes/5.7.0",cr=new Mr(JA);function b3(r){return!!r.toHexString}function io(r){return r.slice||(r.slice=function(){const e=Array.prototype.slice.call(arguments);return io(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}function WA(r){return Ei(r)&&!(r.length%2)||_o(r)}function ug(r){return typeof r=="number"&&r==r&&r%1===0}function _o(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!ug(r.length)||r.length<0)return!1;for(let e=0;e=256)return!1}return!0}function ir(r,e){if(e||(e={}),typeof r=="number"){cr.checkSafeUint53(r,"invalid arrayify value");const t=[];for(;r;)t.unshift(r&255),r=parseInt(String(r/256));return t.length===0&&t.push(0),io(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),b3(r)&&(r=r.toHexString()),Ei(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":cr.throwArgumentError("hex data is odd-length","value",r));const i=[];for(let n=0;nir(n)),t=e.reduce((n,a)=>n+a.length,0),i=new Uint8Array(t);return e.reduce((n,a)=>(i.set(a,n),n+a.length),0),io(i)}function QA(r,e){r=ir(r),r.length>e&&cr.throwArgumentError("value out of range","value",arguments[0]);const t=new Uint8Array(e);return t.set(r,e-r.length),io(t)}function Ei(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}const Ol="0123456789abcdef";function ui(r,e){if(e||(e={}),typeof r=="number"){cr.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=Ol[r&15]+t,r=Math.floor(r/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),b3(r))return r.toHexString();if(Ei(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":cr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(_o(r)){let t="0x";for(let i=0;i>4]+Ol[n&15]}return t}return cr.throwArgumentError("invalid hexlify value","value",r)}function XA(r){if(typeof r!="string")r=ui(r);else if(!Ei(r)||r.length%2)return null;return(r.length-2)/2}function fg(r,e,t){return typeof r!="string"?r=ui(r):(!Ei(r)||r.length%2)&&cr.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}function $n(r,e){for(typeof r!="string"?r=ui(r):Ei(r)||cr.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&cr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}function v3(r){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(WA(r)){let t=ir(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=ui(t.slice(0,32)),e.s=ui(t.slice(32,64))):t.length===65?(e.r=ui(t.slice(0,32)),e.s=ui(t.slice(32,64)),e.v=t[64]):cr.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:cr.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=ui(t.slice(32,64))}else{if(e.r=r.r,e.s=r.s,e.v=r.v,e.recoveryParam=r.recoveryParam,e._vs=r._vs,e._vs!=null){const n=QA(ir(e._vs),32);e._vs=ui(n);const a=n[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&cr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),n[0]&=127;const c=ui(n);e.s==null?e.s=c:e.s!==c&&cr.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?cr.throwArgumentError("signature missing v and recoveryParam","signature",r):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const n=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==n&&cr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!Ei(e.r)?cr.throwArgumentError("signature missing or invalid r","signature",r):e.r=$n(e.r,32),e.s==null||!Ei(e.s)?cr.throwArgumentError("signature missing or invalid s","signature",r):e.s=$n(e.s,32);const t=ir(e.s);t[0]>=128&&cr.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);const i=ui(t);e._vs&&(Ei(e._vs)||cr.throwArgumentError("signature invalid _vs","signature",r),e._vs=$n(e._vs,32)),e._vs==null?e._vs=i:e._vs!==i&&cr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function i0(r){return"0x"+KA.keccak_256(ir(r))}var m3={exports:{}},ZA={},ex=Object.freeze({__proto__:null,default:ZA}),tx=HA(ex);(function(r){(function(e,t){function i(u,h){if(!u)throw new Error(h||"Assertion failed")}function n(u,h){u.super_=h;var v=function(){};v.prototype=h.prototype,u.prototype=new v,u.prototype.constructor=u}function a(u,h,v){if(a.isBN(u))return u;this.negative=0,this.words=null,this.length=0,this.red=null,u!==null&&((h==="le"||h==="be")&&(v=h,h=10),this._init(u||0,h||10,v||"be"))}typeof e=="object"?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var c;try{typeof window<"u"&&typeof window.Buffer<"u"?c=window.Buffer:c=tx.Buffer}catch{}a.isBN=function(u){return u instanceof a?!0:u!==null&&typeof u=="object"&&u.constructor.wordSize===a.wordSize&&Array.isArray(u.words)},a.max=function(u,h){return u.cmp(h)>0?u:h},a.min=function(u,h){return u.cmp(h)<0?u:h},a.prototype._init=function(u,h,v){if(typeof u=="number")return this._initNumber(u,h,v);if(typeof u=="object")return this._initArray(u,h,v);h==="hex"&&(h=16),i(h===(h|0)&&h>=2&&h<=36),u=u.toString().replace(/\s+/g,"");var E=0;u[0]==="-"&&(E++,this.negative=1),E=0;E-=3)M=u[E]|u[E-1]<<8|u[E-2]<<16,this.words[S]|=M<>>26-x&67108863,x+=24,x>=26&&(x-=26,S++);else if(v==="le")for(E=0,S=0;E>>26-x&67108863,x+=24,x>=26&&(x-=26,S++);return this._strip()};function f(u,h){var v=u.charCodeAt(h);if(v>=48&&v<=57)return v-48;if(v>=65&&v<=70)return v-55;if(v>=97&&v<=102)return v-87;i(!1,"Invalid character in "+u)}function g(u,h,v){var E=f(u,v);return v-1>=h&&(E|=f(u,v-1)<<4),E}a.prototype._parseHex=function(u,h,v){this.length=Math.ceil((u.length-h)/6),this.words=new Array(this.length);for(var E=0;E=h;E-=2)x=g(u,h,E)<=18?(S-=18,M+=1,this.words[M]|=x>>>26):S+=8;else{var p=u.length-h;for(E=p%2===0?h+1:h;E=18?(S-=18,M+=1,this.words[M]|=x>>>26):S+=8}this._strip()};function d(u,h,v,E){for(var S=0,M=0,x=Math.min(u.length,v),p=h;p=49?M=b-49+10:b>=17?M=b-17+10:M=b,i(b>=0&&M1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=w}catch{a.prototype.inspect=w}else a.prototype.inspect=w;function w(){return(this.red?""}var O=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],P=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(u,h){u=u||10,h=h|0||1;var v;if(u===16||u==="hex"){v="";for(var E=0,S=0,M=0;M>>24-E&16777215,E+=2,E>=26&&(E-=26,M--),S!==0||M!==this.length-1?v=O[6-p.length]+p+v:v=p+v}for(S!==0&&(v=S.toString(16)+v);v.length%h!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(u===(u|0)&&u>=2&&u<=36){var b=C[u],R=P[u];v="";var Z=this.clone();for(Z.negative=0;!Z.isZero();){var ae=Z.modrn(R).toString(u);Z=Z.idivn(R),Z.isZero()?v=ae+v:v=O[b-ae.length]+ae+v}for(this.isZero()&&(v="0"+v);v.length%h!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=this.words[1]*67108864:this.length===3&&this.words[2]===1?u+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},a.prototype.toJSON=function(){return this.toString(16,2)},c&&(a.prototype.toBuffer=function(u,h){return this.toArrayLike(c,u,h)}),a.prototype.toArray=function(u,h){return this.toArrayLike(Array,u,h)};var q=function(u,h){return u.allocUnsafe?u.allocUnsafe(h):new u(h)};a.prototype.toArrayLike=function(u,h,v){this._strip();var E=this.byteLength(),S=v||Math.max(1,E);i(E<=S,"byte array longer than desired length"),i(S>0,"Requested array length <= 0");var M=q(u,S),x=h==="le"?"LE":"BE";return this["_toArrayLike"+x](M,E),M},a.prototype._toArrayLikeLE=function(u,h){for(var v=0,E=0,S=0,M=0;S>8&255),v>16&255),M===6?(v>24&255),E=0,M=0):(E=x>>>24,M+=2)}if(v=0&&(u[v--]=x>>8&255),v>=0&&(u[v--]=x>>16&255),M===6?(v>=0&&(u[v--]=x>>24&255),E=0,M=0):(E=x>>>24,M+=2)}if(v>=0)for(u[v--]=E;v>=0;)u[v--]=0},Math.clz32?a.prototype._countBits=function(u){return 32-Math.clz32(u)}:a.prototype._countBits=function(u){var h=u,v=0;return h>=4096&&(v+=13,h>>>=13),h>=64&&(v+=7,h>>>=7),h>=8&&(v+=4,h>>>=4),h>=2&&(v+=2,h>>>=2),v+h},a.prototype._zeroBits=function(u){if(u===0)return 26;var h=u,v=0;return h&8191||(v+=13,h>>>=13),h&127||(v+=7,h>>>=7),h&15||(v+=4,h>>>=4),h&3||(v+=2,h>>>=2),h&1||v++,v},a.prototype.bitLength=function(){var u=this.words[this.length-1],h=this._countBits(u);return(this.length-1)*26+h};function K(u){for(var h=new Array(u.bitLength()),v=0;v>>S&1}return h}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,h=0;hu.length?this.clone().ior(u):u.clone().ior(this)},a.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},a.prototype.iuand=function(u){var h;this.length>u.length?h=u:h=this;for(var v=0;vu.length?this.clone().iand(u):u.clone().iand(this)},a.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},a.prototype.iuxor=function(u){var h,v;this.length>u.length?(h=this,v=u):(h=u,v=this);for(var E=0;Eu.length?this.clone().ixor(u):u.clone().ixor(this)},a.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},a.prototype.inotn=function(u){i(typeof u=="number"&&u>=0);var h=Math.ceil(u/26)|0,v=u%26;this._expand(h),v>0&&h--;for(var E=0;E0&&(this.words[E]=~this.words[E]&67108863>>26-v),this._strip()},a.prototype.notn=function(u){return this.clone().inotn(u)},a.prototype.setn=function(u,h){i(typeof u=="number"&&u>=0);var v=u/26|0,E=u%26;return this._expand(v+1),h?this.words[v]=this.words[v]|1<u.length?(v=this,E=u):(v=u,E=this);for(var S=0,M=0;M>>26;for(;S!==0&&M>>26;if(this.length=v.length,S!==0)this.words[this.length]=S,this.length++;else if(v!==this)for(;Mu.length?this.clone().iadd(u):u.clone().iadd(this)},a.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var h=this.iadd(u);return u.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var v=this.cmp(u);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,S;v>0?(E=this,S=u):(E=u,S=this);for(var M=0,x=0;x>26,this.words[x]=h&67108863;for(;M!==0&&x>26,this.words[x]=h&67108863;if(M===0&&x>>26,ae=b&67108863,I=Math.min(R,h.length-1),ee=Math.max(0,R-u.length+1);ee<=I;ee++){var L=R-ee|0;S=u.words[L]|0,M=h.words[ee]|0,x=S*M+ae,Z+=x/67108864|0,ae=x&67108863}v.words[R]=ae|0,b=Z|0}return b!==0?v.words[R]=b|0:v.length--,v._strip()}var z=function(u,h,v){var E=u.words,S=h.words,M=v.words,x=0,p,b,R,Z=E[0]|0,ae=Z&8191,I=Z>>>13,ee=E[1]|0,L=ee&8191,V=ee>>>13,G=E[2]|0,D=G&8191,H=G>>>13,ne=E[3]|0,ce=ne&8191,fe=ne>>>13,ye=E[4]|0,we=ye&8191,Te=ye>>>13,Qe=E[5]|0,Ce=Qe&8191,Re=Qe>>>13,Se=E[6]|0,me=Se&8191,Pe=Se>>>13,Ne=E[7]|0,be=Ne&8191,Oe=Ne>>>13,xe=E[8]|0,ve=xe&8191,qe=xe>>>13,Me=E[9]|0,_e=Me&8191,He=Me>>>13,Ve=S[0]|0,Ee=Ve&8191,Ke=Ve>>>13,ht=S[1]|0,Ge=ht&8191,_t=ht>>>13,lt=S[2]|0,We=lt&8191,Et=lt>>>13,St=S[3]|0,Be=St&8191,Xe=St>>>13,tt=S[4]|0,$e=tt&8191,et=tt>>>13,Ze=S[5]|0,Fe=Ze&8191,ut=Ze>>>13,rt=S[6]|0,ze=rt&8191,it=rt>>>13,st=S[7]|0,Ue=st&8191,Ye=st>>>13,ft=S[8]|0,je=ft&8191,Rt=ft>>>13,Nt=S[9]|0,at=Nt&8191,vt=Nt>>>13;v.negative=u.negative^h.negative,v.length=19,p=Math.imul(ae,Ee),b=Math.imul(ae,Ke),b=b+Math.imul(I,Ee)|0,R=Math.imul(I,Ke);var Rr=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,p=Math.imul(L,Ee),b=Math.imul(L,Ke),b=b+Math.imul(V,Ee)|0,R=Math.imul(V,Ke),p=p+Math.imul(ae,Ge)|0,b=b+Math.imul(ae,_t)|0,b=b+Math.imul(I,Ge)|0,R=R+Math.imul(I,_t)|0;var Nr=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,p=Math.imul(D,Ee),b=Math.imul(D,Ke),b=b+Math.imul(H,Ee)|0,R=Math.imul(H,Ke),p=p+Math.imul(L,Ge)|0,b=b+Math.imul(L,_t)|0,b=b+Math.imul(V,Ge)|0,R=R+Math.imul(V,_t)|0,p=p+Math.imul(ae,We)|0,b=b+Math.imul(ae,Et)|0,b=b+Math.imul(I,We)|0,R=R+Math.imul(I,Et)|0;var Br=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Br>>>26)|0,Br&=67108863,p=Math.imul(ce,Ee),b=Math.imul(ce,Ke),b=b+Math.imul(fe,Ee)|0,R=Math.imul(fe,Ke),p=p+Math.imul(D,Ge)|0,b=b+Math.imul(D,_t)|0,b=b+Math.imul(H,Ge)|0,R=R+Math.imul(H,_t)|0,p=p+Math.imul(L,We)|0,b=b+Math.imul(L,Et)|0,b=b+Math.imul(V,We)|0,R=R+Math.imul(V,Et)|0,p=p+Math.imul(ae,Be)|0,b=b+Math.imul(ae,Xe)|0,b=b+Math.imul(I,Be)|0,R=R+Math.imul(I,Xe)|0;var $r=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+($r>>>26)|0,$r&=67108863,p=Math.imul(we,Ee),b=Math.imul(we,Ke),b=b+Math.imul(Te,Ee)|0,R=Math.imul(Te,Ke),p=p+Math.imul(ce,Ge)|0,b=b+Math.imul(ce,_t)|0,b=b+Math.imul(fe,Ge)|0,R=R+Math.imul(fe,_t)|0,p=p+Math.imul(D,We)|0,b=b+Math.imul(D,Et)|0,b=b+Math.imul(H,We)|0,R=R+Math.imul(H,Et)|0,p=p+Math.imul(L,Be)|0,b=b+Math.imul(L,Xe)|0,b=b+Math.imul(V,Be)|0,R=R+Math.imul(V,Xe)|0,p=p+Math.imul(ae,$e)|0,b=b+Math.imul(ae,et)|0,b=b+Math.imul(I,$e)|0,R=R+Math.imul(I,et)|0;var Ur=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,p=Math.imul(Ce,Ee),b=Math.imul(Ce,Ke),b=b+Math.imul(Re,Ee)|0,R=Math.imul(Re,Ke),p=p+Math.imul(we,Ge)|0,b=b+Math.imul(we,_t)|0,b=b+Math.imul(Te,Ge)|0,R=R+Math.imul(Te,_t)|0,p=p+Math.imul(ce,We)|0,b=b+Math.imul(ce,Et)|0,b=b+Math.imul(fe,We)|0,R=R+Math.imul(fe,Et)|0,p=p+Math.imul(D,Be)|0,b=b+Math.imul(D,Xe)|0,b=b+Math.imul(H,Be)|0,R=R+Math.imul(H,Xe)|0,p=p+Math.imul(L,$e)|0,b=b+Math.imul(L,et)|0,b=b+Math.imul(V,$e)|0,R=R+Math.imul(V,et)|0,p=p+Math.imul(ae,Fe)|0,b=b+Math.imul(ae,ut)|0,b=b+Math.imul(I,Fe)|0,R=R+Math.imul(I,ut)|0;var er=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(er>>>26)|0,er&=67108863,p=Math.imul(me,Ee),b=Math.imul(me,Ke),b=b+Math.imul(Pe,Ee)|0,R=Math.imul(Pe,Ke),p=p+Math.imul(Ce,Ge)|0,b=b+Math.imul(Ce,_t)|0,b=b+Math.imul(Re,Ge)|0,R=R+Math.imul(Re,_t)|0,p=p+Math.imul(we,We)|0,b=b+Math.imul(we,Et)|0,b=b+Math.imul(Te,We)|0,R=R+Math.imul(Te,Et)|0,p=p+Math.imul(ce,Be)|0,b=b+Math.imul(ce,Xe)|0,b=b+Math.imul(fe,Be)|0,R=R+Math.imul(fe,Xe)|0,p=p+Math.imul(D,$e)|0,b=b+Math.imul(D,et)|0,b=b+Math.imul(H,$e)|0,R=R+Math.imul(H,et)|0,p=p+Math.imul(L,Fe)|0,b=b+Math.imul(L,ut)|0,b=b+Math.imul(V,Fe)|0,R=R+Math.imul(V,ut)|0,p=p+Math.imul(ae,ze)|0,b=b+Math.imul(ae,it)|0,b=b+Math.imul(I,ze)|0,R=R+Math.imul(I,it)|0;var Xr=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,p=Math.imul(be,Ee),b=Math.imul(be,Ke),b=b+Math.imul(Oe,Ee)|0,R=Math.imul(Oe,Ke),p=p+Math.imul(me,Ge)|0,b=b+Math.imul(me,_t)|0,b=b+Math.imul(Pe,Ge)|0,R=R+Math.imul(Pe,_t)|0,p=p+Math.imul(Ce,We)|0,b=b+Math.imul(Ce,Et)|0,b=b+Math.imul(Re,We)|0,R=R+Math.imul(Re,Et)|0,p=p+Math.imul(we,Be)|0,b=b+Math.imul(we,Xe)|0,b=b+Math.imul(Te,Be)|0,R=R+Math.imul(Te,Xe)|0,p=p+Math.imul(ce,$e)|0,b=b+Math.imul(ce,et)|0,b=b+Math.imul(fe,$e)|0,R=R+Math.imul(fe,et)|0,p=p+Math.imul(D,Fe)|0,b=b+Math.imul(D,ut)|0,b=b+Math.imul(H,Fe)|0,R=R+Math.imul(H,ut)|0,p=p+Math.imul(L,ze)|0,b=b+Math.imul(L,it)|0,b=b+Math.imul(V,ze)|0,R=R+Math.imul(V,it)|0,p=p+Math.imul(ae,Ue)|0,b=b+Math.imul(ae,Ye)|0,b=b+Math.imul(I,Ue)|0,R=R+Math.imul(I,Ye)|0;var Wi=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,p=Math.imul(ve,Ee),b=Math.imul(ve,Ke),b=b+Math.imul(qe,Ee)|0,R=Math.imul(qe,Ke),p=p+Math.imul(be,Ge)|0,b=b+Math.imul(be,_t)|0,b=b+Math.imul(Oe,Ge)|0,R=R+Math.imul(Oe,_t)|0,p=p+Math.imul(me,We)|0,b=b+Math.imul(me,Et)|0,b=b+Math.imul(Pe,We)|0,R=R+Math.imul(Pe,Et)|0,p=p+Math.imul(Ce,Be)|0,b=b+Math.imul(Ce,Xe)|0,b=b+Math.imul(Re,Be)|0,R=R+Math.imul(Re,Xe)|0,p=p+Math.imul(we,$e)|0,b=b+Math.imul(we,et)|0,b=b+Math.imul(Te,$e)|0,R=R+Math.imul(Te,et)|0,p=p+Math.imul(ce,Fe)|0,b=b+Math.imul(ce,ut)|0,b=b+Math.imul(fe,Fe)|0,R=R+Math.imul(fe,ut)|0,p=p+Math.imul(D,ze)|0,b=b+Math.imul(D,it)|0,b=b+Math.imul(H,ze)|0,R=R+Math.imul(H,it)|0,p=p+Math.imul(L,Ue)|0,b=b+Math.imul(L,Ye)|0,b=b+Math.imul(V,Ue)|0,R=R+Math.imul(V,Ye)|0,p=p+Math.imul(ae,je)|0,b=b+Math.imul(ae,Rt)|0,b=b+Math.imul(I,je)|0,R=R+Math.imul(I,Rt)|0;var Zr=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,p=Math.imul(_e,Ee),b=Math.imul(_e,Ke),b=b+Math.imul(He,Ee)|0,R=Math.imul(He,Ke),p=p+Math.imul(ve,Ge)|0,b=b+Math.imul(ve,_t)|0,b=b+Math.imul(qe,Ge)|0,R=R+Math.imul(qe,_t)|0,p=p+Math.imul(be,We)|0,b=b+Math.imul(be,Et)|0,b=b+Math.imul(Oe,We)|0,R=R+Math.imul(Oe,Et)|0,p=p+Math.imul(me,Be)|0,b=b+Math.imul(me,Xe)|0,b=b+Math.imul(Pe,Be)|0,R=R+Math.imul(Pe,Xe)|0,p=p+Math.imul(Ce,$e)|0,b=b+Math.imul(Ce,et)|0,b=b+Math.imul(Re,$e)|0,R=R+Math.imul(Re,et)|0,p=p+Math.imul(we,Fe)|0,b=b+Math.imul(we,ut)|0,b=b+Math.imul(Te,Fe)|0,R=R+Math.imul(Te,ut)|0,p=p+Math.imul(ce,ze)|0,b=b+Math.imul(ce,it)|0,b=b+Math.imul(fe,ze)|0,R=R+Math.imul(fe,it)|0,p=p+Math.imul(D,Ue)|0,b=b+Math.imul(D,Ye)|0,b=b+Math.imul(H,Ue)|0,R=R+Math.imul(H,Ye)|0,p=p+Math.imul(L,je)|0,b=b+Math.imul(L,Rt)|0,b=b+Math.imul(V,je)|0,R=R+Math.imul(V,Rt)|0,p=p+Math.imul(ae,at)|0,b=b+Math.imul(ae,vt)|0,b=b+Math.imul(I,at)|0,R=R+Math.imul(I,vt)|0;var Yi=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,p=Math.imul(_e,Ge),b=Math.imul(_e,_t),b=b+Math.imul(He,Ge)|0,R=Math.imul(He,_t),p=p+Math.imul(ve,We)|0,b=b+Math.imul(ve,Et)|0,b=b+Math.imul(qe,We)|0,R=R+Math.imul(qe,Et)|0,p=p+Math.imul(be,Be)|0,b=b+Math.imul(be,Xe)|0,b=b+Math.imul(Oe,Be)|0,R=R+Math.imul(Oe,Xe)|0,p=p+Math.imul(me,$e)|0,b=b+Math.imul(me,et)|0,b=b+Math.imul(Pe,$e)|0,R=R+Math.imul(Pe,et)|0,p=p+Math.imul(Ce,Fe)|0,b=b+Math.imul(Ce,ut)|0,b=b+Math.imul(Re,Fe)|0,R=R+Math.imul(Re,ut)|0,p=p+Math.imul(we,ze)|0,b=b+Math.imul(we,it)|0,b=b+Math.imul(Te,ze)|0,R=R+Math.imul(Te,it)|0,p=p+Math.imul(ce,Ue)|0,b=b+Math.imul(ce,Ye)|0,b=b+Math.imul(fe,Ue)|0,R=R+Math.imul(fe,Ye)|0,p=p+Math.imul(D,je)|0,b=b+Math.imul(D,Rt)|0,b=b+Math.imul(H,je)|0,R=R+Math.imul(H,Rt)|0,p=p+Math.imul(L,at)|0,b=b+Math.imul(L,vt)|0,b=b+Math.imul(V,at)|0,R=R+Math.imul(V,vt)|0;var Qi=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,p=Math.imul(_e,We),b=Math.imul(_e,Et),b=b+Math.imul(He,We)|0,R=Math.imul(He,Et),p=p+Math.imul(ve,Be)|0,b=b+Math.imul(ve,Xe)|0,b=b+Math.imul(qe,Be)|0,R=R+Math.imul(qe,Xe)|0,p=p+Math.imul(be,$e)|0,b=b+Math.imul(be,et)|0,b=b+Math.imul(Oe,$e)|0,R=R+Math.imul(Oe,et)|0,p=p+Math.imul(me,Fe)|0,b=b+Math.imul(me,ut)|0,b=b+Math.imul(Pe,Fe)|0,R=R+Math.imul(Pe,ut)|0,p=p+Math.imul(Ce,ze)|0,b=b+Math.imul(Ce,it)|0,b=b+Math.imul(Re,ze)|0,R=R+Math.imul(Re,it)|0,p=p+Math.imul(we,Ue)|0,b=b+Math.imul(we,Ye)|0,b=b+Math.imul(Te,Ue)|0,R=R+Math.imul(Te,Ye)|0,p=p+Math.imul(ce,je)|0,b=b+Math.imul(ce,Rt)|0,b=b+Math.imul(fe,je)|0,R=R+Math.imul(fe,Rt)|0,p=p+Math.imul(D,at)|0,b=b+Math.imul(D,vt)|0,b=b+Math.imul(H,at)|0,R=R+Math.imul(H,vt)|0;var ei=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(ei>>>26)|0,ei&=67108863,p=Math.imul(_e,Be),b=Math.imul(_e,Xe),b=b+Math.imul(He,Be)|0,R=Math.imul(He,Xe),p=p+Math.imul(ve,$e)|0,b=b+Math.imul(ve,et)|0,b=b+Math.imul(qe,$e)|0,R=R+Math.imul(qe,et)|0,p=p+Math.imul(be,Fe)|0,b=b+Math.imul(be,ut)|0,b=b+Math.imul(Oe,Fe)|0,R=R+Math.imul(Oe,ut)|0,p=p+Math.imul(me,ze)|0,b=b+Math.imul(me,it)|0,b=b+Math.imul(Pe,ze)|0,R=R+Math.imul(Pe,it)|0,p=p+Math.imul(Ce,Ue)|0,b=b+Math.imul(Ce,Ye)|0,b=b+Math.imul(Re,Ue)|0,R=R+Math.imul(Re,Ye)|0,p=p+Math.imul(we,je)|0,b=b+Math.imul(we,Rt)|0,b=b+Math.imul(Te,je)|0,R=R+Math.imul(Te,Rt)|0,p=p+Math.imul(ce,at)|0,b=b+Math.imul(ce,vt)|0,b=b+Math.imul(fe,at)|0,R=R+Math.imul(fe,vt)|0;var Mi=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,p=Math.imul(_e,$e),b=Math.imul(_e,et),b=b+Math.imul(He,$e)|0,R=Math.imul(He,et),p=p+Math.imul(ve,Fe)|0,b=b+Math.imul(ve,ut)|0,b=b+Math.imul(qe,Fe)|0,R=R+Math.imul(qe,ut)|0,p=p+Math.imul(be,ze)|0,b=b+Math.imul(be,it)|0,b=b+Math.imul(Oe,ze)|0,R=R+Math.imul(Oe,it)|0,p=p+Math.imul(me,Ue)|0,b=b+Math.imul(me,Ye)|0,b=b+Math.imul(Pe,Ue)|0,R=R+Math.imul(Pe,Ye)|0,p=p+Math.imul(Ce,je)|0,b=b+Math.imul(Ce,Rt)|0,b=b+Math.imul(Re,je)|0,R=R+Math.imul(Re,Rt)|0,p=p+Math.imul(we,at)|0,b=b+Math.imul(we,vt)|0,b=b+Math.imul(Te,at)|0,R=R+Math.imul(Te,vt)|0;var Ii=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,p=Math.imul(_e,Fe),b=Math.imul(_e,ut),b=b+Math.imul(He,Fe)|0,R=Math.imul(He,ut),p=p+Math.imul(ve,ze)|0,b=b+Math.imul(ve,it)|0,b=b+Math.imul(qe,ze)|0,R=R+Math.imul(qe,it)|0,p=p+Math.imul(be,Ue)|0,b=b+Math.imul(be,Ye)|0,b=b+Math.imul(Oe,Ue)|0,R=R+Math.imul(Oe,Ye)|0,p=p+Math.imul(me,je)|0,b=b+Math.imul(me,Rt)|0,b=b+Math.imul(Pe,je)|0,R=R+Math.imul(Pe,Rt)|0,p=p+Math.imul(Ce,at)|0,b=b+Math.imul(Ce,vt)|0,b=b+Math.imul(Re,at)|0,R=R+Math.imul(Re,vt)|0;var lr=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(lr>>>26)|0,lr&=67108863,p=Math.imul(_e,ze),b=Math.imul(_e,it),b=b+Math.imul(He,ze)|0,R=Math.imul(He,it),p=p+Math.imul(ve,Ue)|0,b=b+Math.imul(ve,Ye)|0,b=b+Math.imul(qe,Ue)|0,R=R+Math.imul(qe,Ye)|0,p=p+Math.imul(be,je)|0,b=b+Math.imul(be,Rt)|0,b=b+Math.imul(Oe,je)|0,R=R+Math.imul(Oe,Rt)|0,p=p+Math.imul(me,at)|0,b=b+Math.imul(me,vt)|0,b=b+Math.imul(Pe,at)|0,R=R+Math.imul(Pe,vt)|0;var Xi=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Xi>>>26)|0,Xi&=67108863,p=Math.imul(_e,Ue),b=Math.imul(_e,Ye),b=b+Math.imul(He,Ue)|0,R=Math.imul(He,Ye),p=p+Math.imul(ve,je)|0,b=b+Math.imul(ve,Rt)|0,b=b+Math.imul(qe,je)|0,R=R+Math.imul(qe,Rt)|0,p=p+Math.imul(be,at)|0,b=b+Math.imul(be,vt)|0,b=b+Math.imul(Oe,at)|0,R=R+Math.imul(Oe,vt)|0;var Zi=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(Zi>>>26)|0,Zi&=67108863,p=Math.imul(_e,je),b=Math.imul(_e,Rt),b=b+Math.imul(He,je)|0,R=Math.imul(He,Rt),p=p+Math.imul(ve,at)|0,b=b+Math.imul(ve,vt)|0,b=b+Math.imul(qe,at)|0,R=R+Math.imul(qe,vt)|0;var en=(x+p|0)+((b&8191)<<13)|0;x=(R+(b>>>13)|0)+(en>>>26)|0,en&=67108863,p=Math.imul(_e,at),b=Math.imul(_e,vt),b=b+Math.imul(He,at)|0,R=Math.imul(He,vt);var Ks=(x+p|0)+((b&8191)<<13)|0;return x=(R+(b>>>13)|0)+(Ks>>>26)|0,Ks&=67108863,M[0]=Rr,M[1]=Nr,M[2]=Br,M[3]=$r,M[4]=Ur,M[5]=er,M[6]=Xr,M[7]=Wi,M[8]=Zr,M[9]=Yi,M[10]=Qi,M[11]=ei,M[12]=Mi,M[13]=Ii,M[14]=lr,M[15]=Xi,M[16]=Zi,M[17]=en,M[18]=Ks,x!==0&&(M[19]=x,v.length++),v};Math.imul||(z=Y);function W(u,h,v){v.negative=h.negative^u.negative,v.length=u.length+h.length;for(var E=0,S=0,M=0;M>>26)|0,S+=x>>>26,x&=67108863}v.words[M]=p,E=x,x=S}return E!==0?v.words[M]=E:v.length--,v._strip()}function B(u,h,v){return W(u,h,v)}a.prototype.mulTo=function(u,h){var v,E=this.length+u.length;return this.length===10&&u.length===10?v=z(this,u,h):E<63?v=Y(this,u,h):E<1024?v=W(this,u,h):v=B(this,u,h),v},a.prototype.mul=function(u){var h=new a(null);return h.words=new Array(this.length+u.length),this.mulTo(u,h)},a.prototype.mulf=function(u){var h=new a(null);return h.words=new Array(this.length+u.length),B(this,u,h)},a.prototype.imul=function(u){return this.clone().mulTo(u,this)},a.prototype.imuln=function(u){var h=u<0;h&&(u=-u),i(typeof u=="number"),i(u<67108864);for(var v=0,E=0;E>=26,v+=S/67108864|0,v+=M>>>26,this.words[E]=M&67108863}return v!==0&&(this.words[E]=v,this.length++),h?this.ineg():this},a.prototype.muln=function(u){return this.clone().imuln(u)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(u){var h=K(u);if(h.length===0)return new a(1);for(var v=this,E=0;E=0);var h=u%26,v=(u-h)/26,E=67108863>>>26-h<<26-h,S;if(h!==0){var M=0;for(S=0;S>>26-h}M&&(this.words[S]=M,this.length++)}if(v!==0){for(S=this.length-1;S>=0;S--)this.words[S+v]=this.words[S];for(S=0;S=0);var E;h?E=(h-h%26)/26:E=0;var S=u%26,M=Math.min((u-S)/26,this.length),x=67108863^67108863>>>S<M)for(this.length-=M,b=0;b=0&&(R!==0||b>=E);b--){var Z=this.words[b]|0;this.words[b]=R<<26-S|Z>>>S,R=Z&x}return p&&R!==0&&(p.words[p.length++]=R),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(u,h,v){return i(this.negative===0),this.iushrn(u,h,v)},a.prototype.shln=function(u){return this.clone().ishln(u)},a.prototype.ushln=function(u){return this.clone().iushln(u)},a.prototype.shrn=function(u){return this.clone().ishrn(u)},a.prototype.ushrn=function(u){return this.clone().iushrn(u)},a.prototype.testn=function(u){i(typeof u=="number"&&u>=0);var h=u%26,v=(u-h)/26,E=1<=0);var h=u%26,v=(u-h)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(h!==0&&v++,this.length=Math.min(v,this.length),h!==0){var E=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},a.prototype.isubn=function(u){if(i(typeof u=="number"),i(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-(p/67108864|0),this.words[S+v]=M&67108863}for(;S>26,this.words[S+v]=M&67108863;if(x===0)return this._strip();for(i(x===-1),x=0,S=0;S>26,this.words[S]=M&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(u,h){var v=this.length-u.length,E=this.clone(),S=u,M=S.words[S.length-1]|0,x=this._countBits(M);v=26-x,v!==0&&(S=S.ushln(v),E.iushln(v),M=S.words[S.length-1]|0);var p=E.length-S.length,b;if(h!=="mod"){b=new a(null),b.length=p+1,b.words=new Array(b.length);for(var R=0;R=0;ae--){var I=(E.words[S.length+ae]|0)*67108864+(E.words[S.length+ae-1]|0);for(I=Math.min(I/M|0,67108863),E._ishlnsubmul(S,I,ae);E.negative!==0;)I--,E.negative=0,E._ishlnsubmul(S,1,ae),E.isZero()||(E.negative^=1);b&&(b.words[ae]=I)}return b&&b._strip(),E._strip(),h!=="div"&&v!==0&&E.iushrn(v),{div:b||null,mod:E}},a.prototype.divmod=function(u,h,v){if(i(!u.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var E,S,M;return this.negative!==0&&u.negative===0?(M=this.neg().divmod(u,h),h!=="mod"&&(E=M.div.neg()),h!=="div"&&(S=M.mod.neg(),v&&S.negative!==0&&S.iadd(u)),{div:E,mod:S}):this.negative===0&&u.negative!==0?(M=this.divmod(u.neg(),h),h!=="mod"&&(E=M.div.neg()),{div:E,mod:M.mod}):this.negative&u.negative?(M=this.neg().divmod(u.neg(),h),h!=="div"&&(S=M.mod.neg(),v&&S.negative!==0&&S.isub(u)),{div:M.div,mod:S}):u.length>this.length||this.cmp(u)<0?{div:new a(0),mod:this}:u.length===1?h==="div"?{div:this.divn(u.words[0]),mod:null}:h==="mod"?{div:null,mod:new a(this.modrn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new a(this.modrn(u.words[0]))}:this._wordDiv(u,h)},a.prototype.div=function(u){return this.divmod(u,"div",!1).div},a.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},a.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},a.prototype.divRound=function(u){var h=this.divmod(u);if(h.mod.isZero())return h.div;var v=h.div.negative!==0?h.mod.isub(u):h.mod,E=u.ushrn(1),S=u.andln(1),M=v.cmp(E);return M<0||S===1&&M===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},a.prototype.modrn=function(u){var h=u<0;h&&(u=-u),i(u<=67108863);for(var v=(1<<26)%u,E=0,S=this.length-1;S>=0;S--)E=(v*E+(this.words[S]|0))%u;return h?-E:E},a.prototype.modn=function(u){return this.modrn(u)},a.prototype.idivn=function(u){var h=u<0;h&&(u=-u),i(u<=67108863);for(var v=0,E=this.length-1;E>=0;E--){var S=(this.words[E]|0)+v*67108864;this.words[E]=S/u|0,v=S%u}return this._strip(),h?this.ineg():this},a.prototype.divn=function(u){return this.clone().idivn(u)},a.prototype.egcd=function(u){i(u.negative===0),i(!u.isZero());var h=this,v=u.clone();h.negative!==0?h=h.umod(u):h=h.clone();for(var E=new a(1),S=new a(0),M=new a(0),x=new a(1),p=0;h.isEven()&&v.isEven();)h.iushrn(1),v.iushrn(1),++p;for(var b=v.clone(),R=h.clone();!h.isZero();){for(var Z=0,ae=1;!(h.words[0]&ae)&&Z<26;++Z,ae<<=1);if(Z>0)for(h.iushrn(Z);Z-- >0;)(E.isOdd()||S.isOdd())&&(E.iadd(b),S.isub(R)),E.iushrn(1),S.iushrn(1);for(var I=0,ee=1;!(v.words[0]&ee)&&I<26;++I,ee<<=1);if(I>0)for(v.iushrn(I);I-- >0;)(M.isOdd()||x.isOdd())&&(M.iadd(b),x.isub(R)),M.iushrn(1),x.iushrn(1);h.cmp(v)>=0?(h.isub(v),E.isub(M),S.isub(x)):(v.isub(h),M.isub(E),x.isub(S))}return{a:M,b:x,gcd:v.iushln(p)}},a.prototype._invmp=function(u){i(u.negative===0),i(!u.isZero());var h=this,v=u.clone();h.negative!==0?h=h.umod(u):h=h.clone();for(var E=new a(1),S=new a(0),M=v.clone();h.cmpn(1)>0&&v.cmpn(1)>0;){for(var x=0,p=1;!(h.words[0]&p)&&x<26;++x,p<<=1);if(x>0)for(h.iushrn(x);x-- >0;)E.isOdd()&&E.iadd(M),E.iushrn(1);for(var b=0,R=1;!(v.words[0]&R)&&b<26;++b,R<<=1);if(b>0)for(v.iushrn(b);b-- >0;)S.isOdd()&&S.iadd(M),S.iushrn(1);h.cmp(v)>=0?(h.isub(v),E.isub(S)):(v.isub(h),S.isub(E))}var Z;return h.cmpn(1)===0?Z=E:Z=S,Z.cmpn(0)<0&&Z.iadd(u),Z},a.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var h=this.clone(),v=u.clone();h.negative=0,v.negative=0;for(var E=0;h.isEven()&&v.isEven();E++)h.iushrn(1),v.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;v.isEven();)v.iushrn(1);var S=h.cmp(v);if(S<0){var M=h;h=v,v=M}else if(S===0||v.cmpn(1)===0)break;h.isub(v)}while(!0);return v.iushln(E)},a.prototype.invm=function(u){return this.egcd(u).a.umod(u)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(u){return this.words[0]&u},a.prototype.bincn=function(u){i(typeof u=="number");var h=u%26,v=(u-h)/26,E=1<>>26,x&=67108863,this.words[M]=x}return S!==0&&(this.words[M]=S,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(u){var h=u<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var v;if(this.length>1)v=1;else{h&&(u=-u),i(u<=67108863,"Number is too big");var E=this.words[0]|0;v=E===u?0:Eu.length)return 1;if(this.length=0;v--){var E=this.words[v]|0,S=u.words[v]|0;if(E!==S){ES&&(h=1);break}}return h},a.prototype.gtn=function(u){return this.cmpn(u)===1},a.prototype.gt=function(u){return this.cmp(u)===1},a.prototype.gten=function(u){return this.cmpn(u)>=0},a.prototype.gte=function(u){return this.cmp(u)>=0},a.prototype.ltn=function(u){return this.cmpn(u)===-1},a.prototype.lt=function(u){return this.cmp(u)===-1},a.prototype.lten=function(u){return this.cmpn(u)<=0},a.prototype.lte=function(u){return this.cmp(u)<=0},a.prototype.eqn=function(u){return this.cmpn(u)===0},a.prototype.eq=function(u){return this.cmp(u)===0},a.red=function(u){return new U(u)},a.prototype.toRed=function(u){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(u){return this.red=u,this},a.prototype.forceRed=function(u){return i(!this.red,"Already a number in reduction context"),this._forceRed(u)},a.prototype.redAdd=function(u){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},a.prototype.redIAdd=function(u){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},a.prototype.redSub=function(u){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},a.prototype.redISub=function(u){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},a.prototype.redShl=function(u){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},a.prototype.redMul=function(u){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},a.prototype.redIMul=function(u){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(u){return i(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var j={k256:null,p224:null,p192:null,p25519:null};function k(u,h){this.name=u,this.p=new a(h,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}k.prototype._tmp=function(){var u=new a(null);return u.words=new Array(Math.ceil(this.n/13)),u},k.prototype.ireduce=function(u){var h=u,v;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),v=h.bitLength();while(v>this.n);var E=v0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},k.prototype.split=function(u,h){u.iushrn(this.n,0,h)},k.prototype.imulK=function(u){return u.imul(this.k)};function _(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(_,k),_.prototype.split=function(u,h){for(var v=4194303,E=Math.min(u.length,9),S=0;S>>22,M=x}M>>>=22,u.words[S-10]=M,M===0&&u.length>10?u.length-=10:u.length-=9},_.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var h=0,v=0;v>>=26,u.words[v]=S,h=E}return h!==0&&(u.words[u.length++]=h),u},a._prime=function(u){if(j[u])return j[u];var h;if(u==="k256")h=new _;else if(u==="p224")h=new N;else if(u==="p192")h=new se;else if(u==="p25519")h=new le;else throw new Error("Unknown prime "+u);return j[u]=h,h};function U(u){if(typeof u=="string"){var h=a._prime(u);this.m=h.p,this.prime=h}else i(u.gtn(1),"modulus must be greater than 1"),this.m=u,this.prime=null}U.prototype._verify1=function(u){i(u.negative===0,"red works only with positives"),i(u.red,"red works only with red numbers")},U.prototype._verify2=function(u,h){i((u.negative|h.negative)===0,"red works only with positives"),i(u.red&&u.red===h.red,"red works only with red numbers")},U.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):(m(u,u.umod(this.m)._forceRed(this)),u)},U.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},U.prototype.add=function(u,h){this._verify2(u,h);var v=u.add(h);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},U.prototype.iadd=function(u,h){this._verify2(u,h);var v=u.iadd(h);return v.cmp(this.m)>=0&&v.isub(this.m),v},U.prototype.sub=function(u,h){this._verify2(u,h);var v=u.sub(h);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},U.prototype.isub=function(u,h){this._verify2(u,h);var v=u.isub(h);return v.cmpn(0)<0&&v.iadd(this.m),v},U.prototype.shl=function(u,h){return this._verify1(u),this.imod(u.ushln(h))},U.prototype.imul=function(u,h){return this._verify2(u,h),this.imod(u.imul(h))},U.prototype.mul=function(u,h){return this._verify2(u,h),this.imod(u.mul(h))},U.prototype.isqr=function(u){return this.imul(u,u.clone())},U.prototype.sqr=function(u){return this.mul(u,u)},U.prototype.sqrt=function(u){if(u.isZero())return u.clone();var h=this.m.andln(3);if(i(h%2===1),h===3){var v=this.m.add(new a(1)).iushrn(2);return this.pow(u,v)}for(var E=this.m.subn(1),S=0;!E.isZero()&&E.andln(1)===0;)S++,E.iushrn(1);i(!E.isZero());var M=new a(1).toRed(this),x=M.redNeg(),p=this.m.subn(1).iushrn(1),b=this.m.bitLength();for(b=new a(2*b*b).toRed(this);this.pow(b,p).cmp(x)!==0;)b.redIAdd(x);for(var R=this.pow(b,E),Z=this.pow(u,E.addn(1).iushrn(1)),ae=this.pow(u,E),I=S;ae.cmp(M)!==0;){for(var ee=ae,L=0;ee.cmp(M)!==0;L++)ee=ee.redSqr();i(L=0;S--){for(var R=h.words[S],Z=b-1;Z>=0;Z--){var ae=R>>Z&1;if(M!==E[0]&&(M=this.sqr(M)),ae===0&&x===0){p=0;continue}x<<=1,x|=ae,p++,!(p!==v&&(S!==0||Z!==0))&&(M=this.mul(M,E[x]),p=0,x=0)}b=26}return M},U.prototype.convertTo=function(u){var h=u.umod(this.m);return h===u?h.clone():h},U.prototype.convertFrom=function(u){var h=u.clone();return h.red=null,h},a.mont=function(u){return new y(u)};function y(u){U.call(this,u),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(y,U),y.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},y.prototype.convertFrom=function(u){var h=this.imod(u.mul(this.rinv));return h.red=null,h},y.prototype.imul=function(u,h){if(u.isZero()||h.isZero())return u.words[0]=0,u.length=1,u;var v=u.imul(h),E=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=v.isub(E).iushrn(this.shift),M=S;return S.cmp(this.m)>=0?M=S.isub(this.m):S.cmpn(0)<0&&(M=S.iadd(this.m)),M._forceRed(this)},y.prototype.mul=function(u,h){if(u.isZero()||h.isZero())return new a(0)._forceRed(this);var v=u.mul(h),E=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=v.isub(E).iushrn(this.shift),M=S;return S.cmp(this.m)>=0?M=S.isub(this.m):S.cmpn(0)<0&&(M=S.iadd(this.m)),M._forceRed(this)},y.prototype.invm=function(u){var h=this.imod(u._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(r,p3)})(m3);var bt=m3.exports;const y3="bignumber/5.7.0";var wf=bt.BN;const fs=new Mr(y3),Tl={},hg=9007199254740991;function rx(r){return r!=null&&(Gt.isBigNumber(r)||typeof r=="number"&&r%1===0||typeof r=="string"&&!!r.match(/^-?[0-9]+$/)||Ei(r)||typeof r=="bigint"||_o(r))}let lg=!1;class Gt{constructor(e,t){e!==Tl&&fs.throwError("cannot call constructor directly; use BigNumber.from",Mr.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return ai(It(this).fromTwos(e))}toTwos(e){return ai(It(this).toTwos(e))}abs(){return this._hex[0]==="-"?Gt.from(this._hex.substring(1)):this}add(e){return ai(It(this).add(It(e)))}sub(e){return ai(It(this).sub(It(e)))}div(e){return Gt.from(e).isZero()&&Ui("division-by-zero","div"),ai(It(this).div(It(e)))}mul(e){return ai(It(this).mul(It(e)))}mod(e){const t=It(e);return t.isNeg()&&Ui("division-by-zero","mod"),ai(It(this).umod(t))}pow(e){const t=It(e);return t.isNeg()&&Ui("negative-power","pow"),ai(It(this).pow(t))}and(e){const t=It(e);return(this.isNegative()||t.isNeg())&&Ui("unbound-bitwise-result","and"),ai(It(this).and(t))}or(e){const t=It(e);return(this.isNegative()||t.isNeg())&&Ui("unbound-bitwise-result","or"),ai(It(this).or(t))}xor(e){const t=It(e);return(this.isNegative()||t.isNeg())&&Ui("unbound-bitwise-result","xor"),ai(It(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Ui("negative-width","mask"),ai(It(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Ui("negative-width","shl"),ai(It(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Ui("negative-width","shr"),ai(It(this).shrn(e))}eq(e){return It(this).eq(It(e))}lt(e){return It(this).lt(It(e))}lte(e){return It(this).lte(It(e))}gt(e){return It(this).gt(It(e))}gte(e){return It(this).gte(It(e))}isNegative(){return this._hex[0]==="-"}isZero(){return It(this).isZero()}toNumber(){try{return It(this).toNumber()}catch{Ui("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return fs.throwError("this platform does not support BigInt",Mr.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?lg||(lg=!0,fs.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?fs.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Mr.errors.UNEXPECTED_ARGUMENT,{}):fs.throwError("BigNumber.toString does not accept parameters",Mr.errors.UNEXPECTED_ARGUMENT,{})),It(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Gt)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Gt(Tl,mc(e)):e.match(/^-?[0-9]+$/)?new Gt(Tl,mc(new wf(e))):fs.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Ui("underflow","BigNumber.from",e),(e>=hg||e<=-hg)&&Ui("overflow","BigNumber.from",e),Gt.from(String(e));const t=e;if(typeof t=="bigint")return Gt.from(t.toString());if(_o(t))return Gt.from(ui(t));if(t)if(t.toHexString){const i=t.toHexString();if(typeof i=="string")return Gt.from(i)}else{let i=t._hex;if(i==null&&t.type==="BigNumber"&&(i=t.hex),typeof i=="string"&&(Ei(i)||i[0]==="-"&&Ei(i.substring(1))))return Gt.from(i)}return fs.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function mc(r){if(typeof r!="string")return mc(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&fs.throwArgumentError("invalid hex","value",r),r=mc(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function ai(r){return Gt.from(mc(r))}function It(r){const e=Gt.from(r).toHexString();return e[0]==="-"?new wf("-"+e.substring(3),16):new wf(e.substring(2),16)}function Ui(r,e,t){const i={fault:r,operation:e};return t!=null&&(i.value=t),fs.throwError(r,Mr.errors.NUMERIC_FAULT,i)}function ix(r){return new wf(r,36).toString(16)}const Wr=new Mr(y3),hc={},w3=Gt.from(0),_3=Gt.from(-1);function D3(r,e,t,i){const n={fault:e,operation:t};return i!==void 0&&(n.value=i),Wr.throwError(r,Mr.errors.NUMERIC_FAULT,n)}let lc="0";for(;lc.length<256;)lc+=lc;function n0(r){if(typeof r!="number")try{r=Gt.from(r).toNumber()}catch{}return typeof r=="number"&&r>=0&&r<=256&&!(r%1)?"1"+lc.substring(0,r):Wr.throwArgumentError("invalid decimal size","decimals",r)}function Rl(r,e){e==null&&(e=0);const t=n0(e);r=Gt.from(r);const i=r.lt(w3);i&&(r=r.mul(_3));let n=r.mod(t).toString();for(;n.length2&&Wr.throwArgumentError("too many decimal points","value",r);let a=n[0],c=n[1];for(a||(a="0"),c||(c="0");c[c.length-1]==="0";)c=c.substring(0,c.length-1);for(c.length>t.length-1&&D3("fractional component exceeds decimals","underflow","parseFixed"),c===""&&(c="0");c.lengthe[c]==null?g:(typeof e[c]!==f&&Wr.throwArgumentError("invalid fixed format ("+c+" not "+f+")","format."+c,e[c]),e[c]);t=a("signed","boolean",t),i=a("width","number",i),n=a("decimals","number",n)}return i%8&&Wr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",i),n>80&&Wr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new wd(hc,t,i,n)}},E3=class Gr{constructor(e,t,i,n){e!==hc&&Wr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Mr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Wr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=as(this._value,this.format.decimals),i=as(e._value,e.format.decimals);return Gr.fromValue(t.add(i),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=as(this._value,this.format.decimals),i=as(e._value,e.format.decimals);return Gr.fromValue(t.sub(i),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=as(this._value,this.format.decimals),i=as(e._value,e.format.decimals);return Gr.fromValue(t.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=as(this._value,this.format.decimals),i=as(e._value,e.format.decimals);return Gr.fromValue(t.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=Gr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return this.isNegative()&&i&&(t=t.subUnsafe(dg.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=Gr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return!this.isNegative()&&i&&(t=t.addUnsafe(dg.toFormat(t.format))),t}round(e){e==null&&(e=0);const t=this.toString().split(".");if(t.length===1&&t.push("0"),(e<0||e>80||e%1)&&Wr.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const i=Gr.from("1"+lc.substring(0,e),this.format),n=nx.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(n).floor().divUnsafe(i)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Wr.throwArgumentError("invalid byte width","width",e);const t=Gt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return $n(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Gr.fromString(this._value,e)}static fromValue(e,t,i){return i==null&&t!=null&&!rx(t)&&(i=t,t=null),t==null&&(t=0),i==null&&(i="fixed"),Gr.fromString(Rl(e,t),Nl.from(i))}static fromString(e,t){t==null&&(t="fixed");const i=Nl.from(t),n=as(e,i.decimals);!i.signed&&n.lt(w3)&&D3("unsigned value cannot be negative","overflow","value",e);let a=null;i.signed?a=n.toTwos(i.width).toHexString():(a=n.toHexString(),a=$n(a,i.width/8));const c=Rl(n,i.decimals);return new Gr(hc,a,c,i)}static fromBytes(e,t){t==null&&(t="fixed");const i=Nl.from(t);if(ir(e).length>i.width/8)throw new Error("overflow");let n=Gt.from(e);i.signed&&(n=n.fromTwos(i.width));const a=n.toTwos((i.signed?0:1)+i.width).toHexString(),c=Rl(n,i.decimals);return new Gr(hc,a,c,i)}static from(e,t){if(typeof e=="string")return Gr.fromString(e,t);if(_o(e))return Gr.fromBytes(e,t);try{return Gr.fromValue(e,0,t)}catch(i){if(i.code!==Mr.errors.INVALID_ARGUMENT)throw i}return Wr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}};const dg=E3.from(1),nx=E3.from("0.5"),sx="strings/5.7.0",ax=new Mr(sx);var _f;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(_f||(_f={}));var pg;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(pg||(pg={}));function Bl(r,e=_f.current){e!=_f.current&&(ax.checkNormalize(),r=r.normalize(e));let t=[];for(let i=0;i>6|192),t.push(n&63|128);else if((n&64512)==55296){i++;const a=r.charCodeAt(i);if(i>=r.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");const c=65536+((n&1023)<<10)+(a&1023);t.push(c>>18|240),t.push(c>>12&63|128),t.push(c>>6&63|128),t.push(c&63|128)}else t.push(n>>12|224),t.push(n>>6&63|128),t.push(n&63|128)}return ir(t)}function ox(r){if(r.length%4!==0)throw new Error("bad data");let e=[];for(let t=0;t{let a=n.split(":");t+=parseInt(a[0],16),i[t]=e(a[1])}),i}function gg(r){let e=0;return r.split(",").map(t=>{let i=t.split("-");i.length===1?i[1]="0":i[1]===""&&(i[1]="1");let n=e+parseInt(i[0],16);return e=parseInt(i[1],16),{l:n,h:e}})}gg("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(r=>parseInt(r,16)),$l("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),$l("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),$l("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",ox),gg("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function cx(r){r=atob(r);const e=[];for(let t=0;t0&&Array.isArray(f)?n(f,c-1):t.push(f)})};return n(r,e),t}function ux(r){const e={};for(let t=0;t>--g&1}const w=31,O=Math.pow(2,w),C=O>>>1,P=C>>1,q=O-1;let K=0;for(let j=0;j1;){let le=k+_>>>1;j>>1|m(),N=N<<1^C,se=(se^C)<<1|C|1;z=N,W=1+se-N}let B=i-4;return Y.map(j=>{switch(j-B){case 3:return B+65792+(r[f++]<<16|r[f++]<<8|r[f++]);case 2:return B+256+(r[f++]<<8|r[f++]);case 1:return B+r[f++];default:return j-1}})}function hx(r){let e=0;return()=>r[e++]}function lx(r){return hx(fx(r))}function dx(r){return r&1?~r>>1:r>>1}function px(r,e){let t=Array(r);for(let i=0;ie[c]):t}function bx(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(mx(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(yx(t,r))}return ux(A3(e))}function vx(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(t)}return e}function x3(r,e,t){let i=Array(r).fill(void 0).map(()=>[]);for(let n=0;ni[c].push(a));return i}function mx(r,e){let t=1+e(),i=e(),n=vx(e),a=x3(n.length,1+r,e);return A3(a.map((c,f)=>{const g=c[0],d=c.slice(1);return Array(n[f]).fill(void 0).map((m,w)=>{let O=w*i;return[g+w*t,d.map(C=>C+O)]})}))}function yx(r,e){let t=1+e();return x3(t,1+r,e).map(i=>[i[0],i.slice(1)])}function wx(r){let e=Df(r).sort((i,n)=>i-n);return t();function t(){let i=[];for(;;){let d=Df(r,e);if(d.length==0)break;i.push({set:new Set(d),node:t()})}i.sort((d,m)=>m.set.size-d.set.size);let n=r(),a=n%3;n=n/3|0;let c=!!(n&1);n>>=1;let f=n==1,g=n==2;return{branches:i,valid:a,fe0f:c,save:f,check:g}}}function _x(){return lx(cx("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Hu=_x();new Set(Df(Hu)),new Set(Df(Hu)),bx(Hu),wx(Hu);const Dx=new Uint8Array(32);Dx.fill(0);const Ex=`Ethereum Signed Message: +`;function S3(r){return typeof r=="string"&&(r=Bl(r)),i0(YA([Bl(Ex),Bl(String(r.length)),r]))}const Ax="address/5.7.0",oc=new Mr(Ax);function vg(r){Ei(r,20)||oc.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const e=r.substring(2).split(""),t=new Uint8Array(40);for(let n=0;n<40;n++)t[n]=e[n].charCodeAt(0);const i=ir(i0(t));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(i[n>>1]&15)>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}const xx=9007199254740991;function Sx(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const s0={};for(let r=0;r<10;r++)s0[String(r)]=String(r);for(let r=0;r<26;r++)s0[String.fromCharCode(65+r)]=String(10+r);const mg=Math.floor(Sx(xx));function Mx(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(i=>s0[i]).join("");for(;e.length>=mg;){let i=e.substring(0,mg);e=parseInt(i,10)%97+e.substring(i.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}function Ix(r){let e=null;if(typeof r!="string"&&oc.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=vg(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&oc.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==Mx(r)&&oc.throwArgumentError("bad icap checksum","address",r),e=ix(r.substring(4));e.length<40;)e="0"+e;e=vg("0x"+e)}else oc.throwArgumentError("invalid address","address",r);return e}function Qo(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}const Cx=new Uint8Array(32);Cx.fill(0),Gt.from(-1);const Px=Gt.from(0),Ox=Gt.from(1);Gt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),$n(Ox.toHexString(),32),$n(Px.toHexString(),32);var Mn={},Pt={},Rc=M3;function M3(r,e){if(!r)throw new Error(e||"Assertion failed")}M3.equal=function(r,e,t){if(r!=e)throw new Error(t||"Assertion failed: "+r+" != "+e)};var _d={exports:{}};typeof Object.create=="function"?_d.exports=function(r,e){e&&(r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:_d.exports=function(r,e){if(e){r.super_=e;var t=function(){};t.prototype=e.prototype,r.prototype=new t,r.prototype.constructor=r}};var Tx=Rc,Rx=_d.exports;Pt.inherits=Rx;function Nx(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}function Bx(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),n=0;n>6|192,t[i++]=a&63|128):Nx(r,n)?(a=65536+((a&1023)<<10)+(r.charCodeAt(++n)&1023),t[i++]=a>>18|240,t[i++]=a>>12&63|128,t[i++]=a>>6&63|128,t[i++]=a&63|128):(t[i++]=a>>12|224,t[i++]=a>>6&63|128,t[i++]=a&63|128)}else for(n=0;n>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}Pt.htonl=I3;function Ux(r,e){for(var t="",i=0;i>>0}return a}Pt.join32=qx;function Lx(r,e){for(var t=new Array(r.length*4),i=0,n=0;i>>24,t[n+1]=a>>>16&255,t[n+2]=a>>>8&255,t[n+3]=a&255):(t[n+3]=a>>>24,t[n+2]=a>>>16&255,t[n+1]=a>>>8&255,t[n]=a&255)}return t}Pt.split32=Lx;function Fx(r,e){return r>>>e|r<<32-e}Pt.rotr32=Fx;function zx(r,e){return r<>>32-e}Pt.rotl32=zx;function jx(r,e){return r+e>>>0}Pt.sum32=jx;function kx(r,e,t){return r+e+t>>>0}Pt.sum32_3=kx;function Hx(r,e,t,i){return r+e+t+i>>>0}Pt.sum32_4=Hx;function Kx(r,e,t,i,n){return r+e+t+i+n>>>0}Pt.sum32_5=Kx;function Vx(r,e,t,i){var n=r[e],a=r[e+1],c=i+a>>>0,f=(c>>0,r[e+1]=c}Pt.sum64=Vx;function Gx(r,e,t,i){var n=e+i>>>0,a=(n>>0}Pt.sum64_hi=Gx;function Jx(r,e,t,i){var n=e+i;return n>>>0}Pt.sum64_lo=Jx;function Wx(r,e,t,i,n,a,c,f){var g=0,d=e;d=d+i>>>0,g+=d>>0,g+=d>>0,g+=d>>0}Pt.sum64_4_hi=Wx;function Yx(r,e,t,i,n,a,c,f){var g=e+i+a+f;return g>>>0}Pt.sum64_4_lo=Yx;function Qx(r,e,t,i,n,a,c,f,g,d){var m=0,w=e;w=w+i>>>0,m+=w>>0,m+=w>>0,m+=w>>0,m+=w>>0}Pt.sum64_5_hi=Qx;function Xx(r,e,t,i,n,a,c,f,g,d){var m=e+i+a+f+d;return m>>>0}Pt.sum64_5_lo=Xx;function Zx(r,e,t){var i=e<<32-t|r>>>t;return i>>>0}Pt.rotr64_hi=Zx;function eS(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Pt.rotr64_lo=eS;function tS(r,e,t){return r>>>t}Pt.shr64_hi=tS;function rS(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Pt.shr64_lo=rS;var Do={},yg=Pt,iS=Rc;function Ku(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Do.BlockHash=Ku,Ku.prototype.update=function(r,e){if(r=yg.toArray(r,e),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){r=this.pending;var t=r.length%this._delta8;this.pending=r.slice(r.length-t,r.length),this.pending.length===0&&(this.pending=null),r=yg.join32(r,0,r.length-t,this.endian);for(var i=0;i>>24&255,i[n++]=r>>>16&255,i[n++]=r>>>8&255,i[n++]=r&255}else for(i[n++]=r&255,i[n++]=r>>>8&255,i[n++]=r>>>16&255,i[n++]=r>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;a>>3}Jn.g0_256=cS;function uS(r){return Un(r,17)^Un(r,19)^r>>>10}Jn.g1_256=uS;var uo=Pt,fS=Do,hS=Jn,Ul=uo.rotl32,Xo=uo.sum32,lS=uo.sum32_5,dS=hS.ft_1,N3=fS.BlockHash,pS=[1518500249,1859775393,2400959708,3395469782];function On(){if(!(this instanceof On))return new On;N3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}uo.inherits(On,N3);var gS=On;On.blockSize=512,On.outSize=160,On.hmacStrength=80,On.padLength=64,On.prototype._update=function(r,e){for(var t=this.W,i=0;i<16;i++)t[i]=r[e+i];for(;ithis.blockSize&&(r=new this.Hash().update(r).digest()),rM(r.length<=this.blockSize);for(var e=r.length;e>8,O=m&255;w?g.push(w,O):g.push(O)}return g}t.toArray=i;function n(c){return c.length===1?"0"+c:c}t.zero2=n;function a(c){for(var f="",g=0;g(O>>1)-1?q=(O>>1)-K:q=K,C.isubn(q)):q=0,w[P]=q,C.iushrn(1)}return w}t.getNAF=i;function n(g,d){var m=[[],[]];g=g.clone(),d=d.clone();for(var w=0,O=0,C;g.cmpn(-w)>0||d.cmpn(-O)>0;){var P=g.andln(3)+w&3,q=d.andln(3)+O&3;P===3&&(P=-1),q===3&&(q=-1);var K;P&1?(C=g.andln(7)+w&7,(C===3||C===5)&&q===2?K=-P:K=P):K=0,m[0].push(K);var Y;q&1?(C=d.andln(7)+O&7,(C===3||C===5)&&P===2?Y=-q:Y=q):Y=0,m[1].push(Y),2*w===K+1&&(w=1-w),2*O===Y+1&&(O=1-O),g.iushrn(1),d.iushrn(1)}return m}t.getJSF=n;function a(g,d,m){var w="_"+d;g.prototype[d]=function(){return this[w]!==void 0?this[w]:this[w]=m.call(this)}}t.cachedProperty=a;function c(g){return typeof g=="string"?t.toArray(g,"hex"):g}t.parseBytes=c;function f(g){return new bt(g,"hex","le")}t.intFromLE=f}),Gu=Ai.getNAF,sM=Ai.getJSF,Ef=Ai.assert;function $s(r,e){this.type=r,this.p=new bt(e.p,16),this.red=e.prime?bt.red(e.prime):bt.mont(this.p),this.zero=new bt(0).toRed(this.red),this.one=new bt(1).toRed(this.red),this.two=new bt(2).toRed(this.red),this.n=e.n&&new bt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Aa=$s;$s.prototype.point=function(){throw new Error("Not implemented")},$s.prototype.validate=function(){throw new Error("Not implemented")},$s.prototype._fixedNafMul=function(r,e){Ef(r.precomputed);var t=r._getDoubles(),i=Gu(e,1,this._bitLength),n=(1<=c;g--)f=(f<<1)+i[g];a.push(f)}for(var d=this.jpoint(null,null,null),m=this.jpoint(null,null,null),w=n;w>0;w--){for(c=0;c=0;f--){for(var g=0;f>=0&&a[f]===0;f--)g++;if(f>=0&&g++,c=c.dblp(g),f<0)break;var d=a[f];Ef(d!==0),r.type==="affine"?d>0?c=c.mixedAdd(n[d-1>>1]):c=c.mixedAdd(n[-d-1>>1].neg()):d>0?c=c.add(n[d-1>>1]):c=c.add(n[-d-1>>1].neg())}return r.type==="affine"?c.toP():c},$s.prototype._wnafMulAdd=function(r,e,t,i,n){var a=this._wnafT1,c=this._wnafT2,f=this._wnafT3,g=0,d,m,w;for(d=0;d=1;d-=2){var C=d-1,P=d;if(a[C]!==1||a[P]!==1){f[C]=Gu(t[C],a[C],this._bitLength),f[P]=Gu(t[P],a[P],this._bitLength),g=Math.max(f[C].length,g),g=Math.max(f[P].length,g);continue}var q=[e[C],null,null,e[P]];e[C].y.cmp(e[P].y)===0?(q[1]=e[C].add(e[P]),q[2]=e[C].toJ().mixedAdd(e[P].neg())):e[C].y.cmp(e[P].y.redNeg())===0?(q[1]=e[C].toJ().mixedAdd(e[P]),q[2]=e[C].add(e[P].neg())):(q[1]=e[C].toJ().mixedAdd(e[P]),q[2]=e[C].toJ().mixedAdd(e[P].neg()));var K=[-3,-1,-5,-7,0,7,5,1,3],Y=sM(t[C],t[P]);for(g=Math.max(Y[0].length,g),f[C]=new Array(g),f[P]=new Array(g),m=0;m=0;d--){for(var k=0;d>=0;){var _=!0;for(m=0;m=0&&k++,B=B.dblp(k),d<0)break;for(m=0;m0?w=c[m][N-1>>1]:N<0&&(w=c[m][-N-1>>1].neg()),w.type==="affine"?B=B.mixedAdd(w):B=B.add(w))}}for(d=0;d=Math.ceil((r.bitLength()+1)/e.step):!1},qi.prototype._getDoubles=function(r,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],i=this,n=0;n=0&&(O=g,C=d),m.negative&&(m=m.neg(),w=w.neg()),O.negative&&(O=O.neg(),C=C.neg()),[{a:m,b:w},{a:O,b:C}]},ki.prototype._endoSplit=function(r){var e=this.endo.basis,t=e[0],i=e[1],n=i.b.mul(r).divRound(this.n),a=t.b.neg().mul(r).divRound(this.n),c=n.mul(t.a),f=a.mul(i.a),g=n.mul(t.b),d=a.mul(i.b),m=r.sub(c).sub(f),w=g.add(d).neg();return{k1:m,k2:w}},ki.prototype.pointFromX=function(r,e){r=new bt(r,16),r.red||(r=r.toRed(this.red));var t=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),i=t.redSqrt();if(i.redSqr().redSub(t).cmp(this.zero)!==0)throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(r,i)},ki.prototype.validate=function(r){if(r.inf)return!0;var e=r.x,t=r.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return t.redSqr().redISub(n).cmpn(0)===0},ki.prototype._endoWnafMulAdd=function(r,e,t){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},yr.prototype.isInfinity=function(){return this.inf},yr.prototype.add=function(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(this.x.cmp(r.x)===0)return this.curve.point(null,null);var e=this.y.redSub(r.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(r.x).redInvm()));var t=e.redSqr().redISub(this.x).redISub(r.x),i=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,i)},yr.prototype.dbl=function(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(r.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,t=this.x.redSqr(),i=r.redInvm(),n=t.redAdd(t).redIAdd(t).redIAdd(e).redMul(i),a=n.redSqr().redISub(this.x.redAdd(this.x)),c=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,c)},yr.prototype.getX=function(){return this.x.fromRed()},yr.prototype.getY=function(){return this.y.fromRed()},yr.prototype.mul=function(r){return r=new bt(r,16),this.isInfinity()?this:this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)},yr.prototype.mulAdd=function(r,e,t){var i=[this,e],n=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},yr.prototype.jmulAdd=function(r,e,t){var i=[this,e],n=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},yr.prototype.eq=function(r){return this===r||this.inf===r.inf&&(this.inf||this.x.cmp(r.x)===0&&this.y.cmp(r.y)===0)},yr.prototype.neg=function(r){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var t=this.precomputed,i=function(n){return n.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e},yr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var r=this.curve.jpoint(this.x,this.y,this.curve.one);return r};function Sr(r,e,t,i){Aa.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new bt(0)):(this.x=new bt(e,16),this.y=new bt(t,16),this.z=new bt(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o0(Sr,Aa.BasePoint),ki.prototype.jpoint=function(r,e,t){return new Sr(this,r,e,t)},Sr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),e=r.redSqr(),t=this.x.redMul(e),i=this.y.redMul(e).redMul(r);return this.curve.point(t,i)},Sr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Sr.prototype.add=function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var e=r.z.redSqr(),t=this.z.redSqr(),i=this.x.redMul(e),n=r.x.redMul(t),a=this.y.redMul(e.redMul(r.z)),c=r.y.redMul(t.redMul(this.z)),f=i.redSub(n),g=a.redSub(c);if(f.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var d=f.redSqr(),m=d.redMul(f),w=i.redMul(d),O=g.redSqr().redIAdd(m).redISub(w).redISub(w),C=g.redMul(w.redISub(O)).redISub(a.redMul(m)),P=this.z.redMul(r.z).redMul(f);return this.curve.jpoint(O,C,P)},Sr.prototype.mixedAdd=function(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var e=this.z.redSqr(),t=this.x,i=r.x.redMul(e),n=this.y,a=r.y.redMul(e).redMul(this.z),c=t.redSub(i),f=n.redSub(a);if(c.cmpn(0)===0)return f.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=c.redSqr(),d=g.redMul(c),m=t.redMul(g),w=f.redSqr().redIAdd(d).redISub(m).redISub(m),O=f.redMul(m.redISub(w)).redISub(n.redMul(d)),C=this.z.redMul(c);return this.curve.jpoint(w,O,C)},Sr.prototype.dblp=function(r){if(r===0)return this;if(this.isInfinity())return this;if(!r)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var t=this;for(e=0;e=0)return!1;if(t.redIAdd(n),this.x.cmp(t)===0)return!0}},Sr.prototype.inspect=function(){return this.isInfinity()?"":""},Sr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var sf=Ao(function(r,e){var t=e;t.base=Aa,t.short=oM,t.mont=null,t.edwards=null}),af=Ao(function(r,e){var t=e,i=Ai.assert;function n(f){f.type==="short"?this.curve=new sf.short(f):f.type==="edwards"?this.curve=new sf.edwards(f):this.curve=new sf.mont(f),this.g=this.curve.g,this.n=this.curve.n,this.hash=f.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=n;function a(f,g){Object.defineProperty(t,f,{configurable:!0,enumerable:!0,get:function(){var d=new n(g);return Object.defineProperty(t,f,{configurable:!0,enumerable:!0,value:d}),d}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Mn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Mn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Mn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Mn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Mn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Mn.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Mn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Mn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function Us(r){if(!(this instanceof Us))return new Us(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=pn.toArray(r.entropy,r.entropyEnc||"hex"),t=pn.toArray(r.nonce,r.nonceEnc||"hex"),i=pn.toArray(r.pers,r.persEnc||"hex");a0(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}var Eg=Us;Us.prototype._init=function(r,e,t){var i=r.concat(e).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(r.concat(t||[])),this._reseed=1},Us.prototype.generate=function(r,e,t,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(i=t,t=e,e=null),t&&(t=pn.toArray(t,i||"hex"),this._update(t));for(var n=[];n.length"};var cM=Ai.assert;function Qf(r,e){if(r instanceof Qf)return r;this._importDER(r,e)||(cM(r.r&&r.s,"Signature without r or s"),this.r=new bt(r.r,16),this.s=new bt(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var Ju=Qf;function uM(){this.place=0}function jl(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4)return!1;for(var n=0,a=0,c=e.place;a>>=0;return n<=127?!1:(e.place=c,n)}function Ag(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}Qf.prototype.toDER=function(r){var e=this.r.toArray(),t=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),t[0]&128&&(t=[0].concat(t)),e=Ag(e),t=Ag(t);!t[0]&&!(t[1]&128);)t=t.slice(1);var i=[2];kl(i,e.length),i=i.concat(e),i.push(2),kl(i,t.length);var n=i.concat(t),a=[48];return kl(a,n.length),a=a.concat(n),Ai.encode(a,r)};var fM=function(){throw new Error("unsupported")},V3=Ai.assert;function zi(r){if(!(this instanceof zi))return new zi(r);typeof r=="string"&&(V3(Object.prototype.hasOwnProperty.call(af,r),"Unknown curve "+r),r=af[r]),r instanceof af.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var hM=zi;zi.prototype.keyPair=function(r){return new zl(this,r)},zi.prototype.keyFromPrivate=function(r,e){return zl.fromPrivate(this,r,e)},zi.prototype.keyFromPublic=function(r,e){return zl.fromPublic(this,r,e)},zi.prototype.genKeyPair=function(r){r||(r={});for(var e=new Eg({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||fM(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),i=this.n.sub(new bt(2));;){var n=new bt(e.generate(t));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},zi.prototype._truncateToN=function(r,e){var t=r.byteLength()*8-this.n.bitLength();return t>0&&(r=r.ushrn(t)),!e&&r.cmp(this.n)>=0?r.sub(this.n):r},zi.prototype.sign=function(r,e,t,i){typeof t=="object"&&(i=t,t=null),i||(i={}),e=this.keyFromPrivate(e,t),r=this._truncateToN(new bt(r,16));for(var n=this.n.byteLength(),a=e.getPrivate().toArray("be",n),c=r.toArray("be",n),f=new Eg({hash:this.hash,entropy:a,nonce:c,pers:i.pers,persEnc:i.persEnc||"utf8"}),g=this.n.sub(new bt(1)),d=0;;d++){var m=i.k?i.k(d):new bt(f.generate(this.n.byteLength()));if(m=this._truncateToN(m,!0),!(m.cmpn(1)<=0||m.cmp(g)>=0)){var w=this.g.mul(m);if(!w.isInfinity()){var O=w.getX(),C=O.umod(this.n);if(C.cmpn(0)!==0){var P=m.invm(this.n).mul(C.mul(e.getPrivate()).iadd(r));if(P=P.umod(this.n),P.cmpn(0)!==0){var q=(w.getY().isOdd()?1:0)|(O.cmp(C)!==0?2:0);return i.canonical&&P.cmp(this.nh)>0&&(P=this.n.sub(P),q^=1),new Ju({r:C,s:P,recoveryParam:q})}}}}}},zi.prototype.verify=function(r,e,t,i){r=this._truncateToN(new bt(r,16)),t=this.keyFromPublic(t,i),e=new Ju(e,"hex");var n=e.r,a=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),f=c.mul(r).umod(this.n),g=c.mul(n).umod(this.n),d;return this.curve._maxwellTrick?(d=this.g.jmulAdd(f,t.getPublic(),g),d.isInfinity()?!1:d.eqXToP(n)):(d=this.g.mulAdd(f,t.getPublic(),g),d.isInfinity()?!1:d.getX().umod(this.n).cmp(n)===0)},zi.prototype.recoverPubKey=function(r,e,t,i){V3((3&t)===t,"The recovery param is more than two bits"),e=new Ju(e,i);var n=this.n,a=new bt(r),c=e.r,f=e.s,g=t&1,d=t>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");d?c=this.curve.pointFromX(c.add(this.curve.n),g):c=this.curve.pointFromX(c,g);var m=e.r.invm(n),w=n.sub(a).mul(m).umod(n),O=f.mul(m).umod(n);return this.g.mulAdd(w,c,O)},zi.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new Ju(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(r,e,n)}catch{continue}if(a.eq(t))return n}throw new Error("Unable to find valid recovery factor")};var lM=Ao(function(r,e){var t=e;t.version="6.5.4",t.utils=Ai,t.rand=function(){throw new Error("unsupported")},t.curve=sf,t.curves=af,t.ec=hM,t.eddsa=null}),dM=lM.ec;const pM="signing-key/5.7.0",Ad=new Mr(pM);let Hl=null;function Ns(){return Hl||(Hl=new dM("secp256k1")),Hl}class gM{constructor(e){Qo(this,"curve","secp256k1"),Qo(this,"privateKey",ui(e)),XA(this.privateKey)!==32&&Ad.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Ns().keyFromPrivate(ir(this.privateKey));Qo(this,"publicKey","0x"+t.getPublic(!1,"hex")),Qo(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Qo(this,"_isSigningKey",!0)}_addPoint(e){const t=Ns().keyFromPublic(ir(this.publicKey)),i=Ns().keyFromPublic(ir(e));return"0x"+t.pub.add(i.pub).encodeCompressed("hex")}signDigest(e){const t=Ns().keyFromPrivate(ir(this.privateKey)),i=ir(e);i.length!==32&&Ad.throwArgumentError("bad digest length","digest",e);const n=t.sign(i,{canonical:!0});return v3({recoveryParam:n.recoveryParam,r:$n("0x"+n.r.toString(16),32),s:$n("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=Ns().keyFromPrivate(ir(this.privateKey)),i=Ns().keyFromPublic(ir(G3(e)));return $n("0x"+t.derive(i.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function bM(r,e){const t=v3(e),i={r:ir(t.r),s:ir(t.s)};return"0x"+Ns().recoverPubKey(ir(r),i,t.recoveryParam).encode("hex",!1)}function G3(r,e){const t=ir(r);return t.length===32?new gM(t).publicKey:t.length===33?"0x"+Ns().keyFromPublic(t).getPublic(!1,"hex"):t.length===65?ui(t):Ad.throwArgumentError("invalid public or private key","key","[REDACTED]")}var xg;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(xg||(xg={}));function vM(r){const e=G3(r);return Ix(fg(i0(fg(e,1)),12))}function mM(r,e){return vM(bM(ir(r),e))}const yM="https://rpc.walletconnect.org/v1";async function wM(r,e,t,i,n,a){switch(t.t){case"eip191":return _M(r,e,t.s);case"eip1271":return await DM(r,e,t.s,i,n,a);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${t.t}`)}}function _M(r,e,t){return mM(S3(e),t).toLowerCase()===r.toLowerCase()}async function DM(r,e,t,i,n,a){try{const c="0x1626ba7e",f="0000000000000000000000000000000000000000000000000000000000000040",g="0000000000000000000000000000000000000000000000000000000000000041",d=t.substring(2),m=S3(e).substring(2),w=c+m+f+g+d,O=await fetch(`${a||yM}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:EM(),jsonrpc:"2.0",method:"eth_call",params:[{to:r,data:w},"latest"]})}),{result:C}=await O.json();return C?C.slice(0,c.length).toLowerCase()===c.toLowerCase():!1}catch(c){return console.error("isValidEip1271Signature: ",c),!1}}function EM(){return Date.now()+Math.floor(Math.random()*1e3)}var AM=Object.defineProperty,xM=Object.defineProperties,SM=Object.getOwnPropertyDescriptors,Sg=Object.getOwnPropertySymbols,MM=Object.prototype.hasOwnProperty,IM=Object.prototype.propertyIsEnumerable,Mg=(r,e,t)=>e in r?AM(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,CM=(r,e)=>{for(var t in e||(e={}))MM.call(e,t)&&Mg(r,t,e[t]);if(Sg)for(var t of Sg(e))IM.call(e,t)&&Mg(r,t,e[t]);return r},PM=(r,e)=>xM(r,SM(e));const OM="did:pkh:",c0=r=>r==null?void 0:r.split(":"),J3=r=>{const e=r&&c0(r);if(e)return r.includes(OM)?e[3]:e[1]},Ig=r=>{const e=r&&c0(r);if(e)return e[2]+":"+e[3]},Af=r=>{const e=r&&c0(r);if(e)return e.pop()};async function Cg(r){const{cacao:e,projectId:t}=r,{s:i,p:n}=e,a=W3(n,n.iss),c=Af(n.iss);return await wM(c,a,i,J3(n.iss),t)}const W3=(r,e)=>{const t=`${r.domain} wants you to sign in with your Ethereum account:`,i=Af(e);if(!r.aud&&!r.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=r.statement||void 0;const a=`URI: ${r.aud||r.uri}`,c=`Version: ${r.version}`,f=`Chain ID: ${J3(e)}`,g=`Nonce: ${r.nonce}`,d=`Issued At: ${r.iat}`,m=r.exp?`Expiration Time: ${r.exp}`:void 0,w=r.nbf?`Not Before: ${r.nbf}`:void 0,O=r.requestId?`Request ID: ${r.requestId}`:void 0,C=r.resources?`Resources:${r.resources.map(q=>` +- ${q}`).join("")}`:void 0,P=of(r.resources);if(P){const q=yc(P);n=FM(n,q)}return[t,i,"",n,"",a,c,f,g,d,m,w,O,C].filter(q=>q!=null).join(` +`)};function TM(r){return Buffer.from(JSON.stringify(r)).toString("base64")}function RM(r){return JSON.parse(Buffer.from(r,"base64").toString("utf-8"))}function ya(r){if(!r)throw new Error("No recap provided, value is undefined");if(!r.att)throw new Error("No `att` property found");const e=Object.keys(r.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(t=>{const i=r.att[t];if(Array.isArray(i))throw new Error(`Resource must be an object: ${t}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${t}`);Object.keys(i).forEach(n=>{const a=i[n];if(!Array.isArray(a))throw new Error(`Ability limits ${n} must be an array of objects, found: ${a}`);if(!a.length)throw new Error(`Value of ${n} is empty array, must be an array with objects`);a.forEach(c=>{if(typeof c!="object")throw new Error(`Ability limits (${n}) must be an array of objects, found: ${c}`)})})})}function NM(r,e,t,i={}){return t==null||t.sort((n,a)=>n.localeCompare(a)),{att:{[r]:BM(e,t,i)}}}function BM(r,e,t={}){e=e==null?void 0:e.sort((n,a)=>n.localeCompare(a));const i=e.map(n=>({[`${r}/${n}`]:[t]}));return Object.assign({},...i)}function Y3(r){return ya(r),`urn:recap:${TM(r).replace(/=/g,"")}`}function yc(r){const e=RM(r.replace("urn:recap:",""));return ya(e),e}function $M(r,e,t){const i=NM(r,e,t);return Y3(i)}function UM(r){return r&&r.includes("urn:recap:")}function qM(r,e){const t=yc(r),i=yc(e),n=LM(t,i);return Y3(n)}function LM(r,e){ya(r),ya(e);const t=Object.keys(r.att).concat(Object.keys(e.att)).sort((n,a)=>n.localeCompare(a)),i={att:{}};return t.forEach(n=>{var a,c;Object.keys(((a=r.att)==null?void 0:a[n])||{}).concat(Object.keys(((c=e.att)==null?void 0:c[n])||{})).sort((f,g)=>f.localeCompare(g)).forEach(f=>{var g,d;i.att[n]=PM(CM({},i.att[n]),{[f]:((g=r.att[n])==null?void 0:g[f])||((d=e.att[n])==null?void 0:d[f])})})}),i}function FM(r="",e){ya(e);const t="I further authorize the stated URI to perform the following actions on my behalf: ";if(r.includes(t))return r;const i=[];let n=0;Object.keys(e.att).forEach(f=>{const g=Object.keys(e.att[f]).map(w=>({ability:w.split("/")[0],action:w.split("/")[1]}));g.sort((w,O)=>w.action.localeCompare(O.action));const d={};g.forEach(w=>{d[w.ability]||(d[w.ability]=[]),d[w.ability].push(w.action)});const m=Object.keys(d).map(w=>(n++,`(${n}) '${w}': '${d[w].join("', '")}' for '${f}'.`));i.push(m.join(", ").replace(".,","."))});const a=i.join(" "),c=`${t}${a}`;return`${r?r+" ":""}${c}`}function Pg(r){var e;const t=yc(r);ya(t);const i=(e=t.att)==null?void 0:e.eip155;return i?Object.keys(i).map(n=>n.split("/")[1]):[]}function Og(r){const e=yc(r);ya(e);const t=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(n=>{var a;(a=n==null?void 0:n[0])!=null&&a.chains&&t.push(n[0].chains)})}),[...new Set(t.flat())]}function of(r){if(!r)return;const e=r==null?void 0:r[r.length-1];return UM(e)?e:void 0}const Q3="base10",Yr="base16",Ls="base64pad",ec="base64url",Nc="utf8",X3=0,bs=1,Bc=2,zM=0,Tg=1,dc=12,u0=32;function jM(){const r=Vd.generateKeyPair();return{privateKey:Di(r.secretKey,Yr),publicKey:Di(r.publicKey,Yr)}}function xd(){const r=ks.randomBytes(u0);return Di(r,Yr)}function kM(r,e){const t=Vd.sharedKey(Hi(r,Yr),Hi(e,Yr),!0),i=new V_(Sc.SHA256,t).expand(u0);return Di(i,Yr)}function cf(r){const e=Sc.hash(Hi(r,Yr));return Di(e,Yr)}function hs(r){const e=Sc.hash(Hi(r,Nc));return Di(e,Yr)}function Z3(r){return Hi(`${r}`,Q3)}function wa(r){return Number(Di(r,Q3))}function HM(r){const e=Z3(typeof r.type<"u"?r.type:X3);if(wa(e)===bs&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?Hi(r.senderPublicKey,Yr):void 0,i=typeof r.iv<"u"?Hi(r.iv,Yr):ks.randomBytes(dc),n=new Hd.ChaCha20Poly1305(Hi(r.symKey,Yr)).seal(i,Hi(r.message,Nc));return e2({type:e,sealed:n,iv:i,senderPublicKey:t,encoding:r.encoding})}function KM(r,e){const t=Z3(Bc),i=ks.randomBytes(dc),n=Hi(r,Nc);return e2({type:t,sealed:n,iv:i,encoding:e})}function VM(r){const e=new Hd.ChaCha20Poly1305(Hi(r.symKey,Yr)),{sealed:t,iv:i}=wc({encoded:r.encoded,encoding:r==null?void 0:r.encoding}),n=e.open(i,t);if(n===null)throw new Error("Failed to decrypt");return Di(n,Nc)}function GM(r,e){const{sealed:t}=wc({encoded:r,encoding:e});return Di(t,Nc)}function e2(r){const{encoding:e=Ls}=r;if(wa(r.type)===Bc)return Di(yl([r.type,r.sealed]),e);if(wa(r.type)===bs){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Di(yl([r.type,r.senderPublicKey,r.iv,r.sealed]),e)}return Di(yl([r.type,r.iv,r.sealed]),e)}function wc(r){const{encoded:e,encoding:t=Ls}=r,i=Hi(e,t),n=i.slice(zM,Tg),a=Tg;if(wa(n)===bs){const d=a+u0,m=d+dc,w=i.slice(a,d),O=i.slice(d,m),C=i.slice(m);return{type:n,sealed:C,iv:O,senderPublicKey:w}}if(wa(n)===Bc){const d=i.slice(a),m=ks.randomBytes(dc);return{type:n,sealed:d,iv:m}}const c=a+dc,f=i.slice(a,c),g=i.slice(c);return{type:n,sealed:g,iv:f}}function JM(r,e){const t=wc({encoded:r,encoding:e==null?void 0:e.encoding});return t2({type:wa(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?Di(t.senderPublicKey,Yr):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function t2(r){const e=(r==null?void 0:r.type)||X3;if(e===bs){if(typeof(r==null?void 0:r.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(r==null?void 0:r.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r==null?void 0:r.senderPublicKey,receiverPublicKey:r==null?void 0:r.receiverPublicKey}}function Rg(r){return r.type===bs&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}function Ng(r){return r.type===Bc}function WM(r){return new Ev.ec("p256").keyFromPublic({x:Buffer.from(r.x,"base64").toString("hex"),y:Buffer.from(r.y,"base64").toString("hex")},"hex")}function YM(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");const t=e.length%4;return t>0&&(e+="=".repeat(4-t)),e}function QM(r){return Buffer.from(YM(r),"base64")}function XM(r,e){const[t,i,n]=r.split("."),a=QM(n);if(a.length!==64)throw new Error("Invalid signature length");const c=a.slice(0,32).toString("hex"),f=a.slice(32,64).toString("hex"),g=`${t}.${i}`,d=new Sc.SHA256().update(Buffer.from(g)).digest(),m=WM(e),w=Buffer.from(d).toString("hex");if(!m.verify(w,{r:c,s:f}))throw new Error("Invalid signature");return md(r).payload}const ZM="irn";function Sd(r){return(r==null?void 0:r.relay)||{protocol:ZM}}function cc(r){const e=AA[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var eI=Object.defineProperty,tI=Object.defineProperties,rI=Object.getOwnPropertyDescriptors,Bg=Object.getOwnPropertySymbols,iI=Object.prototype.hasOwnProperty,nI=Object.prototype.propertyIsEnumerable,$g=(r,e,t)=>e in r?eI(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ug=(r,e)=>{for(var t in e||(e={}))iI.call(e,t)&&$g(r,t,e[t]);if(Bg)for(var t of Bg(e))nI.call(e,t)&&$g(r,t,e[t]);return r},sI=(r,e)=>tI(r,rI(e));function aI(r,e="-"){const t={},i="relay"+e;return Object.keys(r).forEach(n=>{if(n.startsWith(i)){const a=n.replace(i,""),c=r[n];t[a]=c}}),t}function qg(r){if(!r.includes("wc:")){const g=d3(r);g!=null&&g.includes("wc:")&&(r=g)}r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,i=r.substring(0,e),n=r.substring(e+1,t).split("@"),a=typeof t<"u"?r.substring(t):"",c=vc.parse(a),f=typeof c.methods=="string"?c.methods.split(","):void 0;return{protocol:i,topic:oI(n[0]),version:parseInt(n[1],10),symKey:c.symKey,relay:aI(c),methods:f,expiryTimestamp:c.expiryTimestamp?parseInt(c.expiryTimestamp,10):void 0}}function oI(r){return r.startsWith("//")?r.substring(2):r}function cI(r,e="-"){const t="relay",i={};return Object.keys(r).forEach(n=>{const a=t+e+n;r[n]&&(i[a]=r[n])}),i}function Lg(r){return`${r.protocol}:${r.topic}@${r.version}?`+vc.stringify(Ug(sI(Ug({symKey:r.symKey},cI(r.relay)),{expiryTimestamp:r.expiryTimestamp}),r.methods?{methods:r.methods.join(",")}:{}))}function Wu(r,e,t){return`${r}?wc_ev=${t}&topic=${e}`}function xo(r){const e=[];return r.forEach(t=>{const[i,n]=t.split(":");e.push(`${i}:${n}`)}),e}function uI(r){const e=[];return Object.values(r).forEach(t=>{e.push(...xo(t.accounts))}),e}function fI(r,e){const t=[];return Object.values(r).forEach(i=>{xo(i.accounts).includes(e)&&t.push(...i.methods)}),t}function hI(r,e){const t=[];return Object.values(r).forEach(i=>{xo(i.accounts).includes(e)&&t.push(...i.events)}),t}function f0(r){return r.includes(":")}function uc(r){return f0(r)?r.split(":")[0]:r}function lI(r){const e={};return r==null||r.forEach(t=>{const[i,n]=t.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[]}),e[i].accounts.push(t),e[i].chains.push(`${i}:${n}`)}),e}function Fg(r,e){e=e.map(i=>i.replace("did:pkh:",""));const t=lI(e);for(const[i,n]of Object.entries(t))n.methods?n.methods=rf(n.methods,r):n.methods=r,n.events=["chainChanged","accountsChanged"];return t}const dI={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},pI={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function De(r,e){const{message:t,code:i}=pI[r];return{message:e?`${t} ${e}`:t,code:i}}function Lt(r,e){const{message:t,code:i}=dI[r];return{message:e?`${t} ${e}`:t,code:i}}function Hn(r,e){return!!Array.isArray(r)}function _c(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function fi(r){return typeof r>"u"}function ur(r,e){return e&&fi(r)?!0:typeof r=="string"&&!!r.trim().length}function h0(r,e){return typeof r=="number"&&!isNaN(r)}function gI(r,e){const{requiredNamespaces:t}=e,i=Object.keys(r.namespaces),n=Object.keys(t);let a=!0;return la(n,i)?(i.forEach(c=>{const{accounts:f,methods:g,events:d}=r.namespaces[c],m=xo(f),w=t[c];(!la(a3(c,w),m)||!la(w.methods,g)||!la(w.events,d))&&(a=!1)}),a):!1}function xf(r){return ur(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function bI(r){if(ur(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&xf(t)}}return!1}function vI(r){function e(t){try{return typeof new URL(t)<"u"}catch{return!1}}try{if(ur(r,!1)){if(e(r))return!0;const t=d3(r);return e(t)}}catch{}return!1}function mI(r){var e;return(e=r==null?void 0:r.proposer)==null?void 0:e.publicKey}function yI(r){return r==null?void 0:r.topic}function wI(r,e){let t=null;return ur(r==null?void 0:r.publicKey,!1)||(t=De("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function zg(r){let e=!0;return Hn(r)?r.length&&(e=r.every(t=>ur(t,!1))):e=!1,e}function _I(r,e,t){let i=null;return Hn(e)&&e.length?e.forEach(n=>{i||xf(n)||(i=Lt("UNSUPPORTED_CHAINS",`${t}, chain ${n} should be a string and conform to "namespace:chainId" format`))}):xf(r)||(i=Lt("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}function DI(r,e,t){let i=null;return Object.entries(r).forEach(([n,a])=>{if(i)return;const c=_I(n,a3(n,a),`${e} ${t}`);c&&(i=c)}),i}function EI(r,e){let t=null;return Hn(r)?r.forEach(i=>{t||bI(i)||(t=Lt("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):t=Lt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function AI(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const n=EI(i==null?void 0:i.accounts,`${e} namespace`);n&&(t=n)}),t}function xI(r,e){let t=null;return zg(r==null?void 0:r.methods)?zg(r==null?void 0:r.events)||(t=Lt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=Lt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function r2(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const n=xI(i,`${e}, namespace`);n&&(t=n)}),t}function SI(r,e,t){let i=null;if(r&&_c(r)){const n=r2(r,e);n&&(i=n);const a=DI(r,e,t);a&&(i=a)}else i=De("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return i}function Kl(r,e){let t=null;if(r&&_c(r)){const i=r2(r,e);i&&(t=i);const n=AI(r,e);n&&(t=n)}else t=De("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function i2(r){return ur(r.protocol,!0)}function MI(r,e){let t=!1;return r?r&&Hn(r)&&r.length&&r.forEach(i=>{t=i2(i)}):t=!0,t}function II(r){return typeof r=="number"}function ci(r){return typeof r<"u"&&typeof r!==null}function CI(r){return!(!r||typeof r!="object"||!r.code||!h0(r.code)||!r.message||!ur(r.message,!1))}function PI(r){return!(fi(r)||!ur(r.method,!1))}function OI(r){return!(fi(r)||fi(r.result)&&fi(r.error)||!h0(r.id)||!ur(r.jsonrpc,!1))}function TI(r){return!(fi(r)||!ur(r.name,!1))}function jg(r,e){return!(!xf(e)||!uI(r).includes(e))}function RI(r,e,t){return ur(t,!1)?fI(r,e).includes(t):!1}function NI(r,e,t){return ur(t,!1)?hI(r,e).includes(t):!1}function kg(r,e,t){let i=null;const n=BI(r),a=$I(e),c=Object.keys(n),f=Object.keys(a),g=Hg(Object.keys(r)),d=Hg(Object.keys(e)),m=g.filter(w=>!d.includes(w));return m.length&&(i=De("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces. + Required: ${m.toString()} + Received: ${Object.keys(e).toString()}`)),la(c,f)||(i=De("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces. + Required: ${c.toString()} + Approved: ${f.toString()}`)),Object.keys(e).forEach(w=>{if(!w.includes(":")||i)return;const O=xo(e[w].accounts);O.includes(w)||(i=De("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${w} + Required: ${w} + Approved: ${O.toString()}`))}),c.forEach(w=>{i||(la(n[w].methods,a[w].methods)?la(n[w].events,a[w].events)||(i=De("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${w}`)):i=De("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${w}`))}),i}function BI(r){const e={};return Object.keys(r).forEach(t=>{var i;t.includes(":")?e[t]=r[t]:(i=r[t].chains)==null||i.forEach(n=>{e[n]={methods:r[t].methods,events:r[t].events}})}),e}function Hg(r){return[...new Set(r.map(e=>e.includes(":")?e.split(":")[0]:e))]}function $I(r){const e={};return Object.keys(r).forEach(t=>{if(t.includes(":"))e[t]=r[t];else{const i=xo(r[t].accounts);i==null||i.forEach(n=>{e[n]={accounts:r[t].accounts.filter(a=>a.includes(`${n}:`)),methods:r[t].methods,events:r[t].events}})}}),e}function UI(r,e){return h0(r)&&r<=e.max&&r>=e.min}function Kg(){const r=Tc();return new Promise(e=>{switch(r){case _i.browser:e(qI());break;case _i.reactNative:e(LI());break;case _i.node:e(FI());break;default:e(!0)}})}function qI(){return Oc()&&(navigator==null?void 0:navigator.onLine)}async function LI(){if(wo()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo){const r=await(globalThis==null?void 0:globalThis.NetInfo.fetch());return r==null?void 0:r.isConnected}return!0}function FI(){return!0}function zI(r){switch(Tc()){case _i.browser:jI(r);break;case _i.reactNative:kI(r);break}}function jI(r){!wo()&&Oc()&&(window.addEventListener("online",()=>r(!0)),window.addEventListener("offline",()=>r(!1)))}function kI(r){wo()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo&&(globalThis==null||globalThis.NetInfo.addEventListener(e=>r(e==null?void 0:e.isConnected)))}const Vl={};class tc{static get(e){return Vl[e]}static set(e,t){Vl[e]=t}static delete(e){delete Vl[e]}}class xa{}let HI=class extends xa{constructor(e){super()}};const Vg=Ae.FIVE_SECONDS,So={pulse:"heartbeat_pulse"};let KI=class n2 extends HI{constructor(e){super(e),this.events=new Vi.EventEmitter,this.interval=Vg,this.interval=(e==null?void 0:e.interval)||Vg}static async init(e){const t=new n2(e);return await t.init(),t}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(),Ae.toMiliseconds(this.interval))}pulse(){this.events.emit(So.pulse)}};const VI=/"(?:_|\\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*:/,GI=/"(?: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*:/,JI=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function WI(r,e){if(r==="__proto__"||r==="constructor"&&e&&typeof e=="object"&&"prototype"in e){YI(r);return}return e}function YI(r){console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)}function Yu(r,e={}){if(typeof r!="string")return r;const t=r.trim();if(r[0]==='"'&&r.endsWith('"')&&!r.includes("\\"))return t.slice(1,-1);if(t.length<=9){const i=t.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;if(i==="undefined")return;if(i==="null")return null;if(i==="nan")return Number.NaN;if(i==="infinity")return Number.POSITIVE_INFINITY;if(i==="-infinity")return Number.NEGATIVE_INFINITY}if(!JI.test(r)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return r}try{if(VI.test(r)||GI.test(r)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(r,WI)}return JSON.parse(r)}catch(i){if(e.strict)throw i;return r}}function QI(r){return!r||typeof r.then!="function"?Promise.resolve(r):r}function _r(r,...e){try{return QI(r(...e))}catch(t){return Promise.reject(t)}}function XI(r){const e=typeof r;return r===null||e!=="object"&&e!=="function"}function ZI(r){const e=Object.getPrototypeOf(r);return!e||e.isPrototypeOf(Object)}function uf(r){if(XI(r))return String(r);if(ZI(r)||Array.isArray(r))return JSON.stringify(r);if(typeof r.toJSON=="function")return uf(r.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function s2(){if(typeof Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const Md="base64:";function eC(r){if(typeof r=="string")return r;s2();const e=Buffer.from(r).toString("base64");return Md+e}function tC(r){return typeof r!="string"||!r.startsWith(Md)?r:(s2(),Buffer.from(r.slice(Md.length),"base64"))}function oi(r){return r?r.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function rC(...r){return oi(r.join(":"))}function Qu(r){return r=oi(r),r?r+":":""}const iC="memory",nC=()=>{const r=new Map;return{name:iC,getInstance:()=>r,hasItem(e){return r.has(e)},getItem(e){return r.get(e)??null},getItemRaw(e){return r.get(e)??null},setItem(e,t){r.set(e,t)},setItemRaw(e,t){r.set(e,t)},removeItem(e){r.delete(e)},getKeys(){return[...r.keys()]},clear(){r.clear()},dispose(){r.clear()}}};function sC(r={}){const e={mounts:{"":r.driver||nC()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=d=>{for(const m of e.mountpoints)if(d.startsWith(m))return{base:m,relativeKey:d.slice(m.length),driver:e.mounts[m]};return{base:"",relativeKey:d,driver:e.mounts[""]}},i=(d,m)=>e.mountpoints.filter(w=>w.startsWith(d)||m&&d.startsWith(w)).map(w=>({relativeBase:d.length>w.length?d.slice(w.length):void 0,mountpoint:w,driver:e.mounts[w]})),n=(d,m)=>{if(e.watching){m=oi(m);for(const w of e.watchListeners)w(d,m)}},a=async()=>{if(!e.watching){e.watching=!0;for(const d in e.mounts)e.unwatch[d]=await Gg(e.mounts[d],n,d)}},c=async()=>{if(e.watching){for(const d in e.unwatch)await e.unwatch[d]();e.unwatch={},e.watching=!1}},f=(d,m,w)=>{const O=new Map,C=P=>{let q=O.get(P.base);return q||(q={driver:P.driver,base:P.base,items:[]},O.set(P.base,q)),q};for(const P of d){const q=typeof P=="string",K=oi(q?P:P.key),Y=q?void 0:P.value,z=q||!P.options?m:{...m,...P.options},W=t(K);C(W).items.push({key:K,value:Y,relativeKey:W.relativeKey,options:z})}return Promise.all([...O.values()].map(P=>w(P))).then(P=>P.flat())},g={hasItem(d,m={}){d=oi(d);const{relativeKey:w,driver:O}=t(d);return _r(O.hasItem,w,m)},getItem(d,m={}){d=oi(d);const{relativeKey:w,driver:O}=t(d);return _r(O.getItem,w,m).then(C=>Yu(C))},getItems(d,m){return f(d,m,w=>w.driver.getItems?_r(w.driver.getItems,w.items.map(O=>({key:O.relativeKey,options:O.options})),m).then(O=>O.map(C=>({key:rC(w.base,C.key),value:Yu(C.value)}))):Promise.all(w.items.map(O=>_r(w.driver.getItem,O.relativeKey,O.options).then(C=>({key:O.key,value:Yu(C)})))))},getItemRaw(d,m={}){d=oi(d);const{relativeKey:w,driver:O}=t(d);return O.getItemRaw?_r(O.getItemRaw,w,m):_r(O.getItem,w,m).then(C=>tC(C))},async setItem(d,m,w={}){if(m===void 0)return g.removeItem(d);d=oi(d);const{relativeKey:O,driver:C}=t(d);C.setItem&&(await _r(C.setItem,O,uf(m),w),C.watch||n("update",d))},async setItems(d,m){await f(d,m,async w=>{if(w.driver.setItems)return _r(w.driver.setItems,w.items.map(O=>({key:O.relativeKey,value:uf(O.value),options:O.options})),m);w.driver.setItem&&await Promise.all(w.items.map(O=>_r(w.driver.setItem,O.relativeKey,uf(O.value),O.options)))})},async setItemRaw(d,m,w={}){if(m===void 0)return g.removeItem(d,w);d=oi(d);const{relativeKey:O,driver:C}=t(d);if(C.setItemRaw)await _r(C.setItemRaw,O,m,w);else if(C.setItem)await _r(C.setItem,O,eC(m),w);else return;C.watch||n("update",d)},async removeItem(d,m={}){typeof m=="boolean"&&(m={removeMeta:m}),d=oi(d);const{relativeKey:w,driver:O}=t(d);O.removeItem&&(await _r(O.removeItem,w,m),(m.removeMeta||m.removeMata)&&await _r(O.removeItem,w+"$",m),O.watch||n("remove",d))},async getMeta(d,m={}){typeof m=="boolean"&&(m={nativeOnly:m}),d=oi(d);const{relativeKey:w,driver:O}=t(d),C=Object.create(null);if(O.getMeta&&Object.assign(C,await _r(O.getMeta,w,m)),!m.nativeOnly){const P=await _r(O.getItem,w+"$",m).then(q=>Yu(q));P&&typeof P=="object"&&(typeof P.atime=="string"&&(P.atime=new Date(P.atime)),typeof P.mtime=="string"&&(P.mtime=new Date(P.mtime)),Object.assign(C,P))}return C},setMeta(d,m,w={}){return this.setItem(d+"$",m,w)},removeMeta(d,m={}){return this.removeItem(d+"$",m)},async getKeys(d,m={}){d=Qu(d);const w=i(d,!0);let O=[];const C=[];for(const P of w){const q=await _r(P.driver.getKeys,P.relativeBase,m);for(const K of q){const Y=P.mountpoint+oi(K);O.some(z=>Y.startsWith(z))||C.push(Y)}O=[P.mountpoint,...O.filter(K=>!K.startsWith(P.mountpoint))]}return d?C.filter(P=>P.startsWith(d)&&P[P.length-1]!=="$"):C.filter(P=>P[P.length-1]!=="$")},async clear(d,m={}){d=Qu(d),await Promise.all(i(d,!1).map(async w=>{if(w.driver.clear)return _r(w.driver.clear,w.relativeBase,m);if(w.driver.removeItem){const O=await w.driver.getKeys(w.relativeBase||"",m);return Promise.all(O.map(C=>w.driver.removeItem(C,m)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(d=>Jg(d)))},async watch(d){return await a(),e.watchListeners.push(d),async()=>{e.watchListeners=e.watchListeners.filter(m=>m!==d),e.watchListeners.length===0&&await c()}},async unwatch(){e.watchListeners=[],await c()},mount(d,m){if(d=Qu(d),d&&e.mounts[d])throw new Error(`already mounted at ${d}`);return d&&(e.mountpoints.push(d),e.mountpoints.sort((w,O)=>O.length-w.length)),e.mounts[d]=m,e.watching&&Promise.resolve(Gg(m,n,d)).then(w=>{e.unwatch[d]=w}).catch(console.error),g},async unmount(d,m=!0){d=Qu(d),!(!d||!e.mounts[d])&&(e.watching&&d in e.unwatch&&(e.unwatch[d](),delete e.unwatch[d]),m&&await Jg(e.mounts[d]),e.mountpoints=e.mountpoints.filter(w=>w!==d),delete e.mounts[d])},getMount(d=""){d=oi(d)+":";const m=t(d);return{driver:m.driver,base:m.base}},getMounts(d="",m={}){return d=oi(d),i(d,m.parents).map(O=>({driver:O.driver,base:O.mountpoint}))},keys:(d,m={})=>g.getKeys(d,m),get:(d,m={})=>g.getItem(d,m),set:(d,m,w={})=>g.setItem(d,m,w),has:(d,m={})=>g.hasItem(d,m),del:(d,m={})=>g.removeItem(d,m),remove:(d,m={})=>g.removeItem(d,m)};return g}function Gg(r,e,t){return r.watch?r.watch((i,n)=>e(i,t+n)):()=>{}}async function Jg(r){typeof r.dispose=="function"&&await _r(r.dispose)}function Sa(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function a2(r,e){const t=indexedDB.open(r);t.onupgradeneeded=()=>t.result.createObjectStore(e);const i=Sa(t);return(n,a)=>i.then(c=>a(c.transaction(e,n).objectStore(e)))}let Gl;function $c(){return Gl||(Gl=a2("keyval-store","keyval")),Gl}function Wg(r,e=$c()){return e("readonly",t=>Sa(t.get(r)))}function aC(r,e,t=$c()){return t("readwrite",i=>(i.put(e,r),Sa(i.transaction)))}function oC(r,e=$c()){return e("readwrite",t=>(t.delete(r),Sa(t.transaction)))}function cC(r=$c()){return r("readwrite",e=>(e.clear(),Sa(e.transaction)))}function uC(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Sa(r.transaction)}function fC(r=$c()){return r("readonly",e=>{if(e.getAllKeys)return Sa(e.getAllKeys());const t=[];return uC(e,i=>t.push(i.key)).then(()=>t)})}const hC="idb-keyval";var lC=(r={})=>{const e=r.base&&r.base.length>0?`${r.base}:`:"",t=n=>e+n;let i;return r.dbName&&r.storeName&&(i=a2(r.dbName,r.storeName)),{name:hC,options:r,async hasItem(n){return!(typeof await Wg(t(n),i)>"u")},async getItem(n){return await Wg(t(n),i)??null},setItem(n,a){return aC(t(n),a,i)},removeItem(n){return oC(t(n),i)},getKeys(){return fC(i)},clear(){return cC(i)}}};const dC="WALLET_CONNECT_V2_INDEXED_DB",pC="keyvaluestorage";let gC=class{constructor(){this.indexedDb=sC({driver:lC({dbName:dC,storeName:pC})})}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){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,ys(t))}async removeItem(e){await this.indexedDb.removeItem(e)}};var Jl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},ff={exports:{}};(function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,i){this[t]=String(i)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(i){t[i]=void 0,delete t[i]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Jl<"u"&&Jl.localStorage?ff.exports=Jl.localStorage:typeof window<"u"&&window.localStorage?ff.exports=window.localStorage:ff.exports=new e})();function bC(r){var e;return[r[0],ma((e=r[1])!=null?e:"")]}class vC{constructor(){this.localStorage=ff.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(bC)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return ma(t)}async setItem(e,t){this.localStorage.setItem(e,ys(t))}async removeItem(e){this.localStorage.removeItem(e)}}const mC="wc_storage_version",Yg=1,yC=async(r,e,t)=>{const i=mC,n=await e.getItem(i);if(n&&n>=Yg){t(e);return}const a=await r.getKeys();if(!a.length){t(e);return}const c=[];for(;a.length;){const f=a.shift();if(!f)continue;const g=f.toLowerCase();if(g.includes("wc@")||g.includes("walletconnect")||g.includes("wc_")||g.includes("wallet_connect")){const d=await r.getItem(f);await e.setItem(f,d),c.push(f)}}await e.setItem(i,Yg),t(e),wC(r,c)},wC=async(r,e)=>{e.length&&e.forEach(async t=>{await r.removeItem(t)})};let _C=class{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new vC;this.storage=e;try{const t=new gC;yC(e,t,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=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}};function DC(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}var EC=AC;function AC(r,e,t){var i=t&&t.stringify||DC,n=1;if(typeof r=="object"&&r!==null){var a=e.length+n;if(a===1)return r;var c=new Array(a);c[0]=i(r);for(var f=1;f-1?w:0,r.charCodeAt(C+1)){case 100:case 102:if(m>=g||e[m]==null)break;w=g||e[m]==null)break;w=g||e[m]===void 0)break;w",w=C+2,C++;break}d+=i(e[m]),w=C+2,C++;break;case 115:if(m>=g)break;w-1&&(a=!1);const c=["error","fatal","warn","info","debug","trace"];typeof t=="function"&&(t.error=t.fatal=t.warn=t.info=t.debug=t.trace=t),r.enabled===!1&&(r.level="silent");const f=r.level||"info",g=Object.create(t);g.log||(g.log=Ec),Object.defineProperty(g,"levelVal",{get:m}),Object.defineProperty(g,"level",{get:w,set:O});const d={transmit:e,serialize:n,asObject:r.browser.asObject,levels:c,timestamp:OC(r)};g.levels=Fn.levels,g.level=f,g.setMaxListeners=g.getMaxListeners=g.emit=g.addListener=g.on=g.prependListener=g.once=g.prependOnceListener=g.removeListener=g.removeAllListeners=g.listeners=g.listenerCount=g.eventNames=g.write=g.flush=Ec,g.serializers=i,g._serialize=n,g._stdErrSerialize=a,g.child=C,e&&(g._logEvent=Id());function m(){return this.level==="silent"?1/0:this.levels.values[this.level]}function w(){return this._level}function O(P){if(P!=="silent"&&!this.levels.values[P])throw Error("unknown level "+P);this._level=P,Ja(d,g,"error","log"),Ja(d,g,"fatal","error"),Ja(d,g,"warn","error"),Ja(d,g,"info","log"),Ja(d,g,"debug","log"),Ja(d,g,"trace","log")}function C(P,q){if(!P)throw new Error("missing bindings for child Pino");q=q||{},n&&P.serializers&&(q.serializers=P.serializers);const K=q.serializers;if(n&&K){var Y=Object.assign({},i,K),z=r.browser.serialize===!0?Object.keys(Y):n;delete P.serializers,Xf([P],z,Y,this._stdErrSerialize)}function W(B){this._childLevel=(B._childLevel|0)+1,this.error=Wa(B,P,"error"),this.fatal=Wa(B,P,"fatal"),this.warn=Wa(B,P,"warn"),this.info=Wa(B,P,"info"),this.debug=Wa(B,P,"debug"),this.trace=Wa(B,P,"trace"),Y&&(this.serializers=Y,this._serialize=z),e&&(this._logEvent=Id([].concat(B._logEvent.bindings,P)))}return W.prototype=this,new W(this)}return g}Fn.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"}};Fn.stdSerializers=xC;Fn.stdTimeFunctions=Object.assign({},{nullTime:o2,epochTime:c2,unixTime:TC,isoTime:RC});function Ja(r,e,t,i){const n=Object.getPrototypeOf(e);e[t]=e.levelVal>e.levels.values[t]?Ec:n[t]?n[t]:Dc[t]||Dc[i]||Ec,MC(r,e,t)}function MC(r,e,t){!r.transmit&&e[t]===Ec||(e[t]=function(i){return function(){const a=r.timestamp(),c=new Array(arguments.length),f=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Dc?Dc:this;for(var g=0;g-1&&a in t&&(r[n][a]=t[a](r[n][a]))}function Wa(r,e,t){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;nthis.maxSizeInBytes)throw new 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;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let 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};const t=e.value;return e=e.next,{done:!1,value:t}}}}},u2=class{constructor(e,t=l0){this.level=e??"error",this.levelValue=Xa.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new Xg(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===Xa.levels.values.error?console.error(e):t===Xa.levels.values.warn?console.warn(e):t===Xa.levels.values.debug?console.debug(e):t===Xa.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(ys({timestamp:new Date().toISOString(),log:e}));const 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 Xg(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push(ys({extraMetadata:e})),new Blob(t,{type:"application/json"})}},UC=class{constructor(e,t=l0){this.baseChunkLogger=new u2(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){const t=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=t,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(t)}};class qC{constructor(e,t=l0){this.baseChunkLogger=new u2(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)}}var LC=Object.defineProperty,FC=Object.defineProperties,zC=Object.getOwnPropertyDescriptors,Zg=Object.getOwnPropertySymbols,jC=Object.prototype.hasOwnProperty,kC=Object.prototype.propertyIsEnumerable,eb=(r,e,t)=>e in r?LC(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Sf=(r,e)=>{for(var t in e||(e={}))jC.call(e,t)&&eb(r,t,e[t]);if(Zg)for(var t of Zg(e))kC.call(e,t)&&eb(r,t,e[t]);return r},Mf=(r,e)=>FC(r,zC(e));function Zf(r){return Mf(Sf({},r),{level:(r==null?void 0:r.level)||BC.level})}function HC(r,e=qc){return r[e]||""}function KC(r,e,t=qc){return r[t]=e,r}function pi(r,e=qc){let t="";return typeof r.bindings>"u"?t=HC(r,e):t=r.bindings().context||"",t}function VC(r,e,t=qc){const i=pi(r,t);return i.trim()?`${i}/${e}`:e}function Qr(r,e,t=qc){const i=VC(r,e,t),n=r.child({context:i});return KC(n,i,t)}function GC(r){var e,t;const i=new UC((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:Uc(Mf(Sf({},r.opts),{level:"trace",browser:Mf(Sf({},(t=r.opts)==null?void 0:t.browser),{write:n=>i.write(n)})})),chunkLoggerController:i}}function JC(r){var e;const t=new qC((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:Uc(Mf(Sf({},r.opts),{level:"trace"}),t),chunkLoggerController:t}}function WC(r){return typeof r.loggerOverride<"u"&&typeof r.loggerOverride!="string"?{logger:r.loggerOverride,chunkLoggerController:null}:typeof window<"u"?GC(r):JC(r)}let YC=class extends xa{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},QC=class extends xa{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},XC=class{constructor(e,t){this.logger=e,this.core=t}},ZC=class extends xa{constructor(e,t){super(),this.relayer=e,this.logger=t}},eP=class extends xa{constructor(e){super()}},tP=class{constructor(e,t,i,n){this.core=e,this.logger=t,this.name=i}},rP=class extends xa{constructor(e,t){super(),this.relayer=e,this.logger=t}},iP=class extends xa{constructor(e,t){super(),this.core=e,this.logger=t}},nP=class{constructor(e,t,i){this.core=e,this.logger=t,this.store=i}},sP=class{constructor(e,t){this.projectId=e,this.logger=t}},aP=class{constructor(e,t,i){this.core=e,this.logger=t,this.telemetryEnabled=i}},oP=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},cP=class{constructor(e){this.client=e}};function uP(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function fP(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i>>0,B=new Uint8Array(W);Y!==z;){for(var j=P[Y],k=0,_=W-1;(j!==0||k>>0,B[_]=j%f>>>0,j=j/f>>>0;if(j!==0)throw new Error("Non-zero carry");K=k,Y++}for(var N=W-K;N!==W&&B[N]===0;)N++;for(var se=g.repeat(q);N>>0,W=new Uint8Array(z);P[q];){var B=t[P.charCodeAt(q)];if(B===255)return;for(var j=0,k=z-1;(B!==0||j>>0,W[k]=B%256>>>0,B=B/256>>>0;if(B!==0)throw new Error("Non-zero carry");Y=j,q++}if(P[q]!==" "){for(var _=z-Y;_!==z&&W[_]===0;)_++;for(var N=new Uint8Array(K+(z-_)),se=K;_!==z;)N[se++]=W[_++];return N}}}function C(P){var q=O(P);if(q)return q;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:O,decode:C}}var hP=fP,lP=hP;const dP=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},pP=r=>new TextEncoder().encode(r),gP=r=>new TextDecoder().decode(r);class bP{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class vP{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}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 f2(this,e)}}class mP{constructor(e){this.decoders=e}or(e){return f2(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const f2=(r,e)=>new mP({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class yP{constructor(e,t,i,n){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=n,this.encoder=new bP(e,t,i),this.decoder=new vP(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const eh=({name:r,prefix:e,encode:t,decode:i})=>new yP(r,e,t,i),Lc=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:n}=lP(t,e);return eh({prefix:r,name:e,encode:i,decode:a=>dP(n(a))})},wP=(r,e,t,i)=>{const n={};for(let m=0;m=8&&(f-=8,c[d++]=255&g>>f)}if(f>=t||255&g<<8-f)throw new SyntaxError("Unexpected end of data");return c},_P=(r,e,t)=>{const i=e[e.length-1]==="=",n=(1<t;)c-=t,a+=e[n&f>>c];if(c&&(a+=e[n&f<eh({prefix:e,name:r,encode(n){return _P(n,i,t)},decode(n){return wP(n,i,t,r)}}),DP=eh({prefix:"\0",name:"identity",encode:r=>gP(r),decode:r=>pP(r)}),EP=Object.freeze(Object.defineProperty({__proto__:null,identity:DP},Symbol.toStringTag,{value:"Module"})),AP=Or({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),xP=Object.freeze(Object.defineProperty({__proto__:null,base2:AP},Symbol.toStringTag,{value:"Module"})),SP=Or({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),MP=Object.freeze(Object.defineProperty({__proto__:null,base8:SP},Symbol.toStringTag,{value:"Module"})),IP=Lc({prefix:"9",name:"base10",alphabet:"0123456789"}),CP=Object.freeze(Object.defineProperty({__proto__:null,base10:IP},Symbol.toStringTag,{value:"Module"})),PP=Or({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),OP=Or({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),TP=Object.freeze(Object.defineProperty({__proto__:null,base16:PP,base16upper:OP},Symbol.toStringTag,{value:"Module"})),RP=Or({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),NP=Or({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),BP=Or({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),$P=Or({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),UP=Or({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),qP=Or({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),LP=Or({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),FP=Or({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),zP=Or({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),jP=Object.freeze(Object.defineProperty({__proto__:null,base32:RP,base32hex:UP,base32hexpad:LP,base32hexpadupper:FP,base32hexupper:qP,base32pad:BP,base32padupper:$P,base32upper:NP,base32z:zP},Symbol.toStringTag,{value:"Module"})),kP=Lc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),HP=Lc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),KP=Object.freeze(Object.defineProperty({__proto__:null,base36:kP,base36upper:HP},Symbol.toStringTag,{value:"Module"})),VP=Lc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),GP=Lc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),JP=Object.freeze(Object.defineProperty({__proto__:null,base58btc:VP,base58flickr:GP},Symbol.toStringTag,{value:"Module"})),WP=Or({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),YP=Or({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),QP=Or({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),XP=Or({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),ZP=Object.freeze(Object.defineProperty({__proto__:null,base64:WP,base64pad:YP,base64url:QP,base64urlpad:XP},Symbol.toStringTag,{value:"Module"})),h2=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),eO=h2.reduce((r,e,t)=>(r[t]=e,r),[]),tO=h2.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function rO(r){return r.reduce((e,t)=>(e+=eO[t],e),"")}function iO(r){const e=[];for(const t of r){const i=tO[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const nO=eh({prefix:"🚀",name:"base256emoji",encode:rO,decode:iO}),sO=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:nO},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const tb={...EP,...xP,...MP,...CP,...TP,...jP,...KP,...JP,...ZP,...sO};function l2(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const rb=l2("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Yl=l2("ascii","a",r=>{let e="a";for(let t=0;t{r=r.substring(1);const e=uP(r.length);for(let t=0;tt.code===r);return e||pc[p2]}function g2(r,e,t){return r.message.includes("getaddrinfo ENOTFOUND")||r.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):r}var b2={};/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */var Cd=function(r,e){return Cd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Cd(r,e)};function gO(r,e){Cd(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Pd=function(){return Pd=Object.assign||function(e){for(var t,i=1,n=arguments.length;i=0;f--)(c=r[f])&&(a=(n<3?c(a):n>3?c(e,t,a):c(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a}function mO(r,e){return function(t,i){e(t,i,r)}}function yO(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function wO(r,e,t,i){function n(a){return a instanceof t?a:new t(function(c){c(a)})}return new(t||(t=Promise))(function(a,c){function f(m){try{d(i.next(m))}catch(w){c(w)}}function g(m){try{d(i.throw(m))}catch(w){c(w)}}function d(m){m.done?a(m.value):n(m.value).then(f,g)}d((i=i.apply(r,e||[])).next())})}function _O(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,c;return c={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function f(d){return function(m){return g([d,m])}}function g(d){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(a=d[0]&2?n.return:d[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,d[1])).done)return a;switch(n=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return t.label++,{value:d[1],done:!1};case 5:t.label++,n=d[1],d=[0];continue;case 7:d=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){t=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function v2(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],c;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(f){c={error:f}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(c)throw c.error}}return a}function AO(){for(var r=[],e=0;e1||f(O,C)})})}function f(O,C){try{g(i[O](C))}catch(P){w(a[0][3],P)}}function g(O){O.value instanceof Ac?Promise.resolve(O.value.v).then(d,m):w(a[0][2],O)}function d(O){f("next",O)}function m(O){f("throw",O)}function w(O,C){O(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function MO(r){var e,t;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,a){e[n]=r[n]?function(c){return(t=!t)?{value:Ac(r[n](c)),done:n==="return"}:a?a(c):c}:a}}function IO(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Od=="function"?Od(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(c){return new Promise(function(f,g){c=r[a](c),n(f,g,c.done,c.value)})}}function n(a,c,f,g){Promise.resolve(g).then(function(d){a({value:d,done:f})},c)}}function CO(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function PO(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function OO(r){return r&&r.__esModule?r:{default:r}}function TO(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function RO(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const NO=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Pd},__asyncDelegator:MO,__asyncGenerator:SO,__asyncValues:IO,__await:Ac,__awaiter:wO,__classPrivateFieldGet:TO,__classPrivateFieldSet:RO,__createBinding:DO,__decorate:vO,__exportStar:EO,__extends:gO,__generator:_O,__importDefault:OO,__importStar:PO,__makeTemplateObject:CO,__metadata:yO,__param:mO,__read:v2,__rest:bO,__spread:AO,__spreadArrays:xO,__values:Od},Symbol.toStringTag,{value:"Module"})),BO=ev(NO);var os={},nb;function $O(){if(nb)return os;nb=1,Object.defineProperty(os,"__esModule",{value:!0}),os.isBrowserCryptoAvailable=os.getSubtleCrypto=os.getBrowerCrypto=void 0;function r(){return(globalThis==null?void 0:globalThis.crypto)||(globalThis==null?void 0:globalThis.msCrypto)||{}}os.getBrowerCrypto=r;function e(){const i=r();return i.subtle||i.webkitSubtle}os.getSubtleCrypto=e;function t(){return!!r()&&!!e()}return os.isBrowserCryptoAvailable=t,os}var cs={},sb;function UO(){if(sb)return cs;sb=1;var r={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};Object.defineProperty(cs,"__esModule",{value:!0}),cs.isBrowser=cs.isNode=cs.isReactNative=void 0;function e(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}cs.isReactNative=e;function t(){return typeof r<"u"&&typeof r.versions<"u"&&typeof r.versions.node<"u"}cs.isNode=t;function i(){return!e()&&!t()}return cs.isBrowser=i,cs}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=BO;e.__exportStar($O(),r),e.__exportStar(UO(),r)})(b2);function Bs(r=3){const e=Date.now()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}function da(r=6){return BigInt(Bs(r))}function Fs(r,e,t){return{id:t||Bs(),jsonrpc:"2.0",method:r,params:e}}function th(r,e){return{id:r,jsonrpc:"2.0",result:e}}function rh(r,e,t){return{id:r,jsonrpc:"2.0",error:qO(e)}}function qO(r,e){return typeof r>"u"?ib(d2):(typeof r=="string"&&(r=Object.assign(Object.assign({},ib(d0)),{message:r})),dO(r.code)&&(r=pO(r.code)),r)}class LO{}class FO extends LO{constructor(){super()}}class zO extends FO{constructor(e){super()}}const jO="^https?:",kO="^wss?:";function HO(r){const e=r.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function m2(r,e){const t=HO(r);return typeof t>"u"?!1:new RegExp(e).test(t)}function ab(r){return m2(r,jO)}function ob(r){return m2(r,kO)}function KO(r){return new RegExp("wss?://localhost(:d{2,5})?").test(r)}function y2(r){return typeof r=="object"&&"id"in r&&"jsonrpc"in r&&r.jsonrpc==="2.0"}function p0(r){return y2(r)&&"method"in r}function ih(r){return y2(r)&&(Cn(r)||ji(r))}function Cn(r){return"result"in r}function ji(r){return"error"in r}let vn=class extends zO{constructor(e){super(e),this.events=new Vi.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(Fs(e.method,e.params||[],e.id||da().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(a){n(a)}this.events.on(`${e.id}`,a=>{ji(a)?n(a.error):i(a.result)});try{await this.connection.send(e,t)}catch(a){n(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),ih(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",new 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()),this.hasRegisteredEventListeners=!0)}};const VO=()=>typeof WebSocket<"u"?WebSocket:typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"?globalThis.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),GO=()=>typeof WebSocket<"u"||typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",cb=r=>r.split("?")[0],ub=10,JO=VO();let WO=class{constructor(e){if(this.url=e,this.events=new Vi.EventEmitter,this.registering=!1,!ob(e))throw new 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(new Error("Connection already closed"));return}this.socket.onclose=i=>{this.onClose(i),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(ys(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!ob(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,n)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),n(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return n(new Error("WebSocket connection is missing or invalid"));i(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,i)=>{const n=new URLSearchParams(e).get("origin"),a=b2.isReactNative()?{headers:{origin:n}}:{rejectUnauthorized:!KO(e)},c=new JO(e,[],a);GO()?c.onerror=f=>{const g=f;i(this.emitError(g.error))}:c.on("error",f=>{i(this.emitError(f))}),c.onopen=()=>{this.onOpen(c),t(c)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),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;const t=typeof e.data=="string"?ma(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),n=i.message||i.toString(),a=rh(e,n);this.events.emit("payload",a)}parseError(e,t=this.url){return g2(e,cb(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>ub&&this.events.setMaxListeners(ub)}emitError(e){const t=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${cb(this.url)}`));return this.events.emit("register_error",t),t}};var If={exports:{}};If.exports;(function(r,e){var t=200,i="__lodash_hash_undefined__",n=1,a=2,c=9007199254740991,f="[object Arguments]",g="[object Array]",d="[object AsyncFunction]",m="[object Boolean]",w="[object Date]",O="[object Error]",C="[object Function]",P="[object GeneratorFunction]",q="[object Map]",K="[object Number]",Y="[object Null]",z="[object Object]",W="[object Promise]",B="[object Proxy]",j="[object RegExp]",k="[object Set]",_="[object String]",N="[object Symbol]",se="[object Undefined]",le="[object WeakMap]",U="[object ArrayBuffer]",y="[object DataView]",u="[object Float32Array]",h="[object Float64Array]",v="[object Int8Array]",E="[object Int16Array]",S="[object Int32Array]",M="[object Uint8Array]",x="[object Uint8ClampedArray]",p="[object Uint16Array]",b="[object Uint32Array]",R=/[\\^$.*+?()[\]{}|]/g,Z=/^\[object .+?Constructor\]$/,ae=/^(?:0|[1-9]\d*)$/,I={};I[u]=I[h]=I[v]=I[E]=I[S]=I[M]=I[x]=I[p]=I[b]=!0,I[f]=I[g]=I[U]=I[m]=I[y]=I[w]=I[O]=I[C]=I[q]=I[K]=I[z]=I[j]=I[k]=I[_]=I[le]=!1;var ee=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,L=typeof self=="object"&&self&&self.Object===Object&&self,V=ee||L||Function("return this")(),G=e&&!e.nodeType&&e,D=G&&!0&&r&&!r.nodeType&&r,H=D&&D.exports===G,ne=H&&ee.process,ce=function(){try{return ne&&ne.binding&&ne.binding("util")}catch{}}(),fe=ce&&ce.isTypedArray;function ye(J,te){for(var pe=-1,Le=J==null?0:J.length,jt=0,pt=[];++pe-1}function Ur(J,te){var pe=this.__data__,Le=Vs(pe,J);return Le<0?(++this.size,pe.push([J,te])):pe[Le][1]=te,this}vt.prototype.clear=Rr,vt.prototype.delete=Nr,vt.prototype.get=Br,vt.prototype.has=$r,vt.prototype.set=Ur;function er(J){var te=-1,pe=J==null?0:J.length;for(this.clear();++tefr))return!1;var kt=pt.get(J);if(kt&&pt.get(te))return kt==te;var sr=-1,ti=!0,hr=pe&a?new ei:void 0;for(pt.set(J,te),pt.set(te,J);++sr-1&&J%1==0&&J-1&&J%1==0&&J<=c}function ru(J){var te=typeof J;return J!=null&&(te=="object"||te=="function")}function Ws(J){return J!=null&&typeof J=="object"}var iu=fe?Ce(fe):Hc;function hh(J){return uh(J)?jc(J):Kc(J)}function zt(){return[]}function Ft(){return!1}r.exports=fh})(If,If.exports);var YO=If.exports;const QO=Ld(YO),w2="wc",_2=2,g0="core",Kn=`${w2}@2:${g0}:`,XO={name:g0,logger:"error"},ZO={database:":memory:"},eT="crypto",fb="client_ed25519_seed",tT=Ae.ONE_DAY,rT="keychain",iT="0.3",nT="messages",sT="0.3",aT=Ae.SIX_HOURS,oT="publisher",D2="irn",cT="error",E2="wss://relay.walletconnect.org",uT="relayer",Jr={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},fT="_subscription",Li={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},hT=.1,Td="2.17.0",Kt={link_mode:"link_mode",relay:"relay"},lT="0.3",dT="WALLETCONNECT_CLIENT_ID",hb="WALLETCONNECT_LINK_MODE_APPS",Pn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},pT="subscription",gT="0.3",bT=Ae.FIVE_SECONDS*1e3,vT="pairing",mT="0.3",rc={wc_pairingDelete:{req:{ttl:Ae.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Ae.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Ae.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Ae.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Ae.ONE_DAY,prompt:!1,tag:0},res:{ttl:Ae.ONE_DAY,prompt:!1,tag:0}}},ha={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},un={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},yT="history",wT="0.3",_T="expirer",Fi={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},DT="0.3",ET="verify-api",AT="https://verify.walletconnect.com",A2="https://verify.walletconnect.org",gc=A2,xT=`${gc}/v3`,ST=[AT,A2],MT="echo",IT="https://echo.walletconnect.com",Sn={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},us={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},fn={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},ca={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},ua={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},ic={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},CT=.1,PT="event-client",OT=86400,TT="https://pulse.walletconnect.org/batch";function RT(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i>>0,B=new Uint8Array(W);Y!==z;){for(var j=P[Y],k=0,_=W-1;(j!==0||k>>0,B[_]=j%f>>>0,j=j/f>>>0;if(j!==0)throw new Error("Non-zero carry");K=k,Y++}for(var N=W-K;N!==W&&B[N]===0;)N++;for(var se=g.repeat(q);N>>0,W=new Uint8Array(z);P[q];){var B=t[P.charCodeAt(q)];if(B===255)return;for(var j=0,k=z-1;(B!==0||j>>0,W[k]=B%256>>>0,B=B/256>>>0;if(B!==0)throw new Error("Non-zero carry");Y=j,q++}if(P[q]!==" "){for(var _=z-Y;_!==z&&W[_]===0;)_++;for(var N=new Uint8Array(K+(z-_)),se=K;_!==z;)N[se++]=W[_++];return N}}}function C(P){var q=O(P);if(q)return q;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:O,decode:C}}var NT=RT,BT=NT;const x2=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},$T=r=>new TextEncoder().encode(r),UT=r=>new TextDecoder().decode(r);class qT{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class LT{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}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 S2(this,e)}}class FT{constructor(e){this.decoders=e}or(e){return S2(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const S2=(r,e)=>new FT({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class zT{constructor(e,t,i,n){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=n,this.encoder=new qT(e,t,i),this.decoder=new LT(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const nh=({name:r,prefix:e,encode:t,decode:i})=>new zT(r,e,t,i),Fc=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:n}=BT(t,e);return nh({prefix:r,name:e,encode:i,decode:a=>x2(n(a))})},jT=(r,e,t,i)=>{const n={};for(let m=0;m=8&&(f-=8,c[d++]=255&g>>f)}if(f>=t||255&g<<8-f)throw new SyntaxError("Unexpected end of data");return c},kT=(r,e,t)=>{const i=e[e.length-1]==="=",n=(1<t;)c-=t,a+=e[n&f>>c];if(c&&(a+=e[n&f<nh({prefix:e,name:r,encode(n){return kT(n,i,t)},decode(n){return jT(n,i,t,r)}}),HT=nh({prefix:"\0",name:"identity",encode:r=>UT(r),decode:r=>$T(r)});var KT=Object.freeze({__proto__:null,identity:HT});const VT=Tr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var GT=Object.freeze({__proto__:null,base2:VT});const JT=Tr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var WT=Object.freeze({__proto__:null,base8:JT});const YT=Fc({prefix:"9",name:"base10",alphabet:"0123456789"});var QT=Object.freeze({__proto__:null,base10:YT});const XT=Tr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),ZT=Tr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var eR=Object.freeze({__proto__:null,base16:XT,base16upper:ZT});const tR=Tr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),rR=Tr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),iR=Tr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),nR=Tr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),sR=Tr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),aR=Tr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),oR=Tr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),cR=Tr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),uR=Tr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var fR=Object.freeze({__proto__:null,base32:tR,base32upper:rR,base32pad:iR,base32padupper:nR,base32hex:sR,base32hexupper:aR,base32hexpad:oR,base32hexpadupper:cR,base32z:uR});const hR=Fc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),lR=Fc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var dR=Object.freeze({__proto__:null,base36:hR,base36upper:lR});const pR=Fc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),gR=Fc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var bR=Object.freeze({__proto__:null,base58btc:pR,base58flickr:gR});const vR=Tr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),mR=Tr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),yR=Tr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),wR=Tr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var _R=Object.freeze({__proto__:null,base64:vR,base64pad:mR,base64url:yR,base64urlpad:wR});const M2=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),DR=M2.reduce((r,e,t)=>(r[t]=e,r),[]),ER=M2.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function AR(r){return r.reduce((e,t)=>(e+=DR[t],e),"")}function xR(r){const e=[];for(const t of r){const i=ER[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const SR=nh({prefix:"🚀",name:"base256emoji",encode:AR,decode:xR});var MR=Object.freeze({__proto__:null,base256emoji:SR}),IR=I2,lb=128,CR=127,PR=~CR,OR=Math.pow(2,31);function I2(r,e,t){e=e||[],t=t||0;for(var i=t;r>=OR;)e[t++]=r&255|lb,r/=128;for(;r&PR;)e[t++]=r&255|lb,r>>>=7;return e[t]=r|0,I2.bytes=t-i+1,e}var TR=Rd,RR=128,db=127;function Rd(r,i){var t=0,i=i||0,n=0,a=i,c,f=r.length;do{if(a>=f)throw Rd.bytes=0,new RangeError("Could not decode varint");c=r[a++],t+=n<28?(c&db)<=RR);return Rd.bytes=a-i,t}var NR=Math.pow(2,7),BR=Math.pow(2,14),$R=Math.pow(2,21),UR=Math.pow(2,28),qR=Math.pow(2,35),LR=Math.pow(2,42),FR=Math.pow(2,49),zR=Math.pow(2,56),jR=Math.pow(2,63),kR=function(r){return r(C2.encode(r,e,t),e),gb=r=>C2.encodingLength(r),Nd=(r,e)=>{const t=e.byteLength,i=gb(r),n=i+gb(t),a=new Uint8Array(n+t);return pb(r,a,0),pb(t,a,i),a.set(e,n),new KR(r,t,e,a)};class KR{constructor(e,t,i,n){this.code=e,this.size=t,this.digest=i,this.bytes=n}}const P2=({name:r,code:e,encode:t})=>new VR(r,e,t);class VR{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?Nd(this.code,t):t.then(i=>Nd(this.code,i))}else throw Error("Unknown type, must be binary type")}}const O2=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),GR=P2({name:"sha2-256",code:18,encode:O2("SHA-256")}),JR=P2({name:"sha2-512",code:19,encode:O2("SHA-512")});var WR=Object.freeze({__proto__:null,sha256:GR,sha512:JR});const T2=0,YR="identity",R2=x2,QR=r=>Nd(T2,R2(r)),XR={code:T2,name:YR,encode:R2,digest:QR};var ZR=Object.freeze({__proto__:null,identity:XR});new TextEncoder,new TextDecoder;const bb={...KT,...GT,...WT,...QT,...eR,...fR,...dR,...bR,..._R,...MR};({...WR,...ZR});function eN(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function N2(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const vb=N2("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Ql=N2("ascii","a",r=>{let e="a";for(let t=0;t{r=r.substring(1);const e=eN(r.length);for(let t=0;t{if(!this.initialized){const i=await this.getKeyChain();typeof i<"u"&&(this.keychain=i),this.initialized=!0}},this.has=i=>(this.isInitialized(),this.keychain.has(i)),this.set=async(i,n)=>{this.isInitialized(),this.keychain.set(i,n),await this.persist()},this.get=i=>{this.isInitialized();const n=this.keychain.get(i);if(typeof n>"u"){const{message:a}=De("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(a)}return n},this.del=async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()},this.core=e,this.logger=Qr(t,this.name)}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,u3(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?f3(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}class nN{constructor(e,t,i){this.core=e,this.logger=t,this.name=eT,this.randomSessionIdentifier=xd(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=n=>(this.isInitialized(),this.keychain.has(n)),this.getClientId=async()=>{this.isInitialized();const n=await this.getClientSeed(),a=Q1(n);return s3(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const n=jM();return this.setPrivateKey(n.publicKey,n.privateKey)},this.signJWT=async n=>{this.isInitialized();const a=await this.getClientSeed(),c=Q1(a),f=this.randomSessionIdentifier;return await EA(f,n,tT,c)},this.generateSharedKey=(n,a,c)=>{this.isInitialized();const f=this.getPrivateKey(n),g=kM(f,a);return this.setSymKey(g,c)},this.setSymKey=async(n,a)=>{this.isInitialized();const c=a||cf(n);return await this.keychain.set(c,n),c},this.deleteKeyPair=async n=>{this.isInitialized(),await this.keychain.del(n)},this.deleteSymKey=async n=>{this.isInitialized(),await this.keychain.del(n)},this.encode=async(n,a,c)=>{this.isInitialized();const f=t2(c),g=ys(a);if(Ng(f))return KM(g,c==null?void 0:c.encoding);if(Rg(f)){const O=f.senderPublicKey,C=f.receiverPublicKey;n=await this.generateSharedKey(O,C)}const d=this.getSymKey(n),{type:m,senderPublicKey:w}=f;return HM({type:m,symKey:d,message:g,senderPublicKey:w,encoding:c==null?void 0:c.encoding})},this.decode=async(n,a,c)=>{this.isInitialized();const f=JM(a,c);if(Ng(f)){const g=GM(a,c==null?void 0:c.encoding);return ma(g)}if(Rg(f)){const g=f.receiverPublicKey,d=f.senderPublicKey;n=await this.generateSharedKey(g,d)}try{const g=this.getSymKey(n),d=VM({symKey:g,encoded:a,encoding:c==null?void 0:c.encoding});return ma(d)}catch(g){this.logger.error(`Failed to decode message from topic: '${n}', clientId: '${await this.getClientId()}'`),this.logger.error(g)}},this.getPayloadType=(n,a=Ls)=>{const c=wc({encoded:n,encoding:a});return wa(c.type)},this.getPayloadSenderPublicKey=(n,a=Ls)=>{const c=wc({encoded:n,encoding:a});return c.senderPublicKey?oO(c.senderPublicKey,Yr):void 0},this.core=e,this.logger=Qr(t,this.name),this.keychain=i||new iN(this.core,this.logger)}get context(){return pi(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(fb)}catch{e=xd(),await this.keychain.set(fb,e)}return rN(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}class sN extends XC{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=nT,this.version=sT,this.initialized=!1,this.storagePrefix=Kn,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const i=await this.getRelayerMessages();typeof i<"u"&&(this.messages=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}},this.set=async(i,n)=>{this.isInitialized();const a=hs(n);let c=this.messages.get(i);return typeof c>"u"&&(c={}),typeof c[a]<"u"||(c[a]=n,this.messages.set(i,c),await this.persist()),a},this.get=i=>{this.isInitialized();let n=this.messages.get(i);return typeof n>"u"&&(n={}),n},this.has=(i,n)=>{this.isInitialized();const a=this.get(i),c=hs(n);return typeof a[c]<"u"},this.del=async i=>{this.isInitialized(),this.messages.delete(i),await this.persist()},this.logger=Qr(e,this.name),this.core=t}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,u3(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?f3(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}class aN extends ZC{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new Vi.EventEmitter,this.name=oT,this.queue=new Map,this.publishTimeout=Ae.toMiliseconds(Ae.ONE_MINUTE),this.failedPublishTimeout=Ae.toMiliseconds(Ae.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(i,n,a)=>{var c;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:n,opts:a}});const f=(a==null?void 0:a.ttl)||aT,g=Sd(a),d=(a==null?void 0:a.prompt)||!1,m=(a==null?void 0:a.tag)||0,w=(a==null?void 0:a.id)||da().toString(),O={topic:i,message:n,opts:{ttl:f,relay:g,prompt:d,tag:m,id:w,attestation:a==null?void 0:a.attestation}},C=`Failed to publish payload, please try again. id:${w} tag:${m}`,P=Date.now();let q,K=1;try{for(;q===void 0;){if(Date.now()-P>this.publishTimeout)throw new Error(C);this.logger.trace({id:w,attempts:K},`publisher.publish - attempt ${K}`),q=await await ro(this.rpcPublish(i,n,f,g,d,m,w,a==null?void 0:a.attestation).catch(Y=>this.logger.warn(Y)),this.publishTimeout,C),K++,q||await new Promise(Y=>setTimeout(Y,this.failedPublishTimeout))}this.relayer.events.emit(Jr.publish,O),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:w,topic:i,message:n,opts:a}})}catch(Y){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(Y),(c=a==null?void 0:a.internal)!=null&&c.throwOnFailedPublish)throw Y;this.queue.set(w,O)}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.relayer=e,this.logger=Qr(t,this.name),this.registerEventListeners()}get context(){return pi(this.logger)}rpcPublish(e,t,i,n,a,c,f,g){var d,m,w,O;const C={method:cc(n.protocol).publish,params:{topic:e,message:t,ttl:i,prompt:a,tag:c,attestation:g},id:f};return fi((d=C.params)==null?void 0:d.prompt)&&((m=C.params)==null||delete m.prompt),fi((w=C.params)==null?void 0:w.tag)&&((O=C.params)==null||delete O.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:C}),this.relayer.request(C)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:i,opts:n}=e;await this.publish(t,i,n)})}registerEventListeners(){this.relayer.core.heartbeat.on(So.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Jr.connection_stalled);return}this.checkQueue()}),this.relayer.on(Jr.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class oN{constructor(){this.map=new Map,this.set=(e,t)=>{const i=this.get(e);this.exists(e,t)||this.map.set(e,[...i,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const i=this.get(e);if(!this.exists(e,t))return;const n=i.filter(a=>a!==t);if(!n.length){this.map.delete(e);return}this.map.set(e,n)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var cN=Object.defineProperty,uN=Object.defineProperties,fN=Object.getOwnPropertyDescriptors,mb=Object.getOwnPropertySymbols,hN=Object.prototype.hasOwnProperty,lN=Object.prototype.propertyIsEnumerable,yb=(r,e,t)=>e in r?cN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,nc=(r,e)=>{for(var t in e||(e={}))hN.call(e,t)&&yb(r,t,e[t]);if(mb)for(var t of mb(e))lN.call(e,t)&&yb(r,t,e[t]);return r},Xl=(r,e)=>uN(r,fN(e));class dN extends rP{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new oN,this.events=new Vi.EventEmitter,this.name=pT,this.version=gT,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Kn,this.subscribeTimeout=Ae.toMiliseconds(Ae.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(i,n)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}});try{const a=Sd(n),c={topic:i,relay:a,transportType:n==null?void 0:n.transportType};this.pending.set(i,c);const f=await this.rpcSubscribe(i,a,n==null?void 0:n.transportType);return typeof f=="string"&&(this.onSubscribe(f,c),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}})),f}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),typeof(n==null?void 0:n.id)<"u"?await this.unsubscribeById(i,n.id,n):await this.unsubscribeByTopic(i,n)},this.isSubscribed=async i=>{if(this.topics.includes(i))return!0;const n=`${this.pendingSubscriptionWatchLabel}_${i}`;return await new Promise((a,c)=>{const f=new Ae.Watch;f.start(n);const g=setInterval(()=>{!this.pending.has(i)&&this.topics.includes(i)&&(clearInterval(g),f.stop(n),a(!0)),f.elapsed(n)>=bT&&(clearInterval(g),f.stop(n),c(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Qr(t,this.name),this.clientId=""}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let i=!1;try{i=this.getSubscription(e).topic===t}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const i=this.topicMap.get(e);await Promise.all(i.map(async n=>await this.unsubscribeById(e,n,t)))}async unsubscribeById(e,t,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}});try{const n=Sd(i);await this.rpcUnsubscribe(e,t,n);const a=Lt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}})}catch(n){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(n),n}}async rpcSubscribe(e,t,i=Kt.relay){i===Kt.relay&&await this.restartToComplete();const n={method:cc(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{const a=hs(e+this.clientId);return i===Kt.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(n).catch(c=>this.logger.warn(c))},Ae.toMiliseconds(Ae.ONE_SECOND)),a):await await ro(this.relayer.request(n).catch(c=>this.logger.warn(c)),this.subscribeTimeout)?a:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Jr.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,i={method:cc(t.protocol).batchSubscribe,params:{topics:e.map(n=>n.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await ro(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)}catch{this.relayer.events.emit(Jr.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t=e[0].relay,i={method:cc(t.protocol).batchFetchMessages,params:{topics:e.map(a=>a.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});let n;try{n=await await ro(this.relayer.request(i).catch(a=>this.logger.warn(a)),this.subscribeTimeout)}catch{this.relayer.events.emit(Jr.connection_stalled)}return n}rpcUnsubscribe(e,t,i){const n={method:cc(i.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,Xl(nc({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,nc({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,i){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,i),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,nc({},t)),this.topicMap.set(t.topic,e),this.events.emit(Pn.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:i}=De("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(Pn.deleted,Xl(nc({},i),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Pn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=De("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);Hn(t)&&this.onBatchSubscribe(t.map((i,n)=>Xl(nc({},e[n]),{id:i})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(t.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(So.pulse,async()=>{await this.checkPending()}),this.events.on(Pn.created,async e=>{const t=Pn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(Pn.deleted,async e=>{const t=Pn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var pN=Object.defineProperty,wb=Object.getOwnPropertySymbols,gN=Object.prototype.hasOwnProperty,bN=Object.prototype.propertyIsEnumerable,_b=(r,e,t)=>e in r?pN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,vN=(r,e)=>{for(var t in e||(e={}))gN.call(e,t)&&_b(r,t,e[t]);if(wb)for(var t of wb(e))bN.call(e,t)&&_b(r,t,e[t]);return r};class mN extends eP{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Vi.EventEmitter,this.name=uT,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=Ae.toMiliseconds(Ae.THIRTY_SECONDS+Ae.ONE_SECOND),this.request=async t=>{var i,n;this.logger.debug("Publishing Request Payload");const a=t.id||da().toString();await this.toEstablishConnection();try{const c=this.provider.request(t);this.requestsInFlight.set(a,{promise:c,request:t}),this.logger.trace({id:a,method:t.method,topic:(i=t.params)==null?void 0:i.topic},"relayer.request - attempt to publish...");const f=await new Promise(async(g,d)=>{const m=()=>{d(new Error(`relayer.request - publish interrupted, id: ${a}`))};this.provider.on(Li.disconnect,m);const w=await c;this.provider.off(Li.disconnect,m),g(w)});return this.logger.trace({id:a,method:t.method,topic:(n=t.params)==null?void 0:n.topic},"relayer.request - published"),f}catch(c){throw this.logger.debug(`Failed to Publish Request: ${a}`),c}finally{this.requestsInFlight.delete(a)}},this.resetPingTimeout=()=>{if(yf())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var t,i,n;(n=(i=(t=this.provider)==null?void 0:t.connection)==null?void 0:i.socket)==null||n.terminate()},this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Jr.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(Jr.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Li.payload,this.onPayloadHandler),this.provider.on(Li.connect,this.onConnectHandler),this.provider.on(Li.disconnect,this.onDisconnectHandler),this.provider.on(Li.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Qr(e.logger,this.name):Uc(Zf({level:e.logger||cT})),this.messages=new sN(this.logger,e.core),this.subscriber=new dN(this,this.logger),this.publisher=new aN(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||E2,this.projectId=e.projectId,this.bundleId=TA(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return pi(this.logger)}get connected(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===1}get connecting(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===0}async publish(e,t,i){this.isInitialized(),await this.publisher.publish(e,t,i),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:Kt.relay})}async subscribe(e,t){var i;this.isInitialized(),(t==null?void 0:t.transportType)==="relay"&&await this.toEstablishConnection();let n=((i=this.subscriber.topicMap.get(e))==null?void 0:i[0])||"",a;const c=f=>{f.topic===e&&(this.subscriber.off(Pn.created,c),a())};return await Promise.all([new Promise(f=>{a=f,this.subscriber.on(Pn.created,c)}),new Promise(async f=>{n=await this.subscriber.subscribe(e,t)||n,f()})]),n}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}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 transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await ro(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(t,i)=>{const n=()=>{this.provider.off(Li.disconnect,n),i(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Li.disconnect,n),await ro(this.provider.connect(),Ae.toMiliseconds(Ae.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(a=>{i(a)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(a=>{this.logger.error(a),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,t()})}catch(t){this.logger.error(t);const i=t;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(i.message))throw t}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Kg())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const t=e.sort((i,n)=>i.publishedAt-n.publishedAt);this.logger.trace(`Batch of ${t.length} message events sorted`);for(const i of t)try{await this.onMessageEvent(i)}catch(n){this.logger.warn(n)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){const{topic:i}=e;if(!t.sessionExists){const n=br(Ae.FIVE_MINUTES),a={topic:i,expiry:n,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(i,a)}this.events.emit(Jr.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,t,i,n,a;if(yf())try{(t=(e=this.provider)==null?void 0:e.connection)!=null&&t.socket&&((a=(n=(i=this.provider)==null?void 0:i.connection)==null?void 0:n.socket)==null||a.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(c){this.logger.warn(c)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new vn(new WO($A({sdkVersion:Td,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:i}=e;await this.messages.set(t,i)}async shouldIgnoreMessageEvent(e){const{topic:t,message:i}=e;if(!i||i.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const n=this.messages.has(t,i);return n&&this.logger.debug(`Ignoring duplicate message: ${i}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),p0(e)){if(!e.method.endsWith(fT))return;const t=e.params,{topic:i,message:n,publishedAt:a,attestation:c}=t.data,f={topic:i,message:n,publishedAt:a,transportType:Kt.relay,attestation:c};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(vN({type:"event",event:t.id},f)),this.events.emit(t.id,f),await this.acknowledgePayload(e),await this.onMessageEvent(f)}else ih(e)&&this.events.emit(Jr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Jr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=th(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(Li.payload,this.onPayloadHandler),this.provider.off(Li.connect,this.onConnectHandler),this.provider.off(Li.disconnect,this.onDisconnectHandler),this.provider.off(Li.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Kg();zI(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(i=>this.logger.error(i)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Jr.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},Ae.toMiliseconds(hT))))}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var yN=Object.defineProperty,Db=Object.getOwnPropertySymbols,wN=Object.prototype.hasOwnProperty,_N=Object.prototype.propertyIsEnumerable,Eb=(r,e,t)=>e in r?yN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ab=(r,e)=>{for(var t in e||(e={}))wN.call(e,t)&&Eb(r,t,e[t]);if(Db)for(var t of Db(e))_N.call(e,t)&&Eb(r,t,e[t]);return r};class Ma extends tP{constructor(e,t,i,n=Kn,a=void 0){super(e,t,i,n),this.core=e,this.logger=t,this.name=i,this.map=new Map,this.version=lT,this.cached=[],this.initialized=!1,this.storagePrefix=Kn,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(c=>{this.getKey&&c!==null&&!fi(c)?this.map.set(this.getKey(c),c):mI(c)?this.map.set(c.id,c):yI(c)&&this.map.set(c.topic,c)}),this.cached=[],this.initialized=!0)},this.set=async(c,f)=>{this.isInitialized(),this.map.has(c)?await this.update(c,f):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:c,value:f}),this.map.set(c,f),await this.persist())},this.get=c=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:c}),this.getData(c)),this.getAll=c=>(this.isInitialized(),c?this.values.filter(f=>Object.keys(c).every(g=>QO(f[g],c[g]))):this.values),this.update=async(c,f)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:c,update:f});const g=Ab(Ab({},this.getData(c)),f);this.map.set(c,g),await this.persist()},this.delete=async(c,f)=>{this.isInitialized(),this.map.has(c)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:c,reason:f}),this.map.delete(c),this.addToRecentlyDeleted(c),await this.persist())},this.logger=Qr(t,this.name),this.storagePrefix=n,this.getKey=a}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:n}=De("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}const{message:i}=De("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:t}=De("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}class DN{constructor(e,t){this.core=e,this.logger=t,this.name=vT,this.version=mT,this.events=new Fd,this.initialized=!1,this.storagePrefix=Kn,this.ignoredPayloadTypes=[bs],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]},this.create=async i=>{this.isInitialized();const n=xd(),a=await this.core.crypto.setSymKey(n),c=br(Ae.FIVE_MINUTES),f={protocol:D2},g={topic:a,expiry:c,relay:f,active:!1,methods:i==null?void 0:i.methods},d=Lg({protocol:this.core.protocol,version:this.core.version,topic:a,symKey:n,relay:f,expiryTimestamp:c,methods:i==null?void 0:i.methods});return this.events.emit(ha.create,g),this.core.expirer.set(a,c),await this.pairings.set(a,g),await this.core.relayer.subscribe(a,{transportType:i==null?void 0:i.transportType}),{topic:a,uri:d}},this.pair=async i=>{this.isInitialized();const n=this.core.eventClient.createEvent({properties:{topic:i==null?void 0:i.uri,trace:[Sn.pairing_started]}});this.isValidPair(i,n);const{topic:a,symKey:c,relay:f,expiryTimestamp:g,methods:d}=qg(i.uri);n.props.properties.topic=a,n.addTrace(Sn.pairing_uri_validation_success),n.addTrace(Sn.pairing_uri_not_expired);let m;if(this.pairings.keys.includes(a)){if(m=this.pairings.get(a),n.addTrace(Sn.existing_pairing),m.active)throw n.setError(us.active_pairing_already_exists),new Error(`Pairing already exists: ${a}. Please try again with a new connection URI.`);n.addTrace(Sn.pairing_not_expired)}const w=g||br(Ae.FIVE_MINUTES),O={topic:a,relay:f,expiry:w,active:!1,methods:d};this.core.expirer.set(a,w),await this.pairings.set(a,O),n.addTrace(Sn.store_new_pairing),i.activatePairing&&await this.activate({topic:a}),this.events.emit(ha.create,O),n.addTrace(Sn.emit_inactive_pairing),this.core.crypto.keychain.has(a)||await this.core.crypto.setSymKey(c,a),n.addTrace(Sn.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{n.setError(us.no_internet_connection)}try{await this.core.relayer.subscribe(a,{relay:f})}catch(C){throw n.setError(us.subscribe_pairing_topic_failure),C}return n.addTrace(Sn.subscribe_pairing_topic_success),O},this.activate=async({topic:i})=>{this.isInitialized();const n=br(Ae.THIRTY_DAYS);this.core.expirer.set(i,n),await this.pairings.update(i,{active:!0,expiry:n})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:n}=i;if(this.pairings.keys.includes(n)){const a=await this.sendRequest(n,"wc_pairingPing",{}),{done:c,resolve:f,reject:g}=fa();this.events.once(xt("pairing_ping",a),({error:d})=>{d?g(d):f()}),await c()}},this.updateExpiry=async({topic:i,expiry:n})=>{this.isInitialized(),await this.pairings.update(i,{expiry:n})},this.updateMetadata=async({topic:i,metadata:n})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:n})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:n}=i;this.pairings.keys.includes(n)&&(await this.sendRequest(n,"wc_pairingDelete",Lt("USER_DISCONNECTED")),await this.deletePairing(n))},this.formatUriFromPairing=i=>{this.isInitialized();const{topic:n,relay:a,expiry:c,methods:f}=i,g=this.core.crypto.keychain.get(n);return Lg({protocol:this.core.protocol,version:this.core.version,topic:n,symKey:g,relay:a,expiryTimestamp:c,methods:f})},this.sendRequest=async(i,n,a)=>{const c=Fs(n,a),f=await this.core.crypto.encode(i,c),g=rc[n].req;return this.core.history.set(i,c),this.core.relayer.publish(i,f,g),c.id},this.sendResult=async(i,n,a)=>{const c=th(i,a),f=await this.core.crypto.encode(n,c),g=await this.core.history.get(n,i),d=rc[g.request.method].res;await this.core.relayer.publish(n,f,d),await this.core.history.resolve(c)},this.sendError=async(i,n,a)=>{const c=rh(i,a),f=await this.core.crypto.encode(n,c),g=await this.core.history.get(n,i),d=rc[g.request.method]?rc[g.request.method].res:rc.unregistered_method.res;await this.core.relayer.publish(n,f,d),await this.core.history.resolve(c)},this.deletePairing=async(i,n)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,Lt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(i),n?Promise.resolve():this.core.expirer.del(i)])},this.cleanup=async()=>{const i=this.pairings.getAll().filter(n=>Rs(n.expiry));await Promise.all(i.map(n=>this.deletePairing(n.topic)))},this.onRelayEventRequest=i=>{const{topic:n,payload:a}=i;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(n,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(n,a);default:return this.onUnknownRpcMethodRequest(n,a)}},this.onRelayEventResponse=async i=>{const{topic:n,payload:a}=i,c=(await this.core.history.get(n,a.id)).request.method;switch(c){case"wc_pairingPing":return this.onPairingPingResponse(n,a);default:return this.onUnknownRpcMethodResponse(c)}},this.onPairingPingRequest=async(i,n)=>{const{id:a}=n;try{this.isValidPing({topic:i}),await this.sendResult(a,i,!0),this.events.emit(ha.ping,{id:a,topic:i})}catch(c){await this.sendError(a,i,c),this.logger.error(c)}},this.onPairingPingResponse=(i,n)=>{const{id:a}=n;setTimeout(()=>{Cn(n)?this.events.emit(xt("pairing_ping",a),{}):ji(n)&&this.events.emit(xt("pairing_ping",a),{error:n.error})},500)},this.onPairingDeleteRequest=async(i,n)=>{const{id:a}=n;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(ha.delete,{id:a,topic:i})}catch(c){await this.sendError(a,i,c),this.logger.error(c)}},this.onUnknownRpcMethodRequest=async(i,n)=>{const{id:a,method:c}=n;try{if(this.registeredMethods.includes(c))return;const f=Lt("WC_METHOD_UNSUPPORTED",c);await this.sendError(a,i,f),this.logger.error(f)}catch(f){await this.sendError(a,i,f),this.logger.error(f)}},this.onUnknownRpcMethodResponse=i=>{this.registeredMethods.includes(i)||this.logger.error(Lt("WC_METHOD_UNSUPPORTED",i))},this.isValidPair=(i,n)=>{var a;if(!ci(i)){const{message:f}=De("MISSING_OR_INVALID",`pair() params: ${i}`);throw n.setError(us.malformed_pairing_uri),new Error(f)}if(!vI(i.uri)){const{message:f}=De("MISSING_OR_INVALID",`pair() uri: ${i.uri}`);throw n.setError(us.malformed_pairing_uri),new Error(f)}const c=qg(i==null?void 0:i.uri);if(!((a=c==null?void 0:c.relay)!=null&&a.protocol)){const{message:f}=De("MISSING_OR_INVALID","pair() uri#relay-protocol");throw n.setError(us.malformed_pairing_uri),new Error(f)}if(!(c!=null&&c.symKey)){const{message:f}=De("MISSING_OR_INVALID","pair() uri#symKey");throw n.setError(us.malformed_pairing_uri),new Error(f)}if(c!=null&&c.expiryTimestamp&&Ae.toMiliseconds(c==null?void 0:c.expiryTimestamp){if(!ci(i)){const{message:a}=De("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(a)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidDisconnect=async i=>{if(!ci(i)){const{message:a}=De("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(a)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidPairingTopic=async i=>{if(!ur(i,!1)){const{message:n}=De("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(n)}if(!this.pairings.keys.includes(i)){const{message:n}=De("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(n)}if(Rs(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:n}=De("EXPIRED",`pairing topic: ${i}`);throw new Error(n)}},this.core=e,this.logger=Qr(t,this.name),this.pairings=new Ma(this.core,this.logger,this.name,this.storagePrefix)}get context(){return pi(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Jr.message,async e=>{const{topic:t,message:i,transportType:n}=e;if(!this.pairings.keys.includes(t)||n===Kt.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;const a=await this.core.crypto.decode(t,i);try{p0(a)?(this.core.history.set(t,a),this.onRelayEventRequest({topic:t,payload:a})):ih(a)&&(await this.core.history.resolve(a),await this.onRelayEventResponse({topic:t,payload:a}),this.core.history.delete(t,a.id))}catch(c){this.logger.error(c)}})}registerExpirerEvents(){this.core.expirer.on(Fi.expired,async e=>{const{topic:t}=l3(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(ha.expire,{topic:t}))})}}class EN extends QC{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new Vi.EventEmitter,this.name=yT,this.version=wT,this.cached=[],this.initialized=!1,this.storagePrefix=Kn,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(i,n,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:i,request:n,chainId:a}),this.records.has(n.id))return;const c={id:n.id,topic:i,request:{method:n.method,params:n.params||null},chainId:a,expiry:br(Ae.THIRTY_DAYS)};this.records.set(c.id,c),this.persist(),this.events.emit(un.created,c)},this.resolve=async i=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:i}),!this.records.has(i.id))return;const n=await this.getRecord(i.id);typeof n.response>"u"&&(n.response=ji(i)?{error:i.error}:{result:i.result},this.records.set(n.id,n),this.persist(),this.events.emit(un.updated,n))},this.get=async(i,n)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:i,id:n}),await this.getRecord(n)),this.delete=(i,n)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:n}),this.values.forEach(a=>{if(a.topic===i){if(typeof n<"u"&&a.id!==n)return;this.records.delete(a.id),this.events.emit(un.deleted,a)}}),this.persist()},this.exists=async(i,n)=>(this.isInitialized(),this.records.has(n)?(await this.getRecord(n)).topic===i:!1),this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=Qr(t,this.name)}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const i={topic:t.topic,request:Fs(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:i}=De("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(un.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=De("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(un.created,e=>{const t=un.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(un.updated,e=>{const t=un.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(un.deleted,e=>{const t=un.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(So.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{Ae.toMiliseconds(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(un.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}class AN extends iP{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new Vi.EventEmitter,this.name=_T,this.version=DT,this.cached=[],this.initialized=!1,this.storagePrefix=Kn,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=i=>{try{const n=this.formatTarget(i);return typeof this.getExpiration(n)<"u"}catch{return!1}},this.set=(i,n)=>{this.isInitialized();const a=this.formatTarget(i),c={target:a,expiry:n};this.expirations.set(a,c),this.checkExpiry(a,c),this.events.emit(Fi.created,{target:a,expiration:c})},this.get=i=>{this.isInitialized();const n=this.formatTarget(i);return this.getExpiration(n)},this.del=i=>{if(this.isInitialized(),this.has(i)){const n=this.formatTarget(i),a=this.getExpiration(n);this.expirations.delete(n),this.events.emit(Fi.deleted,{target:n,expiration:a})}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=Qr(t,this.name)}get context(){return pi(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return UA(e);if(typeof e=="number")return qA(e);const{message:t}=De("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Fi.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=De("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:i}=De("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(i),new Error(i)}return t}checkExpiry(e,t){const{expiry:i}=t;Ae.toMiliseconds(i)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Fi.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(So.pulse,()=>this.checkExpirations()),this.events.on(Fi.created,e=>{const t=Fi.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Fi.expired,e=>{const t=Fi.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Fi.deleted,e=>{const t=Fi.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.getLocalStorage=Qt.getLocalStorageOrThrow=Qt.getCrypto=Qt.getCryptoOrThrow=Qt.getLocation=Qt.getLocationOrThrow=Qt.getNavigator=Qt.getNavigatorOrThrow=B2=Qt.getDocument=Qt.getDocumentOrThrow=Qt.getFromWindowOrThrow=Qt.getFromWindow=void 0;function Ia(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}Qt.getFromWindow=Ia;function Mo(r){const e=Ia(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}Qt.getFromWindowOrThrow=Mo;function xN(){return Mo("document")}Qt.getDocumentOrThrow=xN;function SN(){return Ia("document")}var B2=Qt.getDocument=SN;function MN(){return Mo("navigator")}Qt.getNavigatorOrThrow=MN;function IN(){return Ia("navigator")}Qt.getNavigator=IN;function CN(){return Mo("location")}Qt.getLocationOrThrow=CN;function PN(){return Ia("location")}Qt.getLocation=PN;function ON(){return Mo("crypto")}Qt.getCryptoOrThrow=ON;function TN(){return Ia("crypto")}Qt.getCrypto=TN;function RN(){return Mo("localStorage")}Qt.getLocalStorageOrThrow=RN;function NN(){return Ia("localStorage")}Qt.getLocalStorage=NN;class BN extends nP{constructor(e,t,i){super(e,t,i),this.core=e,this.logger=t,this.store=i,this.name=ET,this.verifyUrlV3=xT,this.storagePrefix=Kn,this.version=_2,this.init=async()=>{var n;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Ae.toMiliseconds((n=this.publicKey)==null?void 0:n.expiresAt){if(!Oc()||this.isDevEnv)return;const a=window.location.origin,{id:c,decryptedId:f}=n,g=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${a}&id=${c}&decryptedId=${f}`;try{const d=B2(),m=this.startAbortTimer(Ae.ONE_SECOND*5),w=await new Promise((O,C)=>{const P=()=>{window.removeEventListener("message",K),d.body.removeChild(q),C("attestation aborted")};this.abortController.signal.addEventListener("abort",P);const q=d.createElement("iframe");q.src=g,q.style.display="none",q.addEventListener("error",P,{signal:this.abortController.signal});const K=Y=>{if(Y.data&&typeof Y.data=="string")try{const z=JSON.parse(Y.data);if(z.type==="verify_attestation"){if(md(z.attestation).payload.id!==c)return;clearInterval(m),d.body.removeChild(q),this.abortController.signal.removeEventListener("abort",P),window.removeEventListener("message",K),O(z.attestation===null?"":z.attestation)}}catch(z){this.logger.warn(z)}};d.body.appendChild(q),window.addEventListener("message",K,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",w),w}catch(d){this.logger.warn(d)}return""},this.resolve=async n=>{if(this.isDevEnv)return"";const{attestationId:a,hash:c,encryptedId:f}=n;if(a===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(a){if(md(a).payload.id!==f)return;const d=await this.isValidJwtAttestation(a);if(d){if(!d.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return d}}if(!c)return;const g=this.getVerifyUrl(n==null?void 0:n.verifyUrl);return this.fetchAttestation(c,g)},this.fetchAttestation=async(n,a)=>{this.logger.debug(`resolving attestation: ${n} from url: ${a}`);const c=this.startAbortTimer(Ae.ONE_SECOND*5),f=await fetch(`${a}/attestation/${n}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(c),f.status===200?await f.json():void 0},this.getVerifyUrl=n=>{let a=n||gc;return ST.includes(a)||(this.logger.info(`verify url: ${a}, not included in trusted list, assigning default: ${gc}`),a=gc),a},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const n=this.startAbortTimer(Ae.FIVE_SECONDS),a=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(n),await a.json()}catch(n){this.logger.warn(n)}},this.persistPublicKey=async n=>{this.logger.debug("persisting public key to local storage",n),await this.store.setItem(this.storeKey,n),this.publicKey=n},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async n=>{const a=await this.getPublicKey();try{if(a)return this.validateAttestation(n,a)}catch(f){this.logger.error(f),this.logger.warn("error validating attestation")}const c=await this.fetchAndPersistPublicKey();try{if(c)return this.validateAttestation(n,c)}catch(f){this.logger.error(f),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async a=>{const c=await this.fetchPublicKey();c&&(await this.persistPublicKey(c),a(c))});const n=await this.fetchPromise;return this.fetchPromise=void 0,n},this.validateAttestation=(n,a)=>{const c=XM(n,a.publicKey),f={hasExpired:Ae.toMiliseconds(c.exp)this.abortController.abort(),Ae.toMiliseconds(e))}}class $N extends sP{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=MT,this.registerDeviceToken=async i=>{const{clientId:n,token:a,notificationType:c,enableEncrypted:f=!1}=i,g=`${IT}/${this.projectId}/clients`;await fetch(g,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:n,type:c,token:a,always_raw:f})})},this.logger=Qr(t,this.context)}}var UN=Object.defineProperty,xb=Object.getOwnPropertySymbols,qN=Object.prototype.hasOwnProperty,LN=Object.prototype.propertyIsEnumerable,Sb=(r,e,t)=>e in r?UN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,sc=(r,e)=>{for(var t in e||(e={}))qN.call(e,t)&&Sb(r,t,e[t]);if(xb)for(var t of xb(e))LN.call(e,t)&&Sb(r,t,e[t]);return r};class FN extends aP{constructor(e,t,i=!0){super(e,t,i),this.core=e,this.logger=t,this.context=PT,this.storagePrefix=Kn,this.storageVersion=CT,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!r0())try{const n={eventId:ig(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:c3(this.core.relayer.protocol,this.core.relayer.version,Td)}}};await this.sendEvent([n])}catch(n){this.logger.warn(n)}},this.createEvent=n=>{const{event:a="ERROR",type:c="",properties:{topic:f,trace:g}}=n,d=ig(),m=this.core.projectId||"",w=Date.now(),O=sc({eventId:d,timestamp:w,props:{event:a,type:c,properties:{topic:f,trace:g}},bundleId:m,domain:this.getAppDomain()},this.setMethods(d));return this.telemetryEnabled&&(this.events.set(d,O),this.shouldPersist=!0),O},this.getEvent=n=>{const{eventId:a,topic:c}=n;if(a)return this.events.get(a);const f=Array.from(this.events.values()).find(g=>g.props.properties.topic===c);if(f)return sc(sc({},f),this.setMethods(f.eventId))},this.deleteEvent=n=>{const{eventId:a}=n;this.events.delete(a),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(So.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(n=>{Ae.fromMiliseconds(Date.now())-Ae.fromMiliseconds(n.timestamp)>OT&&(this.events.delete(n.eventId),this.shouldPersist=!0)})})},this.setMethods=n=>({addTrace:a=>this.addTrace(n,a),setError:a=>this.setError(n,a)}),this.addTrace=(n,a)=>{const c=this.events.get(n);c&&(c.props.properties.trace.push(a),this.events.set(n,c),this.shouldPersist=!0)},this.setError=(n,a)=>{const c=this.events.get(n);c&&(c.props.type=a,c.timestamp=Date.now(),this.events.set(n,c),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const n=await this.core.storage.getItem(this.storageKey)||[];if(!n.length)return;n.forEach(a=>{this.events.set(a.eventId,sc(sc({},a),this.setMethods(a.eventId)))})}catch(n){this.logger.warn(n)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const n=[];for(const[a,c]of this.events)c.props.type&&n.push(c);if(n.length!==0)try{if((await this.sendEvent(n)).ok)for(const a of n)this.events.delete(a.eventId),this.shouldPersist=!0}catch(a){this.logger.warn(a)}},this.sendEvent=async n=>{const a=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${TT}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${Td}${a}`,{method:"POST",body:JSON.stringify(n)})},this.getAppDomain=()=>o3().url,this.logger=Qr(t,this.context),this.telemetryEnabled=i,i?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var zN=Object.defineProperty,Mb=Object.getOwnPropertySymbols,jN=Object.prototype.hasOwnProperty,kN=Object.prototype.propertyIsEnumerable,Ib=(r,e,t)=>e in r?zN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Cb=(r,e)=>{for(var t in e||(e={}))jN.call(e,t)&&Ib(r,t,e[t]);if(Mb)for(var t of Mb(e))kN.call(e,t)&&Ib(r,t,e[t]);return r};class b0 extends YC{constructor(e){var t;super(e),this.protocol=w2,this.version=_2,this.name=g0,this.events=new Vi.EventEmitter,this.initialized=!1,this.on=(c,f)=>this.events.on(c,f),this.once=(c,f)=>this.events.once(c,f),this.off=(c,f)=>this.events.off(c,f),this.removeListener=(c,f)=>this.events.removeListener(c,f),this.dispatchEnvelope=({topic:c,message:f,sessionExists:g})=>{if(!c||!f)return;const d={topic:c,message:f,publishedAt:Date.now(),transportType:Kt.link_mode};this.relayer.onLinkMessageEvent(d,{sessionExists:g})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||E2,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=Zf({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:XO.logger}),{logger:n,chunkLoggerController:a}=WC({opts:i,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=a,(t=this.logChunkController)!=null&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var c,f;(c=this.logChunkController)!=null&&c.downloadLogsBlobInBrowser&&((f=this.logChunkController)==null||f.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=Qr(n,this.name),this.heartbeat=new KI,this.crypto=new nN(this,this.logger,e==null?void 0:e.keychain),this.history=new EN(this,this.logger),this.expirer=new AN(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new _C(Cb(Cb({},ZO),e==null?void 0:e.storageOptions)),this.relayer=new mN({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new DN(this,this.logger),this.verify=new BN(this,this.logger,this.storage),this.echoClient=new $N(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new FN(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const t=new b0(e);await t.initialize();const i=await t.crypto.getClientId();return await t.storage.setItem(dT,i),t}get context(){return pi(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(hb,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(hb)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const HN=b0,$2="wc",U2=2,q2="client",v0=`${$2}@${U2}:${q2}:`,Zl={name:q2,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},Pb="WALLETCONNECT_DEEPLINK_CHOICE",KN="proposal",L2="Proposal expired",VN="session",Ya=Ae.SEVEN_DAYS,GN="engine",wr={wc_sessionPropose:{req:{ttl:Ae.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Ae.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Ae.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Ae.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Ae.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Ae.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Ae.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Ae.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Ae.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Ae.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Ae.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Ae.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Ae.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Ae.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Ae.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Ae.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Ae.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Ae.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Ae.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Ae.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Ae.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Ae.FIVE_MINUTES,prompt:!1,tag:1119}}},ed={min:Ae.FIVE_MINUTES,max:Ae.SEVEN_DAYS},xn={idle:"IDLE",active:"ACTIVE"},JN="request",WN=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],YN="wc",QN="auth",XN="authKeys",ZN="pairingTopics",eB="requests",sh=`${YN}@${1.5}:${QN}:`,hf=`${sh}:PUB_KEY`;var tB=Object.defineProperty,rB=Object.defineProperties,iB=Object.getOwnPropertyDescriptors,Ob=Object.getOwnPropertySymbols,nB=Object.prototype.hasOwnProperty,sB=Object.prototype.propertyIsEnumerable,Tb=(r,e,t)=>e in r?tB(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,rr=(r,e)=>{for(var t in e||(e={}))nB.call(e,t)&&Tb(r,t,e[t]);if(Ob)for(var t of Ob(e))sB.call(e,t)&&Tb(r,t,e[t]);return r},hn=(r,e)=>rB(r,iB(e));class aB extends cP{constructor(e){super(e),this.name=GN,this.events=new Fd,this.initialized=!1,this.requestQueue={state:xn.idle,queue:[]},this.sessionRequestQueue={state:xn.idle,queue:[]},this.requestQueueDelay=Ae.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(wr)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Ae.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const i=hn(rr({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(i);const{pairingTopic:n,requiredNamespaces:a,optionalNamespaces:c,sessionProperties:f,relays:g}=i;let d=n,m,w=!1;try{d&&(w=this.client.core.pairing.pairings.get(d).active)}catch(B){throw this.client.logger.error(`connect() -> pairing.get(${d}) failed`),B}if(!d||!w){const{topic:B,uri:j}=await this.client.core.pairing.create();d=B,m=j}if(!d){const{message:B}=De("NO_MATCHING_KEY",`connect() pairing topic: ${d}`);throw new Error(B)}const O=await this.client.core.crypto.generateKeyPair(),C=wr.wc_sessionPropose.req.ttl||Ae.FIVE_MINUTES,P=br(C),q=rr({requiredNamespaces:a,optionalNamespaces:c,relays:g??[{protocol:D2}],proposer:{publicKey:O,metadata:this.client.metadata},expiryTimestamp:P,pairingTopic:d},f&&{sessionProperties:f}),{reject:K,resolve:Y,done:z}=fa(C,L2);this.events.once(xt("session_connect"),async({error:B,session:j})=>{if(B)K(B);else if(j){j.self.publicKey=O;const k=hn(rr({},j),{pairingTopic:q.pairingTopic,requiredNamespaces:q.requiredNamespaces,optionalNamespaces:q.optionalNamespaces,transportType:Kt.relay});await this.client.session.set(j.topic,k),await this.setExpiry(j.topic,j.expiry),d&&await this.client.core.pairing.updateMetadata({topic:d,metadata:j.peer.metadata}),this.cleanupDuplicatePairings(k),Y(k)}});const W=await this.sendRequest({topic:d,method:"wc_sessionPropose",params:q,throwOnFailedPublish:!0});return await this.setProposal(W,rr({id:W},q)),{uri:m,approval:z}},this.pair=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(t)}catch(i){throw this.client.logger.error("pair() failed"),i}},this.approve=async t=>{var i,n,a;const c=this.client.core.eventClient.createEvent({properties:{topic:(i=t==null?void 0:t.id)==null?void 0:i.toString(),trace:[fn.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(N){throw c.setError(ca.no_internet_connection),N}try{await this.isValidProposalId(t==null?void 0:t.id)}catch(N){throw this.client.logger.error(`approve() -> proposal.get(${t==null?void 0:t.id}) failed`),c.setError(ca.proposal_not_found),N}try{await this.isValidApprove(t)}catch(N){throw this.client.logger.error("approve() -> isValidApprove() failed"),c.setError(ca.session_approve_namespace_validation_failure),N}const{id:f,relayProtocol:g,namespaces:d,sessionProperties:m,sessionConfig:w}=t,O=this.client.proposal.get(f);this.client.core.eventClient.deleteEvent({eventId:c.eventId});const{pairingTopic:C,proposer:P,requiredNamespaces:q,optionalNamespaces:K}=O;let Y=(n=this.client.core.eventClient)==null?void 0:n.getEvent({topic:C});Y||(Y=(a=this.client.core.eventClient)==null?void 0:a.createEvent({type:fn.session_approve_started,properties:{topic:C,trace:[fn.session_approve_started,fn.session_namespaces_validation_success]}}));const z=await this.client.core.crypto.generateKeyPair(),W=P.publicKey,B=await this.client.core.crypto.generateSharedKey(z,W),j=rr(rr({relay:{protocol:g??"irn"},namespaces:d,controller:{publicKey:z,metadata:this.client.metadata},expiry:br(Ya)},m&&{sessionProperties:m}),w&&{sessionConfig:w}),k=Kt.relay;Y.addTrace(fn.subscribing_session_topic);try{await this.client.core.relayer.subscribe(B,{transportType:k})}catch(N){throw Y.setError(ca.subscribe_session_topic_failure),N}Y.addTrace(fn.subscribe_session_topic_success);const _=hn(rr({},j),{topic:B,requiredNamespaces:q,optionalNamespaces:K,pairingTopic:C,acknowledged:!1,self:j.controller,peer:{publicKey:P.publicKey,metadata:P.metadata},controller:z,transportType:Kt.relay});await this.client.session.set(B,_),Y.addTrace(fn.store_session);try{Y.addTrace(fn.publishing_session_settle),await this.sendRequest({topic:B,method:"wc_sessionSettle",params:j,throwOnFailedPublish:!0}).catch(N=>{throw Y==null||Y.setError(ca.session_settle_publish_failure),N}),Y.addTrace(fn.session_settle_publish_success),Y.addTrace(fn.publishing_session_approve),await this.sendResult({id:f,topic:C,result:{relay:{protocol:g??"irn"},responderPublicKey:z},throwOnFailedPublish:!0}).catch(N=>{throw Y==null||Y.setError(ca.session_approve_publish_failure),N}),Y.addTrace(fn.session_approve_publish_success)}catch(N){throw this.client.logger.error(N),this.client.session.delete(B,Lt("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(B),N}return this.client.core.eventClient.deleteEvent({eventId:Y.eventId}),await this.client.core.pairing.updateMetadata({topic:C,metadata:P.metadata}),await this.client.proposal.delete(f,Lt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:C}),await this.setExpiry(B,br(Ya)),{topic:B,acknowledged:()=>Promise.resolve(this.client.session.get(B))}},this.reject=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(t)}catch(c){throw this.client.logger.error("reject() -> isValidReject() failed"),c}const{id:i,reason:n}=t;let a;try{a=this.client.proposal.get(i).pairingTopic}catch(c){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),c}a&&(await this.sendError({id:i,topic:a,error:n,rpcOpts:wr.wc_sessionPropose.reject}),await this.client.proposal.delete(i,Lt("USER_DISCONNECTED")))},this.update=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(t)}catch(w){throw this.client.logger.error("update() -> isValidUpdate() failed"),w}const{topic:i,namespaces:n}=t,{done:a,resolve:c,reject:f}=fa(),g=Bs(),d=da().toString(),m=this.client.session.get(i).namespaces;return this.events.once(xt("session_update",g),({error:w})=>{w?f(w):c()}),await this.client.session.update(i,{namespaces:n}),await this.sendRequest({topic:i,method:"wc_sessionUpdate",params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:g,relayRpcId:d}).catch(w=>{this.client.logger.error(w),this.client.session.update(i,{namespaces:m}),f(w)}),{acknowledged:a}},this.extend=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(t)}catch(g){throw this.client.logger.error("extend() -> isValidExtend() failed"),g}const{topic:i}=t,n=Bs(),{done:a,resolve:c,reject:f}=fa();return this.events.once(xt("session_extend",n),({error:g})=>{g?f(g):c()}),await this.setExpiry(i,br(Ya)),this.sendRequest({topic:i,method:"wc_sessionExtend",params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(g=>{f(g)}),{acknowledged:a}},this.request=async t=>{this.isInitialized();try{await this.isValidRequest(t)}catch(P){throw this.client.logger.error("request() -> isValidRequest() failed"),P}const{chainId:i,request:n,topic:a,expiry:c=wr.wc_sessionRequest.req.ttl}=t,f=this.client.session.get(a);(f==null?void 0:f.transportType)===Kt.relay&&await this.confirmOnlineStateOrThrow();const g=Bs(),d=da().toString(),{done:m,resolve:w,reject:O}=fa(c,"Request expired. Please try again.");this.events.once(xt("session_request",g),({error:P,result:q})=>{P?O(P):w(q)});const C=this.getAppLinkIfEnabled(f.peer.metadata,f.transportType);return C?(await this.sendRequest({clientRpcId:g,relayRpcId:d,topic:a,method:"wc_sessionRequest",params:{request:hn(rr({},n),{expiryTimestamp:br(c)}),chainId:i},expiry:c,throwOnFailedPublish:!0,appLink:C}).catch(P=>O(P)),this.client.events.emit("session_request_sent",{topic:a,request:n,chainId:i,id:g}),await m()):await Promise.all([new Promise(async P=>{await this.sendRequest({clientRpcId:g,relayRpcId:d,topic:a,method:"wc_sessionRequest",params:{request:hn(rr({},n),{expiryTimestamp:br(c)}),chainId:i},expiry:c,throwOnFailedPublish:!0}).catch(q=>O(q)),this.client.events.emit("session_request_sent",{topic:a,request:n,chainId:i,id:g}),P()}),new Promise(async P=>{var q;if(!((q=f.sessionConfig)!=null&&q.disableDeepLink)){const K=await zA(this.client.core.storage,Pb);await LA({id:g,topic:a,wcDeepLink:K})}P()}),m()]).then(P=>P[2])},this.respond=async t=>{this.isInitialized(),await this.isValidRespond(t);const{topic:i,response:n}=t,{id:a}=n,c=this.client.session.get(i);c.transportType===Kt.relay&&await this.confirmOnlineStateOrThrow();const f=this.getAppLinkIfEnabled(c.peer.metadata,c.transportType);Cn(n)?await this.sendResult({id:a,topic:i,result:n.result,throwOnFailedPublish:!0,appLink:f}):ji(n)&&await this.sendError({id:a,topic:i,error:n.error,appLink:f}),this.cleanupAfterResponse(t)},this.ping=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(t)}catch(n){throw this.client.logger.error("ping() -> isValidPing() failed"),n}const{topic:i}=t;if(this.client.session.keys.includes(i)){const n=Bs(),a=da().toString(),{done:c,resolve:f,reject:g}=fa();this.events.once(xt("session_ping",n),({error:d})=>{d?g(d):f()}),await Promise.all([this.sendRequest({topic:i,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:n,relayRpcId:a}),c()])}else this.client.core.pairing.pairings.keys.includes(i)&&await this.client.core.pairing.ping({topic:i})},this.emit=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(t);const{topic:i,event:n,chainId:a}=t,c=da().toString();await this.sendRequest({topic:i,method:"wc_sessionEvent",params:{event:n,chainId:a},throwOnFailedPublish:!0,relayRpcId:c})},this.disconnect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(t);const{topic:i}=t;if(this.client.session.keys.includes(i))await this.sendRequest({topic:i,method:"wc_sessionDelete",params:Lt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:i,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(i))await this.client.core.pairing.disconnect({topic:i});else{const{message:n}=De("MISMATCHED_TOPIC",`Session or pairing topic not found: ${i}`);throw new Error(n)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(i=>gI(i,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(t,i)=>{var n;this.isInitialized(),this.isValidAuthenticate(t);const a=i&&this.client.core.linkModeSupportedApps.includes(i)&&((n=this.client.metadata.redirect)==null?void 0:n.linkMode),c=a?Kt.link_mode:Kt.relay;c===Kt.relay&&await this.confirmOnlineStateOrThrow();const{chains:f,statement:g="",uri:d,domain:m,nonce:w,type:O,exp:C,nbf:P,methods:q=[],expiry:K}=t,Y=[...t.resources||[]],{topic:z,uri:W}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:c});this.client.logger.info({message:"Generated new pairing",pairing:{topic:z,uri:W}});const B=await this.client.core.crypto.generateKeyPair(),j=cf(B);if(await Promise.all([this.client.auth.authKeys.set(hf,{responseTopic:j,publicKey:B}),this.client.auth.pairingTopics.set(j,{topic:j,pairingTopic:z})]),await this.client.core.relayer.subscribe(j,{transportType:c}),this.client.logger.info(`sending request to new pairing topic: ${z}`),q.length>0){const{namespace:M}=fc(f[0]);let x=$M(M,"request",q);of(Y)&&(x=qM(x,Y.pop())),Y.push(x)}const k=K&&K>wr.wc_sessionAuthenticate.req.ttl?K:wr.wc_sessionAuthenticate.req.ttl,_={authPayload:{type:O??"caip122",chains:f,statement:g,aud:d,domain:m,version:"1",nonce:w,iat:new Date().toISOString(),exp:C,nbf:P,resources:Y},requester:{publicKey:B,metadata:this.client.metadata},expiryTimestamp:br(k)},N={eip155:{chains:f,methods:[...new Set(["personal_sign",...q])],events:["chainChanged","accountsChanged"]}},se={requiredNamespaces:{},optionalNamespaces:N,relays:[{protocol:"irn"}],pairingTopic:z,proposer:{publicKey:B,metadata:this.client.metadata},expiryTimestamp:br(wr.wc_sessionPropose.req.ttl)},{done:le,resolve:U,reject:y}=fa(k,"Request expired"),u=async({error:M,session:x})=>{if(this.events.off(xt("session_request",v),h),M)y(M);else if(x){x.self.publicKey=B,await this.client.session.set(x.topic,x),await this.setExpiry(x.topic,x.expiry),z&&await this.client.core.pairing.updateMetadata({topic:z,metadata:x.peer.metadata});const p=this.client.session.get(x.topic);await this.deleteProposal(E),U({session:p})}},h=async M=>{var x,p,b;if(await this.deletePendingAuthRequest(v,{message:"fulfilled",code:0}),M.error){const V=Lt("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return M.error.code===V.code?void 0:(this.events.off(xt("session_connect"),u),y(M.error.message))}await this.deleteProposal(E),this.events.off(xt("session_connect"),u);const{cacaos:R,responder:Z}=M.result,ae=[],I=[];for(const V of R){await Cg({cacao:V,projectId:this.client.core.projectId})||(this.client.logger.error(V,"Signature verification failed"),y(Lt("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:G}=V,D=of(G.resources),H=[Ig(G.iss)],ne=Af(G.iss);if(D){const ce=Pg(D),fe=Og(D);ae.push(...ce),H.push(...fe)}for(const ce of H)I.push(`${ce}:${ne}`)}const ee=await this.client.core.crypto.generateSharedKey(B,Z.publicKey);let L;ae.length>0&&(L={topic:ee,acknowledged:!0,self:{publicKey:B,metadata:this.client.metadata},peer:Z,controller:Z.publicKey,expiry:br(Ya),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:z,namespaces:Fg([...new Set(ae)],[...new Set(I)]),transportType:c},await this.client.core.relayer.subscribe(ee,{transportType:c}),await this.client.session.set(ee,L),z&&await this.client.core.pairing.updateMetadata({topic:z,metadata:Z.metadata}),L=this.client.session.get(ee)),(x=this.client.metadata.redirect)!=null&&x.linkMode&&(p=Z.metadata.redirect)!=null&&p.linkMode&&(b=Z.metadata.redirect)!=null&&b.universal&&i&&(this.client.core.addLinkModeSupportedApp(Z.metadata.redirect.universal),this.client.session.update(ee,{transportType:Kt.link_mode})),U({auths:R,session:L})},v=Bs(),E=Bs();this.events.once(xt("session_connect"),u),this.events.once(xt("session_request",v),h);let S;try{if(a){const M=Fs("wc_sessionAuthenticate",_,v);this.client.core.history.set(z,M);const x=await this.client.core.crypto.encode("",M,{type:Bc,encoding:ec});S=Wu(i,z,x)}else await Promise.all([this.sendRequest({topic:z,method:"wc_sessionAuthenticate",params:_,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:v}),this.sendRequest({topic:z,method:"wc_sessionPropose",params:se,expiry:wr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:E})])}catch(M){throw this.events.off(xt("session_connect"),u),this.events.off(xt("session_request",v),h),M}return await this.setProposal(E,rr({id:E},se)),await this.setAuthRequest(v,{request:hn(rr({},_),{verifyContext:{}}),pairingTopic:z,transportType:c}),{uri:S??W,response:le}},this.approveSessionAuthenticate=async t=>{const{id:i,auths:n}=t,a=this.client.core.eventClient.createEvent({properties:{topic:i.toString(),trace:[ua.authenticated_session_approve_started]}});try{this.isInitialized()}catch(K){throw a.setError(ic.no_internet_connection),K}const c=this.getPendingAuthRequest(i);if(!c)throw a.setError(ic.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${i}`);const f=c.transportType||Kt.relay;f===Kt.relay&&await this.confirmOnlineStateOrThrow();const g=c.requester.publicKey,d=await this.client.core.crypto.generateKeyPair(),m=cf(g),w={type:bs,receiverPublicKey:g,senderPublicKey:d},O=[],C=[];for(const K of n){if(!await Cg({cacao:K,projectId:this.client.core.projectId})){a.setError(ic.invalid_cacao);const j=Lt("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:i,topic:m,error:j,encodeOpts:w}),new Error(j.message)}a.addTrace(ua.cacaos_verified);const{p:Y}=K,z=of(Y.resources),W=[Ig(Y.iss)],B=Af(Y.iss);if(z){const j=Pg(z),k=Og(z);O.push(...j),W.push(...k)}for(const j of W)C.push(`${j}:${B}`)}const P=await this.client.core.crypto.generateSharedKey(d,g);a.addTrace(ua.create_authenticated_session_topic);let q;if((O==null?void 0:O.length)>0){q={topic:P,acknowledged:!0,self:{publicKey:d,metadata:this.client.metadata},peer:{publicKey:g,metadata:c.requester.metadata},controller:g,expiry:br(Ya),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:c.pairingTopic,namespaces:Fg([...new Set(O)],[...new Set(C)]),transportType:f},a.addTrace(ua.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(P,{transportType:f})}catch(K){throw a.setError(ic.subscribe_authenticated_session_topic_failure),K}a.addTrace(ua.subscribe_authenticated_session_topic_success),await this.client.session.set(P,q),a.addTrace(ua.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:c.pairingTopic,metadata:c.requester.metadata})}a.addTrace(ua.publishing_authenticated_session_approve);try{await this.sendResult({topic:m,id:i,result:{cacaos:n,responder:{publicKey:d,metadata:this.client.metadata}},encodeOpts:w,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(c.requester.metadata,f)})}catch(K){throw a.setError(ic.authenticated_session_approve_publish_failure),K}return await this.client.auth.requests.delete(i,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:c.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:a.eventId}),{session:q}},this.rejectSessionAuthenticate=async t=>{this.isInitialized();const{id:i,reason:n}=t,a=this.getPendingAuthRequest(i);if(!a)throw new Error(`Could not find pending auth request with id ${i}`);a.transportType===Kt.relay&&await this.confirmOnlineStateOrThrow();const c=a.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),g=cf(c),d={type:bs,receiverPublicKey:c,senderPublicKey:f};await this.sendError({id:i,topic:g,error:n,encodeOpts:d,rpcOpts:wr.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(a.requester.metadata,a.transportType)}),await this.client.auth.requests.delete(i,{message:"rejected",code:0}),await this.client.proposal.delete(i,Lt("USER_DISCONNECTED"))},this.formatAuthMessage=t=>{this.isInitialized();const{request:i,iss:n}=t;return W3(i,n)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const t=this.relayMessageCache.shift();t&&await this.onRelayMessage(t)}catch(t){this.client.logger.error(t)}},50)},this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const i=this.client.core.pairing.pairings.get(t.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(a=>{var c,f;return((c=a.peerMetadata)==null?void 0:c.url)&&((f=a.peerMetadata)==null?void 0:f.url)===t.peer.metadata.url&&a.topic&&a.topic!==i.topic});if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(i){this.client.logger.error(i)}},this.deleteSession=async t=>{var i;const{topic:n,expirerHasDeleted:a=!1,emitEvent:c=!0,id:f=0}=t,{self:g}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,Lt("USER_DISCONNECTED")),this.addToRecentlyDeleted(n,"session"),this.client.core.crypto.keychain.has(g.publicKey)&&await this.client.core.crypto.deleteKeyPair(g.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),a||this.client.core.expirer.del(n),this.client.core.storage.removeItem(Pb).catch(d=>this.client.logger.warn(d)),this.getPendingSessionRequests().forEach(d=>{d.topic===n&&this.deletePendingSessionRequest(d.id,Lt("USER_DISCONNECTED"))}),n===((i=this.sessionRequestQueue.queue[0])==null?void 0:i.topic)&&(this.sessionRequestQueue.state=xn.idle),c&&this.client.events.emit("session_delete",{id:f,topic:n})},this.deleteProposal=async(t,i)=>{if(i)try{const n=this.client.proposal.get(t),a=this.client.core.eventClient.getEvent({topic:n.pairingTopic});a==null||a.setError(ca.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(t,Lt("USER_DISCONNECTED")),i?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")},this.deletePendingSessionRequest=async(t,i,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,i),n?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==t),n&&(this.sessionRequestQueue.state=xn.idle,this.client.events.emit("session_request_expire",{id:t}))},this.deletePendingAuthRequest=async(t,i,n=!1)=>{await Promise.all([this.client.auth.requests.delete(t,i),n?Promise.resolve():this.client.core.expirer.del(t)])},this.setExpiry=async(t,i)=>{this.client.session.keys.includes(t)&&(this.client.core.expirer.set(t,i),await this.client.session.update(t,{expiry:i}))},this.setProposal=async(t,i)=>{this.client.core.expirer.set(t,br(wr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(t,i)},this.setAuthRequest=async(t,i)=>{const{request:n,pairingTopic:a,transportType:c=Kt.relay}=i;this.client.core.expirer.set(t,n.expiryTimestamp),await this.client.auth.requests.set(t,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:t,pairingTopic:a,verifyContext:n.verifyContext,transportType:c})},this.setPendingSessionRequest=async t=>{const{id:i,topic:n,params:a,verifyContext:c}=t,f=a.request.expiryTimestamp||br(wr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(i,f),await this.client.pendingRequest.set(i,{id:i,topic:n,params:a,verifyContext:c})},this.sendRequest=async t=>{const{topic:i,method:n,params:a,expiry:c,relayRpcId:f,clientRpcId:g,throwOnFailedPublish:d,appLink:m}=t,w=Fs(n,a,g);let O;const C=!!m;try{const K=C?ec:Ls;O=await this.client.core.crypto.encode(i,w,{encoding:K})}catch(K){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),K}let P;if(WN.includes(n)){const K=hs(JSON.stringify(w)),Y=hs(O);P=await this.client.core.verify.register({id:Y,decryptedId:K})}const q=wr[n].req;if(q.attestation=P,c&&(q.ttl=c),f&&(q.id=f),this.client.core.history.set(i,w),C){const K=Wu(m,i,O);await globalThis.Linking.openURL(K,this.client.name)}else{const K=wr[n].req;c&&(K.ttl=c),f&&(K.id=f),d?(K.internal=hn(rr({},K.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,O,K)):this.client.core.relayer.publish(i,O,K).catch(Y=>this.client.logger.error(Y))}return w.id},this.sendResult=async t=>{const{id:i,topic:n,result:a,throwOnFailedPublish:c,encodeOpts:f,appLink:g}=t,d=th(i,a);let m;const w=g&&typeof(globalThis==null?void 0:globalThis.Linking)<"u";try{const C=w?ec:Ls;m=await this.client.core.crypto.encode(n,d,hn(rr({},f||{}),{encoding:C}))}catch(C){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),C}let O;try{O=await this.client.core.history.get(n,i)}catch(C){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${i}) failed`),C}if(w){const C=Wu(g,n,m);await globalThis.Linking.openURL(C,this.client.name)}else{const C=wr[O.request.method].res;c?(C.internal=hn(rr({},C.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,m,C)):this.client.core.relayer.publish(n,m,C).catch(P=>this.client.logger.error(P))}await this.client.core.history.resolve(d)},this.sendError=async t=>{const{id:i,topic:n,error:a,encodeOpts:c,rpcOpts:f,appLink:g}=t,d=rh(i,a);let m;const w=g&&typeof(globalThis==null?void 0:globalThis.Linking)<"u";try{const C=w?ec:Ls;m=await this.client.core.crypto.encode(n,d,hn(rr({},c||{}),{encoding:C}))}catch(C){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),C}let O;try{O=await this.client.core.history.get(n,i)}catch(C){throw this.client.logger.error(`sendError() -> history.get(${n}, ${i}) failed`),C}if(w){const C=Wu(g,n,m);await globalThis.Linking.openURL(C,this.client.name)}else{const C=f||wr[O.request.method].res;this.client.core.relayer.publish(n,m,C)}await this.client.core.history.resolve(d)},this.cleanup=async()=>{const t=[],i=[];this.client.session.getAll().forEach(n=>{let a=!1;Rs(n.expiry)&&(a=!0),this.client.core.crypto.keychain.has(n.topic)||(a=!0),a&&t.push(n.topic)}),this.client.proposal.getAll().forEach(n=>{Rs(n.expiryTimestamp)&&i.push(n.id)}),await Promise.all([...t.map(n=>this.deleteSession({topic:n})),...i.map(n=>this.deleteProposal(n))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===xn.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=xn.active;const t=this.requestQueue.queue.shift();if(t)try{await this.processRequest(t)}catch(i){this.client.logger.warn(i)}}this.requestQueue.state=xn.idle},this.processRequest=async t=>{const{topic:i,payload:n,attestation:a,transportType:c,encryptedId:f}=t,g=n.method;if(!this.shouldIgnorePairingRequest({topic:i,requestMethod:g}))switch(g){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:i,payload:n,attestation:a,encryptedId:f});case"wc_sessionSettle":return await this.onSessionSettleRequest(i,n);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(i,n);case"wc_sessionExtend":return await this.onSessionExtendRequest(i,n);case"wc_sessionPing":return await this.onSessionPingRequest(i,n);case"wc_sessionDelete":return await this.onSessionDeleteRequest(i,n);case"wc_sessionRequest":return await this.onSessionRequest({topic:i,payload:n,attestation:a,encryptedId:f,transportType:c});case"wc_sessionEvent":return await this.onSessionEventRequest(i,n);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:i,payload:n,attestation:a,encryptedId:f,transportType:c});default:return this.client.logger.info(`Unsupported request method ${g}`)}},this.onRelayEventResponse=async t=>{const{topic:i,payload:n,transportType:a}=t,c=(await this.client.core.history.get(i,n.id)).request.method;switch(c){case"wc_sessionPropose":return this.onSessionProposeResponse(i,n,a);case"wc_sessionSettle":return this.onSessionSettleResponse(i,n);case"wc_sessionUpdate":return this.onSessionUpdateResponse(i,n);case"wc_sessionExtend":return this.onSessionExtendResponse(i,n);case"wc_sessionPing":return this.onSessionPingResponse(i,n);case"wc_sessionRequest":return this.onSessionRequestResponse(i,n);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(i,n);default:return this.client.logger.info(`Unsupported response method ${c}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:i}=t,{message:n}=De("MISSING_OR_INVALID",`Decoded payload on topic ${i} is not identifiable as a JSON-RPC request or a response.`);throw new Error(n)},this.shouldIgnorePairingRequest=t=>{const{topic:i,requestMethod:n}=t,a=this.expectedPairingMethodMap.get(i);return!a||a.includes(n)?!1:!!(a.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async t=>{const{topic:i,payload:n,attestation:a,encryptedId:c}=t,{params:f,id:g}=n;try{const d=this.client.core.eventClient.getEvent({topic:i});this.isValidConnect(rr({},n.params));const m=f.expiryTimestamp||br(wr.wc_sessionPropose.req.ttl),w=rr({id:g,pairingTopic:i,expiryTimestamp:m},f);await this.setProposal(g,w);const O=await this.getVerifyContext({attestationId:a,hash:hs(JSON.stringify(n)),encryptedId:c,metadata:w.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),d==null||d.setError(us.proposal_listener_not_found)),d==null||d.addTrace(Sn.emit_session_proposal),this.client.events.emit("session_proposal",{id:g,params:w,verifyContext:O})}catch(d){await this.sendError({id:g,topic:i,error:d,rpcOpts:wr.wc_sessionPropose.autoReject}),this.client.logger.error(d)}},this.onSessionProposeResponse=async(t,i,n)=>{const{id:a}=i;if(Cn(i)){const{result:c}=i;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:c});const f=this.client.proposal.get(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:f});const g=f.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:g});const d=c.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:d});const m=await this.client.core.crypto.generateSharedKey(g,d);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:m});const w=await this.client.core.relayer.subscribe(m,{transportType:n});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:w}),await this.client.core.pairing.activate({topic:t})}else if(ji(i)){await this.client.proposal.delete(a,Lt("USER_DISCONNECTED"));const c=xt("session_connect");if(this.events.listenerCount(c)===0)throw new Error(`emitting ${c} without any listeners, 954`);this.events.emit(xt("session_connect"),{error:i.error})}},this.onSessionSettleRequest=async(t,i)=>{const{id:n,params:a}=i;try{this.isValidSessionSettleRequest(a);const{relay:c,controller:f,expiry:g,namespaces:d,sessionProperties:m,sessionConfig:w}=i.params,O=hn(rr(rr({topic:t,relay:c,expiry:g,namespaces:d,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:f.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:f.publicKey,metadata:f.metadata}},m&&{sessionProperties:m}),w&&{sessionConfig:w}),{transportType:Kt.relay}),C=xt("session_connect");if(this.events.listenerCount(C)===0)throw new Error(`emitting ${C} without any listeners 997`);this.events.emit(xt("session_connect"),{session:O}),await this.sendResult({id:i.id,topic:t,result:!0,throwOnFailedPublish:!0})}catch(c){await this.sendError({id:n,topic:t,error:c}),this.client.logger.error(c)}},this.onSessionSettleResponse=async(t,i)=>{const{id:n}=i;Cn(i)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(xt("session_approve",n),{})):ji(i)&&(await this.client.session.delete(t,Lt("USER_DISCONNECTED")),this.events.emit(xt("session_approve",n),{error:i.error}))},this.onSessionUpdateRequest=async(t,i)=>{const{params:n,id:a}=i;try{const c=`${t}_session_update`,f=tc.get(c);if(f&&this.isRequestOutOfSync(f,a)){this.client.logger.info(`Discarding out of sync request - ${a}`),this.sendError({id:a,topic:t,error:Lt("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(rr({topic:t},n));try{tc.set(c,a),await this.client.session.update(t,{namespaces:n.namespaces}),await this.sendResult({id:a,topic:t,result:!0,throwOnFailedPublish:!0})}catch(g){throw tc.delete(c),g}this.client.events.emit("session_update",{id:a,topic:t,params:n})}catch(c){await this.sendError({id:a,topic:t,error:c}),this.client.logger.error(c)}},this.isRequestOutOfSync=(t,i)=>parseInt(i.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,i)=>{const{id:n}=i,a=xt("session_update",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Cn(i)?this.events.emit(xt("session_update",n),{}):ji(i)&&this.events.emit(xt("session_update",n),{error:i.error})},this.onSessionExtendRequest=async(t,i)=>{const{id:n}=i;try{this.isValidExtend({topic:t}),await this.setExpiry(t,br(Ya)),await this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:n,topic:t})}catch(a){await this.sendError({id:n,topic:t,error:a}),this.client.logger.error(a)}},this.onSessionExtendResponse=(t,i)=>{const{id:n}=i,a=xt("session_extend",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Cn(i)?this.events.emit(xt("session_extend",n),{}):ji(i)&&this.events.emit(xt("session_extend",n),{error:i.error})},this.onSessionPingRequest=async(t,i)=>{const{id:n}=i;try{this.isValidPing({topic:t}),await this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:n,topic:t})}catch(a){await this.sendError({id:n,topic:t,error:a}),this.client.logger.error(a)}},this.onSessionPingResponse=(t,i)=>{const{id:n}=i,a=xt("session_ping",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);setTimeout(()=>{Cn(i)?this.events.emit(xt("session_ping",n),{}):ji(i)&&this.events.emit(xt("session_ping",n),{error:i.error})},500)},this.onSessionDeleteRequest=async(t,i)=>{const{id:n}=i;try{this.isValidDisconnect({topic:t,reason:i.params}),Promise.all([new Promise(a=>{this.client.core.relayer.once(Jr.publish,async()=>{a(await this.deleteSession({topic:t,id:n}))})}),this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:Lt("USER_DISCONNECTED")})]).catch(a=>this.client.logger.error(a))}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async t=>{var i,n,a;const{topic:c,payload:f,attestation:g,encryptedId:d,transportType:m}=t,{id:w,params:O}=f;try{await this.isValidRequest(rr({topic:c},O));const C=this.client.session.get(c),P=await this.getVerifyContext({attestationId:g,hash:hs(JSON.stringify(Fs("wc_sessionRequest",O,w))),encryptedId:d,metadata:C.peer.metadata,transportType:m}),q={id:w,topic:c,params:O,verifyContext:P};await this.setPendingSessionRequest(q),m===Kt.link_mode&&(i=C.peer.metadata.redirect)!=null&&i.universal&&this.client.core.addLinkModeSupportedApp((n=C.peer.metadata.redirect)==null?void 0:n.universal),(a=this.client.signConfig)!=null&&a.disableRequestQueue?this.emitSessionRequest(q):(this.addSessionRequestToSessionRequestQueue(q),this.processSessionRequestQueue())}catch(C){await this.sendError({id:w,topic:c,error:C}),this.client.logger.error(C)}},this.onSessionRequestResponse=(t,i)=>{const{id:n}=i,a=xt("session_request",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Cn(i)?this.events.emit(xt("session_request",n),{result:i.result}):ji(i)&&this.events.emit(xt("session_request",n),{error:i.error})},this.onSessionEventRequest=async(t,i)=>{const{id:n,params:a}=i;try{const c=`${t}_session_event_${a.event.name}`,f=tc.get(c);if(f&&this.isRequestOutOfSync(f,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit(rr({topic:t},a)),this.client.events.emit("session_event",{id:n,topic:t,params:a}),tc.set(c,n)}catch(c){await this.sendError({id:n,topic:t,error:c}),this.client.logger.error(c)}},this.onSessionAuthenticateResponse=(t,i)=>{const{id:n}=i;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:t,payload:i}),Cn(i)?this.events.emit(xt("session_request",n),{result:i.result}):ji(i)&&this.events.emit(xt("session_request",n),{error:i.error})},this.onSessionAuthenticateRequest=async t=>{var i;const{topic:n,payload:a,attestation:c,encryptedId:f,transportType:g}=t;try{const{requester:d,authPayload:m,expiryTimestamp:w}=a.params,O=await this.getVerifyContext({attestationId:c,hash:hs(JSON.stringify(a)),encryptedId:f,metadata:d.metadata,transportType:g}),C={requester:d,pairingTopic:n,id:a.id,authPayload:m,verifyContext:O,expiryTimestamp:w};await this.setAuthRequest(a.id,{request:C,pairingTopic:n,transportType:g}),g===Kt.link_mode&&(i=d.metadata.redirect)!=null&&i.universal&&this.client.core.addLinkModeSupportedApp(d.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:n,params:a.params,id:a.id,verifyContext:O})}catch(d){this.client.logger.error(d);const m=a.params.requester.publicKey,w=await this.client.core.crypto.generateKeyPair(),O=this.getAppLinkIfEnabled(a.params.requester.metadata,g),C={type:bs,receiverPublicKey:m,senderPublicKey:w};await this.sendError({id:a.id,topic:n,error:d,encodeOpts:C,rpcOpts:wr.wc_sessionAuthenticate.autoReject,appLink:O})}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=xn.idle,this.processSessionRequestQueue()},Ae.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:i})=>{const n=this.client.core.history.pending;n.length>0&&n.filter(a=>a.topic===t&&a.request.method==="wc_sessionRequest").forEach(a=>{const c=a.request.id,f=xt("session_request",c);if(this.events.listenerCount(f)===0)throw new Error(`emitting ${f} without any listeners`);this.events.emit(xt("session_request",a.request.id),{error:i})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===xn.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=xn.active,this.emitSessionRequest(t)}catch(i){this.client.logger.error(i)}},this.emitSessionRequest=t=>{this.client.events.emit("session_request",t)},this.onPairingCreated=t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;const i=this.client.proposal.getAll().find(n=>n.pairingTopic===t.topic);i&&this.onSessionProposeRequest({topic:t.topic,payload:Fs("wc_sessionPropose",{requiredNamespaces:i.requiredNamespaces,optionalNamespaces:i.optionalNamespaces,relays:i.relays,proposer:i.proposer,sessionProperties:i.sessionProperties},i.id)})},this.isValidConnect=async t=>{if(!ci(t)){const{message:g}=De("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(g)}const{pairingTopic:i,requiredNamespaces:n,optionalNamespaces:a,sessionProperties:c,relays:f}=t;if(fi(i)||await this.isValidPairingTopic(i),!MI(f)){const{message:g}=De("MISSING_OR_INVALID",`connect() relays: ${f}`);throw new Error(g)}!fi(n)&&_c(n)!==0&&this.validateNamespaces(n,"requiredNamespaces"),!fi(a)&&_c(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),fi(c)||this.validateSessionProps(c,"sessionProperties")},this.validateNamespaces=(t,i)=>{const n=SI(t,"connect()",i);if(n)throw new Error(n.message)},this.isValidApprove=async t=>{if(!ci(t))throw new Error(De("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:i,namespaces:n,relayProtocol:a,sessionProperties:c}=t;this.checkRecentlyDeleted(i),await this.isValidProposalId(i);const f=this.client.proposal.get(i),g=Kl(n,"approve()");if(g)throw new Error(g.message);const d=kg(f.requiredNamespaces,n,"approve()");if(d)throw new Error(d.message);if(!ur(a,!0)){const{message:m}=De("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(m)}fi(c)||this.validateSessionProps(c,"sessionProperties")},this.isValidReject=async t=>{if(!ci(t)){const{message:a}=De("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(a)}const{id:i,reason:n}=t;if(this.checkRecentlyDeleted(i),await this.isValidProposalId(i),!CI(n)){const{message:a}=De("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(n)}`);throw new Error(a)}},this.isValidSessionSettleRequest=t=>{if(!ci(t)){const{message:d}=De("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(d)}const{relay:i,controller:n,namespaces:a,expiry:c}=t;if(!i2(i)){const{message:d}=De("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(d)}const f=wI(n,"onSessionSettleRequest()");if(f)throw new Error(f.message);const g=Kl(a,"onSessionSettleRequest()");if(g)throw new Error(g.message);if(Rs(c)){const{message:d}=De("EXPIRED","onSessionSettleRequest()");throw new Error(d)}},this.isValidUpdate=async t=>{if(!ci(t)){const{message:g}=De("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(g)}const{topic:i,namespaces:n}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const a=this.client.session.get(i),c=Kl(n,"update()");if(c)throw new Error(c.message);const f=kg(a.requiredNamespaces,n,"update()");if(f)throw new Error(f.message)},this.isValidExtend=async t=>{if(!ci(t)){const{message:n}=De("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(n)}const{topic:i}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i)},this.isValidRequest=async t=>{if(!ci(t)){const{message:g}=De("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(g)}const{topic:i,request:n,chainId:a,expiry:c}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const{namespaces:f}=this.client.session.get(i);if(!jg(f,a)){const{message:g}=De("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(g)}if(!PI(n)){const{message:g}=De("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw new Error(g)}if(!RI(f,a,n.method)){const{message:g}=De("MISSING_OR_INVALID",`request() method: ${n.method}`);throw new Error(g)}if(c&&!UI(c,ed)){const{message:g}=De("MISSING_OR_INVALID",`request() expiry: ${c}. Expiry must be a number (in seconds) between ${ed.min} and ${ed.max}`);throw new Error(g)}},this.isValidRespond=async t=>{var i;if(!ci(t)){const{message:c}=De("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(c)}const{topic:n,response:a}=t;try{await this.isValidSessionTopic(n)}catch(c){throw(i=t==null?void 0:t.response)!=null&&i.id&&this.cleanupAfterResponse(t),c}if(!OI(a)){const{message:c}=De("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(c)}},this.isValidPing=async t=>{if(!ci(t)){const{message:n}=De("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(n)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidEmit=async t=>{if(!ci(t)){const{message:f}=De("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(f)}const{topic:i,event:n,chainId:a}=t;await this.isValidSessionTopic(i);const{namespaces:c}=this.client.session.get(i);if(!jg(c,a)){const{message:f}=De("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(f)}if(!TI(n)){const{message:f}=De("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(f)}if(!NI(c,a,n.name)){const{message:f}=De("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(f)}},this.isValidDisconnect=async t=>{if(!ci(t)){const{message:n}=De("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(n)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidAuthenticate=t=>{const{chains:i,uri:n,domain:a,nonce:c}=t;if(!Array.isArray(i)||i.length===0)throw new Error("chains is required and must be a non-empty array");if(!ur(n,!1))throw new Error("uri is required parameter");if(!ur(a,!1))throw new Error("domain is required parameter");if(!ur(c,!1))throw new Error("nonce is required parameter");if([...new Set(i.map(g=>fc(g).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:f}=fc(i[0]);if(f!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async t=>{const{attestationId:i,hash:n,encryptedId:a,metadata:c,transportType:f}=t,g={verified:{verifyUrl:c.verifyUrl||gc,validation:"UNKNOWN",origin:c.url||""}};try{if(f===Kt.link_mode){const m=this.getAppLinkIfEnabled(c,f);return g.verified.validation=m&&new URL(m).origin===new URL(c.url).origin?"VALID":"INVALID",g}const d=await this.client.core.verify.resolve({attestationId:i,hash:n,encryptedId:a,verifyUrl:c.verifyUrl});d&&(g.verified.origin=d.origin,g.verified.isScam=d.isScam,g.verified.validation=d.origin===new URL(c.url).origin?"VALID":"INVALID")}catch(d){this.client.logger.warn(d)}return this.client.logger.debug(`Verify context: ${JSON.stringify(g)}`),g},this.validateSessionProps=(t,i)=>{Object.values(t).forEach(n=>{if(!ur(n,!1)){const{message:a}=De("MISSING_OR_INVALID",`${i} must be in Record format. Received: ${JSON.stringify(n)}`);throw new Error(a)}})},this.getPendingAuthRequest=t=>{const i=this.client.auth.requests.get(t);return typeof i=="object"?i:void 0},this.addToRecentlyDeleted=(t,i)=>{if(this.recentlyDeletedMap.set(t,i),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let n=0;const a=this.recentlyDeletedLimit/2;for(const c of this.recentlyDeletedMap.keys()){if(n++>=a)break;this.recentlyDeletedMap.delete(c)}}},this.checkRecentlyDeleted=t=>{const i=this.recentlyDeletedMap.get(t);if(i){const{message:n}=De("MISSING_OR_INVALID",`Record was recently deleted - ${i}: ${t}`);throw new Error(n)}},this.isLinkModeEnabled=(t,i)=>{var n,a,c,f,g,d,m,w,O;return!t||i!==Kt.link_mode?!1:((a=(n=this.client.metadata)==null?void 0:n.redirect)==null?void 0:a.linkMode)===!0&&((f=(c=this.client.metadata)==null?void 0:c.redirect)==null?void 0:f.universal)!==void 0&&((d=(g=this.client.metadata)==null?void 0:g.redirect)==null?void 0:d.universal)!==""&&((m=t==null?void 0:t.redirect)==null?void 0:m.universal)!==void 0&&((w=t==null?void 0:t.redirect)==null?void 0:w.universal)!==""&&((O=t==null?void 0:t.redirect)==null?void 0:O.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(t.redirect.universal)&&typeof(globalThis==null?void 0:globalThis.Linking)<"u"},this.getAppLinkIfEnabled=(t,i)=>{var n;return this.isLinkModeEnabled(t,i)?(n=t==null?void 0:t.redirect)==null?void 0:n.universal:void 0},this.handleLinkModeMessage=({url:t})=>{if(!t||!t.includes("wc_ev")||!t.includes("topic"))return;const i=rg(t,"topic")||"",n=decodeURIComponent(rg(t,"wc_ev")||""),a=this.client.session.keys.includes(i);a&&this.client.session.update(i,{transportType:Kt.link_mode}),this.client.core.dispatchEnvelope({topic:i,message:n,sessionExists:a})},this.registerLinkModeListeners=async()=>{var t;if(r0()||wo()&&(t=this.client.metadata.redirect)!=null&&t.linkMode){const i=globalThis==null?void 0:globalThis.Linking;if(typeof i<"u"){i.addEventListener("url",this.handleLinkModeMessage,this.client.name);const n=await i.getInitialURL();n&&setTimeout(()=>{this.handleLinkModeMessage({url:n})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=De("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Jr.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:t,message:i,attestation:n,transportType:a}=e,{publicKey:c}=this.client.auth.authKeys.keys.includes(hf)?this.client.auth.authKeys.get(hf):{responseTopic:void 0,publicKey:void 0},f=await this.client.core.crypto.decode(t,i,{receiverPublicKey:c,encoding:a===Kt.link_mode?ec:Ls});try{p0(f)?(this.client.core.history.set(t,f),this.onRelayEventRequest({topic:t,payload:f,attestation:n,transportType:a,encryptedId:hs(i)})):ih(f)?(await this.client.core.history.resolve(f),await this.onRelayEventResponse({topic:t,payload:f,transportType:a}),this.client.core.history.delete(t,f.id)):this.onRelayEventUnknownPayload({topic:t,payload:f,transportType:a})}catch(g){this.client.logger.error(g)}}registerExpirerEvents(){this.client.core.expirer.on(Fi.expired,async e=>{const{topic:t,id:i}=l3(e.target);if(i&&this.client.pendingRequest.keys.includes(i))return await this.deletePendingSessionRequest(i,De("EXPIRED"),!0);if(i&&this.client.auth.requests.keys.includes(i))return await this.deletePendingAuthRequest(i,De("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i}))})}registerPairingEvents(){this.client.core.pairing.events.on(ha.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(ha.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!ur(e,!1)){const{message:t}=De("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=De("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Rs(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=De("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!ur(e,!1)){const{message:t}=De("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=De("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(Rs(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=De("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=De("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(ur(e,!1)){const{message:t}=De("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=De("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!II(e)){const{message:t}=De("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=De("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(Rs(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=De("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class oB extends Ma{constructor(e,t){super(e,t,KN,v0),this.core=e,this.logger=t}}class cB extends Ma{constructor(e,t){super(e,t,VN,v0),this.core=e,this.logger=t}}class uB extends Ma{constructor(e,t){super(e,t,JN,v0,i=>i.id),this.core=e,this.logger=t}}class fB extends Ma{constructor(e,t){super(e,t,XN,sh,()=>hf),this.core=e,this.logger=t}}class hB extends Ma{constructor(e,t){super(e,t,ZN,sh),this.core=e,this.logger=t}}class lB extends Ma{constructor(e,t){super(e,t,eB,sh,i=>i.id),this.core=e,this.logger=t}}class dB{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new fB(this.core,this.logger),this.pairingTopics=new hB(this.core,this.logger),this.requests=new lB(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class m0 extends oP{constructor(e){super(e),this.protocol=$2,this.version=U2,this.name=Zl.name,this.events=new Vi.EventEmitter,this.on=(i,n)=>this.events.on(i,n),this.once=(i,n)=>this.events.once(i,n),this.off=(i,n)=>this.events.off(i,n),this.removeListener=(i,n)=>this.events.removeListener(i,n),this.removeAllListeners=i=>this.events.removeAllListeners(i),this.connect=async i=>{try{return await this.engine.connect(i)}catch(n){throw this.logger.error(n.message),n}},this.pair=async i=>{try{return await this.engine.pair(i)}catch(n){throw this.logger.error(n.message),n}},this.approve=async i=>{try{return await this.engine.approve(i)}catch(n){throw this.logger.error(n.message),n}},this.reject=async i=>{try{return await this.engine.reject(i)}catch(n){throw this.logger.error(n.message),n}},this.update=async i=>{try{return await this.engine.update(i)}catch(n){throw this.logger.error(n.message),n}},this.extend=async i=>{try{return await this.engine.extend(i)}catch(n){throw this.logger.error(n.message),n}},this.request=async i=>{try{return await this.engine.request(i)}catch(n){throw this.logger.error(n.message),n}},this.respond=async i=>{try{return await this.engine.respond(i)}catch(n){throw this.logger.error(n.message),n}},this.ping=async i=>{try{return await this.engine.ping(i)}catch(n){throw this.logger.error(n.message),n}},this.emit=async i=>{try{return await this.engine.emit(i)}catch(n){throw this.logger.error(n.message),n}},this.disconnect=async i=>{try{return await this.engine.disconnect(i)}catch(n){throw this.logger.error(n.message),n}},this.find=i=>{try{return this.engine.find(i)}catch(n){throw this.logger.error(n.message),n}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(i){throw this.logger.error(i.message),i}},this.authenticate=async(i,n)=>{try{return await this.engine.authenticate(i,n)}catch(a){throw this.logger.error(a.message),a}},this.formatAuthMessage=i=>{try{return this.engine.formatAuthMessage(i)}catch(n){throw this.logger.error(n.message),n}},this.approveSessionAuthenticate=async i=>{try{return await this.engine.approveSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.rejectSessionAuthenticate=async i=>{try{return await this.engine.rejectSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.name=(e==null?void 0:e.name)||Zl.name,this.metadata=(e==null?void 0:e.metadata)||o3(),this.signConfig=e==null?void 0:e.signConfig;const t=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Uc(Zf({level:(e==null?void 0:e.logger)||Zl.logger}));this.core=(e==null?void 0:e.core)||new HN(e),this.logger=Qr(t,this.name),this.session=new cB(this.core,this.logger),this.proposal=new oB(this.core,this.logger),this.pendingRequest=new uB(this.core,this.logger),this.engine=new aB(this),this.auth=new dB(this.core,this.logger)}static async init(e){const t=new m0(e);return await t.initialize(),t}get context(){return pi(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var Bd={exports:{}};(function(r,e){var t=typeof self<"u"?self:tv,i=function(){function a(){this.fetch=!1,this.DOMException=t.DOMException}return a.prototype=t,new a}();(function(a){(function(c){var f={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function g(h){return h&&DataView.prototype.isPrototypeOf(h)}if(f.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(h){return h&&d.indexOf(Object.prototype.toString.call(h))>-1};function w(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(h))throw new TypeError("Invalid character in header field name");return h.toLowerCase()}function O(h){return typeof h!="string"&&(h=String(h)),h}function C(h){var v={next:function(){var E=h.shift();return{done:E===void 0,value:E}}};return f.iterable&&(v[Symbol.iterator]=function(){return v}),v}function P(h){this.map={},h instanceof P?h.forEach(function(v,E){this.append(E,v)},this):Array.isArray(h)?h.forEach(function(v){this.append(v[0],v[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(v){this.append(v,h[v])},this)}P.prototype.append=function(h,v){h=w(h),v=O(v);var E=this.map[h];this.map[h]=E?E+", "+v:v},P.prototype.delete=function(h){delete this.map[w(h)]},P.prototype.get=function(h){return h=w(h),this.has(h)?this.map[h]:null},P.prototype.has=function(h){return this.map.hasOwnProperty(w(h))},P.prototype.set=function(h,v){this.map[w(h)]=O(v)},P.prototype.forEach=function(h,v){for(var E in this.map)this.map.hasOwnProperty(E)&&h.call(v,this.map[E],E,this)},P.prototype.keys=function(){var h=[];return this.forEach(function(v,E){h.push(E)}),C(h)},P.prototype.values=function(){var h=[];return this.forEach(function(v){h.push(v)}),C(h)},P.prototype.entries=function(){var h=[];return this.forEach(function(v,E){h.push([E,v])}),C(h)},f.iterable&&(P.prototype[Symbol.iterator]=P.prototype.entries);function q(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function K(h){return new Promise(function(v,E){h.onload=function(){v(h.result)},h.onerror=function(){E(h.error)}})}function Y(h){var v=new FileReader,E=K(v);return v.readAsArrayBuffer(h),E}function z(h){var v=new FileReader,E=K(v);return v.readAsText(h),E}function W(h){for(var v=new Uint8Array(h),E=new Array(v.length),S=0;S-1?v:h}function N(h,v){v=v||{};var E=v.body;if(h instanceof N){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,v.headers||(this.headers=new P(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!E&&h._bodyInit!=null&&(E=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=v.credentials||this.credentials||"same-origin",(v.headers||!this.headers)&&(this.headers=new P(v.headers)),this.method=_(v.method||this.method||"GET"),this.mode=v.mode||this.mode||null,this.signal=v.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&E)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(E)}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function se(h){var v=new FormData;return h.trim().split("&").forEach(function(E){if(E){var S=E.split("="),M=S.shift().replace(/\+/g," "),x=S.join("=").replace(/\+/g," ");v.append(decodeURIComponent(M),decodeURIComponent(x))}}),v}function le(h){var v=new P,E=h.replace(/\r?\n[\t ]+/g," ");return E.split(/\r?\n/).forEach(function(S){var M=S.split(":"),x=M.shift().trim();if(x){var p=M.join(":").trim();v.append(x,p)}}),v}j.call(N.prototype);function U(h,v){v||(v={}),this.type="default",this.status=v.status===void 0?200:v.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in v?v.statusText:"OK",this.headers=new P(v.headers),this.url=v.url||"",this._initBody(h)}j.call(U.prototype),U.prototype.clone=function(){return new U(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new P(this.headers),url:this.url})},U.error=function(){var h=new U(null,{status:0,statusText:""});return h.type="error",h};var y=[301,302,303,307,308];U.redirect=function(h,v){if(y.indexOf(v)===-1)throw new RangeError("Invalid status code");return new U(null,{status:v,headers:{location:h}})},c.DOMException=a.DOMException;try{new c.DOMException}catch{c.DOMException=function(v,E){this.message=v,this.name=E;var S=Error(v);this.stack=S.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function u(h,v){return new Promise(function(E,S){var M=new N(h,v);if(M.signal&&M.signal.aborted)return S(new c.DOMException("Aborted","AbortError"));var x=new XMLHttpRequest;function p(){x.abort()}x.onload=function(){var b={status:x.status,statusText:x.statusText,headers:le(x.getAllResponseHeaders()||"")};b.url="responseURL"in x?x.responseURL:b.headers.get("X-Request-URL");var R="response"in x?x.response:x.responseText;E(new U(R,b))},x.onerror=function(){S(new TypeError("Network request failed"))},x.ontimeout=function(){S(new TypeError("Network request failed"))},x.onabort=function(){S(new c.DOMException("Aborted","AbortError"))},x.open(M.method,M.url,!0),M.credentials==="include"?x.withCredentials=!0:M.credentials==="omit"&&(x.withCredentials=!1),"responseType"in x&&f.blob&&(x.responseType="blob"),M.headers.forEach(function(b,R){x.setRequestHeader(R,b)}),M.signal&&(M.signal.addEventListener("abort",p),x.onreadystatechange=function(){x.readyState===4&&M.signal.removeEventListener("abort",p)}),x.send(typeof M._bodyInit>"u"?null:M._bodyInit)})}return u.polyfill=!0,a.fetch||(a.fetch=u,a.Headers=P,a.Request=N,a.Response=U),c.Headers=P,c.Request=N,c.Response=U,c.fetch=u,Object.defineProperty(c,"__esModule",{value:!0}),c})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,r.exports=e})(Bd,Bd.exports);var pB=Bd.exports;const Rb=Ld(pB);var gB=Object.defineProperty,bB=Object.defineProperties,vB=Object.getOwnPropertyDescriptors,Nb=Object.getOwnPropertySymbols,mB=Object.prototype.hasOwnProperty,yB=Object.prototype.propertyIsEnumerable,Bb=(r,e,t)=>e in r?gB(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,$b=(r,e)=>{for(var t in e||(e={}))mB.call(e,t)&&Bb(r,t,e[t]);if(Nb)for(var t of Nb(e))yB.call(e,t)&&Bb(r,t,e[t]);return r},Ub=(r,e)=>bB(r,vB(e));const wB={Accept:"application/json","Content-Type":"application/json"},_B="POST",qb={headers:wB,method:_B},Lb=10;class Wn{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new Vi.EventEmitter,this.isAvailable=!1,this.registering=!1,!ab(e))throw new 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 new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=ys(e),i=await(await Rb(this.url,Ub($b({},qb),{body:t}))).json();this.onPayload({data:i})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!ab(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,n)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),n(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return n(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=ys({id:1,jsonrpc:"2.0",method:"test",params:[]});await Rb(e,Ub($b({},qb),{body:t}))}this.onOpen()}catch(t){const i=this.parseError(t);throw this.events.emit("register_error",i),this.onClose(),i}}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;const t=typeof e.data=="string"?ma(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),n=i.message||i.toString(),a=rh(e,n);this.events.emit("payload",a)}parseError(e,t=this.url){return g2(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>Lb&&this.events.setMaxListeners(Lb)}}const Fb="error",DB="wss://relay.walletconnect.org",EB="wc",AB="universal_provider",zb=`${EB}@2:${AB}:`,F2="https://rpc.walletconnect.org/v1/",Za="generic",xB=`${F2}bundler`,mn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var ac=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},$d={exports:{}};/** +* @license +* Lodash +* Copyright OpenJS Foundation and other contributors +* Released under MIT license +* Based on Underscore.js 1.8.3 +* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +*/(function(r,e){(function(){var t,i="4.17.21",n=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",f="Invalid `variable` option passed into `_.template`",g="__lodash_hash_undefined__",d=500,m="__lodash_placeholder__",w=1,O=2,C=4,P=1,q=2,K=1,Y=2,z=4,W=8,B=16,j=32,k=64,_=128,N=256,se=512,le=30,U="...",y=800,u=16,h=1,v=2,E=3,S=1/0,M=9007199254740991,x=17976931348623157e292,p=NaN,b=4294967295,R=b-1,Z=b>>>1,ae=[["ary",_],["bind",K],["bindKey",Y],["curry",W],["curryRight",B],["flip",se],["partial",j],["partialRight",k],["rearg",N]],I="[object Arguments]",ee="[object Array]",L="[object AsyncFunction]",V="[object Boolean]",G="[object Date]",D="[object DOMException]",H="[object Error]",ne="[object Function]",ce="[object GeneratorFunction]",fe="[object Map]",ye="[object Number]",we="[object Null]",Te="[object Object]",Qe="[object Promise]",Ce="[object Proxy]",Re="[object RegExp]",Se="[object Set]",me="[object String]",Pe="[object Symbol]",Ne="[object Undefined]",be="[object WeakMap]",Oe="[object WeakSet]",xe="[object ArrayBuffer]",ve="[object DataView]",qe="[object Float32Array]",Me="[object Float64Array]",_e="[object Int8Array]",He="[object Int16Array]",Ve="[object Int32Array]",Ee="[object Uint8Array]",Ke="[object Uint8ClampedArray]",ht="[object Uint16Array]",Ge="[object Uint32Array]",_t=/\b__p \+= '';/g,lt=/\b(__p \+=) '' \+/g,We=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Et=/&(?:amp|lt|gt|quot|#39);/g,St=/[&<>"']/g,Be=RegExp(Et.source),Xe=RegExp(St.source),tt=/<%-([\s\S]+?)%>/g,$e=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,Ze=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fe=/^\w*$/,ut=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/[\\^$.*+?()[\]{}|]/g,ze=RegExp(rt.source),it=/^\s+/,st=/\s/,Ue=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ye=/\{\n\/\* \[wrapped with (.+)\] \*/,ft=/,? & /,je=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Rt=/[()=,{}\[\]\/\s]/,Nt=/\\(\\)?/g,at=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,vt=/\w*$/,Rr=/^[-+]0x[0-9a-f]+$/i,Nr=/^0b[01]+$/i,Br=/^\[object .+?Constructor\]$/,$r=/^0o[0-7]+$/i,Ur=/^(?:0|[1-9]\d*)$/,er=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xr=/($^)/,Wi=/['\n\r\u2028\u2029\\]/g,Zr="\\ud800-\\udfff",Yi="\\u0300-\\u036f",Qi="\\ufe20-\\ufe2f",ei="\\u20d0-\\u20ff",Mi=Yi+Qi+ei,Ii="\\u2700-\\u27bf",lr="a-z\\xdf-\\xf6\\xf8-\\xff",Xi="\\xac\\xb1\\xd7\\xf7",Zi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",en="\\u2000-\\u206f",Ks=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",zc="A-Z\\xc0-\\xd6\\xd8-\\xde",jc="\\ufe0e\\ufe0f",Vs=Xi+Zi+en+Ks,Io="['’]",Gs="["+Zr+"]",Co="["+Vs+"]",Js="["+Mi+"]",kc="\\d+",ah="["+Ii+"]",Hc="["+lr+"]",Kc="[^"+Zr+Vs+kc+Ii+lr+zc+"]",Pa="\\ud83c[\\udffb-\\udfff]",oh="(?:"+Js+"|"+Pa+")",Vc="[^"+Zr+"]",Oa="(?:\\ud83c[\\udde6-\\uddff]){2}",_s="[\\ud800-\\udbff][\\udc00-\\udfff]",gi="["+zc+"]",Gc="\\u200d",Jc="(?:"+Hc+"|"+Kc+")",yn="(?:"+gi+"|"+Kc+")",Wc="(?:"+Io+"(?:d|ll|m|re|s|t|ve))?",Yc="(?:"+Io+"(?:D|LL|M|RE|S|T|VE))?",Qc=oh+"?",Xc="["+jc+"]?",ch="(?:"+Gc+"(?:"+[Vc,Oa,_s].join("|")+")"+Xc+Qc+")*",Yn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",eu=Xc+Qc+ch,Ta="(?:"+[ah,Oa,_s].join("|")+")"+eu,uh="(?:"+[Vc+Js+"?",Js,Oa,_s,Gs].join("|")+")",Po=RegExp(Io,"g"),fh=RegExp(Js,"g"),Ra=RegExp(Pa+"(?="+Pa+")|"+uh+eu,"g"),tu=RegExp([gi+"?"+Hc+"+"+Wc+"(?="+[Co,gi,"$"].join("|")+")",yn+"+"+Yc+"(?="+[Co,gi+Jc,"$"].join("|")+")",gi+"?"+Jc+"+"+Wc,gi+"+"+Yc,Zc,Yn,kc,Ta].join("|"),"g"),ru=RegExp("["+Gc+Zr+Mi+jc+"]"),Ws=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,iu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],hh=-1,zt={};zt[qe]=zt[Me]=zt[_e]=zt[He]=zt[Ve]=zt[Ee]=zt[Ke]=zt[ht]=zt[Ge]=!0,zt[I]=zt[ee]=zt[xe]=zt[V]=zt[ve]=zt[G]=zt[H]=zt[ne]=zt[fe]=zt[ye]=zt[Te]=zt[Re]=zt[Se]=zt[me]=zt[be]=!1;var Ft={};Ft[I]=Ft[ee]=Ft[xe]=Ft[ve]=Ft[V]=Ft[G]=Ft[qe]=Ft[Me]=Ft[_e]=Ft[He]=Ft[Ve]=Ft[fe]=Ft[ye]=Ft[Te]=Ft[Re]=Ft[Se]=Ft[me]=Ft[Pe]=Ft[Ee]=Ft[Ke]=Ft[ht]=Ft[Ge]=!0,Ft[H]=Ft[ne]=Ft[be]=!1;var J={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},te={"&":"&","<":"<",">":">",'"':""","'":"'"},pe={"&":"&","<":"<",">":">",""":'"',"'":"'"},Le={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jt=parseFloat,pt=parseInt,Wt=typeof ac=="object"&&ac&&ac.Object===Object&&ac,fr=typeof self=="object"&&self&&self.Object===Object&&self,Ot=Wt||fr||Function("return this")(),kt=e&&!e.nodeType&&e,sr=kt&&!0&&r&&!r.nodeType&&r,ti=sr&&sr.exports===kt,hr=ti&&Wt.process,Yt=function(){try{var re=sr&&sr.require&&sr.require("util").types;return re||hr&&hr.binding&&hr.binding("util")}catch{}}(),kr=Yt&&Yt.isArrayBuffer,tn=Yt&&Yt.isDate,Ci=Yt&&Yt.isMap,wn=Yt&&Yt.isRegExp,Oo=Yt&&Yt.isSet,Ys=Yt&&Yt.isTypedArray;function vr(re,ue,oe){switch(oe.length){case 0:return re.call(ue);case 1:return re.call(ue,oe[0]);case 2:return re.call(ue,oe[0],oe[1]);case 3:return re.call(ue,oe[0],oe[1],oe[2])}return re.apply(ue,oe)}function k2(re,ue,oe,ke){for(var dt=-1,Bt=re==null?0:re.length;++dt-1}function lh(re,ue,oe){for(var ke=-1,dt=re==null?0:re.length;++ke-1;);return oe}function I0(re,ue){for(var oe=re.length;oe--&&Na(ue,re[oe],0)>-1;);return oe}function X2(re,ue){for(var oe=re.length,ke=0;oe--;)re[oe]===ue&&++ke;return ke}var Z2=bh(J),em=bh(te);function tm(re){return"\\"+Le[re]}function rm(re,ue){return re==null?t:re[ue]}function Ba(re){return ru.test(re)}function im(re){return Ws.test(re)}function nm(re){for(var ue,oe=[];!(ue=re.next()).done;)oe.push(ue.value);return oe}function wh(re){var ue=-1,oe=Array(re.size);return re.forEach(function(ke,dt){oe[++ue]=[dt,ke]}),oe}function C0(re,ue){return function(oe){return re(ue(oe))}}function As(re,ue){for(var oe=-1,ke=re.length,dt=0,Bt=[];++oe-1}function Km(s,o){var l=this.__data__,A=_u(l,s);return A<0?(++this.size,l.push([s,o])):l[A][1]=o,this}Qn.prototype.clear=zm,Qn.prototype.delete=jm,Qn.prototype.get=km,Qn.prototype.has=Hm,Qn.prototype.set=Km;function Xn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o=o?s:o)),s}function Ri(s,o,l,A,T,F){var Q,X=o&w,ie=o&O,he=o&C;if(l&&(Q=T?l(s,A,T,F):l(s)),Q!==t)return Q;if(!Zt(s))return s;var de=gt(s);if(de){if(Q=Wy(s),!X)return ri(s,Q)}else{var ge=Lr(s),Ie=ge==ne||ge==ce;if(Ps(s))return hp(s,X);if(ge==Te||ge==I||Ie&&!T){if(Q=ie||Ie?{}:Pp(s),!X)return ie?qy(s,oy(Q,s)):Uy(s,z0(Q,s))}else{if(!Ft[ge])return T?s:{};Q=Yy(s,ge,X)}}F||(F=new nn);var Je=F.get(s);if(Je)return Je;F.set(s,Q),s1(s)?s.forEach(function(ct){Q.add(Ri(ct,o,l,ct,s,F))}):i1(s)&&s.forEach(function(ct,At){Q.set(At,Ri(ct,o,l,At,s,F))});var ot=he?ie?Vh:Kh:ie?ni:mr,wt=de?t:ot(s);return Pi(wt||s,function(ct,At){wt&&(At=ct,ct=s[At]),qo(Q,At,Ri(ct,o,l,At,s,F))}),Q}function cy(s){var o=mr(s);return function(l){return j0(l,s,o)}}function j0(s,o,l){var A=l.length;if(s==null)return!A;for(s=Ht(s);A--;){var T=l[A],F=o[T],Q=s[T];if(Q===t&&!(T in s)||!F(Q))return!1}return!0}function k0(s,o,l){if(typeof s!="function")throw new Oi(c);return Ko(function(){s.apply(t,l)},o)}function Lo(s,o,l,A){var T=-1,F=nu,Q=!0,X=s.length,ie=[],he=o.length;if(!X)return ie;l&&(o=Xt(o,bi(l))),A?(F=lh,Q=!1):o.length>=n&&(F=To,Q=!1,o=new Zs(o));e:for(;++TT?0:T+l),A=A===t||A>T?T:yt(A),A<0&&(A+=T),A=l>A?0:o1(A);l0&&l(X)?o>1?xr(X,o-1,l,A,T):Es(T,X):A||(T[T.length]=X)}return T}var Mh=vp(),V0=vp(!0);function _n(s,o){return s&&Mh(s,o,mr)}function Ih(s,o){return s&&V0(s,o,mr)}function Eu(s,o){return Ds(o,function(l){return is(s[l])})}function ta(s,o){o=Is(o,s);for(var l=0,A=o.length;s!=null&&lo}function hy(s,o){return s!=null&&qt.call(s,o)}function ly(s,o){return s!=null&&o in Ht(s)}function dy(s,o,l){return s>=qr(o,l)&&s=120&&de.length>=120)?new Zs(Q&&de):t}de=s[0];var ge=-1,Ie=X[0];e:for(;++ge-1;)X!==s&&pu.call(X,ie,1),pu.call(s,ie,1);return s}function ip(s,o){for(var l=s?o.length:0,A=l-1;l--;){var T=o[l];if(l==A||T!==F){var F=T;rs(T)?pu.call(s,T,1):qh(s,T)}}return s}function Bh(s,o){return s+vu(U0()*(o-s+1))}function Sy(s,o,l,A){for(var T=-1,F=pr(bu((o-s)/(l||1)),0),Q=oe(F);F--;)Q[A?F:++T]=s,s+=l;return Q}function $h(s,o){var l="";if(!s||o<1||o>M)return l;do o%2&&(l+=s),o=vu(o/2),o&&(s+=s);while(o);return l}function Dt(s,o){return Zh(Rp(s,o,si),s+"")}function My(s){return F0(Va(s))}function Iy(s,o){var l=Va(s);return Nu(l,ea(o,0,l.length))}function jo(s,o,l,A){if(!Zt(s))return s;o=Is(o,s);for(var T=-1,F=o.length,Q=F-1,X=s;X!=null&&++TT?0:T+o),l=l>T?T:l,l<0&&(l+=T),T=o>l?0:l-o>>>0,o>>>=0;for(var F=oe(T);++A>>1,Q=s[F];Q!==null&&!mi(Q)&&(l?Q<=o:Q=n){var he=o?null:jy(s);if(he)return au(he);Q=!1,T=To,ie=new Zs}else ie=o?[]:X;e:for(;++A=A?s:Ni(s,o,l)}var fp=ym||function(s){return Ot.clearTimeout(s)};function hp(s,o){if(o)return s.slice();var l=s.length,A=T0?T0(l):new s.constructor(l);return s.copy(A),A}function jh(s){var o=new s.constructor(s.byteLength);return new lu(o).set(new lu(s)),o}function Ry(s,o){var l=o?jh(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.byteLength)}function Ny(s){var o=new s.constructor(s.source,vt.exec(s));return o.lastIndex=s.lastIndex,o}function By(s){return Uo?Ht(Uo.call(s)):{}}function lp(s,o){var l=o?jh(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.length)}function dp(s,o){if(s!==o){var l=s!==t,A=s===null,T=s===s,F=mi(s),Q=o!==t,X=o===null,ie=o===o,he=mi(o);if(!X&&!he&&!F&&s>o||F&&Q&&ie&&!X&&!he||A&&Q&&ie||!l&&ie||!T)return 1;if(!A&&!F&&!he&&s=X)return ie;var he=l[A];return ie*(he=="desc"?-1:1)}}return s.index-o.index}function pp(s,o,l,A){for(var T=-1,F=s.length,Q=l.length,X=-1,ie=o.length,he=pr(F-Q,0),de=oe(ie+he),ge=!A;++X1?l[T-1]:t,Q=T>2?l[2]:t;for(F=s.length>3&&typeof F=="function"?(T--,F):t,Q&&Kr(l[0],l[1],Q)&&(F=T<3?t:F,T=1),o=Ht(o);++A-1?T[F?o[Q]:Q]:t}}function wp(s){return ts(function(o){var l=o.length,A=l,T=Ti.prototype.thru;for(s&&o.reverse();A--;){var F=o[A];if(typeof F!="function")throw new Oi(c);if(T&&!Q&&Tu(F)=="wrapper")var Q=new Ti([],!0)}for(A=Q?A:l;++A1&&Tt.reverse(),de&&ieX))return!1;var he=F.get(s),de=F.get(o);if(he&&de)return he==o&&de==s;var ge=-1,Ie=!0,Je=l&q?new Zs:t;for(F.set(s,o),F.set(o,s);++ge1?"& ":"")+o[A],o=o.join(l>2?", ":" "),s.replace(Ue,`{ +/* [wrapped with `+o+`] */ +`)}function Xy(s){return gt(s)||na(s)||!!(B0&&s&&s[B0])}function rs(s,o){var l=typeof s;return o=o??M,!!o&&(l=="number"||l!="symbol"&&Ur.test(s))&&s>-1&&s%1==0&&s0){if(++o>=y)return arguments[0]}else o=0;return s.apply(t,arguments)}}function Nu(s,o){var l=-1,A=s.length,T=A-1;for(o=o===t?A:o;++l1?s[o-1]:t;return l=typeof l=="function"?(s.pop(),l):t,Kp(s,l)});function Vp(s){var o=$(s);return o.__chain__=!0,o}function u8(s,o){return o(s),s}function Bu(s,o){return o(s)}var f8=ts(function(s){var o=s.length,l=o?s[0]:0,A=this.__wrapped__,T=function(F){return Sh(F,s)};return o>1||this.__actions__.length||!(A instanceof Mt)||!rs(l)?this.thru(T):(A=A.slice(l,+l+(o?1:0)),A.__actions__.push({func:Bu,args:[T],thisArg:t}),new Ti(A,this.__chain__).thru(function(F){return o&&!F.length&&F.push(t),F}))});function h8(){return Vp(this)}function l8(){return new Ti(this.value(),this.__chain__)}function d8(){this.__values__===t&&(this.__values__=a1(this.value()));var s=this.__index__>=this.__values__.length,o=s?t:this.__values__[this.__index__++];return{done:s,value:o}}function p8(){return this}function g8(s){for(var o,l=this;l instanceof wu;){var A=Lp(l);A.__index__=0,A.__values__=t,o?T.__wrapped__=A:o=A;var T=A;l=l.__wrapped__}return T.__wrapped__=s,o}function b8(){var s=this.__wrapped__;if(s instanceof Mt){var o=s;return this.__actions__.length&&(o=new Mt(this)),o=o.reverse(),o.__actions__.push({func:Bu,args:[el],thisArg:t}),new Ti(o,this.__chain__)}return this.thru(el)}function v8(){return cp(this.__wrapped__,this.__actions__)}var m8=Mu(function(s,o,l){qt.call(s,l)?++s[l]:Zn(s,l,1)});function y8(s,o,l){var A=gt(s)?_0:uy;return l&&Kr(s,o,l)&&(o=t),A(s,nt(o,3))}function w8(s,o){var l=gt(s)?Ds:K0;return l(s,nt(o,3))}var _8=yp(Fp),D8=yp(zp);function E8(s,o){return xr($u(s,o),1)}function A8(s,o){return xr($u(s,o),S)}function x8(s,o,l){return l=l===t?1:yt(l),xr($u(s,o),l)}function Gp(s,o){var l=gt(s)?Pi:Ss;return l(s,nt(o,3))}function Jp(s,o){var l=gt(s)?H2:H0;return l(s,nt(o,3))}var S8=Mu(function(s,o,l){qt.call(s,l)?s[l].push(o):Zn(s,l,[o])});function M8(s,o,l,A){s=ii(s)?s:Va(s),l=l&&!A?yt(l):0;var T=s.length;return l<0&&(l=pr(T+l,0)),zu(s)?l<=T&&s.indexOf(o,l)>-1:!!T&&Na(s,o,l)>-1}var I8=Dt(function(s,o,l){var A=-1,T=typeof o=="function",F=ii(s)?oe(s.length):[];return Ss(s,function(Q){F[++A]=T?vr(o,Q,l):Fo(Q,o,l)}),F}),C8=Mu(function(s,o,l){Zn(s,l,o)});function $u(s,o){var l=gt(s)?Xt:Q0;return l(s,nt(o,3))}function P8(s,o,l,A){return s==null?[]:(gt(o)||(o=o==null?[]:[o]),l=A?t:l,gt(l)||(l=l==null?[]:[l]),tp(s,o,l))}var O8=Mu(function(s,o,l){s[l?0:1].push(o)},function(){return[[],[]]});function T8(s,o,l){var A=gt(s)?dh:x0,T=arguments.length<3;return A(s,nt(o,4),l,T,Ss)}function R8(s,o,l){var A=gt(s)?K2:x0,T=arguments.length<3;return A(s,nt(o,4),l,T,H0)}function N8(s,o){var l=gt(s)?Ds:K0;return l(s,Lu(nt(o,3)))}function B8(s){var o=gt(s)?F0:My;return o(s)}function $8(s,o,l){(l?Kr(s,o,l):o===t)?o=1:o=yt(o);var A=gt(s)?ny:Iy;return A(s,o)}function U8(s){var o=gt(s)?sy:Py;return o(s)}function q8(s){if(s==null)return 0;if(ii(s))return zu(s)?$a(s):s.length;var o=Lr(s);return o==fe||o==Se?s.size:Th(s).length}function L8(s,o,l){var A=gt(s)?ph:Oy;return l&&Kr(s,o,l)&&(o=t),A(s,nt(o,3))}var F8=Dt(function(s,o){if(s==null)return[];var l=o.length;return l>1&&Kr(s,o[0],o[1])?o=[]:l>2&&Kr(o[0],o[1],o[2])&&(o=[o[0]]),tp(s,xr(o,1),[])}),Uu=wm||function(){return Ot.Date.now()};function z8(s,o){if(typeof o!="function")throw new Oi(c);return s=yt(s),function(){if(--s<1)return o.apply(this,arguments)}}function Wp(s,o,l){return o=l?t:o,o=s&&o==null?s.length:o,es(s,_,t,t,t,t,o)}function Yp(s,o){var l;if(typeof o!="function")throw new Oi(c);return s=yt(s),function(){return--s>0&&(l=o.apply(this,arguments)),s<=1&&(o=t),l}}var rl=Dt(function(s,o,l){var A=K;if(l.length){var T=As(l,Ha(rl));A|=j}return es(s,A,o,l,T)}),Qp=Dt(function(s,o,l){var A=K|Y;if(l.length){var T=As(l,Ha(Qp));A|=j}return es(o,A,s,l,T)});function Xp(s,o,l){o=l?t:o;var A=es(s,W,t,t,t,t,t,o);return A.placeholder=Xp.placeholder,A}function Zp(s,o,l){o=l?t:o;var A=es(s,B,t,t,t,t,t,o);return A.placeholder=Zp.placeholder,A}function e1(s,o,l){var A,T,F,Q,X,ie,he=0,de=!1,ge=!1,Ie=!0;if(typeof s!="function")throw new Oi(c);o=$i(o)||0,Zt(l)&&(de=!!l.leading,ge="maxWait"in l,F=ge?pr($i(l.maxWait)||0,o):F,Ie="trailing"in l?!!l.trailing:Ie);function Je(or){var an=A,ss=T;return A=T=t,he=or,Q=s.apply(ss,an),Q}function ot(or){return he=or,X=Ko(At,o),de?Je(or):Q}function wt(or){var an=or-ie,ss=or-he,y1=o-an;return ge?qr(y1,F-ss):y1}function ct(or){var an=or-ie,ss=or-he;return ie===t||an>=o||an<0||ge&&ss>=F}function At(){var or=Uu();if(ct(or))return Tt(or);X=Ko(At,wt(or))}function Tt(or){return X=t,Ie&&A?Je(or):(A=T=t,Q)}function yi(){X!==t&&fp(X),he=0,A=ie=T=X=t}function Vr(){return X===t?Q:Tt(Uu())}function wi(){var or=Uu(),an=ct(or);if(A=arguments,T=this,ie=or,an){if(X===t)return ot(ie);if(ge)return fp(X),X=Ko(At,o),Je(ie)}return X===t&&(X=Ko(At,o)),Q}return wi.cancel=yi,wi.flush=Vr,wi}var j8=Dt(function(s,o){return k0(s,1,o)}),k8=Dt(function(s,o,l){return k0(s,$i(o)||0,l)});function H8(s){return es(s,se)}function qu(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new Oi(c);var l=function(){var A=arguments,T=o?o.apply(this,A):A[0],F=l.cache;if(F.has(T))return F.get(T);var Q=s.apply(this,A);return l.cache=F.set(T,Q)||F,Q};return l.cache=new(qu.Cache||Xn),l}qu.Cache=Xn;function Lu(s){if(typeof s!="function")throw new Oi(c);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function K8(s){return Yp(2,s)}var V8=Ty(function(s,o){o=o.length==1&>(o[0])?Xt(o[0],bi(nt())):Xt(xr(o,1),bi(nt()));var l=o.length;return Dt(function(A){for(var T=-1,F=qr(A.length,l);++T=o}),na=J0(function(){return arguments}())?J0:function(s){return tr(s)&&qt.call(s,"callee")&&!N0.call(s,"callee")},gt=oe.isArray,ow=kr?bi(kr):gy;function ii(s){return s!=null&&Fu(s.length)&&!is(s)}function ar(s){return tr(s)&&ii(s)}function cw(s){return s===!0||s===!1||tr(s)&&Hr(s)==V}var Ps=Dm||pl,uw=tn?bi(tn):by;function fw(s){return tr(s)&&s.nodeType===1&&!Vo(s)}function hw(s){if(s==null)return!0;if(ii(s)&&(gt(s)||typeof s=="string"||typeof s.splice=="function"||Ps(s)||Ka(s)||na(s)))return!s.length;var o=Lr(s);if(o==fe||o==Se)return!s.size;if(Ho(s))return!Th(s).length;for(var l in s)if(qt.call(s,l))return!1;return!0}function lw(s,o){return zo(s,o)}function dw(s,o,l){l=typeof l=="function"?l:t;var A=l?l(s,o):t;return A===t?zo(s,o,t,l):!!A}function nl(s){if(!tr(s))return!1;var o=Hr(s);return o==H||o==D||typeof s.message=="string"&&typeof s.name=="string"&&!Vo(s)}function pw(s){return typeof s=="number"&&$0(s)}function is(s){if(!Zt(s))return!1;var o=Hr(s);return o==ne||o==ce||o==L||o==Ce}function r1(s){return typeof s=="number"&&s==yt(s)}function Fu(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=M}function Zt(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function tr(s){return s!=null&&typeof s=="object"}var i1=Ci?bi(Ci):my;function gw(s,o){return s===o||Oh(s,o,Jh(o))}function bw(s,o,l){return l=typeof l=="function"?l:t,Oh(s,o,Jh(o),l)}function vw(s){return n1(s)&&s!=+s}function mw(s){if(t6(s))throw new dt(a);return W0(s)}function yw(s){return s===null}function ww(s){return s==null}function n1(s){return typeof s=="number"||tr(s)&&Hr(s)==ye}function Vo(s){if(!tr(s)||Hr(s)!=Te)return!1;var o=du(s);if(o===null)return!0;var l=qt.call(o,"constructor")&&o.constructor;return typeof l=="function"&&l instanceof l&&uu.call(l)==bm}var sl=wn?bi(wn):yy;function _w(s){return r1(s)&&s>=-M&&s<=M}var s1=Oo?bi(Oo):wy;function zu(s){return typeof s=="string"||!gt(s)&&tr(s)&&Hr(s)==me}function mi(s){return typeof s=="symbol"||tr(s)&&Hr(s)==Pe}var Ka=Ys?bi(Ys):_y;function Dw(s){return s===t}function Ew(s){return tr(s)&&Lr(s)==be}function Aw(s){return tr(s)&&Hr(s)==Oe}var xw=Ou(Rh),Sw=Ou(function(s,o){return s<=o});function a1(s){if(!s)return[];if(ii(s))return zu(s)?rn(s):ri(s);if(Ro&&s[Ro])return nm(s[Ro]());var o=Lr(s),l=o==fe?wh:o==Se?au:Va;return l(s)}function ns(s){if(!s)return s===0?s:0;if(s=$i(s),s===S||s===-S){var o=s<0?-1:1;return o*x}return s===s?s:0}function yt(s){var o=ns(s),l=o%1;return o===o?l?o-l:o:0}function o1(s){return s?ea(yt(s),0,b):0}function $i(s){if(typeof s=="number")return s;if(mi(s))return p;if(Zt(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=Zt(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=S0(s);var l=Nr.test(s);return l||$r.test(s)?pt(s.slice(2),l?2:8):Rr.test(s)?p:+s}function c1(s){return Dn(s,ni(s))}function Mw(s){return s?ea(yt(s),-M,M):s===0?s:0}function $t(s){return s==null?"":vi(s)}var Iw=ja(function(s,o){if(Ho(o)||ii(o)){Dn(o,mr(o),s);return}for(var l in o)qt.call(o,l)&&qo(s,l,o[l])}),u1=ja(function(s,o){Dn(o,ni(o),s)}),ju=ja(function(s,o,l,A){Dn(o,ni(o),s,A)}),Cw=ja(function(s,o,l,A){Dn(o,mr(o),s,A)}),Pw=ts(Sh);function Ow(s,o){var l=za(s);return o==null?l:z0(l,o)}var Tw=Dt(function(s,o){s=Ht(s);var l=-1,A=o.length,T=A>2?o[2]:t;for(T&&Kr(o[0],o[1],T)&&(A=1);++l1),F}),Dn(s,Vh(s),l),A&&(l=Ri(l,w|O|C,ky));for(var T=o.length;T--;)qh(l,o[T]);return l});function Yw(s,o){return h1(s,Lu(nt(o)))}var Qw=ts(function(s,o){return s==null?{}:Ay(s,o)});function h1(s,o){if(s==null)return{};var l=Xt(Vh(s),function(A){return[A]});return o=nt(o),rp(s,l,function(A,T){return o(A,T[0])})}function Xw(s,o,l){o=Is(o,s);var A=-1,T=o.length;for(T||(T=1,s=t);++Ao){var A=s;s=o,o=A}if(l||s%1||o%1){var T=U0();return qr(s+T*(o-s+jt("1e-"+((T+"").length-1))),o)}return Bh(s,o)}var u5=ka(function(s,o,l){return o=o.toLowerCase(),s+(l?p1(o):o)});function p1(s){return cl($t(s).toLowerCase())}function g1(s){return s=$t(s),s&&s.replace(er,Z2).replace(fh,"")}function f5(s,o,l){s=$t(s),o=vi(o);var A=s.length;l=l===t?A:ea(yt(l),0,A);var T=l;return l-=o.length,l>=0&&s.slice(l,T)==o}function h5(s){return s=$t(s),s&&Xe.test(s)?s.replace(St,em):s}function l5(s){return s=$t(s),s&&ze.test(s)?s.replace(rt,"\\$&"):s}var d5=ka(function(s,o,l){return s+(l?"-":"")+o.toLowerCase()}),p5=ka(function(s,o,l){return s+(l?" ":"")+o.toLowerCase()}),g5=mp("toLowerCase");function b5(s,o,l){s=$t(s),o=yt(o);var A=o?$a(s):0;if(!o||A>=o)return s;var T=(o-A)/2;return Pu(vu(T),l)+s+Pu(bu(T),l)}function v5(s,o,l){s=$t(s),o=yt(o);var A=o?$a(s):0;return o&&A>>0,l?(s=$t(s),s&&(typeof o=="string"||o!=null&&!sl(o))&&(o=vi(o),!o&&Ba(s))?Cs(rn(s),0,l):s.split(o,l)):[]}var A5=ka(function(s,o,l){return s+(l?" ":"")+cl(o)});function x5(s,o,l){return s=$t(s),l=l==null?0:ea(yt(l),0,s.length),o=vi(o),s.slice(l,l+o.length)==o}function S5(s,o,l){var A=$.templateSettings;l&&Kr(s,o,l)&&(o=t),s=$t(s),o=ju({},o,A,xp);var T=ju({},o.imports,A.imports,xp),F=mr(T),Q=yh(T,F),X,ie,he=0,de=o.interpolate||Xr,ge="__p += '",Ie=_h((o.escape||Xr).source+"|"+de.source+"|"+(de===et?at:Xr).source+"|"+(o.evaluate||Xr).source+"|$","g"),Je="//# sourceURL="+(qt.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++hh+"]")+` +`;s.replace(Ie,function(ct,At,Tt,yi,Vr,wi){return Tt||(Tt=yi),ge+=s.slice(he,wi).replace(Wi,tm),At&&(X=!0,ge+=`' + +__e(`+At+`) + +'`),Vr&&(ie=!0,ge+=`'; +`+Vr+`; +__p += '`),Tt&&(ge+=`' + +((__t = (`+Tt+`)) == null ? '' : __t) + +'`),he=wi+ct.length,ct}),ge+=`'; +`;var ot=qt.call(o,"variable")&&o.variable;if(!ot)ge=`with (obj) { +`+ge+` +} +`;else if(Rt.test(ot))throw new dt(f);ge=(ie?ge.replace(_t,""):ge).replace(lt,"$1").replace(We,"$1;"),ge="function("+(ot||"obj")+`) { +`+(ot?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(X?", __e = _.escape":"")+(ie?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+ge+`return __p +}`;var wt=v1(function(){return Bt(F,Je+"return "+ge).apply(t,Q)});if(wt.source=ge,nl(wt))throw wt;return wt}function M5(s){return $t(s).toLowerCase()}function I5(s){return $t(s).toUpperCase()}function C5(s,o,l){if(s=$t(s),s&&(l||o===t))return S0(s);if(!s||!(o=vi(o)))return s;var A=rn(s),T=rn(o),F=M0(A,T),Q=I0(A,T)+1;return Cs(A,F,Q).join("")}function P5(s,o,l){if(s=$t(s),s&&(l||o===t))return s.slice(0,P0(s)+1);if(!s||!(o=vi(o)))return s;var A=rn(s),T=I0(A,rn(o))+1;return Cs(A,0,T).join("")}function O5(s,o,l){if(s=$t(s),s&&(l||o===t))return s.replace(it,"");if(!s||!(o=vi(o)))return s;var A=rn(s),T=M0(A,rn(o));return Cs(A,T).join("")}function T5(s,o){var l=le,A=U;if(Zt(o)){var T="separator"in o?o.separator:T;l="length"in o?yt(o.length):l,A="omission"in o?vi(o.omission):A}s=$t(s);var F=s.length;if(Ba(s)){var Q=rn(s);F=Q.length}if(l>=F)return s;var X=l-$a(A);if(X<1)return A;var ie=Q?Cs(Q,0,X).join(""):s.slice(0,X);if(T===t)return ie+A;if(Q&&(X+=ie.length-X),sl(T)){if(s.slice(X).search(T)){var he,de=ie;for(T.global||(T=_h(T.source,$t(vt.exec(T))+"g")),T.lastIndex=0;he=T.exec(de);)var ge=he.index;ie=ie.slice(0,ge===t?X:ge)}}else if(s.indexOf(vi(T),X)!=X){var Ie=ie.lastIndexOf(T);Ie>-1&&(ie=ie.slice(0,Ie))}return ie+A}function R5(s){return s=$t(s),s&&Be.test(s)?s.replace(Et,cm):s}var N5=ka(function(s,o,l){return s+(l?" ":"")+o.toUpperCase()}),cl=mp("toUpperCase");function b1(s,o,l){return s=$t(s),o=l?t:o,o===t?im(s)?hm(s):J2(s):s.match(o)||[]}var v1=Dt(function(s,o){try{return vr(s,t,o)}catch(l){return nl(l)?l:new dt(l)}}),B5=ts(function(s,o){return Pi(o,function(l){l=En(l),Zn(s,l,rl(s[l],s))}),s});function $5(s){var o=s==null?0:s.length,l=nt();return s=o?Xt(s,function(A){if(typeof A[1]!="function")throw new Oi(c);return[l(A[0]),A[1]]}):[],Dt(function(A){for(var T=-1;++TM)return[];var l=b,A=qr(s,b);o=nt(o),s-=b;for(var T=mh(A,o);++l0||o<0)?new Mt(l):(s<0?l=l.takeRight(-s):s&&(l=l.drop(s)),o!==t&&(o=yt(o),l=o<0?l.dropRight(-o):l.take(o-s)),l)},Mt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Mt.prototype.toArray=function(){return this.take(b)},_n(Mt.prototype,function(s,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),A=/^(?:head|last)$/.test(o),T=$[A?"take"+(o=="last"?"Right":""):o],F=A||/^find/.test(o);T&&($.prototype[o]=function(){var Q=this.__wrapped__,X=A?[1]:arguments,ie=Q instanceof Mt,he=X[0],de=ie||gt(Q),ge=function(At){var Tt=T.apply($,Es([At],X));return A&&Ie?Tt[0]:Tt};de&&l&&typeof he=="function"&&he.length!=1&&(ie=de=!1);var Ie=this.__chain__,Je=!!this.__actions__.length,ot=F&&!Ie,wt=ie&&!Je;if(!F&&de){Q=wt?Q:new Mt(this);var ct=s.apply(Q,X);return ct.__actions__.push({func:Bu,args:[ge],thisArg:t}),new Ti(ct,Ie)}return ot&&wt?s.apply(this,X):(ct=this.thru(ge),ot?A?ct.value()[0]:ct.value():ct)})}),Pi(["pop","push","shift","sort","splice","unshift"],function(s){var o=ou[s],l=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",A=/^(?:pop|shift)$/.test(s);$.prototype[s]=function(){var T=arguments;if(A&&!this.__chain__){var F=this.value();return o.apply(gt(F)?F:[],T)}return this[l](function(Q){return o.apply(gt(Q)?Q:[],T)})}}),_n(Mt.prototype,function(s,o){var l=$[o];if(l){var A=l.name+"";qt.call(Fa,A)||(Fa[A]=[]),Fa[A].push({name:o,func:l})}}),Fa[Iu(t,Y).name]=[{name:"wrapper",func:t}],Mt.prototype.clone=Rm,Mt.prototype.reverse=Nm,Mt.prototype.value=Bm,$.prototype.at=f8,$.prototype.chain=h8,$.prototype.commit=l8,$.prototype.next=d8,$.prototype.plant=g8,$.prototype.reverse=b8,$.prototype.toJSON=$.prototype.valueOf=$.prototype.value=v8,$.prototype.first=$.prototype.head,Ro&&($.prototype[Ro]=p8),$},Ua=lm();sr?((sr.exports=Ua)._=Ua,kt._=Ua):Ot._=Ua}).call(ac)})($d,$d.exports);var SB=Object.defineProperty,MB=Object.defineProperties,IB=Object.getOwnPropertyDescriptors,jb=Object.getOwnPropertySymbols,CB=Object.prototype.hasOwnProperty,PB=Object.prototype.propertyIsEnumerable,kb=(r,e,t)=>e in r?SB(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Zu=(r,e)=>{for(var t in e||(e={}))CB.call(e,t)&&kb(r,t,e[t]);if(jb)for(var t of jb(e))PB.call(e,t)&&kb(r,t,e[t]);return r},OB=(r,e)=>MB(r,IB(e));function bn(r,e,t){var i;const n=fc(r);return((i=e.rpcMap)==null?void 0:i[n.reference])||`${F2}?chainId=${n.namespace}:${n.reference}&projectId=${t}`}function Ca(r){return r.includes(":")?r.split(":")[1]:r}function z2(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function TB(r,e){const t=Object.keys(e.namespaces).filter(n=>n.includes(r));if(!t.length)return[];const i=[];return t.forEach(n=>{const a=e.namespaces[n].accounts;i.push(...a)}),i}function td(r={},e={}){const t=Hb(r),i=Hb(e);return $d.exports.merge(t,i)}function Hb(r){var e,t,i,n;const a={};if(!_c(r))return a;for(const[c,f]of Object.entries(r)){const g=f0(c)?[c]:f.chains,d=f.methods||[],m=f.events||[],w=f.rpcMap||{},O=uc(c);a[O]=OB(Zu(Zu({},a[O]),f),{chains:rf(g,(e=a[O])==null?void 0:e.chains),methods:rf(d,(t=a[O])==null?void 0:t.methods),events:rf(m,(i=a[O])==null?void 0:i.events),rpcMap:Zu(Zu({},w),(n=a[O])==null?void 0:n.rpcMap)})}return a}function RB(r){return r.includes(":")?r.split(":")[2]:r}function Kb(r){const e={};for(const[t,i]of Object.entries(r)){const n=i.methods||[],a=i.events||[],c=i.accounts||[],f=f0(t)?[t]:i.chains?i.chains:z2(i.accounts);e[t]={chains:f,methods:n,events:a,accounts:c}}return e}function rd(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const j2={},Ut=r=>j2[r],id=(r,e)=>{j2[r]=e};class NB{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Ut("events"),this.client=Ut("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Ca(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||bn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new vn(new Wn(i,Ut("disableProviderPing")))}}var BB=Object.defineProperty,$B=Object.defineProperties,UB=Object.getOwnPropertyDescriptors,Vb=Object.getOwnPropertySymbols,qB=Object.prototype.hasOwnProperty,LB=Object.prototype.propertyIsEnumerable,Gb=(r,e,t)=>e in r?BB(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Jb=(r,e)=>{for(var t in e||(e={}))qB.call(e,t)&&Gb(r,t,e[t]);if(Vb)for(var t of Vb(e))LB.call(e,t)&&Gb(r,t,e[t]);return r},Wb=(r,e)=>$B(r,UB(e));class FB{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Ut("events"),this.client=Ut("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const i=t||bn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new vn(new Wn(i,Ut("disableProviderPing")))}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=parseInt(Ca(t));e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,i;let n=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";n=n.startsWith("0x")?n:`0x${n}`;const a=parseInt(n,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,i,n;const a=(i=(t=e.request)==null?void 0:t.params)==null?void 0:i[0];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const c=this.client.session.get(e.topic),f=((n=c==null?void 0:c.sessionProperties)==null?void 0:n.capabilities)||{};if(f!=null&&f[a])return f==null?void 0:f[a];const g=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:Wb(Jb({},c.sessionProperties||{}),{capabilities:Wb(Jb({},f||{}),{[a]:g})})})}catch(d){console.warn("Failed to update session with capabilities",d)}return g}async getCallStatus(e){var t,i;const n=this.client.session.get(e.topic),a=(t=n.sessionProperties)==null?void 0:t.bundler_name;if(a){const f=this.getBundlerUrl(e.chainId,a);try{return await this.getUserOperationReceipt(f,e)}catch(g){console.warn("Failed to fetch call status from bundler",g,f)}}const c=(i=n.sessionProperties)==null?void 0:i.bundler_url;if(c)try{return await this.getUserOperationReceipt(c,e)}catch(f){console.warn("Failed to fetch call status from custom bundler",f,c)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var i;const n=new URL(e),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Fs("eth_getUserOperationReceipt",[(i=t.request.params)==null?void 0:i[0]]))});if(!a.ok)throw new Error(`Failed to fetch user operation receipt - ${a.status}`);return await a.json()}getBundlerUrl(e,t){return`${xB}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}class zB{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Ut("events"),this.client=Ut("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Ca(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||bn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new vn(new Wn(i,Ut("disableProviderPing")))}}class jB{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Ut("events"),this.client=Ut("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Ca(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||bn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new vn(new Wn(i,Ut("disableProviderPing")))}}class kB{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Ut("events"),this.client=Ut("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const i=t||bn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||bn(e,this.namespace,this.client.core.projectId);return typeof i>"u"?void 0:new vn(new Wn(i,Ut("disableProviderPing")))}}class HB{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Ut("events"),this.client=Ut("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const i=this.getCardanoRPCUrl(t),n=Ca(t);e[n]=this.createHttpProvider(n,i)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new vn(new Wn(i,Ut("disableProviderPing")))}}class KB{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Ut("events"),this.client=Ut("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Ca(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||bn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new vn(new Wn(i,Ut("disableProviderPing")))}}class VB{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Ut("events"),this.client=Ut("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Ca(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||bn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new vn(new Wn(i,Ut("disableProviderPing")))}}class GB{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Ut("events"),this.client=Ut("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const i=t||bn(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||bn(e,this.namespace);return typeof i>"u"?void 0:new vn(new Wn(i,Ut("disableProviderPing")))}}class JB{constructor(e){this.name=Za,this.namespace=e.namespace,this.events=Ut("events"),this.client=Ut("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(mn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){var e,t;const i={};return(t=(e=this.namespace)==null?void 0:e.accounts)==null||t.forEach(n=>{const a=fc(n);i[`${a.namespace}:${a.reference}`]=this.createHttpProvider(n)}),i}getHttpProvider(e){const t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||bn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new vn(new Wn(i,Ut("disableProviderPing")))}}var WB=Object.defineProperty,YB=Object.defineProperties,QB=Object.getOwnPropertyDescriptors,Yb=Object.getOwnPropertySymbols,XB=Object.prototype.hasOwnProperty,ZB=Object.prototype.propertyIsEnumerable,Qb=(r,e,t)=>e in r?WB(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ef=(r,e)=>{for(var t in e||(e={}))XB.call(e,t)&&Qb(r,t,e[t]);if(Yb)for(var t of Yb(e))ZB.call(e,t)&&Qb(r,t,e[t]);return r},nd=(r,e)=>YB(r,QB(e));class y0{constructor(e){this.events=new Fd,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Uc(Zf({level:(e==null?void 0:e.logger)||Fb})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new y0(e);return await t.initialize(),t}async request(e,t,i){const[n,a]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:ef({},e),chainId:`${n}:${a}`,topic:this.session.topic,expiry:i})}sendAsync(e,t,i,n){const a=new Date().getTime();this.request(e,i,n).then(c=>t(null,th(a,c))).catch(c=>t(c,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Lt("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:i,response:n}=await this.client.authenticate(e,t);i&&(this.uri=i,this.events.emit("display_uri",i));const a=await n();if(this.session=a.session,this.session){const c=Kb(this.session.namespaces);this.namespaces=td(this.namespaces,c),this.persist("namespaces",this.namespaces),this.onConnect()}return a}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await n().then(a=>{this.session=a;const c=Kb(a.namespaces);this.namespaces=td(this.namespaces,c),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==L2)throw a;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[i,n]=this.validateChain(e),a=this.getProvider(i);a.name===Za?a.setDefaultChain(`${i}:${n}`,t):a.setDefaultChain(n,t)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(Hn(t)){for(const i of t)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await m0.init({core:this.providerOpts.core,logger:this.providerOpts.logger||Fb,relayUrl:this.providerOpts.relayUrl||DB,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>uc(t)))];id("client",this.client),id("events",this.events),id("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const i=TB(t,this.session),n=z2(i),a=td(this.namespaces,this.optionalNamespaces),c=nd(ef({},a[t]),{accounts:i,chains:n});switch(t){case"eip155":this.rpcProviders[t]=new FB({namespace:c});break;case"algorand":this.rpcProviders[t]=new kB({namespace:c});break;case"solana":this.rpcProviders[t]=new zB({namespace:c});break;case"cosmos":this.rpcProviders[t]=new jB({namespace:c});break;case"polkadot":this.rpcProviders[t]=new NB({namespace:c});break;case"cip34":this.rpcProviders[t]=new HB({namespace:c});break;case"elrond":this.rpcProviders[t]=new KB({namespace:c});break;case"multiversx":this.rpcProviders[t]=new VB({namespace:c});break;case"near":this.rpcProviders[t]=new GB({namespace:c});break;default:this.rpcProviders[Za]?this.rpcProviders[Za].updateNamespace(c):this.rpcProviders[Za]=new JB({namespace:c})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:i}=t;if(i.name==="accountsChanged"){const n=i.data;n&&Hn(n)&&this.events.emit("accountsChanged",n.map(RB))}else if(i.name==="chainChanged"){const n=t.chainId,a=t.event.data,c=uc(n),f=rd(n)!==rd(a)?`${c}:${rd(a)}`:n;this.onChainChanged(f)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var i;const{namespaces:n}=t,a=(i=this.client)==null?void 0:i.session.get(e);this.session=nd(ef({},a),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",nd(ef({},Lt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(mn.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[Za]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:i,sessionProperties:n}=e;t&&Object.keys(t).length&&(this.namespaces=t),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=n,this.persist("namespaces",t),this.persist("optionalNamespaces",i)}validateChain(e){const[t,i]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,i];if(t&&!Object.keys(this.namespaces||{}).map(c=>uc(c)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&i)return[t,i];const n=uc(Object.keys(this.namespaces)[0]),a=this.rpcProviders[n].getDefaultChain();return[n,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[i,n]=this.validateChain(e);n&&(t||this.getProvider(i).setDefaultChain(n),this.namespaces[i]?this.namespaces[i].defaultChain=n:this.namespaces[`${i}:${n}`]?this.namespaces[`${i}:${n}`].defaultChain=n:this.namespaces[`${i}:${n}`]={defaultChain:n},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",n))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${zb}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${zb}/${e}`)}}const e$=y0,t$="wc",r$="ethereum_provider",i$=`${t$}@2:${r$}:`,n$="https://rpc.walletconnect.org/v1/",Ud=["eth_sendTransaction","personal_sign"],s$=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],qd=["chainChanged","accountsChanged"],a$=["chainChanged","accountsChanged","message","disconnect","connect"];var o$=Object.defineProperty,c$=Object.defineProperties,u$=Object.getOwnPropertyDescriptors,Xb=Object.getOwnPropertySymbols,f$=Object.prototype.hasOwnProperty,h$=Object.prototype.propertyIsEnumerable,Zb=(r,e,t)=>e in r?o$(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,eo=(r,e)=>{for(var t in e||(e={}))f$.call(e,t)&&Zb(r,t,e[t]);if(Xb)for(var t of Xb(e))h$.call(e,t)&&Zb(r,t,e[t]);return r},sd=(r,e)=>c$(r,u$(e));function Cf(r){return Number(r[0].split(":")[1])}function tf(r){return`0x${r.toString(16)}`}function l$(r){const{chains:e,optionalChains:t,methods:i,optionalMethods:n,events:a,optionalEvents:c,rpcMap:f}=r;if(!Hn(e))throw new Error("Invalid chains");const g={chains:e,methods:i||Ud,events:a||qd,rpcMap:eo({},e.length?{[Cf(e)]:f[Cf(e)]}:{})},d=a==null?void 0:a.filter(C=>!qd.includes(C)),m=i==null?void 0:i.filter(C=>!Ud.includes(C));if(!t&&!c&&!n&&!(d!=null&&d.length)&&!(m!=null&&m.length))return{required:e.length?g:void 0};const w=(d==null?void 0:d.length)&&(m==null?void 0:m.length)||!t,O={chains:[...new Set(w?g.chains.concat(t||[]):t)],methods:[...new Set(g.methods.concat(n!=null&&n.length?n:s$))],events:[...new Set(g.events.concat(c!=null&&c.length?c:a$))],rpcMap:f};return{required:e.length?g:void 0,optional:t.length?O:void 0}}class w0{constructor(){this.events=new Vi.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=i$,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new w0;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,i){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:i}=l$(this.rpc);try{const n=await new Promise(async(c,f)=>{var g;this.rpc.showQrModal&&((g=this.modal)==null||g.subscribeModal(d=>{!d.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(sd(eo({namespaces:eo({},t&&{[this.namespace]:t})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(d=>{c(d)}).catch(d=>{f(new Error(d.message))})});if(!n)return;const a=X1(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:tf(this.chainId)})}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const i=await new Promise(async(a,c)=>{var f;this.rpc.showQrModal&&((f=this.modal)==null||f.subscribeModal(g=>{!g.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),c(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(sd(eo({},e),{chains:this.rpc.chains}),t).then(g=>{a(g)}).catch(g=>{c(new Error(g.message))})}),n=i.session;if(n){const a=X1(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:tf(this.chainId)})}return i}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:i}=t;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",tf(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",sd(eo({},Lt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,i;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",tf(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,i,n]=e.split(":");return{chainId:`${t}:${i}`,address:n}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,i;const n=(t=e==null?void 0:e.chains)!=null?t:[],a=(i=e==null?void 0:e.optionalChains)!=null?i:[],c=n.concat(a);if(!c.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const f=n.length?(e==null?void 0:e.methods)||Ud:[],g=n.length?(e==null?void 0:e.events)||qd:[],d=(e==null?void 0:e.optionalMethods)||[],m=(e==null?void 0:e.optionalEvents)||[],w=(e==null?void 0:e.rpcMap)||this.buildRpcMap(c,e.projectId),O=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:n==null?void 0:n.map(C=>this.formatChainId(C)),optionalChains:a.map(C=>this.formatChainId(C)),methods:f,events:g,optionalMethods:d,optionalEvents:m,rpcMap:w,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:O,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const i={};return e.forEach(n=>{i[n]=this.getRpcUrl(n,t)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Cf(this.rpc.chains):Cf(this.rpc.optionalChains),this.signer=await e$.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:i}=await _4(()=>import("./index-C91wHTLi.js").then(n=>n.i),__vite__mapDeps([0,1,2]));t=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(eo({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:i,rpcMap:n}=e;t&&Hn(t)&&(this.rpc.chains=t.map(a=>this.formatChainId(a)),t.forEach(a=>{this.rpc.rpcMap[a]=(n==null?void 0:n[a])||this.getRpcUrl(a)})),i&&Hn(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(a=>this.formatChainId(a)),i.forEach(a=>{this.rpc.rpcMap[a]=(n==null?void 0:n[a])||this.getRpcUrl(a)}))}getRpcUrl(e,t){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${n$}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(t=>this.signer.logger.warn(t))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const V$=w0;export{V$ as EthereumProvider,a$ as OPTIONAL_EVENTS,s$ as OPTIONAL_METHODS,qd as REQUIRED_EVENTS,Ud as REQUIRED_METHODS,w0 as default}; diff --git a/buddybook/assets/index.es-D00CSFMM.js b/buddybook/assets/index.es-D00CSFMM.js deleted file mode 100644 index daead3f..0000000 --- a/buddybook/assets/index.es-D00CSFMM.js +++ /dev/null @@ -1,70 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-xoNRwz7B.js","assets/index-Gmp6KMX1.js","assets/index-DQCSip5A.css"])))=>i.map(i=>d[i]); -import{g as Cv,o as z8,p as j8,d as Dv,q as Ar,r as k8,h as Sd,_ as F8}from"./index-Gmp6KMX1.js";import{e as Fi,J as Id}from"./events-q8pkyiVZ.js";import{r as Md,i as xh}from"./inherits_browser-C-oMugCi.js";var xe={};/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var Vl=function(r,e){return Vl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},Vl(r,e)};function H8(r,e){Vl(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Gl=function(){return Gl=Object.assign||function(e){for(var t,i=1,n=arguments.length;i=0;u--)(f=r[u])&&(a=(n<3?f(a):n>3?f(e,t,a):f(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a}function G8(r,e){return function(t,i){e(t,i,r)}}function W8(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function J8(r,e,t,i){function n(a){return a instanceof t?a:new t(function(f){f(a)})}return new(t||(t=Promise))(function(a,f){function u(y){try{p(i.next(y))}catch(A){f(A)}}function b(y){try{p(i.throw(y))}catch(A){f(A)}}function p(y){y.done?a(y.value):n(y.value).then(u,b)}p((i=i.apply(r,e||[])).next())})}function Y8(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,f;return f={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(p){return function(y){return b([p,y])}}function b(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(a=p[0]&2?n.return:p[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,p[1])).done)return a;switch(n=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,n=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Lv(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],f;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(u){f={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(f)throw f.error}}return a}function Z8(){for(var r=[],e=0;e1||u(R,O)})})}function u(R,O){try{b(i[R](O))}catch(N){A(a[0][3],N)}}function b(R){R.value instanceof lc?Promise.resolve(R.value.v).then(p,y):A(a[0][2],R)}function p(R){u("next",R)}function y(R){u("throw",R)}function A(R,O){R(O),a.shift(),a.length&&u(a[0][0],a[0][1])}}function r4(r){var e,t;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,a){e[n]=r[n]?function(f){return(t=!t)?{value:lc(r[n](f)),done:n==="return"}:a?a(f):f}:a}}function i4(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Wl=="function"?Wl(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(f){return new Promise(function(u,b){f=r[a](f),n(u,b,f.done,f.value)})}}function n(a,f,u,b){Promise.resolve(b).then(function(p){a({value:p,done:u})},f)}}function n4(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function s4(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function a4(r){return r&&r.__esModule?r:{default:r}}function o4(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function c4(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const f4=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return Gl},__asyncDelegator:r4,__asyncGenerator:t4,__asyncValues:i4,__await:lc,__awaiter:J8,__classPrivateFieldGet:o4,__classPrivateFieldSet:c4,__createBinding:Q8,__decorate:V8,__exportStar:X8,__extends:H8,__generator:Y8,__importDefault:a4,__importStar:s4,__makeTemplateObject:n4,__metadata:W8,__param:G8,__read:Lv,__rest:K8,__spread:Z8,__spreadArrays:e4,__values:Wl},Symbol.toStringTag,{value:"Module"})),Sh=Cv(f4);var sl={},Fo={},s1;function h4(){if(s1)return Fo;s1=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.delay=void 0;function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}return Fo.delay=r,Fo}var ta={},al={},ra={},a1;function u4(){return a1||(a1=1,Object.defineProperty(ra,"__esModule",{value:!0}),ra.ONE_THOUSAND=ra.ONE_HUNDRED=void 0,ra.ONE_HUNDRED=100,ra.ONE_THOUSAND=1e3),ra}var ol={},o1;function l4(){return o1||(o1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.ONE_YEAR=r.FOUR_WEEKS=r.THREE_WEEKS=r.TWO_WEEKS=r.ONE_WEEK=r.THIRTY_DAYS=r.SEVEN_DAYS=r.FIVE_DAYS=r.THREE_DAYS=r.ONE_DAY=r.TWENTY_FOUR_HOURS=r.TWELVE_HOURS=r.SIX_HOURS=r.THREE_HOURS=r.ONE_HOUR=r.SIXTY_MINUTES=r.THIRTY_MINUTES=r.TEN_MINUTES=r.FIVE_MINUTES=r.ONE_MINUTE=r.SIXTY_SECONDS=r.THIRTY_SECONDS=r.TEN_SECONDS=r.FIVE_SECONDS=r.ONE_SECOND=void 0,r.ONE_SECOND=1,r.FIVE_SECONDS=5,r.TEN_SECONDS=10,r.THIRTY_SECONDS=30,r.SIXTY_SECONDS=60,r.ONE_MINUTE=r.SIXTY_SECONDS,r.FIVE_MINUTES=r.ONE_MINUTE*5,r.TEN_MINUTES=r.ONE_MINUTE*10,r.THIRTY_MINUTES=r.ONE_MINUTE*30,r.SIXTY_MINUTES=r.ONE_MINUTE*60,r.ONE_HOUR=r.SIXTY_MINUTES,r.THREE_HOURS=r.ONE_HOUR*3,r.SIX_HOURS=r.ONE_HOUR*6,r.TWELVE_HOURS=r.ONE_HOUR*12,r.TWENTY_FOUR_HOURS=r.ONE_HOUR*24,r.ONE_DAY=r.TWENTY_FOUR_HOURS,r.THREE_DAYS=r.ONE_DAY*3,r.FIVE_DAYS=r.ONE_DAY*5,r.SEVEN_DAYS=r.ONE_DAY*7,r.THIRTY_DAYS=r.ONE_DAY*30,r.ONE_WEEK=r.SEVEN_DAYS,r.TWO_WEEKS=r.ONE_WEEK*2,r.THREE_WEEKS=r.ONE_WEEK*3,r.FOUR_WEEKS=r.ONE_WEEK*4,r.ONE_YEAR=r.ONE_DAY*365}(ol)),ol}var c1;function qv(){return c1||(c1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Sh;e.__exportStar(u4(),r),e.__exportStar(l4(),r)}(al)),al}var f1;function d4(){if(f1)return ta;f1=1,Object.defineProperty(ta,"__esModule",{value:!0}),ta.fromMiliseconds=ta.toMiliseconds=void 0;const r=qv();function e(i){return i*r.ONE_THOUSAND}ta.toMiliseconds=e;function t(i){return Math.floor(i/r.ONE_THOUSAND)}return ta.fromMiliseconds=t,ta}var h1;function p4(){return h1||(h1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Sh;e.__exportStar(h4(),r),e.__exportStar(d4(),r)}(sl)),sl}var Ha={},u1;function g4(){if(u1)return Ha;u1=1,Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(t){if(this.timestamps.has(t))throw new Error(`Watch already started for label: ${t}`);this.timestamps.set(t,{started:Date.now()})}stop(t){const i=this.get(t);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${t}`);const n=Date.now()-i.started;this.timestamps.set(t,{started:i.started,elapsed:n})}get(t){const i=this.timestamps.get(t);if(typeof i>"u")throw new Error(`No timestamp found for label: ${t}`);return i}elapsed(t){const i=this.get(t);return i.elapsed||Date.now()-i.started}}return Ha.Watch=r,Ha.default=r,Ha}var cl={},Ho={},l1;function v4(){if(l1)return Ho;l1=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.IWatch=void 0;class r{}return Ho.IWatch=r,Ho}var d1;function b4(){return d1||(d1=1,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Sh.__exportStar(v4(),r)}(cl)),cl}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=Sh;e.__exportStar(p4(),r),e.__exportStar(g4(),r),e.__exportStar(b4(),r),e.__exportStar(qv(),r)})(xe);var Vt={};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.getLocalStorage=Vt.getLocalStorageOrThrow=Vt.getCrypto=Vt.getCryptoOrThrow=Bv=Vt.getLocation=Vt.getLocationOrThrow=Pd=Vt.getNavigator=Vt.getNavigatorOrThrow=Ih=Vt.getDocument=Vt.getDocumentOrThrow=Vt.getFromWindowOrThrow=Vt.getFromWindow=void 0;function ma(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}Vt.getFromWindow=ma;function co(r){const e=ma(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}Vt.getFromWindowOrThrow=co;function m4(){return co("document")}Vt.getDocumentOrThrow=m4;function y4(){return ma("document")}var Ih=Vt.getDocument=y4;function w4(){return co("navigator")}Vt.getNavigatorOrThrow=w4;function _4(){return ma("navigator")}var Pd=Vt.getNavigator=_4;function A4(){return co("location")}Vt.getLocationOrThrow=A4;function E4(){return ma("location")}var Bv=Vt.getLocation=E4;function x4(){return co("crypto")}Vt.getCryptoOrThrow=x4;function S4(){return ma("crypto")}Vt.getCrypto=S4;function I4(){return co("localStorage")}Vt.getLocalStorageOrThrow=I4;function M4(){return ma("localStorage")}Vt.getLocalStorage=M4;var Od={};Object.defineProperty(Od,"__esModule",{value:!0});var Uv=Od.getWindowMetadata=void 0;const p1=Vt;function P4(){let r,e;try{r=p1.getDocumentOrThrow(),e=p1.getLocationOrThrow()}catch{return null}function t(){const A=r.getElementsByTagName("link"),R=[];for(let O=0;O-1){const W=N.getAttribute("href");if(W)if(W.toLowerCase().indexOf("https:")===-1&&W.toLowerCase().indexOf("http:")===-1&&W.indexOf("//")!==0){let Q=e.protocol+"//"+e.host;if(W.indexOf("/")===0)Q+=W;else{const k=e.pathname.split("/");k.pop();const Y=k.join("/");Q+=Y+"/"+W}R.push(Q)}else if(W.indexOf("//")===0){const Q=e.protocol+W;R.push(Q)}else R.push(W)}}return R}function i(...A){const R=r.getElementsByTagName("meta");for(let O=0;ON.getAttribute(W)).filter(W=>W?A.includes(W):!1);if(K.length&&K){const W=N.getAttribute("content");if(W)return W}}return""}function n(){let A=i("name","og:site_name","og:title","twitter:title");return A||(A=r.title),A}function a(){return i("description","og:description","twitter:description","keywords")}const f=n(),u=a(),b=e.origin,p=t();return{description:u,url:b,icons:p,name:f}}Uv=Od.getWindowMetadata=P4;var dc={},O4=r=>encodeURIComponent(r).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),$v="%[a-f0-9]{2}",g1=new RegExp("("+$v+")|([^%]+?)","gi"),v1=new RegExp("("+$v+")+","gi");function Jl(r,e){try{return[decodeURIComponent(r.join(""))]}catch{}if(r.length===1)return r;e=e||1;var t=r.slice(0,e),i=r.slice(e);return Array.prototype.concat.call([],Jl(t),Jl(i))}function R4(r){try{return decodeURIComponent(r)}catch{for(var e=r.match(g1)||[],t=1;t{if(!(typeof r=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[r];const t=r.indexOf(e);return t===-1?[r]:[r.slice(0,t),r.slice(t+e.length)]},D4=function(r,e){for(var t={},i=Object.keys(r),n=Array.isArray(e),a=0;ak==null,f=Symbol("encodeFragmentIdentifier");function u(k){switch(k.arrayFormat){case"index":return Y=>($,F)=>{const G=$.length;return F===void 0||k.skipNull&&F===null||k.skipEmptyString&&F===""?$:F===null?[...$,[y(Y,k),"[",G,"]"].join("")]:[...$,[y(Y,k),"[",y(G,k),"]=",y(F,k)].join("")]};case"bracket":return Y=>($,F)=>F===void 0||k.skipNull&&F===null||k.skipEmptyString&&F===""?$:F===null?[...$,[y(Y,k),"[]"].join("")]:[...$,[y(Y,k),"[]=",y(F,k)].join("")];case"colon-list-separator":return Y=>($,F)=>F===void 0||k.skipNull&&F===null||k.skipEmptyString&&F===""?$:F===null?[...$,[y(Y,k),":list="].join("")]:[...$,[y(Y,k),":list=",y(F,k)].join("")];case"comma":case"separator":case"bracket-separator":{const Y=k.arrayFormat==="bracket-separator"?"[]=":"=";return $=>(F,G)=>G===void 0||k.skipNull&&G===null||k.skipEmptyString&&G===""?F:(G=G===null?"":G,F.length===0?[[y($,k),Y,y(G,k)].join("")]:[[F,y(G,k)].join(k.arrayFormatSeparator)])}default:return Y=>($,F)=>F===void 0||k.skipNull&&F===null||k.skipEmptyString&&F===""?$:F===null?[...$,y(Y,k)]:[...$,[y(Y,k),"=",y(F,k)].join("")]}}function b(k){let Y;switch(k.arrayFormat){case"index":return($,F,G)=>{if(Y=/\[(\d*)\]$/.exec($),$=$.replace(/\[\d*\]$/,""),!Y){G[$]=F;return}G[$]===void 0&&(G[$]={}),G[$][Y[1]]=F};case"bracket":return($,F,G)=>{if(Y=/(\[\])$/.exec($),$=$.replace(/\[\]$/,""),!Y){G[$]=F;return}if(G[$]===void 0){G[$]=[F];return}G[$]=[].concat(G[$],F)};case"colon-list-separator":return($,F,G)=>{if(Y=/(:list)$/.exec($),$=$.replace(/:list$/,""),!Y){G[$]=F;return}if(G[$]===void 0){G[$]=[F];return}G[$]=[].concat(G[$],F)};case"comma":case"separator":return($,F,G)=>{const x=typeof F=="string"&&F.includes(k.arrayFormatSeparator),q=typeof F=="string"&&!x&&A(F,k).includes(k.arrayFormatSeparator);F=q?A(F,k):F;const ae=x||q?F.split(k.arrayFormatSeparator).map(le=>A(le,k)):F===null?F:A(F,k);G[$]=ae};case"bracket-separator":return($,F,G)=>{const x=/(\[\])$/.test($);if($=$.replace(/\[\]$/,""),!x){G[$]=F&&A(F,k);return}const q=F===null?[]:F.split(k.arrayFormatSeparator).map(ae=>A(ae,k));if(G[$]===void 0){G[$]=q;return}G[$]=[].concat(G[$],q)};default:return($,F,G)=>{if(G[$]===void 0){G[$]=F;return}G[$]=[].concat(G[$],F)}}}function p(k){if(typeof k!="string"||k.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function y(k,Y){return Y.encode?Y.strict?e(k):encodeURIComponent(k):k}function A(k,Y){return Y.decode?t(k):k}function R(k){return Array.isArray(k)?k.sort():typeof k=="object"?R(Object.keys(k)).sort((Y,$)=>Number(Y)-Number($)).map(Y=>k[Y]):k}function O(k){const Y=k.indexOf("#");return Y!==-1&&(k=k.slice(0,Y)),k}function N(k){let Y="";const $=k.indexOf("#");return $!==-1&&(Y=k.slice($)),Y}function K(k){k=O(k);const Y=k.indexOf("?");return Y===-1?"":k.slice(Y+1)}function W(k,Y){return Y.parseNumbers&&!Number.isNaN(Number(k))&&typeof k=="string"&&k.trim()!==""?k=Number(k):Y.parseBooleans&&k!==null&&(k.toLowerCase()==="true"||k.toLowerCase()==="false")&&(k=k.toLowerCase()==="true"),k}function Q(k,Y){Y=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},Y),p(Y.arrayFormatSeparator);const $=b(Y),F=Object.create(null);if(typeof k!="string"||(k=k.trim().replace(/^[?#&]/,""),!k))return F;for(const G of k.split("&")){if(G==="")continue;let[x,q]=i(Y.decode?G.replace(/\+/g," "):G,"=");q=q===void 0?null:["comma","separator","bracket-separator"].includes(Y.arrayFormat)?q:A(q,Y),$(A(x,Y),q,F)}for(const G of Object.keys(F)){const x=F[G];if(typeof x=="object"&&x!==null)for(const q of Object.keys(x))x[q]=W(x[q],Y);else F[G]=W(x,Y)}return Y.sort===!1?F:(Y.sort===!0?Object.keys(F).sort():Object.keys(F).sort(Y.sort)).reduce((G,x)=>{const q=F[x];return q&&typeof q=="object"&&!Array.isArray(q)?G[x]=R(q):G[x]=q,G},Object.create(null))}r.extract=K,r.parse=Q,r.stringify=(k,Y)=>{if(!k)return"";Y=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},Y),p(Y.arrayFormatSeparator);const $=q=>Y.skipNull&&a(k[q])||Y.skipEmptyString&&k[q]==="",F=u(Y),G={};for(const q of Object.keys(k))$(q)||(G[q]=k[q]);const x=Object.keys(G);return Y.sort!==!1&&x.sort(Y.sort),x.map(q=>{const ae=k[q];return ae===void 0?"":ae===null?y(q,Y):Array.isArray(ae)?ae.length===0&&Y.arrayFormat==="bracket-separator"?y(q,Y)+"[]":ae.reduce(F(q),[]).join("&"):y(q,Y)+"="+y(ae,Y)}).filter(q=>q.length>0).join("&")},r.parseUrl=(k,Y)=>{Y=Object.assign({decode:!0},Y);const[$,F]=i(k,"#");return Object.assign({url:$.split("?")[0]||"",query:Q(K(k),Y)},Y&&Y.parseFragmentIdentifier&&F?{fragmentIdentifier:A(F,Y)}:{})},r.stringifyUrl=(k,Y)=>{Y=Object.assign({encode:!0,strict:!0,[f]:!0},Y);const $=O(k.url).split("?")[0]||"",F=r.extract(k.url),G=r.parse(F,{sort:!1}),x=Object.assign(G,k.query);let q=r.stringify(x,Y);q&&(q=`?${q}`);let ae=N(k.url);return k.fragmentIdentifier&&(ae=`#${Y[f]?y(k.fragmentIdentifier,Y):k.fragmentIdentifier}`),`${$}${q}${ae}`},r.pick=(k,Y,$)=>{$=Object.assign({parseFragmentIdentifier:!0,[f]:!1},$);const{url:F,query:G,fragmentIdentifier:x}=r.parseUrl(k,$);return r.stringifyUrl({url:F,query:n(G,Y),fragmentIdentifier:x},$)},r.exclude=(k,Y,$)=>{const F=Array.isArray(Y)?G=>!Y.includes(G):(G,x)=>!Y(G,x);return r.pick(k,F,$)}})(dc);var Rd={},Mh={},mt={},zv={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});function e(u,b){var p=u>>>16&65535,y=u&65535,A=b>>>16&65535,R=b&65535;return y*R+(p*R+y*A<<16>>>0)|0}r.mul=Math.imul||e;function t(u,b){return u+b|0}r.add=t;function i(u,b){return u-b|0}r.sub=i;function n(u,b){return u<>>32-b}r.rotl=n;function a(u,b){return u<<32-b|u>>>b}r.rotr=a;function f(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}r.isInteger=Number.isInteger||f,r.MAX_SAFE_INTEGER=9007199254740991,r.isSafeInteger=function(u){return r.isInteger(u)&&u>=-r.MAX_SAFE_INTEGER&&u<=r.MAX_SAFE_INTEGER}})(zv);Object.defineProperty(mt,"__esModule",{value:!0});var jv=zv;function L4(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])<<16>>16}mt.readInt16BE=L4;function q4(r,e){return e===void 0&&(e=0),(r[e+0]<<8|r[e+1])>>>0}mt.readUint16BE=q4;function B4(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])<<16>>16}mt.readInt16LE=B4;function U4(r,e){return e===void 0&&(e=0),(r[e+1]<<8|r[e])>>>0}mt.readUint16LE=U4;function kv(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>8,e[t+1]=r>>>0,e}mt.writeUint16BE=kv;mt.writeInt16BE=kv;function Fv(r,e,t){return e===void 0&&(e=new Uint8Array(2)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e}mt.writeUint16LE=Fv;mt.writeInt16LE=Fv;function Yl(r,e){return e===void 0&&(e=0),r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3]}mt.readInt32BE=Yl;function Ql(r,e){return e===void 0&&(e=0),(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}mt.readUint32BE=Ql;function Xl(r,e){return e===void 0&&(e=0),r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e]}mt.readInt32LE=Xl;function Zl(r,e){return e===void 0&&(e=0),(r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e])>>>0}mt.readUint32LE=Zl;function ah(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>24,e[t+1]=r>>>16,e[t+2]=r>>>8,e[t+3]=r>>>0,e}mt.writeUint32BE=ah;mt.writeInt32BE=ah;function oh(r,e,t){return e===void 0&&(e=new Uint8Array(4)),t===void 0&&(t=0),e[t+0]=r>>>0,e[t+1]=r>>>8,e[t+2]=r>>>16,e[t+3]=r>>>24,e}mt.writeUint32LE=oh;mt.writeInt32LE=oh;function $4(r,e){e===void 0&&(e=0);var t=Yl(r,e),i=Yl(r,e+4);return t*4294967296+i-(i>>31)*4294967296}mt.readInt64BE=$4;function z4(r,e){e===void 0&&(e=0);var t=Ql(r,e),i=Ql(r,e+4);return t*4294967296+i}mt.readUint64BE=z4;function j4(r,e){e===void 0&&(e=0);var t=Xl(r,e),i=Xl(r,e+4);return i*4294967296+t-(t>>31)*4294967296}mt.readInt64LE=j4;function k4(r,e){e===void 0&&(e=0);var t=Zl(r,e),i=Zl(r,e+4);return i*4294967296+t}mt.readUint64LE=k4;function Hv(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),ah(r/4294967296>>>0,e,t),ah(r>>>0,e,t+4),e}mt.writeUint64BE=Hv;mt.writeInt64BE=Hv;function Kv(r,e,t){return e===void 0&&(e=new Uint8Array(8)),t===void 0&&(t=0),oh(r>>>0,e,t),oh(r/4294967296>>>0,e,t+4),e}mt.writeUint64LE=Kv;mt.writeInt64LE=Kv;function F4(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,a=r/8+t-1;a>=t;a--)i+=e[a]*n,n*=256;return i}mt.readUintBE=F4;function H4(r,e,t){if(t===void 0&&(t=0),r%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(r/8>e.length-t)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,a=t;a=i;a--)t[a]=e/n&255,n*=256;return t}mt.writeUintBE=K4;function V4(r,e,t,i){if(t===void 0&&(t=new Uint8Array(r/8)),i===void 0&&(i=0),r%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!jv.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var n=1,a=i;a>>16|v<<16,L=L+v|0,x^=L,x=x>>>20|x<<12,$=$+q|0,_^=$,_=_>>>16|_<<16,m=m+_|0,q^=m,q=q>>>20|q<<12,F=F+ae|0,I^=F,I=I>>>16|I<<16,c=c+I|0,ae^=c,ae=ae>>>20|ae<<12,G=G+le|0,M^=G,M=M>>>16|M<<16,h=h+M|0,le^=h,le=le>>>20|le<<12,F=F+ae|0,I^=F,I=I>>>24|I<<8,c=c+I|0,ae^=c,ae=ae>>>25|ae<<7,G=G+le|0,M^=G,M=M>>>24|M<<8,h=h+M|0,le^=h,le=le>>>25|le<<7,$=$+q|0,_^=$,_=_>>>24|_<<8,m=m+_|0,q^=m,q=q>>>25|q<<7,Y=Y+x|0,v^=Y,v=v>>>24|v<<8,L=L+v|0,x^=L,x=x>>>25|x<<7,Y=Y+q|0,M^=Y,M=M>>>16|M<<16,c=c+M|0,q^=c,q=q>>>20|q<<12,$=$+ae|0,v^=$,v=v>>>16|v<<16,h=h+v|0,ae^=h,ae=ae>>>20|ae<<12,F=F+le|0,_^=F,_=_>>>16|_<<16,L=L+_|0,le^=L,le=le>>>20|le<<12,G=G+x|0,I^=G,I=I>>>16|I<<16,m=m+I|0,x^=m,x=x>>>20|x<<12,F=F+le|0,_^=F,_=_>>>24|_<<8,L=L+_|0,le^=L,le=le>>>25|le<<7,G=G+x|0,I^=G,I=I>>>24|I<<8,m=m+I|0,x^=m,x=x>>>25|x<<7,$=$+ae|0,v^=$,v=v>>>24|v<<8,h=h+v|0,ae^=h,ae=ae>>>25|ae<<7,Y=Y+q|0,M^=Y,M=M>>>24|M<<8,c=c+M|0,q^=c,q=q>>>25|q<<7;$r.writeUint32LE(Y+i|0,r,0),$r.writeUint32LE($+n|0,r,4),$r.writeUint32LE(F+a|0,r,8),$r.writeUint32LE(G+f|0,r,12),$r.writeUint32LE(x+u|0,r,16),$r.writeUint32LE(q+b|0,r,20),$r.writeUint32LE(ae+p|0,r,24),$r.writeUint32LE(le+y|0,r,28),$r.writeUint32LE(L+A|0,r,32),$r.writeUint32LE(m+R|0,r,36),$r.writeUint32LE(c+O|0,r,40),$r.writeUint32LE(h+N|0,r,44),$r.writeUint32LE(v+K|0,r,48),$r.writeUint32LE(_+W|0,r,52),$r.writeUint32LE(I+Q|0,r,56),$r.writeUint32LE(M+k|0,r,60)}function Vv(r,e,t,i,n){if(n===void 0&&(n=0),r.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}var Gv={},Us={};Object.defineProperty(Us,"__esModule",{value:!0});function a_(r,e,t){return~(r-1)&e|r-1&t}Us.select=a_;function o_(r,e){return(r|0)-(e|0)-1>>>31&1}Us.lessOrEqual=o_;function Wv(r,e){if(r.length!==e.length)return 0;for(var t=0,i=0;i>>8}Us.compare=Wv;function c_(r,e){return r.length===0||e.length===0?!1:Wv(r,e)!==0}Us.equal=c_;(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Us,t=Ei;r.DIGEST_LENGTH=16;var i=function(){function f(u){this.digestLength=r.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var b=u[0]|u[1]<<8;this._r[0]=b&8191;var p=u[2]|u[3]<<8;this._r[1]=(b>>>13|p<<3)&8191;var y=u[4]|u[5]<<8;this._r[2]=(p>>>10|y<<6)&7939;var A=u[6]|u[7]<<8;this._r[3]=(y>>>7|A<<9)&8191;var R=u[8]|u[9]<<8;this._r[4]=(A>>>4|R<<12)&255,this._r[5]=R>>>1&8190;var O=u[10]|u[11]<<8;this._r[6]=(R>>>14|O<<2)&8191;var N=u[12]|u[13]<<8;this._r[7]=(O>>>11|N<<5)&8065;var K=u[14]|u[15]<<8;this._r[8]=(N>>>8|K<<8)&8191,this._r[9]=K>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return f.prototype._blocks=function(u,b,p){for(var y=this._fin?0:2048,A=this._h[0],R=this._h[1],O=this._h[2],N=this._h[3],K=this._h[4],W=this._h[5],Q=this._h[6],k=this._h[7],Y=this._h[8],$=this._h[9],F=this._r[0],G=this._r[1],x=this._r[2],q=this._r[3],ae=this._r[4],le=this._r[5],L=this._r[6],m=this._r[7],c=this._r[8],h=this._r[9];p>=16;){var v=u[b+0]|u[b+1]<<8;A+=v&8191;var _=u[b+2]|u[b+3]<<8;R+=(v>>>13|_<<3)&8191;var I=u[b+4]|u[b+5]<<8;O+=(_>>>10|I<<6)&8191;var M=u[b+6]|u[b+7]<<8;N+=(I>>>7|M<<9)&8191;var S=u[b+8]|u[b+9]<<8;K+=(M>>>4|S<<12)&8191,W+=S>>>1&8191;var d=u[b+10]|u[b+11]<<8;Q+=(S>>>14|d<<2)&8191;var g=u[b+12]|u[b+13]<<8;k+=(d>>>11|g<<5)&8191;var C=u[b+14]|u[b+15]<<8;Y+=(g>>>8|C<<8)&8191,$+=C>>>5|y;var Z=0,se=Z;se+=A*F,se+=R*(5*h),se+=O*(5*c),se+=N*(5*m),se+=K*(5*L),Z=se>>>13,se&=8191,se+=W*(5*le),se+=Q*(5*ae),se+=k*(5*q),se+=Y*(5*x),se+=$*(5*G),Z+=se>>>13,se&=8191;var P=Z;P+=A*G,P+=R*F,P+=O*(5*h),P+=N*(5*c),P+=K*(5*m),Z=P>>>13,P&=8191,P+=W*(5*L),P+=Q*(5*le),P+=k*(5*ae),P+=Y*(5*q),P+=$*(5*x),Z+=P>>>13,P&=8191;var ee=Z;ee+=A*x,ee+=R*G,ee+=O*F,ee+=N*(5*h),ee+=K*(5*c),Z=ee>>>13,ee&=8191,ee+=W*(5*m),ee+=Q*(5*L),ee+=k*(5*le),ee+=Y*(5*ae),ee+=$*(5*q),Z+=ee>>>13,ee&=8191;var B=Z;B+=A*q,B+=R*x,B+=O*G,B+=N*F,B+=K*(5*h),Z=B>>>13,B&=8191,B+=W*(5*c),B+=Q*(5*m),B+=k*(5*L),B+=Y*(5*le),B+=$*(5*ae),Z+=B>>>13,B&=8191;var j=Z;j+=A*ae,j+=R*q,j+=O*x,j+=N*G,j+=K*F,Z=j>>>13,j&=8191,j+=W*(5*h),j+=Q*(5*c),j+=k*(5*m),j+=Y*(5*L),j+=$*(5*le),Z+=j>>>13,j&=8191;var H=Z;H+=A*le,H+=R*ae,H+=O*q,H+=N*x,H+=K*G,Z=H>>>13,H&=8191,H+=W*F,H+=Q*(5*h),H+=k*(5*c),H+=Y*(5*m),H+=$*(5*L),Z+=H>>>13,H&=8191;var w=Z;w+=A*L,w+=R*le,w+=O*ae,w+=N*q,w+=K*x,Z=w>>>13,w&=8191,w+=W*G,w+=Q*F,w+=k*(5*h),w+=Y*(5*c),w+=$*(5*m),Z+=w>>>13,w&=8191;var z=Z;z+=A*m,z+=R*L,z+=O*le,z+=N*ae,z+=K*q,Z=z>>>13,z&=8191,z+=W*x,z+=Q*G,z+=k*F,z+=Y*(5*h),z+=$*(5*c),Z+=z>>>13,z&=8191;var ne=Z;ne+=A*c,ne+=R*m,ne+=O*L,ne+=N*le,ne+=K*ae,Z=ne>>>13,ne&=8191,ne+=W*q,ne+=Q*x,ne+=k*G,ne+=Y*F,ne+=$*(5*h),Z+=ne>>>13,ne&=8191;var ce=Z;ce+=A*h,ce+=R*c,ce+=O*m,ce+=N*L,ce+=K*le,Z=ce>>>13,ce&=8191,ce+=W*ae,ce+=Q*q,ce+=k*x,ce+=Y*G,ce+=$*F,Z+=ce>>>13,ce&=8191,Z=(Z<<2)+Z|0,Z=Z+se|0,se=Z&8191,Z=Z>>>13,P+=Z,A=se,R=P,O=ee,N=B,K=j,W=H,Q=w,k=z,Y=ne,$=ce,b+=16,p-=16}this._h[0]=A,this._h[1]=R,this._h[2]=O,this._h[3]=N,this._h[4]=K,this._h[5]=W,this._h[6]=Q,this._h[7]=k,this._h[8]=Y,this._h[9]=$},f.prototype.finish=function(u,b){b===void 0&&(b=0);var p=new Uint16Array(10),y,A,R,O;if(this._leftover){for(O=this._leftover,this._buffer[O++]=1;O<16;O++)this._buffer[O]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(y=this._h[1]>>>13,this._h[1]&=8191,O=2;O<10;O++)this._h[O]+=y,y=this._h[O]>>>13,this._h[O]&=8191;for(this._h[0]+=y*5,y=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=y,y=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=y,p[0]=this._h[0]+5,y=p[0]>>>13,p[0]&=8191,O=1;O<10;O++)p[O]=this._h[O]+y,y=p[O]>>>13,p[O]&=8191;for(p[9]-=8192,A=(y^1)-1,O=0;O<10;O++)p[O]&=A;for(A=~A,O=0;O<10;O++)this._h[O]=this._h[O]&A|p[O];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,R=this._h[0]+this._pad[0],this._h[0]=R&65535,O=1;O<8;O++)R=(this._h[O]+this._pad[O]|0)+(R>>>16)|0,this._h[O]=R&65535;return u[b+0]=this._h[0]>>>0,u[b+1]=this._h[0]>>>8,u[b+2]=this._h[1]>>>0,u[b+3]=this._h[1]>>>8,u[b+4]=this._h[2]>>>0,u[b+5]=this._h[2]>>>8,u[b+6]=this._h[3]>>>0,u[b+7]=this._h[3]>>>8,u[b+8]=this._h[4]>>>0,u[b+9]=this._h[4]>>>8,u[b+10]=this._h[5]>>>0,u[b+11]=this._h[5]>>>8,u[b+12]=this._h[6]>>>0,u[b+13]=this._h[6]>>>8,u[b+14]=this._h[7]>>>0,u[b+15]=this._h[7]>>>8,this._finished=!0,this},f.prototype.update=function(u){var b=0,p=u.length,y;if(this._leftover){y=16-this._leftover,y>p&&(y=p);for(var A=0;A=16&&(y=p-p%16,this._blocks(u,b,y),b+=y,p-=y),p){for(var A=0;A16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var O=new Uint8Array(16);O.set(p,O.length-p.length);var N=new Uint8Array(32);e.stream(this._key,O,N,4);var K=y.length+this.tagLength,W;if(R){if(R.length!==K)throw new Error("ChaCha20Poly1305: incorrect destination length");W=R}else W=new Uint8Array(K);return e.streamXOR(this._key,O,y,W,4),this._authenticate(W.subarray(W.length-this.tagLength,W.length),N,W.subarray(0,W.length-this.tagLength),A),i.wipe(O),W},b.prototype.open=function(p,y,A,R){if(p.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(y.length0&&O.update(f.subarray(R.length%16))),O.update(A),A.length%16>0&&O.update(f.subarray(A.length%16));var N=new Uint8Array(8);R&&n.writeUint64LE(R.length,N),O.update(N),n.writeUint64LE(A.length,N),O.update(N);for(var K=O.digest(),W=0;Wthis.blockSize?this._inner.update(t).finish(i).clean():i.set(t);for(var n=0;n1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},r.prototype.expand=function(e){for(var t=new Uint8Array(e),i=0;i256)throw new Error("randomString charset is too long");let R="";const O=y.length,N=256-256%O;for(;p>0;){const K=n(Math.ceil(p*256/N),A);for(let W=0;W0;W++){const Q=K[W];Q0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=b[y++],p--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(y=a(this._temp,this._state,b,y,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=b[y++],p--;return this},u.prototype.finish=function(b){if(!this._finished){var p=this._bytesHashed,y=this._bufferLength,A=p/536870912|0,R=p<<3,O=p%64<56?64:128;this._buffer[y]=128;for(var N=y+1;N0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(b){return this._state.set(b.state),this._bufferLength=b.bufferLength,b.buffer&&this._buffer.set(b.buffer),this._bytesHashed=b.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(b){t.wipe(b.state),b.buffer&&t.wipe(b.buffer),b.bufferLength=0,b.bytesHashed=0},u}();r.SHA256=i;var n=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(u,b,p,y,A){for(;A>=64;){for(var R=b[0],O=b[1],N=b[2],K=b[3],W=b[4],Q=b[5],k=b[6],Y=b[7],$=0;$<16;$++){var F=y+$*4;u[$]=e.readUint32BE(p,F)}for(var $=16;$<64;$++){var G=u[$-2],x=(G>>>17|G<<15)^(G>>>19|G<<13)^G>>>10;G=u[$-15];var q=(G>>>7|G<<25)^(G>>>18|G<<14)^G>>>3;u[$]=(x+u[$-7]|0)+(q+u[$-16]|0)}for(var $=0;$<64;$++){var x=(((W>>>6|W<<26)^(W>>>11|W<<21)^(W>>>25|W<<7))+(W&Q^~W&k)|0)+(Y+(n[$]+u[$]|0)|0)|0,q=((R>>>2|R<<30)^(R>>>13|R<<19)^(R>>>22|R<<10))+(R&O^R&N^O&N)|0;Y=k,k=Q,Q=W,W=K+x|0,K=N,N=O,O=R,R=x+q|0}b[0]+=R,b[1]+=O,b[2]+=N,b[3]+=K,b[4]+=W,b[5]+=Q,b[6]+=k,b[7]+=Y,y+=64,A-=64}return y}function f(u){var b=new i;b.update(u);var p=b.digest();return b.clean(),p}r.hash=f})(Ac);var Td={};(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.sharedKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.scalarMultBase=r.scalarMult=r.SHARED_KEY_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=void 0;const e=$s,t=Ei;r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=32,r.SHARED_KEY_LENGTH=32;function i($){const F=new Float64Array(16);if($)for(let G=0;G<$.length;G++)F[G]=$[G];return F}const n=new Uint8Array(32);n[0]=9;const a=i([56129,1]);function f($){let F=1;for(let G=0;G<16;G++){let x=$[G]+F+65535;F=Math.floor(x/65536),$[G]=x-F*65536}$[0]+=F-1+37*(F-1)}function u($,F,G){const x=~(G-1);for(let q=0;q<16;q++){const ae=x&($[q]^F[q]);$[q]^=ae,F[q]^=ae}}function b($,F){const G=i(),x=i();for(let q=0;q<16;q++)x[q]=F[q];f(x),f(x),f(x);for(let q=0;q<2;q++){G[0]=x[0]-65517;for(let le=1;le<15;le++)G[le]=x[le]-65535-(G[le-1]>>16&1),G[le-1]&=65535;G[15]=x[15]-32767-(G[14]>>16&1);const ae=G[15]>>16&1;G[14]&=65535,u(x,G,1-ae)}for(let q=0;q<16;q++)$[2*q]=x[q]&255,$[2*q+1]=x[q]>>8}function p($,F){for(let G=0;G<16;G++)$[G]=F[2*G]+(F[2*G+1]<<8);$[15]&=32767}function y($,F,G){for(let x=0;x<16;x++)$[x]=F[x]+G[x]}function A($,F,G){for(let x=0;x<16;x++)$[x]=F[x]-G[x]}function R($,F,G){let x,q,ae=0,le=0,L=0,m=0,c=0,h=0,v=0,_=0,I=0,M=0,S=0,d=0,g=0,C=0,Z=0,se=0,P=0,ee=0,B=0,j=0,H=0,w=0,z=0,ne=0,ce=0,he=0,ye=0,we=0,Te=0,Qe=0,Oe=0,Ce=G[0],Ie=G[1],me=G[2],Re=G[3],De=G[4],ve=G[5],Ne=G[6],Se=G[7],be=G[8],Ue=G[9],Me=G[10],_e=G[11],He=G[12],Ve=G[13],Ee=G[14],Ke=G[15];x=F[0],ae+=x*Ce,le+=x*Ie,L+=x*me,m+=x*Re,c+=x*De,h+=x*ve,v+=x*Ne,_+=x*Se,I+=x*be,M+=x*Ue,S+=x*Me,d+=x*_e,g+=x*He,C+=x*Ve,Z+=x*Ee,se+=x*Ke,x=F[1],le+=x*Ce,L+=x*Ie,m+=x*me,c+=x*Re,h+=x*De,v+=x*ve,_+=x*Ne,I+=x*Se,M+=x*be,S+=x*Ue,d+=x*Me,g+=x*_e,C+=x*He,Z+=x*Ve,se+=x*Ee,P+=x*Ke,x=F[2],L+=x*Ce,m+=x*Ie,c+=x*me,h+=x*Re,v+=x*De,_+=x*ve,I+=x*Ne,M+=x*Se,S+=x*be,d+=x*Ue,g+=x*Me,C+=x*_e,Z+=x*He,se+=x*Ve,P+=x*Ee,ee+=x*Ke,x=F[3],m+=x*Ce,c+=x*Ie,h+=x*me,v+=x*Re,_+=x*De,I+=x*ve,M+=x*Ne,S+=x*Se,d+=x*be,g+=x*Ue,C+=x*Me,Z+=x*_e,se+=x*He,P+=x*Ve,ee+=x*Ee,B+=x*Ke,x=F[4],c+=x*Ce,h+=x*Ie,v+=x*me,_+=x*Re,I+=x*De,M+=x*ve,S+=x*Ne,d+=x*Se,g+=x*be,C+=x*Ue,Z+=x*Me,se+=x*_e,P+=x*He,ee+=x*Ve,B+=x*Ee,j+=x*Ke,x=F[5],h+=x*Ce,v+=x*Ie,_+=x*me,I+=x*Re,M+=x*De,S+=x*ve,d+=x*Ne,g+=x*Se,C+=x*be,Z+=x*Ue,se+=x*Me,P+=x*_e,ee+=x*He,B+=x*Ve,j+=x*Ee,H+=x*Ke,x=F[6],v+=x*Ce,_+=x*Ie,I+=x*me,M+=x*Re,S+=x*De,d+=x*ve,g+=x*Ne,C+=x*Se,Z+=x*be,se+=x*Ue,P+=x*Me,ee+=x*_e,B+=x*He,j+=x*Ve,H+=x*Ee,w+=x*Ke,x=F[7],_+=x*Ce,I+=x*Ie,M+=x*me,S+=x*Re,d+=x*De,g+=x*ve,C+=x*Ne,Z+=x*Se,se+=x*be,P+=x*Ue,ee+=x*Me,B+=x*_e,j+=x*He,H+=x*Ve,w+=x*Ee,z+=x*Ke,x=F[8],I+=x*Ce,M+=x*Ie,S+=x*me,d+=x*Re,g+=x*De,C+=x*ve,Z+=x*Ne,se+=x*Se,P+=x*be,ee+=x*Ue,B+=x*Me,j+=x*_e,H+=x*He,w+=x*Ve,z+=x*Ee,ne+=x*Ke,x=F[9],M+=x*Ce,S+=x*Ie,d+=x*me,g+=x*Re,C+=x*De,Z+=x*ve,se+=x*Ne,P+=x*Se,ee+=x*be,B+=x*Ue,j+=x*Me,H+=x*_e,w+=x*He,z+=x*Ve,ne+=x*Ee,ce+=x*Ke,x=F[10],S+=x*Ce,d+=x*Ie,g+=x*me,C+=x*Re,Z+=x*De,se+=x*ve,P+=x*Ne,ee+=x*Se,B+=x*be,j+=x*Ue,H+=x*Me,w+=x*_e,z+=x*He,ne+=x*Ve,ce+=x*Ee,he+=x*Ke,x=F[11],d+=x*Ce,g+=x*Ie,C+=x*me,Z+=x*Re,se+=x*De,P+=x*ve,ee+=x*Ne,B+=x*Se,j+=x*be,H+=x*Ue,w+=x*Me,z+=x*_e,ne+=x*He,ce+=x*Ve,he+=x*Ee,ye+=x*Ke,x=F[12],g+=x*Ce,C+=x*Ie,Z+=x*me,se+=x*Re,P+=x*De,ee+=x*ve,B+=x*Ne,j+=x*Se,H+=x*be,w+=x*Ue,z+=x*Me,ne+=x*_e,ce+=x*He,he+=x*Ve,ye+=x*Ee,we+=x*Ke,x=F[13],C+=x*Ce,Z+=x*Ie,se+=x*me,P+=x*Re,ee+=x*De,B+=x*ve,j+=x*Ne,H+=x*Se,w+=x*be,z+=x*Ue,ne+=x*Me,ce+=x*_e,he+=x*He,ye+=x*Ve,we+=x*Ee,Te+=x*Ke,x=F[14],Z+=x*Ce,se+=x*Ie,P+=x*me,ee+=x*Re,B+=x*De,j+=x*ve,H+=x*Ne,w+=x*Se,z+=x*be,ne+=x*Ue,ce+=x*Me,he+=x*_e,ye+=x*He,we+=x*Ve,Te+=x*Ee,Qe+=x*Ke,x=F[15],se+=x*Ce,P+=x*Ie,ee+=x*me,B+=x*Re,j+=x*De,H+=x*ve,w+=x*Ne,z+=x*Se,ne+=x*be,ce+=x*Ue,he+=x*Me,ye+=x*_e,we+=x*He,Te+=x*Ve,Qe+=x*Ee,Oe+=x*Ke,ae+=38*P,le+=38*ee,L+=38*B,m+=38*j,c+=38*H,h+=38*w,v+=38*z,_+=38*ne,I+=38*ce,M+=38*he,S+=38*ye,d+=38*we,g+=38*Te,C+=38*Qe,Z+=38*Oe,q=1,x=ae+q+65535,q=Math.floor(x/65536),ae=x-q*65536,x=le+q+65535,q=Math.floor(x/65536),le=x-q*65536,x=L+q+65535,q=Math.floor(x/65536),L=x-q*65536,x=m+q+65535,q=Math.floor(x/65536),m=x-q*65536,x=c+q+65535,q=Math.floor(x/65536),c=x-q*65536,x=h+q+65535,q=Math.floor(x/65536),h=x-q*65536,x=v+q+65535,q=Math.floor(x/65536),v=x-q*65536,x=_+q+65535,q=Math.floor(x/65536),_=x-q*65536,x=I+q+65535,q=Math.floor(x/65536),I=x-q*65536,x=M+q+65535,q=Math.floor(x/65536),M=x-q*65536,x=S+q+65535,q=Math.floor(x/65536),S=x-q*65536,x=d+q+65535,q=Math.floor(x/65536),d=x-q*65536,x=g+q+65535,q=Math.floor(x/65536),g=x-q*65536,x=C+q+65535,q=Math.floor(x/65536),C=x-q*65536,x=Z+q+65535,q=Math.floor(x/65536),Z=x-q*65536,x=se+q+65535,q=Math.floor(x/65536),se=x-q*65536,ae+=q-1+37*(q-1),q=1,x=ae+q+65535,q=Math.floor(x/65536),ae=x-q*65536,x=le+q+65535,q=Math.floor(x/65536),le=x-q*65536,x=L+q+65535,q=Math.floor(x/65536),L=x-q*65536,x=m+q+65535,q=Math.floor(x/65536),m=x-q*65536,x=c+q+65535,q=Math.floor(x/65536),c=x-q*65536,x=h+q+65535,q=Math.floor(x/65536),h=x-q*65536,x=v+q+65535,q=Math.floor(x/65536),v=x-q*65536,x=_+q+65535,q=Math.floor(x/65536),_=x-q*65536,x=I+q+65535,q=Math.floor(x/65536),I=x-q*65536,x=M+q+65535,q=Math.floor(x/65536),M=x-q*65536,x=S+q+65535,q=Math.floor(x/65536),S=x-q*65536,x=d+q+65535,q=Math.floor(x/65536),d=x-q*65536,x=g+q+65535,q=Math.floor(x/65536),g=x-q*65536,x=C+q+65535,q=Math.floor(x/65536),C=x-q*65536,x=Z+q+65535,q=Math.floor(x/65536),Z=x-q*65536,x=se+q+65535,q=Math.floor(x/65536),se=x-q*65536,ae+=q-1+37*(q-1),$[0]=ae,$[1]=le,$[2]=L,$[3]=m,$[4]=c,$[5]=h,$[6]=v,$[7]=_,$[8]=I,$[9]=M,$[10]=S,$[11]=d,$[12]=g,$[13]=C,$[14]=Z,$[15]=se}function O($,F){R($,F,F)}function N($,F){const G=i();for(let x=0;x<16;x++)G[x]=F[x];for(let x=253;x>=0;x--)O(G,G),x!==2&&x!==4&&R(G,G,F);for(let x=0;x<16;x++)$[x]=G[x]}function K($,F){const G=new Uint8Array(32),x=new Float64Array(80),q=i(),ae=i(),le=i(),L=i(),m=i(),c=i();for(let I=0;I<31;I++)G[I]=$[I];G[31]=$[31]&127|64,G[0]&=248,p(x,F);for(let I=0;I<16;I++)ae[I]=x[I];q[0]=L[0]=1;for(let I=254;I>=0;--I){const M=G[I>>>3]>>>(I&7)&1;u(q,ae,M),u(le,L,M),y(m,q,le),A(q,q,le),y(le,ae,L),A(ae,ae,L),O(L,m),O(c,q),R(q,le,q),R(le,ae,m),y(m,q,le),A(q,q,le),O(ae,q),A(le,L,c),R(q,le,a),y(q,q,L),R(le,le,q),R(q,L,c),R(L,ae,x),O(ae,m),u(q,ae,M),u(le,L,M)}for(let I=0;I<16;I++)x[I+16]=q[I],x[I+32]=le[I],x[I+48]=ae[I],x[I+64]=L[I];const h=x.subarray(32),v=x.subarray(16);N(h,h),R(v,v,h);const _=new Uint8Array(32);return b(_,v),_}r.scalarMult=K;function W($){return K($,n)}r.scalarMultBase=W;function Q($){if($.length!==r.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${r.SECRET_KEY_LENGTH} bytes`);const F=new Uint8Array($);return{publicKey:W(F),secretKey:F}}r.generateKeyPairFromSeed=Q;function k($){const F=(0,e.randomBytes)(32,$),G=Q(F);return(0,t.wipe)(F),G}r.generateKeyPair=k;function Y($,F,G=!1){if($.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(F.length!==r.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const x=K($,F);if(G){let q=0;for(let ae=0;aen+a.length,0));const t=z8(e);let i=0;for(const n of r)t.set(n,i),i+=n.length;return t}function Er(r,e="utf8"){const t=j8[e];if(!t)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(r.buffer,r.byteOffset,r.byteLength).toString("utf8"):t.encoder.encode(r).substring(1)}var Qv={};const A_="elliptic",E_="6.5.7",x_="EC cryptography",S_="lib/elliptic.js",I_=["lib"],M_={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},P_={type:"git",url:"git@github.com:indutny/elliptic"},O_=["EC","Elliptic","curve","Cryptography"],R_="Fedor Indutny ",N_="MIT",T_={url:"https://github.com/indutny/elliptic/issues"},C_="https://github.com/indutny/elliptic",D_={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},L_={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},q_={name:A_,version:E_,description:x_,main:S_,files:I_,scripts:M_,repository:P_,keywords:O_,author:R_,license:N_,bugs:T_,homepage:C_,devDependencies:D_,dependencies:L_};var xi={},Cd={exports:{}};Cd.exports;(function(r){(function(e,t){function i(L,m){if(!L)throw new Error(m||"Assertion failed")}function n(L,m){L.super_=m;var c=function(){};c.prototype=m.prototype,L.prototype=new c,L.prototype.constructor=L}function a(L,m,c){if(a.isBN(L))return L;this.negative=0,this.words=null,this.length=0,this.red=null,L!==null&&((m==="le"||m==="be")&&(c=m,m=10),this._init(L||0,m||10,c||"be"))}typeof e=="object"?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=Md.Buffer}catch{}a.isBN=function(m){return m instanceof a?!0:m!==null&&typeof m=="object"&&m.constructor.wordSize===a.wordSize&&Array.isArray(m.words)},a.max=function(m,c){return m.cmp(c)>0?m:c},a.min=function(m,c){return m.cmp(c)<0?m:c},a.prototype._init=function(m,c,h){if(typeof m=="number")return this._initNumber(m,c,h);if(typeof m=="object")return this._initArray(m,c,h);c==="hex"&&(c=16),i(c===(c|0)&&c>=2&&c<=36),m=m.toString().replace(/\s+/g,"");var v=0;m[0]==="-"&&(v++,this.negative=1),v=0;v-=3)I=m[v]|m[v-1]<<8|m[v-2]<<16,this.words[_]|=I<>>26-M&67108863,M+=24,M>=26&&(M-=26,_++);else if(h==="le")for(v=0,_=0;v>>26-M&67108863,M+=24,M>=26&&(M-=26,_++);return this.strip()};function u(L,m){var c=L.charCodeAt(m);return c>=65&&c<=70?c-55:c>=97&&c<=102?c-87:c-48&15}function b(L,m,c){var h=u(L,c);return c-1>=m&&(h|=u(L,c-1)<<4),h}a.prototype._parseHex=function(m,c,h){this.length=Math.ceil((m.length-c)/6),this.words=new Array(this.length);for(var v=0;v=c;v-=2)M=b(m,c,v)<<_,this.words[I]|=M&67108863,_>=18?(_-=18,I+=1,this.words[I]|=M>>>26):_+=8;else{var S=m.length-c;for(v=S%2===0?c+1:c;v=18?(_-=18,I+=1,this.words[I]|=M>>>26):_+=8}this.strip()};function p(L,m,c,h){for(var v=0,_=Math.min(L.length,c),I=m;I<_;I++){var M=L.charCodeAt(I)-48;v*=h,M>=49?v+=M-49+10:M>=17?v+=M-17+10:v+=M}return v}a.prototype._parseBase=function(m,c,h){this.words=[0],this.length=1;for(var v=0,_=1;_<=67108863;_*=c)v++;v--,_=_/c|0;for(var I=m.length-h,M=I%v,S=Math.min(I,I-M)+h,d=0,g=h;g1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],A=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],R=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(m,c){m=m||10,c=c|0||1;var h;if(m===16||m==="hex"){h="";for(var v=0,_=0,I=0;I>>24-v&16777215,_!==0||I!==this.length-1?h=y[6-S.length]+S+h:h=S+h,v+=2,v>=26&&(v-=26,I--)}for(_!==0&&(h=_.toString(16)+h);h.length%c!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(m===(m|0)&&m>=2&&m<=36){var d=A[m],g=R[m];h="";var C=this.clone();for(C.negative=0;!C.isZero();){var Z=C.modn(g).toString(m);C=C.idivn(g),C.isZero()?h=Z+h:h=y[d-Z.length]+Z+h}for(this.isZero()&&(h="0"+h);h.length%c!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var m=this.words[0];return this.length===2?m+=this.words[1]*67108864:this.length===3&&this.words[2]===1?m+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-m:m},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(m,c){return i(typeof f<"u"),this.toArrayLike(f,m,c)},a.prototype.toArray=function(m,c){return this.toArrayLike(Array,m,c)},a.prototype.toArrayLike=function(m,c,h){var v=this.byteLength(),_=h||Math.max(1,v);i(v<=_,"byte array longer than desired length"),i(_>0,"Requested array length <= 0"),this.strip();var I=c==="le",M=new m(_),S,d,g=this.clone();if(I){for(d=0;!g.isZero();d++)S=g.andln(255),g.iushrn(8),M[d]=S;for(;d<_;d++)M[d]=0}else{for(d=0;d<_-v;d++)M[d]=0;for(d=0;!g.isZero();d++)S=g.andln(255),g.iushrn(8),M[_-d-1]=S}return M},Math.clz32?a.prototype._countBits=function(m){return 32-Math.clz32(m)}:a.prototype._countBits=function(m){var c=m,h=0;return c>=4096&&(h+=13,c>>>=13),c>=64&&(h+=7,c>>>=7),c>=8&&(h+=4,c>>>=4),c>=2&&(h+=2,c>>>=2),h+c},a.prototype._zeroBits=function(m){if(m===0)return 26;var c=m,h=0;return c&8191||(h+=13,c>>>=13),c&127||(h+=7,c>>>=7),c&15||(h+=4,c>>>=4),c&3||(h+=2,c>>>=2),c&1||h++,h},a.prototype.bitLength=function(){var m=this.words[this.length-1],c=this._countBits(m);return(this.length-1)*26+c};function O(L){for(var m=new Array(L.bitLength()),c=0;c>>v}return m}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var m=0,c=0;cm.length?this.clone().ior(m):m.clone().ior(this)},a.prototype.uor=function(m){return this.length>m.length?this.clone().iuor(m):m.clone().iuor(this)},a.prototype.iuand=function(m){var c;this.length>m.length?c=m:c=this;for(var h=0;hm.length?this.clone().iand(m):m.clone().iand(this)},a.prototype.uand=function(m){return this.length>m.length?this.clone().iuand(m):m.clone().iuand(this)},a.prototype.iuxor=function(m){var c,h;this.length>m.length?(c=this,h=m):(c=m,h=this);for(var v=0;vm.length?this.clone().ixor(m):m.clone().ixor(this)},a.prototype.uxor=function(m){return this.length>m.length?this.clone().iuxor(m):m.clone().iuxor(this)},a.prototype.inotn=function(m){i(typeof m=="number"&&m>=0);var c=Math.ceil(m/26)|0,h=m%26;this._expand(c),h>0&&c--;for(var v=0;v0&&(this.words[v]=~this.words[v]&67108863>>26-h),this.strip()},a.prototype.notn=function(m){return this.clone().inotn(m)},a.prototype.setn=function(m,c){i(typeof m=="number"&&m>=0);var h=m/26|0,v=m%26;return this._expand(h+1),c?this.words[h]=this.words[h]|1<m.length?(h=this,v=m):(h=m,v=this);for(var _=0,I=0;I>>26;for(;_!==0&&I>>26;if(this.length=h.length,_!==0)this.words[this.length]=_,this.length++;else if(h!==this)for(;Im.length?this.clone().iadd(m):m.clone().iadd(this)},a.prototype.isub=function(m){if(m.negative!==0){m.negative=0;var c=this.iadd(m);return m.negative=1,c._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(m),this.negative=1,this._normSign();var h=this.cmp(m);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,_;h>0?(v=this,_=m):(v=m,_=this);for(var I=0,M=0;M<_.length;M++)c=(v.words[M]|0)-(_.words[M]|0)+I,I=c>>26,this.words[M]=c&67108863;for(;I!==0&&M>26,this.words[M]=c&67108863;if(I===0&&M>>26,C=S&67108863,Z=Math.min(d,m.length-1),se=Math.max(0,d-L.length+1);se<=Z;se++){var P=d-se|0;v=L.words[P]|0,_=m.words[se]|0,I=v*_+C,g+=I/67108864|0,C=I&67108863}c.words[d]=C|0,S=g|0}return S!==0?c.words[d]=S|0:c.length--,c.strip()}var K=function(m,c,h){var v=m.words,_=c.words,I=h.words,M=0,S,d,g,C=v[0]|0,Z=C&8191,se=C>>>13,P=v[1]|0,ee=P&8191,B=P>>>13,j=v[2]|0,H=j&8191,w=j>>>13,z=v[3]|0,ne=z&8191,ce=z>>>13,he=v[4]|0,ye=he&8191,we=he>>>13,Te=v[5]|0,Qe=Te&8191,Oe=Te>>>13,Ce=v[6]|0,Ie=Ce&8191,me=Ce>>>13,Re=v[7]|0,De=Re&8191,ve=Re>>>13,Ne=v[8]|0,Se=Ne&8191,be=Ne>>>13,Ue=v[9]|0,Me=Ue&8191,_e=Ue>>>13,He=_[0]|0,Ve=He&8191,Ee=He>>>13,Ke=_[1]|0,ut=Ke&8191,Ge=Ke>>>13,_t=_[2]|0,lt=_t&8191,Je=_t>>>13,Et=_[3]|0,It=Et&8191,Le=Et>>>13,Xe=_[4]|0,tt=Xe&8191,qe=Xe>>>13,et=_[5]|0,Ze=et&8191,ze=et>>>13,ft=_[6]|0,rt=ft&8191,je=ft>>>13,it=_[7]|0,st=it&8191,Be=it>>>13,Ye=_[8]|0,ht=Ye&8191,ke=Ye>>>13,Ct=_[9]|0,Dt=Ct&8191,at=Ct>>>13;h.negative=m.negative^c.negative,h.length=19,S=Math.imul(Z,Ve),d=Math.imul(Z,Ee),d=d+Math.imul(se,Ve)|0,g=Math.imul(se,Ee);var bt=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(bt>>>26)|0,bt&=67108863,S=Math.imul(ee,Ve),d=Math.imul(ee,Ee),d=d+Math.imul(B,Ve)|0,g=Math.imul(B,Ee),S=S+Math.imul(Z,ut)|0,d=d+Math.imul(Z,Ge)|0,d=d+Math.imul(se,ut)|0,g=g+Math.imul(se,Ge)|0;var Tr=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,S=Math.imul(H,Ve),d=Math.imul(H,Ee),d=d+Math.imul(w,Ve)|0,g=Math.imul(w,Ee),S=S+Math.imul(ee,ut)|0,d=d+Math.imul(ee,Ge)|0,d=d+Math.imul(B,ut)|0,g=g+Math.imul(B,Ge)|0,S=S+Math.imul(Z,lt)|0,d=d+Math.imul(Z,Je)|0,d=d+Math.imul(se,lt)|0,g=g+Math.imul(se,Je)|0;var Cr=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,S=Math.imul(ne,Ve),d=Math.imul(ne,Ee),d=d+Math.imul(ce,Ve)|0,g=Math.imul(ce,Ee),S=S+Math.imul(H,ut)|0,d=d+Math.imul(H,Ge)|0,d=d+Math.imul(w,ut)|0,g=g+Math.imul(w,Ge)|0,S=S+Math.imul(ee,lt)|0,d=d+Math.imul(ee,Je)|0,d=d+Math.imul(B,lt)|0,g=g+Math.imul(B,Je)|0,S=S+Math.imul(Z,It)|0,d=d+Math.imul(Z,Le)|0,d=d+Math.imul(se,It)|0,g=g+Math.imul(se,Le)|0;var Dr=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,S=Math.imul(ye,Ve),d=Math.imul(ye,Ee),d=d+Math.imul(we,Ve)|0,g=Math.imul(we,Ee),S=S+Math.imul(ne,ut)|0,d=d+Math.imul(ne,Ge)|0,d=d+Math.imul(ce,ut)|0,g=g+Math.imul(ce,Ge)|0,S=S+Math.imul(H,lt)|0,d=d+Math.imul(H,Je)|0,d=d+Math.imul(w,lt)|0,g=g+Math.imul(w,Je)|0,S=S+Math.imul(ee,It)|0,d=d+Math.imul(ee,Le)|0,d=d+Math.imul(B,It)|0,g=g+Math.imul(B,Le)|0,S=S+Math.imul(Z,tt)|0,d=d+Math.imul(Z,qe)|0,d=d+Math.imul(se,tt)|0,g=g+Math.imul(se,qe)|0;var Lr=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,S=Math.imul(Qe,Ve),d=Math.imul(Qe,Ee),d=d+Math.imul(Oe,Ve)|0,g=Math.imul(Oe,Ee),S=S+Math.imul(ye,ut)|0,d=d+Math.imul(ye,Ge)|0,d=d+Math.imul(we,ut)|0,g=g+Math.imul(we,Ge)|0,S=S+Math.imul(ne,lt)|0,d=d+Math.imul(ne,Je)|0,d=d+Math.imul(ce,lt)|0,g=g+Math.imul(ce,Je)|0,S=S+Math.imul(H,It)|0,d=d+Math.imul(H,Le)|0,d=d+Math.imul(w,It)|0,g=g+Math.imul(w,Le)|0,S=S+Math.imul(ee,tt)|0,d=d+Math.imul(ee,qe)|0,d=d+Math.imul(B,tt)|0,g=g+Math.imul(B,qe)|0,S=S+Math.imul(Z,Ze)|0,d=d+Math.imul(Z,ze)|0,d=d+Math.imul(se,Ze)|0,g=g+Math.imul(se,ze)|0;var qr=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(qr>>>26)|0,qr&=67108863,S=Math.imul(Ie,Ve),d=Math.imul(Ie,Ee),d=d+Math.imul(me,Ve)|0,g=Math.imul(me,Ee),S=S+Math.imul(Qe,ut)|0,d=d+Math.imul(Qe,Ge)|0,d=d+Math.imul(Oe,ut)|0,g=g+Math.imul(Oe,Ge)|0,S=S+Math.imul(ye,lt)|0,d=d+Math.imul(ye,Je)|0,d=d+Math.imul(we,lt)|0,g=g+Math.imul(we,Je)|0,S=S+Math.imul(ne,It)|0,d=d+Math.imul(ne,Le)|0,d=d+Math.imul(ce,It)|0,g=g+Math.imul(ce,Le)|0,S=S+Math.imul(H,tt)|0,d=d+Math.imul(H,qe)|0,d=d+Math.imul(w,tt)|0,g=g+Math.imul(w,qe)|0,S=S+Math.imul(ee,Ze)|0,d=d+Math.imul(ee,ze)|0,d=d+Math.imul(B,Ze)|0,g=g+Math.imul(B,ze)|0,S=S+Math.imul(Z,rt)|0,d=d+Math.imul(Z,je)|0,d=d+Math.imul(se,rt)|0,g=g+Math.imul(se,je)|0;var er=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(er>>>26)|0,er&=67108863,S=Math.imul(De,Ve),d=Math.imul(De,Ee),d=d+Math.imul(ve,Ve)|0,g=Math.imul(ve,Ee),S=S+Math.imul(Ie,ut)|0,d=d+Math.imul(Ie,Ge)|0,d=d+Math.imul(me,ut)|0,g=g+Math.imul(me,Ge)|0,S=S+Math.imul(Qe,lt)|0,d=d+Math.imul(Qe,Je)|0,d=d+Math.imul(Oe,lt)|0,g=g+Math.imul(Oe,Je)|0,S=S+Math.imul(ye,It)|0,d=d+Math.imul(ye,Le)|0,d=d+Math.imul(we,It)|0,g=g+Math.imul(we,Le)|0,S=S+Math.imul(ne,tt)|0,d=d+Math.imul(ne,qe)|0,d=d+Math.imul(ce,tt)|0,g=g+Math.imul(ce,qe)|0,S=S+Math.imul(H,Ze)|0,d=d+Math.imul(H,ze)|0,d=d+Math.imul(w,Ze)|0,g=g+Math.imul(w,ze)|0,S=S+Math.imul(ee,rt)|0,d=d+Math.imul(ee,je)|0,d=d+Math.imul(B,rt)|0,g=g+Math.imul(B,je)|0,S=S+Math.imul(Z,st)|0,d=d+Math.imul(Z,Be)|0,d=d+Math.imul(se,st)|0,g=g+Math.imul(se,Be)|0;var Qr=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,S=Math.imul(Se,Ve),d=Math.imul(Se,Ee),d=d+Math.imul(be,Ve)|0,g=Math.imul(be,Ee),S=S+Math.imul(De,ut)|0,d=d+Math.imul(De,Ge)|0,d=d+Math.imul(ve,ut)|0,g=g+Math.imul(ve,Ge)|0,S=S+Math.imul(Ie,lt)|0,d=d+Math.imul(Ie,Je)|0,d=d+Math.imul(me,lt)|0,g=g+Math.imul(me,Je)|0,S=S+Math.imul(Qe,It)|0,d=d+Math.imul(Qe,Le)|0,d=d+Math.imul(Oe,It)|0,g=g+Math.imul(Oe,Le)|0,S=S+Math.imul(ye,tt)|0,d=d+Math.imul(ye,qe)|0,d=d+Math.imul(we,tt)|0,g=g+Math.imul(we,qe)|0,S=S+Math.imul(ne,Ze)|0,d=d+Math.imul(ne,ze)|0,d=d+Math.imul(ce,Ze)|0,g=g+Math.imul(ce,ze)|0,S=S+Math.imul(H,rt)|0,d=d+Math.imul(H,je)|0,d=d+Math.imul(w,rt)|0,g=g+Math.imul(w,je)|0,S=S+Math.imul(ee,st)|0,d=d+Math.imul(ee,Be)|0,d=d+Math.imul(B,st)|0,g=g+Math.imul(B,Be)|0,S=S+Math.imul(Z,ht)|0,d=d+Math.imul(Z,ke)|0,d=d+Math.imul(se,ht)|0,g=g+Math.imul(se,ke)|0;var Vi=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,S=Math.imul(Me,Ve),d=Math.imul(Me,Ee),d=d+Math.imul(_e,Ve)|0,g=Math.imul(_e,Ee),S=S+Math.imul(Se,ut)|0,d=d+Math.imul(Se,Ge)|0,d=d+Math.imul(be,ut)|0,g=g+Math.imul(be,Ge)|0,S=S+Math.imul(De,lt)|0,d=d+Math.imul(De,Je)|0,d=d+Math.imul(ve,lt)|0,g=g+Math.imul(ve,Je)|0,S=S+Math.imul(Ie,It)|0,d=d+Math.imul(Ie,Le)|0,d=d+Math.imul(me,It)|0,g=g+Math.imul(me,Le)|0,S=S+Math.imul(Qe,tt)|0,d=d+Math.imul(Qe,qe)|0,d=d+Math.imul(Oe,tt)|0,g=g+Math.imul(Oe,qe)|0,S=S+Math.imul(ye,Ze)|0,d=d+Math.imul(ye,ze)|0,d=d+Math.imul(we,Ze)|0,g=g+Math.imul(we,ze)|0,S=S+Math.imul(ne,rt)|0,d=d+Math.imul(ne,je)|0,d=d+Math.imul(ce,rt)|0,g=g+Math.imul(ce,je)|0,S=S+Math.imul(H,st)|0,d=d+Math.imul(H,Be)|0,d=d+Math.imul(w,st)|0,g=g+Math.imul(w,Be)|0,S=S+Math.imul(ee,ht)|0,d=d+Math.imul(ee,ke)|0,d=d+Math.imul(B,ht)|0,g=g+Math.imul(B,ke)|0,S=S+Math.imul(Z,Dt)|0,d=d+Math.imul(Z,at)|0,d=d+Math.imul(se,Dt)|0,g=g+Math.imul(se,at)|0;var Xr=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,S=Math.imul(Me,ut),d=Math.imul(Me,Ge),d=d+Math.imul(_e,ut)|0,g=Math.imul(_e,Ge),S=S+Math.imul(Se,lt)|0,d=d+Math.imul(Se,Je)|0,d=d+Math.imul(be,lt)|0,g=g+Math.imul(be,Je)|0,S=S+Math.imul(De,It)|0,d=d+Math.imul(De,Le)|0,d=d+Math.imul(ve,It)|0,g=g+Math.imul(ve,Le)|0,S=S+Math.imul(Ie,tt)|0,d=d+Math.imul(Ie,qe)|0,d=d+Math.imul(me,tt)|0,g=g+Math.imul(me,qe)|0,S=S+Math.imul(Qe,Ze)|0,d=d+Math.imul(Qe,ze)|0,d=d+Math.imul(Oe,Ze)|0,g=g+Math.imul(Oe,ze)|0,S=S+Math.imul(ye,rt)|0,d=d+Math.imul(ye,je)|0,d=d+Math.imul(we,rt)|0,g=g+Math.imul(we,je)|0,S=S+Math.imul(ne,st)|0,d=d+Math.imul(ne,Be)|0,d=d+Math.imul(ce,st)|0,g=g+Math.imul(ce,Be)|0,S=S+Math.imul(H,ht)|0,d=d+Math.imul(H,ke)|0,d=d+Math.imul(w,ht)|0,g=g+Math.imul(w,ke)|0,S=S+Math.imul(ee,Dt)|0,d=d+Math.imul(ee,at)|0,d=d+Math.imul(B,Dt)|0,g=g+Math.imul(B,at)|0;var Gi=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,S=Math.imul(Me,lt),d=Math.imul(Me,Je),d=d+Math.imul(_e,lt)|0,g=Math.imul(_e,Je),S=S+Math.imul(Se,It)|0,d=d+Math.imul(Se,Le)|0,d=d+Math.imul(be,It)|0,g=g+Math.imul(be,Le)|0,S=S+Math.imul(De,tt)|0,d=d+Math.imul(De,qe)|0,d=d+Math.imul(ve,tt)|0,g=g+Math.imul(ve,qe)|0,S=S+Math.imul(Ie,Ze)|0,d=d+Math.imul(Ie,ze)|0,d=d+Math.imul(me,Ze)|0,g=g+Math.imul(me,ze)|0,S=S+Math.imul(Qe,rt)|0,d=d+Math.imul(Qe,je)|0,d=d+Math.imul(Oe,rt)|0,g=g+Math.imul(Oe,je)|0,S=S+Math.imul(ye,st)|0,d=d+Math.imul(ye,Be)|0,d=d+Math.imul(we,st)|0,g=g+Math.imul(we,Be)|0,S=S+Math.imul(ne,ht)|0,d=d+Math.imul(ne,ke)|0,d=d+Math.imul(ce,ht)|0,g=g+Math.imul(ce,ke)|0,S=S+Math.imul(H,Dt)|0,d=d+Math.imul(H,at)|0,d=d+Math.imul(w,Dt)|0,g=g+Math.imul(w,at)|0;var Wi=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,S=Math.imul(Me,It),d=Math.imul(Me,Le),d=d+Math.imul(_e,It)|0,g=Math.imul(_e,Le),S=S+Math.imul(Se,tt)|0,d=d+Math.imul(Se,qe)|0,d=d+Math.imul(be,tt)|0,g=g+Math.imul(be,qe)|0,S=S+Math.imul(De,Ze)|0,d=d+Math.imul(De,ze)|0,d=d+Math.imul(ve,Ze)|0,g=g+Math.imul(ve,ze)|0,S=S+Math.imul(Ie,rt)|0,d=d+Math.imul(Ie,je)|0,d=d+Math.imul(me,rt)|0,g=g+Math.imul(me,je)|0,S=S+Math.imul(Qe,st)|0,d=d+Math.imul(Qe,Be)|0,d=d+Math.imul(Oe,st)|0,g=g+Math.imul(Oe,Be)|0,S=S+Math.imul(ye,ht)|0,d=d+Math.imul(ye,ke)|0,d=d+Math.imul(we,ht)|0,g=g+Math.imul(we,ke)|0,S=S+Math.imul(ne,Dt)|0,d=d+Math.imul(ne,at)|0,d=d+Math.imul(ce,Dt)|0,g=g+Math.imul(ce,at)|0;var Zr=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,S=Math.imul(Me,tt),d=Math.imul(Me,qe),d=d+Math.imul(_e,tt)|0,g=Math.imul(_e,qe),S=S+Math.imul(Se,Ze)|0,d=d+Math.imul(Se,ze)|0,d=d+Math.imul(be,Ze)|0,g=g+Math.imul(be,ze)|0,S=S+Math.imul(De,rt)|0,d=d+Math.imul(De,je)|0,d=d+Math.imul(ve,rt)|0,g=g+Math.imul(ve,je)|0,S=S+Math.imul(Ie,st)|0,d=d+Math.imul(Ie,Be)|0,d=d+Math.imul(me,st)|0,g=g+Math.imul(me,Be)|0,S=S+Math.imul(Qe,ht)|0,d=d+Math.imul(Qe,ke)|0,d=d+Math.imul(Oe,ht)|0,g=g+Math.imul(Oe,ke)|0,S=S+Math.imul(ye,Dt)|0,d=d+Math.imul(ye,at)|0,d=d+Math.imul(we,Dt)|0,g=g+Math.imul(we,at)|0;var Si=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Si>>>26)|0,Si&=67108863,S=Math.imul(Me,Ze),d=Math.imul(Me,ze),d=d+Math.imul(_e,Ze)|0,g=Math.imul(_e,ze),S=S+Math.imul(Se,rt)|0,d=d+Math.imul(Se,je)|0,d=d+Math.imul(be,rt)|0,g=g+Math.imul(be,je)|0,S=S+Math.imul(De,st)|0,d=d+Math.imul(De,Be)|0,d=d+Math.imul(ve,st)|0,g=g+Math.imul(ve,Be)|0,S=S+Math.imul(Ie,ht)|0,d=d+Math.imul(Ie,ke)|0,d=d+Math.imul(me,ht)|0,g=g+Math.imul(me,ke)|0,S=S+Math.imul(Qe,Dt)|0,d=d+Math.imul(Qe,at)|0,d=d+Math.imul(Oe,Dt)|0,g=g+Math.imul(Oe,at)|0;var Ii=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,S=Math.imul(Me,rt),d=Math.imul(Me,je),d=d+Math.imul(_e,rt)|0,g=Math.imul(_e,je),S=S+Math.imul(Se,st)|0,d=d+Math.imul(Se,Be)|0,d=d+Math.imul(be,st)|0,g=g+Math.imul(be,Be)|0,S=S+Math.imul(De,ht)|0,d=d+Math.imul(De,ke)|0,d=d+Math.imul(ve,ht)|0,g=g+Math.imul(ve,ke)|0,S=S+Math.imul(Ie,Dt)|0,d=d+Math.imul(Ie,at)|0,d=d+Math.imul(me,Dt)|0,g=g+Math.imul(me,at)|0;var lr=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(lr>>>26)|0,lr&=67108863,S=Math.imul(Me,st),d=Math.imul(Me,Be),d=d+Math.imul(_e,st)|0,g=Math.imul(_e,Be),S=S+Math.imul(Se,ht)|0,d=d+Math.imul(Se,ke)|0,d=d+Math.imul(be,ht)|0,g=g+Math.imul(be,ke)|0,S=S+Math.imul(De,Dt)|0,d=d+Math.imul(De,at)|0,d=d+Math.imul(ve,Dt)|0,g=g+Math.imul(ve,at)|0;var Ji=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Ji>>>26)|0,Ji&=67108863,S=Math.imul(Me,ht),d=Math.imul(Me,ke),d=d+Math.imul(_e,ht)|0,g=Math.imul(_e,ke),S=S+Math.imul(Se,Dt)|0,d=d+Math.imul(Se,at)|0,d=d+Math.imul(be,Dt)|0,g=g+Math.imul(be,at)|0;var Yi=(M+S|0)+((d&8191)<<13)|0;M=(g+(d>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,S=Math.imul(Me,Dt),d=Math.imul(Me,at),d=d+Math.imul(_e,Dt)|0,g=Math.imul(_e,at);var Qi=(M+S|0)+((d&8191)<<13)|0;return M=(g+(d>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,I[0]=bt,I[1]=Tr,I[2]=Cr,I[3]=Dr,I[4]=Lr,I[5]=qr,I[6]=er,I[7]=Qr,I[8]=Vi,I[9]=Xr,I[10]=Gi,I[11]=Wi,I[12]=Zr,I[13]=Si,I[14]=Ii,I[15]=lr,I[16]=Ji,I[17]=Yi,I[18]=Qi,M!==0&&(I[19]=M,h.length++),h};Math.imul||(K=N);function W(L,m,c){c.negative=m.negative^L.negative,c.length=L.length+m.length;for(var h=0,v=0,_=0;_>>26)|0,v+=I>>>26,I&=67108863}c.words[_]=M,h=I,I=v}return h!==0?c.words[_]=h:c.length--,c.strip()}function Q(L,m,c){var h=new k;return h.mulp(L,m,c)}a.prototype.mulTo=function(m,c){var h,v=this.length+m.length;return this.length===10&&m.length===10?h=K(this,m,c):v<63?h=N(this,m,c):v<1024?h=W(this,m,c):h=Q(this,m,c),h};function k(L,m){this.x=L,this.y=m}k.prototype.makeRBT=function(m){for(var c=new Array(m),h=a.prototype._countBits(m)-1,v=0;v>=1;return v},k.prototype.permute=function(m,c,h,v,_,I){for(var M=0;M>>1)_++;return 1<<_+1+v},k.prototype.conjugate=function(m,c,h){if(!(h<=1))for(var v=0;v>>13,h[2*I+1]=_&8191,_=_>>>13;for(I=2*c;I>=26,c+=v/67108864|0,c+=_>>>26,this.words[h]=_&67108863}return c!==0&&(this.words[h]=c,this.length++),this},a.prototype.muln=function(m){return this.clone().imuln(m)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(m){var c=O(m);if(c.length===0)return new a(1);for(var h=this,v=0;v=0);var c=m%26,h=(m-c)/26,v=67108863>>>26-c<<26-c,_;if(c!==0){var I=0;for(_=0;_>>26-c}I&&(this.words[_]=I,this.length++)}if(h!==0){for(_=this.length-1;_>=0;_--)this.words[_+h]=this.words[_];for(_=0;_=0);var v;c?v=(c-c%26)/26:v=0;var _=m%26,I=Math.min((m-_)/26,this.length),M=67108863^67108863>>>_<<_,S=h;if(v-=I,v=Math.max(0,v),S){for(var d=0;dI)for(this.length-=I,d=0;d=0&&(g!==0||d>=v);d--){var C=this.words[d]|0;this.words[d]=g<<26-_|C>>>_,g=C&M}return S&&g!==0&&(S.words[S.length++]=g),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(m,c,h){return i(this.negative===0),this.iushrn(m,c,h)},a.prototype.shln=function(m){return this.clone().ishln(m)},a.prototype.ushln=function(m){return this.clone().iushln(m)},a.prototype.shrn=function(m){return this.clone().ishrn(m)},a.prototype.ushrn=function(m){return this.clone().iushrn(m)},a.prototype.testn=function(m){i(typeof m=="number"&&m>=0);var c=m%26,h=(m-c)/26,v=1<=0);var c=m%26,h=(m-c)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(c!==0&&h++,this.length=Math.min(h,this.length),c!==0){var v=67108863^67108863>>>c<=67108864;c++)this.words[c]-=67108864,c===this.length-1?this.words[c+1]=1:this.words[c+1]++;return this.length=Math.max(this.length,c+1),this},a.prototype.isubn=function(m){if(i(typeof m=="number"),i(m<67108864),m<0)return this.iaddn(-m);if(this.negative!==0)return this.negative=0,this.iaddn(m),this.negative=1,this;if(this.words[0]-=m,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var c=0;c>26)-(S/67108864|0),this.words[_+h]=I&67108863}for(;_>26,this.words[_+h]=I&67108863;if(M===0)return this.strip();for(i(M===-1),M=0,_=0;_>26,this.words[_]=I&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(m,c){var h=this.length-m.length,v=this.clone(),_=m,I=_.words[_.length-1]|0,M=this._countBits(I);h=26-M,h!==0&&(_=_.ushln(h),v.iushln(h),I=_.words[_.length-1]|0);var S=v.length-_.length,d;if(c!=="mod"){d=new a(null),d.length=S+1,d.words=new Array(d.length);for(var g=0;g=0;Z--){var se=(v.words[_.length+Z]|0)*67108864+(v.words[_.length+Z-1]|0);for(se=Math.min(se/I|0,67108863),v._ishlnsubmul(_,se,Z);v.negative!==0;)se--,v.negative=0,v._ishlnsubmul(_,1,Z),v.isZero()||(v.negative^=1);d&&(d.words[Z]=se)}return d&&d.strip(),v.strip(),c!=="div"&&h!==0&&v.iushrn(h),{div:d||null,mod:v}},a.prototype.divmod=function(m,c,h){if(i(!m.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var v,_,I;return this.negative!==0&&m.negative===0?(I=this.neg().divmod(m,c),c!=="mod"&&(v=I.div.neg()),c!=="div"&&(_=I.mod.neg(),h&&_.negative!==0&&_.iadd(m)),{div:v,mod:_}):this.negative===0&&m.negative!==0?(I=this.divmod(m.neg(),c),c!=="mod"&&(v=I.div.neg()),{div:v,mod:I.mod}):this.negative&m.negative?(I=this.neg().divmod(m.neg(),c),c!=="div"&&(_=I.mod.neg(),h&&_.negative!==0&&_.isub(m)),{div:I.div,mod:_}):m.length>this.length||this.cmp(m)<0?{div:new a(0),mod:this}:m.length===1?c==="div"?{div:this.divn(m.words[0]),mod:null}:c==="mod"?{div:null,mod:new a(this.modn(m.words[0]))}:{div:this.divn(m.words[0]),mod:new a(this.modn(m.words[0]))}:this._wordDiv(m,c)},a.prototype.div=function(m){return this.divmod(m,"div",!1).div},a.prototype.mod=function(m){return this.divmod(m,"mod",!1).mod},a.prototype.umod=function(m){return this.divmod(m,"mod",!0).mod},a.prototype.divRound=function(m){var c=this.divmod(m);if(c.mod.isZero())return c.div;var h=c.div.negative!==0?c.mod.isub(m):c.mod,v=m.ushrn(1),_=m.andln(1),I=h.cmp(v);return I<0||_===1&&I===0?c.div:c.div.negative!==0?c.div.isubn(1):c.div.iaddn(1)},a.prototype.modn=function(m){i(m<=67108863);for(var c=(1<<26)%m,h=0,v=this.length-1;v>=0;v--)h=(c*h+(this.words[v]|0))%m;return h},a.prototype.idivn=function(m){i(m<=67108863);for(var c=0,h=this.length-1;h>=0;h--){var v=(this.words[h]|0)+c*67108864;this.words[h]=v/m|0,c=v%m}return this.strip()},a.prototype.divn=function(m){return this.clone().idivn(m)},a.prototype.egcd=function(m){i(m.negative===0),i(!m.isZero());var c=this,h=m.clone();c.negative!==0?c=c.umod(m):c=c.clone();for(var v=new a(1),_=new a(0),I=new a(0),M=new a(1),S=0;c.isEven()&&h.isEven();)c.iushrn(1),h.iushrn(1),++S;for(var d=h.clone(),g=c.clone();!c.isZero();){for(var C=0,Z=1;!(c.words[0]&Z)&&C<26;++C,Z<<=1);if(C>0)for(c.iushrn(C);C-- >0;)(v.isOdd()||_.isOdd())&&(v.iadd(d),_.isub(g)),v.iushrn(1),_.iushrn(1);for(var se=0,P=1;!(h.words[0]&P)&&se<26;++se,P<<=1);if(se>0)for(h.iushrn(se);se-- >0;)(I.isOdd()||M.isOdd())&&(I.iadd(d),M.isub(g)),I.iushrn(1),M.iushrn(1);c.cmp(h)>=0?(c.isub(h),v.isub(I),_.isub(M)):(h.isub(c),I.isub(v),M.isub(_))}return{a:I,b:M,gcd:h.iushln(S)}},a.prototype._invmp=function(m){i(m.negative===0),i(!m.isZero());var c=this,h=m.clone();c.negative!==0?c=c.umod(m):c=c.clone();for(var v=new a(1),_=new a(0),I=h.clone();c.cmpn(1)>0&&h.cmpn(1)>0;){for(var M=0,S=1;!(c.words[0]&S)&&M<26;++M,S<<=1);if(M>0)for(c.iushrn(M);M-- >0;)v.isOdd()&&v.iadd(I),v.iushrn(1);for(var d=0,g=1;!(h.words[0]&g)&&d<26;++d,g<<=1);if(d>0)for(h.iushrn(d);d-- >0;)_.isOdd()&&_.iadd(I),_.iushrn(1);c.cmp(h)>=0?(c.isub(h),v.isub(_)):(h.isub(c),_.isub(v))}var C;return c.cmpn(1)===0?C=v:C=_,C.cmpn(0)<0&&C.iadd(m),C},a.prototype.gcd=function(m){if(this.isZero())return m.abs();if(m.isZero())return this.abs();var c=this.clone(),h=m.clone();c.negative=0,h.negative=0;for(var v=0;c.isEven()&&h.isEven();v++)c.iushrn(1),h.iushrn(1);do{for(;c.isEven();)c.iushrn(1);for(;h.isEven();)h.iushrn(1);var _=c.cmp(h);if(_<0){var I=c;c=h,h=I}else if(_===0||h.cmpn(1)===0)break;c.isub(h)}while(!0);return h.iushln(v)},a.prototype.invm=function(m){return this.egcd(m).a.umod(m)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(m){return this.words[0]&m},a.prototype.bincn=function(m){i(typeof m=="number");var c=m%26,h=(m-c)/26,v=1<>>26,M&=67108863,this.words[I]=M}return _!==0&&(this.words[I]=_,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(m){var c=m<0;if(this.negative!==0&&!c)return-1;if(this.negative===0&&c)return 1;this.strip();var h;if(this.length>1)h=1;else{c&&(m=-m),i(m<=67108863,"Number is too big");var v=this.words[0]|0;h=v===m?0:vm.length)return 1;if(this.length=0;h--){var v=this.words[h]|0,_=m.words[h]|0;if(v!==_){v<_?c=-1:v>_&&(c=1);break}}return c},a.prototype.gtn=function(m){return this.cmpn(m)===1},a.prototype.gt=function(m){return this.cmp(m)===1},a.prototype.gten=function(m){return this.cmpn(m)>=0},a.prototype.gte=function(m){return this.cmp(m)>=0},a.prototype.ltn=function(m){return this.cmpn(m)===-1},a.prototype.lt=function(m){return this.cmp(m)===-1},a.prototype.lten=function(m){return this.cmpn(m)<=0},a.prototype.lte=function(m){return this.cmp(m)<=0},a.prototype.eqn=function(m){return this.cmpn(m)===0},a.prototype.eq=function(m){return this.cmp(m)===0},a.red=function(m){return new ae(m)},a.prototype.toRed=function(m){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),m.convertTo(this)._forceRed(m)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(m){return this.red=m,this},a.prototype.forceRed=function(m){return i(!this.red,"Already a number in reduction context"),this._forceRed(m)},a.prototype.redAdd=function(m){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,m)},a.prototype.redIAdd=function(m){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,m)},a.prototype.redSub=function(m){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,m)},a.prototype.redISub=function(m){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,m)},a.prototype.redShl=function(m){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,m)},a.prototype.redMul=function(m){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.mul(this,m)},a.prototype.redIMul=function(m){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,m),this.red.imul(this,m)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(m){return i(this.red&&!m.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,m)};var Y={k256:null,p224:null,p192:null,p25519:null};function $(L,m){this.name=L,this.p=new a(m,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}$.prototype._tmp=function(){var m=new a(null);return m.words=new Array(Math.ceil(this.n/13)),m},$.prototype.ireduce=function(m){var c=m,h;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),h=c.bitLength();while(h>this.n);var v=h0?c.isub(this.p):c.strip!==void 0?c.strip():c._strip(),c},$.prototype.split=function(m,c){m.iushrn(this.n,0,c)},$.prototype.imulK=function(m){return m.imul(this.k)};function F(){$.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(F,$),F.prototype.split=function(m,c){for(var h=4194303,v=Math.min(m.length,9),_=0;_>>22,I=M}I>>>=22,m.words[_-10]=I,I===0&&m.length>10?m.length-=10:m.length-=9},F.prototype.imulK=function(m){m.words[m.length]=0,m.words[m.length+1]=0,m.length+=2;for(var c=0,h=0;h>>=26,m.words[h]=_,c=v}return c!==0&&(m.words[m.length++]=c),m},a._prime=function(m){if(Y[m])return Y[m];var c;if(m==="k256")c=new F;else if(m==="p224")c=new G;else if(m==="p192")c=new x;else if(m==="p25519")c=new q;else throw new Error("Unknown prime "+m);return Y[m]=c,c};function ae(L){if(typeof L=="string"){var m=a._prime(L);this.m=m.p,this.prime=m}else i(L.gtn(1),"modulus must be greater than 1"),this.m=L,this.prime=null}ae.prototype._verify1=function(m){i(m.negative===0,"red works only with positives"),i(m.red,"red works only with red numbers")},ae.prototype._verify2=function(m,c){i((m.negative|c.negative)===0,"red works only with positives"),i(m.red&&m.red===c.red,"red works only with red numbers")},ae.prototype.imod=function(m){return this.prime?this.prime.ireduce(m)._forceRed(this):m.umod(this.m)._forceRed(this)},ae.prototype.neg=function(m){return m.isZero()?m.clone():this.m.sub(m)._forceRed(this)},ae.prototype.add=function(m,c){this._verify2(m,c);var h=m.add(c);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},ae.prototype.iadd=function(m,c){this._verify2(m,c);var h=m.iadd(c);return h.cmp(this.m)>=0&&h.isub(this.m),h},ae.prototype.sub=function(m,c){this._verify2(m,c);var h=m.sub(c);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},ae.prototype.isub=function(m,c){this._verify2(m,c);var h=m.isub(c);return h.cmpn(0)<0&&h.iadd(this.m),h},ae.prototype.shl=function(m,c){return this._verify1(m),this.imod(m.ushln(c))},ae.prototype.imul=function(m,c){return this._verify2(m,c),this.imod(m.imul(c))},ae.prototype.mul=function(m,c){return this._verify2(m,c),this.imod(m.mul(c))},ae.prototype.isqr=function(m){return this.imul(m,m.clone())},ae.prototype.sqr=function(m){return this.mul(m,m)},ae.prototype.sqrt=function(m){if(m.isZero())return m.clone();var c=this.m.andln(3);if(i(c%2===1),c===3){var h=this.m.add(new a(1)).iushrn(2);return this.pow(m,h)}for(var v=this.m.subn(1),_=0;!v.isZero()&&v.andln(1)===0;)_++,v.iushrn(1);i(!v.isZero());var I=new a(1).toRed(this),M=I.redNeg(),S=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new a(2*d*d).toRed(this);this.pow(d,S).cmp(M)!==0;)d.redIAdd(M);for(var g=this.pow(d,v),C=this.pow(m,v.addn(1).iushrn(1)),Z=this.pow(m,v),se=_;Z.cmp(I)!==0;){for(var P=Z,ee=0;P.cmp(I)!==0;ee++)P=P.redSqr();i(ee=0;_--){for(var g=c.words[_],C=d-1;C>=0;C--){var Z=g>>C&1;if(I!==v[0]&&(I=this.sqr(I)),Z===0&&M===0){S=0;continue}M<<=1,M|=Z,S++,!(S!==h&&(_!==0||C!==0))&&(I=this.mul(I,v[M]),S=0,M=0)}d=26}return I},ae.prototype.convertTo=function(m){var c=m.umod(this.m);return c===m?c.clone():c},ae.prototype.convertFrom=function(m){var c=m.clone();return c.red=null,c},a.mont=function(m){return new le(m)};function le(L){ae.call(this,L),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(le,ae),le.prototype.convertTo=function(m){return this.imod(m.ushln(this.shift))},le.prototype.convertFrom=function(m){var c=this.imod(m.mul(this.rinv));return c.red=null,c},le.prototype.imul=function(m,c){if(m.isZero()||c.isZero())return m.words[0]=0,m.length=1,m;var h=m.imul(c),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=h.isub(v).iushrn(this.shift),I=_;return _.cmp(this.m)>=0?I=_.isub(this.m):_.cmpn(0)<0&&(I=_.iadd(this.m)),I._forceRed(this)},le.prototype.mul=function(m,c){if(m.isZero()||c.isZero())return new a(0)._forceRed(this);var h=m.mul(c),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_=h.isub(v).iushrn(this.shift),I=_;return _.cmp(this.m)>=0?I=_.isub(this.m):_.cmpn(0)<0&&(I=_.iadd(this.m)),I._forceRed(this)},le.prototype.invm=function(m){var c=this.imod(m._invmp(this.m).mul(this.r2));return c._forceRed(this)}})(r,Dv)})(Cd);var vs=Cd.exports,ya=Xv;function Xv(r,e){if(!r)throw new Error(e||"Assertion failed")}Xv.equal=function(e,t,i){if(e!=t)throw new Error(i||"Assertion failed: "+e+" != "+t)};var Dd={};(function(r){var e=r;function t(a,f){if(Array.isArray(a))return a.slice();if(!a)return[];var u=[];if(typeof a!="string"){for(var b=0;b>8,A=p&255;y?u.push(y,A):u.push(A)}return u}e.toArray=t;function i(a){return a.length===1?"0"+a:a}e.zero2=i;function n(a){for(var f="",u=0;u(K>>1)-1?Q=(K>>1)-k:Q=k,W.isubn(Q)):Q=0,O[N]=Q,W.iushrn(1)}return O}e.getNAF=a;function f(y,A){var R=[[],[]];y=y.clone(),A=A.clone();for(var O=0,N=0,K;y.cmpn(-O)>0||A.cmpn(-N)>0;){var W=y.andln(3)+O&3,Q=A.andln(3)+N&3;W===3&&(W=-1),Q===3&&(Q=-1);var k;W&1?(K=y.andln(7)+O&7,(K===3||K===5)&&Q===2?k=-W:k=W):k=0,R[0].push(k);var Y;Q&1?(K=A.andln(7)+N&7,(K===3||K===5)&&W===2?Y=-Q:Y=Q):Y=0,R[1].push(Y),2*O===k+1&&(O=1-O),2*N===Y+1&&(N=1-N),y.iushrn(1),A.iushrn(1)}return R}e.getJSF=f;function u(y,A,R){var O="_"+A;y.prototype[A]=function(){return this[O]!==void 0?this[O]:this[O]=R.call(this)}}e.cachedProperty=u;function b(y){return typeof y=="string"?e.toArray(y,"hex"):y}e.parseBytes=b;function p(y){return new t(y,"hex","le")}e.intFromLE=p})(xi);var Ld={exports:{}},fl;Ld.exports=function(e){return fl||(fl=new Ds(null)),fl.generate(e)};function Ds(r){this.rand=r}Ld.exports.Rand=Ds;Ds.prototype.generate=function(e){return this._rand(e)};Ds.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Nh=zs;zs.prototype.point=function(){throw new Error("Not implemented")};zs.prototype.validate=function(){throw new Error("Not implemented")};zs.prototype._fixedNafMul=function(e,t){fh(e.precomputed);var i=e._getDoubles(),n=ch(t,1,this._bitLength),a=(1<=u;p--)b=(b<<1)+n[p];f.push(b)}for(var y=this.jpoint(null,null,null),A=this.jpoint(null,null,null),R=a;R>0;R--){for(u=0;u=0;b--){for(var p=0;b>=0&&f[b]===0;b--)p++;if(b>=0&&p++,u=u.dblp(p),b<0)break;var y=f[b];fh(y!==0),e.type==="affine"?y>0?u=u.mixedAdd(a[y-1>>1]):u=u.mixedAdd(a[-y-1>>1].neg()):y>0?u=u.add(a[y-1>>1]):u=u.add(a[-y-1>>1].neg())}return e.type==="affine"?u.toP():u};zs.prototype._wnafMulAdd=function(e,t,i,n,a){var f=this._wnafT1,u=this._wnafT2,b=this._wnafT3,p=0,y,A,R;for(y=0;y=1;y-=2){var N=y-1,K=y;if(f[N]!==1||f[K]!==1){b[N]=ch(i[N],f[N],this._bitLength),b[K]=ch(i[K],f[K],this._bitLength),p=Math.max(b[N].length,p),p=Math.max(b[K].length,p);continue}var W=[t[N],null,null,t[K]];t[N].y.cmp(t[K].y)===0?(W[1]=t[N].add(t[K]),W[2]=t[N].toJ().mixedAdd(t[K].neg())):t[N].y.cmp(t[K].y.redNeg())===0?(W[1]=t[N].toJ().mixedAdd(t[K]),W[2]=t[N].add(t[K].neg())):(W[1]=t[N].toJ().mixedAdd(t[K]),W[2]=t[N].toJ().mixedAdd(t[K].neg()));var Q=[-3,-1,-5,-7,0,7,5,1,3],k=B_(i[N],i[K]);for(p=Math.max(k[0].length,p),b[N]=new Array(p),b[K]=new Array(p),A=0;A=0;y--){for(var x=0;y>=0;){var q=!0;for(A=0;A=0&&x++,F=F.dblp(x),y<0)break;for(A=0;A0?R=u[A][ae-1>>1]:ae<0&&(R=u[A][-ae-1>>1].neg()),R.type==="affine"?F=F.mixedAdd(R):F=F.add(R))}}for(y=0;y=Math.ceil((e.bitLength()+1)/t.step):!1};Hi.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,a=0;a=0&&(O=p,N=y),A.negative&&(A=A.neg(),R=R.neg()),O.negative&&(O=O.neg(),N=N.neg()),[{a:A,b:R},{a:O,b:N}]};Ki.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),f=i.b.neg().mul(e).divRound(this.n),u=a.mul(i.a),b=f.mul(n.a),p=a.mul(i.b),y=f.mul(n.b),A=e.sub(u).sub(b),R=p.add(y).neg();return{k1:A,k2:R}};Ki.prototype.pointFromX=function(e,t){e=new nr(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var a=n.fromRed().isOdd();return(t&&!a||!t&&a)&&(n=n.redNeg()),this.point(e,n)};Ki.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,n=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(a).cmpn(0)===0};Ki.prototype._endoWnafMulAdd=function(e,t,i){for(var n=this._endoWnafT1,a=this._endoWnafT2,f=0;f":""};Ir.prototype.isInfinity=function(){return this.inf};Ir.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);t.cmpn(0)!==0&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)};Ir.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),a=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(n),f=a.redSqr().redISub(this.x.redAdd(this.x)),u=a.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,u)};Ir.prototype.getX=function(){return this.x.fromRed()};Ir.prototype.getY=function(){return this.y.fromRed()};Ir.prototype.mul=function(e){return e=new nr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Ir.prototype.mulAdd=function(e,t,i){var n=[this,t],a=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,a):this.curve._wnafMulAdd(1,n,a,2)};Ir.prototype.jmulAdd=function(e,t,i){var n=[this,t],a=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,a,!0):this.curve._wnafMulAdd(1,n,a,2,!0)};Ir.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Ir.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(a){return a.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return t};Ir.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Rr(r,e,t,i){fo.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new nr(0)):(this.x=new nr(e,16),this.y=new nr(t,16),this.z=new nr(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Bd(Rr,fo.BasePoint);Ki.prototype.jpoint=function(e,t,i){return new Rr(this,e,t,i)};Rr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(i,n)};Rr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Rr.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(i),f=this.y.redMul(t.redMul(e.z)),u=e.y.redMul(i.redMul(this.z)),b=n.redSub(a),p=f.redSub(u);if(b.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=b.redSqr(),A=y.redMul(b),R=n.redMul(y),O=p.redSqr().redIAdd(A).redISub(R).redISub(R),N=p.redMul(R.redISub(O)).redISub(f.redMul(A)),K=this.z.redMul(e.z).redMul(b);return this.curve.jpoint(O,N,K)};Rr.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,n=e.x.redMul(t),a=this.y,f=e.y.redMul(t).redMul(this.z),u=i.redSub(n),b=a.redSub(f);if(u.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=u.redSqr(),y=p.redMul(u),A=i.redMul(p),R=b.redSqr().redIAdd(y).redISub(A).redISub(A),O=b.redMul(A.redISub(R)).redISub(a.redMul(y)),N=this.z.redMul(u);return this.curve.jpoint(R,O,N)};Rr.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t=0)return!1;if(i.redIAdd(a),this.x.cmp(i)===0)return!0}};Rr.prototype.inspect=function(){return this.isInfinity()?"":""};Rr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Xa=vs,eb=xh,Th=Nh,j_=xi;function ho(r){Th.call(this,"mont",r),this.a=new Xa(r.a,16).toRed(this.red),this.b=new Xa(r.b,16).toRed(this.red),this.i4=new Xa(4).toRed(this.red).redInvm(),this.two=new Xa(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}eb(ho,Th);var k_=ho;ho.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),n=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t),a=n.redSqrt();return a.redSqr().cmp(n)===0};function Sr(r,e,t){Th.BasePoint.call(this,r,"projective"),e===null&&t===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Xa(e,16),this.z=new Xa(t,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}eb(Sr,Th.BasePoint);ho.prototype.decodePoint=function(e,t){return this.point(j_.toArray(e,t),1)};ho.prototype.point=function(e,t){return new Sr(this,e,t)};ho.prototype.pointFromJSON=function(e){return Sr.fromJSON(this,e)};Sr.prototype.precompute=function(){};Sr.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};Sr.fromJSON=function(e,t){return new Sr(e,t[0],t[1]||e.one)};Sr.prototype.inspect=function(){return this.isInfinity()?"":""};Sr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};Sr.prototype.dbl=function(){var e=this.x.redAdd(this.z),t=e.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),a=t.redSub(n),f=t.redMul(n),u=a.redMul(n.redAdd(this.curve.a24.redMul(a)));return this.curve.point(f,u)};Sr.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};Sr.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),a=e.x.redAdd(e.z),f=e.x.redSub(e.z),u=f.redMul(i),b=a.redMul(n),p=t.z.redMul(u.redAdd(b).redSqr()),y=t.x.redMul(u.redISub(b).redSqr());return this.curve.point(p,y)};Sr.prototype.mul=function(e){for(var t=e.clone(),i=this,n=this.curve.point(null,null),a=this,f=[];t.cmpn(0)!==0;t.iushrn(1))f.push(t.andln(1));for(var u=f.length-1;u>=0;u--)f[u]===0?(i=i.diffAdd(n,a),n=n.dbl()):(n=i.diffAdd(n,a),i=i.dbl());return n};Sr.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};Sr.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};Sr.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};Sr.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Sr.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var F_=xi,us=vs,tb=xh,Ch=Nh,H_=F_.assert;function Fn(r){this.twisted=(r.a|0)!==1,this.mOneA=this.twisted&&(r.a|0)===-1,this.extended=this.mOneA,Ch.call(this,"edwards",r),this.a=new us(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new us(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new us(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),H_(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(r.c|0)===1}tb(Fn,Ch);var K_=Fn;Fn.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Fn.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Fn.prototype.jpoint=function(e,t,i,n){return this.point(e,t,i,n)};Fn.prototype.pointFromX=function(e,t){e=new us(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),a=this.one.redSub(this.c2.redMul(this.d).redMul(i)),f=n.redMul(a.redInvm()),u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");var b=u.fromRed().isOdd();return(t&&!b||!t&&b)&&(u=u.redNeg()),this.point(e,u)};Fn.prototype.pointFromY=function(e,t){e=new us(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),a=i.redMul(this.d).redMul(this.c2).redSub(this.a),f=n.redMul(a.redInvm());if(f.cmp(this.zero)===0){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var u=f.redSqrt();if(u.redSqr().redSub(f).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==t&&(u=u.redNeg()),this.point(u,e)};Fn.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),n=t.redMul(this.a).redAdd(i),a=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return n.cmp(a)===0};function Wt(r,e,t,i,n){Ch.BasePoint.call(this,r,"projective"),e===null&&t===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new us(e,16),this.y=new us(t,16),this.z=i?new us(i,16):this.curve.one,this.t=n&&new us(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}tb(Wt,Ch.BasePoint);Fn.prototype.pointFromJSON=function(e){return Wt.fromJSON(this,e)};Fn.prototype.point=function(e,t,i,n){return new Wt(this,e,t,i,n)};Wt.fromJSON=function(e,t){return new Wt(e,t[0],t[1],t[2])};Wt.prototype.inspect=function(){return this.isInfinity()?"":""};Wt.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Wt.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),f=n.redAdd(t),u=f.redSub(i),b=n.redSub(t),p=a.redMul(u),y=f.redMul(b),A=a.redMul(b),R=u.redMul(f);return this.curve.point(p,y,R,A)};Wt.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),t=this.x.redSqr(),i=this.y.redSqr(),n,a,f,u,b,p;if(this.curve.twisted){u=this.curve._mulA(t);var y=u.redAdd(i);this.zOne?(n=e.redSub(t).redSub(i).redMul(y.redSub(this.curve.two)),a=y.redMul(u.redSub(i)),f=y.redSqr().redSub(y).redSub(y)):(b=this.z.redSqr(),p=y.redSub(b).redISub(b),n=e.redSub(t).redISub(i).redMul(p),a=y.redMul(u.redSub(i)),f=y.redMul(p))}else u=t.redAdd(i),b=this.curve._mulC(this.z).redSqr(),p=u.redSub(b).redSub(b),n=this.curve._mulC(e.redISub(u)).redMul(p),a=this.curve._mulC(u).redMul(t.redISub(i)),f=u.redMul(p);return this.curve.point(n,a,f)};Wt.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Wt.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),f=i.redSub(t),u=a.redSub(n),b=a.redAdd(n),p=i.redAdd(t),y=f.redMul(u),A=b.redMul(p),R=f.redMul(p),O=u.redMul(b);return this.curve.point(y,A,O,R)};Wt.prototype._projAdd=function(e){var t=this.z.redMul(e.z),i=t.redSqr(),n=this.x.redMul(e.x),a=this.y.redMul(e.y),f=this.curve.d.redMul(n).redMul(a),u=i.redSub(f),b=i.redAdd(f),p=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(a),y=t.redMul(u).redMul(p),A,R;return this.curve.twisted?(A=t.redMul(b).redMul(a.redSub(this.curve._mulA(n))),R=u.redMul(b)):(A=t.redMul(b).redMul(a.redSub(n)),R=this.curve._mulC(u).redMul(b)),this.curve.point(y,A,R)};Wt.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};Wt.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};Wt.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)};Wt.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)};Wt.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};Wt.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Wt.prototype.getX=function(){return this.normalize(),this.x.fromRed()};Wt.prototype.getY=function(){return this.normalize(),this.y.fromRed()};Wt.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Wt.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),this.x.cmp(t)===0)return!0}};Wt.prototype.toP=Wt.prototype.normalize;Wt.prototype.mixedAdd=Wt.prototype.add;(function(r){var e=r;e.base=Nh,e.short=z_,e.mont=k_,e.edwards=K_})(qd);var Dh={},Lh={},Ot={},V_=ya,G_=xh;Ot.inherits=G_;function W_(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}function J_(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),n=0;n>6|192,t[i++]=a&63|128):W_(r,n)?(a=65536+((a&1023)<<10)+(r.charCodeAt(++n)&1023),t[i++]=a>>18|240,t[i++]=a>>12&63|128,t[i++]=a>>6&63|128,t[i++]=a&63|128):(t[i++]=a>>12|224,t[i++]=a>>6&63|128,t[i++]=a&63|128)}else for(n=0;n>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}Ot.htonl=rb;function Q_(r,e){for(var t="",i=0;i>>0}return a}Ot.join32=X_;function Z_(r,e){for(var t=new Array(r.length*4),i=0,n=0;i>>24,t[n+1]=a>>>16&255,t[n+2]=a>>>8&255,t[n+3]=a&255):(t[n+3]=a>>>24,t[n+2]=a>>>16&255,t[n+1]=a>>>8&255,t[n]=a&255)}return t}Ot.split32=Z_;function e7(r,e){return r>>>e|r<<32-e}Ot.rotr32=e7;function t7(r,e){return r<>>32-e}Ot.rotl32=t7;function r7(r,e){return r+e>>>0}Ot.sum32=r7;function i7(r,e,t){return r+e+t>>>0}Ot.sum32_3=i7;function n7(r,e,t,i){return r+e+t+i>>>0}Ot.sum32_4=n7;function s7(r,e,t,i,n){return r+e+t+i+n>>>0}Ot.sum32_5=s7;function a7(r,e,t,i){var n=r[e],a=r[e+1],f=i+a>>>0,u=(f>>0,r[e+1]=f}Ot.sum64=a7;function o7(r,e,t,i){var n=e+i>>>0,a=(n>>0}Ot.sum64_hi=o7;function c7(r,e,t,i){var n=e+i;return n>>>0}Ot.sum64_lo=c7;function f7(r,e,t,i,n,a,f,u){var b=0,p=e;p=p+i>>>0,b+=p>>0,b+=p>>0,b+=p>>0}Ot.sum64_4_hi=f7;function h7(r,e,t,i,n,a,f,u){var b=e+i+a+u;return b>>>0}Ot.sum64_4_lo=h7;function u7(r,e,t,i,n,a,f,u,b,p){var y=0,A=e;A=A+i>>>0,y+=A>>0,y+=A>>0,y+=A>>0,y+=A>>0}Ot.sum64_5_hi=u7;function l7(r,e,t,i,n,a,f,u,b,p){var y=e+i+a+u+p;return y>>>0}Ot.sum64_5_lo=l7;function d7(r,e,t){var i=e<<32-t|r>>>t;return i>>>0}Ot.rotr64_hi=d7;function p7(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Ot.rotr64_lo=p7;function g7(r,e,t){return r>>>t}Ot.shr64_hi=g7;function v7(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Ot.shr64_lo=v7;var uo={},_1=Ot,b7=ya;function qh(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}uo.BlockHash=qh;qh.prototype.update=function(e,t){if(e=_1.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var i=e.length%this._delta8;this.pending=e.slice(e.length-i,e.length),this.pending.length===0&&(this.pending=null),e=_1.join32(e,0,e.length-i,this.endian);for(var n=0;n>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=e&255}else for(n[a++]=e&255,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,f=8;f>>3}Hn.g0_256=A7;function E7(r){return Rn(r,17)^Rn(r,19)^r>>>10}Hn.g1_256=E7;var ro=Ot,x7=uo,S7=Hn,hl=ro.rotl32,Ko=ro.sum32,I7=ro.sum32_5,M7=S7.ft_1,cb=x7.BlockHash,P7=[1518500249,1859775393,2400959708,3395469782];function Un(){if(!(this instanceof Un))return new Un;cb.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}ro.inherits(Un,cb);var O7=Un;Un.blockSize=512;Un.outSize=160;Un.hmacStrength=80;Un.padLength=64;Un.prototype._update=function(e,t){for(var i=this.W,n=0;n<16;n++)i[n]=e[t+n];for(;nthis.blockSize&&(e=new this.Hash().update(e).digest()),v9(e.length<=this.blockSize);for(var t=e.length;t=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}var w9=Bs;Bs.prototype._init=function(e,t,i){var n=e.concat(t).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1};Bs.prototype.generate=function(e,t,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof t!="string"&&(n=i,i=t,t=null),i&&(i=ha.toArray(i,n||"hex"),this._update(i));for(var a=[];a.length"};var hh=vs,Ud=xi,x9=Ud.assert;function Bh(r,e){if(r instanceof Bh)return r;this._importDER(r,e)||(x9(r.r&&r.s,"Signature without r or s"),this.r=new hh(r.r,16),this.s=new hh(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var S9=Bh;function I9(){this.place=0}function pl(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4||r[e.place]===0)return!1;for(var n=0,a=0,f=e.place;a>>=0;return n<=127?!1:(e.place=f,n)}function I1(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}Bh.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(t[0]&128&&(t=[0].concat(t)),i[0]&128&&(i=[0].concat(i)),t=I1(t),i=I1(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];gl(n,t.length),n=n.concat(t),n.push(2),gl(n,i.length);var a=n.concat(i),f=[48];return gl(f,a.length),f=f.concat(a),Ud.encode(f,e)};var ua=vs,wb=w9,M9=xi,vl=Dh,P9=Zv,_b=M9.assert,$d=E9,Uh=S9;function ki(r){if(!(this instanceof ki))return new ki(r);typeof r=="string"&&(_b(Object.prototype.hasOwnProperty.call(vl,r),"Unknown curve "+r),r=vl[r]),r instanceof vl.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var O9=ki;ki.prototype.keyPair=function(e){return new $d(this,e)};ki.prototype.keyFromPrivate=function(e,t){return $d.fromPrivate(this,e,t)};ki.prototype.keyFromPublic=function(e,t){return $d.fromPublic(this,e,t)};ki.prototype.genKeyPair=function(e){e||(e={});for(var t=new wb({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||P9(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new ua(2));;){var a=new ua(t.generate(i));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}};ki.prototype._truncateToN=function(e,t){var i=e.byteLength()*8-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e};ki.prototype.sign=function(e,t,i,n){typeof i=="object"&&(n=i,i=null),n||(n={}),t=this.keyFromPrivate(t,i),e=this._truncateToN(new ua(e,16));for(var a=this.n.byteLength(),f=t.getPrivate().toArray("be",a),u=e.toArray("be",a),b=new wb({hash:this.hash,entropy:f,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),p=this.n.sub(new ua(1)),y=0;;y++){var A=n.k?n.k(y):new ua(b.generate(this.n.byteLength()));if(A=this._truncateToN(A,!0),!(A.cmpn(1)<=0||A.cmp(p)>=0)){var R=this.g.mul(A);if(!R.isInfinity()){var O=R.getX(),N=O.umod(this.n);if(N.cmpn(0)!==0){var K=A.invm(this.n).mul(N.mul(t.getPrivate()).iadd(e));if(K=K.umod(this.n),K.cmpn(0)!==0){var W=(R.getY().isOdd()?1:0)|(O.cmp(N)!==0?2:0);return n.canonical&&K.cmp(this.nh)>0&&(K=this.n.sub(K),W^=1),new Uh({r:N,s:K,recoveryParam:W})}}}}}};ki.prototype.verify=function(e,t,i,n){e=this._truncateToN(new ua(e,16)),i=this.keyFromPublic(i,n),t=new Uh(t,"hex");var a=t.r,f=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;var u=f.invm(this.n),b=u.mul(e).umod(this.n),p=u.mul(a).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(b,i.getPublic(),p),y.isInfinity()?!1:y.eqXToP(a)):(y=this.g.mulAdd(b,i.getPublic(),p),y.isInfinity()?!1:y.getX().umod(this.n).cmp(a)===0)};ki.prototype.recoverPubKey=function(r,e,t,i){_b((3&t)===t,"The recovery param is more than two bits"),e=new Uh(e,i);var n=this.n,a=new ua(r),f=e.r,u=e.s,b=t&1,p=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?f=this.curve.pointFromX(f.add(this.curve.n),b):f=this.curve.pointFromX(f,b);var y=e.r.invm(n),A=n.sub(a).mul(y).umod(n),R=u.mul(y).umod(n);return this.g.mulAdd(A,f,R)};ki.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new Uh(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(r,e,n)}catch{continue}if(a.eq(t))return n}throw new Error("Unable to find valid recovery factor")};var xc=xi,Ab=xc.assert,M1=xc.parseBytes,go=xc.cachedProperty;function xr(r,e){this.eddsa=r,this._secret=M1(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=M1(e.pub)}xr.fromPublic=function(e,t){return t instanceof xr?t:new xr(e,{pub:t})};xr.fromSecret=function(e,t){return t instanceof xr?t:new xr(e,{secret:t})};xr.prototype.secret=function(){return this._secret};go(xr,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});go(xr,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});go(xr,"privBytes",function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n});go(xr,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});go(xr,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});go(xr,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});xr.prototype.sign=function(e){return Ab(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};xr.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)};xr.prototype.getSecret=function(e){return Ab(this._secret,"KeyPair is public only"),xc.encode(this.secret(),e)};xr.prototype.getPublic=function(e){return xc.encode(this.pubBytes(),e)};var R9=xr,N9=vs,$h=xi,P1=$h.assert,zh=$h.cachedProperty,T9=$h.parseBytes;function wa(r,e){this.eddsa=r,typeof e!="object"&&(e=T9(e)),Array.isArray(e)&&(P1(e.length===r.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,r.encodingLength),S:e.slice(r.encodingLength)}),P1(e.R&&e.S,"Signature without R or S"),r.isPoint(e.R)&&(this._R=e.R),e.S instanceof N9&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}zh(wa,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});zh(wa,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});zh(wa,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});zh(wa,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});wa.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};wa.prototype.toHex=function(){return $h.encode(this.toBytes(),"hex").toUpperCase()};var C9=wa,D9=Lh,L9=Dh,so=xi,q9=so.assert,Eb=so.parseBytes,xb=R9,O1=C9;function ui(r){if(q9(r==="ed25519","only tested with ed25519 so far"),!(this instanceof ui))return new ui(r);r=L9[r].curve,this.curve=r,this.g=r.g,this.g.precompute(r.n.bitLength()+1),this.pointClass=r.point().constructor,this.encodingLength=Math.ceil(r.n.bitLength()/8),this.hash=D9.sha512}var B9=ui;ui.prototype.sign=function(e,t){e=Eb(e);var i=this.keyFromSecret(t),n=this.hashInt(i.messagePrefix(),e),a=this.g.mul(n),f=this.encodePoint(a),u=this.hashInt(f,i.pubBytes(),e).mul(i.priv()),b=n.add(u).umod(this.curve.n);return this.makeSignature({R:a,S:b,Rencoded:f})};ui.prototype.verify=function(e,t,i){if(e=Eb(e),t=this.makeSignature(t),t.S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(i),a=this.hashInt(t.Rencoded(),n.pubBytes(),e),f=this.g.mul(t.S()),u=t.R().add(n.pub().mul(a));return u.eq(f)};ui.prototype.hashInt=function(){for(var e=this.hash(),t=0;t0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=b[y++],p--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(y=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,b,y,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=b[y++],p--;return this},u.prototype.finish=function(b){if(!this._finished){var p=this._bytesHashed,y=this._bufferLength,A=p/536870912|0,R=p<<3,O=p%128<112?128:256;this._buffer[y]=128;for(var N=y+1;N0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(b){return this._stateHi.set(b.stateHi),this._stateLo.set(b.stateLo),this._bufferLength=b.bufferLength,b.buffer&&this._buffer.set(b.buffer),this._bytesHashed=b.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(b){t.wipe(b.stateHi),t.wipe(b.stateLo),b.buffer&&t.wipe(b.buffer),b.bufferLength=0,b.bytesHashed=0},u}();r.SHA512=i;var n=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(u,b,p,y,A,R,O){for(var N=p[0],K=p[1],W=p[2],Q=p[3],k=p[4],Y=p[5],$=p[6],F=p[7],G=y[0],x=y[1],q=y[2],ae=y[3],le=y[4],L=y[5],m=y[6],c=y[7],h,v,_,I,M,S,d,g;O>=128;){for(var C=0;C<16;C++){var Z=8*C+R;u[C]=e.readUint32BE(A,Z),b[C]=e.readUint32BE(A,Z+4)}for(var C=0;C<80;C++){var se=N,P=K,ee=W,B=Q,j=k,H=Y,w=$,z=F,ne=G,ce=x,he=q,ye=ae,we=le,Te=L,Qe=m,Oe=c;if(h=F,v=c,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=(k>>>14|le<<18)^(k>>>18|le<<14)^(le>>>9|k<<23),v=(le>>>14|k<<18)^(le>>>18|k<<14)^(k>>>9|le<<23),M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,h=k&Y^~k&$,v=le&L^~le&m,M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,h=n[C*2],v=n[C*2+1],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,h=u[C%16],v=b[C%16],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,_=d&65535|g<<16,I=M&65535|S<<16,h=_,v=I,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=(N>>>28|G<<4)^(G>>>2|N<<30)^(G>>>7|N<<25),v=(G>>>28|N<<4)^(N>>>2|G<<30)^(N>>>7|G<<25),M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,h=N&K^N&W^K&W,v=G&x^G&q^x&q,M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,z=d&65535|g<<16,Oe=M&65535|S<<16,h=B,v=ye,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=_,v=I,M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,B=d&65535|g<<16,ye=M&65535|S<<16,K=se,W=P,Q=ee,k=B,Y=j,$=H,F=w,N=z,x=ne,q=ce,ae=he,le=ye,L=we,m=Te,c=Qe,G=Oe,C%16===15)for(var Z=0;Z<16;Z++)h=u[Z],v=b[Z],M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=u[(Z+9)%16],v=b[(Z+9)%16],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,_=u[(Z+1)%16],I=b[(Z+1)%16],h=(_>>>1|I<<31)^(_>>>8|I<<24)^_>>>7,v=(I>>>1|_<<31)^(I>>>8|_<<24)^(I>>>7|_<<25),M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,_=u[(Z+14)%16],I=b[(Z+14)%16],h=(_>>>19|I<<13)^(I>>>29|_<<3)^_>>>6,v=(I>>>19|_<<13)^(_>>>29|I<<3)^(I>>>6|_<<26),M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,u[Z]=d&65535|g<<16,b[Z]=M&65535|S<<16}h=N,v=G,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=p[0],v=y[0],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,p[0]=N=d&65535|g<<16,y[0]=G=M&65535|S<<16,h=K,v=x,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=p[1],v=y[1],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,p[1]=K=d&65535|g<<16,y[1]=x=M&65535|S<<16,h=W,v=q,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=p[2],v=y[2],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,p[2]=W=d&65535|g<<16,y[2]=q=M&65535|S<<16,h=Q,v=ae,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=p[3],v=y[3],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,p[3]=Q=d&65535|g<<16,y[3]=ae=M&65535|S<<16,h=k,v=le,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=p[4],v=y[4],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,p[4]=k=d&65535|g<<16,y[4]=le=M&65535|S<<16,h=Y,v=L,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=p[5],v=y[5],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,p[5]=Y=d&65535|g<<16,y[5]=L=M&65535|S<<16,h=$,v=m,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=p[6],v=y[6],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,p[6]=$=d&65535|g<<16,y[6]=m=M&65535|S<<16,h=F,v=c,M=v&65535,S=v>>>16,d=h&65535,g=h>>>16,h=p[7],v=y[7],M+=v&65535,S+=v>>>16,d+=h&65535,g+=h>>>16,S+=M>>>16,d+=S>>>16,g+=d>>>16,p[7]=F=d&65535|g<<16,y[7]=c=M&65535|S<<16,R+=128,O-=128}return R}function f(u){var b=new i;b.update(u);var p=b.digest();return b.clean(),p}r.hash=f})(Sb);(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.convertSecretKeyToX25519=r.convertPublicKeyToX25519=r.verify=r.sign=r.extractPublicKeyFromSecretKey=r.generateKeyPair=r.generateKeyPairFromSeed=r.SEED_LENGTH=r.SECRET_KEY_LENGTH=r.PUBLIC_KEY_LENGTH=r.SIGNATURE_LENGTH=void 0;const e=$s,t=Sb,i=Ei;r.SIGNATURE_LENGTH=64,r.PUBLIC_KEY_LENGTH=32,r.SECRET_KEY_LENGTH=64,r.SEED_LENGTH=32;function n(B){const j=new Float64Array(16);if(B)for(let H=0;H>16&1),H[ce-1]&=65535;H[15]=w[15]-32767-(H[14]>>16&1);const ne=H[15]>>16&1;H[14]&=65535,K(w,H,1-ne)}for(let z=0;z<16;z++)B[2*z]=w[z]&255,B[2*z+1]=w[z]>>8}function Q(B,j){let H=0;for(let w=0;w<32;w++)H|=B[w]^j[w];return(1&H-1>>>8)-1}function k(B,j){const H=new Uint8Array(32),w=new Uint8Array(32);return W(H,B),W(w,j),Q(H,w)}function Y(B){const j=new Uint8Array(32);return W(j,B),j[0]&1}function $(B,j){for(let H=0;H<16;H++)B[H]=j[2*H]+(j[2*H+1]<<8);B[15]&=32767}function F(B,j,H){for(let w=0;w<16;w++)B[w]=j[w]+H[w]}function G(B,j,H){for(let w=0;w<16;w++)B[w]=j[w]-H[w]}function x(B,j,H){let w,z,ne=0,ce=0,he=0,ye=0,we=0,Te=0,Qe=0,Oe=0,Ce=0,Ie=0,me=0,Re=0,De=0,ve=0,Ne=0,Se=0,be=0,Ue=0,Me=0,_e=0,He=0,Ve=0,Ee=0,Ke=0,ut=0,Ge=0,_t=0,lt=0,Je=0,Et=0,It=0,Le=H[0],Xe=H[1],tt=H[2],qe=H[3],et=H[4],Ze=H[5],ze=H[6],ft=H[7],rt=H[8],je=H[9],it=H[10],st=H[11],Be=H[12],Ye=H[13],ht=H[14],ke=H[15];w=j[0],ne+=w*Le,ce+=w*Xe,he+=w*tt,ye+=w*qe,we+=w*et,Te+=w*Ze,Qe+=w*ze,Oe+=w*ft,Ce+=w*rt,Ie+=w*je,me+=w*it,Re+=w*st,De+=w*Be,ve+=w*Ye,Ne+=w*ht,Se+=w*ke,w=j[1],ce+=w*Le,he+=w*Xe,ye+=w*tt,we+=w*qe,Te+=w*et,Qe+=w*Ze,Oe+=w*ze,Ce+=w*ft,Ie+=w*rt,me+=w*je,Re+=w*it,De+=w*st,ve+=w*Be,Ne+=w*Ye,Se+=w*ht,be+=w*ke,w=j[2],he+=w*Le,ye+=w*Xe,we+=w*tt,Te+=w*qe,Qe+=w*et,Oe+=w*Ze,Ce+=w*ze,Ie+=w*ft,me+=w*rt,Re+=w*je,De+=w*it,ve+=w*st,Ne+=w*Be,Se+=w*Ye,be+=w*ht,Ue+=w*ke,w=j[3],ye+=w*Le,we+=w*Xe,Te+=w*tt,Qe+=w*qe,Oe+=w*et,Ce+=w*Ze,Ie+=w*ze,me+=w*ft,Re+=w*rt,De+=w*je,ve+=w*it,Ne+=w*st,Se+=w*Be,be+=w*Ye,Ue+=w*ht,Me+=w*ke,w=j[4],we+=w*Le,Te+=w*Xe,Qe+=w*tt,Oe+=w*qe,Ce+=w*et,Ie+=w*Ze,me+=w*ze,Re+=w*ft,De+=w*rt,ve+=w*je,Ne+=w*it,Se+=w*st,be+=w*Be,Ue+=w*Ye,Me+=w*ht,_e+=w*ke,w=j[5],Te+=w*Le,Qe+=w*Xe,Oe+=w*tt,Ce+=w*qe,Ie+=w*et,me+=w*Ze,Re+=w*ze,De+=w*ft,ve+=w*rt,Ne+=w*je,Se+=w*it,be+=w*st,Ue+=w*Be,Me+=w*Ye,_e+=w*ht,He+=w*ke,w=j[6],Qe+=w*Le,Oe+=w*Xe,Ce+=w*tt,Ie+=w*qe,me+=w*et,Re+=w*Ze,De+=w*ze,ve+=w*ft,Ne+=w*rt,Se+=w*je,be+=w*it,Ue+=w*st,Me+=w*Be,_e+=w*Ye,He+=w*ht,Ve+=w*ke,w=j[7],Oe+=w*Le,Ce+=w*Xe,Ie+=w*tt,me+=w*qe,Re+=w*et,De+=w*Ze,ve+=w*ze,Ne+=w*ft,Se+=w*rt,be+=w*je,Ue+=w*it,Me+=w*st,_e+=w*Be,He+=w*Ye,Ve+=w*ht,Ee+=w*ke,w=j[8],Ce+=w*Le,Ie+=w*Xe,me+=w*tt,Re+=w*qe,De+=w*et,ve+=w*Ze,Ne+=w*ze,Se+=w*ft,be+=w*rt,Ue+=w*je,Me+=w*it,_e+=w*st,He+=w*Be,Ve+=w*Ye,Ee+=w*ht,Ke+=w*ke,w=j[9],Ie+=w*Le,me+=w*Xe,Re+=w*tt,De+=w*qe,ve+=w*et,Ne+=w*Ze,Se+=w*ze,be+=w*ft,Ue+=w*rt,Me+=w*je,_e+=w*it,He+=w*st,Ve+=w*Be,Ee+=w*Ye,Ke+=w*ht,ut+=w*ke,w=j[10],me+=w*Le,Re+=w*Xe,De+=w*tt,ve+=w*qe,Ne+=w*et,Se+=w*Ze,be+=w*ze,Ue+=w*ft,Me+=w*rt,_e+=w*je,He+=w*it,Ve+=w*st,Ee+=w*Be,Ke+=w*Ye,ut+=w*ht,Ge+=w*ke,w=j[11],Re+=w*Le,De+=w*Xe,ve+=w*tt,Ne+=w*qe,Se+=w*et,be+=w*Ze,Ue+=w*ze,Me+=w*ft,_e+=w*rt,He+=w*je,Ve+=w*it,Ee+=w*st,Ke+=w*Be,ut+=w*Ye,Ge+=w*ht,_t+=w*ke,w=j[12],De+=w*Le,ve+=w*Xe,Ne+=w*tt,Se+=w*qe,be+=w*et,Ue+=w*Ze,Me+=w*ze,_e+=w*ft,He+=w*rt,Ve+=w*je,Ee+=w*it,Ke+=w*st,ut+=w*Be,Ge+=w*Ye,_t+=w*ht,lt+=w*ke,w=j[13],ve+=w*Le,Ne+=w*Xe,Se+=w*tt,be+=w*qe,Ue+=w*et,Me+=w*Ze,_e+=w*ze,He+=w*ft,Ve+=w*rt,Ee+=w*je,Ke+=w*it,ut+=w*st,Ge+=w*Be,_t+=w*Ye,lt+=w*ht,Je+=w*ke,w=j[14],Ne+=w*Le,Se+=w*Xe,be+=w*tt,Ue+=w*qe,Me+=w*et,_e+=w*Ze,He+=w*ze,Ve+=w*ft,Ee+=w*rt,Ke+=w*je,ut+=w*it,Ge+=w*st,_t+=w*Be,lt+=w*Ye,Je+=w*ht,Et+=w*ke,w=j[15],Se+=w*Le,be+=w*Xe,Ue+=w*tt,Me+=w*qe,_e+=w*et,He+=w*Ze,Ve+=w*ze,Ee+=w*ft,Ke+=w*rt,ut+=w*je,Ge+=w*it,_t+=w*st,lt+=w*Be,Je+=w*Ye,Et+=w*ht,It+=w*ke,ne+=38*be,ce+=38*Ue,he+=38*Me,ye+=38*_e,we+=38*He,Te+=38*Ve,Qe+=38*Ee,Oe+=38*Ke,Ce+=38*ut,Ie+=38*Ge,me+=38*_t,Re+=38*lt,De+=38*Je,ve+=38*Et,Ne+=38*It,z=1,w=ne+z+65535,z=Math.floor(w/65536),ne=w-z*65536,w=ce+z+65535,z=Math.floor(w/65536),ce=w-z*65536,w=he+z+65535,z=Math.floor(w/65536),he=w-z*65536,w=ye+z+65535,z=Math.floor(w/65536),ye=w-z*65536,w=we+z+65535,z=Math.floor(w/65536),we=w-z*65536,w=Te+z+65535,z=Math.floor(w/65536),Te=w-z*65536,w=Qe+z+65535,z=Math.floor(w/65536),Qe=w-z*65536,w=Oe+z+65535,z=Math.floor(w/65536),Oe=w-z*65536,w=Ce+z+65535,z=Math.floor(w/65536),Ce=w-z*65536,w=Ie+z+65535,z=Math.floor(w/65536),Ie=w-z*65536,w=me+z+65535,z=Math.floor(w/65536),me=w-z*65536,w=Re+z+65535,z=Math.floor(w/65536),Re=w-z*65536,w=De+z+65535,z=Math.floor(w/65536),De=w-z*65536,w=ve+z+65535,z=Math.floor(w/65536),ve=w-z*65536,w=Ne+z+65535,z=Math.floor(w/65536),Ne=w-z*65536,w=Se+z+65535,z=Math.floor(w/65536),Se=w-z*65536,ne+=z-1+37*(z-1),z=1,w=ne+z+65535,z=Math.floor(w/65536),ne=w-z*65536,w=ce+z+65535,z=Math.floor(w/65536),ce=w-z*65536,w=he+z+65535,z=Math.floor(w/65536),he=w-z*65536,w=ye+z+65535,z=Math.floor(w/65536),ye=w-z*65536,w=we+z+65535,z=Math.floor(w/65536),we=w-z*65536,w=Te+z+65535,z=Math.floor(w/65536),Te=w-z*65536,w=Qe+z+65535,z=Math.floor(w/65536),Qe=w-z*65536,w=Oe+z+65535,z=Math.floor(w/65536),Oe=w-z*65536,w=Ce+z+65535,z=Math.floor(w/65536),Ce=w-z*65536,w=Ie+z+65535,z=Math.floor(w/65536),Ie=w-z*65536,w=me+z+65535,z=Math.floor(w/65536),me=w-z*65536,w=Re+z+65535,z=Math.floor(w/65536),Re=w-z*65536,w=De+z+65535,z=Math.floor(w/65536),De=w-z*65536,w=ve+z+65535,z=Math.floor(w/65536),ve=w-z*65536,w=Ne+z+65535,z=Math.floor(w/65536),Ne=w-z*65536,w=Se+z+65535,z=Math.floor(w/65536),Se=w-z*65536,ne+=z-1+37*(z-1),B[0]=ne,B[1]=ce,B[2]=he,B[3]=ye,B[4]=we,B[5]=Te,B[6]=Qe,B[7]=Oe,B[8]=Ce,B[9]=Ie,B[10]=me,B[11]=Re,B[12]=De,B[13]=ve,B[14]=Ne,B[15]=Se}function q(B,j){x(B,j,j)}function ae(B,j){const H=n();let w;for(w=0;w<16;w++)H[w]=j[w];for(w=253;w>=0;w--)q(H,H),w!==2&&w!==4&&x(H,H,j);for(w=0;w<16;w++)B[w]=H[w]}function le(B,j){const H=n();let w;for(w=0;w<16;w++)H[w]=j[w];for(w=250;w>=0;w--)q(H,H),w!==1&&x(H,H,j);for(w=0;w<16;w++)B[w]=H[w]}function L(B,j){const H=n(),w=n(),z=n(),ne=n(),ce=n(),he=n(),ye=n(),we=n(),Te=n();G(H,B[1],B[0]),G(Te,j[1],j[0]),x(H,H,Te),F(w,B[0],B[1]),F(Te,j[0],j[1]),x(w,w,Te),x(z,B[3],j[3]),x(z,z,p),x(ne,B[2],j[2]),F(ne,ne,ne),G(ce,w,H),G(he,ne,z),F(ye,ne,z),F(we,w,H),x(B[0],ce,he),x(B[1],we,ye),x(B[2],ye,he),x(B[3],ce,we)}function m(B,j,H){for(let w=0;w<4;w++)K(B[w],j[w],H)}function c(B,j){const H=n(),w=n(),z=n();ae(z,j[2]),x(H,j[0],z),x(w,j[1],z),W(B,w),B[31]^=Y(H)<<7}function h(B,j,H){O(B[0],f),O(B[1],u),O(B[2],u),O(B[3],f);for(let w=255;w>=0;--w){const z=H[w/8|0]>>(w&7)&1;m(B,j,z),L(j,B),L(B,B),m(B,j,z)}}function v(B,j){const H=[n(),n(),n(),n()];O(H[0],y),O(H[1],A),O(H[2],u),x(H[3],y,A),h(B,H,j)}function _(B){if(B.length!==r.SEED_LENGTH)throw new Error(`ed25519: seed must be ${r.SEED_LENGTH} bytes`);const j=(0,t.hash)(B);j[0]&=248,j[31]&=127,j[31]|=64;const H=new Uint8Array(32),w=[n(),n(),n(),n()];v(w,j),c(H,w);const z=new Uint8Array(64);return z.set(B),z.set(H,32),{publicKey:H,secretKey:z}}r.generateKeyPairFromSeed=_;function I(B){const j=(0,e.randomBytes)(32,B),H=_(j);return(0,i.wipe)(j),H}r.generateKeyPair=I;function M(B){if(B.length!==r.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${r.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(B.subarray(32))}r.extractPublicKeyFromSecretKey=M;const S=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function d(B,j){let H,w,z,ne;for(w=63;w>=32;--w){for(H=0,z=w-32,ne=w-12;z>4)*S[z],H=j[z]>>8,j[z]&=255;for(z=0;z<32;z++)j[z]-=H*S[z];for(w=0;w<32;w++)j[w+1]+=j[w]>>8,B[w]=j[w]&255}function g(B){const j=new Float64Array(64);for(let H=0;H<64;H++)j[H]=B[H];for(let H=0;H<64;H++)B[H]=0;d(B,j)}function C(B,j){const H=new Float64Array(64),w=[n(),n(),n(),n()],z=(0,t.hash)(B.subarray(0,32));z[0]&=248,z[31]&=127,z[31]|=64;const ne=new Uint8Array(64);ne.set(z.subarray(32),32);const ce=new t.SHA512;ce.update(ne.subarray(32)),ce.update(j);const he=ce.digest();ce.clean(),g(he),v(w,he),c(ne,w),ce.reset(),ce.update(ne.subarray(0,32)),ce.update(B.subarray(32)),ce.update(j);const ye=ce.digest();g(ye);for(let we=0;we<32;we++)H[we]=he[we];for(let we=0;we<32;we++)for(let Te=0;Te<32;Te++)H[we+Te]+=ye[we]*z[Te];return d(ne.subarray(32),H),ne}r.sign=C;function Z(B,j){const H=n(),w=n(),z=n(),ne=n(),ce=n(),he=n(),ye=n();return O(B[2],u),$(B[1],j),q(z,B[1]),x(ne,z,b),G(z,z,B[2]),F(ne,B[2],ne),q(ce,ne),q(he,ce),x(ye,he,ce),x(H,ye,z),x(H,H,ne),le(H,H),x(H,H,z),x(H,H,ne),x(H,H,ne),x(B[0],H,ne),q(w,B[0]),x(w,w,ne),k(w,z)&&x(B[0],B[0],R),q(w,B[0]),x(w,w,ne),k(w,z)?-1:(Y(B[0])===j[31]>>7&&G(B[0],f,B[0]),x(B[3],B[0],B[1]),0)}function se(B,j,H){const w=new Uint8Array(32),z=[n(),n(),n(),n()],ne=[n(),n(),n(),n()];if(H.length!==r.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${r.SIGNATURE_LENGTH} bytes`);if(Z(ne,B))return!1;const ce=new t.SHA512;ce.update(H.subarray(0,32)),ce.update(B),ce.update(j);const he=ce.digest();return g(he),h(z,ne,he),v(ne,H.subarray(32)),L(z,ne),c(w,z),!Q(H,w)}r.verify=se;function P(B){let j=[n(),n(),n(),n()];if(Z(j,B))throw new Error("Ed25519: invalid public key");let H=n(),w=n(),z=j[1];F(H,u,z),G(w,u,z),ae(w,w),x(H,H,w);let ne=new Uint8Array(32);return W(ne,H),ne}r.convertPublicKeyToX25519=P;function ee(B){const j=(0,t.hash)(B.subarray(0,32));j[0]&=248,j[31]&=127,j[31]|=64;const H=new Uint8Array(j.subarray(0,32));return(0,i.wipe)(j),H}r.convertSecretKeyToX25519=ee})(zd);const U9="EdDSA",$9="JWT",uh=".",jh="base64url",Ib="utf8",Mb="utf8",z9=":",j9="did",k9="key",R1="base58btc",F9="z",H9="K36",K9=32,V9=r=>JSON.stringify(r,(e,t)=>typeof t=="bigint"?t.toString()+"n":t),G9=r=>{const e=/([\[:])?(\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,t=r.replace(e,'$1"$2n"$3');return JSON.parse(t,(i,n)=>typeof n=="string"&&n.match(/^\d+n$/)?BigInt(n.substring(0,n.length-1)):n)};function ga(r){if(typeof r!="string")throw new Error(`Cannot safe json parse value of type ${typeof r}`);try{return G9(r)}catch{return r}}function gs(r){return typeof r=="string"?r:V9(r)||""}function N1(r){return ga(Er(Ar(r,jh),Ib))}function lh(r){return Er(Ar(gs(r),Ib),jh)}function Pb(r){const e=Ar(H9,R1),t=F9+Er(Yf([e,r]),R1);return[j9,k9,t].join(z9)}function W9(r){return Er(r,jh)}function J9(r){return Ar(r,jh)}function Y9(r){return Ar([lh(r.header),lh(r.payload)].join(uh),Mb)}function Q9(r){return[lh(r.header),lh(r.payload),W9(r.signature)].join(uh)}function nd(r){const e=r.split(uh),t=N1(e[0]),i=N1(e[1]),n=J9(e[2]),a=Ar(e.slice(0,2).join(uh),Mb);return{header:t,payload:i,signature:n,data:a}}function T1(r=$s.randomBytes(K9)){return zd.generateKeyPairFromSeed(r)}async function X9(r,e,t,i,n=xe.fromMiliseconds(Date.now())){const a={alg:U9,typ:$9},f=Pb(i.publicKey),u=n+t,b={iss:f,sub:r,aud:e,iat:n,exp:u},p=Y9({header:a,payload:b}),y=zd.sign(i.secretKey,p);return Q9({header:a,payload:b,signature:y})}const Z9={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"}};var la={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0},eA={};const tA=":";function ac(r){const[e,t]=r.split(tA);return{namespace:e,reference:t}}function C1(r,e=[]){const t=[];return Object.keys(r).forEach(i=>{if(e.length&&!e.includes(i))return;const n=r[i];t.push(...n.accounts)}),t}function Ob(r,e){return r.includes(":")?[r]:e.chains||[]}var rA=Object.defineProperty,D1=Object.getOwnPropertySymbols,iA=Object.prototype.hasOwnProperty,nA=Object.prototype.propertyIsEnumerable,L1=(r,e,t)=>e in r?rA(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,q1=(r,e)=>{for(var t in e||(e={}))iA.call(e,t)&&L1(r,t,e[t]);if(D1)for(var t of D1(e))nA.call(e,t)&&L1(r,t,e[t]);return r};const sA="ReactNative",wi={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},aA="js";function dh(){return typeof la<"u"&&typeof la.versions<"u"&&typeof la.versions.node<"u"}function vo(){return!Ih()&&!!Pd()&&navigator.product===sA}function Sc(){return!dh()&&!!Pd()&&!!Ih()}function Ic(){return vo()?wi.reactNative:dh()?wi.node:Sc()?wi.browser:wi.unknown}function oA(){var r;try{return vo()&&typeof globalThis<"u"&&typeof(globalThis==null?void 0:globalThis.Application)<"u"?(r=globalThis.Application)==null?void 0:r.applicationId:void 0}catch{return}}function cA(r,e){let t=dc.parse(r);return t=q1(q1({},t),e),r=dc.stringify(t),r}function Rb(){return Uv()||{name:"",description:"",url:"",icons:[""]}}function fA(){if(Ic()===wi.reactNative&&typeof globalThis<"u"&&typeof(globalThis==null?void 0:globalThis.Platform)<"u"){const{OS:t,Version:i}=globalThis.Platform;return[t,i].join("-")}const r=k8();if(r===null)return"unknown";const e=r.os?r.os.replace(" ","").toLowerCase():"unknown";return r.type==="browser"?[e,r.name,r.version].join("-"):[e,r.version].join("-")}function hA(){var r;const e=Ic();return e===wi.browser?[e,((r=Bv())==null?void 0:r.host)||"unknown"].join(":"):e}function Nb(r,e,t){const i=fA(),n=hA();return[[r,e].join("-"),[aA,t].join("-"),i,n].join("/")}function uA({protocol:r,version:e,relayUrl:t,sdkVersion:i,auth:n,projectId:a,useOnCloseEvent:f,bundleId:u}){const b=t.split("?"),p=Nb(r,e,i),y={auth:n,ua:p,projectId:a,useOnCloseEvent:f||void 0,origin:u||void 0},A=cA(b[1]||"",y);return b[0]+"?"+A}function ca(r,e){return r.filter(t=>e.includes(t)).length===r.length}function Tb(r){return Object.fromEntries(r.entries())}function Cb(r){return new Map(Object.entries(r))}function aa(r=xe.FIVE_MINUTES,e){const t=xe.toMiliseconds(r||xe.FIVE_MINUTES);let i,n,a;return{resolve:f=>{a&&i&&(clearTimeout(a),i(f))},reject:f=>{a&&n&&(clearTimeout(a),n(f))},done:()=>new Promise((f,u)=>{a=setTimeout(()=>{u(new Error(e))},t),i=f,n=u})}}function Za(r,e,t){return new Promise(async(i,n)=>{const a=setTimeout(()=>n(new Error(t)),e);try{const f=await r;i(f)}catch(f){n(f)}clearTimeout(a)})}function Db(r,e){if(typeof e=="string"&&e.startsWith(`${r}:`))return e;if(r.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(r.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${r}`)}function lA(r){return Db("topic",r)}function dA(r){return Db("id",r)}function Lb(r){const[e,t]=r.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof t=="string")i.topic=t;else if(e==="id"&&Number.isInteger(Number(t)))i.id=Number(t);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${t}`);return i}function vr(r,e){return xe.fromMiliseconds(Date.now()+xe.toMiliseconds(r))}function Os(r){return Date.now()>=xe.toMiliseconds(r)}function St(r,e){return`${r}${e?`:${e}`:""}`}function Qf(r=[],e=[]){return[...new Set([...r,...e])]}async function pA({id:r,topic:e,wcDeepLink:t}){var i;try{if(!t)return;const n=typeof t=="string"?JSON.parse(t):t,a=n==null?void 0:n.href;if(typeof a!="string")return;const f=gA(a,r,e),u=Ic();if(u===wi.browser){if(!((i=Ih())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}f.startsWith("https://")||f.startsWith("http://")?window.open(f,"_blank","noreferrer noopener"):window.open(f,bA()?"_blank":"_self","noreferrer noopener")}else u===wi.reactNative&&typeof(globalThis==null?void 0:globalThis.Linking)<"u"&&await globalThis.Linking.openURL(f)}catch(n){console.error(n)}}function gA(r,e,t){const i=`requestId=${e}&sessionTopic=${t}`;r.endsWith("/")&&(r=r.slice(0,-1));let n=`${r}`;if(r.startsWith("https://t.me")){const a=r.includes("?")?"&startapp=":"?startapp=";n=`${n}${a}${mA(i,!0)}`}else n=`${n}/wc?${i}`;return n}async function vA(r,e){let t="";try{if(Sc()&&(t=localStorage.getItem(e),t))return t;t=await r.getItem(e)}catch(i){console.error(i)}return t}function B1(r,e){if(!r.includes(e))return null;const t=r.split(/([&,?,=])/),i=t.indexOf(e);return t[i+2]}function U1(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,r=>{const e=Math.random()*16|0;return(r==="x"?e:e&3|8).toString(16)})}function jd(){return typeof la<"u"&&eA.IS_VITEST==="true"}function bA(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function mA(r,e=!1){const t=Buffer.from(r).toString("base64");return e?t.replace(/[=]/g,""):t}function qb(r){return Buffer.from(r,"base64").toString("utf-8")}var Bb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function yA(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),t}var Ub={exports:{}};/** -* [js-sha3]{@link https://github.com/emn178/js-sha3} -* -* @version 0.8.0 -* @author Chen, Yi-Cyuan [emn178@gmail.com] -* @copyright Chen, Yi-Cyuan 2015-2018 -* @license MIT -*/(function(r){(function(){var e="input is invalid type",t="finalize already called",i=typeof window=="object",n=i?window:{};n.JS_SHA3_NO_WINDOW&&(i=!1);var a=!i&&typeof self=="object",f=!n.JS_SHA3_NO_NODE_JS&&typeof la=="object"&&la.versions&&la.versions.node;f?n=Bb:a&&(n=self);var u=!n.JS_SHA3_NO_COMMON_JS&&!0&&r.exports,b=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",p="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],A=[4,1024,262144,67108864],R=[1,256,65536,16777216],O=[6,1536,393216,100663296],N=[0,8,16,24],K=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],W=[224,256,384,512],Q=[128,256],k=["hex","buffer","arrayBuffer","array","digest"],Y={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(P){return Object.prototype.toString.call(P)==="[object Array]"}),b&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(P){return typeof P=="object"&&P.buffer&&P.buffer.constructor===ArrayBuffer});for(var $=function(P,ee,B){return function(j){return new C(P,ee,P).update(j)[B]()}},F=function(P,ee,B){return function(j,H){return new C(P,ee,H).update(j)[B]()}},G=function(P,ee,B){return function(j,H,w,z){return h["cshake"+P].update(j,H,w,z)[B]()}},x=function(P,ee,B){return function(j,H,w,z){return h["kmac"+P].update(j,H,w,z)[B]()}},q=function(P,ee,B,j){for(var H=0;H>5,this.byteCount=this.blockCount<<2,this.outputBlocks=B>>5,this.extraBytes=(B&31)>>3;for(var j=0;j<50;++j)this.s[j]=0}C.prototype.update=function(P){if(this.finalized)throw new Error(t);var ee,B=typeof P;if(B!=="string"){if(B==="object"){if(P===null)throw new Error(e);if(b&&P.constructor===ArrayBuffer)P=new Uint8Array(P);else if(!Array.isArray(P)&&(!b||!ArrayBuffer.isView(P)))throw new Error(e)}else throw new Error(e);ee=!0}for(var j=this.blocks,H=this.byteCount,w=P.length,z=this.blockCount,ne=0,ce=this.s,he,ye;ne>2]|=P[ne]<>2]|=ye<>2]|=(192|ye>>6)<>2]|=(128|ye&63)<=57344?(j[he>>2]|=(224|ye>>12)<>2]|=(128|ye>>6&63)<>2]|=(128|ye&63)<>2]|=(240|ye>>18)<>2]|=(128|ye>>12&63)<>2]|=(128|ye>>6&63)<>2]|=(128|ye&63)<=H){for(this.start=he-H,this.block=j[z],he=0;he>8,B=P&255;B>0;)H.unshift(B),P=P>>8,B=P&255,++j;return ee?H.push(j):H.unshift(j),this.update(H),H.length},C.prototype.encodeString=function(P){var ee,B=typeof P;if(B!=="string"){if(B==="object"){if(P===null)throw new Error(e);if(b&&P.constructor===ArrayBuffer)P=new Uint8Array(P);else if(!Array.isArray(P)&&(!b||!ArrayBuffer.isView(P)))throw new Error(e)}else throw new Error(e);ee=!0}var j=0,H=P.length;if(ee)j=H;else for(var w=0;w=57344?j+=3:(z=65536+((z&1023)<<10|P.charCodeAt(++w)&1023),j+=4)}return j+=this.encode(j*8),this.update(P),j},C.prototype.bytepad=function(P,ee){for(var B=this.encode(ee),j=0;j>2]|=this.padding[ee&3],this.lastByteIndex===this.byteCount)for(P[0]=P[B],ee=1;ee>4&15]+p[ne&15]+p[ne>>12&15]+p[ne>>8&15]+p[ne>>20&15]+p[ne>>16&15]+p[ne>>28&15]+p[ne>>24&15];w%P===0&&(se(ee),H=0)}return j&&(ne=ee[H],z+=p[ne>>4&15]+p[ne&15],j>1&&(z+=p[ne>>12&15]+p[ne>>8&15]),j>2&&(z+=p[ne>>20&15]+p[ne>>16&15])),z},C.prototype.arrayBuffer=function(){this.finalize();var P=this.blockCount,ee=this.s,B=this.outputBlocks,j=this.extraBytes,H=0,w=0,z=this.outputBits>>3,ne;j?ne=new ArrayBuffer(B+1<<2):ne=new ArrayBuffer(z);for(var ce=new Uint32Array(ne);w>8&255,z[ne+2]=ce>>16&255,z[ne+3]=ce>>24&255;w%P===0&&se(ee)}return j&&(ne=w<<2,ce=ee[H],z[ne]=ce&255,j>1&&(z[ne+1]=ce>>8&255),j>2&&(z[ne+2]=ce>>16&255)),z};function Z(P,ee,B){C.call(this,P,ee,B)}Z.prototype=new C,Z.prototype.finalize=function(){return this.encode(this.outputBits,!0),C.prototype.finalize.call(this)};var se=function(P){var ee,B,j,H,w,z,ne,ce,he,ye,we,Te,Qe,Oe,Ce,Ie,me,Re,De,ve,Ne,Se,be,Ue,Me,_e,He,Ve,Ee,Ke,ut,Ge,_t,lt,Je,Et,It,Le,Xe,tt,qe,et,Ze,ze,ft,rt,je,it,st,Be,Ye,ht,ke,Ct,Dt,at,bt,Tr,Cr,Dr,Lr,qr,er;for(j=0;j<48;j+=2)H=P[0]^P[10]^P[20]^P[30]^P[40],w=P[1]^P[11]^P[21]^P[31]^P[41],z=P[2]^P[12]^P[22]^P[32]^P[42],ne=P[3]^P[13]^P[23]^P[33]^P[43],ce=P[4]^P[14]^P[24]^P[34]^P[44],he=P[5]^P[15]^P[25]^P[35]^P[45],ye=P[6]^P[16]^P[26]^P[36]^P[46],we=P[7]^P[17]^P[27]^P[37]^P[47],Te=P[8]^P[18]^P[28]^P[38]^P[48],Qe=P[9]^P[19]^P[29]^P[39]^P[49],ee=Te^(z<<1|ne>>>31),B=Qe^(ne<<1|z>>>31),P[0]^=ee,P[1]^=B,P[10]^=ee,P[11]^=B,P[20]^=ee,P[21]^=B,P[30]^=ee,P[31]^=B,P[40]^=ee,P[41]^=B,ee=H^(ce<<1|he>>>31),B=w^(he<<1|ce>>>31),P[2]^=ee,P[3]^=B,P[12]^=ee,P[13]^=B,P[22]^=ee,P[23]^=B,P[32]^=ee,P[33]^=B,P[42]^=ee,P[43]^=B,ee=z^(ye<<1|we>>>31),B=ne^(we<<1|ye>>>31),P[4]^=ee,P[5]^=B,P[14]^=ee,P[15]^=B,P[24]^=ee,P[25]^=B,P[34]^=ee,P[35]^=B,P[44]^=ee,P[45]^=B,ee=ce^(Te<<1|Qe>>>31),B=he^(Qe<<1|Te>>>31),P[6]^=ee,P[7]^=B,P[16]^=ee,P[17]^=B,P[26]^=ee,P[27]^=B,P[36]^=ee,P[37]^=B,P[46]^=ee,P[47]^=B,ee=ye^(H<<1|w>>>31),B=we^(w<<1|H>>>31),P[8]^=ee,P[9]^=B,P[18]^=ee,P[19]^=B,P[28]^=ee,P[29]^=B,P[38]^=ee,P[39]^=B,P[48]^=ee,P[49]^=B,Oe=P[0],Ce=P[1],rt=P[11]<<4|P[10]>>>28,je=P[10]<<4|P[11]>>>28,Ve=P[20]<<3|P[21]>>>29,Ee=P[21]<<3|P[20]>>>29,Dr=P[31]<<9|P[30]>>>23,Lr=P[30]<<9|P[31]>>>23,et=P[40]<<18|P[41]>>>14,Ze=P[41]<<18|P[40]>>>14,lt=P[2]<<1|P[3]>>>31,Je=P[3]<<1|P[2]>>>31,Ie=P[13]<<12|P[12]>>>20,me=P[12]<<12|P[13]>>>20,it=P[22]<<10|P[23]>>>22,st=P[23]<<10|P[22]>>>22,Ke=P[33]<<13|P[32]>>>19,ut=P[32]<<13|P[33]>>>19,qr=P[42]<<2|P[43]>>>30,er=P[43]<<2|P[42]>>>30,Ct=P[5]<<30|P[4]>>>2,Dt=P[4]<<30|P[5]>>>2,Et=P[14]<<6|P[15]>>>26,It=P[15]<<6|P[14]>>>26,Re=P[25]<<11|P[24]>>>21,De=P[24]<<11|P[25]>>>21,Be=P[34]<<15|P[35]>>>17,Ye=P[35]<<15|P[34]>>>17,Ge=P[45]<<29|P[44]>>>3,_t=P[44]<<29|P[45]>>>3,Ue=P[6]<<28|P[7]>>>4,Me=P[7]<<28|P[6]>>>4,at=P[17]<<23|P[16]>>>9,bt=P[16]<<23|P[17]>>>9,Le=P[26]<<25|P[27]>>>7,Xe=P[27]<<25|P[26]>>>7,ve=P[36]<<21|P[37]>>>11,Ne=P[37]<<21|P[36]>>>11,ht=P[47]<<24|P[46]>>>8,ke=P[46]<<24|P[47]>>>8,ze=P[8]<<27|P[9]>>>5,ft=P[9]<<27|P[8]>>>5,_e=P[18]<<20|P[19]>>>12,He=P[19]<<20|P[18]>>>12,Tr=P[29]<<7|P[28]>>>25,Cr=P[28]<<7|P[29]>>>25,tt=P[38]<<8|P[39]>>>24,qe=P[39]<<8|P[38]>>>24,Se=P[48]<<14|P[49]>>>18,be=P[49]<<14|P[48]>>>18,P[0]=Oe^~Ie&Re,P[1]=Ce^~me&De,P[10]=Ue^~_e&Ve,P[11]=Me^~He&Ee,P[20]=lt^~Et&Le,P[21]=Je^~It&Xe,P[30]=ze^~rt&it,P[31]=ft^~je&st,P[40]=Ct^~at&Tr,P[41]=Dt^~bt&Cr,P[2]=Ie^~Re&ve,P[3]=me^~De&Ne,P[12]=_e^~Ve&Ke,P[13]=He^~Ee&ut,P[22]=Et^~Le&tt,P[23]=It^~Xe&qe,P[32]=rt^~it&Be,P[33]=je^~st&Ye,P[42]=at^~Tr&Dr,P[43]=bt^~Cr&Lr,P[4]=Re^~ve&Se,P[5]=De^~Ne&be,P[14]=Ve^~Ke&Ge,P[15]=Ee^~ut&_t,P[24]=Le^~tt&et,P[25]=Xe^~qe&Ze,P[34]=it^~Be&ht,P[35]=st^~Ye&ke,P[44]=Tr^~Dr&qr,P[45]=Cr^~Lr&er,P[6]=ve^~Se&Oe,P[7]=Ne^~be&Ce,P[16]=Ke^~Ge&Ue,P[17]=ut^~_t&Me,P[26]=tt^~et<,P[27]=qe^~Ze&Je,P[36]=Be^~ht&ze,P[37]=Ye^~ke&ft,P[46]=Dr^~qr&Ct,P[47]=Lr^~er&Dt,P[8]=Se^~Oe&Ie,P[9]=be^~Ce&me,P[18]=Ge^~Ue&_e,P[19]=_t^~Me&He,P[28]=et^~lt&Et,P[29]=Ze^~Je&It,P[38]=ht^~ze&rt,P[39]=ke^~ft&je,P[48]=qr^~Ct&at,P[49]=er^~Dt&bt,P[0]^=K[j],P[1]^=K[j+1]};if(u)r.exports=h;else for(_=0;_{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{r.push(e)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const k1=AA();var sd;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(sd||(sd={}));var fn;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(fn||(fn={}));const F1="0123456789abcdef";let Or=class gr{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const i=e.toLowerCase();Xf[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(j1>Xf[i])&&console.log.apply(console,t)}debug(...e){this._log(gr.levels.DEBUG,e)}info(...e){this._log(gr.levels.INFO,e)}warn(...e){this._log(gr.levels.WARNING,e)}makeError(e,t,i){if(z1)return this.makeError("censored error",t,{});t||(t=gr.errors.UNKNOWN_ERROR),i||(i={});const n=[];Object.keys(i).forEach(b=>{const p=i[b];try{if(p instanceof Uint8Array){let y="";for(let A=0;A>4],y+=F1[p[A]&15];n.push(b+"=Uint8Array(0x"+y+")")}else n.push(b+"="+JSON.stringify(p))}catch{n.push(b+"="+JSON.stringify(i[b].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);const a=e;let f="";switch(t){case fn.NUMERIC_FAULT:{f="NUMERIC_FAULT";const b=e;switch(b){case"overflow":case"underflow":case"division-by-zero":f+="-"+b;break;case"negative-power":case"negative-width":f+="-unsupported";break;case"unbound-bitwise-result":f+="-unbound-result";break}break}case fn.CALL_EXCEPTION:case fn.INSUFFICIENT_FUNDS:case fn.MISSING_NEW:case fn.NONCE_EXPIRED:case fn.REPLACEMENT_UNDERPRICED:case fn.TRANSACTION_REPLACED:case fn.UNPREDICTABLE_GAS_LIMIT:f=t;break}f&&(e+=" [ See: https://links.ethers.org/v5-errors-"+f+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const u=new Error(e);return u.reason=a,u.code=t,Object.keys(i).forEach(function(b){u[b]=i[b]}),u}throwError(e,t,i){throw this.makeError(e,t,i)}throwArgumentError(e,t,i){return this.throwError(e,gr.errors.INVALID_ARGUMENT,{argument:t,value:i})}assert(e,t,i,n){e||this.throwError(t,i,n)}assertArgument(e,t,i,n){e||this.throwArgumentError(t,i,n)}checkNormalize(e){k1&&this.throwError("platform missing String.prototype.normalize",gr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:k1})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,gr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,gr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,i){i?i=": "+i:i="",et&&this.throwError("too many arguments"+i,gr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",gr.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",gr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",gr.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return bl||(bl=new gr(_A)),bl}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",gr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),$1){if(!e)return;this.globalLogger().throwError("error censorship permanent",gr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}z1=!!e,$1=!!t}static setLogLevel(e){const t=Xf[e.toLowerCase()];if(t==null){gr.globalLogger().warn("invalid log level - "+e);return}j1=t}static from(e){return new gr(e)}};Or.errors=fn,Or.levels=sd;const EA="bytes/5.7.0",cr=new Or(EA);function $b(r){return!!r.toHexString}function eo(r){return r.slice||(r.slice=function(){const e=Array.prototype.slice.call(arguments);return eo(new Uint8Array(Array.prototype.slice.apply(r,e)))}),r}function xA(r){return _i(r)&&!(r.length%2)||bo(r)}function H1(r){return typeof r=="number"&&r==r&&r%1===0}function bo(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!H1(r.length)||r.length<0)return!1;for(let e=0;e=256)return!1}return!0}function ir(r,e){if(e||(e={}),typeof r=="number"){cr.checkSafeUint53(r,"invalid arrayify value");const t=[];for(;r;)t.unshift(r&255),r=parseInt(String(r/256));return t.length===0&&t.push(0),eo(new Uint8Array(t))}if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),$b(r)&&(r=r.toHexString()),_i(r)){let t=r.substring(2);t.length%2&&(e.hexPad==="left"?t="0"+t:e.hexPad==="right"?t+="0":cr.throwArgumentError("hex data is odd-length","value",r));const i=[];for(let n=0;nir(n)),t=e.reduce((n,a)=>n+a.length,0),i=new Uint8Array(t);return e.reduce((n,a)=>(i.set(a,n),n+a.length),0),eo(i)}function IA(r,e){r=ir(r),r.length>e&&cr.throwArgumentError("value out of range","value",arguments[0]);const t=new Uint8Array(e);return t.set(r,e-r.length),eo(t)}function _i(r,e){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||e&&r.length!==2+2*e)}const ml="0123456789abcdef";function ci(r,e){if(e||(e={}),typeof r=="number"){cr.checkSafeUint53(r,"invalid hexlify value");let t="";for(;r;)t=ml[r&15]+t,r=Math.floor(r/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(e.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),$b(r))return r.toHexString();if(_i(r))return r.length%2&&(e.hexPad==="left"?r="0x0"+r.substring(2):e.hexPad==="right"?r+="0":cr.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(bo(r)){let t="0x";for(let i=0;i>4]+ml[n&15]}return t}return cr.throwArgumentError("invalid hexlify value","value",r)}function MA(r){if(typeof r!="string")r=ci(r);else if(!_i(r)||r.length%2)return null;return(r.length-2)/2}function K1(r,e,t){return typeof r!="string"?r=ci(r):(!_i(r)||r.length%2)&&cr.throwArgumentError("invalid hexData","value",r),e=2+2*e,t!=null?"0x"+r.substring(e,2+2*t):"0x"+r.substring(e)}function Cn(r,e){for(typeof r!="string"?r=ci(r):_i(r)||cr.throwArgumentError("invalid hex string","value",r),r.length>2*e+2&&cr.throwArgumentError("value out of range","value",arguments[1]);r.length<2*e+2;)r="0x0"+r.substring(2);return r}function zb(r){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(xA(r)){let t=ir(r);t.length===64?(e.v=27+(t[32]>>7),t[32]&=127,e.r=ci(t.slice(0,32)),e.s=ci(t.slice(32,64))):t.length===65?(e.r=ci(t.slice(0,32)),e.s=ci(t.slice(32,64)),e.v=t[64]):cr.throwArgumentError("invalid signature string","signature",r),e.v<27&&(e.v===0||e.v===1?e.v+=27:cr.throwArgumentError("signature invalid v byte","signature",r)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(t[32]|=128),e._vs=ci(t.slice(32,64))}else{if(e.r=r.r,e.s=r.s,e.v=r.v,e.recoveryParam=r.recoveryParam,e._vs=r._vs,e._vs!=null){const n=IA(ir(e._vs),32);e._vs=ci(n);const a=n[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&cr.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),n[0]&=127;const f=ci(n);e.s==null?e.s=f:e.s!==f&&cr.throwArgumentError("signature v mismatch _vs","signature",r)}if(e.recoveryParam==null)e.v==null?cr.throwArgumentError("signature missing v and recoveryParam","signature",r):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const n=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==n&&cr.throwArgumentError("signature recoveryParam mismatch v","signature",r)}e.r==null||!_i(e.r)?cr.throwArgumentError("signature missing or invalid r","signature",r):e.r=Cn(e.r,32),e.s==null||!_i(e.s)?cr.throwArgumentError("signature missing or invalid s","signature",r):e.s=Cn(e.s,32);const t=ir(e.s);t[0]>=128&&cr.throwArgumentError("signature s out of range","signature",r),e.recoveryParam&&(t[0]|=128);const i=ci(t);e._vs&&(_i(e._vs)||cr.throwArgumentError("signature invalid _vs","signature",r),e._vs=Cn(e._vs,32)),e._vs==null?e._vs=i:e._vs!==i&&cr.throwArgumentError("signature _vs mismatch v and s","signature",r)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function kd(r){return"0x"+wA.keccak_256(ir(r))}var jb={exports:{}},PA={},OA=Object.freeze({__proto__:null,default:PA}),RA=yA(OA);(function(r){(function(e,t){function i(c,h){if(!c)throw new Error(h||"Assertion failed")}function n(c,h){c.super_=h;var v=function(){};v.prototype=h.prototype,c.prototype=new v,c.prototype.constructor=c}function a(c,h,v){if(a.isBN(c))return c;this.negative=0,this.words=null,this.length=0,this.red=null,c!==null&&((h==="le"||h==="be")&&(v=h,h=10),this._init(c||0,h||10,v||"be"))}typeof e=="object"?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;var f;try{typeof window<"u"&&typeof window.Buffer<"u"?f=window.Buffer:f=RA.Buffer}catch{}a.isBN=function(c){return c instanceof a?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===a.wordSize&&Array.isArray(c.words)},a.max=function(c,h){return c.cmp(h)>0?c:h},a.min=function(c,h){return c.cmp(h)<0?c:h},a.prototype._init=function(c,h,v){if(typeof c=="number")return this._initNumber(c,h,v);if(typeof c=="object")return this._initArray(c,h,v);h==="hex"&&(h=16),i(h===(h|0)&&h>=2&&h<=36),c=c.toString().replace(/\s+/g,"");var _=0;c[0]==="-"&&(_++,this.negative=1),_=0;_-=3)M=c[_]|c[_-1]<<8|c[_-2]<<16,this.words[I]|=M<>>26-S&67108863,S+=24,S>=26&&(S-=26,I++);else if(v==="le")for(_=0,I=0;_>>26-S&67108863,S+=24,S>=26&&(S-=26,I++);return this._strip()};function u(c,h){var v=c.charCodeAt(h);if(v>=48&&v<=57)return v-48;if(v>=65&&v<=70)return v-55;if(v>=97&&v<=102)return v-87;i(!1,"Invalid character in "+c)}function b(c,h,v){var _=u(c,v);return v-1>=h&&(_|=u(c,v-1)<<4),_}a.prototype._parseHex=function(c,h,v){this.length=Math.ceil((c.length-h)/6),this.words=new Array(this.length);for(var _=0;_=h;_-=2)S=b(c,h,_)<=18?(I-=18,M+=1,this.words[M]|=S>>>26):I+=8;else{var d=c.length-h;for(_=d%2===0?h+1:h;_=18?(I-=18,M+=1,this.words[M]|=S>>>26):I+=8}this._strip()};function p(c,h,v,_){for(var I=0,M=0,S=Math.min(c.length,v),d=h;d=49?M=g-49+10:g>=17?M=g-17+10:M=g,i(g>=0&&M<_,"Invalid character"),I+=M}return I}a.prototype._parseBase=function(c,h,v){this.words=[0],this.length=1;for(var _=0,I=1;I<=67108863;I*=h)_++;_--,I=I/h|0;for(var M=c.length-v,S=M%_,d=Math.min(M,M-S)+v,g=0,C=v;C1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=A}catch{a.prototype.inspect=A}else a.prototype.inspect=A;function A(){return(this.red?""}var R=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],O=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],N=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(c,h){c=c||10,h=h|0||1;var v;if(c===16||c==="hex"){v="";for(var _=0,I=0,M=0;M>>24-_&16777215,_+=2,_>=26&&(_-=26,M--),I!==0||M!==this.length-1?v=R[6-d.length]+d+v:v=d+v}for(I!==0&&(v=I.toString(16)+v);v.length%h!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(c===(c|0)&&c>=2&&c<=36){var g=O[c],C=N[c];v="";var Z=this.clone();for(Z.negative=0;!Z.isZero();){var se=Z.modrn(C).toString(c);Z=Z.idivn(C),Z.isZero()?v=se+v:v=R[g-se.length]+se+v}for(this.isZero()&&(v="0"+v);v.length%h!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}i(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},a.prototype.toJSON=function(){return this.toString(16,2)},f&&(a.prototype.toBuffer=function(c,h){return this.toArrayLike(f,c,h)}),a.prototype.toArray=function(c,h){return this.toArrayLike(Array,c,h)};var K=function(c,h){return c.allocUnsafe?c.allocUnsafe(h):new c(h)};a.prototype.toArrayLike=function(c,h,v){this._strip();var _=this.byteLength(),I=v||Math.max(1,_);i(_<=I,"byte array longer than desired length"),i(I>0,"Requested array length <= 0");var M=K(c,I),S=h==="le"?"LE":"BE";return this["_toArrayLike"+S](M,_),M},a.prototype._toArrayLikeLE=function(c,h){for(var v=0,_=0,I=0,M=0;I>8&255),v>16&255),M===6?(v>24&255),_=0,M=0):(_=S>>>24,M+=2)}if(v=0&&(c[v--]=S>>8&255),v>=0&&(c[v--]=S>>16&255),M===6?(v>=0&&(c[v--]=S>>24&255),_=0,M=0):(_=S>>>24,M+=2)}if(v>=0)for(c[v--]=_;v>=0;)c[v--]=0},Math.clz32?a.prototype._countBits=function(c){return 32-Math.clz32(c)}:a.prototype._countBits=function(c){var h=c,v=0;return h>=4096&&(v+=13,h>>>=13),h>=64&&(v+=7,h>>>=7),h>=8&&(v+=4,h>>>=4),h>=2&&(v+=2,h>>>=2),v+h},a.prototype._zeroBits=function(c){if(c===0)return 26;var h=c,v=0;return h&8191||(v+=13,h>>>=13),h&127||(v+=7,h>>>=7),h&15||(v+=4,h>>>=4),h&3||(v+=2,h>>>=2),h&1||v++,v},a.prototype.bitLength=function(){var c=this.words[this.length-1],h=this._countBits(c);return(this.length-1)*26+h};function W(c){for(var h=new Array(c.bitLength()),v=0;v>>I&1}return h}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,h=0;hc.length?this.clone().ior(c):c.clone().ior(this)},a.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},a.prototype.iuand=function(c){var h;this.length>c.length?h=c:h=this;for(var v=0;vc.length?this.clone().iand(c):c.clone().iand(this)},a.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},a.prototype.iuxor=function(c){var h,v;this.length>c.length?(h=this,v=c):(h=c,v=this);for(var _=0;_c.length?this.clone().ixor(c):c.clone().ixor(this)},a.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},a.prototype.inotn=function(c){i(typeof c=="number"&&c>=0);var h=Math.ceil(c/26)|0,v=c%26;this._expand(h),v>0&&h--;for(var _=0;_0&&(this.words[_]=~this.words[_]&67108863>>26-v),this._strip()},a.prototype.notn=function(c){return this.clone().inotn(c)},a.prototype.setn=function(c,h){i(typeof c=="number"&&c>=0);var v=c/26|0,_=c%26;return this._expand(v+1),h?this.words[v]=this.words[v]|1<<_:this.words[v]=this.words[v]&~(1<<_),this._strip()},a.prototype.iadd=function(c){var h;if(this.negative!==0&&c.negative===0)return this.negative=0,h=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,h=this.isub(c),c.negative=1,h._normSign();var v,_;this.length>c.length?(v=this,_=c):(v=c,_=this);for(var I=0,M=0;M<_.length;M++)h=(v.words[M]|0)+(_.words[M]|0)+I,this.words[M]=h&67108863,I=h>>>26;for(;I!==0&&M>>26;if(this.length=v.length,I!==0)this.words[this.length]=I,this.length++;else if(v!==this)for(;Mc.length?this.clone().iadd(c):c.clone().iadd(this)},a.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var h=this.iadd(c);return c.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var v=this.cmp(c);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,I;v>0?(_=this,I=c):(_=c,I=this);for(var M=0,S=0;S>26,this.words[S]=h&67108863;for(;M!==0&&S<_.length;S++)h=(_.words[S]|0)+M,M=h>>26,this.words[S]=h&67108863;if(M===0&&S<_.length&&_!==this)for(;S<_.length;S++)this.words[S]=_.words[S];return this.length=Math.max(this.length,S),_!==this&&(this.negative=1),this._strip()},a.prototype.sub=function(c){return this.clone().isub(c)};function Q(c,h,v){v.negative=h.negative^c.negative;var _=c.length+h.length|0;v.length=_,_=_-1|0;var I=c.words[0]|0,M=h.words[0]|0,S=I*M,d=S&67108863,g=S/67108864|0;v.words[0]=d;for(var C=1;C<_;C++){for(var Z=g>>>26,se=g&67108863,P=Math.min(C,h.length-1),ee=Math.max(0,C-c.length+1);ee<=P;ee++){var B=C-ee|0;I=c.words[B]|0,M=h.words[ee]|0,S=I*M+se,Z+=S/67108864|0,se=S&67108863}v.words[C]=se|0,g=Z|0}return g!==0?v.words[C]=g|0:v.length--,v._strip()}var k=function(c,h,v){var _=c.words,I=h.words,M=v.words,S=0,d,g,C,Z=_[0]|0,se=Z&8191,P=Z>>>13,ee=_[1]|0,B=ee&8191,j=ee>>>13,H=_[2]|0,w=H&8191,z=H>>>13,ne=_[3]|0,ce=ne&8191,he=ne>>>13,ye=_[4]|0,we=ye&8191,Te=ye>>>13,Qe=_[5]|0,Oe=Qe&8191,Ce=Qe>>>13,Ie=_[6]|0,me=Ie&8191,Re=Ie>>>13,De=_[7]|0,ve=De&8191,Ne=De>>>13,Se=_[8]|0,be=Se&8191,Ue=Se>>>13,Me=_[9]|0,_e=Me&8191,He=Me>>>13,Ve=I[0]|0,Ee=Ve&8191,Ke=Ve>>>13,ut=I[1]|0,Ge=ut&8191,_t=ut>>>13,lt=I[2]|0,Je=lt&8191,Et=lt>>>13,It=I[3]|0,Le=It&8191,Xe=It>>>13,tt=I[4]|0,qe=tt&8191,et=tt>>>13,Ze=I[5]|0,ze=Ze&8191,ft=Ze>>>13,rt=I[6]|0,je=rt&8191,it=rt>>>13,st=I[7]|0,Be=st&8191,Ye=st>>>13,ht=I[8]|0,ke=ht&8191,Ct=ht>>>13,Dt=I[9]|0,at=Dt&8191,bt=Dt>>>13;v.negative=c.negative^h.negative,v.length=19,d=Math.imul(se,Ee),g=Math.imul(se,Ke),g=g+Math.imul(P,Ee)|0,C=Math.imul(P,Ke);var Tr=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Tr>>>26)|0,Tr&=67108863,d=Math.imul(B,Ee),g=Math.imul(B,Ke),g=g+Math.imul(j,Ee)|0,C=Math.imul(j,Ke),d=d+Math.imul(se,Ge)|0,g=g+Math.imul(se,_t)|0,g=g+Math.imul(P,Ge)|0,C=C+Math.imul(P,_t)|0;var Cr=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Cr>>>26)|0,Cr&=67108863,d=Math.imul(w,Ee),g=Math.imul(w,Ke),g=g+Math.imul(z,Ee)|0,C=Math.imul(z,Ke),d=d+Math.imul(B,Ge)|0,g=g+Math.imul(B,_t)|0,g=g+Math.imul(j,Ge)|0,C=C+Math.imul(j,_t)|0,d=d+Math.imul(se,Je)|0,g=g+Math.imul(se,Et)|0,g=g+Math.imul(P,Je)|0,C=C+Math.imul(P,Et)|0;var Dr=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,d=Math.imul(ce,Ee),g=Math.imul(ce,Ke),g=g+Math.imul(he,Ee)|0,C=Math.imul(he,Ke),d=d+Math.imul(w,Ge)|0,g=g+Math.imul(w,_t)|0,g=g+Math.imul(z,Ge)|0,C=C+Math.imul(z,_t)|0,d=d+Math.imul(B,Je)|0,g=g+Math.imul(B,Et)|0,g=g+Math.imul(j,Je)|0,C=C+Math.imul(j,Et)|0,d=d+Math.imul(se,Le)|0,g=g+Math.imul(se,Xe)|0,g=g+Math.imul(P,Le)|0,C=C+Math.imul(P,Xe)|0;var Lr=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,d=Math.imul(we,Ee),g=Math.imul(we,Ke),g=g+Math.imul(Te,Ee)|0,C=Math.imul(Te,Ke),d=d+Math.imul(ce,Ge)|0,g=g+Math.imul(ce,_t)|0,g=g+Math.imul(he,Ge)|0,C=C+Math.imul(he,_t)|0,d=d+Math.imul(w,Je)|0,g=g+Math.imul(w,Et)|0,g=g+Math.imul(z,Je)|0,C=C+Math.imul(z,Et)|0,d=d+Math.imul(B,Le)|0,g=g+Math.imul(B,Xe)|0,g=g+Math.imul(j,Le)|0,C=C+Math.imul(j,Xe)|0,d=d+Math.imul(se,qe)|0,g=g+Math.imul(se,et)|0,g=g+Math.imul(P,qe)|0,C=C+Math.imul(P,et)|0;var qr=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(qr>>>26)|0,qr&=67108863,d=Math.imul(Oe,Ee),g=Math.imul(Oe,Ke),g=g+Math.imul(Ce,Ee)|0,C=Math.imul(Ce,Ke),d=d+Math.imul(we,Ge)|0,g=g+Math.imul(we,_t)|0,g=g+Math.imul(Te,Ge)|0,C=C+Math.imul(Te,_t)|0,d=d+Math.imul(ce,Je)|0,g=g+Math.imul(ce,Et)|0,g=g+Math.imul(he,Je)|0,C=C+Math.imul(he,Et)|0,d=d+Math.imul(w,Le)|0,g=g+Math.imul(w,Xe)|0,g=g+Math.imul(z,Le)|0,C=C+Math.imul(z,Xe)|0,d=d+Math.imul(B,qe)|0,g=g+Math.imul(B,et)|0,g=g+Math.imul(j,qe)|0,C=C+Math.imul(j,et)|0,d=d+Math.imul(se,ze)|0,g=g+Math.imul(se,ft)|0,g=g+Math.imul(P,ze)|0,C=C+Math.imul(P,ft)|0;var er=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(er>>>26)|0,er&=67108863,d=Math.imul(me,Ee),g=Math.imul(me,Ke),g=g+Math.imul(Re,Ee)|0,C=Math.imul(Re,Ke),d=d+Math.imul(Oe,Ge)|0,g=g+Math.imul(Oe,_t)|0,g=g+Math.imul(Ce,Ge)|0,C=C+Math.imul(Ce,_t)|0,d=d+Math.imul(we,Je)|0,g=g+Math.imul(we,Et)|0,g=g+Math.imul(Te,Je)|0,C=C+Math.imul(Te,Et)|0,d=d+Math.imul(ce,Le)|0,g=g+Math.imul(ce,Xe)|0,g=g+Math.imul(he,Le)|0,C=C+Math.imul(he,Xe)|0,d=d+Math.imul(w,qe)|0,g=g+Math.imul(w,et)|0,g=g+Math.imul(z,qe)|0,C=C+Math.imul(z,et)|0,d=d+Math.imul(B,ze)|0,g=g+Math.imul(B,ft)|0,g=g+Math.imul(j,ze)|0,C=C+Math.imul(j,ft)|0,d=d+Math.imul(se,je)|0,g=g+Math.imul(se,it)|0,g=g+Math.imul(P,je)|0,C=C+Math.imul(P,it)|0;var Qr=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,d=Math.imul(ve,Ee),g=Math.imul(ve,Ke),g=g+Math.imul(Ne,Ee)|0,C=Math.imul(Ne,Ke),d=d+Math.imul(me,Ge)|0,g=g+Math.imul(me,_t)|0,g=g+Math.imul(Re,Ge)|0,C=C+Math.imul(Re,_t)|0,d=d+Math.imul(Oe,Je)|0,g=g+Math.imul(Oe,Et)|0,g=g+Math.imul(Ce,Je)|0,C=C+Math.imul(Ce,Et)|0,d=d+Math.imul(we,Le)|0,g=g+Math.imul(we,Xe)|0,g=g+Math.imul(Te,Le)|0,C=C+Math.imul(Te,Xe)|0,d=d+Math.imul(ce,qe)|0,g=g+Math.imul(ce,et)|0,g=g+Math.imul(he,qe)|0,C=C+Math.imul(he,et)|0,d=d+Math.imul(w,ze)|0,g=g+Math.imul(w,ft)|0,g=g+Math.imul(z,ze)|0,C=C+Math.imul(z,ft)|0,d=d+Math.imul(B,je)|0,g=g+Math.imul(B,it)|0,g=g+Math.imul(j,je)|0,C=C+Math.imul(j,it)|0,d=d+Math.imul(se,Be)|0,g=g+Math.imul(se,Ye)|0,g=g+Math.imul(P,Be)|0,C=C+Math.imul(P,Ye)|0;var Vi=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Vi>>>26)|0,Vi&=67108863,d=Math.imul(be,Ee),g=Math.imul(be,Ke),g=g+Math.imul(Ue,Ee)|0,C=Math.imul(Ue,Ke),d=d+Math.imul(ve,Ge)|0,g=g+Math.imul(ve,_t)|0,g=g+Math.imul(Ne,Ge)|0,C=C+Math.imul(Ne,_t)|0,d=d+Math.imul(me,Je)|0,g=g+Math.imul(me,Et)|0,g=g+Math.imul(Re,Je)|0,C=C+Math.imul(Re,Et)|0,d=d+Math.imul(Oe,Le)|0,g=g+Math.imul(Oe,Xe)|0,g=g+Math.imul(Ce,Le)|0,C=C+Math.imul(Ce,Xe)|0,d=d+Math.imul(we,qe)|0,g=g+Math.imul(we,et)|0,g=g+Math.imul(Te,qe)|0,C=C+Math.imul(Te,et)|0,d=d+Math.imul(ce,ze)|0,g=g+Math.imul(ce,ft)|0,g=g+Math.imul(he,ze)|0,C=C+Math.imul(he,ft)|0,d=d+Math.imul(w,je)|0,g=g+Math.imul(w,it)|0,g=g+Math.imul(z,je)|0,C=C+Math.imul(z,it)|0,d=d+Math.imul(B,Be)|0,g=g+Math.imul(B,Ye)|0,g=g+Math.imul(j,Be)|0,C=C+Math.imul(j,Ye)|0,d=d+Math.imul(se,ke)|0,g=g+Math.imul(se,Ct)|0,g=g+Math.imul(P,ke)|0,C=C+Math.imul(P,Ct)|0;var Xr=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,d=Math.imul(_e,Ee),g=Math.imul(_e,Ke),g=g+Math.imul(He,Ee)|0,C=Math.imul(He,Ke),d=d+Math.imul(be,Ge)|0,g=g+Math.imul(be,_t)|0,g=g+Math.imul(Ue,Ge)|0,C=C+Math.imul(Ue,_t)|0,d=d+Math.imul(ve,Je)|0,g=g+Math.imul(ve,Et)|0,g=g+Math.imul(Ne,Je)|0,C=C+Math.imul(Ne,Et)|0,d=d+Math.imul(me,Le)|0,g=g+Math.imul(me,Xe)|0,g=g+Math.imul(Re,Le)|0,C=C+Math.imul(Re,Xe)|0,d=d+Math.imul(Oe,qe)|0,g=g+Math.imul(Oe,et)|0,g=g+Math.imul(Ce,qe)|0,C=C+Math.imul(Ce,et)|0,d=d+Math.imul(we,ze)|0,g=g+Math.imul(we,ft)|0,g=g+Math.imul(Te,ze)|0,C=C+Math.imul(Te,ft)|0,d=d+Math.imul(ce,je)|0,g=g+Math.imul(ce,it)|0,g=g+Math.imul(he,je)|0,C=C+Math.imul(he,it)|0,d=d+Math.imul(w,Be)|0,g=g+Math.imul(w,Ye)|0,g=g+Math.imul(z,Be)|0,C=C+Math.imul(z,Ye)|0,d=d+Math.imul(B,ke)|0,g=g+Math.imul(B,Ct)|0,g=g+Math.imul(j,ke)|0,C=C+Math.imul(j,Ct)|0,d=d+Math.imul(se,at)|0,g=g+Math.imul(se,bt)|0,g=g+Math.imul(P,at)|0,C=C+Math.imul(P,bt)|0;var Gi=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Gi>>>26)|0,Gi&=67108863,d=Math.imul(_e,Ge),g=Math.imul(_e,_t),g=g+Math.imul(He,Ge)|0,C=Math.imul(He,_t),d=d+Math.imul(be,Je)|0,g=g+Math.imul(be,Et)|0,g=g+Math.imul(Ue,Je)|0,C=C+Math.imul(Ue,Et)|0,d=d+Math.imul(ve,Le)|0,g=g+Math.imul(ve,Xe)|0,g=g+Math.imul(Ne,Le)|0,C=C+Math.imul(Ne,Xe)|0,d=d+Math.imul(me,qe)|0,g=g+Math.imul(me,et)|0,g=g+Math.imul(Re,qe)|0,C=C+Math.imul(Re,et)|0,d=d+Math.imul(Oe,ze)|0,g=g+Math.imul(Oe,ft)|0,g=g+Math.imul(Ce,ze)|0,C=C+Math.imul(Ce,ft)|0,d=d+Math.imul(we,je)|0,g=g+Math.imul(we,it)|0,g=g+Math.imul(Te,je)|0,C=C+Math.imul(Te,it)|0,d=d+Math.imul(ce,Be)|0,g=g+Math.imul(ce,Ye)|0,g=g+Math.imul(he,Be)|0,C=C+Math.imul(he,Ye)|0,d=d+Math.imul(w,ke)|0,g=g+Math.imul(w,Ct)|0,g=g+Math.imul(z,ke)|0,C=C+Math.imul(z,Ct)|0,d=d+Math.imul(B,at)|0,g=g+Math.imul(B,bt)|0,g=g+Math.imul(j,at)|0,C=C+Math.imul(j,bt)|0;var Wi=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Wi>>>26)|0,Wi&=67108863,d=Math.imul(_e,Je),g=Math.imul(_e,Et),g=g+Math.imul(He,Je)|0,C=Math.imul(He,Et),d=d+Math.imul(be,Le)|0,g=g+Math.imul(be,Xe)|0,g=g+Math.imul(Ue,Le)|0,C=C+Math.imul(Ue,Xe)|0,d=d+Math.imul(ve,qe)|0,g=g+Math.imul(ve,et)|0,g=g+Math.imul(Ne,qe)|0,C=C+Math.imul(Ne,et)|0,d=d+Math.imul(me,ze)|0,g=g+Math.imul(me,ft)|0,g=g+Math.imul(Re,ze)|0,C=C+Math.imul(Re,ft)|0,d=d+Math.imul(Oe,je)|0,g=g+Math.imul(Oe,it)|0,g=g+Math.imul(Ce,je)|0,C=C+Math.imul(Ce,it)|0,d=d+Math.imul(we,Be)|0,g=g+Math.imul(we,Ye)|0,g=g+Math.imul(Te,Be)|0,C=C+Math.imul(Te,Ye)|0,d=d+Math.imul(ce,ke)|0,g=g+Math.imul(ce,Ct)|0,g=g+Math.imul(he,ke)|0,C=C+Math.imul(he,Ct)|0,d=d+Math.imul(w,at)|0,g=g+Math.imul(w,bt)|0,g=g+Math.imul(z,at)|0,C=C+Math.imul(z,bt)|0;var Zr=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,d=Math.imul(_e,Le),g=Math.imul(_e,Xe),g=g+Math.imul(He,Le)|0,C=Math.imul(He,Xe),d=d+Math.imul(be,qe)|0,g=g+Math.imul(be,et)|0,g=g+Math.imul(Ue,qe)|0,C=C+Math.imul(Ue,et)|0,d=d+Math.imul(ve,ze)|0,g=g+Math.imul(ve,ft)|0,g=g+Math.imul(Ne,ze)|0,C=C+Math.imul(Ne,ft)|0,d=d+Math.imul(me,je)|0,g=g+Math.imul(me,it)|0,g=g+Math.imul(Re,je)|0,C=C+Math.imul(Re,it)|0,d=d+Math.imul(Oe,Be)|0,g=g+Math.imul(Oe,Ye)|0,g=g+Math.imul(Ce,Be)|0,C=C+Math.imul(Ce,Ye)|0,d=d+Math.imul(we,ke)|0,g=g+Math.imul(we,Ct)|0,g=g+Math.imul(Te,ke)|0,C=C+Math.imul(Te,Ct)|0,d=d+Math.imul(ce,at)|0,g=g+Math.imul(ce,bt)|0,g=g+Math.imul(he,at)|0,C=C+Math.imul(he,bt)|0;var Si=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Si>>>26)|0,Si&=67108863,d=Math.imul(_e,qe),g=Math.imul(_e,et),g=g+Math.imul(He,qe)|0,C=Math.imul(He,et),d=d+Math.imul(be,ze)|0,g=g+Math.imul(be,ft)|0,g=g+Math.imul(Ue,ze)|0,C=C+Math.imul(Ue,ft)|0,d=d+Math.imul(ve,je)|0,g=g+Math.imul(ve,it)|0,g=g+Math.imul(Ne,je)|0,C=C+Math.imul(Ne,it)|0,d=d+Math.imul(me,Be)|0,g=g+Math.imul(me,Ye)|0,g=g+Math.imul(Re,Be)|0,C=C+Math.imul(Re,Ye)|0,d=d+Math.imul(Oe,ke)|0,g=g+Math.imul(Oe,Ct)|0,g=g+Math.imul(Ce,ke)|0,C=C+Math.imul(Ce,Ct)|0,d=d+Math.imul(we,at)|0,g=g+Math.imul(we,bt)|0,g=g+Math.imul(Te,at)|0,C=C+Math.imul(Te,bt)|0;var Ii=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,d=Math.imul(_e,ze),g=Math.imul(_e,ft),g=g+Math.imul(He,ze)|0,C=Math.imul(He,ft),d=d+Math.imul(be,je)|0,g=g+Math.imul(be,it)|0,g=g+Math.imul(Ue,je)|0,C=C+Math.imul(Ue,it)|0,d=d+Math.imul(ve,Be)|0,g=g+Math.imul(ve,Ye)|0,g=g+Math.imul(Ne,Be)|0,C=C+Math.imul(Ne,Ye)|0,d=d+Math.imul(me,ke)|0,g=g+Math.imul(me,Ct)|0,g=g+Math.imul(Re,ke)|0,C=C+Math.imul(Re,Ct)|0,d=d+Math.imul(Oe,at)|0,g=g+Math.imul(Oe,bt)|0,g=g+Math.imul(Ce,at)|0,C=C+Math.imul(Ce,bt)|0;var lr=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(lr>>>26)|0,lr&=67108863,d=Math.imul(_e,je),g=Math.imul(_e,it),g=g+Math.imul(He,je)|0,C=Math.imul(He,it),d=d+Math.imul(be,Be)|0,g=g+Math.imul(be,Ye)|0,g=g+Math.imul(Ue,Be)|0,C=C+Math.imul(Ue,Ye)|0,d=d+Math.imul(ve,ke)|0,g=g+Math.imul(ve,Ct)|0,g=g+Math.imul(Ne,ke)|0,C=C+Math.imul(Ne,Ct)|0,d=d+Math.imul(me,at)|0,g=g+Math.imul(me,bt)|0,g=g+Math.imul(Re,at)|0,C=C+Math.imul(Re,bt)|0;var Ji=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Ji>>>26)|0,Ji&=67108863,d=Math.imul(_e,Be),g=Math.imul(_e,Ye),g=g+Math.imul(He,Be)|0,C=Math.imul(He,Ye),d=d+Math.imul(be,ke)|0,g=g+Math.imul(be,Ct)|0,g=g+Math.imul(Ue,ke)|0,C=C+Math.imul(Ue,Ct)|0,d=d+Math.imul(ve,at)|0,g=g+Math.imul(ve,bt)|0,g=g+Math.imul(Ne,at)|0,C=C+Math.imul(Ne,bt)|0;var Yi=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Yi>>>26)|0,Yi&=67108863,d=Math.imul(_e,ke),g=Math.imul(_e,Ct),g=g+Math.imul(He,ke)|0,C=Math.imul(He,Ct),d=d+Math.imul(be,at)|0,g=g+Math.imul(be,bt)|0,g=g+Math.imul(Ue,at)|0,C=C+Math.imul(Ue,bt)|0;var Qi=(S+d|0)+((g&8191)<<13)|0;S=(C+(g>>>13)|0)+(Qi>>>26)|0,Qi&=67108863,d=Math.imul(_e,at),g=Math.imul(_e,bt),g=g+Math.imul(He,at)|0,C=Math.imul(He,bt);var js=(S+d|0)+((g&8191)<<13)|0;return S=(C+(g>>>13)|0)+(js>>>26)|0,js&=67108863,M[0]=Tr,M[1]=Cr,M[2]=Dr,M[3]=Lr,M[4]=qr,M[5]=er,M[6]=Qr,M[7]=Vi,M[8]=Xr,M[9]=Gi,M[10]=Wi,M[11]=Zr,M[12]=Si,M[13]=Ii,M[14]=lr,M[15]=Ji,M[16]=Yi,M[17]=Qi,M[18]=js,S!==0&&(M[19]=S,v.length++),v};Math.imul||(k=Q);function Y(c,h,v){v.negative=h.negative^c.negative,v.length=c.length+h.length;for(var _=0,I=0,M=0;M>>26)|0,I+=S>>>26,S&=67108863}v.words[M]=d,_=S,S=I}return _!==0?v.words[M]=_:v.length--,v._strip()}function $(c,h,v){return Y(c,h,v)}a.prototype.mulTo=function(c,h){var v,_=this.length+c.length;return this.length===10&&c.length===10?v=k(this,c,h):_<63?v=Q(this,c,h):_<1024?v=Y(this,c,h):v=$(this,c,h),v},a.prototype.mul=function(c){var h=new a(null);return h.words=new Array(this.length+c.length),this.mulTo(c,h)},a.prototype.mulf=function(c){var h=new a(null);return h.words=new Array(this.length+c.length),$(this,c,h)},a.prototype.imul=function(c){return this.clone().mulTo(c,this)},a.prototype.imuln=function(c){var h=c<0;h&&(c=-c),i(typeof c=="number"),i(c<67108864);for(var v=0,_=0;_>=26,v+=I/67108864|0,v+=M>>>26,this.words[_]=M&67108863}return v!==0&&(this.words[_]=v,this.length++),h?this.ineg():this},a.prototype.muln=function(c){return this.clone().imuln(c)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(c){var h=W(c);if(h.length===0)return new a(1);for(var v=this,_=0;_=0);var h=c%26,v=(c-h)/26,_=67108863>>>26-h<<26-h,I;if(h!==0){var M=0;for(I=0;I>>26-h}M&&(this.words[I]=M,this.length++)}if(v!==0){for(I=this.length-1;I>=0;I--)this.words[I+v]=this.words[I];for(I=0;I=0);var _;h?_=(h-h%26)/26:_=0;var I=c%26,M=Math.min((c-I)/26,this.length),S=67108863^67108863>>>I<M)for(this.length-=M,g=0;g=0&&(C!==0||g>=_);g--){var Z=this.words[g]|0;this.words[g]=C<<26-I|Z>>>I,C=Z&S}return d&&C!==0&&(d.words[d.length++]=C),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(c,h,v){return i(this.negative===0),this.iushrn(c,h,v)},a.prototype.shln=function(c){return this.clone().ishln(c)},a.prototype.ushln=function(c){return this.clone().iushln(c)},a.prototype.shrn=function(c){return this.clone().ishrn(c)},a.prototype.ushrn=function(c){return this.clone().iushrn(c)},a.prototype.testn=function(c){i(typeof c=="number"&&c>=0);var h=c%26,v=(c-h)/26,_=1<=0);var h=c%26,v=(c-h)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(h!==0&&v++,this.length=Math.min(v,this.length),h!==0){var _=67108863^67108863>>>h<=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},a.prototype.isubn=function(c){if(i(typeof c=="number"),i(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h>26)-(d/67108864|0),this.words[I+v]=M&67108863}for(;I>26,this.words[I+v]=M&67108863;if(S===0)return this._strip();for(i(S===-1),S=0,I=0;I>26,this.words[I]=M&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(c,h){var v=this.length-c.length,_=this.clone(),I=c,M=I.words[I.length-1]|0,S=this._countBits(M);v=26-S,v!==0&&(I=I.ushln(v),_.iushln(v),M=I.words[I.length-1]|0);var d=_.length-I.length,g;if(h!=="mod"){g=new a(null),g.length=d+1,g.words=new Array(g.length);for(var C=0;C=0;se--){var P=(_.words[I.length+se]|0)*67108864+(_.words[I.length+se-1]|0);for(P=Math.min(P/M|0,67108863),_._ishlnsubmul(I,P,se);_.negative!==0;)P--,_.negative=0,_._ishlnsubmul(I,1,se),_.isZero()||(_.negative^=1);g&&(g.words[se]=P)}return g&&g._strip(),_._strip(),h!=="div"&&v!==0&&_.iushrn(v),{div:g||null,mod:_}},a.prototype.divmod=function(c,h,v){if(i(!c.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var _,I,M;return this.negative!==0&&c.negative===0?(M=this.neg().divmod(c,h),h!=="mod"&&(_=M.div.neg()),h!=="div"&&(I=M.mod.neg(),v&&I.negative!==0&&I.iadd(c)),{div:_,mod:I}):this.negative===0&&c.negative!==0?(M=this.divmod(c.neg(),h),h!=="mod"&&(_=M.div.neg()),{div:_,mod:M.mod}):this.negative&c.negative?(M=this.neg().divmod(c.neg(),h),h!=="div"&&(I=M.mod.neg(),v&&I.negative!==0&&I.isub(c)),{div:M.div,mod:I}):c.length>this.length||this.cmp(c)<0?{div:new a(0),mod:this}:c.length===1?h==="div"?{div:this.divn(c.words[0]),mod:null}:h==="mod"?{div:null,mod:new a(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new a(this.modrn(c.words[0]))}:this._wordDiv(c,h)},a.prototype.div=function(c){return this.divmod(c,"div",!1).div},a.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},a.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},a.prototype.divRound=function(c){var h=this.divmod(c);if(h.mod.isZero())return h.div;var v=h.div.negative!==0?h.mod.isub(c):h.mod,_=c.ushrn(1),I=c.andln(1),M=v.cmp(_);return M<0||I===1&&M===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},a.prototype.modrn=function(c){var h=c<0;h&&(c=-c),i(c<=67108863);for(var v=(1<<26)%c,_=0,I=this.length-1;I>=0;I--)_=(v*_+(this.words[I]|0))%c;return h?-_:_},a.prototype.modn=function(c){return this.modrn(c)},a.prototype.idivn=function(c){var h=c<0;h&&(c=-c),i(c<=67108863);for(var v=0,_=this.length-1;_>=0;_--){var I=(this.words[_]|0)+v*67108864;this.words[_]=I/c|0,v=I%c}return this._strip(),h?this.ineg():this},a.prototype.divn=function(c){return this.clone().idivn(c)},a.prototype.egcd=function(c){i(c.negative===0),i(!c.isZero());var h=this,v=c.clone();h.negative!==0?h=h.umod(c):h=h.clone();for(var _=new a(1),I=new a(0),M=new a(0),S=new a(1),d=0;h.isEven()&&v.isEven();)h.iushrn(1),v.iushrn(1),++d;for(var g=v.clone(),C=h.clone();!h.isZero();){for(var Z=0,se=1;!(h.words[0]&se)&&Z<26;++Z,se<<=1);if(Z>0)for(h.iushrn(Z);Z-- >0;)(_.isOdd()||I.isOdd())&&(_.iadd(g),I.isub(C)),_.iushrn(1),I.iushrn(1);for(var P=0,ee=1;!(v.words[0]&ee)&&P<26;++P,ee<<=1);if(P>0)for(v.iushrn(P);P-- >0;)(M.isOdd()||S.isOdd())&&(M.iadd(g),S.isub(C)),M.iushrn(1),S.iushrn(1);h.cmp(v)>=0?(h.isub(v),_.isub(M),I.isub(S)):(v.isub(h),M.isub(_),S.isub(I))}return{a:M,b:S,gcd:v.iushln(d)}},a.prototype._invmp=function(c){i(c.negative===0),i(!c.isZero());var h=this,v=c.clone();h.negative!==0?h=h.umod(c):h=h.clone();for(var _=new a(1),I=new a(0),M=v.clone();h.cmpn(1)>0&&v.cmpn(1)>0;){for(var S=0,d=1;!(h.words[0]&d)&&S<26;++S,d<<=1);if(S>0)for(h.iushrn(S);S-- >0;)_.isOdd()&&_.iadd(M),_.iushrn(1);for(var g=0,C=1;!(v.words[0]&C)&&g<26;++g,C<<=1);if(g>0)for(v.iushrn(g);g-- >0;)I.isOdd()&&I.iadd(M),I.iushrn(1);h.cmp(v)>=0?(h.isub(v),_.isub(I)):(v.isub(h),I.isub(_))}var Z;return h.cmpn(1)===0?Z=_:Z=I,Z.cmpn(0)<0&&Z.iadd(c),Z},a.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var h=this.clone(),v=c.clone();h.negative=0,v.negative=0;for(var _=0;h.isEven()&&v.isEven();_++)h.iushrn(1),v.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;v.isEven();)v.iushrn(1);var I=h.cmp(v);if(I<0){var M=h;h=v,v=M}else if(I===0||v.cmpn(1)===0)break;h.isub(v)}while(!0);return v.iushln(_)},a.prototype.invm=function(c){return this.egcd(c).a.umod(c)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(c){return this.words[0]&c},a.prototype.bincn=function(c){i(typeof c=="number");var h=c%26,v=(c-h)/26,_=1<>>26,S&=67108863,this.words[M]=S}return I!==0&&(this.words[M]=I,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(c){var h=c<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var v;if(this.length>1)v=1;else{h&&(c=-c),i(c<=67108863,"Number is too big");var _=this.words[0]|0;v=_===c?0:_c.length)return 1;if(this.length=0;v--){var _=this.words[v]|0,I=c.words[v]|0;if(_!==I){_I&&(h=1);break}}return h},a.prototype.gtn=function(c){return this.cmpn(c)===1},a.prototype.gt=function(c){return this.cmp(c)===1},a.prototype.gten=function(c){return this.cmpn(c)>=0},a.prototype.gte=function(c){return this.cmp(c)>=0},a.prototype.ltn=function(c){return this.cmpn(c)===-1},a.prototype.lt=function(c){return this.cmp(c)===-1},a.prototype.lten=function(c){return this.cmpn(c)<=0},a.prototype.lte=function(c){return this.cmp(c)<=0},a.prototype.eqn=function(c){return this.cmpn(c)===0},a.prototype.eq=function(c){return this.cmp(c)===0},a.red=function(c){return new L(c)},a.prototype.toRed=function(c){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},a.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(c){return this.red=c,this},a.prototype.forceRed=function(c){return i(!this.red,"Already a number in reduction context"),this._forceRed(c)},a.prototype.redAdd=function(c){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},a.prototype.redIAdd=function(c){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},a.prototype.redSub=function(c){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},a.prototype.redISub=function(c){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},a.prototype.redShl=function(c){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},a.prototype.redMul=function(c){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},a.prototype.redIMul=function(c){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},a.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(c){return i(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var F={k256:null,p224:null,p192:null,p25519:null};function G(c,h){this.name=c,this.p=new a(h,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}G.prototype._tmp=function(){var c=new a(null);return c.words=new Array(Math.ceil(this.n/13)),c},G.prototype.ireduce=function(c){var h=c,v;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),v=h.bitLength();while(v>this.n);var _=v0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},G.prototype.split=function(c,h){c.iushrn(this.n,0,h)},G.prototype.imulK=function(c){return c.imul(this.k)};function x(){G.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(x,G),x.prototype.split=function(c,h){for(var v=4194303,_=Math.min(c.length,9),I=0;I<_;I++)h.words[I]=c.words[I];if(h.length=_,c.length<=9){c.words[0]=0,c.length=1;return}var M=c.words[9];for(h.words[h.length++]=M&v,I=10;I>>22,M=S}M>>>=22,c.words[I-10]=M,M===0&&c.length>10?c.length-=10:c.length-=9},x.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var h=0,v=0;v>>=26,c.words[v]=I,h=_}return h!==0&&(c.words[c.length++]=h),c},a._prime=function(c){if(F[c])return F[c];var h;if(c==="k256")h=new x;else if(c==="p224")h=new q;else if(c==="p192")h=new ae;else if(c==="p25519")h=new le;else throw new Error("Unknown prime "+c);return F[c]=h,h};function L(c){if(typeof c=="string"){var h=a._prime(c);this.m=h.p,this.prime=h}else i(c.gtn(1),"modulus must be greater than 1"),this.m=c,this.prime=null}L.prototype._verify1=function(c){i(c.negative===0,"red works only with positives"),i(c.red,"red works only with red numbers")},L.prototype._verify2=function(c,h){i((c.negative|h.negative)===0,"red works only with positives"),i(c.red&&c.red===h.red,"red works only with red numbers")},L.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(y(c,c.umod(this.m)._forceRed(this)),c)},L.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},L.prototype.add=function(c,h){this._verify2(c,h);var v=c.add(h);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},L.prototype.iadd=function(c,h){this._verify2(c,h);var v=c.iadd(h);return v.cmp(this.m)>=0&&v.isub(this.m),v},L.prototype.sub=function(c,h){this._verify2(c,h);var v=c.sub(h);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},L.prototype.isub=function(c,h){this._verify2(c,h);var v=c.isub(h);return v.cmpn(0)<0&&v.iadd(this.m),v},L.prototype.shl=function(c,h){return this._verify1(c),this.imod(c.ushln(h))},L.prototype.imul=function(c,h){return this._verify2(c,h),this.imod(c.imul(h))},L.prototype.mul=function(c,h){return this._verify2(c,h),this.imod(c.mul(h))},L.prototype.isqr=function(c){return this.imul(c,c.clone())},L.prototype.sqr=function(c){return this.mul(c,c)},L.prototype.sqrt=function(c){if(c.isZero())return c.clone();var h=this.m.andln(3);if(i(h%2===1),h===3){var v=this.m.add(new a(1)).iushrn(2);return this.pow(c,v)}for(var _=this.m.subn(1),I=0;!_.isZero()&&_.andln(1)===0;)I++,_.iushrn(1);i(!_.isZero());var M=new a(1).toRed(this),S=M.redNeg(),d=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new a(2*g*g).toRed(this);this.pow(g,d).cmp(S)!==0;)g.redIAdd(S);for(var C=this.pow(g,_),Z=this.pow(c,_.addn(1).iushrn(1)),se=this.pow(c,_),P=I;se.cmp(M)!==0;){for(var ee=se,B=0;ee.cmp(M)!==0;B++)ee=ee.redSqr();i(B=0;I--){for(var C=h.words[I],Z=g-1;Z>=0;Z--){var se=C>>Z&1;if(M!==_[0]&&(M=this.sqr(M)),se===0&&S===0){d=0;continue}S<<=1,S|=se,d++,!(d!==v&&(I!==0||Z!==0))&&(M=this.mul(M,_[S]),d=0,S=0)}g=26}return M},L.prototype.convertTo=function(c){var h=c.umod(this.m);return h===c?h.clone():h},L.prototype.convertFrom=function(c){var h=c.clone();return h.red=null,h},a.mont=function(c){return new m(c)};function m(c){L.call(this,c),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(m,L),m.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},m.prototype.convertFrom=function(c){var h=this.imod(c.mul(this.rinv));return h.red=null,h},m.prototype.imul=function(c,h){if(c.isZero()||h.isZero())return c.words[0]=0,c.length=1,c;var v=c.imul(h),_=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),I=v.isub(_).iushrn(this.shift),M=I;return I.cmp(this.m)>=0?M=I.isub(this.m):I.cmpn(0)<0&&(M=I.iadd(this.m)),M._forceRed(this)},m.prototype.mul=function(c,h){if(c.isZero()||h.isZero())return new a(0)._forceRed(this);var v=c.mul(h),_=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),I=v.isub(_).iushrn(this.shift),M=I;return I.cmp(this.m)>=0?M=I.isub(this.m):I.cmpn(0)<0&&(M=I.iadd(this.m)),M._forceRed(this)},m.prototype.invm=function(c){var h=this.imod(c._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(r,Bb)})(jb);var vt=jb.exports;const kb="bignumber/5.7.0";var ph=vt.BN;const os=new Or(kb),yl={},V1=9007199254740991;function NA(r){return r!=null&&(Gt.isBigNumber(r)||typeof r=="number"&&r%1===0||typeof r=="string"&&!!r.match(/^-?[0-9]+$/)||_i(r)||typeof r=="bigint"||bo(r))}let G1=!1;class Gt{constructor(e,t){e!==yl&&os.throwError("cannot call constructor directly; use BigNumber.from",Or.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return si(Pt(this).fromTwos(e))}toTwos(e){return si(Pt(this).toTwos(e))}abs(){return this._hex[0]==="-"?Gt.from(this._hex.substring(1)):this}add(e){return si(Pt(this).add(Pt(e)))}sub(e){return si(Pt(this).sub(Pt(e)))}div(e){return Gt.from(e).isZero()&&Li("division-by-zero","div"),si(Pt(this).div(Pt(e)))}mul(e){return si(Pt(this).mul(Pt(e)))}mod(e){const t=Pt(e);return t.isNeg()&&Li("division-by-zero","mod"),si(Pt(this).umod(t))}pow(e){const t=Pt(e);return t.isNeg()&&Li("negative-power","pow"),si(Pt(this).pow(t))}and(e){const t=Pt(e);return(this.isNegative()||t.isNeg())&&Li("unbound-bitwise-result","and"),si(Pt(this).and(t))}or(e){const t=Pt(e);return(this.isNegative()||t.isNeg())&&Li("unbound-bitwise-result","or"),si(Pt(this).or(t))}xor(e){const t=Pt(e);return(this.isNegative()||t.isNeg())&&Li("unbound-bitwise-result","xor"),si(Pt(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Li("negative-width","mask"),si(Pt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Li("negative-width","shl"),si(Pt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Li("negative-width","shr"),si(Pt(this).shrn(e))}eq(e){return Pt(this).eq(Pt(e))}lt(e){return Pt(this).lt(Pt(e))}lte(e){return Pt(this).lte(Pt(e))}gt(e){return Pt(this).gt(Pt(e))}gte(e){return Pt(this).gte(Pt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Pt(this).isZero()}toNumber(){try{return Pt(this).toNumber()}catch{Li("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return os.throwError("this platform does not support BigInt",Or.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?G1||(G1=!0,os.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?os.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Or.errors.UNEXPECTED_ARGUMENT,{}):os.throwError("BigNumber.toString does not accept parameters",Or.errors.UNEXPECTED_ARGUMENT,{})),Pt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Gt)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new Gt(yl,pc(e)):e.match(/^-?[0-9]+$/)?new Gt(yl,pc(new ph(e))):os.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Li("underflow","BigNumber.from",e),(e>=V1||e<=-V1)&&Li("overflow","BigNumber.from",e),Gt.from(String(e));const t=e;if(typeof t=="bigint")return Gt.from(t.toString());if(bo(t))return Gt.from(ci(t));if(t)if(t.toHexString){const i=t.toHexString();if(typeof i=="string")return Gt.from(i)}else{let i=t._hex;if(i==null&&t.type==="BigNumber"&&(i=t.hex),typeof i=="string"&&(_i(i)||i[0]==="-"&&_i(i.substring(1))))return Gt.from(i)}return os.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function pc(r){if(typeof r!="string")return pc(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&os.throwArgumentError("invalid hex","value",r),r=pc(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function si(r){return Gt.from(pc(r))}function Pt(r){const e=Gt.from(r).toHexString();return e[0]==="-"?new ph("-"+e.substring(3),16):new ph(e.substring(2),16)}function Li(r,e,t){const i={fault:r,operation:e};return t!=null&&(i.value=t),os.throwError(r,Or.errors.NUMERIC_FAULT,i)}function TA(r){return new ph(r,36).toString(16)}const Wr=new Or(kb),oc={},Fb=Gt.from(0),Hb=Gt.from(-1);function Kb(r,e,t,i){const n={fault:e,operation:t};return i!==void 0&&(n.value=i),Wr.throwError(r,Or.errors.NUMERIC_FAULT,n)}let cc="0";for(;cc.length<256;)cc+=cc;function Fd(r){if(typeof r!="number")try{r=Gt.from(r).toNumber()}catch{}return typeof r=="number"&&r>=0&&r<=256&&!(r%1)?"1"+cc.substring(0,r):Wr.throwArgumentError("invalid decimal size","decimals",r)}function wl(r,e){e==null&&(e=0);const t=Fd(e);r=Gt.from(r);const i=r.lt(Fb);i&&(r=r.mul(Hb));let n=r.mod(t).toString();for(;n.length2&&Wr.throwArgumentError("too many decimal points","value",r);let a=n[0],f=n[1];for(a||(a="0"),f||(f="0");f[f.length-1]==="0";)f=f.substring(0,f.length-1);for(f.length>t.length-1&&Kb("fractional component exceeds decimals","underflow","parseFixed"),f===""&&(f="0");f.lengthe[f]==null?b:(typeof e[f]!==u&&Wr.throwArgumentError("invalid fixed format ("+f+" not "+u+")","format."+f,e[f]),e[f]);t=a("signed","boolean",t),i=a("width","number",i),n=a("decimals","number",n)}return i%8&&Wr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",i),n>80&&Wr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new ad(oc,t,i,n)}},Vb=class Vr{constructor(e,t,i,n){e!==oc&&Wr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Or.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Wr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=is(this._value,this.format.decimals),i=is(e._value,e.format.decimals);return Vr.fromValue(t.add(i),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=is(this._value,this.format.decimals),i=is(e._value,e.format.decimals);return Vr.fromValue(t.sub(i),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=is(this._value,this.format.decimals),i=is(e._value,e.format.decimals);return Vr.fromValue(t.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=is(this._value,this.format.decimals),i=is(e._value,e.format.decimals);return Vr.fromValue(t.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=Vr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return this.isNegative()&&i&&(t=t.subUnsafe(W1.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let t=Vr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return!this.isNegative()&&i&&(t=t.addUnsafe(W1.toFormat(t.format))),t}round(e){e==null&&(e=0);const t=this.toString().split(".");if(t.length===1&&t.push("0"),(e<0||e>80||e%1)&&Wr.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const i=Vr.from("1"+cc.substring(0,e),this.format),n=CA.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(n).floor().divUnsafe(i)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&Wr.throwArgumentError("invalid byte width","width",e);const t=Gt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Cn(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Vr.fromString(this._value,e)}static fromValue(e,t,i){return i==null&&t!=null&&!NA(t)&&(i=t,t=null),t==null&&(t=0),i==null&&(i="fixed"),Vr.fromString(wl(e,t),_l.from(i))}static fromString(e,t){t==null&&(t="fixed");const i=_l.from(t),n=is(e,i.decimals);!i.signed&&n.lt(Fb)&&Kb("unsigned value cannot be negative","overflow","value",e);let a=null;i.signed?a=n.toTwos(i.width).toHexString():(a=n.toHexString(),a=Cn(a,i.width/8));const f=wl(n,i.decimals);return new Vr(oc,a,f,i)}static fromBytes(e,t){t==null&&(t="fixed");const i=_l.from(t);if(ir(e).length>i.width/8)throw new Error("overflow");let n=Gt.from(e);i.signed&&(n=n.fromTwos(i.width));const a=n.toTwos((i.signed?0:1)+i.width).toHexString(),f=wl(n,i.decimals);return new Vr(oc,a,f,i)}static from(e,t){if(typeof e=="string")return Vr.fromString(e,t);if(bo(e))return Vr.fromBytes(e,t);try{return Vr.fromValue(e,0,t)}catch(i){if(i.code!==Or.errors.INVALID_ARGUMENT)throw i}return Wr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}};const W1=Vb.from(1),CA=Vb.from("0.5"),DA="strings/5.7.0",LA=new Or(DA);var gh;(function(r){r.current="",r.NFC="NFC",r.NFD="NFD",r.NFKC="NFKC",r.NFKD="NFKD"})(gh||(gh={}));var J1;(function(r){r.UNEXPECTED_CONTINUE="unexpected continuation byte",r.BAD_PREFIX="bad codepoint prefix",r.OVERRUN="string overrun",r.MISSING_CONTINUE="missing continuation byte",r.OUT_OF_RANGE="out of UTF-8 range",r.UTF16_SURROGATE="UTF-16 surrogate",r.OVERLONG="overlong representation"})(J1||(J1={}));function Al(r,e=gh.current){e!=gh.current&&(LA.checkNormalize(),r=r.normalize(e));let t=[];for(let i=0;i>6|192),t.push(n&63|128);else if((n&64512)==55296){i++;const a=r.charCodeAt(i);if(i>=r.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");const f=65536+((n&1023)<<10)+(a&1023);t.push(f>>18|240),t.push(f>>12&63|128),t.push(f>>6&63|128),t.push(f&63|128)}else t.push(n>>12|224),t.push(n>>6&63|128),t.push(n&63|128)}return ir(t)}function qA(r){if(r.length%4!==0)throw new Error("bad data");let e=[];for(let t=0;t{let a=n.split(":");t+=parseInt(a[0],16),i[t]=e(a[1])}),i}function Y1(r){let e=0;return r.split(",").map(t=>{let i=t.split("-");i.length===1?i[1]="0":i[1]===""&&(i[1]="1");let n=e+parseInt(i[0],16);return e=parseInt(i[1],16),{l:n,h:e}})}Y1("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(r=>parseInt(r,16)),El("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),El("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),El("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",qA),Y1("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function BA(r){r=atob(r);const e=[];for(let t=0;t0&&Array.isArray(u)?n(u,f-1):t.push(u)})};return n(r,e),t}function UA(r){const e={};for(let t=0;t>--b&1}const A=31,R=Math.pow(2,A),O=R>>>1,N=O>>1,K=R-1;let W=0;for(let F=0;F1;){let le=G+x>>>1;F>>1|y(),q=q<<1^O,ae=(ae^O)<<1|O|1;k=q,Y=1+ae-q}let $=i-4;return Q.map(F=>{switch(F-$){case 3:return $+65792+(r[u++]<<16|r[u++]<<8|r[u++]);case 2:return $+256+(r[u++]<<8|r[u++]);case 1:return $+r[u++];default:return F-1}})}function zA(r){let e=0;return()=>r[e++]}function jA(r){return zA($A(r))}function kA(r){return r&1?~r>>1:r>>1}function FA(r,e){let t=Array(r);for(let i=0;ie[f]):t}function KA(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(GA(t,r))}for(;;){let t=r()-1;if(t<0)break;e.push(WA(t,r))}return UA(Gb(e))}function VA(r){let e=[];for(;;){let t=r();if(t==0)break;e.push(t)}return e}function Wb(r,e,t){let i=Array(r).fill(void 0).map(()=>[]);for(let n=0;ni[f].push(a));return i}function GA(r,e){let t=1+e(),i=e(),n=VA(e),a=Wb(n.length,1+r,e);return Gb(a.map((f,u)=>{const b=f[0],p=f.slice(1);return Array(n[u]).fill(void 0).map((y,A)=>{let R=A*i;return[b+A*t,p.map(O=>O+R)]})}))}function WA(r,e){let t=1+e();return Wb(t,1+r,e).map(i=>[i[0],i.slice(1)])}function JA(r){let e=vh(r).sort((i,n)=>i-n);return t();function t(){let i=[];for(;;){let p=vh(r,e);if(p.length==0)break;i.push({set:new Set(p),node:t()})}i.sort((p,y)=>y.set.size-p.set.size);let n=r(),a=n%3;n=n/3|0;let f=!!(n&1);n>>=1;let u=n==1,b=n==2;return{branches:i,valid:a,fe0f:f,save:u,check:b}}}function YA(){return jA(BA("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Uf=YA();new Set(vh(Uf)),new Set(vh(Uf)),KA(Uf),JA(Uf);const QA=new Uint8Array(32);QA.fill(0);const XA=`Ethereum Signed Message: -`;function Jb(r){return typeof r=="string"&&(r=Al(r)),kd(SA([Al(XA),Al(String(r.length)),r]))}const ZA="address/5.7.0",ic=new Or(ZA);function X1(r){_i(r,20)||ic.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const e=r.substring(2).split(""),t=new Uint8Array(40);for(let n=0;n<40;n++)t[n]=e[n].charCodeAt(0);const i=ir(kd(t));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(i[n>>1]&15)>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}const eE=9007199254740991;function tE(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const Hd={};for(let r=0;r<10;r++)Hd[String(r)]=String(r);for(let r=0;r<26;r++)Hd[String.fromCharCode(65+r)]=String(10+r);const Z1=Math.floor(tE(eE));function rE(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let e=r.split("").map(i=>Hd[i]).join("");for(;e.length>=Z1;){let i=e.substring(0,Z1);e=parseInt(i,10)%97+e.substring(i.length)}let t=String(98-parseInt(e,10)%97);for(;t.length<2;)t="0"+t;return t}function iE(r){let e=null;if(typeof r!="string"&&ic.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),e=X1(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==r&&ic.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==rE(r)&&ic.throwArgumentError("bad icap checksum","address",r),e=TA(r.substring(4));e.length<40;)e="0"+e;e=X1("0x"+e)}else ic.throwArgumentError("invalid address","address",r);return e}function Go(r,e,t){Object.defineProperty(r,e,{enumerable:!0,value:t,writable:!1})}const nE=new Uint8Array(32);nE.fill(0),Gt.from(-1);const sE=Gt.from(0),aE=Gt.from(1);Gt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Cn(aE.toHexString(),32),Cn(sE.toHexString(),32);var xn={},Rt={},Mc=Yb;function Yb(r,e){if(!r)throw new Error(e||"Assertion failed")}Yb.equal=function(r,e,t){if(r!=e)throw new Error(t||"Assertion failed: "+r+" != "+e)};var od={exports:{}};typeof Object.create=="function"?od.exports=function(r,e){e&&(r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:od.exports=function(r,e){if(e){r.super_=e;var t=function(){};t.prototype=e.prototype,r.prototype=new t,r.prototype.constructor=r}};var oE=Mc,cE=od.exports;Rt.inherits=cE;function fE(r,e){return(r.charCodeAt(e)&64512)!==55296||e<0||e+1>=r.length?!1:(r.charCodeAt(e+1)&64512)===56320}function hE(r,e){if(Array.isArray(r))return r.slice();if(!r)return[];var t=[];if(typeof r=="string")if(e){if(e==="hex")for(r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r),n=0;n>6|192,t[i++]=a&63|128):fE(r,n)?(a=65536+((a&1023)<<10)+(r.charCodeAt(++n)&1023),t[i++]=a>>18|240,t[i++]=a>>12&63|128,t[i++]=a>>6&63|128,t[i++]=a&63|128):(t[i++]=a>>12|224,t[i++]=a>>6&63|128,t[i++]=a&63|128)}else for(n=0;n>>24|r>>>8&65280|r<<8&16711680|(r&255)<<24;return e>>>0}Rt.htonl=Qb;function lE(r,e){for(var t="",i=0;i>>0}return a}Rt.join32=dE;function pE(r,e){for(var t=new Array(r.length*4),i=0,n=0;i>>24,t[n+1]=a>>>16&255,t[n+2]=a>>>8&255,t[n+3]=a&255):(t[n+3]=a>>>24,t[n+2]=a>>>16&255,t[n+1]=a>>>8&255,t[n]=a&255)}return t}Rt.split32=pE;function gE(r,e){return r>>>e|r<<32-e}Rt.rotr32=gE;function vE(r,e){return r<>>32-e}Rt.rotl32=vE;function bE(r,e){return r+e>>>0}Rt.sum32=bE;function mE(r,e,t){return r+e+t>>>0}Rt.sum32_3=mE;function yE(r,e,t,i){return r+e+t+i>>>0}Rt.sum32_4=yE;function wE(r,e,t,i,n){return r+e+t+i+n>>>0}Rt.sum32_5=wE;function _E(r,e,t,i){var n=r[e],a=r[e+1],f=i+a>>>0,u=(f>>0,r[e+1]=f}Rt.sum64=_E;function AE(r,e,t,i){var n=e+i>>>0,a=(n>>0}Rt.sum64_hi=AE;function EE(r,e,t,i){var n=e+i;return n>>>0}Rt.sum64_lo=EE;function xE(r,e,t,i,n,a,f,u){var b=0,p=e;p=p+i>>>0,b+=p>>0,b+=p>>0,b+=p>>0}Rt.sum64_4_hi=xE;function SE(r,e,t,i,n,a,f,u){var b=e+i+a+u;return b>>>0}Rt.sum64_4_lo=SE;function IE(r,e,t,i,n,a,f,u,b,p){var y=0,A=e;A=A+i>>>0,y+=A>>0,y+=A>>0,y+=A>>0,y+=A>>0}Rt.sum64_5_hi=IE;function ME(r,e,t,i,n,a,f,u,b,p){var y=e+i+a+u+p;return y>>>0}Rt.sum64_5_lo=ME;function PE(r,e,t){var i=e<<32-t|r>>>t;return i>>>0}Rt.rotr64_hi=PE;function OE(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Rt.rotr64_lo=OE;function RE(r,e,t){return r>>>t}Rt.shr64_hi=RE;function NE(r,e,t){var i=r<<32-t|e>>>t;return i>>>0}Rt.shr64_lo=NE;var mo={},eg=Rt,TE=Mc;function $f(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}mo.BlockHash=$f,$f.prototype.update=function(r,e){if(r=eg.toArray(r,e),this.pending?this.pending=this.pending.concat(r):this.pending=r,this.pendingTotal+=r.length,this.pending.length>=this._delta8){r=this.pending;var t=r.length%this._delta8;this.pending=r.slice(r.length-t,r.length),this.pending.length===0&&(this.pending=null),r=eg.join32(r,0,r.length-t,this.endian);for(var i=0;i>>24&255,i[n++]=r>>>16&255,i[n++]=r>>>8&255,i[n++]=r&255}else for(i[n++]=r&255,i[n++]=r>>>8&255,i[n++]=r>>>16&255,i[n++]=r>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;a>>3}Kn.g0_256=BE;function UE(r){return Dn(r,17)^Dn(r,19)^r>>>10}Kn.g1_256=UE;var ao=Rt,$E=mo,zE=Kn,xl=ao.rotl32,Wo=ao.sum32,jE=ao.sum32_5,kE=zE.ft_1,im=$E.BlockHash,FE=[1518500249,1859775393,2400959708,3395469782];function Pn(){if(!(this instanceof Pn))return new Pn;im.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}ao.inherits(Pn,im);var HE=Pn;Pn.blockSize=512,Pn.outSize=160,Pn.hmacStrength=80,Pn.padLength=64,Pn.prototype._update=function(r,e){for(var t=this.W,i=0;i<16;i++)t[i]=r[e+i];for(;ithis.blockSize&&(r=new this.Hash().update(r).digest()),Nx(r.length<=this.blockSize);for(var e=r.length;e>8,R=y&255;A?b.push(A,R):b.push(R)}return b}t.toArray=i;function n(f){return f.length===1?"0"+f:f}t.zero2=n;function a(f){for(var u="",b=0;b(R>>1)-1?K=(R>>1)-W:K=W,O.isubn(K)):K=0,A[N]=K,O.iushrn(1)}return A}t.getNAF=i;function n(b,p){var y=[[],[]];b=b.clone(),p=p.clone();for(var A=0,R=0,O;b.cmpn(-A)>0||p.cmpn(-R)>0;){var N=b.andln(3)+A&3,K=p.andln(3)+R&3;N===3&&(N=-1),K===3&&(K=-1);var W;N&1?(O=b.andln(7)+A&7,(O===3||O===5)&&K===2?W=-N:W=N):W=0,y[0].push(W);var Q;K&1?(O=p.andln(7)+R&7,(O===3||O===5)&&N===2?Q=-K:Q=K):Q=0,y[1].push(Q),2*A===W+1&&(A=1-A),2*R===Q+1&&(R=1-R),b.iushrn(1),p.iushrn(1)}return y}t.getJSF=n;function a(b,p,y){var A="_"+p;b.prototype[p]=function(){return this[A]!==void 0?this[A]:this[A]=y.call(this)}}t.cachedProperty=a;function f(b){return typeof b=="string"?t.toArray(b,"hex"):b}t.parseBytes=f;function u(b){return new vt(b,"hex","le")}t.intFromLE=u}),jf=Ai.getNAF,Dx=Ai.getJSF,bh=Ai.assert;function Ts(r,e){this.type=r,this.p=new vt(e.p,16),this.red=e.prime?vt.red(e.prime):vt.mont(this.p),this.zero=new vt(0).toRed(this.red),this.one=new vt(1).toRed(this.red),this.two=new vt(2).toRed(this.red),this.n=e.n&&new vt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var _a=Ts;Ts.prototype.point=function(){throw new Error("Not implemented")},Ts.prototype.validate=function(){throw new Error("Not implemented")},Ts.prototype._fixedNafMul=function(r,e){bh(r.precomputed);var t=r._getDoubles(),i=jf(e,1,this._bitLength),n=(1<=f;b--)u=(u<<1)+i[b];a.push(u)}for(var p=this.jpoint(null,null,null),y=this.jpoint(null,null,null),A=n;A>0;A--){for(f=0;f=0;u--){for(var b=0;u>=0&&a[u]===0;u--)b++;if(u>=0&&b++,f=f.dblp(b),u<0)break;var p=a[u];bh(p!==0),r.type==="affine"?p>0?f=f.mixedAdd(n[p-1>>1]):f=f.mixedAdd(n[-p-1>>1].neg()):p>0?f=f.add(n[p-1>>1]):f=f.add(n[-p-1>>1].neg())}return r.type==="affine"?f.toP():f},Ts.prototype._wnafMulAdd=function(r,e,t,i,n){var a=this._wnafT1,f=this._wnafT2,u=this._wnafT3,b=0,p,y,A;for(p=0;p=1;p-=2){var O=p-1,N=p;if(a[O]!==1||a[N]!==1){u[O]=jf(t[O],a[O],this._bitLength),u[N]=jf(t[N],a[N],this._bitLength),b=Math.max(u[O].length,b),b=Math.max(u[N].length,b);continue}var K=[e[O],null,null,e[N]];e[O].y.cmp(e[N].y)===0?(K[1]=e[O].add(e[N]),K[2]=e[O].toJ().mixedAdd(e[N].neg())):e[O].y.cmp(e[N].y.redNeg())===0?(K[1]=e[O].toJ().mixedAdd(e[N]),K[2]=e[O].add(e[N].neg())):(K[1]=e[O].toJ().mixedAdd(e[N]),K[2]=e[O].toJ().mixedAdd(e[N].neg()));var W=[-3,-1,-5,-7,0,7,5,1,3],Q=Dx(t[O],t[N]);for(b=Math.max(Q[0].length,b),u[O]=new Array(b),u[N]=new Array(b),y=0;y=0;p--){for(var G=0;p>=0;){var x=!0;for(y=0;y=0&&G++,$=$.dblp(G),p<0)break;for(y=0;y0?A=f[y][q-1>>1]:q<0&&(A=f[y][-q-1>>1].neg()),A.type==="affine"?$=$.mixedAdd(A):$=$.add(A))}}for(p=0;p=Math.ceil((r.bitLength()+1)/e.step):!1},qi.prototype._getDoubles=function(r,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],i=this,n=0;n=0&&(R=b,O=p),y.negative&&(y=y.neg(),A=A.neg()),R.negative&&(R=R.neg(),O=O.neg()),[{a:y,b:A},{a:R,b:O}]},ji.prototype._endoSplit=function(r){var e=this.endo.basis,t=e[0],i=e[1],n=i.b.mul(r).divRound(this.n),a=t.b.neg().mul(r).divRound(this.n),f=n.mul(t.a),u=a.mul(i.a),b=n.mul(t.b),p=a.mul(i.b),y=r.sub(f).sub(u),A=b.add(p).neg();return{k1:y,k2:A}},ji.prototype.pointFromX=function(r,e){r=new vt(r,16),r.red||(r=r.toRed(this.red));var t=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),i=t.redSqrt();if(i.redSqr().redSub(t).cmp(this.zero)!==0)throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(r,i)},ji.prototype.validate=function(r){if(r.inf)return!0;var e=r.x,t=r.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return t.redSqr().redISub(n).cmpn(0)===0},ji.prototype._endoWnafMulAdd=function(r,e,t){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},yr.prototype.isInfinity=function(){return this.inf},yr.prototype.add=function(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(this.x.cmp(r.x)===0)return this.curve.point(null,null);var e=this.y.redSub(r.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(r.x).redInvm()));var t=e.redSqr().redISub(this.x).redISub(r.x),i=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,i)},yr.prototype.dbl=function(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(r.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,t=this.x.redSqr(),i=r.redInvm(),n=t.redAdd(t).redIAdd(t).redIAdd(e).redMul(i),a=n.redSqr().redISub(this.x.redAdd(this.x)),f=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,f)},yr.prototype.getX=function(){return this.x.fromRed()},yr.prototype.getY=function(){return this.y.fromRed()},yr.prototype.mul=function(r){return r=new vt(r,16),this.isInfinity()?this:this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)},yr.prototype.mulAdd=function(r,e,t){var i=[this,e],n=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},yr.prototype.jmulAdd=function(r,e,t){var i=[this,e],n=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},yr.prototype.eq=function(r){return this===r||this.inf===r.inf&&(this.inf||this.x.cmp(r.x)===0&&this.y.cmp(r.y)===0)},yr.prototype.neg=function(r){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var t=this.precomputed,i=function(n){return n.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e},yr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var r=this.curve.jpoint(this.x,this.y,this.curve.one);return r};function Pr(r,e,t,i){_a.BasePoint.call(this,r,"jacobian"),e===null&&t===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new vt(0)):(this.x=new vt(e,16),this.y=new vt(t,16),this.z=new vt(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Vd(Pr,_a.BasePoint),ji.prototype.jpoint=function(r,e,t){return new Pr(this,r,e,t)},Pr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),e=r.redSqr(),t=this.x.redMul(e),i=this.y.redMul(e).redMul(r);return this.curve.point(t,i)},Pr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Pr.prototype.add=function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var e=r.z.redSqr(),t=this.z.redSqr(),i=this.x.redMul(e),n=r.x.redMul(t),a=this.y.redMul(e.redMul(r.z)),f=r.y.redMul(t.redMul(this.z)),u=i.redSub(n),b=a.redSub(f);if(u.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=u.redSqr(),y=p.redMul(u),A=i.redMul(p),R=b.redSqr().redIAdd(y).redISub(A).redISub(A),O=b.redMul(A.redISub(R)).redISub(a.redMul(y)),N=this.z.redMul(r.z).redMul(u);return this.curve.jpoint(R,O,N)},Pr.prototype.mixedAdd=function(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var e=this.z.redSqr(),t=this.x,i=r.x.redMul(e),n=this.y,a=r.y.redMul(e).redMul(this.z),f=t.redSub(i),u=n.redSub(a);if(f.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var b=f.redSqr(),p=b.redMul(f),y=t.redMul(b),A=u.redSqr().redIAdd(p).redISub(y).redISub(y),R=u.redMul(y.redISub(A)).redISub(n.redMul(p)),O=this.z.redMul(f);return this.curve.jpoint(A,R,O)},Pr.prototype.dblp=function(r){if(r===0)return this;if(this.isInfinity())return this;if(!r)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var t=this;for(e=0;e=0)return!1;if(t.redIAdd(n),this.x.cmp(t)===0)return!0}},Pr.prototype.inspect=function(){return this.isInfinity()?"":""},Pr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Zf=wo(function(r,e){var t=e;t.base=_a,t.short=qx,t.mont=null,t.edwards=null}),eh=wo(function(r,e){var t=e,i=Ai.assert;function n(u){u.type==="short"?this.curve=new Zf.short(u):u.type==="edwards"?this.curve=new Zf.edwards(u):this.curve=new Zf.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=n;function a(u,b){Object.defineProperty(t,u,{configurable:!0,enumerable:!0,get:function(){var p=new n(b);return Object.defineProperty(t,u,{configurable:!0,enumerable:!0,value:p}),p}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:xn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:xn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:xn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:xn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:xn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:xn.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:xn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var f;try{f=null.crash()}catch{f=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:xn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",f]})});function Cs(r){if(!(this instanceof Cs))return new Cs(r);this.hash=r.hash,this.predResist=!!r.predResist,this.outLen=this.hash.outSize,this.minEntropy=r.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=un.toArray(r.entropy,r.entropyEnc||"hex"),t=un.toArray(r.nonce,r.nonceEnc||"hex"),i=un.toArray(r.pers,r.persEnc||"hex");Kd(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,t,i)}var ng=Cs;Cs.prototype._init=function(r,e,t){var i=r.concat(e).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(r.concat(t||[])),this._reseed=1},Cs.prototype.generate=function(r,e,t,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(i=t,t=e,e=null),t&&(t=un.toArray(t,i||"hex"),this._update(t));for(var n=[];n.length"};var Bx=Ai.assert;function kh(r,e){if(r instanceof kh)return r;this._importDER(r,e)||(Bx(r.r&&r.s,"Signature without r or s"),this.r=new vt(r.r,16),this.s=new vt(r.s,16),r.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}var kf=kh;function Ux(){this.place=0}function Ol(r,e){var t=r[e.place++];if(!(t&128))return t;var i=t&15;if(i===0||i>4)return!1;for(var n=0,a=0,f=e.place;a>>=0;return n<=127?!1:(e.place=f,n)}function sg(r){for(var e=0,t=r.length-1;!r[e]&&!(r[e+1]&128)&&e>>3);for(r.push(t|128);--t;)r.push(e>>>(t<<3)&255);r.push(e)}kh.prototype.toDER=function(r){var e=this.r.toArray(),t=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),t[0]&128&&(t=[0].concat(t)),e=sg(e),t=sg(t);!t[0]&&!(t[1]&128);)t=t.slice(1);var i=[2];Rl(i,e.length),i=i.concat(e),i.push(2),Rl(i,t.length);var n=i.concat(t),a=[48];return Rl(a,n.length),a=a.concat(n),Ai.encode(a,r)};var $x=function(){throw new Error("unsupported")},gm=Ai.assert;function $i(r){if(!(this instanceof $i))return new $i(r);typeof r=="string"&&(gm(Object.prototype.hasOwnProperty.call(eh,r),"Unknown curve "+r),r=eh[r]),r instanceof eh.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}var zx=$i;$i.prototype.keyPair=function(r){return new Pl(this,r)},$i.prototype.keyFromPrivate=function(r,e){return Pl.fromPrivate(this,r,e)},$i.prototype.keyFromPublic=function(r,e){return Pl.fromPublic(this,r,e)},$i.prototype.genKeyPair=function(r){r||(r={});for(var e=new ng({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||$x(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),i=this.n.sub(new vt(2));;){var n=new vt(e.generate(t));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},$i.prototype._truncateToN=function(r,e){var t=r.byteLength()*8-this.n.bitLength();return t>0&&(r=r.ushrn(t)),!e&&r.cmp(this.n)>=0?r.sub(this.n):r},$i.prototype.sign=function(r,e,t,i){typeof t=="object"&&(i=t,t=null),i||(i={}),e=this.keyFromPrivate(e,t),r=this._truncateToN(new vt(r,16));for(var n=this.n.byteLength(),a=e.getPrivate().toArray("be",n),f=r.toArray("be",n),u=new ng({hash:this.hash,entropy:a,nonce:f,pers:i.pers,persEnc:i.persEnc||"utf8"}),b=this.n.sub(new vt(1)),p=0;;p++){var y=i.k?i.k(p):new vt(u.generate(this.n.byteLength()));if(y=this._truncateToN(y,!0),!(y.cmpn(1)<=0||y.cmp(b)>=0)){var A=this.g.mul(y);if(!A.isInfinity()){var R=A.getX(),O=R.umod(this.n);if(O.cmpn(0)!==0){var N=y.invm(this.n).mul(O.mul(e.getPrivate()).iadd(r));if(N=N.umod(this.n),N.cmpn(0)!==0){var K=(A.getY().isOdd()?1:0)|(R.cmp(O)!==0?2:0);return i.canonical&&N.cmp(this.nh)>0&&(N=this.n.sub(N),K^=1),new kf({r:O,s:N,recoveryParam:K})}}}}}},$i.prototype.verify=function(r,e,t,i){r=this._truncateToN(new vt(r,16)),t=this.keyFromPublic(t,i),e=new kf(e,"hex");var n=e.r,a=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var f=a.invm(this.n),u=f.mul(r).umod(this.n),b=f.mul(n).umod(this.n),p;return this.curve._maxwellTrick?(p=this.g.jmulAdd(u,t.getPublic(),b),p.isInfinity()?!1:p.eqXToP(n)):(p=this.g.mulAdd(u,t.getPublic(),b),p.isInfinity()?!1:p.getX().umod(this.n).cmp(n)===0)},$i.prototype.recoverPubKey=function(r,e,t,i){gm((3&t)===t,"The recovery param is more than two bits"),e=new kf(e,i);var n=this.n,a=new vt(r),f=e.r,u=e.s,b=t&1,p=t>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?f=this.curve.pointFromX(f.add(this.curve.n),b):f=this.curve.pointFromX(f,b);var y=e.r.invm(n),A=n.sub(a).mul(y).umod(n),R=u.mul(y).umod(n);return this.g.mulAdd(A,f,R)},$i.prototype.getKeyRecoveryParam=function(r,e,t,i){if(e=new kf(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var a;try{a=this.recoverPubKey(r,e,n)}catch{continue}if(a.eq(t))return n}throw new Error("Unable to find valid recovery factor")};var jx=wo(function(r,e){var t=e;t.version="6.5.4",t.utils=Ai,t.rand=function(){throw new Error("unsupported")},t.curve=Zf,t.curves=eh,t.ec=zx,t.eddsa=null}),kx=jx.ec;const Fx="signing-key/5.7.0",hd=new Or(Fx);let Nl=null;function Rs(){return Nl||(Nl=new kx("secp256k1")),Nl}class Hx{constructor(e){Go(this,"curve","secp256k1"),Go(this,"privateKey",ci(e)),MA(this.privateKey)!==32&&hd.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Rs().keyFromPrivate(ir(this.privateKey));Go(this,"publicKey","0x"+t.getPublic(!1,"hex")),Go(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Go(this,"_isSigningKey",!0)}_addPoint(e){const t=Rs().keyFromPublic(ir(this.publicKey)),i=Rs().keyFromPublic(ir(e));return"0x"+t.pub.add(i.pub).encodeCompressed("hex")}signDigest(e){const t=Rs().keyFromPrivate(ir(this.privateKey)),i=ir(e);i.length!==32&&hd.throwArgumentError("bad digest length","digest",e);const n=t.sign(i,{canonical:!0});return zb({recoveryParam:n.recoveryParam,r:Cn("0x"+n.r.toString(16),32),s:Cn("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=Rs().keyFromPrivate(ir(this.privateKey)),i=Rs().keyFromPublic(ir(vm(e)));return Cn("0x"+t.derive(i.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function Kx(r,e){const t=zb(e),i={r:ir(t.r),s:ir(t.s)};return"0x"+Rs().recoverPubKey(ir(r),i,t.recoveryParam).encode("hex",!1)}function vm(r,e){const t=ir(r);return t.length===32?new Hx(t).publicKey:t.length===33?"0x"+Rs().keyFromPublic(t).getPublic(!1,"hex"):t.length===65?ci(t):hd.throwArgumentError("invalid public or private key","key","[REDACTED]")}var ag;(function(r){r[r.legacy=0]="legacy",r[r.eip2930=1]="eip2930",r[r.eip1559=2]="eip1559"})(ag||(ag={}));function Vx(r){const e=vm(r);return iE(K1(kd(K1(e,1)),12))}function Gx(r,e){return Vx(Kx(ir(r),e))}const Wx="https://rpc.walletconnect.org/v1";async function Jx(r,e,t,i,n,a){switch(t.t){case"eip191":return Yx(r,e,t.s);case"eip1271":return await Qx(r,e,t.s,i,n,a);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${t.t}`)}}function Yx(r,e,t){return Gx(Jb(e),t).toLowerCase()===r.toLowerCase()}async function Qx(r,e,t,i,n,a){try{const f="0x1626ba7e",u="0000000000000000000000000000000000000000000000000000000000000040",b="0000000000000000000000000000000000000000000000000000000000000041",p=t.substring(2),y=Jb(e).substring(2),A=f+y+u+b+p,R=await fetch(`${a||Wx}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:Xx(),jsonrpc:"2.0",method:"eth_call",params:[{to:r,data:A},"latest"]})}),{result:O}=await R.json();return O?O.slice(0,f.length).toLowerCase()===f.toLowerCase():!1}catch(f){return console.error("isValidEip1271Signature: ",f),!1}}function Xx(){return Date.now()+Math.floor(Math.random()*1e3)}var Zx=Object.defineProperty,eS=Object.defineProperties,tS=Object.getOwnPropertyDescriptors,og=Object.getOwnPropertySymbols,rS=Object.prototype.hasOwnProperty,iS=Object.prototype.propertyIsEnumerable,cg=(r,e,t)=>e in r?Zx(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,nS=(r,e)=>{for(var t in e||(e={}))rS.call(e,t)&&cg(r,t,e[t]);if(og)for(var t of og(e))iS.call(e,t)&&cg(r,t,e[t]);return r},sS=(r,e)=>eS(r,tS(e));const aS="did:pkh:",Gd=r=>r==null?void 0:r.split(":"),bm=r=>{const e=r&&Gd(r);if(e)return r.includes(aS)?e[3]:e[1]},fg=r=>{const e=r&&Gd(r);if(e)return e[2]+":"+e[3]},mh=r=>{const e=r&&Gd(r);if(e)return e.pop()};async function hg(r){const{cacao:e,projectId:t}=r,{s:i,p:n}=e,a=mm(n,n.iss),f=mh(n.iss);return await Jx(f,a,i,bm(n.iss),t)}const mm=(r,e)=>{const t=`${r.domain} wants you to sign in with your Ethereum account:`,i=mh(e);if(!r.aud&&!r.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=r.statement||void 0;const a=`URI: ${r.aud||r.uri}`,f=`Version: ${r.version}`,u=`Chain ID: ${bm(e)}`,b=`Nonce: ${r.nonce}`,p=`Issued At: ${r.iat}`,y=r.exp?`Expiration Time: ${r.exp}`:void 0,A=r.nbf?`Not Before: ${r.nbf}`:void 0,R=r.requestId?`Request ID: ${r.requestId}`:void 0,O=r.resources?`Resources:${r.resources.map(K=>` -- ${K}`).join("")}`:void 0,N=th(r.resources);if(N){const K=gc(N);n=gS(n,K)}return[t,i,"",n,"",a,f,u,b,p,y,A,R,O].filter(K=>K!=null).join(` -`)};function oS(r){return Buffer.from(JSON.stringify(r)).toString("base64")}function cS(r){return JSON.parse(Buffer.from(r,"base64").toString("utf-8"))}function va(r){if(!r)throw new Error("No recap provided, value is undefined");if(!r.att)throw new Error("No `att` property found");const e=Object.keys(r.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(t=>{const i=r.att[t];if(Array.isArray(i))throw new Error(`Resource must be an object: ${t}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${t}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${t}`);Object.keys(i).forEach(n=>{const a=i[n];if(!Array.isArray(a))throw new Error(`Ability limits ${n} must be an array of objects, found: ${a}`);if(!a.length)throw new Error(`Value of ${n} is empty array, must be an array with objects`);a.forEach(f=>{if(typeof f!="object")throw new Error(`Ability limits (${n}) must be an array of objects, found: ${f}`)})})})}function fS(r,e,t,i={}){return t==null||t.sort((n,a)=>n.localeCompare(a)),{att:{[r]:hS(e,t,i)}}}function hS(r,e,t={}){e=e==null?void 0:e.sort((n,a)=>n.localeCompare(a));const i=e.map(n=>({[`${r}/${n}`]:[t]}));return Object.assign({},...i)}function ym(r){return va(r),`urn:recap:${oS(r).replace(/=/g,"")}`}function gc(r){const e=cS(r.replace("urn:recap:",""));return va(e),e}function uS(r,e,t){const i=fS(r,e,t);return ym(i)}function lS(r){return r&&r.includes("urn:recap:")}function dS(r,e){const t=gc(r),i=gc(e),n=pS(t,i);return ym(n)}function pS(r,e){va(r),va(e);const t=Object.keys(r.att).concat(Object.keys(e.att)).sort((n,a)=>n.localeCompare(a)),i={att:{}};return t.forEach(n=>{var a,f;Object.keys(((a=r.att)==null?void 0:a[n])||{}).concat(Object.keys(((f=e.att)==null?void 0:f[n])||{})).sort((u,b)=>u.localeCompare(b)).forEach(u=>{var b,p;i.att[n]=sS(nS({},i.att[n]),{[u]:((b=r.att[n])==null?void 0:b[u])||((p=e.att[n])==null?void 0:p[u])})})}),i}function gS(r="",e){va(e);const t="I further authorize the stated URI to perform the following actions on my behalf: ";if(r.includes(t))return r;const i=[];let n=0;Object.keys(e.att).forEach(u=>{const b=Object.keys(e.att[u]).map(A=>({ability:A.split("/")[0],action:A.split("/")[1]}));b.sort((A,R)=>A.action.localeCompare(R.action));const p={};b.forEach(A=>{p[A.ability]||(p[A.ability]=[]),p[A.ability].push(A.action)});const y=Object.keys(p).map(A=>(n++,`(${n}) '${A}': '${p[A].join("', '")}' for '${u}'.`));i.push(y.join(", ").replace(".,","."))});const a=i.join(" "),f=`${t}${a}`;return`${r?r+" ":""}${f}`}function ug(r){var e;const t=gc(r);va(t);const i=(e=t.att)==null?void 0:e.eip155;return i?Object.keys(i).map(n=>n.split("/")[1]):[]}function lg(r){const e=gc(r);va(e);const t=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(n=>{var a;(a=n==null?void 0:n[0])!=null&&a.chains&&t.push(n[0].chains)})}),[...new Set(t.flat())]}function th(r){if(!r)return;const e=r==null?void 0:r[r.length-1];return lS(e)?e:void 0}const wm="base10",Jr="base16",Ls="base64pad",Yo="base64url",Pc="utf8",_m=0,ls=1,Oc=2,vS=0,dg=1,fc=12,Wd=32;function bS(){const r=Td.generateKeyPair();return{privateKey:Er(r.secretKey,Jr),publicKey:Er(r.publicKey,Jr)}}function ud(){const r=$s.randomBytes(Wd);return Er(r,Jr)}function mS(r,e){const t=Td.sharedKey(Ar(r,Jr),Ar(e,Jr),!0),i=new p_(Ac.SHA256,t).expand(Wd);return Er(i,Jr)}function rh(r){const e=Ac.hash(Ar(r,Jr));return Er(e,Jr)}function cs(r){const e=Ac.hash(Ar(r,Pc));return Er(e,Jr)}function Am(r){return Ar(`${r}`,wm)}function ba(r){return Number(Er(r,wm))}function yS(r){const e=Am(typeof r.type<"u"?r.type:_m);if(ba(e)===ls&&typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const t=typeof r.senderPublicKey<"u"?Ar(r.senderPublicKey,Jr):void 0,i=typeof r.iv<"u"?Ar(r.iv,Jr):$s.randomBytes(fc),n=new Rd.ChaCha20Poly1305(Ar(r.symKey,Jr)).seal(i,Ar(r.message,Pc));return Em({type:e,sealed:n,iv:i,senderPublicKey:t,encoding:r.encoding})}function wS(r,e){const t=Am(Oc),i=$s.randomBytes(fc),n=Ar(r,Pc);return Em({type:t,sealed:n,iv:i,encoding:e})}function _S(r){const e=new Rd.ChaCha20Poly1305(Ar(r.symKey,Jr)),{sealed:t,iv:i}=vc({encoded:r.encoded,encoding:r==null?void 0:r.encoding}),n=e.open(i,t);if(n===null)throw new Error("Failed to decrypt");return Er(n,Pc)}function AS(r,e){const{sealed:t}=vc({encoded:r,encoding:e});return Er(t,Pc)}function Em(r){const{encoding:e=Ls}=r;if(ba(r.type)===Oc)return Er(Yf([r.type,r.sealed]),e);if(ba(r.type)===ls){if(typeof r.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return Er(Yf([r.type,r.senderPublicKey,r.iv,r.sealed]),e)}return Er(Yf([r.type,r.iv,r.sealed]),e)}function vc(r){const{encoded:e,encoding:t=Ls}=r,i=Ar(e,t),n=i.slice(vS,dg),a=dg;if(ba(n)===ls){const p=a+Wd,y=p+fc,A=i.slice(a,p),R=i.slice(p,y),O=i.slice(y);return{type:n,sealed:O,iv:R,senderPublicKey:A}}if(ba(n)===Oc){const p=i.slice(a),y=$s.randomBytes(fc);return{type:n,sealed:p,iv:y}}const f=a+fc,u=i.slice(a,f),b=i.slice(f);return{type:n,sealed:b,iv:u}}function ES(r,e){const t=vc({encoded:r,encoding:e==null?void 0:e.encoding});return xm({type:ba(t.type),senderPublicKey:typeof t.senderPublicKey<"u"?Er(t.senderPublicKey,Jr):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function xm(r){const e=(r==null?void 0:r.type)||_m;if(e===ls){if(typeof(r==null?void 0:r.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(r==null?void 0:r.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:r==null?void 0:r.senderPublicKey,receiverPublicKey:r==null?void 0:r.receiverPublicKey}}function pg(r){return r.type===ls&&typeof r.senderPublicKey=="string"&&typeof r.receiverPublicKey=="string"}function gg(r){return r.type===Oc}function xS(r){return new Qv.ec("p256").keyFromPublic({x:Buffer.from(r.x,"base64").toString("hex"),y:Buffer.from(r.y,"base64").toString("hex")},"hex")}function SS(r){let e=r.replace(/-/g,"+").replace(/_/g,"/");const t=e.length%4;return t>0&&(e+="=".repeat(4-t)),e}function IS(r){return Buffer.from(SS(r),"base64")}function MS(r,e){const[t,i,n]=r.split("."),a=IS(n);if(a.length!==64)throw new Error("Invalid signature length");const f=a.slice(0,32).toString("hex"),u=a.slice(32,64).toString("hex"),b=`${t}.${i}`,p=new Ac.SHA256().update(Buffer.from(b)).digest(),y=xS(e),A=Buffer.from(p).toString("hex");if(!y.verify(A,{r:f,s:u}))throw new Error("Invalid signature");return nd(r).payload}const PS="irn";function ld(r){return(r==null?void 0:r.relay)||{protocol:PS}}function nc(r){const e=Z9[r];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${r}`);return e}var OS=Object.defineProperty,RS=Object.defineProperties,NS=Object.getOwnPropertyDescriptors,vg=Object.getOwnPropertySymbols,TS=Object.prototype.hasOwnProperty,CS=Object.prototype.propertyIsEnumerable,bg=(r,e,t)=>e in r?OS(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,mg=(r,e)=>{for(var t in e||(e={}))TS.call(e,t)&&bg(r,t,e[t]);if(vg)for(var t of vg(e))CS.call(e,t)&&bg(r,t,e[t]);return r},DS=(r,e)=>RS(r,NS(e));function LS(r,e="-"){const t={},i="relay"+e;return Object.keys(r).forEach(n=>{if(n.startsWith(i)){const a=n.replace(i,""),f=r[n];t[a]=f}}),t}function yg(r){if(!r.includes("wc:")){const b=qb(r);b!=null&&b.includes("wc:")&&(r=b)}r=r.includes("wc://")?r.replace("wc://",""):r,r=r.includes("wc:")?r.replace("wc:",""):r;const e=r.indexOf(":"),t=r.indexOf("?")!==-1?r.indexOf("?"):void 0,i=r.substring(0,e),n=r.substring(e+1,t).split("@"),a=typeof t<"u"?r.substring(t):"",f=dc.parse(a),u=typeof f.methods=="string"?f.methods.split(","):void 0;return{protocol:i,topic:qS(n[0]),version:parseInt(n[1],10),symKey:f.symKey,relay:LS(f),methods:u,expiryTimestamp:f.expiryTimestamp?parseInt(f.expiryTimestamp,10):void 0}}function qS(r){return r.startsWith("//")?r.substring(2):r}function BS(r,e="-"){const t="relay",i={};return Object.keys(r).forEach(n=>{const a=t+e+n;r[n]&&(i[a]=r[n])}),i}function wg(r){return`${r.protocol}:${r.topic}@${r.version}?`+dc.stringify(mg(DS(mg({symKey:r.symKey},BS(r.relay)),{expiryTimestamp:r.expiryTimestamp}),r.methods?{methods:r.methods.join(",")}:{}))}function Ff(r,e,t){return`${r}?wc_ev=${t}&topic=${e}`}function _o(r){const e=[];return r.forEach(t=>{const[i,n]=t.split(":");e.push(`${i}:${n}`)}),e}function US(r){const e=[];return Object.values(r).forEach(t=>{e.push(..._o(t.accounts))}),e}function $S(r,e){const t=[];return Object.values(r).forEach(i=>{_o(i.accounts).includes(e)&&t.push(...i.methods)}),t}function zS(r,e){const t=[];return Object.values(r).forEach(i=>{_o(i.accounts).includes(e)&&t.push(...i.events)}),t}function Jd(r){return r.includes(":")}function sc(r){return Jd(r)?r.split(":")[0]:r}function jS(r){const e={};return r==null||r.forEach(t=>{const[i,n]=t.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[]}),e[i].accounts.push(t),e[i].chains.push(`${i}:${n}`)}),e}function _g(r,e){e=e.map(i=>i.replace("did:pkh:",""));const t=jS(e);for(const[i,n]of Object.entries(t))n.methods?n.methods=Qf(n.methods,r):n.methods=r,n.events=["chainChanged","accountsChanged"];return t}const kS={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},FS={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Ae(r,e){const{message:t,code:i}=FS[r];return{message:e?`${t} ${e}`:t,code:i}}function $t(r,e){const{message:t,code:i}=kS[r];return{message:e?`${t} ${e}`:t,code:i}}function jn(r,e){return!!Array.isArray(r)}function bc(r){return Object.getPrototypeOf(r)===Object.prototype&&Object.keys(r).length}function fi(r){return typeof r>"u"}function fr(r,e){return e&&fi(r)?!0:typeof r=="string"&&!!r.trim().length}function Yd(r,e){return typeof r=="number"&&!isNaN(r)}function HS(r,e){const{requiredNamespaces:t}=e,i=Object.keys(r.namespaces),n=Object.keys(t);let a=!0;return ca(n,i)?(i.forEach(f=>{const{accounts:u,methods:b,events:p}=r.namespaces[f],y=_o(u),A=t[f];(!ca(Ob(f,A),y)||!ca(A.methods,b)||!ca(A.events,p))&&(a=!1)}),a):!1}function yh(r){return fr(r,!1)&&r.includes(":")?r.split(":").length===2:!1}function KS(r){if(fr(r,!1)&&r.includes(":")){const e=r.split(":");if(e.length===3){const t=e[0]+":"+e[1];return!!e[2]&&yh(t)}}return!1}function VS(r){function e(t){try{return typeof new URL(t)<"u"}catch{return!1}}try{if(fr(r,!1)){if(e(r))return!0;const t=qb(r);return e(t)}}catch{}return!1}function GS(r){var e;return(e=r==null?void 0:r.proposer)==null?void 0:e.publicKey}function WS(r){return r==null?void 0:r.topic}function JS(r,e){let t=null;return fr(r==null?void 0:r.publicKey,!1)||(t=Ae("MISSING_OR_INVALID",`${e} controller public key should be a string`)),t}function Ag(r){let e=!0;return jn(r)?r.length&&(e=r.every(t=>fr(t,!1))):e=!1,e}function YS(r,e,t){let i=null;return jn(e)&&e.length?e.forEach(n=>{i||yh(n)||(i=$t("UNSUPPORTED_CHAINS",`${t}, chain ${n} should be a string and conform to "namespace:chainId" format`))}):yh(r)||(i=$t("UNSUPPORTED_CHAINS",`${t}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}function QS(r,e,t){let i=null;return Object.entries(r).forEach(([n,a])=>{if(i)return;const f=YS(n,Ob(n,a),`${e} ${t}`);f&&(i=f)}),i}function XS(r,e){let t=null;return jn(r)?r.forEach(i=>{t||KS(i)||(t=$t("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):t=$t("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),t}function ZS(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const n=XS(i==null?void 0:i.accounts,`${e} namespace`);n&&(t=n)}),t}function eI(r,e){let t=null;return Ag(r==null?void 0:r.methods)?Ag(r==null?void 0:r.events)||(t=$t("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):t=$t("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),t}function Sm(r,e){let t=null;return Object.values(r).forEach(i=>{if(t)return;const n=eI(i,`${e}, namespace`);n&&(t=n)}),t}function tI(r,e,t){let i=null;if(r&&bc(r)){const n=Sm(r,e);n&&(i=n);const a=QS(r,e,t);a&&(i=a)}else i=Ae("MISSING_OR_INVALID",`${e}, ${t} should be an object with data`);return i}function Tl(r,e){let t=null;if(r&&bc(r)){const i=Sm(r,e);i&&(t=i);const n=ZS(r,e);n&&(t=n)}else t=Ae("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return t}function Im(r){return fr(r.protocol,!0)}function rI(r,e){let t=!1;return r?r&&jn(r)&&r.length&&r.forEach(i=>{t=Im(i)}):t=!0,t}function iI(r){return typeof r=="number"}function oi(r){return typeof r<"u"&&typeof r!==null}function nI(r){return!(!r||typeof r!="object"||!r.code||!Yd(r.code)||!r.message||!fr(r.message,!1))}function sI(r){return!(fi(r)||!fr(r.method,!1))}function aI(r){return!(fi(r)||fi(r.result)&&fi(r.error)||!Yd(r.id)||!fr(r.jsonrpc,!1))}function oI(r){return!(fi(r)||!fr(r.name,!1))}function Eg(r,e){return!(!yh(e)||!US(r).includes(e))}function cI(r,e,t){return fr(t,!1)?$S(r,e).includes(t):!1}function fI(r,e,t){return fr(t,!1)?zS(r,e).includes(t):!1}function xg(r,e,t){let i=null;const n=hI(r),a=uI(e),f=Object.keys(n),u=Object.keys(a),b=Sg(Object.keys(r)),p=Sg(Object.keys(e)),y=b.filter(A=>!p.includes(A));return y.length&&(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces keys don't satisfy requiredNamespaces. - Required: ${y.toString()} - Received: ${Object.keys(e).toString()}`)),ca(f,u)||(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces chains don't satisfy required namespaces. - Required: ${f.toString()} - Approved: ${u.toString()}`)),Object.keys(e).forEach(A=>{if(!A.includes(":")||i)return;const R=_o(e[A].accounts);R.includes(A)||(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces accounts don't satisfy namespace accounts for ${A} - Required: ${A} - Approved: ${R.toString()}`))}),f.forEach(A=>{i||(ca(n[A].methods,a[A].methods)?ca(n[A].events,a[A].events)||(i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces events don't satisfy namespace events for ${A}`)):i=Ae("NON_CONFORMING_NAMESPACES",`${t} namespaces methods don't satisfy namespace methods for ${A}`))}),i}function hI(r){const e={};return Object.keys(r).forEach(t=>{var i;t.includes(":")?e[t]=r[t]:(i=r[t].chains)==null||i.forEach(n=>{e[n]={methods:r[t].methods,events:r[t].events}})}),e}function Sg(r){return[...new Set(r.map(e=>e.includes(":")?e.split(":")[0]:e))]}function uI(r){const e={};return Object.keys(r).forEach(t=>{if(t.includes(":"))e[t]=r[t];else{const i=_o(r[t].accounts);i==null||i.forEach(n=>{e[n]={accounts:r[t].accounts.filter(a=>a.includes(`${n}:`)),methods:r[t].methods,events:r[t].events}})}}),e}function lI(r,e){return Yd(r)&&r<=e.max&&r>=e.min}function Ig(){const r=Ic();return new Promise(e=>{switch(r){case wi.browser:e(dI());break;case wi.reactNative:e(pI());break;case wi.node:e(gI());break;default:e(!0)}})}function dI(){return Sc()&&(navigator==null?void 0:navigator.onLine)}async function pI(){if(vo()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo){const r=await(globalThis==null?void 0:globalThis.NetInfo.fetch());return r==null?void 0:r.isConnected}return!0}function gI(){return!0}function vI(r){switch(Ic()){case wi.browser:bI(r);break;case wi.reactNative:mI(r);break}}function bI(r){!vo()&&Sc()&&(window.addEventListener("online",()=>r(!0)),window.addEventListener("offline",()=>r(!1)))}function mI(r){vo()&&typeof globalThis<"u"&&globalThis!=null&&globalThis.NetInfo&&(globalThis==null||globalThis.NetInfo.addEventListener(e=>r(e==null?void 0:e.isConnected)))}const Cl={};class Qo{static get(e){return Cl[e]}static set(e,t){Cl[e]=t}static delete(e){delete Cl[e]}}class Aa{}let yI=class extends Aa{constructor(e){super()}};const Mg=xe.FIVE_SECONDS,Ao={pulse:"heartbeat_pulse"};let wI=class Mm extends yI{constructor(e){super(e),this.events=new Fi.EventEmitter,this.interval=Mg,this.interval=(e==null?void 0:e.interval)||Mg}static async init(e){const t=new Mm(e);return await t.init(),t}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(),xe.toMiliseconds(this.interval))}pulse(){this.events.emit(Ao.pulse)}};const _I=/"(?:_|\\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*:/,AI=/"(?: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*:/,EI=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function xI(r,e){if(r==="__proto__"||r==="constructor"&&e&&typeof e=="object"&&"prototype"in e){SI(r);return}return e}function SI(r){console.warn(`[destr] Dropping "${r}" key to prevent prototype pollution.`)}function Hf(r,e={}){if(typeof r!="string")return r;const t=r.trim();if(r[0]==='"'&&r.endsWith('"')&&!r.includes("\\"))return t.slice(1,-1);if(t.length<=9){const i=t.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;if(i==="undefined")return;if(i==="null")return null;if(i==="nan")return Number.NaN;if(i==="infinity")return Number.POSITIVE_INFINITY;if(i==="-infinity")return Number.NEGATIVE_INFINITY}if(!EI.test(r)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return r}try{if(_I.test(r)||AI.test(r)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(r,xI)}return JSON.parse(r)}catch(i){if(e.strict)throw i;return r}}function II(r){return!r||typeof r.then!="function"?Promise.resolve(r):r}function _r(r,...e){try{return II(r(...e))}catch(t){return Promise.reject(t)}}function MI(r){const e=typeof r;return r===null||e!=="object"&&e!=="function"}function PI(r){const e=Object.getPrototypeOf(r);return!e||e.isPrototypeOf(Object)}function ih(r){if(MI(r))return String(r);if(PI(r)||Array.isArray(r))return JSON.stringify(r);if(typeof r.toJSON=="function")return ih(r.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function Pm(){if(typeof Buffer>"u")throw new TypeError("[unstorage] Buffer is not supported!")}const dd="base64:";function OI(r){if(typeof r=="string")return r;Pm();const e=Buffer.from(r).toString("base64");return dd+e}function RI(r){return typeof r!="string"||!r.startsWith(dd)?r:(Pm(),Buffer.from(r.slice(dd.length),"base64"))}function ai(r){return r?r.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function NI(...r){return ai(r.join(":"))}function Kf(r){return r=ai(r),r?r+":":""}const TI="memory",CI=()=>{const r=new Map;return{name:TI,getInstance:()=>r,hasItem(e){return r.has(e)},getItem(e){return r.get(e)??null},getItemRaw(e){return r.get(e)??null},setItem(e,t){r.set(e,t)},setItemRaw(e,t){r.set(e,t)},removeItem(e){r.delete(e)},getKeys(){return[...r.keys()]},clear(){r.clear()},dispose(){r.clear()}}};function DI(r={}){const e={mounts:{"":r.driver||CI()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},t=p=>{for(const y of e.mountpoints)if(p.startsWith(y))return{base:y,relativeKey:p.slice(y.length),driver:e.mounts[y]};return{base:"",relativeKey:p,driver:e.mounts[""]}},i=(p,y)=>e.mountpoints.filter(A=>A.startsWith(p)||y&&p.startsWith(A)).map(A=>({relativeBase:p.length>A.length?p.slice(A.length):void 0,mountpoint:A,driver:e.mounts[A]})),n=(p,y)=>{if(e.watching){y=ai(y);for(const A of e.watchListeners)A(p,y)}},a=async()=>{if(!e.watching){e.watching=!0;for(const p in e.mounts)e.unwatch[p]=await Pg(e.mounts[p],n,p)}},f=async()=>{if(e.watching){for(const p in e.unwatch)await e.unwatch[p]();e.unwatch={},e.watching=!1}},u=(p,y,A)=>{const R=new Map,O=N=>{let K=R.get(N.base);return K||(K={driver:N.driver,base:N.base,items:[]},R.set(N.base,K)),K};for(const N of p){const K=typeof N=="string",W=ai(K?N:N.key),Q=K?void 0:N.value,k=K||!N.options?y:{...y,...N.options},Y=t(W);O(Y).items.push({key:W,value:Q,relativeKey:Y.relativeKey,options:k})}return Promise.all([...R.values()].map(N=>A(N))).then(N=>N.flat())},b={hasItem(p,y={}){p=ai(p);const{relativeKey:A,driver:R}=t(p);return _r(R.hasItem,A,y)},getItem(p,y={}){p=ai(p);const{relativeKey:A,driver:R}=t(p);return _r(R.getItem,A,y).then(O=>Hf(O))},getItems(p,y){return u(p,y,A=>A.driver.getItems?_r(A.driver.getItems,A.items.map(R=>({key:R.relativeKey,options:R.options})),y).then(R=>R.map(O=>({key:NI(A.base,O.key),value:Hf(O.value)}))):Promise.all(A.items.map(R=>_r(A.driver.getItem,R.relativeKey,R.options).then(O=>({key:R.key,value:Hf(O)})))))},getItemRaw(p,y={}){p=ai(p);const{relativeKey:A,driver:R}=t(p);return R.getItemRaw?_r(R.getItemRaw,A,y):_r(R.getItem,A,y).then(O=>RI(O))},async setItem(p,y,A={}){if(y===void 0)return b.removeItem(p);p=ai(p);const{relativeKey:R,driver:O}=t(p);O.setItem&&(await _r(O.setItem,R,ih(y),A),O.watch||n("update",p))},async setItems(p,y){await u(p,y,async A=>{if(A.driver.setItems)return _r(A.driver.setItems,A.items.map(R=>({key:R.relativeKey,value:ih(R.value),options:R.options})),y);A.driver.setItem&&await Promise.all(A.items.map(R=>_r(A.driver.setItem,R.relativeKey,ih(R.value),R.options)))})},async setItemRaw(p,y,A={}){if(y===void 0)return b.removeItem(p,A);p=ai(p);const{relativeKey:R,driver:O}=t(p);if(O.setItemRaw)await _r(O.setItemRaw,R,y,A);else if(O.setItem)await _r(O.setItem,R,OI(y),A);else return;O.watch||n("update",p)},async removeItem(p,y={}){typeof y=="boolean"&&(y={removeMeta:y}),p=ai(p);const{relativeKey:A,driver:R}=t(p);R.removeItem&&(await _r(R.removeItem,A,y),(y.removeMeta||y.removeMata)&&await _r(R.removeItem,A+"$",y),R.watch||n("remove",p))},async getMeta(p,y={}){typeof y=="boolean"&&(y={nativeOnly:y}),p=ai(p);const{relativeKey:A,driver:R}=t(p),O=Object.create(null);if(R.getMeta&&Object.assign(O,await _r(R.getMeta,A,y)),!y.nativeOnly){const N=await _r(R.getItem,A+"$",y).then(K=>Hf(K));N&&typeof N=="object"&&(typeof N.atime=="string"&&(N.atime=new Date(N.atime)),typeof N.mtime=="string"&&(N.mtime=new Date(N.mtime)),Object.assign(O,N))}return O},setMeta(p,y,A={}){return this.setItem(p+"$",y,A)},removeMeta(p,y={}){return this.removeItem(p+"$",y)},async getKeys(p,y={}){p=Kf(p);const A=i(p,!0);let R=[];const O=[];for(const N of A){const K=await _r(N.driver.getKeys,N.relativeBase,y);for(const W of K){const Q=N.mountpoint+ai(W);R.some(k=>Q.startsWith(k))||O.push(Q)}R=[N.mountpoint,...R.filter(W=>!W.startsWith(N.mountpoint))]}return p?O.filter(N=>N.startsWith(p)&&N[N.length-1]!=="$"):O.filter(N=>N[N.length-1]!=="$")},async clear(p,y={}){p=Kf(p),await Promise.all(i(p,!1).map(async A=>{if(A.driver.clear)return _r(A.driver.clear,A.relativeBase,y);if(A.driver.removeItem){const R=await A.driver.getKeys(A.relativeBase||"",y);return Promise.all(R.map(O=>A.driver.removeItem(O,y)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(p=>Og(p)))},async watch(p){return await a(),e.watchListeners.push(p),async()=>{e.watchListeners=e.watchListeners.filter(y=>y!==p),e.watchListeners.length===0&&await f()}},async unwatch(){e.watchListeners=[],await f()},mount(p,y){if(p=Kf(p),p&&e.mounts[p])throw new Error(`already mounted at ${p}`);return p&&(e.mountpoints.push(p),e.mountpoints.sort((A,R)=>R.length-A.length)),e.mounts[p]=y,e.watching&&Promise.resolve(Pg(y,n,p)).then(A=>{e.unwatch[p]=A}).catch(console.error),b},async unmount(p,y=!0){p=Kf(p),!(!p||!e.mounts[p])&&(e.watching&&p in e.unwatch&&(e.unwatch[p](),delete e.unwatch[p]),y&&await Og(e.mounts[p]),e.mountpoints=e.mountpoints.filter(A=>A!==p),delete e.mounts[p])},getMount(p=""){p=ai(p)+":";const y=t(p);return{driver:y.driver,base:y.base}},getMounts(p="",y={}){return p=ai(p),i(p,y.parents).map(R=>({driver:R.driver,base:R.mountpoint}))},keys:(p,y={})=>b.getKeys(p,y),get:(p,y={})=>b.getItem(p,y),set:(p,y,A={})=>b.setItem(p,y,A),has:(p,y={})=>b.hasItem(p,y),del:(p,y={})=>b.removeItem(p,y),remove:(p,y={})=>b.removeItem(p,y)};return b}function Pg(r,e,t){return r.watch?r.watch((i,n)=>e(i,t+n)):()=>{}}async function Og(r){typeof r.dispose=="function"&&await _r(r.dispose)}function Ea(r){return new Promise((e,t)=>{r.oncomplete=r.onsuccess=()=>e(r.result),r.onabort=r.onerror=()=>t(r.error)})}function Om(r,e){const t=indexedDB.open(r);t.onupgradeneeded=()=>t.result.createObjectStore(e);const i=Ea(t);return(n,a)=>i.then(f=>a(f.transaction(e,n).objectStore(e)))}let Dl;function Rc(){return Dl||(Dl=Om("keyval-store","keyval")),Dl}function Rg(r,e=Rc()){return e("readonly",t=>Ea(t.get(r)))}function LI(r,e,t=Rc()){return t("readwrite",i=>(i.put(e,r),Ea(i.transaction)))}function qI(r,e=Rc()){return e("readwrite",t=>(t.delete(r),Ea(t.transaction)))}function BI(r=Rc()){return r("readwrite",e=>(e.clear(),Ea(e.transaction)))}function UI(r,e){return r.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Ea(r.transaction)}function $I(r=Rc()){return r("readonly",e=>{if(e.getAllKeys)return Ea(e.getAllKeys());const t=[];return UI(e,i=>t.push(i.key)).then(()=>t)})}const zI="idb-keyval";var jI=(r={})=>{const e=r.base&&r.base.length>0?`${r.base}:`:"",t=n=>e+n;let i;return r.dbName&&r.storeName&&(i=Om(r.dbName,r.storeName)),{name:zI,options:r,async hasItem(n){return!(typeof await Rg(t(n),i)>"u")},async getItem(n){return await Rg(t(n),i)??null},setItem(n,a){return LI(t(n),a,i)},removeItem(n){return qI(t(n),i)},getKeys(){return $I(i)},clear(){return BI(i)}}};const kI="WALLET_CONNECT_V2_INDEXED_DB",FI="keyvaluestorage";let HI=class{constructor(){this.indexedDb=DI({driver:jI({dbName:kI,storeName:FI})})}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){const t=await this.indexedDb.getItem(e);if(t!==null)return t}async setItem(e,t){await this.indexedDb.setItem(e,gs(t))}async removeItem(e){await this.indexedDb.removeItem(e)}};var Ll=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},nh={exports:{}};(function(){let r;function e(){}r=e,r.prototype.getItem=function(t){return this.hasOwnProperty(t)?String(this[t]):null},r.prototype.setItem=function(t,i){this[t]=String(i)},r.prototype.removeItem=function(t){delete this[t]},r.prototype.clear=function(){const t=this;Object.keys(t).forEach(function(i){t[i]=void 0,delete t[i]})},r.prototype.key=function(t){return t=t||0,Object.keys(this)[t]},r.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Ll<"u"&&Ll.localStorage?nh.exports=Ll.localStorage:typeof window<"u"&&window.localStorage?nh.exports=window.localStorage:nh.exports=new e})();function KI(r){var e;return[r[0],ga((e=r[1])!=null?e:"")]}class VI{constructor(){this.localStorage=nh.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(KI)}async getItem(e){const t=this.localStorage.getItem(e);if(t!==null)return ga(t)}async setItem(e,t){this.localStorage.setItem(e,gs(t))}async removeItem(e){this.localStorage.removeItem(e)}}const GI="wc_storage_version",Ng=1,WI=async(r,e,t)=>{const i=GI,n=await e.getItem(i);if(n&&n>=Ng){t(e);return}const a=await r.getKeys();if(!a.length){t(e);return}const f=[];for(;a.length;){const u=a.shift();if(!u)continue;const b=u.toLowerCase();if(b.includes("wc@")||b.includes("walletconnect")||b.includes("wc_")||b.includes("wallet_connect")){const p=await r.getItem(u);await e.setItem(u,p),f.push(u)}}await e.setItem(i,Ng),t(e),JI(r,f)},JI=async(r,e)=>{e.length&&e.forEach(async t=>{await r.removeItem(t)})};let YI=class{constructor(){this.initialized=!1,this.setInitialized=t=>{this.storage=t,this.initialized=!0};const e=new VI;this.storage=e;try{const t=new HI;WI(e,t,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=>{const t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}};function QI(r){try{return JSON.stringify(r)}catch{return'"[Circular]"'}}var XI=ZI;function ZI(r,e,t){var i=t&&t.stringify||QI,n=1;if(typeof r=="object"&&r!==null){var a=e.length+n;if(a===1)return r;var f=new Array(a);f[0]=i(r);for(var u=1;u-1?A:0,r.charCodeAt(O+1)){case 100:case 102:if(y>=b||e[y]==null)break;A=b||e[y]==null)break;A=b||e[y]===void 0)break;A",A=O+2,O++;break}p+=i(e[y]),A=O+2,O++;break;case 115:if(y>=b)break;A-1&&(a=!1);const f=["error","fatal","warn","info","debug","trace"];typeof t=="function"&&(t.error=t.fatal=t.warn=t.info=t.debug=t.trace=t),r.enabled===!1&&(r.level="silent");const u=r.level||"info",b=Object.create(t);b.log||(b.log=yc),Object.defineProperty(b,"levelVal",{get:y}),Object.defineProperty(b,"level",{get:A,set:R});const p={transmit:e,serialize:n,asObject:r.browser.asObject,levels:f,timestamp:aM(r)};b.levels=Bn.levels,b.level=u,b.setMaxListeners=b.getMaxListeners=b.emit=b.addListener=b.on=b.prependListener=b.once=b.prependOnceListener=b.removeListener=b.removeAllListeners=b.listeners=b.listenerCount=b.eventNames=b.write=b.flush=yc,b.serializers=i,b._serialize=n,b._stdErrSerialize=a,b.child=O,e&&(b._logEvent=pd());function y(){return this.level==="silent"?1/0:this.levels.values[this.level]}function A(){return this._level}function R(N){if(N!=="silent"&&!this.levels.values[N])throw Error("unknown level "+N);this._level=N,Ka(p,b,"error","log"),Ka(p,b,"fatal","error"),Ka(p,b,"warn","error"),Ka(p,b,"info","log"),Ka(p,b,"debug","log"),Ka(p,b,"trace","log")}function O(N,K){if(!N)throw new Error("missing bindings for child Pino");K=K||{},n&&N.serializers&&(K.serializers=N.serializers);const W=K.serializers;if(n&&W){var Q=Object.assign({},i,W),k=r.browser.serialize===!0?Object.keys(Q):n;delete N.serializers,Fh([N],k,Q,this._stdErrSerialize)}function Y($){this._childLevel=($._childLevel|0)+1,this.error=Va($,N,"error"),this.fatal=Va($,N,"fatal"),this.warn=Va($,N,"warn"),this.info=Va($,N,"info"),this.debug=Va($,N,"debug"),this.trace=Va($,N,"trace"),Q&&(this.serializers=Q,this._serialize=k),e&&(this._logEvent=pd([].concat($._logEvent.bindings,N)))}return Y.prototype=this,new Y(this)}return b}Bn.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"}};Bn.stdSerializers=eM;Bn.stdTimeFunctions=Object.assign({},{nullTime:Rm,epochTime:Nm,unixTime:oM,isoTime:cM});function Ka(r,e,t,i){const n=Object.getPrototypeOf(e);e[t]=e.levelVal>e.levels.values[t]?yc:n[t]?n[t]:mc[t]||mc[i]||yc,rM(r,e,t)}function rM(r,e,t){!r.transmit&&e[t]===yc||(e[t]=function(i){return function(){const a=r.timestamp(),f=new Array(arguments.length),u=Object.getPrototypeOf&&Object.getPrototypeOf(this)===mc?mc:this;for(var b=0;b-1&&a in t&&(r[n][a]=t[a](r[n][a]))}function Va(r,e,t){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;nthis.maxSizeInBytes)throw new 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;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let 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};const t=e.value;return e=e.next,{done:!1,value:t}}}}},Tm=class{constructor(e,t=Qd){this.level=e??"error",this.levelValue=Ja.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new Cg(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===Ja.levels.values.error?console.error(e):t===Ja.levels.values.warn?console.warn(e):t===Ja.levels.values.debug?console.debug(e):t===Ja.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(gs({timestamp:new Date().toISOString(),log:e}));const 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 Cg(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const t=this.getLogArray();return t.push(gs({extraMetadata:e})),new Blob(t,{type:"application/json"})}},lM=class{constructor(e,t=Qd){this.baseChunkLogger=new Tm(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){const t=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=t,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(t)}};class dM{constructor(e,t=Qd){this.baseChunkLogger=new Tm(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)}}var pM=Object.defineProperty,gM=Object.defineProperties,vM=Object.getOwnPropertyDescriptors,Dg=Object.getOwnPropertySymbols,bM=Object.prototype.hasOwnProperty,mM=Object.prototype.propertyIsEnumerable,Lg=(r,e,t)=>e in r?pM(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,wh=(r,e)=>{for(var t in e||(e={}))bM.call(e,t)&&Lg(r,t,e[t]);if(Dg)for(var t of Dg(e))mM.call(e,t)&&Lg(r,t,e[t]);return r},_h=(r,e)=>gM(r,vM(e));function Hh(r){return _h(wh({},r),{level:(r==null?void 0:r.level)||hM.level})}function yM(r,e=Tc){return r[e]||""}function wM(r,e,t=Tc){return r[t]=e,r}function di(r,e=Tc){let t="";return typeof r.bindings>"u"?t=yM(r,e):t=r.bindings().context||"",t}function _M(r,e,t=Tc){const i=di(r,t);return i.trim()?`${i}/${e}`:e}function Yr(r,e,t=Tc){const i=_M(r,e,t),n=r.child({context:i});return wM(n,i,t)}function AM(r){var e,t;const i=new lM((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:Nc(_h(wh({},r.opts),{level:"trace",browser:_h(wh({},(t=r.opts)==null?void 0:t.browser),{write:n=>i.write(n)})})),chunkLoggerController:i}}function EM(r){var e;const t=new dM((e=r.opts)==null?void 0:e.level,r.maxSizeInBytes);return{logger:Nc(_h(wh({},r.opts),{level:"trace"}),t),chunkLoggerController:t}}function xM(r){return typeof r.loggerOverride<"u"&&typeof r.loggerOverride!="string"?{logger:r.loggerOverride,chunkLoggerController:null}:typeof window<"u"?AM(r):EM(r)}let SM=class extends Aa{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},IM=class extends Aa{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}},MM=class{constructor(e,t){this.logger=e,this.core=t}},PM=class extends Aa{constructor(e,t){super(),this.relayer=e,this.logger=t}},OM=class extends Aa{constructor(e){super()}},RM=class{constructor(e,t,i,n){this.core=e,this.logger=t,this.name=i}},NM=class extends Aa{constructor(e,t){super(),this.relayer=e,this.logger=t}},TM=class extends Aa{constructor(e,t){super(),this.core=e,this.logger=t}},CM=class{constructor(e,t,i){this.core=e,this.logger=t,this.store=i}},DM=class{constructor(e,t){this.projectId=e,this.logger=t}},LM=class{constructor(e,t,i){this.core=e,this.logger=t,this.telemetryEnabled=i}},qM=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},BM=class{constructor(e){this.client=e}};const UM="PARSE_ERROR",$M="INVALID_REQUEST",zM="METHOD_NOT_FOUND",jM="INVALID_PARAMS",Cm="INTERNAL_ERROR",Xd="SERVER_ERROR",kM=[-32700,-32600,-32601,-32602,-32603],hc={[UM]:{code:-32700,message:"Parse error"},[$M]:{code:-32600,message:"Invalid Request"},[zM]:{code:-32601,message:"Method not found"},[jM]:{code:-32602,message:"Invalid params"},[Cm]:{code:-32603,message:"Internal error"},[Xd]:{code:-32e3,message:"Server error"}},Dm=Xd;function FM(r){return kM.includes(r)}function qg(r){return Object.keys(hc).includes(r)?hc[r]:hc[Dm]}function HM(r){const e=Object.values(hc).find(t=>t.code===r);return e||hc[Dm]}function Lm(r,e,t){return r.message.includes("getaddrinfo ENOTFOUND")||r.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${t} RPC url at ${e}`):r}var qm={};/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var gd=function(r,e){return gd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)i.hasOwnProperty(n)&&(t[n]=i[n])},gd(r,e)};function KM(r,e){gd(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var vd=function(){return vd=Object.assign||function(e){for(var t,i=1,n=arguments.length;i=0;u--)(f=r[u])&&(a=(n<3?f(a):n>3?f(e,t,a):f(e,t))||a);return n>3&&a&&Object.defineProperty(e,t,a),a}function WM(r,e){return function(t,i){e(t,i,r)}}function JM(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function YM(r,e,t,i){function n(a){return a instanceof t?a:new t(function(f){f(a)})}return new(t||(t=Promise))(function(a,f){function u(y){try{p(i.next(y))}catch(A){f(A)}}function b(y){try{p(i.throw(y))}catch(A){f(A)}}function p(y){y.done?a(y.value):n(y.value).then(u,b)}p((i=i.apply(r,e||[])).next())})}function QM(r,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,n,a,f;return f={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function u(p){return function(y){return b([p,y])}}function b(p){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(a=p[0]&2?n.return:p[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,p[1])).done)return a;switch(n=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,n=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Bm(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,a=[],f;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(u){f={error:u}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(f)throw f.error}}return a}function eP(){for(var r=[],e=0;e1||u(R,O)})})}function u(R,O){try{b(i[R](O))}catch(N){A(a[0][3],N)}}function b(R){R.value instanceof wc?Promise.resolve(R.value.v).then(p,y):A(a[0][2],R)}function p(R){u("next",R)}function y(R){u("throw",R)}function A(R,O){R(O),a.shift(),a.length&&u(a[0][0],a[0][1])}}function iP(r){var e,t;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,a){e[n]=r[n]?function(f){return(t=!t)?{value:wc(r[n](f)),done:n==="return"}:a?a(f):f}:a}}function nP(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof bd=="function"?bd(r):r[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(a){t[a]=r[a]&&function(f){return new Promise(function(u,b){f=r[a](f),n(u,b,f.done,f.value)})}}function n(a,f,u,b){Promise.resolve(b).then(function(p){a({value:p,done:u})},f)}}function sP(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function aP(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function oP(r){return r&&r.__esModule?r:{default:r}}function cP(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function fP(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}const hP=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return vd},__asyncDelegator:iP,__asyncGenerator:rP,__asyncValues:nP,__await:wc,__awaiter:YM,__classPrivateFieldGet:cP,__classPrivateFieldSet:fP,__createBinding:XM,__decorate:GM,__exportStar:ZM,__extends:KM,__generator:QM,__importDefault:oP,__importStar:aP,__makeTemplateObject:sP,__metadata:JM,__param:WM,__read:Bm,__rest:VM,__spread:eP,__spreadArrays:tP,__values:bd},Symbol.toStringTag,{value:"Module"})),uP=Cv(hP);var ns={},Bg;function lP(){if(Bg)return ns;Bg=1,Object.defineProperty(ns,"__esModule",{value:!0}),ns.isBrowserCryptoAvailable=ns.getSubtleCrypto=ns.getBrowerCrypto=void 0;function r(){return(globalThis==null?void 0:globalThis.crypto)||(globalThis==null?void 0:globalThis.msCrypto)||{}}ns.getBrowerCrypto=r;function e(){const i=r();return i.subtle||i.webkitSubtle}ns.getSubtleCrypto=e;function t(){return!!r()&&!!e()}return ns.isBrowserCryptoAvailable=t,ns}var ss={},Ug;function dP(){if(Ug)return ss;Ug=1;var r={env:{NODE_ENV:'"production"',VITE_WALLETCONNECT_PROJECT_ID:'"1d93edc21291f98e3bed6ff7617ff539"'},nextTick:"setImmediate",platform:'"browser"',version:'"v16.0.0"',browser:!0};Object.defineProperty(ss,"__esModule",{value:!0}),ss.isBrowser=ss.isNode=ss.isReactNative=void 0;function e(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}ss.isReactNative=e;function t(){return typeof r<"u"&&typeof r.versions<"u"&&typeof r.versions.node<"u"}ss.isNode=t;function i(){return!e()&&!t()}return ss.isBrowser=i,ss}(function(r){Object.defineProperty(r,"__esModule",{value:!0});const e=uP;e.__exportStar(lP(),r),e.__exportStar(dP(),r)})(qm);function Ns(r=3){const e=Date.now()*Math.pow(10,r),t=Math.floor(Math.random()*Math.pow(10,r));return e+t}function fa(r=6){return BigInt(Ns(r))}function qs(r,e,t){return{id:t||Ns(),jsonrpc:"2.0",method:r,params:e}}function Kh(r,e){return{id:r,jsonrpc:"2.0",result:e}}function Vh(r,e,t){return{id:r,jsonrpc:"2.0",error:pP(e)}}function pP(r,e){return typeof r>"u"?qg(Cm):(typeof r=="string"&&(r=Object.assign(Object.assign({},qg(Xd)),{message:r})),FM(r.code)&&(r=HM(r.code)),r)}class gP{}class vP extends gP{constructor(){super()}}class bP extends vP{constructor(e){super()}}const mP="^https?:",yP="^wss?:";function wP(r){const e=r.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function Um(r,e){const t=wP(r);return typeof t>"u"?!1:new RegExp(e).test(t)}function $g(r){return Um(r,mP)}function zg(r){return Um(r,yP)}function _P(r){return new RegExp("wss?://localhost(:d{2,5})?").test(r)}function $m(r){return typeof r=="object"&&"id"in r&&"jsonrpc"in r&&r.jsonrpc==="2.0"}function Zd(r){return $m(r)&&"method"in r}function Gh(r){return $m(r)&&(In(r)||zi(r))}function In(r){return"result"in r}function zi(r){return"error"in r}let pn=class extends bP{constructor(e){super(e),this.events=new Fi.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(qs(e.method,e.params||[],e.id||fa().toString()),t)}async requestStrict(e,t){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(a){n(a)}this.events.on(`${e.id}`,a=>{zi(a)?n(a.error):i(a.result)});try{await this.connection.send(e,t)}catch(a){n(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Gh(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",new 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()),this.hasRegisteredEventListeners=!0)}};const AP=()=>typeof WebSocket<"u"?WebSocket:typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"?globalThis.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),EP=()=>typeof WebSocket<"u"||typeof globalThis<"u"&&typeof globalThis.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",jg=r=>r.split("?")[0],kg=10,xP=AP();let SP=class{constructor(e){if(this.url=e,this.events=new Fi.EventEmitter,this.registering=!1,!zg(e))throw new 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(new Error("Connection already closed"));return}this.socket.onclose=i=>{this.onClose(i),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(gs(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!zg(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,n)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),n(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return n(new Error("WebSocket connection is missing or invalid"));i(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,i)=>{const n=new URLSearchParams(e).get("origin"),a=qm.isReactNative()?{headers:{origin:n}}:{rejectUnauthorized:!_P(e)},f=new xP(e,[],a);EP()?f.onerror=u=>{const b=u;i(this.emitError(b.error))}:f.on("error",u=>{i(this.emitError(u))}),f.onopen=()=>{this.onOpen(f),t(f)}})}onOpen(e){e.onmessage=t=>this.onPayload(t),e.onclose=t=>this.onClose(t),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;const t=typeof e.data=="string"?ga(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),n=i.message||i.toString(),a=Vh(e,n);this.events.emit("payload",a)}parseError(e,t=this.url){return Lm(e,jg(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>kg&&this.events.setMaxListeners(kg)}emitError(e){const t=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${jg(this.url)}`));return this.events.emit("register_error",t),t}};var Ah={exports:{}};Ah.exports;(function(r,e){var t=200,i="__lodash_hash_undefined__",n=1,a=2,f=9007199254740991,u="[object Arguments]",b="[object Array]",p="[object AsyncFunction]",y="[object Boolean]",A="[object Date]",R="[object Error]",O="[object Function]",N="[object GeneratorFunction]",K="[object Map]",W="[object Number]",Q="[object Null]",k="[object Object]",Y="[object Promise]",$="[object Proxy]",F="[object RegExp]",G="[object Set]",x="[object String]",q="[object Symbol]",ae="[object Undefined]",le="[object WeakMap]",L="[object ArrayBuffer]",m="[object DataView]",c="[object Float32Array]",h="[object Float64Array]",v="[object Int8Array]",_="[object Int16Array]",I="[object Int32Array]",M="[object Uint8Array]",S="[object Uint8ClampedArray]",d="[object Uint16Array]",g="[object Uint32Array]",C=/[\\^$.*+?()[\]{}|]/g,Z=/^\[object .+?Constructor\]$/,se=/^(?:0|[1-9]\d*)$/,P={};P[c]=P[h]=P[v]=P[_]=P[I]=P[M]=P[S]=P[d]=P[g]=!0,P[u]=P[b]=P[L]=P[y]=P[m]=P[A]=P[R]=P[O]=P[K]=P[W]=P[k]=P[F]=P[G]=P[x]=P[le]=!1;var ee=typeof globalThis=="object"&&globalThis&&globalThis.Object===Object&&globalThis,B=typeof self=="object"&&self&&self.Object===Object&&self,j=ee||B||Function("return this")(),H=e&&!e.nodeType&&e,w=H&&!0&&r&&!r.nodeType&&r,z=w&&w.exports===H,ne=z&&ee.process,ce=function(){try{return ne&&ne.binding&&ne.binding("util")}catch{}}(),he=ce&&ce.isTypedArray;function ye(V,te){for(var pe=-1,$e=V==null?0:V.length,kt=0,pt=[];++pe<$e;){var Jt=V[pe];te(Jt,pe,V)&&(pt[kt++]=Jt)}return pt}function we(V,te){for(var pe=-1,$e=te.length,kt=V.length;++pe<$e;)V[kt+pe]=te[pe];return V}function Te(V,te){for(var pe=-1,$e=V==null?0:V.length;++pe<$e;)if(te(V[pe],pe,V))return!0;return!1}function Qe(V,te){for(var pe=-1,$e=Array(V);++pe-1}function qr(V,te){var pe=this.__data__,$e=ks(pe,V);return $e<0?(++this.size,pe.push([V,te])):pe[$e][1]=te,this}bt.prototype.clear=Tr,bt.prototype.delete=Cr,bt.prototype.get=Dr,bt.prototype.has=Lr,bt.prototype.set=qr;function er(V){var te=-1,pe=V==null?0:V.length;for(this.clear();++tehr))return!1;var Ft=pt.get(V);if(Ft&&pt.get(te))return Ft==te;var sr=-1,ei=!0,ur=pe&a?new Zr:void 0;for(pt.set(V,te),pt.set(te,V);++sr-1&&V%1==0&&V-1&&V%1==0&&V<=f}function Jc(V){var te=typeof V;return V!=null&&(te=="object"||te=="function")}function Ks(V){return V!=null&&typeof V=="object"}var Yc=he?Oe(he):Bc;function tu(V){return Zh(V)?Lc(V):Uc(V)}function jt(){return[]}function zt(){return!1}r.exports=eu})(Ah,Ah.exports);var IP=Ah.exports;const MP=Sd(IP),zm="wc",jm=2,e0="core",kn=`${zm}@2:${e0}:`,PP={name:e0,logger:"error"},OP={database:":memory:"},RP="crypto",Fg="client_ed25519_seed",NP=xe.ONE_DAY,TP="keychain",CP="0.3",DP="messages",LP="0.3",qP=xe.SIX_HOURS,BP="publisher",km="irn",UP="error",Fm="wss://relay.walletconnect.org",$P="relayer",Gr={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},zP="_subscription",Bi={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},jP=.1,md="2.17.0",Kt={link_mode:"link_mode",relay:"relay"},kP="0.3",FP="WALLETCONNECT_CLIENT_ID",Hg="WALLETCONNECT_LINK_MODE_APPS",Mn={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},HP="subscription",KP="0.3",VP=xe.FIVE_SECONDS*1e3,GP="pairing",WP="0.3",Xo={wc_pairingDelete:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:xe.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:xe.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:xe.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:0},res:{ttl:xe.ONE_DAY,prompt:!1,tag:0}}},oa={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},an={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},JP="history",YP="0.3",QP="expirer",Ui={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},XP="0.3",ZP="verify-api",eO="https://verify.walletconnect.com",Hm="https://verify.walletconnect.org",uc=Hm,tO=`${uc}/v3`,rO=[eO,Hm],iO="echo",nO="https://echo.walletconnect.com",En={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},as={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},on={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},na={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},sa={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},Zo={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},sO=.1,aO="event-client",oO=86400,cO="https://pulse.walletconnect.org/batch";function fO(r,e){if(r.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i>>0,$=new Uint8Array(Y);Q!==k;){for(var F=N[Q],G=0,x=Y-1;(F!==0||G>>0,$[x]=F%u>>>0,F=F/u>>>0;if(F!==0)throw new Error("Non-zero carry");W=G,Q++}for(var q=Y-W;q!==Y&&$[q]===0;)q++;for(var ae=b.repeat(K);q>>0,Y=new Uint8Array(k);N[K];){var $=t[N.charCodeAt(K)];if($===255)return;for(var F=0,G=k-1;($!==0||F>>0,Y[G]=$%256>>>0,$=$/256>>>0;if($!==0)throw new Error("Non-zero carry");Q=F,K++}if(N[K]!==" "){for(var x=k-Q;x!==k&&Y[x]===0;)x++;for(var q=new Uint8Array(W+(k-x)),ae=W;x!==k;)q[ae++]=Y[x++];return q}}}function O(N){var K=R(N);if(K)return K;throw new Error(`Non-${e} character`)}return{encode:A,decodeUnsafe:R,decode:O}}var hO=fO,uO=hO;const Km=r=>{if(r instanceof Uint8Array&&r.constructor.name==="Uint8Array")return r;if(r instanceof ArrayBuffer)return new Uint8Array(r);if(ArrayBuffer.isView(r))return new Uint8Array(r.buffer,r.byteOffset,r.byteLength);throw new Error("Unknown type, must be binary type")},lO=r=>new TextEncoder().encode(r),dO=r=>new TextDecoder().decode(r);class pO{constructor(e,t,i){this.name=e,this.prefix=t,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class gO{constructor(e,t,i){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=i}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 Vm(this,e)}}class vO{constructor(e){this.decoders=e}or(e){return Vm(this,e)}decode(e){const t=e[0],i=this.decoders[t];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Vm=(r,e)=>new vO({...r.decoders||{[r.prefix]:r},...e.decoders||{[e.prefix]:e}});class bO{constructor(e,t,i,n){this.name=e,this.prefix=t,this.baseEncode=i,this.baseDecode=n,this.encoder=new pO(e,t,i),this.decoder=new gO(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Wh=({name:r,prefix:e,encode:t,decode:i})=>new bO(r,e,t,i),Cc=({prefix:r,name:e,alphabet:t})=>{const{encode:i,decode:n}=uO(t,e);return Wh({prefix:r,name:e,encode:i,decode:a=>Km(n(a))})},mO=(r,e,t,i)=>{const n={};for(let y=0;y=8&&(u-=8,f[p++]=255&b>>u)}if(u>=t||255&b<<8-u)throw new SyntaxError("Unexpected end of data");return f},yO=(r,e,t)=>{const i=e[e.length-1]==="=",n=(1<t;)f-=t,a+=e[n&u>>f];if(f&&(a+=e[n&u<Wh({prefix:e,name:r,encode(n){return yO(n,i,t)},decode(n){return mO(n,i,t,r)}}),wO=Wh({prefix:"\0",name:"identity",encode:r=>dO(r),decode:r=>lO(r)});var _O=Object.freeze({__proto__:null,identity:wO});const AO=Nr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var EO=Object.freeze({__proto__:null,base2:AO});const xO=Nr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var SO=Object.freeze({__proto__:null,base8:xO});const IO=Cc({prefix:"9",name:"base10",alphabet:"0123456789"});var MO=Object.freeze({__proto__:null,base10:IO});const PO=Nr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),OO=Nr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var RO=Object.freeze({__proto__:null,base16:PO,base16upper:OO});const NO=Nr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),TO=Nr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),CO=Nr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),DO=Nr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),LO=Nr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),qO=Nr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),BO=Nr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),UO=Nr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),$O=Nr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var zO=Object.freeze({__proto__:null,base32:NO,base32upper:TO,base32pad:CO,base32padupper:DO,base32hex:LO,base32hexupper:qO,base32hexpad:BO,base32hexpadupper:UO,base32z:$O});const jO=Cc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),kO=Cc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var FO=Object.freeze({__proto__:null,base36:jO,base36upper:kO});const HO=Cc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),KO=Cc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var VO=Object.freeze({__proto__:null,base58btc:HO,base58flickr:KO});const GO=Nr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),WO=Nr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),JO=Nr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),YO=Nr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var QO=Object.freeze({__proto__:null,base64:GO,base64pad:WO,base64url:JO,base64urlpad:YO});const Gm=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),XO=Gm.reduce((r,e,t)=>(r[t]=e,r),[]),ZO=Gm.reduce((r,e,t)=>(r[e.codePointAt(0)]=t,r),[]);function eR(r){return r.reduce((e,t)=>(e+=XO[t],e),"")}function tR(r){const e=[];for(const t of r){const i=ZO[t.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${t}`);e.push(i)}return new Uint8Array(e)}const rR=Wh({prefix:"🚀",name:"base256emoji",encode:eR,decode:tR});var iR=Object.freeze({__proto__:null,base256emoji:rR}),nR=Wm,Kg=128,sR=127,aR=~sR,oR=Math.pow(2,31);function Wm(r,e,t){e=e||[],t=t||0;for(var i=t;r>=oR;)e[t++]=r&255|Kg,r/=128;for(;r&aR;)e[t++]=r&255|Kg,r>>>=7;return e[t]=r|0,Wm.bytes=t-i+1,e}var cR=yd,fR=128,Vg=127;function yd(r,i){var t=0,i=i||0,n=0,a=i,f,u=r.length;do{if(a>=u)throw yd.bytes=0,new RangeError("Could not decode varint");f=r[a++],t+=n<28?(f&Vg)<=fR);return yd.bytes=a-i,t}var hR=Math.pow(2,7),uR=Math.pow(2,14),lR=Math.pow(2,21),dR=Math.pow(2,28),pR=Math.pow(2,35),gR=Math.pow(2,42),vR=Math.pow(2,49),bR=Math.pow(2,56),mR=Math.pow(2,63),yR=function(r){return r(Jm.encode(r,e,t),e),Wg=r=>Jm.encodingLength(r),wd=(r,e)=>{const t=e.byteLength,i=Wg(r),n=i+Wg(t),a=new Uint8Array(n+t);return Gg(r,a,0),Gg(t,a,i),a.set(e,n),new _R(r,t,e,a)};class _R{constructor(e,t,i,n){this.code=e,this.size=t,this.digest=i,this.bytes=n}}const Ym=({name:r,code:e,encode:t})=>new AR(r,e,t);class AR{constructor(e,t,i){this.name=e,this.code=t,this.encode=i}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?wd(this.code,t):t.then(i=>wd(this.code,i))}else throw Error("Unknown type, must be binary type")}}const Qm=r=>async e=>new Uint8Array(await crypto.subtle.digest(r,e)),ER=Ym({name:"sha2-256",code:18,encode:Qm("SHA-256")}),xR=Ym({name:"sha2-512",code:19,encode:Qm("SHA-512")});var SR=Object.freeze({__proto__:null,sha256:ER,sha512:xR});const Xm=0,IR="identity",Zm=Km,MR=r=>wd(Xm,Zm(r)),PR={code:Xm,name:IR,encode:Zm,digest:MR};var OR=Object.freeze({__proto__:null,identity:PR});new TextEncoder,new TextDecoder;const Jg={..._O,...EO,...SO,...MO,...RO,...zO,...FO,...VO,...QO,...iR};({...SR,...OR});function RR(r=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(r):new Uint8Array(r)}function e2(r,e,t,i){return{name:r,prefix:e,encoder:{name:r,prefix:e,encode:t},decoder:{decode:i}}}const Yg=e2("utf8","u",r=>"u"+new TextDecoder("utf8").decode(r),r=>new TextEncoder().encode(r.substring(1))),Bl=e2("ascii","a",r=>{let e="a";for(let t=0;t{r=r.substring(1);const e=RR(r.length);for(let t=0;t{if(!this.initialized){const i=await this.getKeyChain();typeof i<"u"&&(this.keychain=i),this.initialized=!0}},this.has=i=>(this.isInitialized(),this.keychain.has(i)),this.set=async(i,n)=>{this.isInitialized(),this.keychain.set(i,n),await this.persist()},this.get=i=>{this.isInitialized();const n=this.keychain.get(i);if(typeof n>"u"){const{message:a}=Ae("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(a)}return n},this.del=async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()},this.core=e,this.logger=Yr(t,this.name)}get context(){return di(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Tb(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Cb(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class DR{constructor(e,t,i){this.core=e,this.logger=t,this.name=RP,this.randomSessionIdentifier=ud(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=n=>(this.isInitialized(),this.keychain.has(n)),this.getClientId=async()=>{this.isInitialized();const n=await this.getClientSeed(),a=T1(n);return Pb(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const n=bS();return this.setPrivateKey(n.publicKey,n.privateKey)},this.signJWT=async n=>{this.isInitialized();const a=await this.getClientSeed(),f=T1(a),u=this.randomSessionIdentifier;return await X9(u,n,NP,f)},this.generateSharedKey=(n,a,f)=>{this.isInitialized();const u=this.getPrivateKey(n),b=mS(u,a);return this.setSymKey(b,f)},this.setSymKey=async(n,a)=>{this.isInitialized();const f=a||rh(n);return await this.keychain.set(f,n),f},this.deleteKeyPair=async n=>{this.isInitialized(),await this.keychain.del(n)},this.deleteSymKey=async n=>{this.isInitialized(),await this.keychain.del(n)},this.encode=async(n,a,f)=>{this.isInitialized();const u=xm(f),b=gs(a);if(gg(u))return wS(b,f==null?void 0:f.encoding);if(pg(u)){const R=u.senderPublicKey,O=u.receiverPublicKey;n=await this.generateSharedKey(R,O)}const p=this.getSymKey(n),{type:y,senderPublicKey:A}=u;return yS({type:y,symKey:p,message:b,senderPublicKey:A,encoding:f==null?void 0:f.encoding})},this.decode=async(n,a,f)=>{this.isInitialized();const u=ES(a,f);if(gg(u)){const b=AS(a,f==null?void 0:f.encoding);return ga(b)}if(pg(u)){const b=u.receiverPublicKey,p=u.senderPublicKey;n=await this.generateSharedKey(b,p)}try{const b=this.getSymKey(n),p=_S({symKey:b,encoded:a,encoding:f==null?void 0:f.encoding});return ga(p)}catch(b){this.logger.error(`Failed to decode message from topic: '${n}', clientId: '${await this.getClientId()}'`),this.logger.error(b)}},this.getPayloadType=(n,a=Ls)=>{const f=vc({encoded:n,encoding:a});return ba(f.type)},this.getPayloadSenderPublicKey=(n,a=Ls)=>{const f=vc({encoded:n,encoding:a});return f.senderPublicKey?Er(f.senderPublicKey,Jr):void 0},this.core=e,this.logger=Yr(t,this.name),this.keychain=i||new CR(this.core,this.logger)}get context(){return di(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(Fg)}catch{e=ud(),await this.keychain.set(Fg,e)}return TR(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class LR extends MM{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name=DP,this.version=LP,this.initialized=!1,this.storagePrefix=kn,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const i=await this.getRelayerMessages();typeof i<"u"&&(this.messages=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}},this.set=async(i,n)=>{this.isInitialized();const a=cs(n);let f=this.messages.get(i);return typeof f>"u"&&(f={}),typeof f[a]<"u"||(f[a]=n,this.messages.set(i,f),await this.persist()),a},this.get=i=>{this.isInitialized();let n=this.messages.get(i);return typeof n>"u"&&(n={}),n},this.has=(i,n)=>{this.isInitialized();const a=this.get(i),f=cs(n);return typeof a[f]<"u"},this.del=async i=>{this.isInitialized(),this.messages.delete(i),await this.persist()},this.logger=Yr(e,this.name),this.core=t}get context(){return di(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Tb(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Cb(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class qR extends PM{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new Fi.EventEmitter,this.name=BP,this.queue=new Map,this.publishTimeout=xe.toMiliseconds(xe.ONE_MINUTE),this.failedPublishTimeout=xe.toMiliseconds(xe.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(i,n,a)=>{var f;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:n,opts:a}});const u=(a==null?void 0:a.ttl)||qP,b=ld(a),p=(a==null?void 0:a.prompt)||!1,y=(a==null?void 0:a.tag)||0,A=(a==null?void 0:a.id)||fa().toString(),R={topic:i,message:n,opts:{ttl:u,relay:b,prompt:p,tag:y,id:A,attestation:a==null?void 0:a.attestation}},O=`Failed to publish payload, please try again. id:${A} tag:${y}`,N=Date.now();let K,W=1;try{for(;K===void 0;){if(Date.now()-N>this.publishTimeout)throw new Error(O);this.logger.trace({id:A,attempts:W},`publisher.publish - attempt ${W}`),K=await await Za(this.rpcPublish(i,n,u,b,p,y,A,a==null?void 0:a.attestation).catch(Q=>this.logger.warn(Q)),this.publishTimeout,O),W++,K||await new Promise(Q=>setTimeout(Q,this.failedPublishTimeout))}this.relayer.events.emit(Gr.publish,R),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:A,topic:i,message:n,opts:a}})}catch(Q){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(Q),(f=a==null?void 0:a.internal)!=null&&f.throwOnFailedPublish)throw Q;this.queue.set(A,R)}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.relayer=e,this.logger=Yr(t,this.name),this.registerEventListeners()}get context(){return di(this.logger)}rpcPublish(e,t,i,n,a,f,u,b){var p,y,A,R;const O={method:nc(n.protocol).publish,params:{topic:e,message:t,ttl:i,prompt:a,tag:f,attestation:b},id:u};return fi((p=O.params)==null?void 0:p.prompt)&&((y=O.params)==null||delete y.prompt),fi((A=O.params)==null?void 0:A.tag)&&((R=O.params)==null||delete R.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:O}),this.relayer.request(O)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:t,message:i,opts:n}=e;await this.publish(t,i,n)})}registerEventListeners(){this.relayer.core.heartbeat.on(Ao.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Gr.connection_stalled);return}this.checkQueue()}),this.relayer.on(Gr.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class BR{constructor(){this.map=new Map,this.set=(e,t)=>{const i=this.get(e);this.exists(e,t)||this.map.set(e,[...i,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const i=this.get(e);if(!this.exists(e,t))return;const n=i.filter(a=>a!==t);if(!n.length){this.map.delete(e);return}this.map.set(e,n)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var UR=Object.defineProperty,$R=Object.defineProperties,zR=Object.getOwnPropertyDescriptors,Qg=Object.getOwnPropertySymbols,jR=Object.prototype.hasOwnProperty,kR=Object.prototype.propertyIsEnumerable,Xg=(r,e,t)=>e in r?UR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ec=(r,e)=>{for(var t in e||(e={}))jR.call(e,t)&&Xg(r,t,e[t]);if(Qg)for(var t of Qg(e))kR.call(e,t)&&Xg(r,t,e[t]);return r},Ul=(r,e)=>$R(r,zR(e));class FR extends NM{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new BR,this.events=new Fi.EventEmitter,this.name=HP,this.version=KP,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=kn,this.subscribeTimeout=xe.toMiliseconds(xe.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(i,n)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}});try{const a=ld(n),f={topic:i,relay:a,transportType:n==null?void 0:n.transportType};this.pending.set(i,f);const u=await this.rpcSubscribe(i,a,n==null?void 0:n.transportType);return typeof u=="string"&&(this.onSubscribe(u,f),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}})),u}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),typeof(n==null?void 0:n.id)<"u"?await this.unsubscribeById(i,n.id,n):await this.unsubscribeByTopic(i,n)},this.isSubscribed=async i=>{if(this.topics.includes(i))return!0;const n=`${this.pendingSubscriptionWatchLabel}_${i}`;return await new Promise((a,f)=>{const u=new xe.Watch;u.start(n);const b=setInterval(()=>{!this.pending.has(i)&&this.topics.includes(i)&&(clearInterval(b),u.stop(n),a(!0)),u.elapsed(n)>=VP&&(clearInterval(b),u.stop(n),f(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=Yr(t,this.name),this.clientId=""}get context(){return di(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let i=!1;try{i=this.getSubscription(e).topic===t}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){const i=this.topicMap.get(e);await Promise.all(i.map(async n=>await this.unsubscribeById(e,n,t)))}async unsubscribeById(e,t,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}});try{const n=ld(i);await this.rpcUnsubscribe(e,t,n);const a=$t("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:i}})}catch(n){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(n),n}}async rpcSubscribe(e,t,i=Kt.relay){i===Kt.relay&&await this.restartToComplete();const n={method:nc(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{const a=cs(e+this.clientId);return i===Kt.link_mode?(setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(n).catch(f=>this.logger.warn(f))},xe.toMiliseconds(xe.ONE_SECOND)),a):await await Za(this.relayer.request(n).catch(f=>this.logger.warn(f)),this.subscribeTimeout)?a:null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Gr.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const t=e[0].relay,i={method:nc(t.protocol).batchSubscribe,params:{topics:e.map(n=>n.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await Za(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)}catch{this.relayer.events.emit(Gr.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const t=e[0].relay,i={method:nc(t.protocol).batchFetchMessages,params:{topics:e.map(a=>a.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});let n;try{n=await await Za(this.relayer.request(i).catch(a=>this.logger.warn(a)),this.subscribeTimeout)}catch{this.relayer.events.emit(Gr.connection_stalled)}return n}rpcUnsubscribe(e,t,i){const n={method:nc(i.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,Ul(ec({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(t=>{this.setSubscription(t.id,ec({},t)),this.pending.delete(t.topic)})}async onUnsubscribe(e,t,i){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,i),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,ec({},t)),this.topicMap.set(t.topic,e),this.events.emit(Mn.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const t=this.subscriptions.get(e);if(!t){const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});const i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(Mn.deleted,Ul(ec({},i),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(Mn.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t"u"||!e.length)return;if(this.subscriptions.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const t=await this.rpcBatchSubscribe(e);jn(t)&&this.onBatchSubscribe(t.map((i,n)=>Ul(ec({},e[n]),{id:i})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(t.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(Ao.pulse,async()=>{await this.checkPending()}),this.events.on(Mn.created,async e=>{const t=Mn.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(Mn.deleted,async e=>{const t=Mn.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen(),this.restartInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var HR=Object.defineProperty,Zg=Object.getOwnPropertySymbols,KR=Object.prototype.hasOwnProperty,VR=Object.prototype.propertyIsEnumerable,ev=(r,e,t)=>e in r?HR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,GR=(r,e)=>{for(var t in e||(e={}))KR.call(e,t)&&ev(r,t,e[t]);if(Zg)for(var t of Zg(e))VR.call(e,t)&&ev(r,t,e[t]);return r};class WR extends OM{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Fi.EventEmitter,this.name=$P,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=xe.toMiliseconds(xe.THIRTY_SECONDS+xe.ONE_SECOND),this.request=async t=>{var i,n;this.logger.debug("Publishing Request Payload");const a=t.id||fa().toString();await this.toEstablishConnection();try{const f=this.provider.request(t);this.requestsInFlight.set(a,{promise:f,request:t}),this.logger.trace({id:a,method:t.method,topic:(i=t.params)==null?void 0:i.topic},"relayer.request - attempt to publish...");const u=await new Promise(async(b,p)=>{const y=()=>{p(new Error(`relayer.request - publish interrupted, id: ${a}`))};this.provider.on(Bi.disconnect,y);const A=await f;this.provider.off(Bi.disconnect,y),b(A)});return this.logger.trace({id:a,method:t.method,topic:(n=t.params)==null?void 0:n.topic},"relayer.request - published"),u}catch(f){throw this.logger.debug(`Failed to Publish Request: ${a}`),f}finally{this.requestsInFlight.delete(a)}},this.resetPingTimeout=()=>{if(dh())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var t,i,n;(n=(i=(t=this.provider)==null?void 0:t.connection)==null?void 0:i.socket)==null||n.terminate()},this.heartBeatTimeout)}catch(t){this.logger.warn(t)}},this.onPayloadHandler=t=>{this.onProviderPayload(t),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Gr.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=t=>{this.logger.error(t),this.events.emit(Gr.error,t),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Bi.payload,this.onPayloadHandler),this.provider.on(Bi.connect,this.onConnectHandler),this.provider.on(Bi.disconnect,this.onDisconnectHandler),this.provider.on(Bi.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?Yr(e.logger,this.name):Nc(Hh({level:e.logger||UP})),this.messages=new LR(this.logger,e.core),this.subscriber=new FR(this,this.logger),this.publisher=new qR(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Fm,this.projectId=e.projectId,this.bundleId=oA(),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e)}}get context(){return di(this.logger)}get connected(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===1}get connecting(){var e,t,i;return((i=(t=(e=this.provider)==null?void 0:e.connection)==null?void 0:t.socket)==null?void 0:i.readyState)===0}async publish(e,t,i){this.isInitialized(),await this.publisher.publish(e,t,i),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:Kt.relay})}async subscribe(e,t){var i;this.isInitialized(),(t==null?void 0:t.transportType)==="relay"&&await this.toEstablishConnection();let n=((i=this.subscriber.topicMap.get(e))==null?void 0:i[0])||"",a;const f=u=>{u.topic===e&&(this.subscriber.off(Mn.created,f),a())};return await Promise.all([new Promise(u=>{a=u,this.subscriber.on(Mn.created,f)}),new Promise(async u=>{n=await this.subscriber.subscribe(e,t)||n,u()})]),n}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}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 transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await Za(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(t,i)=>{const n=()=>{this.provider.off(Bi.disconnect,n),i(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(Bi.disconnect,n),await Za(this.provider.connect(),xe.toMiliseconds(xe.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(a=>{i(a)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(a=>{this.logger.error(a),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,t()})}catch(t){this.logger.error(t);const i=t;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(i.message))throw t}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await Ig())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const t=e.sort((i,n)=>i.publishedAt-n.publishedAt);this.logger.trace(`Batch of ${t.length} message events sorted`);for(const i of t)try{await this.onMessageEvent(i)}catch(n){this.logger.warn(n)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){const{topic:i}=e;if(!t.sessionExists){const n=vr(xe.FIVE_MINUTES),a={topic:i,expiry:n,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(i,a)}this.events.emit(Gr.message,e),await this.recordMessageEvent(e)}startPingTimeout(){var e,t,i,n,a;if(dh())try{(t=(e=this.provider)==null?void 0:e.connection)!=null&&t.socket&&((a=(n=(i=this.provider)==null?void 0:i.connection)==null?void 0:n.socket)==null||a.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(f){this.logger.warn(f)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new pn(new SP(uA({sdkVersion:md,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:t,message:i}=e;await this.messages.set(t,i)}async shouldIgnoreMessageEvent(e){const{topic:t,message:i}=e;if(!i||i.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;const n=this.messages.has(t,i);return n&&this.logger.debug(`Ignoring duplicate message: ${i}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Zd(e)){if(!e.method.endsWith(zP))return;const t=e.params,{topic:i,message:n,publishedAt:a,attestation:f}=t.data,u={topic:i,message:n,publishedAt:a,transportType:Kt.relay,attestation:f};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(GR({type:"event",event:t.id},u)),this.events.emit(t.id,u),await this.acknowledgePayload(e),await this.onMessageEvent(u)}else Gh(e)&&this.events.emit(Gr.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Gr.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const t=Kh(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(Bi.payload,this.onPayloadHandler),this.provider.off(Bi.connect,this.onConnectHandler),this.provider.off(Bi.disconnect,this.onDisconnectHandler),this.provider.off(Bi.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await Ig();vI(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(i=>this.logger.error(i)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Gr.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},xe.toMiliseconds(jP))))}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var JR=Object.defineProperty,tv=Object.getOwnPropertySymbols,YR=Object.prototype.hasOwnProperty,QR=Object.prototype.propertyIsEnumerable,rv=(r,e,t)=>e in r?JR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,iv=(r,e)=>{for(var t in e||(e={}))YR.call(e,t)&&rv(r,t,e[t]);if(tv)for(var t of tv(e))QR.call(e,t)&&rv(r,t,e[t]);return r};class xa extends RM{constructor(e,t,i,n=kn,a=void 0){super(e,t,i,n),this.core=e,this.logger=t,this.name=i,this.map=new Map,this.version=kP,this.cached=[],this.initialized=!1,this.storagePrefix=kn,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(f=>{this.getKey&&f!==null&&!fi(f)?this.map.set(this.getKey(f),f):GS(f)?this.map.set(f.id,f):WS(f)&&this.map.set(f.topic,f)}),this.cached=[],this.initialized=!0)},this.set=async(f,u)=>{this.isInitialized(),this.map.has(f)?await this.update(f,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:f,value:u}),this.map.set(f,u),await this.persist())},this.get=f=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:f}),this.getData(f)),this.getAll=f=>(this.isInitialized(),f?this.values.filter(u=>Object.keys(f).every(b=>MP(u[b],f[b]))):this.values),this.update=async(f,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:f,update:u});const b=iv(iv({},this.getData(f)),u);this.map.set(f,b),await this.persist()},this.delete=async(f,u)=>{this.isInitialized(),this.map.has(f)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:f,reason:u}),this.map.delete(f),this.addToRecentlyDeleted(f),await this.persist())},this.logger=Yr(t,this.name),this.storagePrefix=n,this.getKey=a}get context(){return di(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){const{message:n}=Ae("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class XR{constructor(e,t){this.core=e,this.logger=t,this.name=GP,this.version=WP,this.events=new Id,this.initialized=!1,this.storagePrefix=kn,this.ignoredPayloadTypes=[ls],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]},this.create=async i=>{this.isInitialized();const n=ud(),a=await this.core.crypto.setSymKey(n),f=vr(xe.FIVE_MINUTES),u={protocol:km},b={topic:a,expiry:f,relay:u,active:!1,methods:i==null?void 0:i.methods},p=wg({protocol:this.core.protocol,version:this.core.version,topic:a,symKey:n,relay:u,expiryTimestamp:f,methods:i==null?void 0:i.methods});return this.events.emit(oa.create,b),this.core.expirer.set(a,f),await this.pairings.set(a,b),await this.core.relayer.subscribe(a,{transportType:i==null?void 0:i.transportType}),{topic:a,uri:p}},this.pair=async i=>{this.isInitialized();const n=this.core.eventClient.createEvent({properties:{topic:i==null?void 0:i.uri,trace:[En.pairing_started]}});this.isValidPair(i,n);const{topic:a,symKey:f,relay:u,expiryTimestamp:b,methods:p}=yg(i.uri);n.props.properties.topic=a,n.addTrace(En.pairing_uri_validation_success),n.addTrace(En.pairing_uri_not_expired);let y;if(this.pairings.keys.includes(a)){if(y=this.pairings.get(a),n.addTrace(En.existing_pairing),y.active)throw n.setError(as.active_pairing_already_exists),new Error(`Pairing already exists: ${a}. Please try again with a new connection URI.`);n.addTrace(En.pairing_not_expired)}const A=b||vr(xe.FIVE_MINUTES),R={topic:a,relay:u,expiry:A,active:!1,methods:p};this.core.expirer.set(a,A),await this.pairings.set(a,R),n.addTrace(En.store_new_pairing),i.activatePairing&&await this.activate({topic:a}),this.events.emit(oa.create,R),n.addTrace(En.emit_inactive_pairing),this.core.crypto.keychain.has(a)||await this.core.crypto.setSymKey(f,a),n.addTrace(En.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{n.setError(as.no_internet_connection)}try{await this.core.relayer.subscribe(a,{relay:u})}catch(O){throw n.setError(as.subscribe_pairing_topic_failure),O}return n.addTrace(En.subscribe_pairing_topic_success),R},this.activate=async({topic:i})=>{this.isInitialized();const n=vr(xe.THIRTY_DAYS);this.core.expirer.set(i,n),await this.pairings.update(i,{active:!0,expiry:n})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:n}=i;if(this.pairings.keys.includes(n)){const a=await this.sendRequest(n,"wc_pairingPing",{}),{done:f,resolve:u,reject:b}=aa();this.events.once(St("pairing_ping",a),({error:p})=>{p?b(p):u()}),await f()}},this.updateExpiry=async({topic:i,expiry:n})=>{this.isInitialized(),await this.pairings.update(i,{expiry:n})},this.updateMetadata=async({topic:i,metadata:n})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:n})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:n}=i;this.pairings.keys.includes(n)&&(await this.sendRequest(n,"wc_pairingDelete",$t("USER_DISCONNECTED")),await this.deletePairing(n))},this.formatUriFromPairing=i=>{this.isInitialized();const{topic:n,relay:a,expiry:f,methods:u}=i,b=this.core.crypto.keychain.get(n);return wg({protocol:this.core.protocol,version:this.core.version,topic:n,symKey:b,relay:a,expiryTimestamp:f,methods:u})},this.sendRequest=async(i,n,a)=>{const f=qs(n,a),u=await this.core.crypto.encode(i,f),b=Xo[n].req;return this.core.history.set(i,f),this.core.relayer.publish(i,u,b),f.id},this.sendResult=async(i,n,a)=>{const f=Kh(i,a),u=await this.core.crypto.encode(n,f),b=await this.core.history.get(n,i),p=Xo[b.request.method].res;await this.core.relayer.publish(n,u,p),await this.core.history.resolve(f)},this.sendError=async(i,n,a)=>{const f=Vh(i,a),u=await this.core.crypto.encode(n,f),b=await this.core.history.get(n,i),p=Xo[b.request.method]?Xo[b.request.method].res:Xo.unregistered_method.res;await this.core.relayer.publish(n,u,p),await this.core.history.resolve(f)},this.deletePairing=async(i,n)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,$t("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(i),n?Promise.resolve():this.core.expirer.del(i)])},this.cleanup=async()=>{const i=this.pairings.getAll().filter(n=>Os(n.expiry));await Promise.all(i.map(n=>this.deletePairing(n.topic)))},this.onRelayEventRequest=i=>{const{topic:n,payload:a}=i;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(n,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(n,a);default:return this.onUnknownRpcMethodRequest(n,a)}},this.onRelayEventResponse=async i=>{const{topic:n,payload:a}=i,f=(await this.core.history.get(n,a.id)).request.method;switch(f){case"wc_pairingPing":return this.onPairingPingResponse(n,a);default:return this.onUnknownRpcMethodResponse(f)}},this.onPairingPingRequest=async(i,n)=>{const{id:a}=n;try{this.isValidPing({topic:i}),await this.sendResult(a,i,!0),this.events.emit(oa.ping,{id:a,topic:i})}catch(f){await this.sendError(a,i,f),this.logger.error(f)}},this.onPairingPingResponse=(i,n)=>{const{id:a}=n;setTimeout(()=>{In(n)?this.events.emit(St("pairing_ping",a),{}):zi(n)&&this.events.emit(St("pairing_ping",a),{error:n.error})},500)},this.onPairingDeleteRequest=async(i,n)=>{const{id:a}=n;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(oa.delete,{id:a,topic:i})}catch(f){await this.sendError(a,i,f),this.logger.error(f)}},this.onUnknownRpcMethodRequest=async(i,n)=>{const{id:a,method:f}=n;try{if(this.registeredMethods.includes(f))return;const u=$t("WC_METHOD_UNSUPPORTED",f);await this.sendError(a,i,u),this.logger.error(u)}catch(u){await this.sendError(a,i,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=i=>{this.registeredMethods.includes(i)||this.logger.error($t("WC_METHOD_UNSUPPORTED",i))},this.isValidPair=(i,n)=>{var a;if(!oi(i)){const{message:u}=Ae("MISSING_OR_INVALID",`pair() params: ${i}`);throw n.setError(as.malformed_pairing_uri),new Error(u)}if(!VS(i.uri)){const{message:u}=Ae("MISSING_OR_INVALID",`pair() uri: ${i.uri}`);throw n.setError(as.malformed_pairing_uri),new Error(u)}const f=yg(i==null?void 0:i.uri);if(!((a=f==null?void 0:f.relay)!=null&&a.protocol)){const{message:u}=Ae("MISSING_OR_INVALID","pair() uri#relay-protocol");throw n.setError(as.malformed_pairing_uri),new Error(u)}if(!(f!=null&&f.symKey)){const{message:u}=Ae("MISSING_OR_INVALID","pair() uri#symKey");throw n.setError(as.malformed_pairing_uri),new Error(u)}if(f!=null&&f.expiryTimestamp&&xe.toMiliseconds(f==null?void 0:f.expiryTimestamp){if(!oi(i)){const{message:a}=Ae("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(a)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidDisconnect=async i=>{if(!oi(i)){const{message:a}=Ae("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(a)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidPairingTopic=async i=>{if(!fr(i,!1)){const{message:n}=Ae("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(n)}if(!this.pairings.keys.includes(i)){const{message:n}=Ae("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(n)}if(Os(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:n}=Ae("EXPIRED",`pairing topic: ${i}`);throw new Error(n)}},this.core=e,this.logger=Yr(t,this.name),this.pairings=new xa(this.core,this.logger,this.name,this.storagePrefix)}get context(){return di(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Gr.message,async e=>{const{topic:t,message:i,transportType:n}=e;if(!this.pairings.keys.includes(t)||n===Kt.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;const a=await this.core.crypto.decode(t,i);try{Zd(a)?(this.core.history.set(t,a),this.onRelayEventRequest({topic:t,payload:a})):Gh(a)&&(await this.core.history.resolve(a),await this.onRelayEventResponse({topic:t,payload:a}),this.core.history.delete(t,a.id))}catch(f){this.logger.error(f)}})}registerExpirerEvents(){this.core.expirer.on(Ui.expired,async e=>{const{topic:t}=Lb(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(oa.expire,{topic:t}))})}}class ZR extends IM{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new Fi.EventEmitter,this.name=JP,this.version=YP,this.cached=[],this.initialized=!1,this.storagePrefix=kn,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(i,n,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:i,request:n,chainId:a}),this.records.has(n.id))return;const f={id:n.id,topic:i,request:{method:n.method,params:n.params||null},chainId:a,expiry:vr(xe.THIRTY_DAYS)};this.records.set(f.id,f),this.persist(),this.events.emit(an.created,f)},this.resolve=async i=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:i}),!this.records.has(i.id))return;const n=await this.getRecord(i.id);typeof n.response>"u"&&(n.response=zi(i)?{error:i.error}:{result:i.result},this.records.set(n.id,n),this.persist(),this.events.emit(an.updated,n))},this.get=async(i,n)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:i,id:n}),await this.getRecord(n)),this.delete=(i,n)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:n}),this.values.forEach(a=>{if(a.topic===i){if(typeof n<"u"&&a.id!==n)return;this.records.delete(a.id),this.events.emit(an.deleted,a)}}),this.persist()},this.exists=async(i,n)=>(this.isInitialized(),this.records.has(n)?(await this.getRecord(n)).topic===i:!1),this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=Yr(t,this.name)}get context(){return di(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(t=>{if(typeof t.response<"u")return;const i={topic:t.topic,request:qs(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const t=this.records.get(e);if(!t){const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(an.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(an.created,e=>{const t=an.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(an.updated,e=>{const t=an.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(an.deleted,e=>{const t=an.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(Ao.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{xe.toMiliseconds(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(an.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}class eN extends TM{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new Fi.EventEmitter,this.name=QP,this.version=XP,this.cached=[],this.initialized=!1,this.storagePrefix=kn,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=i=>{try{const n=this.formatTarget(i);return typeof this.getExpiration(n)<"u"}catch{return!1}},this.set=(i,n)=>{this.isInitialized();const a=this.formatTarget(i),f={target:a,expiry:n};this.expirations.set(a,f),this.checkExpiry(a,f),this.events.emit(Ui.created,{target:a,expiration:f})},this.get=i=>{this.isInitialized();const n=this.formatTarget(i);return this.getExpiration(n)},this.del=i=>{if(this.isInitialized(),this.has(i)){const n=this.formatTarget(i),a=this.getExpiration(n);this.expirations.delete(n),this.events.emit(Ui.deleted,{target:n,expiration:a})}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=Yr(t,this.name)}get context(){return di(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return lA(e);if(typeof e=="number")return dA(e);const{message:t}=Ae("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Ui.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:t}=Ae("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(t),new Error(t)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const t=this.expirations.get(e);if(!t){const{message:i}=Ae("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(i),new Error(i)}return t}checkExpiry(e,t){const{expiry:i}=t;xe.toMiliseconds(i)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(Ui.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(Ao.pulse,()=>this.checkExpirations()),this.events.on(Ui.created,e=>{const t=Ui.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Ui.expired,e=>{const t=Ui.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(Ui.deleted,e=>{const t=Ui.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}}var Qt={};Object.defineProperty(Qt,"__esModule",{value:!0}),Qt.getLocalStorage=Qt.getLocalStorageOrThrow=Qt.getCrypto=Qt.getCryptoOrThrow=Qt.getLocation=Qt.getLocationOrThrow=Qt.getNavigator=Qt.getNavigatorOrThrow=t2=Qt.getDocument=Qt.getDocumentOrThrow=Qt.getFromWindowOrThrow=Qt.getFromWindow=void 0;function Sa(r){let e;return typeof window<"u"&&typeof window[r]<"u"&&(e=window[r]),e}Qt.getFromWindow=Sa;function Eo(r){const e=Sa(r);if(!e)throw new Error(`${r} is not defined in Window`);return e}Qt.getFromWindowOrThrow=Eo;function tN(){return Eo("document")}Qt.getDocumentOrThrow=tN;function rN(){return Sa("document")}var t2=Qt.getDocument=rN;function iN(){return Eo("navigator")}Qt.getNavigatorOrThrow=iN;function nN(){return Sa("navigator")}Qt.getNavigator=nN;function sN(){return Eo("location")}Qt.getLocationOrThrow=sN;function aN(){return Sa("location")}Qt.getLocation=aN;function oN(){return Eo("crypto")}Qt.getCryptoOrThrow=oN;function cN(){return Sa("crypto")}Qt.getCrypto=cN;function fN(){return Eo("localStorage")}Qt.getLocalStorageOrThrow=fN;function hN(){return Sa("localStorage")}Qt.getLocalStorage=hN;class uN extends CM{constructor(e,t,i){super(e,t,i),this.core=e,this.logger=t,this.store=i,this.name=ZP,this.verifyUrlV3=tO,this.storagePrefix=kn,this.version=jm,this.init=async()=>{var n;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&xe.toMiliseconds((n=this.publicKey)==null?void 0:n.expiresAt){if(!Sc()||this.isDevEnv)return;const a=window.location.origin,{id:f,decryptedId:u}=n,b=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${a}&id=${f}&decryptedId=${u}`;try{const p=t2(),y=this.startAbortTimer(xe.ONE_SECOND*5),A=await new Promise((R,O)=>{const N=()=>{window.removeEventListener("message",W),p.body.removeChild(K),O("attestation aborted")};this.abortController.signal.addEventListener("abort",N);const K=p.createElement("iframe");K.src=b,K.style.display="none",K.addEventListener("error",N,{signal:this.abortController.signal});const W=Q=>{if(Q.data&&typeof Q.data=="string")try{const k=JSON.parse(Q.data);if(k.type==="verify_attestation"){if(nd(k.attestation).payload.id!==f)return;clearInterval(y),p.body.removeChild(K),this.abortController.signal.removeEventListener("abort",N),window.removeEventListener("message",W),R(k.attestation===null?"":k.attestation)}}catch(k){this.logger.warn(k)}};p.body.appendChild(K),window.addEventListener("message",W,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",A),A}catch(p){this.logger.warn(p)}return""},this.resolve=async n=>{if(this.isDevEnv)return"";const{attestationId:a,hash:f,encryptedId:u}=n;if(a===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(a){if(nd(a).payload.id!==u)return;const p=await this.isValidJwtAttestation(a);if(p){if(!p.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return p}}if(!f)return;const b=this.getVerifyUrl(n==null?void 0:n.verifyUrl);return this.fetchAttestation(f,b)},this.fetchAttestation=async(n,a)=>{this.logger.debug(`resolving attestation: ${n} from url: ${a}`);const f=this.startAbortTimer(xe.ONE_SECOND*5),u=await fetch(`${a}/attestation/${n}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(f),u.status===200?await u.json():void 0},this.getVerifyUrl=n=>{let a=n||uc;return rO.includes(a)||(this.logger.info(`verify url: ${a}, not included in trusted list, assigning default: ${uc}`),a=uc),a},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const n=this.startAbortTimer(xe.FIVE_SECONDS),a=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(n),await a.json()}catch(n){this.logger.warn(n)}},this.persistPublicKey=async n=>{this.logger.debug("persisting public key to local storage",n),await this.store.setItem(this.storeKey,n),this.publicKey=n},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async n=>{const a=await this.getPublicKey();try{if(a)return this.validateAttestation(n,a)}catch(u){this.logger.error(u),this.logger.warn("error validating attestation")}const f=await this.fetchAndPersistPublicKey();try{if(f)return this.validateAttestation(n,f)}catch(u){this.logger.error(u),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async a=>{const f=await this.fetchPublicKey();f&&(await this.persistPublicKey(f),a(f))});const n=await this.fetchPromise;return this.fetchPromise=void 0,n},this.validateAttestation=(n,a)=>{const f=MS(n,a.publicKey),u={hasExpired:xe.toMiliseconds(f.exp)this.abortController.abort(),xe.toMiliseconds(e))}}class lN extends DM{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context=iO,this.registerDeviceToken=async i=>{const{clientId:n,token:a,notificationType:f,enableEncrypted:u=!1}=i,b=`${nO}/${this.projectId}/clients`;await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:n,type:f,token:a,always_raw:u})})},this.logger=Yr(t,this.context)}}var dN=Object.defineProperty,nv=Object.getOwnPropertySymbols,pN=Object.prototype.hasOwnProperty,gN=Object.prototype.propertyIsEnumerable,sv=(r,e,t)=>e in r?dN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,tc=(r,e)=>{for(var t in e||(e={}))pN.call(e,t)&&sv(r,t,e[t]);if(nv)for(var t of nv(e))gN.call(e,t)&&sv(r,t,e[t]);return r};class vN extends LM{constructor(e,t,i=!0){super(e,t,i),this.core=e,this.logger=t,this.context=aO,this.storagePrefix=kn,this.storageVersion=sO,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!jd())try{const n={eventId:U1(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Nb(this.core.relayer.protocol,this.core.relayer.version,md)}}};await this.sendEvent([n])}catch(n){this.logger.warn(n)}},this.createEvent=n=>{const{event:a="ERROR",type:f="",properties:{topic:u,trace:b}}=n,p=U1(),y=this.core.projectId||"",A=Date.now(),R=tc({eventId:p,timestamp:A,props:{event:a,type:f,properties:{topic:u,trace:b}},bundleId:y,domain:this.getAppDomain()},this.setMethods(p));return this.telemetryEnabled&&(this.events.set(p,R),this.shouldPersist=!0),R},this.getEvent=n=>{const{eventId:a,topic:f}=n;if(a)return this.events.get(a);const u=Array.from(this.events.values()).find(b=>b.props.properties.topic===f);if(u)return tc(tc({},u),this.setMethods(u.eventId))},this.deleteEvent=n=>{const{eventId:a}=n;this.events.delete(a),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(Ao.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(n=>{xe.fromMiliseconds(Date.now())-xe.fromMiliseconds(n.timestamp)>oO&&(this.events.delete(n.eventId),this.shouldPersist=!0)})})},this.setMethods=n=>({addTrace:a=>this.addTrace(n,a),setError:a=>this.setError(n,a)}),this.addTrace=(n,a)=>{const f=this.events.get(n);f&&(f.props.properties.trace.push(a),this.events.set(n,f),this.shouldPersist=!0)},this.setError=(n,a)=>{const f=this.events.get(n);f&&(f.props.type=a,f.timestamp=Date.now(),this.events.set(n,f),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const n=await this.core.storage.getItem(this.storageKey)||[];if(!n.length)return;n.forEach(a=>{this.events.set(a.eventId,tc(tc({},a),this.setMethods(a.eventId)))})}catch(n){this.logger.warn(n)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const n=[];for(const[a,f]of this.events)f.props.type&&n.push(f);if(n.length!==0)try{if((await this.sendEvent(n)).ok)for(const a of n)this.events.delete(a.eventId),this.shouldPersist=!0}catch(a){this.logger.warn(a)}},this.sendEvent=async n=>{const a=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${cO}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${md}${a}`,{method:"POST",body:JSON.stringify(n)})},this.getAppDomain=()=>Rb().url,this.logger=Yr(t,this.context),this.telemetryEnabled=i,i?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var bN=Object.defineProperty,av=Object.getOwnPropertySymbols,mN=Object.prototype.hasOwnProperty,yN=Object.prototype.propertyIsEnumerable,ov=(r,e,t)=>e in r?bN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,cv=(r,e)=>{for(var t in e||(e={}))mN.call(e,t)&&ov(r,t,e[t]);if(av)for(var t of av(e))yN.call(e,t)&&ov(r,t,e[t]);return r};class t0 extends SM{constructor(e){var t;super(e),this.protocol=zm,this.version=jm,this.name=e0,this.events=new Fi.EventEmitter,this.initialized=!1,this.on=(f,u)=>this.events.on(f,u),this.once=(f,u)=>this.events.once(f,u),this.off=(f,u)=>this.events.off(f,u),this.removeListener=(f,u)=>this.events.removeListener(f,u),this.dispatchEnvelope=({topic:f,message:u,sessionExists:b})=>{if(!f||!u)return;const p={topic:f,message:u,publishedAt:Date.now(),transportType:Kt.link_mode};this.relayer.onLinkMessageEvent(p,{sessionExists:b})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Fm,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=Hh({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:PP.logger}),{logger:n,chunkLoggerController:a}=xM({opts:i,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=a,(t=this.logChunkController)!=null&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var f,u;(f=this.logChunkController)!=null&&f.downloadLogsBlobInBrowser&&((u=this.logChunkController)==null||u.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=Yr(n,this.name),this.heartbeat=new wI,this.crypto=new DR(this,this.logger,e==null?void 0:e.keychain),this.history=new ZR(this,this.logger),this.expirer=new eN(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new YI(cv(cv({},OP),e==null?void 0:e.storageOptions)),this.relayer=new WR({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new XR(this,this.logger),this.verify=new uN(this,this.logger,this.storage),this.echoClient=new lN(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new vN(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const t=new t0(e);await t.initialize();const i=await t.crypto.getClientId();return await t.storage.setItem(FP,i),t}get context(){return di(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(Hg,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(Hg)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const wN=t0,r2="wc",i2=2,n2="client",r0=`${r2}@${i2}:${n2}:`,$l={name:n2,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},fv="WALLETCONNECT_DEEPLINK_CHOICE",_N="proposal",s2="Proposal expired",AN="session",Ga=xe.SEVEN_DAYS,EN="engine",wr={wc_sessionPropose:{req:{ttl:xe.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:1104},res:{ttl:xe.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:1106},res:{ttl:xe.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:xe.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:xe.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:1112},res:{ttl:xe.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:xe.ONE_DAY,prompt:!1,tag:1114},res:{ttl:xe.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:xe.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:xe.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:xe.FIVE_MINUTES,prompt:!1,tag:1119}}},zl={min:xe.FIVE_MINUTES,max:xe.SEVEN_DAYS},An={idle:"IDLE",active:"ACTIVE"},xN="request",SN=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],IN="wc",MN="auth",PN="authKeys",ON="pairingTopics",RN="requests",Jh=`${IN}@${1.5}:${MN}:`,sh=`${Jh}:PUB_KEY`;var NN=Object.defineProperty,TN=Object.defineProperties,CN=Object.getOwnPropertyDescriptors,hv=Object.getOwnPropertySymbols,DN=Object.prototype.hasOwnProperty,LN=Object.prototype.propertyIsEnumerable,uv=(r,e,t)=>e in r?NN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,rr=(r,e)=>{for(var t in e||(e={}))DN.call(e,t)&&uv(r,t,e[t]);if(hv)for(var t of hv(e))LN.call(e,t)&&uv(r,t,e[t]);return r},cn=(r,e)=>TN(r,CN(e));class qN extends BM{constructor(e){super(e),this.name=EN,this.events=new Id,this.initialized=!1,this.requestQueue={state:An.idle,queue:[]},this.sessionRequestQueue={state:An.idle,queue:[]},this.requestQueueDelay=xe.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(wr)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},xe.toMiliseconds(this.requestQueueDelay)))},this.connect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const i=cn(rr({},t),{requiredNamespaces:t.requiredNamespaces||{},optionalNamespaces:t.optionalNamespaces||{}});await this.isValidConnect(i);const{pairingTopic:n,requiredNamespaces:a,optionalNamespaces:f,sessionProperties:u,relays:b}=i;let p=n,y,A=!1;try{p&&(A=this.client.core.pairing.pairings.get(p).active)}catch($){throw this.client.logger.error(`connect() -> pairing.get(${p}) failed`),$}if(!p||!A){const{topic:$,uri:F}=await this.client.core.pairing.create();p=$,y=F}if(!p){const{message:$}=Ae("NO_MATCHING_KEY",`connect() pairing topic: ${p}`);throw new Error($)}const R=await this.client.core.crypto.generateKeyPair(),O=wr.wc_sessionPropose.req.ttl||xe.FIVE_MINUTES,N=vr(O),K=rr({requiredNamespaces:a,optionalNamespaces:f,relays:b??[{protocol:km}],proposer:{publicKey:R,metadata:this.client.metadata},expiryTimestamp:N,pairingTopic:p},u&&{sessionProperties:u}),{reject:W,resolve:Q,done:k}=aa(O,s2);this.events.once(St("session_connect"),async({error:$,session:F})=>{if($)W($);else if(F){F.self.publicKey=R;const G=cn(rr({},F),{pairingTopic:K.pairingTopic,requiredNamespaces:K.requiredNamespaces,optionalNamespaces:K.optionalNamespaces,transportType:Kt.relay});await this.client.session.set(F.topic,G),await this.setExpiry(F.topic,F.expiry),p&&await this.client.core.pairing.updateMetadata({topic:p,metadata:F.peer.metadata}),this.cleanupDuplicatePairings(G),Q(G)}});const Y=await this.sendRequest({topic:p,method:"wc_sessionPropose",params:K,throwOnFailedPublish:!0});return await this.setProposal(Y,rr({id:Y},K)),{uri:y,approval:k}},this.pair=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(t)}catch(i){throw this.client.logger.error("pair() failed"),i}},this.approve=async t=>{var i,n,a;const f=this.client.core.eventClient.createEvent({properties:{topic:(i=t==null?void 0:t.id)==null?void 0:i.toString(),trace:[on.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(q){throw f.setError(na.no_internet_connection),q}try{await this.isValidProposalId(t==null?void 0:t.id)}catch(q){throw this.client.logger.error(`approve() -> proposal.get(${t==null?void 0:t.id}) failed`),f.setError(na.proposal_not_found),q}try{await this.isValidApprove(t)}catch(q){throw this.client.logger.error("approve() -> isValidApprove() failed"),f.setError(na.session_approve_namespace_validation_failure),q}const{id:u,relayProtocol:b,namespaces:p,sessionProperties:y,sessionConfig:A}=t,R=this.client.proposal.get(u);this.client.core.eventClient.deleteEvent({eventId:f.eventId});const{pairingTopic:O,proposer:N,requiredNamespaces:K,optionalNamespaces:W}=R;let Q=(n=this.client.core.eventClient)==null?void 0:n.getEvent({topic:O});Q||(Q=(a=this.client.core.eventClient)==null?void 0:a.createEvent({type:on.session_approve_started,properties:{topic:O,trace:[on.session_approve_started,on.session_namespaces_validation_success]}}));const k=await this.client.core.crypto.generateKeyPair(),Y=N.publicKey,$=await this.client.core.crypto.generateSharedKey(k,Y),F=rr(rr({relay:{protocol:b??"irn"},namespaces:p,controller:{publicKey:k,metadata:this.client.metadata},expiry:vr(Ga)},y&&{sessionProperties:y}),A&&{sessionConfig:A}),G=Kt.relay;Q.addTrace(on.subscribing_session_topic);try{await this.client.core.relayer.subscribe($,{transportType:G})}catch(q){throw Q.setError(na.subscribe_session_topic_failure),q}Q.addTrace(on.subscribe_session_topic_success);const x=cn(rr({},F),{topic:$,requiredNamespaces:K,optionalNamespaces:W,pairingTopic:O,acknowledged:!1,self:F.controller,peer:{publicKey:N.publicKey,metadata:N.metadata},controller:k,transportType:Kt.relay});await this.client.session.set($,x),Q.addTrace(on.store_session);try{Q.addTrace(on.publishing_session_settle),await this.sendRequest({topic:$,method:"wc_sessionSettle",params:F,throwOnFailedPublish:!0}).catch(q=>{throw Q==null||Q.setError(na.session_settle_publish_failure),q}),Q.addTrace(on.session_settle_publish_success),Q.addTrace(on.publishing_session_approve),await this.sendResult({id:u,topic:O,result:{relay:{protocol:b??"irn"},responderPublicKey:k},throwOnFailedPublish:!0}).catch(q=>{throw Q==null||Q.setError(na.session_approve_publish_failure),q}),Q.addTrace(on.session_approve_publish_success)}catch(q){throw this.client.logger.error(q),this.client.session.delete($,$t("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe($),q}return this.client.core.eventClient.deleteEvent({eventId:Q.eventId}),await this.client.core.pairing.updateMetadata({topic:O,metadata:N.metadata}),await this.client.proposal.delete(u,$t("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:O}),await this.setExpiry($,vr(Ga)),{topic:$,acknowledged:()=>Promise.resolve(this.client.session.get($))}},this.reject=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(t)}catch(f){throw this.client.logger.error("reject() -> isValidReject() failed"),f}const{id:i,reason:n}=t;let a;try{a=this.client.proposal.get(i).pairingTopic}catch(f){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),f}a&&(await this.sendError({id:i,topic:a,error:n,rpcOpts:wr.wc_sessionPropose.reject}),await this.client.proposal.delete(i,$t("USER_DISCONNECTED")))},this.update=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(t)}catch(A){throw this.client.logger.error("update() -> isValidUpdate() failed"),A}const{topic:i,namespaces:n}=t,{done:a,resolve:f,reject:u}=aa(),b=Ns(),p=fa().toString(),y=this.client.session.get(i).namespaces;return this.events.once(St("session_update",b),({error:A})=>{A?u(A):f()}),await this.client.session.update(i,{namespaces:n}),await this.sendRequest({topic:i,method:"wc_sessionUpdate",params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:b,relayRpcId:p}).catch(A=>{this.client.logger.error(A),this.client.session.update(i,{namespaces:y}),u(A)}),{acknowledged:a}},this.extend=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(t)}catch(b){throw this.client.logger.error("extend() -> isValidExtend() failed"),b}const{topic:i}=t,n=Ns(),{done:a,resolve:f,reject:u}=aa();return this.events.once(St("session_extend",n),({error:b})=>{b?u(b):f()}),await this.setExpiry(i,vr(Ga)),this.sendRequest({topic:i,method:"wc_sessionExtend",params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(b=>{u(b)}),{acknowledged:a}},this.request=async t=>{this.isInitialized();try{await this.isValidRequest(t)}catch(N){throw this.client.logger.error("request() -> isValidRequest() failed"),N}const{chainId:i,request:n,topic:a,expiry:f=wr.wc_sessionRequest.req.ttl}=t,u=this.client.session.get(a);(u==null?void 0:u.transportType)===Kt.relay&&await this.confirmOnlineStateOrThrow();const b=Ns(),p=fa().toString(),{done:y,resolve:A,reject:R}=aa(f,"Request expired. Please try again.");this.events.once(St("session_request",b),({error:N,result:K})=>{N?R(N):A(K)});const O=this.getAppLinkIfEnabled(u.peer.metadata,u.transportType);return O?(await this.sendRequest({clientRpcId:b,relayRpcId:p,topic:a,method:"wc_sessionRequest",params:{request:cn(rr({},n),{expiryTimestamp:vr(f)}),chainId:i},expiry:f,throwOnFailedPublish:!0,appLink:O}).catch(N=>R(N)),this.client.events.emit("session_request_sent",{topic:a,request:n,chainId:i,id:b}),await y()):await Promise.all([new Promise(async N=>{await this.sendRequest({clientRpcId:b,relayRpcId:p,topic:a,method:"wc_sessionRequest",params:{request:cn(rr({},n),{expiryTimestamp:vr(f)}),chainId:i},expiry:f,throwOnFailedPublish:!0}).catch(K=>R(K)),this.client.events.emit("session_request_sent",{topic:a,request:n,chainId:i,id:b}),N()}),new Promise(async N=>{var K;if(!((K=u.sessionConfig)!=null&&K.disableDeepLink)){const W=await vA(this.client.core.storage,fv);await pA({id:b,topic:a,wcDeepLink:W})}N()}),y()]).then(N=>N[2])},this.respond=async t=>{this.isInitialized(),await this.isValidRespond(t);const{topic:i,response:n}=t,{id:a}=n,f=this.client.session.get(i);f.transportType===Kt.relay&&await this.confirmOnlineStateOrThrow();const u=this.getAppLinkIfEnabled(f.peer.metadata,f.transportType);In(n)?await this.sendResult({id:a,topic:i,result:n.result,throwOnFailedPublish:!0,appLink:u}):zi(n)&&await this.sendError({id:a,topic:i,error:n.error,appLink:u}),this.cleanupAfterResponse(t)},this.ping=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(t)}catch(n){throw this.client.logger.error("ping() -> isValidPing() failed"),n}const{topic:i}=t;if(this.client.session.keys.includes(i)){const n=Ns(),a=fa().toString(),{done:f,resolve:u,reject:b}=aa();this.events.once(St("session_ping",n),({error:p})=>{p?b(p):u()}),await Promise.all([this.sendRequest({topic:i,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:n,relayRpcId:a}),f()])}else this.client.core.pairing.pairings.keys.includes(i)&&await this.client.core.pairing.ping({topic:i})},this.emit=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(t);const{topic:i,event:n,chainId:a}=t,f=fa().toString();await this.sendRequest({topic:i,method:"wc_sessionEvent",params:{event:n,chainId:a},throwOnFailedPublish:!0,relayRpcId:f})},this.disconnect=async t=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(t);const{topic:i}=t;if(this.client.session.keys.includes(i))await this.sendRequest({topic:i,method:"wc_sessionDelete",params:$t("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:i,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(i))await this.client.core.pairing.disconnect({topic:i});else{const{message:n}=Ae("MISMATCHED_TOPIC",`Session or pairing topic not found: ${i}`);throw new Error(n)}},this.find=t=>(this.isInitialized(),this.client.session.getAll().filter(i=>HS(i,t))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(t,i)=>{var n;this.isInitialized(),this.isValidAuthenticate(t);const a=i&&this.client.core.linkModeSupportedApps.includes(i)&&((n=this.client.metadata.redirect)==null?void 0:n.linkMode),f=a?Kt.link_mode:Kt.relay;f===Kt.relay&&await this.confirmOnlineStateOrThrow();const{chains:u,statement:b="",uri:p,domain:y,nonce:A,type:R,exp:O,nbf:N,methods:K=[],expiry:W}=t,Q=[...t.resources||[]],{topic:k,uri:Y}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:f});this.client.logger.info({message:"Generated new pairing",pairing:{topic:k,uri:Y}});const $=await this.client.core.crypto.generateKeyPair(),F=rh($);if(await Promise.all([this.client.auth.authKeys.set(sh,{responseTopic:F,publicKey:$}),this.client.auth.pairingTopics.set(F,{topic:F,pairingTopic:k})]),await this.client.core.relayer.subscribe(F,{transportType:f}),this.client.logger.info(`sending request to new pairing topic: ${k}`),K.length>0){const{namespace:M}=ac(u[0]);let S=uS(M,"request",K);th(Q)&&(S=dS(S,Q.pop())),Q.push(S)}const G=W&&W>wr.wc_sessionAuthenticate.req.ttl?W:wr.wc_sessionAuthenticate.req.ttl,x={authPayload:{type:R??"caip122",chains:u,statement:b,aud:p,domain:y,version:"1",nonce:A,iat:new Date().toISOString(),exp:O,nbf:N,resources:Q},requester:{publicKey:$,metadata:this.client.metadata},expiryTimestamp:vr(G)},q={eip155:{chains:u,methods:[...new Set(["personal_sign",...K])],events:["chainChanged","accountsChanged"]}},ae={requiredNamespaces:{},optionalNamespaces:q,relays:[{protocol:"irn"}],pairingTopic:k,proposer:{publicKey:$,metadata:this.client.metadata},expiryTimestamp:vr(wr.wc_sessionPropose.req.ttl)},{done:le,resolve:L,reject:m}=aa(G,"Request expired"),c=async({error:M,session:S})=>{if(this.events.off(St("session_request",v),h),M)m(M);else if(S){S.self.publicKey=$,await this.client.session.set(S.topic,S),await this.setExpiry(S.topic,S.expiry),k&&await this.client.core.pairing.updateMetadata({topic:k,metadata:S.peer.metadata});const d=this.client.session.get(S.topic);await this.deleteProposal(_),L({session:d})}},h=async M=>{var S,d,g;if(await this.deletePendingAuthRequest(v,{message:"fulfilled",code:0}),M.error){const j=$t("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return M.error.code===j.code?void 0:(this.events.off(St("session_connect"),c),m(M.error.message))}await this.deleteProposal(_),this.events.off(St("session_connect"),c);const{cacaos:C,responder:Z}=M.result,se=[],P=[];for(const j of C){await hg({cacao:j,projectId:this.client.core.projectId})||(this.client.logger.error(j,"Signature verification failed"),m($t("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:H}=j,w=th(H.resources),z=[fg(H.iss)],ne=mh(H.iss);if(w){const ce=ug(w),he=lg(w);se.push(...ce),z.push(...he)}for(const ce of z)P.push(`${ce}:${ne}`)}const ee=await this.client.core.crypto.generateSharedKey($,Z.publicKey);let B;se.length>0&&(B={topic:ee,acknowledged:!0,self:{publicKey:$,metadata:this.client.metadata},peer:Z,controller:Z.publicKey,expiry:vr(Ga),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:k,namespaces:_g([...new Set(se)],[...new Set(P)]),transportType:f},await this.client.core.relayer.subscribe(ee,{transportType:f}),await this.client.session.set(ee,B),k&&await this.client.core.pairing.updateMetadata({topic:k,metadata:Z.metadata}),B=this.client.session.get(ee)),(S=this.client.metadata.redirect)!=null&&S.linkMode&&(d=Z.metadata.redirect)!=null&&d.linkMode&&(g=Z.metadata.redirect)!=null&&g.universal&&i&&(this.client.core.addLinkModeSupportedApp(Z.metadata.redirect.universal),this.client.session.update(ee,{transportType:Kt.link_mode})),L({auths:C,session:B})},v=Ns(),_=Ns();this.events.once(St("session_connect"),c),this.events.once(St("session_request",v),h);let I;try{if(a){const M=qs("wc_sessionAuthenticate",x,v);this.client.core.history.set(k,M);const S=await this.client.core.crypto.encode("",M,{type:Oc,encoding:Yo});I=Ff(i,k,S)}else await Promise.all([this.sendRequest({topic:k,method:"wc_sessionAuthenticate",params:x,expiry:t.expiry,throwOnFailedPublish:!0,clientRpcId:v}),this.sendRequest({topic:k,method:"wc_sessionPropose",params:ae,expiry:wr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:_})])}catch(M){throw this.events.off(St("session_connect"),c),this.events.off(St("session_request",v),h),M}return await this.setProposal(_,rr({id:_},ae)),await this.setAuthRequest(v,{request:cn(rr({},x),{verifyContext:{}}),pairingTopic:k,transportType:f}),{uri:I??Y,response:le}},this.approveSessionAuthenticate=async t=>{const{id:i,auths:n}=t,a=this.client.core.eventClient.createEvent({properties:{topic:i.toString(),trace:[sa.authenticated_session_approve_started]}});try{this.isInitialized()}catch(W){throw a.setError(Zo.no_internet_connection),W}const f=this.getPendingAuthRequest(i);if(!f)throw a.setError(Zo.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${i}`);const u=f.transportType||Kt.relay;u===Kt.relay&&await this.confirmOnlineStateOrThrow();const b=f.requester.publicKey,p=await this.client.core.crypto.generateKeyPair(),y=rh(b),A={type:ls,receiverPublicKey:b,senderPublicKey:p},R=[],O=[];for(const W of n){if(!await hg({cacao:W,projectId:this.client.core.projectId})){a.setError(Zo.invalid_cacao);const F=$t("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:i,topic:y,error:F,encodeOpts:A}),new Error(F.message)}a.addTrace(sa.cacaos_verified);const{p:Q}=W,k=th(Q.resources),Y=[fg(Q.iss)],$=mh(Q.iss);if(k){const F=ug(k),G=lg(k);R.push(...F),Y.push(...G)}for(const F of Y)O.push(`${F}:${$}`)}const N=await this.client.core.crypto.generateSharedKey(p,b);a.addTrace(sa.create_authenticated_session_topic);let K;if((R==null?void 0:R.length)>0){K={topic:N,acknowledged:!0,self:{publicKey:p,metadata:this.client.metadata},peer:{publicKey:b,metadata:f.requester.metadata},controller:b,expiry:vr(Ga),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:f.pairingTopic,namespaces:_g([...new Set(R)],[...new Set(O)]),transportType:u},a.addTrace(sa.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(N,{transportType:u})}catch(W){throw a.setError(Zo.subscribe_authenticated_session_topic_failure),W}a.addTrace(sa.subscribe_authenticated_session_topic_success),await this.client.session.set(N,K),a.addTrace(sa.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:f.pairingTopic,metadata:f.requester.metadata})}a.addTrace(sa.publishing_authenticated_session_approve);try{await this.sendResult({topic:y,id:i,result:{cacaos:n,responder:{publicKey:p,metadata:this.client.metadata}},encodeOpts:A,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(f.requester.metadata,u)})}catch(W){throw a.setError(Zo.authenticated_session_approve_publish_failure),W}return await this.client.auth.requests.delete(i,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:f.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:a.eventId}),{session:K}},this.rejectSessionAuthenticate=async t=>{this.isInitialized();const{id:i,reason:n}=t,a=this.getPendingAuthRequest(i);if(!a)throw new Error(`Could not find pending auth request with id ${i}`);a.transportType===Kt.relay&&await this.confirmOnlineStateOrThrow();const f=a.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),b=rh(f),p={type:ls,receiverPublicKey:f,senderPublicKey:u};await this.sendError({id:i,topic:b,error:n,encodeOpts:p,rpcOpts:wr.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(a.requester.metadata,a.transportType)}),await this.client.auth.requests.delete(i,{message:"rejected",code:0}),await this.client.proposal.delete(i,$t("USER_DISCONNECTED"))},this.formatAuthMessage=t=>{this.isInitialized();const{request:i,iss:n}=t;return mm(i,n)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const t=this.relayMessageCache.shift();t&&await this.onRelayMessage(t)}catch(t){this.client.logger.error(t)}},50)},this.cleanupDuplicatePairings=async t=>{if(t.pairingTopic)try{const i=this.client.core.pairing.pairings.get(t.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(a=>{var f,u;return((f=a.peerMetadata)==null?void 0:f.url)&&((u=a.peerMetadata)==null?void 0:u.url)===t.peer.metadata.url&&a.topic&&a.topic!==i.topic});if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(i){this.client.logger.error(i)}},this.deleteSession=async t=>{var i;const{topic:n,expirerHasDeleted:a=!1,emitEvent:f=!0,id:u=0}=t,{self:b}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,$t("USER_DISCONNECTED")),this.addToRecentlyDeleted(n,"session"),this.client.core.crypto.keychain.has(b.publicKey)&&await this.client.core.crypto.deleteKeyPair(b.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),a||this.client.core.expirer.del(n),this.client.core.storage.removeItem(fv).catch(p=>this.client.logger.warn(p)),this.getPendingSessionRequests().forEach(p=>{p.topic===n&&this.deletePendingSessionRequest(p.id,$t("USER_DISCONNECTED"))}),n===((i=this.sessionRequestQueue.queue[0])==null?void 0:i.topic)&&(this.sessionRequestQueue.state=An.idle),f&&this.client.events.emit("session_delete",{id:u,topic:n})},this.deleteProposal=async(t,i)=>{if(i)try{const n=this.client.proposal.get(t),a=this.client.core.eventClient.getEvent({topic:n.pairingTopic});a==null||a.setError(na.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(t,$t("USER_DISCONNECTED")),i?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"proposal")},this.deletePendingSessionRequest=async(t,i,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(t,i),n?Promise.resolve():this.client.core.expirer.del(t)]),this.addToRecentlyDeleted(t,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==t),n&&(this.sessionRequestQueue.state=An.idle,this.client.events.emit("session_request_expire",{id:t}))},this.deletePendingAuthRequest=async(t,i,n=!1)=>{await Promise.all([this.client.auth.requests.delete(t,i),n?Promise.resolve():this.client.core.expirer.del(t)])},this.setExpiry=async(t,i)=>{this.client.session.keys.includes(t)&&(this.client.core.expirer.set(t,i),await this.client.session.update(t,{expiry:i}))},this.setProposal=async(t,i)=>{this.client.core.expirer.set(t,vr(wr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(t,i)},this.setAuthRequest=async(t,i)=>{const{request:n,pairingTopic:a,transportType:f=Kt.relay}=i;this.client.core.expirer.set(t,n.expiryTimestamp),await this.client.auth.requests.set(t,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:t,pairingTopic:a,verifyContext:n.verifyContext,transportType:f})},this.setPendingSessionRequest=async t=>{const{id:i,topic:n,params:a,verifyContext:f}=t,u=a.request.expiryTimestamp||vr(wr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(i,u),await this.client.pendingRequest.set(i,{id:i,topic:n,params:a,verifyContext:f})},this.sendRequest=async t=>{const{topic:i,method:n,params:a,expiry:f,relayRpcId:u,clientRpcId:b,throwOnFailedPublish:p,appLink:y}=t,A=qs(n,a,b);let R;const O=!!y;try{const W=O?Yo:Ls;R=await this.client.core.crypto.encode(i,A,{encoding:W})}catch(W){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),W}let N;if(SN.includes(n)){const W=cs(JSON.stringify(A)),Q=cs(R);N=await this.client.core.verify.register({id:Q,decryptedId:W})}const K=wr[n].req;if(K.attestation=N,f&&(K.ttl=f),u&&(K.id=u),this.client.core.history.set(i,A),O){const W=Ff(y,i,R);await globalThis.Linking.openURL(W,this.client.name)}else{const W=wr[n].req;f&&(W.ttl=f),u&&(W.id=u),p?(W.internal=cn(rr({},W.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,R,W)):this.client.core.relayer.publish(i,R,W).catch(Q=>this.client.logger.error(Q))}return A.id},this.sendResult=async t=>{const{id:i,topic:n,result:a,throwOnFailedPublish:f,encodeOpts:u,appLink:b}=t,p=Kh(i,a);let y;const A=b&&typeof(globalThis==null?void 0:globalThis.Linking)<"u";try{const O=A?Yo:Ls;y=await this.client.core.crypto.encode(n,p,cn(rr({},u||{}),{encoding:O}))}catch(O){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),O}let R;try{R=await this.client.core.history.get(n,i)}catch(O){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${i}) failed`),O}if(A){const O=Ff(b,n,y);await globalThis.Linking.openURL(O,this.client.name)}else{const O=wr[R.request.method].res;f?(O.internal=cn(rr({},O.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,y,O)):this.client.core.relayer.publish(n,y,O).catch(N=>this.client.logger.error(N))}await this.client.core.history.resolve(p)},this.sendError=async t=>{const{id:i,topic:n,error:a,encodeOpts:f,rpcOpts:u,appLink:b}=t,p=Vh(i,a);let y;const A=b&&typeof(globalThis==null?void 0:globalThis.Linking)<"u";try{const O=A?Yo:Ls;y=await this.client.core.crypto.encode(n,p,cn(rr({},f||{}),{encoding:O}))}catch(O){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),O}let R;try{R=await this.client.core.history.get(n,i)}catch(O){throw this.client.logger.error(`sendError() -> history.get(${n}, ${i}) failed`),O}if(A){const O=Ff(b,n,y);await globalThis.Linking.openURL(O,this.client.name)}else{const O=u||wr[R.request.method].res;this.client.core.relayer.publish(n,y,O)}await this.client.core.history.resolve(p)},this.cleanup=async()=>{const t=[],i=[];this.client.session.getAll().forEach(n=>{let a=!1;Os(n.expiry)&&(a=!0),this.client.core.crypto.keychain.has(n.topic)||(a=!0),a&&t.push(n.topic)}),this.client.proposal.getAll().forEach(n=>{Os(n.expiryTimestamp)&&i.push(n.id)}),await Promise.all([...t.map(n=>this.deleteSession({topic:n})),...i.map(n=>this.deleteProposal(n))])},this.onRelayEventRequest=async t=>{this.requestQueue.queue.push(t),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===An.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=An.active;const t=this.requestQueue.queue.shift();if(t)try{await this.processRequest(t)}catch(i){this.client.logger.warn(i)}}this.requestQueue.state=An.idle},this.processRequest=async t=>{const{topic:i,payload:n,attestation:a,transportType:f,encryptedId:u}=t,b=n.method;if(!this.shouldIgnorePairingRequest({topic:i,requestMethod:b}))switch(b){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:i,payload:n,attestation:a,encryptedId:u});case"wc_sessionSettle":return await this.onSessionSettleRequest(i,n);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(i,n);case"wc_sessionExtend":return await this.onSessionExtendRequest(i,n);case"wc_sessionPing":return await this.onSessionPingRequest(i,n);case"wc_sessionDelete":return await this.onSessionDeleteRequest(i,n);case"wc_sessionRequest":return await this.onSessionRequest({topic:i,payload:n,attestation:a,encryptedId:u,transportType:f});case"wc_sessionEvent":return await this.onSessionEventRequest(i,n);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:i,payload:n,attestation:a,encryptedId:u,transportType:f});default:return this.client.logger.info(`Unsupported request method ${b}`)}},this.onRelayEventResponse=async t=>{const{topic:i,payload:n,transportType:a}=t,f=(await this.client.core.history.get(i,n.id)).request.method;switch(f){case"wc_sessionPropose":return this.onSessionProposeResponse(i,n,a);case"wc_sessionSettle":return this.onSessionSettleResponse(i,n);case"wc_sessionUpdate":return this.onSessionUpdateResponse(i,n);case"wc_sessionExtend":return this.onSessionExtendResponse(i,n);case"wc_sessionPing":return this.onSessionPingResponse(i,n);case"wc_sessionRequest":return this.onSessionRequestResponse(i,n);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(i,n);default:return this.client.logger.info(`Unsupported response method ${f}`)}},this.onRelayEventUnknownPayload=t=>{const{topic:i}=t,{message:n}=Ae("MISSING_OR_INVALID",`Decoded payload on topic ${i} is not identifiable as a JSON-RPC request or a response.`);throw new Error(n)},this.shouldIgnorePairingRequest=t=>{const{topic:i,requestMethod:n}=t,a=this.expectedPairingMethodMap.get(i);return!a||a.includes(n)?!1:!!(a.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async t=>{const{topic:i,payload:n,attestation:a,encryptedId:f}=t,{params:u,id:b}=n;try{const p=this.client.core.eventClient.getEvent({topic:i});this.isValidConnect(rr({},n.params));const y=u.expiryTimestamp||vr(wr.wc_sessionPropose.req.ttl),A=rr({id:b,pairingTopic:i,expiryTimestamp:y},u);await this.setProposal(b,A);const R=await this.getVerifyContext({attestationId:a,hash:cs(JSON.stringify(n)),encryptedId:f,metadata:A.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),p==null||p.setError(as.proposal_listener_not_found)),p==null||p.addTrace(En.emit_session_proposal),this.client.events.emit("session_proposal",{id:b,params:A,verifyContext:R})}catch(p){await this.sendError({id:b,topic:i,error:p,rpcOpts:wr.wc_sessionPropose.autoReject}),this.client.logger.error(p)}},this.onSessionProposeResponse=async(t,i,n)=>{const{id:a}=i;if(In(i)){const{result:f}=i;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:f});const u=this.client.proposal.get(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:u});const b=u.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:b});const p=f.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:p});const y=await this.client.core.crypto.generateSharedKey(b,p);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:y});const A=await this.client.core.relayer.subscribe(y,{transportType:n});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:A}),await this.client.core.pairing.activate({topic:t})}else if(zi(i)){await this.client.proposal.delete(a,$t("USER_DISCONNECTED"));const f=St("session_connect");if(this.events.listenerCount(f)===0)throw new Error(`emitting ${f} without any listeners, 954`);this.events.emit(St("session_connect"),{error:i.error})}},this.onSessionSettleRequest=async(t,i)=>{const{id:n,params:a}=i;try{this.isValidSessionSettleRequest(a);const{relay:f,controller:u,expiry:b,namespaces:p,sessionProperties:y,sessionConfig:A}=i.params,R=cn(rr(rr({topic:t,relay:f,expiry:b,namespaces:p,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},y&&{sessionProperties:y}),A&&{sessionConfig:A}),{transportType:Kt.relay}),O=St("session_connect");if(this.events.listenerCount(O)===0)throw new Error(`emitting ${O} without any listeners 997`);this.events.emit(St("session_connect"),{session:R}),await this.sendResult({id:i.id,topic:t,result:!0,throwOnFailedPublish:!0})}catch(f){await this.sendError({id:n,topic:t,error:f}),this.client.logger.error(f)}},this.onSessionSettleResponse=async(t,i)=>{const{id:n}=i;In(i)?(await this.client.session.update(t,{acknowledged:!0}),this.events.emit(St("session_approve",n),{})):zi(i)&&(await this.client.session.delete(t,$t("USER_DISCONNECTED")),this.events.emit(St("session_approve",n),{error:i.error}))},this.onSessionUpdateRequest=async(t,i)=>{const{params:n,id:a}=i;try{const f=`${t}_session_update`,u=Qo.get(f);if(u&&this.isRequestOutOfSync(u,a)){this.client.logger.info(`Discarding out of sync request - ${a}`),this.sendError({id:a,topic:t,error:$t("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(rr({topic:t},n));try{Qo.set(f,a),await this.client.session.update(t,{namespaces:n.namespaces}),await this.sendResult({id:a,topic:t,result:!0,throwOnFailedPublish:!0})}catch(b){throw Qo.delete(f),b}this.client.events.emit("session_update",{id:a,topic:t,params:n})}catch(f){await this.sendError({id:a,topic:t,error:f}),this.client.logger.error(f)}},this.isRequestOutOfSync=(t,i)=>parseInt(i.toString().slice(0,-3))<=parseInt(t.toString().slice(0,-3)),this.onSessionUpdateResponse=(t,i)=>{const{id:n}=i,a=St("session_update",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);In(i)?this.events.emit(St("session_update",n),{}):zi(i)&&this.events.emit(St("session_update",n),{error:i.error})},this.onSessionExtendRequest=async(t,i)=>{const{id:n}=i;try{this.isValidExtend({topic:t}),await this.setExpiry(t,vr(Ga)),await this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:n,topic:t})}catch(a){await this.sendError({id:n,topic:t,error:a}),this.client.logger.error(a)}},this.onSessionExtendResponse=(t,i)=>{const{id:n}=i,a=St("session_extend",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);In(i)?this.events.emit(St("session_extend",n),{}):zi(i)&&this.events.emit(St("session_extend",n),{error:i.error})},this.onSessionPingRequest=async(t,i)=>{const{id:n}=i;try{this.isValidPing({topic:t}),await this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:n,topic:t})}catch(a){await this.sendError({id:n,topic:t,error:a}),this.client.logger.error(a)}},this.onSessionPingResponse=(t,i)=>{const{id:n}=i,a=St("session_ping",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);setTimeout(()=>{In(i)?this.events.emit(St("session_ping",n),{}):zi(i)&&this.events.emit(St("session_ping",n),{error:i.error})},500)},this.onSessionDeleteRequest=async(t,i)=>{const{id:n}=i;try{this.isValidDisconnect({topic:t,reason:i.params}),Promise.all([new Promise(a=>{this.client.core.relayer.once(Gr.publish,async()=>{a(await this.deleteSession({topic:t,id:n}))})}),this.sendResult({id:n,topic:t,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:t,error:$t("USER_DISCONNECTED")})]).catch(a=>this.client.logger.error(a))}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async t=>{var i,n,a;const{topic:f,payload:u,attestation:b,encryptedId:p,transportType:y}=t,{id:A,params:R}=u;try{await this.isValidRequest(rr({topic:f},R));const O=this.client.session.get(f),N=await this.getVerifyContext({attestationId:b,hash:cs(JSON.stringify(qs("wc_sessionRequest",R,A))),encryptedId:p,metadata:O.peer.metadata,transportType:y}),K={id:A,topic:f,params:R,verifyContext:N};await this.setPendingSessionRequest(K),y===Kt.link_mode&&(i=O.peer.metadata.redirect)!=null&&i.universal&&this.client.core.addLinkModeSupportedApp((n=O.peer.metadata.redirect)==null?void 0:n.universal),(a=this.client.signConfig)!=null&&a.disableRequestQueue?this.emitSessionRequest(K):(this.addSessionRequestToSessionRequestQueue(K),this.processSessionRequestQueue())}catch(O){await this.sendError({id:A,topic:f,error:O}),this.client.logger.error(O)}},this.onSessionRequestResponse=(t,i)=>{const{id:n}=i,a=St("session_request",n);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);In(i)?this.events.emit(St("session_request",n),{result:i.result}):zi(i)&&this.events.emit(St("session_request",n),{error:i.error})},this.onSessionEventRequest=async(t,i)=>{const{id:n,params:a}=i;try{const f=`${t}_session_event_${a.event.name}`,u=Qo.get(f);if(u&&this.isRequestOutOfSync(u,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit(rr({topic:t},a)),this.client.events.emit("session_event",{id:n,topic:t,params:a}),Qo.set(f,n)}catch(f){await this.sendError({id:n,topic:t,error:f}),this.client.logger.error(f)}},this.onSessionAuthenticateResponse=(t,i)=>{const{id:n}=i;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:t,payload:i}),In(i)?this.events.emit(St("session_request",n),{result:i.result}):zi(i)&&this.events.emit(St("session_request",n),{error:i.error})},this.onSessionAuthenticateRequest=async t=>{var i;const{topic:n,payload:a,attestation:f,encryptedId:u,transportType:b}=t;try{const{requester:p,authPayload:y,expiryTimestamp:A}=a.params,R=await this.getVerifyContext({attestationId:f,hash:cs(JSON.stringify(a)),encryptedId:u,metadata:p.metadata,transportType:b}),O={requester:p,pairingTopic:n,id:a.id,authPayload:y,verifyContext:R,expiryTimestamp:A};await this.setAuthRequest(a.id,{request:O,pairingTopic:n,transportType:b}),b===Kt.link_mode&&(i=p.metadata.redirect)!=null&&i.universal&&this.client.core.addLinkModeSupportedApp(p.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:n,params:a.params,id:a.id,verifyContext:R})}catch(p){this.client.logger.error(p);const y=a.params.requester.publicKey,A=await this.client.core.crypto.generateKeyPair(),R=this.getAppLinkIfEnabled(a.params.requester.metadata,b),O={type:ls,receiverPublicKey:y,senderPublicKey:A};await this.sendError({id:a.id,topic:n,error:p,encodeOpts:O,rpcOpts:wr.wc_sessionAuthenticate.autoReject,appLink:R})}},this.addSessionRequestToSessionRequestQueue=t=>{this.sessionRequestQueue.queue.push(t)},this.cleanupAfterResponse=t=>{this.deletePendingSessionRequest(t.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=An.idle,this.processSessionRequestQueue()},xe.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:t,error:i})=>{const n=this.client.core.history.pending;n.length>0&&n.filter(a=>a.topic===t&&a.request.method==="wc_sessionRequest").forEach(a=>{const f=a.request.id,u=St("session_request",f);if(this.events.listenerCount(u)===0)throw new Error(`emitting ${u} without any listeners`);this.events.emit(St("session_request",a.request.id),{error:i})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===An.active){this.client.logger.info("session request queue is already active.");return}const t=this.sessionRequestQueue.queue[0];if(!t){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=An.active,this.emitSessionRequest(t)}catch(i){this.client.logger.error(i)}},this.emitSessionRequest=t=>{this.client.events.emit("session_request",t)},this.onPairingCreated=t=>{if(t.methods&&this.expectedPairingMethodMap.set(t.topic,t.methods),t.active)return;const i=this.client.proposal.getAll().find(n=>n.pairingTopic===t.topic);i&&this.onSessionProposeRequest({topic:t.topic,payload:qs("wc_sessionPropose",{requiredNamespaces:i.requiredNamespaces,optionalNamespaces:i.optionalNamespaces,relays:i.relays,proposer:i.proposer,sessionProperties:i.sessionProperties},i.id)})},this.isValidConnect=async t=>{if(!oi(t)){const{message:b}=Ae("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(t)}`);throw new Error(b)}const{pairingTopic:i,requiredNamespaces:n,optionalNamespaces:a,sessionProperties:f,relays:u}=t;if(fi(i)||await this.isValidPairingTopic(i),!rI(u)){const{message:b}=Ae("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(b)}!fi(n)&&bc(n)!==0&&this.validateNamespaces(n,"requiredNamespaces"),!fi(a)&&bc(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),fi(f)||this.validateSessionProps(f,"sessionProperties")},this.validateNamespaces=(t,i)=>{const n=tI(t,"connect()",i);if(n)throw new Error(n.message)},this.isValidApprove=async t=>{if(!oi(t))throw new Error(Ae("MISSING_OR_INVALID",`approve() params: ${t}`).message);const{id:i,namespaces:n,relayProtocol:a,sessionProperties:f}=t;this.checkRecentlyDeleted(i),await this.isValidProposalId(i);const u=this.client.proposal.get(i),b=Tl(n,"approve()");if(b)throw new Error(b.message);const p=xg(u.requiredNamespaces,n,"approve()");if(p)throw new Error(p.message);if(!fr(a,!0)){const{message:y}=Ae("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(y)}fi(f)||this.validateSessionProps(f,"sessionProperties")},this.isValidReject=async t=>{if(!oi(t)){const{message:a}=Ae("MISSING_OR_INVALID",`reject() params: ${t}`);throw new Error(a)}const{id:i,reason:n}=t;if(this.checkRecentlyDeleted(i),await this.isValidProposalId(i),!nI(n)){const{message:a}=Ae("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(n)}`);throw new Error(a)}},this.isValidSessionSettleRequest=t=>{if(!oi(t)){const{message:p}=Ae("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${t}`);throw new Error(p)}const{relay:i,controller:n,namespaces:a,expiry:f}=t;if(!Im(i)){const{message:p}=Ae("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(p)}const u=JS(n,"onSessionSettleRequest()");if(u)throw new Error(u.message);const b=Tl(a,"onSessionSettleRequest()");if(b)throw new Error(b.message);if(Os(f)){const{message:p}=Ae("EXPIRED","onSessionSettleRequest()");throw new Error(p)}},this.isValidUpdate=async t=>{if(!oi(t)){const{message:b}=Ae("MISSING_OR_INVALID",`update() params: ${t}`);throw new Error(b)}const{topic:i,namespaces:n}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const a=this.client.session.get(i),f=Tl(n,"update()");if(f)throw new Error(f.message);const u=xg(a.requiredNamespaces,n,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async t=>{if(!oi(t)){const{message:n}=Ae("MISSING_OR_INVALID",`extend() params: ${t}`);throw new Error(n)}const{topic:i}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i)},this.isValidRequest=async t=>{if(!oi(t)){const{message:b}=Ae("MISSING_OR_INVALID",`request() params: ${t}`);throw new Error(b)}const{topic:i,request:n,chainId:a,expiry:f}=t;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const{namespaces:u}=this.client.session.get(i);if(!Eg(u,a)){const{message:b}=Ae("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(b)}if(!sI(n)){const{message:b}=Ae("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw new Error(b)}if(!cI(u,a,n.method)){const{message:b}=Ae("MISSING_OR_INVALID",`request() method: ${n.method}`);throw new Error(b)}if(f&&!lI(f,zl)){const{message:b}=Ae("MISSING_OR_INVALID",`request() expiry: ${f}. Expiry must be a number (in seconds) between ${zl.min} and ${zl.max}`);throw new Error(b)}},this.isValidRespond=async t=>{var i;if(!oi(t)){const{message:f}=Ae("MISSING_OR_INVALID",`respond() params: ${t}`);throw new Error(f)}const{topic:n,response:a}=t;try{await this.isValidSessionTopic(n)}catch(f){throw(i=t==null?void 0:t.response)!=null&&i.id&&this.cleanupAfterResponse(t),f}if(!aI(a)){const{message:f}=Ae("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(f)}},this.isValidPing=async t=>{if(!oi(t)){const{message:n}=Ae("MISSING_OR_INVALID",`ping() params: ${t}`);throw new Error(n)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidEmit=async t=>{if(!oi(t)){const{message:u}=Ae("MISSING_OR_INVALID",`emit() params: ${t}`);throw new Error(u)}const{topic:i,event:n,chainId:a}=t;await this.isValidSessionTopic(i);const{namespaces:f}=this.client.session.get(i);if(!Eg(f,a)){const{message:u}=Ae("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(u)}if(!oI(n)){const{message:u}=Ae("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(u)}if(!fI(f,a,n.name)){const{message:u}=Ae("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(u)}},this.isValidDisconnect=async t=>{if(!oi(t)){const{message:n}=Ae("MISSING_OR_INVALID",`disconnect() params: ${t}`);throw new Error(n)}const{topic:i}=t;await this.isValidSessionOrPairingTopic(i)},this.isValidAuthenticate=t=>{const{chains:i,uri:n,domain:a,nonce:f}=t;if(!Array.isArray(i)||i.length===0)throw new Error("chains is required and must be a non-empty array");if(!fr(n,!1))throw new Error("uri is required parameter");if(!fr(a,!1))throw new Error("domain is required parameter");if(!fr(f,!1))throw new Error("nonce is required parameter");if([...new Set(i.map(b=>ac(b).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:u}=ac(i[0]);if(u!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async t=>{const{attestationId:i,hash:n,encryptedId:a,metadata:f,transportType:u}=t,b={verified:{verifyUrl:f.verifyUrl||uc,validation:"UNKNOWN",origin:f.url||""}};try{if(u===Kt.link_mode){const y=this.getAppLinkIfEnabled(f,u);return b.verified.validation=y&&new URL(y).origin===new URL(f.url).origin?"VALID":"INVALID",b}const p=await this.client.core.verify.resolve({attestationId:i,hash:n,encryptedId:a,verifyUrl:f.verifyUrl});p&&(b.verified.origin=p.origin,b.verified.isScam=p.isScam,b.verified.validation=p.origin===new URL(f.url).origin?"VALID":"INVALID")}catch(p){this.client.logger.warn(p)}return this.client.logger.debug(`Verify context: ${JSON.stringify(b)}`),b},this.validateSessionProps=(t,i)=>{Object.values(t).forEach(n=>{if(!fr(n,!1)){const{message:a}=Ae("MISSING_OR_INVALID",`${i} must be in Record format. Received: ${JSON.stringify(n)}`);throw new Error(a)}})},this.getPendingAuthRequest=t=>{const i=this.client.auth.requests.get(t);return typeof i=="object"?i:void 0},this.addToRecentlyDeleted=(t,i)=>{if(this.recentlyDeletedMap.set(t,i),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let n=0;const a=this.recentlyDeletedLimit/2;for(const f of this.recentlyDeletedMap.keys()){if(n++>=a)break;this.recentlyDeletedMap.delete(f)}}},this.checkRecentlyDeleted=t=>{const i=this.recentlyDeletedMap.get(t);if(i){const{message:n}=Ae("MISSING_OR_INVALID",`Record was recently deleted - ${i}: ${t}`);throw new Error(n)}},this.isLinkModeEnabled=(t,i)=>{var n,a,f,u,b,p,y,A,R;return!t||i!==Kt.link_mode?!1:((a=(n=this.client.metadata)==null?void 0:n.redirect)==null?void 0:a.linkMode)===!0&&((u=(f=this.client.metadata)==null?void 0:f.redirect)==null?void 0:u.universal)!==void 0&&((p=(b=this.client.metadata)==null?void 0:b.redirect)==null?void 0:p.universal)!==""&&((y=t==null?void 0:t.redirect)==null?void 0:y.universal)!==void 0&&((A=t==null?void 0:t.redirect)==null?void 0:A.universal)!==""&&((R=t==null?void 0:t.redirect)==null?void 0:R.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(t.redirect.universal)&&typeof(globalThis==null?void 0:globalThis.Linking)<"u"},this.getAppLinkIfEnabled=(t,i)=>{var n;return this.isLinkModeEnabled(t,i)?(n=t==null?void 0:t.redirect)==null?void 0:n.universal:void 0},this.handleLinkModeMessage=({url:t})=>{if(!t||!t.includes("wc_ev")||!t.includes("topic"))return;const i=B1(t,"topic")||"",n=decodeURIComponent(B1(t,"wc_ev")||""),a=this.client.session.keys.includes(i);a&&this.client.session.update(i,{transportType:Kt.link_mode}),this.client.core.dispatchEnvelope({topic:i,message:n,sessionExists:a})},this.registerLinkModeListeners=async()=>{var t;if(jd()||vo()&&(t=this.client.metadata.redirect)!=null&&t.linkMode){const i=globalThis==null?void 0:globalThis.Linking;if(typeof i<"u"){i.addEventListener("url",this.handleLinkModeMessage,this.client.name);const n=await i.getInitialURL();n&&setTimeout(()=>{this.handleLinkModeMessage({url:n})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=Ae("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Gr.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:t,message:i,attestation:n,transportType:a}=e,{publicKey:f}=this.client.auth.authKeys.keys.includes(sh)?this.client.auth.authKeys.get(sh):{responseTopic:void 0,publicKey:void 0},u=await this.client.core.crypto.decode(t,i,{receiverPublicKey:f,encoding:a===Kt.link_mode?Yo:Ls});try{Zd(u)?(this.client.core.history.set(t,u),this.onRelayEventRequest({topic:t,payload:u,attestation:n,transportType:a,encryptedId:cs(i)})):Gh(u)?(await this.client.core.history.resolve(u),await this.onRelayEventResponse({topic:t,payload:u,transportType:a}),this.client.core.history.delete(t,u.id)):this.onRelayEventUnknownPayload({topic:t,payload:u,transportType:a})}catch(b){this.client.logger.error(b)}}registerExpirerEvents(){this.client.core.expirer.on(Ui.expired,async e=>{const{topic:t,id:i}=Lb(e.target);if(i&&this.client.pendingRequest.keys.includes(i))return await this.deletePendingSessionRequest(i,Ae("EXPIRED"),!0);if(i&&this.client.auth.requests.keys.includes(i))return await this.deletePendingAuthRequest(i,Ae("EXPIRED"),!0);t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i}))})}registerPairingEvents(){this.client.core.pairing.events.on(oa.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(oa.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!fr(e,!1)){const{message:t}=Ae("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:t}=Ae("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(t)}if(Os(this.client.core.pairing.pairings.get(e).expiry)){const{message:t}=Ae("EXPIRED",`pairing topic: ${e}`);throw new Error(t)}}async isValidSessionTopic(e){if(!fr(e,!1)){const{message:t}=Ae("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:t}=Ae("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(t)}if(Os(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:t}=Ae("EXPIRED",`session topic: ${e}`);throw new Error(t)}if(!this.client.core.crypto.keychain.has(e)){const{message:t}=Ae("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(fr(e,!1)){const{message:t}=Ae("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(t)}else{const{message:t}=Ae("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(t)}}async isValidProposalId(e){if(!iI(e)){const{message:t}=Ae("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(t)}if(!this.client.proposal.keys.includes(e)){const{message:t}=Ae("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(t)}if(Os(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:t}=Ae("EXPIRED",`proposal id: ${e}`);throw new Error(t)}}}class BN extends xa{constructor(e,t){super(e,t,_N,r0),this.core=e,this.logger=t}}class UN extends xa{constructor(e,t){super(e,t,AN,r0),this.core=e,this.logger=t}}class $N extends xa{constructor(e,t){super(e,t,xN,r0,i=>i.id),this.core=e,this.logger=t}}class zN extends xa{constructor(e,t){super(e,t,PN,Jh,()=>sh),this.core=e,this.logger=t}}class jN extends xa{constructor(e,t){super(e,t,ON,Jh),this.core=e,this.logger=t}}class kN extends xa{constructor(e,t){super(e,t,RN,Jh,i=>i.id),this.core=e,this.logger=t}}class FN{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new zN(this.core,this.logger),this.pairingTopics=new jN(this.core,this.logger),this.requests=new kN(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class i0 extends qM{constructor(e){super(e),this.protocol=r2,this.version=i2,this.name=$l.name,this.events=new Fi.EventEmitter,this.on=(i,n)=>this.events.on(i,n),this.once=(i,n)=>this.events.once(i,n),this.off=(i,n)=>this.events.off(i,n),this.removeListener=(i,n)=>this.events.removeListener(i,n),this.removeAllListeners=i=>this.events.removeAllListeners(i),this.connect=async i=>{try{return await this.engine.connect(i)}catch(n){throw this.logger.error(n.message),n}},this.pair=async i=>{try{return await this.engine.pair(i)}catch(n){throw this.logger.error(n.message),n}},this.approve=async i=>{try{return await this.engine.approve(i)}catch(n){throw this.logger.error(n.message),n}},this.reject=async i=>{try{return await this.engine.reject(i)}catch(n){throw this.logger.error(n.message),n}},this.update=async i=>{try{return await this.engine.update(i)}catch(n){throw this.logger.error(n.message),n}},this.extend=async i=>{try{return await this.engine.extend(i)}catch(n){throw this.logger.error(n.message),n}},this.request=async i=>{try{return await this.engine.request(i)}catch(n){throw this.logger.error(n.message),n}},this.respond=async i=>{try{return await this.engine.respond(i)}catch(n){throw this.logger.error(n.message),n}},this.ping=async i=>{try{return await this.engine.ping(i)}catch(n){throw this.logger.error(n.message),n}},this.emit=async i=>{try{return await this.engine.emit(i)}catch(n){throw this.logger.error(n.message),n}},this.disconnect=async i=>{try{return await this.engine.disconnect(i)}catch(n){throw this.logger.error(n.message),n}},this.find=i=>{try{return this.engine.find(i)}catch(n){throw this.logger.error(n.message),n}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(i){throw this.logger.error(i.message),i}},this.authenticate=async(i,n)=>{try{return await this.engine.authenticate(i,n)}catch(a){throw this.logger.error(a.message),a}},this.formatAuthMessage=i=>{try{return this.engine.formatAuthMessage(i)}catch(n){throw this.logger.error(n.message),n}},this.approveSessionAuthenticate=async i=>{try{return await this.engine.approveSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.rejectSessionAuthenticate=async i=>{try{return await this.engine.rejectSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.name=(e==null?void 0:e.name)||$l.name,this.metadata=(e==null?void 0:e.metadata)||Rb(),this.signConfig=e==null?void 0:e.signConfig;const t=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Nc(Hh({level:(e==null?void 0:e.logger)||$l.logger}));this.core=(e==null?void 0:e.core)||new wN(e),this.logger=Yr(t,this.name),this.session=new UN(this.core,this.logger),this.proposal=new BN(this.core,this.logger),this.pendingRequest=new $N(this.core,this.logger),this.engine=new qN(this),this.auth=new FN(this.core,this.logger)}static async init(e){const t=new i0(e);return await t.initialize(),t}get context(){return di(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var _d={exports:{}};(function(r,e){var t=typeof self<"u"?self:Dv,i=function(){function a(){this.fetch=!1,this.DOMException=t.DOMException}return a.prototype=t,new a}();(function(a){(function(f){var u={searchParams:"URLSearchParams"in a,iterable:"Symbol"in a&&"iterator"in Symbol,blob:"FileReader"in a&&"Blob"in a&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in a,arrayBuffer:"ArrayBuffer"in a};function b(h){return h&&DataView.prototype.isPrototypeOf(h)}if(u.arrayBuffer)var p=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=ArrayBuffer.isView||function(h){return h&&p.indexOf(Object.prototype.toString.call(h))>-1};function A(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(h))throw new TypeError("Invalid character in header field name");return h.toLowerCase()}function R(h){return typeof h!="string"&&(h=String(h)),h}function O(h){var v={next:function(){var _=h.shift();return{done:_===void 0,value:_}}};return u.iterable&&(v[Symbol.iterator]=function(){return v}),v}function N(h){this.map={},h instanceof N?h.forEach(function(v,_){this.append(_,v)},this):Array.isArray(h)?h.forEach(function(v){this.append(v[0],v[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(v){this.append(v,h[v])},this)}N.prototype.append=function(h,v){h=A(h),v=R(v);var _=this.map[h];this.map[h]=_?_+", "+v:v},N.prototype.delete=function(h){delete this.map[A(h)]},N.prototype.get=function(h){return h=A(h),this.has(h)?this.map[h]:null},N.prototype.has=function(h){return this.map.hasOwnProperty(A(h))},N.prototype.set=function(h,v){this.map[A(h)]=R(v)},N.prototype.forEach=function(h,v){for(var _ in this.map)this.map.hasOwnProperty(_)&&h.call(v,this.map[_],_,this)},N.prototype.keys=function(){var h=[];return this.forEach(function(v,_){h.push(_)}),O(h)},N.prototype.values=function(){var h=[];return this.forEach(function(v){h.push(v)}),O(h)},N.prototype.entries=function(){var h=[];return this.forEach(function(v,_){h.push([_,v])}),O(h)},u.iterable&&(N.prototype[Symbol.iterator]=N.prototype.entries);function K(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function W(h){return new Promise(function(v,_){h.onload=function(){v(h.result)},h.onerror=function(){_(h.error)}})}function Q(h){var v=new FileReader,_=W(v);return v.readAsArrayBuffer(h),_}function k(h){var v=new FileReader,_=W(v);return v.readAsText(h),_}function Y(h){for(var v=new Uint8Array(h),_=new Array(v.length),I=0;I-1?v:h}function q(h,v){v=v||{};var _=v.body;if(h instanceof q){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,v.headers||(this.headers=new N(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!_&&h._bodyInit!=null&&(_=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=v.credentials||this.credentials||"same-origin",(v.headers||!this.headers)&&(this.headers=new N(v.headers)),this.method=x(v.method||this.method||"GET"),this.mode=v.mode||this.mode||null,this.signal=v.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&_)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(_)}q.prototype.clone=function(){return new q(this,{body:this._bodyInit})};function ae(h){var v=new FormData;return h.trim().split("&").forEach(function(_){if(_){var I=_.split("="),M=I.shift().replace(/\+/g," "),S=I.join("=").replace(/\+/g," ");v.append(decodeURIComponent(M),decodeURIComponent(S))}}),v}function le(h){var v=new N,_=h.replace(/\r?\n[\t ]+/g," ");return _.split(/\r?\n/).forEach(function(I){var M=I.split(":"),S=M.shift().trim();if(S){var d=M.join(":").trim();v.append(S,d)}}),v}F.call(q.prototype);function L(h,v){v||(v={}),this.type="default",this.status=v.status===void 0?200:v.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in v?v.statusText:"OK",this.headers=new N(v.headers),this.url=v.url||"",this._initBody(h)}F.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new N(this.headers),url:this.url})},L.error=function(){var h=new L(null,{status:0,statusText:""});return h.type="error",h};var m=[301,302,303,307,308];L.redirect=function(h,v){if(m.indexOf(v)===-1)throw new RangeError("Invalid status code");return new L(null,{status:v,headers:{location:h}})},f.DOMException=a.DOMException;try{new f.DOMException}catch{f.DOMException=function(v,_){this.message=v,this.name=_;var I=Error(v);this.stack=I.stack},f.DOMException.prototype=Object.create(Error.prototype),f.DOMException.prototype.constructor=f.DOMException}function c(h,v){return new Promise(function(_,I){var M=new q(h,v);if(M.signal&&M.signal.aborted)return I(new f.DOMException("Aborted","AbortError"));var S=new XMLHttpRequest;function d(){S.abort()}S.onload=function(){var g={status:S.status,statusText:S.statusText,headers:le(S.getAllResponseHeaders()||"")};g.url="responseURL"in S?S.responseURL:g.headers.get("X-Request-URL");var C="response"in S?S.response:S.responseText;_(new L(C,g))},S.onerror=function(){I(new TypeError("Network request failed"))},S.ontimeout=function(){I(new TypeError("Network request failed"))},S.onabort=function(){I(new f.DOMException("Aborted","AbortError"))},S.open(M.method,M.url,!0),M.credentials==="include"?S.withCredentials=!0:M.credentials==="omit"&&(S.withCredentials=!1),"responseType"in S&&u.blob&&(S.responseType="blob"),M.headers.forEach(function(g,C){S.setRequestHeader(C,g)}),M.signal&&(M.signal.addEventListener("abort",d),S.onreadystatechange=function(){S.readyState===4&&M.signal.removeEventListener("abort",d)}),S.send(typeof M._bodyInit>"u"?null:M._bodyInit)})}return c.polyfill=!0,a.fetch||(a.fetch=c,a.Headers=N,a.Request=q,a.Response=L),f.Headers=N,f.Request=q,f.Response=L,f.fetch=c,Object.defineProperty(f,"__esModule",{value:!0}),f})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,r.exports=e})(_d,_d.exports);var HN=_d.exports;const lv=Sd(HN);var KN=Object.defineProperty,VN=Object.defineProperties,GN=Object.getOwnPropertyDescriptors,dv=Object.getOwnPropertySymbols,WN=Object.prototype.hasOwnProperty,JN=Object.prototype.propertyIsEnumerable,pv=(r,e,t)=>e in r?KN(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,gv=(r,e)=>{for(var t in e||(e={}))WN.call(e,t)&&pv(r,t,e[t]);if(dv)for(var t of dv(e))JN.call(e,t)&&pv(r,t,e[t]);return r},vv=(r,e)=>VN(r,GN(e));const YN={Accept:"application/json","Content-Type":"application/json"},QN="POST",bv={headers:YN,method:QN},mv=10;class Vn{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new Fi.EventEmitter,this.isAvailable=!1,this.registering=!1,!$g(e))throw new 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 new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const t=gs(e),i=await(await lv(this.url,vv(gv({},bv),{body:t}))).json();this.onPayload({data:i})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!$g(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const t=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=t||this.events.listenerCount("open")>=t)&&this.events.setMaxListeners(t+1),new Promise((i,n)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),n(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return n(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const t=gs({id:1,jsonrpc:"2.0",method:"test",params:[]});await lv(e,vv(gv({},bv),{body:t}))}this.onOpen()}catch(t){const i=this.parseError(t);throw this.events.emit("register_error",i),this.onClose(),i}}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;const t=typeof e.data=="string"?ga(e.data):e.data;this.events.emit("payload",t)}onError(e,t){const i=this.parseError(t),n=i.message||i.toString(),a=Vh(e,n);this.events.emit("payload",a)}parseError(e,t=this.url){return Lm(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>mv&&this.events.setMaxListeners(mv)}}const yv="error",XN="wss://relay.walletconnect.org",ZN="wc",eT="universal_provider",wv=`${ZN}@2:${eT}:`,a2="https://rpc.walletconnect.org/v1/",Ya="generic",tT=`${a2}bundler`,gn={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var rc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},Ad={exports:{}};/** -* @license -* Lodash -* Copyright OpenJS Foundation and other contributors -* Released under MIT license -* Based on Underscore.js 1.8.3 -* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -*/(function(r,e){(function(){var t,i="4.17.21",n=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",f="Expected a function",u="Invalid `variable` option passed into `_.template`",b="__lodash_hash_undefined__",p=500,y="__lodash_placeholder__",A=1,R=2,O=4,N=1,K=2,W=1,Q=2,k=4,Y=8,$=16,F=32,G=64,x=128,q=256,ae=512,le=30,L="...",m=800,c=16,h=1,v=2,_=3,I=1/0,M=9007199254740991,S=17976931348623157e292,d=NaN,g=4294967295,C=g-1,Z=g>>>1,se=[["ary",x],["bind",W],["bindKey",Q],["curry",Y],["curryRight",$],["flip",ae],["partial",F],["partialRight",G],["rearg",q]],P="[object Arguments]",ee="[object Array]",B="[object AsyncFunction]",j="[object Boolean]",H="[object Date]",w="[object DOMException]",z="[object Error]",ne="[object Function]",ce="[object GeneratorFunction]",he="[object Map]",ye="[object Number]",we="[object Null]",Te="[object Object]",Qe="[object Promise]",Oe="[object Proxy]",Ce="[object RegExp]",Ie="[object Set]",me="[object String]",Re="[object Symbol]",De="[object Undefined]",ve="[object WeakMap]",Ne="[object WeakSet]",Se="[object ArrayBuffer]",be="[object DataView]",Ue="[object Float32Array]",Me="[object Float64Array]",_e="[object Int8Array]",He="[object Int16Array]",Ve="[object Int32Array]",Ee="[object Uint8Array]",Ke="[object Uint8ClampedArray]",ut="[object Uint16Array]",Ge="[object Uint32Array]",_t=/\b__p \+= '';/g,lt=/\b(__p \+=) '' \+/g,Je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Et=/&(?:amp|lt|gt|quot|#39);/g,It=/[&<>"']/g,Le=RegExp(Et.source),Xe=RegExp(It.source),tt=/<%-([\s\S]+?)%>/g,qe=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,Ze=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ze=/^\w*$/,ft=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/[\\^$.*+?()[\]{}|]/g,je=RegExp(rt.source),it=/^\s+/,st=/\s/,Be=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ye=/\{\n\/\* \[wrapped with (.+)\] \*/,ht=/,? & /,ke=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ct=/[()=,{}\[\]\/\s]/,Dt=/\\(\\)?/g,at=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,bt=/\w*$/,Tr=/^[-+]0x[0-9a-f]+$/i,Cr=/^0b[01]+$/i,Dr=/^\[object .+?Constructor\]$/,Lr=/^0o[0-7]+$/i,qr=/^(?:0|[1-9]\d*)$/,er=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Qr=/($^)/,Vi=/['\n\r\u2028\u2029\\]/g,Xr="\\ud800-\\udfff",Gi="\\u0300-\\u036f",Wi="\\ufe20-\\ufe2f",Zr="\\u20d0-\\u20ff",Si=Gi+Wi+Zr,Ii="\\u2700-\\u27bf",lr="a-z\\xdf-\\xf6\\xf8-\\xff",Ji="\\xac\\xb1\\xd7\\xf7",Yi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Qi="\\u2000-\\u206f",js=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Dc="A-Z\\xc0-\\xd6\\xd8-\\xde",Lc="\\ufe0e\\ufe0f",ks=Ji+Yi+Qi+js,xo="['’]",Fs="["+Xr+"]",So="["+ks+"]",Hs="["+Si+"]",qc="\\d+",Yh="["+Ii+"]",Bc="["+lr+"]",Uc="[^"+Xr+ks+qc+Ii+lr+Dc+"]",Ma="\\ud83c[\\udffb-\\udfff]",Qh="(?:"+Hs+"|"+Ma+")",$c="[^"+Xr+"]",Pa="(?:\\ud83c[\\udde6-\\uddff]){2}",bs="[\\ud800-\\udbff][\\udc00-\\udfff]",pi="["+Dc+"]",zc="\\u200d",jc="(?:"+Bc+"|"+Uc+")",vn="(?:"+pi+"|"+Uc+")",kc="(?:"+xo+"(?:d|ll|m|re|s|t|ve))?",Fc="(?:"+xo+"(?:D|LL|M|RE|S|T|VE))?",Hc=Qh+"?",Kc="["+Lc+"]?",Xh="(?:"+zc+"(?:"+[$c,Pa,bs].join("|")+")"+Kc+Hc+")*",Gn="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Vc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Gc=Kc+Hc+Xh,Oa="(?:"+[Yh,Pa,bs].join("|")+")"+Gc,Zh="(?:"+[$c+Hs+"?",Hs,Pa,bs,Fs].join("|")+")",Io=RegExp(xo,"g"),eu=RegExp(Hs,"g"),Ra=RegExp(Ma+"(?="+Ma+")|"+Zh+Gc,"g"),Wc=RegExp([pi+"?"+Bc+"+"+kc+"(?="+[So,pi,"$"].join("|")+")",vn+"+"+Fc+"(?="+[So,pi+jc,"$"].join("|")+")",pi+"?"+jc+"+"+kc,pi+"+"+Fc,Vc,Gn,qc,Oa].join("|"),"g"),Jc=RegExp("["+zc+Xr+Si+Lc+"]"),Ks=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Yc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tu=-1,jt={};jt[Ue]=jt[Me]=jt[_e]=jt[He]=jt[Ve]=jt[Ee]=jt[Ke]=jt[ut]=jt[Ge]=!0,jt[P]=jt[ee]=jt[Se]=jt[j]=jt[be]=jt[H]=jt[z]=jt[ne]=jt[he]=jt[ye]=jt[Te]=jt[Ce]=jt[Ie]=jt[me]=jt[ve]=!1;var zt={};zt[P]=zt[ee]=zt[Se]=zt[be]=zt[j]=zt[H]=zt[Ue]=zt[Me]=zt[_e]=zt[He]=zt[Ve]=zt[he]=zt[ye]=zt[Te]=zt[Ce]=zt[Ie]=zt[me]=zt[Re]=zt[Ee]=zt[Ke]=zt[ut]=zt[Ge]=!0,zt[z]=zt[ne]=zt[ve]=!1;var V={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},te={"&":"&","<":"<",">":">",'"':""","'":"'"},pe={"&":"&","<":"<",">":">",""":'"',"'":"'"},$e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},kt=parseFloat,pt=parseInt,Jt=typeof rc=="object"&&rc&&rc.Object===Object&&rc,hr=typeof self=="object"&&self&&self.Object===Object&&self,Nt=Jt||hr||Function("return this")(),Ft=e&&!e.nodeType&&e,sr=Ft&&!0&&r&&!r.nodeType&&r,ei=sr&&sr.exports===Ft,ur=ei&&Jt.process,Yt=function(){try{var re=sr&&sr.require&&sr.require("util").types;return re||ur&&ur.binding&&ur.binding("util")}catch{}}(),kr=Yt&&Yt.isArrayBuffer,Xi=Yt&&Yt.isDate,Mi=Yt&&Yt.isMap,bn=Yt&&Yt.isRegExp,Mo=Yt&&Yt.isSet,Vs=Yt&&Yt.isTypedArray;function br(re,fe,oe){switch(oe.length){case 0:return re.call(fe);case 1:return re.call(fe,oe[0]);case 2:return re.call(fe,oe[0],oe[1]);case 3:return re.call(fe,oe[0],oe[1],oe[2])}return re.apply(fe,oe)}function f2(re,fe,oe,Fe){for(var dt=-1,Lt=re==null?0:re.length;++dt-1}function ru(re,fe,oe){for(var Fe=-1,dt=re==null?0:re.length;++Fe-1;);return oe}function d0(re,fe){for(var oe=re.length;oe--&&Na(fe,re[oe],0)>-1;);return oe}function m2(re,fe){for(var oe=re.length,Fe=0;oe--;)re[oe]===fe&&++Fe;return Fe}var y2=au(V),w2=au(te);function _2(re){return"\\"+$e[re]}function A2(re,fe){return re==null?t:re[fe]}function Ta(re){return Jc.test(re)}function E2(re){return Ks.test(re)}function x2(re){for(var fe,oe=[];!(fe=re.next()).done;)oe.push(fe.value);return oe}function hu(re){var fe=-1,oe=Array(re.size);return re.forEach(function(Fe,dt){oe[++fe]=[dt,Fe]}),oe}function p0(re,fe){return function(oe){return re(fe(oe))}}function ws(re,fe){for(var oe=-1,Fe=re.length,dt=0,Lt=[];++oe-1}function uy(s,o){var l=this.__data__,E=gf(l,s);return E<0?(++this.size,l.push([s,o])):l[E][1]=o,this}Wn.prototype.clear=oy,Wn.prototype.delete=cy,Wn.prototype.get=fy,Wn.prototype.has=hy,Wn.prototype.set=uy;function Jn(s){var o=-1,l=s==null?0:s.length;for(this.clear();++o=o?s:o)),s}function Ni(s,o,l,E,T,U){var J,X=o&A,ie=o&R,ue=o&O;if(l&&(J=T?l(s,E,T,U):l(s)),J!==t)return J;if(!Zt(s))return s;var de=gt(s);if(de){if(J=g6(s),!X)return ti(s,J)}else{var ge=Ur(s),Pe=ge==ne||ge==ce;if(Is(s))return Y0(s,X);if(ge==Te||ge==P||Pe&&!T){if(J=ie||Pe?{}:gp(s),!X)return ie?n6(s,My(J,s)):i6(s,I0(J,s))}else{if(!zt[ge])return T?s:{};J=v6(s,ge,X)}}U||(U=new en);var We=U.get(s);if(We)return We;U.set(s,J),Hp(s)?s.forEach(function(ct){J.add(Ni(ct,o,l,ct,s,U))}):kp(s)&&s.forEach(function(ct,xt){J.set(xt,Ni(ct,o,l,xt,s,U))});var ot=ue?ie?qu:Lu:ie?ii:mr,wt=de?t:ot(s);return Pi(wt||s,function(ct,xt){wt&&(xt=ct,ct=s[xt]),Do(J,xt,Ni(ct,o,l,xt,s,U))}),J}function Py(s){var o=mr(s);return function(l){return M0(l,s,o)}}function M0(s,o,l){var E=l.length;if(s==null)return!E;for(s=Ht(s);E--;){var T=l[E],U=o[T],J=s[T];if(J===t&&!(T in s)||!U(J))return!1}return!0}function P0(s,o,l){if(typeof s!="function")throw new Oi(f);return jo(function(){s.apply(t,l)},o)}function Lo(s,o,l,E){var T=-1,U=Qc,J=!0,X=s.length,ie=[],ue=o.length;if(!X)return ie;l&&(o=Xt(o,gi(l))),E?(U=ru,J=!1):o.length>=n&&(U=Po,J=!1,o=new Js(o));e:for(;++TT?0:T+l),E=E===t||E>T?T:yt(E),E<0&&(E+=T),E=l>E?0:Vp(E);l0&&l(X)?o>1?Mr(X,o-1,l,E,T):ys(T,X):E||(T[T.length]=X)}return T}var bu=rp(),N0=rp(!0);function mn(s,o){return s&&bu(s,o,mr)}function mu(s,o){return s&&N0(s,o,mr)}function bf(s,o){return ms(o,function(l){return es(s[l])})}function Qs(s,o){o=xs(o,s);for(var l=0,E=o.length;s!=null&&lo}function Ny(s,o){return s!=null&&Ut.call(s,o)}function Ty(s,o){return s!=null&&o in Ht(s)}function Cy(s,o,l){return s>=Br(o,l)&&s=120&&de.length>=120)?new Js(J&&de):t}de=s[0];var ge=-1,Pe=X[0];e:for(;++ge-1;)X!==s&&cf.call(X,ie,1),cf.call(s,ie,1);return s}function k0(s,o){for(var l=s?o.length:0,E=l-1;l--;){var T=o[l];if(l==E||T!==U){var U=T;Zn(T)?cf.call(s,T,1):Pu(s,T)}}return s}function Su(s,o){return s+uf(A0()*(o-s+1))}function Vy(s,o,l,E){for(var T=-1,U=pr(hf((o-s)/(l||1)),0),J=oe(U);U--;)J[E?U:++T]=s,s+=l;return J}function Iu(s,o){var l="";if(!s||o<1||o>M)return l;do o%2&&(l+=s),o=uf(o/2),o&&(s+=s);while(o);return l}function At(s,o){return Fu(mp(s,o,ni),s+"")}function Gy(s){return S0(Fa(s))}function Wy(s,o){var l=Fa(s);return Pf(l,Ys(o,0,l.length))}function Uo(s,o,l,E){if(!Zt(s))return s;o=xs(o,s);for(var T=-1,U=o.length,J=U-1,X=s;X!=null&&++TT?0:T+o),l=l>T?T:l,l<0&&(l+=T),T=o>l?0:l-o>>>0,o>>>=0;for(var U=oe(T);++E>>1,J=s[U];J!==null&&!bi(J)&&(l?J<=o:J=n){var ue=o?null:c6(s);if(ue)return Zc(ue);J=!1,T=Po,ie=new Js}else ie=o?[]:X;e:for(;++E=E?s:Ti(s,o,l)}var J0=$2||function(s){return Nt.clearTimeout(s)};function Y0(s,o){if(o)return s.slice();var l=s.length,E=b0?b0(l):new s.constructor(l);return s.copy(E),E}function Tu(s){var o=new s.constructor(s.byteLength);return new af(o).set(new af(s)),o}function Zy(s,o){var l=o?Tu(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.byteLength)}function e6(s){var o=new s.constructor(s.source,bt.exec(s));return o.lastIndex=s.lastIndex,o}function t6(s){return Co?Ht(Co.call(s)):{}}function Q0(s,o){var l=o?Tu(s.buffer):s.buffer;return new s.constructor(l,s.byteOffset,s.length)}function X0(s,o){if(s!==o){var l=s!==t,E=s===null,T=s===s,U=bi(s),J=o!==t,X=o===null,ie=o===o,ue=bi(o);if(!X&&!ue&&!U&&s>o||U&&J&&ie&&!X&&!ue||E&&J&&ie||!l&&ie||!T)return 1;if(!E&&!U&&!ue&&s=X)return ie;var ue=l[E];return ie*(ue=="desc"?-1:1)}}return s.index-o.index}function Z0(s,o,l,E){for(var T=-1,U=s.length,J=l.length,X=-1,ie=o.length,ue=pr(U-J,0),de=oe(ie+ue),ge=!E;++X1?l[T-1]:t,J=T>2?l[2]:t;for(U=s.length>3&&typeof U=="function"?(T--,U):t,J&&Hr(l[0],l[1],J)&&(U=T<3?t:U,T=1),o=Ht(o);++E-1?T[U?o[J]:J]:t}}function sp(s){return Xn(function(o){var l=o.length,E=l,T=Ri.prototype.thru;for(s&&o.reverse();E--;){var U=o[E];if(typeof U!="function")throw new Oi(f);if(T&&!J&&If(U)=="wrapper")var J=new Ri([],!0)}for(E=J?E:l;++E1&&Tt.reverse(),de&&ieX))return!1;var ue=U.get(s),de=U.get(o);if(ue&&de)return ue==o&&de==s;var ge=-1,Pe=!0,We=l&K?new Js:t;for(U.set(s,o),U.set(o,s);++ge1?"& ":"")+o[E],o=o.join(l>2?", ":" "),s.replace(Be,`{ -/* [wrapped with `+o+`] */ -`)}function m6(s){return gt(s)||ea(s)||!!(w0&&s&&s[w0])}function Zn(s,o){var l=typeof s;return o=o??M,!!o&&(l=="number"||l!="symbol"&&qr.test(s))&&s>-1&&s%1==0&&s0){if(++o>=m)return arguments[0]}else o=0;return s.apply(t,arguments)}}function Pf(s,o){var l=-1,E=s.length,T=E-1;for(o=o===t?E:o;++l1?s[o-1]:t;return l=typeof l=="function"?(s.pop(),l):t,Rp(s,l)});function Np(s){var o=D(s);return o.__chain__=!0,o}function O3(s,o){return o(s),s}function Of(s,o){return o(s)}var R3=Xn(function(s){var o=s.length,l=o?s[0]:0,E=this.__wrapped__,T=function(U){return vu(U,s)};return o>1||this.__actions__.length||!(E instanceof Mt)||!Zn(l)?this.thru(T):(E=E.slice(l,+l+(o?1:0)),E.__actions__.push({func:Of,args:[T],thisArg:t}),new Ri(E,this.__chain__).thru(function(U){return o&&!U.length&&U.push(t),U}))});function N3(){return Np(this)}function T3(){return new Ri(this.value(),this.__chain__)}function C3(){this.__values__===t&&(this.__values__=Kp(this.value()));var s=this.__index__>=this.__values__.length,o=s?t:this.__values__[this.__index__++];return{done:s,value:o}}function D3(){return this}function L3(s){for(var o,l=this;l instanceof pf;){var E=xp(l);E.__index__=0,E.__values__=t,o?T.__wrapped__=E:o=E;var T=E;l=l.__wrapped__}return T.__wrapped__=s,o}function q3(){var s=this.__wrapped__;if(s instanceof Mt){var o=s;return this.__actions__.length&&(o=new Mt(this)),o=o.reverse(),o.__actions__.push({func:Of,args:[Hu],thisArg:t}),new Ri(o,this.__chain__)}return this.thru(Hu)}function B3(){return G0(this.__wrapped__,this.__actions__)}var U3=_f(function(s,o,l){Ut.call(s,l)?++s[l]:Yn(s,l,1)});function $3(s,o,l){var E=gt(s)?a0:Oy;return l&&Hr(s,o,l)&&(o=t),E(s,nt(o,3))}function z3(s,o){var l=gt(s)?ms:R0;return l(s,nt(o,3))}var j3=np(Sp),k3=np(Ip);function F3(s,o){return Mr(Rf(s,o),1)}function H3(s,o){return Mr(Rf(s,o),I)}function K3(s,o,l){return l=l===t?1:yt(l),Mr(Rf(s,o),l)}function Tp(s,o){var l=gt(s)?Pi:As;return l(s,nt(o,3))}function Cp(s,o){var l=gt(s)?h2:O0;return l(s,nt(o,3))}var V3=_f(function(s,o,l){Ut.call(s,l)?s[l].push(o):Yn(s,l,[o])});function G3(s,o,l,E){s=ri(s)?s:Fa(s),l=l&&!E?yt(l):0;var T=s.length;return l<0&&(l=pr(T+l,0)),Lf(s)?l<=T&&s.indexOf(o,l)>-1:!!T&&Na(s,o,l)>-1}var W3=At(function(s,o,l){var E=-1,T=typeof o=="function",U=ri(s)?oe(s.length):[];return As(s,function(J){U[++E]=T?br(o,J,l):qo(J,o,l)}),U}),J3=_f(function(s,o,l){Yn(s,l,o)});function Rf(s,o){var l=gt(s)?Xt:q0;return l(s,nt(o,3))}function Y3(s,o,l,E){return s==null?[]:(gt(o)||(o=o==null?[]:[o]),l=E?t:l,gt(l)||(l=l==null?[]:[l]),z0(s,o,l))}var Q3=_f(function(s,o,l){s[l?0:1].push(o)},function(){return[[],[]]});function X3(s,o,l){var E=gt(s)?iu:h0,T=arguments.length<3;return E(s,nt(o,4),l,T,As)}function Z3(s,o,l){var E=gt(s)?u2:h0,T=arguments.length<3;return E(s,nt(o,4),l,T,O0)}function ew(s,o){var l=gt(s)?ms:R0;return l(s,Cf(nt(o,3)))}function tw(s){var o=gt(s)?S0:Gy;return o(s)}function rw(s,o,l){(l?Hr(s,o,l):o===t)?o=1:o=yt(o);var E=gt(s)?xy:Wy;return E(s,o)}function iw(s){var o=gt(s)?Sy:Yy;return o(s)}function nw(s){if(s==null)return 0;if(ri(s))return Lf(s)?Ca(s):s.length;var o=Ur(s);return o==he||o==Ie?s.size:Au(s).length}function sw(s,o,l){var E=gt(s)?nu:Qy;return l&&Hr(s,o,l)&&(o=t),E(s,nt(o,3))}var aw=At(function(s,o){if(s==null)return[];var l=o.length;return l>1&&Hr(s,o[0],o[1])?o=[]:l>2&&Hr(o[0],o[1],o[2])&&(o=[o[0]]),z0(s,Mr(o,1),[])}),Nf=z2||function(){return Nt.Date.now()};function ow(s,o){if(typeof o!="function")throw new Oi(f);return s=yt(s),function(){if(--s<1)return o.apply(this,arguments)}}function Dp(s,o,l){return o=l?t:o,o=s&&o==null?s.length:o,Qn(s,x,t,t,t,t,o)}function Lp(s,o){var l;if(typeof o!="function")throw new Oi(f);return s=yt(s),function(){return--s>0&&(l=o.apply(this,arguments)),s<=1&&(o=t),l}}var Vu=At(function(s,o,l){var E=W;if(l.length){var T=ws(l,ja(Vu));E|=F}return Qn(s,E,o,l,T)}),qp=At(function(s,o,l){var E=W|Q;if(l.length){var T=ws(l,ja(qp));E|=F}return Qn(o,E,s,l,T)});function Bp(s,o,l){o=l?t:o;var E=Qn(s,Y,t,t,t,t,t,o);return E.placeholder=Bp.placeholder,E}function Up(s,o,l){o=l?t:o;var E=Qn(s,$,t,t,t,t,t,o);return E.placeholder=Up.placeholder,E}function $p(s,o,l){var E,T,U,J,X,ie,ue=0,de=!1,ge=!1,Pe=!0;if(typeof s!="function")throw new Oi(f);o=Di(o)||0,Zt(l)&&(de=!!l.leading,ge="maxWait"in l,U=ge?pr(Di(l.maxWait)||0,o):U,Pe="trailing"in l?!!l.trailing:Pe);function We(or){var rn=E,rs=T;return E=T=t,ue=or,J=s.apply(rs,rn),J}function ot(or){return ue=or,X=jo(xt,o),de?We(or):J}function wt(or){var rn=or-ie,rs=or-ue,n1=o-rn;return ge?Br(n1,U-rs):n1}function ct(or){var rn=or-ie,rs=or-ue;return ie===t||rn>=o||rn<0||ge&&rs>=U}function xt(){var or=Nf();if(ct(or))return Tt(or);X=jo(xt,wt(or))}function Tt(or){return X=t,Pe&&E?We(or):(E=T=t,J)}function mi(){X!==t&&J0(X),ue=0,E=ie=T=X=t}function Kr(){return X===t?J:Tt(Nf())}function yi(){var or=Nf(),rn=ct(or);if(E=arguments,T=this,ie=or,rn){if(X===t)return ot(ie);if(ge)return J0(X),X=jo(xt,o),We(ie)}return X===t&&(X=jo(xt,o)),J}return yi.cancel=mi,yi.flush=Kr,yi}var cw=At(function(s,o){return P0(s,1,o)}),fw=At(function(s,o,l){return P0(s,Di(o)||0,l)});function hw(s){return Qn(s,ae)}function Tf(s,o){if(typeof s!="function"||o!=null&&typeof o!="function")throw new Oi(f);var l=function(){var E=arguments,T=o?o.apply(this,E):E[0],U=l.cache;if(U.has(T))return U.get(T);var J=s.apply(this,E);return l.cache=U.set(T,J)||U,J};return l.cache=new(Tf.Cache||Jn),l}Tf.Cache=Jn;function Cf(s){if(typeof s!="function")throw new Oi(f);return function(){var o=arguments;switch(o.length){case 0:return!s.call(this);case 1:return!s.call(this,o[0]);case 2:return!s.call(this,o[0],o[1]);case 3:return!s.call(this,o[0],o[1],o[2])}return!s.apply(this,o)}}function uw(s){return Lp(2,s)}var lw=Xy(function(s,o){o=o.length==1&>(o[0])?Xt(o[0],gi(nt())):Xt(Mr(o,1),gi(nt()));var l=o.length;return At(function(E){for(var T=-1,U=Br(E.length,l);++T=o}),ea=C0(function(){return arguments}())?C0:function(s){return tr(s)&&Ut.call(s,"callee")&&!y0.call(s,"callee")},gt=oe.isArray,Mw=kr?gi(kr):Ly;function ri(s){return s!=null&&Df(s.length)&&!es(s)}function ar(s){return tr(s)&&ri(s)}function Pw(s){return s===!0||s===!1||tr(s)&&Fr(s)==j}var Is=k2||nl,Ow=Xi?gi(Xi):qy;function Rw(s){return tr(s)&&s.nodeType===1&&!ko(s)}function Nw(s){if(s==null)return!0;if(ri(s)&&(gt(s)||typeof s=="string"||typeof s.splice=="function"||Is(s)||ka(s)||ea(s)))return!s.length;var o=Ur(s);if(o==he||o==Ie)return!s.size;if(zo(s))return!Au(s).length;for(var l in s)if(Ut.call(s,l))return!1;return!0}function Tw(s,o){return Bo(s,o)}function Cw(s,o,l){l=typeof l=="function"?l:t;var E=l?l(s,o):t;return E===t?Bo(s,o,t,l):!!E}function Wu(s){if(!tr(s))return!1;var o=Fr(s);return o==z||o==w||typeof s.message=="string"&&typeof s.name=="string"&&!ko(s)}function Dw(s){return typeof s=="number"&&_0(s)}function es(s){if(!Zt(s))return!1;var o=Fr(s);return o==ne||o==ce||o==B||o==Oe}function jp(s){return typeof s=="number"&&s==yt(s)}function Df(s){return typeof s=="number"&&s>-1&&s%1==0&&s<=M}function Zt(s){var o=typeof s;return s!=null&&(o=="object"||o=="function")}function tr(s){return s!=null&&typeof s=="object"}var kp=Mi?gi(Mi):Uy;function Lw(s,o){return s===o||_u(s,o,Uu(o))}function qw(s,o,l){return l=typeof l=="function"?l:t,_u(s,o,Uu(o),l)}function Bw(s){return Fp(s)&&s!=+s}function Uw(s){if(_6(s))throw new dt(a);return D0(s)}function $w(s){return s===null}function zw(s){return s==null}function Fp(s){return typeof s=="number"||tr(s)&&Fr(s)==ye}function ko(s){if(!tr(s)||Fr(s)!=Te)return!1;var o=of(s);if(o===null)return!0;var l=Ut.call(o,"constructor")&&o.constructor;return typeof l=="function"&&l instanceof l&&rf.call(l)==q2}var Ju=bn?gi(bn):$y;function jw(s){return jp(s)&&s>=-M&&s<=M}var Hp=Mo?gi(Mo):zy;function Lf(s){return typeof s=="string"||!gt(s)&&tr(s)&&Fr(s)==me}function bi(s){return typeof s=="symbol"||tr(s)&&Fr(s)==Re}var ka=Vs?gi(Vs):jy;function kw(s){return s===t}function Fw(s){return tr(s)&&Ur(s)==ve}function Hw(s){return tr(s)&&Fr(s)==Ne}var Kw=Sf(Eu),Vw=Sf(function(s,o){return s<=o});function Kp(s){if(!s)return[];if(ri(s))return Lf(s)?Zi(s):ti(s);if(Oo&&s[Oo])return x2(s[Oo]());var o=Ur(s),l=o==he?hu:o==Ie?Zc:Fa;return l(s)}function ts(s){if(!s)return s===0?s:0;if(s=Di(s),s===I||s===-I){var o=s<0?-1:1;return o*S}return s===s?s:0}function yt(s){var o=ts(s),l=o%1;return o===o?l?o-l:o:0}function Vp(s){return s?Ys(yt(s),0,g):0}function Di(s){if(typeof s=="number")return s;if(bi(s))return d;if(Zt(s)){var o=typeof s.valueOf=="function"?s.valueOf():s;s=Zt(o)?o+"":o}if(typeof s!="string")return s===0?s:+s;s=u0(s);var l=Cr.test(s);return l||Lr.test(s)?pt(s.slice(2),l?2:8):Tr.test(s)?d:+s}function Gp(s){return yn(s,ii(s))}function Gw(s){return s?Ys(yt(s),-M,M):s===0?s:0}function qt(s){return s==null?"":vi(s)}var Ww=$a(function(s,o){if(zo(o)||ri(o)){yn(o,mr(o),s);return}for(var l in o)Ut.call(o,l)&&Do(s,l,o[l])}),Wp=$a(function(s,o){yn(o,ii(o),s)}),qf=$a(function(s,o,l,E){yn(o,ii(o),s,E)}),Jw=$a(function(s,o,l,E){yn(o,mr(o),s,E)}),Yw=Xn(vu);function Qw(s,o){var l=Ua(s);return o==null?l:I0(l,o)}var Xw=At(function(s,o){s=Ht(s);var l=-1,E=o.length,T=E>2?o[2]:t;for(T&&Hr(o[0],o[1],T)&&(E=1);++l1),U}),yn(s,qu(s),l),E&&(l=Ni(l,A|R|O,f6));for(var T=o.length;T--;)Pu(l,o[T]);return l});function v5(s,o){return Yp(s,Cf(nt(o)))}var b5=Xn(function(s,o){return s==null?{}:Hy(s,o)});function Yp(s,o){if(s==null)return{};var l=Xt(qu(s),function(E){return[E]});return o=nt(o),j0(s,l,function(E,T){return o(E,T[0])})}function m5(s,o,l){o=xs(o,s);var E=-1,T=o.length;for(T||(T=1,s=t);++Eo){var E=s;s=o,o=E}if(l||s%1||o%1){var T=A0();return Br(s+T*(o-s+kt("1e-"+((T+"").length-1))),o)}return Su(s,o)}var O5=za(function(s,o,l){return o=o.toLowerCase(),s+(l?Zp(o):o)});function Zp(s){return Xu(qt(s).toLowerCase())}function e1(s){return s=qt(s),s&&s.replace(er,y2).replace(eu,"")}function R5(s,o,l){s=qt(s),o=vi(o);var E=s.length;l=l===t?E:Ys(yt(l),0,E);var T=l;return l-=o.length,l>=0&&s.slice(l,T)==o}function N5(s){return s=qt(s),s&&Xe.test(s)?s.replace(It,w2):s}function T5(s){return s=qt(s),s&&je.test(s)?s.replace(rt,"\\$&"):s}var C5=za(function(s,o,l){return s+(l?"-":"")+o.toLowerCase()}),D5=za(function(s,o,l){return s+(l?" ":"")+o.toLowerCase()}),L5=ip("toLowerCase");function q5(s,o,l){s=qt(s),o=yt(o);var E=o?Ca(s):0;if(!o||E>=o)return s;var T=(o-E)/2;return xf(uf(T),l)+s+xf(hf(T),l)}function B5(s,o,l){s=qt(s),o=yt(o);var E=o?Ca(s):0;return o&&E>>0,l?(s=qt(s),s&&(typeof o=="string"||o!=null&&!Ju(o))&&(o=vi(o),!o&&Ta(s))?Ss(Zi(s),0,l):s.split(o,l)):[]}var H5=za(function(s,o,l){return s+(l?" ":"")+Xu(o)});function K5(s,o,l){return s=qt(s),l=l==null?0:Ys(yt(l),0,s.length),o=vi(o),s.slice(l,l+o.length)==o}function V5(s,o,l){var E=D.templateSettings;l&&Hr(s,o,l)&&(o=t),s=qt(s),o=qf({},o,E,hp);var T=qf({},o.imports,E.imports,hp),U=mr(T),J=fu(T,U),X,ie,ue=0,de=o.interpolate||Qr,ge="__p += '",Pe=uu((o.escape||Qr).source+"|"+de.source+"|"+(de===et?at:Qr).source+"|"+(o.evaluate||Qr).source+"|$","g"),We="//# sourceURL="+(Ut.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tu+"]")+` -`;s.replace(Pe,function(ct,xt,Tt,mi,Kr,yi){return Tt||(Tt=mi),ge+=s.slice(ue,yi).replace(Vi,_2),xt&&(X=!0,ge+=`' + -__e(`+xt+`) + -'`),Kr&&(ie=!0,ge+=`'; -`+Kr+`; -__p += '`),Tt&&(ge+=`' + -((__t = (`+Tt+`)) == null ? '' : __t) + -'`),ue=yi+ct.length,ct}),ge+=`'; -`;var ot=Ut.call(o,"variable")&&o.variable;if(!ot)ge=`with (obj) { -`+ge+` -} -`;else if(Ct.test(ot))throw new dt(u);ge=(ie?ge.replace(_t,""):ge).replace(lt,"$1").replace(Je,"$1;"),ge="function("+(ot||"obj")+`) { -`+(ot?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(X?", __e = _.escape":"")+(ie?`, __j = Array.prototype.join; -function print() { __p += __j.call(arguments, '') } -`:`; -`)+ge+`return __p -}`;var wt=r1(function(){return Lt(U,We+"return "+ge).apply(t,J)});if(wt.source=ge,Wu(wt))throw wt;return wt}function G5(s){return qt(s).toLowerCase()}function W5(s){return qt(s).toUpperCase()}function J5(s,o,l){if(s=qt(s),s&&(l||o===t))return u0(s);if(!s||!(o=vi(o)))return s;var E=Zi(s),T=Zi(o),U=l0(E,T),J=d0(E,T)+1;return Ss(E,U,J).join("")}function Y5(s,o,l){if(s=qt(s),s&&(l||o===t))return s.slice(0,g0(s)+1);if(!s||!(o=vi(o)))return s;var E=Zi(s),T=d0(E,Zi(o))+1;return Ss(E,0,T).join("")}function Q5(s,o,l){if(s=qt(s),s&&(l||o===t))return s.replace(it,"");if(!s||!(o=vi(o)))return s;var E=Zi(s),T=l0(E,Zi(o));return Ss(E,T).join("")}function X5(s,o){var l=le,E=L;if(Zt(o)){var T="separator"in o?o.separator:T;l="length"in o?yt(o.length):l,E="omission"in o?vi(o.omission):E}s=qt(s);var U=s.length;if(Ta(s)){var J=Zi(s);U=J.length}if(l>=U)return s;var X=l-Ca(E);if(X<1)return E;var ie=J?Ss(J,0,X).join(""):s.slice(0,X);if(T===t)return ie+E;if(J&&(X+=ie.length-X),Ju(T)){if(s.slice(X).search(T)){var ue,de=ie;for(T.global||(T=uu(T.source,qt(bt.exec(T))+"g")),T.lastIndex=0;ue=T.exec(de);)var ge=ue.index;ie=ie.slice(0,ge===t?X:ge)}}else if(s.indexOf(vi(T),X)!=X){var Pe=ie.lastIndexOf(T);Pe>-1&&(ie=ie.slice(0,Pe))}return ie+E}function Z5(s){return s=qt(s),s&&Le.test(s)?s.replace(Et,P2):s}var e8=za(function(s,o,l){return s+(l?" ":"")+o.toUpperCase()}),Xu=ip("toUpperCase");function t1(s,o,l){return s=qt(s),o=l?t:o,o===t?E2(s)?N2(s):p2(s):s.match(o)||[]}var r1=At(function(s,o){try{return br(s,t,o)}catch(l){return Wu(l)?l:new dt(l)}}),t8=Xn(function(s,o){return Pi(o,function(l){l=wn(l),Yn(s,l,Vu(s[l],s))}),s});function r8(s){var o=s==null?0:s.length,l=nt();return s=o?Xt(s,function(E){if(typeof E[1]!="function")throw new Oi(f);return[l(E[0]),E[1]]}):[],At(function(E){for(var T=-1;++TM)return[];var l=g,E=Br(s,g);o=nt(o),s-=g;for(var T=cu(E,o);++l0||o<0)?new Mt(l):(s<0?l=l.takeRight(-s):s&&(l=l.drop(s)),o!==t&&(o=yt(o),l=o<0?l.dropRight(-o):l.take(o-s)),l)},Mt.prototype.takeRightWhile=function(s){return this.reverse().takeWhile(s).reverse()},Mt.prototype.toArray=function(){return this.take(g)},mn(Mt.prototype,function(s,o){var l=/^(?:filter|find|map|reject)|While$/.test(o),E=/^(?:head|last)$/.test(o),T=D[E?"take"+(o=="last"?"Right":""):o],U=E||/^find/.test(o);T&&(D.prototype[o]=function(){var J=this.__wrapped__,X=E?[1]:arguments,ie=J instanceof Mt,ue=X[0],de=ie||gt(J),ge=function(xt){var Tt=T.apply(D,ys([xt],X));return E&&Pe?Tt[0]:Tt};de&&l&&typeof ue=="function"&&ue.length!=1&&(ie=de=!1);var Pe=this.__chain__,We=!!this.__actions__.length,ot=U&&!Pe,wt=ie&&!We;if(!U&&de){J=wt?J:new Mt(this);var ct=s.apply(J,X);return ct.__actions__.push({func:Of,args:[ge],thisArg:t}),new Ri(ct,Pe)}return ot&&wt?s.apply(this,X):(ct=this.thru(ge),ot?E?ct.value()[0]:ct.value():ct)})}),Pi(["pop","push","shift","sort","splice","unshift"],function(s){var o=ef[s],l=/^(?:push|sort|unshift)$/.test(s)?"tap":"thru",E=/^(?:pop|shift)$/.test(s);D.prototype[s]=function(){var T=arguments;if(E&&!this.__chain__){var U=this.value();return o.apply(gt(U)?U:[],T)}return this[l](function(J){return o.apply(gt(J)?J:[],T)})}}),mn(Mt.prototype,function(s,o){var l=D[o];if(l){var E=l.name+"";Ut.call(Ba,E)||(Ba[E]=[]),Ba[E].push({name:o,func:l})}}),Ba[Af(t,Q).name]=[{name:"wrapper",func:t}],Mt.prototype.clone=Z2,Mt.prototype.reverse=ey,Mt.prototype.value=ty,D.prototype.at=R3,D.prototype.chain=N3,D.prototype.commit=T3,D.prototype.next=C3,D.prototype.plant=L3,D.prototype.reverse=q3,D.prototype.toJSON=D.prototype.valueOf=D.prototype.value=B3,D.prototype.first=D.prototype.head,Oo&&(D.prototype[Oo]=D3),D},Da=T2();sr?((sr.exports=Da)._=Da,Ft._=Da):Nt._=Da}).call(rc)})(Ad,Ad.exports);var rT=Object.defineProperty,iT=Object.defineProperties,nT=Object.getOwnPropertyDescriptors,_v=Object.getOwnPropertySymbols,sT=Object.prototype.hasOwnProperty,aT=Object.prototype.propertyIsEnumerable,Av=(r,e,t)=>e in r?rT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Gf=(r,e)=>{for(var t in e||(e={}))sT.call(e,t)&&Av(r,t,e[t]);if(_v)for(var t of _v(e))aT.call(e,t)&&Av(r,t,e[t]);return r},oT=(r,e)=>iT(r,nT(e));function dn(r,e,t){var i;const n=ac(r);return((i=e.rpcMap)==null?void 0:i[n.reference])||`${a2}?chainId=${n.namespace}:${n.reference}&projectId=${t}`}function Ia(r){return r.includes(":")?r.split(":")[1]:r}function o2(r){return r.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function cT(r,e){const t=Object.keys(e.namespaces).filter(n=>n.includes(r));if(!t.length)return[];const i=[];return t.forEach(n=>{const a=e.namespaces[n].accounts;i.push(...a)}),i}function jl(r={},e={}){const t=Ev(r),i=Ev(e);return Ad.exports.merge(t,i)}function Ev(r){var e,t,i,n;const a={};if(!bc(r))return a;for(const[f,u]of Object.entries(r)){const b=Jd(f)?[f]:u.chains,p=u.methods||[],y=u.events||[],A=u.rpcMap||{},R=sc(f);a[R]=oT(Gf(Gf({},a[R]),u),{chains:Qf(b,(e=a[R])==null?void 0:e.chains),methods:Qf(p,(t=a[R])==null?void 0:t.methods),events:Qf(y,(i=a[R])==null?void 0:i.events),rpcMap:Gf(Gf({},A),(n=a[R])==null?void 0:n.rpcMap)})}return a}function fT(r){return r.includes(":")?r.split(":")[2]:r}function xv(r){const e={};for(const[t,i]of Object.entries(r)){const n=i.methods||[],a=i.events||[],f=i.accounts||[],u=Jd(t)?[t]:i.chains?i.chains:o2(i.accounts);e[t]={chains:u,methods:n,events:a,accounts:f}}return e}function kl(r){return typeof r=="number"?r:r.includes("0x")?parseInt(r,16):(r=r.includes(":")?r.split(":")[1]:r,isNaN(Number(r))?r:Number(r))}const c2={},Bt=r=>c2[r],Fl=(r,e)=>{c2[r]=e};class hT{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Bt("events"),this.client=Bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Ia(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new pn(new Vn(i,Bt("disableProviderPing")))}}var uT=Object.defineProperty,lT=Object.defineProperties,dT=Object.getOwnPropertyDescriptors,Sv=Object.getOwnPropertySymbols,pT=Object.prototype.hasOwnProperty,gT=Object.prototype.propertyIsEnumerable,Iv=(r,e,t)=>e in r?uT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Mv=(r,e)=>{for(var t in e||(e={}))pT.call(e,t)&&Iv(r,t,e[t]);if(Sv)for(var t of Sv(e))gT.call(e,t)&&Iv(r,t,e[t]);return r},Pv=(r,e)=>lT(r,dT(e));class vT{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Bt("events"),this.client=Bt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(gn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){const i=t||dn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new pn(new Vn(i,Bt("disableProviderPing")))}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=parseInt(Ia(t));e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,i;let n=e.request.params?(t=e.request.params[0])==null?void 0:t.chainId:"0x0";n=n.startsWith("0x")?n:`0x${n}`;const a=parseInt(n,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,i,n;const a=(i=(t=e.request)==null?void 0:t.params)==null?void 0:i[0];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const f=this.client.session.get(e.topic),u=((n=f==null?void 0:f.sessionProperties)==null?void 0:n.capabilities)||{};if(u!=null&&u[a])return u==null?void 0:u[a];const b=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:Pv(Mv({},f.sessionProperties||{}),{capabilities:Pv(Mv({},u||{}),{[a]:b})})})}catch(p){console.warn("Failed to update session with capabilities",p)}return b}async getCallStatus(e){var t,i;const n=this.client.session.get(e.topic),a=(t=n.sessionProperties)==null?void 0:t.bundler_name;if(a){const u=this.getBundlerUrl(e.chainId,a);try{return await this.getUserOperationReceipt(u,e)}catch(b){console.warn("Failed to fetch call status from bundler",b,u)}}const f=(i=n.sessionProperties)==null?void 0:i.bundler_url;if(f)try{return await this.getUserOperationReceipt(f,e)}catch(u){console.warn("Failed to fetch call status from custom bundler",u,f)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,t){var i;const n=new URL(e),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(qs("eth_getUserOperationReceipt",[(i=t.request.params)==null?void 0:i[0]]))});if(!a.ok)throw new Error(`Failed to fetch user operation receipt - ${a.status}`);return await a.json()}getBundlerUrl(e,t){return`${tT}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${t}`}}class bT{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Bt("events"),this.client=Bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Ia(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new pn(new Vn(i,Bt("disableProviderPing")))}}class mT{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Bt("events"),this.client=Bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Ia(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new pn(new Vn(i,Bt("disableProviderPing")))}}class yT{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Bt("events"),this.client=Bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(!this.httpProviders[e]){const i=t||dn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.chainId=e,this.events.emit(gn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||dn(e,this.namespace,this.client.core.projectId);return typeof i>"u"?void 0:new pn(new Vn(i,Bt("disableProviderPing")))}}class wT{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Bt("events"),this.client=Bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{const i=this.getCardanoRPCUrl(t),n=Ia(t);e[n]=this.createHttpProvider(n,i)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){const t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new pn(new Vn(i,Bt("disableProviderPing")))}}class _T{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Bt("events"),this.client=Bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Ia(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new pn(new Vn(i,Bt("disableProviderPing")))}}class AT{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Bt("events"),this.client=Bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;const n=Ia(t);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new pn(new Vn(i,Bt("disableProviderPing")))}}class ET{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Bt("events"),this.client=Bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){const i=t||dn(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(gn.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(t=>{var i;e[t]=this.createHttpProvider(t,(i=this.namespace.rpcMap)==null?void 0:i[t])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||dn(e,this.namespace);return typeof i>"u"?void 0:new pn(new Vn(i,Bt("disableProviderPing")))}}class xT{constructor(e){this.name=Ya,this.namespace=e.namespace,this.events=Bt("events"),this.client=Bt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(gn.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(t=>t.split(":")[1]===this.chainId.toString()).map(t=>t.split(":")[2]))]:[]}createHttpProviders(){var e,t;const i={};return(t=(e=this.namespace)==null?void 0:e.accounts)==null||t.forEach(n=>{const a=ac(n);i[`${a.namespace}:${a.reference}`]=this.createHttpProvider(n)}),i}getHttpProvider(e){const t=this.httpProviders[e];if(typeof t>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){const i=this.createHttpProvider(e,t);i&&(this.httpProviders[e]=i)}createHttpProvider(e,t){const i=t||dn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new pn(new Vn(i,Bt("disableProviderPing")))}}var ST=Object.defineProperty,IT=Object.defineProperties,MT=Object.getOwnPropertyDescriptors,Ov=Object.getOwnPropertySymbols,PT=Object.prototype.hasOwnProperty,OT=Object.prototype.propertyIsEnumerable,Rv=(r,e,t)=>e in r?ST(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Wf=(r,e)=>{for(var t in e||(e={}))PT.call(e,t)&&Rv(r,t,e[t]);if(Ov)for(var t of Ov(e))OT.call(e,t)&&Rv(r,t,e[t]);return r},Hl=(r,e)=>IT(r,MT(e));class n0{constructor(e){this.events=new Id,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:Nc(Hh({level:(e==null?void 0:e.logger)||yv})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const t=new n0(e);return await t.initialize(),t}async request(e,t,i){const[n,a]=this.validateChain(t);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:Wf({},e),chainId:`${n}:${a}`,topic:this.session.topic,expiry:i})}sendAsync(e,t,i,n){const a=new Date().getTime();this.request(e,i,n).then(f=>t(null,Kh(a,f))).catch(f=>t(f,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:$t("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,t){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:i,response:n}=await this.client.authenticate(e,t);i&&(this.uri=i,this.events.emit("display_uri",i));const a=await n();if(this.session=a.session,this.session){const f=xv(this.session.namespaces);this.namespaces=jl(this.namespaces,f),this.persist("namespaces",this.namespaces),this.onConnect()}return a}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await n().then(a=>{this.session=a;const f=xv(a.namespaces);this.namespaces=jl(this.namespaces,f),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==s2)throw a;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;const[i,n]=this.validateChain(e),a=this.getProvider(i);a.name===Ya?a.setDefaultChain(`${i}:${n}`,t):a.setDefaultChain(n,t)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const t=this.client.pairing.getAll();if(jn(t)){for(const i of t)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await i0.init({core:this.providerOpts.core,logger:this.providerOpts.logger||yv,relayUrl:this.providerOpts.relayUrl||XN,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(t=>sc(t)))];Fl("client",this.client),Fl("events",this.events),Fl("disableProviderPing",this.disableProviderPing),e.forEach(t=>{if(!this.session)return;const i=cT(t,this.session),n=o2(i),a=jl(this.namespaces,this.optionalNamespaces),f=Hl(Wf({},a[t]),{accounts:i,chains:n});switch(t){case"eip155":this.rpcProviders[t]=new vT({namespace:f});break;case"algorand":this.rpcProviders[t]=new yT({namespace:f});break;case"solana":this.rpcProviders[t]=new bT({namespace:f});break;case"cosmos":this.rpcProviders[t]=new mT({namespace:f});break;case"polkadot":this.rpcProviders[t]=new hT({namespace:f});break;case"cip34":this.rpcProviders[t]=new wT({namespace:f});break;case"elrond":this.rpcProviders[t]=new _T({namespace:f});break;case"multiversx":this.rpcProviders[t]=new AT({namespace:f});break;case"near":this.rpcProviders[t]=new ET({namespace:f});break;default:this.rpcProviders[Ya]?this.rpcProviders[Ya].updateNamespace(f):this.rpcProviders[Ya]=new xT({namespace:f})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:t}=e,{event:i}=t;if(i.name==="accountsChanged"){const n=i.data;n&&jn(n)&&this.events.emit("accountsChanged",n.map(fT))}else if(i.name==="chainChanged"){const n=t.chainId,a=t.event.data,f=sc(n),u=kl(n)!==kl(a)?`${f}:${kl(a)}`:n;this.onChainChanged(u)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var i;const{namespaces:n}=t,a=(i=this.client)==null?void 0:i.session.get(e);this.session=Hl(Wf({},a),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",Hl(Wf({},$t("USER_DISCONNECTED")),{data:e.topic}))}),this.on(gn.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[Ya]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace((t=this.session)==null?void 0:t.namespaces[e])})}setNamespaces(e){const{namespaces:t,optionalNamespaces:i,sessionProperties:n}=e;t&&Object.keys(t).length&&(this.namespaces=t),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=n,this.persist("namespaces",t),this.persist("optionalNamespaces",i)}validateChain(e){const[t,i]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,i];if(t&&!Object.keys(this.namespaces||{}).map(f=>sc(f)).includes(t))throw new Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&i)return[t,i];const n=sc(Object.keys(this.namespaces)[0]),a=this.rpcProviders[n].getDefaultChain();return[n,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;const[i,n]=this.validateChain(e);n&&(t||this.getProvider(i).setDefaultChain(n),this.namespaces[i]?this.namespaces[i].defaultChain=n:this.namespaces[`${i}:${n}`]?this.namespaces[`${i}:${n}`].defaultChain=n:this.namespaces[`${i}:${n}`]={defaultChain:n},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",n))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${wv}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${wv}/${e}`)}}const RT=n0,NT="wc",TT="ethereum_provider",CT=`${NT}@2:${TT}:`,DT="https://rpc.walletconnect.org/v1/",Ed=["eth_sendTransaction","personal_sign"],LT=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],xd=["chainChanged","accountsChanged"],qT=["chainChanged","accountsChanged","message","disconnect","connect"];var BT=Object.defineProperty,UT=Object.defineProperties,$T=Object.getOwnPropertyDescriptors,Nv=Object.getOwnPropertySymbols,zT=Object.prototype.hasOwnProperty,jT=Object.prototype.propertyIsEnumerable,Tv=(r,e,t)=>e in r?BT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Qa=(r,e)=>{for(var t in e||(e={}))zT.call(e,t)&&Tv(r,t,e[t]);if(Nv)for(var t of Nv(e))jT.call(e,t)&&Tv(r,t,e[t]);return r},Kl=(r,e)=>UT(r,$T(e));function Eh(r){return Number(r[0].split(":")[1])}function Jf(r){return`0x${r.toString(16)}`}function kT(r){const{chains:e,optionalChains:t,methods:i,optionalMethods:n,events:a,optionalEvents:f,rpcMap:u}=r;if(!jn(e))throw new Error("Invalid chains");const b={chains:e,methods:i||Ed,events:a||xd,rpcMap:Qa({},e.length?{[Eh(e)]:u[Eh(e)]}:{})},p=a==null?void 0:a.filter(O=>!xd.includes(O)),y=i==null?void 0:i.filter(O=>!Ed.includes(O));if(!t&&!f&&!n&&!(p!=null&&p.length)&&!(y!=null&&y.length))return{required:e.length?b:void 0};const A=(p==null?void 0:p.length)&&(y==null?void 0:y.length)||!t,R={chains:[...new Set(A?b.chains.concat(t||[]):t)],methods:[...new Set(b.methods.concat(n!=null&&n.length?n:LT))],events:[...new Set(b.events.concat(f!=null&&f.length?f:qT))],rpcMap:u};return{required:e.length?b:void 0,optional:t.length?R:void 0}}class s0{constructor(){this.events=new Fi.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=CT,this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const t=new s0;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,i){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:t,optional:i}=kT(this.rpc);try{const n=await new Promise(async(f,u)=>{var b;this.rpc.showQrModal&&((b=this.modal)==null||b.subscribeModal(p=>{!p.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),u(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(Kl(Qa({namespaces:Qa({},t&&{[this.namespace]:t})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(p=>{f(p)}).catch(p=>{u(new Error(p.message))})});if(!n)return;const a=C1(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Jf(this.chainId)})}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,t){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const i=await new Promise(async(a,f)=>{var u;this.rpc.showQrModal&&((u=this.modal)==null||u.subscribeModal(b=>{!b.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),f(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(Kl(Qa({},e),{chains:this.rpc.chains}),t).then(b=>{a(b)}).catch(b=>{f(new Error(b.message))})}),n=i.session;if(n){const a=C1(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:Jf(this.chainId)})}return i}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:t}=e,{event:i}=t;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",Jf(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",Kl(Qa({},$t("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,i;this.rpc.showQrModal&&((t=this.modal)==null||t.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const t=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",Jf(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){const[t,i,n]=e.split(":");return{chainId:`${t}:${i}`,address:n}}setAccounts(e){this.accounts=e.filter(t=>this.parseChainId(this.parseAccountId(t).chainId)===this.chainId).map(t=>this.parseAccountId(t).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,i;const n=(t=e==null?void 0:e.chains)!=null?t:[],a=(i=e==null?void 0:e.optionalChains)!=null?i:[],f=n.concat(a);if(!f.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const u=n.length?(e==null?void 0:e.methods)||Ed:[],b=n.length?(e==null?void 0:e.events)||xd:[],p=(e==null?void 0:e.optionalMethods)||[],y=(e==null?void 0:e.optionalEvents)||[],A=(e==null?void 0:e.rpcMap)||this.buildRpcMap(f,e.projectId),R=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:n==null?void 0:n.map(O=>this.formatChainId(O)),optionalChains:a.map(O=>this.formatChainId(O)),methods:u,events:b,optionalMethods:p,optionalEvents:y,rpcMap:A,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:R,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){const i={};return e.forEach(n=>{i[n]=this.getRpcUrl(n,t)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Eh(this.rpc.chains):Eh(this.rpc.optionalChains),this.signer=await RT.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let t;try{const{WalletConnectModal:i}=await F8(()=>import("./index-xoNRwz7B.js").then(n=>n.i),__vite__mapDeps([0,1,2]));t=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(t)try{this.modal=new t(Qa({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:t,optionalChains:i,rpcMap:n}=e;t&&jn(t)&&(this.rpc.chains=t.map(a=>this.formatChainId(a)),t.forEach(a=>{this.rpc.rpcMap[a]=(n==null?void 0:n[a])||this.getRpcUrl(a)})),i&&jn(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i==null?void 0:i.map(a=>this.formatChainId(a)),i.forEach(a=>{this.rpc.rpcMap[a]=(n==null?void 0:n[a])||this.getRpcUrl(a)}))}getRpcUrl(e,t){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${DT}?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t==null?void 0:t.accounts),this.setAccounts(t==null?void 0:t.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(t=>this.signer.logger.warn(t))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(t=>this.parseAccount(t))}}const pC=s0;export{pC as EthereumProvider,qT as OPTIONAL_EVENTS,LT as OPTIONAL_METHODS,xd as REQUIRED_EVENTS,Ed as REQUIRED_METHODS,s0 as default}; diff --git a/buddybook/assets/inherits_browser-C-oMugCi.js b/buddybook/assets/inherits_browser-DKXdsDax.js similarity index 74% rename from buddybook/assets/inherits_browser-C-oMugCi.js rename to buddybook/assets/inherits_browser-DKXdsDax.js index 402688f..b22e9cf 100644 --- a/buddybook/assets/inherits_browser-C-oMugCi.js +++ b/buddybook/assets/inherits_browser-DKXdsDax.js @@ -1 +1 @@ -import{g as n,u as s}from"./index-Gmp6KMX1.js";const a=n(s);var r={exports:{}};typeof Object.create=="function"?r.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(e,t){if(t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}};var u=r.exports;export{u as i,a as r}; +import{j as n,v as s}from"./index-Cye4tEiE.js";const a=n(s);var r={exports:{}};typeof Object.create=="function"?r.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:r.exports=function(e,t){if(t){e.super_=t;var o=function(){};o.prototype=t.prototype,e.prototype=new o,e.prototype.constructor=e}};var f=r.exports;export{f as i,a as r}; diff --git a/buddybook/index.html b/buddybook/index.html index 0f2828a..27ff4d0 100644 --- a/buddybook/index.html +++ b/buddybook/index.html @@ -31,8 +31,8 @@ } })(); - - + +
diff --git a/flush-notes/404.html b/flush-notes/404.html index a400f27..9fb6aba 100644 --- a/flush-notes/404.html +++ b/flush-notes/404.html @@ -1 +1 @@ -Share notes

Loading...

\ No newline at end of file +Share notes

Loading...

\ No newline at end of file diff --git a/flush-notes/_next/static/ByRzlDfDsRSlEfHLzI4Mq/_buildManifest.js b/flush-notes/_next/static/5-GwyAoDnZqLVyoBYvyMp/_buildManifest.js similarity index 100% rename from flush-notes/_next/static/ByRzlDfDsRSlEfHLzI4Mq/_buildManifest.js rename to flush-notes/_next/static/5-GwyAoDnZqLVyoBYvyMp/_buildManifest.js diff --git a/flush-notes/_next/static/ByRzlDfDsRSlEfHLzI4Mq/_ssgManifest.js b/flush-notes/_next/static/5-GwyAoDnZqLVyoBYvyMp/_ssgManifest.js similarity index 100% rename from flush-notes/_next/static/ByRzlDfDsRSlEfHLzI4Mq/_ssgManifest.js rename to flush-notes/_next/static/5-GwyAoDnZqLVyoBYvyMp/_ssgManifest.js diff --git a/flush-notes/index.html b/flush-notes/index.html index 9750bac..ab6cece 100644 --- a/flush-notes/index.html +++ b/flush-notes/index.html @@ -1 +1 @@ -Share notes

Loading...

\ No newline at end of file +Share notes

Loading...

\ No newline at end of file diff --git a/flush-notes/index.txt b/flush-notes/index.txt index c3f2e01..0ef9a62 100644 --- a/flush-notes/index.txt +++ b/flush-notes/index.txt @@ -1,6 +1,6 @@ 1:HL["/_next/static/media/a34f9d1faa5f3315-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] 2:HL["/_next/static/css/93e318bfbcd18d37.css","style",{"crossOrigin":""}] -0:["ByRzlDfDsRSlEfHLzI4Mq",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/93e318bfbcd18d37.css","precedence":"next","crossOrigin":""}]],"$L4"]]]] +0:["5-GwyAoDnZqLVyoBYvyMp",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/93e318bfbcd18d37.css","precedence":"next","crossOrigin":""}]],"$L4"]]]] 5:I[5685,["948","static/chunks/948-50bbf5866eb892b4.js","185","static/chunks/app/layout-6076b03a814c7003.js"],""] 6:I[6954,[],""] 7:I[7264,[],""] diff --git a/flush-notes/view.html b/flush-notes/view.html index 8cc4767..ad4f0f2 100644 --- a/flush-notes/view.html +++ b/flush-notes/view.html @@ -1 +1 @@ -Share notes

Loading...

\ No newline at end of file +Share notes

Loading...

\ No newline at end of file diff --git a/flush-notes/view.txt b/flush-notes/view.txt index 9eeabeb..c6f5051 100644 --- a/flush-notes/view.txt +++ b/flush-notes/view.txt @@ -1,6 +1,6 @@ 1:HL["/_next/static/media/a34f9d1faa5f3315-s.p.woff2","font",{"crossOrigin":"","type":"font/woff2"}] 2:HL["/_next/static/css/93e318bfbcd18d37.css","style",{"crossOrigin":""}] -0:["ByRzlDfDsRSlEfHLzI4Mq",[[["",{"children":["view",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/93e318bfbcd18d37.css","precedence":"next","crossOrigin":""}]],"$L4"]]]] +0:["5-GwyAoDnZqLVyoBYvyMp",[[["",{"children":["view",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],"$L3",[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/93e318bfbcd18d37.css","precedence":"next","crossOrigin":""}]],"$L4"]]]] 5:I[5685,["948","static/chunks/948-50bbf5866eb892b4.js","185","static/chunks/app/layout-6076b03a814c7003.js"],""] 6:I[6954,[],""] 7:I[7264,[],""]