@dev.sail.money/sailor 1.2.1-90 → 1.2.1-93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/package.json +1 -1
  2. package/packages/sdk/dist/intelligence.d.ts +1 -1
  3. package/packages/sdk/dist/intelligence.js +1 -1
  4. package/packages/ui/dist/assets/{add-R0xP2zko.js → add-BER1P0s8.js} +1 -1
  5. package/packages/ui/dist/assets/{all-wallets-qnzttqV_.js → all-wallets-Dpvf_Fgb.js} +1 -1
  6. package/packages/ui/dist/assets/{app-store-DpKGxR0G.js → app-store-CRRn8Odw.js} +1 -1
  7. package/packages/ui/dist/assets/{apple-Ckb9o1LK.js → apple-Dt7cfB4T.js} +1 -1
  8. package/packages/ui/dist/assets/{arrow-bottom-circle-BH2TcYm0.js → arrow-bottom-circle-CX3JbHmW.js} +1 -1
  9. package/packages/ui/dist/assets/{arrow-bottom-D1FAx-yB.js → arrow-bottom-nnnn08j6.js} +1 -1
  10. package/packages/ui/dist/assets/{arrow-left-CaaYjdtV.js → arrow-left-CA_ePKfw.js} +1 -1
  11. package/packages/ui/dist/assets/{arrow-right-DW-rnoD_.js → arrow-right-PdNbPXya.js} +1 -1
  12. package/packages/ui/dist/assets/{arrow-top-M7CVCSnU.js → arrow-top-Bi7Vtz7K.js} +1 -1
  13. package/packages/ui/dist/assets/{bank-DVbh1inT.js → bank-pst7NvBz.js} +1 -1
  14. package/packages/ui/dist/assets/{basic-BWLPh793.js → basic-CoHdyAX2.js} +1 -1
  15. package/packages/ui/dist/assets/{browser-BW0QiXeN.js → browser-FFX3Izi4.js} +1 -1
  16. package/packages/ui/dist/assets/{card-BNNvJESX.js → card-DnCzRGnr.js} +1 -1
  17. package/packages/ui/dist/assets/{ccip-C2ivRCFf.js → ccip-DSxi6VpP.js} +1 -1
  18. package/packages/ui/dist/assets/{checkmark-FoCkBDzR.js → checkmark-DYPnyuve.js} +1 -1
  19. package/packages/ui/dist/assets/{checkmark-bold-B7P2Bvsd.js → checkmark-bold-Cw0Vp6CM.js} +1 -1
  20. package/packages/ui/dist/assets/{chevron-bottom-DOhAc7rS.js → chevron-bottom-EVHy9xJn.js} +1 -1
  21. package/packages/ui/dist/assets/{chevron-left-BiWf2KCl.js → chevron-left-CxY9fiDc.js} +1 -1
  22. package/packages/ui/dist/assets/{chevron-right-BH7i9-GZ.js → chevron-right-Br_OBI9u.js} +1 -1
  23. package/packages/ui/dist/assets/{chevron-top-C9zp-WFB.js → chevron-top-BpU3ntbA.js} +1 -1
  24. package/packages/ui/dist/assets/{chrome-store-vDr9wSYG.js → chrome-store-Dpgj_H8i.js} +1 -1
  25. package/packages/ui/dist/assets/{clock-CZlsrGmg.js → clock-BXeQYwif.js} +1 -1
  26. package/packages/ui/dist/assets/{close-C7369YAf.js → close-DL5E5Xp_.js} +1 -1
  27. package/packages/ui/dist/assets/{coinPlaceholder-CEONEmQj.js → coinPlaceholder-DrwJ2B_l.js} +1 -1
  28. package/packages/ui/dist/assets/{compass-DzhhABp6.js → compass-E5e-CeJQ.js} +1 -1
  29. package/packages/ui/dist/assets/{copy-zuwgIOLp.js → copy-BeNB4dl_.js} +1 -1
  30. package/packages/ui/dist/assets/{core-DjR_jD64.js → core-tNZO_nnA.js} +3 -3
  31. package/packages/ui/dist/assets/cursor-DV0oS1UQ.js +3 -0
  32. package/packages/ui/dist/assets/{cursor-transparent-DQOaLcvd.js → cursor-transparent-DZDjASnn.js} +1 -1
  33. package/packages/ui/dist/assets/{desktop-Bv7fy2f-.js → desktop-Cius6BUw.js} +1 -1
  34. package/packages/ui/dist/assets/{disconnect-DT21kQcX.js → disconnect-Bj35sHVy.js} +1 -1
  35. package/packages/ui/dist/assets/{discord-DnM6J12l.js → discord-DfrcpsIk.js} +1 -1
  36. package/packages/ui/dist/assets/{etherscan-CkYGysSe.js → etherscan-CBbH0szp.js} +1 -1
  37. package/packages/ui/dist/assets/{events-Bzlx_C-j.js → events-C79WI7iD.js} +1 -1
  38. package/packages/ui/dist/assets/{exclamation-triangle-CowxL_9E.js → exclamation-triangle-BNJwMq9S.js} +1 -1
  39. package/packages/ui/dist/assets/{extension-Dq3IsAUN.js → extension-CvYgSO7v.js} +1 -1
  40. package/packages/ui/dist/assets/{external-link-CVa7Or9W.js → external-link-CERn9oXB.js} +1 -1
  41. package/packages/ui/dist/assets/{facebook-CeigZ-Dq.js → facebook-B7m7SaqX.js} +1 -1
  42. package/packages/ui/dist/assets/{fallback-QmdVrhdj.js → fallback-BQkB1W8W.js} +1 -1
  43. package/packages/ui/dist/assets/{farcaster-CmxCGnX5.js → farcaster-Bwlsctme.js} +1 -1
  44. package/packages/ui/dist/assets/{filters-CY5pHglU.js → filters-C8rBtKff.js} +1 -1
  45. package/packages/ui/dist/assets/{github-DrSj44zE.js → github-PsXcSjMp.js} +1 -1
  46. package/packages/ui/dist/assets/{google-DTfyabXp.js → google-C_z3OmPf.js} +1 -1
  47. package/packages/ui/dist/assets/{help-circle-kFOxdrQz.js → help-circle-DwWgeVHE.js} +1 -1
  48. package/packages/ui/dist/assets/{id-5pW65QwE.js → id-CLuydosc.js} +1 -1
  49. package/packages/ui/dist/assets/{image-D2FlAtVU.js → image-BsLEVlQ9.js} +1 -1
  50. package/packages/ui/dist/assets/{index-CqeISmow.js → index-B075MYIF.js} +1 -1
  51. package/packages/ui/dist/assets/{index-DZwl1NkD.js → index-B9uA_-pd.js} +1 -1
  52. package/packages/ui/dist/assets/{index-DxcSXSQt.js → index-B_Jv-Jat.js} +1 -1
  53. package/packages/ui/dist/assets/{index-C62B8KTP.js → index-BrDR678h.js} +5 -5
  54. package/packages/ui/dist/assets/{index-CNJJ8w4T.js → index-CQ2Kvj0a.js} +3 -3
  55. package/packages/ui/dist/assets/{index-BkS9kyuf.js → index-_AI1Rhpq.js} +1 -1
  56. package/packages/ui/dist/assets/{index.es-CdKoInzi.js → index.es-C70kk3Fw.js} +4 -4
  57. package/packages/ui/dist/assets/{info-DbUUs-7h.js → info-BjPgE-Fn.js} +1 -1
  58. package/packages/ui/dist/assets/{info-circle-pK0azOfA.js → info-circle-CjkQM-HJ.js} +1 -1
  59. package/packages/ui/dist/assets/{lightbulb-BapmKP8y.js → lightbulb-FhGsti_A.js} +1 -1
  60. package/packages/ui/dist/assets/{mail-CdYd0Rh9.js → mail-Bg5yFmja.js} +1 -1
  61. package/packages/ui/dist/assets/{metamask-sdk-CmHF3TFo.js → metamask-sdk-DtKlSkak.js} +1 -1
  62. package/packages/ui/dist/assets/{mobile-DkjGiGYO.js → mobile-BzAf0T-M.js} +1 -1
  63. package/packages/ui/dist/assets/{more-BsU5N8hZ.js → more-Ccm3EzWe.js} +1 -1
  64. package/packages/ui/dist/assets/{network-placeholder-DLlzj024.js → network-placeholder-DJBjBRGX.js} +1 -1
  65. package/packages/ui/dist/assets/{nftPlaceholder-D2naVFFA.js → nftPlaceholder-DDTtQFge.js} +1 -1
  66. package/packages/ui/dist/assets/{off-O4fs0RcI.js → off-UsG8XtRe.js} +1 -1
  67. package/packages/ui/dist/assets/{parseSignature-Ipc8B6L-.js → parseSignature-CfnKWXKa.js} +1 -1
  68. package/packages/ui/dist/assets/{play-store-BySsEKjB.js → play-store-DCX3LKbh.js} +1 -1
  69. package/packages/ui/dist/assets/{plus-DcwXbThh.js → plus-JIY8UK-q.js} +1 -1
  70. package/packages/ui/dist/assets/{qr-code-DXcikaWN.js → qr-code-D7zoAbI2.js} +1 -1
  71. package/packages/ui/dist/assets/{recycle-horizontal-QHdoxezF.js → recycle-horizontal-D-TJ0tMe.js} +1 -1
  72. package/packages/ui/dist/assets/{refresh-CimMVwX6.js → refresh-BLW9ZCWM.js} +1 -1
  73. package/packages/ui/dist/assets/{reown-logo-DAmY3tUR.js → reown-logo-a6-yZeCb.js} +1 -1
  74. package/packages/ui/dist/assets/{search-YYHOSKxV.js → search-DL22Jf3a.js} +1 -1
  75. package/packages/ui/dist/assets/{secp256k1-DziXvsDr.js → secp256k1-CcCxXqQL.js} +1 -1
  76. package/packages/ui/dist/assets/{send-BohgZ4SZ.js → send-CEqsNJ4v.js} +1 -1
  77. package/packages/ui/dist/assets/{swapHorizontal-gdiztcz1.js → swapHorizontal-qHIvFSq_.js} +1 -1
  78. package/packages/ui/dist/assets/{swapHorizontalBold-C4PPuw1r.js → swapHorizontalBold-BPLu_S-H.js} +1 -1
  79. package/packages/ui/dist/assets/{swapHorizontalMedium-CmhTo_53.js → swapHorizontalMedium-BtzOrTEk.js} +1 -1
  80. package/packages/ui/dist/assets/{swapHorizontalRoundedBold-BPNMkAqM.js → swapHorizontalRoundedBold-CxFUoyan.js} +1 -1
  81. package/packages/ui/dist/assets/{swapVertical-Cnulu56K.js → swapVertical-CKwy7QFB.js} +1 -1
  82. package/packages/ui/dist/assets/{telegram-rBBqAA42.js → telegram-NqtkQg8v.js} +1 -1
  83. package/packages/ui/dist/assets/{three-dots-DhYHC0m3.js → three-dots-CVGMz7ju.js} +1 -1
  84. package/packages/ui/dist/assets/{twitch-DKwUBfEi.js → twitch-DLWcevwY.js} +1 -1
  85. package/packages/ui/dist/assets/{twitterIcon-BEW1pHCf.js → twitterIcon-BWNZUbJU.js} +1 -1
  86. package/packages/ui/dist/assets/{verify-filled-BGkV52th.js → verify-filled-nLelz9C-.js} +1 -1
  87. package/packages/ui/dist/assets/{verify-BVZjkQ2n.js → verify-rPul4L0m.js} +1 -1
  88. package/packages/ui/dist/assets/{w3m-modal-B7m-K8vL.js → w3m-modal-jmFSiKg3.js} +1 -1
  89. package/packages/ui/dist/assets/{wallet-BOwiO_Zr.js → wallet-CbYcUDfO.js} +1 -1
  90. package/packages/ui/dist/assets/{wallet-placeholder-C5O9rl_6.js → wallet-placeholder-6xP3kuxz.js} +1 -1
  91. package/packages/ui/dist/assets/{walletconnect-CKSy8TKP.js → walletconnect-Bj3tR3Jr.js} +1 -1
  92. package/packages/ui/dist/assets/{warning-circle-CwXtaT0N.js → warning-circle-vtLDBHkc.js} +1 -1
  93. package/packages/ui/dist/assets/{x-32UJYpvE.js → x-C5WNnyzd.js} +1 -1
  94. package/packages/ui/dist/index.html +1 -1
  95. package/packages/ui/dist/assets/cursor-DeDBddRQ.js +0 -3
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CqeISmow.js","assets/parseSignature-Ipc8B6L-.js","assets/index-BkS9kyuf.js","assets/index-DZwl1NkD.js","assets/index-DxcSXSQt.js","assets/fallback-QmdVrhdj.js","assets/ccip-C2ivRCFf.js","assets/events-Bzlx_C-j.js","assets/index.es-CdKoInzi.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-B075MYIF.js","assets/parseSignature-CfnKWXKa.js","assets/index-_AI1Rhpq.js","assets/index-B9uA_-pd.js","assets/index-B_Jv-Jat.js","assets/fallback-BQkB1W8W.js","assets/ccip-DSxi6VpP.js","assets/events-C79WI7iD.js","assets/index.es-C70kk3Fw.js"])))=>i.map(i=>d[i]);
2
2
  var gA=Object.defineProperty;var G2=e=>{throw TypeError(e)};var yA=(e,t,n)=>t in e?gA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ds=(e,t,n)=>yA(e,typeof t!="symbol"?t+"":t,n),Hp=(e,t,n)=>t.has(e)||G2("Cannot "+n);var D=(e,t,n)=>(Hp(e,t,"read from private field"),n?n.call(e):t.get(e)),_e=(e,t,n)=>t.has(e)?G2("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ue=(e,t,n,r)=>(Hp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ne=(e,t,n)=>(Hp(e,t,"access private method"),n);var wd=(e,t,n,r)=>({set _(s){ue(e,t,s,n)},get _(){return D(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var Gxe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Kxe(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),n}var Yx={exports:{}},Bh={},Jx={exports:{}},Be={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -1682,7 +1682,7 @@ ${xI(p)}`),super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessa
1682
1682
  `);super(u,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=n.cause,this.details=r,this.docs=a,this.docsOrigin=o,this.docsPath=s,this.shortMessage=t,this.showVersion=c,this.version=l}walk(t){return pC(this,t)}};Object.defineProperty(Se,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${VI()}`}});Se.setStaticOptions(Se.defaultStaticOptions);function pC(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?pC(e.cause,t):t?null:e}function Ju(e,t){if(Ai(e)>t)throw new fM({givenSize:Ai(e),maxSize:t})}const ts={zero:48,nine:57,A:65,F:70,a:97,f:102};function Rw(e){if(e>=ts.zero&&e<=ts.nine)return e-ts.zero;if(e>=ts.A&&e<=ts.F)return e-(ts.A-10);if(e>=ts.a&&e<=ts.f)return e-(ts.a-10)}function GI(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;if(e.length>r)throw new hM({size:e.length,targetSize:r,type:"Bytes"});const s=new Uint8Array(r);for(let o=0;o<r;o++){const a=n==="right";s[a?o:r-o-1]=e[a?o:e.length-o-1]}return s}function mC(e,t={}){const{dir:n="left"}=t;let r=e,s=0;for(let o=0;o<r.length-1&&r[n==="left"?o:r.length-o-1].toString()==="0";o++)s++;return r=n==="left"?r.slice(s):r.slice(0,r.length-s),r}function ap(e,t){if(an(e)>t)throw new yM({givenSize:an(e),maxSize:t})}function KI(e,t){if(typeof t=="number"&&t>0&&t>an(e)-1)throw new kC({offset:t,position:"start",size:an(e)})}function QI(e,t,n){if(typeof t=="number"&&typeof n=="number"&&an(e)!==n-t)throw new kC({offset:n,position:"end",size:an(e)})}function gC(e,t={}){const{dir:n,size:r=32}=t;if(r===0)return e;const s=e.replace("0x","");if(s.length>r*2)throw new bM({size:Math.ceil(s.length/2),targetSize:r,type:"Hex"});return`0x${s[n==="right"?"padEnd":"padStart"](r*2,"0")}`}function YI(e,t={}){const{dir:n="left"}=t;let r=e.replace("0x",""),s=0;for(let o=0;o<r.length-1&&r[n==="left"?o:r.length-o-1].toString()==="0";o++)s++;return r=n==="left"?r.slice(s):r.slice(0,r.length-s),r==="0"?"0x":n==="right"&&r.length%2===1?`0x${r}0`:`0x${r}`}const JI="#__bigint";function ip(e,t,n){return JSON.stringify(e,(r,s)=>typeof s=="bigint"?s.toString()+JI:s,n)}const XI=new TextDecoder,ZI=new TextEncoder;function eM(e){if(!(e instanceof Uint8Array)){if(!e)throw new qd(e);if(typeof e!="object")throw new qd(e);if(!("BYTES_PER_ELEMENT"in e))throw new qd(e);if(e.BYTES_PER_ELEMENT!==1||e.constructor.name!=="Uint8Array")throw new qd(e)}}function tM(e){return e instanceof Uint8Array?e:typeof e=="string"?pb(e):nM(e)}function nM(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function pb(e,t={}){const{size:n}=t;let r=e;n&&(ap(e,n),r=Ca(e,n));let s=r.slice(2);s.length%2&&(s=`0${s}`);const o=s.length/2,a=new Uint8Array(o);for(let c=0,l=0;c<o;c++){const u=Rw(s.charCodeAt(l++)),d=Rw(s.charCodeAt(l++));if(u===void 0||d===void 0)throw new Se(`Invalid byte sequence ("${s[l-2]}${s[l-1]}" in "${s}").`);a[c]=u<<4|d}return a}function rM(e,t={}){const{size:n}=t,r=ZI.encode(e);return typeof n=="number"?(Ju(r,n),sM(r,n)):r}function sM(e,t){return GI(e,{dir:"right",size:t})}function Ai(e){return e.length}function oM(e,t,n,r={}){const{strict:s}=r;return e.slice(t,n)}function aM(e,t={}){const{size:n}=t;typeof n<"u"&&Ju(e,n);const r=$n(e,t);return vC(r,t)}function iM(e,t={}){const{size:n}=t;let r=e;if(typeof n<"u"&&(Ju(r,n),r=yC(r)),r.length>1||r[0]>1)throw new dM(r);return!!r[0]}function vs(e,t={}){const{size:n}=t;typeof n<"u"&&Ju(e,n);const r=$n(e,t);return wC(r,t)}function cM(e,t={}){const{size:n}=t;let r=e;return typeof n<"u"&&(Ju(r,n),r=lM(r)),XI.decode(r)}function yC(e){return mC(e,{dir:"left"})}function lM(e){return mC(e,{dir:"right"})}function uM(e){try{return eM(e),!0}catch{return!1}}class dM extends Se{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["The bytes array must contain a single byte of either a `0` or `1` value."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesBooleanError"})}}class qd extends Se{constructor(t){super(`Value \`${typeof t=="object"?ip(t):t}\` of type \`${typeof t}\` is an invalid Bytes value.`,{metaMessages:["Bytes values must be of type `Bytes`."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.InvalidBytesTypeError"})}}let fM=class extends Se{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},hM=class extends Se{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const pM=new TextEncoder,mM=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function gM(e,t={}){const{strict:n=!1}=t;if(!e)throw new Dw(e);if(typeof e!="string")throw new Dw(e);if(n&&!/^0x[0-9a-fA-F]*$/.test(e))throw new Ow(e);if(!e.startsWith("0x"))throw new Ow(e)}function Sn(...e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function mb(e){return e instanceof Uint8Array?$n(e):Array.isArray(e)?$n(new Uint8Array(e)):e}function bC(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(ap(n,t.size),ka(n,t.size)):n}function $n(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=mM[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(ap(r,t.size),Ca(r,t.size)):r}function tt(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let o;r?n?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof o=="bigint"&&n?-o-1n:0;if(o&&s>o||s<a){const u=typeof e=="bigint"?"n":"";throw new xC({max:o?`${o}${u}`:void 0,min:`${a}${u}`,signed:n,size:r,value:`${e}${u}`})}const l=`0x${(n&&s<0?BigInt.asUintN(r*8,BigInt(s)):s).toString(16)}`;return r?ka(l,r):l}function gb(e,t={}){return $n(pM.encode(e),t)}function ka(e,t){return gC(e,{dir:"left",size:t})}function Ca(e,t){return gC(e,{dir:"right",size:t})}function Tt(e,t,n,r={}){const{strict:s}=r;KI(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return s&&QI(o,t,n),o}function an(e){return Math.ceil((e.length-2)/2)}function Lw(e){return YI(e,{dir:"left"})}function vC(e,t={}){const{signed:n}=t;t.size&&ap(e,t.size);const r=BigInt(e);if(!n)return r;const s=(e.length-2)/2,o=(1n<<BigInt(s)*8n)-1n,a=o>>1n;return r<=a?r:r-o-1n}function wC(e,t={}){const{signed:n,size:r}=t;return Number(!n&&!r?e:vC(e,t))}function _C(e,t={}){const{strict:n=!1}=t;try{return gM(e,{strict:n}),!0}catch{return!1}}let xC=class extends Se{constructor({max:t,min:n,signed:r,size:s,value:o}){super(`Number \`${o}\` is not in safe${s?` ${s*8}-bit`:""}${r?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}};class Dw extends Se{constructor(t){super(`Value \`${typeof t=="object"?ip(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class Ow extends Se{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}let yM=class extends Se{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed \`${n}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}},kC=class extends Se{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}},bM=class extends Se{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}};function vM(e){return{address:e.address,amount:tt(e.amount),index:tt(e.index),validatorIndex:tt(e.validatorIndex)}}function CC(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:tt(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:tt(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:tt(e.gasLimit)},...typeof e.number=="bigint"&&{number:tt(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:tt(e.prevRandao)},...typeof e.time=="bigint"&&{time:tt(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(vM)}}}const wM="0x82ad56cb",jC="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",_M="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",xM="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",yb="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033",Am="/docs/contract/encodeDeployData";function bb(e){const{abi:t,args:n,bytecode:r}=e;if(!n||n.length===0)return r;const s=t.find(a=>"type"in a&&a.type==="constructor");if(!s)throw new rE({docsPath:Am});if(!("inputs"in s))throw new lw({docsPath:Am});if(!s.inputs||s.inputs.length===0)throw new lw({docsPath:Am});const o=Ba(s.inputs,n);return Un([r,o])}function pc(e,t){if(!ut(e,{strict:!1}))throw new Yt({address:e});if(!ut(t,{strict:!1}))throw new Yt({address:t});return e.toLowerCase()===t.toLowerCase()}function Pa(e){const{blockHash:t,blockNumber:n,blockTag:r,requireCanonical:s}=e;if(s!==void 0&&!t)throw new K("`requireCanonical` can only be provided when `blockHash` is set.");return t?s?{blockHash:t,requireCanonical:s}:{blockHash:t}:typeof n=="bigint"?te(n):r??"latest"}class Ei extends K{constructor({cause:t,message:n}={}){var s;const r=(s=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:s.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Ei,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Ei,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class ja extends K{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Cn(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(ja,"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 W0 extends K{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Cn(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(W0,"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 V0 extends K{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(V0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class G0 extends K{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
1683
1683
  `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(G0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class K0 extends K{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(K0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Q0 extends K{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
1684
1684
  `),{cause:t,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(Q0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Y0 extends K{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Y0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class J0 extends K{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(J0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class X0 extends K{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(X0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class bu extends K{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:r}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Cn(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${Cn(r)} gwei`:""}).`].join(`
1685
- `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(bu,"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 Xu extends K{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function cp(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof K?e.walk(s=>(s==null?void 0:s.code)===Ei.code):e;return r instanceof K?new Ei({cause:e,message:r.details}):Ei.nodeMessage.test(n)?new Ei({cause:e,message:e.details}):ja.nodeMessage.test(n)?new ja({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):W0.nodeMessage.test(n)?new W0({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):V0.nodeMessage.test(n)?new V0({cause:e,nonce:t==null?void 0:t.nonce}):G0.nodeMessage.test(n)?new G0({cause:e,nonce:t==null?void 0:t.nonce}):K0.nodeMessage.test(n)?new K0({cause:e,nonce:t==null?void 0:t.nonce}):Q0.nodeMessage.test(n)?new Q0({cause:e}):Y0.nodeMessage.test(n)?new Y0({cause:e,gas:t==null?void 0:t.gas}):J0.nodeMessage.test(n)?new J0({cause:e,gas:t==null?void 0:t.gas}):X0.nodeMessage.test(n)?new X0({cause:e}):bu.nodeMessage.test(n)?new bu({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new Xu({cause:e})}function SC(e,{docsPath:t,...n}){const r=(()=>{const s=cp(e,n);return s instanceof Xu?e:s})();return new cC(r,{docsPath:t,...n})}function Zu(e,{format:t}){if(!t)return{};const n={};function r(o){const a=Object.keys(o);for(const c of a)c in e&&(n[c]=e[c]),o[c]&&typeof o[c]=="object"&&!Array.isArray(o[c])&&r(o[c])}const s=t(e||{});return r(s),n}function lp(e,t){return({exclude:n,format:r})=>({exclude:n,format:(s,o)=>{const a=t(s,o);if(n)for(const c of n)delete a[c];return{...a,...r(s,o)}},type:e})}const kM={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Ra(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=CM(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>lt(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=te(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=te(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=te(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=te(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=te(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=te(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=kM[e.type]),typeof e.value<"u"&&(n.value=te(e.value)),n}const D5e=lp("transactionRequest",Ra);function CM(e){return e.map(t=>({address:t.address,r:t.r?te(BigInt(t.r)):t.r,s:t.s?te(BigInt(t.s)):t.s,chainId:te(t.chainId),nonce:te(t.nonce),...typeof t.yParity<"u"?{yParity:te(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:te(t.v)}:{}}))}function AC(){let e=()=>{},t=()=>{};return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}const Em=new Map;function vb({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const o=async()=>{const d=l();a();const f=d.map(({args:h})=>h);f.length!==0&&e(f).then(h=>{s&&Array.isArray(h)&&h.sort(s);for(let p=0;p<d.length;p++){const{resolve:m}=d[p];m==null||m([h[p],h])}}).catch(h=>{for(let p=0;p<d.length;p++){const{reject:m}=d[p];m==null||m(h)}})},a=()=>Em.delete(t),c=()=>l().map(({args:d})=>d),l=()=>Em.get(t)||[],u=d=>Em.set(t,[...l(),d]);return{flush:a,async schedule(d){const{promise:f,resolve:h,reject:p}=AC();return(n==null?void 0:n([...c(),d]))&&o(),l().length>0?(u({args:d,resolve:h,reject:p}),f):(u({args:d,resolve:h,reject:p}),setTimeout(o,r),f)}}}function Fw(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new fw({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new fw({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function jM(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:o}=e,a={};if(o!==void 0&&(a.code=o),t!==void 0&&(a.balance=te(t)),n!==void 0&&(a.nonce=te(n)),r!==void 0&&(a.state=Fw(r)),s!==void 0){if(a.state)throw new _I;a.stateDiff=Fw(s)}return a}function wb(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ut(n,{strict:!1}))throw new Yt({address:n});if(t[n])throw new wI({address:n});t[n]=jM(r)}return t}const O5e=2n**(8n-1n)-1n,F5e=2n**(16n-1n)-1n,$5e=2n**(24n-1n)-1n,z5e=2n**(32n-1n)-1n,q5e=2n**(40n-1n)-1n,U5e=2n**(48n-1n)-1n,H5e=2n**(56n-1n)-1n,W5e=2n**(64n-1n)-1n,V5e=2n**(72n-1n)-1n,G5e=2n**(80n-1n)-1n,K5e=2n**(88n-1n)-1n,Q5e=2n**(96n-1n)-1n,Y5e=2n**(104n-1n)-1n,J5e=2n**(112n-1n)-1n,X5e=2n**(120n-1n)-1n,Z5e=2n**(128n-1n)-1n,e3e=2n**(136n-1n)-1n,t3e=2n**(144n-1n)-1n,n3e=2n**(152n-1n)-1n,r3e=2n**(160n-1n)-1n,s3e=2n**(168n-1n)-1n,o3e=2n**(176n-1n)-1n,a3e=2n**(184n-1n)-1n,i3e=2n**(192n-1n)-1n,c3e=2n**(200n-1n)-1n,l3e=2n**(208n-1n)-1n,u3e=2n**(216n-1n)-1n,d3e=2n**(224n-1n)-1n,f3e=2n**(232n-1n)-1n,h3e=2n**(240n-1n)-1n,p3e=2n**(248n-1n)-1n,m3e=2n**(256n-1n)-1n,g3e=-(2n**(8n-1n)),y3e=-(2n**(16n-1n)),b3e=-(2n**(24n-1n)),v3e=-(2n**(32n-1n)),w3e=-(2n**(40n-1n)),_3e=-(2n**(48n-1n)),x3e=-(2n**(56n-1n)),k3e=-(2n**(64n-1n)),C3e=-(2n**(72n-1n)),j3e=-(2n**(80n-1n)),S3e=-(2n**(88n-1n)),A3e=-(2n**(96n-1n)),E3e=-(2n**(104n-1n)),N3e=-(2n**(112n-1n)),I3e=-(2n**(120n-1n)),M3e=-(2n**(128n-1n)),B3e=-(2n**(136n-1n)),T3e=-(2n**(144n-1n)),P3e=-(2n**(152n-1n)),R3e=-(2n**(160n-1n)),L3e=-(2n**(168n-1n)),D3e=-(2n**(176n-1n)),O3e=-(2n**(184n-1n)),F3e=-(2n**(192n-1n)),$3e=-(2n**(200n-1n)),z3e=-(2n**(208n-1n)),q3e=-(2n**(216n-1n)),U3e=-(2n**(224n-1n)),H3e=-(2n**(232n-1n)),W3e=-(2n**(240n-1n)),V3e=-(2n**(248n-1n)),G3e=-(2n**(256n-1n)),K3e=2n**8n-1n,Q3e=2n**16n-1n,Y3e=2n**24n-1n,J3e=2n**32n-1n,X3e=2n**40n-1n,Z3e=2n**48n-1n,eke=2n**56n-1n,tke=2n**64n-1n,nke=2n**72n-1n,rke=2n**80n-1n,ske=2n**88n-1n,oke=2n**96n-1n,ake=2n**104n-1n,ike=2n**112n-1n,cke=2n**120n-1n,lke=2n**128n-1n,uke=2n**136n-1n,dke=2n**144n-1n,fke=2n**152n-1n,hke=2n**160n-1n,pke=2n**168n-1n,mke=2n**176n-1n,gke=2n**184n-1n,yke=2n**192n-1n,bke=2n**200n-1n,vke=2n**208n-1n,wke=2n**216n-1n,_ke=2n**224n-1n,xke=2n**232n-1n,kke=2n**240n-1n,Cke=2n**248n-1n,up=2n**256n-1n;function La(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:s}=e,o=t?Lt(t):void 0;if(o&&!ut(o.address))throw new Yt({address:o.address});if(s&&!ut(s))throw new Yt({address:s});if(n&&n>up)throw new ja({maxFeePerGas:n});if(r&&n&&r>n)throw new bu({maxFeePerGas:n,maxPriorityFeePerGas:r})}async function Ic(e,t){var N,H,M,$,W,ie;const{account:n=e.account,authorizationList:r,batch:s=!!((N=e.batch)!=null&&N.multicall),blockHash:o,blockNumber:a,blockTag:c=e.experimental_blockTag??"latest",requireCanonical:l,accessList:u,blobs:d,blockOverrides:f,code:h,data:p,factory:m,factoryData:g,gas:_,gasPrice:b,maxFeePerBlobGas:y,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:x,requestOptions:A,to:C,value:j,stateOverride:E,...I}=t,T=n?Lt(n):void 0;if(h&&(m||g))throw new K("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(h&&C)throw new K("Cannot provide both `code` & `to` as parameters.");const O=h&&p,B=m&&g&&C&&p,U=O||B,L=O?NC({code:h,data:p}):B?MM({data:p,factory:m,factoryData:g,to:C}):p;try{La(t);const de=Pa({blockHash:o,blockNumber:a,blockTag:c,requireCanonical:l}),ye=f?CC(f):void 0,z=wb(E),se=($=(M=(H=e.chain)==null?void 0:H.formatters)==null?void 0:M.transactionRequest)==null?void 0:$.format,xe=(se||Ra)({...Zu(I,{format:se}),accessList:u,account:T,authorizationList:r,blobs:d,data:L,gas:_,gasPrice:b,maxFeePerBlobGas:y,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:x,to:U?void 0:C,value:j},"call");if(s&&SM({request:xe})&&!ye&&o===void 0)try{const{deployless:Fe=!1}=typeof((W=e.batch)==null?void 0:W.multicall)=="object"?e.batch.multicall:{},Ze=EC(e,{blockNumber:a,deployless:Fe});if(!Ze||!IM(z,Ze))return await NM(e,{...xe,blockHash:o,blockNumber:a,blockTag:c,multicallAddress:Ze,requestOptions:A,requireCanonical:l,rpcStateOverride:z})}catch(Fe){if(!(Fe instanceof nC)&&!(Fe instanceof $0))throw Fe}const je=(()=>{const Fe=[xe,de];return z&&ye?[...Fe,z,ye]:z?[...Fe,z]:ye?[...Fe,{},ye]:Fe})(),Ue=await e.request({method:"eth_call",params:je},A);return Ue==="0x"?{data:void 0}:{data:Ue}}catch(de){if((ie=A==null?void 0:A.signal)!=null&&ie.aborted)throw jo(A.signal);if(Nc(de))throw de;const ye=BM(de),{offchainLookup:z,offchainLookupSignature:se}=await ae(async()=>{const{offchainLookup:ge,offchainLookupSignature:xe}=await import("./ccip-C2ivRCFf.js");return{offchainLookup:ge,offchainLookupSignature:xe}},[]);if(e.ccipRead!==!1&&(ye==null?void 0:ye.slice(0,10))===se&&C)return{data:await z(e,{data:ye,requestOptions:A,to:C})};throw U&&(ye==null?void 0:ye.slice(0,10))==="0x101bb98d"?new MI({factory:m}):SC(de,{...t,account:T,chain:e.chain})}}function SM({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(wM)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}let AM=0;const $w=new WeakMap;function EM(e){if(!e)return"default";const t=$w.get(e);if(t!==void 0)return t;const n=AM++;return $w.set(e,n),n}async function NM(e,t){var x;const{batchSize:n=1024,deployless:r=!1,wait:s=0}=typeof((x=e.batch)==null?void 0:x.multicall)=="object"?e.batch.multicall:{},{blockHash:o,blockNumber:a,blockTag:c=e.experimental_blockTag??"latest",requireCanonical:l,data:u,multicallAddress:d,requestOptions:f,rpcStateOverride:h,to:p}=t,m=d!==void 0?d:EC(e,{blockNumber:a,deployless:r}),g=Pa({blockHash:o,blockNumber:a,blockTag:c,requireCanonical:l}),_=typeof g=="string"?g:JSON.stringify(g),b=h?`.${JSON.stringify(h)}`:"",{schedule:y}=vb({id:`${e.uid}.${_}.${EM(f)}${b}`,wait:s,shouldSplitBatch(A){return A.reduce((j,{data:E})=>j+(E.length-2),0)>n*2},fn:async A=>{const C=A.map(T=>({allowFailure:!0,callData:T.data,target:T.to})),j=ht({abi:lc,args:[C],functionName:"aggregate3"}),E={...m===null?{data:NC({code:yb,data:j})}:{to:m,data:j}},I=await e.request({method:"eth_call",params:h?[E,g,h]:[E,g]},f);return Bo({abi:lc,args:[C],functionName:"aggregate3",data:I||"0x"})}}),[{returnData:v,success:w}]=await y({data:u,to:p});if(!w)throw new np({data:v});return v==="0x"?{data:void 0}:{data:v}}function EC(e,t){const{blockNumber:n,deployless:r}=t;if(r)return null;if(e.chain)return Ec({blockNumber:n,chain:e.chain,contract:"multicall3"});throw new nC}function IM(e,t){return e?Object.keys(e).some(n=>pc(n,t)):!1}function NC(e){const{code:t,data:n}=e;return bb({abi:Zk(["constructor(bytes, bytes)"]),bytecode:jC,args:[t,n]})}function MM(e){const{data:t,factory:n,factoryData:r,to:s}=e;return bb({abi:Zk(["constructor(address, bytes, address, bytes)"]),bytecode:_M,args:[s,t,n,r]})}function BM(e){var n;if(!(e instanceof K))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function sr(e,t){const{abi:n,address:r,args:s,functionName:o,...a}=t,c=ht({abi:n,args:s,functionName:o});try{const{data:l}=await we(e,Ic,"call")({...a,data:c,to:r});return Bo({abi:n,args:s,functionName:o,data:l||"0x"})}catch(l){throw hc(l,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:o})}}async function TM(e,t){const{blockNumber:n,blockTag:r,coinType:s,name:o,gatewayUrls:a,strict:c}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return Ec({blockNumber:n,chain:l,contract:"ensUniversalResolver"})})(),d=l==null?void 0:l.ensTlds;if(d&&!d.some(h=>o.endsWith(h)))return null;const f=s!=null?[q0(o),BigInt(s)]:[q0(o)];try{const h=ht({abi:pk,functionName:"addr",args:f}),p={address:u,abi:hk,functionName:"resolveWithGateways",args:[rn(ub(o)),h,a??[rp]],blockNumber:n,blockTag:r},g=await we(e,sr,"readContract")(p);if(g[0]==="0x")return null;const _=PM({coinType:s,data:g[0],args:f});return _==="0x"||kn(_)==="0x00"?null:_}catch(h){if(c)throw h;if(lb(h))return null;throw h}}function PM({coinType:e,data:t,args:n}){try{return Bo({abi:pk,args:n,functionName:"addr",data:t})}catch(r){if(e==null)throw r;const s=kn(t);if(Je(s)===20)return Ge(s);throw r}}class RM extends K{constructor({data:t}){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(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Xc extends K{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class _b extends K{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class LM extends K{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}class jke extends K{constructor({chainId:t}){super(`Invalid ENSIP-11 chainId: ${t}. Must be between 0 and 0x7fffffff, or 1.`,{name:"EnsInvalidChainIdError"})}}const DM=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,OM=/^(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,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,FM=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,$M=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function zM(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function zw(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function IC({uri:e,gatewayUrls:t}){const n=FM.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=zw(t==null?void 0:t.ipfs,"https://ipfs.io"),s=zw(t==null?void 0:t.arweave,"https://arweave.net"),o=e.match(DM),{protocol:a,subpath:c,target:l,subtarget:u=""}=(o==null?void 0:o.groups)||{},d=a==="ipns:/"||c==="ipns/",f=a==="ipfs:/"||c==="ipfs/"||OM.test(e);if(e.startsWith("http")&&!d&&!f){let p=e;return t!=null&&t.arweave&&(p=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:p,isOnChain:!1,isEncoded:!1}}if((d||f)&&l)return{uri:`${r}/${d?"ipns":"ipfs"}/${l}${u}`,isOnChain:!1,isEncoded:!1};if(a==="ar:/"&&l)return{uri:`${s}/${l}${u||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace($M,"");if(h.startsWith("<svg")&&(h=`data:image/svg+xml;base64,${btoa(h)}`),h.startsWith("data:")||h.startsWith("{"))return{uri:h,isOnChain:!0,isEncoded:!1};throw new _b({uri:e})}function MC(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new RM({data:e});return e.image||e.image_url||e.image_data}async function qM({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(s=>s.json());return await xb({gatewayUrls:e,uri:MC(n)})}catch{throw new _b({uri:t})}}async function xb({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=IC({uri:t,gatewayUrls:e});if(r||await zM(n))return n;throw new _b({uri:t})}function UM(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[o,a]=n.split(":"),[c,l]=r.split(":");if(!o||o.toLowerCase()!=="eip155")throw new Xc({reason:"Only EIP-155 supported"});if(!a)throw new Xc({reason:"Chain ID not found"});if(!l)throw new Xc({reason:"Contract address not found"});if(!s)throw new Xc({reason:"Token ID not found"});if(!c)throw new Xc({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a,10),namespace:c.toLowerCase(),contractAddress:l,tokenID:s}}async function HM(e,{nft:t}){if(t.namespace==="erc721")return sr(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return sr(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new LM({namespace:t.namespace})}async function WM(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?VM(e,{gatewayUrls:t,record:n}):xb({uri:n,gatewayUrls:t})}async function VM(e,{gatewayUrls:t,record:n}){const r=UM(n),s=await HM(e,{nft:r}),{uri:o,isOnChain:a,isEncoded:c}=IC({uri:s,gatewayUrls:t});if(a&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const u=c?atob(o.replace("data:application/json;base64,","")):o,d=JSON.parse(u);return xb({uri:MC(d),gatewayUrls:t})}let l=r.tokenID;return r.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),qM({gatewayUrls:t,uri:o.replace(/(?:0x)?{id}/,l)})}async function BC(e,t){const{blockNumber:n,blockTag:r,key:s,name:o,gatewayUrls:a,strict:c}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return Ec({blockNumber:n,chain:l,contract:"ensUniversalResolver"})})(),d=l==null?void 0:l.ensTlds;if(d&&!d.some(f=>o.endsWith(f)))return null;try{const f={address:u,abi:hk,args:[rn(ub(o)),ht({abi:iw,functionName:"text",args:[q0(o),s]}),a??[rp]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},p=await we(e,sr,"readContract")(f);if(p[0]==="0x")return null;const m=Bo({abi:iw,functionName:"text",data:p[0]});return m===""?null:m}catch(f){if(c)throw f;if(lb(f))return null;throw f}}async function TC(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:o,strict:a,universalResolverAddress:c}){const l=await we(e,BC,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:c,gatewayUrls:o,strict:a});if(!l)return null;try{return await WM(e,{record:l,gatewayUrls:r})}catch{return null}}async function PC(e,t){const{address:n,blockNumber:r,blockTag:s,coinType:o=60n,gatewayUrls:a,strict:c}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return Ec({blockNumber:r,chain:l,contract:"ensUniversalResolver"})})();try{const d={address:u,abi:tE,args:[n,o,a??[rp]],functionName:"reverseWithGateways",blockNumber:r,blockTag:s},f=we(e,sr,"readContract"),[h]=await f(d);return h||null}catch(d){if(c)throw d;if(lb(d))return null;throw d}}async function GM(e,t){const{blockNumber:n,blockTag:r,name:s}=t,{chain:o}=e,a=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!o)throw new Error("client chain not configured. universalResolverAddress is required.");return Ec({blockNumber:n,chain:o,contract:"ensUniversalResolver"})})(),c=o==null?void 0:o.ensTlds;if(c&&!c.some(u=>s.endsWith(u)))throw new Error(`${s} is not a valid ENS TLD (${c==null?void 0:c.join(", ")}) for chain "${o.name}" (id: ${o.id}).`);const[l]=await we(e,sr,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[rn(ub(s))],blockNumber:n,blockTag:r});return l}async function RC(e,t){var _,b,y;const{account:n=e.account,blockNumber:r,blockTag:s="latest",blobs:o,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,to:h,value:p,...m}=t,g=n?Lt(n):void 0;try{La(t);const w=(typeof r=="bigint"?te(r):void 0)||s,x=(y=(b=(_=e.chain)==null?void 0:_.formatters)==null?void 0:b.transactionRequest)==null?void 0:y.format,C=(x||Ra)({...Zu(m,{format:x}),account:g,blobs:o,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,to:h,value:p},"createAccessList"),j=await e.request({method:"eth_createAccessList",params:[C,w]});if(j.error)throw new K(j.error,{details:j.error});return{accessList:j.accessList,gasUsed:BigInt(j.gasUsed)}}catch(v){throw SC(v,{...t,account:g,chain:e.chain})}}function dp(e,{method:t}){var r,s;const n={};return e.transport.type==="fallback"&&((s=(r=e.transport).onResponse)==null||s.call(r,({method:o,response:a,status:c,transport:l})=>{c==="success"&&t===o&&(n[a]=l.request)})),o=>n[o]||e.request}async function KM(e){const t=dp(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class QM extends K{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const qw="/docs/contract/encodeEventTopics";function ed(e){var l;const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const u=Ta({abi:t,name:n});if(!u)throw new dw(n,{docsPath:qw});s=u}if(s.type!=="event")throw new dw(void 0,{docsPath:qw});let o=[];if(r&&"inputs"in s){const u=(l=s.inputs)==null?void 0:l.filter(f=>"indexed"in f&&f.indexed),d=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(f=>r[f.name]))??[]:[];d.length>0&&(o=(u==null?void 0:u.map((f,h)=>Array.isArray(d[h])?d[h].map((p,m)=>Uw({param:f,value:d[h][m]})):typeof d[h]<"u"&&d[h]!==null?Uw({param:f,value:d[h]}):null))??[])}if(s.anonymous)return o;const a=Cr(s);return[Zh(a),...o]}function Uw({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Et(Sc(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new QM(e.type);return Ba([e],[t])}async function LC(e,t){const{address:n,abi:r,args:s,eventName:o,fromBlock:a,strict:c,toBlock:l}=t,u=dp(e,{method:"eth_newFilter"}),d=o?ed({abi:r,args:s,eventName:o}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof a=="bigint"?te(a):a,toBlock:typeof l=="bigint"?te(l):l,topics:d}]});return{abi:r,args:s,eventName:o,id:f,request:u(f),strict:!!c,type:"event"}}async function DC(e,{address:t,args:n,event:r,events:s,fromBlock:o,strict:a,toBlock:c}={}){const l=s??(r?[r]:void 0),u=dp(e,{method:"eth_newFilter"});let d=[];l&&(d=[l.flatMap(p=>ed({abi:[p],eventName:p.name,args:n}))],r&&(d=d[0]));const f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof o=="bigint"?te(o):o,toBlock:typeof c=="bigint"?te(c):c,...d.length?{topics:d}:{}}]});return{abi:l,args:n,eventName:r?r.name:void 0,fromBlock:o,id:f,request:u(f),strict:!!a,toBlock:c,type:"event"}}async function OC(e){const t=dp(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}function YM(e){const t=Et(`0x${e.substring(4)}`).substring(26);return Jh(`0x${t}`)}async function JM({hash:e,signature:t}){const n=Hr(e)?e:rn(e),{secp256k1:r}=await ae(async()=>{const{secp256k1:a}=await Promise.resolve().then(()=>LP);return{secp256k1:a}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:d,v:f,yParity:h}=t,p=Number(h??f),m=Hw(p);return new r.Signature(Gt(u),Gt(d)).addRecoveryBit(m)}const a=Hr(t)?t:rn(t);if(Je(a)!==65)throw new Error("invalid signature length");const c=tr(`0x${a.slice(130)}`),l=Hw(c);return r.Signature.fromCompact(a.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function Hw(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function Z0({hash:e,signature:t}){return YM(await JM({hash:e,signature:t}))}function Wr(e,t="hex"){const n=FC(e),r=tb(new Uint8Array(n.length));return n.encode(r),t==="hex"?lt(r.bytes):r.bytes}function Ske(e,t="bytes"){return Wr(e,t)}function Ake(e,t="hex"){return Wr(e,t)}function FC(e){return Array.isArray(e)?XM(e.map(t=>FC(t))):ZM(e)}function XM(e){const t=e.reduce((s,o)=>s+o.length,0),n=$C(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:o}of e)o(s)}}}function ZM(e){const t=typeof e=="string"?nr(e):e,n=$C(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function $C(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new K("Length is too large.")}function eB(e){const{chainId:t,nonce:n,to:r}=e,s=e.contractAddress??e.address,o=Et(Un(["0x05",Wr([t?te(t):"0x",s,n?te(n):"0x"])]));return r==="bytes"?nr(o):o}async function kb(e){const{authorization:t,signature:n}=e;return Z0({hash:eB(t),signature:n??t})}class tB extends K{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:a,gasPrice:c,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:d,to:f,value:h}){var m;const p=Gu({from:n==null?void 0:n.address,to:f,value:typeof h<"u"&&`${ib(h)} ${((m=s==null?void 0:s.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:o,gas:a,gasPrice:typeof c<"u"&&`${Cn(c)} gwei`,maxFeePerGas:typeof l<"u"&&`${Cn(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Cn(u)} gwei`,nonce:d});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function nB(e,{docsPath:t,...n}){const r=(()=>{const s=cp(e,n);return s instanceof Xu?e:s})();return new tB(r,{docsPath:t,...n})}class zC extends K{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Cb extends K{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class rB extends K{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Cn(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class jb extends K{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const qC={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function td(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...e.blockTimestamp!=null&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?tr(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?tr(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?qC[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=oB(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const sB=lp("transaction",td);function oB(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Sb(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:td(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const aB=lp("block",Sb);async function gr(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:s}={}){var u,d,f;const o=s??!1,a=n!==void 0?te(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,o]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[a||r,o]},{dedupe:!!a}),!c)throw new jb({blockHash:t,blockNumber:n});return(((f=(d=(u=e.chain)==null?void 0:u.formatters)==null?void 0:d.block)==null?void 0:f.format)||Sb)(c,"getBlock")}async function Ab(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function iB(e,t){return UC(e,t)}async function UC(e,t){var o,a;const{block:n,chain:r=e.chain,request:s}=t||{};try{const c=((o=r==null?void 0:r.fees)==null?void 0:o.maxPriorityFeePerGas)??((a=r==null?void 0:r.fees)==null?void 0:a.defaultPriorityFee);if(typeof c=="function"){const u=n||await we(e,gr,"getBlock")({}),d=await c({block:u,client:e,request:s});if(d===null)throw new Error;return d}if(typeof c<"u")return c;const l=await e.request({method:"eth_maxPriorityFeePerGas"});return Gt(l)}catch{const[c,l]=await Promise.all([n?Promise.resolve(n):we(e,gr,"getBlock")({}),we(e,Ab,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new Cb;const u=l-c.baseFeePerGas;return u<0n?0n:u}}async function cB(e,t){return eg(e,t)}async function eg(e,t){var h,p;const{block:n,chain:r=e.chain,request:s,type:o="eip1559"}=t||{},a=await(async()=>{var m,g;return typeof((m=r==null?void 0:r.fees)==null?void 0:m.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):((g=r==null?void 0:r.fees)==null?void 0:g.baseFeeMultiplier)??1.2})();if(a<1)throw new zC;const l=10**(((h=a.toString().split(".")[1])==null?void 0:h.length)??0),u=m=>m*BigInt(Math.ceil(a*l))/BigInt(l),d=n||await we(e,gr,"getBlock")({});if(typeof((p=r==null?void 0:r.fees)==null?void 0:p.estimateFeesPerGas)=="function"){const m=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:o});if(m!==null)return m}if(o==="eip1559"){if(typeof d.baseFeePerGas!="bigint")throw new Cb;const m=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await UC(e,{block:d,chain:r,request:s}),g=u(d.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??g+m,maxPriorityFeePerGas:m}}return{gasPrice:(s==null?void 0:s.gasPrice)??u(await we(e,Ab,"getGasPrice")({}))}}async function HC(e,{address:t,blockHash:n,blockNumber:r,blockTag:s="latest",requireCanonical:o}){const a=Pa({blockHash:n,blockNumber:r,blockTag:s,requireCanonical:o}),c=await e.request({method:"eth_getTransactionCount",params:[t,a]},{dedupe:typeof r=="bigint"||n!==void 0});return tr(c)}function Eb(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>nr(o)):e.blobs,s=[];for(const o of r)s.push(Uint8Array.from(t.blobToKzgCommitment(o)));return n==="bytes"?s:s.map(o=>lt(o))}function Nb(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(a=>nr(a)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(a=>nr(a)):e.commitments,o=[];for(let a=0;a<r.length;a++){const c=r[a],l=s[a];o.push(Uint8Array.from(t.computeBlobKzgProof(c,l)))}return n==="bytes"?o:o.map(a=>lt(a))}function lB(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),o=BigInt(4294967295),a=Number(n>>s&o),c=Number(n&o),l=r?4:0,u=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+u,c,r)}function uB(e,t,n){return e&t^~e&n}function dB(e,t,n){return e&t^e&n^t&n}class WC extends Xy{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=bm(this.buffer)}update(t){dc(this),t=Qh(t),xo(t);const{view:n,buffer:r,blockLen:s}=this,o=t.length;for(let a=0;a<o;){const c=Math.min(s-this.pos,o-a);if(c===s){const l=bm(t);for(;s<=o-a;a+=s)this.process(l,a);continue}r.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){dc(this),Ek(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:o}=this;let{pos:a}=this;n[a++]=128,ko(this.buffer.subarray(a)),this.padOffset>s-a&&(this.process(r,0),a=0);for(let f=a;f<s;f++)n[f]=0;lB(r,s-8,BigInt(this.length*8),o),this.process(r,0);const c=bm(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)c.setUint32(4*f,d[f],o)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:o,destroyed:a,pos:c}=this;return t.destroyed=a,t.finished=o,t.length=s,t.pos=c,s%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const Fs=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ut=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Ht=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),fB=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),$s=new Uint32Array(64);class hB extends WC{constructor(t=32){super(64,t,8,!1),this.A=Fs[0]|0,this.B=Fs[1]|0,this.C=Fs[2]|0,this.D=Fs[3]|0,this.E=Fs[4]|0,this.F=Fs[5]|0,this.G=Fs[6]|0,this.H=Fs[7]|0}get(){const{A:t,B:n,C:r,D:s,E:o,F:a,G:c,H:l}=this;return[t,n,r,s,o,a,c,l]}set(t,n,r,s,o,a,c,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=a|0,this.G=c|0,this.H=l|0}process(t,n){for(let f=0;f<16;f++,n+=4)$s[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const h=$s[f-15],p=$s[f-2],m=Er(h,7)^Er(h,18)^h>>>3,g=Er(p,17)^Er(p,19)^p>>>10;$s[f]=g+$s[f-7]+m+$s[f-16]|0}let{A:r,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const h=Er(c,6)^Er(c,11)^Er(c,25),p=d+h+uB(c,l,u)+fB[f]+$s[f]|0,g=(Er(r,2)^Er(r,13)^Er(r,22))+dB(r,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=r,r=p+g|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,o,a,c,l,u,d)}roundClean(){ko($s)}destroy(){this.set(0,0,0,0,0,0,0,0),ko(this.buffer)}}const VC=Ak(["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(e=>BigInt(e))),pB=VC[0],mB=VC[1],zs=new Uint32Array(80),qs=new Uint32Array(80);class GC extends WC{constructor(t=64){super(128,t,16,!1),this.Ah=Ht[0]|0,this.Al=Ht[1]|0,this.Bh=Ht[2]|0,this.Bl=Ht[3]|0,this.Ch=Ht[4]|0,this.Cl=Ht[5]|0,this.Dh=Ht[6]|0,this.Dl=Ht[7]|0,this.Eh=Ht[8]|0,this.El=Ht[9]|0,this.Fh=Ht[10]|0,this.Fl=Ht[11]|0,this.Gh=Ht[12]|0,this.Gl=Ht[13]|0,this.Hh=Ht[14]|0,this.Hl=Ht[15]|0}get(){const{Ah:t,Al:n,Bh:r,Bl:s,Ch:o,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:h,Gh:p,Gl:m,Hh:g,Hl:_}=this;return[t,n,r,s,o,a,c,l,u,d,f,h,p,m,g,_]}set(t,n,r,s,o,a,c,l,u,d,f,h,p,m,g,_){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=o|0,this.Cl=a|0,this.Dh=c|0,this.Dl=l|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=h|0,this.Gh=p|0,this.Gl=m|0,this.Hh=g|0,this.Hl=_|0}process(t,n){for(let v=0;v<16;v++,n+=4)zs[v]=t.getUint32(n),qs[v]=t.getUint32(n+=4);for(let v=16;v<80;v++){const w=zs[v-15]|0,x=qs[v-15]|0,A=Ha(w,x,1)^Ha(w,x,8)^gw(w,x,7),C=Wa(w,x,1)^Wa(w,x,8)^yw(w,x,7),j=zs[v-2]|0,E=qs[v-2]|0,I=Ha(j,E,19)^Fd(j,E,61)^gw(j,E,6),T=Wa(j,E,19)^$d(j,E,61)^yw(j,E,6),O=ME(C,T,qs[v-7],qs[v-16]),B=BE(O,A,I,zs[v-7],zs[v-16]);zs[v]=B|0,qs[v]=O|0}let{Ah:r,Al:s,Bh:o,Bl:a,Ch:c,Cl:l,Dh:u,Dl:d,Eh:f,El:h,Fh:p,Fl:m,Gh:g,Gl:_,Hh:b,Hl:y}=this;for(let v=0;v<80;v++){const w=Ha(f,h,14)^Ha(f,h,18)^Fd(f,h,41),x=Wa(f,h,14)^Wa(f,h,18)^$d(f,h,41),A=f&p^~f&g,C=h&m^~h&_,j=TE(y,x,C,mB[v],qs[v]),E=PE(j,b,w,A,pB[v],zs[v]),I=j|0,T=Ha(r,s,28)^Fd(r,s,34)^Fd(r,s,39),O=Wa(r,s,28)^$d(r,s,34)^$d(r,s,39),B=r&o^r&c^o&c,U=s&a^s&l^a&l;b=g|0,y=_|0,g=p|0,_=m|0,p=f|0,m=h|0,{h:f,l:h}=Xr(u|0,d|0,E|0,I|0),u=c|0,d=l|0,c=o|0,l=a|0,o=r|0,a=s|0;const L=NE(I,O,U);r=IE(L,E,T,B),s=L|0}({h:r,l:s}=Xr(this.Ah|0,this.Al|0,r|0,s|0)),{h:o,l:a}=Xr(this.Bh|0,this.Bl|0,o|0,a|0),{h:c,l}=Xr(this.Ch|0,this.Cl|0,c|0,l|0),{h:u,l:d}=Xr(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:h}=Xr(this.Eh|0,this.El|0,f|0,h|0),{h:p,l:m}=Xr(this.Fh|0,this.Fl|0,p|0,m|0),{h:g,l:_}=Xr(this.Gh|0,this.Gl|0,g|0,_|0),{h:b,l:y}=Xr(this.Hh|0,this.Hl|0,b|0,y|0),this.set(r,s,o,a,c,l,u,d,f,h,p,m,g,_,b,y)}roundClean(){ko(zs,qs)}destroy(){ko(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class gB extends GC{constructor(){super(48),this.Ah=Ut[0]|0,this.Al=Ut[1]|0,this.Bh=Ut[2]|0,this.Bl=Ut[3]|0,this.Ch=Ut[4]|0,this.Cl=Ut[5]|0,this.Dh=Ut[6]|0,this.Dl=Ut[7]|0,this.Eh=Ut[8]|0,this.El=Ut[9]|0,this.Fh=Ut[10]|0,this.Fl=Ut[11]|0,this.Gh=Ut[12]|0,this.Gl=Ut[13]|0,this.Hh=Ut[14]|0,this.Hl=Ut[15]|0}}const KC=Yh(()=>new hB),Eke=Yh(()=>new GC),Nke=Yh(()=>new gB),yB=KC;function bB(e,t){const n=t||"hex",r=yB(Hr(e,{strict:!1})?Sc(e):e);return n==="bytes"?r:rn(r)}function vB(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=bB(t,"bytes");return s.set([n],0),r==="bytes"?s:lt(s)}function QC(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const o of t)s.push(vB({commitment:o,to:r,version:n}));return s}const Ww=6,YC=32,Ib=4096,JC=YC*Ib,Vw=JC*Ww-1-1*Ib*Ww,XC=1;class wB extends K{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class ZC extends K{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class _B extends K{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class xB extends K{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${XC}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function kB(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?nr(e.data):e.data,r=Je(n);if(!r)throw new ZC;if(r>Vw)throw new wB({maxSize:Vw,size:r});const s=[];let o=!0,a=0;for(;o;){const c=tb(new Uint8Array(JC));let l=0;for(;l<Ib;){const u=n.slice(a,a+(YC-1));if(c.pushByte(0),c.pushBytes(u),u.length<31){c.pushByte(128),o=!1;break}l++,a+=31}s.push(c)}return t==="bytes"?s.map(c=>c.bytes):s.map(c=>lt(c.bytes))}function e4(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??kB({data:t,to:r}),o=e.commitments??Eb({blobs:s,kzg:n,to:r}),a=e.proofs??Nb({blobs:s,commitments:o,kzg:n,to:r}),c=[];for(let l=0;l<s.length;l++)c.push({blob:s[l],commitment:o[l],proof:a[l]});return c}function t4(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new CI({transaction:e})}function n4(e,{docsPath:t,...n}){const r=(()=>{const s=cp(e,n);return s instanceof Xu?e:s})();return new SI(r,{docsPath:t,...n})}async function vu(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return tr(t)}async function r4(e,t){var j,E,I,T,O;const{account:n=e.account,accessList:r,authorizationList:s,chain:o=e.chain,blobVersionedHashes:a,blobs:c,data:l,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:m,nonceManager:g,to:_,type:b,value:y,...v}=t,w=await(async()=>{if(!n||!g||typeof m<"u")return m;const B=Lt(n),U=o?o.id:await we(e,vu,"getChainId")({});return await g.consume({address:B.address,chainId:U,client:e})})();La(t);const x=(E=(j=o==null?void 0:o.formatters)==null?void 0:j.transactionRequest)==null?void 0:E.format,C=(x||Ra)({...Zu(v,{format:x}),account:n?Lt(n):void 0,accessList:r,authorizationList:s,blobs:c,blobVersionedHashes:a,data:l,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:w,to:_,type:b,value:y},"fillTransaction");try{const B=await e.request({method:"eth_fillTransaction",params:[C]}),L=(((T=(I=o==null?void 0:o.formatters)==null?void 0:I.transaction)==null?void 0:T.format)||td)(B.tx);delete L.blockHash,delete L.blockNumber,delete L.r,delete L.s,delete L.transactionIndex,delete L.v,delete L.yParity,L.data=L.input,L.gas&&(L.gas=t.gas??L.gas),L.gasPrice&&(L.gasPrice=t.gasPrice??L.gasPrice),L.maxFeePerBlobGas&&(L.maxFeePerBlobGas=t.maxFeePerBlobGas??L.maxFeePerBlobGas),L.maxFeePerGas&&(L.maxFeePerGas=t.maxFeePerGas??L.maxFeePerGas),L.maxPriorityFeePerGas&&(L.maxPriorityFeePerGas=t.maxPriorityFeePerGas??L.maxPriorityFeePerGas),typeof L.nonce<"u"&&(L.nonce=t.nonce??L.nonce);const N=await(async()=>{var W,ie;if(typeof((W=o==null?void 0:o.fees)==null?void 0:W.baseFeeMultiplier)=="function"){const de=await we(e,gr,"getBlock")({});return o.fees.baseFeeMultiplier({block:de,client:e,request:t})}return((ie=o==null?void 0:o.fees)==null?void 0:ie.baseFeeMultiplier)??1.2})();if(N<1)throw new zC;const M=10**(((O=N.toString().split(".")[1])==null?void 0:O.length)??0),$=W=>W*BigInt(Math.ceil(N*M))/BigInt(M);return L.feePayerSignature||(L.maxFeePerGas&&!t.maxFeePerGas&&(L.maxFeePerGas=$(L.maxFeePerGas)),L.gasPrice&&!t.gasPrice&&(L.gasPrice=$(L.gasPrice))),{raw:B.raw,transaction:{from:C.from,...L},...B.capabilities?{capabilities:B.capabilities}:{}}}catch(B){throw n4(B,{...t,chain:e.chain})}}const s4=["blobVersionedHashes","chainId","fees","gas","nonce","type"],Gw=new Map,Nm=new Hu(128);async function Mb(e,t){var w,x,A;let n=t;n.account??(n.account=e.account),n.parameters??(n.parameters=s4);const{account:r,chain:s=e.chain,nonceManager:o,parameters:a}=n,c=(()=>{if(typeof(s==null?void 0:s.prepareTransactionRequest)=="function")return{fn:s.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(s==null?void 0:s.prepareTransactionRequest))return{fn:s.prepareTransactionRequest[0],runAt:s.prepareTransactionRequest[1].runAt}})();let l;async function u(){return l||(typeof n.chainId<"u"?n.chainId:s?s.id:(l=await we(e,vu,"getChainId")({}),l))}const d=r&&Lt(r);let f=n.nonce;if(a.includes("nonce")&&typeof f>"u"&&d&&o){const C=await u();f=await o.consume({address:d.address,chainId:C,client:e})}c!=null&&c.fn&&((w=c.runAt)!=null&&w.includes("beforeFillTransaction"))&&(n=await c.fn({...n,chain:s},{client:e,phase:"beforeFillTransaction"}),f??(f=n.nonce));const p=((a.includes("blobVersionedHashes")||a.includes("sidecars"))&&n.kzg&&n.blobs||Nm.get(e.uid)===!1||!["fees","gas"].some(j=>a.includes(j))?!1:!!(a.includes("chainId")&&typeof n.chainId!="number"||a.includes("nonce")&&typeof f!="number"||a.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||a.includes("gas")&&typeof n.gas!="bigint"))?await we(e,r4,"fillTransaction")({...n,nonce:f}).then(C=>{const{chainId:j,from:E,gas:I,gasPrice:T,nonce:O,maxFeePerBlobGas:B,maxFeePerGas:U,maxPriorityFeePerGas:L,type:N,...H}=C.transaction;return Nm.set(e.uid,!0),{...n,...E?{from:E}:{},...N&&!n.type?{type:N}:{},...typeof j<"u"?{chainId:j}:{},...typeof I<"u"?{gas:I}:{},...typeof T<"u"?{gasPrice:T}:{},...typeof O<"u"?{nonce:O}:{},...typeof B<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerBlobGas:B}:{},...typeof U<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerGas:U}:{},...typeof L<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxPriorityFeePerGas:L}:{},..."nonceKey"in H&&typeof H.nonceKey<"u"?{nonceKey:H.nonceKey}:{},..."keyAuthorization"in H&&typeof H.keyAuthorization<"u"&&H.keyAuthorization!==null&&!("keyAuthorization"in n)?{keyAuthorization:H.keyAuthorization}:{},..."feePayerSignature"in H&&typeof H.feePayerSignature<"u"&&H.feePayerSignature!==null?{feePayerSignature:H.feePayerSignature}:{},..."feeToken"in H&&typeof H.feeToken<"u"&&H.feeToken!==null&&!("feeToken"in n)?{feeToken:H.feeToken}:{},...C.capabilities?{_capabilities:C.capabilities}:{}}}).catch(C=>{var T,O;const j=C;if(j.name!=="TransactionExecutionError")return n;if((T=j.walk)==null?void 0:T.call(j,B=>B.name==="ExecutionRevertedError"))throw C;return((O=j.walk)==null?void 0:O.call(j,B=>{var L;const U=B;return U.name==="MethodNotFoundRpcError"||U.name==="MethodNotSupportedRpcError"||((L=U.message)==null?void 0:L.includes("eth_fillTransaction is not available"))}))&&Nm.set(e.uid,!1),n}):n;f??(f=p.nonce),n={...p,...d?{from:d==null?void 0:d.address}:{},...typeof f<"u"?{nonce:f}:{}};const{blobs:m,gas:g,kzg:_,type:b}=n;c!=null&&c.fn&&((x=c.runAt)!=null&&x.includes("beforeFillParameters"))&&(n=await c.fn({...n,chain:s},{client:e,phase:"beforeFillParameters"}));let y;async function v(){return y||(y=await we(e,gr,"getBlock")({blockTag:"latest"}),y)}if(a.includes("nonce")&&typeof f>"u"&&d&&!o&&(n.nonce=await we(e,HC,"getTransactionCount")({address:d.address,blockTag:"pending"})),(a.includes("blobVersionedHashes")||a.includes("sidecars"))&&m&&_){const C=Eb({blobs:m,kzg:_});if(a.includes("blobVersionedHashes")){const j=QC({commitments:C,to:"hex"});n.blobVersionedHashes=j}if(a.includes("sidecars")){const j=Nb({blobs:m,commitments:C,kzg:_}),E=e4({blobs:m,commitments:C,proofs:j,to:"hex"});n.sidecars=E}}if(a.includes("chainId")&&(n.chainId=await u()),(a.includes("fees")||a.includes("type"))&&typeof b>"u")try{n.type=t4(n)}catch{let C=Gw.get(e.uid);if(typeof C>"u"){const j=await v();C=typeof(j==null?void 0:j.baseFeePerGas)=="bigint",Gw.set(e.uid,C)}n.type=C?"eip1559":"legacy"}if(a.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const C=await v(),{maxFeePerGas:j,maxPriorityFeePerGas:E}=await eg(e,{block:C,chain:s,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<E)throw new rB({maxPriorityFeePerGas:E});n.maxPriorityFeePerGas=E,n.maxFeePerGas=j}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Cb;if(typeof n.gasPrice>"u"){const C=await v(),{gasPrice:j}=await eg(e,{block:C,chain:s,request:n,type:"legacy"});n.gasPrice=j}}return a.includes("gas")&&typeof g>"u"&&(n.gas=await we(e,Bb,"estimateGas")({...n,account:d,prepare:(d==null?void 0:d.type)==="local"?[]:["blobVersionedHashes"]})),c!=null&&c.fn&&((A=c.runAt)!=null&&A.includes("afterFillParameters"))&&(n=await c.fn({...n,chain:s},{client:e,phase:"afterFillParameters"})),La(n),delete n.parameters,n}async function Bb(e,t){var a,c,l;const{account:n=e.account,prepare:r=!0}=t,s=n?Lt(n):void 0,o=(()=>{if(Array.isArray(r))return r;if((s==null?void 0:s.type)!=="local")return["blobVersionedHashes"]})();try{const u=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await kb({authorization:t.authorizationList[0]}).catch(()=>{throw new K("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:d,authorizationList:f,blobs:h,blobVersionedHashes:p,blockNumber:m,blockTag:g,data:_,gas:b,gasPrice:y,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:A,value:C,stateOverride:j,...E}=r?await Mb(e,{...t,parameters:o,to:u}):t;if(b&&t.gas!==b)return b;const T=(typeof m=="bigint"?te(m):void 0)||g,O=wb(j);La(t);const B=(l=(c=(a=e.chain)==null?void 0:a.formatters)==null?void 0:c.transactionRequest)==null?void 0:l.format,L=(B||Ra)({...Zu(E,{format:B}),account:s,accessList:d,authorizationList:f,blobs:h,blobVersionedHashes:p,data:_,gasPrice:y,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:A,to:u,value:C},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:O?[L,T??e.experimental_blockTag??"latest",O]:T?[L,T]:[L]}))}catch(u){throw nB(u,{...t,account:s,chain:e.chain})}}async function CB(e,t){var u;const{abi:n,address:r,args:s,functionName:o,dataSuffix:a=typeof e.dataSuffix=="string"?e.dataSuffix:(u=e.dataSuffix)==null?void 0:u.value,...c}=t,l=ht({abi:n,args:s,functionName:o});try{return await we(e,Bb,"estimateGas")({data:`${l}${a?a.replace("0x",""):""}`,to:r,...c})}catch(d){const f=c.account?Lt(c.account):void 0;throw hc(d,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:o,sender:f==null?void 0:f.address})}}async function o4(e,{address:t,blockHash:n,blockNumber:r,blockTag:s=e.experimental_blockTag??"latest",requireCanonical:o}){var l,u,d;const a=Pa({blockHash:n,blockNumber:r,blockTag:s,requireCanonical:o});if((l=e.batch)!=null&&l.multicall&&((d=(u=e.chain)==null?void 0:u.contracts)!=null&&d.multicall3)){const f=e.chain.contracts.multicall3.address,h=ht({abi:lc,functionName:"getEthBalance",args:[t]}),{data:p}=await we(e,Ic,"call")({to:f,data:h,blockHash:n,blockNumber:r,blockTag:s,requireCanonical:o});return Bo({abi:lc,functionName:"getEthBalance",args:[t],data:p||"0x"})}const c=await e.request({method:"eth_getBalance",params:[t,a]});return BigInt(c)}async function jB(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const SB=new Map,AB=new Map;function EB(e){const t=(s,o)=>({clear:()=>o.delete(s),get:()=>o.get(s),set:a=>o.set(s,a)}),n=t(e,SB),r=t(e,AB);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function NB(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=EB(t),s=r.response.get();if(s&&n>0&&Date.now()-s.created.getTime()<n)return s.data;let o=r.promise.get();o||(o=e(),r.promise.set(o));try{const a=await o;return r.response.set({created:new Date,data:a}),a}finally{r.promise.clear()}}const IB=e=>`blockNumber.${e}`;async function nd(e,{cacheTime:t=e.cacheTime}={}){const n=await NB(()=>e.request({method:"eth_blockNumber"}),{cacheKey:IB(e.uid),cacheTime:t});return BigInt(n)}function Vr(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const MB={"0x0":"reverted","0x1":"success"};function fp(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>Vr(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?tr(e.transactionIndex):null,status:e.status?MB[e.status]:null,type:e.type?qC[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const BB=lp("transactionReceipt",fp);async function TB(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}={}){var c,l,u;const s=n!==void 0?te(n):void 0,o=await e.request({method:"eth_getBlockReceipts",params:[t||s||r]},{dedupe:!!(t||s)});if(!o)throw new jb({blockHash:t,blockNumber:n});const a=((u=(l=(c=e.chain)==null?void 0:c.formatters)==null?void 0:l.transactionReceipt)==null?void 0:u.format)||fp;return o.map(d=>a(d,"getBlockReceipts"))}async function PB(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?te(n):void 0;let o;return t?o=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):o=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:!!s}),tr(o)}async function hh(e,{address:t,blockHash:n,blockNumber:r,blockTag:s="latest",requireCanonical:o}){const a=Pa({blockHash:n,blockNumber:r,blockTag:s,requireCanonical:o}),c=await e.request({method:"eth_getCode",params:[t,a]},{dedupe:typeof r=="bigint"||n!==void 0});if(c!=="0x")return c}const Kw="/docs/contract/decodeEventLog";function ph(e){const{abi:t,data:n,strict:r,topics:s}=e,o=r??!0,[a,...c]=s;if(!a)throw new iE({docsPath:Kw});const l=t.find(b=>b.type==="event"&&a===Zh(Cr(b)));if(!(l&&"name"in l)||l.type!=="event")throw new cE(a,{docsPath:Kw});const{name:u,inputs:d}=l,f=d==null?void 0:d.some(b=>!("name"in b&&b.name)),h=f?[]:{},p=d.map((b,y)=>[b,y]).filter(([b])=>"indexed"in b&&b.indexed),m=[];for(let b=0;b<p.length;b++){const[y,v]=p[b],w=c[b];if(!w){if(o)throw new Ky({abiItem:l,param:y});m.push([y,v]);continue}h[f?v:y.name||v]=RB({param:y,value:w})}const g=d.filter(b=>!("indexed"in b&&b.indexed)),_=o?g:[...m.map(([b])=>b),...g];if(_.length>0){if(n&&n!=="0x")try{const b=Wu(_,n);if(b){let y=0;if(!o)for(const[v,w]of m)h[f?w:v.name||w]=b[y++];if(f)for(let v=0;v<d.length;v++)h[v]===void 0&&y<b.length&&(h[v]=b[y++]);else for(let v=0;v<g.length;v++)h[g[v].name]=b[y++]}}catch(b){if(o)throw b instanceof bk||b instanceof Pk?new ch({abiItem:l,data:n,params:_,size:Je(n)}):b}else if(o)throw new ch({abiItem:l,data:"0x",params:_,size:0})}return{eventName:u,args:Object.values(h).length>0?h:void 0}}function RB({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Wu([e],t)||[])[0]}function hp(e){const{abi:t,args:n,logs:r,strict:s=!0}=e,o=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),a=t.filter(c=>c.type==="event").map(c=>({abi:c,selector:Zh(c)}));return r.map(c=>{var h;const l=typeof c.blockNumber=="string"?Vr(c):c,u=a.filter(p=>l.topics[0]===p.selector);if(u.length===0)return null;let d,f;for(const p of u)try{d=ph({...l,abi:[p.abi],strict:!0}),f=p;break}catch{}if(!d&&!s){f=u[0];try{d=ph({data:l.data,topics:l.topics,abi:[f.abi],strict:!1})}catch{const p=(h=f.abi.inputs)==null?void 0:h.some(m=>!("name"in m&&m.name));return{...l,args:p?[]:{},eventName:f.abi.name}}}return!d||!f||o&&!o.includes(d.eventName)||!LB({args:d.args,inputs:f.abi.inputs,matchArgs:n})?null:{...d,...l}}).filter(Boolean)}function LB(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function s(o,a,c){try{return o.type==="address"?pc(a,c):o.type==="string"||o.type==="bytes"?Et(Sc(a))===c:a===c}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((o,a)=>{if(o==null)return!0;const c=n[a];return c?(Array.isArray(o)?o:[o]).some(u=>s(c,u,t[a])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([o,a])=>{if(a==null)return!0;const c=n.find(u=>u.name===o);return c?(Array.isArray(a)?a:[a]).some(u=>s(c,u,t[o])):!1}):!1}async function Tb(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:o,events:a,args:c,strict:l}={}){const u=l??!1,d=a??(o?[o]:void 0);let f=[];d&&(f=[d.flatMap(g=>ed({abi:[g],eventName:g.name,args:a?void 0:c}))],o&&(f=f[0]));let h;n?h=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):h=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof r=="bigint"?te(r):r,toBlock:typeof s=="bigint"?te(s):s}]});const p=h.map(m=>Vr(m));return d?hp({abi:d,args:c,logs:p,strict:u}):p}async function a4(e,t){const{abi:n,address:r,args:s,blockHash:o,eventName:a,fromBlock:c,toBlock:l,strict:u}=t,d=a?Ta({abi:n,name:a}):void 0,f=d?void 0:n.filter(h=>h.type==="event");return we(e,Tb,"getLogs")({address:r,args:s,blockHash:o,event:d,events:f,fromBlock:c,toBlock:l,strict:u})}async function DB(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=await hh(e,{address:t,...n!==void 0?{blockNumber:n}:{blockTag:r}});if(s&&Je(s)===23&&s.startsWith("0xef0100"))return Ge(Co(s,3,23))}class OB extends K{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function FB(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[o,a,c,l,u,d,f]=await we(e,sr,"readContract")({abi:$B,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:a,version:c,chainId:Number(l),verifyingContract:u,salt:d},extensions:f,fields:o}}catch(o){const a=o;throw a.name==="ContractFunctionExecutionError"&&a.cause.name==="ContractFunctionZeroDataError"?new OB({address:n}):a}}const $B=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function zB(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function qB(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const o=typeof n=="bigint"?te(n):void 0,a=await e.request({method:"eth_feeHistory",params:[te(t),o||r,s]},{dedupe:!!o});return zB(a)}async function pp(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const s=r.map(o=>Vr(o));return!("abi"in t)||!t.abi?s:hp({abi:t.abi,logs:s,strict:n})}async function UB(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(o=>Vr(o));return t.abi?hp({abi:t.abi,logs:s,strict:n}):s}function HB(e,t){if(e.length!==t.length)throw new vk({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],o=t[r];n.push(i4(s,o))}return Un(n)}function i4(e,t,n=!1){if(e==="address"){const a=t;if(!ut(a))throw new Yt({address:a});return _r(a.toLowerCase(),{size:n?32:null})}if(e==="string")return _a(t);if(e==="bytes")return t;if(e==="bool")return _r(Jy(t),{size:n?32:1});const r=e.match(nb);if(r){const[a,c,l="256"]=r,u=Number.parseInt(l,10)/8;return te(t,{size:n?32:u,signed:c==="int"})}const s=e.match(zk);if(s){const[a,c]=s;if(Number.parseInt(c,10)!==(t.length-2)/2)throw new xk({expectedSize:Number.parseInt(c,10),givenSize:(t.length-2)/2});return _r(t,{dir:"right",size:n?32:null})}const o=e.match(oN);if(o&&Array.isArray(t)){const[a,c]=o,l=[];for(let u=0;u<t.length;u++)l.push(i4(c,t[u],!0));return l.length===0?"0x":Un(l)}throw new pE(e)}function WB(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,s=n.address;if(!ut(s))throw new Yt({address:s});if(r<0)throw new ep({chainId:r})}Pb(e)}function VB(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new ZC;for(const n of t){const r=Je(n),s=tr(Co(n,0,1));if(r!==32)throw new _B({hash:n,size:r});if(s!==XC)throw new xB({hash:n,version:s})}}Pb(e)}function Pb(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new ep({chainId:t});if(s&&!ut(s))throw new Yt({address:s});if(r&&r>up)throw new ja({maxFeePerGas:r});if(n&&r&&n>r)throw new bu({maxFeePerGas:r,maxPriorityFeePerGas:n})}function GB(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:o}=e;if(t<=0)throw new ep({chainId:t});if(o&&!ut(o))throw new Yt({address:o});if(n||s)throw new K("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>up)throw new ja({maxFeePerGas:r})}function KB(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:o}=e;if(o&&!ut(o))throw new Yt({address:o});if(typeof t<"u"&&t<=0)throw new ep({chainId:t});if(n||s)throw new K("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>up)throw new ja({maxFeePerGas:r})}function mp(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:s}=e[n];for(let o=0;o<s.length;o++)if(s[o].length-2!==64)throw new jI({storageKey:s[o]});if(!ut(r,{strict:!1}))throw new Yt({address:r});t.push([r,s])}return t}function QB(e,t){const n=t4(e);return n==="eip1559"?XB(e,t):n==="eip2930"?ZB(e,t):n==="eip4844"?JB(e,t):n==="eip7702"?YB(e,t):eT(e,t)}function YB(e,t){const{authorizationList:n,chainId:r,gas:s,nonce:o,to:a,value:c,maxFeePerGas:l,maxPriorityFeePerGas:u,accessList:d,data:f}=e;WB(e);const h=mp(d),p=tT(n);return Un(["0x04",Wr([te(r),o?te(o):"0x",u?te(u):"0x",l?te(l):"0x",s?te(s):"0x",a??"0x",c?te(c):"0x",f??"0x",h,p,...rd(e,t)])])}function JB(e,t){const{chainId:n,gas:r,nonce:s,to:o,value:a,maxFeePerBlobGas:c,maxFeePerGas:l,maxPriorityFeePerGas:u,accessList:d,data:f}=e;VB(e);let h=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&(typeof h>"u"||typeof p>"u")){const v=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(A=>lt(A)),w=e.kzg,x=Eb({blobs:v,kzg:w});if(typeof h>"u"&&(h=QC({commitments:x})),typeof p>"u"){const A=Nb({blobs:v,commitments:x,kzg:w});p=e4({blobs:v,commitments:x,proofs:A})}}const m=mp(d),g=[te(n),s?te(s):"0x",u?te(u):"0x",l?te(l):"0x",r?te(r):"0x",o??"0x",a?te(a):"0x",f??"0x",m,c?te(c):"0x",h??[],...rd(e,t)],_=[],b=[],y=[];if(p)for(let v=0;v<p.length;v++){const{blob:w,commitment:x,proof:A}=p[v];_.push(w),b.push(x),y.push(A)}return Un(["0x03",Wr(p?[g,_,b,y]:g)])}function XB(e,t){const{chainId:n,gas:r,nonce:s,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;Pb(e);const f=mp(u),h=[te(n),s?te(s):"0x",l?te(l):"0x",c?te(c):"0x",r?te(r):"0x",o??"0x",a?te(a):"0x",d??"0x",f,...rd(e,t)];return Un(["0x02",Wr(h)])}function ZB(e,t){const{chainId:n,gas:r,data:s,nonce:o,to:a,value:c,accessList:l,gasPrice:u}=e;GB(e);const d=mp(l),f=[te(n),o?te(o):"0x",u?te(u):"0x",r?te(r):"0x",a??"0x",c?te(c):"0x",s??"0x",d,...rd(e,t)];return Un(["0x01",Wr(f)])}function eT(e,t){const{chainId:n=0,gas:r,data:s,nonce:o,to:a,value:c,gasPrice:l}=e;KB(e);let u=[o?te(o):"0x",l?te(l):"0x",r?te(r):"0x",a??"0x",c?te(c):"0x",s??"0x"];if(t){const d=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const p=27n+(t.v===27n?0n:1n);if(t.v!==p)throw new kI({v:t.v});return p})(),f=kn(t.r),h=kn(t.s);u=[...u,te(d),f==="0x00"?"0x":f,h==="0x00"?"0x":h]}else n>0&&(u=[...u,te(n),"0x","0x"]);return Wr(u)}function rd(e,t){const n=t??e,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const o=kn(n.r),a=kn(n.s);return[typeof s=="number"?s?te(1):"0x":r===0n?"0x":r===1n?te(1):r===27n?"0x":te(1),o==="0x00"?"0x":o,a==="0x00"?"0x":a]}function tT(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:s,...o}=n,a=n.address;t.push([r?rn(r):"0x",a,s?rn(s):"0x",...rd({},o)])}return t}async function nT({address:e,authorization:t,signature:n}){return pc(Ge(e),await kb({authorization:t,signature:n}))}const Ud=new Hu(8192);function rT(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Ud.get(n))return Ud.get(n);const r=e().finally(()=>Ud.delete(n));return Ud.set(n,r),r}async function tg(e,{signal:t}={}){return new Promise((n,r)=>{if(t!=null&&t.aborted){r(jo(t));return}const s=()=>t==null?void 0:t.removeEventListener("abort",a),o=setTimeout(()=>{s(),n()},e),a=()=>{clearTimeout(o),s(),r(jo(t))};t==null||t.addEventListener("abort",a,{once:!0})})}function mc(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0,signal:s}={}){return new Promise((o,a)=>{const c=async({count:l=0}={})=>{if(s!=null&&s.aborted){a(jo(s));return}const u=async({error:d})=>{const f=typeof t=="function"?t({count:l,error:d}):t;if(f)try{await tg(f,{signal:s})}catch(h){a(h);return}c({count:l+1})};try{const d=await e();o(d)}catch(d){if(s!=null&&s.aborted){a(jo(s));return}if(Nc(d)){a(d);return}if(l<n&&await r({count:l,error:d}))return u({error:d});a(d)}};c()})}function sT(e,t={}){return async(n,r={})=>{var h;const{dedupe:s=!1,methods:o,retryDelay:a=150,retryCount:c=3,signal:l,uid:u}={...t,...r},{method:d}=n;if((h=o==null?void 0:o.exclude)!=null&&h.includes(d))throw new Xo(new Error("method not supported"),{method:d});if(o!=null&&o.include&&!o.include.includes(d))throw new Xo(new Error("method not supported"),{method:d});if(l!=null&&l.aborted)throw jo(l);const f=s?aT(`${u}.${xt(n)}`):void 0;return rT(()=>mc(async()=>{try{return await e(n,l?{signal:l}:void 0)}catch(p){if(l!=null&&l.aborted)throw jo(l);if(Nc(p))throw p;const m=p;switch(m.code){case Jl.code:throw new Jl(m);case Xl.code:throw new Xl(m);case Zl.code:throw new Zl(m,{method:n.method});case eu.code:throw new eu(m);case xa.code:throw new xa(m);case So.code:throw new So(m);case tu.code:throw new tu(m);case qr.code:throw new qr(m);case nu.code:throw new nu(m);case Xo.code:throw new Xo(m,{method:n.method});case fc.code:throw new fc(m);case ru.code:throw new ru(m);case Re.code:throw new Re(m);case su.code:throw new su(m);case ou.code:throw new ou(m);case au.code:throw new au(m);case iu.code:throw new iu(m);case jn.code:throw new jn(m);case cu.code:throw new cu(m);case lu.code:throw new lu(m);case uu.code:throw new uu(m);case du.code:throw new du(m);case fu.code:throw new fu(m);case hu.code:throw new hu(m);case pu.code:throw new pu(m);case 5e3:throw new Re(m);case mu.code:throw new mu(m);default:throw p instanceof K?p:new FI(m)}}},{delay:({count:p,error:m})=>{var g;if(m&&m instanceof Il){const _=(g=m==null?void 0:m.headers)==null?void 0:g.get("Retry-After");if(_!=null&&_.match(/\d/))return Number.parseInt(_,10)*1e3}return~~(1<<p)*a},retryCount:c,signal:l,shouldRetry:({error:p})=>oT(p)}),{enabled:s,id:f})}}function oT(e){return Nc(e)?!1:"code"in e&&typeof e.code=="number"?e.code===-1||e.code===fc.code||e.code===xa.code||e.code===429:e instanceof Il&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function aT(e,t=0){let n=3735928559^t,r=1103547991^t;for(let s=0;s<e.length;s++){const o=e.charCodeAt(s);n=Math.imul(n^o,2654435761),r=Math.imul(r^o,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36)}function iT({chain:e,currentChainId:t}){if(!e)throw new pI;if(t!==e.id)throw new hI({chain:e,currentChainId:t})}function Kr(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return s=>{const o=typeof s=="function"?s(r):s,a={...r,...o};return Object.assign(a,{extend:n(a)})}}return Object.assign(t,{extend:n(t)})}function Ike(){return{}}function sd(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,o)=>{(async()=>{let a;const c=new AbortController;try{n>0&&(a=setTimeout(()=>{r?c.abort():o(t)},n)),s(await e({signal:(c==null?void 0:c.signal)||null}))}catch(l){if(c!=null&&c.signal.aborted&&Nc(l)){o(t);return}o(l)}finally{clearTimeout(a)}})()})}function cT(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const ng=cT();function c4(e,t={}){const{url:n,headers:r}=lT(e);return{async request(s){var m,g,_;const{body:o,fetchFn:a=t.fetchFn??fetch,onRequest:c=t.onRequest,onResponse:l=t.onResponse,timeout:u=t.timeout??1e4}=s,d={...t.fetchOptions??{},...s.fetchOptions??{}},{headers:f,method:h,signal:p}=d;try{const b=await sd(async({signal:v})=>{const w={...d,body:Array.isArray(o)?xt(o.map(j=>({jsonrpc:"2.0",id:j.id??ng.take(),...j}))):xt({jsonrpc:"2.0",id:o.id??ng.take(),...o}),headers:{...r,"Content-Type":"application/json",...f},method:h||"POST",signal:p||(u>0?v:null)},x=new Request(n,w),A=await(c==null?void 0:c(x,w))??{...w,url:n};return await a(A.url??n,A)},{errorInstance:new U0({body:o,url:n}),timeout:u,signal:!0});l&&await l(b);let y;if((m=b.headers.get("Content-Type"))!=null&&m.startsWith("application/json"))y=await b.json();else{y=await b.text();try{y=JSON.parse(y||"{}")}catch(v){if(b.ok)throw v;y={error:y}}}if(!b.ok){if(typeof((g=y.error)==null?void 0:g.code)=="number"&&typeof((_=y.error)==null?void 0:_.message)=="string")return y;throw new Il({body:o,details:xt(y.error)||b.statusText,headers:b.headers,status:b.status,url:n})}return y}catch(b){throw p!=null&&p.aborted?jo(p):Nc(b)||b instanceof Il||b instanceof U0?b:new Il({body:o,cause:b,url:n})}}}}function lT(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}const Im=new Map;async function uT(e){const{getSocket:t,keepAlive:n=!0,key:r="socket",reconnect:s=!0,url:o}=e,{interval:a=3e4}=typeof n=="object"?n:{},{attempts:c=5,delay:l=2e3}=typeof s=="object"?s:{},u=JSON.stringify({keepAlive:n,key:r,url:o,reconnect:s});let d=Im.get(u);if(d)return d;let f=0;const{schedule:h}=vb({id:u,fn:async()=>{const g=new Map,_=new Map;let b,y,v,w,x=!1,A=!1;function C(){if(s&&!A&&f<c){if(x)return;x=!0,f++,y==null||y.close(),w=setTimeout(async()=>{if(w=void 0,A){x=!1;return}await j().catch(console.error),x=!1},l)}else g.clear(),_.clear()}async function j(){const E=await t({onClose(){var I,T;for(const O of g.values())(I=O.onError)==null||I.call(O,new uh({url:o}));for(const O of _.values())(T=O.onError)==null||T.call(O,new uh({url:o}));C()},onError(I){var T,O;b=I;for(const B of g.values())(T=B.onError)==null||T.call(B,b);for(const B of _.values())(O=B.onError)==null||O.call(B,b);C()},onOpen(){b=void 0,f=0},onResponse(I){const T=I.method==="eth_subscription",O=T?I.params.subscription:I.id,B=T?_:g,U=B.get(O);U&&U.onResponse(I),T||B.delete(O)}});if(A)return E.close(),E;if(y=E,n&&(v&&clearInterval(v),v=setInterval(()=>{var I;return(I=y.ping)==null?void 0:I.call(y)},a)),s&&_.size>0){const I=_.entries();for(const[T,{onResponse:O,body:B,onError:U}]of I)B&&(_.delete(T),d==null||d.request({body:B,onResponse:O,onError:U}))}return E}return await j(),b=void 0,d={close(){A=!0,v&&clearInterval(v),w&&(clearTimeout(w),w=void 0,x=!1),y.close(),Im.delete(u)},get socket(){return y},request({body:E,onError:I,onResponse:T}){var U;b&&I&&I(b);const O=E.id??ng.take(),B=L=>{typeof L.id=="number"&&O!==L.id||(E.method==="eth_subscribe"&&typeof L.result=="string"&&_.set(L.result,{onResponse:B,onError:I,body:E}),T(L))};E.method==="eth_unsubscribe"&&_.delete((U=E.params)==null?void 0:U[0]),g.set(O,{onResponse:B,onError:I});try{y.request({body:{jsonrpc:"2.0",id:O,...E}})}catch(L){I==null||I(L)}},requestAsync({body:E,timeout:I=1e4}){return sd(()=>new Promise((T,O)=>this.request({body:E,onError:O,onResponse:T})),{errorInstance:new U0({body:E,url:o}),timeout:I})},requests:g,subscriptions:_,url:o},Im.set(u,d),[d]}}),[p,[m]]=await h();return m}async function dT(e,t={}){const{keepAlive:n,reconnect:r}=t;return uT({async getSocket({onClose:s,onError:o,onOpen:a,onResponse:c}){const l=await ae(()=>import("./native-CJ5et6AR.js"),[]).then(p=>p.WebSocket),u=new l(e);function d(){u.removeEventListener("close",d),u.removeEventListener("message",f),u.removeEventListener("error",o),u.removeEventListener("open",a),s()}function f({data:p}){if(!(typeof p=="string"&&p.trim().length===0))try{const m=JSON.parse(p);c(m)}catch(m){o(m)}}u.addEventListener("close",d),u.addEventListener("message",f),u.addEventListener("error",o),u.addEventListener("open",a),u.readyState===l.CONNECTING&&await new Promise((p,m)=>{u&&(u.onopen=p,u.onerror=m)});const{close:h}=u;return Object.assign(u,{close(){h.bind(u)(),d()},ping(){try{if(u.readyState===u.CLOSED||u.readyState===u.CLOSING)throw new Mw({url:u.url,cause:new uh({url:u.url})});const p={jsonrpc:"2.0",id:null,method:"net_version",params:[]};u.send(JSON.stringify(p))}catch(p){o(p)}},request({body:p}){if(u.readyState===u.CLOSED||u.readyState===u.CLOSING)throw new Mw({body:p,url:u.url,cause:new uh({url:u.url})});return u.send(JSON.stringify(p))}})},keepAlive:n,reconnect:r,url:e})}function fT(e,{body:t,onError:n,onResponse:r}){return e.request({body:t,onError:n,onResponse:r}),e}async function hT(e,{body:t,timeout:n=1e4}){return e.requestAsync({body:t,timeout:n})}async function Mke(e){const t=await dT(e);return Object.assign(t.socket,{requests:t.requests,subscriptions:t.subscriptions})}const Mm={http(e,t){return c4(e).request(t)},webSocket:fT,webSocketAsync:hT},pT=`Ethereum Signed Message:
1685
+ `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(bu,"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 Xu extends K{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function cp(e,t){const n=(e.details||"").toLowerCase(),r=e instanceof K?e.walk(s=>(s==null?void 0:s.code)===Ei.code):e;return r instanceof K?new Ei({cause:e,message:r.details}):Ei.nodeMessage.test(n)?new Ei({cause:e,message:e.details}):ja.nodeMessage.test(n)?new ja({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):W0.nodeMessage.test(n)?new W0({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):V0.nodeMessage.test(n)?new V0({cause:e,nonce:t==null?void 0:t.nonce}):G0.nodeMessage.test(n)?new G0({cause:e,nonce:t==null?void 0:t.nonce}):K0.nodeMessage.test(n)?new K0({cause:e,nonce:t==null?void 0:t.nonce}):Q0.nodeMessage.test(n)?new Q0({cause:e}):Y0.nodeMessage.test(n)?new Y0({cause:e,gas:t==null?void 0:t.gas}):J0.nodeMessage.test(n)?new J0({cause:e,gas:t==null?void 0:t.gas}):X0.nodeMessage.test(n)?new X0({cause:e}):bu.nodeMessage.test(n)?new bu({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new Xu({cause:e})}function SC(e,{docsPath:t,...n}){const r=(()=>{const s=cp(e,n);return s instanceof Xu?e:s})();return new cC(r,{docsPath:t,...n})}function Zu(e,{format:t}){if(!t)return{};const n={};function r(o){const a=Object.keys(o);for(const c of a)c in e&&(n[c]=e[c]),o[c]&&typeof o[c]=="object"&&!Array.isArray(o[c])&&r(o[c])}const s=t(e||{});return r(s),n}function lp(e,t){return({exclude:n,format:r})=>({exclude:n,format:(s,o)=>{const a=t(s,o);if(n)for(const c of n)delete a[c];return{...a,...r(s,o)}},type:e})}const kM={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Ra(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=CM(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(r=>lt(r)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=te(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=te(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=te(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=te(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=te(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=te(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=kM[e.type]),typeof e.value<"u"&&(n.value=te(e.value)),n}const D5e=lp("transactionRequest",Ra);function CM(e){return e.map(t=>({address:t.address,r:t.r?te(BigInt(t.r)):t.r,s:t.s?te(BigInt(t.s)):t.s,chainId:te(t.chainId),nonce:te(t.nonce),...typeof t.yParity<"u"?{yParity:te(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:te(t.v)}:{}}))}function AC(){let e=()=>{},t=()=>{};return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}const Em=new Map;function vb({fn:e,id:t,shouldSplitBatch:n,wait:r=0,sort:s}){const o=async()=>{const d=l();a();const f=d.map(({args:h})=>h);f.length!==0&&e(f).then(h=>{s&&Array.isArray(h)&&h.sort(s);for(let p=0;p<d.length;p++){const{resolve:m}=d[p];m==null||m([h[p],h])}}).catch(h=>{for(let p=0;p<d.length;p++){const{reject:m}=d[p];m==null||m(h)}})},a=()=>Em.delete(t),c=()=>l().map(({args:d})=>d),l=()=>Em.get(t)||[],u=d=>Em.set(t,[...l(),d]);return{flush:a,async schedule(d){const{promise:f,resolve:h,reject:p}=AC();return(n==null?void 0:n([...c(),d]))&&o(),l().length>0?(u({args:d,resolve:h,reject:p}),f):(u({args:d,resolve:h,reject:p}),setTimeout(o,r),f)}}}function Fw(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:r})=>{if(n.length!==66)throw new fw({size:n.length,targetSize:66,type:"hex"});if(r.length!==66)throw new fw({size:r.length,targetSize:66,type:"hex"});return t[n]=r,t},{})}function jM(e){const{balance:t,nonce:n,state:r,stateDiff:s,code:o}=e,a={};if(o!==void 0&&(a.code=o),t!==void 0&&(a.balance=te(t)),n!==void 0&&(a.nonce=te(n)),r!==void 0&&(a.state=Fw(r)),s!==void 0){if(a.state)throw new _I;a.stateDiff=Fw(s)}return a}function wb(e){if(!e)return;const t={};for(const{address:n,...r}of e){if(!ut(n,{strict:!1}))throw new Yt({address:n});if(t[n])throw new wI({address:n});t[n]=jM(r)}return t}const O5e=2n**(8n-1n)-1n,F5e=2n**(16n-1n)-1n,$5e=2n**(24n-1n)-1n,z5e=2n**(32n-1n)-1n,q5e=2n**(40n-1n)-1n,U5e=2n**(48n-1n)-1n,H5e=2n**(56n-1n)-1n,W5e=2n**(64n-1n)-1n,V5e=2n**(72n-1n)-1n,G5e=2n**(80n-1n)-1n,K5e=2n**(88n-1n)-1n,Q5e=2n**(96n-1n)-1n,Y5e=2n**(104n-1n)-1n,J5e=2n**(112n-1n)-1n,X5e=2n**(120n-1n)-1n,Z5e=2n**(128n-1n)-1n,e3e=2n**(136n-1n)-1n,t3e=2n**(144n-1n)-1n,n3e=2n**(152n-1n)-1n,r3e=2n**(160n-1n)-1n,s3e=2n**(168n-1n)-1n,o3e=2n**(176n-1n)-1n,a3e=2n**(184n-1n)-1n,i3e=2n**(192n-1n)-1n,c3e=2n**(200n-1n)-1n,l3e=2n**(208n-1n)-1n,u3e=2n**(216n-1n)-1n,d3e=2n**(224n-1n)-1n,f3e=2n**(232n-1n)-1n,h3e=2n**(240n-1n)-1n,p3e=2n**(248n-1n)-1n,m3e=2n**(256n-1n)-1n,g3e=-(2n**(8n-1n)),y3e=-(2n**(16n-1n)),b3e=-(2n**(24n-1n)),v3e=-(2n**(32n-1n)),w3e=-(2n**(40n-1n)),_3e=-(2n**(48n-1n)),x3e=-(2n**(56n-1n)),k3e=-(2n**(64n-1n)),C3e=-(2n**(72n-1n)),j3e=-(2n**(80n-1n)),S3e=-(2n**(88n-1n)),A3e=-(2n**(96n-1n)),E3e=-(2n**(104n-1n)),N3e=-(2n**(112n-1n)),I3e=-(2n**(120n-1n)),M3e=-(2n**(128n-1n)),B3e=-(2n**(136n-1n)),T3e=-(2n**(144n-1n)),P3e=-(2n**(152n-1n)),R3e=-(2n**(160n-1n)),L3e=-(2n**(168n-1n)),D3e=-(2n**(176n-1n)),O3e=-(2n**(184n-1n)),F3e=-(2n**(192n-1n)),$3e=-(2n**(200n-1n)),z3e=-(2n**(208n-1n)),q3e=-(2n**(216n-1n)),U3e=-(2n**(224n-1n)),H3e=-(2n**(232n-1n)),W3e=-(2n**(240n-1n)),V3e=-(2n**(248n-1n)),G3e=-(2n**(256n-1n)),K3e=2n**8n-1n,Q3e=2n**16n-1n,Y3e=2n**24n-1n,J3e=2n**32n-1n,X3e=2n**40n-1n,Z3e=2n**48n-1n,eke=2n**56n-1n,tke=2n**64n-1n,nke=2n**72n-1n,rke=2n**80n-1n,ske=2n**88n-1n,oke=2n**96n-1n,ake=2n**104n-1n,ike=2n**112n-1n,cke=2n**120n-1n,lke=2n**128n-1n,uke=2n**136n-1n,dke=2n**144n-1n,fke=2n**152n-1n,hke=2n**160n-1n,pke=2n**168n-1n,mke=2n**176n-1n,gke=2n**184n-1n,yke=2n**192n-1n,bke=2n**200n-1n,vke=2n**208n-1n,wke=2n**216n-1n,_ke=2n**224n-1n,xke=2n**232n-1n,kke=2n**240n-1n,Cke=2n**248n-1n,up=2n**256n-1n;function La(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:r,to:s}=e,o=t?Lt(t):void 0;if(o&&!ut(o.address))throw new Yt({address:o.address});if(s&&!ut(s))throw new Yt({address:s});if(n&&n>up)throw new ja({maxFeePerGas:n});if(r&&n&&r>n)throw new bu({maxFeePerGas:n,maxPriorityFeePerGas:r})}async function Ic(e,t){var N,H,M,$,W,ie;const{account:n=e.account,authorizationList:r,batch:s=!!((N=e.batch)!=null&&N.multicall),blockHash:o,blockNumber:a,blockTag:c=e.experimental_blockTag??"latest",requireCanonical:l,accessList:u,blobs:d,blockOverrides:f,code:h,data:p,factory:m,factoryData:g,gas:_,gasPrice:b,maxFeePerBlobGas:y,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:x,requestOptions:A,to:C,value:j,stateOverride:E,...I}=t,T=n?Lt(n):void 0;if(h&&(m||g))throw new K("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(h&&C)throw new K("Cannot provide both `code` & `to` as parameters.");const O=h&&p,B=m&&g&&C&&p,U=O||B,L=O?NC({code:h,data:p}):B?MM({data:p,factory:m,factoryData:g,to:C}):p;try{La(t);const de=Pa({blockHash:o,blockNumber:a,blockTag:c,requireCanonical:l}),ye=f?CC(f):void 0,z=wb(E),se=($=(M=(H=e.chain)==null?void 0:H.formatters)==null?void 0:M.transactionRequest)==null?void 0:$.format,xe=(se||Ra)({...Zu(I,{format:se}),accessList:u,account:T,authorizationList:r,blobs:d,data:L,gas:_,gasPrice:b,maxFeePerBlobGas:y,maxFeePerGas:v,maxPriorityFeePerGas:w,nonce:x,to:U?void 0:C,value:j},"call");if(s&&SM({request:xe})&&!ye&&o===void 0)try{const{deployless:Fe=!1}=typeof((W=e.batch)==null?void 0:W.multicall)=="object"?e.batch.multicall:{},Ze=EC(e,{blockNumber:a,deployless:Fe});if(!Ze||!IM(z,Ze))return await NM(e,{...xe,blockHash:o,blockNumber:a,blockTag:c,multicallAddress:Ze,requestOptions:A,requireCanonical:l,rpcStateOverride:z})}catch(Fe){if(!(Fe instanceof nC)&&!(Fe instanceof $0))throw Fe}const je=(()=>{const Fe=[xe,de];return z&&ye?[...Fe,z,ye]:z?[...Fe,z]:ye?[...Fe,{},ye]:Fe})(),Ue=await e.request({method:"eth_call",params:je},A);return Ue==="0x"?{data:void 0}:{data:Ue}}catch(de){if((ie=A==null?void 0:A.signal)!=null&&ie.aborted)throw jo(A.signal);if(Nc(de))throw de;const ye=BM(de),{offchainLookup:z,offchainLookupSignature:se}=await ae(async()=>{const{offchainLookup:ge,offchainLookupSignature:xe}=await import("./ccip-DSxi6VpP.js");return{offchainLookup:ge,offchainLookupSignature:xe}},[]);if(e.ccipRead!==!1&&(ye==null?void 0:ye.slice(0,10))===se&&C)return{data:await z(e,{data:ye,requestOptions:A,to:C})};throw U&&(ye==null?void 0:ye.slice(0,10))==="0x101bb98d"?new MI({factory:m}):SC(de,{...t,account:T,chain:e.chain})}}function SM({request:e}){const{data:t,to:n,...r}=e;return!(!t||t.startsWith(wM)||!n||Object.values(r).filter(s=>typeof s<"u").length>0)}let AM=0;const $w=new WeakMap;function EM(e){if(!e)return"default";const t=$w.get(e);if(t!==void 0)return t;const n=AM++;return $w.set(e,n),n}async function NM(e,t){var x;const{batchSize:n=1024,deployless:r=!1,wait:s=0}=typeof((x=e.batch)==null?void 0:x.multicall)=="object"?e.batch.multicall:{},{blockHash:o,blockNumber:a,blockTag:c=e.experimental_blockTag??"latest",requireCanonical:l,data:u,multicallAddress:d,requestOptions:f,rpcStateOverride:h,to:p}=t,m=d!==void 0?d:EC(e,{blockNumber:a,deployless:r}),g=Pa({blockHash:o,blockNumber:a,blockTag:c,requireCanonical:l}),_=typeof g=="string"?g:JSON.stringify(g),b=h?`.${JSON.stringify(h)}`:"",{schedule:y}=vb({id:`${e.uid}.${_}.${EM(f)}${b}`,wait:s,shouldSplitBatch(A){return A.reduce((j,{data:E})=>j+(E.length-2),0)>n*2},fn:async A=>{const C=A.map(T=>({allowFailure:!0,callData:T.data,target:T.to})),j=ht({abi:lc,args:[C],functionName:"aggregate3"}),E={...m===null?{data:NC({code:yb,data:j})}:{to:m,data:j}},I=await e.request({method:"eth_call",params:h?[E,g,h]:[E,g]},f);return Bo({abi:lc,args:[C],functionName:"aggregate3",data:I||"0x"})}}),[{returnData:v,success:w}]=await y({data:u,to:p});if(!w)throw new np({data:v});return v==="0x"?{data:void 0}:{data:v}}function EC(e,t){const{blockNumber:n,deployless:r}=t;if(r)return null;if(e.chain)return Ec({blockNumber:n,chain:e.chain,contract:"multicall3"});throw new nC}function IM(e,t){return e?Object.keys(e).some(n=>pc(n,t)):!1}function NC(e){const{code:t,data:n}=e;return bb({abi:Zk(["constructor(bytes, bytes)"]),bytecode:jC,args:[t,n]})}function MM(e){const{data:t,factory:n,factoryData:r,to:s}=e;return bb({abi:Zk(["constructor(address, bytes, address, bytes)"]),bytecode:_M,args:[s,t,n,r]})}function BM(e){var n;if(!(e instanceof K))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(n=t.data)==null?void 0:n.data:t.data}async function sr(e,t){const{abi:n,address:r,args:s,functionName:o,...a}=t,c=ht({abi:n,args:s,functionName:o});try{const{data:l}=await we(e,Ic,"call")({...a,data:c,to:r});return Bo({abi:n,args:s,functionName:o,data:l||"0x"})}catch(l){throw hc(l,{abi:n,address:r,args:s,docsPath:"/docs/contract/readContract",functionName:o})}}async function TM(e,t){const{blockNumber:n,blockTag:r,coinType:s,name:o,gatewayUrls:a,strict:c}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return Ec({blockNumber:n,chain:l,contract:"ensUniversalResolver"})})(),d=l==null?void 0:l.ensTlds;if(d&&!d.some(h=>o.endsWith(h)))return null;const f=s!=null?[q0(o),BigInt(s)]:[q0(o)];try{const h=ht({abi:pk,functionName:"addr",args:f}),p={address:u,abi:hk,functionName:"resolveWithGateways",args:[rn(ub(o)),h,a??[rp]],blockNumber:n,blockTag:r},g=await we(e,sr,"readContract")(p);if(g[0]==="0x")return null;const _=PM({coinType:s,data:g[0],args:f});return _==="0x"||kn(_)==="0x00"?null:_}catch(h){if(c)throw h;if(lb(h))return null;throw h}}function PM({coinType:e,data:t,args:n}){try{return Bo({abi:pk,args:n,functionName:"addr",data:t})}catch(r){if(e==null)throw r;const s=kn(t);if(Je(s)===20)return Ge(s);throw r}}class RM extends K{constructor({data:t}){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(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Xc extends K{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class _b extends K{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class LM extends K{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}class jke extends K{constructor({chainId:t}){super(`Invalid ENSIP-11 chainId: ${t}. Must be between 0 and 0x7fffffff, or 1.`,{name:"EnsInvalidChainIdError"})}}const DM=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,OM=/^(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,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,FM=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,$M=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function zM(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const n=t.headers.get("content-type");return n==null?void 0:n.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const r=new Image;r.onload=()=>{n(!0)},r.onerror=()=>{n(!1)},r.src=e})}}function zw(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function IC({uri:e,gatewayUrls:t}){const n=FM.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const r=zw(t==null?void 0:t.ipfs,"https://ipfs.io"),s=zw(t==null?void 0:t.arweave,"https://arweave.net"),o=e.match(DM),{protocol:a,subpath:c,target:l,subtarget:u=""}=(o==null?void 0:o.groups)||{},d=a==="ipns:/"||c==="ipns/",f=a==="ipfs:/"||c==="ipfs/"||OM.test(e);if(e.startsWith("http")&&!d&&!f){let p=e;return t!=null&&t.arweave&&(p=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:p,isOnChain:!1,isEncoded:!1}}if((d||f)&&l)return{uri:`${r}/${d?"ipns":"ipfs"}/${l}${u}`,isOnChain:!1,isEncoded:!1};if(a==="ar:/"&&l)return{uri:`${s}/${l}${u||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace($M,"");if(h.startsWith("<svg")&&(h=`data:image/svg+xml;base64,${btoa(h)}`),h.startsWith("data:")||h.startsWith("{"))return{uri:h,isOnChain:!0,isEncoded:!1};throw new _b({uri:e})}function MC(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new RM({data:e});return e.image||e.image_url||e.image_data}async function qM({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(s=>s.json());return await xb({gatewayUrls:e,uri:MC(n)})}catch{throw new _b({uri:t})}}async function xb({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:r}=IC({uri:t,gatewayUrls:e});if(r||await zM(n))return n;throw new _b({uri:t})}function UM(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,r,s]=t.split("/"),[o,a]=n.split(":"),[c,l]=r.split(":");if(!o||o.toLowerCase()!=="eip155")throw new Xc({reason:"Only EIP-155 supported"});if(!a)throw new Xc({reason:"Chain ID not found"});if(!l)throw new Xc({reason:"Contract address not found"});if(!s)throw new Xc({reason:"Token ID not found"});if(!c)throw new Xc({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a,10),namespace:c.toLowerCase(),contractAddress:l,tokenID:s}}async function HM(e,{nft:t}){if(t.namespace==="erc721")return sr(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return sr(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new LM({namespace:t.namespace})}async function WM(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?VM(e,{gatewayUrls:t,record:n}):xb({uri:n,gatewayUrls:t})}async function VM(e,{gatewayUrls:t,record:n}){const r=UM(n),s=await HM(e,{nft:r}),{uri:o,isOnChain:a,isEncoded:c}=IC({uri:s,gatewayUrls:t});if(a&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const u=c?atob(o.replace("data:application/json;base64,","")):o,d=JSON.parse(u);return xb({uri:MC(d),gatewayUrls:t})}let l=r.tokenID;return r.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),qM({gatewayUrls:t,uri:o.replace(/(?:0x)?{id}/,l)})}async function BC(e,t){const{blockNumber:n,blockTag:r,key:s,name:o,gatewayUrls:a,strict:c}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return Ec({blockNumber:n,chain:l,contract:"ensUniversalResolver"})})(),d=l==null?void 0:l.ensTlds;if(d&&!d.some(f=>o.endsWith(f)))return null;try{const f={address:u,abi:hk,args:[rn(ub(o)),ht({abi:iw,functionName:"text",args:[q0(o),s]}),a??[rp]],functionName:"resolveWithGateways",blockNumber:n,blockTag:r},p=await we(e,sr,"readContract")(f);if(p[0]==="0x")return null;const m=Bo({abi:iw,functionName:"text",data:p[0]});return m===""?null:m}catch(f){if(c)throw f;if(lb(f))return null;throw f}}async function TC(e,{blockNumber:t,blockTag:n,assetGatewayUrls:r,name:s,gatewayUrls:o,strict:a,universalResolverAddress:c}){const l=await we(e,BC,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:s,universalResolverAddress:c,gatewayUrls:o,strict:a});if(!l)return null;try{return await WM(e,{record:l,gatewayUrls:r})}catch{return null}}async function PC(e,t){const{address:n,blockNumber:r,blockTag:s,coinType:o=60n,gatewayUrls:a,strict:c}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return Ec({blockNumber:r,chain:l,contract:"ensUniversalResolver"})})();try{const d={address:u,abi:tE,args:[n,o,a??[rp]],functionName:"reverseWithGateways",blockNumber:r,blockTag:s},f=we(e,sr,"readContract"),[h]=await f(d);return h||null}catch(d){if(c)throw d;if(lb(d))return null;throw d}}async function GM(e,t){const{blockNumber:n,blockTag:r,name:s}=t,{chain:o}=e,a=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!o)throw new Error("client chain not configured. universalResolverAddress is required.");return Ec({blockNumber:n,chain:o,contract:"ensUniversalResolver"})})(),c=o==null?void 0:o.ensTlds;if(c&&!c.some(u=>s.endsWith(u)))throw new Error(`${s} is not a valid ENS TLD (${c==null?void 0:c.join(", ")}) for chain "${o.name}" (id: ${o.id}).`);const[l]=await we(e,sr,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[rn(ub(s))],blockNumber:n,blockTag:r});return l}async function RC(e,t){var _,b,y;const{account:n=e.account,blockNumber:r,blockTag:s="latest",blobs:o,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,to:h,value:p,...m}=t,g=n?Lt(n):void 0;try{La(t);const w=(typeof r=="bigint"?te(r):void 0)||s,x=(y=(b=(_=e.chain)==null?void 0:_.formatters)==null?void 0:b.transactionRequest)==null?void 0:y.format,C=(x||Ra)({...Zu(m,{format:x}),account:g,blobs:o,data:a,gas:c,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:d,maxPriorityFeePerGas:f,to:h,value:p},"createAccessList"),j=await e.request({method:"eth_createAccessList",params:[C,w]});if(j.error)throw new K(j.error,{details:j.error});return{accessList:j.accessList,gasUsed:BigInt(j.gasUsed)}}catch(v){throw SC(v,{...t,account:g,chain:e.chain})}}function dp(e,{method:t}){var r,s;const n={};return e.transport.type==="fallback"&&((s=(r=e.transport).onResponse)==null||s.call(r,({method:o,response:a,status:c,transport:l})=>{c==="success"&&t===o&&(n[a]=l.request)})),o=>n[o]||e.request}async function KM(e){const t=dp(e,{method:"eth_newBlockFilter"}),n=await e.request({method:"eth_newBlockFilter"});return{id:n,request:t(n),type:"block"}}class QM extends K{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}const qw="/docs/contract/encodeEventTopics";function ed(e){var l;const{abi:t,eventName:n,args:r}=e;let s=t[0];if(n){const u=Ta({abi:t,name:n});if(!u)throw new dw(n,{docsPath:qw});s=u}if(s.type!=="event")throw new dw(void 0,{docsPath:qw});let o=[];if(r&&"inputs"in s){const u=(l=s.inputs)==null?void 0:l.filter(f=>"indexed"in f&&f.indexed),d=Array.isArray(r)?r:Object.values(r).length>0?(u==null?void 0:u.map(f=>r[f.name]))??[]:[];d.length>0&&(o=(u==null?void 0:u.map((f,h)=>Array.isArray(d[h])?d[h].map((p,m)=>Uw({param:f,value:d[h][m]})):typeof d[h]<"u"&&d[h]!==null?Uw({param:f,value:d[h]}):null))??[])}if(s.anonymous)return o;const a=Cr(s);return[Zh(a),...o]}function Uw({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return Et(Sc(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new QM(e.type);return Ba([e],[t])}async function LC(e,t){const{address:n,abi:r,args:s,eventName:o,fromBlock:a,strict:c,toBlock:l}=t,u=dp(e,{method:"eth_newFilter"}),d=o?ed({abi:r,args:s,eventName:o}):void 0,f=await e.request({method:"eth_newFilter",params:[{address:n,fromBlock:typeof a=="bigint"?te(a):a,toBlock:typeof l=="bigint"?te(l):l,topics:d}]});return{abi:r,args:s,eventName:o,id:f,request:u(f),strict:!!c,type:"event"}}async function DC(e,{address:t,args:n,event:r,events:s,fromBlock:o,strict:a,toBlock:c}={}){const l=s??(r?[r]:void 0),u=dp(e,{method:"eth_newFilter"});let d=[];l&&(d=[l.flatMap(p=>ed({abi:[p],eventName:p.name,args:n}))],r&&(d=d[0]));const f=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof o=="bigint"?te(o):o,toBlock:typeof c=="bigint"?te(c):c,...d.length?{topics:d}:{}}]});return{abi:l,args:n,eventName:r?r.name:void 0,fromBlock:o,id:f,request:u(f),strict:!!a,toBlock:c,type:"event"}}async function OC(e){const t=dp(e,{method:"eth_newPendingTransactionFilter"}),n=await e.request({method:"eth_newPendingTransactionFilter"});return{id:n,request:t(n),type:"transaction"}}function YM(e){const t=Et(`0x${e.substring(4)}`).substring(26);return Jh(`0x${t}`)}async function JM({hash:e,signature:t}){const n=Hr(e)?e:rn(e),{secp256k1:r}=await ae(async()=>{const{secp256k1:a}=await Promise.resolve().then(()=>LP);return{secp256k1:a}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:d,v:f,yParity:h}=t,p=Number(h??f),m=Hw(p);return new r.Signature(Gt(u),Gt(d)).addRecoveryBit(m)}const a=Hr(t)?t:rn(t);if(Je(a)!==65)throw new Error("invalid signature length");const c=tr(`0x${a.slice(130)}`),l=Hw(c);return r.Signature.fromCompact(a.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(n.substring(2)).toHex(!1)}`}function Hw(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function Z0({hash:e,signature:t}){return YM(await JM({hash:e,signature:t}))}function Wr(e,t="hex"){const n=FC(e),r=tb(new Uint8Array(n.length));return n.encode(r),t==="hex"?lt(r.bytes):r.bytes}function Ske(e,t="bytes"){return Wr(e,t)}function Ake(e,t="hex"){return Wr(e,t)}function FC(e){return Array.isArray(e)?XM(e.map(t=>FC(t))):ZM(e)}function XM(e){const t=e.reduce((s,o)=>s+o.length,0),n=$C(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:o}of e)o(s)}}}function ZM(e){const t=typeof e=="string"?nr(e):e,n=$C(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function $C(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new K("Length is too large.")}function eB(e){const{chainId:t,nonce:n,to:r}=e,s=e.contractAddress??e.address,o=Et(Un(["0x05",Wr([t?te(t):"0x",s,n?te(n):"0x"])]));return r==="bytes"?nr(o):o}async function kb(e){const{authorization:t,signature:n}=e;return Z0({hash:eB(t),signature:n??t})}class tB extends K{constructor(t,{account:n,docsPath:r,chain:s,data:o,gas:a,gasPrice:c,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:d,to:f,value:h}){var m;const p=Gu({from:n==null?void 0:n.address,to:f,value:typeof h<"u"&&`${ib(h)} ${((m=s==null?void 0:s.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:o,gas:a,gasPrice:typeof c<"u"&&`${Cn(c)} gwei`,maxFeePerGas:typeof l<"u"&&`${Cn(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Cn(u)} gwei`,nonce:d});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function nB(e,{docsPath:t,...n}){const r=(()=>{const s=cp(e,n);return s instanceof Xu?e:s})();return new tB(r,{docsPath:t,...n})}class zC extends K{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Cb extends K{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class rB extends K{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Cn(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class jb extends K{constructor({blockHash:t,blockNumber:n}){let r="Block";t&&(r=`Block at hash "${t}"`),n&&(r=`Block at number "${n}"`),super(`${r} could not be found.`,{name:"BlockNotFoundError"})}}const qC={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function td(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,...e.blockTimestamp!=null&&{blockTimestamp:BigInt(e.blockTimestamp)},chainId:e.chainId?tr(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?tr(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?qC[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=oB(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const sB=lp("transaction",td);function oB(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function Sb(e,t){const n=(e.transactions??[]).map(r=>typeof r=="string"?r:td(r));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const aB=lp("block",Sb);async function gr(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",includeTransactions:s}={}){var u,d,f;const o=s??!1,a=n!==void 0?te(n):void 0;let c=null;if(t?c=await e.request({method:"eth_getBlockByHash",params:[t,o]},{dedupe:!0}):c=await e.request({method:"eth_getBlockByNumber",params:[a||r,o]},{dedupe:!!a}),!c)throw new jb({blockHash:t,blockNumber:n});return(((f=(d=(u=e.chain)==null?void 0:u.formatters)==null?void 0:d.block)==null?void 0:f.format)||Sb)(c,"getBlock")}async function Ab(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function iB(e,t){return UC(e,t)}async function UC(e,t){var o,a;const{block:n,chain:r=e.chain,request:s}=t||{};try{const c=((o=r==null?void 0:r.fees)==null?void 0:o.maxPriorityFeePerGas)??((a=r==null?void 0:r.fees)==null?void 0:a.defaultPriorityFee);if(typeof c=="function"){const u=n||await we(e,gr,"getBlock")({}),d=await c({block:u,client:e,request:s});if(d===null)throw new Error;return d}if(typeof c<"u")return c;const l=await e.request({method:"eth_maxPriorityFeePerGas"});return Gt(l)}catch{const[c,l]=await Promise.all([n?Promise.resolve(n):we(e,gr,"getBlock")({}),we(e,Ab,"getGasPrice")({})]);if(typeof c.baseFeePerGas!="bigint")throw new Cb;const u=l-c.baseFeePerGas;return u<0n?0n:u}}async function cB(e,t){return eg(e,t)}async function eg(e,t){var h,p;const{block:n,chain:r=e.chain,request:s,type:o="eip1559"}=t||{},a=await(async()=>{var m,g;return typeof((m=r==null?void 0:r.fees)==null?void 0:m.baseFeeMultiplier)=="function"?r.fees.baseFeeMultiplier({block:n,client:e,request:s}):((g=r==null?void 0:r.fees)==null?void 0:g.baseFeeMultiplier)??1.2})();if(a<1)throw new zC;const l=10**(((h=a.toString().split(".")[1])==null?void 0:h.length)??0),u=m=>m*BigInt(Math.ceil(a*l))/BigInt(l),d=n||await we(e,gr,"getBlock")({});if(typeof((p=r==null?void 0:r.fees)==null?void 0:p.estimateFeesPerGas)=="function"){const m=await r.fees.estimateFeesPerGas({block:n,client:e,multiply:u,request:s,type:o});if(m!==null)return m}if(o==="eip1559"){if(typeof d.baseFeePerGas!="bigint")throw new Cb;const m=typeof(s==null?void 0:s.maxPriorityFeePerGas)=="bigint"?s.maxPriorityFeePerGas:await UC(e,{block:d,chain:r,request:s}),g=u(d.baseFeePerGas);return{maxFeePerGas:(s==null?void 0:s.maxFeePerGas)??g+m,maxPriorityFeePerGas:m}}return{gasPrice:(s==null?void 0:s.gasPrice)??u(await we(e,Ab,"getGasPrice")({}))}}async function HC(e,{address:t,blockHash:n,blockNumber:r,blockTag:s="latest",requireCanonical:o}){const a=Pa({blockHash:n,blockNumber:r,blockTag:s,requireCanonical:o}),c=await e.request({method:"eth_getTransactionCount",params:[t,a]},{dedupe:typeof r=="bigint"||n!==void 0});return tr(c)}function Eb(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(o=>nr(o)):e.blobs,s=[];for(const o of r)s.push(Uint8Array.from(t.blobToKzgCommitment(o)));return n==="bytes"?s:s.map(o=>lt(o))}function Nb(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),r=typeof e.blobs[0]=="string"?e.blobs.map(a=>nr(a)):e.blobs,s=typeof e.commitments[0]=="string"?e.commitments.map(a=>nr(a)):e.commitments,o=[];for(let a=0;a<r.length;a++){const c=r[a],l=s[a];o.push(Uint8Array.from(t.computeBlobKzgProof(c,l)))}return n==="bytes"?o:o.map(a=>lt(a))}function lB(e,t,n,r){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,r);const s=BigInt(32),o=BigInt(4294967295),a=Number(n>>s&o),c=Number(n&o),l=r?4:0,u=r?0:4;e.setUint32(t+l,a,r),e.setUint32(t+u,c,r)}function uB(e,t,n){return e&t^~e&n}function dB(e,t,n){return e&t^e&n^t&n}class WC extends Xy{constructor(t,n,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=bm(this.buffer)}update(t){dc(this),t=Qh(t),xo(t);const{view:n,buffer:r,blockLen:s}=this,o=t.length;for(let a=0;a<o;){const c=Math.min(s-this.pos,o-a);if(c===s){const l=bm(t);for(;s<=o-a;a+=s)this.process(l,a);continue}r.set(t.subarray(a,a+c),this.pos),this.pos+=c,a+=c,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){dc(this),Ek(t,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:o}=this;let{pos:a}=this;n[a++]=128,ko(this.buffer.subarray(a)),this.padOffset>s-a&&(this.process(r,0),a=0);for(let f=a;f<s;f++)n[f]=0;lB(r,s-8,BigInt(this.length*8),o),this.process(r,0);const c=bm(t),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const u=l/4,d=this.get();if(u>d.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f<u;f++)c.setUint32(4*f,d[f],o)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:o,destroyed:a,pos:c}=this;return t.destroyed=a,t.finished=o,t.length=s,t.pos=c,s%n&&t.buffer.set(r),t}clone(){return this._cloneInto()}}const Fs=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ut=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Ht=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),fB=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),$s=new Uint32Array(64);class hB extends WC{constructor(t=32){super(64,t,8,!1),this.A=Fs[0]|0,this.B=Fs[1]|0,this.C=Fs[2]|0,this.D=Fs[3]|0,this.E=Fs[4]|0,this.F=Fs[5]|0,this.G=Fs[6]|0,this.H=Fs[7]|0}get(){const{A:t,B:n,C:r,D:s,E:o,F:a,G:c,H:l}=this;return[t,n,r,s,o,a,c,l]}set(t,n,r,s,o,a,c,l){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=a|0,this.G=c|0,this.H=l|0}process(t,n){for(let f=0;f<16;f++,n+=4)$s[f]=t.getUint32(n,!1);for(let f=16;f<64;f++){const h=$s[f-15],p=$s[f-2],m=Er(h,7)^Er(h,18)^h>>>3,g=Er(p,17)^Er(p,19)^p>>>10;$s[f]=g+$s[f-7]+m+$s[f-16]|0}let{A:r,B:s,C:o,D:a,E:c,F:l,G:u,H:d}=this;for(let f=0;f<64;f++){const h=Er(c,6)^Er(c,11)^Er(c,25),p=d+h+uB(c,l,u)+fB[f]+$s[f]|0,g=(Er(r,2)^Er(r,13)^Er(r,22))+dB(r,s,o)|0;d=u,u=l,l=c,c=a+p|0,a=o,o=s,s=r,r=p+g|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,a=a+this.D|0,c=c+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,s,o,a,c,l,u,d)}roundClean(){ko($s)}destroy(){this.set(0,0,0,0,0,0,0,0),ko(this.buffer)}}const VC=Ak(["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(e=>BigInt(e))),pB=VC[0],mB=VC[1],zs=new Uint32Array(80),qs=new Uint32Array(80);class GC extends WC{constructor(t=64){super(128,t,16,!1),this.Ah=Ht[0]|0,this.Al=Ht[1]|0,this.Bh=Ht[2]|0,this.Bl=Ht[3]|0,this.Ch=Ht[4]|0,this.Cl=Ht[5]|0,this.Dh=Ht[6]|0,this.Dl=Ht[7]|0,this.Eh=Ht[8]|0,this.El=Ht[9]|0,this.Fh=Ht[10]|0,this.Fl=Ht[11]|0,this.Gh=Ht[12]|0,this.Gl=Ht[13]|0,this.Hh=Ht[14]|0,this.Hl=Ht[15]|0}get(){const{Ah:t,Al:n,Bh:r,Bl:s,Ch:o,Cl:a,Dh:c,Dl:l,Eh:u,El:d,Fh:f,Fl:h,Gh:p,Gl:m,Hh:g,Hl:_}=this;return[t,n,r,s,o,a,c,l,u,d,f,h,p,m,g,_]}set(t,n,r,s,o,a,c,l,u,d,f,h,p,m,g,_){this.Ah=t|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=o|0,this.Cl=a|0,this.Dh=c|0,this.Dl=l|0,this.Eh=u|0,this.El=d|0,this.Fh=f|0,this.Fl=h|0,this.Gh=p|0,this.Gl=m|0,this.Hh=g|0,this.Hl=_|0}process(t,n){for(let v=0;v<16;v++,n+=4)zs[v]=t.getUint32(n),qs[v]=t.getUint32(n+=4);for(let v=16;v<80;v++){const w=zs[v-15]|0,x=qs[v-15]|0,A=Ha(w,x,1)^Ha(w,x,8)^gw(w,x,7),C=Wa(w,x,1)^Wa(w,x,8)^yw(w,x,7),j=zs[v-2]|0,E=qs[v-2]|0,I=Ha(j,E,19)^Fd(j,E,61)^gw(j,E,6),T=Wa(j,E,19)^$d(j,E,61)^yw(j,E,6),O=ME(C,T,qs[v-7],qs[v-16]),B=BE(O,A,I,zs[v-7],zs[v-16]);zs[v]=B|0,qs[v]=O|0}let{Ah:r,Al:s,Bh:o,Bl:a,Ch:c,Cl:l,Dh:u,Dl:d,Eh:f,El:h,Fh:p,Fl:m,Gh:g,Gl:_,Hh:b,Hl:y}=this;for(let v=0;v<80;v++){const w=Ha(f,h,14)^Ha(f,h,18)^Fd(f,h,41),x=Wa(f,h,14)^Wa(f,h,18)^$d(f,h,41),A=f&p^~f&g,C=h&m^~h&_,j=TE(y,x,C,mB[v],qs[v]),E=PE(j,b,w,A,pB[v],zs[v]),I=j|0,T=Ha(r,s,28)^Fd(r,s,34)^Fd(r,s,39),O=Wa(r,s,28)^$d(r,s,34)^$d(r,s,39),B=r&o^r&c^o&c,U=s&a^s&l^a&l;b=g|0,y=_|0,g=p|0,_=m|0,p=f|0,m=h|0,{h:f,l:h}=Xr(u|0,d|0,E|0,I|0),u=c|0,d=l|0,c=o|0,l=a|0,o=r|0,a=s|0;const L=NE(I,O,U);r=IE(L,E,T,B),s=L|0}({h:r,l:s}=Xr(this.Ah|0,this.Al|0,r|0,s|0)),{h:o,l:a}=Xr(this.Bh|0,this.Bl|0,o|0,a|0),{h:c,l}=Xr(this.Ch|0,this.Cl|0,c|0,l|0),{h:u,l:d}=Xr(this.Dh|0,this.Dl|0,u|0,d|0),{h:f,l:h}=Xr(this.Eh|0,this.El|0,f|0,h|0),{h:p,l:m}=Xr(this.Fh|0,this.Fl|0,p|0,m|0),{h:g,l:_}=Xr(this.Gh|0,this.Gl|0,g|0,_|0),{h:b,l:y}=Xr(this.Hh|0,this.Hl|0,b|0,y|0),this.set(r,s,o,a,c,l,u,d,f,h,p,m,g,_,b,y)}roundClean(){ko(zs,qs)}destroy(){ko(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class gB extends GC{constructor(){super(48),this.Ah=Ut[0]|0,this.Al=Ut[1]|0,this.Bh=Ut[2]|0,this.Bl=Ut[3]|0,this.Ch=Ut[4]|0,this.Cl=Ut[5]|0,this.Dh=Ut[6]|0,this.Dl=Ut[7]|0,this.Eh=Ut[8]|0,this.El=Ut[9]|0,this.Fh=Ut[10]|0,this.Fl=Ut[11]|0,this.Gh=Ut[12]|0,this.Gl=Ut[13]|0,this.Hh=Ut[14]|0,this.Hl=Ut[15]|0}}const KC=Yh(()=>new hB),Eke=Yh(()=>new GC),Nke=Yh(()=>new gB),yB=KC;function bB(e,t){const n=t||"hex",r=yB(Hr(e,{strict:!1})?Sc(e):e);return n==="bytes"?r:rn(r)}function vB(e){const{commitment:t,version:n=1}=e,r=e.to??(typeof t=="string"?"hex":"bytes"),s=bB(t,"bytes");return s.set([n],0),r==="bytes"?s:lt(s)}function QC(e){const{commitments:t,version:n}=e,r=e.to??(typeof t[0]=="string"?"hex":"bytes"),s=[];for(const o of t)s.push(vB({commitment:o,to:r,version:n}));return s}const Ww=6,YC=32,Ib=4096,JC=YC*Ib,Vw=JC*Ww-1-1*Ib*Ww,XC=1;class wB extends K{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class ZC extends K{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class _B extends K{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class xB extends K{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${XC}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function kB(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?nr(e.data):e.data,r=Je(n);if(!r)throw new ZC;if(r>Vw)throw new wB({maxSize:Vw,size:r});const s=[];let o=!0,a=0;for(;o;){const c=tb(new Uint8Array(JC));let l=0;for(;l<Ib;){const u=n.slice(a,a+(YC-1));if(c.pushByte(0),c.pushBytes(u),u.length<31){c.pushByte(128),o=!1;break}l++,a+=31}s.push(c)}return t==="bytes"?s.map(c=>c.bytes):s.map(c=>lt(c.bytes))}function e4(e){const{data:t,kzg:n,to:r}=e,s=e.blobs??kB({data:t,to:r}),o=e.commitments??Eb({blobs:s,kzg:n,to:r}),a=e.proofs??Nb({blobs:s,commitments:o,kzg:n,to:r}),c=[];for(let l=0;l<s.length;l++)c.push({blob:s[l],commitment:o[l],proof:a[l]});return c}function t4(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new CI({transaction:e})}function n4(e,{docsPath:t,...n}){const r=(()=>{const s=cp(e,n);return s instanceof Xu?e:s})();return new SI(r,{docsPath:t,...n})}async function vu(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return tr(t)}async function r4(e,t){var j,E,I,T,O;const{account:n=e.account,accessList:r,authorizationList:s,chain:o=e.chain,blobVersionedHashes:a,blobs:c,data:l,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:m,nonceManager:g,to:_,type:b,value:y,...v}=t,w=await(async()=>{if(!n||!g||typeof m<"u")return m;const B=Lt(n),U=o?o.id:await we(e,vu,"getChainId")({});return await g.consume({address:B.address,chainId:U,client:e})})();La(t);const x=(E=(j=o==null?void 0:o.formatters)==null?void 0:j.transactionRequest)==null?void 0:E.format,C=(x||Ra)({...Zu(v,{format:x}),account:n?Lt(n):void 0,accessList:r,authorizationList:s,blobs:c,blobVersionedHashes:a,data:l,gas:u,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:h,maxPriorityFeePerGas:p,nonce:w,to:_,type:b,value:y},"fillTransaction");try{const B=await e.request({method:"eth_fillTransaction",params:[C]}),L=(((T=(I=o==null?void 0:o.formatters)==null?void 0:I.transaction)==null?void 0:T.format)||td)(B.tx);delete L.blockHash,delete L.blockNumber,delete L.r,delete L.s,delete L.transactionIndex,delete L.v,delete L.yParity,L.data=L.input,L.gas&&(L.gas=t.gas??L.gas),L.gasPrice&&(L.gasPrice=t.gasPrice??L.gasPrice),L.maxFeePerBlobGas&&(L.maxFeePerBlobGas=t.maxFeePerBlobGas??L.maxFeePerBlobGas),L.maxFeePerGas&&(L.maxFeePerGas=t.maxFeePerGas??L.maxFeePerGas),L.maxPriorityFeePerGas&&(L.maxPriorityFeePerGas=t.maxPriorityFeePerGas??L.maxPriorityFeePerGas),typeof L.nonce<"u"&&(L.nonce=t.nonce??L.nonce);const N=await(async()=>{var W,ie;if(typeof((W=o==null?void 0:o.fees)==null?void 0:W.baseFeeMultiplier)=="function"){const de=await we(e,gr,"getBlock")({});return o.fees.baseFeeMultiplier({block:de,client:e,request:t})}return((ie=o==null?void 0:o.fees)==null?void 0:ie.baseFeeMultiplier)??1.2})();if(N<1)throw new zC;const M=10**(((O=N.toString().split(".")[1])==null?void 0:O.length)??0),$=W=>W*BigInt(Math.ceil(N*M))/BigInt(M);return L.feePayerSignature||(L.maxFeePerGas&&!t.maxFeePerGas&&(L.maxFeePerGas=$(L.maxFeePerGas)),L.gasPrice&&!t.gasPrice&&(L.gasPrice=$(L.gasPrice))),{raw:B.raw,transaction:{from:C.from,...L},...B.capabilities?{capabilities:B.capabilities}:{}}}catch(B){throw n4(B,{...t,chain:e.chain})}}const s4=["blobVersionedHashes","chainId","fees","gas","nonce","type"],Gw=new Map,Nm=new Hu(128);async function Mb(e,t){var w,x,A;let n=t;n.account??(n.account=e.account),n.parameters??(n.parameters=s4);const{account:r,chain:s=e.chain,nonceManager:o,parameters:a}=n,c=(()=>{if(typeof(s==null?void 0:s.prepareTransactionRequest)=="function")return{fn:s.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(s==null?void 0:s.prepareTransactionRequest))return{fn:s.prepareTransactionRequest[0],runAt:s.prepareTransactionRequest[1].runAt}})();let l;async function u(){return l||(typeof n.chainId<"u"?n.chainId:s?s.id:(l=await we(e,vu,"getChainId")({}),l))}const d=r&&Lt(r);let f=n.nonce;if(a.includes("nonce")&&typeof f>"u"&&d&&o){const C=await u();f=await o.consume({address:d.address,chainId:C,client:e})}c!=null&&c.fn&&((w=c.runAt)!=null&&w.includes("beforeFillTransaction"))&&(n=await c.fn({...n,chain:s},{client:e,phase:"beforeFillTransaction"}),f??(f=n.nonce));const p=((a.includes("blobVersionedHashes")||a.includes("sidecars"))&&n.kzg&&n.blobs||Nm.get(e.uid)===!1||!["fees","gas"].some(j=>a.includes(j))?!1:!!(a.includes("chainId")&&typeof n.chainId!="number"||a.includes("nonce")&&typeof f!="number"||a.includes("fees")&&typeof n.gasPrice!="bigint"&&(typeof n.maxFeePerGas!="bigint"||typeof n.maxPriorityFeePerGas!="bigint")||a.includes("gas")&&typeof n.gas!="bigint"))?await we(e,r4,"fillTransaction")({...n,nonce:f}).then(C=>{const{chainId:j,from:E,gas:I,gasPrice:T,nonce:O,maxFeePerBlobGas:B,maxFeePerGas:U,maxPriorityFeePerGas:L,type:N,...H}=C.transaction;return Nm.set(e.uid,!0),{...n,...E?{from:E}:{},...N&&!n.type?{type:N}:{},...typeof j<"u"?{chainId:j}:{},...typeof I<"u"?{gas:I}:{},...typeof T<"u"?{gasPrice:T}:{},...typeof O<"u"?{nonce:O}:{},...typeof B<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerBlobGas:B}:{},...typeof U<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxFeePerGas:U}:{},...typeof L<"u"&&n.type!=="legacy"&&n.type!=="eip2930"?{maxPriorityFeePerGas:L}:{},..."nonceKey"in H&&typeof H.nonceKey<"u"?{nonceKey:H.nonceKey}:{},..."keyAuthorization"in H&&typeof H.keyAuthorization<"u"&&H.keyAuthorization!==null&&!("keyAuthorization"in n)?{keyAuthorization:H.keyAuthorization}:{},..."feePayerSignature"in H&&typeof H.feePayerSignature<"u"&&H.feePayerSignature!==null?{feePayerSignature:H.feePayerSignature}:{},..."feeToken"in H&&typeof H.feeToken<"u"&&H.feeToken!==null&&!("feeToken"in n)?{feeToken:H.feeToken}:{},...C.capabilities?{_capabilities:C.capabilities}:{}}}).catch(C=>{var T,O;const j=C;if(j.name!=="TransactionExecutionError")return n;if((T=j.walk)==null?void 0:T.call(j,B=>B.name==="ExecutionRevertedError"))throw C;return((O=j.walk)==null?void 0:O.call(j,B=>{var L;const U=B;return U.name==="MethodNotFoundRpcError"||U.name==="MethodNotSupportedRpcError"||((L=U.message)==null?void 0:L.includes("eth_fillTransaction is not available"))}))&&Nm.set(e.uid,!1),n}):n;f??(f=p.nonce),n={...p,...d?{from:d==null?void 0:d.address}:{},...typeof f<"u"?{nonce:f}:{}};const{blobs:m,gas:g,kzg:_,type:b}=n;c!=null&&c.fn&&((x=c.runAt)!=null&&x.includes("beforeFillParameters"))&&(n=await c.fn({...n,chain:s},{client:e,phase:"beforeFillParameters"}));let y;async function v(){return y||(y=await we(e,gr,"getBlock")({blockTag:"latest"}),y)}if(a.includes("nonce")&&typeof f>"u"&&d&&!o&&(n.nonce=await we(e,HC,"getTransactionCount")({address:d.address,blockTag:"pending"})),(a.includes("blobVersionedHashes")||a.includes("sidecars"))&&m&&_){const C=Eb({blobs:m,kzg:_});if(a.includes("blobVersionedHashes")){const j=QC({commitments:C,to:"hex"});n.blobVersionedHashes=j}if(a.includes("sidecars")){const j=Nb({blobs:m,commitments:C,kzg:_}),E=e4({blobs:m,commitments:C,proofs:j,to:"hex"});n.sidecars=E}}if(a.includes("chainId")&&(n.chainId=await u()),(a.includes("fees")||a.includes("type"))&&typeof b>"u")try{n.type=t4(n)}catch{let C=Gw.get(e.uid);if(typeof C>"u"){const j=await v();C=typeof(j==null?void 0:j.baseFeePerGas)=="bigint",Gw.set(e.uid,C)}n.type=C?"eip1559":"legacy"}if(a.includes("fees"))if(n.type!=="legacy"&&n.type!=="eip2930"){if(typeof n.maxFeePerGas>"u"||typeof n.maxPriorityFeePerGas>"u"){const C=await v(),{maxFeePerGas:j,maxPriorityFeePerGas:E}=await eg(e,{block:C,chain:s,request:n});if(typeof n.maxPriorityFeePerGas>"u"&&n.maxFeePerGas&&n.maxFeePerGas<E)throw new rB({maxPriorityFeePerGas:E});n.maxPriorityFeePerGas=E,n.maxFeePerGas=j}}else{if(typeof n.maxFeePerGas<"u"||typeof n.maxPriorityFeePerGas<"u")throw new Cb;if(typeof n.gasPrice>"u"){const C=await v(),{gasPrice:j}=await eg(e,{block:C,chain:s,request:n,type:"legacy"});n.gasPrice=j}}return a.includes("gas")&&typeof g>"u"&&(n.gas=await we(e,Bb,"estimateGas")({...n,account:d,prepare:(d==null?void 0:d.type)==="local"?[]:["blobVersionedHashes"]})),c!=null&&c.fn&&((A=c.runAt)!=null&&A.includes("afterFillParameters"))&&(n=await c.fn({...n,chain:s},{client:e,phase:"afterFillParameters"})),La(n),delete n.parameters,n}async function Bb(e,t){var a,c,l;const{account:n=e.account,prepare:r=!0}=t,s=n?Lt(n):void 0,o=(()=>{if(Array.isArray(r))return r;if((s==null?void 0:s.type)!=="local")return["blobVersionedHashes"]})();try{const u=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await kb({authorization:t.authorizationList[0]}).catch(()=>{throw new K("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:d,authorizationList:f,blobs:h,blobVersionedHashes:p,blockNumber:m,blockTag:g,data:_,gas:b,gasPrice:y,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:A,value:C,stateOverride:j,...E}=r?await Mb(e,{...t,parameters:o,to:u}):t;if(b&&t.gas!==b)return b;const T=(typeof m=="bigint"?te(m):void 0)||g,O=wb(j);La(t);const B=(l=(c=(a=e.chain)==null?void 0:a.formatters)==null?void 0:c.transactionRequest)==null?void 0:l.format,L=(B||Ra)({...Zu(E,{format:B}),account:s,accessList:d,authorizationList:f,blobs:h,blobVersionedHashes:p,data:_,gasPrice:y,maxFeePerBlobGas:v,maxFeePerGas:w,maxPriorityFeePerGas:x,nonce:A,to:u,value:C},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:O?[L,T??e.experimental_blockTag??"latest",O]:T?[L,T]:[L]}))}catch(u){throw nB(u,{...t,account:s,chain:e.chain})}}async function CB(e,t){var u;const{abi:n,address:r,args:s,functionName:o,dataSuffix:a=typeof e.dataSuffix=="string"?e.dataSuffix:(u=e.dataSuffix)==null?void 0:u.value,...c}=t,l=ht({abi:n,args:s,functionName:o});try{return await we(e,Bb,"estimateGas")({data:`${l}${a?a.replace("0x",""):""}`,to:r,...c})}catch(d){const f=c.account?Lt(c.account):void 0;throw hc(d,{abi:n,address:r,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:o,sender:f==null?void 0:f.address})}}async function o4(e,{address:t,blockHash:n,blockNumber:r,blockTag:s=e.experimental_blockTag??"latest",requireCanonical:o}){var l,u,d;const a=Pa({blockHash:n,blockNumber:r,blockTag:s,requireCanonical:o});if((l=e.batch)!=null&&l.multicall&&((d=(u=e.chain)==null?void 0:u.contracts)!=null&&d.multicall3)){const f=e.chain.contracts.multicall3.address,h=ht({abi:lc,functionName:"getEthBalance",args:[t]}),{data:p}=await we(e,Ic,"call")({to:f,data:h,blockHash:n,blockNumber:r,blockTag:s,requireCanonical:o});return Bo({abi:lc,functionName:"getEthBalance",args:[t],data:p||"0x"})}const c=await e.request({method:"eth_getBalance",params:[t,a]});return BigInt(c)}async function jB(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}const SB=new Map,AB=new Map;function EB(e){const t=(s,o)=>({clear:()=>o.delete(s),get:()=>o.get(s),set:a=>o.set(s,a)}),n=t(e,SB),r=t(e,AB);return{clear:()=>{n.clear(),r.clear()},promise:n,response:r}}async function NB(e,{cacheKey:t,cacheTime:n=Number.POSITIVE_INFINITY}){const r=EB(t),s=r.response.get();if(s&&n>0&&Date.now()-s.created.getTime()<n)return s.data;let o=r.promise.get();o||(o=e(),r.promise.set(o));try{const a=await o;return r.response.set({created:new Date,data:a}),a}finally{r.promise.clear()}}const IB=e=>`blockNumber.${e}`;async function nd(e,{cacheTime:t=e.cacheTime}={}){const n=await NB(()=>e.request({method:"eth_blockNumber"}),{cacheKey:IB(e.uid),cacheTime:t});return BigInt(n)}function Vr(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const MB={"0x0":"reverted","0x1":"success"};function fp(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(r=>Vr(r)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?tr(e.transactionIndex):null,status:e.status?MB[e.status]:null,type:e.type?qC[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const BB=lp("transactionReceipt",fp);async function TB(e,{blockHash:t,blockNumber:n,blockTag:r=e.experimental_blockTag??"latest"}={}){var c,l,u;const s=n!==void 0?te(n):void 0,o=await e.request({method:"eth_getBlockReceipts",params:[t||s||r]},{dedupe:!!(t||s)});if(!o)throw new jb({blockHash:t,blockNumber:n});const a=((u=(l=(c=e.chain)==null?void 0:c.formatters)==null?void 0:l.transactionReceipt)==null?void 0:u.format)||fp;return o.map(d=>a(d,"getBlockReceipts"))}async function PB(e,{blockHash:t,blockNumber:n,blockTag:r="latest"}={}){const s=n!==void 0?te(n):void 0;let o;return t?o=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):o=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||r]},{dedupe:!!s}),tr(o)}async function hh(e,{address:t,blockHash:n,blockNumber:r,blockTag:s="latest",requireCanonical:o}){const a=Pa({blockHash:n,blockNumber:r,blockTag:s,requireCanonical:o}),c=await e.request({method:"eth_getCode",params:[t,a]},{dedupe:typeof r=="bigint"||n!==void 0});if(c!=="0x")return c}const Kw="/docs/contract/decodeEventLog";function ph(e){const{abi:t,data:n,strict:r,topics:s}=e,o=r??!0,[a,...c]=s;if(!a)throw new iE({docsPath:Kw});const l=t.find(b=>b.type==="event"&&a===Zh(Cr(b)));if(!(l&&"name"in l)||l.type!=="event")throw new cE(a,{docsPath:Kw});const{name:u,inputs:d}=l,f=d==null?void 0:d.some(b=>!("name"in b&&b.name)),h=f?[]:{},p=d.map((b,y)=>[b,y]).filter(([b])=>"indexed"in b&&b.indexed),m=[];for(let b=0;b<p.length;b++){const[y,v]=p[b],w=c[b];if(!w){if(o)throw new Ky({abiItem:l,param:y});m.push([y,v]);continue}h[f?v:y.name||v]=RB({param:y,value:w})}const g=d.filter(b=>!("indexed"in b&&b.indexed)),_=o?g:[...m.map(([b])=>b),...g];if(_.length>0){if(n&&n!=="0x")try{const b=Wu(_,n);if(b){let y=0;if(!o)for(const[v,w]of m)h[f?w:v.name||w]=b[y++];if(f)for(let v=0;v<d.length;v++)h[v]===void 0&&y<b.length&&(h[v]=b[y++]);else for(let v=0;v<g.length;v++)h[g[v].name]=b[y++]}}catch(b){if(o)throw b instanceof bk||b instanceof Pk?new ch({abiItem:l,data:n,params:_,size:Je(n)}):b}else if(o)throw new ch({abiItem:l,data:"0x",params:_,size:0})}return{eventName:u,args:Object.values(h).length>0?h:void 0}}function RB({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(Wu([e],t)||[])[0]}function hp(e){const{abi:t,args:n,logs:r,strict:s=!0}=e,o=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),a=t.filter(c=>c.type==="event").map(c=>({abi:c,selector:Zh(c)}));return r.map(c=>{var h;const l=typeof c.blockNumber=="string"?Vr(c):c,u=a.filter(p=>l.topics[0]===p.selector);if(u.length===0)return null;let d,f;for(const p of u)try{d=ph({...l,abi:[p.abi],strict:!0}),f=p;break}catch{}if(!d&&!s){f=u[0];try{d=ph({data:l.data,topics:l.topics,abi:[f.abi],strict:!1})}catch{const p=(h=f.abi.inputs)==null?void 0:h.some(m=>!("name"in m&&m.name));return{...l,args:p?[]:{},eventName:f.abi.name}}}return!d||!f||o&&!o.includes(d.eventName)||!LB({args:d.args,inputs:f.abi.inputs,matchArgs:n})?null:{...d,...l}}).filter(Boolean)}function LB(e){const{args:t,inputs:n,matchArgs:r}=e;if(!r)return!0;if(!t)return!1;function s(o,a,c){try{return o.type==="address"?pc(a,c):o.type==="string"||o.type==="bytes"?Et(Sc(a))===c:a===c}catch{return!1}}return Array.isArray(t)&&Array.isArray(r)?r.every((o,a)=>{if(o==null)return!0;const c=n[a];return c?(Array.isArray(o)?o:[o]).some(u=>s(c,u,t[a])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof r=="object"&&!Array.isArray(r)?Object.entries(r).every(([o,a])=>{if(a==null)return!0;const c=n.find(u=>u.name===o);return c?(Array.isArray(a)?a:[a]).some(u=>s(c,u,t[o])):!1}):!1}async function Tb(e,{address:t,blockHash:n,fromBlock:r,toBlock:s,event:o,events:a,args:c,strict:l}={}){const u=l??!1,d=a??(o?[o]:void 0);let f=[];d&&(f=[d.flatMap(g=>ed({abi:[g],eventName:g.name,args:a?void 0:c}))],o&&(f=f[0]));let h;n?h=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,blockHash:n}]}):h=await e.request({method:"eth_getLogs",params:[{address:t,topics:f,fromBlock:typeof r=="bigint"?te(r):r,toBlock:typeof s=="bigint"?te(s):s}]});const p=h.map(m=>Vr(m));return d?hp({abi:d,args:c,logs:p,strict:u}):p}async function a4(e,t){const{abi:n,address:r,args:s,blockHash:o,eventName:a,fromBlock:c,toBlock:l,strict:u}=t,d=a?Ta({abi:n,name:a}):void 0,f=d?void 0:n.filter(h=>h.type==="event");return we(e,Tb,"getLogs")({address:r,args:s,blockHash:o,event:d,events:f,fromBlock:c,toBlock:l,strict:u})}async function DB(e,{address:t,blockNumber:n,blockTag:r="latest"}){const s=await hh(e,{address:t,...n!==void 0?{blockNumber:n}:{blockTag:r}});if(s&&Je(s)===23&&s.startsWith("0xef0100"))return Ge(Co(s,3,23))}class OB extends K{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function FB(e,t){const{address:n,factory:r,factoryData:s}=t;try{const[o,a,c,l,u,d,f]=await we(e,sr,"readContract")({abi:$B,address:n,functionName:"eip712Domain",factory:r,factoryData:s});return{domain:{name:a,version:c,chainId:Number(l),verifyingContract:u,salt:d},extensions:f,fields:o}}catch(o){const a=o;throw a.name==="ContractFunctionExecutionError"&&a.cause.name==="ContractFunctionZeroDataError"?new OB({address:n}):a}}const $B=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];function zB(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(n=>BigInt(n)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(n=>n.map(r=>BigInt(r)))}}async function qB(e,{blockCount:t,blockNumber:n,blockTag:r="latest",rewardPercentiles:s}){const o=typeof n=="bigint"?te(n):void 0,a=await e.request({method:"eth_feeHistory",params:[te(t),o||r,s]},{dedupe:!!o});return zB(a)}async function pp(e,{filter:t}){const n="strict"in t&&t.strict,r=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof r[0]=="string")return r;const s=r.map(o=>Vr(o));return!("abi"in t)||!t.abi?s:hp({abi:t.abi,logs:s,strict:n})}async function UB(e,{filter:t}){const n=t.strict??!1,s=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(o=>Vr(o));return t.abi?hp({abi:t.abi,logs:s,strict:n}):s}function HB(e,t){if(e.length!==t.length)throw new vk({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],o=t[r];n.push(i4(s,o))}return Un(n)}function i4(e,t,n=!1){if(e==="address"){const a=t;if(!ut(a))throw new Yt({address:a});return _r(a.toLowerCase(),{size:n?32:null})}if(e==="string")return _a(t);if(e==="bytes")return t;if(e==="bool")return _r(Jy(t),{size:n?32:1});const r=e.match(nb);if(r){const[a,c,l="256"]=r,u=Number.parseInt(l,10)/8;return te(t,{size:n?32:u,signed:c==="int"})}const s=e.match(zk);if(s){const[a,c]=s;if(Number.parseInt(c,10)!==(t.length-2)/2)throw new xk({expectedSize:Number.parseInt(c,10),givenSize:(t.length-2)/2});return _r(t,{dir:"right",size:n?32:null})}const o=e.match(oN);if(o&&Array.isArray(t)){const[a,c]=o,l=[];for(let u=0;u<t.length;u++)l.push(i4(c,t[u],!0));return l.length===0?"0x":Un(l)}throw new pE(e)}function WB(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:r}=n,s=n.address;if(!ut(s))throw new Yt({address:s});if(r<0)throw new ep({chainId:r})}Pb(e)}function VB(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new ZC;for(const n of t){const r=Je(n),s=tr(Co(n,0,1));if(r!==32)throw new _B({hash:n,size:r});if(s!==XC)throw new xB({hash:n,version:s})}}Pb(e)}function Pb(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:r,to:s}=e;if(t<=0)throw new ep({chainId:t});if(s&&!ut(s))throw new Yt({address:s});if(r&&r>up)throw new ja({maxFeePerGas:r});if(n&&r&&n>r)throw new bu({maxFeePerGas:r,maxPriorityFeePerGas:n})}function GB(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:o}=e;if(t<=0)throw new ep({chainId:t});if(o&&!ut(o))throw new Yt({address:o});if(n||s)throw new K("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(r&&r>up)throw new ja({maxFeePerGas:r})}function KB(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:r,maxFeePerGas:s,to:o}=e;if(o&&!ut(o))throw new Yt({address:o});if(typeof t<"u"&&t<=0)throw new ep({chainId:t});if(n||s)throw new K("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(r&&r>up)throw new ja({maxFeePerGas:r})}function mp(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:r,storageKeys:s}=e[n];for(let o=0;o<s.length;o++)if(s[o].length-2!==64)throw new jI({storageKey:s[o]});if(!ut(r,{strict:!1}))throw new Yt({address:r});t.push([r,s])}return t}function QB(e,t){const n=t4(e);return n==="eip1559"?XB(e,t):n==="eip2930"?ZB(e,t):n==="eip4844"?JB(e,t):n==="eip7702"?YB(e,t):eT(e,t)}function YB(e,t){const{authorizationList:n,chainId:r,gas:s,nonce:o,to:a,value:c,maxFeePerGas:l,maxPriorityFeePerGas:u,accessList:d,data:f}=e;WB(e);const h=mp(d),p=tT(n);return Un(["0x04",Wr([te(r),o?te(o):"0x",u?te(u):"0x",l?te(l):"0x",s?te(s):"0x",a??"0x",c?te(c):"0x",f??"0x",h,p,...rd(e,t)])])}function JB(e,t){const{chainId:n,gas:r,nonce:s,to:o,value:a,maxFeePerBlobGas:c,maxFeePerGas:l,maxPriorityFeePerGas:u,accessList:d,data:f}=e;VB(e);let h=e.blobVersionedHashes,p=e.sidecars;if(e.blobs&&(typeof h>"u"||typeof p>"u")){const v=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(A=>lt(A)),w=e.kzg,x=Eb({blobs:v,kzg:w});if(typeof h>"u"&&(h=QC({commitments:x})),typeof p>"u"){const A=Nb({blobs:v,commitments:x,kzg:w});p=e4({blobs:v,commitments:x,proofs:A})}}const m=mp(d),g=[te(n),s?te(s):"0x",u?te(u):"0x",l?te(l):"0x",r?te(r):"0x",o??"0x",a?te(a):"0x",f??"0x",m,c?te(c):"0x",h??[],...rd(e,t)],_=[],b=[],y=[];if(p)for(let v=0;v<p.length;v++){const{blob:w,commitment:x,proof:A}=p[v];_.push(w),b.push(x),y.push(A)}return Un(["0x03",Wr(p?[g,_,b,y]:g)])}function XB(e,t){const{chainId:n,gas:r,nonce:s,to:o,value:a,maxFeePerGas:c,maxPriorityFeePerGas:l,accessList:u,data:d}=e;Pb(e);const f=mp(u),h=[te(n),s?te(s):"0x",l?te(l):"0x",c?te(c):"0x",r?te(r):"0x",o??"0x",a?te(a):"0x",d??"0x",f,...rd(e,t)];return Un(["0x02",Wr(h)])}function ZB(e,t){const{chainId:n,gas:r,data:s,nonce:o,to:a,value:c,accessList:l,gasPrice:u}=e;GB(e);const d=mp(l),f=[te(n),o?te(o):"0x",u?te(u):"0x",r?te(r):"0x",a??"0x",c?te(c):"0x",s??"0x",d,...rd(e,t)];return Un(["0x01",Wr(f)])}function eT(e,t){const{chainId:n=0,gas:r,data:s,nonce:o,to:a,value:c,gasPrice:l}=e;KB(e);let u=[o?te(o):"0x",l?te(l):"0x",r?te(r):"0x",a??"0x",c?te(c):"0x",s??"0x"];if(t){const d=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const p=27n+(t.v===27n?0n:1n);if(t.v!==p)throw new kI({v:t.v});return p})(),f=kn(t.r),h=kn(t.s);u=[...u,te(d),f==="0x00"?"0x":f,h==="0x00"?"0x":h]}else n>0&&(u=[...u,te(n),"0x","0x"]);return Wr(u)}function rd(e,t){const n=t??e,{v:r,yParity:s}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof r>"u"&&typeof s>"u")return[];const o=kn(n.r),a=kn(n.s);return[typeof s=="number"?s?te(1):"0x":r===0n?"0x":r===1n?te(1):r===27n?"0x":te(1),o==="0x00"?"0x":o,a==="0x00"?"0x":a]}function tT(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:r,nonce:s,...o}=n,a=n.address;t.push([r?rn(r):"0x",a,s?rn(s):"0x",...rd({},o)])}return t}async function nT({address:e,authorization:t,signature:n}){return pc(Ge(e),await kb({authorization:t,signature:n}))}const Ud=new Hu(8192);function rT(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Ud.get(n))return Ud.get(n);const r=e().finally(()=>Ud.delete(n));return Ud.set(n,r),r}async function tg(e,{signal:t}={}){return new Promise((n,r)=>{if(t!=null&&t.aborted){r(jo(t));return}const s=()=>t==null?void 0:t.removeEventListener("abort",a),o=setTimeout(()=>{s(),n()},e),a=()=>{clearTimeout(o),s(),r(jo(t))};t==null||t.addEventListener("abort",a,{once:!0})})}function mc(e,{delay:t=100,retryCount:n=2,shouldRetry:r=()=>!0,signal:s}={}){return new Promise((o,a)=>{const c=async({count:l=0}={})=>{if(s!=null&&s.aborted){a(jo(s));return}const u=async({error:d})=>{const f=typeof t=="function"?t({count:l,error:d}):t;if(f)try{await tg(f,{signal:s})}catch(h){a(h);return}c({count:l+1})};try{const d=await e();o(d)}catch(d){if(s!=null&&s.aborted){a(jo(s));return}if(Nc(d)){a(d);return}if(l<n&&await r({count:l,error:d}))return u({error:d});a(d)}};c()})}function sT(e,t={}){return async(n,r={})=>{var h;const{dedupe:s=!1,methods:o,retryDelay:a=150,retryCount:c=3,signal:l,uid:u}={...t,...r},{method:d}=n;if((h=o==null?void 0:o.exclude)!=null&&h.includes(d))throw new Xo(new Error("method not supported"),{method:d});if(o!=null&&o.include&&!o.include.includes(d))throw new Xo(new Error("method not supported"),{method:d});if(l!=null&&l.aborted)throw jo(l);const f=s?aT(`${u}.${xt(n)}`):void 0;return rT(()=>mc(async()=>{try{return await e(n,l?{signal:l}:void 0)}catch(p){if(l!=null&&l.aborted)throw jo(l);if(Nc(p))throw p;const m=p;switch(m.code){case Jl.code:throw new Jl(m);case Xl.code:throw new Xl(m);case Zl.code:throw new Zl(m,{method:n.method});case eu.code:throw new eu(m);case xa.code:throw new xa(m);case So.code:throw new So(m);case tu.code:throw new tu(m);case qr.code:throw new qr(m);case nu.code:throw new nu(m);case Xo.code:throw new Xo(m,{method:n.method});case fc.code:throw new fc(m);case ru.code:throw new ru(m);case Re.code:throw new Re(m);case su.code:throw new su(m);case ou.code:throw new ou(m);case au.code:throw new au(m);case iu.code:throw new iu(m);case jn.code:throw new jn(m);case cu.code:throw new cu(m);case lu.code:throw new lu(m);case uu.code:throw new uu(m);case du.code:throw new du(m);case fu.code:throw new fu(m);case hu.code:throw new hu(m);case pu.code:throw new pu(m);case 5e3:throw new Re(m);case mu.code:throw new mu(m);default:throw p instanceof K?p:new FI(m)}}},{delay:({count:p,error:m})=>{var g;if(m&&m instanceof Il){const _=(g=m==null?void 0:m.headers)==null?void 0:g.get("Retry-After");if(_!=null&&_.match(/\d/))return Number.parseInt(_,10)*1e3}return~~(1<<p)*a},retryCount:c,signal:l,shouldRetry:({error:p})=>oT(p)}),{enabled:s,id:f})}}function oT(e){return Nc(e)?!1:"code"in e&&typeof e.code=="number"?e.code===-1||e.code===fc.code||e.code===xa.code||e.code===429:e instanceof Il&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function aT(e,t=0){let n=3735928559^t,r=1103547991^t;for(let s=0;s<e.length;s++){const o=e.charCodeAt(s);n=Math.imul(n^o,2654435761),r=Math.imul(r^o,1597334677)}return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(r^r>>>16,3266489909),r=Math.imul(r^r>>>16,2246822507),r^=Math.imul(n^n>>>16,3266489909),(4294967296*(2097151&r)+(n>>>0)).toString(36)}function iT({chain:e,currentChainId:t}){if(!e)throw new pI;if(t!==e.id)throw new hI({chain:e,currentChainId:t})}function Kr(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(r){return s=>{const o=typeof s=="function"?s(r):s,a={...r,...o};return Object.assign(a,{extend:n(a)})}}return Object.assign(t,{extend:n(t)})}function Ike(){return{}}function sd(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:r}){return new Promise((s,o)=>{(async()=>{let a;const c=new AbortController;try{n>0&&(a=setTimeout(()=>{r?c.abort():o(t)},n)),s(await e({signal:(c==null?void 0:c.signal)||null}))}catch(l){if(c!=null&&c.signal.aborted&&Nc(l)){o(t);return}o(l)}finally{clearTimeout(a)}})()})}function cT(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const ng=cT();function c4(e,t={}){const{url:n,headers:r}=lT(e);return{async request(s){var m,g,_;const{body:o,fetchFn:a=t.fetchFn??fetch,onRequest:c=t.onRequest,onResponse:l=t.onResponse,timeout:u=t.timeout??1e4}=s,d={...t.fetchOptions??{},...s.fetchOptions??{}},{headers:f,method:h,signal:p}=d;try{const b=await sd(async({signal:v})=>{const w={...d,body:Array.isArray(o)?xt(o.map(j=>({jsonrpc:"2.0",id:j.id??ng.take(),...j}))):xt({jsonrpc:"2.0",id:o.id??ng.take(),...o}),headers:{...r,"Content-Type":"application/json",...f},method:h||"POST",signal:p||(u>0?v:null)},x=new Request(n,w),A=await(c==null?void 0:c(x,w))??{...w,url:n};return await a(A.url??n,A)},{errorInstance:new U0({body:o,url:n}),timeout:u,signal:!0});l&&await l(b);let y;if((m=b.headers.get("Content-Type"))!=null&&m.startsWith("application/json"))y=await b.json();else{y=await b.text();try{y=JSON.parse(y||"{}")}catch(v){if(b.ok)throw v;y={error:y}}}if(!b.ok){if(typeof((g=y.error)==null?void 0:g.code)=="number"&&typeof((_=y.error)==null?void 0:_.message)=="string")return y;throw new Il({body:o,details:xt(y.error)||b.statusText,headers:b.headers,status:b.status,url:n})}return y}catch(b){throw p!=null&&p.aborted?jo(p):Nc(b)||b instanceof Il||b instanceof U0?b:new Il({body:o,cause:b,url:n})}}}}function lT(e){try{const t=new URL(e),n=(()=>{if(t.username){const r=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(r)}`}}}})();return{url:t.toString(),...n}}catch{return{url:e}}}const Im=new Map;async function uT(e){const{getSocket:t,keepAlive:n=!0,key:r="socket",reconnect:s=!0,url:o}=e,{interval:a=3e4}=typeof n=="object"?n:{},{attempts:c=5,delay:l=2e3}=typeof s=="object"?s:{},u=JSON.stringify({keepAlive:n,key:r,url:o,reconnect:s});let d=Im.get(u);if(d)return d;let f=0;const{schedule:h}=vb({id:u,fn:async()=>{const g=new Map,_=new Map;let b,y,v,w,x=!1,A=!1;function C(){if(s&&!A&&f<c){if(x)return;x=!0,f++,y==null||y.close(),w=setTimeout(async()=>{if(w=void 0,A){x=!1;return}await j().catch(console.error),x=!1},l)}else g.clear(),_.clear()}async function j(){const E=await t({onClose(){var I,T;for(const O of g.values())(I=O.onError)==null||I.call(O,new uh({url:o}));for(const O of _.values())(T=O.onError)==null||T.call(O,new uh({url:o}));C()},onError(I){var T,O;b=I;for(const B of g.values())(T=B.onError)==null||T.call(B,b);for(const B of _.values())(O=B.onError)==null||O.call(B,b);C()},onOpen(){b=void 0,f=0},onResponse(I){const T=I.method==="eth_subscription",O=T?I.params.subscription:I.id,B=T?_:g,U=B.get(O);U&&U.onResponse(I),T||B.delete(O)}});if(A)return E.close(),E;if(y=E,n&&(v&&clearInterval(v),v=setInterval(()=>{var I;return(I=y.ping)==null?void 0:I.call(y)},a)),s&&_.size>0){const I=_.entries();for(const[T,{onResponse:O,body:B,onError:U}]of I)B&&(_.delete(T),d==null||d.request({body:B,onResponse:O,onError:U}))}return E}return await j(),b=void 0,d={close(){A=!0,v&&clearInterval(v),w&&(clearTimeout(w),w=void 0,x=!1),y.close(),Im.delete(u)},get socket(){return y},request({body:E,onError:I,onResponse:T}){var U;b&&I&&I(b);const O=E.id??ng.take(),B=L=>{typeof L.id=="number"&&O!==L.id||(E.method==="eth_subscribe"&&typeof L.result=="string"&&_.set(L.result,{onResponse:B,onError:I,body:E}),T(L))};E.method==="eth_unsubscribe"&&_.delete((U=E.params)==null?void 0:U[0]),g.set(O,{onResponse:B,onError:I});try{y.request({body:{jsonrpc:"2.0",id:O,...E}})}catch(L){I==null||I(L)}},requestAsync({body:E,timeout:I=1e4}){return sd(()=>new Promise((T,O)=>this.request({body:E,onError:O,onResponse:T})),{errorInstance:new U0({body:E,url:o}),timeout:I})},requests:g,subscriptions:_,url:o},Im.set(u,d),[d]}}),[p,[m]]=await h();return m}async function dT(e,t={}){const{keepAlive:n,reconnect:r}=t;return uT({async getSocket({onClose:s,onError:o,onOpen:a,onResponse:c}){const l=await ae(()=>import("./native-CJ5et6AR.js"),[]).then(p=>p.WebSocket),u=new l(e);function d(){u.removeEventListener("close",d),u.removeEventListener("message",f),u.removeEventListener("error",o),u.removeEventListener("open",a),s()}function f({data:p}){if(!(typeof p=="string"&&p.trim().length===0))try{const m=JSON.parse(p);c(m)}catch(m){o(m)}}u.addEventListener("close",d),u.addEventListener("message",f),u.addEventListener("error",o),u.addEventListener("open",a),u.readyState===l.CONNECTING&&await new Promise((p,m)=>{u&&(u.onopen=p,u.onerror=m)});const{close:h}=u;return Object.assign(u,{close(){h.bind(u)(),d()},ping(){try{if(u.readyState===u.CLOSED||u.readyState===u.CLOSING)throw new Mw({url:u.url,cause:new uh({url:u.url})});const p={jsonrpc:"2.0",id:null,method:"net_version",params:[]};u.send(JSON.stringify(p))}catch(p){o(p)}},request({body:p}){if(u.readyState===u.CLOSED||u.readyState===u.CLOSING)throw new Mw({body:p,url:u.url,cause:new uh({url:u.url})});return u.send(JSON.stringify(p))}})},keepAlive:n,reconnect:r,url:e})}function fT(e,{body:t,onError:n,onResponse:r}){return e.request({body:t,onError:n,onResponse:r}),e}async function hT(e,{body:t,timeout:n=1e4}){return e.requestAsync({body:t,timeout:n})}async function Mke(e){const t=await dT(e);return Object.assign(t.socket,{requests:t.requests,subscriptions:t.subscriptions})}const Mm={http(e,t){return c4(e).request(t)},webSocket:fT,webSocketAsync:hT},pT=`Ethereum Signed Message:
1686
1686
  `;function mT(e){const t=typeof e=="string"?_a(e):typeof e.raw=="string"?e.raw:lt(e.raw),n=_a(`${pT}${Je(t)}`);return rr([n,t])}function l4(e,t){return Et(mT(e),t)}class gT extends K{constructor({domain:t}){super(`Invalid domain "${xt(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class yT 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 bT extends K{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function vT(e){const{domain:t,message:n,primaryType:r,types:s}=e,o=(l,u)=>{const d={...u};for(const f of l){const{name:h,type:p}=f;p==="address"&&(d[h]=d[h].toLowerCase())}return d},a=s.EIP712Domain?t?o(s.EIP712Domain,t):{}:{},c=(()=>{if(r!=="EIP712Domain")return o(s[r],n)})();return xt({domain:a,message:c,primaryType:r,types:s})}function u4(e){const{domain:t,message:n,primaryType:r,types:s}=e,o=(a,c)=>{for(const l of a){const{name:u,type:d}=l,f=c[u],h=d.match(nb);if(h&&(typeof f=="number"||typeof f=="bigint")){const[g,_,b]=h;te(f,{signed:_==="int",size:Number.parseInt(b,10)/8})}if(d==="address"&&typeof f=="string"&&!ut(f))throw new Yt({address:f});const p=d.match(zk);if(p){const[g,_]=p;if(_&&Je(f)!==Number.parseInt(_,10))throw new xk({expectedSize:Number.parseInt(_,10),givenSize:Je(f)})}const m=s[d];m&&(wT(d),o(m,f))}};if(s.EIP712Domain&&t){if(typeof t!="object")throw new gT({domain:t});o(s.EIP712Domain,t)}if(r!=="EIP712Domain")if(s[r])o(s[r],n);else throw new yT({primaryType:r,types:s})}function Rb({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"||typeof(e==null?void 0:e.chainId)=="bigint")&&{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 Bke({domain:e}){return d4({domain:e,types:{EIP712Domain:Rb({domain:e})}})}function wT(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new bT({type:e})}function _T(e){const{domain:t={},message:n,primaryType:r}=e,s={EIP712Domain:Rb({domain:t}),...e.types};u4({domain:t,message:n,primaryType:r,types:s});const o=["0x1901"];return t&&o.push(d4({domain:t,types:s})),r!=="EIP712Domain"&&o.push(f4({data:n,primaryType:r,types:s})),Et(rr(o))}function d4({domain:e,types:t}){return f4({data:e,primaryType:"EIP712Domain",types:t})}function f4({data:e,primaryType:t,types:n}){const r=h4({data:e,primaryType:t,types:n});return Et(r)}function h4({data:e,primaryType:t,types:n}){const r=[{type:"bytes32"}],s=[xT({primaryType:t,types:n})];for(const o of n[t]){const[a,c]=m4({types:n,name:o.name,type:o.type,value:e[o.name]});r.push(a),s.push(c)}return Ba(r,s)}function xT({primaryType:e,types:t}){const n=rn(kT({primaryType:e,types:t}));return Et(n)}function kT({primaryType:e,types:t}){let n="";const r=p4({primaryType:e,types:t});r.delete(e);const s=[e,...Array.from(r).sort()];for(const o of s)n+=`${o}(${t[o].map(({name:a,type:c})=>`${c} ${a}`).join(",")})`;return n}function p4({primaryType:e,types:t},n=new Set){const r=e.match(/^\w*/u),s=r==null?void 0:r[0];if(n.has(s)||t[s]===void 0)return n;n.add(s);for(const o of t[s])p4({primaryType:o.type,types:t},n);return n}function m4({types:e,name:t,type:n,value:r}){if(e[n]!==void 0)return[{type:"bytes32"},Et(h4({data:r,primaryType:n,types:e}))];if(n==="bytes")return[{type:"bytes32"},Et(r)];if(n==="string")return[{type:"bytes32"},Et(rn(r))];if(n.lastIndexOf("]")===n.length-1){const s=n.slice(0,n.lastIndexOf("[")),o=r.map(a=>m4({name:t,type:s,types:e,value:a}));return[{type:"bytes32"},Et(Ba(o.map(([a])=>a),o.map(([,a])=>a)))]}return[{type:n},r]}let CT=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}};const jT={checksum:new CT(8192)},Bm=jT.checksum;class g4 extends Xy{constructor(t,n){super(),this.finished=!1,this.destroyed=!1,LE(t);const r=Qh(n);if(this.iHash=t.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 s=this.blockLen,o=new Uint8Array(s);o.set(r.length>s?t.create().update(r).digest():r);for(let a=0;a<o.length;a++)o[a]^=54;this.iHash.update(o),this.oHash=t.create();for(let a=0;a<o.length;a++)o[a]^=106;this.oHash.update(o),ko(o)}update(t){return dc(this),this.iHash.update(t),this}digestInto(t){dc(this),xo(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:o,blockLen:a,outputLen:c}=this;return t=t,t.finished=s,t.destroyed=o,t.blockLen=a,t.outputLen=c,t.oHash=n._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const y4=(e,t,n)=>new g4(e,t).update(n).digest();y4.create=(e,t)=>new g4(e,t);function gp(e,t={}){const{as:n=typeof e=="string"?"Hex":"Bytes"}=t,r=eb(tM(e));return n==="Bytes"?r:$n(r)}function b4(e,t={}){const{compressed:n}=t,{prefix:r,x:s,y:o}=e;if(n===!1||typeof s=="bigint"&&typeof o=="bigint"){if(r!==4)throw new Qw({prefix:r,cause:new MT});return}if(n===!0||typeof s=="bigint"&&typeof o>"u"){if(r!==3&&r!==2)throw new Qw({prefix:r,cause:new IT});return}throw new NT({publicKey:e})}function ST(e){const t=(()=>{if(_C(e))return v4(e);if(uM(e))return AT(e);const{prefix:n,x:r,y:s}=e;return typeof r=="bigint"&&typeof s=="bigint"?{prefix:n??4,x:r,y:s}:{prefix:n,x:r}})();return b4(t),t}function AT(e){return v4($n(e))}function v4(e){if(e.length!==132&&e.length!==130&&e.length!==68)throw new BT({publicKey:e});if(e.length===130){const r=BigInt(Tt(e,0,32)),s=BigInt(Tt(e,32,64));return{prefix:4,x:r,y:s}}if(e.length===132){const r=Number(Tt(e,0,1)),s=BigInt(Tt(e,1,33)),o=BigInt(Tt(e,33,65));return{prefix:r,x:s,y:o}}const t=Number(Tt(e,0,1)),n=BigInt(Tt(e,1,33));return{prefix:t,x:n}}function ET(e,t={}){b4(e);const{prefix:n,x:r,y:s}=e,{includePrefix:o=!0}=t;return Sn(o?tt(n,{size:1}):"0x",tt(r,{size:32}),typeof s=="bigint"?tt(s,{size:32}):"0x")}class NT extends Se{constructor({publicKey:t}){super(`Value \`${ip(t)}\` is not a valid public key.`,{metaMessages:["Public key must contain:","- an `x` and `prefix` value (compressed)","- an `x`, `y`, and `prefix` value (uncompressed)"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidError"})}}class Qw extends Se{constructor({prefix:t,cause:n}){super(`Prefix "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidPrefixError"})}}class IT extends Se{constructor(){super("Prefix must be 2 or 3 for compressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidCompressedPrefixError"})}}class MT extends Se{constructor(){super("Prefix must be 4 for uncompressed public keys."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidUncompressedPrefixError"})}}let BT=class extends Se{constructor({publicKey:t}){super(`Value \`${t}\` is an invalid public key size.`,{metaMessages:["Expected: 33 bytes (compressed + prefix), 64 bytes (uncompressed) or 65 bytes (uncompressed + prefix).",`Received ${an(mb(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PublicKey.InvalidSerializedSizeError"})}};const TT=/^0x[a-fA-F0-9]{40}$/;function od(e,t={}){const{strict:n=!0}=t;if(!TT.test(e))throw new Yw({address:e,cause:new LT});if(n){if(e.toLowerCase()===e)return;if(Lb(e)!==e)throw new Yw({address:e,cause:new DT})}}function Lb(e){if(Bm.has(e))return Bm.get(e);od(e,{strict:!1});const t=e.substring(2).toLowerCase(),n=gp(rM(t),{as:"Bytes"}),r=t.split("");for(let o=0;o<40;o+=2)n[o>>1]>>4>=8&&r[o]&&(r[o]=r[o].toUpperCase()),(n[o>>1]&15)>=8&&r[o+1]&&(r[o+1]=r[o+1].toUpperCase());const s=`0x${r.join("")}`;return Bm.set(e,s),s}function PT(e,t={}){const{checksum:n=!1}=t;return od(e),n?Lb(e):e}function RT(e,t={}){const n=gp(`0x${ET(e).slice(4)}`).substring(26);return PT(`0x${n}`,t)}function rg(e,t={}){const{strict:n=!0}=t??{};try{return od(e,{strict:n}),!0}catch{return!1}}let Yw=class extends Se{constructor({address:t,cause:n}){super(`Address "${t}" is invalid.`,{cause:n}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}};class LT extends Se{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class DT extends Se{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const OT=/^(.*)\[([0-9]*)\]$/,FT=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,w4=/^(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)?$/,Jw=2n**256n-1n;function Fi(e,t,n){const{checksumAddress:r,staticPosition:s}=n,o=Fb(t.type);if(o){const[a,c]=o;return zT(e,{...t,type:c},{checksumAddress:r,length:a,staticPosition:s})}if(t.type==="tuple")return WT(e,t,{checksumAddress:r,staticPosition:s});if(t.type==="address")return $T(e,{checksum:r});if(t.type==="bool")return qT(e);if(t.type.startsWith("bytes"))return UT(e,t,{staticPosition:s});if(t.type.startsWith("uint")||t.type.startsWith("int"))return HT(e,t);if(t.type==="string")return VT(e,{staticPosition:s});throw new $b(t.type)}const Xw=32,sg=32;function $T(e,t={}){const{checksum:n=!1}=t,r=e.readBytes(32);return[(o=>n?Lb(o):o)($n(oM(r,-20))),32]}function zT(e,t,n){const{checksumAddress:r,length:s,staticPosition:o}=n;if(!s){const l=vs(e.readBytes(sg)),u=o+l,d=u+Xw;e.setPosition(u);const f=vs(e.readBytes(Xw)),h=wu(t);let p=0;const m=[];for(let g=0;g<f;++g){e.setPosition(d+(h?g*32:p));const[_,b]=Fi(e,t,{checksumAddress:r,staticPosition:d});p+=b,m.push(_)}return e.setPosition(o+32),[m,32]}if(wu(t)){const l=vs(e.readBytes(sg)),u=o+l,d=[];for(let f=0;f<s;++f){e.setPosition(u+f*32);const[h]=Fi(e,t,{checksumAddress:r,staticPosition:u});d.push(h)}return e.setPosition(o+32),[d,32]}let a=0;const c=[];for(let l=0;l<s;++l){const[u,d]=Fi(e,t,{checksumAddress:r,staticPosition:o+a});a+=d,c.push(u)}return[c,a]}function qT(e){return[iM(e.readBytes(32),{size:32}),32]}function UT(e,t,{staticPosition:n}){const[r,s]=t.type.split("bytes");if(!s){const a=vs(e.readBytes(32));e.setPosition(n+a);const c=vs(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const l=e.readBytes(c);return e.setPosition(n+32),[$n(l),32]}return[$n(e.readBytes(Number.parseInt(s,10),32)),32]}function HT(e,t){const n=t.type.startsWith("int"),r=Number.parseInt(t.type.split("int")[1]||"256",10),s=e.readBytes(32);return[r>48?aM(s,{signed:n}):vs(s,{signed:n}),32]}function WT(e,t,n){const{checksumAddress:r,staticPosition:s}=n,o=t.components.length===0||t.components.some(({name:l})=>!l),a=o?[]:{};let c=0;if(wu(t)){const l=vs(e.readBytes(sg)),u=s+l;for(let d=0;d<t.components.length;++d){const f=t.components[d];e.setPosition(u+c);const[h,p]=Fi(e,f,{checksumAddress:r,staticPosition:u});c+=p,a[o?d:f==null?void 0:f.name]=h}return e.setPosition(s+32),[a,32]}for(let l=0;l<t.components.length;++l){const u=t.components[l],[d,f]=Fi(e,u,{checksumAddress:r,staticPosition:s});a[o?l:u==null?void 0:u.name]=d,c+=f}return[a,c]}function VT(e,{staticPosition:t}){const n=vs(e.readBytes(32)),r=t+n;e.setPosition(r);const s=vs(e.readBytes(32));if(s===0)return e.setPosition(t+32),["",32];const o=e.readBytes(s,32),a=cM(yC(o));return e.setPosition(t+32),[a,32]}function GT({checksumAddress:e,parameters:t,values:n}){const r=[];for(let s=0;s<t.length;s++)r.push(Db({checksumAddress:e,parameter:t[s],value:n[s]}));return r}function Db({checksumAddress:e=!1,parameter:t,value:n}){const r=t,s=Fb(r.type);if(s){const[o,a]=s;return QT(n,{checksumAddress:e,length:o,parameter:{...r,type:a}})}if(r.type==="tuple")return eP(n,{checksumAddress:e,parameter:r});if(r.type==="address")return KT(n,{checksum:e});if(r.type==="bool")return JT(n);if(r.type.startsWith("uint")||r.type.startsWith("int")){const o=r.type.startsWith("int"),[,,a="256"]=w4.exec(r.type)??[];return XT(n,{signed:o,size:Number(a)})}if(r.type.startsWith("bytes"))return YT(n,{type:r.type});if(r.type==="string")return ZT(n);throw new $b(r.type)}function Ob(e){let t=0;for(let o=0;o<e.length;o++){const{dynamic:a,encoded:c}=e[o];a?t+=32:t+=an(c)}const n=[],r=[];let s=0;for(let o=0;o<e.length;o++){const{dynamic:a,encoded:c}=e[o];a?(n.push(tt(t+s,{size:32})),r.push(c),s+=an(c)):n.push(c)}return Sn(...n,...r)}function KT(e,t){const{checksum:n=!1}=t;return od(e,{strict:n}),{dynamic:!1,encoded:ka(e.toLowerCase())}}function QT(e,t){const{checksumAddress:n,length:r,parameter:s}=t,o=r===null;if(!Array.isArray(e))throw new cP(e);if(!o&&e.length!==r)throw new iP({expectedLength:r,givenLength:e.length,type:`${s.type}[${r}]`});let a=!1;const c=[];for(let l=0;l<e.length;l++){const u=Db({checksumAddress:n,parameter:s,value:e[l]});u.dynamic&&(a=!0),c.push(u)}if(o||a){const l=Ob(c);if(o){const u=tt(c.length,{size:32});return{dynamic:!0,encoded:c.length>0?Sn(u,l):u}}if(a)return{dynamic:!0,encoded:l}}return{dynamic:!1,encoded:Sn(...c.map(({encoded:l})=>l))}}function YT(e,{type:t}){const[,n]=t.split("bytes"),r=an(e);if(!n){let s=e;return r%32!==0&&(s=Ca(s,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Sn(ka(tt(r,{size:32})),s)}}if(r!==Number.parseInt(n,10))throw new k4({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:Ca(e)}}function JT(e){if(typeof e!="boolean")throw new Se(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ka(bC(e))}}function XT(e,{signed:t,size:n}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new xC({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:tt(e,{size:32,signed:t})}}function ZT(e){const t=gb(e),n=Math.ceil(an(t)/32),r=[];for(let s=0;s<n;s++)r.push(Ca(Tt(t,s*32,(s+1)*32)));return{dynamic:!0,encoded:Sn(Ca(tt(an(t),{size:32})),...r)}}function eP(e,t){const{checksumAddress:n,parameter:r}=t;let s=!1;const o=[];for(let a=0;a<r.components.length;a++){const c=r.components[a],l=Array.isArray(e)?a:c.name,u=Db({checksumAddress:n,parameter:c,value:e[l]});o.push(u),u.dynamic&&(s=!0)}return{dynamic:s,encoded:s?Ob(o):Sn(...o.map(({encoded:a})=>a))}}function Fb(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function wu(e){var r;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(r=e.components)==null?void 0:r.some(wu);const n=Fb(e.type);return!!(n&&wu({...e,type:n[1]}))}const tP={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 rP({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new nP({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new Zw({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new Zw({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function _4(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(tP);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}class Zw extends Se{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class nP extends Se{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class rP extends Se{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function sP(e,t,n={}){const{as:r="Array",checksumAddress:s=!1}=n,o=typeof t=="string"?pb(t):t,a=_4(o);if(Ai(o)===0&&e.length>0)throw new aP;if(Ai(o)&&Ai(o)<32)throw new oP({data:typeof t=="string"?t:$n(t),parameters:e,size:Ai(o)});let c=0;const l=r==="Array"?[]:{};for(let u=0;u<e.length;++u){const d=e[u];a.setPosition(c);const[f,h]=Fi(a,d,{checksumAddress:s,staticPosition:0});c+=h,r==="Array"?l.push(f):l[d.name??u]=f}return l}function yp(e,t,n){const{checksumAddress:r=!1}={};if(e.length!==t.length)throw new C4({expectedLength:e.length,givenLength:t.length});const s=GT({checksumAddress:r,parameters:e,values:t}),o=Ob(s);return o.length===0?"0x":o}function og(e,t){if(e.length!==t.length)throw new C4({expectedLength:e.length,givenLength:t.length});const n=[];for(let r=0;r<e.length;r++){const s=e[r],o=t[r];n.push(og.encode(s,o))}return Sn(...n)}(function(e){function t(n,r,s=!1){if(n==="address"){const l=r;return od(l),ka(l.toLowerCase(),s?32:0)}if(n==="string")return gb(r);if(n==="bytes")return r;if(n==="bool")return ka(bC(r),s?32:1);const o=n.match(w4);if(o){const[l,u,d="256"]=o,f=Number.parseInt(d,10)/8;return tt(r,{size:s?32:f,signed:u==="int"})}const a=n.match(FT);if(a){const[l,u]=a;if(Number.parseInt(u,10)!==(r.length-2)/2)throw new k4({expectedSize:Number.parseInt(u,10),value:r});return Ca(r,s?32:0)}const c=n.match(OT);if(c&&Array.isArray(r)){const[l,u]=c,d=[];for(let f=0;f<r.length;f++)d.push(t(u,r[f],!0));return d.length===0?"0x":Sn(...d)}throw new $b(n)}e.encode=t})(og||(og={}));function x4(e){return Array.isArray(e)&&typeof e[0]=="string"||typeof e=="string"?Aw(e):e}class oP extends Se{constructor({data:t,parameters:n,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${fi(n)})`,`Data: ${t} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.DataSizeTooSmallError"})}}class aP extends Se{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ZeroDataError"})}}class iP extends Se{constructor({expectedLength:t,givenLength:n,type:r}){super(`Array length mismatch for type \`${r}\`. Expected: \`${t}\`. Given: \`${n}\`.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.ArrayLengthMismatchError"})}}class k4 extends Se{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${an(n)}) does not match expected size (bytes${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.BytesSizeMismatchError"})}}class C4 extends Se{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding parameters/values length mismatch.",`Expected length (parameters): ${t}`,`Given length (values): ${n}`].join(`
1687
1687
  `)),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.LengthMismatchError"})}}let cP=class extends Se{constructor(t){super(`Value \`${t}\` is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidArrayError"})}};class $b extends Se{constructor(t){super(`Type \`${t}\` is not a valid ABI Type.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiParameters.InvalidTypeError"})}}function lP(e,t){const{as:n}=t,r=j4(e),s=_4(new Uint8Array(r.length));return r.encode(s),n==="Hex"?$n(s.bytes):s.bytes}function uP(e,t={}){const{as:n="Hex"}=t;return lP(e,{as:n})}function j4(e){return Array.isArray(e)?dP(e.map(t=>j4(t))):fP(e)}function dP(e){const t=e.reduce((s,o)=>s+o.length,0),n=S4(t);return{length:t<=55?1+t:1+n+t,encode(s){t<=55?s.pushByte(192+t):(s.pushByte(247+n),n===1?s.pushUint8(t):n===2?s.pushUint16(t):n===3?s.pushUint24(t):s.pushUint32(t));for(const{encode:o}of e)o(s)}}}function fP(e){const t=typeof e=="string"?pb(e):e,n=S4(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(s){t.length===1&&t[0]<128?s.pushBytes(t):t.length<=55?(s.pushByte(128+t.length),s.pushBytes(t)):(s.pushByte(183+n),n===1?s.pushUint8(t.length):n===2?s.pushUint16(t.length):n===3?s.pushUint24(t.length):s.pushUint32(t.length),s.pushBytes(t))}}}function S4(e){if(e<=255)return 1;if(e<=65535)return 2;if(e<=16777215)return 3;if(e<=4294967295)return 4;throw new Se("Length is too large.")}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bn=BigInt(0),sn=BigInt(1),Zo=BigInt(2),hP=BigInt(3),A4=BigInt(4),E4=BigInt(5),N4=BigInt(8);function mn(e,t){const n=e%t;return n>=bn?n:t+n}function Hn(e,t,n){let r=e;for(;t-- >bn;)r*=r,r%=n;return r}function ag(e,t){if(e===bn)throw new Error("invert: expected non-zero number");if(t<=bn)throw new Error("invert: expected positive modulus, got "+t);let n=mn(e,t),r=t,s=bn,o=sn;for(;n!==bn;){const c=r/n,l=r%n,u=s-o*c;r=n,n=l,s=o,o=u}if(r!==sn)throw new Error("invert: does not exist");return mn(s,t)}function I4(e,t){const n=(e.ORDER+sn)/A4,r=e.pow(t,n);if(!e.eql(e.sqr(r),t))throw new Error("Cannot find square root");return r}function pP(e,t){const n=(e.ORDER-E4)/N4,r=e.mul(t,Zo),s=e.pow(r,n),o=e.mul(t,s),a=e.mul(e.mul(o,Zo),s),c=e.mul(o,e.sub(a,e.ONE));if(!e.eql(e.sqr(c),t))throw new Error("Cannot find square root");return c}function mP(e){if(e<BigInt(3))throw new Error("sqrt is not defined for small field");let t=e-sn,n=0;for(;t%Zo===bn;)t/=Zo,n++;let r=Zo;const s=zb(e);for(;e_(s,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return I4;let o=s.pow(r,t);const a=(t+sn)/Zo;return function(l,u){if(l.is0(u))return u;if(e_(l,u)!==1)throw new Error("Cannot find square root");let d=n,f=l.mul(l.ONE,o),h=l.pow(u,t),p=l.pow(u,a);for(;!l.eql(h,l.ONE);){if(l.is0(h))return l.ZERO;let m=1,g=l.sqr(h);for(;!l.eql(g,l.ONE);)if(m++,g=l.sqr(g),m===d)throw new Error("Cannot find square root");const _=sn<<BigInt(d-m-1),b=l.pow(f,_);d=m,f=l.sqr(b),h=l.mul(h,f),p=l.mul(p,b)}return p}}function gP(e){return e%A4===hP?I4:e%N4===E4?pP:mP(e)}const yP=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function bP(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=yP.reduce((r,s)=>(r[s]="function",r),t);return op(e,n)}function vP(e,t,n){if(n<bn)throw new Error("invalid exponent, negatives unsupported");if(n===bn)return e.ONE;if(n===sn)return t;let r=e.ONE,s=t;for(;n>bn;)n&sn&&(r=e.mul(r,s)),s=e.sqr(s),n>>=sn;return r}function M4(e,t,n=!1){const r=new Array(t.length).fill(n?e.ZERO:void 0),s=t.reduce((a,c,l)=>e.is0(c)?a:(r[l]=a,e.mul(a,c)),e.ONE),o=e.inv(s);return t.reduceRight((a,c,l)=>e.is0(c)?a:(r[l]=e.mul(a,r[l]),e.mul(a,c)),o),r}function e_(e,t){const n=(e.ORDER-sn)/Zo,r=e.pow(t,n),s=e.eql(r,e.ONE),o=e.eql(r,e.ZERO),a=e.eql(r,e.neg(e.ONE));if(!s&&!o&&!a)throw new Error("invalid Legendre symbol result");return s?1:o?0:-1}function B4(e,t){t!==void 0&&Ql(t);const n=t!==void 0?t:e.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function zb(e,t,n=!1,r={}){if(e<=bn)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:s,nByteLength:o}=B4(e,t);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a;const c=Object.freeze({ORDER:e,isLE:n,BITS:s,BYTES:o,MASK:sp(s),ZERO:bn,ONE:sn,create:l=>mn(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return bn<=l&&l<e},is0:l=>l===bn,isOdd:l=>(l&sn)===sn,neg:l=>mn(-l,e),eql:(l,u)=>l===u,sqr:l=>mn(l*l,e),add:(l,u)=>mn(l+u,e),sub:(l,u)=>mn(l-u,e),mul:(l,u)=>mn(l*u,e),pow:(l,u)=>vP(c,l,u),div:(l,u)=>mn(l*ag(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>ag(l,e),sqrt:r.sqrt||(l=>(a||(a=gP(e)),a(c,l))),toBytes:l=>n?hC(l,o):Yu(l,o),fromBytes:l=>{if(l.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+l.length);return n?fC(l):pa(l)},invertBatch:l=>M4(c,l),cmov:(l,u,d)=>d?u:l});return Object.freeze(c)}function T4(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function P4(e){const t=T4(e);return t+Math.ceil(t/2)}function wP(e,t,n=!1){const r=e.length,s=T4(t),o=P4(t);if(r<16||r<o||r>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+r);const a=n?fC(e):pa(e),c=mn(a,t-sn)+sn;return n?hC(c,s):Yu(c,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const t_=BigInt(0),ig=BigInt(1);function Tm(e,t){const n=t.negate();return e?n:t}function R4(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Pm(e,t){R4(e,t);const n=Math.ceil(t/e)+1,r=2**(e-1),s=2**e,o=sp(e),a=BigInt(e);return{windows:n,windowSize:r,mask:o,maxNumber:s,shiftBy:a}}function n_(e,t,n){const{windowSize:r,mask:s,maxNumber:o,shiftBy:a}=n;let c=Number(e&s),l=e>>a;c>r&&(c-=o,l+=ig);const u=t*r,d=u+Math.abs(c)-1,f=c===0,h=c<0,p=t%2!==0;return{nextN:l,offset:d,isZero:f,isNeg:h,isNegF:p,offsetF:u}}function _P(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((n,r)=>{if(!(n instanceof t))throw new Error("invalid point at index "+r)})}function xP(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((n,r)=>{if(!t.isValid(n))throw new Error("invalid scalar at index "+r)})}const Rm=new WeakMap,L4=new WeakMap;function Lm(e){return L4.get(e)||1}function kP(e,t){return{constTimeNegate:Tm,hasPrecomputes(n){return Lm(n)!==1},unsafeLadder(n,r,s=e.ZERO){let o=n;for(;r>t_;)r&ig&&(s=s.add(o)),o=o.double(),r>>=ig;return s},precomputeWindow(n,r){const{windows:s,windowSize:o}=Pm(r,t),a=[];let c=n,l=c;for(let u=0;u<s;u++){l=c,a.push(l);for(let d=1;d<o;d++)l=l.add(c),a.push(l);c=l.double()}return a},wNAF(n,r,s){let o=e.ZERO,a=e.BASE;const c=Pm(n,t);for(let l=0;l<c.windows;l++){const{nextN:u,offset:d,isZero:f,isNeg:h,isNegF:p,offsetF:m}=n_(s,l,c);s=u,f?a=a.add(Tm(p,r[m])):o=o.add(Tm(h,r[d]))}return{p:o,f:a}},wNAFUnsafe(n,r,s,o=e.ZERO){const a=Pm(n,t);for(let c=0;c<a.windows&&s!==t_;c++){const{nextN:l,offset:u,isZero:d,isNeg:f}=n_(s,c,a);if(s=l,!d){const h=r[u];o=o.add(f?h.negate():h)}}return o},getPrecomputes(n,r,s){let o=Rm.get(r);return o||(o=this.precomputeWindow(r,n),n!==1&&Rm.set(r,s(o))),o},wNAFCached(n,r,s){const o=Lm(n);return this.wNAF(o,this.getPrecomputes(o,n,s),r)},wNAFCachedUnsafe(n,r,s,o){const a=Lm(n);return a===1?this.unsafeLadder(n,r,o):this.wNAFUnsafe(a,this.getPrecomputes(a,n,s),r,o)},setWindowSize(n,r){R4(r,t),L4.set(n,r),Rm.delete(n)}}}function CP(e,t,n,r){_P(n,e),xP(r,t);const s=n.length,o=r.length;if(s!==o)throw new Error("arrays of points and scalars must have equal length");const a=e.ZERO,c=qI(BigInt(s));let l=1;c>12?l=c-3:c>4?l=c-2:c>0&&(l=2);const u=sp(l),d=new Array(Number(u)+1).fill(a),f=Math.floor((t.BITS-1)/l)*l;let h=a;for(let p=f;p>=0;p-=l){d.fill(a);for(let g=0;g<o;g++){const _=r[g],b=Number(_>>BigInt(p)&u);d[b]=d[b].add(n[g])}let m=a;for(let g=d.length-1,_=a;g>0;g--)_=_.add(d[g]),m=m.add(_);if(h=h.add(m),p!==0)for(let g=0;g<l;g++)h=h.double()}return h}function D4(e){return bP(e.Fp),op(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...B4(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function r_(e){e.lowS!==void 0&&gu("lowS",e.lowS),e.prehash!==void 0&&gu("prehash",e.prehash)}function jP(e){const t=D4(e);op(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:s}=t;if(n){if(!r.eql(s,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class SP extends Error{constructor(t=""){super(t)}}const ls={Err:SP,_tlv:{encode:(e,t)=>{const{Err:n}=ls;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length&1)throw new n("tlv.encode: unpadded data");const r=t.length/2,s=zd(r);if(s.length/2&128)throw new n("tlv.encode: long form length too big");const o=r>127?zd(s.length/2|128):"";return zd(e)+o+s+t},decode(e,t){const{Err:n}=ls;let r=0;if(e<0||e>256)throw new n("tlv.encode: wrong tag");if(t.length<2||t[r++]!==e)throw new n("tlv.decode: wrong tlv");const s=t[r++],o=!!(s&128);let a=0;if(!o)a=s;else{const l=s&127;if(!l)throw new n("tlv.decode(long): indefinite length not supported");if(l>4)throw new n("tlv.decode(long): byte length is too big");const u=t.subarray(r,r+l);if(u.length!==l)throw new n("tlv.decode: length bytes not complete");if(u[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const d of u)a=a<<8|d;if(r+=l,a<128)throw new n("tlv.decode(long): not minimal encoding")}const c=t.subarray(r,r+a);if(c.length!==a)throw new n("tlv.decode: wrong value length");return{v:c,l:t.subarray(r+a)}}},_int:{encode(e){const{Err:t}=ls;if(e<ps)throw new t("integer: negative integers are not allowed");let n=zd(e);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return n},decode(e){const{Err:t}=ls;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return pa(e)}},toSig(e){const{Err:t,_int:n,_tlv:r}=ls,s=Vn("signature",e),{v:o,l:a}=r.decode(48,s);if(a.length)throw new t("invalid signature: left bytes after parsing");const{v:c,l}=r.decode(2,o),{v:u,l:d}=r.decode(2,l);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:n.decode(c),s:n.decode(u)}},hexFromSig(e){const{_tlv:t,_int:n}=ls,r=t.encode(2,n.encode(e.r)),s=t.encode(2,n.encode(e.s)),o=r+s;return t.encode(48,o)}};function Dm(e,t){return yu(Yu(e,t))}const ps=BigInt(0),St=BigInt(1);BigInt(2);const Om=BigInt(3),AP=BigInt(4);function EP(e){const t=jP(e),{Fp:n}=t,r=zb(t.n,t.nBitLength),s=t.toBytes||((v,w,x)=>{const A=w.toAffine();return fh(Uint8Array.from([4]),n.toBytes(A.x),n.toBytes(A.y))}),o=t.fromBytes||(v=>{const w=v.subarray(1),x=n.fromBytes(w.subarray(0,n.BYTES)),A=n.fromBytes(w.subarray(n.BYTES,2*n.BYTES));return{x,y:A}});function a(v){const{a:w,b:x}=t,A=n.sqr(v),C=n.mul(A,v);return n.add(n.add(C,n.mul(v,w)),x)}function c(v,w){const x=n.sqr(w),A=a(v);return n.eql(x,A)}if(!c(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const l=n.mul(n.pow(t.a,Om),AP),u=n.mul(n.sqr(t.b),BigInt(27));if(n.is0(n.add(l,u)))throw new Error("bad curve params: a or b");function d(v){return hb(v,St,t.n)}function f(v){const{allowedPrivateKeyLengths:w,nByteLength:x,wrapPrivateKey:A,n:C}=t;if(w&&typeof v!="bigint"){if(Qu(v)&&(v=yu(v)),typeof v!="string"||!w.includes(v.length))throw new Error("invalid private key");v=v.padStart(x*2,"0")}let j;try{j=typeof v=="bigint"?v:pa(Vn("private key",v,x))}catch{throw new Error("invalid private key, expected hex or "+x+" bytes, got "+typeof v)}return A&&(j=mn(j,C)),Oi("private key",j,St,C),j}function h(v){if(!(v instanceof g))throw new Error("ProjectivePoint expected")}const p=Pw((v,w)=>{const{px:x,py:A,pz:C}=v;if(n.eql(C,n.ONE))return{x,y:A};const j=v.is0();w==null&&(w=j?n.ONE:n.inv(C));const E=n.mul(x,w),I=n.mul(A,w),T=n.mul(C,w);if(j)return{x:n.ZERO,y:n.ZERO};if(!n.eql(T,n.ONE))throw new Error("invZ was invalid");return{x:E,y:I}}),m=Pw(v=>{if(v.is0()){if(t.allowInfinityPoint&&!n.is0(v.py))return;throw new Error("bad point: ZERO")}const{x:w,y:x}=v.toAffine();if(!n.isValid(w)||!n.isValid(x))throw new Error("bad point: x or y not FE");if(!c(w,x))throw new Error("bad point: equation left != right");if(!v.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class g{constructor(w,x,A){if(w==null||!n.isValid(w))throw new Error("x required");if(x==null||!n.isValid(x)||n.is0(x))throw new Error("y required");if(A==null||!n.isValid(A))throw new Error("z required");this.px=w,this.py=x,this.pz=A,Object.freeze(this)}static fromAffine(w){const{x,y:A}=w||{};if(!w||!n.isValid(x)||!n.isValid(A))throw new Error("invalid affine point");if(w instanceof g)throw new Error("projective point not allowed");const C=j=>n.eql(j,n.ZERO);return C(x)&&C(A)?g.ZERO:new g(x,A,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(w){const x=M4(n,w.map(A=>A.pz));return w.map((A,C)=>A.toAffine(x[C])).map(g.fromAffine)}static fromHex(w){const x=g.fromAffine(o(Vn("pointHex",w)));return x.assertValidity(),x}static fromPrivateKey(w){return g.BASE.multiply(f(w))}static msm(w,x){return CP(g,r,w,x)}_setWindowSize(w){y.setWindowSize(this,w)}assertValidity(){m(this)}hasEvenY(){const{y:w}=this.toAffine();if(n.isOdd)return!n.isOdd(w);throw new Error("Field doesn't support isOdd")}equals(w){h(w);const{px:x,py:A,pz:C}=this,{px:j,py:E,pz:I}=w,T=n.eql(n.mul(x,I),n.mul(j,C)),O=n.eql(n.mul(A,I),n.mul(E,C));return T&&O}negate(){return new g(this.px,n.neg(this.py),this.pz)}double(){const{a:w,b:x}=t,A=n.mul(x,Om),{px:C,py:j,pz:E}=this;let I=n.ZERO,T=n.ZERO,O=n.ZERO,B=n.mul(C,C),U=n.mul(j,j),L=n.mul(E,E),N=n.mul(C,j);return N=n.add(N,N),O=n.mul(C,E),O=n.add(O,O),I=n.mul(w,O),T=n.mul(A,L),T=n.add(I,T),I=n.sub(U,T),T=n.add(U,T),T=n.mul(I,T),I=n.mul(N,I),O=n.mul(A,O),L=n.mul(w,L),N=n.sub(B,L),N=n.mul(w,N),N=n.add(N,O),O=n.add(B,B),B=n.add(O,B),B=n.add(B,L),B=n.mul(B,N),T=n.add(T,B),L=n.mul(j,E),L=n.add(L,L),B=n.mul(L,N),I=n.sub(I,B),O=n.mul(L,U),O=n.add(O,O),O=n.add(O,O),new g(I,T,O)}add(w){h(w);const{px:x,py:A,pz:C}=this,{px:j,py:E,pz:I}=w;let T=n.ZERO,O=n.ZERO,B=n.ZERO;const U=t.a,L=n.mul(t.b,Om);let N=n.mul(x,j),H=n.mul(A,E),M=n.mul(C,I),$=n.add(x,A),W=n.add(j,E);$=n.mul($,W),W=n.add(N,H),$=n.sub($,W),W=n.add(x,C);let ie=n.add(j,I);return W=n.mul(W,ie),ie=n.add(N,M),W=n.sub(W,ie),ie=n.add(A,C),T=n.add(E,I),ie=n.mul(ie,T),T=n.add(H,M),ie=n.sub(ie,T),B=n.mul(U,W),T=n.mul(L,M),B=n.add(T,B),T=n.sub(H,B),B=n.add(H,B),O=n.mul(T,B),H=n.add(N,N),H=n.add(H,N),M=n.mul(U,M),W=n.mul(L,W),H=n.add(H,M),M=n.sub(N,M),M=n.mul(U,M),W=n.add(W,M),N=n.mul(H,W),O=n.add(O,N),N=n.mul(ie,W),T=n.mul($,T),T=n.sub(T,N),N=n.mul($,H),B=n.mul(ie,B),B=n.add(B,N),new g(T,O,B)}subtract(w){return this.add(w.negate())}is0(){return this.equals(g.ZERO)}wNAF(w){return y.wNAFCached(this,w,g.normalizeZ)}multiplyUnsafe(w){const{endo:x,n:A}=t;Oi("scalar",w,ps,A);const C=g.ZERO;if(w===ps)return C;if(this.is0()||w===St)return this;if(!x||y.hasPrecomputes(this))return y.wNAFCachedUnsafe(this,w,g.normalizeZ);let{k1neg:j,k1:E,k2neg:I,k2:T}=x.splitScalar(w),O=C,B=C,U=this;for(;E>ps||T>ps;)E&St&&(O=O.add(U)),T&St&&(B=B.add(U)),U=U.double(),E>>=St,T>>=St;return j&&(O=O.negate()),I&&(B=B.negate()),B=new g(n.mul(B.px,x.beta),B.py,B.pz),O.add(B)}multiply(w){const{endo:x,n:A}=t;Oi("scalar",w,St,A);let C,j;if(x){const{k1neg:E,k1:I,k2neg:T,k2:O}=x.splitScalar(w);let{p:B,f:U}=this.wNAF(I),{p:L,f:N}=this.wNAF(O);B=y.constTimeNegate(E,B),L=y.constTimeNegate(T,L),L=new g(n.mul(L.px,x.beta),L.py,L.pz),C=B.add(L),j=U.add(N)}else{const{p:E,f:I}=this.wNAF(w);C=E,j=I}return g.normalizeZ([C,j])[0]}multiplyAndAddUnsafe(w,x,A){const C=g.BASE,j=(I,T)=>T===ps||T===St||!I.equals(C)?I.multiplyUnsafe(T):I.multiply(T),E=j(this,x).add(j(w,A));return E.is0()?void 0:E}toAffine(w){return p(this,w)}isTorsionFree(){const{h:w,isTorsionFree:x}=t;if(w===St)return!0;if(x)return x(g,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:w,clearCofactor:x}=t;return w===St?this:x?x(g,this):this.multiplyUnsafe(t.h)}toRawBytes(w=!0){return gu("isCompressed",w),this.assertValidity(),s(g,this,w)}toHex(w=!0){return gu("isCompressed",w),yu(this.toRawBytes(w))}}g.BASE=new g(t.Gx,t.Gy,n.ONE),g.ZERO=new g(n.ZERO,n.ONE,n.ZERO);const{endo:_,nBitLength:b}=t,y=kP(g,_?Math.ceil(b/2):b);return{CURVE:t,ProjectivePoint:g,normPrivateKeyToScalar:f,weierstrassEquation:a,isWithinCurveOrder:d}}function NP(e){const t=D4(e);return op(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function IP(e){const t=NP(e),{Fp:n,n:r,nByteLength:s,nBitLength:o}=t,a=n.BYTES+1,c=2*n.BYTES+1;function l(L){return mn(L,r)}function u(L){return ag(L,r)}const{ProjectivePoint:d,normPrivateKeyToScalar:f,weierstrassEquation:h,isWithinCurveOrder:p}=EP({...t,toBytes(L,N,H){const M=N.toAffine(),$=n.toBytes(M.x),W=fh;return gu("isCompressed",H),H?W(Uint8Array.from([N.hasEvenY()?2:3]),$):W(Uint8Array.from([4]),$,n.toBytes(M.y))},fromBytes(L){const N=L.length,H=L[0],M=L.subarray(1);if(N===a&&(H===2||H===3)){const $=pa(M);if(!hb($,St,n.ORDER))throw new Error("Point is not on curve");const W=h($);let ie;try{ie=n.sqrt(W)}catch(z){const se=z instanceof Error?": "+z.message:"";throw new Error("Point is not on curve"+se)}const de=(ie&St)===St;return(H&1)===1!==de&&(ie=n.neg(ie)),{x:$,y:ie}}else if(N===c&&H===4){const $=n.fromBytes(M.subarray(0,n.BYTES)),W=n.fromBytes(M.subarray(n.BYTES,2*n.BYTES));return{x:$,y:W}}else{const $=a,W=c;throw new Error("invalid Point, expected length of "+$+", or uncompressed "+W+", got "+N)}}});function m(L){const N=r>>St;return L>N}function g(L){return m(L)?l(-L):L}const _=(L,N,H)=>pa(L.slice(N,H));class b{constructor(N,H,M){Oi("r",N,St,r),Oi("s",H,St,r),this.r=N,this.s=H,M!=null&&(this.recovery=M),Object.freeze(this)}static fromCompact(N){const H=s;return N=Vn("compactSignature",N,H*2),new b(_(N,0,H),_(N,H,2*H))}static fromDER(N){const{r:H,s:M}=ls.toSig(Vn("DER",N));return new b(H,M)}assertValidity(){}addRecoveryBit(N){return new b(this.r,this.s,N)}recoverPublicKey(N){const{r:H,s:M,recovery:$}=this,W=C(Vn("msgHash",N));if($==null||![0,1,2,3].includes($))throw new Error("recovery id invalid");const ie=$===2||$===3?H+t.n:H;if(ie>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const de=$&1?"03":"02",ye=d.fromHex(de+Dm(ie,n.BYTES)),z=u(ie),se=l(-W*z),ge=l(M*z),xe=d.BASE.multiplyAndAddUnsafe(ye,se,ge);if(!xe)throw new Error("point at infinify");return xe.assertValidity(),xe}hasHighS(){return m(this.s)}normalizeS(){return this.hasHighS()?new b(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return dh(this.toDERHex())}toDERHex(){return ls.hexFromSig(this)}toCompactRawBytes(){return dh(this.toCompactHex())}toCompactHex(){const N=s;return Dm(this.r,N)+Dm(this.s,N)}}const y={isValidPrivateKey(L){try{return f(L),!0}catch{return!1}},normPrivateKeyToScalar:f,randomPrivateKey:()=>{const L=P4(t.n);return wP(t.randomBytes(L),t.n)},precompute(L=8,N=d.BASE){return N._setWindowSize(L),N.multiply(BigInt(3)),N}};function v(L,N=!0){return d.fromPrivateKey(L).toRawBytes(N)}function w(L){if(typeof L=="bigint")return!1;if(L instanceof d)return!0;const H=Vn("key",L).length,M=n.BYTES,$=M+1,W=2*M+1;if(!(t.allowedPrivateKeyLengths||s===$))return H===$||H===W}function x(L,N,H=!0){if(w(L)===!0)throw new Error("first arg must be private key");if(w(N)===!1)throw new Error("second arg must be public key");return d.fromHex(N).multiply(f(L)).toRawBytes(H)}const A=t.bits2int||function(L){if(L.length>8192)throw new Error("input is too large");const N=pa(L),H=L.length*8-o;return H>0?N>>BigInt(H):N},C=t.bits2int_modN||function(L){return l(A(L))},j=sp(o);function E(L){return Oi("num < 2^"+o,L,ps,j),Yu(L,s)}function I(L,N,H=T){if(["recovered","canonical"].some(Ue=>Ue in H))throw new Error("sign() legacy options not supported");const{hash:M,randomBytes:$}=t;let{lowS:W,prehash:ie,extraEntropy:de}=H;W==null&&(W=!0),L=Vn("msgHash",L),r_(H),ie&&(L=Vn("prehashed msgHash",M(L)));const ye=C(L),z=f(N),se=[E(z),E(ye)];if(de!=null&&de!==!1){const Ue=de===!0?$(n.BYTES):de;se.push(Vn("extraEntropy",Ue))}const ge=fh(...se),xe=ye;function je(Ue){const Fe=A(Ue);if(!p(Fe))return;const Ze=u(Fe),Nn=d.BASE.multiply(Fe).toAffine(),Mt=l(Nn.x);if(Mt===ps)return;const In=l(Ze*l(xe+Mt*z));if(In===ps)return;let Ot=(Nn.x===Mt?0:2)|Number(Nn.y&St),dn=In;return W&&m(In)&&(dn=g(In),Ot^=1),new b(Mt,dn,Ot)}return{seed:ge,k2sig:je}}const T={lowS:t.lowS,prehash:!1},O={lowS:t.lowS,prehash:!1};function B(L,N,H=T){const{seed:M,k2sig:$}=I(L,N,H),W=t;return UI(W.hash.outputLen,W.nByteLength,W.hmac)(M,$)}d.BASE._setWindowSize(8);function U(L,N,H,M=O){var Ot;const $=L;N=Vn("msgHash",N),H=Vn("publicKey",H);const{lowS:W,prehash:ie,format:de}=M;if(r_(M),"strict"in M)throw new Error("options.strict was renamed to lowS");if(de!==void 0&&de!=="compact"&&de!=="der")throw new Error("format must be compact or der");const ye=typeof $=="string"||Qu($),z=!ye&&!de&&typeof $=="object"&&$!==null&&typeof $.r=="bigint"&&typeof $.s=="bigint";if(!ye&&!z)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let se,ge;try{if(z&&(se=new b($.r,$.s)),ye){try{de!=="compact"&&(se=b.fromDER($))}catch(dn){if(!(dn instanceof ls.Err))throw dn}!se&&de!=="der"&&(se=b.fromCompact($))}ge=d.fromHex(H)}catch{return!1}if(!se||W&&se.hasHighS())return!1;ie&&(N=t.hash(N));const{r:xe,s:je}=se,Ue=C(N),Fe=u(je),Ze=l(Ue*Fe),Nn=l(xe*Fe),Mt=(Ot=d.BASE.multiplyAndAddUnsafe(ge,Ze,Nn))==null?void 0:Ot.toAffine();return Mt?l(Mt.x)===xe:!1}return{CURVE:t,getPublicKey:v,getSharedSecret:x,sign:B,verify:U,ProjectivePoint:d,Signature:b,utils:y}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function MP(e){return{hash:e,hmac:(t,...n)=>y4(e,t,UE(...n)),randomBytes:HE}}function BP(e,t){const n=r=>IP({...e,...MP(r)});return{...n(t),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const O4=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),s_=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),TP=BigInt(0),PP=BigInt(1),cg=BigInt(2),o_=(e,t)=>(e+t/cg)/t;function RP(e){const t=O4,n=BigInt(3),r=BigInt(6),s=BigInt(11),o=BigInt(22),a=BigInt(23),c=BigInt(44),l=BigInt(88),u=e*e*e%t,d=u*u*e%t,f=Hn(d,n,t)*d%t,h=Hn(f,n,t)*d%t,p=Hn(h,cg,t)*u%t,m=Hn(p,s,t)*p%t,g=Hn(m,o,t)*m%t,_=Hn(g,c,t)*g%t,b=Hn(_,l,t)*_%t,y=Hn(b,c,t)*g%t,v=Hn(y,n,t)*d%t,w=Hn(v,a,t)*m%t,x=Hn(w,r,t)*u%t,A=Hn(x,cg,t);if(!lg.eql(lg.sqr(A),e))throw new Error("Cannot find square root");return A}const lg=zb(O4,void 0,void 0,{sqrt:RP}),qb=BP({a:TP,b:BigInt(7),Fp:lg,n:s_,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=s_,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-PP*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),s=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,a=BigInt("0x100000000000000000000000000000000"),c=o_(o*e,t),l=o_(-r*e,t);let u=mn(e-c*n-l*s,t),d=mn(-c*r-l*o,t);const f=u>a,h=d>a;if(f&&(u=t-u),h&&(d=t-d),u>a||d>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:f,k1:u,k2neg:h,k2:d}}}},KC),LP=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:qb},Symbol.toStringTag,{value:"Module"}));function F4(e,t={}){const{recovered:n}=t;if(typeof e.r>"u")throw new Fm({signature:e});if(typeof e.s>"u")throw new Fm({signature:e});if(n&&typeof e.yParity>"u")throw new Fm({signature:e});if(e.r<0n||e.r>Jw)throw new qP({value:e.r});if(e.s<0n||e.s>Jw)throw new UP({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new Hb({value:e.yParity})}function DP(e){return $4($n(e))}function $4(e){if(e.length!==130&&e.length!==132)throw new zP({signature:e});const t=BigInt(Tt(e,0,32)),n=BigInt(Tt(e,32,64)),r=(()=>{const s=+`0x${e.slice(130)}`;if(!Number.isNaN(s))try{return Ub(s)}catch{throw new Hb({value:s})}})();return typeof r>"u"?{r:t,s:n}:{r:t,s:n,yParity:r}}function z4(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return q4(e)}function q4(e){const t=typeof e=="string"?$4(e):e instanceof Uint8Array?DP(e):typeof e.r=="string"?FP(e):e.v?OP(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return F4(t),t}function OP(e){return{r:e.r,s:e.s,yParity:Ub(e.v)}}function FP(e){const t=(()=>{const n=e.v?Number(e.v):void 0;let r=e.yParity?Number(e.yParity):void 0;if(typeof n=="number"&&typeof r!="number"&&(r=Ub(n)),typeof r!="number")throw new Hb({value:e.yParity});return r})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function $P(e){const{r:t,s:n,yParity:r}=e;return[r?"0x01":"0x",t===0n?"0x":Lw(tt(t)),n===0n?"0x":Lw(tt(n))]}function Ub(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new HP({value:e})}class zP extends Se{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${an(mb(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Fm extends Se{constructor({signature:t}){super(`Signature \`${ip(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class qP extends Se{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class UP extends Se{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class Hb extends Se{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class HP extends Se{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function WP(e,t={}){return typeof e.chainId=="string"?VP(e):{...e,...t.signature}}function VP(e){const{address:t,chainId:n,nonce:r}=e,s=z4(e);return{address:t,chainId:Number(n),nonce:BigInt(r),...s}}function GP(e){return KP(e,{presign:!0})}function KP(e,t={}){const{presign:n}=t;return gp(Sn("0x05",uP(QP(n?{address:e.address,chainId:e.chainId,nonce:e.nonce}:e))))}function QP(e){const{address:t,chainId:n,nonce:r}=e,s=z4(e);return[n?tt(n):"0x",t,r?tt(r):"0x",...s?$P(s):[]]}function YP(e){return RT(JP(e))}function JP(e){const{payload:t,signature:n}=e,{r,s,yParity:o}=n,c=new qb.Signature(BigInt(r),BigInt(s)).addRecoveryBit(o).recoverPublicKey(mb(t).substring(2));return ST(c)}const U4="0x8010801080108010801080108010801080108010801080108010801080108010",H4=x4("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function Wb(e){if(typeof e=="string"){if(Tt(e,-32)!==U4)throw new eR(e)}else F4(e.authorization)}function XP(e){Wb(e);const t=wC(Tt(e,-64,-32)),n=Tt(e,-t-64,-64),r=Tt(e,0,-t-64),[s,o,a]=sP(H4,n);return{authorization:WP({address:s.delegation,chainId:Number(s.chainId),nonce:s.nonce,yParity:s.yParity,r:s.r,s:s.s}),signature:r,...a&&a!=="0x"?{data:a,to:o}:{}}}function Dke(e){const{data:t,signature:n}=e;Wb(e);const r=YP({payload:GP(e.authorization),signature:q4(e.authorization)}),s=yp(H4,[{...e.authorization,delegation:e.authorization.address,chainId:BigInt(e.authorization.chainId)},e.to??r,t??"0x"]),o=tt(an(s),{size:32});return Sn(n,s,o,U4)}function ZP(e){try{return Wb(e),!0}catch{return!1}}let eR=class extends Se{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};class tR extends K{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function nR(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new tR({value:e});let[n,r="0"]=e.split(".");const s=n.startsWith("-");if(s&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),t===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+1n}`),r="";else if(r.length>t){const[o,a,c]=[r.slice(0,t-1),r.slice(t-1,t),r.slice(t)],l=Math.round(+`${a}.${c}`);l>9?r=`${BigInt(o)+BigInt(1)}0`.padStart(o.length+1,"0"):r=`${o}${l}`,r.length>t&&(r=r.slice(1),n=`${BigInt(n)+1n}`),r=r.slice(0,t)}else r=r.padEnd(t,"0");return BigInt(`${s?"-":""}${n}${r}`)}function rR(e,t="wei"){return nR(e,oC[t])}function sR(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function oR(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?tr(e.nonce):void 0,storageProof:e.storageProof?sR(e.storageProof):void 0}}async function aR(e,{address:t,blockHash:n,blockNumber:r,blockTag:s="latest",requireCanonical:o,storageKeys:a}){const c=Pa({blockHash:n,blockNumber:r,blockTag:s,requireCanonical:o}),l=await e.request({method:"eth_getProof",params:[t,a,c]});return oR(l)}async function iR(e,{address:t,blockHash:n,blockNumber:r,blockTag:s="latest",requireCanonical:o,slot:a}){const c=Pa({blockHash:n,blockNumber:r,blockTag:s,requireCanonical:o});return await e.request({method:"eth_getStorageAt",params:[t,a,c]})}async function bp(e,{blockHash:t,blockNumber:n,blockTag:r,hash:s,index:o,sender:a,nonce:c}){var h,p,m;const l=r||"latest",u=n!==void 0?te(n):void 0;let d=null;if(s?d=await e.request({method:"eth_getTransactionByHash",params:[s]},{dedupe:!0}):t?d=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,te(o)]},{dedupe:!0}):typeof o=="number"?d=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[u||l,te(o)]},{dedupe:!!u}):a&&typeof c=="number"&&(d=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[a,te(c)]},{dedupe:!0})),!d)throw new aC({blockHash:t,blockNumber:n,blockTag:l,hash:s,index:o});return(((m=(p=(h=e.chain)==null?void 0:h.formatters)==null?void 0:p.transaction)==null?void 0:m.format)||td)(d,"getTransaction")}async function cR(e,{hash:t,transactionReceipt:n}){const[r,s]=await Promise.all([we(e,nd,"getBlockNumber")({}),t?we(e,bp,"getTransaction")({hash:t}):void 0]),o=(n==null?void 0:n.blockNumber)||(s==null?void 0:s.blockNumber);return o?r-o+1n:0n}async function Af(e,{hash:t}){var s,o,a;const n=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!n)throw new iC({hash:t});return(((a=(o=(s=e.chain)==null?void 0:s.formatters)==null?void 0:o.transactionReceipt)==null?void 0:a.format)||fp)(n,"getTransactionReceipt")}async function W4(e,t){var w;const{account:n,authorizationList:r,allowFailure:s=!0,blockHash:o,blockNumber:a,blockOverrides:c,blockTag:l,requireCanonical:u,stateOverride:d}=t,f=t.contracts,{batchSize:h=t.batchSize??1024,deployless:p=t.deployless??!1}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},m=(()=>{if(t.multicallAddress)return t.multicallAddress;if(p)return null;if(e.chain)return Ec({blockNumber:a,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),g=[[]];let _=0,b=0;for(let x=0;x<f.length;x++){const{abi:A,address:C,args:j,functionName:E}=f[x];try{const I=ht({abi:A,args:j,functionName:E});b+=(I.length-2)/2,h>0&&b>h&&g[_].length>0&&(_++,b=(I.length-2)/2,g[_]=[]),g[_]=[...g[_],{allowFailure:!0,callData:I,target:C}]}catch(I){const T=hc(I,{abi:A,address:C,args:j,docsPath:"/docs/contract/multicall",functionName:E,sender:n});if(!s)throw T;g[_]=[...g[_],{allowFailure:!0,callData:"0x",target:C}]}}const y=await Promise.allSettled(g.map(x=>we(e,sr,"readContract")({...m===null?{code:yb}:{address:m},abi:lc,account:n,args:[x],authorizationList:r,blockHash:o,blockNumber:a,blockOverrides:c,blockTag:l,functionName:"aggregate3",requireCanonical:u,stateOverride:d}))),v=[];for(let x=0;x<y.length;x++){const A=y[x];if(A.status==="rejected"){if(!s)throw A.reason;for(let j=0;j<g[x].length;j++)v.push({status:"failure",error:A.reason,result:void 0});continue}const C=A.value;for(let j=0;j<C.length;j++){const{returnData:E,success:I}=C[j],{callData:T}=g[x][j],{abi:O,address:B,functionName:U,args:L}=f[v.length];try{if(T==="0x")throw new Uu;if(!I)throw new np({data:E});const N=Bo({abi:O,args:L,data:E,functionName:U});v.push(s?{result:N,status:"success"}:N)}catch(N){const H=hc(N,{abi:O,address:B,args:L,docsPath:"/docs/contract/multicall",functionName:U});if(!s)throw H;v.push({error:H,result:void 0,status:"failure"})}}}if(v.length!==f.length)throw new K("multicall results mismatch");return v}async function ug(e,t){const{blockNumber:n,blockTag:r=e.experimental_blockTag??"latest",blocks:s,returnFullTransactions:o,traceTransfers:a,validation:c}=t;try{const l=[];for(const h of s){const p=h.blockOverrides?CC(h.blockOverrides):void 0,m=h.calls.map(_=>{const b=_,y=b.account?Lt(b.account):void 0,v=b.abi?ht(b):b.data,w={...b,account:y,data:b.dataSuffix?rr([v||"0x",b.dataSuffix]):v,from:b.from??(y==null?void 0:y.address)};return La(w),Ra(w)}),g=h.stateOverrides?wb(h.stateOverrides):void 0;l.push({blockOverrides:p,calls:m,stateOverrides:g})}const d=(typeof n=="bigint"?te(n):void 0)||r;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:l,returnFullTransactions:o,traceTransfers:a,validation:c},d]})).map((h,p)=>({...Sb(h),calls:h.calls.map((m,g)=>{var I,T;const{abi:_,args:b,functionName:y,to:v}=s[p].calls[g],w=((I=m.error)==null?void 0:I.data)??m.returnData,x=BigInt(m.gasUsed),A=(T=m.logs)==null?void 0:T.map(O=>Vr(O)),C=m.status==="0x1"?"success":"failure",j=_&&C==="success"&&w!=="0x"?Bo({abi:_,data:w,functionName:y}):null,E=(()=>{if(C==="success")return;let O;if(w==="0x"?O=new Uu:w&&(O=new np({data:w})),!!O)return hc(O,{abi:_??[],address:v??"0x",args:b,functionName:y??"<unknown>"})})();return{data:w,gasUsed:x,logs:A,status:C,...C==="success"?{result:j}:{error:E}}})}))}catch(l){const u=l,d=cp(u,{});throw d instanceof Xu?u:d}}function dg(e){let t=!0,n="",r=0,s="",o=!1;for(let a=0;a<e.length;a++){const c=e[a];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function","error",""].includes(s))s="";else if(s+=c,c===")"){o=!0;break}continue}if(c===" "){e[a-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=c,n+=c}}if(!o)throw new Se("Unable to normalize signature.");return s}function fg(e,t){const n=typeof e,r=t.type;switch(r){case"address":return rg(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>fg(Object.values(e)[o],s)):/^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(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>fg(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function V4(e,t,n){for(const r in e){const s=e[r],o=t[r];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return V4(s.components,o.components,n[r]);const a=[s.type,o.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?rg(n[r],{strict:!1}):a.includes("address")&&a.includes("bytes")?rg(n[r],{strict:!1}):!1)return a}}function G4(e,t={}){const{prepare:n=!0}=t,r=Array.isArray(e)||typeof e=="string"?Sw(e):e;return{...r,...n?{hash:Ni(r)}:{}}}function vp(e,t,n){const{args:r=[],prepare:s=!0}=n??{},o=_C(t,{strict:!1}),a=e.filter(u=>o?u.type==="function"||u.type==="error"?K4(u)===Tt(t,0,4):u.type==="event"?Ni(u)===t:!1:"name"in u&&u.name===t);if(a.length===0)throw new mh({name:t});if(a.length===1)return{...a[0],...s?{hash:Ni(a[0])}:{}};let c;for(const u of a){if(!("inputs"in u))continue;if(!r||r.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...s?{hash:Ni(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==r.length)continue;if(r.every((f,h)=>{const p="inputs"in u&&u.inputs[h];return p?fg(f,p):!1})){if(c&&"inputs"in c&&c.inputs){const f=V4(u.inputs,c.inputs,r);if(f)throw new uR({abiItem:u,type:f[0]},{abiItem:c,type:f[1]})}c=u}}const l=(()=>{if(c)return c;const[u,...d]=a;return{...u,overloads:d}})();if(!l)throw new mh({name:t});return{...l,...s?{hash:Ni(l)}:{}}}function K4(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return vp(n,r)}return e[0]})();return Tt(Ni(t),0,4)}function lR(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,s]=e;return vp(r,s)}return e[0]})(),n=typeof t=="string"?t:lh(t);return dg(n)}function Ni(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,r]=e;return vp(n,r)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:gp(gb(lR(t)))}class uR extends Se{constructor(t,n){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${dg(lh(t.abiItem))}\`, and`,`\`${n.type}\` in \`${dg(lh(n.abiItem))}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.AmbiguityError"})}}class mh extends Se{constructor({name:t,data:n,type:r="item"}){const s=t?` with name "${t}"`:n?` with data "${n}"`:"";super(`ABI ${r}${s} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function dR(...e){var o;const[t,n]=(()=>{if(Array.isArray(e[0])){const[a,c]=e;return[hR(a),c]}return e})(),{bytecode:r,args:s}=n;return Sn(r,(o=t.inputs)!=null&&o.length&&(s!=null&&s.length)?yp(t.inputs,s):"0x")}function fR(e){return G4(e)}function hR(e){const t=e.find(n=>n.type==="constructor");if(!t)throw new mh({name:"constructor"});return t}function pR(...e){const[t,n=[]]=(()=>{if(Array.isArray(e[0])){const[u,d,f]=e;return[a_(u,d,{args:f}),f]}const[c,l]=e;return[c,l]})(),{overloads:r}=t,s=r?a_([t,...r],t.name,{args:n}):t,o=mR(s),a=n.length>0?yp(s.inputs,n):void 0;return a?Sn(o,a):o}function Ga(e,t={}){return G4(e,t)}function a_(e,t,n){const r=vp(e,t,n);if(r.type!=="function")throw new mh({name:t,type:"function"});return r}function mR(e){return K4(e)}const gR="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",bt="0x0000000000000000000000000000000000000000",yR="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function bR(e,t){const{blockNumber:n,blockTag:r,calls:s,stateOverrides:o,traceAssetChanges:a,traceTransfers:c,validation:l}=t,u=t.account?Lt(t.account):void 0;if(a&&!u)throw new K("`account` is required when `traceAssetChanges` is true");const d=u?dR(fR("constructor(bytes, bytes)"),{bytecode:jC,args:[yR,pR(Ga("function getBalance(address)"),[u.address])]}):void 0,f=a?await Promise.all(t.calls.map(async M=>{if(!M.data&&!M.abi)return;const{accessList:$}=await RC(e,{account:u.address,...M,data:M.abi?ht(M):M.data});return $.map(({address:W,storageKeys:ie})=>ie.length>0?W:null)})).then(M=>M.flat().filter(Boolean)):[],h=await ug(e,{blockNumber:n,blockTag:r,blocks:[...a?[{calls:[{data:d}],stateOverrides:o},{calls:f.map((M,$)=>({abi:[Ga("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:M,from:bt,nonce:$})),stateOverrides:[{address:bt,nonce:0}]}]:[],{calls:[...s,{to:bt}].map(M=>({...M,from:u==null?void 0:u.address})),stateOverrides:o},...a?[{calls:[{data:d}]},{calls:f.map((M,$)=>({abi:[Ga("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:M,from:bt,nonce:$})),stateOverrides:[{address:bt,nonce:0}]},{calls:f.map((M,$)=>({to:M,abi:[Ga("function decimals() returns (uint256)")],functionName:"decimals",from:bt,nonce:$})),stateOverrides:[{address:bt,nonce:0}]},{calls:f.map((M,$)=>({to:M,abi:[Ga("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:bt,nonce:$})),stateOverrides:[{address:bt,nonce:0}]},{calls:f.map((M,$)=>({to:M,abi:[Ga("function symbol() returns (string)")],functionName:"symbol",from:bt,nonce:$})),stateOverrides:[{address:bt,nonce:0}]}]:[]],traceTransfers:c,validation:l}),p=a?h[2]:h[0],[m,g,,_,b,y,v,w]=a?h:[],{calls:x,...A}=p,C=x.slice(0,-1)??[],j=(m==null?void 0:m.calls)??[],E=(g==null?void 0:g.calls)??[],I=[...j,...E].map(M=>M.status==="success"?Gt(M.data):null),T=(_==null?void 0:_.calls)??[],O=(b==null?void 0:b.calls)??[],B=[...T,...O].map(M=>M.status==="success"?Gt(M.data):null),U=((y==null?void 0:y.calls)??[]).map(M=>M.status==="success"?M.result:null),L=((w==null?void 0:w.calls)??[]).map(M=>M.status==="success"?M.result:null),N=((v==null?void 0:v.calls)??[]).map(M=>M.status==="success"?M.result:null),H=[];for(const[M,$]of B.entries()){const W=I[M];if(typeof $!="bigint"||typeof W!="bigint")continue;const ie=U[M-1],de=L[M-1],ye=N[M-1],z=M===0?{address:gR,decimals:18,symbol:"ETH"}:{address:f[M-1],decimals:ye||ie?Number(ie??1):void 0,symbol:de??void 0};H.some(se=>se.token.address===z.address)||H.push({token:z,value:{pre:W,post:$,diff:$-W}})}return{assetChanges:H,block:A,results:C}}async function vR(e,t){var d;const{abi:n,address:r,args:s,functionName:o,dataSuffix:a=typeof e.dataSuffix=="string"?e.dataSuffix:(d=e.dataSuffix)==null?void 0:d.value,...c}=t,l=c.account?Lt(c.account):e.account,u=ht({abi:n,args:s,functionName:o});try{const{data:f}=await we(e,Ic,"call")({batch:!1,data:`${u}${a?a.replace("0x",""):""}`,to:r,...c,account:l}),h=Bo({abi:n,args:s,functionName:o,data:f||"0x"}),p=n.filter(m=>"name"in m&&m.name===t.functionName);return{result:h,request:{abi:p,address:r,args:s,dataSuffix:a,functionName:o,...c,account:l}}}catch(f){throw hc(f,{abi:n,address:r,args:s,docsPath:"/docs/contract/simulateContract",functionName:o,sender:l==null?void 0:l.address})}}async function wp(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}const Q4="0x6492649264926492649264926492649264926492649264926492649264926492";function wR(e){if(Tt(e,-32)!==Q4)throw new kR(e)}function _R(e){const{data:t,signature:n,to:r}=e;return Sn(yp(x4("address, bytes, bytes"),[r,t,n]),Q4)}function xR(e){try{return wR(e),!0}catch{return!1}}class kR extends Se{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function CR({r:e,s:t,to:n="hex",v:r,yParity:s}){const o=(()=>{if(s===0||s===1)return s;if(r&&(r===27n||r===28n||r>=35n))return r%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),a=`0x${new qb.Signature(Gt(e),Gt(t)).toCompactHex()}${o===0?"1b":"1c"}`;return n==="hex"?a:nr(a)}async function _p(e,t){var u,d,f,h;const{address:n,chain:r=e.chain,hash:s,erc6492VerifierAddress:o=t.universalSignatureVerifierAddress??((d=(u=r==null?void 0:r.contracts)==null?void 0:u.erc6492Verifier)==null?void 0:d.address),multicallAddress:a=t.multicallAddress??((h=(f=r==null?void 0:r.contracts)==null?void 0:f.multicall3)==null?void 0:h.address),mode:c="auto"}=t;if(r!=null&&r.verifyHash)return await r.verifyHash(e,t);const l=(()=>{const p=t.signature;return Hr(p)?p:typeof p=="object"&&"r"in p&&"s"in p?CR(p):lt(p)})();try{if(c==="eoa")try{if(pc(Ge(n),await Z0({hash:s,signature:l})))return!0}catch{}return ZP(l)?await jR(e,{...t,multicallAddress:a,signature:l}):await SR(e,{...t,verifierAddress:o,signature:l})}catch(p){if(c!=="eoa")try{if(pc(Ge(n),await Z0({hash:s,signature:l})))return!0}catch{}if(p instanceof Sa)return!1;throw p}}async function jR(e,t){var _;const{address:n,blockNumber:r,blockTag:s,hash:o,multicallAddress:a}=t,{authorization:c,data:l,signature:u,to:d}=XP(t.signature);if(await hh(e,{address:n,blockNumber:r,blockTag:s})===Un(["0xef0100",c.address]))return await AR(e,{address:n,blockNumber:r,blockTag:s,hash:o,signature:u});const h={address:c.address,chainId:Number(c.chainId),nonce:Number(c.nonce),r:te(c.r,{size:32}),s:te(c.s,{size:32}),yParity:c.yParity};if(!await nT({address:n,authorization:h}))throw new Sa;const m=await we(e,sr,"readContract")({...a?{address:a}:{code:yb},authorizationList:[h],abi:lc,blockNumber:r,blockTag:"pending",functionName:"aggregate3",args:[[...l?[{allowFailure:!0,target:d??n,callData:l}]:[],{allowFailure:!0,target:n,callData:ht({abi:mk,functionName:"isValidSignature",args:[o,u]})}]]}),g=(_=m[m.length-1])==null?void 0:_.returnData;if(g!=null&&g.startsWith("0x1626ba7e"))return!0;throw new Sa}async function SR(e,t){const{address:n,factory:r,factoryData:s,hash:o,signature:a,verifierAddress:c,...l}=t,u=await(async()=>!r&&!s||xR(a)?a:_R({data:s,signature:a,to:r}))(),d=c?{to:c,data:ht({abi:cw,functionName:"isValidSig",args:[n,o,u]}),...l}:{data:bb({abi:cw,args:[n,o,u],bytecode:xM}),...l},{data:f}=await we(e,Ic,"call")(d).catch(h=>{throw h instanceof cC?new Sa:h});if(Sk(f??"0x0"))return!0;throw new Sa}async function AR(e,t){const{address:n,blockNumber:r,blockTag:s,hash:o,signature:a}=t;if((await we(e,sr,"readContract")({address:n,abi:mk,args:[o,a],blockNumber:r,blockTag:s,functionName:"isValidSignature"}).catch(l=>{throw l instanceof cb?new Sa:l})).startsWith("0x1626ba7e"))return!0;throw new Sa}class Sa extends Error{}async function ER(e,{address:t,message:n,factory:r,factoryData:s,signature:o,...a}){const c=l4(n);return we(e,_p,"verifyHash")({address:t,factory:r,factoryData:s,hash:c,signature:o,...a})}async function NR(e,t){const{address:n,factory:r,factoryData:s,signature:o,message:a,primaryType:c,types:l,domain:u,...d}=t,f=_T({message:a,primaryType:c,types:l,domain:u});return we(e,_p,"verifyHash")({address:n,factory:r,factoryData:s,hash:f,signature:o,...d})}const Hd=new Map,$m=new Map;let IR=0;function Ao(e,t,n){const r=++IR,s=()=>Hd.get(e)||[],o=()=>{const f=s().filter(h=>h.id!==r);if(f.length===0){Hd.delete(e),$m.delete(e);return}Hd.set(e,f)},a=()=>{const d=s();if(!d.some(h=>h.id===r))return;const f=$m.get(e);if(d.length===1&&f){const h=f();h instanceof Promise&&h.catch(()=>{})}o()},c=s();if(Hd.set(e,[...c,{id:r,fns:t}]),c&&c.length>0)return a;const l={};for(const d in t)l[d]=(...f)=>{var p,m;const h=s();if(h.length!==0)for(const g of h)(m=(p=g.fns)[d])==null||m.call(p,...f)};const u=n(l);return typeof u=="function"&&$m.set(e,u),a}function ad(e,{emitOnBegin:t,initialWaitTime:n,interval:r}){let s=!0;const o=()=>s=!1;return(async()=>{let c;t&&(c=await e({unpoll:o}));const l=await(n==null?void 0:n(c))??r;await tg(l);const u=async()=>{s&&(await e({unpoll:o}),await tg(r),u())};u()})(),o}function Y4(e,{emitOnBegin:t=!1,emitMissed:n=!1,onBlockNumber:r,onError:s,poll:o,pollingInterval:a=e.pollingInterval}){const c=typeof o<"u"?o:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let l;return c?(()=>{const f=xt(["watchBlockNumber",e.uid,t,n,a]);return Ao(f,{onBlockNumber:r,onError:s},h=>ad(async()=>{var p;try{const m=await we(e,nd,"getBlockNumber")({cacheTime:0});if(l!==void 0){if(m===l)return;if(m-l>1&&n)for(let g=l+1n;g<m;g++)h.onBlockNumber(g,l),l=g}(l===void 0||m>l)&&(h.onBlockNumber(m,l),l=m)}catch(m){(p=h.onError)==null||p.call(h,m)}},{emitOnBegin:t,interval:a}))})():(()=>{const f=xt(["watchBlockNumber",e.uid,t,n]);return Ao(f,{onBlockNumber:r,onError:s},h=>{let p=!0,m=()=>p=!1;return(async()=>{try{const g=(()=>{if(e.transport.type==="fallback"){const b=e.transport.transports.find(y=>y.config.type==="webSocket"||y.config.type==="ipc");return b?b.value:e.transport}return e.transport})(),{unsubscribe:_}=await g.subscribe({params:["newHeads"],onData(b){var v;if(!p)return;const y=Gt((v=b.result)==null?void 0:v.number);h.onBlockNumber(y,l),l=y},onError(b){var y;(y=h.onError)==null||y.call(h,b)}});m=_,p||m()}catch(g){s==null||s(g)}})(),()=>m()})})()}async function Vb(e,t){const{checkReplacement:n=!0,confirmations:r=1,hash:s,onReplaced:o,retryCount:a=6,retryDelay:c=({count:x})=>~~(1<<x)*200,timeout:l=18e4}=t,u=xt(["waitForTransactionReceipt",e.uid,s]),d=(()=>{var x;return t.pollingInterval?t.pollingInterval:(x=e.chain)!=null&&x.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let f,h,p,m=!1,g,_;const{promise:b,resolve:y,reject:v}=AC(),w=l?setTimeout(()=>{_==null||_(),g==null||g(),v(new EI({hash:s}))},l):void 0;return g=Ao(u,{onReplaced:o,resolve:y,reject:v},async x=>{if(p=await we(e,Af,"getTransactionReceipt")({hash:s}).catch(()=>{}),p&&r<=1){clearTimeout(w),x.resolve(p),g==null||g();return}_=we(e,Y4,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:d,async onBlockNumber(A){const C=E=>{clearTimeout(w),_==null||_(),E(),g==null||g()};let j=A;if(!m)try{if(p){if(r>1&&(!p.blockNumber||j-p.blockNumber+1n<r))return;C(()=>x.resolve(p));return}if(n&&!f&&(m=!0,await mc(async()=>{f=await we(e,bp,"getTransaction")({hash:s}),f.blockNumber&&(j=f.blockNumber)},{delay:c,retryCount:a}),m=!1),p=await we(e,Af,"getTransactionReceipt")({hash:s}),r>1&&(!p.blockNumber||j-p.blockNumber+1n<r))return;C(()=>x.resolve(p))}catch(E){if(E instanceof aC||E instanceof iC){if(!f){m=!1;return}try{h=f,m=!0;const I=await mc(()=>we(e,gr,"getBlock")({blockNumber:j,includeTransactions:!0}),{delay:c,retryCount:a,shouldRetry:({error:B})=>B instanceof jb});m=!1;const T=I.transactions.find(({from:B,nonce:U})=>B===h.from&&U===h.nonce);if(!T||(p=await we(e,Af,"getTransactionReceipt")({hash:T.hash}),r>1&&(!p.blockNumber||j-p.blockNumber+1n<r)))return;let O="replaced";T.to===h.to&&T.value===h.value&&T.input===h.input?O="repriced":T.from===T.to&&T.value===0n&&(O="cancelled"),C(()=>{var B;(B=x.onReplaced)==null||B.call(x,{reason:O,replacedTransaction:h,transaction:T,transactionReceipt:p}),x.resolve(p)})}catch(I){C(()=>x.reject(I))}}else C(()=>x.reject(E))}}})}),b}function MR(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:n=!1,emitOnBegin:r=!1,onBlock:s,onError:o,includeTransactions:a,poll:c,pollingInterval:l=e.pollingInterval}){const u=typeof c<"u"?c:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),d=a??!1;let f;return u?(()=>{const m=xt(["watchBlocks",e.uid,t,n,r,d,l]);return Ao(m,{onBlock:s,onError:o},g=>ad(async()=>{var _;try{const b=await we(e,gr,"getBlock")({blockTag:t,includeTransactions:d});if(b.number!==null&&(f==null?void 0:f.number)!=null){if(b.number===f.number)return;if(b.number-f.number>1&&n)for(let y=(f==null?void 0:f.number)+1n;y<b.number;y++){const v=await we(e,gr,"getBlock")({blockNumber:y,includeTransactions:d});g.onBlock(v,f),f=v}}((f==null?void 0:f.number)==null||t==="pending"&&(b==null?void 0:b.number)==null||b.number!==null&&b.number>f.number)&&(g.onBlock(b,f),f=b)}catch(b){(_=g.onError)==null||_.call(g,b)}},{emitOnBegin:r,interval:l}))})():(()=>{let m=!0,g=!0,_=()=>m=!1;return(async()=>{try{r&&we(e,gr,"getBlock")({blockTag:t,includeTransactions:d}).then(v=>{m&&g&&(s(v,void 0),g=!1)}).catch(o);const b=(()=>{if(e.transport.type==="fallback"){const v=e.transport.transports.find(w=>w.config.type==="webSocket"||w.config.type==="ipc");return v?v.value:e.transport}return e.transport})(),{unsubscribe:y}=await b.subscribe({params:["newHeads"],async onData(v){var x;if(!m)return;const w=await we(e,gr,"getBlock")({blockNumber:(x=v.result)==null?void 0:x.number,includeTransactions:d}).catch(()=>{});m&&(s(w,f),g=!1,f=w)},onError(v){o==null||o(v)}});_=y,m||_()}catch(b){o==null||o(b)}})(),()=>_()})()}function BR(e,t){const{abi:n,address:r,args:s,batch:o=!0,eventName:a,fromBlock:c,onError:l,onLogs:u,poll:d,pollingInterval:f=e.pollingInterval,strict:h}=t;return(typeof d<"u"?d:typeof c=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const _=h??!1,b=xt(["watchContractEvent",r,s,o,e.uid,a,f,_,c]);return Ao(b,{onLogs:u,onError:l},y=>{let v;c!==void 0&&(v=c-1n);let w,x=!1;const A=ad(async()=>{var C;if(!x){try{w=await we(e,LC,"createContractEventFilter")({abi:n,address:r,args:s,eventName:a,strict:_,fromBlock:c})}catch{}x=!0;return}try{let j;if(w)j=await we(e,pp,"getFilterChanges")({filter:w});else{const E=await we(e,nd,"getBlockNumber")({});v&&v<E?j=await we(e,a4,"getContractEvents")({abi:n,address:r,args:s,eventName:a,fromBlock:v+1n,toBlock:E,strict:_}):j=[],v=E}if(j.length===0)return;if(o)y.onLogs(j);else for(const E of j)y.onLogs([E])}catch(j){w&&j instanceof So&&(x=!1),(C=y.onError)==null||C.call(y,j)}},{emitOnBegin:!0,interval:f});return async()=>{w&&await we(e,wp,"uninstallFilter")({filter:w}),A()}})})():(()=>{const _=h??!1,b=xt(["watchContractEvent",r,s,o,e.uid,a,f,_]);let y=!0,v=()=>y=!1;return Ao(b,{onLogs:u,onError:l},w=>((async()=>{try{const x=(()=>{if(e.transport.type==="fallback"){const j=e.transport.transports.find(E=>E.config.type==="webSocket"||E.config.type==="ipc");return j?j.value:e.transport}return e.transport})(),A=a?ed({abi:n,eventName:a,args:s}):[],{unsubscribe:C}=await x.subscribe({params:["logs",{address:r,topics:A}],onData(j){var I;if(!y)return;const E=j.result;try{const{eventName:T,args:O}=ph({abi:n,data:E.data,topics:E.topics,strict:h}),B=Vr(E,{args:O,eventName:T});w.onLogs([B])}catch(T){let O,B;if(T instanceof ch||T instanceof Ky){if(h)return;O=T.abiItem.name,B=(I=T.abiItem.inputs)==null?void 0:I.some(L=>!("name"in L&&L.name))}const U=Vr(E,{args:B?[]:{},eventName:O});w.onLogs([U])}},onError(j){var E;(E=w.onError)==null||E.call(w,j)}});v=C,y||v()}catch(x){l==null||l(x)}})(),()=>v()))})()}function TR(e,{address:t,args:n,batch:r=!0,event:s,events:o,fromBlock:a,onError:c,onLogs:l,poll:u,pollingInterval:d=e.pollingInterval,strict:f}){const h=typeof u<"u"?u:typeof a=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),p=f??!1;return h?(()=>{const _=xt(["watchEvent",t,n,r,e.uid,s,d,a]);return Ao(_,{onLogs:l,onError:c},b=>{let y;a!==void 0&&(y=a-1n);let v,w=!1;const x=ad(async()=>{var A;if(!w){try{v=await we(e,DC,"createEventFilter")({address:t,args:n,event:s,events:o,strict:p,fromBlock:a})}catch{}w=!0;return}try{let C;if(v)C=await we(e,pp,"getFilterChanges")({filter:v});else{const j=await we(e,nd,"getBlockNumber")({});y&&y!==j?C=await we(e,Tb,"getLogs")({address:t,args:n,event:s,events:o,fromBlock:y+1n,toBlock:j}):C=[],y=j}if(C.length===0)return;if(r)b.onLogs(C);else for(const j of C)b.onLogs([j])}catch(C){v&&C instanceof So&&(w=!1),(A=b.onError)==null||A.call(b,C)}},{emitOnBegin:!0,interval:d});return async()=>{v&&await we(e,wp,"uninstallFilter")({filter:v}),x()}})})():(()=>{let _=!0,b=()=>_=!1;return(async()=>{try{const y=(()=>{if(e.transport.type==="fallback"){const A=e.transport.transports.find(C=>C.config.type==="webSocket"||C.config.type==="ipc");return A?A.value:e.transport}return e.transport})(),v=o??(s?[s]:void 0);let w=[];v&&(w=[v.flatMap(C=>ed({abi:[C],eventName:C.name,args:n}))],s&&(w=w[0]));const{unsubscribe:x}=await y.subscribe({params:["logs",{address:t,topics:w}],onData(A){var j;if(!_)return;const C=A.result;try{const{eventName:E,args:I}=ph({abi:v??[],data:C.data,topics:C.topics,strict:p}),T=Vr(C,{args:I,eventName:E});l([T])}catch(E){let I,T;if(E instanceof ch||E instanceof Ky){if(f)return;I=E.abiItem.name,T=(j=E.abiItem.inputs)==null?void 0:j.some(B=>!("name"in B&&B.name))}const O=Vr(C,{args:T?[]:{},eventName:I});l([O])}},onError(A){c==null||c(A)}});b=x,_||b()}catch(y){c==null||c(y)}})(),()=>b()})()}function PR(e,{batch:t=!0,onError:n,onTransactions:r,poll:s,pollingInterval:o=e.pollingInterval}){return(typeof s<"u"?s:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const u=xt(["watchPendingTransactions",e.uid,t,o]);return Ao(u,{onTransactions:r,onError:n},d=>{let f;const h=ad(async()=>{var p;try{if(!f)try{f=await we(e,OC,"createPendingTransactionFilter")({});return}catch(g){throw h(),g}const m=await we(e,pp,"getFilterChanges")({filter:f});if(m.length===0)return;if(t)d.onTransactions(m);else for(const g of m)d.onTransactions([g])}catch(m){(p=d.onError)==null||p.call(d,m)}},{emitOnBegin:!0,interval:o});return async()=>{f&&await we(e,wp,"uninstallFilter")({filter:f}),h()}})})():(()=>{let u=!0,d=()=>u=!1;return(async()=>{try{const{unsubscribe:f}=await e.transport.subscribe({params:["newPendingTransactions"],onData(h){if(!u)return;const p=h.result;r([p])},onError(h){n==null||n(h)}});d=f,u||d()}catch(f){n==null||n(f)}})(),()=>d()})()}class Gb extends K{constructor({docsPath:t}={}){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(`
1688
1688
  `),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class zm extends K{constructor({docsPath:t,metaMessages:n,type:r}){super(`Account type "${r}" is not supported.`,{docsPath:t,metaMessages:n,name:"AccountTypeNotSupportedError"})}}async function J4(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const qm=new Hu(128);async function RR(e,t){var x,A,C,j,E,I;const{account:n=e.account,assertChainId:r=!0,chain:s=e.chain,accessList:o,authorizationList:a,blobs:c,data:l,dataSuffix:u=typeof e.dataSuffix=="string"?e.dataSuffix:(x=e.dataSuffix)==null?void 0:x.value,gas:d,gasPrice:f,maxFeePerBlobGas:h,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:g,type:_,value:b,...y}=t;if(typeof n>"u")throw new Gb({docsPath:"/docs/actions/wallet/sendTransaction"});const v=n?Lt(n):null;let w;try{La(t);const T=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await kb({authorization:a[0]}).catch(()=>{throw new K("`to` is required. Could not infer from `authorizationList`.")})})();if((v==null?void 0:v.type)==="json-rpc"||v===null){let O;s!==null&&(O=await we(e,vu,"getChainId")({}),r&&iT({currentChainId:O,chain:s}));const B=(j=(C=(A=e.chain)==null?void 0:A.formatters)==null?void 0:C.transactionRequest)==null?void 0:j.format,L=(B||Ra)({...Zu(y,{format:B}),accessList:o,account:v,authorizationList:a,blobs:c,chainId:O,data:u?rr([l??"0x",u]):l,gas:d,gasPrice:f,maxFeePerBlobGas:h,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:g,to:T,type:_,value:b},"sendTransaction"),N=qm.get(e.uid),H=N?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:H,params:[L]},{retryCount:0})}catch(M){if(N===!1)throw M;const $=M;if($.name==="InvalidInputRpcError"||$.name==="InvalidParamsRpcError"||$.name==="MethodNotFoundRpcError"||$.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[L]},{retryCount:0}).then(W=>(qm.set(e.uid,!0),W)).catch(W=>{const ie=W;throw ie.name==="MethodNotFoundRpcError"||ie.name==="MethodNotSupportedRpcError"?(qm.set(e.uid,!1),$):ie});throw $}}if((v==null?void 0:v.type)==="local"){if(v.nonceManager&&typeof g>"u"){const L=y.chainId,N=await(async()=>typeof L=="number"?L:s?s.id:we(e,vu,"getChainId")({}))();w={address:v.address,chainId:N}}const O=await we(e,Mb,"prepareTransactionRequest")({account:v,accessList:o,authorizationList:a,blobs:c,chain:s,data:u?rr([l??"0x",u]):l,gas:d,gasPrice:f,maxFeePerBlobGas:h,maxFeePerGas:p,maxPriorityFeePerGas:m,nonce:g,nonceManager:v.nonceManager,parameters:[...s4,"sidecars"],type:_,value:b,...y,to:T}),B=(E=s==null?void 0:s.serializers)==null?void 0:E.transaction,U=await v.signTransaction(O,{serializer:B});return await we(e,J4,"sendRawTransaction")({serializedTransaction:U})}throw(v==null?void 0:v.type)==="smart"?new zm({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new zm({docsPath:"/docs/actions/wallet/sendTransaction",type:v==null?void 0:v.type})}catch(T){throw T instanceof zm?T:(w&&((I=v==null?void 0:v.nonceManager)==null||I.reset(w)),n4(T,{...t,account:v,chain:t.chain||void 0}))}}async function LR(e,{serializedTransaction:t,throwOnReceiptRevert:n,timeout:r}){var c,l,u;const s=await e.request({method:"eth_sendRawTransactionSync",params:r?[t,r]:[t]},{retryCount:0}),a=(((u=(l=(c=e.chain)==null?void 0:c.formatters)==null?void 0:l.transactionReceipt)==null?void 0:u.format)||fp)(s);if(a.status==="reverted"&&n)throw new AI({receipt:a});return a}async function DR(e,{account:t=e.account,message:n}){if(!t)throw new Gb({docsPath:"/docs/actions/wallet/signMessage"});const r=Lt(t);if(r.signMessage)return r.signMessage({message:n});const s=typeof n=="string"?_a(n):n.raw instanceof Uint8Array?rn(n.raw):n.raw;return e.request({method:"personal_sign",params:[s,r.address]},{retryCount:0})}async function OR(e,t){const{account:n=e.account,domain:r,message:s,primaryType:o}=t;if(!n)throw new Gb({docsPath:"/docs/actions/wallet/signTypedData"});const a=Lt(n),c={EIP712Domain:Rb({domain:r}),...t.types};if(u4({domain:r,message:s,primaryType:o,types:c}),a.signTypedData)return a.signTypedData({domain:r,message:s,primaryType:o,types:c});const l=vT({domain:r,message:s,primaryType:o,types:c});return e.request({method:"eth_signTypedData_v4",params:[a.address,l]},{retryCount:0})}function xr(e,t,n){const r=e[t.name];if(typeof r=="function")return r;const s=e[n];return typeof s=="function"?s:o=>t(e,o)}const Ef="2.22.1",FR=()=>`@wagmi/core@${Ef}`;var X4=function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},gh,Z4;let Rs=class hg extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return FR()}constructor(t,n={}){var o;super(),gh.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 r=n.cause instanceof hg?n.cause.details:(o=n.cause)!=null&&o.message?n.cause.message:n.details,s=n.cause instanceof hg&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...s?[`Docs: ${this.docsBaseUrl}${s}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${this.version}`].join(`
@@ -1758,7 +1758,7 @@ distributed under the License is distributed on an "AS IS" BASIS,
1758
1758
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1759
1759
  See the License for the specific language governing permissions and
1760
1760
  limitations under the License.
1761
- */const sl={newline:10,reset:27};function u$(e){if(!Number.isSafeInteger(e))throw new Error(`integer expected: ${e}`)}function d$(e){if(!Number.isSafeInteger(e)||e<1||e>40)throw new Error(`Invalid version=${e}. Expected number [1..40]`)}function Oo(e,t){return e.toString(2).padStart(t,"0")}function J_(e,t){const n=e%t;return n>=0?n:t+n}function Br(e,t){return new Array(e).fill(t)}function i1(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}function X_(e){let t=0,n=0;for(const o of e)t=Math.max(t,o.length),n+=o.length;const r=new Uint8Array(n);let s=0;for(let o=0;o<t;o++)for(const a of e)o<a.length&&(r[s++]=a[o]);return r}function f$(){let e,t=1/0;return{add(n,r){n>=t||(e=r,t=n)},get:()=>e,score:()=>t}}function Z_(e){return Object.freeze({has:t=>e.includes(t),decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})},encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(u$(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})}})}function e6(e){if(e.length!==32)throw new Error("expects 32 element matrix");const t=[1431655765,858993459,252645135,16711935,65535];for(let n=0;n<5;n++){const r=t[n]>>>0,s=1<<n,o=s<<1;for(let a=0;a<32;a+=o)for(let c=0;c<s;c++){const l=a+c,u=l+s,d=e[l]>>>0,f=e[u]>>>0,h=(d>>>s^f)&r;e[l]=(d^h<<s)>>>0,e[u]=(f^h)>>>0}}}const ol=e=>1<<(e&31)>>>0,Fo=(e,t)=>t===0?0:t===32?4294967295:(1<<t)-1<<e>>>0;class Xt{constructor(t,n){Ds(this,"defined");Ds(this,"value");Ds(this,"tailMask");Ds(this,"words");Ds(this,"fullWords");Ds(this,"height");Ds(this,"width");const{height:r,width:s}=Xt.size(t);if(!Number.isSafeInteger(r)||r<=0)throw new Error(`Bitmap: invalid height=${r}, expected positive safe integer dimension`);if(!Number.isSafeInteger(s)||s<=0)throw new Error(`Bitmap: invalid width=${s}, expected positive safe integer dimension`);if(this.height=r,this.width=s,this.tailMask=Fo(0,s&31||32),this.words=Math.ceil(s/32)|0,this.fullWords=Math.floor(s/32)|0,this.value=new Uint32Array(this.words*r),this.defined=new Uint32Array(this.value.length),n){if(n.length!==r)throw new Error(`Bitmap: data height mismatch: exp=${r} got=${n.length}`);for(let o=0;o<r;o++){const a=n[o];if(!a||a.length!==s)throw new Error(`Bitmap: data width mismatch at y=${o}: exp=${s} got=${a==null?void 0:a.length}`);for(let c=0;c<s;c++)this.set(c,o,a[c])}}}static size(t,n){if(typeof t=="number"&&(t={height:t,width:t}),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: invalid height=${t.height} (${typeof t.height})`);if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: invalid width=${t.width} (${typeof t.width})`);return n!==void 0&&(t={width:Math.min(t.width,n.width),height:Math.min(t.height,n.height)}),t}static fromString(t){t=t.replace(/^\n+/g,"").replace(/\n+$/g,"");const n=t.split(String.fromCharCode(sl.newline)),r=n.length;let s;const o=[];for(const a of n){const c=a.split("").map(l=>{if(l==="X")return!0;if(l===" ")return!1;if(l!=="?")throw new Error(`Bitmap.fromString: unknown symbol=${l}`)});if(s!==void 0&&c.length!==s)throw new Error(`Bitmap.fromString different row sizes: width=${s} cur=${c.length}`);s=c.length,o.push(c)}return s===void 0&&(s=0),new Xt({height:r,width:s},o)}point(t){return this.get(t.x,t.y)}isInside(t){return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height}size(t){if(!t)return{height:this.height,width:this.width};const{x:n,y:r}=this.xy(t);return{height:this.height-r,width:this.width-n}}xy(t){if(typeof t=="number"&&(t={x:t,y:t}),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: invalid x=${t.x}`);if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: invalid y=${t.y}`);return t.x=J_(t.x,this.width),t.y=J_(t.y,this.height),t}wordIndex(t,n){return n*this.words+(t>>>5)}bitIndex(t,n){return{word:this.wordIndex(t,n),bit:t&31}}isDefined(t,n){const r=this.wordIndex(t,n),s=ol(t);return(this.defined[r]&s)!==0}get(t,n){const r=this.wordIndex(t,n),s=ol(t);return(this.value[r]&s)!==0}maskWord(t,n,r){const{defined:s,value:o}=this;s[t]|=n,o[t]=o[t]&~n|-r&n}set(t,n,r){r!==void 0&&this.maskWord(this.wordIndex(t,n),ol(t),r)}fillRectConst(t,n,r,s,o){if(r<=0||s<=0||o===void 0)return;const{value:a,defined:c,words:l}=this,u=t>>>5,d=t+r-1>>>5,f=t&31,h=t+r-1&31;for(let p=0;p<s;p++){const m=(n+p)*l;if(u===d){const g=Fo(f,h-f+1);this.maskWord(m+u,g,o);continue}this.maskWord(m+u,Fo(f,32-f),o);for(let g=u+1;g<d;g++)c[m+g]=4294967295,a[m+g]=o?4294967295:0;this.maskWord(m+d,Fo(0,h+1),o)}}rectWords(t,n,r,s,o){for(let a=0;a<s;a++){const c=n+a;for(let l=0;l<r;){const u=t+l,{bit:d,word:f}=this.bitIndex(u,c),h=Math.min(32-d,r-l);o(f,u,l,a,h),l+=h}}}rect(t,n,r){const{x:s,y:o}=this.xy(t),{height:a,width:c}=Xt.size(n,this.size({x:s,y:o}));if(typeof r!="function")return this.fillRectConst(s,o,c,a,r),this;const{defined:l,value:u}=this;return this.rectWords(s,o,c,a,(d,f,h,p,m)=>{let g=0,_=u[d];for(let b=0;b<m;b++){const y=ol(f+b),v=r({x:h+b,y:p},(_&y)!==0);v!==void 0&&(g|=y,_=_&~y|-v&y)}l[d]|=g,u[d]=_}),this}rectRead(t,n,r){const{x:s,y:o}=this.xy(t),{height:a,width:c}=Xt.size(n,this.size({x:s,y:o})),{value:l}=this;return this.rectWords(s,o,c,a,(u,d,f,h,p)=>{const m=l[u];for(let g=0;g<p;g++){const _=ol(d+g);r({x:f+g,y:h},(m&_)!==0)}}),this}hLine(t,n,r){return this.rect(t,{width:n,height:1},r)}vLine(t,n,r){return this.rect(t,{width:1,height:n},r)}border(t=2,n){if(!Number.isSafeInteger(t)||t<=0)throw new Error(`Bitmap.border: invalid size=${t}`);const r=this.height+2*t,s=this.width+2*t,o=new Xt({height:r,width:s});return o.rect(0,1/0,n),o.embed({x:t,y:t},this),o}embed(t,n){const{x:r,y:s}=this.xy(t),{height:o,width:a}=Xt.size(n.size(),this.size({x:r,y:s}));if(a<=0||o<=0)return this;const{value:c,defined:l}=this,{words:u,value:d}=n;for(let f=0;f<o;f++){const h=f*u;for(let p=0;p<a;){const m=r+p,{word:g,bit:_}=this.bitIndex(m,s+f),{word:b,bit:y}=n.bitIndex(p,f),v=Math.min(32-_,a-p),w=d[b],x=y&&b+1<h+u?d[b+1]:0,A=y?(w>>>y|x<<32-y)>>>0:w,C=Fo(_,v),j=(A&Fo(0,v))<<_>>>0;l[g]|=C,c[g]=c[g]&~C|j,p+=v}}return this}rectSlice(t,n=this.size()){const{x:r,y:s}=this.xy(t),{height:o,width:a}=Xt.size(n,this.size({x:r,y:s})),c=new Xt({height:o,width:a});return this.rectRead({x:r,y:s},{height:o,width:a},(l,u)=>{this.isDefined(r+l.x,s+l.y)&&c.set(l.x,l.y,u)}),c}transpose(){const{height:t,width:n,value:r,defined:s,words:o}=this,a=new Xt({height:n,width:t}),{words:c,value:l,defined:u,tailMask:d}=a,f=new Uint32Array(32),h=new Uint32Array(32);for(let p=0;p<t;p+=32)for(let m=0;m<o;m++){const g=Math.min(32,t-p);for(let _=0;_<g;_++){const b=this.wordIndex(32*m,p+_);f[_]=r[b],h[_]=s[b]}f.fill(0,g),h.fill(0,g),e6(f),e6(h);for(let _=0;_<32;_++){const b=m*32+_;if(b>=n)break;const y=a.wordIndex(p,b),v=p>>>5===c-1?d:4294967295;l[y]=f[_]&v,u[y]=h[_]&v}}return a}negate(){const t=this.defined.length;for(let n=0;n<t;n++)this.value[n]=~this.value[n],this.defined[n]=4294967295;return this}scale(t){if(!Number.isSafeInteger(t)||t>1024)throw new Error(`invalid scale factor: ${t}`);const{height:n,width:r}=this;return new Xt({height:t*n,width:t*r}).rect({x:0,y:0},1/0,({x:o,y:a})=>this.get(o/t|0,a/t|0))}clone(){const t=new Xt(this.size());return t.defined.set(this.defined),t.value.set(this.value),t}assertDrawn(){const{height:t,width:n,defined:r,tailMask:s,fullWords:o,words:a}=this;if(!(!t||!n))for(let c=0;c<t;c++){const l=c*a;for(let u=0;u<o;u++)if(r[l+u]!==4294967295)throw new Error("Invalid color type=undefined");if(a!==o&&(r[l+o]&s)!==s)throw new Error("Invalid color type=undefined")}}countPatternInRow(t,n,...r){if(!Number.isSafeInteger(n)||n<=0||n>=32)throw new Error("wrong patternLen");const s=(1<<n)-1,{height:o,width:a,value:c,words:l}=this;if(!Number.isSafeInteger(t)||t<0||t>=o)return 0;let u=0;const d=this.wordIndex(0,t);for(let f=0,h=0;f<l;f++){const p=c[d+f],m=f===l-1&&a&31||32;for(let g=0;g<m;g++)if(h=(h<<1|p>>>g&1)&s,!(f*32+g+1<n)){for(const _ of r)if(h===_){u++;break}}}return u}getRuns(t,n){const{height:r,width:s,value:o,words:a}=this;if(s===0||!Number.isSafeInteger(t)||t<0||t>=r)return;let c=0,l;const u=this.wordIndex(0,t);for(let d=0;d<a;d++){const f=o[u+d],h=d===a-1&&s&31||32;for(let p=0;p<h;p++){const m=(f&1<<p)!==0;if(m===l){c++;continue}l!==void 0&&n(c,l),l=m,c=1}}l!==void 0&&n(c,l)}popcnt(){const{height:t,width:n,words:r,fullWords:s,tailMask:o}=this;if(!t||!n)return 0;let a=0;for(let c=0;c<t;c++){const l=c*r;for(let u=0;u<s;u++)a+=i1(this.value[l+u]);r!==s&&(a+=i1(this.value[l+s]&o))}return a}countBoxes2x2(t){const{height:n,width:r,words:s}=this;if(r<2||!Number.isSafeInteger(t)||t<0||t+1>=n)return 0;const o=this.wordIndex(0,t),a=this.wordIndex(0,t+1),l=(r&31)===0?2147483647:Fo(0,r-1&31);let u=0;for(let d=0;d<s;d++){const f=this.value[o+d],h=this.value[a+d],p=~(f^h)>>>0,m=d+1<s?this.value[o+d+1]>>>0:0,g=~(f^(f>>>1|(m&1)<<31)>>>0)>>>0,_=d+1<s?this.value[a+d+1]>>>0:0,b=~(h^(h>>>1|(_&1)<<31)>>>0)>>>0;let y=(p&g&b)>>>0;d===s-1&&(y&=l),u+=i1(y)}return u}toString(){const t=String.fromCharCode(sl.newline);let n="";for(let r=0;r<this.height;r++){let s="";for(let o=0;o<this.width;o++){const a=this.get(o,r);s+=this.isDefined(o,r)?a?"X":" ":"?"}n+=s+(r+1===this.height?"":t)}return n}toRaw(){const t=Array.from({length:this.height},()=>new Array(this.width));for(let n=0;n<this.height;n++){const r=t[n];for(let s=0;s<this.width;s++)r[s]=this.get(s,n)}return t}toASCII(){const{height:t,width:n}=this;let r="";for(let s=0;s<t;s+=2){for(let o=0;o<n;o++){const a=this.get(o,s),c=s+1>=t?!0:this.get(o,s+1);!a&&!c?r+="█":!a&&c?r+="▀":a&&!c?r+="▄":a&&c&&(r+=" ")}r+=String.fromCharCode(sl.newline)}return r}toTerm(){const t=String.fromCharCode(sl.reset),n=t+"[0m",r=t+"[1;47m "+n,s=t+"[40m "+n,o=String.fromCharCode(sl.newline);let a="";for(let c=0;c<this.height;c++){for(let l=0;l<this.width;l++){const u=this.get(l,c);a+=u?s:r}a+=o}return a}toSVG(t=!0){let n=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,r="",s;return this.rectRead(0,1/0,(o,a)=>{if(!a)return;const{x:c,y:l}=o;if(!t){n+=`<rect x="${c}" y="${l}" width="1" height="1" />`;return}let u=`M${c} ${l}`;if(s){const f=`m${c-s.x} ${l-s.y}`;f.length<=u.length&&(u=f)}const d=c<10?`H${c}`:"h-1";r+=`${u}h1v1${d}Z`,s=o}),t&&(n+=`<path d="${r}"/>`),n+="</svg>",n}toGIF(){const t=c=>[c&255,c>>>8&255],n=[...t(this.width),...t(this.height)],r=[];this.rectRead(0,1/0,(c,l)=>r.push(+(l===!0)));const s=126,o=[71,73,70,56,55,97,...n,246,0,0,255,255,255,...Br(3*127,0),44,0,0,0,0,...n,0,7],a=Math.floor(r.length/s);for(let c=0;c<a;c++)o.push(s+1,128,...r.slice(s*c,s*(c+1)).map(l=>+l));return o.push(r.length%s+1,128,...r.slice(a*s).map(c=>+c)),o.push(1,129,0,59),new Uint8Array(o)}toImage(t=!1){const{height:n,width:r}=this.size(),s=new Uint8Array(n*r*(t?3:4));let o=0;for(let a=0;a<n;a++)for(let c=0;c<r;c++){const l=this.get(c,a)?0:255;s[o++]=l,s[o++]=l,s[o++]=l,t||(s[o++]=255)}return{height:n,width:r,data:s}}}const t6=Object.freeze(["low","medium","quartile","high"]),n6=Object.freeze(["numeric","alphanumeric","byte","kanji","eci"]),h$=[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],p$={low:[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],medium:[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],quartile:[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],high:[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]},m$={low:[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],medium:[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],quartile:[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],high:[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]},Kt=Object.freeze({size:Object.freeze({encode:e=>21+4*(e-1),decode:e=>(e-17)/4}),sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(e===1)return[];const t=6,n=Kt.size.encode(e)-t-1,r=n-t,s=Math.ceil(r/28);let o=Math.floor(r/s);o%2?o+=1:r%s*2>=s&&(o+=2);const a=[t];for(let c=1;c<s;c++)a.push(n-(s-c)*o);return a.push(n),a},ECCode:Object.freeze({low:1,medium:0,quartile:3,high:2}),formatMask:21522,formatBits(e,t){const n=Kt.ECCode[e]<<3|t;let r=n;for(let s=0;s<10;s++)r=r<<1^(r>>9)*1335;return(n<<10|r)^Kt.formatMask},versionBits(e){let t=e;for(let n=0;n<12;n++)t=t<<1^(t>>11)*7973;return e<<12|t},alphabet:Object.freeze({numeric:Z_("0123456789"),alphanumerc:Z_("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")}),lengthBits(e,t){return{numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[t][Kt.sizeType(e)]},modeBits:Object.freeze({numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"}),capacity(e,t){const n=h$[e-1],r=p$[t][e-1],s=m$[t][e-1],o=Math.floor(n/s)-r,a=s-n%s;return{words:r,numBlocks:s,shortBlocks:a,blockLen:o,capacity:(n-r*s)*8,total:(r+o)*s+s-a}}}),c2=Object.freeze([(e,t)=>(e+t)%2==0,(e,t)=>t%2==0,(e,t)=>e%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0]),fe={tables:(e=>{const t=Br(256,0),n=Br(256,0);for(let r=0,s=1;r<256;r++)t[r]=s,n[s]=r,s<<=1,s&256&&(s^=e);return{exp:t,log:n}})(285),exp:e=>fe.tables.exp[e],log(e){if(e===0)throw new Error(`GF.log: invalid arg=${e}`);return fe.tables.log[e]%255},mul(e,t){return e===0||t===0?0:fe.tables.exp[(fe.tables.log[e]+fe.tables.log[t])%255]},add:(e,t)=>e^t,pow:(e,t)=>fe.tables.exp[fe.tables.log[e]*t%255],inv(e){if(e===0)throw new Error(`GF.inverse: invalid arg=${e}`);return fe.tables.exp[255-fe.tables.log[e]]},polynomial(e){if(e.length==0)throw new Error("GF.polymomial: invalid length");if(e[0]!==0)return e;let t=0;for(;t<e.length-1&&e[t]==0;t++);return e.slice(t)},monomial(e,t){if(e<0)throw new Error(`GF.monomial: invalid degree=${e}`);if(t==0)return[0];let n=Br(e+1,0);return n[0]=t,fe.polynomial(n)},degree:e=>e.length-1,coefficient:(e,t)=>e[fe.degree(e)-t],mulPoly(e,t){if(e[0]===0||t[0]===0)return[0];const n=Br(e.length+t.length-1,0);for(let r=0;r<e.length;r++)for(let s=0;s<t.length;s++)n[r+s]=fe.add(n[r+s],fe.mul(e[r],t[s]));return fe.polynomial(n)},mulPolyScalar(e,t){if(t==0)return[0];if(t==1)return e;const n=Br(e.length,0);for(let r=0;r<e.length;r++)n[r]=fe.mul(e[r],t);return fe.polynomial(n)},mulPolyMonomial(e,t,n){if(t<0)throw new Error("GF.mulPolyMonomial: invalid degree");if(n==0)return[0];const r=Br(e.length+t,0);for(let s=0;s<e.length;s++)r[s]=fe.mul(e[s],n);return fe.polynomial(r)},addPoly(e,t){if(e[0]===0)return t;if(t[0]===0)return e;let n=e,r=t;n.length>r.length&&([n,r]=[r,n]);let s=Br(r.length,0),o=r.length-n.length,a=r.slice(0,o);for(let c=0;c<a.length;c++)s[c]=a[c];for(let c=o;c<r.length;c++)s[c]=fe.add(n[c-o],r[c]);return fe.polynomial(s)},remainderPoly(e,t){const n=Array.from(e);for(let r=0;r<e.length-t.length+1;r++){const s=n[r];if(s!==0)for(let o=1;o<t.length;o++)t[o]!==0&&(n[r+o]=fe.add(n[r+o],fe.mul(t[o],s)))}return n.slice(e.length-t.length+1,n.length)},divisorPoly(e){let t=[1];for(let n=0;n<e;n++)t=fe.mulPoly(t,[1,fe.pow(2,n)]);return t},evalPoly(e,t){if(t==0)return fe.coefficient(e,0);let n=e[0];for(let r=1;r<e.length;r++)n=fe.add(fe.mul(t,n),e[r]);return n},euclidian(e,t,n){fe.degree(e)<fe.degree(t)&&([e,t]=[t,e]);let r=e,s=t,o=[0],a=[1];for(;2*fe.degree(s)>=n;){let u=r,d=o;if(r=s,o=a,r[0]===0)throw new Error("rLast[0] === 0");s=u;let f=[0];const h=fe.inv(r[0]);for(;fe.degree(s)>=fe.degree(r)&&s[0]!==0;){const p=fe.degree(s)-fe.degree(r),m=fe.mul(s[0],h);f=fe.addPoly(f,fe.monomial(p,m)),s=fe.addPoly(s,fe.mulPolyMonomial(r,p,m))}if(f=fe.mulPoly(f,o),a=fe.addPoly(f,d),fe.degree(s)>=fe.degree(r))throw new Error(`Division failed r: ${s}, rLast: ${r}`)}const c=fe.coefficient(a,0);if(c==0)throw new Error("sigmaTilde(0) was zero");const l=fe.inv(c);return[fe.mulPolyScalar(a,l),fe.mulPolyScalar(s,l)]}};function g$(e){return{encode(t){const n=fe.divisorPoly(e),r=Array.from(t);return r.push(...n.slice(0,-1).fill(0)),Uint8Array.from(fe.remainderPoly(r,n))},decode(t){const n=t.slice(),r=fe.polynomial(Array.from(t));let s=Br(e,0),o=!1;for(let f=0;f<e;f++){const h=fe.evalPoly(r,fe.exp(f));s[s.length-1-f]=h,h!==0&&(o=!0)}if(!o)return n;s=fe.polynomial(s);const a=fe.monomial(e,1),[c,l]=fe.euclidian(a,s,e),u=Br(fe.degree(c),0);let d=0;for(let f=1;f<256&&d<u.length;f++)fe.evalPoly(c,f)===0&&(u[d++]=fe.inv(f));if(d!==u.length)throw new Error("RS.decode: invalid errors number");for(let f=0;f<u.length;f++){const h=n.length-1-fe.log(u[f]);if(h<0)throw new Error("RS.decode: invalid error location");const p=fe.inv(u[f]);let m=1;for(let g=0;g<u.length;g++)f!==g&&(m=fe.mul(m,fe.add(1,fe.mul(u[g],p))));n[h]=fe.add(n[h],fe.mul(fe.evalPoly(l,p),fe.inv(m)))}return n}}}function y$(e,t){const{words:n,shortBlocks:r,numBlocks:s,blockLen:o,total:a}=Kt.capacity(e,t),c=g$(n);return{encode(l){const u=[],d=[];for(let m=0;m<s;m++){const g=m<r,_=o+(g?0:1);u.push(l.subarray(0,_)),d.push(c.encode(l.subarray(0,_))),l=l.subarray(_)}const f=X_(u),h=X_(d),p=new Uint8Array(f.length+h.length);return p.set(f),p.set(h,f.length),p},decode(l){if(l.length!==a)throw new Error(`interleave.decode: len(data)=${l.length}, total=${a}`);const u=[];for(let h=0;h<s;h++){const p=h<r;u.push(new Uint8Array(n+o+(p?0:1)))}let d=0;for(let h=0;h<o;h++)for(let p=0;p<s;p++)u[p][h]=l[d++];for(let h=r;h<s;h++)u[h][o]=l[d++];for(let h=o;h<o+n;h++)for(let p=0;p<s;p++){const m=p<r;u[p][h+(m?0:1)]=l[d++]}const f=[];for(const h of u)f.push(...Array.from(c.decode(h)).slice(0,-n));return Uint8Array.from(f)}}}function b$(e,t,n,r=!1){const s=Kt.size.encode(e);let o=new Xt(s+2);const a=new Xt(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);o=o.embed(0,a).embed({x:-a.width,y:0},a).embed({x:0,y:-a.height},a),o=o.rectSlice(1,s);const c=new Xt(1).rect(0,1,!0).border(1,!1).border(1,!0),l=Kt.alignmentPatterns(e);for(const u of l)for(const d of l)o.isDefined(d,u)||o.embed({x:d-2,y:u-2},c);o=o.hLine({x:0,y:6},1/0,({x:u})=>o.isDefined(u,6)?void 0:u%2==0).vLine({x:6,y:0},1/0,({y:u})=>o.isDefined(6,u)?void 0:u%2==0);{const u=Kt.formatBits(t,n),d=f=>!r&&(u>>f&1)==1;for(let f=0;f<6;f++)o.set(8,f,d(f));for(let f=6;f<8;f++)o.set(8,f+1,d(f));for(let f=8;f<15;f++)o.set(8,s-15+f,d(f));for(let f=0;f<8;f++)o.set(s-f-1,8,d(f));for(let f=8;f<9;f++)o.set(15-f-1+1,8,d(f));for(let f=9;f<15;f++)o.set(15-f-1,8,d(f));o.set(8,s-8,!r)}if(e>=7){const u=Kt.versionBits(e);for(let d=0;d<18;d+=1){const f=!r&&(u>>d&1)==1,h=Math.floor(d/3),p=d%3+s-8-3;o.set(p,h,f),o.set(h,p,f)}}return o}function v$(e,t,n){const r=e,s=r.height,o=c2[t];let a=-1,c=s-1;for(let l=s-1;l>0;l-=2){for(l==6&&(l=5);;c+=a){for(let u=0;u<2;u+=1){const d=l-u;r.isDefined(d,c)||n(d,c,o(d,c))}if(c+a<0||c+a>=s)break}a=-a}}function w$(e){let t="numeric";for(let n of e)if(!Kt.alphabet.numeric.has(n)&&(t="alphanumeric",!Kt.alphabet.alphanumerc.has(n)))return"byte";return t}function _$(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function r6(e,t,n,r,s=_$){let o="",a=n.length;if(r==="numeric"){const h=Kt.alphabet.numeric.decode(n.split("")),p=h.length;for(let m=0;m<p-2;m+=3)o+=Oo(h[m]*100+h[m+1]*10+h[m+2],10);p%3===1?o+=Oo(h[p-1],4):p%3===2&&(o+=Oo(h[p-2]*10+h[p-1],7))}else if(r==="alphanumeric"){const h=Kt.alphabet.alphanumerc.decode(n.split("")),p=h.length;for(let m=0;m<p-1;m+=2)o+=Oo(h[m]*45+h[m+1],11);p%2==1&&(o+=Oo(h[p-1],6))}else if(r==="byte"){const h=s(n);a=h.length,o=Array.from(h).map(p=>Oo(p,8)).join("")}else throw new Error("encode: unsupported type");const{capacity:c}=Kt.capacity(e,t),l=Oo(a,Kt.lengthBits(e,r));let u=Kt.modeBits[r]+l+o;if(u.length>c)throw new Error("Capacity overflow");u+="0".repeat(Math.min(4,Math.max(0,c-u.length))),u.length%8&&(u+="0".repeat(8-u.length%8));const d="1110110000010001";for(let h=0;u.length!==c;h++)u+=d[h%d.length];const f=Uint8Array.from(u.match(/(.{8})/g).map(h=>+`0b${h}`));return y$(e,t).encode(f)}function s6(e,t,n,r,s=!1){const o=b$(e,t,r,s);let a=0;const c=8*n.length;if(v$(o,r,(l,u,d)=>{let f=!1;a<c&&(f=(n[a>>>3]>>(7-a&7)&1)!==0,a++),o.set(l,u,f!==d)}),a!==c)throw new Error("QR: bytes left after draw");return o}const g8=e=>{const t=e.map(n=>n?"1":"0").join("");return{len:t.length,n:+`0b${t}`}},y8=[!0,!1,!0,!0,!0,!1,!0],b8=[!1,!1,!1,!1],sf=g8([...y8,...b8]),o6=g8([...b8,...y8]);function x$(e){const t=e,{width:n,height:r}=t,s=t.transpose();let o=0;for(let h=0;h<r;h++)t.getRuns(h,p=>{p>=5&&(o+=3+(p-5))});for(let h=0;h<n;h++)s.getRuns(h,p=>{p>=5&&(o+=3+(p-5))});let a=0;for(let h=0;h<r-1;h++)a+=3*t.countBoxes2x2(h);let c=0;for(let h=0;h<r;h++)c+=40*t.countPatternInRow(h,sf.len,sf.n,o6.n);for(let h=0;h<n;h++)c+=40*s.countPatternInRow(h,sf.len,sf.n,o6.n);const l=r*n,u=t.popcnt(),f=10*Math.ceil(Math.max(0,Math.abs(u*100-l*50)-l*5)/(l*5));return o+a+c+f}function k$(e,t,n,r){if(r===void 0){const s=f$();for(let o=0;o<c2.length;o++)s.add(x$(s6(e,t,n,o,!0)),o);r=s.get()}if(r===void 0)throw new Error("Cannot find mask");return s6(e,t,n,r)}function C$(e){if(!t6.includes(e))throw new Error(`Invalid error correction mode=${e}. Expected: ${t6}`)}function j$(e){if(!n6.includes(e))throw new Error(`Encoding: invalid mode=${e}. Expected: ${n6}`);if(e==="kanji"||e==="eci")throw new Error(`Encoding: ${e} is not supported (yet?).`)}function S$(e){if(![0,1,2,3,4,5,6,7].includes(e)||!c2[e])throw new Error(`Invalid mask=${e}. Expected number [0..7]`)}function A$(e,t="raw",n={}){const r=n,s=r.ecc!==void 0?r.ecc:"medium";C$(s);const o=r.encoding!==void 0?r.encoding:w$(e);j$(o),r.mask!==void 0&&S$(r.mask);let a=r.version,c,l=new Error("Unknown error");if(a!==void 0)d$(a),c=r6(a,s,e,o,r.textEncoder);else for(let f=1;f<=40;f++)try{c=r6(f,s,e,o,r.textEncoder),a=f;break}catch(h){l=h}if(!a||!c)throw l;let u=k$(a,s,c,r.mask);u.assertDrawn();const d=r.border===void 0?2:r.border;if(!Number.isSafeInteger(d)||d<=0)throw new Error(`invalid border=${d}`);if(u=u.border(d,!1),r.scale!==void 0&&(u=u.scale(r.scale)),t==="raw")return u.toRaw();if(t==="ascii")return u.toASCII();if(t==="svg")return u.toSVG(r.optimize);if(t==="gif")return u.toGIF();if(t==="term")return u.toTerm();throw new Error(`Unknown output: ${t}`)}function E$(e,t={}){const{errorCorrection:n,version:r}=t,s=A$(e,"raw",{border:0,ecc:n,scale:1,version:r});return{edgeLength:s.length,finderLength:7,grid:s,value:e}}function Or(e){const{arena:t,...n}=e;return i.jsxs(Or.Root,{...n,children:[i.jsx(Or.Finder,{}),i.jsx(Or.Cells,{}),t&&i.jsx(Or.Arena,{children:typeof t=="string"?i.jsx("img",{alt:"Arena",src:t,style:{borderRadius:1,height:"100%",objectFit:"cover",width:"100%"}}):t})]})}(function(e){e.Context=S.createContext(null);function t(o){const{children:a,size:c="100%",value:l,version:u,errorCorrection:d,...f}=o,h=S.useMemo(()=>(S.Children.map(a,v=>!S.isValidElement(v)||typeof v.type=="string"?null:"displayName"in v.type&&v.type.displayName==="Arena"?!0:null)??[]).some(Boolean),[a]),p=S.useMemo(()=>{let v=d;return h&&d==="low"&&(v="medium"),E$(l,{errorCorrection:v,version:u})},[l,h,d,u]),m=1,g=p.edgeLength*m,_=p.finderLength*m/2,b=h?Math.floor(g/4):0,y=S.useMemo(()=>({arenaSize:b,cellSize:m,edgeSize:g,qrcode:p,finderSize:_}),[b,g,p,_]);return i.jsx(e.Context.Provider,{value:y,children:i.jsxs("svg",{...f,width:c,height:c,viewBox:`0 0 ${g} ${g}`,xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("title",{children:"QR Code"}),a]})})}e.Root=t,function(o){o.displayName="Root"}(t=e.Root||(e.Root={}));function n(o){const{className:a,fill:c,innerClassName:l,radius:u=.25}=o,{cellSize:d,edgeSize:f,finderSize:h}=S.useContext(e.Context);function p({position:m}){let g=h-(h-d)-d/2;m==="top-right"&&(g=f-h-(h-d)-d/2);let _=h-(h-d)-d/2;m==="bottom-left"&&(_=f-h-(h-d)-d/2);let b=h-d*1.5;m==="top-right"&&(b=f-h-d*1.5);let y=h-d*1.5;return m==="bottom-left"&&(y=f-h-d*1.5),i.jsxs(i.Fragment,{children:[i.jsx("rect",{className:a,stroke:c??"currentColor",fill:"transparent",x:g,y:_,width:d+(h-d)*2,height:d+(h-d)*2,rx:2*u*(h-d),ry:2*u*(h-d),strokeWidth:d}),i.jsx("rect",{className:l,fill:c??"currentColor",x:b,y,width:d*3,height:d*3,rx:2*u*d,ry:2*u*d})]})}return i.jsxs(i.Fragment,{children:[i.jsx(p,{position:"top-left"}),i.jsx(p,{position:"top-right"}),i.jsx(p,{position:"bottom-left"})]})}e.Finder=n,function(o){o.displayName="Finder"}(n=e.Finder||(e.Finder={}));function r(o){const{className:a,fill:c="currentColor",inset:l=!0,radius:u=1}=o,{arenaSize:d,cellSize:f,qrcode:h}=S.useContext(e.Context),{edgeLength:p,finderLength:m}=h,g=S.useMemo(()=>{let _="";for(let b=0;b<h.grid.length;b++){const y=h.grid[b];if(y)for(let v=0;v<y.length;v++){if(!y[v])continue;const x=p/2-d/2,A=x+d;if(b>=x&&b<=A&&v>=x&&v<=A)continue;const C=b<m&&v<m,j=b<m&&v>=p-m,E=b>=p-m&&v<m;if(C||j||E)continue;const I=l?f*.1:0,T=(f-I*2)/2,O=v*f+f/2,B=b*f+f/2,U=O-T,L=O+T,N=B-T,H=B+T,M=u*T;_+=[`M ${U+M},${N}`,`L ${L-M},${N}`,`A ${M},${M} 0 0,1 ${L},${N+M}`,`L ${L},${H-M}`,`A ${M},${M} 0 0,1 ${L-M},${H}`,`L ${U+M},${H}`,`A ${M},${M} 0 0,1 ${U},${H-M}`,`L ${U},${N+M}`,`A ${M},${M} 0 0,1 ${U+M},${N}`,"z"].join(" ")}}return _},[d,f,p,m,h.grid,l,u]);return i.jsx("path",{className:a,d:g,fill:c})}e.Cells=r,function(o){o.displayName="Cells"}(r=e.Cells||(e.Cells={}));function s(o){const{children:a}=o,{arenaSize:c,cellSize:l,edgeSize:u}=S.useContext(e.Context),d=Math.ceil(u/2-c/2),f=c+c%2,h=l/2;return i.jsx("foreignObject",{x:d,y:d,width:f,height:f,children:i.jsx("div",{style:{alignItems:"center",display:"flex",fontSize:1,justifyContent:"center",height:"100%",overflow:"hidden",width:"100%",padding:h,boxSizing:"border-box"},children:a})})}e.Arena=s,function(o){o.displayName="Arena"}(s=e.Arena||(e.Arena={}))})(Or||(Or={}));function N$(e={}){let t,n,r,s;return o=>({id:"baseAccount",name:"Base Account",rdns:"app.base.account",type:"baseAccount",async connect({chainId:a,withCapabilities:c,...l}={}){var u;try{const d=await this.getProvider(),f=a??((u=o.chains[0])==null?void 0:u.id);if(!f)throw new Ns;const h=await d.request({method:"wallet_connect",params:[{capabilities:"capabilities"in l&&l.capabilities?l.capabilities:{},chainIds:[te(f),...o.chains.filter(g=>g.id!==f).map(g=>te(g.id))]}]}),p=h.accounts.map(g=>({address:Ge(g.address),capabilities:g.capabilities??{}}));let m=Number(h.chainIds[0]);if(n||(n=this.onAccountsChanged.bind(this),d.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),d.on("chainChanged",r)),s||(s=this.onDisconnect.bind(this),d.on("disconnect",s)),a&&m!==a){const g=await this.switchChain({chainId:a}).catch(_=>{if(_.code===Re.code)throw _;return{id:m}});m=(g==null?void 0:g.id)??m}return{accounts:c?p:p.map(g=>g.address),chainId:m}}catch(d){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(d.message)?new Re(d):d}},async disconnect(){const a=await this.getProvider();n&&(a.removeListener("accountsChanged",n),n=void 0),r&&(a.removeListener("chainChanged",r),r=void 0),s&&(a.removeListener("disconnect",s),s=void 0),a.disconnect()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(c=>Ge(c))},async getChainId(){const c=await(await this.getProvider()).request({method:"eth_chainId"});return Number(c)},async getProvider(){if(!t){const a=(()=>{var u;return typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:((u=e.preference)==null?void 0:u.options)??"all"}})(),{createBaseAccountSDK:c}=await ae(async()=>{const{createBaseAccountSDK:u}=await import("./index-CqeISmow.js");return{createBaseAccountSDK:u}},__vite__mapDeps([0,1]));t=c({...e,appChainIds:o.chains.map(u=>u.id),preference:a}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:c}){var d,f,h,p;const l=o.chains.find(m=>m.id===c);if(!l)throw new jn(new Ns);const u=await this.getProvider();try{return await u.request({method:"wallet_switchEthereumChain",params:[{chainId:te(l.id)}]}),l}catch(m){if(m.code===4902)try{let g;a!=null&&a.blockExplorerUrls?g=a.blockExplorerUrls:g=(d=l.blockExplorers)!=null&&d.default.url?[(f=l.blockExplorers)==null?void 0:f.default.url]:[];let _;(h=a==null?void 0:a.rpcUrls)!=null&&h.length?_=a.rpcUrls:_=[((p=l.rpcUrls.default)==null?void 0:p.http[0])??""];const b={blockExplorerUrls:g,chainId:te(c),chainName:(a==null?void 0:a.chainName)??l.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??l.nativeCurrency,rpcUrls:_};return await u.request({method:"wallet_addEthereumChain",params:[b]}),l}catch(g){throw new Re(g)}throw new jn(m)}},onAccountsChanged(a){a.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:a.map(c=>Ge(c))})},onChainChanged(a){const c=Number(a);o.emitter.emit("change",{chainId:c})},async onDisconnect(a){o.emitter.emit("disconnect");const c=await this.getProvider();n&&(c.removeListener("accountsChanged",n),n=void 0),r&&(c.removeListener("chainChanged",r),r=void 0),s&&(c.removeListener("disconnect",s),s=void 0)}})}l2.type="metaMask";function l2(e={}){let t,n,r,s,o,a,c,l;return u=>({id:"metaMaskSDK",name:"MetaMask",rdns:["io.metamask","io.metamask.mobile"],type:l2.type,async setup(){const d=await this.getProvider();d!=null&&d.on&&(a||(a=this.onConnect.bind(this),d.on("connect",a)),s||(s=this.onAccountsChanged.bind(this),d.on("accountsChanged",s)))},async connect({chainId:d,isReconnecting:f,withCapabilities:h}={}){const p=await this.getProvider();c||(c=this.onDisplayUri,p.on("display_uri",c));let m=[];f&&(m=await this.getAccounts().catch(()=>[]));try{let g,_;m!=null&&m.length||(e.connectAndSign||e.connectWith?(e.connectAndSign?g=await t.connectAndSign({msg:e.connectAndSign}):e.connectWith&&(_=await t.connectWith({method:e.connectWith.method,params:e.connectWith.params})),m=await this.getAccounts()):m=(await t.connect()).map(v=>Ge(v)));let b=await this.getChainId();if(d&&b!==d){const y=await this.switchChain({chainId:d}).catch(v=>{if(v.code===Re.code)throw v;return{id:b}});b=(y==null?void 0:y.id)??b}return c&&(p.removeListener("display_uri",c),c=void 0),g?p.emit("connectAndSign",{accounts:m,chainId:b,signResponse:g}):_&&p.emit("connectWith",{accounts:m,chainId:b,connectWithResponse:_}),a&&(p.removeListener("connect",a),a=void 0),s||(s=this.onAccountsChanged.bind(this),p.on("accountsChanged",s)),o||(o=this.onChainChanged.bind(this),p.on("chainChanged",o)),l||(l=this.onDisconnect.bind(this),p.on("disconnect",l)),{accounts:h?m.map(y=>({address:y,capabilities:{}})):m,chainId:b}}catch(g){const _=g;throw _.code===Re.code?new Re(_):_.code===qr.code?new qr(_):_}},async disconnect(){const d=await this.getProvider();o&&(d.removeListener("chainChanged",o),o=void 0),l&&(d.removeListener("disconnect",l),l=void 0),a||(a=this.onConnect.bind(this),d.on("connect",a)),await t.terminate()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(h=>Ge(h))},async getChainId(){const d=await this.getProvider(),f=d.getChainId()||await(d==null?void 0:d.request({method:"eth_chainId"}));return Number(f)},async getProvider(){async function d(){var g,_,b,y,v;const f=await(async()=>{const{default:w}=await ae(async()=>{const{default:x}=await import("./metamask-sdk-CmHF3TFo.js");return{default:x}},[]);return typeof w!="function"&&typeof w.default=="function"?w.default:w})(),h={};for(const w of u.chains)h[te(w.id)]=(g=dj({chain:w,transports:u.transports}))==null?void 0:g[0];t=new f({_source:"wagmi",forceDeleteProvider:!1,forceInjectProvider:!1,injectProvider:!1,...e,readonlyRPCMap:h,dappMetadata:{...e.dappMetadata,name:(_=e.dappMetadata)!=null&&_.name?(b=e.dappMetadata)==null?void 0:b.name:"wagmi",url:(y=e.dappMetadata)!=null&&y.url?(v=e.dappMetadata)==null?void 0:v.url:typeof window<"u"?window.location.origin:"https://wagmi.sh"},useDeeplink:e.useDeeplink??!0});const p=await t.init(),m=p!=null&&p.activeProvider?p.activeProvider:t.getProvider();if(!m)throw new Pn;return m}return n||(r||(r=d()),n=await r),n},async isAuthorized(){try{return!!(await mc(()=>sd(()=>this.getAccounts(),{timeout:200}),{delay:201,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:d,chainId:f}){var _,b;const h=await this.getProvider(),p=u.chains.find(y=>y.id===f);if(!p)throw new jn(new Ns);try{return await h.request({method:"wallet_switchEthereumChain",params:[{chainId:te(f)}]}),await m(),await g(f),p}catch(y){const v=y;if(v.code===Re.code)throw new Re(v);if(v.code===4902||((b=(_=v==null?void 0:v.data)==null?void 0:_.originalError)==null?void 0:b.code)===4902)try{return await h.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:(()=>{const{default:w,...x}=p.blockExplorers??{};if(d!=null&&d.blockExplorerUrls)return d.blockExplorerUrls;if(w)return[w.url,...Object.values(x).map(A=>A.url)]})(),chainId:te(f),chainName:(d==null?void 0:d.chainName)??p.name,iconUrls:d==null?void 0:d.iconUrls,nativeCurrency:(d==null?void 0:d.nativeCurrency)??p.nativeCurrency,rpcUrls:(()=>{var w,x;return(w=d==null?void 0:d.rpcUrls)!=null&&w.length?d.rpcUrls:[((x=p.rpcUrls.default)==null?void 0:x.http[0])??""]})()}]}),await m(),await g(f),p}catch(w){const x=w;throw x.code===Re.code?new Re(x):new jn(x)}throw new jn(v)}async function m(){await mc(async()=>{const y=tr(await h.request({method:"eth_chainId"}));if(y!==f)throw new Error("User rejected switch after adding network.");return y},{delay:50,retryCount:20})}async function g(y){await new Promise(v=>{const w=x=>{"chainId"in x&&x.chainId===y&&(u.emitter.off("change",w),v())};u.emitter.on("change",w),u.emitter.emit("change",{chainId:y})})}},async onAccountsChanged(d){if(d.length===0)if(t.isExtensionActive())this.onDisconnect();else return;else if(u.emitter.listenerCount("connect")){const f=(await this.getChainId()).toString();this.onConnect({chainId:f})}else u.emitter.emit("change",{accounts:d.map(f=>Ge(f))})},onChainChanged(d){const f=Number(d);u.emitter.emit("change",{chainId:f})},async onConnect(d){const f=await this.getAccounts();if(f.length===0)return;const h=Number(d.chainId);u.emitter.emit("connect",{accounts:f,chainId:h});const p=await this.getProvider();a&&(p.removeListener("connect",a),a=void 0),s||(s=this.onAccountsChanged.bind(this),p.on("accountsChanged",s)),o||(o=this.onChainChanged.bind(this),p.on("chainChanged",o)),l||(l=this.onDisconnect.bind(this),p.on("disconnect",l))},async onDisconnect(d){const f=await this.getProvider();d&&d.code===1013&&f&&(await this.getAccounts()).length||(u.emitter.emit("disconnect"),o&&(f.removeListener("chainChanged",o),o=void 0),l&&(f.removeListener("disconnect",l),l=void 0),a||(a=this.onConnect.bind(this),f.on("connect",a)))},onDisplayUri(d){u.emitter.emit("message",{type:"display_uri",data:d})}})}u2.type="safe";function u2(e={}){const{shimDisconnect:t=!1}=e;let n,r;return s=>({id:"safe",name:"Safe",type:u2.type,async connect({withCapabilities:o}={}){var u;const a=await this.getProvider();if(!a)throw new Pn;const c=await this.getAccounts(),l=await this.getChainId();return r||(r=this.onDisconnect.bind(this),a.on("disconnect",r)),t&&await((u=s.storage)==null?void 0:u.removeItem("safe.disconnected")),{accounts:o?c.map(d=>({address:d,capabilities:{}})):c,chainId:l}},async disconnect(){var a;const o=await this.getProvider();if(!o)throw new Pn;r&&(o.removeListener("disconnect",r),r=void 0),t&&await((a=s.storage)==null?void 0:a.setItem("safe.disconnected",!0))},async getAccounts(){const o=await this.getProvider();if(!o)throw new Pn;return(await o.request({method:"eth_accounts"})).map(Ge)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!n){const{default:a}=await ae(async()=>{const{default:d}=await import("./index-BkS9kyuf.js");return{default:d}},__vite__mapDeps([2,3])),c=new a(e),l=await sd(()=>c.safe.getInfo(),{timeout:e.unstable_getInfoTimeout??10});if(!l)throw new Error("Could not load Safe information");const u=await(async()=>{const d=await ae(()=>import("./index-DxcSXSQt.js").then(f=>f.i),__vite__mapDeps([4,3,1,5,6,7]));return typeof d.SafeAppProvider!="function"&&typeof d.default.SafeAppProvider=="function"?d.default.SafeAppProvider:d.SafeAppProvider})();n=new u(l,c)}return n}},async getChainId(){const o=await this.getProvider();if(!o)throw new Pn;return Number(o.chainId)},async isAuthorized(){var o;try{return t&&await((o=s.storage)==null?void 0:o.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){s.emitter.emit("disconnect")}})}d2.type="walletConnect";function d2(e){const t=e.isNewChainsStale??!0;let n,r;const s="eip155";let o,a,c,l,u,d;return f=>({id:"walletConnect",name:"WalletConnect",type:d2.type,async setup(){const h=await this.getProvider().catch(()=>null);h&&(c||(c=this.onConnect.bind(this),h.on("connect",c)),u||(u=this.onSessionDelete.bind(this),h.on("session_delete",u)))},async connect({chainId:h,withCapabilities:p,...m}={}){var g,_;try{const b=await this.getProvider();if(!b)throw new Pn;l||(l=this.onDisplayUri,b.on("display_uri",l));let y=h;if(!y){const A=await((g=f.storage)==null?void 0:g.getItem("state"))??{};f.chains.some(j=>j.id===A.chainId)?y=A.chainId:y=(_=f.chains[0])==null?void 0:_.id}if(!y)throw new Error("No chains found on connector.");const v=await this.isChainsStale();if(b.session&&v&&await b.disconnect(),!b.session||v){const A=f.chains.filter(C=>C.id!==y).map(C=>C.id);await b.connect({optionalChains:[y,...A],..."pairingTopic"in m?{pairingTopic:m.pairingTopic}:{}}),this.setRequestedChainsIds(f.chains.map(C=>C.id))}const w=(await b.enable()).map(A=>Ge(A));let x=await this.getChainId();if(h&&x!==h){const A=await this.switchChain({chainId:h}).catch(C=>{var j;if(C.code===Re.code&&((j=C.cause)==null?void 0:j.message)!=="Missing or invalid. request() method: wallet_addEthereumChain")throw C;return{id:x}});x=(A==null?void 0:A.id)??x}return l&&(b.removeListener("display_uri",l),l=void 0),c&&(b.removeListener("connect",c),c=void 0),o||(o=this.onAccountsChanged.bind(this),b.on("accountsChanged",o)),a||(a=this.onChainChanged.bind(this),b.on("chainChanged",a)),d||(d=this.onDisconnect.bind(this),b.on("disconnect",d)),u||(u=this.onSessionDelete.bind(this),b.on("session_delete",u)),{accounts:p?w.map(A=>({address:A,capabilities:{}})):w,chainId:x}}catch(b){throw/(user rejected|connection request reset)/i.test(b==null?void 0:b.message)?new Re(b):b}},async disconnect(){const h=await this.getProvider();try{await(h==null?void 0:h.disconnect())}catch(p){if(!/No matching key/i.test(p.message))throw p}finally{a&&(h==null||h.removeListener("chainChanged",a),a=void 0),d&&(h==null||h.removeListener("disconnect",d),d=void 0),c||(c=this.onConnect.bind(this),h==null||h.on("connect",c)),o&&(h==null||h.removeListener("accountsChanged",o),o=void 0),u&&(h==null||h.removeListener("session_delete",u),u=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(p=>Ge(p))},async getProvider({chainId:h}={}){var m;async function p(){const g=f.chains.map(b=>b.id);if(!g.length)return;const{EthereumProvider:_}=await ae(async()=>{const{EthereumProvider:b}=await import("./index.es-CdKoInzi.js").then(y=>y.y);return{EthereumProvider:b}},__vite__mapDeps([8,7]));return await _.init({...e,disableProviderPing:!0,optionalChains:g,projectId:e.projectId,rpcMap:Object.fromEntries(f.chains.map(b=>{const[y]=dj({chain:b,transports:f.transports});return[b.id,y]})),showQrModal:e.showQrModal??!0})}return n||(r||(r=p()),n=await r,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY)),h&&await((m=this.switchChain)==null?void 0:m.call(this,{chainId:h})),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[h,p]=await Promise.all([this.getAccounts(),this.getProvider()]);return h.length?await this.isChainsStale()&&p.session?(await p.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:h,chainId:p}){var _,b,y;const m=await this.getProvider();if(!m)throw new Pn;const g=f.chains.find(v=>v.id===p);if(!g)throw new jn(new Ns);try{await Promise.all([new Promise(w=>{const x=({chainId:A})=>{A===p&&(f.emitter.off("change",x),w())};f.emitter.on("change",x)}),m.request({method:"wallet_switchEthereumChain",params:[{chainId:te(p)}]})]);const v=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...v,p]),g}catch(v){const w=v;if(/(user rejected)/i.test(w.message))throw new Re(w);try{let x;h!=null&&h.blockExplorerUrls?x=h.blockExplorerUrls:x=(_=g.blockExplorers)!=null&&_.default.url?[(b=g.blockExplorers)==null?void 0:b.default.url]:[];let A;(y=h==null?void 0:h.rpcUrls)!=null&&y.length?A=h.rpcUrls:A=[...g.rpcUrls.default.http];const C={blockExplorerUrls:x,chainId:te(p),chainName:(h==null?void 0:h.chainName)??g.name,iconUrls:h==null?void 0:h.iconUrls,nativeCurrency:(h==null?void 0:h.nativeCurrency)??g.nativeCurrency,rpcUrls:A};await m.request({method:"wallet_addEthereumChain",params:[C]});const j=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...j,p]),g}catch(x){throw new Re(x)}}},onAccountsChanged(h){h.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:h.map(p=>Ge(p))})},onChainChanged(h){const p=Number(h);f.emitter.emit("change",{chainId:p})},async onConnect(h){const p=Number(h.chainId),m=await this.getAccounts();f.emitter.emit("connect",{accounts:m,chainId:p})},async onDisconnect(h){this.setRequestedChainsIds([]),f.emitter.emit("disconnect");const p=await this.getProvider();o&&(p.removeListener("accountsChanged",o),o=void 0),a&&(p.removeListener("chainChanged",a),a=void 0),d&&(p.removeListener("disconnect",d),d=void 0),u&&(p.removeListener("session_delete",u),u=void 0),c||(c=this.onConnect.bind(this),p.on("connect",c))},onDisplayUri(h){f.emitter.emit("message",{type:"display_uri",data:h})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var p,m,g;return n?((g=(m=(p=n.session)==null?void 0:p.namespaces[s])==null?void 0:m.accounts)==null?void 0:g.map(_=>Number.parseInt(_.split(":")[1]||"",10)))??[]:[]},async getRequestedChainsIds(){var h;return await((h=f.storage)==null?void 0:h.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!t)return!1;const h=f.chains.map(g=>g.id),p=this.getNamespaceChainsIds();if(p.length&&!p.some(g=>h.includes(g)))return!1;const m=await this.getRequestedChainsIds();return!h.every(g=>m.includes(g))},async setRequestedChainsIds(h){var p;await((p=f.storage)==null?void 0:p.setItem(this.requestedChainsStorageKey,h))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var Sh={},I$=768,Za=K9({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),v8=dk({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),Ug=eE({conditions:{defaultCondition:"base",conditionNames:["base","hover","active"],responsiveArray:void 0},styles:{background:{values:{accentColor:{conditions:{base:"ju367v9i",hover:"ju367v9j",active:"ju367v9k"},defaultClass:"ju367v9i"},accentColorForeground:{conditions:{base:"ju367v9l",hover:"ju367v9m",active:"ju367v9n"},defaultClass:"ju367v9l"},actionButtonBorder:{conditions:{base:"ju367v9o",hover:"ju367v9p",active:"ju367v9q"},defaultClass:"ju367v9o"},actionButtonBorderMobile:{conditions:{base:"ju367v9r",hover:"ju367v9s",active:"ju367v9t"},defaultClass:"ju367v9r"},actionButtonSecondaryBackground:{conditions:{base:"ju367v9u",hover:"ju367v9v",active:"ju367v9w"},defaultClass:"ju367v9u"},closeButton:{conditions:{base:"ju367v9x",hover:"ju367v9y",active:"ju367v9z"},defaultClass:"ju367v9x"},closeButtonBackground:{conditions:{base:"ju367va0",hover:"ju367va1",active:"ju367va2"},defaultClass:"ju367va0"},connectButtonBackground:{conditions:{base:"ju367va3",hover:"ju367va4",active:"ju367va5"},defaultClass:"ju367va3"},connectButtonBackgroundError:{conditions:{base:"ju367va6",hover:"ju367va7",active:"ju367va8"},defaultClass:"ju367va6"},connectButtonInnerBackground:{conditions:{base:"ju367va9",hover:"ju367vaa",active:"ju367vab"},defaultClass:"ju367va9"},connectButtonText:{conditions:{base:"ju367vac",hover:"ju367vad",active:"ju367vae"},defaultClass:"ju367vac"},connectButtonTextError:{conditions:{base:"ju367vaf",hover:"ju367vag",active:"ju367vah"},defaultClass:"ju367vaf"},connectionIndicator:{conditions:{base:"ju367vai",hover:"ju367vaj",active:"ju367vak"},defaultClass:"ju367vai"},downloadBottomCardBackground:{conditions:{base:"ju367val",hover:"ju367vam",active:"ju367van"},defaultClass:"ju367val"},downloadTopCardBackground:{conditions:{base:"ju367vao",hover:"ju367vap",active:"ju367vaq"},defaultClass:"ju367vao"},error:{conditions:{base:"ju367var",hover:"ju367vas",active:"ju367vat"},defaultClass:"ju367var"},generalBorder:{conditions:{base:"ju367vau",hover:"ju367vav",active:"ju367vaw"},defaultClass:"ju367vau"},generalBorderDim:{conditions:{base:"ju367vax",hover:"ju367vay",active:"ju367vaz"},defaultClass:"ju367vax"},menuItemBackground:{conditions:{base:"ju367vb0",hover:"ju367vb1",active:"ju367vb2"},defaultClass:"ju367vb0"},modalBackdrop:{conditions:{base:"ju367vb3",hover:"ju367vb4",active:"ju367vb5"},defaultClass:"ju367vb3"},modalBackground:{conditions:{base:"ju367vb6",hover:"ju367vb7",active:"ju367vb8"},defaultClass:"ju367vb6"},modalBorder:{conditions:{base:"ju367vb9",hover:"ju367vba",active:"ju367vbb"},defaultClass:"ju367vb9"},modalText:{conditions:{base:"ju367vbc",hover:"ju367vbd",active:"ju367vbe"},defaultClass:"ju367vbc"},modalTextDim:{conditions:{base:"ju367vbf",hover:"ju367vbg",active:"ju367vbh"},defaultClass:"ju367vbf"},modalTextSecondary:{conditions:{base:"ju367vbi",hover:"ju367vbj",active:"ju367vbk"},defaultClass:"ju367vbi"},profileAction:{conditions:{base:"ju367vbl",hover:"ju367vbm",active:"ju367vbn"},defaultClass:"ju367vbl"},profileActionHover:{conditions:{base:"ju367vbo",hover:"ju367vbp",active:"ju367vbq"},defaultClass:"ju367vbo"},profileForeground:{conditions:{base:"ju367vbr",hover:"ju367vbs",active:"ju367vbt"},defaultClass:"ju367vbr"},selectedOptionBorder:{conditions:{base:"ju367vbu",hover:"ju367vbv",active:"ju367vbw"},defaultClass:"ju367vbu"},standby:{conditions:{base:"ju367vbx",hover:"ju367vby",active:"ju367vbz"},defaultClass:"ju367vbx"}}},borderColor:{values:{accentColor:{conditions:{base:"ju367vc0",hover:"ju367vc1",active:"ju367vc2"},defaultClass:"ju367vc0"},accentColorForeground:{conditions:{base:"ju367vc3",hover:"ju367vc4",active:"ju367vc5"},defaultClass:"ju367vc3"},actionButtonBorder:{conditions:{base:"ju367vc6",hover:"ju367vc7",active:"ju367vc8"},defaultClass:"ju367vc6"},actionButtonBorderMobile:{conditions:{base:"ju367vc9",hover:"ju367vca",active:"ju367vcb"},defaultClass:"ju367vc9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vcc",hover:"ju367vcd",active:"ju367vce"},defaultClass:"ju367vcc"},closeButton:{conditions:{base:"ju367vcf",hover:"ju367vcg",active:"ju367vch"},defaultClass:"ju367vcf"},closeButtonBackground:{conditions:{base:"ju367vci",hover:"ju367vcj",active:"ju367vck"},defaultClass:"ju367vci"},connectButtonBackground:{conditions:{base:"ju367vcl",hover:"ju367vcm",active:"ju367vcn"},defaultClass:"ju367vcl"},connectButtonBackgroundError:{conditions:{base:"ju367vco",hover:"ju367vcp",active:"ju367vcq"},defaultClass:"ju367vco"},connectButtonInnerBackground:{conditions:{base:"ju367vcr",hover:"ju367vcs",active:"ju367vct"},defaultClass:"ju367vcr"},connectButtonText:{conditions:{base:"ju367vcu",hover:"ju367vcv",active:"ju367vcw"},defaultClass:"ju367vcu"},connectButtonTextError:{conditions:{base:"ju367vcx",hover:"ju367vcy",active:"ju367vcz"},defaultClass:"ju367vcx"},connectionIndicator:{conditions:{base:"ju367vd0",hover:"ju367vd1",active:"ju367vd2"},defaultClass:"ju367vd0"},downloadBottomCardBackground:{conditions:{base:"ju367vd3",hover:"ju367vd4",active:"ju367vd5"},defaultClass:"ju367vd3"},downloadTopCardBackground:{conditions:{base:"ju367vd6",hover:"ju367vd7",active:"ju367vd8"},defaultClass:"ju367vd6"},error:{conditions:{base:"ju367vd9",hover:"ju367vda",active:"ju367vdb"},defaultClass:"ju367vd9"},generalBorder:{conditions:{base:"ju367vdc",hover:"ju367vdd",active:"ju367vde"},defaultClass:"ju367vdc"},generalBorderDim:{conditions:{base:"ju367vdf",hover:"ju367vdg",active:"ju367vdh"},defaultClass:"ju367vdf"},menuItemBackground:{conditions:{base:"ju367vdi",hover:"ju367vdj",active:"ju367vdk"},defaultClass:"ju367vdi"},modalBackdrop:{conditions:{base:"ju367vdl",hover:"ju367vdm",active:"ju367vdn"},defaultClass:"ju367vdl"},modalBackground:{conditions:{base:"ju367vdo",hover:"ju367vdp",active:"ju367vdq"},defaultClass:"ju367vdo"},modalBorder:{conditions:{base:"ju367vdr",hover:"ju367vds",active:"ju367vdt"},defaultClass:"ju367vdr"},modalText:{conditions:{base:"ju367vdu",hover:"ju367vdv",active:"ju367vdw"},defaultClass:"ju367vdu"},modalTextDim:{conditions:{base:"ju367vdx",hover:"ju367vdy",active:"ju367vdz"},defaultClass:"ju367vdx"},modalTextSecondary:{conditions:{base:"ju367ve0",hover:"ju367ve1",active:"ju367ve2"},defaultClass:"ju367ve0"},profileAction:{conditions:{base:"ju367ve3",hover:"ju367ve4",active:"ju367ve5"},defaultClass:"ju367ve3"},profileActionHover:{conditions:{base:"ju367ve6",hover:"ju367ve7",active:"ju367ve8"},defaultClass:"ju367ve6"},profileForeground:{conditions:{base:"ju367ve9",hover:"ju367vea",active:"ju367veb"},defaultClass:"ju367ve9"},selectedOptionBorder:{conditions:{base:"ju367vec",hover:"ju367ved",active:"ju367vee"},defaultClass:"ju367vec"},standby:{conditions:{base:"ju367vef",hover:"ju367veg",active:"ju367veh"},defaultClass:"ju367vef"}}},boxShadow:{values:{connectButton:{conditions:{base:"ju367vei",hover:"ju367vej",active:"ju367vek"},defaultClass:"ju367vei"},dialog:{conditions:{base:"ju367vel",hover:"ju367vem",active:"ju367ven"},defaultClass:"ju367vel"},profileDetailsAction:{conditions:{base:"ju367veo",hover:"ju367vep",active:"ju367veq"},defaultClass:"ju367veo"},selectedOption:{conditions:{base:"ju367ver",hover:"ju367ves",active:"ju367vet"},defaultClass:"ju367ver"},selectedWallet:{conditions:{base:"ju367veu",hover:"ju367vev",active:"ju367vew"},defaultClass:"ju367veu"},walletLogo:{conditions:{base:"ju367vex",hover:"ju367vey",active:"ju367vez"},defaultClass:"ju367vex"}}},color:{values:{accentColor:{conditions:{base:"ju367vf0",hover:"ju367vf1",active:"ju367vf2"},defaultClass:"ju367vf0"},accentColorForeground:{conditions:{base:"ju367vf3",hover:"ju367vf4",active:"ju367vf5"},defaultClass:"ju367vf3"},actionButtonBorder:{conditions:{base:"ju367vf6",hover:"ju367vf7",active:"ju367vf8"},defaultClass:"ju367vf6"},actionButtonBorderMobile:{conditions:{base:"ju367vf9",hover:"ju367vfa",active:"ju367vfb"},defaultClass:"ju367vf9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vfc",hover:"ju367vfd",active:"ju367vfe"},defaultClass:"ju367vfc"},closeButton:{conditions:{base:"ju367vff",hover:"ju367vfg",active:"ju367vfh"},defaultClass:"ju367vff"},closeButtonBackground:{conditions:{base:"ju367vfi",hover:"ju367vfj",active:"ju367vfk"},defaultClass:"ju367vfi"},connectButtonBackground:{conditions:{base:"ju367vfl",hover:"ju367vfm",active:"ju367vfn"},defaultClass:"ju367vfl"},connectButtonBackgroundError:{conditions:{base:"ju367vfo",hover:"ju367vfp",active:"ju367vfq"},defaultClass:"ju367vfo"},connectButtonInnerBackground:{conditions:{base:"ju367vfr",hover:"ju367vfs",active:"ju367vft"},defaultClass:"ju367vfr"},connectButtonText:{conditions:{base:"ju367vfu",hover:"ju367vfv",active:"ju367vfw"},defaultClass:"ju367vfu"},connectButtonTextError:{conditions:{base:"ju367vfx",hover:"ju367vfy",active:"ju367vfz"},defaultClass:"ju367vfx"},connectionIndicator:{conditions:{base:"ju367vg0",hover:"ju367vg1",active:"ju367vg2"},defaultClass:"ju367vg0"},downloadBottomCardBackground:{conditions:{base:"ju367vg3",hover:"ju367vg4",active:"ju367vg5"},defaultClass:"ju367vg3"},downloadTopCardBackground:{conditions:{base:"ju367vg6",hover:"ju367vg7",active:"ju367vg8"},defaultClass:"ju367vg6"},error:{conditions:{base:"ju367vg9",hover:"ju367vga",active:"ju367vgb"},defaultClass:"ju367vg9"},generalBorder:{conditions:{base:"ju367vgc",hover:"ju367vgd",active:"ju367vge"},defaultClass:"ju367vgc"},generalBorderDim:{conditions:{base:"ju367vgf",hover:"ju367vgg",active:"ju367vgh"},defaultClass:"ju367vgf"},menuItemBackground:{conditions:{base:"ju367vgi",hover:"ju367vgj",active:"ju367vgk"},defaultClass:"ju367vgi"},modalBackdrop:{conditions:{base:"ju367vgl",hover:"ju367vgm",active:"ju367vgn"},defaultClass:"ju367vgl"},modalBackground:{conditions:{base:"ju367vgo",hover:"ju367vgp",active:"ju367vgq"},defaultClass:"ju367vgo"},modalBorder:{conditions:{base:"ju367vgr",hover:"ju367vgs",active:"ju367vgt"},defaultClass:"ju367vgr"},modalText:{conditions:{base:"ju367vgu",hover:"ju367vgv",active:"ju367vgw"},defaultClass:"ju367vgu"},modalTextDim:{conditions:{base:"ju367vgx",hover:"ju367vgy",active:"ju367vgz"},defaultClass:"ju367vgx"},modalTextSecondary:{conditions:{base:"ju367vh0",hover:"ju367vh1",active:"ju367vh2"},defaultClass:"ju367vh0"},profileAction:{conditions:{base:"ju367vh3",hover:"ju367vh4",active:"ju367vh5"},defaultClass:"ju367vh3"},profileActionHover:{conditions:{base:"ju367vh6",hover:"ju367vh7",active:"ju367vh8"},defaultClass:"ju367vh6"},profileForeground:{conditions:{base:"ju367vh9",hover:"ju367vha",active:"ju367vhb"},defaultClass:"ju367vh9"},selectedOptionBorder:{conditions:{base:"ju367vhc",hover:"ju367vhd",active:"ju367vhe"},defaultClass:"ju367vhc"},standby:{conditions:{base:"ju367vhf",hover:"ju367vhg",active:"ju367vhh"},defaultClass:"ju367vhf"}}}}},{conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0},styles:{alignItems:{values:{"flex-start":{conditions:{smallScreen:"ju367v0",largeScreen:"ju367v1"},defaultClass:"ju367v0"},"flex-end":{conditions:{smallScreen:"ju367v2",largeScreen:"ju367v3"},defaultClass:"ju367v2"},center:{conditions:{smallScreen:"ju367v4",largeScreen:"ju367v5"},defaultClass:"ju367v4"}}},display:{values:{none:{conditions:{smallScreen:"ju367v6",largeScreen:"ju367v7"},defaultClass:"ju367v6"},block:{conditions:{smallScreen:"ju367v8",largeScreen:"ju367v9"},defaultClass:"ju367v8"},flex:{conditions:{smallScreen:"ju367va",largeScreen:"ju367vb"},defaultClass:"ju367va"},inline:{conditions:{smallScreen:"ju367vc",largeScreen:"ju367vd"},defaultClass:"ju367vc"}}}}},{conditions:void 0,styles:{margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},alignSelf:{values:{"flex-start":{defaultClass:"ju367ve"},"flex-end":{defaultClass:"ju367vf"},center:{defaultClass:"ju367vg"}}},backgroundSize:{values:{cover:{defaultClass:"ju367vh"}}},borderRadius:{values:{1:{defaultClass:"ju367vi"},6:{defaultClass:"ju367vj"},10:{defaultClass:"ju367vk"},13:{defaultClass:"ju367vl"},actionButton:{defaultClass:"ju367vm"},connectButton:{defaultClass:"ju367vn"},menuButton:{defaultClass:"ju367vo"},modal:{defaultClass:"ju367vp"},modalMobile:{defaultClass:"ju367vq"},"25%":{defaultClass:"ju367vr"},full:{defaultClass:"ju367vs"}}},borderStyle:{values:{solid:{defaultClass:"ju367vt"}}},borderWidth:{values:{0:{defaultClass:"ju367vu"},1:{defaultClass:"ju367vv"},2:{defaultClass:"ju367vw"},4:{defaultClass:"ju367vx"}}},cursor:{values:{pointer:{defaultClass:"ju367vy"},none:{defaultClass:"ju367vz"}}},pointerEvents:{values:{none:{defaultClass:"ju367v10"},all:{defaultClass:"ju367v11"}}},minHeight:{values:{8:{defaultClass:"ju367v12"},44:{defaultClass:"ju367v13"}}},flexDirection:{values:{row:{defaultClass:"ju367v14"},column:{defaultClass:"ju367v15"}}},fontFamily:{values:{body:{defaultClass:"ju367v16"}}},fontSize:{values:{12:{defaultClass:"ju367v17"},13:{defaultClass:"ju367v18"},14:{defaultClass:"ju367v19"},16:{defaultClass:"ju367v1a"},18:{defaultClass:"ju367v1b"},20:{defaultClass:"ju367v1c"},23:{defaultClass:"ju367v1d"}}},fontWeight:{values:{regular:{defaultClass:"ju367v1e"},medium:{defaultClass:"ju367v1f"},semibold:{defaultClass:"ju367v1g"},bold:{defaultClass:"ju367v1h"},heavy:{defaultClass:"ju367v1i"}}},gap:{values:{0:{defaultClass:"ju367v1j"},1:{defaultClass:"ju367v1k"},2:{defaultClass:"ju367v1l"},3:{defaultClass:"ju367v1m"},4:{defaultClass:"ju367v1n"},5:{defaultClass:"ju367v1o"},6:{defaultClass:"ju367v1p"},8:{defaultClass:"ju367v1q"},10:{defaultClass:"ju367v1r"},12:{defaultClass:"ju367v1s"},14:{defaultClass:"ju367v1t"},16:{defaultClass:"ju367v1u"},18:{defaultClass:"ju367v1v"},20:{defaultClass:"ju367v1w"},24:{defaultClass:"ju367v1x"},28:{defaultClass:"ju367v1y"},32:{defaultClass:"ju367v1z"},36:{defaultClass:"ju367v20"},44:{defaultClass:"ju367v21"},64:{defaultClass:"ju367v22"},"-1":{defaultClass:"ju367v23"}}},height:{values:{1:{defaultClass:"ju367v24"},2:{defaultClass:"ju367v25"},4:{defaultClass:"ju367v26"},8:{defaultClass:"ju367v27"},12:{defaultClass:"ju367v28"},20:{defaultClass:"ju367v29"},24:{defaultClass:"ju367v2a"},28:{defaultClass:"ju367v2b"},30:{defaultClass:"ju367v2c"},32:{defaultClass:"ju367v2d"},34:{defaultClass:"ju367v2e"},36:{defaultClass:"ju367v2f"},40:{defaultClass:"ju367v2g"},44:{defaultClass:"ju367v2h"},48:{defaultClass:"ju367v2i"},54:{defaultClass:"ju367v2j"},60:{defaultClass:"ju367v2k"},200:{defaultClass:"ju367v2l"},full:{defaultClass:"ju367v2m"},max:{defaultClass:"ju367v2n"}}},justifyContent:{values:{"flex-start":{defaultClass:"ju367v2o"},"flex-end":{defaultClass:"ju367v2p"},center:{defaultClass:"ju367v2q"},"space-between":{defaultClass:"ju367v2r"},"space-around":{defaultClass:"ju367v2s"}}},textAlign:{values:{left:{defaultClass:"ju367v2t"},center:{defaultClass:"ju367v2u"},inherit:{defaultClass:"ju367v2v"}}},marginBottom:{values:{0:{defaultClass:"ju367v2w"},1:{defaultClass:"ju367v2x"},2:{defaultClass:"ju367v2y"},3:{defaultClass:"ju367v2z"},4:{defaultClass:"ju367v30"},5:{defaultClass:"ju367v31"},6:{defaultClass:"ju367v32"},8:{defaultClass:"ju367v33"},10:{defaultClass:"ju367v34"},12:{defaultClass:"ju367v35"},14:{defaultClass:"ju367v36"},16:{defaultClass:"ju367v37"},18:{defaultClass:"ju367v38"},20:{defaultClass:"ju367v39"},24:{defaultClass:"ju367v3a"},28:{defaultClass:"ju367v3b"},32:{defaultClass:"ju367v3c"},36:{defaultClass:"ju367v3d"},44:{defaultClass:"ju367v3e"},64:{defaultClass:"ju367v3f"},"-1":{defaultClass:"ju367v3g"}}},marginLeft:{values:{0:{defaultClass:"ju367v3h"},1:{defaultClass:"ju367v3i"},2:{defaultClass:"ju367v3j"},3:{defaultClass:"ju367v3k"},4:{defaultClass:"ju367v3l"},5:{defaultClass:"ju367v3m"},6:{defaultClass:"ju367v3n"},8:{defaultClass:"ju367v3o"},10:{defaultClass:"ju367v3p"},12:{defaultClass:"ju367v3q"},14:{defaultClass:"ju367v3r"},16:{defaultClass:"ju367v3s"},18:{defaultClass:"ju367v3t"},20:{defaultClass:"ju367v3u"},24:{defaultClass:"ju367v3v"},28:{defaultClass:"ju367v3w"},32:{defaultClass:"ju367v3x"},36:{defaultClass:"ju367v3y"},44:{defaultClass:"ju367v3z"},64:{defaultClass:"ju367v40"},"-1":{defaultClass:"ju367v41"}}},marginRight:{values:{0:{defaultClass:"ju367v42"},1:{defaultClass:"ju367v43"},2:{defaultClass:"ju367v44"},3:{defaultClass:"ju367v45"},4:{defaultClass:"ju367v46"},5:{defaultClass:"ju367v47"},6:{defaultClass:"ju367v48"},8:{defaultClass:"ju367v49"},10:{defaultClass:"ju367v4a"},12:{defaultClass:"ju367v4b"},14:{defaultClass:"ju367v4c"},16:{defaultClass:"ju367v4d"},18:{defaultClass:"ju367v4e"},20:{defaultClass:"ju367v4f"},24:{defaultClass:"ju367v4g"},28:{defaultClass:"ju367v4h"},32:{defaultClass:"ju367v4i"},36:{defaultClass:"ju367v4j"},44:{defaultClass:"ju367v4k"},64:{defaultClass:"ju367v4l"},"-1":{defaultClass:"ju367v4m"}}},marginTop:{values:{0:{defaultClass:"ju367v4n"},1:{defaultClass:"ju367v4o"},2:{defaultClass:"ju367v4p"},3:{defaultClass:"ju367v4q"},4:{defaultClass:"ju367v4r"},5:{defaultClass:"ju367v4s"},6:{defaultClass:"ju367v4t"},8:{defaultClass:"ju367v4u"},10:{defaultClass:"ju367v4v"},12:{defaultClass:"ju367v4w"},14:{defaultClass:"ju367v4x"},16:{defaultClass:"ju367v4y"},18:{defaultClass:"ju367v4z"},20:{defaultClass:"ju367v50"},24:{defaultClass:"ju367v51"},28:{defaultClass:"ju367v52"},32:{defaultClass:"ju367v53"},36:{defaultClass:"ju367v54"},44:{defaultClass:"ju367v55"},64:{defaultClass:"ju367v56"},"-1":{defaultClass:"ju367v57"}}},maxWidth:{values:{1:{defaultClass:"ju367v58"},2:{defaultClass:"ju367v59"},4:{defaultClass:"ju367v5a"},8:{defaultClass:"ju367v5b"},12:{defaultClass:"ju367v5c"},20:{defaultClass:"ju367v5d"},24:{defaultClass:"ju367v5e"},28:{defaultClass:"ju367v5f"},30:{defaultClass:"ju367v5g"},32:{defaultClass:"ju367v5h"},34:{defaultClass:"ju367v5i"},36:{defaultClass:"ju367v5j"},40:{defaultClass:"ju367v5k"},44:{defaultClass:"ju367v5l"},48:{defaultClass:"ju367v5m"},54:{defaultClass:"ju367v5n"},60:{defaultClass:"ju367v5o"},200:{defaultClass:"ju367v5p"},full:{defaultClass:"ju367v5q"},max:{defaultClass:"ju367v5r"}}},minWidth:{values:{1:{defaultClass:"ju367v5s"},2:{defaultClass:"ju367v5t"},4:{defaultClass:"ju367v5u"},8:{defaultClass:"ju367v5v"},12:{defaultClass:"ju367v5w"},20:{defaultClass:"ju367v5x"},24:{defaultClass:"ju367v5y"},28:{defaultClass:"ju367v5z"},30:{defaultClass:"ju367v60"},32:{defaultClass:"ju367v61"},34:{defaultClass:"ju367v62"},36:{defaultClass:"ju367v63"},40:{defaultClass:"ju367v64"},44:{defaultClass:"ju367v65"},48:{defaultClass:"ju367v66"},54:{defaultClass:"ju367v67"},60:{defaultClass:"ju367v68"},200:{defaultClass:"ju367v69"},full:{defaultClass:"ju367v6a"},max:{defaultClass:"ju367v6b"}}},overflow:{values:{hidden:{defaultClass:"ju367v6c"}}},paddingBottom:{values:{0:{defaultClass:"ju367v6d"},1:{defaultClass:"ju367v6e"},2:{defaultClass:"ju367v6f"},3:{defaultClass:"ju367v6g"},4:{defaultClass:"ju367v6h"},5:{defaultClass:"ju367v6i"},6:{defaultClass:"ju367v6j"},8:{defaultClass:"ju367v6k"},10:{defaultClass:"ju367v6l"},12:{defaultClass:"ju367v6m"},14:{defaultClass:"ju367v6n"},16:{defaultClass:"ju367v6o"},18:{defaultClass:"ju367v6p"},20:{defaultClass:"ju367v6q"},24:{defaultClass:"ju367v6r"},28:{defaultClass:"ju367v6s"},32:{defaultClass:"ju367v6t"},36:{defaultClass:"ju367v6u"},44:{defaultClass:"ju367v6v"},64:{defaultClass:"ju367v6w"},"-1":{defaultClass:"ju367v6x"}}},paddingLeft:{values:{0:{defaultClass:"ju367v6y"},1:{defaultClass:"ju367v6z"},2:{defaultClass:"ju367v70"},3:{defaultClass:"ju367v71"},4:{defaultClass:"ju367v72"},5:{defaultClass:"ju367v73"},6:{defaultClass:"ju367v74"},8:{defaultClass:"ju367v75"},10:{defaultClass:"ju367v76"},12:{defaultClass:"ju367v77"},14:{defaultClass:"ju367v78"},16:{defaultClass:"ju367v79"},18:{defaultClass:"ju367v7a"},20:{defaultClass:"ju367v7b"},24:{defaultClass:"ju367v7c"},28:{defaultClass:"ju367v7d"},32:{defaultClass:"ju367v7e"},36:{defaultClass:"ju367v7f"},44:{defaultClass:"ju367v7g"},64:{defaultClass:"ju367v7h"},"-1":{defaultClass:"ju367v7i"}}},paddingRight:{values:{0:{defaultClass:"ju367v7j"},1:{defaultClass:"ju367v7k"},2:{defaultClass:"ju367v7l"},3:{defaultClass:"ju367v7m"},4:{defaultClass:"ju367v7n"},5:{defaultClass:"ju367v7o"},6:{defaultClass:"ju367v7p"},8:{defaultClass:"ju367v7q"},10:{defaultClass:"ju367v7r"},12:{defaultClass:"ju367v7s"},14:{defaultClass:"ju367v7t"},16:{defaultClass:"ju367v7u"},18:{defaultClass:"ju367v7v"},20:{defaultClass:"ju367v7w"},24:{defaultClass:"ju367v7x"},28:{defaultClass:"ju367v7y"},32:{defaultClass:"ju367v7z"},36:{defaultClass:"ju367v80"},44:{defaultClass:"ju367v81"},64:{defaultClass:"ju367v82"},"-1":{defaultClass:"ju367v83"}}},paddingTop:{values:{0:{defaultClass:"ju367v84"},1:{defaultClass:"ju367v85"},2:{defaultClass:"ju367v86"},3:{defaultClass:"ju367v87"},4:{defaultClass:"ju367v88"},5:{defaultClass:"ju367v89"},6:{defaultClass:"ju367v8a"},8:{defaultClass:"ju367v8b"},10:{defaultClass:"ju367v8c"},12:{defaultClass:"ju367v8d"},14:{defaultClass:"ju367v8e"},16:{defaultClass:"ju367v8f"},18:{defaultClass:"ju367v8g"},20:{defaultClass:"ju367v8h"},24:{defaultClass:"ju367v8i"},28:{defaultClass:"ju367v8j"},32:{defaultClass:"ju367v8k"},36:{defaultClass:"ju367v8l"},44:{defaultClass:"ju367v8m"},64:{defaultClass:"ju367v8n"},"-1":{defaultClass:"ju367v8o"}}},position:{values:{absolute:{defaultClass:"ju367v8p"},fixed:{defaultClass:"ju367v8q"},relative:{defaultClass:"ju367v8r"}}},WebkitUserSelect:{values:{none:{defaultClass:"ju367v8s"}}},right:{values:{0:{defaultClass:"ju367v8t"}}},transition:{values:{default:{defaultClass:"ju367v8u"},transform:{defaultClass:"ju367v8v"}}},userSelect:{values:{none:{defaultClass:"ju367v8w"}}},width:{values:{1:{defaultClass:"ju367v8x"},2:{defaultClass:"ju367v8y"},4:{defaultClass:"ju367v8z"},8:{defaultClass:"ju367v90"},12:{defaultClass:"ju367v91"},20:{defaultClass:"ju367v92"},24:{defaultClass:"ju367v93"},28:{defaultClass:"ju367v94"},30:{defaultClass:"ju367v95"},32:{defaultClass:"ju367v96"},34:{defaultClass:"ju367v97"},36:{defaultClass:"ju367v98"},40:{defaultClass:"ju367v99"},44:{defaultClass:"ju367v9a"},48:{defaultClass:"ju367v9b"},54:{defaultClass:"ju367v9c"},60:{defaultClass:"ju367v9d"},200:{defaultClass:"ju367v9e"},full:{defaultClass:"ju367v9f"},max:{defaultClass:"ju367v9g"}}},backdropFilter:{values:{modalOverlay:{defaultClass:"ju367v9h"}}}}}),a6={colors:{accentColor:"var(--rk-colors-accentColor)",accentColorForeground:"var(--rk-colors-accentColorForeground)",actionButtonBorder:"var(--rk-colors-actionButtonBorder)",actionButtonBorderMobile:"var(--rk-colors-actionButtonBorderMobile)",actionButtonSecondaryBackground:"var(--rk-colors-actionButtonSecondaryBackground)",closeButton:"var(--rk-colors-closeButton)",closeButtonBackground:"var(--rk-colors-closeButtonBackground)",connectButtonBackground:"var(--rk-colors-connectButtonBackground)",connectButtonBackgroundError:"var(--rk-colors-connectButtonBackgroundError)",connectButtonInnerBackground:"var(--rk-colors-connectButtonInnerBackground)",connectButtonText:"var(--rk-colors-connectButtonText)",connectButtonTextError:"var(--rk-colors-connectButtonTextError)",connectionIndicator:"var(--rk-colors-connectionIndicator)",downloadBottomCardBackground:"var(--rk-colors-downloadBottomCardBackground)",downloadTopCardBackground:"var(--rk-colors-downloadTopCardBackground)",error:"var(--rk-colors-error)",generalBorder:"var(--rk-colors-generalBorder)",generalBorderDim:"var(--rk-colors-generalBorderDim)",menuItemBackground:"var(--rk-colors-menuItemBackground)",modalBackdrop:"var(--rk-colors-modalBackdrop)",modalBackground:"var(--rk-colors-modalBackground)",modalBorder:"var(--rk-colors-modalBorder)",modalText:"var(--rk-colors-modalText)",modalTextDim:"var(--rk-colors-modalTextDim)",modalTextSecondary:"var(--rk-colors-modalTextSecondary)",profileAction:"var(--rk-colors-profileAction)",profileActionHover:"var(--rk-colors-profileActionHover)",profileForeground:"var(--rk-colors-profileForeground)",selectedOptionBorder:"var(--rk-colors-selectedOptionBorder)",standby:"var(--rk-colors-standby)"},fonts:{body:"var(--rk-fonts-body)"},radii:{actionButton:"var(--rk-radii-actionButton)",connectButton:"var(--rk-radii-connectButton)",menuButton:"var(--rk-radii-menuButton)",modal:"var(--rk-radii-modal)",modalMobile:"var(--rk-radii-modalMobile)"},shadows:{connectButton:"var(--rk-shadows-connectButton)",dialog:"var(--rk-shadows-dialog)",profileDetailsAction:"var(--rk-shadows-profileDetailsAction)",selectedOption:"var(--rk-shadows-selectedOption)",selectedWallet:"var(--rk-shadows-selectedWallet)",walletLogo:"var(--rk-shadows-walletLogo)"},blurs:{modalOverlay:"var(--rk-blurs-modalOverlay)"}},M$={shrink:"_12cbo8i6",shrinkSm:"_12cbo8i7"},B$="_12cbo8i3 ju367v8r",T$={grow:"_12cbo8i4",growLg:"_12cbo8i5"};function pt({active:e,hover:t}){return[B$,t&&T$[t],M$[e]]}var w8=S.createContext(null);function P$(){const{adapter:e}=S.useContext(w8)??{};if(!e)throw new Error("No authentication adapter found");return e}function Pp(){const e=S.useContext(w8);return(e==null?void 0:e.status)??null}function f2(){const e=Pp(),{isConnected:t}=Oe();return t?e&&(e==="loading"||e==="unauthenticated")?e:"connected":"disconnected"}function _8(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function R$(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function L$(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function id(){return R$()||L$()}function mt(){return _8()||id()}var D$="iekbcc0",O$={a:"iekbcca",blockquote:"iekbcc2",button:"iekbcc9",input:"iekbcc8 iekbcc5 iekbcc4",mark:"iekbcc6",ol:"iekbcc1",q:"iekbcc2",select:"iekbcc7 iekbcc5 iekbcc4",table:"iekbcc3",textarea:"iekbcc5 iekbcc4",ul:"iekbcc1"},F$=({reset:e,...t})=>{if(!e)return Ug(t);const n=O$[e],r=Ug(t);return Rj(D$,n,r)},R=k.forwardRef(({as:e="div",className:t,testId:n,...r},s)=>{const o={},a={};for(const l in r)Ug.properties.has(l)?o[l]=r[l]:a[l]=r[l];const c=F$({reset:typeof e=="string"?e:"div",...o});return k.createElement(e,{className:Rj(c,t),...a,"data-testid":n?`rk-${n.replace(/^rk-/,"")}`:void 0,ref:s})});R.displayName="Box";var x8=new Map,c1=new Map;async function k8(e){const t=c1.get(e);if(t)return t;const n=async()=>e().then(async s=>(x8.set(e,s),s)),r=n().catch(s=>n().catch(o=>{c1.delete(e)}));return c1.set(e,r),r}async function Gr(...e){return await Promise.all(e.map(t=>typeof t=="function"?k8(t):t))}function $$(){const[,e]=S.useReducer(t=>t+1,0);return e}function Rp(e){const t=typeof e=="function"?x8.get(e):void 0,n=$$();return S.useEffect(()=>{typeof e=="function"&&!t&&k8(e).then(n)},[e,t,n]),typeof e=="function"?t:e}function It({alt:e,background:t,borderColor:n,borderRadius:r,useAsImage:s,boxShadow:o,height:a,src:c,width:l,testId:u}){const d=id(),f=Rp(c),h=f&&/^http/.test(f),[p,m]=S.useReducer(()=>!0,!1);return k.createElement(R,{"aria-label":e,borderRadius:r,boxShadow:o,height:typeof a=="string"?a:void 0,overflow:"hidden",position:"relative",role:"img",style:{background:t,height:typeof a=="number"?a:void 0,width:typeof l=="number"?l:void 0},width:typeof l=="string"?l:void 0,testId:u},k.createElement(R,{...h?{"aria-hidden":!0,as:"img",onLoad:m,src:f}:{"aria-hidden":!0,as:"img",src:f},height:"full",position:"absolute",...d?{WebkitUserSelect:"none"}:{},style:{WebkitTouchCallout:"none",transition:"opacity .15s linear",userSelect:"none",...!s&&h?{opacity:p?1:0}:{}},width:"full"}),n?k.createElement(R,{...typeof n=="object"&&"custom"in n?{style:{borderColor:n.custom}}:{borderColor:n},borderRadius:r,borderStyle:"solid",borderWidth:"1",height:"full",position:"relative",width:"full"}):null)}var z$="_1luule42",q$="_1luule43",U$=e=>S.useMemo(()=>`${e}_${Math.round(Math.random()*1e9)}`,[e]),Iu=({height:e=21,width:t=21})=>{const n=U$("spinner");return k.createElement("svg",{className:z$,fill:"none",height:e,viewBox:"0 0 21 21",width:t,xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Loading"),k.createElement("clipPath",{id:n},k.createElement("path",{d:"M10.5 3C6.35786 3 3 6.35786 3 10.5C3 14.6421 6.35786 18 10.5 18C11.3284 18 12 18.6716 12 19.5C12 20.3284 11.3284 21 10.5 21C4.70101 21 0 16.299 0 10.5C0 4.70101 4.70101 0 10.5 0C16.299 0 21 4.70101 21 10.5C21 11.3284 20.3284 12 19.5 12C18.6716 12 18 11.3284 18 10.5C18 6.35786 14.6421 3 10.5 3Z"})),k.createElement("foreignObject",{clipPath:`url(#${n})`,height:"21",width:"21",x:"0",y:"0"},k.createElement("div",{className:q$})))},Te=["#FC5C54","#FFD95A","#E95D72","#6A87C8","#5FD0F3","#75C06B","#FFDD86","#5FC6D4","#FF949A","#FF8024","#9BA1A4","#EC66FF","#FF8CBC","#FF9A23","#C5DADB","#A8CE63","#71ABFF","#FFE279","#B6B1B6","#FF6780","#A575FF","#4D82FF","#FFB35A"],i6=[{color:Te[0],emoji:"🌶"},{color:Te[1],emoji:"🤑"},{color:Te[2],emoji:"🐙"},{color:Te[3],emoji:"🫐"},{color:Te[4],emoji:"🐳"},{color:Te[0],emoji:"🤶"},{color:Te[5],emoji:"🌲"},{color:Te[6],emoji:"🌞"},{color:Te[7],emoji:"🐒"},{color:Te[8],emoji:"🐵"},{color:Te[9],emoji:"🦊"},{color:Te[10],emoji:"🐼"},{color:Te[11],emoji:"🦄"},{color:Te[12],emoji:"🐷"},{color:Te[13],emoji:"🐧"},{color:Te[8],emoji:"🦩"},{color:Te[14],emoji:"👽"},{color:Te[0],emoji:"🎈"},{color:Te[8],emoji:"🍉"},{color:Te[1],emoji:"🎉"},{color:Te[15],emoji:"🐲"},{color:Te[16],emoji:"🌎"},{color:Te[17],emoji:"🍊"},{color:Te[18],emoji:"🐭"},{color:Te[19],emoji:"🍣"},{color:Te[1],emoji:"🐥"},{color:Te[20],emoji:"👾"},{color:Te[15],emoji:"🥦"},{color:Te[0],emoji:"👹"},{color:Te[17],emoji:"🙀"},{color:Te[4],emoji:"⛱"},{color:Te[21],emoji:"⛵️"},{color:Te[17],emoji:"🥳"},{color:Te[8],emoji:"🤯"},{color:Te[22],emoji:"🤠"}];function H$(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function W$(e){const n=Math.abs(H$((typeof e=="string"?e:"").toLowerCase())%i6.length);return i6[n??0]}var V$=({address:e,ensImage:t,size:n})=>{const[r,s]=S.useState(!1);S.useEffect(()=>{if(t){const c=new Image;c.src=t,c.onload=()=>s(!0)}},[t]);const{color:o,emoji:a}=S.useMemo(()=>W$(e),[e]);return t?r?k.createElement(R,{backgroundSize:"cover",borderRadius:"full",position:"absolute",style:{backgroundImage:`url(${t})`,backgroundPosition:"center",height:n,width:n}}):k.createElement(R,{alignItems:"center",backgroundSize:"cover",borderRadius:"full",color:"modalText",display:"flex",justifyContent:"center",position:"absolute",style:{height:n,width:n}},k.createElement(Iu,null)):k.createElement(R,{alignItems:"center",display:"flex",justifyContent:"center",overflow:"hidden",style:{...!t&&{backgroundColor:o},height:n,width:n}},a)},C8=V$,j8=S.createContext(C8);function S8({address:e,imageUrl:t,loading:n,size:r}){const s=S.useContext(j8);return k.createElement(R,{"aria-hidden":!0,borderRadius:"full",overflow:"hidden",position:"relative",style:{height:`${r}px`,width:`${r}px`},userSelect:"none"},k.createElement(R,{alignItems:"center",borderRadius:"full",display:"flex",justifyContent:"center",overflow:"hidden",position:"absolute",style:{fontSize:`${Math.round(r*.55)}px`,height:`${r}px`,transform:n?"scale(0.72)":void 0,transition:".25s ease",transitionDelay:n?void 0:".1s",width:`${r}px`,willChange:"transform"},userSelect:"none"},k.createElement(s,{address:e,ensImage:t,size:r})),n&&k.createElement(R,{color:"accentColor",display:"flex",height:"full",position:"absolute",width:"full"},k.createElement(Iu,{height:"100%",width:"100%"})))}var c6=()=>k.createElement("svg",{fill:"none",height:"7",width:"14",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Dropdown"),k.createElement("path",{d:"M12.75 1.54001L8.51647 5.0038C7.77974 5.60658 6.72026 5.60658 5.98352 5.0038L1.75 1.54001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",xmlns:"http://www.w3.org/2000/svg"})),l6={defaultLocale:"en",locale:"en"},G$=class{constructor(e){this.listeners=new Set,this.defaultLocale=l6.defaultLocale,this.enableFallback=!1,this.locale=l6.locale,this.cachedLocales=[],this.translations={};for(const[t,n]of Object.entries(e))this.cachedLocales=[...this.cachedLocales,t],this.translations={...this.translations,...this.flattenTranslation(n,t)}}missingMessage(e){return`[missing: "${this.locale}.${e}" translation]`}flattenTranslation(e,t){const n={},r=(s,o)=>{for(const a of Object.keys(s)){const c=`${o}.${a}`,l=s[a];typeof l=="object"&&l!==null?r(l,c):n[c]=l}};return r(e,t),n}translateWithReplacements(e,t={}){let n=e;for(const r in t){const s=t[r];n=n.replace(`%{${r}}`,s)}return n}t(e,t,n){const r=`${this.locale}.${e}`,s=this.translations[r];if(!s){if(this.enableFallback){const o=`${this.defaultLocale}.${e}`,a=this.translations[o];if(a)return this.translateWithReplacements(a,t)}return n!=null&&n.rawKeyIfTranslationMissing?e:this.missingMessage(e)}return this.translateWithReplacements(s,t)}isLocaleCached(e){return this.cachedLocales.includes(e)}updateLocale(e){this.locale=e,this.notifyListeners()}setTranslations(e,t){this.isLocaleCached(e)||(this.cachedLocales=[...this.cachedLocales,e],this.translations={...this.translations,...this.flattenTranslation(t,e)}),this.locale=e,this.notifyListeners()}notifyListeners(){for(const e of this.listeners)e()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},Yn=new G$({en:JSON.parse(M0),"en-US":JSON.parse(M0)});Yn.defaultLocale="en-US";Yn.locale="en-US";Yn.enableFallback=!0;var K$=async e=>{switch(e){case"ar":case"ar-AR":return(await ae(async()=>{const{default:t}=await import("./ar_AR-LIPSOZP5-BQrIDibT.js");return{default:t}},[])).default;case"de":case"de-DE":return(await ae(async()=>{const{default:t}=await import("./de_DE-YE3KOFHU-BRt5ztUe.js");return{default:t}},[])).default;case"en":case"en-US":return(await ae(async()=>{const{default:t}=await Promise.resolve().then(()=>Dx);return{default:t}},void 0)).default;case"es":case"es-419":return(await ae(async()=>{const{default:t}=await import("./es_419-7LMPU7G4-DH7rM0yQ.js");return{default:t}},[])).default;case"fr":case"fr-FR":return(await ae(async()=>{const{default:t}=await import("./fr_FR-VBJP3ZLL-B-_ocunw.js");return{default:t}},[])).default;case"hi":case"hi-IN":return(await ae(async()=>{const{default:t}=await import("./hi_IN-WBVD5XYI-D73g2UFs.js");return{default:t}},[])).default;case"id":case"id-ID":return(await ae(async()=>{const{default:t}=await import("./id_ID-SBYANJ7G-Cjpa4ay6.js");return{default:t}},[])).default;case"ja":case"ja-JP":return(await ae(async()=>{const{default:t}=await import("./ja_JP-ZRMWJV3I-DXbifiMm.js");return{default:t}},[])).default;case"ko":case"ko-KR":return(await ae(async()=>{const{default:t}=await import("./ko_KR-FR54RFUG-upinSHjQ.js");return{default:t}},[])).default;case"ms":case"ms-MY":return(await ae(async()=>{const{default:t}=await import("./ms_MY-EZSGYYYQ-4cPLK-3L.js");return{default:t}},[])).default;case"pt":case"pt-BR":return(await ae(async()=>{const{default:t}=await import("./pt_BR-JQFQ3P4L-DOHfdcA2.js");return{default:t}},[])).default;case"ru":case"ru-RU":return(await ae(async()=>{const{default:t}=await import("./ru_RU-Z42UEJBP-Cvb2oWxQ.js");return{default:t}},[])).default;case"th":case"th-TH":return(await ae(async()=>{const{default:t}=await import("./th_TH-4YB4VSB2-BUipNP-V.js");return{default:t}},[])).default;case"tr":case"tr-TR":return(await ae(async()=>{const{default:t}=await import("./tr_TR-5FKHPPIO-D5jTpIm9.js");return{default:t}},[])).default;case"ua":case"uk-UA":return(await ae(async()=>{const{default:t}=await import("./uk_UA-ZD4IBC52-DgnQrpzl.js");return{default:t}},[])).default;case"vi":case"vi-VN":return(await ae(async()=>{const{default:t}=await import("./vi_VN-5EVRZKLY-x078672g.js");return{default:t}},[])).default;case"zh":case"zh-CN":case"zh-Hans":return(await ae(async()=>{const{default:t}=await import("./zh_CN-4XK5YJPR-Bt6Yz5Ek.js");return{default:t}},[])).default;case"zh-HK":return(await ae(async()=>{const{default:t}=await import("./zh_HK-N4YN2WSI-Cvzl1V16.js");return{default:t}},[])).default;case"zh-Hant":case"zh-TW":return(await ae(async()=>{const{default:t}=await import("./zh_TW-CNCRXH6Z-BNelatfN.js");return{default:t}},[])).default;default:return(await ae(async()=>{const{default:t}=await Promise.resolve().then(()=>Dx);return{default:t}},void 0)).default}};async function u6(e){if(Yn.isLocaleCached(e)){Yn.updateLocale(e);return}const n=await K$(e);Yn.setTranslations(e,JSON.parse(n))}var Q$=()=>{var e;if(typeof window<"u"&&typeof navigator<"u"){if((e=navigator.languages)!=null&&e.length)return navigator.languages[0];if(navigator.language)return navigator.language}},gt=S.createContext({i18n:Yn}),Y$=({children:e,locale:t})=>{const[n,r]=S.useState(0),s=S.useMemo(()=>Q$(),[]);S.useEffect(()=>Yn.onChange(()=>{r(c=>c+1)}),[]),S.useEffect(()=>{t&&t!==Yn.locale?u6(t):!t&&s&&s!==Yn.locale&&u6(s)},[t,s]);const o=S.useMemo(()=>({t:(c,l)=>Yn.t(c,l),i18n:Yn}),[n]);return k.createElement(gt.Provider,{value:o},e)};function A8(e){return e!=null}var d6={iconBackground:"#7290CC",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./apechain-SX5YFU6N-q5qBv-mp.js");return{default:e}},[])).default},l1={iconBackground:"#96bedc",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./arbitrum-WURIBY6W-CqVkHBr5.js");return{default:e}},[])).default},f6={iconBackground:"#e84141",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./avalanche-KOMJD3XY-Dsn_JPR4.js");return{default:e}},[])).default},u1={iconBackground:"#0052ff",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./base-OAXLRA4F-CoYTVIiL.js");return{default:e}},[])).default},d1={iconBackground:"#814625",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./berachain-NJECWIVC-DumxnFvf.js");return{default:e}},[])).default},h6={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./blast-V555OVXZ-BbhJh1tj.js");return{default:e}},[])).default},p6={iconBackground:"#ebac0e",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./bsc-N647EYR2-B2nLKXWV.js");return{default:e}},[])).default},m6={iconBackground:"#FCFF52",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./celo-GEP4TUHG-CenIBYLU.js");return{default:e}},[])).default},g6={iconBackground:"#002D74",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./cronos-HJPAQTAE-BEOvlOC4.js");return{default:e}},[])).default},J$={iconBackground:"#A36EFD",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./degen-FQQ4XGHB-CeHTs88l.js");return{default:e}},[])).default},Hs={iconBackground:"#484c50",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./ethereum-RGGVA4PY-SWGOlkuk.js");return{default:e}},[])).default},y6={iconBackground:"transparent",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./flow-5FQJFCTK-CUie2reO.js");return{default:e}},[])).default},X$={iconBackground:"#04795c",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./gnosis-37ZC4RBL-B137OtHZ.js");return{default:e}},[])).default},b6={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./gravity-J5YQHTYH-Bj6B0uod.js");return{default:e}},[])).default},Z$={iconBackground:"#f9f7ec",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./hardhat-TX56IT5N-CV1FY-wE.js");return{default:e}},[])).default},ez={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./hyperevm-VKPAA4SA-CHwraEsx.js");return{default:e}},[])).default},v6={iconBackground:"#7132F5",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./ink-FZMYZWHG-62p-5IK5.js");return{default:e}},[])).default},w6={iconBackground:"transparent",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./kaia-65D2U3PU-JmuLQ4gC.js");return{default:e}},[])).default},f1={iconBackground:"#ffffff",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./linea-QRMVQ5DY-DuI3vv0d.js");return{default:e}},[])).default},h1={iconBackground:"#ffffff",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./manta-SI27YFEJ-CpVOKa06.js");return{default:e}},[])).default},_6={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./mantle-CKIUT334-DR2WgqzU.js");return{default:e}},[])).default},tz={iconBackground:"transparent",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./monad-4KWC6TSS-DVXSkpiz.js");return{default:e}},[])).default},of={iconBackground:"#ff5a57",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./optimism-HAF2GUT7-ec6Nqxs9.js");return{default:e}},[])).default},p1={iconBackground:"#9f71ec",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./polygon-WW6ZI7PM-DXlmm4L1.js");return{default:e}},[])).default},nz={iconBackground:"#1273EA",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./ronin-EMCPYXZT-N-QBHZdV.js");return{default:e}},[])).default},rz={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./sanko-RHQYXGM5-OX010CbN.js");return{default:e}},[])).default},sz={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./superposition-HG6MMR2Y-bRkgatRO.js");return{default:e}},[])).default},x6={iconBackground:"#FFEEDA",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./scroll-5OBGQVOV-DJFECiai.js");return{default:e}},[])).default},k6={iconBackground:"#F50DB4",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./unichain-C5BWO2ZY-BfguYsnu.js");return{default:e}},[])).default},C6={iconBackground:"#f9f7ec",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./xdc-KJ3TDBYO-DNV6zchh.js");return{default:e}},[])).default},j6={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./zetachain-TLDS5IPW-Udhyw16T.js");return{default:e}},[])).default},S6={iconBackground:"#f9f7ec",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./zksync-DH7HK5U4-Dt4usFw6.js");return{default:e}},[])).default},m1={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./zora-FYL5H3IO-iB4wygST.js");return{default:e}},[])).default},oz={apechain:{chainId:33139,name:"ApeChain",...d6},apechainCurtis:{chainId:33111,name:"ApeChain Curtis",...d6},arbitrum:{chainId:42161,name:"Arbitrum",...l1},arbitrumGoerli:{chainId:421613,...l1},arbitrumSepolia:{chainId:421614,...l1},avalanche:{chainId:43114,...f6},avalancheFuji:{chainId:43113,...f6},base:{chainId:8453,name:"Base",...u1},baseGoerli:{chainId:84531,...u1},baseSepolia:{chainId:84532,...u1},berachain:{chainId:80094,name:"Berachain",...d1},berachainArtio:{chainId:80085,name:"Berachain Artio",...d1},berachainBArtio:{chainId:80084,name:"Berachain bArtio",...d1},blast:{chainId:81457,name:"Blast",...h6},blastSepolia:{chainId:168587773,...h6},bsc:{chainId:56,name:"BSC",...p6},bscTestnet:{chainId:97,...p6},celo:{chainId:42220,name:"Celo",...m6},celoAlfajores:{chainId:44787,name:"Celo Alfajores",...m6},cronos:{chainId:25,...g6},cronosTestnet:{chainId:338,...g6},degen:{chainId:666666666,name:"Degen",...J$},flow:{chainId:747,...y6},flowTestnet:{chainId:545,...y6},gnosis:{chainId:100,name:"Gnosis",...X$},goerli:{chainId:5,...Hs},gravity:{chainId:1625,name:"Gravity",...b6},gravitySepolia:{chainId:13505,name:"Gravity Sepolia",...b6},hardhat:{chainId:31337,...Z$},holesky:{chainId:17e3,...Hs},hyperevm:{chainId:999,...ez},ink:{chainId:57073,...v6},inkSepolia:{chainId:763373,...v6},kaia:{chainId:8217,name:"Kaia",...w6},kairos:{chainId:1001,name:"Kairos",...w6},kovan:{chainId:42,...Hs},linea:{chainId:59144,name:"Linea",...f1},lineaGoerli:{chainId:59140,name:"Linea Goerli",...f1},lineaSepolia:{chainId:59141,name:"Linea Sepolia",...f1},localhost:{chainId:1337,...Hs},mainnet:{chainId:1,name:"Ethereum",...Hs},manta:{chainId:169,name:"Manta",...h1},mantaSepolia:{chainId:3441006,...h1},mantaTestnet:{chainId:3441005,...h1},mantle:{chainId:5e3,..._6},mantleTestnet:{chainId:5001,..._6},monadTestnet:{chainId:10143,name:"Monad Testnet",...tz},optimism:{chainId:10,name:"Optimism",...of},optimismGoerli:{chainId:420,...of},optimismKovan:{chainId:69,...of},optimismSepolia:{chainId:11155420,...of},polygon:{chainId:137,name:"Polygon",...p1},polygonAmoy:{chainId:80002,...p1},polygonMumbai:{chainId:80001,...p1},rinkeby:{chainId:4,...Hs},ronin:{chainId:2020,...nz},ropsten:{chainId:3,...Hs},sanko:{chainId:1996,name:"Sanko",...rz},scroll:{chainId:534352,...x6},scrollSepolia:{chainId:534351,...x6},sepolia:{chainId:11155111,...Hs},superposition:{chainId:55244,name:"Superposition",...sz},unichain:{chainId:130,...k6},unichainSepolia:{chainId:1301,...k6},xdc:{chainId:50,name:"XDC",...C6},xdcTestnet:{chainId:51,...C6},zetachain:{chainId:7e3,name:"ZetaChain",...j6},zetachainAthensTestnet:{chainId:7001,name:"Zeta Athens",...j6},zkSync:{chainId:324,name:"zkSync",...S6},zkSyncTestnet:{chainId:280,...S6},zora:{chainId:7777777,name:"Zora",...m1},zoraSepolia:{chainId:999999999,...m1},zoraTestnet:{chainId:999,...m1}},az=Object.fromEntries(Object.values(oz).filter(A8).map(({chainId:e,...t})=>[e,t])),iz=e=>e.map(t=>{const n=az[t.id]??{};return{...t,name:n.name??t.name,iconUrl:t.iconUrl??n.iconUrl,iconBackground:t.iconBackground??n.iconBackground}}),h2=S.createContext({chains:[]});function cz({children:e,initialChain:t}){const{chains:n}=at();return k.createElement(h2.Provider,{value:S.useMemo(()=>({chains:iz(n),initialChainId:typeof t=="number"?t:t==null?void 0:t.id}),[n,t])},e)}var Da=()=>S.useContext(h2).chains,lz=()=>S.useContext(h2).initialChainId,uz=()=>{const e=Da();return S.useMemo(()=>{const t={};for(const n of e)t[n.id]=n;return t},[e])},E8=S.createContext({showBalance:void 0,setShowBalance:()=>{}});function dz({children:e}){const[t,n]=S.useState();return k.createElement(E8.Provider,{value:{showBalance:t,setShowBalance:n}},e)}var N8=()=>S.useContext(E8);function fz(){const[e,t]=S.useState(!1);return S.useEffect(()=>(t(!0),()=>{t(!1)}),[]),S.useCallback(()=>e,[e])}function I8(){const e=Da(),t=Ip.id;return e.some(r=>r.id===t)}function hz(e){const t=I8(),n=s=>{try{return tF(s)}catch{}},{data:r}=pO({chainId:Ip.id,name:e?n(e):void 0,query:{enabled:t}});return r}async function $o(e,t){const n={headers:{},method:"get",...t,timeout:t.timeout??1e4};if(!e)throw new Error("rainbowFetch: Missing url argument");const r=new AbortController,s=setTimeout(()=>r.abort(),n.timeout),{body:o,params:a,headers:c,...l}=n,u=o&&typeof o=="object"?JSON.stringify(o):o,d=await fetch(`${e}${mz(a)}`,{...l,body:u,headers:{Accept:"application/json","Content-Type":"application/json",...c},signal:r.signal});clearTimeout(s);const f=await pz(d);if(d.ok){const{headers:m,status:g}=d;return{data:f,headers:m,status:g}}throw gz({requestBody:o,response:d,responseBody:typeof f=="string"?{error:f}:f})}function pz(e){const t=e.headers.get("Content-Type");return t!=null&&t.startsWith("application/json")?e.json():e.text()}function mz(e){return e&&Object.keys(e).length?`?${new URLSearchParams(e)}`:""}function gz({requestBody:e,response:t,responseBody:n}){const r=(n==null?void 0:n.error)||(t==null?void 0:t.statusText)||"There was an error with the request.",s=new Error(r);return s.response=t,s.responseBody=n,s.requestBody=e,s}var yz=class{constructor(e={}){const{baseUrl:t="",...n}=e;this.baseUrl=t,this.opts=n}get(e,t){return $o(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"get"})}delete(e,t){return $o(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"delete"})}head(e,t){return $o(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"head"})}options(e,t){return $o(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"options"})}post(e,t,n){return $o(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"post"})}put(e,t,n){return $o(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"put"})}patch(e,t,n){return $o(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"patch"})}};function bz({baseUrl:e,headers:t,params:n,timeout:r}){return new yz({baseUrl:e,headers:t,params:n,timeout:r})}var vz=!!(typeof process<"u"&&typeof Sh<"u"&&Sh.RAINBOW_PROVIDER_API_KEY),wz=bz({baseUrl:"https://enhanced-provider.rainbow.me",headers:{"x-api-key":typeof process<"u"&&typeof Sh<"u"&&Sh.RAINBOW_PROVIDER_API_KEY||"LzbasoBiLqltex3VkcQ7LRmL4PtfiiZ1EMJrizrgfonWN6byJReu/l6yrUoo3zLW"}});function _z(e,t,n={}){return[e,t,n]}function Lf(e){return`rk-ens-name-${e}`}function xz(e){try{const t=e?JSON.parse(e):null;return typeof t=="object"?t:null}catch{return null}}function kz(e,t){if(!ut(e)||typeof window>"u")return;const n=new Date,r=new Date(n.getTime()+180*6e4);window.localStorage.setItem(Lf(e),JSON.stringify({ensName:t,expires:r.getTime()}))}function Cz(e){if(typeof window>"u")return null;const t=xz(window.localStorage.getItem(Lf(e)));if(!t)return null;const{ensName:n,expires:r}=t;return typeof n!="string"||Number.isNaN(Number(r))||new Date().getTime()>Number(r)?(window.localStorage.removeItem(Lf(e)),null):n}async function jz({address:e}){const t=Cz(e);if(t)return t;const r=(await wz.get("/v1/resolve-ens",{params:{address:e}})).data.data;return r&&kz(e,r),r}function Sz(e){const t=I8(),{data:n}=mO({chainId:Ip.id,address:e,query:{enabled:t}}),{data:r}=Bj({queryKey:_z("address",e),queryFn:()=>jz({address:e}),enabled:!t&&!!e&&vz,staleTime:10*(60*1e3),retry:1});return n||r}function M8({address:e,includeBalance:t}){const n=Sz(e),r=hz(n),{data:s}=Tj({address:t?e:void 0});return{ensName:n,ensAvatar:r,balance:s}}function p2(){const{chain:e}=Oe();return(e==null?void 0:e.id)??null}var Az="rk-transactions";function Ez(e){const t=`${e.uid}.${Az}`;return{...e,uid:t}}var B8="rk-transactions";function Nz(e){try{const t=e?JSON.parse(e):{};return typeof t=="object"?t:{}}catch{return{}}}function A6(){return Nz(typeof window<"u"?window.localStorage.getItem(B8):null)}var Iz=/^0x([A-Fa-f0-9]{64})$/;function Mz(e){const t=[];return Iz.test(e.hash)||t.push("Invalid transaction hash"),typeof e.description!="string"&&t.push("Transaction must have a description"),typeof e.confirmations<"u"&&(!Number.isInteger(e.confirmations)||e.confirmations<1)&&t.push("Transaction confirmations must be a positiver integer"),t}function Bz({provider:e}){let t=A6(),n;const r=new Set,s=new Set,o=new Map;function a(y){n=Ez(y)}a(e);function c(y,v){var w;return((w=t[y])==null?void 0:w[v])??[]}function l(y,v,w){const x=Mz(w);if(x.length>0)throw new Error(["Unable to add transaction",...x].join(`
1761
+ */const sl={newline:10,reset:27};function u$(e){if(!Number.isSafeInteger(e))throw new Error(`integer expected: ${e}`)}function d$(e){if(!Number.isSafeInteger(e)||e<1||e>40)throw new Error(`Invalid version=${e}. Expected number [1..40]`)}function Oo(e,t){return e.toString(2).padStart(t,"0")}function J_(e,t){const n=e%t;return n>=0?n:t+n}function Br(e,t){return new Array(e).fill(t)}function i1(e){return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}function X_(e){let t=0,n=0;for(const o of e)t=Math.max(t,o.length),n+=o.length;const r=new Uint8Array(n);let s=0;for(let o=0;o<t;o++)for(const a of e)o<a.length&&(r[s++]=a[o]);return r}function f$(){let e,t=1/0;return{add(n,r){n>=t||(e=r,t=n)},get:()=>e,score:()=>t}}function Z_(e){return Object.freeze({has:t=>e.includes(t),decode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="string")throw new Error("alphabet.decode input should be array of strings");return t.map(n=>{if(typeof n!="string")throw new Error(`alphabet.decode: not string element=${n}`);const r=e.indexOf(n);if(r===-1)throw new Error(`Unknown letter: "${n}". Allowed: ${e}`);return r})},encode:t=>{if(!Array.isArray(t)||t.length&&typeof t[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return t.map(n=>{if(u$(n),n<0||n>=e.length)throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${e.length})`);return e[n]})}})}function e6(e){if(e.length!==32)throw new Error("expects 32 element matrix");const t=[1431655765,858993459,252645135,16711935,65535];for(let n=0;n<5;n++){const r=t[n]>>>0,s=1<<n,o=s<<1;for(let a=0;a<32;a+=o)for(let c=0;c<s;c++){const l=a+c,u=l+s,d=e[l]>>>0,f=e[u]>>>0,h=(d>>>s^f)&r;e[l]=(d^h<<s)>>>0,e[u]=(f^h)>>>0}}}const ol=e=>1<<(e&31)>>>0,Fo=(e,t)=>t===0?0:t===32?4294967295:(1<<t)-1<<e>>>0;class Xt{constructor(t,n){Ds(this,"defined");Ds(this,"value");Ds(this,"tailMask");Ds(this,"words");Ds(this,"fullWords");Ds(this,"height");Ds(this,"width");const{height:r,width:s}=Xt.size(t);if(!Number.isSafeInteger(r)||r<=0)throw new Error(`Bitmap: invalid height=${r}, expected positive safe integer dimension`);if(!Number.isSafeInteger(s)||s<=0)throw new Error(`Bitmap: invalid width=${s}, expected positive safe integer dimension`);if(this.height=r,this.width=s,this.tailMask=Fo(0,s&31||32),this.words=Math.ceil(s/32)|0,this.fullWords=Math.floor(s/32)|0,this.value=new Uint32Array(this.words*r),this.defined=new Uint32Array(this.value.length),n){if(n.length!==r)throw new Error(`Bitmap: data height mismatch: exp=${r} got=${n.length}`);for(let o=0;o<r;o++){const a=n[o];if(!a||a.length!==s)throw new Error(`Bitmap: data width mismatch at y=${o}: exp=${s} got=${a==null?void 0:a.length}`);for(let c=0;c<s;c++)this.set(c,o,a[c])}}}static size(t,n){if(typeof t=="number"&&(t={height:t,width:t}),!Number.isSafeInteger(t.height)&&t.height!==1/0)throw new Error(`Bitmap: invalid height=${t.height} (${typeof t.height})`);if(!Number.isSafeInteger(t.width)&&t.width!==1/0)throw new Error(`Bitmap: invalid width=${t.width} (${typeof t.width})`);return n!==void 0&&(t={width:Math.min(t.width,n.width),height:Math.min(t.height,n.height)}),t}static fromString(t){t=t.replace(/^\n+/g,"").replace(/\n+$/g,"");const n=t.split(String.fromCharCode(sl.newline)),r=n.length;let s;const o=[];for(const a of n){const c=a.split("").map(l=>{if(l==="X")return!0;if(l===" ")return!1;if(l!=="?")throw new Error(`Bitmap.fromString: unknown symbol=${l}`)});if(s!==void 0&&c.length!==s)throw new Error(`Bitmap.fromString different row sizes: width=${s} cur=${c.length}`);s=c.length,o.push(c)}return s===void 0&&(s=0),new Xt({height:r,width:s},o)}point(t){return this.get(t.x,t.y)}isInside(t){return 0<=t.x&&t.x<this.width&&0<=t.y&&t.y<this.height}size(t){if(!t)return{height:this.height,width:this.width};const{x:n,y:r}=this.xy(t);return{height:this.height-r,width:this.width-n}}xy(t){if(typeof t=="number"&&(t={x:t,y:t}),!Number.isSafeInteger(t.x))throw new Error(`Bitmap: invalid x=${t.x}`);if(!Number.isSafeInteger(t.y))throw new Error(`Bitmap: invalid y=${t.y}`);return t.x=J_(t.x,this.width),t.y=J_(t.y,this.height),t}wordIndex(t,n){return n*this.words+(t>>>5)}bitIndex(t,n){return{word:this.wordIndex(t,n),bit:t&31}}isDefined(t,n){const r=this.wordIndex(t,n),s=ol(t);return(this.defined[r]&s)!==0}get(t,n){const r=this.wordIndex(t,n),s=ol(t);return(this.value[r]&s)!==0}maskWord(t,n,r){const{defined:s,value:o}=this;s[t]|=n,o[t]=o[t]&~n|-r&n}set(t,n,r){r!==void 0&&this.maskWord(this.wordIndex(t,n),ol(t),r)}fillRectConst(t,n,r,s,o){if(r<=0||s<=0||o===void 0)return;const{value:a,defined:c,words:l}=this,u=t>>>5,d=t+r-1>>>5,f=t&31,h=t+r-1&31;for(let p=0;p<s;p++){const m=(n+p)*l;if(u===d){const g=Fo(f,h-f+1);this.maskWord(m+u,g,o);continue}this.maskWord(m+u,Fo(f,32-f),o);for(let g=u+1;g<d;g++)c[m+g]=4294967295,a[m+g]=o?4294967295:0;this.maskWord(m+d,Fo(0,h+1),o)}}rectWords(t,n,r,s,o){for(let a=0;a<s;a++){const c=n+a;for(let l=0;l<r;){const u=t+l,{bit:d,word:f}=this.bitIndex(u,c),h=Math.min(32-d,r-l);o(f,u,l,a,h),l+=h}}}rect(t,n,r){const{x:s,y:o}=this.xy(t),{height:a,width:c}=Xt.size(n,this.size({x:s,y:o}));if(typeof r!="function")return this.fillRectConst(s,o,c,a,r),this;const{defined:l,value:u}=this;return this.rectWords(s,o,c,a,(d,f,h,p,m)=>{let g=0,_=u[d];for(let b=0;b<m;b++){const y=ol(f+b),v=r({x:h+b,y:p},(_&y)!==0);v!==void 0&&(g|=y,_=_&~y|-v&y)}l[d]|=g,u[d]=_}),this}rectRead(t,n,r){const{x:s,y:o}=this.xy(t),{height:a,width:c}=Xt.size(n,this.size({x:s,y:o})),{value:l}=this;return this.rectWords(s,o,c,a,(u,d,f,h,p)=>{const m=l[u];for(let g=0;g<p;g++){const _=ol(d+g);r({x:f+g,y:h},(m&_)!==0)}}),this}hLine(t,n,r){return this.rect(t,{width:n,height:1},r)}vLine(t,n,r){return this.rect(t,{width:1,height:n},r)}border(t=2,n){if(!Number.isSafeInteger(t)||t<=0)throw new Error(`Bitmap.border: invalid size=${t}`);const r=this.height+2*t,s=this.width+2*t,o=new Xt({height:r,width:s});return o.rect(0,1/0,n),o.embed({x:t,y:t},this),o}embed(t,n){const{x:r,y:s}=this.xy(t),{height:o,width:a}=Xt.size(n.size(),this.size({x:r,y:s}));if(a<=0||o<=0)return this;const{value:c,defined:l}=this,{words:u,value:d}=n;for(let f=0;f<o;f++){const h=f*u;for(let p=0;p<a;){const m=r+p,{word:g,bit:_}=this.bitIndex(m,s+f),{word:b,bit:y}=n.bitIndex(p,f),v=Math.min(32-_,a-p),w=d[b],x=y&&b+1<h+u?d[b+1]:0,A=y?(w>>>y|x<<32-y)>>>0:w,C=Fo(_,v),j=(A&Fo(0,v))<<_>>>0;l[g]|=C,c[g]=c[g]&~C|j,p+=v}}return this}rectSlice(t,n=this.size()){const{x:r,y:s}=this.xy(t),{height:o,width:a}=Xt.size(n,this.size({x:r,y:s})),c=new Xt({height:o,width:a});return this.rectRead({x:r,y:s},{height:o,width:a},(l,u)=>{this.isDefined(r+l.x,s+l.y)&&c.set(l.x,l.y,u)}),c}transpose(){const{height:t,width:n,value:r,defined:s,words:o}=this,a=new Xt({height:n,width:t}),{words:c,value:l,defined:u,tailMask:d}=a,f=new Uint32Array(32),h=new Uint32Array(32);for(let p=0;p<t;p+=32)for(let m=0;m<o;m++){const g=Math.min(32,t-p);for(let _=0;_<g;_++){const b=this.wordIndex(32*m,p+_);f[_]=r[b],h[_]=s[b]}f.fill(0,g),h.fill(0,g),e6(f),e6(h);for(let _=0;_<32;_++){const b=m*32+_;if(b>=n)break;const y=a.wordIndex(p,b),v=p>>>5===c-1?d:4294967295;l[y]=f[_]&v,u[y]=h[_]&v}}return a}negate(){const t=this.defined.length;for(let n=0;n<t;n++)this.value[n]=~this.value[n],this.defined[n]=4294967295;return this}scale(t){if(!Number.isSafeInteger(t)||t>1024)throw new Error(`invalid scale factor: ${t}`);const{height:n,width:r}=this;return new Xt({height:t*n,width:t*r}).rect({x:0,y:0},1/0,({x:o,y:a})=>this.get(o/t|0,a/t|0))}clone(){const t=new Xt(this.size());return t.defined.set(this.defined),t.value.set(this.value),t}assertDrawn(){const{height:t,width:n,defined:r,tailMask:s,fullWords:o,words:a}=this;if(!(!t||!n))for(let c=0;c<t;c++){const l=c*a;for(let u=0;u<o;u++)if(r[l+u]!==4294967295)throw new Error("Invalid color type=undefined");if(a!==o&&(r[l+o]&s)!==s)throw new Error("Invalid color type=undefined")}}countPatternInRow(t,n,...r){if(!Number.isSafeInteger(n)||n<=0||n>=32)throw new Error("wrong patternLen");const s=(1<<n)-1,{height:o,width:a,value:c,words:l}=this;if(!Number.isSafeInteger(t)||t<0||t>=o)return 0;let u=0;const d=this.wordIndex(0,t);for(let f=0,h=0;f<l;f++){const p=c[d+f],m=f===l-1&&a&31||32;for(let g=0;g<m;g++)if(h=(h<<1|p>>>g&1)&s,!(f*32+g+1<n)){for(const _ of r)if(h===_){u++;break}}}return u}getRuns(t,n){const{height:r,width:s,value:o,words:a}=this;if(s===0||!Number.isSafeInteger(t)||t<0||t>=r)return;let c=0,l;const u=this.wordIndex(0,t);for(let d=0;d<a;d++){const f=o[u+d],h=d===a-1&&s&31||32;for(let p=0;p<h;p++){const m=(f&1<<p)!==0;if(m===l){c++;continue}l!==void 0&&n(c,l),l=m,c=1}}l!==void 0&&n(c,l)}popcnt(){const{height:t,width:n,words:r,fullWords:s,tailMask:o}=this;if(!t||!n)return 0;let a=0;for(let c=0;c<t;c++){const l=c*r;for(let u=0;u<s;u++)a+=i1(this.value[l+u]);r!==s&&(a+=i1(this.value[l+s]&o))}return a}countBoxes2x2(t){const{height:n,width:r,words:s}=this;if(r<2||!Number.isSafeInteger(t)||t<0||t+1>=n)return 0;const o=this.wordIndex(0,t),a=this.wordIndex(0,t+1),l=(r&31)===0?2147483647:Fo(0,r-1&31);let u=0;for(let d=0;d<s;d++){const f=this.value[o+d],h=this.value[a+d],p=~(f^h)>>>0,m=d+1<s?this.value[o+d+1]>>>0:0,g=~(f^(f>>>1|(m&1)<<31)>>>0)>>>0,_=d+1<s?this.value[a+d+1]>>>0:0,b=~(h^(h>>>1|(_&1)<<31)>>>0)>>>0;let y=(p&g&b)>>>0;d===s-1&&(y&=l),u+=i1(y)}return u}toString(){const t=String.fromCharCode(sl.newline);let n="";for(let r=0;r<this.height;r++){let s="";for(let o=0;o<this.width;o++){const a=this.get(o,r);s+=this.isDefined(o,r)?a?"X":" ":"?"}n+=s+(r+1===this.height?"":t)}return n}toRaw(){const t=Array.from({length:this.height},()=>new Array(this.width));for(let n=0;n<this.height;n++){const r=t[n];for(let s=0;s<this.width;s++)r[s]=this.get(s,n)}return t}toASCII(){const{height:t,width:n}=this;let r="";for(let s=0;s<t;s+=2){for(let o=0;o<n;o++){const a=this.get(o,s),c=s+1>=t?!0:this.get(o,s+1);!a&&!c?r+="█":!a&&c?r+="▀":a&&!c?r+="▄":a&&c&&(r+=" ")}r+=String.fromCharCode(sl.newline)}return r}toTerm(){const t=String.fromCharCode(sl.reset),n=t+"[0m",r=t+"[1;47m "+n,s=t+"[40m "+n,o=String.fromCharCode(sl.newline);let a="";for(let c=0;c<this.height;c++){for(let l=0;l<this.width;l++){const u=this.get(l,c);a+=u?s:r}a+=o}return a}toSVG(t=!0){let n=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,r="",s;return this.rectRead(0,1/0,(o,a)=>{if(!a)return;const{x:c,y:l}=o;if(!t){n+=`<rect x="${c}" y="${l}" width="1" height="1" />`;return}let u=`M${c} ${l}`;if(s){const f=`m${c-s.x} ${l-s.y}`;f.length<=u.length&&(u=f)}const d=c<10?`H${c}`:"h-1";r+=`${u}h1v1${d}Z`,s=o}),t&&(n+=`<path d="${r}"/>`),n+="</svg>",n}toGIF(){const t=c=>[c&255,c>>>8&255],n=[...t(this.width),...t(this.height)],r=[];this.rectRead(0,1/0,(c,l)=>r.push(+(l===!0)));const s=126,o=[71,73,70,56,55,97,...n,246,0,0,255,255,255,...Br(3*127,0),44,0,0,0,0,...n,0,7],a=Math.floor(r.length/s);for(let c=0;c<a;c++)o.push(s+1,128,...r.slice(s*c,s*(c+1)).map(l=>+l));return o.push(r.length%s+1,128,...r.slice(a*s).map(c=>+c)),o.push(1,129,0,59),new Uint8Array(o)}toImage(t=!1){const{height:n,width:r}=this.size(),s=new Uint8Array(n*r*(t?3:4));let o=0;for(let a=0;a<n;a++)for(let c=0;c<r;c++){const l=this.get(c,a)?0:255;s[o++]=l,s[o++]=l,s[o++]=l,t||(s[o++]=255)}return{height:n,width:r,data:s}}}const t6=Object.freeze(["low","medium","quartile","high"]),n6=Object.freeze(["numeric","alphanumeric","byte","kanji","eci"]),h$=[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],p$={low:[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],medium:[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],quartile:[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],high:[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]},m$={low:[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],medium:[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],quartile:[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],high:[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]},Kt=Object.freeze({size:Object.freeze({encode:e=>21+4*(e-1),decode:e=>(e-17)/4}),sizeType:e=>Math.floor((e+7)/17),alignmentPatterns(e){if(e===1)return[];const t=6,n=Kt.size.encode(e)-t-1,r=n-t,s=Math.ceil(r/28);let o=Math.floor(r/s);o%2?o+=1:r%s*2>=s&&(o+=2);const a=[t];for(let c=1;c<s;c++)a.push(n-(s-c)*o);return a.push(n),a},ECCode:Object.freeze({low:1,medium:0,quartile:3,high:2}),formatMask:21522,formatBits(e,t){const n=Kt.ECCode[e]<<3|t;let r=n;for(let s=0;s<10;s++)r=r<<1^(r>>9)*1335;return(n<<10|r)^Kt.formatMask},versionBits(e){let t=e;for(let n=0;n<12;n++)t=t<<1^(t>>11)*7973;return e<<12|t},alphabet:Object.freeze({numeric:Z_("0123456789"),alphanumerc:Z_("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")}),lengthBits(e,t){return{numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[t][Kt.sizeType(e)]},modeBits:Object.freeze({numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"}),capacity(e,t){const n=h$[e-1],r=p$[t][e-1],s=m$[t][e-1],o=Math.floor(n/s)-r,a=s-n%s;return{words:r,numBlocks:s,shortBlocks:a,blockLen:o,capacity:(n-r*s)*8,total:(r+o)*s+s-a}}}),c2=Object.freeze([(e,t)=>(e+t)%2==0,(e,t)=>t%2==0,(e,t)=>e%3==0,(e,t)=>(e+t)%3==0,(e,t)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(e,t)=>e*t%2+e*t%3==0,(e,t)=>(e*t%2+e*t%3)%2==0,(e,t)=>((e+t)%2+e*t%3)%2==0]),fe={tables:(e=>{const t=Br(256,0),n=Br(256,0);for(let r=0,s=1;r<256;r++)t[r]=s,n[s]=r,s<<=1,s&256&&(s^=e);return{exp:t,log:n}})(285),exp:e=>fe.tables.exp[e],log(e){if(e===0)throw new Error(`GF.log: invalid arg=${e}`);return fe.tables.log[e]%255},mul(e,t){return e===0||t===0?0:fe.tables.exp[(fe.tables.log[e]+fe.tables.log[t])%255]},add:(e,t)=>e^t,pow:(e,t)=>fe.tables.exp[fe.tables.log[e]*t%255],inv(e){if(e===0)throw new Error(`GF.inverse: invalid arg=${e}`);return fe.tables.exp[255-fe.tables.log[e]]},polynomial(e){if(e.length==0)throw new Error("GF.polymomial: invalid length");if(e[0]!==0)return e;let t=0;for(;t<e.length-1&&e[t]==0;t++);return e.slice(t)},monomial(e,t){if(e<0)throw new Error(`GF.monomial: invalid degree=${e}`);if(t==0)return[0];let n=Br(e+1,0);return n[0]=t,fe.polynomial(n)},degree:e=>e.length-1,coefficient:(e,t)=>e[fe.degree(e)-t],mulPoly(e,t){if(e[0]===0||t[0]===0)return[0];const n=Br(e.length+t.length-1,0);for(let r=0;r<e.length;r++)for(let s=0;s<t.length;s++)n[r+s]=fe.add(n[r+s],fe.mul(e[r],t[s]));return fe.polynomial(n)},mulPolyScalar(e,t){if(t==0)return[0];if(t==1)return e;const n=Br(e.length,0);for(let r=0;r<e.length;r++)n[r]=fe.mul(e[r],t);return fe.polynomial(n)},mulPolyMonomial(e,t,n){if(t<0)throw new Error("GF.mulPolyMonomial: invalid degree");if(n==0)return[0];const r=Br(e.length+t,0);for(let s=0;s<e.length;s++)r[s]=fe.mul(e[s],n);return fe.polynomial(r)},addPoly(e,t){if(e[0]===0)return t;if(t[0]===0)return e;let n=e,r=t;n.length>r.length&&([n,r]=[r,n]);let s=Br(r.length,0),o=r.length-n.length,a=r.slice(0,o);for(let c=0;c<a.length;c++)s[c]=a[c];for(let c=o;c<r.length;c++)s[c]=fe.add(n[c-o],r[c]);return fe.polynomial(s)},remainderPoly(e,t){const n=Array.from(e);for(let r=0;r<e.length-t.length+1;r++){const s=n[r];if(s!==0)for(let o=1;o<t.length;o++)t[o]!==0&&(n[r+o]=fe.add(n[r+o],fe.mul(t[o],s)))}return n.slice(e.length-t.length+1,n.length)},divisorPoly(e){let t=[1];for(let n=0;n<e;n++)t=fe.mulPoly(t,[1,fe.pow(2,n)]);return t},evalPoly(e,t){if(t==0)return fe.coefficient(e,0);let n=e[0];for(let r=1;r<e.length;r++)n=fe.add(fe.mul(t,n),e[r]);return n},euclidian(e,t,n){fe.degree(e)<fe.degree(t)&&([e,t]=[t,e]);let r=e,s=t,o=[0],a=[1];for(;2*fe.degree(s)>=n;){let u=r,d=o;if(r=s,o=a,r[0]===0)throw new Error("rLast[0] === 0");s=u;let f=[0];const h=fe.inv(r[0]);for(;fe.degree(s)>=fe.degree(r)&&s[0]!==0;){const p=fe.degree(s)-fe.degree(r),m=fe.mul(s[0],h);f=fe.addPoly(f,fe.monomial(p,m)),s=fe.addPoly(s,fe.mulPolyMonomial(r,p,m))}if(f=fe.mulPoly(f,o),a=fe.addPoly(f,d),fe.degree(s)>=fe.degree(r))throw new Error(`Division failed r: ${s}, rLast: ${r}`)}const c=fe.coefficient(a,0);if(c==0)throw new Error("sigmaTilde(0) was zero");const l=fe.inv(c);return[fe.mulPolyScalar(a,l),fe.mulPolyScalar(s,l)]}};function g$(e){return{encode(t){const n=fe.divisorPoly(e),r=Array.from(t);return r.push(...n.slice(0,-1).fill(0)),Uint8Array.from(fe.remainderPoly(r,n))},decode(t){const n=t.slice(),r=fe.polynomial(Array.from(t));let s=Br(e,0),o=!1;for(let f=0;f<e;f++){const h=fe.evalPoly(r,fe.exp(f));s[s.length-1-f]=h,h!==0&&(o=!0)}if(!o)return n;s=fe.polynomial(s);const a=fe.monomial(e,1),[c,l]=fe.euclidian(a,s,e),u=Br(fe.degree(c),0);let d=0;for(let f=1;f<256&&d<u.length;f++)fe.evalPoly(c,f)===0&&(u[d++]=fe.inv(f));if(d!==u.length)throw new Error("RS.decode: invalid errors number");for(let f=0;f<u.length;f++){const h=n.length-1-fe.log(u[f]);if(h<0)throw new Error("RS.decode: invalid error location");const p=fe.inv(u[f]);let m=1;for(let g=0;g<u.length;g++)f!==g&&(m=fe.mul(m,fe.add(1,fe.mul(u[g],p))));n[h]=fe.add(n[h],fe.mul(fe.evalPoly(l,p),fe.inv(m)))}return n}}}function y$(e,t){const{words:n,shortBlocks:r,numBlocks:s,blockLen:o,total:a}=Kt.capacity(e,t),c=g$(n);return{encode(l){const u=[],d=[];for(let m=0;m<s;m++){const g=m<r,_=o+(g?0:1);u.push(l.subarray(0,_)),d.push(c.encode(l.subarray(0,_))),l=l.subarray(_)}const f=X_(u),h=X_(d),p=new Uint8Array(f.length+h.length);return p.set(f),p.set(h,f.length),p},decode(l){if(l.length!==a)throw new Error(`interleave.decode: len(data)=${l.length}, total=${a}`);const u=[];for(let h=0;h<s;h++){const p=h<r;u.push(new Uint8Array(n+o+(p?0:1)))}let d=0;for(let h=0;h<o;h++)for(let p=0;p<s;p++)u[p][h]=l[d++];for(let h=r;h<s;h++)u[h][o]=l[d++];for(let h=o;h<o+n;h++)for(let p=0;p<s;p++){const m=p<r;u[p][h+(m?0:1)]=l[d++]}const f=[];for(const h of u)f.push(...Array.from(c.decode(h)).slice(0,-n));return Uint8Array.from(f)}}}function b$(e,t,n,r=!1){const s=Kt.size.encode(e);let o=new Xt(s+2);const a=new Xt(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);o=o.embed(0,a).embed({x:-a.width,y:0},a).embed({x:0,y:-a.height},a),o=o.rectSlice(1,s);const c=new Xt(1).rect(0,1,!0).border(1,!1).border(1,!0),l=Kt.alignmentPatterns(e);for(const u of l)for(const d of l)o.isDefined(d,u)||o.embed({x:d-2,y:u-2},c);o=o.hLine({x:0,y:6},1/0,({x:u})=>o.isDefined(u,6)?void 0:u%2==0).vLine({x:6,y:0},1/0,({y:u})=>o.isDefined(6,u)?void 0:u%2==0);{const u=Kt.formatBits(t,n),d=f=>!r&&(u>>f&1)==1;for(let f=0;f<6;f++)o.set(8,f,d(f));for(let f=6;f<8;f++)o.set(8,f+1,d(f));for(let f=8;f<15;f++)o.set(8,s-15+f,d(f));for(let f=0;f<8;f++)o.set(s-f-1,8,d(f));for(let f=8;f<9;f++)o.set(15-f-1+1,8,d(f));for(let f=9;f<15;f++)o.set(15-f-1,8,d(f));o.set(8,s-8,!r)}if(e>=7){const u=Kt.versionBits(e);for(let d=0;d<18;d+=1){const f=!r&&(u>>d&1)==1,h=Math.floor(d/3),p=d%3+s-8-3;o.set(p,h,f),o.set(h,p,f)}}return o}function v$(e,t,n){const r=e,s=r.height,o=c2[t];let a=-1,c=s-1;for(let l=s-1;l>0;l-=2){for(l==6&&(l=5);;c+=a){for(let u=0;u<2;u+=1){const d=l-u;r.isDefined(d,c)||n(d,c,o(d,c))}if(c+a<0||c+a>=s)break}a=-a}}function w$(e){let t="numeric";for(let n of e)if(!Kt.alphabet.numeric.has(n)&&(t="alphanumeric",!Kt.alphabet.alphanumerc.has(n)))return"byte";return t}function _$(e){if(typeof e!="string")throw new Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function r6(e,t,n,r,s=_$){let o="",a=n.length;if(r==="numeric"){const h=Kt.alphabet.numeric.decode(n.split("")),p=h.length;for(let m=0;m<p-2;m+=3)o+=Oo(h[m]*100+h[m+1]*10+h[m+2],10);p%3===1?o+=Oo(h[p-1],4):p%3===2&&(o+=Oo(h[p-2]*10+h[p-1],7))}else if(r==="alphanumeric"){const h=Kt.alphabet.alphanumerc.decode(n.split("")),p=h.length;for(let m=0;m<p-1;m+=2)o+=Oo(h[m]*45+h[m+1],11);p%2==1&&(o+=Oo(h[p-1],6))}else if(r==="byte"){const h=s(n);a=h.length,o=Array.from(h).map(p=>Oo(p,8)).join("")}else throw new Error("encode: unsupported type");const{capacity:c}=Kt.capacity(e,t),l=Oo(a,Kt.lengthBits(e,r));let u=Kt.modeBits[r]+l+o;if(u.length>c)throw new Error("Capacity overflow");u+="0".repeat(Math.min(4,Math.max(0,c-u.length))),u.length%8&&(u+="0".repeat(8-u.length%8));const d="1110110000010001";for(let h=0;u.length!==c;h++)u+=d[h%d.length];const f=Uint8Array.from(u.match(/(.{8})/g).map(h=>+`0b${h}`));return y$(e,t).encode(f)}function s6(e,t,n,r,s=!1){const o=b$(e,t,r,s);let a=0;const c=8*n.length;if(v$(o,r,(l,u,d)=>{let f=!1;a<c&&(f=(n[a>>>3]>>(7-a&7)&1)!==0,a++),o.set(l,u,f!==d)}),a!==c)throw new Error("QR: bytes left after draw");return o}const g8=e=>{const t=e.map(n=>n?"1":"0").join("");return{len:t.length,n:+`0b${t}`}},y8=[!0,!1,!0,!0,!0,!1,!0],b8=[!1,!1,!1,!1],sf=g8([...y8,...b8]),o6=g8([...b8,...y8]);function x$(e){const t=e,{width:n,height:r}=t,s=t.transpose();let o=0;for(let h=0;h<r;h++)t.getRuns(h,p=>{p>=5&&(o+=3+(p-5))});for(let h=0;h<n;h++)s.getRuns(h,p=>{p>=5&&(o+=3+(p-5))});let a=0;for(let h=0;h<r-1;h++)a+=3*t.countBoxes2x2(h);let c=0;for(let h=0;h<r;h++)c+=40*t.countPatternInRow(h,sf.len,sf.n,o6.n);for(let h=0;h<n;h++)c+=40*s.countPatternInRow(h,sf.len,sf.n,o6.n);const l=r*n,u=t.popcnt(),f=10*Math.ceil(Math.max(0,Math.abs(u*100-l*50)-l*5)/(l*5));return o+a+c+f}function k$(e,t,n,r){if(r===void 0){const s=f$();for(let o=0;o<c2.length;o++)s.add(x$(s6(e,t,n,o,!0)),o);r=s.get()}if(r===void 0)throw new Error("Cannot find mask");return s6(e,t,n,r)}function C$(e){if(!t6.includes(e))throw new Error(`Invalid error correction mode=${e}. Expected: ${t6}`)}function j$(e){if(!n6.includes(e))throw new Error(`Encoding: invalid mode=${e}. Expected: ${n6}`);if(e==="kanji"||e==="eci")throw new Error(`Encoding: ${e} is not supported (yet?).`)}function S$(e){if(![0,1,2,3,4,5,6,7].includes(e)||!c2[e])throw new Error(`Invalid mask=${e}. Expected number [0..7]`)}function A$(e,t="raw",n={}){const r=n,s=r.ecc!==void 0?r.ecc:"medium";C$(s);const o=r.encoding!==void 0?r.encoding:w$(e);j$(o),r.mask!==void 0&&S$(r.mask);let a=r.version,c,l=new Error("Unknown error");if(a!==void 0)d$(a),c=r6(a,s,e,o,r.textEncoder);else for(let f=1;f<=40;f++)try{c=r6(f,s,e,o,r.textEncoder),a=f;break}catch(h){l=h}if(!a||!c)throw l;let u=k$(a,s,c,r.mask);u.assertDrawn();const d=r.border===void 0?2:r.border;if(!Number.isSafeInteger(d)||d<=0)throw new Error(`invalid border=${d}`);if(u=u.border(d,!1),r.scale!==void 0&&(u=u.scale(r.scale)),t==="raw")return u.toRaw();if(t==="ascii")return u.toASCII();if(t==="svg")return u.toSVG(r.optimize);if(t==="gif")return u.toGIF();if(t==="term")return u.toTerm();throw new Error(`Unknown output: ${t}`)}function E$(e,t={}){const{errorCorrection:n,version:r}=t,s=A$(e,"raw",{border:0,ecc:n,scale:1,version:r});return{edgeLength:s.length,finderLength:7,grid:s,value:e}}function Or(e){const{arena:t,...n}=e;return i.jsxs(Or.Root,{...n,children:[i.jsx(Or.Finder,{}),i.jsx(Or.Cells,{}),t&&i.jsx(Or.Arena,{children:typeof t=="string"?i.jsx("img",{alt:"Arena",src:t,style:{borderRadius:1,height:"100%",objectFit:"cover",width:"100%"}}):t})]})}(function(e){e.Context=S.createContext(null);function t(o){const{children:a,size:c="100%",value:l,version:u,errorCorrection:d,...f}=o,h=S.useMemo(()=>(S.Children.map(a,v=>!S.isValidElement(v)||typeof v.type=="string"?null:"displayName"in v.type&&v.type.displayName==="Arena"?!0:null)??[]).some(Boolean),[a]),p=S.useMemo(()=>{let v=d;return h&&d==="low"&&(v="medium"),E$(l,{errorCorrection:v,version:u})},[l,h,d,u]),m=1,g=p.edgeLength*m,_=p.finderLength*m/2,b=h?Math.floor(g/4):0,y=S.useMemo(()=>({arenaSize:b,cellSize:m,edgeSize:g,qrcode:p,finderSize:_}),[b,g,p,_]);return i.jsx(e.Context.Provider,{value:y,children:i.jsxs("svg",{...f,width:c,height:c,viewBox:`0 0 ${g} ${g}`,xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("title",{children:"QR Code"}),a]})})}e.Root=t,function(o){o.displayName="Root"}(t=e.Root||(e.Root={}));function n(o){const{className:a,fill:c,innerClassName:l,radius:u=.25}=o,{cellSize:d,edgeSize:f,finderSize:h}=S.useContext(e.Context);function p({position:m}){let g=h-(h-d)-d/2;m==="top-right"&&(g=f-h-(h-d)-d/2);let _=h-(h-d)-d/2;m==="bottom-left"&&(_=f-h-(h-d)-d/2);let b=h-d*1.5;m==="top-right"&&(b=f-h-d*1.5);let y=h-d*1.5;return m==="bottom-left"&&(y=f-h-d*1.5),i.jsxs(i.Fragment,{children:[i.jsx("rect",{className:a,stroke:c??"currentColor",fill:"transparent",x:g,y:_,width:d+(h-d)*2,height:d+(h-d)*2,rx:2*u*(h-d),ry:2*u*(h-d),strokeWidth:d}),i.jsx("rect",{className:l,fill:c??"currentColor",x:b,y,width:d*3,height:d*3,rx:2*u*d,ry:2*u*d})]})}return i.jsxs(i.Fragment,{children:[i.jsx(p,{position:"top-left"}),i.jsx(p,{position:"top-right"}),i.jsx(p,{position:"bottom-left"})]})}e.Finder=n,function(o){o.displayName="Finder"}(n=e.Finder||(e.Finder={}));function r(o){const{className:a,fill:c="currentColor",inset:l=!0,radius:u=1}=o,{arenaSize:d,cellSize:f,qrcode:h}=S.useContext(e.Context),{edgeLength:p,finderLength:m}=h,g=S.useMemo(()=>{let _="";for(let b=0;b<h.grid.length;b++){const y=h.grid[b];if(y)for(let v=0;v<y.length;v++){if(!y[v])continue;const x=p/2-d/2,A=x+d;if(b>=x&&b<=A&&v>=x&&v<=A)continue;const C=b<m&&v<m,j=b<m&&v>=p-m,E=b>=p-m&&v<m;if(C||j||E)continue;const I=l?f*.1:0,T=(f-I*2)/2,O=v*f+f/2,B=b*f+f/2,U=O-T,L=O+T,N=B-T,H=B+T,M=u*T;_+=[`M ${U+M},${N}`,`L ${L-M},${N}`,`A ${M},${M} 0 0,1 ${L},${N+M}`,`L ${L},${H-M}`,`A ${M},${M} 0 0,1 ${L-M},${H}`,`L ${U+M},${H}`,`A ${M},${M} 0 0,1 ${U},${H-M}`,`L ${U},${N+M}`,`A ${M},${M} 0 0,1 ${U+M},${N}`,"z"].join(" ")}}return _},[d,f,p,m,h.grid,l,u]);return i.jsx("path",{className:a,d:g,fill:c})}e.Cells=r,function(o){o.displayName="Cells"}(r=e.Cells||(e.Cells={}));function s(o){const{children:a}=o,{arenaSize:c,cellSize:l,edgeSize:u}=S.useContext(e.Context),d=Math.ceil(u/2-c/2),f=c+c%2,h=l/2;return i.jsx("foreignObject",{x:d,y:d,width:f,height:f,children:i.jsx("div",{style:{alignItems:"center",display:"flex",fontSize:1,justifyContent:"center",height:"100%",overflow:"hidden",width:"100%",padding:h,boxSizing:"border-box"},children:a})})}e.Arena=s,function(o){o.displayName="Arena"}(s=e.Arena||(e.Arena={}))})(Or||(Or={}));function N$(e={}){let t,n,r,s;return o=>({id:"baseAccount",name:"Base Account",rdns:"app.base.account",type:"baseAccount",async connect({chainId:a,withCapabilities:c,...l}={}){var u;try{const d=await this.getProvider(),f=a??((u=o.chains[0])==null?void 0:u.id);if(!f)throw new Ns;const h=await d.request({method:"wallet_connect",params:[{capabilities:"capabilities"in l&&l.capabilities?l.capabilities:{},chainIds:[te(f),...o.chains.filter(g=>g.id!==f).map(g=>te(g.id))]}]}),p=h.accounts.map(g=>({address:Ge(g.address),capabilities:g.capabilities??{}}));let m=Number(h.chainIds[0]);if(n||(n=this.onAccountsChanged.bind(this),d.on("accountsChanged",n)),r||(r=this.onChainChanged.bind(this),d.on("chainChanged",r)),s||(s=this.onDisconnect.bind(this),d.on("disconnect",s)),a&&m!==a){const g=await this.switchChain({chainId:a}).catch(_=>{if(_.code===Re.code)throw _;return{id:m}});m=(g==null?void 0:g.id)??m}return{accounts:c?p:p.map(g=>g.address),chainId:m}}catch(d){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(d.message)?new Re(d):d}},async disconnect(){const a=await this.getProvider();n&&(a.removeListener("accountsChanged",n),n=void 0),r&&(a.removeListener("chainChanged",r),r=void 0),s&&(a.removeListener("disconnect",s),s=void 0),a.disconnect()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(c=>Ge(c))},async getChainId(){const c=await(await this.getProvider()).request({method:"eth_chainId"});return Number(c)},async getProvider(){if(!t){const a=(()=>{var u;return typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:((u=e.preference)==null?void 0:u.options)??"all"}})(),{createBaseAccountSDK:c}=await ae(async()=>{const{createBaseAccountSDK:u}=await import("./index-B075MYIF.js");return{createBaseAccountSDK:u}},__vite__mapDeps([0,1]));t=c({...e,appChainIds:o.chains.map(u=>u.id),preference:a}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:a,chainId:c}){var d,f,h,p;const l=o.chains.find(m=>m.id===c);if(!l)throw new jn(new Ns);const u=await this.getProvider();try{return await u.request({method:"wallet_switchEthereumChain",params:[{chainId:te(l.id)}]}),l}catch(m){if(m.code===4902)try{let g;a!=null&&a.blockExplorerUrls?g=a.blockExplorerUrls:g=(d=l.blockExplorers)!=null&&d.default.url?[(f=l.blockExplorers)==null?void 0:f.default.url]:[];let _;(h=a==null?void 0:a.rpcUrls)!=null&&h.length?_=a.rpcUrls:_=[((p=l.rpcUrls.default)==null?void 0:p.http[0])??""];const b={blockExplorerUrls:g,chainId:te(c),chainName:(a==null?void 0:a.chainName)??l.name,iconUrls:a==null?void 0:a.iconUrls,nativeCurrency:(a==null?void 0:a.nativeCurrency)??l.nativeCurrency,rpcUrls:_};return await u.request({method:"wallet_addEthereumChain",params:[b]}),l}catch(g){throw new Re(g)}throw new jn(m)}},onAccountsChanged(a){a.length===0?this.onDisconnect():o.emitter.emit("change",{accounts:a.map(c=>Ge(c))})},onChainChanged(a){const c=Number(a);o.emitter.emit("change",{chainId:c})},async onDisconnect(a){o.emitter.emit("disconnect");const c=await this.getProvider();n&&(c.removeListener("accountsChanged",n),n=void 0),r&&(c.removeListener("chainChanged",r),r=void 0),s&&(c.removeListener("disconnect",s),s=void 0)}})}l2.type="metaMask";function l2(e={}){let t,n,r,s,o,a,c,l;return u=>({id:"metaMaskSDK",name:"MetaMask",rdns:["io.metamask","io.metamask.mobile"],type:l2.type,async setup(){const d=await this.getProvider();d!=null&&d.on&&(a||(a=this.onConnect.bind(this),d.on("connect",a)),s||(s=this.onAccountsChanged.bind(this),d.on("accountsChanged",s)))},async connect({chainId:d,isReconnecting:f,withCapabilities:h}={}){const p=await this.getProvider();c||(c=this.onDisplayUri,p.on("display_uri",c));let m=[];f&&(m=await this.getAccounts().catch(()=>[]));try{let g,_;m!=null&&m.length||(e.connectAndSign||e.connectWith?(e.connectAndSign?g=await t.connectAndSign({msg:e.connectAndSign}):e.connectWith&&(_=await t.connectWith({method:e.connectWith.method,params:e.connectWith.params})),m=await this.getAccounts()):m=(await t.connect()).map(v=>Ge(v)));let b=await this.getChainId();if(d&&b!==d){const y=await this.switchChain({chainId:d}).catch(v=>{if(v.code===Re.code)throw v;return{id:b}});b=(y==null?void 0:y.id)??b}return c&&(p.removeListener("display_uri",c),c=void 0),g?p.emit("connectAndSign",{accounts:m,chainId:b,signResponse:g}):_&&p.emit("connectWith",{accounts:m,chainId:b,connectWithResponse:_}),a&&(p.removeListener("connect",a),a=void 0),s||(s=this.onAccountsChanged.bind(this),p.on("accountsChanged",s)),o||(o=this.onChainChanged.bind(this),p.on("chainChanged",o)),l||(l=this.onDisconnect.bind(this),p.on("disconnect",l)),{accounts:h?m.map(y=>({address:y,capabilities:{}})):m,chainId:b}}catch(g){const _=g;throw _.code===Re.code?new Re(_):_.code===qr.code?new qr(_):_}},async disconnect(){const d=await this.getProvider();o&&(d.removeListener("chainChanged",o),o=void 0),l&&(d.removeListener("disconnect",l),l=void 0),a||(a=this.onConnect.bind(this),d.on("connect",a)),await t.terminate()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(h=>Ge(h))},async getChainId(){const d=await this.getProvider(),f=d.getChainId()||await(d==null?void 0:d.request({method:"eth_chainId"}));return Number(f)},async getProvider(){async function d(){var g,_,b,y,v;const f=await(async()=>{const{default:w}=await ae(async()=>{const{default:x}=await import("./metamask-sdk-DtKlSkak.js");return{default:x}},[]);return typeof w!="function"&&typeof w.default=="function"?w.default:w})(),h={};for(const w of u.chains)h[te(w.id)]=(g=dj({chain:w,transports:u.transports}))==null?void 0:g[0];t=new f({_source:"wagmi",forceDeleteProvider:!1,forceInjectProvider:!1,injectProvider:!1,...e,readonlyRPCMap:h,dappMetadata:{...e.dappMetadata,name:(_=e.dappMetadata)!=null&&_.name?(b=e.dappMetadata)==null?void 0:b.name:"wagmi",url:(y=e.dappMetadata)!=null&&y.url?(v=e.dappMetadata)==null?void 0:v.url:typeof window<"u"?window.location.origin:"https://wagmi.sh"},useDeeplink:e.useDeeplink??!0});const p=await t.init(),m=p!=null&&p.activeProvider?p.activeProvider:t.getProvider();if(!m)throw new Pn;return m}return n||(r||(r=d()),n=await r),n},async isAuthorized(){try{return!!(await mc(()=>sd(()=>this.getAccounts(),{timeout:200}),{delay:201,retryCount:3})).length}catch{return!1}},async switchChain({addEthereumChainParameter:d,chainId:f}){var _,b;const h=await this.getProvider(),p=u.chains.find(y=>y.id===f);if(!p)throw new jn(new Ns);try{return await h.request({method:"wallet_switchEthereumChain",params:[{chainId:te(f)}]}),await m(),await g(f),p}catch(y){const v=y;if(v.code===Re.code)throw new Re(v);if(v.code===4902||((b=(_=v==null?void 0:v.data)==null?void 0:_.originalError)==null?void 0:b.code)===4902)try{return await h.request({method:"wallet_addEthereumChain",params:[{blockExplorerUrls:(()=>{const{default:w,...x}=p.blockExplorers??{};if(d!=null&&d.blockExplorerUrls)return d.blockExplorerUrls;if(w)return[w.url,...Object.values(x).map(A=>A.url)]})(),chainId:te(f),chainName:(d==null?void 0:d.chainName)??p.name,iconUrls:d==null?void 0:d.iconUrls,nativeCurrency:(d==null?void 0:d.nativeCurrency)??p.nativeCurrency,rpcUrls:(()=>{var w,x;return(w=d==null?void 0:d.rpcUrls)!=null&&w.length?d.rpcUrls:[((x=p.rpcUrls.default)==null?void 0:x.http[0])??""]})()}]}),await m(),await g(f),p}catch(w){const x=w;throw x.code===Re.code?new Re(x):new jn(x)}throw new jn(v)}async function m(){await mc(async()=>{const y=tr(await h.request({method:"eth_chainId"}));if(y!==f)throw new Error("User rejected switch after adding network.");return y},{delay:50,retryCount:20})}async function g(y){await new Promise(v=>{const w=x=>{"chainId"in x&&x.chainId===y&&(u.emitter.off("change",w),v())};u.emitter.on("change",w),u.emitter.emit("change",{chainId:y})})}},async onAccountsChanged(d){if(d.length===0)if(t.isExtensionActive())this.onDisconnect();else return;else if(u.emitter.listenerCount("connect")){const f=(await this.getChainId()).toString();this.onConnect({chainId:f})}else u.emitter.emit("change",{accounts:d.map(f=>Ge(f))})},onChainChanged(d){const f=Number(d);u.emitter.emit("change",{chainId:f})},async onConnect(d){const f=await this.getAccounts();if(f.length===0)return;const h=Number(d.chainId);u.emitter.emit("connect",{accounts:f,chainId:h});const p=await this.getProvider();a&&(p.removeListener("connect",a),a=void 0),s||(s=this.onAccountsChanged.bind(this),p.on("accountsChanged",s)),o||(o=this.onChainChanged.bind(this),p.on("chainChanged",o)),l||(l=this.onDisconnect.bind(this),p.on("disconnect",l))},async onDisconnect(d){const f=await this.getProvider();d&&d.code===1013&&f&&(await this.getAccounts()).length||(u.emitter.emit("disconnect"),o&&(f.removeListener("chainChanged",o),o=void 0),l&&(f.removeListener("disconnect",l),l=void 0),a||(a=this.onConnect.bind(this),f.on("connect",a)))},onDisplayUri(d){u.emitter.emit("message",{type:"display_uri",data:d})}})}u2.type="safe";function u2(e={}){const{shimDisconnect:t=!1}=e;let n,r;return s=>({id:"safe",name:"Safe",type:u2.type,async connect({withCapabilities:o}={}){var u;const a=await this.getProvider();if(!a)throw new Pn;const c=await this.getAccounts(),l=await this.getChainId();return r||(r=this.onDisconnect.bind(this),a.on("disconnect",r)),t&&await((u=s.storage)==null?void 0:u.removeItem("safe.disconnected")),{accounts:o?c.map(d=>({address:d,capabilities:{}})):c,chainId:l}},async disconnect(){var a;const o=await this.getProvider();if(!o)throw new Pn;r&&(o.removeListener("disconnect",r),r=void 0),t&&await((a=s.storage)==null?void 0:a.setItem("safe.disconnected",!0))},async getAccounts(){const o=await this.getProvider();if(!o)throw new Pn;return(await o.request({method:"eth_accounts"})).map(Ge)},async getProvider(){if(typeof window<"u"&&(window==null?void 0:window.parent)!==window){if(!n){const{default:a}=await ae(async()=>{const{default:d}=await import("./index-_AI1Rhpq.js");return{default:d}},__vite__mapDeps([2,3])),c=new a(e),l=await sd(()=>c.safe.getInfo(),{timeout:e.unstable_getInfoTimeout??10});if(!l)throw new Error("Could not load Safe information");const u=await(async()=>{const d=await ae(()=>import("./index-B_Jv-Jat.js").then(f=>f.i),__vite__mapDeps([4,3,1,5,6,7]));return typeof d.SafeAppProvider!="function"&&typeof d.default.SafeAppProvider=="function"?d.default.SafeAppProvider:d.SafeAppProvider})();n=new u(l,c)}return n}},async getChainId(){const o=await this.getProvider();if(!o)throw new Pn;return Number(o.chainId)},async isAuthorized(){var o;try{return t&&await((o=s.storage)==null?void 0:o.getItem("safe.disconnected"))?!1:!!(await this.getAccounts()).length}catch{return!1}},onAccountsChanged(){},onChainChanged(){},onDisconnect(){s.emitter.emit("disconnect")}})}d2.type="walletConnect";function d2(e){const t=e.isNewChainsStale??!0;let n,r;const s="eip155";let o,a,c,l,u,d;return f=>({id:"walletConnect",name:"WalletConnect",type:d2.type,async setup(){const h=await this.getProvider().catch(()=>null);h&&(c||(c=this.onConnect.bind(this),h.on("connect",c)),u||(u=this.onSessionDelete.bind(this),h.on("session_delete",u)))},async connect({chainId:h,withCapabilities:p,...m}={}){var g,_;try{const b=await this.getProvider();if(!b)throw new Pn;l||(l=this.onDisplayUri,b.on("display_uri",l));let y=h;if(!y){const A=await((g=f.storage)==null?void 0:g.getItem("state"))??{};f.chains.some(j=>j.id===A.chainId)?y=A.chainId:y=(_=f.chains[0])==null?void 0:_.id}if(!y)throw new Error("No chains found on connector.");const v=await this.isChainsStale();if(b.session&&v&&await b.disconnect(),!b.session||v){const A=f.chains.filter(C=>C.id!==y).map(C=>C.id);await b.connect({optionalChains:[y,...A],..."pairingTopic"in m?{pairingTopic:m.pairingTopic}:{}}),this.setRequestedChainsIds(f.chains.map(C=>C.id))}const w=(await b.enable()).map(A=>Ge(A));let x=await this.getChainId();if(h&&x!==h){const A=await this.switchChain({chainId:h}).catch(C=>{var j;if(C.code===Re.code&&((j=C.cause)==null?void 0:j.message)!=="Missing or invalid. request() method: wallet_addEthereumChain")throw C;return{id:x}});x=(A==null?void 0:A.id)??x}return l&&(b.removeListener("display_uri",l),l=void 0),c&&(b.removeListener("connect",c),c=void 0),o||(o=this.onAccountsChanged.bind(this),b.on("accountsChanged",o)),a||(a=this.onChainChanged.bind(this),b.on("chainChanged",a)),d||(d=this.onDisconnect.bind(this),b.on("disconnect",d)),u||(u=this.onSessionDelete.bind(this),b.on("session_delete",u)),{accounts:p?w.map(A=>({address:A,capabilities:{}})):w,chainId:x}}catch(b){throw/(user rejected|connection request reset)/i.test(b==null?void 0:b.message)?new Re(b):b}},async disconnect(){const h=await this.getProvider();try{await(h==null?void 0:h.disconnect())}catch(p){if(!/No matching key/i.test(p.message))throw p}finally{a&&(h==null||h.removeListener("chainChanged",a),a=void 0),d&&(h==null||h.removeListener("disconnect",d),d=void 0),c||(c=this.onConnect.bind(this),h==null||h.on("connect",c)),o&&(h==null||h.removeListener("accountsChanged",o),o=void 0),u&&(h==null||h.removeListener("session_delete",u),u=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(p=>Ge(p))},async getProvider({chainId:h}={}){var m;async function p(){const g=f.chains.map(b=>b.id);if(!g.length)return;const{EthereumProvider:_}=await ae(async()=>{const{EthereumProvider:b}=await import("./index.es-C70kk3Fw.js").then(y=>y.y);return{EthereumProvider:b}},__vite__mapDeps([8,7]));return await _.init({...e,disableProviderPing:!0,optionalChains:g,projectId:e.projectId,rpcMap:Object.fromEntries(f.chains.map(b=>{const[y]=dj({chain:b,transports:f.transports});return[b.id,y]})),showQrModal:e.showQrModal??!0})}return n||(r||(r=p()),n=await r,n==null||n.events.setMaxListeners(Number.POSITIVE_INFINITY)),h&&await((m=this.switchChain)==null?void 0:m.call(this,{chainId:h})),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[h,p]=await Promise.all([this.getAccounts(),this.getProvider()]);return h.length?await this.isChainsStale()&&p.session?(await p.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:h,chainId:p}){var _,b,y;const m=await this.getProvider();if(!m)throw new Pn;const g=f.chains.find(v=>v.id===p);if(!g)throw new jn(new Ns);try{await Promise.all([new Promise(w=>{const x=({chainId:A})=>{A===p&&(f.emitter.off("change",x),w())};f.emitter.on("change",x)}),m.request({method:"wallet_switchEthereumChain",params:[{chainId:te(p)}]})]);const v=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...v,p]),g}catch(v){const w=v;if(/(user rejected)/i.test(w.message))throw new Re(w);try{let x;h!=null&&h.blockExplorerUrls?x=h.blockExplorerUrls:x=(_=g.blockExplorers)!=null&&_.default.url?[(b=g.blockExplorers)==null?void 0:b.default.url]:[];let A;(y=h==null?void 0:h.rpcUrls)!=null&&y.length?A=h.rpcUrls:A=[...g.rpcUrls.default.http];const C={blockExplorerUrls:x,chainId:te(p),chainName:(h==null?void 0:h.chainName)??g.name,iconUrls:h==null?void 0:h.iconUrls,nativeCurrency:(h==null?void 0:h.nativeCurrency)??g.nativeCurrency,rpcUrls:A};await m.request({method:"wallet_addEthereumChain",params:[C]});const j=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...j,p]),g}catch(x){throw new Re(x)}}},onAccountsChanged(h){h.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:h.map(p=>Ge(p))})},onChainChanged(h){const p=Number(h);f.emitter.emit("change",{chainId:p})},async onConnect(h){const p=Number(h.chainId),m=await this.getAccounts();f.emitter.emit("connect",{accounts:m,chainId:p})},async onDisconnect(h){this.setRequestedChainsIds([]),f.emitter.emit("disconnect");const p=await this.getProvider();o&&(p.removeListener("accountsChanged",o),o=void 0),a&&(p.removeListener("chainChanged",a),a=void 0),d&&(p.removeListener("disconnect",d),d=void 0),u&&(p.removeListener("session_delete",u),u=void 0),c||(c=this.onConnect.bind(this),p.on("connect",c))},onDisplayUri(h){f.emitter.emit("message",{type:"display_uri",data:h})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){var p,m,g;return n?((g=(m=(p=n.session)==null?void 0:p.namespaces[s])==null?void 0:m.accounts)==null?void 0:g.map(_=>Number.parseInt(_.split(":")[1]||"",10)))??[]:[]},async getRequestedChainsIds(){var h;return await((h=f.storage)==null?void 0:h.getItem(this.requestedChainsStorageKey))??[]},async isChainsStale(){if(!t)return!1;const h=f.chains.map(g=>g.id),p=this.getNamespaceChainsIds();if(p.length&&!p.some(g=>h.includes(g)))return!1;const m=await this.getRequestedChainsIds();return!h.every(g=>m.includes(g))},async setRequestedChainsIds(h){var p;await((p=f.storage)==null?void 0:p.setItem(this.requestedChainsStorageKey,h))},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}})}var Sh={},I$=768,Za=K9({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),v8=dk({conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0}}),Ug=eE({conditions:{defaultCondition:"base",conditionNames:["base","hover","active"],responsiveArray:void 0},styles:{background:{values:{accentColor:{conditions:{base:"ju367v9i",hover:"ju367v9j",active:"ju367v9k"},defaultClass:"ju367v9i"},accentColorForeground:{conditions:{base:"ju367v9l",hover:"ju367v9m",active:"ju367v9n"},defaultClass:"ju367v9l"},actionButtonBorder:{conditions:{base:"ju367v9o",hover:"ju367v9p",active:"ju367v9q"},defaultClass:"ju367v9o"},actionButtonBorderMobile:{conditions:{base:"ju367v9r",hover:"ju367v9s",active:"ju367v9t"},defaultClass:"ju367v9r"},actionButtonSecondaryBackground:{conditions:{base:"ju367v9u",hover:"ju367v9v",active:"ju367v9w"},defaultClass:"ju367v9u"},closeButton:{conditions:{base:"ju367v9x",hover:"ju367v9y",active:"ju367v9z"},defaultClass:"ju367v9x"},closeButtonBackground:{conditions:{base:"ju367va0",hover:"ju367va1",active:"ju367va2"},defaultClass:"ju367va0"},connectButtonBackground:{conditions:{base:"ju367va3",hover:"ju367va4",active:"ju367va5"},defaultClass:"ju367va3"},connectButtonBackgroundError:{conditions:{base:"ju367va6",hover:"ju367va7",active:"ju367va8"},defaultClass:"ju367va6"},connectButtonInnerBackground:{conditions:{base:"ju367va9",hover:"ju367vaa",active:"ju367vab"},defaultClass:"ju367va9"},connectButtonText:{conditions:{base:"ju367vac",hover:"ju367vad",active:"ju367vae"},defaultClass:"ju367vac"},connectButtonTextError:{conditions:{base:"ju367vaf",hover:"ju367vag",active:"ju367vah"},defaultClass:"ju367vaf"},connectionIndicator:{conditions:{base:"ju367vai",hover:"ju367vaj",active:"ju367vak"},defaultClass:"ju367vai"},downloadBottomCardBackground:{conditions:{base:"ju367val",hover:"ju367vam",active:"ju367van"},defaultClass:"ju367val"},downloadTopCardBackground:{conditions:{base:"ju367vao",hover:"ju367vap",active:"ju367vaq"},defaultClass:"ju367vao"},error:{conditions:{base:"ju367var",hover:"ju367vas",active:"ju367vat"},defaultClass:"ju367var"},generalBorder:{conditions:{base:"ju367vau",hover:"ju367vav",active:"ju367vaw"},defaultClass:"ju367vau"},generalBorderDim:{conditions:{base:"ju367vax",hover:"ju367vay",active:"ju367vaz"},defaultClass:"ju367vax"},menuItemBackground:{conditions:{base:"ju367vb0",hover:"ju367vb1",active:"ju367vb2"},defaultClass:"ju367vb0"},modalBackdrop:{conditions:{base:"ju367vb3",hover:"ju367vb4",active:"ju367vb5"},defaultClass:"ju367vb3"},modalBackground:{conditions:{base:"ju367vb6",hover:"ju367vb7",active:"ju367vb8"},defaultClass:"ju367vb6"},modalBorder:{conditions:{base:"ju367vb9",hover:"ju367vba",active:"ju367vbb"},defaultClass:"ju367vb9"},modalText:{conditions:{base:"ju367vbc",hover:"ju367vbd",active:"ju367vbe"},defaultClass:"ju367vbc"},modalTextDim:{conditions:{base:"ju367vbf",hover:"ju367vbg",active:"ju367vbh"},defaultClass:"ju367vbf"},modalTextSecondary:{conditions:{base:"ju367vbi",hover:"ju367vbj",active:"ju367vbk"},defaultClass:"ju367vbi"},profileAction:{conditions:{base:"ju367vbl",hover:"ju367vbm",active:"ju367vbn"},defaultClass:"ju367vbl"},profileActionHover:{conditions:{base:"ju367vbo",hover:"ju367vbp",active:"ju367vbq"},defaultClass:"ju367vbo"},profileForeground:{conditions:{base:"ju367vbr",hover:"ju367vbs",active:"ju367vbt"},defaultClass:"ju367vbr"},selectedOptionBorder:{conditions:{base:"ju367vbu",hover:"ju367vbv",active:"ju367vbw"},defaultClass:"ju367vbu"},standby:{conditions:{base:"ju367vbx",hover:"ju367vby",active:"ju367vbz"},defaultClass:"ju367vbx"}}},borderColor:{values:{accentColor:{conditions:{base:"ju367vc0",hover:"ju367vc1",active:"ju367vc2"},defaultClass:"ju367vc0"},accentColorForeground:{conditions:{base:"ju367vc3",hover:"ju367vc4",active:"ju367vc5"},defaultClass:"ju367vc3"},actionButtonBorder:{conditions:{base:"ju367vc6",hover:"ju367vc7",active:"ju367vc8"},defaultClass:"ju367vc6"},actionButtonBorderMobile:{conditions:{base:"ju367vc9",hover:"ju367vca",active:"ju367vcb"},defaultClass:"ju367vc9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vcc",hover:"ju367vcd",active:"ju367vce"},defaultClass:"ju367vcc"},closeButton:{conditions:{base:"ju367vcf",hover:"ju367vcg",active:"ju367vch"},defaultClass:"ju367vcf"},closeButtonBackground:{conditions:{base:"ju367vci",hover:"ju367vcj",active:"ju367vck"},defaultClass:"ju367vci"},connectButtonBackground:{conditions:{base:"ju367vcl",hover:"ju367vcm",active:"ju367vcn"},defaultClass:"ju367vcl"},connectButtonBackgroundError:{conditions:{base:"ju367vco",hover:"ju367vcp",active:"ju367vcq"},defaultClass:"ju367vco"},connectButtonInnerBackground:{conditions:{base:"ju367vcr",hover:"ju367vcs",active:"ju367vct"},defaultClass:"ju367vcr"},connectButtonText:{conditions:{base:"ju367vcu",hover:"ju367vcv",active:"ju367vcw"},defaultClass:"ju367vcu"},connectButtonTextError:{conditions:{base:"ju367vcx",hover:"ju367vcy",active:"ju367vcz"},defaultClass:"ju367vcx"},connectionIndicator:{conditions:{base:"ju367vd0",hover:"ju367vd1",active:"ju367vd2"},defaultClass:"ju367vd0"},downloadBottomCardBackground:{conditions:{base:"ju367vd3",hover:"ju367vd4",active:"ju367vd5"},defaultClass:"ju367vd3"},downloadTopCardBackground:{conditions:{base:"ju367vd6",hover:"ju367vd7",active:"ju367vd8"},defaultClass:"ju367vd6"},error:{conditions:{base:"ju367vd9",hover:"ju367vda",active:"ju367vdb"},defaultClass:"ju367vd9"},generalBorder:{conditions:{base:"ju367vdc",hover:"ju367vdd",active:"ju367vde"},defaultClass:"ju367vdc"},generalBorderDim:{conditions:{base:"ju367vdf",hover:"ju367vdg",active:"ju367vdh"},defaultClass:"ju367vdf"},menuItemBackground:{conditions:{base:"ju367vdi",hover:"ju367vdj",active:"ju367vdk"},defaultClass:"ju367vdi"},modalBackdrop:{conditions:{base:"ju367vdl",hover:"ju367vdm",active:"ju367vdn"},defaultClass:"ju367vdl"},modalBackground:{conditions:{base:"ju367vdo",hover:"ju367vdp",active:"ju367vdq"},defaultClass:"ju367vdo"},modalBorder:{conditions:{base:"ju367vdr",hover:"ju367vds",active:"ju367vdt"},defaultClass:"ju367vdr"},modalText:{conditions:{base:"ju367vdu",hover:"ju367vdv",active:"ju367vdw"},defaultClass:"ju367vdu"},modalTextDim:{conditions:{base:"ju367vdx",hover:"ju367vdy",active:"ju367vdz"},defaultClass:"ju367vdx"},modalTextSecondary:{conditions:{base:"ju367ve0",hover:"ju367ve1",active:"ju367ve2"},defaultClass:"ju367ve0"},profileAction:{conditions:{base:"ju367ve3",hover:"ju367ve4",active:"ju367ve5"},defaultClass:"ju367ve3"},profileActionHover:{conditions:{base:"ju367ve6",hover:"ju367ve7",active:"ju367ve8"},defaultClass:"ju367ve6"},profileForeground:{conditions:{base:"ju367ve9",hover:"ju367vea",active:"ju367veb"},defaultClass:"ju367ve9"},selectedOptionBorder:{conditions:{base:"ju367vec",hover:"ju367ved",active:"ju367vee"},defaultClass:"ju367vec"},standby:{conditions:{base:"ju367vef",hover:"ju367veg",active:"ju367veh"},defaultClass:"ju367vef"}}},boxShadow:{values:{connectButton:{conditions:{base:"ju367vei",hover:"ju367vej",active:"ju367vek"},defaultClass:"ju367vei"},dialog:{conditions:{base:"ju367vel",hover:"ju367vem",active:"ju367ven"},defaultClass:"ju367vel"},profileDetailsAction:{conditions:{base:"ju367veo",hover:"ju367vep",active:"ju367veq"},defaultClass:"ju367veo"},selectedOption:{conditions:{base:"ju367ver",hover:"ju367ves",active:"ju367vet"},defaultClass:"ju367ver"},selectedWallet:{conditions:{base:"ju367veu",hover:"ju367vev",active:"ju367vew"},defaultClass:"ju367veu"},walletLogo:{conditions:{base:"ju367vex",hover:"ju367vey",active:"ju367vez"},defaultClass:"ju367vex"}}},color:{values:{accentColor:{conditions:{base:"ju367vf0",hover:"ju367vf1",active:"ju367vf2"},defaultClass:"ju367vf0"},accentColorForeground:{conditions:{base:"ju367vf3",hover:"ju367vf4",active:"ju367vf5"},defaultClass:"ju367vf3"},actionButtonBorder:{conditions:{base:"ju367vf6",hover:"ju367vf7",active:"ju367vf8"},defaultClass:"ju367vf6"},actionButtonBorderMobile:{conditions:{base:"ju367vf9",hover:"ju367vfa",active:"ju367vfb"},defaultClass:"ju367vf9"},actionButtonSecondaryBackground:{conditions:{base:"ju367vfc",hover:"ju367vfd",active:"ju367vfe"},defaultClass:"ju367vfc"},closeButton:{conditions:{base:"ju367vff",hover:"ju367vfg",active:"ju367vfh"},defaultClass:"ju367vff"},closeButtonBackground:{conditions:{base:"ju367vfi",hover:"ju367vfj",active:"ju367vfk"},defaultClass:"ju367vfi"},connectButtonBackground:{conditions:{base:"ju367vfl",hover:"ju367vfm",active:"ju367vfn"},defaultClass:"ju367vfl"},connectButtonBackgroundError:{conditions:{base:"ju367vfo",hover:"ju367vfp",active:"ju367vfq"},defaultClass:"ju367vfo"},connectButtonInnerBackground:{conditions:{base:"ju367vfr",hover:"ju367vfs",active:"ju367vft"},defaultClass:"ju367vfr"},connectButtonText:{conditions:{base:"ju367vfu",hover:"ju367vfv",active:"ju367vfw"},defaultClass:"ju367vfu"},connectButtonTextError:{conditions:{base:"ju367vfx",hover:"ju367vfy",active:"ju367vfz"},defaultClass:"ju367vfx"},connectionIndicator:{conditions:{base:"ju367vg0",hover:"ju367vg1",active:"ju367vg2"},defaultClass:"ju367vg0"},downloadBottomCardBackground:{conditions:{base:"ju367vg3",hover:"ju367vg4",active:"ju367vg5"},defaultClass:"ju367vg3"},downloadTopCardBackground:{conditions:{base:"ju367vg6",hover:"ju367vg7",active:"ju367vg8"},defaultClass:"ju367vg6"},error:{conditions:{base:"ju367vg9",hover:"ju367vga",active:"ju367vgb"},defaultClass:"ju367vg9"},generalBorder:{conditions:{base:"ju367vgc",hover:"ju367vgd",active:"ju367vge"},defaultClass:"ju367vgc"},generalBorderDim:{conditions:{base:"ju367vgf",hover:"ju367vgg",active:"ju367vgh"},defaultClass:"ju367vgf"},menuItemBackground:{conditions:{base:"ju367vgi",hover:"ju367vgj",active:"ju367vgk"},defaultClass:"ju367vgi"},modalBackdrop:{conditions:{base:"ju367vgl",hover:"ju367vgm",active:"ju367vgn"},defaultClass:"ju367vgl"},modalBackground:{conditions:{base:"ju367vgo",hover:"ju367vgp",active:"ju367vgq"},defaultClass:"ju367vgo"},modalBorder:{conditions:{base:"ju367vgr",hover:"ju367vgs",active:"ju367vgt"},defaultClass:"ju367vgr"},modalText:{conditions:{base:"ju367vgu",hover:"ju367vgv",active:"ju367vgw"},defaultClass:"ju367vgu"},modalTextDim:{conditions:{base:"ju367vgx",hover:"ju367vgy",active:"ju367vgz"},defaultClass:"ju367vgx"},modalTextSecondary:{conditions:{base:"ju367vh0",hover:"ju367vh1",active:"ju367vh2"},defaultClass:"ju367vh0"},profileAction:{conditions:{base:"ju367vh3",hover:"ju367vh4",active:"ju367vh5"},defaultClass:"ju367vh3"},profileActionHover:{conditions:{base:"ju367vh6",hover:"ju367vh7",active:"ju367vh8"},defaultClass:"ju367vh6"},profileForeground:{conditions:{base:"ju367vh9",hover:"ju367vha",active:"ju367vhb"},defaultClass:"ju367vh9"},selectedOptionBorder:{conditions:{base:"ju367vhc",hover:"ju367vhd",active:"ju367vhe"},defaultClass:"ju367vhc"},standby:{conditions:{base:"ju367vhf",hover:"ju367vhg",active:"ju367vhh"},defaultClass:"ju367vhf"}}}}},{conditions:{defaultCondition:"smallScreen",conditionNames:["smallScreen","largeScreen"],responsiveArray:void 0},styles:{alignItems:{values:{"flex-start":{conditions:{smallScreen:"ju367v0",largeScreen:"ju367v1"},defaultClass:"ju367v0"},"flex-end":{conditions:{smallScreen:"ju367v2",largeScreen:"ju367v3"},defaultClass:"ju367v2"},center:{conditions:{smallScreen:"ju367v4",largeScreen:"ju367v5"},defaultClass:"ju367v4"}}},display:{values:{none:{conditions:{smallScreen:"ju367v6",largeScreen:"ju367v7"},defaultClass:"ju367v6"},block:{conditions:{smallScreen:"ju367v8",largeScreen:"ju367v9"},defaultClass:"ju367v8"},flex:{conditions:{smallScreen:"ju367va",largeScreen:"ju367vb"},defaultClass:"ju367va"},inline:{conditions:{smallScreen:"ju367vc",largeScreen:"ju367vd"},defaultClass:"ju367vc"}}}}},{conditions:void 0,styles:{margin:{mappings:["marginTop","marginBottom","marginLeft","marginRight"]},marginX:{mappings:["marginLeft","marginRight"]},marginY:{mappings:["marginTop","marginBottom"]},padding:{mappings:["paddingTop","paddingBottom","paddingLeft","paddingRight"]},paddingX:{mappings:["paddingLeft","paddingRight"]},paddingY:{mappings:["paddingTop","paddingBottom"]},alignSelf:{values:{"flex-start":{defaultClass:"ju367ve"},"flex-end":{defaultClass:"ju367vf"},center:{defaultClass:"ju367vg"}}},backgroundSize:{values:{cover:{defaultClass:"ju367vh"}}},borderRadius:{values:{1:{defaultClass:"ju367vi"},6:{defaultClass:"ju367vj"},10:{defaultClass:"ju367vk"},13:{defaultClass:"ju367vl"},actionButton:{defaultClass:"ju367vm"},connectButton:{defaultClass:"ju367vn"},menuButton:{defaultClass:"ju367vo"},modal:{defaultClass:"ju367vp"},modalMobile:{defaultClass:"ju367vq"},"25%":{defaultClass:"ju367vr"},full:{defaultClass:"ju367vs"}}},borderStyle:{values:{solid:{defaultClass:"ju367vt"}}},borderWidth:{values:{0:{defaultClass:"ju367vu"},1:{defaultClass:"ju367vv"},2:{defaultClass:"ju367vw"},4:{defaultClass:"ju367vx"}}},cursor:{values:{pointer:{defaultClass:"ju367vy"},none:{defaultClass:"ju367vz"}}},pointerEvents:{values:{none:{defaultClass:"ju367v10"},all:{defaultClass:"ju367v11"}}},minHeight:{values:{8:{defaultClass:"ju367v12"},44:{defaultClass:"ju367v13"}}},flexDirection:{values:{row:{defaultClass:"ju367v14"},column:{defaultClass:"ju367v15"}}},fontFamily:{values:{body:{defaultClass:"ju367v16"}}},fontSize:{values:{12:{defaultClass:"ju367v17"},13:{defaultClass:"ju367v18"},14:{defaultClass:"ju367v19"},16:{defaultClass:"ju367v1a"},18:{defaultClass:"ju367v1b"},20:{defaultClass:"ju367v1c"},23:{defaultClass:"ju367v1d"}}},fontWeight:{values:{regular:{defaultClass:"ju367v1e"},medium:{defaultClass:"ju367v1f"},semibold:{defaultClass:"ju367v1g"},bold:{defaultClass:"ju367v1h"},heavy:{defaultClass:"ju367v1i"}}},gap:{values:{0:{defaultClass:"ju367v1j"},1:{defaultClass:"ju367v1k"},2:{defaultClass:"ju367v1l"},3:{defaultClass:"ju367v1m"},4:{defaultClass:"ju367v1n"},5:{defaultClass:"ju367v1o"},6:{defaultClass:"ju367v1p"},8:{defaultClass:"ju367v1q"},10:{defaultClass:"ju367v1r"},12:{defaultClass:"ju367v1s"},14:{defaultClass:"ju367v1t"},16:{defaultClass:"ju367v1u"},18:{defaultClass:"ju367v1v"},20:{defaultClass:"ju367v1w"},24:{defaultClass:"ju367v1x"},28:{defaultClass:"ju367v1y"},32:{defaultClass:"ju367v1z"},36:{defaultClass:"ju367v20"},44:{defaultClass:"ju367v21"},64:{defaultClass:"ju367v22"},"-1":{defaultClass:"ju367v23"}}},height:{values:{1:{defaultClass:"ju367v24"},2:{defaultClass:"ju367v25"},4:{defaultClass:"ju367v26"},8:{defaultClass:"ju367v27"},12:{defaultClass:"ju367v28"},20:{defaultClass:"ju367v29"},24:{defaultClass:"ju367v2a"},28:{defaultClass:"ju367v2b"},30:{defaultClass:"ju367v2c"},32:{defaultClass:"ju367v2d"},34:{defaultClass:"ju367v2e"},36:{defaultClass:"ju367v2f"},40:{defaultClass:"ju367v2g"},44:{defaultClass:"ju367v2h"},48:{defaultClass:"ju367v2i"},54:{defaultClass:"ju367v2j"},60:{defaultClass:"ju367v2k"},200:{defaultClass:"ju367v2l"},full:{defaultClass:"ju367v2m"},max:{defaultClass:"ju367v2n"}}},justifyContent:{values:{"flex-start":{defaultClass:"ju367v2o"},"flex-end":{defaultClass:"ju367v2p"},center:{defaultClass:"ju367v2q"},"space-between":{defaultClass:"ju367v2r"},"space-around":{defaultClass:"ju367v2s"}}},textAlign:{values:{left:{defaultClass:"ju367v2t"},center:{defaultClass:"ju367v2u"},inherit:{defaultClass:"ju367v2v"}}},marginBottom:{values:{0:{defaultClass:"ju367v2w"},1:{defaultClass:"ju367v2x"},2:{defaultClass:"ju367v2y"},3:{defaultClass:"ju367v2z"},4:{defaultClass:"ju367v30"},5:{defaultClass:"ju367v31"},6:{defaultClass:"ju367v32"},8:{defaultClass:"ju367v33"},10:{defaultClass:"ju367v34"},12:{defaultClass:"ju367v35"},14:{defaultClass:"ju367v36"},16:{defaultClass:"ju367v37"},18:{defaultClass:"ju367v38"},20:{defaultClass:"ju367v39"},24:{defaultClass:"ju367v3a"},28:{defaultClass:"ju367v3b"},32:{defaultClass:"ju367v3c"},36:{defaultClass:"ju367v3d"},44:{defaultClass:"ju367v3e"},64:{defaultClass:"ju367v3f"},"-1":{defaultClass:"ju367v3g"}}},marginLeft:{values:{0:{defaultClass:"ju367v3h"},1:{defaultClass:"ju367v3i"},2:{defaultClass:"ju367v3j"},3:{defaultClass:"ju367v3k"},4:{defaultClass:"ju367v3l"},5:{defaultClass:"ju367v3m"},6:{defaultClass:"ju367v3n"},8:{defaultClass:"ju367v3o"},10:{defaultClass:"ju367v3p"},12:{defaultClass:"ju367v3q"},14:{defaultClass:"ju367v3r"},16:{defaultClass:"ju367v3s"},18:{defaultClass:"ju367v3t"},20:{defaultClass:"ju367v3u"},24:{defaultClass:"ju367v3v"},28:{defaultClass:"ju367v3w"},32:{defaultClass:"ju367v3x"},36:{defaultClass:"ju367v3y"},44:{defaultClass:"ju367v3z"},64:{defaultClass:"ju367v40"},"-1":{defaultClass:"ju367v41"}}},marginRight:{values:{0:{defaultClass:"ju367v42"},1:{defaultClass:"ju367v43"},2:{defaultClass:"ju367v44"},3:{defaultClass:"ju367v45"},4:{defaultClass:"ju367v46"},5:{defaultClass:"ju367v47"},6:{defaultClass:"ju367v48"},8:{defaultClass:"ju367v49"},10:{defaultClass:"ju367v4a"},12:{defaultClass:"ju367v4b"},14:{defaultClass:"ju367v4c"},16:{defaultClass:"ju367v4d"},18:{defaultClass:"ju367v4e"},20:{defaultClass:"ju367v4f"},24:{defaultClass:"ju367v4g"},28:{defaultClass:"ju367v4h"},32:{defaultClass:"ju367v4i"},36:{defaultClass:"ju367v4j"},44:{defaultClass:"ju367v4k"},64:{defaultClass:"ju367v4l"},"-1":{defaultClass:"ju367v4m"}}},marginTop:{values:{0:{defaultClass:"ju367v4n"},1:{defaultClass:"ju367v4o"},2:{defaultClass:"ju367v4p"},3:{defaultClass:"ju367v4q"},4:{defaultClass:"ju367v4r"},5:{defaultClass:"ju367v4s"},6:{defaultClass:"ju367v4t"},8:{defaultClass:"ju367v4u"},10:{defaultClass:"ju367v4v"},12:{defaultClass:"ju367v4w"},14:{defaultClass:"ju367v4x"},16:{defaultClass:"ju367v4y"},18:{defaultClass:"ju367v4z"},20:{defaultClass:"ju367v50"},24:{defaultClass:"ju367v51"},28:{defaultClass:"ju367v52"},32:{defaultClass:"ju367v53"},36:{defaultClass:"ju367v54"},44:{defaultClass:"ju367v55"},64:{defaultClass:"ju367v56"},"-1":{defaultClass:"ju367v57"}}},maxWidth:{values:{1:{defaultClass:"ju367v58"},2:{defaultClass:"ju367v59"},4:{defaultClass:"ju367v5a"},8:{defaultClass:"ju367v5b"},12:{defaultClass:"ju367v5c"},20:{defaultClass:"ju367v5d"},24:{defaultClass:"ju367v5e"},28:{defaultClass:"ju367v5f"},30:{defaultClass:"ju367v5g"},32:{defaultClass:"ju367v5h"},34:{defaultClass:"ju367v5i"},36:{defaultClass:"ju367v5j"},40:{defaultClass:"ju367v5k"},44:{defaultClass:"ju367v5l"},48:{defaultClass:"ju367v5m"},54:{defaultClass:"ju367v5n"},60:{defaultClass:"ju367v5o"},200:{defaultClass:"ju367v5p"},full:{defaultClass:"ju367v5q"},max:{defaultClass:"ju367v5r"}}},minWidth:{values:{1:{defaultClass:"ju367v5s"},2:{defaultClass:"ju367v5t"},4:{defaultClass:"ju367v5u"},8:{defaultClass:"ju367v5v"},12:{defaultClass:"ju367v5w"},20:{defaultClass:"ju367v5x"},24:{defaultClass:"ju367v5y"},28:{defaultClass:"ju367v5z"},30:{defaultClass:"ju367v60"},32:{defaultClass:"ju367v61"},34:{defaultClass:"ju367v62"},36:{defaultClass:"ju367v63"},40:{defaultClass:"ju367v64"},44:{defaultClass:"ju367v65"},48:{defaultClass:"ju367v66"},54:{defaultClass:"ju367v67"},60:{defaultClass:"ju367v68"},200:{defaultClass:"ju367v69"},full:{defaultClass:"ju367v6a"},max:{defaultClass:"ju367v6b"}}},overflow:{values:{hidden:{defaultClass:"ju367v6c"}}},paddingBottom:{values:{0:{defaultClass:"ju367v6d"},1:{defaultClass:"ju367v6e"},2:{defaultClass:"ju367v6f"},3:{defaultClass:"ju367v6g"},4:{defaultClass:"ju367v6h"},5:{defaultClass:"ju367v6i"},6:{defaultClass:"ju367v6j"},8:{defaultClass:"ju367v6k"},10:{defaultClass:"ju367v6l"},12:{defaultClass:"ju367v6m"},14:{defaultClass:"ju367v6n"},16:{defaultClass:"ju367v6o"},18:{defaultClass:"ju367v6p"},20:{defaultClass:"ju367v6q"},24:{defaultClass:"ju367v6r"},28:{defaultClass:"ju367v6s"},32:{defaultClass:"ju367v6t"},36:{defaultClass:"ju367v6u"},44:{defaultClass:"ju367v6v"},64:{defaultClass:"ju367v6w"},"-1":{defaultClass:"ju367v6x"}}},paddingLeft:{values:{0:{defaultClass:"ju367v6y"},1:{defaultClass:"ju367v6z"},2:{defaultClass:"ju367v70"},3:{defaultClass:"ju367v71"},4:{defaultClass:"ju367v72"},5:{defaultClass:"ju367v73"},6:{defaultClass:"ju367v74"},8:{defaultClass:"ju367v75"},10:{defaultClass:"ju367v76"},12:{defaultClass:"ju367v77"},14:{defaultClass:"ju367v78"},16:{defaultClass:"ju367v79"},18:{defaultClass:"ju367v7a"},20:{defaultClass:"ju367v7b"},24:{defaultClass:"ju367v7c"},28:{defaultClass:"ju367v7d"},32:{defaultClass:"ju367v7e"},36:{defaultClass:"ju367v7f"},44:{defaultClass:"ju367v7g"},64:{defaultClass:"ju367v7h"},"-1":{defaultClass:"ju367v7i"}}},paddingRight:{values:{0:{defaultClass:"ju367v7j"},1:{defaultClass:"ju367v7k"},2:{defaultClass:"ju367v7l"},3:{defaultClass:"ju367v7m"},4:{defaultClass:"ju367v7n"},5:{defaultClass:"ju367v7o"},6:{defaultClass:"ju367v7p"},8:{defaultClass:"ju367v7q"},10:{defaultClass:"ju367v7r"},12:{defaultClass:"ju367v7s"},14:{defaultClass:"ju367v7t"},16:{defaultClass:"ju367v7u"},18:{defaultClass:"ju367v7v"},20:{defaultClass:"ju367v7w"},24:{defaultClass:"ju367v7x"},28:{defaultClass:"ju367v7y"},32:{defaultClass:"ju367v7z"},36:{defaultClass:"ju367v80"},44:{defaultClass:"ju367v81"},64:{defaultClass:"ju367v82"},"-1":{defaultClass:"ju367v83"}}},paddingTop:{values:{0:{defaultClass:"ju367v84"},1:{defaultClass:"ju367v85"},2:{defaultClass:"ju367v86"},3:{defaultClass:"ju367v87"},4:{defaultClass:"ju367v88"},5:{defaultClass:"ju367v89"},6:{defaultClass:"ju367v8a"},8:{defaultClass:"ju367v8b"},10:{defaultClass:"ju367v8c"},12:{defaultClass:"ju367v8d"},14:{defaultClass:"ju367v8e"},16:{defaultClass:"ju367v8f"},18:{defaultClass:"ju367v8g"},20:{defaultClass:"ju367v8h"},24:{defaultClass:"ju367v8i"},28:{defaultClass:"ju367v8j"},32:{defaultClass:"ju367v8k"},36:{defaultClass:"ju367v8l"},44:{defaultClass:"ju367v8m"},64:{defaultClass:"ju367v8n"},"-1":{defaultClass:"ju367v8o"}}},position:{values:{absolute:{defaultClass:"ju367v8p"},fixed:{defaultClass:"ju367v8q"},relative:{defaultClass:"ju367v8r"}}},WebkitUserSelect:{values:{none:{defaultClass:"ju367v8s"}}},right:{values:{0:{defaultClass:"ju367v8t"}}},transition:{values:{default:{defaultClass:"ju367v8u"},transform:{defaultClass:"ju367v8v"}}},userSelect:{values:{none:{defaultClass:"ju367v8w"}}},width:{values:{1:{defaultClass:"ju367v8x"},2:{defaultClass:"ju367v8y"},4:{defaultClass:"ju367v8z"},8:{defaultClass:"ju367v90"},12:{defaultClass:"ju367v91"},20:{defaultClass:"ju367v92"},24:{defaultClass:"ju367v93"},28:{defaultClass:"ju367v94"},30:{defaultClass:"ju367v95"},32:{defaultClass:"ju367v96"},34:{defaultClass:"ju367v97"},36:{defaultClass:"ju367v98"},40:{defaultClass:"ju367v99"},44:{defaultClass:"ju367v9a"},48:{defaultClass:"ju367v9b"},54:{defaultClass:"ju367v9c"},60:{defaultClass:"ju367v9d"},200:{defaultClass:"ju367v9e"},full:{defaultClass:"ju367v9f"},max:{defaultClass:"ju367v9g"}}},backdropFilter:{values:{modalOverlay:{defaultClass:"ju367v9h"}}}}}),a6={colors:{accentColor:"var(--rk-colors-accentColor)",accentColorForeground:"var(--rk-colors-accentColorForeground)",actionButtonBorder:"var(--rk-colors-actionButtonBorder)",actionButtonBorderMobile:"var(--rk-colors-actionButtonBorderMobile)",actionButtonSecondaryBackground:"var(--rk-colors-actionButtonSecondaryBackground)",closeButton:"var(--rk-colors-closeButton)",closeButtonBackground:"var(--rk-colors-closeButtonBackground)",connectButtonBackground:"var(--rk-colors-connectButtonBackground)",connectButtonBackgroundError:"var(--rk-colors-connectButtonBackgroundError)",connectButtonInnerBackground:"var(--rk-colors-connectButtonInnerBackground)",connectButtonText:"var(--rk-colors-connectButtonText)",connectButtonTextError:"var(--rk-colors-connectButtonTextError)",connectionIndicator:"var(--rk-colors-connectionIndicator)",downloadBottomCardBackground:"var(--rk-colors-downloadBottomCardBackground)",downloadTopCardBackground:"var(--rk-colors-downloadTopCardBackground)",error:"var(--rk-colors-error)",generalBorder:"var(--rk-colors-generalBorder)",generalBorderDim:"var(--rk-colors-generalBorderDim)",menuItemBackground:"var(--rk-colors-menuItemBackground)",modalBackdrop:"var(--rk-colors-modalBackdrop)",modalBackground:"var(--rk-colors-modalBackground)",modalBorder:"var(--rk-colors-modalBorder)",modalText:"var(--rk-colors-modalText)",modalTextDim:"var(--rk-colors-modalTextDim)",modalTextSecondary:"var(--rk-colors-modalTextSecondary)",profileAction:"var(--rk-colors-profileAction)",profileActionHover:"var(--rk-colors-profileActionHover)",profileForeground:"var(--rk-colors-profileForeground)",selectedOptionBorder:"var(--rk-colors-selectedOptionBorder)",standby:"var(--rk-colors-standby)"},fonts:{body:"var(--rk-fonts-body)"},radii:{actionButton:"var(--rk-radii-actionButton)",connectButton:"var(--rk-radii-connectButton)",menuButton:"var(--rk-radii-menuButton)",modal:"var(--rk-radii-modal)",modalMobile:"var(--rk-radii-modalMobile)"},shadows:{connectButton:"var(--rk-shadows-connectButton)",dialog:"var(--rk-shadows-dialog)",profileDetailsAction:"var(--rk-shadows-profileDetailsAction)",selectedOption:"var(--rk-shadows-selectedOption)",selectedWallet:"var(--rk-shadows-selectedWallet)",walletLogo:"var(--rk-shadows-walletLogo)"},blurs:{modalOverlay:"var(--rk-blurs-modalOverlay)"}},M$={shrink:"_12cbo8i6",shrinkSm:"_12cbo8i7"},B$="_12cbo8i3 ju367v8r",T$={grow:"_12cbo8i4",growLg:"_12cbo8i5"};function pt({active:e,hover:t}){return[B$,t&&T$[t],M$[e]]}var w8=S.createContext(null);function P$(){const{adapter:e}=S.useContext(w8)??{};if(!e)throw new Error("No authentication adapter found");return e}function Pp(){const e=S.useContext(w8);return(e==null?void 0:e.status)??null}function f2(){const e=Pp(),{isConnected:t}=Oe();return t?e&&(e==="loading"||e==="unauthenticated")?e:"connected":"disconnected"}function _8(){return typeof navigator<"u"&&/android/i.test(navigator.userAgent)}function R$(){return typeof navigator<"u"&&/iPhone|iPod/.test(navigator.userAgent)}function L$(){return typeof navigator<"u"&&(/iPad/.test(navigator.userAgent)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)}function id(){return R$()||L$()}function mt(){return _8()||id()}var D$="iekbcc0",O$={a:"iekbcca",blockquote:"iekbcc2",button:"iekbcc9",input:"iekbcc8 iekbcc5 iekbcc4",mark:"iekbcc6",ol:"iekbcc1",q:"iekbcc2",select:"iekbcc7 iekbcc5 iekbcc4",table:"iekbcc3",textarea:"iekbcc5 iekbcc4",ul:"iekbcc1"},F$=({reset:e,...t})=>{if(!e)return Ug(t);const n=O$[e],r=Ug(t);return Rj(D$,n,r)},R=k.forwardRef(({as:e="div",className:t,testId:n,...r},s)=>{const o={},a={};for(const l in r)Ug.properties.has(l)?o[l]=r[l]:a[l]=r[l];const c=F$({reset:typeof e=="string"?e:"div",...o});return k.createElement(e,{className:Rj(c,t),...a,"data-testid":n?`rk-${n.replace(/^rk-/,"")}`:void 0,ref:s})});R.displayName="Box";var x8=new Map,c1=new Map;async function k8(e){const t=c1.get(e);if(t)return t;const n=async()=>e().then(async s=>(x8.set(e,s),s)),r=n().catch(s=>n().catch(o=>{c1.delete(e)}));return c1.set(e,r),r}async function Gr(...e){return await Promise.all(e.map(t=>typeof t=="function"?k8(t):t))}function $$(){const[,e]=S.useReducer(t=>t+1,0);return e}function Rp(e){const t=typeof e=="function"?x8.get(e):void 0,n=$$();return S.useEffect(()=>{typeof e=="function"&&!t&&k8(e).then(n)},[e,t,n]),typeof e=="function"?t:e}function It({alt:e,background:t,borderColor:n,borderRadius:r,useAsImage:s,boxShadow:o,height:a,src:c,width:l,testId:u}){const d=id(),f=Rp(c),h=f&&/^http/.test(f),[p,m]=S.useReducer(()=>!0,!1);return k.createElement(R,{"aria-label":e,borderRadius:r,boxShadow:o,height:typeof a=="string"?a:void 0,overflow:"hidden",position:"relative",role:"img",style:{background:t,height:typeof a=="number"?a:void 0,width:typeof l=="number"?l:void 0},width:typeof l=="string"?l:void 0,testId:u},k.createElement(R,{...h?{"aria-hidden":!0,as:"img",onLoad:m,src:f}:{"aria-hidden":!0,as:"img",src:f},height:"full",position:"absolute",...d?{WebkitUserSelect:"none"}:{},style:{WebkitTouchCallout:"none",transition:"opacity .15s linear",userSelect:"none",...!s&&h?{opacity:p?1:0}:{}},width:"full"}),n?k.createElement(R,{...typeof n=="object"&&"custom"in n?{style:{borderColor:n.custom}}:{borderColor:n},borderRadius:r,borderStyle:"solid",borderWidth:"1",height:"full",position:"relative",width:"full"}):null)}var z$="_1luule42",q$="_1luule43",U$=e=>S.useMemo(()=>`${e}_${Math.round(Math.random()*1e9)}`,[e]),Iu=({height:e=21,width:t=21})=>{const n=U$("spinner");return k.createElement("svg",{className:z$,fill:"none",height:e,viewBox:"0 0 21 21",width:t,xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Loading"),k.createElement("clipPath",{id:n},k.createElement("path",{d:"M10.5 3C6.35786 3 3 6.35786 3 10.5C3 14.6421 6.35786 18 10.5 18C11.3284 18 12 18.6716 12 19.5C12 20.3284 11.3284 21 10.5 21C4.70101 21 0 16.299 0 10.5C0 4.70101 4.70101 0 10.5 0C16.299 0 21 4.70101 21 10.5C21 11.3284 20.3284 12 19.5 12C18.6716 12 18 11.3284 18 10.5C18 6.35786 14.6421 3 10.5 3Z"})),k.createElement("foreignObject",{clipPath:`url(#${n})`,height:"21",width:"21",x:"0",y:"0"},k.createElement("div",{className:q$})))},Te=["#FC5C54","#FFD95A","#E95D72","#6A87C8","#5FD0F3","#75C06B","#FFDD86","#5FC6D4","#FF949A","#FF8024","#9BA1A4","#EC66FF","#FF8CBC","#FF9A23","#C5DADB","#A8CE63","#71ABFF","#FFE279","#B6B1B6","#FF6780","#A575FF","#4D82FF","#FFB35A"],i6=[{color:Te[0],emoji:"🌶"},{color:Te[1],emoji:"🤑"},{color:Te[2],emoji:"🐙"},{color:Te[3],emoji:"🫐"},{color:Te[4],emoji:"🐳"},{color:Te[0],emoji:"🤶"},{color:Te[5],emoji:"🌲"},{color:Te[6],emoji:"🌞"},{color:Te[7],emoji:"🐒"},{color:Te[8],emoji:"🐵"},{color:Te[9],emoji:"🦊"},{color:Te[10],emoji:"🐼"},{color:Te[11],emoji:"🦄"},{color:Te[12],emoji:"🐷"},{color:Te[13],emoji:"🐧"},{color:Te[8],emoji:"🦩"},{color:Te[14],emoji:"👽"},{color:Te[0],emoji:"🎈"},{color:Te[8],emoji:"🍉"},{color:Te[1],emoji:"🎉"},{color:Te[15],emoji:"🐲"},{color:Te[16],emoji:"🌎"},{color:Te[17],emoji:"🍊"},{color:Te[18],emoji:"🐭"},{color:Te[19],emoji:"🍣"},{color:Te[1],emoji:"🐥"},{color:Te[20],emoji:"👾"},{color:Te[15],emoji:"🥦"},{color:Te[0],emoji:"👹"},{color:Te[17],emoji:"🙀"},{color:Te[4],emoji:"⛱"},{color:Te[21],emoji:"⛵️"},{color:Te[17],emoji:"🥳"},{color:Te[8],emoji:"🤯"},{color:Te[22],emoji:"🤠"}];function H$(e){let t=0;if(e.length===0)return t;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}function W$(e){const n=Math.abs(H$((typeof e=="string"?e:"").toLowerCase())%i6.length);return i6[n??0]}var V$=({address:e,ensImage:t,size:n})=>{const[r,s]=S.useState(!1);S.useEffect(()=>{if(t){const c=new Image;c.src=t,c.onload=()=>s(!0)}},[t]);const{color:o,emoji:a}=S.useMemo(()=>W$(e),[e]);return t?r?k.createElement(R,{backgroundSize:"cover",borderRadius:"full",position:"absolute",style:{backgroundImage:`url(${t})`,backgroundPosition:"center",height:n,width:n}}):k.createElement(R,{alignItems:"center",backgroundSize:"cover",borderRadius:"full",color:"modalText",display:"flex",justifyContent:"center",position:"absolute",style:{height:n,width:n}},k.createElement(Iu,null)):k.createElement(R,{alignItems:"center",display:"flex",justifyContent:"center",overflow:"hidden",style:{...!t&&{backgroundColor:o},height:n,width:n}},a)},C8=V$,j8=S.createContext(C8);function S8({address:e,imageUrl:t,loading:n,size:r}){const s=S.useContext(j8);return k.createElement(R,{"aria-hidden":!0,borderRadius:"full",overflow:"hidden",position:"relative",style:{height:`${r}px`,width:`${r}px`},userSelect:"none"},k.createElement(R,{alignItems:"center",borderRadius:"full",display:"flex",justifyContent:"center",overflow:"hidden",position:"absolute",style:{fontSize:`${Math.round(r*.55)}px`,height:`${r}px`,transform:n?"scale(0.72)":void 0,transition:".25s ease",transitionDelay:n?void 0:".1s",width:`${r}px`,willChange:"transform"},userSelect:"none"},k.createElement(s,{address:e,ensImage:t,size:r})),n&&k.createElement(R,{color:"accentColor",display:"flex",height:"full",position:"absolute",width:"full"},k.createElement(Iu,{height:"100%",width:"100%"})))}var c6=()=>k.createElement("svg",{fill:"none",height:"7",width:"14",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Dropdown"),k.createElement("path",{d:"M12.75 1.54001L8.51647 5.0038C7.77974 5.60658 6.72026 5.60658 5.98352 5.0038L1.75 1.54001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.5",xmlns:"http://www.w3.org/2000/svg"})),l6={defaultLocale:"en",locale:"en"},G$=class{constructor(e){this.listeners=new Set,this.defaultLocale=l6.defaultLocale,this.enableFallback=!1,this.locale=l6.locale,this.cachedLocales=[],this.translations={};for(const[t,n]of Object.entries(e))this.cachedLocales=[...this.cachedLocales,t],this.translations={...this.translations,...this.flattenTranslation(n,t)}}missingMessage(e){return`[missing: "${this.locale}.${e}" translation]`}flattenTranslation(e,t){const n={},r=(s,o)=>{for(const a of Object.keys(s)){const c=`${o}.${a}`,l=s[a];typeof l=="object"&&l!==null?r(l,c):n[c]=l}};return r(e,t),n}translateWithReplacements(e,t={}){let n=e;for(const r in t){const s=t[r];n=n.replace(`%{${r}}`,s)}return n}t(e,t,n){const r=`${this.locale}.${e}`,s=this.translations[r];if(!s){if(this.enableFallback){const o=`${this.defaultLocale}.${e}`,a=this.translations[o];if(a)return this.translateWithReplacements(a,t)}return n!=null&&n.rawKeyIfTranslationMissing?e:this.missingMessage(e)}return this.translateWithReplacements(s,t)}isLocaleCached(e){return this.cachedLocales.includes(e)}updateLocale(e){this.locale=e,this.notifyListeners()}setTranslations(e,t){this.isLocaleCached(e)||(this.cachedLocales=[...this.cachedLocales,e],this.translations={...this.translations,...this.flattenTranslation(t,e)}),this.locale=e,this.notifyListeners()}notifyListeners(){for(const e of this.listeners)e()}onChange(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},Yn=new G$({en:JSON.parse(M0),"en-US":JSON.parse(M0)});Yn.defaultLocale="en-US";Yn.locale="en-US";Yn.enableFallback=!0;var K$=async e=>{switch(e){case"ar":case"ar-AR":return(await ae(async()=>{const{default:t}=await import("./ar_AR-LIPSOZP5-BQrIDibT.js");return{default:t}},[])).default;case"de":case"de-DE":return(await ae(async()=>{const{default:t}=await import("./de_DE-YE3KOFHU-BRt5ztUe.js");return{default:t}},[])).default;case"en":case"en-US":return(await ae(async()=>{const{default:t}=await Promise.resolve().then(()=>Dx);return{default:t}},void 0)).default;case"es":case"es-419":return(await ae(async()=>{const{default:t}=await import("./es_419-7LMPU7G4-DH7rM0yQ.js");return{default:t}},[])).default;case"fr":case"fr-FR":return(await ae(async()=>{const{default:t}=await import("./fr_FR-VBJP3ZLL-B-_ocunw.js");return{default:t}},[])).default;case"hi":case"hi-IN":return(await ae(async()=>{const{default:t}=await import("./hi_IN-WBVD5XYI-D73g2UFs.js");return{default:t}},[])).default;case"id":case"id-ID":return(await ae(async()=>{const{default:t}=await import("./id_ID-SBYANJ7G-Cjpa4ay6.js");return{default:t}},[])).default;case"ja":case"ja-JP":return(await ae(async()=>{const{default:t}=await import("./ja_JP-ZRMWJV3I-DXbifiMm.js");return{default:t}},[])).default;case"ko":case"ko-KR":return(await ae(async()=>{const{default:t}=await import("./ko_KR-FR54RFUG-upinSHjQ.js");return{default:t}},[])).default;case"ms":case"ms-MY":return(await ae(async()=>{const{default:t}=await import("./ms_MY-EZSGYYYQ-4cPLK-3L.js");return{default:t}},[])).default;case"pt":case"pt-BR":return(await ae(async()=>{const{default:t}=await import("./pt_BR-JQFQ3P4L-DOHfdcA2.js");return{default:t}},[])).default;case"ru":case"ru-RU":return(await ae(async()=>{const{default:t}=await import("./ru_RU-Z42UEJBP-Cvb2oWxQ.js");return{default:t}},[])).default;case"th":case"th-TH":return(await ae(async()=>{const{default:t}=await import("./th_TH-4YB4VSB2-BUipNP-V.js");return{default:t}},[])).default;case"tr":case"tr-TR":return(await ae(async()=>{const{default:t}=await import("./tr_TR-5FKHPPIO-D5jTpIm9.js");return{default:t}},[])).default;case"ua":case"uk-UA":return(await ae(async()=>{const{default:t}=await import("./uk_UA-ZD4IBC52-DgnQrpzl.js");return{default:t}},[])).default;case"vi":case"vi-VN":return(await ae(async()=>{const{default:t}=await import("./vi_VN-5EVRZKLY-x078672g.js");return{default:t}},[])).default;case"zh":case"zh-CN":case"zh-Hans":return(await ae(async()=>{const{default:t}=await import("./zh_CN-4XK5YJPR-Bt6Yz5Ek.js");return{default:t}},[])).default;case"zh-HK":return(await ae(async()=>{const{default:t}=await import("./zh_HK-N4YN2WSI-Cvzl1V16.js");return{default:t}},[])).default;case"zh-Hant":case"zh-TW":return(await ae(async()=>{const{default:t}=await import("./zh_TW-CNCRXH6Z-BNelatfN.js");return{default:t}},[])).default;default:return(await ae(async()=>{const{default:t}=await Promise.resolve().then(()=>Dx);return{default:t}},void 0)).default}};async function u6(e){if(Yn.isLocaleCached(e)){Yn.updateLocale(e);return}const n=await K$(e);Yn.setTranslations(e,JSON.parse(n))}var Q$=()=>{var e;if(typeof window<"u"&&typeof navigator<"u"){if((e=navigator.languages)!=null&&e.length)return navigator.languages[0];if(navigator.language)return navigator.language}},gt=S.createContext({i18n:Yn}),Y$=({children:e,locale:t})=>{const[n,r]=S.useState(0),s=S.useMemo(()=>Q$(),[]);S.useEffect(()=>Yn.onChange(()=>{r(c=>c+1)}),[]),S.useEffect(()=>{t&&t!==Yn.locale?u6(t):!t&&s&&s!==Yn.locale&&u6(s)},[t,s]);const o=S.useMemo(()=>({t:(c,l)=>Yn.t(c,l),i18n:Yn}),[n]);return k.createElement(gt.Provider,{value:o},e)};function A8(e){return e!=null}var d6={iconBackground:"#7290CC",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./apechain-SX5YFU6N-q5qBv-mp.js");return{default:e}},[])).default},l1={iconBackground:"#96bedc",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./arbitrum-WURIBY6W-CqVkHBr5.js");return{default:e}},[])).default},f6={iconBackground:"#e84141",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./avalanche-KOMJD3XY-Dsn_JPR4.js");return{default:e}},[])).default},u1={iconBackground:"#0052ff",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./base-OAXLRA4F-CoYTVIiL.js");return{default:e}},[])).default},d1={iconBackground:"#814625",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./berachain-NJECWIVC-DumxnFvf.js");return{default:e}},[])).default},h6={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./blast-V555OVXZ-BbhJh1tj.js");return{default:e}},[])).default},p6={iconBackground:"#ebac0e",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./bsc-N647EYR2-B2nLKXWV.js");return{default:e}},[])).default},m6={iconBackground:"#FCFF52",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./celo-GEP4TUHG-CenIBYLU.js");return{default:e}},[])).default},g6={iconBackground:"#002D74",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./cronos-HJPAQTAE-BEOvlOC4.js");return{default:e}},[])).default},J$={iconBackground:"#A36EFD",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./degen-FQQ4XGHB-CeHTs88l.js");return{default:e}},[])).default},Hs={iconBackground:"#484c50",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./ethereum-RGGVA4PY-SWGOlkuk.js");return{default:e}},[])).default},y6={iconBackground:"transparent",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./flow-5FQJFCTK-CUie2reO.js");return{default:e}},[])).default},X$={iconBackground:"#04795c",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./gnosis-37ZC4RBL-B137OtHZ.js");return{default:e}},[])).default},b6={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./gravity-J5YQHTYH-Bj6B0uod.js");return{default:e}},[])).default},Z$={iconBackground:"#f9f7ec",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./hardhat-TX56IT5N-CV1FY-wE.js");return{default:e}},[])).default},ez={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./hyperevm-VKPAA4SA-CHwraEsx.js");return{default:e}},[])).default},v6={iconBackground:"#7132F5",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./ink-FZMYZWHG-62p-5IK5.js");return{default:e}},[])).default},w6={iconBackground:"transparent",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./kaia-65D2U3PU-JmuLQ4gC.js");return{default:e}},[])).default},f1={iconBackground:"#ffffff",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./linea-QRMVQ5DY-DuI3vv0d.js");return{default:e}},[])).default},h1={iconBackground:"#ffffff",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./manta-SI27YFEJ-CpVOKa06.js");return{default:e}},[])).default},_6={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./mantle-CKIUT334-DR2WgqzU.js");return{default:e}},[])).default},tz={iconBackground:"transparent",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./monad-4KWC6TSS-DVXSkpiz.js");return{default:e}},[])).default},of={iconBackground:"#ff5a57",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./optimism-HAF2GUT7-ec6Nqxs9.js");return{default:e}},[])).default},p1={iconBackground:"#9f71ec",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./polygon-WW6ZI7PM-DXlmm4L1.js");return{default:e}},[])).default},nz={iconBackground:"#1273EA",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./ronin-EMCPYXZT-N-QBHZdV.js");return{default:e}},[])).default},rz={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./sanko-RHQYXGM5-OX010CbN.js");return{default:e}},[])).default},sz={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./superposition-HG6MMR2Y-bRkgatRO.js");return{default:e}},[])).default},x6={iconBackground:"#FFEEDA",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./scroll-5OBGQVOV-DJFECiai.js");return{default:e}},[])).default},k6={iconBackground:"#F50DB4",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./unichain-C5BWO2ZY-BfguYsnu.js");return{default:e}},[])).default},C6={iconBackground:"#f9f7ec",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./xdc-KJ3TDBYO-DNV6zchh.js");return{default:e}},[])).default},j6={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./zetachain-TLDS5IPW-Udhyw16T.js");return{default:e}},[])).default},S6={iconBackground:"#f9f7ec",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./zksync-DH7HK5U4-Dt4usFw6.js");return{default:e}},[])).default},m1={iconBackground:"#000000",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./zora-FYL5H3IO-iB4wygST.js");return{default:e}},[])).default},oz={apechain:{chainId:33139,name:"ApeChain",...d6},apechainCurtis:{chainId:33111,name:"ApeChain Curtis",...d6},arbitrum:{chainId:42161,name:"Arbitrum",...l1},arbitrumGoerli:{chainId:421613,...l1},arbitrumSepolia:{chainId:421614,...l1},avalanche:{chainId:43114,...f6},avalancheFuji:{chainId:43113,...f6},base:{chainId:8453,name:"Base",...u1},baseGoerli:{chainId:84531,...u1},baseSepolia:{chainId:84532,...u1},berachain:{chainId:80094,name:"Berachain",...d1},berachainArtio:{chainId:80085,name:"Berachain Artio",...d1},berachainBArtio:{chainId:80084,name:"Berachain bArtio",...d1},blast:{chainId:81457,name:"Blast",...h6},blastSepolia:{chainId:168587773,...h6},bsc:{chainId:56,name:"BSC",...p6},bscTestnet:{chainId:97,...p6},celo:{chainId:42220,name:"Celo",...m6},celoAlfajores:{chainId:44787,name:"Celo Alfajores",...m6},cronos:{chainId:25,...g6},cronosTestnet:{chainId:338,...g6},degen:{chainId:666666666,name:"Degen",...J$},flow:{chainId:747,...y6},flowTestnet:{chainId:545,...y6},gnosis:{chainId:100,name:"Gnosis",...X$},goerli:{chainId:5,...Hs},gravity:{chainId:1625,name:"Gravity",...b6},gravitySepolia:{chainId:13505,name:"Gravity Sepolia",...b6},hardhat:{chainId:31337,...Z$},holesky:{chainId:17e3,...Hs},hyperevm:{chainId:999,...ez},ink:{chainId:57073,...v6},inkSepolia:{chainId:763373,...v6},kaia:{chainId:8217,name:"Kaia",...w6},kairos:{chainId:1001,name:"Kairos",...w6},kovan:{chainId:42,...Hs},linea:{chainId:59144,name:"Linea",...f1},lineaGoerli:{chainId:59140,name:"Linea Goerli",...f1},lineaSepolia:{chainId:59141,name:"Linea Sepolia",...f1},localhost:{chainId:1337,...Hs},mainnet:{chainId:1,name:"Ethereum",...Hs},manta:{chainId:169,name:"Manta",...h1},mantaSepolia:{chainId:3441006,...h1},mantaTestnet:{chainId:3441005,...h1},mantle:{chainId:5e3,..._6},mantleTestnet:{chainId:5001,..._6},monadTestnet:{chainId:10143,name:"Monad Testnet",...tz},optimism:{chainId:10,name:"Optimism",...of},optimismGoerli:{chainId:420,...of},optimismKovan:{chainId:69,...of},optimismSepolia:{chainId:11155420,...of},polygon:{chainId:137,name:"Polygon",...p1},polygonAmoy:{chainId:80002,...p1},polygonMumbai:{chainId:80001,...p1},rinkeby:{chainId:4,...Hs},ronin:{chainId:2020,...nz},ropsten:{chainId:3,...Hs},sanko:{chainId:1996,name:"Sanko",...rz},scroll:{chainId:534352,...x6},scrollSepolia:{chainId:534351,...x6},sepolia:{chainId:11155111,...Hs},superposition:{chainId:55244,name:"Superposition",...sz},unichain:{chainId:130,...k6},unichainSepolia:{chainId:1301,...k6},xdc:{chainId:50,name:"XDC",...C6},xdcTestnet:{chainId:51,...C6},zetachain:{chainId:7e3,name:"ZetaChain",...j6},zetachainAthensTestnet:{chainId:7001,name:"Zeta Athens",...j6},zkSync:{chainId:324,name:"zkSync",...S6},zkSyncTestnet:{chainId:280,...S6},zora:{chainId:7777777,name:"Zora",...m1},zoraSepolia:{chainId:999999999,...m1},zoraTestnet:{chainId:999,...m1}},az=Object.fromEntries(Object.values(oz).filter(A8).map(({chainId:e,...t})=>[e,t])),iz=e=>e.map(t=>{const n=az[t.id]??{};return{...t,name:n.name??t.name,iconUrl:t.iconUrl??n.iconUrl,iconBackground:t.iconBackground??n.iconBackground}}),h2=S.createContext({chains:[]});function cz({children:e,initialChain:t}){const{chains:n}=at();return k.createElement(h2.Provider,{value:S.useMemo(()=>({chains:iz(n),initialChainId:typeof t=="number"?t:t==null?void 0:t.id}),[n,t])},e)}var Da=()=>S.useContext(h2).chains,lz=()=>S.useContext(h2).initialChainId,uz=()=>{const e=Da();return S.useMemo(()=>{const t={};for(const n of e)t[n.id]=n;return t},[e])},E8=S.createContext({showBalance:void 0,setShowBalance:()=>{}});function dz({children:e}){const[t,n]=S.useState();return k.createElement(E8.Provider,{value:{showBalance:t,setShowBalance:n}},e)}var N8=()=>S.useContext(E8);function fz(){const[e,t]=S.useState(!1);return S.useEffect(()=>(t(!0),()=>{t(!1)}),[]),S.useCallback(()=>e,[e])}function I8(){const e=Da(),t=Ip.id;return e.some(r=>r.id===t)}function hz(e){const t=I8(),n=s=>{try{return tF(s)}catch{}},{data:r}=pO({chainId:Ip.id,name:e?n(e):void 0,query:{enabled:t}});return r}async function $o(e,t){const n={headers:{},method:"get",...t,timeout:t.timeout??1e4};if(!e)throw new Error("rainbowFetch: Missing url argument");const r=new AbortController,s=setTimeout(()=>r.abort(),n.timeout),{body:o,params:a,headers:c,...l}=n,u=o&&typeof o=="object"?JSON.stringify(o):o,d=await fetch(`${e}${mz(a)}`,{...l,body:u,headers:{Accept:"application/json","Content-Type":"application/json",...c},signal:r.signal});clearTimeout(s);const f=await pz(d);if(d.ok){const{headers:m,status:g}=d;return{data:f,headers:m,status:g}}throw gz({requestBody:o,response:d,responseBody:typeof f=="string"?{error:f}:f})}function pz(e){const t=e.headers.get("Content-Type");return t!=null&&t.startsWith("application/json")?e.json():e.text()}function mz(e){return e&&Object.keys(e).length?`?${new URLSearchParams(e)}`:""}function gz({requestBody:e,response:t,responseBody:n}){const r=(n==null?void 0:n.error)||(t==null?void 0:t.statusText)||"There was an error with the request.",s=new Error(r);return s.response=t,s.responseBody=n,s.requestBody=e,s}var yz=class{constructor(e={}){const{baseUrl:t="",...n}=e;this.baseUrl=t,this.opts=n}get(e,t){return $o(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"get"})}delete(e,t){return $o(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"delete"})}head(e,t){return $o(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"head"})}options(e,t){return $o(`${this.baseUrl}${e}`,{...this.opts,...t||{},method:"options"})}post(e,t,n){return $o(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"post"})}put(e,t,n){return $o(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"put"})}patch(e,t,n){return $o(`${this.baseUrl}${e}`,{...this.opts,...n||{},body:t,method:"patch"})}};function bz({baseUrl:e,headers:t,params:n,timeout:r}){return new yz({baseUrl:e,headers:t,params:n,timeout:r})}var vz=!!(typeof process<"u"&&typeof Sh<"u"&&Sh.RAINBOW_PROVIDER_API_KEY),wz=bz({baseUrl:"https://enhanced-provider.rainbow.me",headers:{"x-api-key":typeof process<"u"&&typeof Sh<"u"&&Sh.RAINBOW_PROVIDER_API_KEY||"LzbasoBiLqltex3VkcQ7LRmL4PtfiiZ1EMJrizrgfonWN6byJReu/l6yrUoo3zLW"}});function _z(e,t,n={}){return[e,t,n]}function Lf(e){return`rk-ens-name-${e}`}function xz(e){try{const t=e?JSON.parse(e):null;return typeof t=="object"?t:null}catch{return null}}function kz(e,t){if(!ut(e)||typeof window>"u")return;const n=new Date,r=new Date(n.getTime()+180*6e4);window.localStorage.setItem(Lf(e),JSON.stringify({ensName:t,expires:r.getTime()}))}function Cz(e){if(typeof window>"u")return null;const t=xz(window.localStorage.getItem(Lf(e)));if(!t)return null;const{ensName:n,expires:r}=t;return typeof n!="string"||Number.isNaN(Number(r))||new Date().getTime()>Number(r)?(window.localStorage.removeItem(Lf(e)),null):n}async function jz({address:e}){const t=Cz(e);if(t)return t;const r=(await wz.get("/v1/resolve-ens",{params:{address:e}})).data.data;return r&&kz(e,r),r}function Sz(e){const t=I8(),{data:n}=mO({chainId:Ip.id,address:e,query:{enabled:t}}),{data:r}=Bj({queryKey:_z("address",e),queryFn:()=>jz({address:e}),enabled:!t&&!!e&&vz,staleTime:10*(60*1e3),retry:1});return n||r}function M8({address:e,includeBalance:t}){const n=Sz(e),r=hz(n),{data:s}=Tj({address:t?e:void 0});return{ensName:n,ensAvatar:r,balance:s}}function p2(){const{chain:e}=Oe();return(e==null?void 0:e.id)??null}var Az="rk-transactions";function Ez(e){const t=`${e.uid}.${Az}`;return{...e,uid:t}}var B8="rk-transactions";function Nz(e){try{const t=e?JSON.parse(e):{};return typeof t=="object"?t:{}}catch{return{}}}function A6(){return Nz(typeof window<"u"?window.localStorage.getItem(B8):null)}var Iz=/^0x([A-Fa-f0-9]{64})$/;function Mz(e){const t=[];return Iz.test(e.hash)||t.push("Invalid transaction hash"),typeof e.description!="string"&&t.push("Transaction must have a description"),typeof e.confirmations<"u"&&(!Number.isInteger(e.confirmations)||e.confirmations<1)&&t.push("Transaction confirmations must be a positiver integer"),t}function Bz({provider:e}){let t=A6(),n;const r=new Set,s=new Set,o=new Map;function a(y){n=Ez(y)}a(e);function c(y,v){var w;return((w=t[y])==null?void 0:w[v])??[]}function l(y,v,w){const x=Mz(w);if(x.length>0)throw new Error(["Unable to add transaction",...x].join(`
1762
1762
  `));h(y,v,A=>[{...w,status:"pending"},...A.filter(({hash:C})=>C!==w.hash)])}function u(y,v){h(y,v,()=>[])}function d(y,v,w,x){h(y,v,A=>A.map(C=>C.hash===w?{...C,status:x}:C))}async function f(y,v){await Promise.all(c(y,v).filter(w=>w.status==="pending").map(async w=>{const{confirmations:x,hash:A}=w,C=o.get(A);if(C)return await C;const j=Vb(n,{confirmations:x,hash:A,timeout:3e5}).then(({status:E})=>{o.delete(A),E!==void 0&&(d(y,v,A,E===0||E==="reverted"?"failed":"confirmed"),g(E))}).catch(()=>{o.delete(A),d(y,v,A,"failed")});return o.set(A,j),await j}))}function h(y,v,w){t=A6(),t[y]=t[y]??{};let x=0;const A=10,C=w(t[y][v]??[]).filter(({status:j})=>j==="pending"?!0:x++<=A);t[y][v]=C.length>0?C:void 0,p(),m(),f(y,v)}function p(){typeof window<"u"&&window.localStorage.setItem(B8,JSON.stringify(t))}function m(){for(const y of r)y()}function g(y){for(const v of s)v(y)}function _(y){return r.add(y),()=>{r.delete(y)}}function b(y){return s.add(y),()=>{s.delete(y)}}return{addTransaction:l,clearTransactions:u,getTransactions:c,onTransactionStatus:b,onChange:_,setProvider:a,waitForPendingTransactions:f}}var g1,T8=k.createContext(null);function Tz({children:e}){const t=Ap(),{address:n}=Oe(),r=p2(),{refetch:s}=Tj({address:n,query:{enabled:!1}}),[o]=k.useState(()=>(g1||(g1=Bz({provider:t})),g1)),a=k.useCallback(c=>{c==="success"&&s()},[s]);return k.useEffect(()=>{o.setProvider(t)},[o,t]),k.useEffect(()=>{n&&r&&o.waitForPendingTransactions(n,r)},[o,n,r]),k.useEffect(()=>{if(o&&n&&r)return o.onTransactionStatus(a)},[o,n,r,a]),k.createElement(T8.Provider,{value:o},e)}function P8(){const e=k.useContext(T8);if(!e)throw new Error("Transaction hooks must be used within RainbowKitProvider");return e}function R8(){const e=P8(),{address:t}=Oe(),n=p2(),[r,s]=S.useState(()=>e&&t&&n?e.getTransactions(t,n):[]);return S.useEffect(()=>{if(e&&t&&n)return s(e.getTransactions(t,n)),e.onChange(()=>{s(e.getTransactions(t,n))})},[e,t,n]),r}var E6=e=>typeof e=="function"?e():e;function Pz(e,{extends:t}={}){const n={...D_(a6,E6(e))};if(!t)return n;const r=D_(a6,E6(t));return Object.fromEntries(Object.entries(n).filter(([o,a])=>a!==r[o]))}function N6(e,t={}){return Object.entries(Pz(e,t)).map(([n,r])=>`${n}:${r.replace(/[:;{}</>]/g,"")};`).join("")}var L8={appName:void 0,disclaimer:void 0,learnMoreUrl:"https://learn.rainbow.me/understanding-web3?utm_source=rainbowkit&utm_campaign=learnmore"},cd=S.createContext(L8),D8=S.createContext(!1);function Rz(e,t){let n=null;const r=()=>{n&&clearTimeout(n),n=setTimeout(()=>{n=null,e()},t)};return r.cancel=()=>{n&&(clearTimeout(n),n=null)},r}var O8=()=>{const[e,t]=S.useState({height:void 0,width:void 0});return S.useEffect(()=>{const n=Rz(()=>{t({height:window.innerHeight,width:window.innerWidth})},500);return window.addEventListener("resize",n),n(),()=>{n.cancel(),window.removeEventListener("resize",n)}},[]),e},ld=S.createContext({connector:null,setConnector:()=>{}});function Lz({children:e}){const[t,n]=S.useState(null);return k.createElement(ld.Provider,{value:S.useMemo(()=>({connector:t,setConnector:n}),[t])},e)}var ud={COMPACT:"compact",WIDE:"wide"},Lp=S.createContext(ud.WIDE);function Dz({children:e,modalSize:t}){const{width:n}=O8(),r=n&&n<I$,{connector:s}=S.useContext(ld);return k.createElement(Lp.Provider,{value:r||s?ud.COMPACT:t},e)}var m2=S.createContext(!1),Oz="rk-version";function Fz({version:e}){typeof window<"u"&&window.localStorage.setItem(Oz,e)}function $z(){const e=S.useCallback(()=>{Fz({version:"2.2.11"})},[]);S.useEffect(()=>{e()},[e])}function zz(e,t){const n={};for(const r of e){const s=t(r);s&&(n[s]=r)}return n}function g2(){return typeof navigator<"u"&&typeof navigator.userAgent<"u"&&/Version\/([0-9._]+).*Safari/.test(navigator.userAgent)}function qz(){return typeof document<"u"&&getComputedStyle(document.body).getPropertyValue("--arc-palette-focus")!==""}function y2(){var t,n;if(typeof navigator>"u")return"Browser";const e=(t=navigator.userAgent)==null?void 0:t.toLowerCase();return(n=navigator.brave)!=null&&n.isBrave?"Brave":(e==null?void 0:e.indexOf("edg/"))>-1?"Edge":(e==null?void 0:e.indexOf("op"))>-1?"Opera":qz()?"Arc":(e==null?void 0:e.indexOf("chrome"))>-1?"Chrome":(e==null?void 0:e.indexOf("firefox"))>-1?"Firefox":g2()?"Safari":"Browser"}var Uz=Is(),{os:b2}=Uz;function Hz(){return b2.name==="Windows"}function Wz(){return b2.name==="macOS"}function Vz(){return["Ubuntu","Mint","Fedora","Debian","Arch","Linux"].includes(b2.name)}function v2(){return Hz()?"Windows":Wz()?"macOS":Vz()?"Linux":"Desktop"}var Gz=e=>{var n,r,s,o,a,c,l,u,d,f,h;const t=y2();return{Arc:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.chrome,Brave:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.chrome,Chrome:(s=e==null?void 0:e.downloadUrls)==null?void 0:s.chrome,Edge:((o=e==null?void 0:e.downloadUrls)==null?void 0:o.edge)||((a=e==null?void 0:e.downloadUrls)==null?void 0:a.chrome),Firefox:(c=e==null?void 0:e.downloadUrls)==null?void 0:c.firefox,Opera:((l=e==null?void 0:e.downloadUrls)==null?void 0:l.opera)||((u=e==null?void 0:e.downloadUrls)==null?void 0:u.chrome),Safari:(d=e==null?void 0:e.downloadUrls)==null?void 0:d.safari,Browser:(f=e==null?void 0:e.downloadUrls)==null?void 0:f.browserExtension}[t]??((h=e==null?void 0:e.downloadUrls)==null?void 0:h.browserExtension)},Kz=e=>{var n,r,s;return(id()?(n=e==null?void 0:e.downloadUrls)==null?void 0:n.ios:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.android)??((s=e==null?void 0:e.downloadUrls)==null?void 0:s.mobile)},Qz=e=>{var n,r,s,o,a;const t=v2();return{Windows:(n=e==null?void 0:e.downloadUrls)==null?void 0:n.windows,macOS:(r=e==null?void 0:e.downloadUrls)==null?void 0:r.macos,Linux:(s=e==null?void 0:e.downloadUrls)==null?void 0:s.linux,Desktop:(o=e==null?void 0:e.downloadUrls)==null?void 0:o.desktop}[t]??((a=e==null?void 0:e.downloadUrls)==null?void 0:a.desktop)},F8=(e,t)=>e.some(n=>n.id===t),Yz=e=>!!e.isRainbowKitConnector,I6=e=>{var t;return!!(!e.isRainbowKitConnector&&((t=e.icon)!=null&&t.replace(/\n/g,"").startsWith("data:image"))&&e.uid&&e.name)},Jz=(e,t)=>e.id==="walletConnect"&&t?{...e,walletConnectModalConnector:t}:e,Xz=({wallets:e,recentWallets:t})=>[...t,...e.filter(n=>!F8(t,n.id))],$8="rk-recent";function Zz(e){try{const t=e?JSON.parse(e):[];return Array.isArray(t)?t:[]}catch{return[]}}function z8(){return typeof window<"u"?Zz(window.localStorage.getItem($8)):[]}function eq(e){return[...new Set(e)]}function tq(e){const t=eq([e,...z8()]);typeof window<"u"&&window.localStorage.setItem($8,JSON.stringify(t))}function Mu(e=!1){var w,x,A;const t=Da(),n=lz(),{connectAsync:r,connectors:s}=fO(),o=s,{setIsWalletConnectModalOpen:a}=fS(),c=o.map(C=>({...C,...C.rkDetails||{}}));async function l(C,j){var T,O;const E=await C.getChainId(),I=await r({...j,chainId:(j==null?void 0:j.chainId)??n??((T=t.find(({id:B})=>B===E))==null?void 0:T.id)??((O=t[0])==null?void 0:O.id),connector:C});return I&&tq(C.id),I}async function u(C){try{a(!0),await l(C),a(!1)}catch(j){const E=j.name==="UserRejectedRequestError"||j.message==="Connection request reset. Please try again.";if(a(!1),!E)throw j}}const d=async(C,j)=>{const E=await C.getProvider();return C.id==="coinbase"?E.qrUrl:new Promise(I=>E.once("display_uri",T=>{I(j(T))}))},f=c.find(C=>C.id==="walletConnect"&&C.isWalletConnectModalConnector),h=c.filter(I6).map(C=>({...C,groupIndex:0})),p=c.filter(Yz).filter(C=>!C.isWalletConnectModalConnector).filter(C=>e?!h.some(E=>E.id===C.rdns):!0).map(C=>Jz(C,f)),m=[...h,...p],g=zz(m,C=>C.id),b=z8().map(C=>g[C]).filter(Boolean).slice(0,3),y=[],v=Xz({wallets:m,recentWallets:b});for(const C of v){if(!C)continue;const j=I6(C),E=F8(b,C.id);if(j){y.push({...C,iconUrl:C.icon,ready:!0,connect:l.bind(null,C),groupName:"Installed",recent:E});continue}y.push({...C,ready:C.installed??!0,connect:l.bind(null,C),desktopDownloadUrl:Qz(C),extensionDownloadUrl:Gz(C),groupName:C.groupName,mobileDownloadUrl:Kz(C),getQrCodeUri:(w=C.qrCode)!=null&&w.getUri?()=>d(C,C.qrCode.getUri):void 0,getDesktopUri:(x=C.desktop)!=null&&x.getUri?()=>d(C,C.desktop.getUri):void 0,getMobileUri:(A=C.mobile)!=null&&A.getUri?()=>d(C,C.mobile.getUri):void 0,recent:E,showWalletConnectModal:C.walletConnectModalConnector?()=>u(C.walletConnectModalConnector):void 0})}return y}var q8=async()=>(await ae(async()=>{const{default:e}=await import("./assets-Q6ZU7ZJ5-P8HioiAD.js");return{default:e}},[])).default,nq=()=>Gr(q8),rq=()=>k.createElement(It,{background:"#d0d5de",borderRadius:"10",height:"48",src:q8,width:"48"}),U8=async()=>(await ae(async()=>{const{default:e}=await import("./login-UP3DZBGS-Db_wM5oQ.js");return{default:e}},[])).default,sq=()=>Gr(U8),oq=()=>k.createElement(It,{background:"#d0d5de",borderRadius:"10",height:"48",src:U8,width:"48"}),be=k.forwardRef(({as:e="div",children:t,className:n,color:r,display:s,font:o="body",id:a,size:c="16",style:l,tabIndex:u,textAlign:d="inherit",weight:f="regular",testId:h},p)=>k.createElement(R,{as:e,className:n,color:r,display:s,fontFamily:o,fontSize:c,fontWeight:f,id:a,ref:p,style:l,tabIndex:u,textAlign:d,testId:h},t));be.displayName="Text";var aq={large:{fontSize:"16",paddingX:"24",paddingY:"10"},medium:{fontSize:"14",height:"28",paddingX:"12",paddingY:"4"},small:{fontSize:"14",paddingX:"10",paddingY:"5"}};function on({disabled:e=!1,href:t,label:n,onClick:r,rel:s="noreferrer noopener",size:o="medium",target:a="_blank",testId:c,type:l="primary"}){const u=l==="primary",d=o!=="large",f=mt(),h=e?"actionButtonSecondaryBackground":u?"accentColor":d?"actionButtonSecondaryBackground":null,{fontSize:p,height:m,paddingX:g,paddingY:_}=aq[o],b=!f||!d;return k.createElement(R,{...t?e?{}:{as:"a",href:t,rel:s,target:a}:{as:"button",type:"button"},onClick:e?void 0:r,...b?{borderColor:f&&!d&&!u?"actionButtonBorderMobile":"actionButtonBorder",borderStyle:"solid",borderWidth:"1"}:{},borderRadius:"actionButton",className:!e&&pt({active:"shrinkSm",hover:"grow"}),display:"block",paddingX:g,paddingY:_,style:{willChange:"transform"},testId:c,textAlign:"center",transition:"transform",...h?{background:h}:{},...m?{height:m}:{}},k.createElement(be,{color:e?"modalTextSecondary":u?"accentColorForeground":"accentColor",size:p,weight:"bold"},n))}var iq=()=>mt()?k.createElement("svg",{"aria-hidden":!0,fill:"none",height:"11.5",viewBox:"0 0 11.5 11.5",width:"11.5",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Close"),k.createElement("path",{d:"M2.13388 0.366117C1.64573 -0.122039 0.854272 -0.122039 0.366117 0.366117C-0.122039 0.854272 -0.122039 1.64573 0.366117 2.13388L3.98223 5.75L0.366117 9.36612C-0.122039 9.85427 -0.122039 10.6457 0.366117 11.1339C0.854272 11.622 1.64573 11.622 2.13388 11.1339L5.75 7.51777L9.36612 11.1339C9.85427 11.622 10.6457 11.622 11.1339 11.1339C11.622 10.6457 11.622 9.85427 11.1339 9.36612L7.51777 5.75L11.1339 2.13388C11.622 1.64573 11.622 0.854272 11.1339 0.366117C10.6457 -0.122039 9.85427 -0.122039 9.36612 0.366117L5.75 3.98223L2.13388 0.366117Z",fill:"currentColor"})):k.createElement("svg",{"aria-hidden":!0,fill:"none",height:"10",viewBox:"0 0 10 10",width:"10",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Close"),k.createElement("path",{d:"M1.70711 0.292893C1.31658 -0.0976311 0.683417 -0.0976311 0.292893 0.292893C-0.0976311 0.683417 -0.0976311 1.31658 0.292893 1.70711L3.58579 5L0.292893 8.29289C-0.0976311 8.68342 -0.0976311 9.31658 0.292893 9.70711C0.683417 10.0976 1.31658 10.0976 1.70711 9.70711L5 6.41421L8.29289 9.70711C8.68342 10.0976 9.31658 10.0976 9.70711 9.70711C10.0976 9.31658 10.0976 8.68342 9.70711 8.29289L6.41421 5L9.70711 1.70711C10.0976 1.31658 10.0976 0.683417 9.70711 0.292893C9.31658 -0.0976311 8.68342 -0.0976311 8.29289 0.292893L5 3.58579L1.70711 0.292893Z",fill:"currentColor"})),Na=({"aria-label":e="Close",onClose:t})=>{const n=mt();return k.createElement(R,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:pt({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},k.createElement(iq,null))},H8=async()=>(await ae(async()=>{const{default:e}=await import("./sign-A7IJEUT5-CGsRnPrd.js");return{default:e}},[])).default;function cq({onClose:e,onCloseModal:t}){const{i18n:n}=S.useContext(gt),[{status:r,...s},o]=k.useState({status:"idle"}),a=P$(),c=S.useCallback(async()=>{try{const m=await a.getNonce();o(g=>({...g,nonce:m}))}catch{o(m=>({...m,errorMessage:n.t("sign_in.message.preparing_error"),status:"idle"}))}},[a,n.t]),l=S.useRef(!1);k.useEffect(()=>{l.current||(l.current=!0,c())},[c]);const u=mt(),{address:d,chain:f}=Oe(),{signMessageAsync:h}=gO(),p=async()=>{try{const m=f==null?void 0:f.id,{nonce:g}=s;if(!d||!m||!g)return;o(y=>({...y,errorMessage:void 0}));let _;try{const y=a.createMessage({address:d,chainId:m,nonce:g});y instanceof Promise&&o(v=>({...v,status:"creatingMessage"})),_=await y}catch{return o(y=>({...y,errorMessage:n.t("sign_in.message.preparing_error"),status:"idle"}))}let b;try{o(y=>({...y,status:"signing"})),b=await h({message:_})}catch(y){return y instanceof Re?o(v=>({...v,status:"idle"})):o(v=>({...v,errorMessage:n.t("sign_in.signature.signing_error"),status:"idle"}))}o(y=>({...y,status:"verifying"}));try{if(await a.verify({message:_,signature:b})){t();return}throw new Error}catch{return o(y=>({...y,errorMessage:n.t("sign_in.signature.verifying_error"),status:"idle"}))}}catch{o(m=>({...m,errorMessage:n.t("sign_in.signature.oops_error"),status:"idle"}))}};return k.createElement(R,{position:"relative"},k.createElement(R,{display:"flex",paddingRight:"16",paddingTop:"16",position:"absolute",right:"0"},k.createElement(Na,{onClose:e})),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"32":"24",padding:"24",paddingX:"18",style:{paddingTop:u?"60px":"36px"}},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"6":"4",style:{maxWidth:u?320:280}},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"32":"16"},k.createElement(It,{height:40,src:H8,width:40}),k.createElement(be,{color:"modalText",size:u?"20":"18",textAlign:"center",weight:"heavy"},n.t("sign_in.label"))),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:u?"16":"12"},k.createElement(be,{color:"modalTextSecondary",size:u?"16":"14",textAlign:"center"},n.t("sign_in.description")),r==="idle"&&s.errorMessage?k.createElement(be,{color:"error",size:u?"16":"14",textAlign:"center",weight:"bold"},s.errorMessage):null)),k.createElement(R,{alignItems:u?void 0:"center",display:"flex",flexDirection:"column",gap:"8",width:"full"},k.createElement(on,{disabled:!s.nonce||r==="creatingMessage"||r==="signing"||r==="verifying",label:!s.nonce||r==="creatingMessage"?n.t("sign_in.message.preparing"):r==="signing"?n.t("sign_in.signature.waiting"):r==="verifying"?n.t("sign_in.signature.verifying"):n.t("sign_in.message.send"),onClick:p,size:u?"large":"medium",testId:"auth-message-button"}),u?k.createElement(on,{label:"Cancel",onClick:e,size:"large",type:"secondary"}):k.createElement(R,{as:"button",borderRadius:"full",className:pt({active:"shrink",hover:"grow"}),display:"block",onClick:e,paddingX:"10",paddingY:"5",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},k.createElement(be,{color:"closeButton",size:u?"16":"14",weight:"bold"},n.t("sign_in.message.cancel"))))))}function lq(){const e=Da(),t=Mu(),n=Pp()==="unauthenticated",r=S.useCallback(()=>{Gr(...t.map(s=>s.iconUrl),...e.map(s=>s.iconUrl).filter(A8)),mt()||(nq(),sq()),n&&Gr(H8)},[t,e,n]);S.useEffect(()=>{r()},[r])}var W8="WALLETCONNECT_DEEPLINK_CHOICE";function uq({mobileUri:e,name:t}){typeof window>"u"||window.localStorage.setItem(W8,JSON.stringify({href:e.split("?")[0],name:t}))}function dq(){typeof window<"u"&&window.localStorage.removeItem(W8)}var V8=S.createContext(void 0),Hg="data-rk",G8=e=>({[Hg]:e||""}),fq=e=>{if(e&&!/^[a-zA-Z0-9_]+$/.test(e))throw new Error(`Invalid ID: ${e}`);return e?`[${Hg}="${e}"]`:`[${Hg}]`},hq=()=>{const e=S.useContext(V8);return G8(e)},pq=lk();function mq({appInfo:e,avatar:t,children:n,coolMode:r=!1,id:s,initialChain:o,locale:a,modalSize:c=ud.WIDE,showRecentTransactions:l=!1,theme:u=pq}){if(lq(),$z(),bj({onDisconnect:dq}),typeof u=="function")throw new Error('A theme function was provided to the "theme" prop instead of a theme object. You must execute this function to get the resulting theme object.');const d=fq(s),f={...L8,...e},h=t??C8;return k.createElement(cz,{initialChain:o},k.createElement(Lz,null,k.createElement(Y$,{locale:a},k.createElement(D8.Provider,{value:r},k.createElement(Dz,{modalSize:c},k.createElement(m2.Provider,{value:l},k.createElement(Tz,null,k.createElement(j8.Provider,{value:h},k.createElement(cd.Provider,{value:f},k.createElement(V8.Provider,{value:s},k.createElement(dz,null,k.createElement(NU,null,u?k.createElement("div",{...G8(s)},k.createElement("style",{dangerouslySetInnerHTML:{__html:[`${d}{${N6("lightMode"in u?u.lightMode:u)}}`,"darkMode"in u?`@media(prefers-color-scheme:dark){${d}{${N6(u.darkMode,{extends:u.lightMode})}}}`:null].join("")}}),n):n))))))))))))}var gq="_9pm4ki5 ju367va ju367v15 ju367v8r",yq="_9pm4ki3 ju367v9h ju367vb3 ju367va ju367v2q ju367v8q",M6=(e,t)=>{const n=e.querySelectorAll("button:not(:disabled), a[href]");n.length!==0&&n[t==="end"?n.length-1:0].focus()};function bq(e){const t=S.useRef(null);return S.useEffect(()=>{const n=document.activeElement;return()=>{var r;(r=n.focus)==null||r.call(n)}},[]),S.useEffect(()=>{if(t.current){const n=t.current.querySelector("[data-auto-focus]");n?n.focus():t.current.focus()}},[]),k.createElement(k.Fragment,null,k.createElement("div",{onFocus:S.useCallback(()=>t.current&&M6(t.current,"end"),[]),tabIndex:0}),k.createElement("div",{ref:t,style:{outline:"none"},tabIndex:-1,...e}),k.createElement("div",{onFocus:S.useCallback(()=>t.current&&M6(t.current,"start"),[]),tabIndex:0}))}var vq=e=>e.stopPropagation();function Ah({children:e,onClose:t,open:n,titleId:r}){S.useEffect(()=>{const u=d=>n&&d.key==="Escape"&&t();return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[n,t]);const[s,o]=S.useState(!0);S.useEffect(()=>{o(getComputedStyle(window.document.body).overflow!=="hidden")},[]);const a=S.useCallback(()=>t(),[t]),c=hq(),l=mt();return k.createElement(k.Fragment,null,n?Gy.createPortal(k.createElement(u8,{enabled:s},k.createElement(R,{...c},k.createElement(R,{...c,alignItems:l?"flex-end":"center","aria-labelledby":r,"aria-modal":!0,className:yq,onClick:a,position:"fixed",role:"dialog"},k.createElement(bq,{className:gq,onClick:vq,role:"document"},e)))),document.body):null)}var wq="_1ckjpok7",_q="_1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",xq="_1ckjpok4 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",kq="_1ckjpok6 ju367vq",Cq="_1ckjpok3 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r",jq="_1ckjpok2 _1ckjpok1 ju367vb6 ju367vdr ju367vp ju367vt ju367vv ju367vel ju367va ju367v15 ju367v6c ju367v8r";function Eh({bottomSheetOnMobile:e=!1,children:t,marginTop:n,padding:r="16",paddingBottom:s,wide:o=!1}){const a=mt(),l=S.useContext(Lp)===ud.COMPACT;return k.createElement(R,{marginTop:n},k.createElement(R,{className:[o?a?jq:l?xq:Cq:_q,a?kq:null,a&&e?wq:null].join(" ")},k.createElement(R,{padding:r,paddingBottom:s??r},t)))}var B6=["k","m","b","t"];function af(e,t=1){return e.toString().replace(new RegExp(`(.+\\.\\d{${t}})\\d+`),"$1").replace(/(\.[1-9]*)0+$/,"$1").replace(/\.$/,"")}function K8(e){if(e<1)return af(e,3);if(e<10**2)return af(e,2);if(e<10**4)return new Intl.NumberFormat().format(Number.parseFloat(af(e,1)));const t=10**1;let n=String(e);for(let r=B6.length-1;r>=0;r--){const s=10**((r+1)*3);if(s<=e){const o=e*t/s/t;n=af(o,1)+B6[r];break}}return n}function Q8(e){return e.length<8?e:`${e.substring(0,4)}…${e.substring(e.length-4)}`}function Y8(e){if(!e)return"";const t=e.split("."),n=t.pop();return t.join(".").length>24?`${t.join(".").substring(0,24)}...`:`${t.join(".")}.${n}`}var Sq=()=>k.createElement("svg",{fill:"none",height:"13",viewBox:"0 0 13 13",width:"13",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Copied"),k.createElement("path",{d:"M4.94568 12.2646C5.41052 12.2646 5.77283 12.0869 6.01892 11.7109L12.39 1.96973C12.5677 1.69629 12.6429 1.44336 12.6429 1.2041C12.6429 0.561523 12.1644 0.0966797 11.5082 0.0966797C11.057 0.0966797 10.7767 0.260742 10.5033 0.691406L4.9115 9.50977L2.07458 5.98926C1.82166 5.68848 1.54822 5.55176 1.16541 5.55176C0.502319 5.55176 0.0238037 6.02344 0.0238037 6.66602C0.0238037 6.95312 0.112671 7.20605 0.358765 7.48633L3.88611 11.7588C4.18005 12.1074 4.50818 12.2646 4.94568 12.2646Z",fill:"currentColor"})),Aq=()=>k.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 17 16",width:"17",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Copy"),k.createElement("path",{d:"M3.04236 12.3027H4.18396V13.3008C4.18396 14.8525 5.03845 15.7002 6.59705 15.7002H13.6244C15.183 15.7002 16.0375 14.8525 16.0375 13.3008V6.24609C16.0375 4.69434 15.183 3.84668 13.6244 3.84668H12.4828V2.8418C12.4828 1.29688 11.6283 0.442383 10.0697 0.442383H3.04236C1.48376 0.442383 0.629272 1.29004 0.629272 2.8418V9.90332C0.629272 11.4551 1.48376 12.3027 3.04236 12.3027ZM3.23376 10.5391C2.68689 10.5391 2.39294 10.2656 2.39294 9.68457V3.06055C2.39294 2.47949 2.68689 2.21289 3.23376 2.21289H9.8783C10.4252 2.21289 10.7191 2.47949 10.7191 3.06055V3.84668H6.59705C5.03845 3.84668 4.18396 4.69434 4.18396 6.24609V10.5391H3.23376ZM6.78845 13.9365C6.24158 13.9365 5.94763 13.6699 5.94763 13.0889V6.45801C5.94763 5.87695 6.24158 5.61035 6.78845 5.61035H13.433C13.9799 5.61035 14.2738 5.87695 14.2738 6.45801V13.0889C14.2738 13.6699 13.9799 13.9365 13.433 13.9365H6.78845Z",fill:"currentColor"})),Eq=()=>k.createElement("svg",{fill:"none",height:"16",viewBox:"0 0 18 16",width:"18",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Disconnect"),k.createElement("path",{d:"M2.67834 15.5908H9.99963C11.5514 15.5908 12.399 14.7432 12.399 13.1777V10.2656H10.6354V12.9863C10.6354 13.5332 10.3688 13.8271 9.78772 13.8271H2.89026C2.3092 13.8271 2.0426 13.5332 2.0426 12.9863V3.15625C2.0426 2.60254 2.3092 2.30859 2.89026 2.30859H9.78772C10.3688 2.30859 10.6354 2.60254 10.6354 3.15625V5.89746H12.399V2.95801C12.399 1.39941 11.5514 0.544922 9.99963 0.544922H2.67834C1.12659 0.544922 0.278931 1.39941 0.278931 2.95801V13.1777C0.278931 14.7432 1.12659 15.5908 2.67834 15.5908ZM7.43616 8.85059H14.0875L15.0924 8.78906L14.566 9.14453L13.6842 9.96484C13.5406 10.1016 13.4586 10.2861 13.4586 10.4844C13.4586 10.8398 13.7321 11.168 14.1217 11.168C14.3199 11.168 14.4635 11.0928 14.6002 10.9561L16.7809 8.68652C16.986 8.48145 17.0543 8.27637 17.0543 8.06445C17.0543 7.85254 16.986 7.64746 16.7809 7.43555L14.6002 5.17285C14.4635 5.03613 14.3199 4.9541 14.1217 4.9541C13.7321 4.9541 13.4586 5.27539 13.4586 5.6377C13.4586 5.83594 13.5406 6.02734 13.6842 6.15723L14.566 6.98438L15.0924 7.33984L14.0875 7.27148H7.43616C7.01917 7.27148 6.65686 7.62012 6.65686 8.06445C6.65686 8.50195 7.01917 8.85059 7.43616 8.85059Z",fill:"currentColor"}));function Nq(){const e=P8(),{address:t}=Oe(),n=p2();return S.useCallback(()=>{if(!t||!n)throw new Error("No address or chain ID found");e.clearTransactions(t,n)},[e,t,n])}var J8=e=>{var t,n;return(n=(t=e==null?void 0:e.blockExplorers)==null?void 0:t.default)==null?void 0:n.url},X8=()=>k.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Link"),k.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM12.7158 12.1416C13.2432 12.1416 13.5684 11.7549 13.5684 11.1836V7.19336C13.5684 6.44629 13.1377 6.05957 12.417 6.05957H8.40918C7.8291 6.05957 7.45117 6.38477 7.45117 6.91211C7.45117 7.43945 7.8291 7.77344 8.40918 7.77344H9.69238L10.7207 7.63281L9.53418 8.67871L6.73047 11.4912C6.53711 11.6758 6.41406 11.9395 6.41406 12.2031C6.41406 12.7832 6.85352 13.1699 7.39844 13.1699C7.68848 13.1699 7.92578 13.0732 8.1543 12.8623L10.9316 10.0762L11.9775 8.89844L11.8545 9.98828V11.1836C11.8545 11.7725 12.1885 12.1416 12.7158 12.1416Z",fill:"currentColor"})),Iq=()=>k.createElement("svg",{fill:"none",height:"19",viewBox:"0 0 20 19",width:"20",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Cancel"),k.createElement("path",{d:"M10 18.9443C15.0977 18.9443 19.2812 14.752 19.2812 9.6543C19.2812 4.56543 15.0889 0.373047 10 0.373047C4.90234 0.373047 0.71875 4.56543 0.71875 9.6543C0.71875 14.752 4.91113 18.9443 10 18.9443ZM10 16.6328C6.1416 16.6328 3.03906 13.5215 3.03906 9.6543C3.03906 5.7959 6.13281 2.68457 10 2.68457C13.8584 2.68457 16.9697 5.7959 16.9697 9.6543C16.9785 13.5215 13.8672 16.6328 10 16.6328ZM7.29297 13.3018C7.58301 13.3018 7.81152 13.2139 7.99609 13.0205L10 11.0166L12.0127 13.0205C12.1973 13.2051 12.4258 13.3018 12.707 13.3018C13.2432 13.3018 13.6562 12.8887 13.6562 12.3525C13.6562 12.0977 13.5508 11.8691 13.3662 11.6934L11.3535 9.67188L13.375 7.6416C13.5596 7.44824 13.6562 7.22852 13.6562 6.98242C13.6562 6.44629 13.2432 6.0332 12.7158 6.0332C12.4346 6.0332 12.2148 6.12109 12.0215 6.31445L10 8.32715L7.9873 6.32324C7.80273 6.12988 7.58301 6.04199 7.29297 6.04199C6.76562 6.04199 6.35254 6.45508 6.35254 6.99121C6.35254 7.2373 6.44922 7.46582 6.63379 7.6416L8.65527 9.67188L6.63379 11.6934C6.44922 11.8691 6.35254 12.1064 6.35254 12.3525C6.35254 12.8887 6.76562 13.3018 7.29297 13.3018Z",fill:"currentColor"})),Mq=()=>k.createElement("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Success"),k.createElement("path",{d:"M10 19.4443C15.0977 19.4443 19.2812 15.252 19.2812 10.1543C19.2812 5.06543 15.0889 0.873047 10 0.873047C4.90234 0.873047 0.71875 5.06543 0.71875 10.1543C0.71875 15.252 4.91113 19.4443 10 19.4443ZM10 17.1328C6.1416 17.1328 3.03906 14.0215 3.03906 10.1543C3.03906 6.2959 6.13281 3.18457 10 3.18457C13.8584 3.18457 16.9697 6.2959 16.9697 10.1543C16.9785 14.0215 13.8672 17.1328 10 17.1328ZM9.07715 14.3379C9.4375 14.3379 9.7627 14.1533 9.97363 13.8369L13.7441 8.00977C13.8848 7.79883 13.9814 7.5791 13.9814 7.36816C13.9814 6.84961 13.5244 6.48926 13.0322 6.48926C12.707 6.48926 12.4258 6.66504 12.2148 7.0166L9.05957 12.0967L7.5918 10.2949C7.37207 10.0225 7.13477 9.9082 6.84473 9.9082C6.33496 9.9082 5.92188 10.3125 5.92188 10.8223C5.92188 11.0684 6.00098 11.2793 6.18555 11.5078L8.1543 13.8545C8.40918 14.1709 8.70801 14.3379 9.07715 14.3379Z",fill:"currentColor"})),Bq=e=>{switch(e){case"pending":return Iu;case"confirmed":return Mq;case"failed":return Iq;default:return Iu}};function Tq({tx:e}){const t=mt(),n=Bq(e.status),r=e.status==="failed"?"error":"accentColor",{chain:s}=Oe(),o=e.status==="confirmed"?"Confirmed":e.status==="failed"?"Failed":"Pending",a=J8(s);return k.createElement(k.Fragment,null,k.createElement(R,{...a?{as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:pt({active:"shrink"}),href:`${a}/tx/${e.hash}`,rel:"noreferrer noopener",target:"_blank",transition:"default"}:{},color:"modalText",display:"flex",flexDirection:"row",justifyContent:"space-between",padding:"8",width:"full"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:t?"16":"14"},k.createElement(R,{color:r},k.createElement(n,null)),k.createElement(R,{display:"flex",flexDirection:"column",gap:t?"3":"1"},k.createElement(R,null,k.createElement(be,{color:"modalText",font:"body",size:t?"16":"14",weight:"bold"},e==null?void 0:e.description)),k.createElement(R,null,k.createElement(be,{color:e.status==="pending"?"modalTextSecondary":r,font:"body",size:"14",weight:t?"medium":"regular"},o)))),a&&k.createElement(R,{alignItems:"center",color:"modalTextDim",display:"flex"},k.createElement(X8,null))))}var Pq=3;function Rq({address:e}){const t=R8(),n=Nq(),{chain:r}=Oe(),s=J8(r),o=t.slice(0,Pq),a=o.length>0,c=mt(),{appName:l}=S.useContext(cd),{i18n:u}=S.useContext(gt);return k.createElement(k.Fragment,null,k.createElement(R,{display:"flex",flexDirection:"column",gap:"10",paddingBottom:"2",paddingTop:"16",paddingX:c?"8":"18"},a&&k.createElement(R,{paddingBottom:c?"4":"0",paddingTop:"8",paddingX:c?"12":"6"},k.createElement(R,{display:"flex",justifyContent:"space-between"},k.createElement(be,{color:"modalTextSecondary",size:c?"16":"14",weight:"semibold"},u.t("profile.transactions.recent.title")),k.createElement(R,{style:{marginBottom:-6,marginLeft:-10,marginRight:-10,marginTop:-6}},k.createElement(R,{as:"button",background:{hover:"profileForeground"},borderRadius:"actionButton",className:pt({active:"shrink"}),onClick:n,paddingX:c?"8":"12",paddingY:c?"4":"5",transition:"default",type:"button"},k.createElement(be,{color:"modalTextSecondary",size:c?"16":"14",weight:"semibold"},u.t("profile.transactions.clear.label")))))),k.createElement(R,{display:"flex",flexDirection:"column",gap:"4"},a?o.map(d=>k.createElement(Tq,{key:d.hash,tx:d})):k.createElement(k.Fragment,null,k.createElement(R,{padding:c?"12":"8"},k.createElement(be,{color:"modalTextDim",size:c?"16":"14",weight:c?"medium":"bold"},l?u.t("profile.transactions.description",{appName:l}):u.t("profile.transactions.description_fallback"))),c&&k.createElement(R,{background:"generalBorderDim",height:"1",marginX:"12",marginY:"8"})))),s&&k.createElement(R,{paddingBottom:"18",paddingX:c?"8":"18"},k.createElement(R,{alignItems:"center",as:"a",background:{hover:"profileForeground"},borderRadius:"menuButton",className:pt({active:"shrink"}),color:"modalTextDim",display:"flex",flexDirection:"row",href:`${s}/address/${e}`,justifyContent:"space-between",paddingX:"8",paddingY:"12",rel:"noreferrer noopener",style:{willChange:"transform"},target:"_blank",transition:"default",width:"full",...c?{paddingLeft:"12"}:{}},k.createElement(be,{color:"modalText",font:"body",size:c?"16":"14",weight:c?"semibold":"bold"},u.t("profile.explorer.label")),k.createElement(X8,null))))}function T6({action:e,icon:t,label:n,testId:r,url:s}){const o=mt();return k.createElement(R,{...s?{as:"a",href:s,rel:"noreferrer noopener",target:"_blank"}:{as:"button",type:"button"},background:{base:"profileAction",...o?{}:{hover:"profileActionHover"}},borderRadius:"menuButton",boxShadow:"profileDetailsAction",className:pt({active:"shrinkSm",hover:o?void 0:"grow"}),display:"flex",onClick:e,padding:o?"6":"8",style:{willChange:"transform"},testId:r,transition:"default",width:"full"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"1",justifyContent:"center",paddingTop:"2",width:"full"},k.createElement(R,{color:"modalText",height:"max"},t),k.createElement(R,null,k.createElement(be,{color:"modalText",size:o?"12":"13",weight:"semibold"},n))))}function Lq({address:e,ensAvatar:t,ensName:n,balance:r,onClose:s,onDisconnect:o}){const a=S.useContext(m2),{i18n:c}=S.useContext(gt),[l,u]=S.useState(!1),d=S.useCallback(()=>{e&&(navigator.clipboard.writeText(e),u(!0))},[e]);if(S.useEffect(()=>{if(l){const _=setTimeout(()=>{u(!1)},1500);return()=>clearTimeout(_)}},[l]),!e)return null;const f=n?Y8(n):Q8(e),h=r==null?void 0:r.formatted,p=h?K8(Number.parseFloat(h)):void 0,m="rk_profile_title",g=mt();return k.createElement(k.Fragment,null,k.createElement(R,{display:"flex",flexDirection:"column"},k.createElement(R,{background:"profileForeground",padding:"16"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:g?"16":"12",justifyContent:"center",margin:"8",style:{textAlign:"center"}},k.createElement(R,{style:{position:"absolute",right:16,top:16,willChange:"transform"}},k.createElement(Na,{onClose:s}))," ",k.createElement(R,{marginTop:g?"24":"0"},k.createElement(S8,{address:e,imageUrl:t,size:g?82:74})),k.createElement(R,{display:"flex",flexDirection:"column",gap:g?"4":"0",textAlign:"center"},k.createElement(R,{textAlign:"center"},k.createElement(be,{as:"h1",color:"modalText",id:m,size:g?"20":"18",weight:"heavy"},f)),!!r&&k.createElement(R,{textAlign:"center"},k.createElement(be,{as:"h1",color:"modalTextSecondary",id:m,size:g?"16":"14",weight:"semibold"},p," ",r.symbol)))),k.createElement(R,{display:"flex",flexDirection:"row",gap:"8",margin:"2",marginTop:"16"},k.createElement(T6,{action:d,icon:l?k.createElement(Sq,null):k.createElement(Aq,null),label:l?c.t("profile.copy_address.copied"):c.t("profile.copy_address.label")}),k.createElement(T6,{action:o,icon:k.createElement(Eq,null),label:c.t("profile.disconnect.label"),testId:"disconnect-button"}))),a&&k.createElement(k.Fragment,null,k.createElement(R,{background:"generalBorder",height:"1",marginTop:"-1"}),k.createElement(R,null,k.createElement(Rq,{address:e})))))}function Dq({onClose:e,open:t}){const{address:n}=Oe(),{balance:r,ensAvatar:s,ensName:o}=M8({address:n,includeBalance:t}),{disconnect:a}=Tc();return n?k.createElement(k.Fragment,null,n&&k.createElement(Ah,{onClose:e,open:t,titleId:"rk_account_modal_title"},k.createElement(Eh,{bottomSheetOnMobile:!0,padding:"0"},k.createElement(Lq,{address:n,ensAvatar:s,ensName:o,balance:r,onClose:e,onDisconnect:a})))):null}var Oq=({size:e})=>k.createElement("svg",{fill:"none",height:e,viewBox:"0 0 28 28",width:e,xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Disconnect"),k.createElement("path",{d:"M6.742 22.195h8.367c1.774 0 2.743-.968 2.743-2.758V16.11h-2.016v3.11c0 .625-.305.96-.969.96H6.984c-.664 0-.968-.335-.968-.96V7.984c0-.632.304-.968.968-.968h7.883c.664 0 .969.336.969.968v3.133h2.016v-3.36c0-1.78-.97-2.757-2.743-2.757H6.742C4.97 5 4 5.977 4 7.758v11.68c0 1.789.969 2.757 2.742 2.757Zm5.438-7.703h7.601l1.149-.07-.602.406-1.008.938a.816.816 0 0 0-.258.593c0 .407.313.782.758.782.227 0 .39-.086.547-.243l2.492-2.593c.235-.235.313-.47.313-.711 0-.242-.078-.477-.313-.719l-2.492-2.586c-.156-.156-.32-.25-.547-.25-.445 0-.758.367-.758.781 0 .227.094.446.258.594l1.008.945.602.407-1.149-.079H12.18a.904.904 0 0 0 0 1.805Z",fill:"currentColor"})),Fq="v9horb0",w2=k.forwardRef(({children:e,currentlySelected:t=!1,onClick:n,testId:r,...s},o)=>{const a=mt();return k.createElement(R,{as:"button",borderRadius:"menuButton",disabled:t,display:"flex",onClick:n,ref:o,testId:r,type:"button"},k.createElement(R,{borderRadius:"menuButton",className:[a?Fq:void 0,!t&&pt({active:"shrink"})],padding:a?"8":"6",transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",borderStyle:"solid",borderWidth:"1",boxShadow:"selectedOption",color:"accentColorForeground"}:{background:{hover:"menuItemBackground"},color:"modalText",transition:"default"},...s},e))});w2.displayName="MenuButton";var $q=({chainId:e,currentChainId:t,switchChain:n,chainIconSize:r,isLoading:s,src:o,name:a,iconBackground:c,idx:l})=>{const u=mt(),{i18n:d}=S.useContext(gt),f=Da(),h=t===e;return k.createElement(S.Fragment,null,k.createElement(w2,{currentlySelected:h,onClick:h?void 0:()=>n({chainId:e}),testId:`chain-option-${e}`},k.createElement(R,{fontFamily:"body",fontSize:"16",fontWeight:"bold"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:r},o&&k.createElement(R,{height:"full",marginRight:"8"},k.createElement(It,{alt:a,background:c,borderRadius:"full",height:r,src:o,width:r,testId:`chain-option-${e}-icon`})),k.createElement("div",null,a??a)),h&&k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},k.createElement(be,{color:"accentColorForeground",size:"14",weight:"medium"},d.t("chains.connected")),k.createElement(R,{background:"connectionIndicator",borderColor:"selectedOptionBorder",borderRadius:"full",borderStyle:"solid",borderWidth:"1",height:"8",marginLeft:"8",width:"8"})),s&&k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",marginRight:"6"},k.createElement(be,{color:"modalText",size:"14",weight:"medium"},d.t("chains.confirm")),k.createElement(R,{background:"standby",borderRadius:"full",height:"8",marginLeft:"8",width:"8"}))))),u&&l<f.length-1&&k.createElement(R,{background:"generalBorderDim",height:"1",marginX:"8"}))},zq=$q,qq="_18dqw9x0",Uq="_18dqw9x1";function Hq({onClose:e,open:t}){const{chainId:n}=Oe(),{chains:r}=at(),[s,o]=S.useState(null),{switchChain:a}=Ls({mutation:{onMutate:({chainId:m})=>{o(m)},onSuccess:()=>{s&&o(null)},onError:()=>{s&&o(null)},onSettled:()=>{e()}}}),{i18n:c}=S.useContext(gt),{disconnect:l}=Tc(),u="rk_chain_modal_title",d=mt(),f=r.some(m=>m.id===n),h=d?"36":"28",p=Da();return n?k.createElement(Ah,{onClose:e,open:t,titleId:u},k.createElement(Eh,{bottomSheetOnMobile:!0,paddingBottom:"0"},k.createElement(R,{display:"flex",flexDirection:"column",gap:"14"},k.createElement(R,{display:"flex",flexDirection:"row",justifyContent:"space-between"},d&&k.createElement(R,{width:"30"}),k.createElement(R,{paddingBottom:"0",paddingLeft:"8",paddingTop:"4"},k.createElement(be,{as:"h1",color:"modalText",id:u,size:d?"20":"18",weight:"heavy"},c.t("chains.title"))),k.createElement(Na,{onClose:e})),!f&&k.createElement(R,{marginX:"8",textAlign:d?"center":"left"},k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},c.t("chains.wrong_network"))),k.createElement(R,{className:d?Uq:qq,display:"flex",flexDirection:"column",gap:"4",padding:"2",paddingBottom:"16"},p.map(({iconBackground:m,iconUrl:g,id:_,name:b},y)=>k.createElement(zq,{key:_,chainId:_,currentChainId:n,switchChain:a,chainIconSize:h,isLoading:s===_,src:g,name:b,iconBackground:m,idx:y})),!f&&k.createElement(k.Fragment,null,k.createElement(R,{background:"generalBorderDim",height:"1",marginX:"8"}),k.createElement(w2,{onClick:()=>l(),testId:"chain-option-disconnect"},k.createElement(R,{color:"error",fontFamily:"body",fontSize:"16",fontWeight:"bold"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",justifyContent:"space-between"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",height:h},k.createElement(R,{alignItems:"center",color:"error",height:h,justifyContent:"center",marginRight:"8"},k.createElement(Oq,{size:Number(h)})),k.createElement("div",null,c.t("chains.disconnect"))))))))))):null}function Wq(e,t){const n={};for(const r of e){const s=t(r);s&&(n[s]||(n[s]=[]),n[s].push(r))}return n}var Vq="rk-latest-id";function Gq(e){typeof window<"u"&&window.localStorage.setItem(Vq,e)}var _2=({children:e,href:t})=>k.createElement(R,{as:"a",color:"accentColor",href:t,rel:"noreferrer",target:"_blank"},e),x2=({children:e})=>k.createElement(be,{color:"modalTextSecondary",size:"12",weight:"medium"},e);function P6({compactModeEnabled:e=!1,getWallet:t}){const{disclaimer:n,learnMoreUrl:r}=S.useContext(cd),{i18n:s}=S.useContext(gt);return k.createElement(k.Fragment,null,k.createElement(R,{alignItems:"center",color:"accentColor",display:"flex",flexDirection:"column",height:"full",justifyContent:"space-around"},k.createElement(R,{marginBottom:"10"},!e&&k.createElement(be,{color:"modalText",size:"18",weight:"heavy"},s.t("intro.title"))),k.createElement(R,{display:"flex",flexDirection:"column",gap:"32",justifyContent:"center",marginY:"20",style:{maxWidth:312}},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},k.createElement(R,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},k.createElement(rq,null)),k.createElement(R,{display:"flex",flexDirection:"column",gap:"4"},k.createElement(be,{color:"modalText",size:"14",weight:"bold"},s.t("intro.digital_asset.title")),k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},s.t("intro.digital_asset.description")))),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},k.createElement(R,{borderRadius:"6",height:"48",minWidth:"48",width:"48"},k.createElement(oq,null)),k.createElement(R,{display:"flex",flexDirection:"column",gap:"4"},k.createElement(be,{color:"modalText",size:"14",weight:"bold"},s.t("intro.login.title")),k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},s.t("intro.login.description"))))),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",margin:"10"},k.createElement(on,{label:s.t("intro.get.label"),onClick:t}),k.createElement(R,{as:"a",className:pt({active:"shrink",hover:"grow"}),display:"block",href:r,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},k.createElement(be,{color:"accentColor",size:"14",weight:"bold"},s.t("intro.learn_more.label")))),n&&!e&&k.createElement(R,{marginBottom:"8",marginTop:"12",textAlign:"center"},k.createElement(n,{Link:_2,Text:x2}))))}var Z8=()=>k.createElement("svg",{fill:"none",height:"17",viewBox:"0 0 11 17",width:"11",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Back"),k.createElement("path",{d:"M0.99707 8.6543C0.99707 9.08496 1.15527 9.44531 1.51562 9.79688L8.16016 16.3096C8.43262 16.5732 8.74902 16.7051 9.13574 16.7051C9.90918 16.7051 10.5508 16.0811 10.5508 15.3076C10.5508 14.9121 10.3838 14.5605 10.0938 14.2705L4.30176 8.64551L10.0938 3.0293C10.3838 2.74805 10.5508 2.3877 10.5508 2.00098C10.5508 1.23633 9.90918 0.603516 9.13574 0.603516C8.74902 0.603516 8.43262 0.735352 8.16016 0.999023L1.51562 7.51172C1.15527 7.85449 1.00586 8.21484 0.99707 8.6543Z",fill:"currentColor"})),Kq=()=>k.createElement("svg",{fill:"none",height:"12",viewBox:"0 0 8 12",width:"8",xmlns:"http://www.w3.org/2000/svg"},k.createElement("title",null,"Info"),k.createElement("path",{d:"M3.64258 7.99609C4.19336 7.99609 4.5625 7.73828 4.68555 7.24609C4.69141 7.21094 4.70312 7.16406 4.70898 7.13477C4.80859 6.60742 5.05469 6.35547 6.04492 5.76367C7.14648 5.10156 7.67969 4.3457 7.67969 3.24414C7.67969 1.39844 6.17383 0.255859 3.95898 0.255859C2.32422 0.255859 1.05859 0.894531 0.548828 1.86719C0.396484 2.14844 0.320312 2.44727 0.320312 2.74023C0.314453 3.37305 0.742188 3.79492 1.42188 3.79492C1.91406 3.79492 2.33594 3.54883 2.53516 3.11523C2.78711 2.47656 3.23242 2.21289 3.83594 2.21289C4.55664 2.21289 5.10742 2.65234 5.10742 3.29102C5.10742 3.9707 4.7793 4.29883 3.81836 4.87891C3.02148 5.36523 2.50586 5.92773 2.50586 6.76562V6.90039C2.50586 7.55664 2.96289 7.99609 3.64258 7.99609ZM3.67188 11.4473C4.42773 11.4473 5.04297 10.8672 5.04297 10.1406C5.04297 9.41406 4.42773 8.83984 3.67188 8.83984C2.91602 8.83984 2.30664 9.41406 2.30664 10.1406C2.30664 10.8672 2.91602 11.4473 3.67188 11.4473Z",fill:"currentColor"})),Qq=({"aria-label":e="Info",onClick:t})=>{const n=mt();return k.createElement(R,{alignItems:"center","aria-label":e,as:"button",background:"closeButtonBackground",borderColor:"actionButtonBorder",borderRadius:"full",borderStyle:"solid",borderWidth:n?"0":"1",className:pt({active:"shrinkSm",hover:"growLg"}),color:"closeButton",display:"flex",height:n?"30":"28",justifyContent:"center",onClick:t,style:{willChange:"transform"},transition:"default",type:"button",width:n?"30":"28"},k.createElement(Kq,null))},eS=e=>{const t=S.useRef(null),n=S.useContext(D8),r=Rp(e);return S.useEffect(()=>{if(n&&t.current&&r)return Jq(t.current,r)},[n,r]),t},Yq=()=>{const e="_rk_coolMode",t=document.getElementById(e);if(t)return t;const n=document.createElement("div");return n.setAttribute("id",e),n.setAttribute("style",["overflow:hidden","position:fixed","height:100%","top:0","left:0","right:0","bottom:0","pointer-events:none","z-index:2147483647"].join(";")),document.body.appendChild(n),n},R6=0;function Jq(e,t){R6++;const n=[15,20,25,35,45],r=35;let s=[],o=!1,a=0,c=0;const l=Yq();function u(){const w=n[Math.floor(Math.random()*n.length)],x=Math.random()*10,A=Math.random()*25,C=Math.random()*360,j=Math.random()*35*(Math.random()<=.5?-1:1),E=c-w/2,I=a-w/2,T=Math.random()<=.5?-1:1,O=document.createElement("div"),B=document.createElement("img");B.src=t,B.width=w,B.height=w,B.style.borderRadius="25%",O.appendChild(B),O.setAttribute("style",["position:absolute","will-change:transform",`top:${E}px`,`left:${I}px`,`transform:rotate(${C}deg)`].join(";")),l.appendChild(O),s.push({direction:T,element:O,left:I,size:w,speedHorz:x,speedUp:A,spinSpeed:j,spinVal:C,top:E})}function d(){for(const w of s)w.left=w.left-w.speedHorz*w.direction,w.top=w.top-w.speedUp,w.speedUp=Math.min(w.size,w.speedUp-1),w.spinVal=w.spinVal+w.spinSpeed,w.top>=Math.max(window.innerHeight,document.body.clientHeight)+w.size&&(s=s.filter(x=>x!==w),w.element.remove()),w.element.setAttribute("style",["position:absolute","will-change:transform",`top:${w.top}px`,`left:${w.left}px`,`transform:rotate(${w.spinVal}deg)`].join(";"))}let f;function h(){o&&s.length<r&&u(),d(),f=requestAnimationFrame(h)}h();const p="ontouchstart"in window||navigator.msMaxTouchPoints,m=p?"touchstart":"mousedown",g=p?"touchend":"mouseup",_=p?"touchmove":"mousemove",b=w=>{var x,A;"touches"in w?(a=(x=w.touches)==null?void 0:x[0].clientX,c=(A=w.touches)==null?void 0:A[0].clientY):(a=w.clientX,c=w.clientY)},y=w=>{b(w),o=!0},v=()=>{o=!1};return e.addEventListener(_,b,{passive:!1}),e.addEventListener(m,y),e.addEventListener(g,v),e.addEventListener("mouseleave",v),()=>{e.removeEventListener(_,b),e.removeEventListener(m,y),e.removeEventListener(g,v),e.removeEventListener("mouseleave",v);const w=setInterval(()=>{f&&s.length===0&&(cancelAnimationFrame(f),clearInterval(w),--R6===0&&l.remove())},500)}}var Xq="g5kl0l0",tS=({as:e="button",currentlySelected:t=!1,iconBackground:n,iconUrl:r,name:s,onClick:o,ready:a,recent:c,testId:l,isRainbowKitConnector:u,...d})=>{const f=eS(r),[h,p]=k.useState(!1),{i18n:m}=k.useContext(gt);return k.createElement(R,{display:"flex",flexDirection:"column",onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),ref:f},k.createElement(R,{as:e,borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:t?void 0:[Xq,pt({active:"shrink"})],disabled:t,onClick:o,padding:"5",style:{willChange:"transform"},testId:l,transition:"default",width:"full",...t?{background:"accentColor",borderColor:"selectedOptionBorder",boxShadow:"selectedWallet"}:{background:{hover:"menuItemBackground"}},...d},k.createElement(R,{color:t?"accentColorForeground":"modalText",disabled:!a,fontFamily:"body",fontSize:"16",fontWeight:"bold",transition:"default"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:"12"},k.createElement(It,{background:n,...!h&&u?{borderColor:"actionButtonBorder"}:{},useAsImage:!u,borderRadius:"6",height:"28",src:r,width:"28"}),k.createElement(R,null,k.createElement(R,{style:{marginTop:c?-2:void 0},maxWidth:"200"},s),c&&k.createElement(be,{color:t?"accentColorForeground":"accentColor",size:"12",style:{lineHeight:1,marginTop:-1},weight:"medium"},m.t("connect.recent")))))))};tS.displayName="ModalSelection";var y1=(e,t=1)=>{let n=e.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=Number.parseInt(n.substring(0,2),16),s=Number.parseInt(n.substring(2,4),16),o=Number.parseInt(n.substring(4,6),16),a=t>1&&t<=100?t/100:t;return`rgba(${r},${s},${o},${a})`},Zq=e=>e?[y1(e,.2),y1(e,.14),y1(e,.1)]:null,eU=e=>/^#([0-9a-f]{3}){1,2}$/i.test(e),nS=async()=>(await ae(async()=>{const{default:e}=await import("./connect-UA7M4XW6-IY3X6Bmr.js");return{default:e}},[])).default,tU=()=>Gr(nS),nU=()=>k.createElement(It,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:nS,width:"48"}),rS=async()=>(await ae(async()=>{const{default:e}=await import("./create-FASO7PVG-D_rvSpre.js");return{default:e}},[])).default,sS=()=>Gr(rS),rU=()=>k.createElement(It,{background:"#e3a5e8",borderColor:"generalBorder",borderRadius:"10",height:"48",src:rS,width:"48"}),oS=async()=>(await ae(async()=>{const{default:e}=await import("./refresh-S4T5V5GX-CwqIaaxK.js");return{default:e}},[])).default,sU=()=>Gr(oS),oU=()=>k.createElement(It,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:oS,width:"48"}),aS=async()=>(await ae(async()=>{const{default:e}=await import("./scan-4UYSQ56Q-CjMz6-XC.js");return{default:e}},[])).default,iS=()=>Gr(aS),aU=()=>k.createElement(It,{background:"#515a70",borderColor:"generalBorder",borderRadius:"10",height:"48",src:aS,width:"48"}),iU="_1vwt0cg0",cU="_1vwt0cg2 ju367v7a ju367v7v",lU="_1vwt0cg3",uU="_1vwt0cg4";function cS({ecc:e="medium",logoBackground:t,logoSize:n=50,logoUrl:r,size:s=200,uri:o}){const a="20",c=s-Number.parseInt(a,10)*2,l=Rp(r);return k.createElement(R,{borderColor:"generalBorder",borderRadius:"menuButton",borderStyle:"solid",borderWidth:"1",className:iU,padding:a,width:"max"},k.createElement(R,{style:{height:c,userSelect:"none",width:c},userSelect:"none"},k.createElement(Or.Root,{errorCorrection:e,size:c,value:o},k.createElement(Or.Cells,{className:void 0,fill:"currentColor",filter:void 0,radius:1}),k.createElement(Or.Finder,{className:void 0,fill:"currentColor",radius:.25,stroke:void 0}),l&&k.createElement(Or.Arena,null,k.createElement("img",{alt:"Wallet Logo",src:l,style:{backgroundColor:t,borderRadius:"22.5%",height:"88%",objectFit:"cover",width:"88%"}})))))}var lS=async()=>{switch(y2()){case"Arc":return(await ae(async()=>{const{default:t}=await import("./Arc-VDBY7LNS-BChRXCXW.js");return{default:t}},[])).default;case"Brave":return(await ae(async()=>{const{default:t}=await import("./Brave-BRAKJXDS-mq-Xo37j.js");return{default:t}},[])).default;case"Chrome":return(await ae(async()=>{const{default:t}=await import("./Chrome-65Q5P54Y-DR9MQEVr.js");return{default:t}},[])).default;case"Edge":return(await ae(async()=>{const{default:t}=await import("./Edge-XSPUTORV-DEoZslQE.js");return{default:t}},[])).default;case"Firefox":return(await ae(async()=>{const{default:t}=await import("./Firefox-AAHGJQIP-Bp_Hm04m.js");return{default:t}},[])).default;case"Opera":return(await ae(async()=>{const{default:t}=await import("./Opera-KQZLSACL-Cwv5MDFy.js");return{default:t}},[])).default;case"Safari":return(await ae(async()=>{const{default:t}=await import("./Safari-ZPL37GXR-C4Ggg6rz.js");return{default:t}},[])).default;default:return(await ae(async()=>{const{default:t}=await import("./Browser-76IHF3Y2-BMhRaC5Z.js");return{default:t}},[])).default}},dU=()=>Gr(lS),uS=async()=>{switch(v2()){case"Windows":return(await ae(async()=>{const{default:t}=await import("./Windows-PPTHQER6-BlyV2p7Y.js");return{default:t}},[])).default;case"macOS":return(await ae(async()=>{const{default:t}=await import("./Macos-MW4AE7LN-Vvm8Drw3.js");return{default:t}},[])).default;case"Linux":return(await ae(async()=>{const{default:t}=await import("./Linux-OO4TNCLJ-B0aw93n9.js");return{default:t}},[])).default;default:return(await ae(async()=>{const{default:t}=await import("./Linux-OO4TNCLJ-B0aw93n9.js");return{default:t}},[])).default}},fU=()=>Gr(uS);function hU({getWalletDownload:e,compactModeEnabled:t}){const r=Mu().filter(o=>o.isRainbowKitConnector).splice(0,5),{i18n:s}=S.useContext(gt);return k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginTop:"18",width:"full"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"28",height:"full",width:"full"},r==null?void 0:r.filter(o=>{var a;return o.extensionDownloadUrl||o.desktopDownloadUrl||o.qrCode&&((a=o.downloadUrls)==null?void 0:a.qrCode)}).map(o=>{const{downloadUrls:a,iconBackground:c,iconUrl:l,id:u,name:d,qrCode:f}=o,h=(a==null?void 0:a.qrCode)&&f,p=!!o.extensionDownloadUrl,m=(a==null?void 0:a.qrCode)&&p,g=(a==null?void 0:a.qrCode)&&!!o.desktopDownloadUrl;return k.createElement(R,{alignItems:"center",display:"flex",gap:"16",justifyContent:"space-between",key:o.id,width:"full"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16"},k.createElement(It,{background:c,borderColor:"actionButtonBorder",borderRadius:"10",height:"48",src:l,width:"48"}),k.createElement(R,{display:"flex",flexDirection:"column",gap:"2"},k.createElement(be,{color:"modalText",size:"14",weight:"bold"},d),k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},m?s.t("get.mobile_and_extension.description"):g?s.t("get.mobile_and_desktop.description"):h?s.t("get.mobile.description"):p?s.t("get.extension.description"):null))),k.createElement(R,{display:"flex",flexDirection:"column",gap:"4"},k.createElement(on,{label:s.t("get.action.label"),onClick:()=>e(u),type:"secondary"})))})),k.createElement(R,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"column",gap:"8",justifyContent:"space-between",marginBottom:"4",paddingY:"8",style:{maxWidth:275,textAlign:"center"}},k.createElement(be,{color:"modalText",size:"14",weight:"bold"},s.t("get.looking_for.title")),k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},t?s.t("get.looking_for.desktop.compact_description"):s.t("get.looking_for.desktop.wide_description"))))}var b1="44";function pU({changeWalletStep:e,compactModeEnabled:t,connectionError:n,onClose:r,qrCodeUri:s,reconnect:o,wallet:a}){const{downloadUrls:c,iconBackground:l,iconUrl:u,name:d,qrCode:f,ready:h,showWalletConnectModal:p,getDesktopUri:m}=a,g=!!m,_=g2(),{i18n:b}=S.useContext(gt),y=!!a.extensionDownloadUrl,v=(c==null?void 0:c.qrCode)&&y,w=(c==null?void 0:c.qrCode)&&!!a.desktopDownloadUrl,x=f&&s,A=async()=>{const I=await(m==null?void 0:m());window.open(I,_?"_blank":"_self")},C=p?{description:t?b.t("connect.walletconnect.description.compact"):b.t("connect.walletconnect.description.full"),label:b.t("connect.walletconnect.open.label"),onClick:()=>{r(),p()}}:x?{description:b.t("connect.secondary_action.get.description",{wallet:d}),label:b.t("connect.secondary_action.get.label"),onClick:()=>e(v||w?"DOWNLOAD_OPTIONS":"DOWNLOAD")}:null,{width:j}=O8(),E=j&&j<768;return S.useEffect(()=>{dU(),fU()},[]),k.createElement(R,{display:"flex",flexDirection:"column",height:"full",width:"full"},x?k.createElement(R,{alignItems:"center",display:"flex",height:"full",justifyContent:"center"},k.createElement(cS,{logoBackground:l,logoSize:t?60:72,logoUrl:u,size:t?318:E?Math.max(280,Math.min(j-308,382)):382,uri:s})):k.createElement(R,{alignItems:"center",display:"flex",justifyContent:"center",style:{flexGrow:1}},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8"},k.createElement(R,{borderRadius:"10",height:b1,overflow:"hidden"},k.createElement(It,{useAsImage:!a.isRainbowKitConnector,height:b1,src:u,width:b1})),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"4",paddingX:"32",style:{textAlign:"center"}},k.createElement(be,{color:"modalText",size:"18",weight:"bold"},h?b.t("connect.status.opening",{wallet:d}):y?b.t("connect.status.not_installed",{wallet:d}):b.t("connect.status.not_available",{wallet:d})),!h&&y?k.createElement(R,{paddingTop:"20"},k.createElement(on,{href:a.extensionDownloadUrl,label:b.t("connect.secondary_action.install.label"),type:"secondary"})):null,h&&!x&&k.createElement(k.Fragment,null,k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},k.createElement(be,{color:"modalTextSecondary",size:"14",textAlign:"center",weight:"medium"},b.t("connect.status.confirm"))),k.createElement(R,{alignItems:"center",color:"modalText",display:"flex",flexDirection:"row",height:"32",marginTop:"8"},n?k.createElement(on,{label:b.t("connect.secondary_action.retry.label"),onClick:async()=>{g&&A(),o(a)}}):k.createElement(R,{color:"modalTextSecondary"},k.createElement(Iu,null))))))),k.createElement(R,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"28",justifyContent:"space-between",marginTop:"12"},h&&C&&k.createElement(k.Fragment,null,k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},C.description),k.createElement(on,{label:C.label,onClick:C.onClick,type:"secondary"}))))}var v1=({actionLabel:e,description:t,iconAccent:n,iconBackground:r,iconUrl:s,isCompact:o,onAction:a,title:c,url:l,variant:u})=>{const d=u==="browser",f=!d&&n&&Zq(n);return k.createElement(R,{alignItems:"center",borderRadius:"13",display:"flex",justifyContent:"center",overflow:"hidden",paddingX:o?"18":"44",position:"relative",style:{flex:1,isolation:"isolate"},width:"full"},k.createElement(R,{borderColor:"actionButtonBorder",borderRadius:"13",borderStyle:"solid",borderWidth:"1",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0",zIndex:1}}),d&&k.createElement(R,{background:"downloadTopCardBackground",height:"full",position:"absolute",style:{zIndex:0},width:"full"},k.createElement(R,{display:"flex",flexDirection:"row",justifyContent:"space-between",style:{bottom:"0",filter:"blur(20px)",left:"0",position:"absolute",right:"0",top:"0",transform:"translate3d(0, 0, 0)"}},k.createElement(R,{style:{filter:"blur(100px)",marginLeft:-27,marginTop:-20,opacity:.6,transform:"translate3d(0, 0, 0)"}},k.createElement(It,{borderRadius:"full",height:"200",src:s,width:"200"})),k.createElement(R,{style:{filter:"blur(100px)",marginRight:0,marginTop:105,opacity:.6,overflow:"auto",transform:"translate3d(0, 0, 0)"}},k.createElement(It,{borderRadius:"full",height:"200",src:s,width:"200"})))),!d&&f&&k.createElement(R,{background:"downloadBottomCardBackground",style:{bottom:"0",left:"0",position:"absolute",right:"0",top:"0"}},k.createElement(R,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${f[0]} 0%, ${f[1]} 25%, rgba(0,0,0,0) 100%)`,height:564,left:-215,top:-197,transform:"translate3d(0, 0, 0)",width:564}}),k.createElement(R,{position:"absolute",style:{background:`radial-gradient(50% 50% at 50% 50%, ${f[2]} 0%, rgba(0, 0, 0, 0) 100%)`,height:564,left:-1,top:-76,transform:"translate3d(0, 0, 0)",width:564}})),k.createElement(R,{alignItems:"flex-start",display:"flex",flexDirection:"row",gap:"24",height:"max",justifyContent:"center",style:{zIndex:1}},k.createElement(R,null,k.createElement(It,{height:"60",src:s,width:"60",...r?{background:r,borderColor:"generalBorder",borderRadius:"10"}:null})),k.createElement(R,{display:"flex",flexDirection:"column",gap:"4",style:{flex:1},width:"full"},k.createElement(be,{color:"modalText",size:"14",weight:"bold"},c),k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},t),k.createElement(R,{marginTop:"14",width:"max"},k.createElement(on,{href:l,label:e,onClick:a,size:"medium"})))))};function mU({changeWalletStep:e,wallet:t}){const n=y2(),r=v2(),o=S.useContext(Lp)==="compact",{desktop:a,desktopDownloadUrl:c,extension:l,extensionDownloadUrl:u,mobileDownloadUrl:d}=t,{i18n:f}=S.useContext(gt);return S.useEffect(()=>{sS(),iS(),sU(),tU()},[]),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",marginBottom:"8",marginTop:"4",width:"full"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"8",height:"full",justifyContent:"center",width:"full"},u&&k.createElement(v1,{actionLabel:f.t("get_options.extension.download.label",{browser:n}),description:f.t("get_options.extension.description"),iconUrl:lS,isCompact:o,onAction:()=>e(l!=null&&l.instructions?"INSTRUCTIONS_EXTENSION":"CONNECT"),title:f.t("get_options.extension.title",{wallet:t.name,browser:n}),url:u,variant:"browser"}),c&&k.createElement(v1,{actionLabel:f.t("get_options.desktop.download.label",{platform:r}),description:f.t("get_options.desktop.description"),iconUrl:uS,isCompact:o,onAction:()=>e(a!=null&&a.instructions?"INSTRUCTIONS_DESKTOP":"CONNECT"),title:f.t("get_options.desktop.title",{wallet:t.name,platform:r}),url:c,variant:"desktop"}),d&&k.createElement(v1,{actionLabel:f.t("get_options.mobile.download.label",{wallet:t.name}),description:f.t("get_options.mobile.description"),iconAccent:t.iconAccent,iconBackground:t.iconBackground,iconUrl:t.iconUrl,isCompact:o,onAction:()=>{e("DOWNLOAD")},title:f.t("get_options.mobile.title",{wallet:t.name}),variant:"app"})))}function gU({changeWalletStep:e,wallet:t}){const{downloadUrls:n,qrCode:r}=t,{i18n:s}=S.useContext(gt);return S.useEffect(()=>{sS(),iS()},[]),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"24",height:"full",width:"full"},k.createElement(R,{style:{maxWidth:220,textAlign:"center"}},k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"semibold"},s.t("get_mobile.description"))),k.createElement(R,{height:"full"},n!=null&&n.qrCode?k.createElement(cS,{logoSize:0,size:268,uri:n.qrCode}):null),k.createElement(R,{alignItems:"center",borderRadius:"10",display:"flex",flexDirection:"row",gap:"8",height:"34",justifyContent:"space-between",marginBottom:"12",paddingY:"8"},k.createElement(on,{label:s.t("get_mobile.continue.label"),onClick:()=>e(r!=null&&r.instructions?"INSTRUCTIONS_MOBILE":"CONNECT")})))}var _s={connect:()=>k.createElement(nU,null),create:()=>k.createElement(rU,null),install:e=>k.createElement(It,{background:e.iconBackground,borderColor:"generalBorder",borderRadius:"10",height:"48",src:e.iconUrl,width:"48"}),refresh:()=>k.createElement(oU,null),scan:()=>k.createElement(aU,null)};function yU({connectWallet:e,wallet:t}){var r,s,o,a;const{i18n:n}=S.useContext(gt);return k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},k.createElement(R,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(s=(r=t==null?void 0:t.qrCode)==null?void 0:r.instructions)==null?void 0:s.steps.map(c=>{var l;return k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:c.title},k.createElement(R,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(l=_s[c.step])==null?void 0:l.call(_s,t)),k.createElement(R,{display:"flex",flexDirection:"column",gap:"4"},k.createElement(be,{color:"modalText",size:"14",weight:"bold"},n.t(c.title,void 0,{rawKeyIfTranslationMissing:!0})),k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(c.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},k.createElement(on,{label:n.t("get_instructions.mobile.connect.label"),onClick:()=>e(t)}),k.createElement(R,{as:"a",className:pt({active:"shrink",hover:"grow"}),display:"block",href:(a=(o=t==null?void 0:t.qrCode)==null?void 0:o.instructions)==null?void 0:a.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},k.createElement(be,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.mobile.learn_more.label")))))}function bU({wallet:e}){var n,r,s,o;const{i18n:t}=S.useContext(gt);return k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},k.createElement(R,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(r=(n=e==null?void 0:e.extension)==null?void 0:n.instructions)==null?void 0:r.steps.map(a=>{var c;return k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:a.title},k.createElement(R,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(c=_s[a.step])==null?void 0:c.call(_s,e)),k.createElement(R,{display:"flex",flexDirection:"column",gap:"4"},k.createElement(be,{color:"modalText",size:"14",weight:"bold"},t.t(a.title,void 0,{rawKeyIfTranslationMissing:!0})),k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},t.t(a.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},k.createElement(on,{label:t.t("get_instructions.extension.refresh.label"),onClick:window.location.reload.bind(window.location)}),k.createElement(R,{as:"a",className:pt({active:"shrink",hover:"grow"}),display:"block",href:(o=(s=e==null?void 0:e.extension)==null?void 0:s.instructions)==null?void 0:o.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},k.createElement(be,{color:"accentColor",size:"14",weight:"bold"},t.t("get_instructions.extension.learn_more.label")))))}function vU({connectWallet:e,wallet:t}){var r,s,o,a;const{i18n:n}=S.useContext(gt);return k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",width:"full"},k.createElement(R,{display:"flex",flexDirection:"column",gap:"28",height:"full",justifyContent:"center",paddingY:"32",style:{maxWidth:320}},(s=(r=t==null?void 0:t.desktop)==null?void 0:r.instructions)==null?void 0:s.steps.map(c=>{var l;return k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:"16",key:c.title},k.createElement(R,{borderRadius:"10",height:"48",minWidth:"48",overflow:"hidden",position:"relative",width:"48"},(l=_s[c.step])==null?void 0:l.call(_s,t)),k.createElement(R,{display:"flex",flexDirection:"column",gap:"4"},k.createElement(be,{color:"modalText",size:"14",weight:"bold"},n.t(c.title,void 0,{rawKeyIfTranslationMissing:!0})),k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},n.t(c.description,void 0,{rawKeyIfTranslationMissing:!0}))))})),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"12",justifyContent:"center",marginBottom:"16"},k.createElement(on,{label:n.t("get_instructions.desktop.connect.label"),onClick:()=>e(t)}),k.createElement(R,{as:"a",className:pt({active:"shrink",hover:"grow"}),display:"block",href:(a=(o=t==null?void 0:t.desktop)==null?void 0:o.instructions)==null?void 0:a.learnMoreUrl,paddingX:"12",paddingY:"4",rel:"noreferrer",style:{willChange:"transform"},target:"_blank",transition:"default"},k.createElement(be,{color:"accentColor",size:"14",weight:"bold"},n.t("get_instructions.desktop.learn_more.label")))))}function wU({onClose:e}){const t="rk_connect_title",[n,r]=S.useState(),[s,o]=S.useState(),[a,c]=S.useState(),l=!!(s!=null&&s.qrCode)&&a,[u,d]=S.useState(!1),h=S.useContext(Lp)===ud.COMPACT,{disclaimer:p}=S.useContext(cd),{i18n:m}=S.useContext(gt),g=g2(),_=S.useRef(!1),{connector:b}=S.useContext(ld),v=Mu(!b).filter(z=>z.ready||!!z.extensionDownloadUrl).sort((z,se)=>z.groupIndex-se.groupIndex),w=Mu(),x=Wq(v,z=>z.groupName),A=["Recommended","Other","Popular","More","Others","Installed"];S.useEffect(()=>{b&&!_.current&&(B("CONNECT"),I(b),_.current=!0)},[b]);const C=z=>{var se,ge;d(!1),z.ready&&((ge=(se=z==null?void 0:z.connect)==null?void 0:se.call(z))==null||ge.catch(()=>{d(!0)}))},j=async z=>{const se=v.find(ge=>z.id===ge.id);se!=null&&se.getDesktopUri&&setTimeout(async()=>{var xe;const ge=await((xe=se==null?void 0:se.getDesktopUri)==null?void 0:xe.call(se));ge&&window.open(ge,g?"_blank":"_self")},0)},E=async z=>{var xe;const se=v.find(je=>z.id===je.id),ge=await((xe=se==null?void 0:se.getQrCodeUri)==null?void 0:xe.call(se));c(ge),setTimeout(()=>{o(se),B("CONNECT")},ge?0:50)},I=async z=>{Gq(z.id),z.ready&&(E(z),j(z)),C(z),r(z.id),z.ready||(o(z),B(z!=null&&z.extensionDownloadUrl?"DOWNLOAD_OPTIONS":"CONNECT"))},T=z=>{var Ue;const se=w.find(Fe=>z===Fe.id),ge=(Ue=se==null?void 0:se.downloadUrls)==null?void 0:Ue.qrCode,xe=!!(se!=null&&se.desktopDownloadUrl),je=!!(se!=null&&se.extensionDownloadUrl);o(se),B(ge&&(je||xe)?"DOWNLOAD_OPTIONS":ge?"DOWNLOAD":xe?"INSTRUCTIONS_DESKTOP":"INSTRUCTIONS_EXTENSION")},O=()=>{r(void 0),o(void 0),c(void 0)},B=(z,se=!1)=>{se&&z==="GET"&&U==="GET"?O():!se&&z==="GET"?L("GET"):!se&&z==="CONNECT"&&L("CONNECT"),H(z)},[U,L]=S.useState("NONE"),[N,H]=S.useState("NONE");let M=null,$=null,W=null,ie;S.useEffect(()=>{d(!1)},[N,s]);const ye=!!(!!(s!=null&&s.extensionDownloadUrl)&&(s!=null&&s.mobileDownloadUrl));switch(N){case"NONE":M=k.createElement(P6,{getWallet:()=>B("GET")});break;case"LEARN_COMPACT":M=k.createElement(P6,{compactModeEnabled:h,getWallet:()=>B("GET")}),$=m.t("intro.title"),W="NONE";break;case"GET":M=k.createElement(hU,{getWalletDownload:T,compactModeEnabled:h}),$=m.t("get.title"),W=h?"LEARN_COMPACT":"NONE";break;case"CONNECT":M=s&&k.createElement(pU,{changeWalletStep:B,compactModeEnabled:h,connectionError:u,onClose:e,qrCodeUri:a,reconnect:C,wallet:s}),$=l&&(s.name==="WalletConnect"?m.t("connect_scan.fallback_title"):m.t("connect_scan.title",{wallet:s.name})),W=h?b?null:"NONE":null,ie=h?b?()=>{}:O:()=>{};break;case"DOWNLOAD_OPTIONS":M=s&&k.createElement(mU,{changeWalletStep:B,wallet:s}),$=s&&m.t("get_options.short_title",{wallet:s.name}),W=b?"CONNECT":h?"NONE":U;break;case"DOWNLOAD":M=s&&k.createElement(gU,{changeWalletStep:B,wallet:s}),$=s&&m.t("get_mobile.title",{wallet:s.name}),W=ye?"DOWNLOAD_OPTIONS":U;break;case"INSTRUCTIONS_MOBILE":M=s&&k.createElement(yU,{connectWallet:I,wallet:s}),$=s&&m.t("get_options.title",{wallet:h&&s.shortName||s.name}),W="DOWNLOAD";break;case"INSTRUCTIONS_EXTENSION":M=s&&k.createElement(bU,{wallet:s}),$=s&&m.t("get_options.title",{wallet:h&&s.shortName||s.name}),W="DOWNLOAD_OPTIONS";break;case"INSTRUCTIONS_DESKTOP":M=s&&k.createElement(vU,{connectWallet:I,wallet:s}),$=s&&m.t("get_options.title",{wallet:h&&s.shortName||s.name}),W="DOWNLOAD_OPTIONS";break}return k.createElement(R,{display:"flex",flexDirection:"row",style:{maxHeight:h?468:504}},(h?N==="NONE":!0)&&k.createElement(R,{className:h?uU:lU,display:"flex",flexDirection:"column",marginTop:"16"},k.createElement(R,{display:"flex",justifyContent:"space-between"},h&&p&&k.createElement(R,{marginLeft:"16",width:"28"},k.createElement(Qq,{onClick:()=>B("LEARN_COMPACT")})),h&&!p&&k.createElement(R,{marginLeft:"16",width:"28"}),k.createElement(R,{marginLeft:h?"0":"6",paddingBottom:"8",paddingTop:"2",paddingX:"18"},k.createElement(be,{as:"h1",color:"modalText",id:t,size:"18",weight:"heavy",testId:"connect-header-label"},m.t("connect.title"))),h&&k.createElement(R,{marginRight:"16"},k.createElement(Na,{onClose:e}))),k.createElement(R,{className:cU,paddingBottom:"18"},Object.entries(x).map(([z,se])=>se.length>0&&k.createElement(S.Fragment,{key:z},z?k.createElement(R,{marginBottom:"8",marginTop:"16",marginX:"6"},k.createElement(be,{color:z==="Installed"?"accentColor":"modalTextSecondary",size:"14",weight:"bold"},A.includes(z)?m.t(`connector_group.${z.toLowerCase()}`):z)):null,k.createElement(R,{display:"flex",flexDirection:"column",gap:"4"},se.map(ge=>k.createElement(tS,{currentlySelected:ge.id===n,iconBackground:ge.iconBackground,iconUrl:ge.iconUrl,key:ge.id,name:ge.name,onClick:()=>I(ge),ready:ge.ready,recent:ge.recent,testId:`wallet-option-${ge.id}`,isRainbowKitConnector:ge.isRainbowKitConnector})))))),h&&k.createElement(k.Fragment,null,k.createElement(R,{background:"generalBorder",height:"1",marginTop:"-1"}),p?k.createElement(R,{paddingX:"24",paddingY:"16",textAlign:"center"},k.createElement(p,{Link:_2,Text:x2})):k.createElement(R,{alignItems:"center",display:"flex",justifyContent:"space-between",paddingX:"24",paddingY:"16"},k.createElement(R,{paddingY:"4"},k.createElement(be,{color:"modalTextSecondary",size:"14",weight:"medium"},m.t("connect.new_to_ethereum.description"))),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"row",gap:"4",justifyContent:"center"},k.createElement(R,{className:pt({active:"shrink",hover:"grow"}),cursor:"pointer",onClick:()=>B("LEARN_COMPACT"),paddingY:"4",style:{willChange:"transform"},transition:"default"},k.createElement(be,{color:"accentColor",size:"14",weight:"bold"},m.t("connect.new_to_ethereum.learn_more.label"))))))),(h?N!=="NONE":!0)&&k.createElement(k.Fragment,null,!h&&k.createElement(R,{background:"generalBorder",minWidth:"1",width:"1"}),k.createElement(R,{display:"flex",flexDirection:"column",margin:"16",style:{flexGrow:1}},k.createElement(R,{alignItems:"center",display:"flex",justifyContent:"space-between",marginBottom:"12"},k.createElement(R,{width:"28"},W&&k.createElement(R,{as:"button",className:pt({active:"shrinkSm",hover:"growLg"}),color:"accentColor",onClick:()=>{W&&B(W,!0),ie==null||ie()},paddingX:"8",paddingY:"4",style:{boxSizing:"content-box",height:17,willChange:"transform"},transition:"default",type:"button"},k.createElement(Z8,null))),k.createElement(R,{display:"flex",justifyContent:"center",style:{flexGrow:1}},$&&k.createElement(be,{color:"modalText",size:"18",textAlign:"center",weight:"heavy"},$)),k.createElement(Na,{onClose:e})),k.createElement(R,{display:"flex",flexDirection:"column",style:{minHeight:h?396:432}},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"6",height:"full",justifyContent:"center",marginX:"8"},M)))))}var _U="_1am14412",xU="_1am14410",kU="_1am14413",CU=({wallet:e})=>k.createElement("svg",{className:kU,viewBox:"0 0 86 86",width:"86",height:"86"},k.createElement("title",null,"Loading"),k.createElement("rect",{x:"3",y:"3",width:80,height:80,rx:20,ry:20,strokeDasharray:`${160/3} ${2*160/3}`,strokeDashoffset:160,className:_U,style:{stroke:(e==null?void 0:e.iconAccent)||"#0D3887"}}));function dS({onClose:e,wallet:t,connecting:n}){const{connect:r,iconBackground:s,iconUrl:o,id:a,name:c,getMobileUri:l,ready:u,shortName:d,showWalletConnectModal:f}=t,h=eS(o),p=S.useRef(!1),{i18n:m}=S.useContext(gt),g=S.useCallback(async()=>{if(a!=="walletConnect"&&(async()=>{const b=await(l==null?void 0:l());if(b)if(b&&uq({mobileUri:b,name:c}),b.startsWith("http")){const y=document.createElement("a");y.href=b,y.target="_blank",y.rel="noreferrer noopener",y.click()}else window.location.href=b})(),f){f(),e==null||e();return}try{await(r==null?void 0:r())}catch{}},[r,l,f,e,c,a]);return S.useEffect(()=>{n&&!p.current&&(g(),p.current=!0)},[n,g]),k.createElement(R,{as:"button",color:u?"modalText":"modalTextSecondary",disabled:!u,fontFamily:"body",key:a,onClick:g,ref:h,style:{overflow:"visible",textAlign:"center"},testId:`wallet-option-${a}`,type:"button",width:"full"},k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",justifyContent:"center"},k.createElement(R,{display:"flex",alignItems:"center",justifyContent:"center",paddingBottom:"8",paddingTop:"10",position:"relative"},n?k.createElement(CU,{wallet:t}):null,k.createElement(It,{background:s,borderRadius:"13",boxShadow:"walletLogo",height:"60",src:o,width:"60"})),n?null:k.createElement(R,{display:"flex",flexDirection:"column",textAlign:"center"},k.createElement(be,{as:"h2",color:t.ready?"modalText":"modalTextSecondary",size:"13",weight:"medium"},k.createElement(R,{as:"span",position:"relative"},d??c,!t.ready&&" (unsupported)")),t.recent&&k.createElement(be,{color:"accentColor",size:"12",weight:"medium"},m.t("connect.recent")))))}function jU({onClose:e}){var p;const t="rk_connect_title",n=Mu().filter(m=>m.isRainbowKitConnector),{disclaimer:r,learnMoreUrl:s}=S.useContext(cd);let o=null,a=null,c=!1,l=null;const[u,d]=S.useState("CONNECT"),{i18n:f}=S.useContext(gt),h=id();switch(u){case"CONNECT":{o=f.t("connect.title"),c=!0,a=k.createElement(R,null,k.createElement(R,{background:"profileForeground",className:xU,display:"flex",paddingBottom:"20",paddingTop:"6",paddingX:"20",style:{gap:"calc((100% - 40px - 240px + 47px) / 4)"}},n.filter(m=>m.ready).map(m=>k.createElement(R,{key:m.id,width:"60"},k.createElement(dS,{onClose:e,wallet:m})))),k.createElement(R,{background:"generalBorder",height:"1",marginBottom:"32",marginTop:"-1"}),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"32",paddingX:"32",style:{textAlign:"center"}},k.createElement(R,{display:"flex",flexDirection:"column",gap:"8",textAlign:"center"},k.createElement(be,{color:"modalText",size:"16",weight:"bold"},f.t("intro.title")),k.createElement(be,{color:"modalTextSecondary",size:"16"},f.t("intro.description")))),k.createElement(R,{paddingTop:"32",paddingX:"20"},k.createElement(R,{display:"flex",gap:"14",justifyContent:"center"},k.createElement(on,{label:f.t("intro.get.label"),onClick:()=>d("GET"),size:"large",type:"secondary"}),k.createElement(on,{href:s,label:f.t("intro.learn_more.label"),size:"large",type:"secondary"}))),r&&k.createElement(R,{marginTop:"28",marginX:"32",textAlign:"center"},k.createElement(r,{Link:_2,Text:x2})));break}case"GET":{o=f.t("get.title"),l="CONNECT";const m=(p=n==null?void 0:n.filter(g=>{var _,b,y;return((_=g.downloadUrls)==null?void 0:_.ios)||((b=g.downloadUrls)==null?void 0:b.android)||((y=g.downloadUrls)==null?void 0:y.mobile)}))==null?void 0:p.splice(0,3);a=k.createElement(R,null,k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",height:"full",marginBottom:"36",marginTop:"5",paddingTop:"12",width:"full"},m.map((g,_)=>{const{downloadUrls:b,iconBackground:y,iconUrl:v,name:w}=g;return!(b!=null&&b.ios)&&!(b!=null&&b.android)&&!(b!=null&&b.mobile)?null:k.createElement(R,{display:"flex",gap:"16",key:g.id,paddingX:"20",width:"full"},k.createElement(R,{style:{minHeight:48,minWidth:48}},k.createElement(It,{background:y,borderColor:"generalBorder",borderRadius:"10",height:"48",src:v,width:"48"})),k.createElement(R,{display:"flex",flexDirection:"column",width:"full"},k.createElement(R,{alignItems:"center",display:"flex",height:"48"},k.createElement(R,{width:"full"},k.createElement(be,{color:"modalText",size:"18",weight:"bold"},w)),k.createElement(on,{href:(h?b==null?void 0:b.ios:b==null?void 0:b.android)||(b==null?void 0:b.mobile),label:f.t("get.action.label"),size:"small",type:"secondary"})),_<m.length-1&&k.createElement(R,{background:"generalBorderDim",height:"1",marginY:"10",width:"full"})))})),k.createElement(R,{style:{marginBottom:"42px"}}),k.createElement(R,{alignItems:"center",display:"flex",flexDirection:"column",gap:"36",paddingX:"36",style:{textAlign:"center"}},k.createElement(R,{display:"flex",flexDirection:"column",gap:"12",textAlign:"center"},k.createElement(be,{color:"modalText",size:"16",weight:"bold"},f.t("get.looking_for.title")),k.createElement(be,{color:"modalTextSecondary",size:"16"},f.t("get.looking_for.mobile.description")))));break}}return k.createElement(R,{display:"flex",flexDirection:"column",paddingBottom:"36"},k.createElement(R,{background:c?"profileForeground":"modalBackground",display:"flex",flexDirection:"column",paddingBottom:"4",paddingTop:"14"},k.createElement(R,{display:"flex",justifyContent:"center",paddingBottom:"6",paddingX:"20",position:"relative"},l&&k.createElement(R,{display:"flex",position:"absolute",style:{left:0,marginBottom:-20,marginTop:-20}},k.createElement(R,{alignItems:"center",as:"button",className:pt({active:"shrinkSm",hover:"growLg"}),color:"accentColor",display:"flex",marginLeft:"4",marginTop:"20",onClick:()=>d(l),padding:"16",style:{height:17,willChange:"transform"},transition:"default",type:"button"},k.createElement(Z8,null))),k.createElement(R,{marginTop:"4",textAlign:"center",width:"full"},k.createElement(be,{as:"h1",color:"modalText",id:t,size:"20",weight:"bold"},o)),k.createElement(R,{alignItems:"center",display:"flex",height:"32",paddingRight:"14",position:"absolute",right:"0"},k.createElement(R,{style:{marginBottom:-20,marginTop:-20}},k.createElement(Na,{onClose:e}))))),k.createElement(R,{display:"flex",flexDirection:"column"},a))}var SU=({onClose:e})=>{const{connector:t}=S.useContext(ld),{i18n:n}=S.useContext(gt),r=(t==null?void 0:t.name)||"";return k.createElement(R,null,k.createElement(R,{display:"flex",paddingBottom:"32",justifyContent:"center",alignItems:"center",background:"profileForeground",flexDirection:"column"},k.createElement(R,{width:"full",display:"flex",justifyContent:"flex-end",marginTop:"18",marginRight:"24"},k.createElement(Na,{onClose:e})),k.createElement(R,{width:"60"},k.createElement(dS,{onClose:e,wallet:t,connecting:!0})),k.createElement(R,{marginTop:"20"},k.createElement(be,{textAlign:"center",color:"modalText",size:"18",weight:"semibold"},n.t("connect.status.connect_mobile",{wallet:r}))),k.createElement(R,{maxWidth:"full",marginTop:"8"},k.createElement(be,{textAlign:"center",color:"modalText",size:"16",weight:"medium"},n.t("connect.status.confirm_mobile",{wallet:r})))))};function AU({onClose:e}){const{connector:t}=S.useContext(ld);return mt()?t?k.createElement(SU,{onClose:e}):k.createElement(jU,{onClose:e}):k.createElement(wU,{onClose:e})}function EU({onClose:e,open:t}){const n="rk_connect_title",r=f2(),{disconnect:s}=Tc(),{isConnecting:o}=Oe(),a=k.useCallback(()=>{e(),s()},[e,s]),c=k.useCallback(()=>{o&&s(),e()},[e,s,o]);return r==="disconnected"?k.createElement(Ah,{onClose:c,open:t,titleId:n},k.createElement(Eh,{bottomSheetOnMobile:!0,padding:"0",wide:!0},k.createElement(AU,{onClose:c}))):r==="unauthenticated"?k.createElement(Ah,{onClose:a,open:t,titleId:n},k.createElement(Eh,{bottomSheetOnMobile:!0,padding:"0"},k.createElement(cq,{onClose:a,onCloseModal:e}))):null}function w1(){const[e,t]=S.useState(!1);return{closeModal:S.useCallback(()=>t(!1),[]),isModalOpen:e,openModal:S.useCallback(()=>t(!0),[])}}var Lc=S.createContext({accountModalOpen:!1,chainModalOpen:!1,connectModalOpen:!1,isWalletConnectModalOpen:!1,setIsWalletConnectModalOpen:()=>{}});function NU({children:e}){const{closeModal:t,isModalOpen:n,openModal:r}=w1(),{closeModal:s,isModalOpen:o,openModal:a}=w1(),{closeModal:c,isModalOpen:l,openModal:u}=w1(),[d,f]=S.useState(!1),h=f2(),{chainId:p}=Oe(),{chains:m}=at(),g=m.some(y=>y.id===p),_=S.useCallback(({keepConnectModalOpen:y=!1}={})=>{y||t(),s(),c()},[t,s,c]),b=Pp()==="unauthenticated";return bj({onConnect:()=>_({keepConnectModalOpen:b}),onDisconnect:()=>_()}),S.useEffect(()=>{b&&_()},[b,_]),k.createElement(Lc.Provider,{value:S.useMemo(()=>({accountModalOpen:o,chainModalOpen:l,connectModalOpen:n,isWalletConnectModalOpen:d,openAccountModal:g&&h==="connected"?a:void 0,openChainModal:h==="connected"?u:void 0,openConnectModal:h==="disconnected"||h==="unauthenticated"?r:void 0,setIsWalletConnectModalOpen:f}),[h,o,l,n,a,u,r,g,d])},e,k.createElement(EU,{onClose:t,open:n}),k.createElement(Dq,{onClose:s,open:o}),k.createElement(Hq,{onClose:c,open:l}))}function IU(){const{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}=S.useContext(Lc);return{accountModalOpen:e,chainModalOpen:t,connectModalOpen:n}}function MU(){const{accountModalOpen:e,openAccountModal:t}=S.useContext(Lc);return{accountModalOpen:e,openAccountModal:t}}function BU(){const{chainModalOpen:e,openChainModal:t}=S.useContext(Lc);return{chainModalOpen:e,openChainModal:t}}function fS(){const{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}=S.useContext(Lc);return{isWalletConnectModalOpen:e,setIsWalletConnectModalOpen:t}}function Oa(){const{connectModalOpen:e,openConnectModal:t}=S.useContext(Lc),{isWalletConnectModalOpen:n}=fS();return{connectModalOpen:e||n,openConnectModal:t}}var _1=()=>{};function k2({children:e}){const t=fz(),{address:n}=Oe(),{chainId:r}=Oe(),{chains:s}=at(),o=s.some(O=>O.id===r),a=uz(),c=Pp()??void 0,l=r?a[r]:void 0,u=(l==null?void 0:l.name)??void 0,d=(l==null?void 0:l.iconUrl)??void 0,f=(l==null?void 0:l.iconBackground)??void 0,h=Rp(d),p=S.useContext(m2),m=R8().some(({status:O})=>O==="pending")&&p,{showBalance:g}=N8(),b=typeof g=="boolean"?g:g?v8(g)[mt()?"smallScreen":"largeScreen"]:!0,{balance:y,ensAvatar:v,ensName:w}=M8({address:n,includeBalance:b}),x=y?`${K8(Number.parseFloat(y.formatted))} ${y.symbol}`:void 0,{openConnectModal:A}=Oa(),{openChainModal:C}=BU(),{openAccountModal:j}=MU(),{accountModalOpen:E,chainModalOpen:I,connectModalOpen:T}=IU();return k.createElement(k.Fragment,null,e({account:n?{address:n,balanceDecimals:y==null?void 0:y.decimals,balanceFormatted:y==null?void 0:y.formatted,balanceSymbol:y==null?void 0:y.symbol,displayBalance:x,displayName:w?Y8(w):Q8(n),ensAvatar:v??void 0,ensName:w??void 0,hasPendingTransactions:m}:void 0,accountModalOpen:E,authenticationStatus:c,chain:r?{hasIcon:!!d,iconBackground:f,iconUrl:h,id:r,name:u,unsupported:!o}:void 0,chainModalOpen:I,connectModalOpen:T,mounted:t(),openAccountModal:j??_1,openChainModal:C??_1,openConnectModal:A??_1}))}k2.displayName="ConnectButton.Custom";var wl={accountStatus:"full",chainStatus:{largeScreen:"full",smallScreen:"icon"},label:"Connect Wallet",showBalance:{largeScreen:!0,smallScreen:!1}};function C2({accountStatus:e=wl.accountStatus,chainStatus:t=wl.chainStatus,label:n=wl.label,showBalance:r=wl.showBalance}){const s=Da(),o=f2(),{setShowBalance:a}=N8(),[c,l]=S.useState(!1),{i18n:u}=S.useContext(gt);return S.useEffect(()=>{a(r),c||l(!0)},[r,a]),c?k.createElement(k2,null,({account:d,chain:f,mounted:h,openAccountModal:p,openChainModal:m,openConnectModal:g})=>{const _=h&&o!=="loading",b=(f==null?void 0:f.unsupported)??!1;return k.createElement(R,{display:"flex",gap:"12",...!_&&{"aria-hidden":!0,style:{opacity:0,pointerEvents:"none",userSelect:"none"}}},_&&d&&o==="connected"?k.createElement(k.Fragment,null,f&&(s.length>1||b)&&k.createElement(R,{alignItems:"center","aria-label":"Chain Selector",as:"button",background:b?"connectButtonBackgroundError":"connectButtonBackground",borderRadius:"connectButton",boxShadow:"connectButton",className:pt({active:"shrink",hover:"grow"}),color:b?"connectButtonTextError":"connectButtonText",display:Za(t,y=>y==="none"?"none":"flex"),fontFamily:"body",fontWeight:"bold",gap:"6",key:b?"unsupported":"supported",onClick:m,paddingX:"10",paddingY:"8",testId:b?"wrong-network-button":"chain-button",transition:"default",type:"button"},b?k.createElement(R,{alignItems:"center",display:"flex",height:"24",paddingX:"4"},u.t("connect_wallet.wrong_network.label")):k.createElement(R,{alignItems:"center",display:"flex",gap:"6"},f.hasIcon?k.createElement(R,{display:Za(t,y=>y==="full"||y==="icon"?"block":"none"),height:"24",width:"24"},k.createElement(It,{alt:f.name??"Chain icon",background:f.iconBackground,borderRadius:"full",height:"24",src:f.iconUrl,width:"24"})):null,k.createElement(R,{display:Za(t,y=>y==="icon"&&!f.iconUrl||y==="full"||y==="name"?"block":"none")},f.name??f.id)),k.createElement(c6,null)),!b&&k.createElement(R,{alignItems:"center",as:"button",background:"connectButtonBackground",borderRadius:"connectButton",boxShadow:"connectButton",className:pt({active:"shrink",hover:"grow"}),color:"connectButtonText",display:"flex",fontFamily:"body",fontWeight:"bold",onClick:p,testId:"account-button",transition:"default",type:"button"},d.displayBalance&&k.createElement(R,{display:Za(r,y=>y?"block":"none"),padding:"8",paddingLeft:"12"},d.displayBalance),k.createElement(R,{background:v8(r)[mt()?"smallScreen":"largeScreen"]?"connectButtonInnerBackground":"connectButtonBackground",borderColor:"connectButtonBackground",borderRadius:"connectButton",borderStyle:"solid",borderWidth:"2",color:"connectButtonText",fontFamily:"body",fontWeight:"bold",paddingX:"8",paddingY:"6",transition:"default"},k.createElement(R,{alignItems:"center",display:"flex",gap:"6",height:"24"},k.createElement(R,{display:Za(e,y=>y==="full"||y==="avatar"?"block":"none")},k.createElement(S8,{address:d.address,imageUrl:d.ensAvatar,loading:d.hasPendingTransactions,size:24})),k.createElement(R,{alignItems:"center",display:"flex",gap:"6"},k.createElement(R,{display:Za(e,y=>y==="full"||y==="address"?"block":"none")},d.displayName),k.createElement(c6,null)))))):k.createElement(R,{as:"button",background:"accentColor",borderRadius:"connectButton",boxShadow:"connectButton",className:pt({active:"shrink",hover:"grow"}),color:"accentColorForeground",fontFamily:"body",fontWeight:"bold",height:"40",key:"connect",onClick:g,paddingX:"14",testId:"connect-button",transition:"default",type:"button"},h&&n==="Connect Wallet"?u.t("connect_wallet.label"):n))}):null}C2.__defaultProps=wl;C2.Custom=k2;var hS=({appName:e,appDescription:t,appUrl:n,appIcon:r})=>({name:e,description:t??e,url:n??(typeof window<"u"?window.location.origin:""),icons:[...r?[r]:[]]});function TU(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!==void 0))}function PU(e,t){const n=[];for(const r of e)n.some(s=>s[t]===r[t])||n.push(r);return n}var RU=(e,{projectId:t,walletConnectParameters:n,appName:r,appDescription:s,appUrl:o,appIcon:a})=>{if(!e.length)throw new Error("No wallet list was provided");for(const{wallets:p,groupName:m}of e)if(!p.length)throw new Error(`No wallets provided for group: ${m}`);let c=-1;const l=[],u=[],d=[],f=hS({appName:r,appDescription:s,appUrl:o,appIcon:a});for(const[p,{groupName:m,wallets:g}]of e.entries())for(const _ of g){c++;const b=_({projectId:t,appName:r,appIcon:a,options:{metadata:f,...n},walletConnectParameters:{metadata:f,...n}});if(b!=null&&b.iconAccent&&!eU(b==null?void 0:b.iconAccent))throw new Error(`Property \`iconAccent\` is not a hex value for wallet: ${b.name}`);const y={...b,groupIndex:p+1,groupName:m,index:c};typeof b.hidden=="function"?d.push(y):u.push(y)}const h=PU([...u,...d],"id");for(const{createConnector:p,groupIndex:m,groupName:g,hidden:_,...b}of h){if(typeof _=="function"&&_())continue;const y=x=>({rkDetails:TU({...b,groupIndex:m,groupName:g,isRainbowKitConnector:!0,...x||{}})});b.id==="walletConnect"&&l.push(p(y({isWalletConnectModalConnector:!0,showQrModal:!0})));const w=p(y());l.push(w)}return l},LU=typeof window>"u",L6=new Map,DU=({projectId:e,walletConnectParameters:t,rkDetailsShowQrModal:n,rkDetailsIsWalletConnectModalConnector:r})=>{if(LU)return Qb({accounts:["0x0000000000000000000000000000000000000000"]});let s={telemetryEnabled:!1,...t||{},projectId:e,showQrModal:!1};n&&(s={...s,showQrModal:!0}),"customStoragePrefix"in s||(s={...s,customStoragePrefix:r?"clientOne":"clientTwo"});const o=JSON.stringify(s),a=L6.get(o);if(a)return a;const c=d2(s);return L6.set(o,c),c};function OU({projectId:e,walletDetails:t,walletConnectParameters:n}){return r=>({...DU({projectId:e,walletConnectParameters:n,rkDetailsShowQrModal:t.rkDetails.showQrModal,rkDetailsIsWalletConnectModalConnector:t.rkDetails.isWalletConnectModalConnector})(r),...t})}function j2({projectId:e,walletConnectParameters:t}){const n="21fef48091f12692cad574a6f7753643";if(!e||e==="")throw new Error("No projectId found. Every dApp must now provide a WalletConnect Cloud projectId to enable WalletConnect v2 https://www.rainbowkit.com/docs/installation#configure");return e==="YOUR_PROJECT_ID"&&(e=n),r=>OU({projectId:e,walletDetails:r,walletConnectParameters:t})}function pS(e){const t=typeof window<"u"?window:void 0;if(typeof t>"u"||typeof t.ethereum>"u")return;const n=t.ethereum.providers;return n?n.find(r=>r[e]):t.ethereum[e]?t.ethereum:void 0}function mS(e){const t=(n,r)=>{const[s,...o]=r.split("."),a=n[s];if(a)return o.length===0?a:t(a,o.join("."))};if(typeof window<"u")return t(window,e)}function FU({flag:e,namespace:t}){return!!(t&&typeof mS(t)<"u"||typeof pS(e)<"u")}function $U({flag:e,namespace:t}){var r;const n=typeof window<"u"?window:void 0;if(!(typeof n>"u")){if(t){const s=mS(t);if(s)return s}(r=n.ethereum)==null||r.providers;{const s=pS(e);if(s)return s}}}function zU(e){return t=>{const n=e?{target:()=>({id:t.rkDetails.id,name:t.rkDetails.name,provider:e})}:{};return r=>({...xp(n)(r),...t})}}function qU({flag:e,namespace:t,target:n}){const r=n||$U({flag:e,namespace:t});return zU(r)}var gS=({appName:e,appIcon:t})=>{const{preference:n,...r}=gS;return{id:"base",aliases:["baseAccount"],name:"Base",shortName:"Base",rdns:"app.base.account",iconUrl:async()=>(await ae(async()=>{const{default:s}=await import("./base-QS6CYWIN-CsjdbWCf.js");return{default:s}},[])).default,iconAccent:"#0000FF",iconBackground:"#0000FF",installed:!0,createConnector:s=>{const o=N$({appName:e,appLogoUrl:t,...r,preference:{telemetry:!1,...n||{}}});return a=>({...o(a),...s})}}};function UU(e){return!(!(e!=null&&e.isMetaMask)||e.isBraveWallet&&!e._events&&!e._state||e.isApexWallet||e.isAvalanche||e.isBackpack||e.isBifrost||e.isBitKeep||e.isBitski||e.isBinance||e.isBlockWallet||e.isCoinbaseWallet||e.isDawn||e.isEnkrypt||e.isExodus||e.isFrame||e.isFrontier||e.isGamestop||e.isHyperPay||e.isImToken||e.isKuCoinWallet||e.isMathWallet||e.isNestWallet||e.isOkxWallet||e.isOKExWallet||e.isOneInchIOSWallet||e.isOneInchAndroidWallet||e.isOpera||e.isPhantom||e.isZilPay||e.isPortal||e.isxPortal||e.isRabby||e.isRainbow||e.isStatus||e.isTalisman||e.isTally||e.isTokenPocket||e.isTokenary||e.isTrust||e.isTrustWallet||e.isCTRL||e.isZeal||e.isCoin98||e.isMEWwallet||e.isSafeheron||e.isSafePal||e.isWigwam||e.isZerion||e.__seif)}var yS=({projectId:e,walletConnectParameters:t})=>{const{...n}=yS,r=typeof window<"u"?UU(window.ethereum):!1,s=!r&&!mt(),o=r||mt();return{id:"metaMask",name:"MetaMask",rdns:"io.metamask",iconUrl:async()=>(await ae(async()=>{const{default:a}=await import("./metaMaskWallet-EI6MED72-D5HFOsnz.js");return{default:a}},[])).default,iconAccent:"#f6851a",iconBackground:"#fff",installed:r||void 0,downloadUrls:{android:"https://play.google.com/store/apps/details?id=io.metamask",ios:"https://apps.apple.com/us/app/metamask/id1438144202",mobile:"https://metamask.io/download",qrCode:"https://metamask.io/download",chrome:"https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn",edge:"https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm",firefox:"https://addons.mozilla.org/firefox/addon/ether-metamask",opera:"https://addons.opera.com/extensions/details/metamask-10",browserExtension:"https://metamask.io/download"},mobile:{getUri:o?a=>a:void 0},qrCode:s?{getUri:a=>`https://metamask.app.link/wc?uri=${encodeURIComponent(a)}`,instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.qr_code.step1.description",step:"install",title:"wallet_connectors.metamask.qr_code.step1.title"},{description:"wallet_connectors.metamask.qr_code.step2.description",step:"create",title:"wallet_connectors.metamask.qr_code.step2.title"},{description:"wallet_connectors.metamask.qr_code.step3.description",step:"refresh",title:"wallet_connectors.metamask.qr_code.step3.title"}]}}:void 0,extension:{instructions:{learnMoreUrl:"https://metamask.io/faqs/",steps:[{description:"wallet_connectors.metamask.extension.step1.description",step:"install",title:"wallet_connectors.metamask.extension.step1.title"},{description:"wallet_connectors.metamask.extension.step2.description",step:"create",title:"wallet_connectors.metamask.extension.step2.title"},{description:"wallet_connectors.metamask.extension.step3.description",step:"refresh",title:"wallet_connectors.metamask.extension.step3.title"}]}},createConnector:s?j2({projectId:e,walletConnectParameters:t}):a=>c=>{var u,d,f;const l=l2({dappMetadata:{connector:"rainbowkit",name:(u=t==null?void 0:t.metadata)==null?void 0:u.name,iconUrl:(d=t==null?void 0:t.metadata)==null?void 0:d.icons[0],url:(f=t==null?void 0:t.metadata)==null?void 0:f.url},headless:!0,checkInstallationImmediately:!1,enableAnalytics:!1,...n})(c);return{...l,...a,getChainId:async()=>{var h;try{return await l.getChainId()}catch{return((h=c.chains[0])==null?void 0:h.id)??1}}}}}},HU=({projectId:e,walletConnectParameters:t})=>{const n=FU({flag:"isRainbow"}),r=!n,s=o=>_8()?o:id()?`rainbow://wc?uri=${encodeURIComponent(o)}&connector=rainbowkit`:`https://rnbwapp.com/wc?uri=${encodeURIComponent(o)}&connector=rainbowkit`;return{id:"rainbow",name:"Rainbow",rdns:"me.rainbow",iconUrl:async()=>(await ae(async()=>{const{default:o}=await import("./rainbowWallet-O26YNBMX-DUhYus-9.js");return{default:o}},[])).default,iconBackground:"#0c2f78",installed:r?void 0:n,downloadUrls:{android:"https://play.google.com/store/apps/details?id=me.rainbow&referrer=utm_source%3Drainbowkit&utm_source=rainbowkit",ios:"https://apps.apple.com/app/apple-store/id1457119021?pt=119997837&ct=rainbowkit&mt=8",mobile:"https://rainbow.download?utm_source=rainbowkit",qrCode:"https://rainbow.download?utm_source=rainbowkit&utm_medium=qrcode",browserExtension:"https://rainbow.me/extension?utm_source=rainbowkit"},mobile:{getUri:r?s:void 0},qrCode:r?{getUri:s,instructions:{learnMoreUrl:"https://learn.rainbow.me/connect-to-a-website-or-app?utm_source=rainbowkit&utm_medium=connector&utm_campaign=learnmore",steps:[{description:"wallet_connectors.rainbow.qr_code.step1.description",step:"install",title:"wallet_connectors.rainbow.qr_code.step1.title"},{description:"wallet_connectors.rainbow.qr_code.step2.description",step:"create",title:"wallet_connectors.rainbow.qr_code.step2.title"},{description:"wallet_connectors.rainbow.qr_code.step3.description",step:"scan",title:"wallet_connectors.rainbow.qr_code.step3.title"}]}}:void 0,createConnector:r?j2({projectId:e,walletConnectParameters:t}):qU({flag:"isRainbow"})}},WU=()=>({id:"safe",name:"Safe",iconAccent:"#12ff80",iconBackground:"#fff",iconUrl:async()=>(await ae(async()=>{const{default:e}=await import("./safeWallet-5MNKTR5Z-D-5imDLD.js");return{default:e}},[])).default,installed:!(typeof window>"u")&&(window==null?void 0:window.parent)!==window,downloadUrls:{},createConnector:e=>t=>({...u2()(t),...e})}),VU=({projectId:e,options:t})=>({id:"walletConnect",name:"WalletConnect",installed:void 0,iconUrl:async()=>(await ae(async()=>{const{default:r}=await import("./walletConnectWallet-YHWKVTDY-D3lyiczV.js");return{default:r}},[])).default,iconBackground:"#3b99fc",qrCode:{getUri:r=>r},createConnector:j2({projectId:e,walletConnectParameters:t})}),GU=e=>e.reduce((n,r)=>{const s=r.id;return n[s]=eL(),n},{}),KU=({appName:e,appDescription:t,appUrl:n,appIcon:r,wallets:s,projectId:o,walletConnectParameters:a,...c})=>{const{transports:l,chains:u,...d}=c,f=hS({appName:e,appDescription:t,appUrl:n,appIcon:r}),h=RU(s||[{groupName:"Popular",wallets:[WU,HU,gS,yS,VU]}],{projectId:o,appName:e,appDescription:t,appUrl:n,appIcon:r,walletConnectParameters:{metadata:f,...a}});return DL({connectors:h,chains:u,transports:l||GU(u),...d})};const QU="_overlay_p0t7r_7",YU="_card_p0t7r_22",JU="_iconWrap_p0t7r_47",XU="_title_p0t7r_60",ZU="_body_p0t7r_70",eH="_actions_p0t7r_79",tH="_btn_p0t7r_86",nH="_btnDanger_p0t7r_105",rH="_btnGhost_p0t7r_115",Nr={overlay:QU,card:YU,iconWrap:JU,title:XU,body:ZU,actions:eH,btn:tH,btnDanger:nH,btnGhost:rH};function bS({open:e,title:t,body:n,confirmLabel:r="Confirm",cancelLabel:s="Cancel",onConfirm:o,onCancel:a}){return S.useEffect(()=>{if(!e)return;const c=l=>{l.key==="Escape"&&(a==null||a())};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e,a]),e?i.jsx("div",{className:Nr.overlay,role:"dialog","aria-modal":"true","aria-label":t,onClick:a,children:i.jsxs("div",{className:Nr.card,onClick:c=>c.stopPropagation(),children:[i.jsx("span",{className:Nr.iconWrap,"aria-hidden":!0,children:i.jsxs("svg",{viewBox:"0 0 24 24",width:"22",height:"22",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round",children:[i.jsx("path",{d:"M12 3l9 16H3l9-16z"}),i.jsx("path",{d:"M12 9v5"}),i.jsx("circle",{cx:"12",cy:"17",r:"0.9",fill:"currentColor",stroke:"none"})]})}),i.jsx("h2",{className:Nr.title,children:t}),i.jsx("p",{className:Nr.body,children:n}),i.jsxs("div",{className:Nr.actions,children:[i.jsx("button",{type:"button",className:`${Nr.btn} ${Nr.btnDanger}`,onClick:o,autoFocus:!0,children:r}),i.jsx("button",{type:"button",className:`${Nr.btn} ${Nr.btnGhost}`,onClick:a,children:s})]})]})}):null}const sH="_disc_1ig4i_4",oH="_icon_1ig4i_15",aH="_claude_1ig4i_20",iH="_cursor_1ig4i_21",cH="_openai_1ig4i_22",lH="_fallback_1ig4i_30",al={disc:sH,icon:oH,claude:aH,cursor:iH,openai:cH,fallback:lH};function xs({name:e,size:t=28}){const n=uH(e);if(n==="fallback")return i.jsx("span",{className:`${al.disc} ${al.fallback}`,style:{width:t,height:t},"aria-label":e,children:i.jsx("span",{style:{fontSize:Math.round(t*.48),lineHeight:1},children:((e==null?void 0:e[0])??"?").toUpperCase()})});const r=`/brands/${n}.svg`,o=Math.round(t*(n==="claude"?.78:n==="cursor"?.58:.68));return i.jsx("span",{className:`${al.disc} ${al[n]}`,style:{width:t,height:t},"aria-label":e,children:i.jsx("img",{src:r,alt:"",width:o,height:o,className:al.icon,"aria-hidden":!0})})}function uH(e){const t=(e??"").toLowerCase();return t==="claude"||t==="anthropic"?"claude":t==="cursor"?"cursor":t==="chatgpt"||t==="codex"||t==="openai"||t==="gpt"?"openai":"fallback"}const dH="_fluidBg_kmscg_7",fH="_blob1_kmscg_43",hH="_blob2_kmscg_58",pH="_blob3_kmscg_73",mH="_blob4_kmscg_88",gH="_blob5_kmscg_103",yH="_fluidFrost_kmscg_118",zo={fluidBg:dH,blob1:fH,blob2:hH,blob3:pH,blob4:mH,blob5:gH,fluidFrost:yH};function Ms(){return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:zo.fluidBg,"aria-hidden":"true",children:[i.jsx("div",{className:zo.blob1}),i.jsx("div",{className:zo.blob2}),i.jsx("div",{className:zo.blob3}),i.jsx("div",{className:zo.blob4}),i.jsx("div",{className:zo.blob5})]}),i.jsx("div",{className:zo.fluidFrost,"aria-hidden":"true"})]})}const bH="_card_zqry2_1",vH={card:bH};function Ct({children:e,className:t="",as:n="div",...r}){return i.jsx(n,{className:`${vH.card} ${t}`,...r,children:e})}const wH="_mark_1wlr6_1",_H={mark:wH},xH=`data:image/svg+xml,${encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2 -2 36 34" width="288" height="272" role="img" aria-label="Sail logo" overflow="visible"><style>
1763
1763
  .boat { transform-origin: 16px 28.5px; animation: rock 4.6s cubic-bezier(.37,0,.63,1) infinite; }
1764
1764
  .bob { animation: bob 3.5s cubic-bezier(.37,0,.63,1) infinite; }
@@ -1783,8 +1783,8 @@ limitations under the License.
1783
1783
  `),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class hce extends kt{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${Gg(t.abiItem)}\`, and`,`\`${n.type}\` in \`${Gg(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class pce extends kt{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
1784
1784
  `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class mce extends kt{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
1785
1785
  `),{name:"InvalidArrayError"})}}class gce extends kt{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
1786
- `),{name:"InvalidDefinitionTypeError"})}}class PS extends kt{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class RS extends kt{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function Dc(e,{dir:t,size:n=32}={}){return typeof e=="string"?vo(e,{dir:t,size:n}):yce(e,{dir:t,size:n})}function vo(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new RS({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function yce(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new RS({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const o=t==="right";r[o?s:n-s-1]=e[o?s:e.length-s-1]}return r}class LS extends kt{constructor({max:t,min:n,signed:r,size:s,value:o}){super(`Number "${o}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class bce extends kt{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function hd(e,{size:t}){if(or(e)>t)throw new bce({givenSize:or(e),maxSize:t})}const vce=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function wce(e,t={}){return typeof e=="number"||typeof e=="bigint"?Fa(e,t):typeof e=="string"?FS(e,t):typeof e=="boolean"?DS(e,t):OS(e,t)}function DS(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(hd(n,{size:t.size}),Dc(n,{size:t.size})):n}function OS(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=vce[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(hd(r,{size:t.size}),Dc(r,{dir:"right",size:t.size})):r}function Fa(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let o;r?n?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof o=="bigint"&&n?-o-1n:0;if(o&&s>o||s<a){const l=typeof e=="bigint"?"n":"";throw new LS({max:o?`${o}${l}`:void 0,min:`${a}${l}`,signed:n,size:r,value:`${e}${l}`})}const c=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?Dc(c,{size:r}):c}const _ce=new TextEncoder;function FS(e,t={}){const n=_ce.encode(e);return OS(n,t)}const xce=new TextEncoder;function $S(e,t={}){return typeof e=="number"||typeof e=="bigint"?Cce(e,t):typeof e=="boolean"?kce(e,t):fd(e)?zS(e,t):qS(e,t)}function kce(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(hd(n,{size:t.size}),Dc(n,{size:t.size})):n}const rs={zero:48,nine:57,A:65,F:70,a:97,f:102};function X6(e){if(e>=rs.zero&&e<=rs.nine)return e-rs.zero;if(e>=rs.A&&e<=rs.F)return e-(rs.A-10);if(e>=rs.a&&e<=rs.f)return e-(rs.a-10)}function zS(e,t={}){let n=e;t.size&&(hd(n,{size:t.size}),n=Dc(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,o=new Uint8Array(s);for(let a=0,c=0;a<s;a++){const l=X6(r.charCodeAt(c++)),u=X6(r.charCodeAt(c++));if(l===void 0||u===void 0)throw new kt(`Invalid byte sequence ("${r[c-2]}${r[c-1]}" in "${r}").`);o[a]=l*16+u}return o}function Cce(e,t){const n=Fa(e,t);return zS(n)}function qS(e,t={}){const n=xce.encode(e);return typeof t.size=="number"?(hd(n,{size:t.size}),Dc(n,{dir:"right",size:t.size})):n}function US(e,t){const n=t||"hex",r=eb(fd(e,{strict:!1})?$S(e):e);return n==="bytes"?r:wce(r)}const jce=e=>US($S(e));function Sce(e){return jce(e)}function Ace(e){let t=!0,n="",r=0,s="",o=!1;for(let a=0;a<e.length;a++){const c=e[a];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function",""].includes(s))s="";else if(s+=c,c===")"){o=!0;break}continue}if(c===" "){e[a-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=c,n+=c}}if(!o)throw new kt("Unable to normalize signature.");return s}const Ece=e=>{const t=typeof e=="string"?e:cce(e);return Ace(t)};function HS(e){return Sce(Ece(e))}const Nce=HS;class Ice extends kt{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class WS extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&(super.delete(t),super.set(t,n)),n}set(t,n){if(super.has(t)&&super.delete(t),super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=super.keys().next().value;r!==void 0&&super.delete(r)}return this}}const E1=new WS(8192);function Mce(e,t){if(E1.has(`${e}.${t}`))return E1.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=US(qS(n),"bytes"),s=n.split("");for(let a=0;a<40;a+=2)r[a>>1]>>4>=8&&s[a]&&(s[a]=s[a].toUpperCase()),(r[a>>1]&15)>=8&&s[a+1]&&(s[a+1]=s[a+1].toUpperCase());const o=`0x${s.join("")}`;return E1.set(`${e}.${t}`,o),o}const Bce=/^0x[a-fA-F0-9]{40}$/,N1=new WS(8192);function Nh(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(N1.has(r))return N1.get(r);const s=Bce.test(e)?e.toLowerCase()===e?!0:n?Mce(e)===e:!0:!1;return N1.set(r,s),s}function xc(e){return typeof e[0]=="string"?VS(e):Tce(e)}function Tce(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function VS(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function GS(e,t,n,{strict:r}={}){return fd(e,{strict:!1})?Rce(e,t,n,{strict:r}):Pce(e,t,n,{strict:r})}function KS(e,t){if(typeof t=="number"&&t>0&&t>or(e)-1)throw new PS({offset:t,position:"start",size:or(e)})}function QS(e,t,n){if(typeof t=="number"&&typeof n=="number"&&or(e)!==n-t)throw new PS({offset:n,position:"end",size:or(e)})}function Pce(e,t,n,{strict:r}={}){KS(e,t);const s=e.slice(t,n);return r&&QS(s,t,n),s}function Rce(e,t,n,{strict:r}={}){KS(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&QS(s,t,n),s}const Lce=/^(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 Dce(e,t){if(e.length!==t.length)throw new fce({expectedLength:e.length,givenLength:t.length});const n=Oce({params:e,values:t}),r=M2(n);return r.length===0?"0x":r}function Oce({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(I2({param:e[r],value:t[r]}));return n}function I2({param:e,value:t}){const n=Vce(e.type);if(n){const[r,s]=n;return $ce(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return Wce(t,{param:e});if(e.type==="address")return Fce(t);if(e.type==="bool")return qce(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,s="256"]=Lce.exec(e.type)??[];return Uce(t,{signed:r,size:Number(s)})}if(e.type.startsWith("bytes"))return zce(t,{param:e});if(e.type==="string")return Hce(t);throw new pce(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function M2(e){let t=0;for(let o=0;o<e.length;o++){const{dynamic:a,encoded:c}=e[o];a?t+=32:t+=or(c)}const n=[],r=[];let s=0;for(let o=0;o<e.length;o++){const{dynamic:a,encoded:c}=e[o];a?(n.push(Fa(t+s,{size:32})),r.push(c),s+=or(c)):n.push(c)}return xc([...n,...r])}function Fce(e){if(!Nh(e))throw new Ice({address:e});return{dynamic:!1,encoded:vo(e.toLowerCase())}}function $ce(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new mce(e);if(!r&&e.length!==t)throw new uce({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const o=[];for(let a=0;a<e.length;a++){const c=I2({param:n,value:e[a]});c.dynamic&&(s=!0),o.push(c)}if(r||s){const a=M2(o);if(r){const c=Fa(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?xc([c,a]):c}}if(s)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:xc(o.map(({encoded:a})=>a))}}function zce(e,{param:t}){const[,n]=t.type.split("bytes"),r=or(e);if(!n){let s=e;return r%32!==0&&(s=vo(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:xc([vo(Fa(r,{size:32})),s])}}if(r!==Number.parseInt(n,10))throw new dce({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:vo(e,{dir:"right"})}}function qce(e){if(typeof e!="boolean")throw new kt(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:vo(DS(e))}}function Uce(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new LS({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Fa(e,{size:32,signed:t})}}function Hce(e){const t=FS(e),n=Math.ceil(or(t)/32),r=[];for(let s=0;s<n;s++)r.push(vo(GS(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:xc([vo(Fa(or(t),{size:32})),...r])}}function Wce(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const o=t.components[s],a=Array.isArray(e)?s:o.name,c=I2({param:o,value:e[a]});r.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?M2(r):xc(r.map(({encoded:s})=>s))}}function Vce(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const YS=e=>GS(HS(e),0,4);function Gce(e){const{abi:t,args:n=[],name:r}=e,s=fd(r,{strict:!1}),o=t.filter(c=>s?c.type==="function"?YS(c)===r:c.type==="event"?Nce(c)===r:!1:"name"in c&&c.name===r);if(o.length===0)return;if(o.length===1)return o[0];let a;for(const c of o){if(!("inputs"in c))continue;if(!n||n.length===0){if(!c.inputs||c.inputs.length===0)return c;continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==n.length)continue;if(n.every((u,d)=>{const f="inputs"in c&&c.inputs[d];return f?Kg(u,f):!1})){if(a&&"inputs"in a&&a.inputs){const u=JS(c.inputs,a.inputs,n);if(u)throw new hce({abiItem:c,type:u[0]},{abiItem:a,type:u[1]})}a=c}}return a||o[0]}function Kg(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Nh(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>n==="object"&&Kg(Object.values(e)[o],s)):/^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(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>Kg(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function JS(e,t,n){for(const r in e){const s=e[r],o=t[r];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return JS(s.components,o.components,n[r]);const a=[s.type,o.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?Nh(n[r],{strict:!1}):a.includes("address")&&a.includes("bytes")?Nh(n[r],{strict:!1}):!1)return a}}const Z6="/docs/contract/encodeFunctionData";function Kce(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const o=Gce({abi:t,args:n,name:r});if(!o)throw new J6(r,{docsPath:Z6});s=o}if(s.type!=="function")throw new J6(void 0,{docsPath:Z6});return{abi:[s],functionName:YS(Gg(s))}}function ex(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var c;return e.abi.length===1&&((c=e.functionName)!=null&&c.startsWith("0x"))?e:Kce(e)})(),s=n[0],o=r,a="inputs"in s&&s.inputs?Dce(s.inputs,t??[]):void 0;return VS([o,a??"0x"])}const tx="0x0000000000000000000000000000000000000000",XS=[{type:"function",name:"setup",stateMutability:"nonpayable",inputs:[{name:"_owners",type:"address[]"},{name:"_threshold",type:"uint256"},{name:"to",type:"address"},{name:"data",type:"bytes"},{name:"fallbackHandler",type:"address"},{name:"paymentToken",type:"address"},{name:"payment",type:"uint256"},{name:"paymentReceiver",type:"address"}],outputs:[]}],Qce=[{type:"function",name:"enable",stateMutability:"nonpayable",inputs:[{name:"module",type:"address"}],outputs:[]}],Ko={proxyFactory:"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",singletonL2:"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",fallbackHandler:"0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99"};function Yce(e){const t=ex({abi:Qce,functionName:"enable",args:[e.kernel]});return ex({abi:XS,functionName:"setup",args:[e.owners,e.threshold,e.safeModuleEnabler,t,e.fallbackHandler??Ko.fallbackHandler,tx,0n,tx]})}const ZS=[{type:"function",name:"createAccount",stateMutability:"nonpayable",inputs:[{name:"safeFactory",type:"address"},{name:"safeSingleton",type:"address"},{name:"safeInitializer",type:"bytes"},{name:"saltNonce",type:"uint256"},{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"feeAsset",type:"address"}],outputs:[{name:"account",type:"address"}]},{type:"function",name:"registerAccount",stateMutability:"nonpayable",inputs:[{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"}],outputs:[]},{type:"function",name:"setManager",stateMutability:"nonpayable",inputs:[{name:"newManager",type:"address"}],outputs:[]},{type:"function",name:"getManager",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"address"}]},{type:"function",name:"registerPermission",stateMutability:"payable",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"registerPermissions",stateMutability:"payable",inputs:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"dispatch",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"managerSig",type:"bytes"},{name:"deadline",type:"uint256"}],outputs:[]},{type:"function",name:"dispatchBatch",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"calls",type:"tuple[]",components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}]},{name:"managerSig",type:"bytes"},{name:"deadline",type:"uint256"}],outputs:[]},{type:"function",name:"previewBatch",stateMutability:"view",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"calls",type:"tuple[]",components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}]}],outputs:[{name:"approved",type:"bool"},{name:"reason",type:"string"}]},{type:"function",name:"collectFees",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"grossFee",type:"uint256"},{name:"currentNav",type:"uint256"},{name:"feeToken",type:"address"}],outputs:[]},{type:"function",name:"recordDeposit",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"recordWithdrawal",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"getPermissions",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"address[]"}]},{type:"function",name:"getPermissionsWithInfo",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"infos",type:"tuple[]",components:[{name:"permission",type:"address"},{name:"isBatch",type:"bool"},{name:"hasIntrospection",type:"bool"},{name:"permissionId",type:"bytes32"},{name:"permissionVersion",type:"bytes32"}]}]},{type:"function",name:"isPermissionRegistered",stateMutability:"view",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"configs",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"sessionActive",type:"bool"}]},{type:"function",name:"registered",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"managerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"batchNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"event",name:"AccountRegistered",inputs:[{name:"account",type:"address",indexed:!0},{name:"permissionSigner",type:"address",indexed:!0},{name:"manager",type:"address",indexed:!0}]},{type:"event",name:"PermissionRegistered",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0}]},{type:"event",name:"ManagerChanged",inputs:[{name:"account",type:"address",indexed:!0},{name:"oldManager",type:"address",indexed:!0},{name:"newManager",type:"address",indexed:!0}]},{type:"event",name:"PermissionRevoked",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0}]},{type:"event",name:"Dispatched",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0},{name:"target",type:"address",indexed:!1},{name:"selector",type:"bytes4",indexed:!1},{name:"value",type:"uint256",indexed:!1}]},{type:"event",name:"BatchDispatched",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0},{name:"batchHash",type:"bytes32",indexed:!1},{name:"callCount",type:"uint256",indexed:!1}]}],Jce="_overlay_vkkf7_6",Xce="_fadeIn_vkkf7_1",Zce="_card_vkkf7_21",ele="_cardRise_vkkf7_1",tle="_close_vkkf7_47",nle="_stepper_vkkf7_73",rle="_stepGroup_vkkf7_83",sle="_step_vkkf7_73",ole="_stepCircle_vkkf7_85",ale="_step_upcoming_vkkf7_99",ile="_step_current_vkkf7_104",cle="_step_done_vkkf7_111",lle="_stepLabel_vkkf7_115",ule="_stepLine_vkkf7_123",dle="_stepLineDone_vkkf7_130",fle="_body_vkkf7_133",hle="_bodyFade_vkkf7_1",ple="_bodyCentered_vkkf7_139",mle="_heroSai_vkkf7_149",gle="_header_vkkf7_155",yle="_headerCentered_vkkf7_162",ble="_kicker_vkkf7_170",vle="_headline_vkkf7_178",wle="_sub_vkkf7_187",_le="_points_vkkf7_197",xle="_liRise_vkkf7_1",kle="_checkBubble_vkkf7_218",Cle="_pointTitle_vkkf7_231",jle="_pointSub_vkkf7_239",Sle="_txPanel_vkkf7_249",Ale="_txPanelHeader_vkkf7_259",Ele="_txPanelKicker_vkkf7_267",Nle="_txPanelBadge_vkkf7_275",Ile="_netSelectWrap_vkkf7_288",Mle="_netSelectBtn_vkkf7_292",Ble="_netSelectBtnOpen_vkkf7_309",Tle="_netSelectDot_vkkf7_314",Ple="_netSelectName_vkkf7_320",Rle="_netSelectStack_vkkf7_326",Lle="_netSelectStackDot_vkkf7_331",Dle="_netSelectCaret_vkkf7_339",Ole="_netSelectCaretOpen_vkkf7_344",Fle="_netSelectMenu_vkkf7_346",$le="_netMenuRise_vkkf7_1",zle="_netSelectMenuHeader_vkkf7_365",qle="_netSelectMenuKicker_vkkf7_373",Ule="_netSelectMenuLink_vkkf7_381",Hle="_netSelectMenuList_vkkf7_398",Wle="_netSelectOption_vkkf7_412",Vle="_netSelectOptionActive_vkkf7_433",Gle="_netSelectOptionBody_vkkf7_440",Kle="_netSelectOptionName_vkkf7_446",Qle="_netSelectOptionMeta_vkkf7_450",Yle="_netSelectCheckbox_vkkf7_459",Jle="_netSelectCheckboxOn_vkkf7_471",Xle="_netSummary_vkkf7_479",Zle="_netSummaryItem_vkkf7_488",eue="_netSummarySep_vkkf7_493",tue="_netSummaryStack_vkkf7_497",nue="_netSummaryStackDot_vkkf7_501",rue="_txDetails_vkkf7_509",sue="_txRow_vkkf7_510",oue="_gas_vkkf7_522",aue="_txPanelFooter_vkkf7_523",iue="_actions_vkkf7_530",cue="_linkBtn_vkkf7_537",lue="_fineprint_vkkf7_551",uue="_confirmIndicator_vkkf7_562",due="_confirmDone_vkkf7_573",fue="_pulse_vkkf7_576",hue="_confirmHeadline_vkkf7_588",pue="_confirmSub_vkkf7_593",mue="_successHalo_vkkf7_601",oe={overlay:Jce,fadeIn:Xce,card:Zce,cardRise:ele,close:tle,stepper:nle,stepGroup:rle,step:sle,stepCircle:ole,step_upcoming:ale,step_current:ile,step_done:cle,stepLabel:lle,stepLine:ule,stepLineDone:dle,body:fle,bodyFade:hle,bodyCentered:ple,heroSai:mle,header:gle,headerCentered:yle,kicker:ble,headline:vle,sub:wle,points:_le,liRise:xle,checkBubble:kle,pointTitle:Cle,pointSub:jle,txPanel:Sle,txPanelHeader:Ale,txPanelKicker:Ele,txPanelBadge:Nle,netSelectWrap:Ile,netSelectBtn:Mle,netSelectBtnOpen:Ble,netSelectDot:Tle,netSelectName:Ple,netSelectStack:Rle,netSelectStackDot:Lle,netSelectCaret:Dle,netSelectCaretOpen:Ole,netSelectMenu:Fle,netMenuRise:$le,netSelectMenuHeader:zle,netSelectMenuKicker:qle,netSelectMenuLink:Ule,netSelectMenuList:Hle,netSelectOption:Wle,netSelectOptionActive:Vle,netSelectOptionBody:Gle,netSelectOptionName:Kle,netSelectOptionMeta:Qle,netSelectCheckbox:Yle,netSelectCheckboxOn:Jle,netSummary:Xle,netSummaryItem:Zle,netSummarySep:eue,netSummaryStack:tue,netSummaryStackDot:nue,txDetails:rue,txRow:sue,gas:oue,txPanelFooter:aue,actions:iue,linkBtn:cue,fineprint:lue,confirmIndicator:uue,confirmDone:due,pulse:fue,"confirm-pulse":"_confirm-pulse_vkkf7_1",confirmHeadline:hue,confirmSub:pue,successHalo:mue},gue=[{type:"function",name:"createProxyWithNonce",stateMutability:"nonpayable",inputs:[{name:"singleton",type:"address"},{name:"initializer",type:"bytes"},{name:"saltNonce",type:"uint256"}],outputs:[{name:"proxy",type:"address"}]}],yue="0x4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e235";function bue(e){var r,s;if(!(e!=null&&e.logs))return null;const[t]=hp({abi:ZS,eventName:"AccountRegistered",logs:e.logs});if((r=t==null?void 0:t.args)!=null&&r.account)return t.args.account;const n=e.logs.find(o=>{var a;return((a=o.topics)==null?void 0:a[0])===yue});return n?`0x${(s=n.topics[1])==null?void 0:s.slice(26)}`:null}function vue(e,t,n){if(e){const s=Yce({owners:[t],threshold:1n,kernel:e.kernel,safeModuleEnabler:e.safeModuleEnabler});return{to:e.kernel,data:ht({abi:ZS,functionName:"createAccount",args:[Ko.proxyFactory,Ko.singletonL2,s,n,t,t,e.standardFeePolicy,bt]})}}const r=ht({abi:XS,functionName:"setup",args:[[t],1n,bt,"0x",Ko.fallbackHandler,bt,0n,bt]});return{to:Ko.proxyFactory,data:ht({abi:gue,functionName:"createProxyWithNonce",args:[Ko.singletonL2,r,n]})}}async function wue(e){try{await fetch("/api/account",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}function _ue({open:e,onClose:t,onComplete:n}){const[r,s]=S.useState("intro"),[o,a]=S.useState([eA]),[c,l]=S.useState(""),[u,d]=S.useState(null),[f,h]=S.useState(null),[p,m]=S.useState(null),{address:g,chainId:_}=Oe(),{sendTransactionAsync:b}=Pc(),{switchChainAsync:y}=Ls(),v=at();S.useEffect(()=>{if(!e)return;s("intro"),l(""),d(null),h(null),m(null),document.body.style.overflow="hidden";const x=A=>{A.key==="Escape"&&r!=="confirm"&&(t==null||t())};return window.addEventListener("keydown",x),()=>{window.removeEventListener("keydown",x),document.body.style.overflow=""}},[e]);async function w(){var O;if(!g){l("No wallet connected.");return}const x=Ih.filter(B=>o.includes(B.id));if(x.length===0){l("Select a network.");return}const A=BigInt(Date.now());s("confirm"),l("");const C=[];let j=null,E="0",I=_;try{for(const B of x){m({index:C.length,total:x.length,name:B.name});let U=null;try{U=AS(B.chainId)}catch{}const{to:L,data:N}=vue(U,g,A);I!==B.chainId&&(await y({chainId:B.chainId}),I=B.chainId);const H=await b({to:L,data:N,chainId:B.chainId}),M=await ij(v,{hash:H,chainId:B.chainId});j||(j=bue(M),E=((O=M.blockNumber)==null?void 0:O.toString())??"0"),C.push(B.chainId)}}catch(B){if(C.length===0){l((B==null?void 0:B.shortMessage)||(B==null?void 0:B.message)||"Transaction rejected."),s("review"),m(null);return}l(`Deployed on ${C.length} of ${x.length} chains — the rest were not completed. ${(B==null?void 0:B.shortMessage)||(B==null?void 0:B.message)||""}`.trim())}if(m(null),!j){s("review");return}const T={safe:j,owner:g,permissionSigner:g,manager:g,chainId:C[0],createdAtBlock:E,deployedChains:C};d(j),wue(T),h(T),s("ready")}return e?i.jsx("div",{className:oe.overlay,role:"dialog","aria-modal":"true","aria-label":"Create your SMA",onClick:r==="confirm"?void 0:t,children:i.jsxs(Ct,{className:oe.card,onClick:x=>x.stopPropagation(),children:[r!=="confirm"&&i.jsx("button",{type:"button",className:oe.close,onClick:t,"aria-label":"Close",children:"×"}),r!=="ready"&&i.jsx(xue,{step:r}),r==="intro"&&i.jsx(kue,{onContinue:()=>s("review")}),r==="review"&&i.jsx(Cue,{onBack:()=>s("intro"),onSign:w,networks:o,onNetworksChange:a,error:c,ownerAddress:g}),r==="confirm"&&i.jsx(Eue,{progress:p}),r==="ready"&&i.jsx(Nue,{safeAddress:u,onContinue:()=>{t==null||t(),n==null||n(f)}})]})}):null}const I1=[{id:"intro",label:"Intro"},{id:"review",label:"Review"},{id:"confirm",label:"Confirm"}];function xue({step:e}){const t=I1.findIndex(n=>n.id===e);return i.jsx("div",{className:oe.stepper,"aria-label":"Setup progress",children:I1.map((n,r)=>{const s=r<t?"done":r===t?"current":"upcoming";return i.jsxs("span",{className:oe.stepGroup,children:[i.jsxs("span",{className:`${oe.step} ${oe[`step_${s}`]}`,children:[i.jsx("span",{className:oe.stepCircle,"aria-hidden":!0,children:s==="done"?i.jsx(Mue,{}):r+1}),s==="current"&&i.jsx("span",{className:oe.stepLabel,children:n.label})]}),r<I1.length-1&&i.jsx("span",{className:`${oe.stepLine} ${r<t?oe.stepLineDone:""}`,"aria-hidden":!0})]},n.id)})})}function kue({onContinue:e}){return i.jsxs("section",{className:oe.body,children:[i.jsx("div",{className:oe.heroSai,"aria-hidden":!0,children:i.jsx(Dt,{size:56,animate:!0})}),i.jsxs("header",{className:oe.header,children:[i.jsx("span",{className:oe.kicker,children:"FIRST AGENT"}),i.jsx("h2",{className:`${De.displayHeadline} ${oe.headline}`,children:"Before creating your first agent, we’ll create your SMA."}),i.jsx("p",{className:oe.sub,children:"Your Separately Managed Account is the self-custody smart contract that your AI operates inside. It’s deployed once. You alone control it."})]}),i.jsxs("ul",{className:oe.points,children:[i.jsxs("li",{style:{"--i":0},children:[i.jsx(M1,{}),i.jsxs("div",{children:[i.jsx("span",{className:oe.pointTitle,children:"You own this account"}),i.jsx("span",{className:oe.pointSub,children:"Not Sail. Not the AI. Only the wallet you just connected."})]})]}),i.jsxs("li",{style:{"--i":1},children:[i.jsx(M1,{}),i.jsxs("div",{children:[i.jsx("span",{className:oe.pointTitle,children:"Bounded delegation"}),i.jsx("span",{className:oe.pointSub,children:"Every agent has cap, time, and venue limits — enforced onchain."})]})]}),i.jsxs("li",{style:{"--i":2},children:[i.jsx(M1,{}),i.jsxs("div",{children:[i.jsx("span",{className:oe.pointTitle,children:"Revoke at any time"}),i.jsx("span",{className:oe.pointSub,children:"One signature halts every running agent. No waiting period."})]})]})]}),i.jsx(Me,{fullWidth:!0,onClick:e,children:"Continue"}),i.jsx("p",{className:oe.fineprint,children:"You can stop at any step. Nothing happens onchain until you sign."})]})}function Cue({onBack:e,onSign:t,networks:n,onNetworksChange:r,error:s,ownerAddress:o}){const a=Ih.filter(g=>n.includes(g.id)),c=a.reduce((g,_)=>g+Sue(_.gas),0),l=Aue(c),[u,d]=S.useState(!1),f=a[0];let h=null;if(f)try{h=AS(f.chainId)}catch{}const p=!!h;async function m(){d(!0);try{await t()}finally{d(!1)}}return i.jsxs("section",{className:oe.body,children:[i.jsxs("header",{className:oe.headerCentered,children:[i.jsx("span",{className:oe.kicker,children:"REVIEW & SIGN"}),i.jsx("h2",{className:`${De.displayHeadline} ${oe.headline}`,children:"Deploy your SMA."}),i.jsxs("p",{className:oe.sub,children:["One signature creates a self-custody smart account.",i.jsx("br",{}),"No AI has access until you create your first agent."]})]}),i.jsxs("div",{className:oe.txPanel,children:[i.jsxs("header",{className:oe.txPanelHeader,children:[i.jsx("span",{className:oe.txPanelKicker,children:"What you are signing"}),i.jsx(Iue,{value:n,onChange:r})]}),i.jsxs("dl",{className:oe.txDetails,children:[i.jsx(dl,{k:"Transaction",v:p?"Deploy & register SMA":"Safe proxy deployment"}),i.jsx(dl,{k:`Network${a.length===1?"":"s"}`,v:i.jsx(jue,{nets:a})}),p?i.jsx(dl,{k:"SailKernel",v:`${h.kernel.slice(0,10)}…`}):i.jsx(dl,{k:"Factory",v:`${Ko.proxyFactory.slice(0,10)}…`}),i.jsx(dl,{k:a.length===1?"Gas estimate":`Gas estimate · ${a.length} chains`,v:l,accent:!0})]})]}),s&&i.jsx("p",{style:{color:"#ff6b6b",fontSize:13,margin:"8px 0 0",textAlign:"center"},children:s}),i.jsxs("div",{className:oe.actions,children:[i.jsx(Me,{fullWidth:!0,onClick:m,disabled:a.length===0||u,children:u?"Check your wallet…":"Sign & deploy"}),i.jsx("button",{type:"button",className:oe.linkBtn,onClick:e,children:"Back"})]})]})}function jue({nets:e}){return e.length===0?i.jsx("span",{style:{opacity:.6},children:"None selected"}):e.length<=3?i.jsx("span",{className:oe.netSummary,children:e.map((t,n)=>i.jsxs("span",{className:oe.netSummaryItem,children:[i.jsx("span",{className:oe.netSelectDot,style:{background:t.color,boxShadow:`0 0 6px ${t.color}66`},"aria-hidden":!0}),i.jsx("span",{children:t.name}),n<e.length-1&&i.jsx("span",{className:oe.netSummarySep,"aria-hidden":!0,children:"·"})]},t.id))}):i.jsxs("span",{className:oe.netSummary,children:[i.jsx("span",{className:oe.netSummaryStack,"aria-hidden":!0,children:e.slice(0,4).map(t=>i.jsx("span",{className:oe.netSummaryStackDot,style:{background:t.color,boxShadow:`0 0 6px ${t.color}66`}},t.id))}),i.jsxs("span",{children:[e.length," networks"]})]})}function Sue(e){const t=String(e??"").match(/\$(\d+(?:\.\d+)?)/);return t?Number(t[1]):0}function Aue(e){return e<1?`$${e.toFixed(2)}`:e<100?`$${e.toFixed(2)}`:`$${Math.round(e)}`}function Eue({progress:e}){const t=e&&e.total>1;return i.jsxs("section",{className:`${oe.body} ${oe.bodyCentered}`,children:[i.jsx("div",{className:oe.confirmIndicator,children:i.jsx("span",{className:oe.pulse})}),i.jsx("h2",{className:`${De.displayHeadline} ${oe.confirmHeadline}`,children:e?`Deploying on ${e.name}…`:"Waiting for confirmation…"}),i.jsx("p",{className:oe.confirmSub,children:t?`Chain ${e.index+1} of ${e.total} — approve each deployment in your wallet. You may be asked to switch networks between chains.`:"Approve the deployment in your wallet, then wait for the block."})]})}function Nue({onContinue:e,safeAddress:t}){return i.jsxs("section",{className:`${oe.body} ${oe.bodyCentered}`,children:[i.jsx("span",{className:oe.successHalo,"aria-hidden":!0,children:i.jsx(Dt,{size:56,animate:!0})}),i.jsxs("header",{className:oe.headerCentered,children:[i.jsx("span",{className:oe.kicker,children:"SMA READY"}),i.jsx("h2",{className:`${De.displayHeadline} ${oe.headline}`,children:"Your account is ready."}),t&&i.jsx("p",{className:oe.sub,style:{fontFamily:"monospace",fontSize:12,wordBreak:"break-all"},children:t}),i.jsxs("p",{className:oe.sub,children:["Open a chat with your AI and ask it to draft your first agent.",i.jsx("br",{}),"When it’s ready you’ll see it here, waiting for your signature."]})]}),i.jsx(Me,{fullWidth:!0,onClick:e,children:"Open my dashboard"}),i.jsx("p",{className:oe.fineprint,children:"Tip: paste your SMA address into your AI chat to start."})]})}const Ih=[{id:"base",name:"Base",chainId:8453,color:"#0052FF",gas:"$0.18",tier:"L2",sail:!0},{id:"arbitrum",name:"Arbitrum One",chainId:42161,color:"#28A0F0",gas:"$0.42",tier:"L2",sail:!0},{id:"ethereum",name:"Ethereum",chainId:1,color:"#627EEA",gas:"$24.80",tier:"L1",sail:!0},{id:"unichain",name:"Unichain",chainId:130,color:"#FF007A",gas:"$0.10",tier:"L2",sail:!0},{id:"sepolia",name:"Ethereum Sepolia",chainId:11155111,color:"#627EEA",gas:"$0.01",tier:"Testnet",sail:!0},{id:"baseSepolia",name:"Base Sepolia",chainId:84532,color:"#3c6ef5",gas:"$0.01",tier:"Testnet",sail:!0},{id:"arbitrumSepolia",name:"Arbitrum Sepolia",chainId:421614,color:"#28A0F0",gas:"$0.01",tier:"Testnet",sail:!0},{id:"unichainSepolia",name:"Unichain Sepolia",chainId:1301,color:"#FF007A",gas:"$0.01",tier:"Testnet",sail:!0}],eA="base";function Iue({value:e,onChange:t}){const[n,r]=S.useState(!1),s=Ih.filter(c=>e.includes(c.id)),o=s.length===1?s[0]:null;S.useEffect(()=>{if(!n)return;const c=u=>{var d,f;(f=(d=u.target)==null?void 0:d.closest)!=null&&f.call(d,`.${oe.netSelectWrap}`)||r(!1)},l=u=>{u.key==="Escape"&&r(!1)};return window.addEventListener("click",c),window.addEventListener("keydown",l),()=>{window.removeEventListener("click",c),window.removeEventListener("keydown",l)}},[n]);function a(c){const l=e.includes(c)?e.filter(u=>u!==c):[...e,c];l.length!==0&&(t==null||t(l))}return i.jsxs("span",{className:oe.netSelectWrap,children:[i.jsxs("button",{type:"button",className:`${oe.netSelectBtn} ${n?oe.netSelectBtnOpen:""}`,onClick:()=>r(c=>!c),"aria-haspopup":"listbox","aria-expanded":n,children:[o?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:oe.netSelectDot,style:{background:o.color,boxShadow:`0 0 6px ${o.color}66`},"aria-hidden":!0}),i.jsx("span",{className:oe.netSelectName,children:o.name})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:oe.netSelectStack,"aria-hidden":!0,children:s.slice(0,4).map(c=>i.jsx("span",{className:oe.netSelectStackDot,style:{background:c.color,boxShadow:`0 0 6px ${c.color}66`}},c.id))}),i.jsx("span",{className:oe.netSelectName,children:s.length===0?"Select networks":`${s.length} networks`})]}),i.jsx("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",className:`${oe.netSelectCaret} ${n?oe.netSelectCaretOpen:""}`,"aria-hidden":!0,children:i.jsx("path",{d:"M3 4.5l3 3 3-3"})})]}),n&&i.jsxs("div",{className:oe.netSelectMenu,role:"listbox","aria-multiselectable":"true","aria-label":"EVM networks",children:[i.jsxs("header",{className:oe.netSelectMenuHeader,children:[i.jsx("span",{className:oe.netSelectMenuKicker,children:s.length===0?"Select at least one chain":`${s.length} selected`}),i.jsx("button",{type:"button",className:oe.netSelectMenuLink,onClick:()=>t==null?void 0:t([eA]),children:"Reset"})]}),i.jsx("ul",{className:oe.netSelectMenuList,children:Ih.map(c=>{const l=e.includes(c.id);return i.jsx("li",{children:i.jsxs("button",{type:"button",role:"option","aria-selected":l,className:`${oe.netSelectOption} ${l?oe.netSelectOptionActive:""}`,onClick:()=>a(c.id),children:[i.jsx("span",{className:oe.netSelectDot,style:{background:c.color,boxShadow:`0 0 6px ${c.color}66`},"aria-hidden":!0}),i.jsxs("span",{className:oe.netSelectOptionBody,children:[i.jsxs("span",{className:oe.netSelectOptionName,children:[c.name,c.sail&&i.jsx("span",{style:{marginLeft:6,fontSize:10,color:"var(--accent-blue)",opacity:.9},children:"● Sail"})]}),i.jsxs("span",{className:oe.netSelectOptionMeta,children:[c.tier," · chain ",c.chainId]})]}),i.jsx("span",{className:`${oe.netSelectCheckbox} ${l?oe.netSelectCheckboxOn:""}`,"aria-hidden":!0,children:l&&i.jsx("svg",{viewBox:"0 0 14 14",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})})]})},c.id)})})]})]})}function dl({k:e,v:t,accent:n}){return i.jsxs("div",{className:oe.txRow,children:[i.jsx("dt",{children:e}),i.jsx("dd",{className:n?oe.gas:"",children:t})]})}function M1(){return i.jsx("span",{className:oe.checkBubble,"aria-hidden":!0,children:i.jsx("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M5 12.5l5 5L20 7"})})})}function Mue(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M3 7.5l2.6 2.6L11 4"})})}const Bue="_overlay_1jzwq_1",Tue="_card_1jzwq_13",Pue="_close_1jzwq_19",Rue="_title_1jzwq_33",Lue="_body_1jzwq_40",Due="_meta_1jzwq_48",Oue="_error_1jzwq_68",Fue="_warn_1jzwq_77",$ue="_actions_1jzwq_83",zue="_cancel_1jzwq_89",que="_permList_1jzwq_104",Uue="_permItem_1jzwq_115",Hue="_permLabel_1jzwq_121",Wue="_permCheck_1jzwq_129",Vue="_permName_1jzwq_136",Gue="_permAddr_1jzwq_142",Kue="_confirmList_1jzwq_148",Que="_confirmItem_1jzwq_159",ke={overlay:Bue,card:Tue,close:Pue,title:Rue,body:Lue,meta:Due,error:Oue,warn:Fue,actions:$ue,cancel:zue,permList:que,permItem:Uue,permLabel:Hue,permCheck:Wue,permName:Vue,permAddr:Gue,confirmList:Kue,confirmItem:Que},nx=[{type:"function",name:"revokePermissions",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]}],Yue={RevokePermissions:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};async function Jue(e){try{await fetch("/api/activity",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}function Xue({open:e,mandate:t,permissions:n,sma:r,kernel:s,chainId:o,onClose:a,onRevoked:c}){var T,O;const{address:l,chainId:u}=Oe(),d=Ap({chainId:o}),{signTypedDataAsync:f}=Ep(),{sendTransactionAsync:h}=Pc(),{switchChainAsync:p}=Ls(),m=Array.isArray(n)&&n.length>0,[g,_]=S.useState("confirm"),[b,y]=S.useState(new Set),[v,w]=S.useState(""),[x,A]=S.useState(null),{isSuccess:C}=yO({hash:x});if(S.useEffect(()=>{if(!e)return;_(m?"select":"confirm"),y(new Set),w(""),A(null),document.body.style.overflow="hidden";const B=U=>{U.key==="Escape"&&g!=="pending"&&(a==null||a())};return window.addEventListener("keydown",B),()=>{window.removeEventListener("keydown",B),document.body.style.overflow=""}},[e]),S.useEffect(()=>{if(!C||!x||g==="done")return;_("done");const B=m?[...b]:[t==null?void 0:t.address];Promise.all(B.map(U=>Jue({type:"permission_revoked",actor:"owner",permission:U,sma:r,txHash:x,chainId:o}))).then(()=>c==null?void 0:c())},[C,x]),!e)return null;const j=m?[...b]:t!=null&&t.address?[t.address]:[];async function E(){if(!l){w("Connect your owner wallet first.");return}if(!s||!r||j.length===0){w("Select at least one permission to revoke.");return}_("pending"),w("");try{u!==o&&await p({chainId:o});const B=await d.readContract({address:s,abi:nx,functionName:"signerNonces",args:[r]}),U=BigInt(Math.floor(Date.now()/1e3)+600),L=await f({domain:{name:"SailKernel",version:"1",chainId:o,verifyingContract:s},types:Yue,primaryType:"RevokePermissions",message:{account:r,permissions:j,nonce:B,deadline:U}}),N=ht({abi:nx,functionName:"revokePermissions",args:[r,j,U,L]}),H=await h({to:s,data:N,chainId:o});A(H)}catch(B){w((B==null?void 0:B.shortMessage)||(B==null?void 0:B.message)||"Transaction rejected."),_(m?"select":"confirm")}}function I(B){y(U=>{const L=new Set(U);return L.has(B)?L.delete(B):L.add(B),L})}return i.jsx("div",{className:ke.overlay,role:"dialog","aria-modal":"true","aria-label":"Revoke permission",onClick:g==="pending"?void 0:a,children:i.jsxs(Ct,{className:ke.card,onClick:B=>B.stopPropagation(),children:[g!=="pending"&&i.jsx("button",{type:"button",className:ke.close,onClick:a,"aria-label":"Close",children:"×"}),g==="done"?i.jsxs(i.Fragment,{children:[i.jsxs("h2",{className:ke.title,children:["Permission",j.length>1?"s":""," revoked"]}),i.jsxs("p",{className:ke.body,children:[j.length===1?i.jsxs(i.Fragment,{children:[i.jsx("strong",{children:(m?(T=n.find(B=>B.address===j[0]))==null?void 0:T.name:t==null?void 0:t.name)??j[0]})," is no longer attached to your SMA."]}):i.jsxs(i.Fragment,{children:[i.jsxs("strong",{children:[j.length," permissions"]})," removed from your SMA."]})," ","It now appears in Recent Activity."]}),i.jsx("div",{className:ke.actions,children:i.jsx(Me,{onClick:a,children:"Done"})})]}):g==="select"?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:ke.title,children:"Select permissions to revoke"}),i.jsx("p",{className:ke.body,children:"Choose which permissions to remove from your SMA. The agent will no longer be able to act under revoked permissions."}),i.jsx("ul",{className:ke.permList,children:n.map(B=>i.jsx("li",{className:ke.permItem,children:i.jsxs("label",{className:ke.permLabel,children:[i.jsx("input",{type:"checkbox",className:ke.permCheck,checked:b.has(B.address),onChange:()=>I(B.address)}),i.jsx("span",{className:ke.permName,children:B.name??B.address}),i.jsxs("span",{className:ke.permAddr,children:[B.address.slice(0,10),"…",B.address.slice(-6)]})]})},B.address))}),v&&i.jsx("p",{className:ke.error,children:v}),!l&&i.jsx("p",{className:ke.warn,children:"Connect your owner wallet to continue."}),i.jsxs("div",{className:ke.actions,children:[i.jsx("button",{type:"button",className:ke.cancel,onClick:a,children:"Cancel"}),i.jsx(Me,{onClick:()=>{if(b.size===0){w("Select at least one permission.");return}w(""),_("confirm")},disabled:!l,children:"Next"})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("h2",{className:ke.title,children:["Revoke ",j.length>1?`${j.length} permissions`:"this permission","?"]}),i.jsxs("p",{className:ke.body,children:[j.length>1?`Removing these ${j.length} permissions means the agent can no longer act under them.`:i.jsxs(i.Fragment,{children:["Removing ",i.jsx("strong",{children:(m?(O=n==null?void 0:n.find(B=>B.address===j[0]))==null?void 0:O.name:t==null?void 0:t.name)??"this permission"})," means the agent can no longer act under it."]})," ","You authorize the removal in your wallet and pay gas."]}),m&&j.length>0&&i.jsx("ul",{className:ke.confirmList,children:j.map(B=>{var L;const U=(L=n.find(N=>N.address===B))==null?void 0:L.name;return i.jsx("li",{className:ke.confirmItem,children:U??B},B)})}),!m&&i.jsxs("dl",{className:ke.meta,children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Permission"}),i.jsx("dd",{children:t==null?void 0:t.address})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"SMA"}),i.jsx("dd",{children:r})]})]}),v&&i.jsx("p",{className:ke.error,children:v}),!l&&i.jsx("p",{className:ke.warn,children:"Connect your owner wallet to continue."}),i.jsxs("div",{className:ke.actions,children:[i.jsx("button",{type:"button",className:ke.cancel,onClick:m?()=>_("select"):a,disabled:g==="pending",children:m?"Back":"Cancel"}),i.jsx(Me,{onClick:E,disabled:g==="pending"||!l,children:g==="pending"?"Awaiting wallet…":"Revoke"})]})]})]})})}const Zue="_overlay_x1rfq_7",ede="_card_x1rfq_22",tde="_close_x1rfq_32",nde="_body_x1rfq_49",rde="_kicker_x1rfq_55",sde="_headline_x1rfq_63",ode="_sub_x1rfq_70",ade="_segmented_x1rfq_78",ide="_segmented2_x1rfq_79",cde="_segBtn_x1rfq_89",lde="_segActive_x1rfq_102",ude="_modeNote_x1rfq_107",dde="_field_x1rfq_115",fde="_fieldLabel_x1rfq_120",hde="_input_x1rfq_125",pde="_fieldHint_x1rfq_139",mde="_error_x1rfq_145",gde="_fineprint_x1rfq_151",yde="_addrPanel_x1rfq_159",bde="_revealPanel_x1rfq_160",vde="_addrLabel_x1rfq_169",wde="_revealLabel_x1rfq_170",_de="_addrValue_x1rfq_177",xde="_revealValue_x1rfq_178",kde="_revealNote_x1rfq_190",Cde="_copyBtn_x1rfq_196",jde="_savedList_x1rfq_211",Sde="_savedItem_x1rfq_218",Ade="_savedItemActive_x1rfq_235",Ede="_savedAddr_x1rfq_240",Nde="_savedBadge_x1rfq_247",le={overlay:Zue,card:ede,close:tde,body:nde,kicker:rde,headline:sde,sub:ode,segmented:ade,segmented2:ide,segBtn:cde,segActive:lde,modeNote:ude,field:dde,fieldLabel:fde,input:hde,fieldHint:pde,error:mde,fineprint:gde,addrPanel:yde,revealPanel:bde,addrLabel:vde,revealLabel:wde,addrValue:_de,revealValue:xde,revealNote:kde,copyBtn:Cde,savedList:jde,savedItem:Sde,savedItemActive:Ade,savedAddr:Ede,savedBadge:Nde},rx=8;function sx(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:"this SMA"}function Ide({open:e,safe:t,onClose:n,onCreated:r}){const[s,o]=S.useState("create"),[a,c]=S.useState("privateKey"),[l,u]=S.useState(""),[d,f]=S.useState(""),[h,p]=S.useState(!1),[m,g]=S.useState(""),[_,b]=S.useState(null),[y,v]=S.useState(!1);if(S.useEffect(()=>{if(!e)return;o("create"),c("privateKey"),u(""),f(""),p(!1),g(""),b(null),v(!1),document.body.style.overflow="hidden";const j=E=>{E.key==="Escape"&&!h&&(n==null||n())};return window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j),document.body.style.overflow=""}},[e]),!e)return null;const w=s==="create"?"generate":a,x=s==="import";async function A(){if(g(""),d.length<rx){g(`Password must be at least ${rx} characters.`);return}if(x&&!l.trim()){g(a==="privateKey"?"Enter a private key.":"Enter your recovery phrase.");return}p(!0);try{const j=await fetch("/api/signer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:w,secret:x?l.trim():void 0,password:d})}),E=await j.json();if(!j.ok)throw new Error((E==null?void 0:E.error)||"Failed to create signer.");b(E),u(""),f("")}catch(j){g((j==null?void 0:j.message)||"Failed to create signer.")}finally{p(!1)}}function C(){var j;_!=null&&_.revealed&&((j=navigator==null?void 0:navigator.clipboard)!=null&&j.writeText)&&(navigator.clipboard.writeText(_.revealed),v(!0),setTimeout(()=>v(!1),1500))}return i.jsx("div",{className:le.overlay,role:"dialog","aria-modal":"true","aria-label":"Add agent wallet",onClick:h?void 0:n,children:i.jsxs(Ct,{className:le.card,onClick:j=>j.stopPropagation(),children:[!h&&i.jsx("button",{type:"button",className:le.close,onClick:n,"aria-label":"Close",children:"×"}),_?i.jsxs("section",{className:le.body,children:[i.jsx("span",{className:le.kicker,children:"SIGNER READY"}),i.jsx("h2",{className:`${De.displayHeadline} ${le.headline}`,children:"Agent wallet created."}),i.jsxs("p",{className:le.sub,children:["Encrypted on disk for ",sx(t),". It still needs to be delegated on-chain before the agent can sign with it."]}),i.jsxs("div",{className:le.addrPanel,children:[i.jsx("span",{className:le.addrLabel,children:"Signer address"}),i.jsx("code",{className:le.addrValue,children:_.address})]}),_.revealed&&i.jsxs("div",{className:le.revealPanel,children:[i.jsx("span",{className:le.revealLabel,children:"Private key — save it now, shown only once"}),i.jsx("code",{className:le.revealValue,children:_.revealed}),i.jsx("button",{type:"button",className:le.copyBtn,onClick:C,children:y?"Copied ✓":"Copy"}),i.jsx("p",{className:le.revealNote,children:"Anyone with this key controls the signer. Store it in a password manager — never paste it into a chat or commit it to a repo."})]}),i.jsx(Me,{fullWidth:!0,onClick:()=>r==null?void 0:r(_),children:_.revealed?"I've saved it — done":"Done"})]}):i.jsxs("section",{className:le.body,children:[i.jsx("span",{className:le.kicker,children:"DELEGATED SIGNER"}),i.jsx("h2",{className:`${De.displayHeadline} ${le.headline}`,children:"Add an agent wallet."}),i.jsxs("p",{className:le.sub,children:["A hot key the agent uses to sign dispatches for ",sx(t),". It’s encrypted on disk and never leaves this machine."]}),i.jsxs("div",{className:le.segmented,role:"tablist","aria-label":"Signer source",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":s==="create",className:`${le.segBtn} ${s==="create"?le.segActive:""}`,onClick:()=>o("create"),children:"Create new"}),i.jsx("button",{type:"button",role:"tab","aria-selected":s==="import",className:`${le.segBtn} ${s==="import"?le.segActive:""}`,onClick:()=>o("import"),children:"Import"})]}),s==="create"?i.jsx("p",{className:le.modeNote,children:"Generates a fresh random key. You’ll see the private key once, to back up."}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:le.segmented2,children:[i.jsx("button",{type:"button",className:`${le.segBtn} ${a==="privateKey"?le.segActive:""}`,onClick:()=>c("privateKey"),children:"Private key"}),i.jsx("button",{type:"button",className:`${le.segBtn} ${a==="mnemonic"?le.segActive:""}`,onClick:()=>c("mnemonic"),children:"Recovery phrase"})]}),i.jsxs("label",{className:le.field,children:[i.jsx("span",{className:le.fieldLabel,children:a==="privateKey"?"Private key":"Recovery phrase (12 or 24 words)"}),i.jsx("textarea",{className:le.input,rows:a==="privateKey"?2:3,placeholder:a==="privateKey"?"0x…":"word1 word2 word3 …",value:l,onChange:j=>u(j.target.value),autoComplete:"off",spellCheck:!1})]})]}),i.jsxs("label",{className:le.field,children:[i.jsx("span",{className:le.fieldLabel,children:"Encryption password"}),i.jsx("input",{className:le.input,type:"password",placeholder:"At least 8 characters",value:d,onChange:j=>f(j.target.value),autoComplete:"new-password"}),i.jsx("span",{className:le.fieldHint,children:"Encrypts the key on disk. You’ll enter it to run the agent (or set SAIL_PASSPHRASE)."})]}),m&&i.jsx("p",{className:le.error,children:m}),i.jsx(Me,{fullWidth:!0,onClick:A,disabled:h,children:h?"Working…":s==="create"?"Generate signer":"Import signer"}),i.jsx("p",{className:le.fineprint,children:"Self-custody. The key is encrypted locally and never sent anywhere."})]})]})})}const ox=8,Mde=[{type:"function",name:"setManager",stateMutability:"nonpayable",inputs:[{name:"newManager",type:"address"}],outputs:[]}],Bde=[{type:"function",name:"execTransaction",stateMutability:"payable",inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"operation",type:"uint8"},{name:"safeTxGas",type:"uint256"},{name:"baseGas",type:"uint256"},{name:"gasPrice",type:"uint256"},{name:"gasToken",type:"address"},{name:"refundReceiver",type:"address"},{name:"signatures",type:"bytes"}],outputs:[{name:"success",type:"bool"}]}],ax=[{type:"function",name:"registerPermissions",stateMutability:"payable",inputs:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]}],Tde={RegisterPermissions:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};function Pde(e){return HB(["bytes32","bytes32","uint8"],[_r(e,{size:32}),_r("0x",{size:32}),1])}async function ix(e){try{await fetch("/api/activity",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}function Rde({open:e,sma:t,kernel:n,chainId:r,owner:s,currentManager:o,mandates:a=[],initialTo:c=null,onClose:l,onRotated:u}){const{address:d,chainId:f}=Oe(),h=Ap({chainId:r}),{signTypedDataAsync:p}=Ep(),{sendTransactionAsync:m}=Pc(),{switchChainAsync:g}=Ls(),_=(a??[]).map(re=>typeof re=="string"?re:re==null?void 0:re.address).filter(Boolean),[b,y]=S.useState("confirm"),[v,w]=S.useState("create"),[x,A]=S.useState("privateKey"),[C,j]=S.useState(""),[E,I]=S.useState(""),[T,O]=S.useState(!1),[B,U]=S.useState(""),[L,N]=S.useState(null),[H,M]=S.useState(!1),[$,W]=S.useState(null),[ie,de]=S.useState(null),[ye,z]=S.useState(null),[se,ge]=S.useState(!1),[xe,je]=S.useState("");if(S.useEffect(()=>{if(!e)return;y("confirm"),w(c?"saved":"create"),A("privateKey"),j(""),I(""),O(!1),U(""),N(null),M(!1),W(null),de(null),z(null),ge(!1),je(c??""),c&&In(),document.body.style.overflow="hidden";const re=Ke=>{Ke.key==="Escape"&&!T&&b!=="rotating"&&b!=="reattaching"&&(l==null||l())};return window.addEventListener("keydown",re),()=>{window.removeEventListener("keydown",re),document.body.style.overflow=""}},[e]),!e)return null;const Ue=s??d,Fe=d&&Ue&&d.toLowerCase()!==Ue.toLowerCase(),Ze=v==="create"?"generate":x,Nn=v==="import";async function Mt(){if(U(""),E.length<ox){U(`Password must be at least ${ox} characters.`);return}if(Nn&&!C.trim()){U(x==="privateKey"?"Enter a private key.":"Enter your recovery phrase.");return}O(!0);try{const re=await fetch("/api/signer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:Ze,secret:Nn?C.trim():void 0,password:E})}),Ke=await re.json();if(!re.ok)throw new Error((Ke==null?void 0:Ke.error)||"Failed to prepare the new manager wallet.");N(Ke),j(""),I(""),y("backup")}catch(re){U((re==null?void 0:re.message)||"Failed to prepare the new manager wallet.")}finally{O(!1)}}async function In(){ge(!0),U("");try{const re=await fetch("/api/signers");if(!re.ok)throw new Error(re.status===404?"Saved-manager listing needs an updated Sailor UI — restart it (sailor ui stop && sailor ui).":`Could not list saved managers (HTTP ${re.status}).`);const Ke=await re.json().catch(()=>null);z(Array.isArray(Ke==null?void 0:Ke.signers)?Ke.signers:[])}catch(re){z([]),U((re==null?void 0:re.message)||"Could not list saved managers.")}finally{ge(!1)}}function Ot(re){w(re),U(""),re==="saved"&&ye===null&&!se&&In()}const dn=(ye??[]).filter(re=>!o||re.address.toLowerCase()!==o.toLowerCase());function pd(){U("");const re=dn.find(Ke=>Ke.address.toLowerCase()===xe.toLowerCase());if(!re){U("Select a saved manager to rotate to.");return}N({address:re.address,revealed:null,fromSaved:!0}),y("backup")}function md(){var re;L!=null&&L.revealed&&((re=navigator==null?void 0:navigator.clipboard)!=null&&re.writeText)&&(navigator.clipboard.writeText(L.revealed),M(!0),setTimeout(()=>M(!1),1500))}async function gd(re,Ke=8){let Ft;for(let Po=0;Po<Ke;Po++)try{return await h.waitForTransactionReceipt({hash:re})}catch(jr){Ft=jr,await new Promise($c=>setTimeout($c,1500))}throw Ft}async function Oc(){if(!d){U("Connect your owner wallet first.");return}if(!n||!t||!(L!=null&&L.address)){U("Missing SMA, kernel, or new signer.");return}y("rotating"),U("");try{f!==r&&await g({chainId:r});const re=ht({abi:Mde,functionName:"setManager",args:[L.address]}),Ke=ht({abi:Bde,functionName:"execTransaction",args:[n,0n,re,0,0n,0n,0n,bt,bt,Pde(Ue)]}),Ft=await m({to:t,data:Ke,chainId:r});W(Ft),await gd(Ft),await ix({type:"signer_rotated",actor:"owner",sma:t,oldManager:o??null,newManager:L.address,txHash:Ft,chainId:r}),_.length>0?await yd():await Fc(Ft)}catch(re){U((re==null?void 0:re.shortMessage)||(re==null?void 0:re.message)||"Rotation transaction rejected."),y("backup")}}async function yd(){y("reattaching"),U("");try{f!==r&&await g({chainId:r});const re=await h.readContract({address:n,abi:ax,functionName:"signerNonces",args:[t]}),Ke=BigInt(Math.floor(Date.now()/1e3)+600),Ft=await p({domain:{name:"SailKernel",version:"1",chainId:r,verifyingContract:n},types:Tde,primaryType:"RegisterPermissions",message:{account:t,permissions:_,nonce:re,deadline:Ke}}),Po=ht({abi:ax,functionName:"registerPermissions",args:[t,_,Ke,Ft]}),jr=await m({to:n,data:Po,chainId:r});de(jr),await gd(jr),await ix({type:"mandates_reattached",actor:"owner",sma:t,permissions:_,txHash:jr,chainId:r}),await Fc($)}catch(re){U(((re==null?void 0:re.shortMessage)||(re==null?void 0:re.message)||"Re-approval rejected.")+" The signer was rotated, but the mandates are not re-approved yet — reopen this to retry."),y("backup")}}async function Fc(re){try{L!=null&&L.fromSaved&&await fetch("/api/signer/activate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:L.address})}),await fetch("/api/manager/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newManager:L==null?void 0:L.address,txHash:re})})}catch{}y("done"),u==null||u()}const $a=b==="rotating"||b==="reattaching";return i.jsx("div",{className:ke.overlay,role:"dialog","aria-modal":"true","aria-label":"Rotate manager",onClick:$a?void 0:l,children:i.jsxs(Ct,{className:ke.card,onClick:re=>re.stopPropagation(),children:[!$a&&i.jsx("button",{type:"button",className:ke.close,onClick:l,"aria-label":"Close",children:"×"}),b==="done"?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:ke.title,children:"Manager rotated"}),i.jsxs("p",{className:ke.body,children:[i.jsx("strong",{children:L==null?void 0:L.address})," is now this SMA’s delegated signer.",_.length>0?` ${_.length} mandate(s) were re-approved and bound to it.`:" No mandates were attached, so none needed re-approval."]}),i.jsx("p",{className:ke.body,children:"Fund the new manager wallet so it can pay gas for dispatches, then restart your agent."}),i.jsx("div",{className:ke.actions,children:i.jsx(Me,{onClick:l,children:"Done"})})]}):b==="backup"?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:ke.title,children:L!=null&&L.revealed?"Back up the new manager":"New manager ready"}),i.jsx("p",{className:ke.body,children:L!=null&&L.revealed?"A fresh manager wallet was created and encrypted on disk. Save its private key now — it’s shown only once. Then rotate the SMA to it.":L!=null&&L.fromSaved?"This manager is already saved in this project. Rotate the SMA to it below — its keystore becomes this SMA’s active signer.":"Your manager wallet was imported and encrypted on disk. Rotate the SMA to it below."}),i.jsxs("div",{className:le.addrPanel,children:[i.jsx("span",{className:le.addrLabel,children:"New manager address"}),i.jsx("code",{className:le.addrValue,children:L==null?void 0:L.address})]}),(L==null?void 0:L.revealed)&&i.jsxs("div",{className:le.revealPanel,children:[i.jsx("span",{className:le.revealLabel,children:"Private key — save it now, shown only once"}),i.jsx("code",{className:le.revealValue,children:L.revealed}),i.jsx("button",{type:"button",className:le.copyBtn,onClick:md,children:H?"Copied ✓":"Copy"}),i.jsx("p",{className:le.revealNote,children:"Anyone with this key controls the signer. Store it in a password manager."})]}),_.length>0&&i.jsxs("p",{className:ke.warn,children:["Rotating clears all ",_.length," attached mandate(s); you’ll re-approve them in your wallet right after, rebinding them to the new signer."]}),B&&i.jsx("p",{className:ke.error,children:B}),!d&&i.jsx("p",{className:ke.warn,children:"Connect your owner wallet to continue."}),Fe&&i.jsxs("p",{className:ke.warn,children:["Connected wallet isn’t the SMA owner (",Ue,"). Switch to it to authorize."]}),i.jsxs("div",{className:ke.actions,children:[i.jsx("button",{type:"button",className:ke.cancel,onClick:l,children:"Cancel"}),i.jsx(Me,{onClick:Oc,disabled:!d,children:_.length>0?"Rotate & re-approve":"Rotate signer"})]})]}):$a?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:ke.title,children:b==="rotating"?"Rotating signer…":"Re-approving mandates…"}),i.jsx("p",{className:ke.body,children:b==="rotating"?"Confirm the Safe transaction in your wallet to set the new delegated signer.":"Sign the re-approval and confirm the transaction to rebind your mandates."}),i.jsxs("dl",{className:ke.meta,children:[$&&i.jsxs("div",{children:[i.jsx("dt",{children:"Rotation tx"}),i.jsx("dd",{children:$})]}),ie&&i.jsxs("div",{children:[i.jsx("dt",{children:"Re-approval tx"}),i.jsx("dd",{children:ie})]})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:ke.title,children:"Rotate the manager?"}),i.jsx("p",{className:ke.body,children:"Rotate this SMA to a new delegated signer (manager) — the recovery path when the current manager key is lost or compromised. Generate a fresh wallet, or import an existing one by private key or recovery phrase. Set a password to encrypt it on disk."}),i.jsxs("dl",{className:ke.meta,children:[i.jsxs("div",{children:[i.jsx("dt",{children:"SMA"}),i.jsx("dd",{children:t})]}),o&&i.jsxs("div",{children:[i.jsx("dt",{children:"Current manager"}),i.jsx("dd",{children:o})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Attached mandates"}),i.jsx("dd",{children:_.length})]})]}),i.jsxs("div",{className:le.segmented,role:"tablist","aria-label":"New manager source",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":v==="create",className:`${le.segBtn} ${v==="create"?le.segActive:""}`,onClick:()=>Ot("create"),children:"Create new"}),i.jsx("button",{type:"button",role:"tab","aria-selected":v==="import",className:`${le.segBtn} ${v==="import"?le.segActive:""}`,onClick:()=>Ot("import"),children:"Import"}),i.jsx("button",{type:"button",role:"tab","aria-selected":v==="saved",className:`${le.segBtn} ${v==="saved"?le.segActive:""}`,onClick:()=>Ot("saved"),children:"Use saved"})]}),v==="create"?i.jsx("p",{className:le.modeNote,children:"Generates a fresh random key. You’ll see the private key once, to back up."}):v==="saved"?i.jsx("div",{className:le.savedList,role:"radiogroup","aria-label":"Saved managers",children:se?i.jsx("p",{className:le.modeNote,children:"Loading saved managers…"}):(ye??[]).length===0?i.jsx("p",{className:le.modeNote,children:"No saved managers in this project. Create a new wallet or import one."}):i.jsxs(i.Fragment,{children:[dn.length===0&&i.jsx("p",{className:le.modeNote,children:"The only saved manager is this SMA’s current one. Create a new wallet or import one."}),(ye??[]).map(re=>i.jsxs("label",{className:`${le.savedItem} ${xe.toLowerCase()===re.address.toLowerCase()?le.savedItemActive:""}`,"aria-disabled":re.active,children:[i.jsx("input",{type:"radio",name:"saved-manager",value:re.address,disabled:re.active,checked:xe.toLowerCase()===re.address.toLowerCase(),onChange:()=>je(re.address)}),i.jsx("code",{className:le.savedAddr,children:re.address}),re.active&&i.jsx("span",{className:le.savedBadge,children:"current"})]},re.address))]})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:le.segmented2,children:[i.jsx("button",{type:"button",className:`${le.segBtn} ${x==="privateKey"?le.segActive:""}`,onClick:()=>A("privateKey"),children:"Private key"}),i.jsx("button",{type:"button",className:`${le.segBtn} ${x==="mnemonic"?le.segActive:""}`,onClick:()=>A("mnemonic"),children:"Recovery phrase"})]}),i.jsxs("label",{className:le.field,children:[i.jsx("span",{className:le.fieldLabel,children:x==="privateKey"?"Private key":"Recovery phrase (12 or 24 words)"}),i.jsx("textarea",{className:le.input,rows:x==="privateKey"?2:3,placeholder:x==="privateKey"?"0x…":"word1 word2 word3 …",value:C,onChange:re=>j(re.target.value),autoComplete:"off",spellCheck:!1})]})]}),v!=="saved"&&i.jsxs("label",{className:le.field,children:[i.jsx("span",{className:le.fieldLabel,children:"Encryption password"}),i.jsx("input",{className:le.input,type:"password",placeholder:"At least 8 characters",value:E,onChange:re=>I(re.target.value),autoComplete:"new-password"}),i.jsx("span",{className:le.fieldHint,children:"Encrypts the key on disk. You’ll enter it to run the agent (or set SAIL_PASSPHRASE)."})]}),B&&i.jsx("p",{className:ke.error,children:B}),i.jsxs("div",{className:ke.actions,children:[i.jsx("button",{type:"button",className:ke.cancel,onClick:l,children:"Cancel"}),v==="saved"?i.jsx(Me,{onClick:pd,disabled:T||!xe,children:"Use this manager"}):i.jsx(Me,{onClick:Mt,disabled:T,children:T?"Working…":v==="create"?"Generate new wallet":"Import wallet"})]})]})]})})}const Lde="_overlay_1rcxh_1",Dde="_card_1rcxh_16",Ode="_close_1rcxh_28",Fde="_body_1rcxh_45",$de="_kicker_1rcxh_51",zde="_headline_1rcxh_59",qde="_sub_1rcxh_68",Ude="_addrBlock_1rcxh_75",Hde="_addrRow_1rcxh_84",Wde="_addrDivider_1rcxh_92",Vde="_addrLabel_1rcxh_97",Gde="_addrValue_1rcxh_106",Kde="_addrValueFull_1rcxh_112",Qde="_field_1rcxh_121",Yde="_fieldLabel_1rcxh_127",Jde="_amountWrap_1rcxh_133",Xde="_amountInput_1rcxh_144",Zde="_amountUnit_1rcxh_155",efe="_error_1rcxh_162",We={overlay:Lde,card:Dde,close:Ode,body:Fde,kicker:$de,headline:zde,sub:qde,addrBlock:Ude,addrRow:Hde,addrDivider:Wde,addrLabel:Vde,addrValue:Gde,addrValueFull:Kde,field:Qde,fieldLabel:Yde,amountWrap:Jde,amountInput:Xde,amountUnit:Zde,error:efe};function cx(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:"—"}function tfe({open:e,onClose:t,signer:n,network:r,chainId:s}){const[o,a]=S.useState("0.01"),[c,l]=S.useState(!1),[u,d]=S.useState(""),[f,h]=S.useState(!1),{address:p,chainId:m}=Oe(),{sendTransactionAsync:g}=Pc(),{switchChainAsync:_}=Ls(),b=p&&(n==null?void 0:n.address)&&p.toLowerCase()===n.address.toLowerCase();if(S.useEffect(()=>{if(!e)return;a("0.01"),l(!1),d(""),h(!1),document.body.style.overflow="hidden";const A=C=>{C.key==="Escape"&&!c&&(t==null||t())};return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A),document.body.style.overflow=""}},[e]),!e)return null;const y=o&&/^\d+(\.\d+)?$/.test(o)&&Number(o)>0,v=r?r.charAt(0).toUpperCase()+r.slice(1):null;function w(){var A;(A=navigator==null?void 0:navigator.clipboard)!=null&&A.writeText&&navigator.clipboard.writeText(n.address),h(!0),setTimeout(()=>h(!1),1500)}async function x(){if(y){l(!0),d("");try{s&&m!==s&&await _({chainId:s}),await g({to:n.address,value:rR(o),...s?{chainId:s}:{}}),t==null||t()}catch(A){const C=(A==null?void 0:A.shortMessage)??(A==null?void 0:A.message)??"Transaction rejected.";d(C)}finally{l(!1)}}}return i.jsx("div",{className:We.overlay,role:"dialog","aria-modal":"true","aria-label":"Fund gas",onClick:c?void 0:t,children:i.jsxs(Ct,{className:We.card,onClick:A=>A.stopPropagation(),children:[!c&&i.jsx("button",{type:"button",className:We.close,onClick:t,"aria-label":"Close",children:"×"}),i.jsxs("section",{className:We.body,children:[i.jsx("span",{className:We.kicker,children:"FUND GAS"}),b?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:We.headline,children:"Send ETH to this address."}),i.jsxs("p",{className:We.sub,children:["This is your connected wallet — you can't send to yourself. Transfer ETH here from an exchange or another wallet",v?` on ${v}`:"","."]}),i.jsx("div",{className:We.addrBlock,children:i.jsx("div",{className:We.addrRow,children:i.jsx("code",{className:We.addrValueFull,children:n.address})})}),i.jsx(Me,{fullWidth:!0,onClick:w,children:f?"Copied ✓":"Copy address"})]}):i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:We.headline,children:"Top up agent wallet."}),i.jsxs("p",{className:We.sub,children:["The agent signs transactions with its local wallet and pays gas from it. Send ETH from your connected wallet to keep it running.",v&&` The transfer happens on ${v}.`]}),i.jsxs("div",{className:We.addrBlock,children:[i.jsxs("div",{className:We.addrRow,children:[i.jsx("span",{className:We.addrLabel,children:"From"}),i.jsx("code",{className:We.addrValue,children:p?cx(p):"no wallet connected"})]}),i.jsx("div",{className:We.addrDivider,"aria-hidden":!0}),i.jsxs("div",{className:We.addrRow,children:[i.jsx("span",{className:We.addrLabel,children:"To · agent wallet"}),i.jsx("code",{className:We.addrValue,children:cx(n.address)})]})]}),i.jsxs("label",{className:We.field,children:[i.jsx("span",{className:We.fieldLabel,children:"Amount"}),i.jsxs("div",{className:We.amountWrap,children:[i.jsx("input",{type:"text",inputMode:"decimal",className:We.amountInput,value:o,autoFocus:!0,onChange:A=>a(A.target.value)}),i.jsx("span",{className:We.amountUnit,children:"ETH"})]})]}),u&&i.jsx("p",{className:We.error,children:u}),i.jsx(Me,{fullWidth:!0,onClick:x,disabled:c||!y,children:c?"Check wallet…":"Send"})]})]})]})})}const nfe="_section_1ihbw_5",rfe="_head_1ihbw_11",sfe="_eyebrow_1ihbw_17",ofe="_loading_1ihbw_25",afe="_health_1ihbw_32",ife="_healthDot_1ihbw_38",cfe="_healthOk_1ihbw_39",lfe="_healthWarn_1ihbw_41",ufe="_chainList_1ihbw_45",dfe="_chainCard_1ihbw_50",ffe="_chainCardActive_1ihbw_59",hfe="_chainCardHead_1ihbw_63",pfe="_chainMeta_1ihbw_70",mfe="_chainName_1ihbw_76",gfe="_chainTag_1ihbw_85",yfe="_chainTagActive_1ihbw_91",bfe="_chainEndpoint_1ihbw_98",vfe="_chainEndpointMissing_1ihbw_107",wfe="_edit_1ihbw_111",_fe="_editBtn_1ihbw_165",xfe="_listLabel_1ihbw_200",kfe="_optionList_1ihbw_234",Cfe="_optionRow_1ihbw_242",jfe="_optionRowActive_1ihbw_265",Sfe="_optionBody_1ihbw_293",Afe="_optionNameRow_1ihbw_294",Efe="_optionName_1ihbw_294",Nfe="_optionTag_1ihbw_302",Ife="_optionTagMuted_1ihbw_308",Mfe="_optionSub_1ihbw_314",Bfe="_optionRadio_1ihbw_320",Tfe="_optionRadioOn_1ihbw_327",Pfe="_fieldBlock_1ihbw_340",Rfe="_fieldLabel_1ihbw_341",Lfe="_field_1ihbw_340",Dfe="_fieldIcon_1ihbw_355",Ofe="_fieldInput_1ihbw_356",Ffe="_fieldOk_1ihbw_362",$fe="_fieldNote_1ihbw_363",zfe="_howBlock_1ihbw_371",qfe="_howTrigger_1ihbw_372",Ufe="_howTriggerIcon_1ihbw_381",Hfe="_howTriggerText_1ihbw_382",Wfe="_howChevron_1ihbw_388",Vfe="_howChevronOpen_1ihbw_392",Gfe="_howPanel_1ihbw_393",Kfe="_howPanelOpen_1ihbw_394",Qfe="_howPanelInner_1ihbw_395",Yfe="_howSteps_1ihbw_403",Jfe="_howStepNum_1ihbw_405",Xfe="_howStepText_1ihbw_410",Zfe="_howLink_1ihbw_411",ehe="_editActions_1ihbw_423",the="_cancelBtn_1ihbw_428",nhe="_saveBtn_1ihbw_440",me={section:nfe,head:rfe,eyebrow:sfe,loading:ofe,health:afe,healthDot:ife,healthOk:cfe,healthWarn:lfe,chainList:ufe,chainCard:dfe,chainCardActive:ffe,chainCardHead:hfe,chainMeta:pfe,chainName:mfe,chainTag:gfe,chainTagActive:yfe,chainEndpoint:bfe,chainEndpointMissing:vfe,edit:wfe,editBtn:_fe,listLabel:xfe,optionList:kfe,optionRow:Cfe,optionRowActive:jfe,optionBody:Sfe,optionNameRow:Afe,optionName:Efe,optionTag:Nfe,optionTagMuted:Ife,optionSub:Mfe,optionRadio:Bfe,optionRadioOn:Tfe,fieldBlock:Pfe,fieldLabel:Rfe,field:Lfe,fieldIcon:Dfe,fieldInput:Ofe,fieldOk:Ffe,fieldNote:$fe,howBlock:zfe,howTrigger:qfe,howTriggerIcon:Ufe,howTriggerText:Hfe,howChevron:Wfe,howChevronOpen:Vfe,howPanel:Gfe,howPanelOpen:Kfe,howPanelInner:Qfe,howSteps:Yfe,howStepNum:Jfe,howStepText:Xfe,howLink:Zfe,editActions:ehe,cancelBtn:the,saveBtn:nhe};async function rhe(){const e=await fetch("/api/onboard/state");if(!e.ok)throw new Error(`onboard/state ${e.status}`);return e.json()}async function she({rpcUrl:e,chainId:t}){const n=await fetch("/api/onboard/save-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rpcUrl:e,chainId:t})});if(!n.ok)throw new Error(`save-config ${n.status}`);return n.json()}const ohe="An RPC is the connection your dashboard uses to read the blockchain and broadcast transactions — like a phone line to the network. Sail talks to the chain directly through it; there's no Sail server in between. A free Alchemy/Infura key (or a public endpoint) works.",ahe=[{id:8453,name:"Base",kind:"mainnet"},{id:42161,name:"Arbitrum",kind:"mainnet"},{id:130,name:"Unichain",kind:"mainnet"},{id:84532,name:"Base Sepolia",kind:"testnet"}],lx=[{id:"alchemy",name:"Alchemy",tag:"Recommended",needsKey:!0,desc:"Free tier, reliable for automation. The Sailor default.",keyHint:"Paste your Alchemy API key",url:"https://dashboard.alchemy.com/apps",urlLabel:"Open Alchemy dashboard",steps:["Create a free account at alchemy.com.",'Click "Create new app" and pick this network.',"Open the app and copy the API key from the top of the page.","Paste it above — one key works across every network."]},{id:"infura",name:"Infura",needsKey:!0,desc:"Free tier. A solid alternative to Alchemy.",keyHint:"Paste your Infura project key",url:"https://app.infura.io/dashboard",urlLabel:"Open Infura dashboard",steps:["Sign up free at infura.io.",'Open "API Keys" and click "Create new API key".',"Under Endpoints, enable this network.","Copy the key and paste it above."]},{id:"custom",name:"Custom / Public",needsKey:!1,desc:"Paste any RPC URL — a public endpoint, your own node, or a private provider."}],ihe={8453:"base-mainnet.g.alchemy.com",42161:"arb-mainnet.g.alchemy.com",130:"unichain-mainnet.g.alchemy.com",84532:"base-sepolia.g.alchemy.com"},che={8453:"base-mainnet.infura.io",42161:"arbitrum-mainnet.infura.io",130:"unichain-mainnet.infura.io",84532:"base-sepolia.infura.io"},B1={8453:"https://mainnet.base.org",42161:"https://arb1.arbitrum.io/rpc",130:"https://mainnet.unichain.org",84532:"https://sepolia.base.org"};function ux(e,t,n){if(e==="infura"){const r=che[t];return r?`https://${r}/v3/${n}`:""}if(e==="alchemy"){const r=ihe[t];return r?`https://${r}/v2/${n}`:""}return n}function dx(e){return!e||/alchemy\.com/i.test(e)?"alchemy":/infura\.io/i.test(e)?"infura":"custom"}function lhe(e){if(!e)return"";const t=e.match(/^(https?:\/\/[^/]+)(\/.*\/)([^/]+)$/);if(!t)return e;const[,n,r,s]=t,o=s.length>6?`${s.slice(0,4)}••••`:"••••";return`${n}${r}${o}`}function uhe({chainId:e,rpcUrl:t,isActive:n,onSaved:r}){const s=ahe.find(j=>j.id===e),[o,a]=S.useState(!1),[c,l]=S.useState("alchemy"),[u,d]=S.useState(""),[f,h]=S.useState(""),[p,m]=S.useState(!1),[g,_]=S.useState(!1),[b,y]=S.useState(!1);function v(){const j=dx(t);l(j),d(""),h(j==="custom"?t??"":B1[e]??""),m(!1),a(!0)}async function w(){let j;c==="custom"?j=f.trim():c==="alchemy"&&u.trim()?j=ux("alchemy",e,u.trim()):c==="infura"&&u.trim()?j=ux("infura",e,u.trim()):j=t,j&&(_(!0),await she({rpcUrl:j,chainId:e}),_(!1),y(!0),setTimeout(()=>y(!1),1600),a(!1),r==null||r())}const x=lx.find(j=>j.id===c),A=(x==null?void 0:x.needsKey)??!1,C=c==="custom"?f.trim().startsWith("http"):!A||u.trim().length>=12||!!t;return i.jsxs("div",{className:`${me.chainCard} ${n?me.chainCardActive:""}`,children:[i.jsxs("div",{className:me.chainCardHead,children:[i.jsxs("div",{className:me.chainMeta,children:[i.jsxs("span",{className:me.chainName,children:[i.jsx(Dp,{chainId:e,size:16}),(s==null?void 0:s.name)??`Chain ${e}`,(s==null?void 0:s.kind)==="testnet"&&i.jsx("span",{className:me.chainTag,children:"testnet"}),n&&i.jsx("span",{className:me.chainTagActive,children:"active"})]}),!o&&i.jsx("span",{className:me.chainEndpoint,children:t?lhe(t):i.jsx("span",{className:me.chainEndpointMissing,children:"Not configured"})})]}),!o&&i.jsx("button",{type:"button",className:me.editBtn,onClick:v,children:b?"Saved ✓":t?"Edit":"Add"})]}),o&&i.jsxs("div",{className:me.edit,children:[i.jsx("span",{className:me.listLabel,children:"Provider"}),i.jsx("ul",{className:me.optionList,children:lx.map(j=>{const E=c===j.id;return i.jsx("li",{children:i.jsxs("button",{type:"button",className:`${me.optionRow} ${E?me.optionRowActive:""}`,onClick:()=>{l(j.id),j.id==="custom"&&h(t??B1[e]??"")},"aria-pressed":E,children:[i.jsxs("span",{className:me.optionBody,children:[i.jsxs("span",{className:me.optionNameRow,children:[i.jsx("span",{className:me.optionName,children:j.name}),j.tag&&i.jsx("span",{className:me.optionTag,children:j.tag}),!j.needsKey&&i.jsx("span",{className:me.optionTagMuted,children:"URL"})]}),i.jsx("span",{className:me.optionSub,children:j.desc})]}),i.jsx("span",{className:`${me.optionRadio} ${E?me.optionRadioOn:""}`,"aria-hidden":!0})]})},j.id)})}),A&&i.jsxs("div",{className:me.fieldBlock,children:[i.jsxs("label",{className:me.fieldLabel,htmlFor:`rpc-key-${e}`,children:[x.name," API key"]}),i.jsxs("div",{className:me.field,children:[i.jsx("span",{className:me.fieldIcon,"aria-hidden":!0,children:i.jsx(fhe,{})}),i.jsx("input",{id:`rpc-key-${e}`,type:"text",className:me.fieldInput,placeholder:t&&dx(t)===c?"•••••••••• (keep current)":x.keyHint,value:u,spellCheck:!1,autoComplete:"off",onChange:j=>d(j.target.value)}),u.trim().length>=12&&i.jsx("span",{className:me.fieldOk,"aria-hidden":!0,children:i.jsx(fx,{})})]}),i.jsxs("p",{className:me.fieldNote,children:["Stored in ",i.jsx("code",{children:".sail/.env.local"}),". Never sent to Sail."]}),i.jsxs("div",{className:me.howBlock,children:[i.jsxs("button",{type:"button",className:me.howTrigger,onClick:()=>m(j=>!j),"aria-expanded":p,children:[i.jsx("span",{className:me.howTriggerIcon,"aria-hidden":!0,children:i.jsx(phe,{})}),i.jsxs("span",{className:me.howTriggerText,children:["Where do I find my ",x.name," key?"]}),i.jsx("span",{className:`${me.howChevron} ${p?me.howChevronOpen:""}`,"aria-hidden":!0,children:i.jsx(mhe,{})})]}),i.jsx("div",{className:`${me.howPanel} ${p?me.howPanelOpen:""}`,"aria-hidden":!p,children:i.jsxs("div",{className:me.howPanelInner,children:[i.jsx("ol",{className:me.howSteps,children:x.steps.map((j,E)=>i.jsxs("li",{children:[i.jsx("span",{className:me.howStepNum,children:String(E+1).padStart(2,"0")}),i.jsx("span",{className:me.howStepText,children:j})]},E))}),i.jsxs("a",{className:me.howLink,href:x.url,target:"_blank",rel:"noreferrer",children:[x.urlLabel,i.jsx(ghe,{})]})]})})]})]}),!A&&i.jsxs("div",{className:me.fieldBlock,children:[i.jsx("label",{className:me.fieldLabel,htmlFor:`rpc-url-${e}`,children:"RPC URL"}),i.jsxs("div",{className:me.field,children:[i.jsx("span",{className:me.fieldIcon,"aria-hidden":!0,children:i.jsx(hhe,{})}),i.jsx("input",{id:`rpc-url-${e}`,type:"text",className:me.fieldInput,placeholder:B1[e]??"https://your-rpc-endpoint",value:f,spellCheck:!1,autoComplete:"off",onChange:j=>h(j.target.value)}),f.trim().startsWith("http")&&i.jsx("span",{className:me.fieldOk,"aria-hidden":!0,children:i.jsx(fx,{})})]}),i.jsxs("p",{className:me.fieldNote,children:["Stored in ",i.jsx("code",{children:".sail/.env.local"})," as ",i.jsxs("code",{children:["RPC_URL_",e]}),"."]})]}),i.jsxs("div",{className:me.editActions,children:[i.jsx("button",{type:"button",className:me.cancelBtn,onClick:()=>a(!1),disabled:g,children:"Cancel"}),i.jsx("button",{type:"button",className:me.saveBtn,onClick:w,disabled:g||!C,children:g?"Saving…":"Save"})]})]})]})}function dhe({deployedChains:e}){const[t,n]=S.useState(null);function r(){rhe().then(n).catch(()=>{})}if(S.useEffect(()=>{r()},[]),!t)return i.jsxs("div",{className:me.section,children:[i.jsx("span",{className:me.eyebrow,children:"RPC /"}),i.jsx("span",{className:me.loading,children:"Reading configuration…"})]});const s=t.rpcByChain??{},o=t.chainId??8453,a=e&&e.length>0?e:[o],c=a.filter(l=>s[l]).length;return i.jsxs("div",{className:me.section,children:[i.jsxs("div",{className:me.head,children:[i.jsxs("span",{className:me.eyebrow,children:["RPC / ",i.jsx($H,{label:"What is an RPC?",children:ohe})]}),i.jsxs("span",{className:`${me.health} ${c>0?me.healthOk:me.healthWarn}`,children:[i.jsx("span",{className:me.healthDot,"aria-hidden":!0}),c>0?`${c} network${c>1?"s":""} configured`:"No networks configured"]})]}),i.jsx("div",{className:me.chainList,children:a.map(l=>i.jsx(uhe,{chainId:l,rpcUrl:s[l]??null,isActive:!!s[l],onSaved:r},l))})]})}function fhe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"5.5",cy:"5.5",r:"3"}),i.jsx("path",{d:"M7.6 7.6l5 5M11 11l1.4-1.4M9.4 9.4l1.4-1.4"})]})}function hhe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M6.5 9.5a3.5 3.5 0 0 0 5 0l1.5-1.5a3.5 3.5 0 0 0-5-5L7.5 3.5"}),i.jsx("path",{d:"M9.5 6.5a3.5 3.5 0 0 0-5 0L3 8a3.5 3.5 0 0 0 5 5l.5-.5"})]})}function fx(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})}function phe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":!0,children:[i.jsx("circle",{cx:"8",cy:"8",r:"6"}),i.jsx("path",{d:"M8 7.2v3.4",strokeLinecap:"round"}),i.jsx("circle",{cx:"8",cy:"5.2",r:"0.8",fill:"currentColor",stroke:"none"})]})}function mhe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 5l4 4 4-4"})})}function ghe(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 9 L9 5"}),i.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}const yhe={ethereum:"eth",arbitrum:"arb1",base:"base",unichain:"unichain",optimism:"oeth",polygon:"matic"},mr={1:"ethereum",42161:"arbitrum",8453:"base",130:"unichain",10:"optimism",137:"polygon",84532:"base sepolia"};function bhe(e,t){return`https://app.safe.global/home?safe=${yhe[e]??"eth"}:${t}`}function qp(e,t){const n={arbitrum:`https://arbiscan.io/address/${t}`,ethereum:`https://etherscan.io/address/${t}`,base:`https://basescan.org/address/${t}`,unichain:`https://uniscan.xyz/address/${t}`,optimism:`https://optimistic.etherscan.io/address/${t}`,polygon:`https://polygonscan.com/address/${t}`};return n[e]??n.ethereum}function vhe(e,t){return`${qp(e,t)}#code`}function br(e){return!e||e.length<12?e??"":`${e.slice(0,6)}…${e.slice(-4)}`}function tA(e){return e?`${e.slice(0,10)}...${e.slice(-7)}`:""}const whe={SharedBoundedSwapPermission:e=>[`Maximum swap size: $${Number(e.maxSwapValueUsd??0).toLocaleString()} USD per transaction`,`Maximum slippage: ${Number(e.maxSlippageBps??0)/100}%`,`Allowed input tokens: ${(e.allowedInputTokens??[]).join(", ")}`,`Allowed output tokens: ${(e.allowedOutputTokens??[]).join(", ")}`,`Allowed protocols: ${(e.allowedProtocols??[]).join(", ")}`],SharedTransferTargetPermission:e=>[`ERC-20 transfers restricted to ${(e.allowedRecipients??[]).length} approved recipient(s)`,`Applies to: ${(e.allowedTokens??[]).length===0?"all tokens":(e.allowedTokens??[]).join(", ")}`,`Approved recipients: ${(e.allowedRecipients??[]).join(", ")}`]};function _he(e){const t=whe[e==null?void 0:e.template];if(!t)return[];try{return t(e.params??{})}catch{return[]}}function nA(e){try{const t=new Date(e),n=t.toLocaleDateString([],{month:"short",day:"numeric"}),r=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return`${n}, ${r}`}catch{return e??""}}const xhe={"create-sma":"Create Safe (SMA)","deploy-mandate":"Deploy mandate","register-permission":"Register permission","attach-mandate":"Attach mandate","set-delegate":"Set agent as manager","arbitrary-tx":"Arbitrary transaction"},khe={1:"Ethereum",10:"Optimism",137:"Polygon",8453:"Base",42161:"Arbitrum One",130:"Unichain",84532:"Base Sepolia"},Che={dispatch_executed:"executed dispatch",dispatch_approved:"approved dispatch",dispatch_denied:"denied dispatch",tick_start:"tick started",tick_end:"tick ended",error:"error",log:"log",permission_registered:"registered permission",permission_revoked:"revoked permission",owner_signed:"signed in wallet",owner_rejected:"rejected signing",sma_created:"created Safe (SMA)",mandate_deployed:"deployed mandate",mandate_attached:"attached mandate"},jhe=new Set(["dispatch_executed","dispatch_approved","owner_signed","sma_created","mandate_deployed","mandate_attached","permission_registered"]),She=new Set(["dispatch_denied","error","owner_rejected","permission_revoked"]);function Ahe(e){return jhe.has(e)?"success":She.has(e)?"rejected":"info"}function hx(e){return e.actor==="owner"?"owner":"agent"}const Ehe={owner:"Owner",agent:"Agent"};function Nhe(e){return e.type==="owner_signed"||e.type==="owner_rejected"?e.title??e.reason??e.kind??"":e.type==="sma_created"?br(e.sma):e.type==="mandate_deployed"||e.type==="mandate_attached"?e.name??br(e.address??e.permission):e.type==="permission_registered"||e.type==="permission_revoked"?e.name??br(e.permission):e.permission?br(e.permission):e.reason??e.msg??""}function Ihe(e){const t=Number(e??0);return Number.isFinite(t)?t===0?"0":t<1e-4?t.toFixed(6):t.toFixed(t<1?5:4):"—"}const px={ok:{label:"Funded"},low:{label:"Low gas balance"},critical:{label:"Empty"}},Mhe={manager:{label:"Manager",sub:"Pays gas for every dispatch."},owner:{label:"Owner",sub:"Holds the Safe and signs mandates."},permissionSigner:{label:"Permission signer",sub:"Authorizes which mandates apply."}};function Bhe({chainOverview:e,liveMandates:t,sma:n,onNewMandate:r,onAddSigner:s,onRotateSigner:o,onRevoke:a}){const c=e.chainId,l=e.network??mr[c]??null,u=l?l.charAt(0).toUpperCase()+l.slice(1):`Chain ${c}`,d=e.mandates??[],f=new Map(d.map(m=>[m.name??m.template,m.address])),h=t.length>0?t:d.map(m=>({chainId:c,registeredOnChain:!0,permissions:[{template:m.name??m.template??"Unknown permission",params:{}}]})),p=h.reduce((m,g)=>m+(g.permissions??[]).length,0);return i.jsxs("div",{className:P.chainSection,children:[i.jsxs("div",{className:P.chainSectionHeader,children:[i.jsxs("span",{className:P.chainSectionBadge,children:[i.jsx(Dp,{chainId:c,size:14}),u]}),e.onchainError&&i.jsx("span",{className:P.chainSectionMeta,children:"RPC unavailable"})]}),i.jsxs("section",{className:P.mandatesSection,"aria-label":`${u} mandates`,children:[i.jsxs("header",{className:P.mandatesSectionHead,children:[i.jsxs("h2",{className:P.mandatesSectionTitle,children:[i.jsx(P2,{}),"Your Mandates"]}),i.jsx("span",{className:P.mandatesSectionMeta,children:p>0?`${p} permission${p===1?"":"s"}${e.onchain?" · on-chain":""}`:"No permissions yet"})]}),i.jsx("div",{className:P.mandateList,children:h.length>0?h.map((m,g)=>i.jsx(sA,{mandate:m,network:l,addressByTemplate:f,onRevoke:a},m.signedAt??g)):i.jsx(oA,{onClick:r})})]}),i.jsxs("section",{className:P.signersSection,"aria-label":`${u} account details`,children:[i.jsxs("header",{className:P.mandatesSectionHead,children:[i.jsxs("h2",{className:P.mandatesSectionTitle,children:[i.jsx(lA,{}),"Your Wallets"]}),i.jsx("span",{className:P.mandatesSectionMeta,children:e.onchain?"live balances · refill when low":"Add RPC URL to enable balance tracking"})]}),i.jsx(rA,{overview:e,sma:n,onAddSigner:s,onRotateSigner:o})]})]})}function The({mandates:e,network:t,onchain:n,onRevoke:r}){return i.jsxs("div",{className:P.mandateRows,children:[e.map(s=>i.jsx(Phe,{mandate:s,network:t,onRevoke:r},s.address)),i.jsx("div",{className:P.mandateRowsFoot,children:n?`Reflecting the kernel's live permission set${t?` on ${t}`:""}.`:"Last known set — on-chain confirmation unavailable."})]})}function Phe({mandate:e,network:t,onRevoke:n}){const r=e.name??e.template??"Unrecognized permission",s=!!(e.name??e.template);return i.jsxs("article",{className:`${P.mandateRow} ${s?"":P.mandateRowUnknown}`,children:[i.jsx("span",{className:P.mandateRowIcon,"aria-hidden":!0,children:s?i.jsx(cA,{}):i.jsx(P2,{})}),i.jsxs("span",{className:P.mandateRowBody,children:[i.jsx("span",{className:P.mandateRowName,children:r}),i.jsx("span",{className:P.mandateRowAddr,children:e.address})]}),n&&i.jsx("button",{type:"button",className:P.mandateRowRevoke,onClick:()=>n(e),"aria-label":`Revoke ${r}`,children:"Revoke"}),i.jsx("a",{className:P.mandateRowOpen,href:qp(t??e.network,e.address),target:"_blank",rel:"noreferrer","aria-label":"Open permission contract on block explorer",children:i.jsx(qi,{})})]})}function rA({overview:e,sma:t,onAddSigner:n,onRotateSigner:r}){var p,m;const{address:s}=Oe(),o=(e==null?void 0:e.signers)??[],a=((m=(p=e==null?void 0:e.sma)==null?void 0:p.owner)==null?void 0:m.toLowerCase())??null;let c=!1,l=!1;const u=o.flatMap(g=>{var _,b;if(g.role==="manager"&&((_=g.managers)==null?void 0:_.length)>0){let y=g.managers;g.address&&!y.some(w=>{var x;return((x=w.address)==null?void 0:x.toLowerCase())===g.address.toLowerCase()})&&(y=[{address:g.address,balanceEth:g.balanceEth,isActive:!0},...y]);const v=[];for(const w of y){if(a&&((b=w.address)==null?void 0:b.toLowerCase())===a){c=!0,w.isActive&&(l=!0);continue}v.push({...g,address:w.address,balanceEth:w.balanceEth,status:w.isActive?g.status:"idle",managers:void 0,activeManager:w.isActive})}return v}return g.role==="manager"&&g.address&&a&&g.address.toLowerCase()===a?(c=!0,["local","unconfigured","idle"].includes(g.status)||(l=!0),[]):[g]}),d=u.findIndex(g=>g.role==="owner");if(d!==-1)u[d]={...u[d],isManager:c,managerActive:l};else if(c&&a){const g=o.find(_=>_.role==="manager");u.push({role:"owner",address:e.sma.owner,balanceEth:(g==null?void 0:g.balanceEth)??null,status:g==null?void 0:g.status,isManager:!0,managerActive:l})}const f=!!(e!=null&&e.rpcConfigured)&&!(e!=null&&e.onchain);let h=u;return f&&s&&!h.some(g=>{var _;return((_=g.address)==null?void 0:_.toLowerCase())===s.toLowerCase()})&&(h=[...h,{role:"owner",address:s,balanceEth:null,status:void 0}]),h.length===0?i.jsxs("div",{className:P.signersOffline,children:[i.jsx("p",{className:P.signersOfflineMsg,children:(e==null?void 0:e.rpcConfigured)===!1||e!=null&&e.onchainError?"Add RPC_URL to .sail/.env.local to see balances.":"Reading balances…"}),t&&i.jsx(Me,{variant:"secondary",onClick:n,children:"Add agent wallet"})]}):i.jsx("div",{className:P.signerGrid,children:h.map(g=>i.jsx(Rhe,{signer:g,network:e.network,chainId:e.chainId,loading:f,onAddSigner:n,onRotateSigner:r},g.address?`${g.role}:${g.address}`:g.role))})}function Rhe({signer:e,network:t,chainId:n,loading:r,onAddSigner:s,onRotateSigner:o}){const[a,c]=S.useState(!1),[l,u]=S.useState(!1),d=e.role==="sma"?{label:"SMA",sub:"Holds your funds. Native ETH shown; tokens not counted."}:Mhe[e.role]??{label:e.role,sub:""},f=e.status==="unconfigured",h=e.status==="local",p=e.status==="idle",m=e.role==="manager"&&(e.activeManager!==void 0?e.activeManager:!h&&!f&&!p),g=e.role==="owner"&&e.isManager,_=e.role==="owner"&&e.managerActive,b=(m||_)&&o,y=e.role==="sma"||f||h||p?null:px[e.status]??px.ok,v=h&&e.balanceEth!=null?Number(e.balanceEth):null,w=e.balanceEth!=null?Number(e.balanceEth):null,x=!!r&&!f&&e.balanceEth==null,A=!f&&!p&&e.role!=="sma"&&w===0,C=e.status==="critical"||A,j=!x&&(e.status==="low"||C||h&&(v===null||v<.002));function E(){var I;(I=navigator==null?void 0:navigator.clipboard)!=null&&I.writeText&&navigator.clipboard.writeText(e.address),c(!0),setTimeout(()=>c(!1),1400)}return i.jsxs("article",{className:`${P.signerCard} ${j?P.signerCardWarn:""} ${C?P.signerCardCrit:""}`,children:[i.jsxs("header",{className:P.signerCardHead,children:[i.jsxs("span",{className:P.signerRoleWrap,children:[i.jsx("span",{className:P.signerRole,children:d.label}),!x&&m&&i.jsx("span",{className:P.activeTag,title:"Registered as this SMA's delegated signer on-chain",children:"Active"})]}),x?i.jsxs("span",{className:`${P.balancePill} ${P.balancePillLoading}`,children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0}),"Reading…"]}):i.jsxs(i.Fragment,{children:[_?i.jsxs("span",{className:P.balancePill,style:{color:"#1990FF"},title:"This EOA is also registered as the SMA's delegated manager on-chain",children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0,style:{background:"#1990FF"}}),"Active manager"]}):g?i.jsxs("span",{className:P.balancePill,style:{color:"var(--text-secondary)"},title:"This EOA is a known manager for this SMA, not currently active on-chain",children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0,style:{background:"rgba(255,255,255,0.25)"}}),"Manager"]}):null,p&&i.jsxs("span",{className:P.balancePill,style:{color:"var(--text-secondary)"},children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0,style:{background:"rgba(255,255,255,0.25)"}}),"Idle"]}),y&&i.jsxs("span",{className:`${P.balancePill} ${P[`balancePill_${e.status}`]??""}`,children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0}),y.label]}),h&&i.jsxs("span",{className:P.balancePill,style:{color:"var(--text-secondary)"},children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0,style:{background:"var(--accent-blue)"}}),"Not registered"]})]})]}),i.jsxs("div",{className:P.signerBalance,children:[!f&&i.jsx("span",{className:P.ethGlyph,"aria-hidden":!0,children:i.jsx(npe,{})}),f?i.jsx("span",{className:P.signerBalanceNum,style:{opacity:.4},children:"—"}):x?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:`${P.signerBalanceNum} ${P.signerBalanceNumLoading}`,"aria-label":"Loading balance",children:"0.0000"}),i.jsx("span",{className:`${P.signerBalanceUnit} ${P.signerBalanceNumLoading}`,children:"ETH"})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:P.signerBalanceNum,children:Ihe(e.balanceEth)}),i.jsx("span",{className:P.signerBalanceUnit,children:"ETH"})]})]}),i.jsx("p",{className:P.signerSub,children:f?"No agent wallet assigned yet — create or import one to let your agent sign.":h?"Local key — not yet delegated.":p?"Known manager — not currently active on-chain.":d.sub}),f&&i.jsx(Me,{fullWidth:!0,variant:"secondary",onClick:s,children:"Add agent wallet"}),e.address&&i.jsxs("footer",{className:P.signerFoot,children:[i.jsxs("button",{type:"button",className:P.signerAddrPill,onClick:E,title:e.address,"aria-label":"Copy signer address",children:[i.jsx("span",{className:P.signerAddrMono,children:br(e.address)}),i.jsx("span",{className:P.signerAddrIcon,"aria-hidden":!0,children:a?i.jsx(T2,{}):i.jsx(iA,{})})]}),i.jsx("a",{className:P.signerAddrOpen,href:qp(t,e.address),target:"_blank",rel:"noreferrer","aria-label":"Open on block explorer",children:i.jsx(qi,{})})]}),b&&i.jsx("button",{type:"button",className:P.signerRotateBtn,onClick:()=>o(),children:"Rotate manager"}),e.role==="manager"&&p&&o&&i.jsx("button",{type:"button",className:P.signerRotateBtn,onClick:()=>o(e.address),children:"Rotate to this"}),i.jsx("div",{className:P.signerSpacer}),j&&i.jsxs("div",{className:P.signerTopUp,children:[i.jsx("span",{className:P.signerTopUpMsg,children:C?"Out of gas — agent is stalled.":"Running low — top up soon."}),i.jsx("button",{type:"button",className:P.signerFundBtn,onClick:()=>u(!0),children:"Fund Gas"})]}),i.jsx(tfe,{open:l,onClose:()=>u(!1),signer:e,network:t,chainId:n})]})}function sA({mandate:e,network:t,addressByTemplate:n,onRevoke:r}){const s=(e==null?void 0:e.permissions)??[],o=e!=null&&e.registeredOnChain?"active":"pending",a=e!=null&&e.signedAt?new Date(e.signedAt).toLocaleDateString():"",c=(()=>{const u=t??(e!=null&&e.chainId?mr[e.chainId]:null);return u?u.charAt(0).toUpperCase()+u.slice(1):null})(),l=r?(()=>{const u=new Set;return s.map(d=>({name:d.template,address:n==null?void 0:n.get(d.template)})).filter(d=>{if(!d.address)return!1;const f=d.address.toLowerCase();return u.has(f)?!1:(u.add(f),!0)})})():[];return i.jsxs("article",{className:P.mandateSummary,children:[i.jsxs("header",{className:P.mandateSummaryHead,children:[i.jsxs("div",{className:P.mandateSummaryHeadText,children:[i.jsxs("span",{className:P.mandateSummaryKicker,children:["Live mandate",a?` · signed ${a}`:""]}),i.jsx("h3",{className:P.mandateSummaryTitle,children:c?`Mandate · ${c}`:"Mandate"})]}),i.jsxs("div",{className:P.mandateSummaryHeadRight,children:[i.jsx(Bu,{status:o}),i.jsxs("span",{className:P.mandateSummaryCount,children:[s.length," permission",s.length===1?"":"s"]})]})]}),i.jsx("ul",{className:P.mandateSummaryPerms,children:s.map((u,d)=>{const f=n==null?void 0:n.get(u.template),h=i.jsxs("span",{className:P.mandateSummaryPermBody,children:[i.jsx("span",{className:P.mandateSummaryPermLabel,children:u.template}),(u.explanation?String(u.explanation).split("; "):_he(u)).map((p,m)=>i.jsx("span",{className:P.mandateSummaryPermSub,children:p},m))]});return i.jsxs("li",{className:P.mandateSummaryPermRow,children:[i.jsx("span",{className:P.mandateSummaryCheck,"aria-hidden":!0,children:i.jsx(cA,{})}),f?i.jsxs("a",{className:P.mandateSummaryPermLink,href:vhe(c,f),target:"_blank",rel:"noreferrer",title:f,children:[h,i.jsx("span",{className:P.mandateSummaryPermArrow,"aria-hidden":!0,children:i.jsx(qi,{})})]}):h]},`${u.template}-${d}`)})}),i.jsxs("footer",{className:P.mandateSummaryFoot,children:[i.jsx("span",{className:P.mandateSummaryFootMeta,children:o==="active"?"Registered on-chain":"Signed — awaiting on-chain registration"}),l.length>0&&i.jsx("button",{type:"button",className:P.mandateRevokeBtn,onClick:()=>r(l),children:"Revoke permission"})]})]})}const mx={arbitrum:e=>`https://arbiscan.io/tx/${e}`,ethereum:e=>`https://etherscan.io/tx/${e}`,base:e=>`https://basescan.org/tx/${e}`,optimism:e=>`https://optimistic.etherscan.io/tx/${e}`,polygon:e=>`https://polygonscan.com/tx/${e}`};function Lhe(e,t){return(mx[e]??mx.ethereum)(t)}const Dhe=[{key:"all",label:"All"},{key:"owner",label:"Owner"},{key:"agent",label:"Agent"}];function Ohe(e,t=new Map){const n=[];let r=null;for(const s of e){const o=s.chainId??(s.permission?t.get(s.permission.toLowerCase())??null:null);s.type==="tick_start"?(r={kind:"tick",startTs:s.ts,endTs:null,durationMs:null,logs:[],complete:!1,chainIds:new Set},o&&r.chainIds.add(o)):s.type==="tick_end"&&r?(o&&r.chainIds.add(o),r.endTs=s.ts,r.durationMs=new Date(s.ts)-new Date(r.startTs),r.complete=!0,n.push(r),r=null):s.type==="log"&&r?s.msg&&r.logs.push(s.msg):s.type!=="tick_start"&&s.type!=="tick_end"&&s.type!=="log"?(r&&(o&&r.chainIds.add(o),n.push(r),r=null),n.push({kind:"event",event:{...s,chainId:o}})):r&&o&&r.chainIds.add(o)}return r&&n.push({kind:"tick",...r}),n.reverse()}function Fhe(e){return e?e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`:""}function $he({tick:e,positions:t}){const[n,r]=S.useState(!1),s=!e.complete,o=e.logs.find(d=>d.includes("hold")||d.includes("below threshold")),a=e.logs.find(d=>d.includes("rebalance")||d.includes("deposit")||d.includes("withdraw")),c=e.logs.find(d=>d.startsWith("portfolio:")),l=a??o??c??e.logs[0]??(s?"Running…":"Tick complete"),u=(t==null?void 0:t.reduce((d,f)=>d+(f.valueUsd??0),0))??null;return i.jsxs("li",{className:P.tickCard,children:[i.jsxs("button",{type:"button",className:P.tickCardHead,onClick:()=>r(d=>!d),"aria-expanded":n,children:[i.jsx("span",{className:`${P.tickDot} ${s?P.tickDotLive:""}`,"aria-hidden":!0}),i.jsxs("span",{className:P.tickMeta,children:[i.jsx("span",{className:P.tickTime,children:nA(e.startTs)}),e.durationMs!=null&&i.jsx("span",{className:P.tickDuration,children:Fhe(e.durationMs)})]}),i.jsx("span",{className:P.tickHeadline,children:l}),u!=null&&i.jsxs("span",{className:P.tickValue,children:["$",u.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),i.jsx("span",{className:P.tickChevron,"aria-hidden":!0,children:n?"▴":"▾"})]}),n&&i.jsxs("div",{className:P.tickBody,children:[e.logs.map((d,f)=>i.jsx("p",{className:P.tickLog,children:d},f)),t&&t.length>0&&i.jsx("div",{className:P.tickPositions,children:t.map(d=>i.jsxs("div",{className:P.tickPosition,children:[i.jsx("span",{className:P.tickPositionToken,children:(d.token??"token").toUpperCase()}),i.jsxs("span",{className:P.tickPositionValue,children:["$",(d.valueUsd??0).toFixed(2)]}),d.protocol&&i.jsx("span",{className:P.tickPositionProto,children:d.protocol})]},d.vaultAddress))})]})]})}function zhe({source:e,pid:t,pids:n}){const[r,s]=S.useState(!1),o=S.useRef(null);S.useEffect(()=>{if(!r)return;const l=u=>{o.current&&!o.current.contains(u.target)&&s(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]);const a=e==="remote"?"remote agent":e==="github-actions"?"github actions":"Running",c=e==="local"&&n.length>0;return i.jsxs("div",{className:P.agentSourceWrap,ref:o,children:[i.jsxs("button",{type:"button",className:`${P.agentRunningBadge} ${c?P.agentRunningBadgeClickable:""}`,onClick:()=>c&&s(l=>!l),"aria-haspopup":c?"true":void 0,"aria-expanded":r,children:[i.jsx("span",{className:P.agentRunningDot,"aria-hidden":!0}),a,c&&i.jsx("svg",{className:`${P.agentSourceChevron} ${r?P.agentSourceChevronOpen:""}`,width:"8",height:"8",viewBox:"0 0 8 8",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M1.5 3L4 5.5L6.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&i.jsx("div",{className:P.agentSourcePanel,children:n.map(({chainId:l,pid:u})=>{const d=l?mr[l]??`chain ${l}`:"unknown chain";return i.jsxs("div",{className:P.agentSourceRow,children:[i.jsx("span",{className:P.agentSourceChain,children:d}),i.jsxs("span",{className:P.agentSourcePid,children:["PID ",u]})]},l??u)})})]})}function qhe({deployedChains:e,chainFilter:t,onChainFilterChange:n}){return e.length<=1?null:i.jsxs("div",{className:P.activityFilter,role:"tablist","aria-label":"Filter by chain",style:{marginBottom:14},children:[i.jsx("button",{type:"button",role:"tab","aria-selected":t==="all",className:`${P.activityFilterBtn} ${t==="all"?P.activityFilterBtnActive:""}`,onClick:()=>n("all"),children:"All chains"}),e.map(r=>{const s=mr[r],o=s?s.charAt(0).toUpperCase()+s.slice(1):`Chain ${r}`;return i.jsx("button",{type:"button",role:"tab","aria-selected":t===String(r),className:`${P.activityFilterBtn} ${t===String(r)?P.activityFilterBtnActive:""}`,onClick:()=>n(String(r)),children:o},r)})]})}function Uhe({events:e,positions:t,network:n,permToChain:r=new Map,chainFilter:s="all",actorFilter:o="all"}){const[c,l]=S.useState(8);S.useEffect(()=>{l(8)},[o,s]);const d=Ohe(e,r).filter(m=>{var b;const g=o==="all"||(m.kind==="tick"?o==="agent":hx(m.event)===o),_=s==="all"||(m.kind==="tick"?(b=m.chainIds)==null?void 0:b.has(Number(s)):m.event.chainId===Number(s));return g&&_}),f=d.slice(0,c),h=d.length>c,p=[o!=="all"?o:null,s!=="all"?mr[Number(s)]??s:null].filter(Boolean).join(" · ");return i.jsx(i.Fragment,{children:f.length===0?i.jsx("div",{className:P.emptyAgents,children:i.jsxs("p",{className:P.emptyAgentsBody,children:["No ",p?`${p} `:"","activity yet."]})}):i.jsxs(i.Fragment,{children:[i.jsx("ul",{className:`${Ie.journalList} ${P.tickList}`,children:f.map((m,g)=>{if(m.kind==="tick")return i.jsx($he,{tick:m,positions:t},`tick-${m.startTs}-${g}`);const _=m.event,b=Ahe(_.type),y=hx(_),v=_.txHash&&_.txHash!=="0x",w=Nhe(_);return i.jsx("li",{children:i.jsxs("div",{className:Ie.journalRow,children:[i.jsx("span",{className:Ie.journalTime,children:nA(_.ts)}),i.jsxs("span",{className:`${Ie.journalMark} ${Ie[`jStatus_${b}`]??""}`,"aria-hidden":!0,children:[b==="success"&&i.jsx(T2,{}),b==="rejected"&&i.jsx(Xhe,{}),b==="info"&&i.jsx(Zhe,{})]}),i.jsxs("span",{className:Ie.journalBody,children:[i.jsxs("span",{className:Ie.journalTitle,children:[i.jsx("span",{className:`${P.activityActor} ${P[`activityActor_${y}`]??""}`,children:Ehe[y]}),i.jsx("span",{className:Ie.journalAction,children:Che[_.type]??_.type})]}),i.jsxs("span",{className:Ie.journalMeta,children:[w,v&&i.jsxs(i.Fragment,{children:[w?" · ":"",i.jsx("a",{href:Lhe(n??"ethereum",_.txHash),target:"_blank",rel:"noreferrer",children:br(_.txHash)})]})]})]})]})},`${_.ts}-${g}`)})}),h&&i.jsx("div",{style:{marginTop:"12px",textAlign:"center"},children:i.jsx("button",{type:"button",onClick:()=>l(m=>m+10),style:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px",border:"1px solid #3a3f4a",background:"transparent",color:"#9aa0ae",cursor:"pointer"},children:"Load more"})})]})})}let ff=null;function gx(){try{if(JSON.parse(localStorage.getItem("sail.account")??"null"))return{hasAccount:!0}}catch{}return null}function T1(){const[e,t]=S.useState(()=>ff??gx()),[n,r]=S.useState(()=>ff!==null||gx()!==null),{draft:s}=S2(),[o,a]=S.useState(!1);function c(){fetch("/api/onboard/state").then(u=>u.json()).then(u=>{ff=u,t(u),r(!0)}).catch(()=>r(!0))}function l(){const u={...e??{},hasAccount:!0};ff=u,t(u),r(!0),c()}return S.useEffect(()=>{c()},[]),S.useEffect(()=>{if(e!=null&&e.hasAccount)return;const u=setInterval(c,2e3);return()=>clearInterval(u)},[e==null?void 0:e.hasAccount]),n?!(e!=null&&e.hasAccount)&&!o?i.jsx(qoe,{onboardState:e,onComplete:l,onSkip:()=>a(!0)}):i.jsx(Hhe,{draft:s,onReset:c,wizardSkipped:o}):i.jsx("div",{className:`${De.pageShell} ${P.shell}`,children:i.jsx(N2,{})})}function Hhe({draft:e,onReset:t,wizardSkipped:n}){var R2,L2,D2,O2,F2,$2,z2,q2,U2,H2;const{isConnected:r,address:s}=Oe(),{disconnect:o}=Tc(),{openConnectModal:a}=Oa(),[c,l]=S.useState(0),[u,d]=S.useState(!1),[f,h]=S.useState(!1),[p,m]=S.useState(null),[g,_]=S.useState(null),{account:b,loading:y}=dd(c),{accounts:v}=fK(c),{overview:w}=pK(c),{overviews:x}=vK(c),A=new Map;for(const J of x)for(const Ee of J.mandates??[])Ee.address&&A.set(Ee.address.toLowerCase(),J.chainId);const{mandates:C}=Fp(c),{events:j}=kS(c),{positions:E}=bK(c),{running:I,pid:T,pids:O,source:B}=mK(),{pending:U}=gK(),[L,N]=S.useState(()=>{try{return JSON.parse(localStorage.getItem("sail.account")??"null")}catch{return null}}),[H,M]=S.useState(!1),[$,W]=S.useState(!1),[ie,de]=S.useState(!1),[ye,z]=S.useState(!1),[se,ge]=S.useState(!1),[xe,je]=S.useState(null),[Ue,Fe]=S.useState(null),[Ze,Nn]=S.useState(null),[Mt,In]=S.useState("all"),[Ot,dn]=S.useState("all"),[pd,md]=S.useState({}),[gd,Oc]=S.useState(!1),[yd,Fc]=S.useState(""),$a=(R2=w==null?void 0:w.sma)!=null&&R2.address?{safe:w.sma.address,owner:w.sma.owner,permissionSigner:w.sma.permissionSigner,manager:w.sma.manager,chainId:w.chainId}:null,re=$a??b??L,Ke=re!=null,Ft=(w==null?void 0:w.mandates)??[],Po=(D2=(L2=$a??b)==null?void 0:L2.safe)==null?void 0:D2.toLowerCase(),jr=C.filter(J=>J.safe!=null?J.safe.toLowerCase()===Po:v.length<=1),$c=jr.length>0,uA=$c||I,zc=re?mr[re.chainId]??"ethereum":null,He=re?{id:"live-sma",name:"My SMA",address:re.safe,network:zc}:null,Sr=(re==null?void 0:re.owner)??s??null,$t=v.find(J=>J.active)??v[0]??null,Ro=(()=>{const J=new Set(($t==null?void 0:$t.deployedChains)??[]);for(const Ee of x)(Ee==null?void 0:Ee.chainId)!=null&&J.add(Number(Ee.chainId));return($t==null?void 0:$t.chainId)!=null&&J.add(Number($t.chainId)),[...J].filter(Ee=>Number.isFinite(Ee)&&Ee>0)})(),bd=Ro.length>1,vd=pd[($t==null?void 0:$t.safe)??"live-sma"]??($t==null?void 0:$t.name)??(He==null?void 0:He.name)??"My SMA",za=($t==null?void 0:$t.safe)??(re==null?void 0:re.safe)??"live-sma",dA=v.length>0?(()=>{var Ee;const J=new Map;for(const yt of v){const Yr=yt.safe.toLowerCase(),ir=mr[yt.chainId]??"ethereum",mA=((Ee=yt.safe)==null?void 0:Ee.toLowerCase())===(za==null?void 0:za.toLowerCase()),W2=yt.deployedChains?yt.deployedChains.map(qa=>mr[qa]??"ethereum").filter(Boolean):null;if(!J.has(Yr))J.set(Yr,{id:yt.safe,name:pd[yt.safe]??yt.name??"My SMA",address:yt.safe,network:ir,networks:W2??[ir],mandateCount:mA?bd&&x.length>0?x.reduce((qa,Up)=>qa+(Up.mandateCount??0),0):(w==null?void 0:w.mandateCount)??0:0,createdAt:yt.addedAt??null});else{const qa=J.get(Yr),Up=W2??[ir];for(const V2 of Up)qa.networks.includes(V2)||qa.networks.push(V2)}}return[...J.values()]})():He?[{...He,name:vd,networks:Ro.length>0?Ro.map(J=>mr[J]??"ethereum").filter(Boolean):[zc],mandateCount:bd&&x.length>0?x.reduce((J,Ee)=>J+(Ee.mandateCount??0),0):(w==null?void 0:w.mandateCount)??0,createdAt:null}]:[],fA=He?bhe(He.network,He.address):"#",hA=He?`https://debank.com/profile/${He.address}`:"#";function pA(){var J;He&&((J=navigator==null?void 0:navigator.clipboard)!=null&&J.writeText&&navigator.clipboard.writeText(He.address),M(!0),setTimeout(()=>M(!1),1400))}return i.jsxs("div",{className:`${De.pageShell} ${P.shell}`,children:[i.jsx(N2,{}),i.jsxs("header",{className:P.header,children:[i.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[i.jsx("button",{type:"button",className:P.brand,onClick:()=>{window.location.hash="#/dashboard"},"aria-label":"Go to dashboard",children:i.jsx(Dt,{size:48,animate:!0})}),i.jsx(ace,{})]}),i.jsxs("div",{className:P.topActionsPill,children:[i.jsx(Yhe,{pending:U,draft:e,open:ie,onToggle:()=>de(J=>!J),onClose:()=>de(!1),onOpenStation:()=>{de(!1),window.location.hash="#/station"},onOpenSigning:()=>{de(!1),window.location.hash="#/station"}}),i.jsxs("button",{type:"button",className:P.avatarBtn,onClick:r?()=>z(!0):a,"aria-label":r&&Sr?`Profile (${br(Sr)})`:"Connect wallet",title:r&&Sr?Sr:void 0,children:[i.jsx("span",{className:P.avatarBtnMonogram,"aria-hidden":!0,children:r&&Sr?Sr.slice(2,4).toUpperCase():"—"}),i.jsx("span",{className:P.avatarBtnAddr,children:r&&Sr?br(Sr):"Not connected"})]})]})]}),i.jsx("main",{className:Ie.main,children:r&&Ke&&s&&(re!=null&&re.owner)&&s.toLowerCase()!==re.owner.toLowerCase()?i.jsx(Whe,{projectOwner:re.owner,connectedAddress:s,onReset:async()=>{await fetch("/api/account",{method:"DELETE"}).catch(()=>{}),t()},onConnect:a}):r?!Ke&&y?i.jsx(Vhe,{}):Ke?i.jsxs(i.Fragment,{children:[e&&B2(e)>0&&i.jsx(Khe,{draft:e,onReview:()=>{window.location.hash="#/station"}}),U.length>0&&i.jsx(Qhe,{count:U.length,onReview:()=>{window.location.hash="#/station"}}),i.jsxs("section",{className:Ie.titleBlock,children:[i.jsxs("div",{className:P.titleHeadFlex,children:[gd?i.jsx("input",{className:P.titleNameInput,value:yd,autoFocus:!0,maxLength:40,onChange:J=>Fc(J.target.value),onBlur:()=>{const J=yd.trim();J&&J!==vd&&(md(Ee=>({...Ee,[za]:J})),F6(za,J).catch(()=>{}),l(Ee=>Ee+1)),Oc(!1)},onKeyDown:J=>{J.key==="Enter"&&J.target.blur(),J.key==="Escape"&&Oc(!1)}}):i.jsxs("button",{type:"button",className:P.titleNameBtn,onClick:()=>{Fc(vd),Oc(!0)},title:"Click to rename",children:[i.jsx("h1",{className:Ie.title,children:vd}),i.jsx(tpe,{})]}),(w==null?void 0:w.sma)&&i.jsxs("div",{className:P.smaBadges,children:[(Ro.length>0?Ro.map(J=>({id:J,name:mr[J]})).filter(J=>J.name):w.network?[{id:w.chainId,name:w.network}]:[]).map(J=>i.jsxs("span",{className:P.smaBadge,children:[J.id!=null&&i.jsx(Dp,{chainId:J.id,size:13}),J.name]},J.name)),i.jsx(Bu,{status:I?"active":"paused",kind:"agent"}),B&&i.jsx(zhe,{source:B,pid:T,pids:O})]})]}),i.jsx("div",{className:Ie.addrRow,children:i.jsxs("button",{type:"button",className:Ie.addrPill,onClick:pA,"aria-label":"Copy SMA address",title:He==null?void 0:He.address,children:[i.jsx("span",{className:Ie.addrMono,children:tA(He==null?void 0:He.address)}),i.jsx("span",{className:Ie.addrIcon,"aria-hidden":!0,children:H?i.jsx(T2,{}):i.jsx(iA,{})}),i.jsx("a",{href:qp(He==null?void 0:He.network,He==null?void 0:He.address),target:"_blank",rel:"noreferrer",className:Ie.addrOpen,onClick:J=>J.stopPropagation(),"aria-label":"Open SMA on block explorer",children:i.jsx(qi,{})})]})})]}),i.jsxs("section",{className:`${Ie.quickLinks} ${P.quickLinksLarge}`,"aria-label":"Quick links",children:[i.jsxs("a",{className:`${Ie.quickLink} ${P.quickLinkLarge}`,href:hA,target:"_blank",rel:"noreferrer",children:[i.jsxs("span",{className:Ie.qlText,children:[i.jsx("span",{className:`${Ie.qlTitle} ${P.qlTitleLarge}`,children:"View portfolio"}),i.jsx("span",{className:Ie.qlSub,children:"opens DeBank"})]}),i.jsx("span",{className:Ie.qlArrow,"aria-hidden":!0,children:i.jsx(qi,{})})]}),i.jsxs("a",{className:`${Ie.quickLink} ${P.quickLinkLarge}`,href:fA,target:"_blank",rel:"noreferrer",children:[i.jsxs("span",{className:Ie.qlText,children:[i.jsx("span",{className:`${Ie.qlTitle} ${P.qlTitleLarge}`,children:"Manage SMA"}),i.jsx("span",{className:Ie.qlSub,children:"opens Safe"})]}),i.jsx("span",{className:Ie.qlArrow,"aria-hidden":!0,children:i.jsx(qi,{})})]})]}),bd&&x.length>0?x.map(J=>{var yt,Yr;const Ee=C.filter(ir=>(ir.safe==null||ir.safe.toLowerCase()===Po)&&ir.chainId===J.chainId);return i.jsx(Bhe,{chainOverview:J,liveMandates:Ee,sma:He,onNewMandate:()=>je({variant:"new",context:"mandate"}),onAddSigner:()=>d(!0),onRotateSigner:J!=null&&J.kernel&&((yt=J==null?void 0:J.sma)!=null&&yt.address)?ir=>{_({sma:J.sma.address,kernel:J.kernel,chainId:J.chainId,owner:J.sma.owner,currentManager:J.sma.manager,mandates:J.mandates??[]}),m(ir??null),h(!0)}:void 0,onRevoke:J!=null&&J.kernel&&((Yr=J==null?void 0:J.sma)!=null&&Yr.address)?ir=>{Nn({sma:J.sma.address,kernel:J.kernel,chainId:J.chainId}),Fe(ir)}:void 0},J.chainId)}):i.jsxs(i.Fragment,{children:[i.jsxs("section",{className:P.mandatesSection,"aria-label":"Your mandates",children:[i.jsxs("header",{className:P.mandatesSectionHead,children:[i.jsxs("h2",{className:P.mandatesSectionTitle,children:[i.jsx(P2,{}),i.jsx("span",{className:P.sectionNum,children:"01 /"}),"Your Mandates"]}),i.jsx("span",{className:P.mandatesSectionMeta,children:Ft.length>0?`${Ft.length} permission${Ft.length===1?"":"s"}${w!=null&&w.onchain?" · attached on-chain":""}`:$c?`${jr.reduce((J,Ee)=>J+(Ee.permissions??[]).length,0)} permission${jr.reduce((J,Ee)=>J+(Ee.permissions??[]).length,0)===1?"":"s"} · live`:"No permissions registered yet"})]}),i.jsx("div",{className:P.mandateList,children:$c?(()=>{const J=new Map(Ft.map(Ee=>[Ee.name??Ee.template,Ee.address]));return jr.map((Ee,yt)=>{var Yr;return i.jsx(sA,{mandate:Ee,network:zc,addressByTemplate:J,onRevoke:w!=null&&w.kernel&&((Yr=w==null?void 0:w.sma)!=null&&Yr.address)?Fe:void 0},Ee.signedAt??yt)})})():Ft.length>0?i.jsx(The,{mandates:Ft,network:(w==null?void 0:w.network)??zc,onchain:w==null?void 0:w.onchain,onRevoke:w!=null&&w.kernel&&((O2=w==null?void 0:w.sma)!=null&&O2.address)?Fe:void 0}):i.jsx(oA,{onClick:()=>je({variant:"new",context:"mandate"})})})]}),i.jsxs("section",{className:P.signersSection,"aria-label":"Accounts details",children:[i.jsxs("header",{className:P.mandatesSectionHead,children:[i.jsxs("h2",{className:P.mandatesSectionTitle,children:[i.jsx(lA,{}),i.jsx("span",{className:P.sectionNum,children:"02 /"}),"Your Wallets"]}),i.jsx("span",{className:P.mandatesSectionMeta,children:w!=null&&w.onchain?"live balances · refill when low":"Add RPC URL to enable balance tracking"})]}),i.jsx(rA,{overview:w,sma:He,onAddSigner:()=>d(!0),onRotateSigner:w!=null&&w.kernel&&((F2=w==null?void 0:w.sma)!=null&&F2.address)?J=>{_({sma:w.sma.address,kernel:w.kernel,chainId:w.chainId,owner:w.sma.owner,currentManager:w.sma.manager,mandates:w.mandates??[]}),m(J??null),h(!0)}:void 0})]})]}),i.jsx("section",{className:Ie.card,children:i.jsx(dhe,{deployedChains:Ro})}),i.jsxs("section",{className:Ie.card,children:[i.jsxs("header",{className:Ie.cardHead,children:[i.jsxs("div",{className:Ie.cardHeadText,children:[i.jsxs("h2",{className:P.mandatesSectionTitle,children:[i.jsx(epe,{}),!bd&&i.jsx("span",{className:P.sectionNum,children:"03 /"}),"Recent Activity"]}),i.jsx("p",{className:Ie.cardSub,children:"Click any event to see the agent's reasoning and evidence."})]}),i.jsx("div",{className:P.activityFilter,role:"tablist","aria-label":"Filter by actor",children:Dhe.map(J=>i.jsx("button",{type:"button",role:"tab","aria-selected":Ot===J.key,className:`${P.activityFilterBtn} ${Ot===J.key?P.activityFilterBtnActive:""}`,onClick:()=>dn(J.key),children:J.label},J.key))})]}),i.jsx(qhe,{deployedChains:Ro,chainFilter:Mt,onChainFilterChange:In}),j.length>0?i.jsx(Uhe,{events:j,positions:E,network:zc,permToChain:A,chainFilter:Mt,actorFilter:Ot}):i.jsx("div",{className:P.emptyAgents,children:i.jsx("p",{className:P.emptyAgentsBody,children:uA?i.jsxs(i.Fragment,{children:["No activity yet — run ",i.jsx("code",{children:"sailor run"})," to start"]}):"Activity from your agents will appear here."})})]}),i.jsxs("footer",{className:P.localFootnote,children:[i.jsx("span",{className:P.localFootnoteDot,"aria-hidden":!0}),"Running locally at ",i.jsx("code",{children:window.location.host})," · project state lives in"," ",i.jsx("code",{children:".sail/"}),". There is no Sail-hosted backend; your wallet talks to the chain directly."]})]}):i.jsx(Ghe,{onCreate:()=>ge(!0),initialShowImport:n,onImport:J=>{N(J);try{localStorage.setItem("sail.account",JSON.stringify(J))}catch{}fetch("/api/account",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}).catch(()=>{}),l(Ee=>Ee+1)},ownerAddr:Sr}):i.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"center",padding:"40px 24px"},children:i.jsx(xS,{eyebrow:"DASHBOARD",title:"Connect to view your SMA.",sub:"Connect the owner wallet you used to set up this project."})})}),i.jsx(A2,{open:!!xe,variant:xe==null?void 0:xe.variant,context:xe==null?void 0:xe.context,mandate:xe==null?void 0:xe.mandate,onClose:()=>je(null)}),i.jsx(jS,{open:ye,wallet:Sr,safes:dA,currentSafeId:za,hasSMA:Ke,onClose:()=>z(!1),onDisconnect:()=>{z(!1),N(null);try{localStorage.removeItem("sail.account")}catch{}o()},onCreateSMA:()=>{z(!1),ge(!0)},onImportSMA:J=>{N(J);try{localStorage.setItem("sail.account",JSON.stringify(J))}catch{}fetch("/api/account",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}).catch(()=>{}),l(Ee=>Ee+1),z(!1)},onRenameSafe:(J,Ee)=>{md(yt=>({...yt,[J]:Ee})),F6(J,Ee).catch(()=>{}),l(yt=>yt+1)},onSelectSafe:async J=>{try{await hK(J.address)}catch{}l(Ee=>Ee+1),z(!1)}}),i.jsx(Ide,{open:u,safe:($2=w==null?void 0:w.sma)==null?void 0:$2.address,onClose:()=>d(!1),onCreated:()=>{d(!1),l(J=>J+1)}}),i.jsx(Rde,{open:f,sma:(g==null?void 0:g.sma)??((z2=w==null?void 0:w.sma)==null?void 0:z2.address),kernel:(g==null?void 0:g.kernel)??(w==null?void 0:w.kernel),chainId:(g==null?void 0:g.chainId)??(w==null?void 0:w.chainId),owner:(g==null?void 0:g.owner)??((q2=w==null?void 0:w.sma)==null?void 0:q2.owner),currentManager:(g==null?void 0:g.currentManager)??((U2=w==null?void 0:w.sma)==null?void 0:U2.manager),mandates:(g==null?void 0:g.mandates)??(w==null?void 0:w.mandates)??[],initialTo:p,onClose:()=>{h(!1),m(null),_(null)},onRotated:()=>l(J=>J+1)}),i.jsx(_ue,{open:se,onClose:()=>ge(!1),onComplete:J=>{if(J){N(J);try{localStorage.setItem("sail.account",JSON.stringify(J))}catch{}}ge(!1)}}),i.jsx(Xue,{open:Ue!=null,mandate:Array.isArray(Ue)?void 0:Ue,permissions:Array.isArray(Ue)?Ue:void 0,sma:(Ze==null?void 0:Ze.sma)??((H2=w==null?void 0:w.sma)==null?void 0:H2.address),kernel:(Ze==null?void 0:Ze.kernel)??(w==null?void 0:w.kernel),chainId:(Ze==null?void 0:Ze.chainId)??(w==null?void 0:w.chainId),onClose:()=>{Fe(null),Nn(null)},onRevoked:()=>{Fe(null),Nn(null)}})]})}function Whe({projectOwner:e,connectedAddress:t,onReset:n,onConnect:r}){const[s,o]=S.useState(!1);return i.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"center",padding:"40px 24px"},children:i.jsxs("div",{style:{maxWidth:440,width:"100%",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:20,padding:"36px 32px",display:"flex",flexDirection:"column",gap:16},children:[i.jsx("span",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.14em",textTransform:"uppercase",color:"rgba(255,165,0,0.7)"},children:"Wrong wallet"}),i.jsx("h2",{style:{margin:0,fontSize:22,fontWeight:600,color:"#fff",lineHeight:1.2},children:"This project belongs to a different wallet."}),i.jsxs("p",{style:{margin:0,fontSize:14,color:"rgba(255,255,255,0.5)",lineHeight:1.6},children:["Project owner: ",i.jsx("code",{style:{fontSize:12,color:"rgba(255,255,255,0.75)"},children:br(e)}),i.jsx("br",{}),"Connected: ",i.jsx("code",{style:{fontSize:12,color:"rgba(255,255,255,0.75)"},children:br(t)})]}),i.jsx("p",{style:{margin:0,fontSize:13,color:"rgba(255,255,255,0.4)",lineHeight:1.5},children:"Connect the owner wallet to manage this SMA, or reset to start a new project with the current wallet."}),i.jsxs("div",{style:{display:"flex",gap:10,marginTop:4},children:[i.jsx(Me,{onClick:r,style:{flex:1},children:"Switch wallet"}),i.jsx("button",{type:"button",disabled:s,onClick:async()=>{o(!0),await n()},style:{flex:1,padding:"10px 16px",borderRadius:12,fontSize:14,fontWeight:500,color:"rgba(255,255,255,0.5)",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",cursor:s?"default":"pointer"},children:s?"Resetting…":"Reset project"})]})]})})}function Vhe(){return i.jsxs("section",{className:P.noSMAHero,children:[i.jsx("div",{className:P.noSMAMascot,"aria-hidden":!0,children:i.jsx(Dt,{size:64,animate:!0})}),i.jsx("h2",{className:P.noSMATitle,children:"Loading your project…"}),i.jsxs("p",{className:P.noSMASub,children:["Reading local state from ",i.jsx("code",{children:".sail/"}),"."]})]})}function Ghe({onCreate:e,onImport:t,ownerAddr:n,initialShowImport:r}){const[s,o]=S.useState(r??!1),[a,c]=S.useState(!1),[l,u]=S.useState(""),[d,f]=S.useState("8453"),[h,p]=S.useState(""),{safes:m,scanning:g,done:_}=CS(n,s&&!a);function b(v,w){t==null||t({safe:v,owner:n??v,permissionSigner:n??v,manager:n??v,chainId:w,createdAtBlock:"0"})}function y(){const v=l.trim();if(!/^0x[0-9a-fA-F]{40}$/.test(v)){p("Enter a valid 0x address.");return}const w=Number(d);if(!w){p("Enter a valid chain ID.");return}b(v,w)}return i.jsxs("section",{className:P.noSMAHero,children:[i.jsx("div",{className:P.noSMAMascot,"aria-hidden":!0,children:i.jsx(Dt,{size:64,animate:!0})}),i.jsxs("div",{className:P.noSMAStatus,children:[i.jsx("span",{className:P.noSMAStatusDot,"aria-hidden":!0}),"No SMA yet"]}),i.jsx("h2",{className:P.noSMATitle,children:"Your wallet is connected."}),i.jsx("p",{className:P.noSMASub,children:"Create a new Separately Managed Account for your AI to operate — you only pay gas when there’s something for it to do — or import an existing Safe you already own."}),s?a?i.jsxs("div",{className:P.noSMAImport,children:[i.jsx("input",{className:P.noSMAImportInput,type:"text",placeholder:"Safe address 0x…",value:l,onChange:v=>{u(v.target.value),p("")},spellCheck:!1}),i.jsx("input",{className:P.noSMAImportInput,type:"text",placeholder:"Chain ID e.g. 8453",value:d,onChange:v=>{f(v.target.value),p("")}}),h&&i.jsx("span",{className:P.noSMAImportErr,children:h}),i.jsxs("div",{className:P.noSMAImportActions,children:[i.jsx(Me,{onClick:y,children:"Import SMA"}),i.jsx("button",{type:"button",className:P.noSMAImportLink,onClick:()=>{c(!1),p("")},children:"Back to discovered Safes"})]})]}):i.jsxs("div",{className:P.noSMAImport,children:[g&&m.length===0&&i.jsxs("span",{className:P.noSMAImportScan,children:["Scanning for Safes owned by ",br(n),"…"]}),m.length>0&&i.jsx("ul",{className:P.importSafeList,children:m.map(v=>i.jsx("li",{children:i.jsxs("button",{type:"button",className:P.importSafeRow,onClick:()=>b(v.safe,v.chainId),children:[i.jsx("span",{className:P.importSafeAddr,children:tA(v.safe)}),i.jsx("span",{className:P.importSafeNet,children:mr[v.chainId]??`chain ${v.chainId}`})]})},`${v.chainId}-${v.safe}`))}),_&&m.length===0&&i.jsx("span",{className:P.noSMAImportScan,children:"No Safes found for this wallet on supported chains."}),i.jsxs("div",{className:P.noSMAImportActions,children:[i.jsx("button",{type:"button",className:P.noSMAImportLink,onClick:()=>c(!0),children:"Enter an address manually"}),i.jsx("button",{type:"button",className:P.noSMAImportLink,onClick:()=>o(!1),children:"Cancel"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:P.noSMACta,children:i.jsx(Me,{onClick:e,children:"Create your first agent"})}),i.jsx("button",{type:"button",className:P.noSMAImportLink,onClick:()=>o(!0),children:"Already have a Safe? Import it as your SMA"})]}),i.jsx("p",{className:P.noSMAFine,children:"Self-custody. Sail never holds your keys."})]})}function B2(e){return((e==null?void 0:e.permissions)??(e==null?void 0:e.items)??[]).length}function Khe({draft:e,onReview:t}){const n=B2(e);return i.jsxs("button",{type:"button",className:`${P.pendingBanner} ${P.pendingBannerDraft}`,onClick:t,"aria-label":"Review pending mandate draft",children:[i.jsx("span",{className:P.pendingBannerPulse,"aria-hidden":!0}),i.jsxs("span",{className:P.pendingBannerBody,children:[i.jsx("span",{className:P.pendingBannerKicker,children:"Mandate draft ready"}),i.jsxs("span",{className:P.pendingBannerTitle,children:[i.jsx("strong",{children:n})," permission",n===1?"":"s"," queued — sign or reject"]})]})]})}function Qhe({count:e,onReview:t}){return i.jsxs("button",{type:"button",className:P.pendingBanner,onClick:t,"aria-label":`Review ${e} pending mandates`,children:[i.jsx("span",{className:P.pendingBannerPulse,"aria-hidden":!0}),i.jsxs("span",{className:P.pendingBannerBody,children:[i.jsx("span",{className:P.pendingBannerKicker,children:"Awaiting your signature"}),i.jsxs("span",{className:P.pendingBannerTitle,children:[i.jsx("strong",{children:e})," mandate",e===1?"":"s"," ready to authorize"]})]}),i.jsxs("span",{className:P.pendingBannerCta,children:["Review",i.jsx(aA,{})]})]})}function oA({onClick:e}){return i.jsxs("button",{type:"button",className:P.newMandateTile,onClick:e,children:[i.jsx("span",{className:P.newMandateTilePlus,"aria-hidden":!0,children:"+"}),i.jsxs("span",{className:P.newMandateTileText,children:[i.jsx("span",{className:P.newMandateTileLabel,children:"Register a permission"}),i.jsx("span",{className:P.newMandateTileHint,children:"Draft one with your AI — sign each permission individually."})]})]})}function Yhe({pending:e,draft:t,open:n,onToggle:r,onClose:s,onOpenStation:o,onOpenSigning:a}){const c=S.useRef(null);S.useEffect(()=>{if(!n)return;function f(p){c.current&&!c.current.contains(p.target)&&s()}function h(p){p.key==="Escape"&&s()}return document.addEventListener("mousedown",f),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",h)}},[n,s]);const l=B2(t),u=l>0,d=e.length+(u?1:0);return i.jsxs("div",{className:P.notifWrap,ref:c,children:[i.jsxs("button",{type:"button",className:`${P.notifBtn} ${d>0?P.notifBtnLive:""}`,onClick:r,"aria-label":d>0?`${d} pending signatures`:"Pending signatures","aria-expanded":n,children:[i.jsx(Jhe,{}),d>0&&i.jsx("span",{className:P.notifBadge,children:d})]}),n&&i.jsxs("div",{className:P.notifPanel,role:"menu",children:[i.jsxs("header",{className:P.notifPanelHead,children:[i.jsx("span",{className:P.notifPanelTitle,children:"Pending signatures"}),i.jsx("span",{className:P.notifPanelCount,children:d===0?"none":`${d} waiting`})]}),d===0?i.jsx("div",{className:P.notifEmpty,children:i.jsxs("p",{className:P.notifEmptyBody,children:["Nothing to approve right now. When your agent needs a signature it appears here — start it with ",i.jsx("code",{children:"sailor station start"}),"."]})}):i.jsxs("ul",{className:P.notifList,children:[u&&i.jsx("li",{children:i.jsxs("button",{type:"button",className:P.notifItem,onClick:a,children:[i.jsxs("span",{className:P.notifItemTop,children:[i.jsx("span",{className:P.notifItemKind,children:"Mandate"}),i.jsx("span",{className:P.notifItemType,children:"signature"})]}),i.jsx("span",{className:P.notifItemTitle,children:"Permission draft ready"}),i.jsxs("span",{className:P.notifItemDesc,children:[l," permission",l===1?"":"s"," queued — sign or reject"]})]})}),e.map(f=>i.jsx("li",{children:i.jsxs("button",{type:"button",className:P.notifItem,onClick:o,children:[i.jsxs("span",{className:P.notifItemTop,children:[i.jsx("span",{className:P.notifItemKind,children:xhe[f.kind]??f.kind}),i.jsx("span",{className:P.notifItemType,children:f.type==="typed-data"?"signature":"transaction"})]}),i.jsx("span",{className:P.notifItemTitle,children:f.title}),f.description&&i.jsx("span",{className:P.notifItemDesc,children:f.description}),i.jsx("span",{className:P.notifItemMeta,children:khe[f.chainId]??`Chain ${f.chainId}`})]})},f.id))]}),e.length>0&&i.jsxs("button",{type:"button",className:P.notifFootBtn,onClick:o,children:["Open signing station",i.jsx(aA,{})]})]})]})}function Jhe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M4.6 6.2a3.4 3.4 0 016.8 0v2.6c0 .9.3 1.7.9 2.3l.6.7H3.1l.6-.7c.6-.6.9-1.4.9-2.3V6.2z"}),i.jsx("path",{d:"M6.8 12.5a1.4 1.4 0 002.4 0"})]})}function qi(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 9 L9 5"}),i.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}function aA(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 7h8M8 4l3 3-3 3"})})}function iA(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("rect",{x:"2.5",y:"2.5",width:"7",height:"7",rx:"1.6"}),i.jsx("path",{d:"M4 4V3a1 1 0 011-1h4.5a1 1 0 011 1v5a1 1 0 01-1 1H9"})]})}function T2(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})}function cA(){return i.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3.5 8.4l3 3L13 5.2"})})}function Xhe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3.5 3.5l7 7M10.5 3.5l-7 7"})})}function Zhe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"8",height:"8","aria-hidden":!0,children:i.jsx("circle",{cx:"7",cy:"7",r:"3.2",fill:"currentColor"})})}function P2(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M4 2.5h5l3 3v8a.5.5 0 01-.5.5h-7.5a.5.5 0 01-.5-.5v-10a.5.5 0 01.5-.5z"}),i.jsx("path",{d:"M9 2.5v3h3"}),i.jsx("path",{d:"M5.6 9h5M5.6 11.4h5"})]})}function epe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),i.jsx("path",{d:"M8 5v3.2l2.1 1.5"})]})}function lA(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"5.5",cy:"6",r:"2.8"}),i.jsx("path",{d:"M7.7 7.8l4.3 4.3M10.4 10.5l1.2-1.2M12 12.1l1.2-1.2"})]})}function tpe(){return i.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M11.5 2.5a1.414 1.414 0 0 1 2 2L5 13H3v-2L11.5 2.5z"})})}function npe(){return i.jsxs("svg",{viewBox:"0 0 32 32",width:"20",height:"20","aria-hidden":!0,children:[i.jsx("path",{d:"M16 3 7.8 16.6 16 12.9Z",fill:"#1990ff"}),i.jsx("path",{d:"M16 3 24.2 16.6 16 12.9Z",fill:"#1990ff",opacity:"0.55"}),i.jsx("path",{d:"M16 20.2 7.8 16.6 16 12.9Z",fill:"#1990ff",opacity:"0.8"}),i.jsx("path",{d:"M16 20.2 24.2 16.6 16 12.9Z",fill:"#1990ff",opacity:"0.4"}),i.jsx("path",{d:"M16 29 7.8 18.2 16 21.7Z",fill:"#1990ff"}),i.jsx("path",{d:"M16 29 24.2 18.2 16 21.7Z",fill:"#1990ff",opacity:"0.55"})]})}const rpe="_shell_12lj4_8",spe="_header_12lj4_18",ope="_backBtn_12lj4_33",ape="_headerActions_12lj4_60",ipe="_editBtnProvider_12lj4_68",cpe="_headerPauseBtn_12lj4_76",lpe="_headerRevokeBtn_12lj4_77",upe="_headerPauseBtnPaused_12lj4_100",dpe="_headerBtn_12lj4_117",fpe="_headerBtnGhost_12lj4_141",hpe="_headerBtnDanger_12lj4_142",ppe="_main_12lj4_185",mpe="_titleBlock_12lj4_198",gpe="_identityRow_12lj4_204",ype="_body_12lj4_215",bpe="_tierStack_12lj4_230",vpe="_tierCard_12lj4_241",wpe="_tierCardOpen_12lj4_255",_pe="_tierCardDepth_0_12lj4_263",xpe="_tierCardDepth_1_12lj4_264",kpe="_tierCardDepth_2_12lj4_265",Cpe="_tierCardConnector_12lj4_270",jpe="_tierCardHead_12lj4_288",Spe="_tierCardHeadText_12lj4_305",Ape="_tierCardLabel_12lj4_311",Epe="_tierCardPrimary_12lj4_319",Npe="_tierCardSummary_12lj4_330",Ipe="_tierCardChevron_12lj4_337",Mpe="_tierCardChevronOpen_12lj4_354",Bpe="_tierCardBody_12lj4_356",Tpe="_tierGrid_12lj4_369",Ppe="_statusStrip_12lj4_379",Rpe="_statusCell_12lj4_387",Lpe="_statusCellKicker_12lj4_397",Dpe="_statusCellValue_12lj4_405",Ope="_statusCellDot_12lj4_416",Fpe="_statusDot_success_12lj4_423",$pe="_statusDot_warn_12lj4_424",zpe="_statusDot_danger_12lj4_425",qpe="_statusDot_muted_12lj4_426",Upe="_statusCellSub_12lj4_427",Hpe="_gasRow_12lj4_435",Wpe="_gasChain_12lj4_444",Vpe="_gasValue_12lj4_451",Gpe="_actionCard_12lj4_457",Kpe="_actionCard_neutral_12lj4_471",Qpe="_actionCard_warn_12lj4_472",Ype="_actionCard_danger_12lj4_478",Jpe="_actionCardText_12lj4_484",Xpe="_actionCardKicker_12lj4_490",Zpe="_actionCardKicker_warn_12lj4_498",eme="_actionCardKicker_danger_12lj4_499",tme="_actionCardTitle_12lj4_500",nme="_actionCardDescription_12lj4_508",rme="_actionCardAction_12lj4_516",sme="_pauseBtn_12lj4_520",ome="_revokeBtn_12lj4_521",ame="_sidebar_12lj4_541",ime="_statusCard_12lj4_550",cme="_statusList_12lj4_557",lme="_statusRow_12lj4_562",ume="_statusRowProminent_12lj4_573",dme="_statusHead_12lj4_577",fme="_statusHeadProminent_12lj4_583",hme="_statusKicker_12lj4_588",pme="_statusValue_12lj4_596",mme="_statusValueLarge_12lj4_604",gme="_statusDot_12lj4_423",yme="_statusTone_muted_12lj4_622",bme="_statusSub_12lj4_623",vme="_actionsBlock_12lj4_631",wme="_actionsHint_12lj4_636",_me="_hero_12lj4_649",xme="_heroIdentity_12lj4_663",kme="_chainChips_12lj4_676",Cme="_chainChip_12lj4_676",jme="_chainChipDot_12lj4_696",Sme="_statStat_12lj4_712",Ame="_statTone_success_12lj4_722",Eme="_statTone_warn_12lj4_728",Nme="_statTone_danger_12lj4_734",Ime="_statTone_muted_12lj4_740",Mme="_statKicker_12lj4_743",Bme="_statValue_12lj4_751",Tme="_statDot_12lj4_762",Pme="_statDot_success_12lj4_769",Rme="_statDot_warn_12lj4_770",Lme="_statDot_danger_12lj4_771",Dme="_statDot_muted_12lj4_772",Ome="_statSub_12lj4_773",Fme="_heroActions_12lj4_787",$me="_heroActionsHint_12lj4_795",zme="_hierarchy_12lj4_811",qme="_hierStep_12lj4_825",Ume="_hierKicker_12lj4_840",Hme="_hierTitle_12lj4_848",Wme="_hierSub_12lj4_855",Vme="_hierStepActive_12lj4_862",Gme="_hierTone_owner_12lj4_868",Kme="_hierTone_sma_12lj4_869",Qme="_hierArrow_12lj4_872",Yme="_identityName_12lj4_885",Jme="_identityDot_12lj4_886",Xme="_title_12lj4_198",Zme="_summary_12lj4_894",e1e="_chainBlock_12lj4_906",t1e="_chainHeader_12lj4_917",n1e="_chainList_12lj4_922",r1e="_chainStep_12lj4_931",s1e="_chainDepth_0_12lj4_949",o1e="_chainDepth_1_12lj4_950",a1e="_chainDepth_2_12lj4_951",i1e="_chainConnector_12lj4_956",c1e="_chainConnectorSvg_12lj4_965",l1e="_chainStepActive_12lj4_971",u1e="_chainKicker_12lj4_976",d1e="_chainTitle_12lj4_985",f1e="_chainAddress_12lj4_992",h1e="_chainCopyIcon_12lj4_1013",p1e="_sidebarBlock_12lj4_1019",m1e="_sidebarBlockHead_12lj4_1028",g1e="_sidebarKicker_12lj4_1033",y1e="_sidebarBlockTitle_12lj4_1041",b1e="_sidebarBody_12lj4_1048",v1e="_sidebarMeta_12lj4_1053",w1e="_sidebarValue_12lj4_1068",_1e="_sidebarHint_12lj4_1074",x1e="_copyAddress_12lj4_1082",k1e="_copyAddressValue_12lj4_1103",C1e="_copyAddressIcon_12lj4_1104",j1e="_identityLink_12lj4_1114",S1e="_identityHandle_12lj4_1135",A1e="_identityArrow_12lj4_1136",E1e="_networkList_12lj4_1139",N1e="_networkRow_12lj4_1147",I1e="_networkDot_12lj4_1159",M1e="_netDot_ethereum_12lj4_1166",B1e="_netDot_base_12lj4_1167",T1e="_netDot_arbitrum_12lj4_1168",P1e="_netDot_optimism_12lj4_1169",R1e="_netDot_polygon_12lj4_1170",L1e="_networkName_12lj4_1171",D1e="_networkState_12lj4_1172",O1e="_pauseBtnPaused_12lj4_1203",F1e="_content_12lj4_1237",$1e="_section_12lj4_1243",z1e="_sectionAccent_mandate_12lj4_1261",q1e="_sectionKicker_12lj4_1269",U1e="_sectionAccent_permissions_12lj4_1270",H1e="_sectionAccent_identity_12lj4_1279",W1e="_mandateExplainer_12lj4_1291",V1e="_hierarchyHeader_12lj4_1310",G1e="_hierTier_12lj4_1329",K1e="_hierTier_depth_0_12lj4_1341",Q1e="_hierTier_depth_1_12lj4_1342",Y1e="_hierTier_depth_2_12lj4_1343",J1e="_hierTier_depth_3_12lj4_1344",X1e="_hierTier_depth_4_12lj4_1345",Z1e="_hierTier_identity_12lj4_1354",e0e="_hierTier_mandate_12lj4_1360",t0e="_hierTier_permissions_12lj4_1366",n0e="_hierTierActive_12lj4_1375",r0e="_hierTierConnector_12lj4_1385",s0e="_hierTierHead_12lj4_1396",o0e="_hierTierKicker_12lj4_1402",a0e="_hierTierPrimary_12lj4_1414",i0e="_hierTierSecondary_12lj4_1425",c0e="_hierTierChips_12lj4_1433",l0e="_hierTierChip_12lj4_1433",u0e="_hierTierChipMono_12lj4_1454",d0e="_hierTierAddress_12lj4_1488",f0e="_hierTierAddressKicker_12lj4_1514",h0e="_hierTierAddressValue_12lj4_1522",p0e="_hierTierAddressIcon_12lj4_1523",m0e="_sectionHead_12lj4_1538",g0e="_sectionHeadText_12lj4_1544",y0e="_sectionHeadAction_12lj4_1552",b0e="_sectionLink_12lj4_1556",v0e="_collapsibleSection_12lj4_1581",w0e="_collapsibleTrigger_12lj4_1584",_0e="_collapsibleOpen_12lj4_1603",x0e="_collapsibleChevron_12lj4_1607",k0e="_collapsibleChevronOpen_12lj4_1624",C0e="_collapsibleBody_12lj4_1625",j0e="_sectionTitle_12lj4_1639",S0e="_sectionTitleHint_12lj4_1653",A0e="_sectionNote_12lj4_1677",E0e="_subsection_12lj4_1687",N0e="_subsectionHead_12lj4_1696",I0e="_subsectionKicker_12lj4_1701",M0e="_subsectionTitle_12lj4_1709",B0e="_mandateSpec_12lj4_1719",T0e="_specCell_12lj4_1724",P0e="_specKey_12lj4_1733",R0e="_specHintWrap_12lj4_1744",L0e="_specHintIcon_12lj4_1745",D0e="_registryGrid_12lj4_1772",O0e="_gasCell_12lj4_1778",F0e="_gasKicker_12lj4_1787",$0e="_specValRow_12lj4_1808",z0e="_specVal_12lj4_1808",q0e="_specViewBtn_12lj4_1824",U0e="_specValMono_12lj4_1852",H0e="_targetList_12lj4_1858",W0e="_targetRow_12lj4_1866",V0e="_targetLabel_12lj4_1876",G0e="_targetVenue_12lj4_1884",K0e="_targetSep_12lj4_1889",Q0e="_targetSelector_12lj4_1890",Y0e="_targetMeta_12lj4_1902",J0e="_targetHash_12lj4_1911",X0e="_targetConstraint_12lj4_1916",Z0e="_targetTemplate_12lj4_1924",ege="_permRelation_12lj4_1940",tge="_permRelationText_12lj4_1952",nge="_permRelationKicker_12lj4_1958",rge="_permRelationRole_12lj4_1965",sge="_permRelationBody_12lj4_1972",oge="_permRelationLink_12lj4_1982",age="_permRelationHint_12lj4_2005",ige="_permRelationEmpty_12lj4_2015",cge="_agentPermList_12lj4_2030",lge="_agentPermRow_12lj4_2038",uge="_agentPermUsed_12lj4_2049",dge="_agentPermUnused_12lj4_2053",fge="_agentPermRevoked_12lj4_2056",hge="_agentPermLabel_12lj4_2059",pge="_agentPermMark_12lj4_2063",mge="_agentPermBody_12lj4_2081",gge="_agentPermSub_12lj4_2095",yge="_agentPermMeta_12lj4_2100",bge="_agentPermMetaTpl_12lj4_2110",vge="_agentPermMetaSep_12lj4_2114",wge="_agentPermMetaVer_12lj4_2115",_ge="_agentPermTag_12lj4_2116",xge="_scheduleList_12lj4_2143",kge="_scheduleRow_12lj4_2151",Cge="_scheduleRowDisabled_12lj4_2161",jge="_scheduleMain_12lj4_2162",Sge="_scheduleHeadRow_12lj4_2168",Age="_scheduleId_12lj4_2173",Ege="_scheduleMode_12lj4_2180",Nge="_scheduleModeLive_12lj4_2190",Ige="_scheduleModeFork_12lj4_2195",Mge="_scheduleCron_12lj4_2200",Bge="_scheduleRuns_12lj4_2213",Tge="_scheduleToggle_12lj4_2227",Pge="_scheduleToggleOn_12lj4_2246",Rge="_signerShareRow_12lj4_2257",Lge="_signerShareLabel_12lj4_2266",Dge="_signerShareList_12lj4_2271",Oge="_signerShareChip_12lj4_2276",Fge="_receiptGrid_12lj4_2291",$ge="_receiptRow_12lj4_2300",zge="_linkOut_12lj4_2312",qge="_recoQuote_12lj4_2326",Uge="_recoMark_12lj4_2340",Hge="_recoBody_12lj4_2347",Wge="_recoFoot_12lj4_2356",Vge="_pagesList_12lj4_2367",Gge="_pageRow_12lj4_2375",Kge="_pageIcon_12lj4_2390",Qge="_pageBody_12lj4_2404",Yge="_pageTitle_12lj4_2410",Jge="_pageMeta_12lj4_2417",Xge="_pageOpen_12lj4_2425",Zge="_pageNew_12lj4_2445",eye="_pageNewIcon_12lj4_2454",tye="_pageNewBody_12lj4_2466",nye="_pageNewTitle_12lj4_2472",rye="_pageNewSub_12lj4_2479",sye="_pagesEmpty_12lj4_2485",oye="_pagesEmptyIcon_12lj4_2496",aye="_pagesEmptyTitle_12lj4_2509",iye="_pagesEmptySub_12lj4_2516",cye="_activityList_12lj4_2525",lye="_activityRow_12lj4_2533",uye="_activityDot_12lj4_2545",dye="_actDot_exec_12lj4_2551",fye="_actDot_sim_12lj4_2552",hye="_actDot_check_12lj4_2553",pye="_actDot_sys_12lj4_2554",mye="_actDot_auth_12lj4_2555",gye="_activityLabel_12lj4_2556",yye="_activityAgo_12lj4_2557",bye="_activityEmpty_12lj4_2562",vye="_runList_12lj4_2571",wye="_runRow_12lj4_2579",_ye="_runStatus_12lj4_2600",xye="_runStatus_success_12lj4_2610",kye="_runStatus_failed_12lj4_2611",Cye="_runStatus_pending_12lj4_2612",jye="_runId_12lj4_2613",Sye="_runLabel_12lj4_2619",Aye="_runMeta_12lj4_2627",Eye="_runGas_12lj4_2636",Nye="_runAgo_12lj4_2637",Iye="_runChevron_12lj4_2638",Mye="_runFailed_12lj4_2640",Bye="_drawerScrim_12lj4_2643",Tye="_drawerScrimOpen_12lj4_2654",Pye="_drawer_12lj4_2643",Rye="_drawerOpen_12lj4_2672",Lye="_drawerHead_12lj4_2673",Dye="_drawerHeadLeft_12lj4_2680",Oye="_drawerKicker_12lj4_2681",Fye="_drawerTitle_12lj4_2689",$ye="_drawerClose_12lj4_2697",zye="_drawerBody_12lj4_2714",qye="_drawerGrid_12lj4_2722",Uye="_drawerRow_12lj4_2731",Hye="_drawerLink_12lj4_2748",Wye="_drawerStatus_12lj4_2760",Vye="_drawerError_12lj4_2772",Gye="_drawerSection_12lj4_2776",Kye="_drawerSectionTitle_12lj4_2781",Qye="_drawerNote_12lj4_2790",Yye="_drawerLog_12lj4_2797",Jye="_notFound_12lj4_2812",Xye="_notFoundTitle_12lj4_2822",Zye="_notFoundBody_12lj4_2829",ebe="_mandateLinkPill_12lj4_2847",tbe="_titleScope_12lj4_2873",nbe="_identityFootnote_12lj4_2886",rbe="_readinessLine_12lj4_2910",sbe="_readinessStatusRow_12lj4_2916",obe="_readinessDot_12lj4_2925",abe="_readinessDot_success_12lj4_2932",ibe="_readinessDot_warn_12lj4_2933",cbe="_readinessDot_muted_12lj4_2934",lbe="_readinessLabel_12lj4_2935",ube="_readinessDetail_12lj4_2939",dbe="_readinessRehearsal_12lj4_2943",fbe="_readinessRehearsalStaleBtn_12lj4_2968",hbe="_readinessRehearsalBusy_12lj4_2977",pbe="_readinessRehearsalStale_12lj4_2968",mbe="_readinessAttribution_12lj4_2987",F={shell:rpe,header:spe,backBtn:ope,headerActions:ape,editBtnProvider:ipe,headerPauseBtn:cpe,headerRevokeBtn:lpe,headerPauseBtnPaused:upe,headerBtn:dpe,headerBtnGhost:fpe,headerBtnDanger:hpe,main:ppe,titleBlock:mpe,identityRow:gpe,body:ype,tierStack:bpe,tierCard:vpe,tierCardOpen:wpe,tierCardDepth_0:_pe,tierCardDepth_1:xpe,tierCardDepth_2:kpe,tierCardConnector:Cpe,tierCardHead:jpe,tierCardHeadText:Spe,tierCardLabel:Ape,tierCardPrimary:Epe,tierCardSummary:Npe,tierCardChevron:Ipe,tierCardChevronOpen:Mpe,tierCardBody:Bpe,tierGrid:Tpe,statusStrip:Ppe,statusCell:Rpe,statusCellKicker:Lpe,statusCellValue:Dpe,statusCellDot:Ope,statusDot_success:Fpe,statusDot_warn:$pe,statusDot_danger:zpe,statusDot_muted:qpe,statusCellSub:Upe,gasRow:Hpe,gasChain:Wpe,gasValue:Vpe,actionCard:Gpe,actionCard_neutral:Kpe,actionCard_warn:Qpe,actionCard_danger:Ype,actionCardText:Jpe,actionCardKicker:Xpe,actionCardKicker_warn:Zpe,actionCardKicker_danger:eme,actionCardTitle:tme,actionCardDescription:nme,actionCardAction:rme,pauseBtn:sme,revokeBtn:ome,sidebar:ame,statusCard:ime,statusList:cme,statusRow:lme,statusRowProminent:ume,statusHead:dme,statusHeadProminent:fme,statusKicker:hme,statusValue:pme,statusValueLarge:mme,statusDot:gme,statusTone_muted:yme,statusSub:bme,actionsBlock:vme,actionsHint:wme,hero:_me,heroIdentity:xme,chainChips:kme,chainChip:Cme,chainChipDot:jme,statStat:Sme,statTone_success:Ame,statTone_warn:Eme,statTone_danger:Nme,statTone_muted:Ime,statKicker:Mme,statValue:Bme,statDot:Tme,statDot_success:Pme,statDot_warn:Rme,statDot_danger:Lme,statDot_muted:Dme,statSub:Ome,heroActions:Fme,heroActionsHint:$me,hierarchy:zme,hierStep:qme,hierKicker:Ume,hierTitle:Hme,hierSub:Wme,hierStepActive:Vme,hierTone_owner:Gme,hierTone_sma:Kme,hierArrow:Qme,identityName:Yme,identityDot:Jme,title:Xme,summary:Zme,chainBlock:e1e,chainHeader:t1e,chainList:n1e,chainStep:r1e,chainDepth_0:s1e,chainDepth_1:o1e,chainDepth_2:a1e,chainConnector:i1e,chainConnectorSvg:c1e,chainStepActive:l1e,chainKicker:u1e,chainTitle:d1e,chainAddress:f1e,chainCopyIcon:h1e,sidebarBlock:p1e,sidebarBlockHead:m1e,sidebarKicker:g1e,sidebarBlockTitle:y1e,sidebarBody:b1e,sidebarMeta:v1e,sidebarValue:w1e,sidebarHint:_1e,copyAddress:x1e,copyAddressValue:k1e,copyAddressIcon:C1e,identityLink:j1e,identityHandle:S1e,identityArrow:A1e,networkList:E1e,networkRow:N1e,networkDot:I1e,netDot_ethereum:M1e,netDot_base:B1e,netDot_arbitrum:T1e,netDot_optimism:P1e,netDot_polygon:R1e,networkName:L1e,networkState:D1e,pauseBtnPaused:O1e,content:F1e,section:$1e,sectionAccent_mandate:z1e,sectionKicker:q1e,sectionAccent_permissions:U1e,sectionAccent_identity:H1e,mandateExplainer:W1e,hierarchyHeader:V1e,hierTier:G1e,hierTier_depth_0:K1e,hierTier_depth_1:Q1e,hierTier_depth_2:Y1e,hierTier_depth_3:J1e,hierTier_depth_4:X1e,hierTier_identity:Z1e,hierTier_mandate:e0e,hierTier_permissions:t0e,hierTierActive:n0e,hierTierConnector:r0e,hierTierHead:s0e,hierTierKicker:o0e,hierTierPrimary:a0e,hierTierSecondary:i0e,hierTierChips:c0e,hierTierChip:l0e,hierTierChipMono:u0e,hierTierAddress:d0e,hierTierAddressKicker:f0e,hierTierAddressValue:h0e,hierTierAddressIcon:p0e,sectionHead:m0e,sectionHeadText:g0e,sectionHeadAction:y0e,sectionLink:b0e,collapsibleSection:v0e,collapsibleTrigger:w0e,collapsibleOpen:_0e,collapsibleChevron:x0e,collapsibleChevronOpen:k0e,collapsibleBody:C0e,sectionTitle:j0e,sectionTitleHint:S0e,sectionNote:A0e,subsection:E0e,subsectionHead:N0e,subsectionKicker:I0e,subsectionTitle:M0e,mandateSpec:B0e,specCell:T0e,specKey:P0e,specHintWrap:R0e,specHintIcon:L0e,registryGrid:D0e,gasCell:O0e,gasKicker:F0e,specValRow:$0e,specVal:z0e,specViewBtn:q0e,specValMono:U0e,targetList:H0e,targetRow:W0e,targetLabel:V0e,targetVenue:G0e,targetSep:K0e,targetSelector:Q0e,targetMeta:Y0e,targetHash:J0e,targetConstraint:X0e,targetTemplate:Z0e,permRelation:ege,permRelationText:tge,permRelationKicker:nge,permRelationRole:rge,permRelationBody:sge,permRelationLink:oge,permRelationHint:age,permRelationEmpty:ige,agentPermList:cge,agentPermRow:lge,agentPermUsed:uge,agentPermUnused:dge,agentPermRevoked:fge,agentPermLabel:hge,agentPermMark:pge,agentPermBody:mge,agentPermSub:gge,agentPermMeta:yge,agentPermMetaTpl:bge,agentPermMetaSep:vge,agentPermMetaVer:wge,agentPermTag:_ge,scheduleList:xge,scheduleRow:kge,scheduleRowDisabled:Cge,scheduleMain:jge,scheduleHeadRow:Sge,scheduleId:Age,scheduleMode:Ege,scheduleModeLive:Nge,scheduleModeFork:Ige,scheduleCron:Mge,scheduleRuns:Bge,scheduleToggle:Tge,scheduleToggleOn:Pge,signerShareRow:Rge,signerShareLabel:Lge,signerShareList:Dge,signerShareChip:Oge,receiptGrid:Fge,receiptRow:$ge,linkOut:zge,recoQuote:qge,recoMark:Uge,recoBody:Hge,recoFoot:Wge,pagesList:Vge,pageRow:Gge,pageIcon:Kge,pageBody:Qge,pageTitle:Yge,pageMeta:Jge,pageOpen:Xge,pageNew:Zge,pageNewIcon:eye,pageNewBody:tye,pageNewTitle:nye,pageNewSub:rye,pagesEmpty:sye,pagesEmptyIcon:oye,pagesEmptyTitle:aye,pagesEmptySub:iye,activityList:cye,activityRow:lye,activityDot:uye,actDot_exec:dye,actDot_sim:fye,actDot_check:hye,actDot_sys:pye,actDot_auth:mye,activityLabel:gye,activityAgo:yye,activityEmpty:bye,runList:vye,runRow:wye,runStatus:_ye,runStatus_success:xye,runStatus_failed:kye,runStatus_pending:Cye,runId:jye,runLabel:Sye,runMeta:Aye,runGas:Eye,runAgo:Nye,runChevron:Iye,runFailed:Mye,drawerScrim:Bye,drawerScrimOpen:Tye,drawer:Pye,drawerOpen:Rye,drawerHead:Lye,drawerHeadLeft:Dye,drawerKicker:Oye,drawerTitle:Fye,drawerClose:$ye,drawerBody:zye,drawerGrid:qye,drawerRow:Uye,drawerLink:Hye,drawerStatus:Wye,drawerError:Vye,drawerSection:Gye,drawerSectionTitle:Kye,drawerNote:Qye,drawerLog:Yye,notFound:Jye,notFoundTitle:Xye,notFoundBody:Zye,mandateLinkPill:ebe,titleScope:tbe,identityFootnote:nbe,readinessLine:rbe,readinessStatusRow:sbe,readinessDot:obe,readinessDot_success:abe,readinessDot_warn:ibe,readinessDot_muted:cbe,readinessLabel:lbe,readinessDetail:ube,readinessRehearsal:dbe,readinessRehearsalStaleBtn:fbe,readinessRehearsalBusy:hbe,readinessRehearsalStale:pbe,readinessAttribution:mbe},gbe="_overlay_1joyb_6",ybe="_contractFade_1joyb_1",bbe="_card_1joyb_21",vbe="_contractRise_1joyb_1",wbe="_close_1joyb_45",_be="_doc_1joyb_74",xbe="_docHead_1joyb_88",kbe="_docKicker_1joyb_95",Cbe="_docTitle_1joyb_103",jbe="_docLede_1joyb_113",Sbe="_docMeta_1joyb_132",Abe="_docMetaCell_1joyb_144",Ebe="_docMetaWithMark_1joyb_167",Nbe="_divider_1joyb_177",Ibe="_section_1joyb_186",Mbe="_sectionHead_1joyb_191",Bbe="_sectionRoman_1joyb_199",Tbe="_sectionTitle_1joyb_208",Pbe="_sectionKicker_1joyb_217",Rbe="_sectionBody_1joyb_224",Lbe="_docBody_1joyb_231",Dbe="_recital_1joyb_251",Obe="_recitalMark_1joyb_265",Fbe="_parties_1joyb_295",$be="_party_1joyb_306",zbe="_partyActive_1joyb_315",qbe="_partyRole_1joyb_319",Ube="_partyName_1joyb_328",Hbe="_partyDesc_1joyb_335",Wbe="_partyAddr_1joyb_341",Vbe="_scopeGrid_1joyb_351",Gbe="_scopeBlock_1joyb_359",Kbe="_scopeHead_1joyb_368",Qbe="_scopeCount_1joyb_380",Ybe="_scopeChips_1joyb_386",Jbe="_scopePill_1joyb_391",Xbe="_scopePillDot_1joyb_404",Zbe="_scopeEmpty_1joyb_410",e2e="_limitsGrid_1joyb_418",t2e="_limitCell_1joyb_426",n2e="_limitCellEmphasis_1joyb_435",r2e="_limitLabel_1joyb_441",s2e="_limitValueWrap_1joyb_449",o2e="_limitVal_1joyb_449",a2e="_limitSub_1joyb_464",i2e="_actionList_1joyb_473",c2e="_actionItem_1joyb_482",l2e="_actionIndex_1joyb_491",u2e="_actionBody_1joyb_500",d2e="_actionLabel_1joyb_506",f2e="_actionMeta_1joyb_513",h2e="_actionChip_1joyb_518",p2e="_actionChipDot_1joyb_531",m2e="_rights_1joyb_539",g2e="_sigBlock_1joyb_576",y2e="_sigHead_1joyb_588",b2e="_sigTitle_1joyb_595",v2e="_sigSub_1joyb_603",w2e="_sigGrid_1joyb_610",_2e="_sigCard_1joyb_619",x2e="_sigCard_signed_1joyb_629",k2e="_sigCardProvider_claude_1joyb_637",C2e="_sigCardRole_1joyb_641",j2e="_sigLine_1joyb_642",S2e="_sigX_1joyb_643",A2e="_sigCardProvider_cursor_1joyb_645",E2e="_sigCardProvider_codex_1joyb_653",N2e="_sigCard_signing_1joyb_660",I2e="_sigCardHead_1joyb_663",M2e="_sigCardName_1joyb_677",B2e="_sigCardAddr_1joyb_684",T2e="_sigCardAddrLabel_1joyb_689",P2e="_sigCardAddrValue_1joyb_697",R2e="_sigLineWrap_1joyb_706",L2e="_sigValue_1joyb_729",D2e="_sigWrite_1joyb_1",O2e="_sigPenLine_1joyb_747",F2e="_penDraw_1joyb_1",$2e="_docFooter_1joyb_770",z2e="_authorizeBtn_1joyb_788",q2e="_rejectBtn_1joyb_809",U2e="_docFooterNote_1joyb_827",H2e="_revokeError_1joyb_840",W2e="_readOnlyFoot_1joyb_855",V2e="_readOnlyNote_1joyb_862",G2e="_readOnlyClose_1joyb_869",K2e="_docFooterSuccess_1joyb_897",Q2e="_successBlock_1joyb_902",Y2e="_successRise_1joyb_1",J2e="_successMark_1joyb_914",X2e="_successPop_1joyb_1",Z2e="_successCheck_1joyb_1",eve="_successBody_1joyb_941",tve="_successTitle_1joyb_947",nve="_successSub_1joyb_954",rve="_successDone_1joyb_961",sve="_docRevoking_1joyb_1011",ove="_revokeStamp_1joyb_1029",ave="_revokeStampLanded_1joyb_1045",ive="_revokeStampInner_1joyb_1053",cve="_revokeStampText_1joyb_1081",lve="_revokeStampDate_1joyb_1096",uve="_revokeStampImpact_1joyb_1114",dve="_stampImpact_1joyb_1",fve="_docFooterRevoked_1joyb_1131",hve="_revokingBlock_1joyb_1138",pve="_revokingPulse_1joyb_1149",mve="_revokePulse_1joyb_1",gve="_revokingTitle_1joyb_1161",yve="_revokedBlock_1joyb_1165",bve="_revokedMark_1joyb_1173",vve="_revokedBody_1joyb_1192",wve="_revokedTitle_1joyb_1198",_ve="_revokedSub_1joyb_1205",xve="_scopeRow_1joyb_1288",kve="_limitRow_1joyb_1289",Cve="_actionLine_1joyb_1290",jve="_signatureRow_1joyb_1291",Sve="_signatureSlot_1joyb_1292",Ave="_actionsRow_1joyb_1367",Eve="_footerActions_1joyb_1368",Nve="_footerBar_1joyb_1369",Ive="_footerCta_1joyb_1370",Mve="_cta_1joyb_1373",Bve="_ctaSecondary_1joyb_1374",Tve="_ctaTertiary_1joyb_1375",Pve="_ctaDestructive_1joyb_1376",Rve="_docRequester_1joyb_1389",Lve="_protections_1joyb_1408",Dve="_protectionChip_1joyb_1414",Ove="_partyAvatar_1joyb_1441",Fve="_onchain_1joyb_1459",$ve="_onchainKicker_1joyb_1464",zve="_onchainList_1joyb_1472",qve="_onchainRow_1joyb_1479",Uve="_onchainLabel_1joyb_1488",Hve="_onchainAddr_1joyb_1494",Wve="_onchainLink_1joyb_1500",G={overlay:gbe,contractFade:ybe,card:bbe,contractRise:vbe,close:wbe,doc:_be,docHead:xbe,docKicker:kbe,docTitle:Cbe,docLede:jbe,docMeta:Sbe,docMetaCell:Abe,docMetaWithMark:Ebe,divider:Nbe,section:Ibe,sectionHead:Mbe,sectionRoman:Bbe,sectionTitle:Tbe,sectionKicker:Pbe,sectionBody:Rbe,docBody:Lbe,recital:Dbe,recitalMark:Obe,parties:Fbe,party:$be,partyActive:zbe,partyRole:qbe,partyName:Ube,partyDesc:Hbe,partyAddr:Wbe,scopeGrid:Vbe,scopeBlock:Gbe,scopeHead:Kbe,scopeCount:Qbe,scopeChips:Ybe,scopePill:Jbe,scopePillDot:Xbe,scopeEmpty:Zbe,limitsGrid:e2e,limitCell:t2e,limitCellEmphasis:n2e,limitLabel:r2e,limitValueWrap:s2e,limitVal:o2e,limitSub:a2e,actionList:i2e,actionItem:c2e,actionIndex:l2e,actionBody:u2e,actionLabel:d2e,actionMeta:f2e,actionChip:h2e,actionChipDot:p2e,rights:m2e,sigBlock:g2e,sigHead:y2e,sigTitle:b2e,sigSub:v2e,sigGrid:w2e,sigCard:_2e,sigCard_signed:x2e,sigCardProvider_claude:k2e,sigCardRole:C2e,sigLine:j2e,sigX:S2e,sigCardProvider_cursor:A2e,sigCardProvider_codex:E2e,sigCard_signing:N2e,sigCardHead:I2e,sigCardName:M2e,sigCardAddr:B2e,sigCardAddrLabel:T2e,sigCardAddrValue:P2e,sigLineWrap:R2e,sigValue:L2e,sigWrite:D2e,sigPenLine:O2e,penDraw:F2e,docFooter:$2e,authorizeBtn:z2e,rejectBtn:q2e,docFooterNote:U2e,revokeError:H2e,readOnlyFoot:W2e,readOnlyNote:V2e,readOnlyClose:G2e,docFooterSuccess:K2e,successBlock:Q2e,successRise:Y2e,successMark:J2e,successPop:X2e,successCheck:Z2e,successBody:eve,successTitle:tve,successSub:nve,successDone:rve,docRevoking:sve,revokeStamp:ove,revokeStampLanded:ave,revokeStampInner:ive,revokeStampText:cve,revokeStampDate:lve,revokeStampImpact:uve,stampImpact:dve,docFooterRevoked:fve,revokingBlock:hve,revokingPulse:pve,revokePulse:mve,revokingTitle:gve,revokedBlock:yve,revokedMark:bve,revokedBody:vve,revokedTitle:wve,revokedSub:_ve,scopeRow:xve,limitRow:kve,actionLine:Cve,signatureRow:jve,signatureSlot:Sve,actionsRow:Ave,footerActions:Eve,footerBar:Nve,footerCta:Ive,cta:Mve,ctaSecondary:Bve,ctaTertiary:Tve,ctaDestructive:Pve,docRequester:Rve,protections:Lve,protectionChip:Dve,partyAvatar:Ove,onchain:Fve,onchainKicker:$ve,onchainList:zve,onchainRow:qve,onchainLabel:Uve,onchainAddr:Hve,onchainLink:Wve},Vve={ethereum:{id:"ethereum",name:"Ethereum",chainId:1,color:"#627EEA",short:"ETH"},arbitrum:{id:"arbitrum",name:"Arbitrum",chainId:42161,color:"#2D374B",short:"ARB"},base:{id:"base",name:"Base",chainId:8453,color:"#0052FF",short:"BASE"},optimism:{id:"optimism",name:"Optimism",chainId:10,color:"#FF0420",short:"OP"},polygon:{id:"polygon",name:"Polygon",chainId:137,color:"#8247E5",short:"POL"}},Gve={USDC:{symbol:"USDC",name:"USD Coin",color:"#2775CA",decimals:6,addresses:{ethereum:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",arbitrum:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",base:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",optimism:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"}},USDT:{symbol:"USDT",name:"Tether USD",color:"#26A17B",decimals:6,addresses:{ethereum:"0xdAC17F958D2ee523a2206206994597C13D831ec7",arbitrum:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",polygon:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F"}},DAI:{symbol:"DAI",name:"Dai Stablecoin",color:"#F4B731",decimals:18,addresses:{ethereum:"0x6B175474E89094C44Da98b954EedeAC495271d0F",arbitrum:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",base:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb"}},WETH:{symbol:"WETH",name:"Wrapped Ether",color:"#627EEA",decimals:18,addresses:{ethereum:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",arbitrum:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",base:"0x4200000000000000000000000000000000000006"}},ARB:{symbol:"ARB",name:"Arbitrum",color:"#2D374B",decimals:18,addresses:{arbitrum:"0x912CE59144191C1204E64559FE8253a0e49E6548"}},VVV:{symbol:"VVV",name:"Venice Token",color:"#FF3B5C",decimals:18,addresses:{base:"0xacfE6019Ed1A7Dc6f7B508C02d1b04ec88cC21bf"}},LINK:{symbol:"LINK",name:"Chainlink",color:"#2A5ADA",decimals:18,addresses:{ethereum:"0x514910771AF9Ca656af840dff83E8264EcF986CA",arbitrum:"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",base:"0x88Fb150BDc53A65fe94Dea0c9BA0a6dAf8C6e196"}},WBTC:{symbol:"WBTC",name:"Wrapped Bitcoin",color:"#F7931A",decimals:8,addresses:{ethereum:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",arbitrum:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f"}},CRV:{symbol:"CRV",name:"Curve DAO Token",color:"#A50E0E",decimals:18,addresses:{ethereum:"0xD533a949740bb3306d119CC777fa900bA034cd52",arbitrum:"0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978"}}},Kve={"morpho-blue":{id:"morpho-blue",name:"Morpho Blue",kind:"Lending vaults",color:"#2B5CFF",addresses:{ethereum:"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFFb",base:"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFFb"}},aave:{id:"aave",name:"Aave V3",kind:"Lending pool",color:"#B6509E",addresses:{ethereum:"0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",arbitrum:"0x794a61358D6845594F94dc1DB02A252b5b4814aD",base:"0xA238Dd80C259a72e81d7e4664a9801593F98d1c5"}},compound:{id:"compound",name:"Compound III",kind:"Lending pool",color:"#00D395",addresses:{ethereum:"0xc3d688B66703497DAA19211EEdff47f25384cdc3",arbitrum:"0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf",base:"0xb125E6687d4313864e53df431d5425969c15Eb2F"}},"uniswap-v3":{id:"uniswap-v3",name:"Uniswap V3",kind:"AMM",color:"#FF007A",addresses:{ethereum:"0xE592427A0AEce92De3Edee1F18E0157C05861564",arbitrum:"0xE592427A0AEce92De3Edee1F18E0157C05861564",base:"0x2626664c2603336E57B271c5C0b26F421741e481"}},curve:{id:"curve",name:"Curve",kind:"AMM",color:"#A50E0E",addresses:{ethereum:"0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7",arbitrum:"0x7544Fe3d184b6B55D6B36c3FCA1157eE0Ba30287"}},gmx:{id:"gmx",name:"GMX",kind:"Perps",color:"#3D88FF",addresses:{arbitrum:"0x489ee077994B6658eAfA855C308275EAd8097C4A"}},pendle:{id:"pendle",name:"Pendle",kind:"Fixed yield",color:"#00B388",addresses:{ethereum:"0x888888888889758F76e7103c6CbF23ABbF58F946",arbitrum:"0x888888888889758F76e7103c6CbF23ABbF58F946"}},ethena:{id:"ethena",name:"Ethena",kind:"Yield strategy",color:"#7AFAA1",addresses:{ethereum:"0x9D39A5DE30e57443BfF2A8307A4256c8797A3497"}},lyra:{id:"lyra",name:"Lyra",kind:"Options",color:"#39EBA0",addresses:{arbitrum:"0x2dD5edEEf3A77fcF8290a44C7CD96fAaa0E96322"}},dopex:{id:"dopex",name:"Dopex",kind:"Options",color:"#22E1FF",addresses:{arbitrum:"0xa12d0FaF12BC4d2DB8DD0F1F94B7C9DA02b2D7A8"}}},P1={deposit:{label:"Deposit",accent:"#1990FF"},withdraw:{label:"Withdraw",accent:"#6ba3ff"},claim:{label:"Claim",accent:"#5fd28a"},swap:{label:"Swap",accent:"#9b8eff"},rebalance:{label:"Rebalance",accent:"#ffb84d"},"conditional-swap":{label:"Conditional",accent:"#ff8a8a"},short:{label:"Short",accent:"#ff8a8a"},long:{label:"Long",accent:"#5fd28a"},hedge:{label:"Hedge",accent:"#9b8eff"}},yx=e=>Vve[e],bx=e=>Gve[e],R1=e=>Kve[e];function Mh({open:e,mandate:t,onClose:n,onAuthorize:r,onReject:s,onRevoke:o,readOnly:a=!1,signedDate:c=null,mode:l="sign"}){var O,B,U,L,N,H;const u=a&&l==="sign"?"view":l,{address:d}=Oe(),{account:f}=dd(),h=(f==null?void 0:f.safe)??null,p=f?[{name:"My SMA",address:f.safe}]:[],[m,g]=S.useState("preview"),[_,b]=S.useState(null),[y,v]=S.useState(!1),w=S.useRef(null),x=S.useRef(null);S.useEffect(()=>{if(!e)return;u==="view"?(g("signed"),b(c?new Date(c):new Date)):u==="revoke"?(g("preview"),b(c?new Date(c):new Date)):(g("preview"),b(null)),document.body.style.overflow="hidden";const M=$=>{$.key==="Escape"&&m!=="signing"&&m!=="revoking"&&m!=="revoked"&&(n==null||n())};return window.addEventListener("keydown",M),()=>{window.removeEventListener("keydown",M),document.body.style.overflow=""}},[e,u]);function A(){const M=w.current,$=x.current;if(M&&$){const W=Math.max(0,M.offsetTop-($.clientHeight-M.clientHeight)/2);vx($,W,360)}setTimeout(()=>g("signing"),280),setTimeout(()=>{b(new Date),g("signed"),setTimeout(()=>r==null?void 0:r(t.id),4200)},1880)}function C(){r==null||r(t.id)}function j(){const M=w.current,$=x.current;if(M&&$){const W=Math.max(0,M.offsetTop-($.clientHeight-M.clientHeight)/2);vx($,W,360)}setTimeout(()=>g("revoking"),280),setTimeout(()=>g("revoked"),640),setTimeout(()=>o==null?void 0:o(t.id),3600)}if(!e||!t)return null;const E=Qve(t),I=p[0],T=new Date;return i.jsxs("div",{className:G.overlay,role:"dialog","aria-modal":"true","aria-label":"Mandate",onClick:m==="preview"?n:void 0,children:[i.jsxs(Ct,{className:G.card,onClick:M=>M.stopPropagation(),children:[i.jsx("button",{type:"button",className:G.close,onClick:n,"aria-label":"Close",disabled:m==="signing",children:"×"}),i.jsxs("article",{ref:x,className:`${G.doc} ${m==="revoking"||m==="revoked"?G.docRevoking:""}`,children:[i.jsxs("header",{className:G.docHead,children:[i.jsx("span",{className:G.docKicker,children:"Mandate"}),i.jsx("h1",{className:G.docTitle,children:t.title}),i.jsxs("p",{className:G.docLede,children:["A bounded delegation between ",i.jsx("strong",{children:Qg(d)})," and the agent operating inside ",i.jsx("strong",{children:I.name}),"."]}),i.jsxs("dl",{className:G.docMeta,children:[i.jsxs("span",{className:G.docMetaCell,children:[i.jsx("dt",{children:"Drafted by"}),i.jsxs("dd",{className:G.docMetaWithMark,children:[i.jsx(xs,{name:t.aiName,size:14})," ",t.aiName]})]}),i.jsxs("span",{className:G.docMetaCell,children:[i.jsx("dt",{children:"Requested"}),i.jsx("dd",{children:t.requestedAgo??"just now"})]}),i.jsxs("span",{className:G.docMetaCell,children:[i.jsx("dt",{children:"Effective"}),i.jsx("dd",{children:"upon signature"})]}),i.jsxs("span",{className:G.docMetaCell,children:[i.jsx("dt",{children:"Date"}),i.jsx("dd",{children:ci(T)})]})]})]}),i.jsx(wx,{}),i.jsxs(ai,{roman:"",title:"Summary",kicker:"Plain-language recital",children:[i.jsxs("p",{className:G.docBody,children:["The undersigned wallet (the ",i.jsx("em",{children:"Owner"}),") hereby grants the agent identified herein a",i.jsx("em",{children:" bounded delegation"})," to act on its behalf inside the Separately Managed Account named ",i.jsx("strong",{children:I.name}),", strictly within the scope, limits, and permitted actions defined by this mandate."]}),t.summary&&i.jsxs("blockquote",{className:G.recital,children:[i.jsx("span",{className:G.recitalMark,"aria-hidden":!0,children:"“"}),i.jsx("p",{children:t.summary}),i.jsxs("footer",{children:[i.jsx(xs,{name:t.aiName,size:13}),i.jsxs("span",{children:["Drafted by ",t.aiName]})]})]})]}),i.jsx(ai,{roman:"I",title:"Parties",children:i.jsxs("ul",{className:G.parties,children:[i.jsx(L1,{role:"Owner",desc:"Externally Owned Account — sole signer",address:d}),i.jsx(L1,{role:"Safe Account",desc:`Separately Managed Account · ${ii(I.network)}`,name:I.name,address:h}),i.jsx(L1,{role:"Agent",desc:`Delegated EOA · operated by ${t.aiName}`,address:kx(t),active:!0})]})}),i.jsx(ai,{roman:"II",title:"Scope",children:i.jsxs("div",{className:G.scopeGrid,children:[i.jsx(D1,{label:"Networks",count:((O=t.networks)==null?void 0:O.length)??0,children:(t.networks??[]).map(M=>{const $=yx(M)??{label:ii(M),color:"#1990FF"};return i.jsxs("span",{className:G.scopePill,children:[i.jsx("span",{className:G.scopePillDot,style:{background:$.color},"aria-hidden":!0}),$.label]},M)})}),i.jsx(D1,{label:"Assets",count:((B=t.assets)==null?void 0:B.length)??0,children:(t.assets??[]).map(M=>{const $=bx(M)??{symbol:M,color:"#999"};return i.jsxs("span",{className:G.scopePill,children:[i.jsx("span",{className:G.scopePillDot,style:{background:$.color},"aria-hidden":!0}),$.symbol]},M)})}),i.jsxs(D1,{label:"Protocols",count:E.protocols.length,children:[E.protocols.length===0&&i.jsx("span",{className:G.scopeEmpty,children:"Any onchain target permitted under the action whitelist."}),E.protocols.map(M=>{const $=R1(M)??{label:ii(M),color:"#FFFFFF"};return i.jsxs("span",{className:G.scopePill,children:[i.jsx("span",{className:G.scopePillDot,style:{background:$.color??"#FFFFFF"},"aria-hidden":!0}),$.label]},M)})]})]})}),i.jsx(ai,{roman:"III",title:"Limits",children:i.jsxs("div",{className:G.limitsGrid,children:[i.jsx(_x,{label:"Spending cap",emphasis:!0,children:((U=t.caps)==null?void 0:U.length)>0?t.caps.map((M,$)=>i.jsxs("span",{className:G.limitVal,children:[M.currency==="USD"?`$${M.amount.toLocaleString()}`:`${M.amount} ${M.asset}`,i.jsxs("span",{className:G.limitSub,children:["max · ",M.asset]})]},$)):i.jsx("span",{className:G.limitVal,children:"—"})}),i.jsx(_x,{label:"Time limit",emphasis:!0,children:i.jsxs("span",{className:G.limitVal,children:[t.duration??"—",t.endsAt&&i.jsxs("span",{className:G.limitSub,children:["ends · ",ci(new Date(t.endsAt*1e3))]})]})})]})}),i.jsx(ai,{roman:"IV",title:"Permitted actions",kicker:`${((L=t.actions)==null?void 0:L.length)??((N=t.allowed)==null?void 0:N.length)??0} authorised`,children:((H=t.actions)==null?void 0:H.length)>0?i.jsx("ol",{className:G.actionList,children:t.actions.map((M,$)=>{var W,ie,de;return(P1==null?void 0:P1[M.kind])??ii(M.kind),i.jsxs("li",{className:G.actionItem,children:[i.jsx("span",{className:G.actionIndex,children:Cx($+1).toLowerCase()}),i.jsxs("div",{className:G.actionBody,children:[i.jsx("span",{className:G.actionLabel,children:M.label}),i.jsxs("div",{className:G.actionMeta,children:[M.asset&&i.jsxs("span",{className:G.actionChip,children:[i.jsx("span",{className:G.actionChipDot,style:{background:((W=bx(M.asset))==null?void 0:W.color)??"#999"}}),M.asset]}),M.venue&&i.jsxs("span",{className:G.actionChip,children:[i.jsx("span",{className:G.actionChipDot,style:{background:((ie=R1(M.venue))==null?void 0:ie.color)??"#fff"}}),((de=R1(M.venue))==null?void 0:de.label)??ii(M.venue)]}),(M.networks??[]).map(ye=>{var z;return i.jsxs("span",{className:G.actionChip,children:[i.jsx("span",{className:G.actionChipDot,style:{background:((z=yx(ye))==null?void 0:z.color)??"#1990FF"}}),ii(ye)]},ye)})]})]})]},M.id??$)})}):i.jsx("ol",{className:G.actionList,children:(t.allowed??[]).map((M,$)=>i.jsxs("li",{className:G.actionItem,children:[i.jsx("span",{className:G.actionIndex,children:Cx($+1).toLowerCase()}),i.jsx("div",{className:G.actionBody,children:i.jsx("span",{className:G.actionLabel,children:M})})]},$))})}),i.jsx(ai,{roman:"V",title:"Reservation of rights",children:i.jsxs("ul",{className:G.rights,children:[i.jsxs("li",{children:["The Owner may ",i.jsx("strong",{children:"pause"})," the agent at any time, halting future executions without revoking the mandate."]}),i.jsxs("li",{children:["The Owner may ",i.jsx("strong",{children:"revoke"})," the mandate at any time. Revocation is permanent and immediate onchain."]}),i.jsxs("li",{children:["The Owner retains ",i.jsx("strong",{children:"self-custody"})," of the Separately Managed Account at all times. Sail never holds the keys."]}),i.jsxs("li",{children:["Any action taken outside the scope, limits, or permitted actions of this mandate is ",i.jsx("strong",{children:"rejected onchain"})," by Template Logic."]})]})}),i.jsx(wx,{}),i.jsxs("section",{ref:w,className:G.sigBlock,"aria-label":"Signatures",children:[i.jsxs("header",{className:G.sigHead,children:[i.jsx("span",{className:G.docKicker,children:"Signatures"}),i.jsx("h2",{className:G.sigTitle,children:"In witness whereof"}),i.jsxs("p",{className:G.sigSub,children:["Signed on ",ci(T),m==="signed"&&_&&` at ${hf(_)} UTC`,"."]})]}),i.jsxs("div",{className:G.sigGrid,children:[i.jsx(xx,{role:"Drafted by",name:t.aiName,addressKicker:"Agent identity",address:`sail-agent#${kx(t).slice(2,8)}`,state:"signed",signatureValue:`/s/ ${t.aiName}`,signatureSub:"Counter-signed at draft",brand:t.aiName}),i.jsx(xx,{role:"Owner",name:"Externally Owned Account",addressKicker:"EOA address",address:Qg(d),state:u==="view"||u==="revoke"||m==="signed"?"signed":m==="signing"?"signing":"pending",signatureValue:d,signatureSub:u==="view"||u==="revoke"?_?`Signed ${ci(_)} at ${hf(_)} UTC`:"Signed onchain":m==="signed"&&_?`Signed ${ci(_)} at ${hf(_)} UTC`:"Awaiting signature"})]}),(m==="revoking"||m==="revoked")&&i.jsxs("div",{className:`${G.revokeStamp} ${m==="revoked"?G.revokeStampLanded:""}`,"aria-hidden":!0,children:[i.jsxs("span",{className:G.revokeStampInner,children:[i.jsx("span",{className:G.revokeStampText,children:"REVOKED"}),i.jsx("span",{className:G.revokeStampDate,children:_&&ci(_)})]}),i.jsx("span",{className:G.revokeStampImpact,"aria-hidden":!0})]})]}),i.jsx("footer",{className:`${G.docFooter} ${m==="signed"&&u!=="view"?G.docFooterSuccess:""} ${m==="revoked"?G.docFooterRevoked:""}`,children:u==="view"?i.jsxs("div",{className:G.readOnlyFoot,children:[i.jsx("span",{className:G.readOnlyNote,children:"Signed onchain · revocable at any time from the agent page."}),i.jsx("button",{type:"button",className:G.readOnlyClose,onClick:n,children:"Close"})]}):u==="revoke"?m==="preview"?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:G.rejectBtn,onClick:j,children:"Revoke this mandate"}),i.jsx("button",{type:"button",className:G.authorizeBtn,onClick:n,style:{background:"rgba(255,255,255,0.04)",borderColor:"rgba(255,255,255,0.12)",color:"var(--text-primary)",boxShadow:"none"},children:"Keep it active"}),i.jsxs("p",{className:G.docFooterNote,children:["Revocation is ",i.jsx("strong",{children:"permanent"})," and immediate onchain. Open positions stay in your SMA — Sail won't unwind anything — but your AI loses authority to act and you cannot undo this."]})]}):m==="revoking"?i.jsxs("div",{className:G.revokingBlock,role:"status","aria-live":"polite",children:[i.jsx("span",{className:G.revokingPulse,"aria-hidden":!0}),i.jsx("span",{className:G.revokingTitle,children:"Revoking onchain…"})]}):i.jsxs("div",{className:G.revokedBlock,role:"status","aria-live":"polite",children:[i.jsx("span",{className:G.revokedMark,"aria-hidden":!0,children:i.jsxs("svg",{viewBox:"0 0 32 32",width:"22",height:"22",fill:"none","aria-hidden":!0,children:[i.jsx("circle",{cx:"16",cy:"16",r:"15",stroke:"currentColor",strokeWidth:"1.4"}),i.jsx("path",{d:"M10 16h12",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round"})]})}),i.jsxs("div",{className:G.revokedBody,children:[i.jsx("span",{className:G.revokedTitle,children:"Mandate revoked"}),i.jsx("span",{className:G.revokedSub,children:"The delegated EOA is permanently disabled. Funds remain self-custody."})]})]}):m!=="signed"?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:G.authorizeBtn,onClick:A,disabled:m!=="preview",children:[m==="preview"&&"Authorize & sign",m==="signing"&&"Signing…"]}),i.jsx("button",{type:"button",className:G.rejectBtn,onClick:()=>v(!0),disabled:m!=="preview",children:"Reject mandate"}),i.jsx("p",{className:G.docFooterNote,children:"By signing you agree to the scope, limits, and permitted actions described above. Revocable at any time from the agent page."})]}):i.jsxs("div",{className:G.successBlock,role:"status","aria-live":"polite",children:[i.jsx("span",{className:G.successMark,"aria-hidden":!0,children:i.jsxs("svg",{viewBox:"0 0 32 32",width:"22",height:"22",fill:"none","aria-hidden":!0,children:[i.jsx("circle",{cx:"16",cy:"16",r:"15",stroke:"currentColor",strokeWidth:"1.4"}),i.jsx("path",{d:"M9 16.5l4.5 4.5L23 11",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsxs("div",{className:G.successBody,children:[i.jsx("span",{className:G.successTitle,children:"Mandate signed"}),i.jsxs("span",{className:G.successSub,children:["Your agent is operating inside ",p[0].name," now.",_&&` Signed at ${hf(_)} UTC.`]})]}),i.jsx("button",{type:"button",className:G.successDone,onClick:C,autoFocus:!0,children:"Done"})]})})]})]}),i.jsx(bS,{open:y,title:"Reject this mandate?",body:i.jsxs(i.Fragment,{children:[i.jsx("strong",{style:{color:"var(--text-primary)"},children:t.aiName})," will be told the draft was declined. Nothing is created onchain. You can ask your AI to redraft anytime."]}),confirmLabel:"Reject mandate",cancelLabel:"Keep reading",onConfirm:()=>{v(!1),s==null||s(t.id)},onCancel:()=>v(!1)})]})}function vx(e,t,n=360){if(!e)return;const r=e.scrollTop,s=t-r;if(Math.abs(s)<1)return;const o=Date.now(),a=l=>1-Math.pow(1-l,3);function c(){const l=Math.min(1,(Date.now()-o)/n);e.scrollTop=r+s*a(l),l<1&&setTimeout(c,16)}c()}function ai({roman:e,title:t,kicker:n,children:r}){return i.jsxs("section",{className:G.section,children:[i.jsxs("header",{className:G.sectionHead,children:[e&&i.jsxs("span",{className:G.sectionRoman,children:["Article ",e]}),i.jsx("h2",{className:G.sectionTitle,children:t}),n&&i.jsx("span",{className:G.sectionKicker,children:n})]}),i.jsx("div",{className:G.sectionBody,children:r})]})}function wx(){return i.jsx("span",{className:G.divider,"aria-hidden":!0})}function L1({role:e,name:t,desc:n,address:r,active:s}){return i.jsxs("li",{className:`${G.party} ${s?G.partyActive:""}`,children:[i.jsx("span",{className:G.partyRole,children:e}),i.jsx("span",{className:G.partyName,children:t??Qg(r)}),i.jsx("span",{className:G.partyDesc,children:n}),i.jsx("span",{className:G.partyAddr,children:r})]})}function D1({label:e,count:t,children:n}){return i.jsxs("div",{className:G.scopeBlock,children:[i.jsxs("header",{className:G.scopeHead,children:[i.jsx("span",{children:e}),i.jsx("span",{className:G.scopeCount,children:t})]}),i.jsx("div",{className:G.scopeChips,children:n})]})}function _x({label:e,emphasis:t,children:n}){return i.jsxs("div",{className:`${G.limitCell} ${t?G.limitCellEmphasis:""}`,children:[i.jsx("span",{className:G.limitLabel,children:e}),i.jsx("div",{className:G.limitValueWrap,children:n})]})}function xx({role:e,name:t,addressKicker:n,address:r,state:s,signatureValue:o,signatureSub:a,brand:c}){const l=c?G[`sigCardProvider_${Yve(c)}`]:"";return i.jsxs("div",{className:`${G.sigCard} ${G[`sigCard_${s}`]} ${l}`,children:[i.jsxs("header",{className:G.sigCardHead,children:[i.jsx("span",{className:G.sigCardRole,children:e}),c&&i.jsx(xs,{name:c,size:14})]}),i.jsx("span",{className:G.sigCardName,children:t}),i.jsxs("div",{className:G.sigCardAddr,children:[i.jsx("span",{className:G.sigCardAddrLabel,children:n}),i.jsx("span",{className:G.sigCardAddrValue,children:r})]}),i.jsxs("div",{className:G.sigLineWrap,children:[i.jsx("span",{className:G.sigX,"aria-hidden":!0,children:"X"}),i.jsxs("div",{className:G.sigLine,children:[s==="signed"&&i.jsx("span",{className:G.sigValue,children:o}),s==="signing"&&i.jsx("span",{className:G.sigPenLine,"aria-hidden":!0})]})]}),i.jsx("span",{className:G.sigSub,children:a})]})}function Qve(e){const t=new Set;for(const n of e.actions??[])n.venue&&t.add(n.venue);return{protocols:Array.from(t)}}function kx(e){let t=0;const n=e.id??"";for(let a=0;a<n.length;a++)t=t*31+n.charCodeAt(a)|0;t=Math.abs(t);const r=t.toString(16).padStart(8,"0"),s=(t*7).toString(16).padStart(8,"0"),o=(t*11).toString(16).padStart(8,"0");return("0x"+r+s+o+r).slice(0,42)}function Cx(e){return["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI"][e-1]??`${e}`}function Yve(e){const t=(e??"").toLowerCase();return t==="claude"||t==="anthropic"?"claude":t==="cursor"?"cursor":t==="codex"||t==="chatgpt"||t==="openai"||t==="gpt"?"codex":"default"}function ii(e){return e&&e[0].toUpperCase()+e.slice(1)}function Qg(e){return!e||e.length<12?e??"":`${e.slice(0,6)}…${e.slice(-4)}`}function ci(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function hf(e){return e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1})}function Jve({agentId:e,onBack:t,onEdit:n,onRevoke:r}){var U,L;const{mandate:s}=Fp(),{account:o}=dd(),{address:a}=Oe();o==null||o.safe,o&&o.safe;const c=s??null,l=S.useMemo(()=>uwe(c),[c]),u=((s==null?void 0:s.permissions)??[]).map(N=>({...N,usedByThisAgent:!0})),[d,f]=S.useState([]);function h(N){f(H=>H.map(M=>M.id===N?{...M,enabled:!M.enabled}:M))}const p=(c==null?void 0:c.lastRehearsalHoursAgo)??3,[m,g]=S.useState(p),[_,b]=S.useState(!1);S.useEffect(()=>{g(p)},[p]);function y(){_||(b(!0),setTimeout(()=>{g(0),b(!1)},900))}const[v,w]=S.useState(null),[x,A]=S.useState(!1),[C,j]=S.useState(!1),[E,I]=S.useState(!1);if(S.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"})},[e]),!c)return i.jsxs("div",{className:`${De.pageShell} ${F.shell}`,children:[i.jsx(Ms,{}),i.jsxs("main",{className:F.notFound,children:[i.jsx(Dt,{size:48}),i.jsx("h1",{className:F.notFoundTitle,children:"Agent not found"}),i.jsx("p",{className:F.notFoundBody,children:"The URL points to an agent that doesn’t exist."}),i.jsx(Me,{onClick:t,children:"Back to agents"})]})]});const T=c.status==="active",O=x?"paused":c.status,B=v?l.runs.find(N=>N.id===v):null;return awe(c),iwe(c,O),lwe(c),i.jsxs("div",{className:`${De.pageShell} ${F.shell}`,children:[i.jsx(Ms,{}),i.jsxs("header",{className:F.header,children:[i.jsxs("button",{type:"button",className:F.backBtn,onClick:t,"aria-label":"Back to dashboard",children:[i.jsx(gwe,{}),i.jsx("span",{children:"Dashboard"})]}),parentMandate&&i.jsxs("a",{href:`#/mandate/${parentMandate.id}`,className:F.mandateLinkPill,children:[i.jsx(mwe,{}),i.jsxs("span",{children:["Operating under: ",parentMandate.title]}),i.jsx(Ex,{})]})]}),i.jsxs("main",{className:F.main,children:[i.jsxs("section",{className:F.titleBlock,children:[i.jsxs("div",{className:F.identityRow,children:[i.jsx(xs,{name:c.aiName,size:22}),i.jsxs("span",{className:F.identityName,children:["Created in ",c.aiName]}),i.jsx("span",{className:F.identityDot,"aria-hidden":!0,children:"·"}),i.jsx(Bu,{status:O,kind:"agent"}),i.jsx(swe,{networks:c.networks})]}),i.jsx("h1",{className:`${De.displayHeadline} ${F.title}`,children:c.role??c.title}),c.role&&i.jsx("p",{className:F.titleScope,children:c.title}),l.agentId!=null&&i.jsxs("p",{className:F.identityFootnote,children:[i.jsx("code",{children:c.id}),i.jsx("span",{className:F.identityDot,"aria-hidden":!0,children:"·"}),i.jsxs("span",{children:["agentId ",i.jsx("code",{children:l.agentId.toLocaleString()})]})]}),i.jsx(ewe,{status:O,mandate:c,hasMpcWallet:!!((U=l.mpcWallet)!=null&&U.address),lastRehearsalHoursAgo:m,rehearsing:_,onRehearse:y,managerEndpoint:mockManagerEndpoint})]}),i.jsxs("div",{className:F.body,children:[i.jsx(jx,{title:"Your brief",kicker:"What you asked for",hint:`A summary of everything you told ${c.aiName} across your conversation — your goal, plus any follow-up details ${c.aiName} asked for while drafting this mandate. The mandate itself is ${c.aiName}'s interpretation of this brief into onchain rules.`,children:i.jsxs("blockquote",{className:F.recoQuote,children:[i.jsx("span",{className:F.recoMark,"aria-hidden":!0,children:"“"}),i.jsx("p",{className:F.recoBody,children:l.recommendation.body}),i.jsxs("footer",{className:F.recoFoot,children:[i.jsx(xs,{name:c.aiName,size:16}),i.jsxs("span",{children:["Interpreted by ",c.aiName," · ",l.recommendation.ago]})]})]})}),i.jsxs("div",{className:F.tierStack,children:[i.jsxs(Sx,{tier:"1",depth:0,label:"Agent",primary:l.erc8004.handle,summary:`${hwe(l.mpcWallet.address)} · ${l.runs.length} execution${l.runs.length===1?"":"s"} · last ${((L=l.activity[0])==null?void 0:L.ago)??"—"}`,defaultOpen:!0,children:[i.jsxs("div",{className:F.tierGrid,children:[i.jsxs(li,{title:"Verified handle",kicker:"ERC-8004 · optional",children:[i.jsxs("a",{href:l.erc8004.url,target:"_blank",rel:"noreferrer",className:F.identityLink,children:[i.jsx("span",{className:F.identityHandle,children:l.erc8004.handle}),i.jsx(Yg,{})]}),i.jsx("span",{className:F.sidebarHint,children:"Template-layer metadata only — the kernel doesn't read this. The canonical agent identity is the agentId above."})]}),i.jsxs(li,{title:"Gas balance",kicker:"Agent wallet",children:[i.jsxs("div",{className:F.gasRow,children:[i.jsxs("span",{className:F.gasChain,children:[i.jsx(vwe,{})," Arbitrum"]}),i.jsxs("span",{className:F.gasValue,children:[l.mpcWallet.gas," ETH"]})]}),l.mpcWallet.threshold&&i.jsxs("div",{className:F.signerShareRow,children:[i.jsxs("span",{className:F.signerShareLabel,children:["Signed by ",l.mpcWallet.threshold.replace("-of-"," of ")]}),i.jsx("span",{className:F.signerShareList,children:(l.mpcWallet.keyShares??[]).map(N=>i.jsx("span",{className:F.signerShareChip,children:N},N))})]})]})]}),d.length>0&&i.jsx(li,{title:"Schedules",kicker:`${d.filter(N=>N.enabled).length} of ${d.length} enabled`,children:i.jsx("ul",{className:F.scheduleList,children:d.map(N=>{var H;return i.jsxs("li",{className:`${F.scheduleRow} ${N.enabled?"":F.scheduleRowDisabled}`,children:[i.jsxs("div",{className:F.scheduleMain,children:[i.jsxs("div",{className:F.scheduleHeadRow,children:[i.jsx("span",{className:F.scheduleId,children:N.id}),i.jsx("span",{className:`${F.scheduleMode} ${N.mode==="live"?F.scheduleModeLive:F.scheduleModeFork}`,children:N.mode})]}),i.jsxs("span",{className:F.scheduleCron,children:[N.cronHuman," · ",i.jsx("code",{children:N.cron})]})]}),i.jsxs("div",{className:F.scheduleRuns,children:[i.jsxs("span",{children:["Last ",i.jsx("code",{children:((H=N.lastRun)==null?void 0:H.at)??"—"})]}),i.jsxs("span",{children:["Next ",i.jsx("code",{children:N.nextRun??"—"})]})]}),i.jsx("button",{type:"button",className:`${F.scheduleToggle} ${N.enabled?F.scheduleToggleOn:""}`,onClick:()=>h(N.id),"aria-pressed":N.enabled,"aria-label":`${N.enabled?"Disable":"Enable"} schedule ${N.id}`,children:N.enabled?"Enabled":"Disabled"})]},N.id)})})}),i.jsx(li,{title:"Activity",kicker:"Recent events",children:i.jsxs("ul",{className:F.activityList,children:[l.activity.map(N=>i.jsxs("li",{className:F.activityRow,children:[i.jsx("span",{className:`${F.activityDot} ${F[`actDot_${N.kind}`]??""}`,"aria-hidden":!0}),i.jsx("span",{className:F.activityLabel,children:N.label}),i.jsx("span",{className:F.activityAgo,children:N.ago})]},N.id)),l.activity.length===0&&i.jsx("li",{className:F.activityEmpty,children:"No recent activity."})]})}),i.jsx(li,{title:"Runs",kicker:`${l.runs.length} execution${l.runs.length===1?"":"s"}`,children:i.jsxs("ul",{className:F.runList,children:[l.runs.map(N=>i.jsx("li",{children:i.jsxs("button",{type:"button",className:`${F.runRow} ${N.status==="failed"?F.runFailed:""}`,onClick:()=>w(N.id),children:[i.jsx("span",{className:`${F.runStatus} ${F[`runStatus_${N.status}`]}`,"aria-hidden":!0,children:N.status==="success"?i.jsx(Nx,{}):N.status==="failed"?i.jsx(Ix,{}):i.jsx(Mx,{})}),i.jsx("span",{className:F.runId,children:N.id}),i.jsx("span",{className:F.runLabel,children:N.label}),i.jsxs("span",{className:F.runMeta,children:[i.jsx("span",{className:F.runGas,children:N.gas}),i.jsx("span",{className:F.runAgo,children:N.ago})]}),i.jsx("span",{className:F.runChevron,"aria-hidden":!0,children:i.jsx(ywe,{})})]})},N.id)),l.runs.length===0&&i.jsx("li",{className:F.activityEmpty,children:"This agent hasn’t executed yet."})]})})]}),i.jsx(Sx,{tier:"2",depth:1,label:"Permissions",primary:parentMandate?`${usedPermissionIds.size} of ${u.filter(N=>!N.revoked).length} active permissions`:"No mandate",summary:parentMandate?`Operating under ${parentMandate.title} · this agent uses the highlighted lines below`:"This agent is not bound to a signed mandate.",defaultOpen:!0,children:parentMandate?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:F.permRelation,children:[i.jsxs("div",{className:F.permRelationText,children:[i.jsx("span",{className:F.permRelationKicker,children:"Role"}),i.jsx("span",{className:F.permRelationRole,children:c.role??c.title}),i.jsxs("span",{className:F.permRelationBody,children:["Operates as an agent wallet under"," ",i.jsx("strong",{children:parentMandate.title}),". The mandate above defines the full permission set; this agent uses the",i.jsxs("strong",{children:[" ",usedPermissionIds.size]})," highlighted below."]})]}),i.jsxs("a",{href:`#/mandate/${parentMandate.id}`,className:F.permRelationLink,children:[i.jsx("span",{children:"Open mandate"}),i.jsx(Ex,{})]})]}),i.jsx(li,{title:"Permissions this agent uses",kicker:"Inherited from the mandate",children:i.jsx("ul",{className:F.agentPermList,children:u.map(N=>i.jsxs("li",{className:`${F.agentPermRow} ${N.usedByThisAgent?F.agentPermUsed:F.agentPermUnused} ${N.revoked?F.agentPermRevoked:""}`,children:[i.jsx("span",{className:F.agentPermMark,"aria-hidden":!0,children:N.revoked?i.jsx(Ix,{}):N.usedByThisAgent?i.jsx(Nx,{}):i.jsx(Mx,{})}),i.jsxs("span",{className:F.agentPermBody,children:[i.jsx("span",{className:F.agentPermLabel,children:N.label}),i.jsx("span",{className:F.agentPermSub,children:N.sub}),N.template&&i.jsxs("span",{className:F.agentPermMeta,children:[i.jsx("span",{className:F.agentPermMetaTpl,children:N.template}),N.version&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:F.agentPermMetaSep,"aria-hidden":!0,children:"·"}),i.jsxs("span",{className:F.agentPermMetaVer,children:["v",N.version]})]})]})]}),i.jsx("span",{className:F.agentPermTag,children:N.revoked?"Revoked on mandate":N.usedByThisAgent?"Used by this agent":"Available · not used"})]},N.id))})}),i.jsx("p",{className:F.permRelationHint,children:"To revoke an individual permission, open the parent mandate. Revocation always happens at the mandate level so every agent operating under it loses authority for that line at once."})]}):i.jsx("p",{className:F.permRelationEmpty,children:"This agent is not currently bound to a signed mandate."})})]}),i.jsx(jx,{title:"Custom pages",kicker:`${l.pages.length} created by your AI`,note:"Ask your AI to build a page for this agent — a dashboard, a watchlist, anything you want.",children:l.pages.length>0?i.jsxs("ul",{className:F.pagesList,children:[l.pages.map(N=>i.jsxs("li",{className:F.pageRow,children:[i.jsx("span",{className:F.pageIcon,"aria-hidden":!0,children:N.icon}),i.jsxs("div",{className:F.pageBody,children:[i.jsx("span",{className:F.pageTitle,children:N.title}),i.jsxs("span",{className:F.pageMeta,children:[i.jsx(xs,{name:N.maker,size:12}),i.jsxs("span",{children:[N.maker," · ",N.updated]})]})]}),i.jsxs("a",{className:F.pageOpen,href:N.url,target:"_blank",rel:"noreferrer",children:[i.jsx("span",{children:"Open"}),i.jsx(Yg,{})]})]},N.id)),i.jsxs("li",{className:F.pageNew,children:[i.jsx("span",{className:F.pageNewIcon,"aria-hidden":!0,children:"+"}),i.jsxs("div",{className:F.pageNewBody,children:[i.jsx("span",{className:F.pageNewTitle,children:"Ask your AI to build a page"}),i.jsx("span",{className:F.pageNewSub,children:"Try: “Sailor, build me a yield-history page for this agent.”"})]})]})]}):i.jsxs("div",{className:F.pagesEmpty,children:[i.jsx("span",{className:F.pagesEmptyIcon,"aria-hidden":!0,children:"+"}),i.jsx("span",{className:F.pagesEmptyTitle,children:"No custom pages yet"}),i.jsx("span",{className:F.pagesEmptySub,children:"Ask your AI to design one for this agent — Sail will serve it locally."})]})}),i.jsx(Zve,{tone:"warn",kicker:"Reversible · agent only",title:x?"Resume this agent":"Stop this agent",description:x?"This agent is stopped. Resume to let it dispatch again — no re-signing required.":"Stops this agent. Other agents under the same mandate keep running. You can resume at any time without re-signing. Agents are never revoked; only mandates and individual permissions are.",action:i.jsx("button",{type:"button",className:`${F.pauseBtn} ${x?F.pauseBtnPaused:""}`,onClick:()=>A(N=>!N),disabled:!T&&!x,children:x?"Resume this agent":"Stop this agent"})})]})]}),i.jsx(owe,{run:B,open:!!B,onClose:()=>w(null)}),i.jsx(Mh,{open:E,mandate:c,readOnly:!0,signedDate:l.receipt.signedAt,onClose:()=>I(!1)}),i.jsx(Mh,{open:C,mode:"revoke",mandate:c,signedDate:l.receipt.signedAt,onClose:()=>j(!1),onRevoke:()=>{j(!1),r==null||r()}})]})}function jx({title:e,kicker:t,note:n,hint:r,headerAction:s,accent:o,children:a}){return i.jsxs("section",{className:`${F.section} ${o?F[`sectionAccent_${o}`]:""}`,children:[i.jsxs("header",{className:F.sectionHead,children:[i.jsxs("div",{className:F.sectionHeadText,children:[i.jsx("span",{className:F.sectionKicker,children:t}),i.jsxs("h2",{className:F.sectionTitle,children:[e,r&&i.jsx("span",{className:F.sectionTitleHint,title:r,"aria-label":r,role:"img",children:"i"})]}),n&&i.jsx("p",{className:F.sectionNote,children:n})]}),s&&i.jsx("div",{className:F.sectionHeadAction,children:s})]}),a]})}function Sx({tier:e,depth:t=0,label:n,primary:r,summary:s,defaultOpen:o,children:a}){const[c,l]=S.useState(o??!1),u=`tier-${e}-heading`,d=`tier-${e}-body`;return i.jsxs("section",{className:`${F.tierCard} ${F[`tierCardDepth_${t}`]??""} ${c?F.tierCardOpen:""}`,"aria-labelledby":u,children:[t>0&&i.jsx("span",{className:F.tierCardConnector,"aria-hidden":!0,children:i.jsx(Xve,{})}),i.jsxs("button",{type:"button",className:F.tierCardHead,onClick:()=>l(f=>!f),"aria-expanded":c,"aria-controls":d,id:u,children:[i.jsxs("div",{className:F.tierCardHeadText,children:[i.jsx("span",{className:F.tierCardLabel,children:n}),i.jsx("span",{className:F.tierCardPrimary,children:r}),s&&i.jsx("span",{className:F.tierCardSummary,children:s})]}),i.jsx("span",{className:`${F.tierCardChevron} ${c?F.tierCardChevronOpen:""}`,"aria-hidden":!0,children:i.jsx(bwe,{})})]}),c&&i.jsx("div",{className:F.tierCardBody,id:d,role:"region",children:a})]})}function Xve(){return i.jsxs("svg",{viewBox:"0 0 24 52",width:"24",height:"52",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("defs",{children:i.jsxs("linearGradient",{id:"tier-conn",x1:"0",y1:"0",x2:"0",y2:"52",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{offset:"0%",stopColor:"#FFFFFF",stopOpacity:"0"}),i.jsx("stop",{offset:"35%",stopColor:"#FFFFFF",stopOpacity:"0.18"}),i.jsx("stop",{offset:"100%",stopColor:"#1990FF",stopOpacity:"0.65"})]})}),i.jsx("path",{d:"M 1.5 0 L 1.5 36 Q 1.5 44 11 44 L 22 44",stroke:"url(#tier-conn)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),i.jsx("circle",{cx:"22",cy:"44",r:"2",fill:"#1990FF",fillOpacity:"0.75"})]})}function Zve({tone:e,kicker:t,title:n,description:r,action:s}){return i.jsxs("section",{className:`${F.actionCard} ${F[`actionCard_${e}`]}`,children:[i.jsxs("div",{className:F.actionCardText,children:[i.jsx("span",{className:`${F.actionCardKicker} ${F[`actionCardKicker_${e}`]}`,children:t}),i.jsx("h3",{className:F.actionCardTitle,children:n}),i.jsx("p",{className:F.actionCardDescription,children:r})]}),i.jsx("div",{className:F.actionCardAction,children:s})]})}function li({title:e,kicker:t,children:n}){return i.jsxs("section",{className:F.subsection,children:[i.jsxs("header",{className:F.subsectionHead,children:[i.jsx("span",{className:F.subsectionKicker,children:t}),i.jsx("h3",{className:F.subsectionTitle,children:e})]}),n]})}function ewe({status:e,mandate:t,hasMpcWallet:n,lastRehearsalHoursAgo:r,rehearsing:s,onRehearse:o,managerEndpoint:a}){const c=twe({status:e,hasMpcWallet:n,lastRehearsalHoursAgo:r}),l=r!=null&&r>24;return i.jsxs("div",{className:F.readinessLine,children:[i.jsxs("div",{className:F.readinessStatusRow,children:[i.jsx("span",{className:`${F.readinessDot} ${F[`readinessDot_${c.tone}`]}`,"aria-hidden":!0}),i.jsx("span",{className:F.readinessLabel,children:c.headline}),c.detail&&i.jsx("span",{className:F.readinessDetail,children:c.detail}),r!=null&&i.jsxs("button",{type:"button",className:`${F.readinessRehearsal} ${l?F.readinessRehearsalStaleBtn:""} ${s?F.readinessRehearsalBusy:""}`,onClick:o,disabled:s,title:"Click to re-run the dry run — runs against a local chain fork. Live dispatch requires a rehearsal ≤ 24h old.","aria-label":"Re-run dry run on a chain fork",children:[i.jsx(rwe,{}),s?i.jsx(i.Fragment,{children:"Re-running dry run…"}):i.jsxs(i.Fragment,{children:["Dry run · ",nwe(r),l&&i.jsx("span",{className:F.readinessRehearsalStale,children:" · stale · re-run"})]})]})]}),i.jsxs("p",{className:F.readinessAttribution,children:["Drafted in ",i.jsx("strong",{children:t.aiName}),". Runtime decisions come from your manager endpoint at ",i.jsx("code",{children:a.url})," — not from"," ",t.aiName,". Switching drafters doesn't change who runs the agent."]})]})}function twe({status:e,hasMpcWallet:t,lastRehearsalHoursAgo:n}){return e==="revoked"?{headline:"Ended",detail:"parent mandate was revoked",tone:"muted"}:e==="expired"?{headline:"Expired",detail:"window closed",tone:"muted"}:e==="paused"?{headline:"Stopped",detail:"schedules disabled · resume any time",tone:"warn"}:t?n!=null&&n>24?{headline:"Dry run stale",detail:"rerun on a chain fork to resume live dispatch",tone:"warn"}:{headline:"Live · dispatching",detail:"schedules firing onchain",tone:"success"}:{headline:"Awaiting signer",detail:"delegated MPC wallet not yet bound",tone:"warn"}}function nwe(e){if(e<1)return"just now";if(e<24)return`${Math.round(e)}h ago`;const t=Math.round(e/24);return t===1?"1 day ago":`${t} days ago`}function rwe(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M3 9.5c2-3.6 6-3.6 8 0"}),i.jsx("path",{d:"M5.5 7l-2.5 2.5L5.5 12"}),i.jsx("circle",{cx:"11",cy:"3.5",r:"1",fill:"currentColor"})]})}function swe({networks:e}){return!e||e.length===0?null:i.jsx("span",{className:F.chainChips,"aria-label":`Networks: ${e.map(Ax).join(", ")}`,children:e.map(t=>i.jsxs("span",{className:F.chainChip,children:[i.jsx("span",{className:`${F.chainChipDot} ${F[`netDot_${t}`]??""}`,"aria-hidden":!0}),i.jsx("span",{children:Ax(t)})]},t))})}function owe({run:e,open:t,onClose:n}){return S.useEffect(()=>{if(!t)return;const r=s=>{s.key==="Escape"&&(n==null||n())};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t,n]),i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`${F.drawerScrim} ${t?F.drawerScrimOpen:""}`,onClick:n,"aria-hidden":!0}),i.jsx("aside",{className:`${F.drawer} ${t?F.drawerOpen:""}`,role:"dialog","aria-modal":"true","aria-label":"Run detail",children:e&&i.jsxs(i.Fragment,{children:[i.jsxs("header",{className:F.drawerHead,children:[i.jsxs("div",{className:F.drawerHeadLeft,children:[i.jsx("span",{className:F.drawerKicker,children:"Execution"}),i.jsx("span",{className:F.drawerTitle,children:e.id})]}),i.jsx("button",{type:"button",className:F.drawerClose,onClick:n,"aria-label":"Close",children:"×"})]}),i.jsxs("div",{className:F.drawerBody,children:[i.jsxs("dl",{className:F.drawerGrid,children:[i.jsx(qo,{k:"Status",v:i.jsx("span",{className:`${F.drawerStatus} ${F[`runStatus_${e.status}`]}`,children:e.status==="success"?"Success":e.status==="failed"?"Failed":"Pending"})}),i.jsx(qo,{k:"Action",v:e.label}),i.jsx(qo,{k:"Tx hash",v:i.jsxs("a",{className:F.drawerLink,href:`https://arbiscan.io/tx/${e.txHash}`,target:"_blank",rel:"noreferrer",children:[pwe(e.txHash),i.jsx(Yg,{})]})}),i.jsx(qo,{k:"Block",v:e.block}),i.jsx(qo,{k:"Gas",v:e.gas}),i.jsx(qo,{k:"When",v:`${e.ts} · ${e.ago}`}),e.error&&i.jsx(qo,{k:"Error",v:i.jsx("span",{className:F.drawerError,children:e.error})})]}),i.jsxs("section",{className:F.drawerSection,children:[i.jsx("h3",{className:F.drawerSectionTitle,children:"Simulation"}),i.jsx("p",{className:F.drawerNote,children:e.status==="failed"?"Simulation passed before broadcast. The revert was triggered onchain.":"Simulation matched the executed result exactly."})]}),i.jsxs("section",{className:F.drawerSection,children:[i.jsx("h3",{className:F.drawerSectionTitle,children:"Log"}),i.jsx("pre",{className:F.drawerLog,children:e.log})]})]})]})})]})}function qo({k:e,v:t}){return i.jsxs("div",{className:F.drawerRow,children:[i.jsx("dt",{children:e}),i.jsx("dd",{children:t})]})}function awe(e){return e.lastAction?{value:e.lastAction.ago,sub:e.lastAction.label}:{value:"—",sub:"No checks yet."}}function iwe(e,t){var c;if(t!=="active")return{value:"—",sub:t==="paused"?"Paused":"Not running"};const n=((c=e.lastAction)==null?void 0:c.ago)??"0h ago",r=cwe(n),s=6;if(r==null)return{value:"~6h",sub:"Continuous · every 6h"};const o=Math.max(0,s-r);return{value:o<=0?"soon":`in ${o}h`,sub:"Continuous · every 6h"}}function cwe(e){if(!e)return null;if(/just now/i.test(e))return 0;const t=e.match(/(\d+)\s*([mhd])/i);if(!t)return null;const n=Number(t[1]),r=t[2].toLowerCase();return r==="m"?n/60:r==="h"?n:r==="d"?n*24:null}function lwe(e){const t=e.duration??"",n=t.match(/Ends in (.+)/i);return n?{value:n[1],sub:"Auto-revokes at expiry."}:/^expired/i.test(t)?{value:"Expired",sub:t.replace(/^expired\s*/i,"")}:/^revoked/i.test(t)?{value:"Revoked",sub:t.replace(/^revoked\s*/i,"")}:{value:t||"—",sub:""}}function uwe(e){var w,x,A,C;if(!e)return{mpcWallet:{},runs:[],activity:[],schedule:{},erc8004:{},agentId:null,templateHash:"",policyHash:"",templateDeployed:!1,targets:[],receipt:{},pages:[],recommendation:{}};const t=dwe(e.id),n=t.toString(16).padStart(8,"0"),r=`0x${n}${(t*7).toString(16).padStart(8,"0")}${(t*11).toString(16).padStart(8,"0")}${n}`,s={address:fwe(r),gas:(.005+t%30/1e3).toFixed(4),threshold:"2-of-3",provenance:"sail-mpc-lab",keyShares:["operator-a","operator-b","paper-backup"]},o=8004e3+t%1e3,a={handle:`sail-agent#${s.address.slice(2,8)}`,url:`https://identity.erc8004.org/${s.address}`},c=e.status==="active"?{label:"Continuous · checks every 6h"}:{label:"Stopped"},l=((w=e.lastAction)==null?void 0:w.label)??"Mandate signed",u=e.status==="active"?[{id:"a1",label:l,ago:((x=e.lastAction)==null?void 0:x.ago)??"just now",kind:"exec"},{id:"a2",label:"Simulation passed before broadcast",ago:((A=e.lastAction)==null?void 0:A.ago)??"2h ago",kind:"sim"},{id:"a3",label:"Permission check ok",ago:"4h ago",kind:"check"},{id:"a4",label:"Gas balance refreshed",ago:"4h ago",kind:"sys"},{id:"a5",label:"Agent authorized",ago:"1d ago",kind:"auth"}]:[{id:"a1",label:e.status==="revoked"?"Agent revoked":"Agent expired",ago:((C=e.lastAction)==null?void 0:C.ago)??"—",kind:"auth"}],d=(e.actions??[]).slice(0,6).map((j,E)=>{var I;return{id:`run-${String(t%900+70+E).padStart(3,"0")}`,label:j.label,status:E===2&&e.status==="active"?"failed":"success",ago:["just now","2h ago","6h ago","1d ago","2d ago","4d ago"][E]??`${E+1}d ago`,ts:"2026-05-21 12:08 UTC",block:23481004-E*13,txHash:`0x${t.toString(16).padStart(4,"0").repeat(8).slice(0,60)}${E}`,gas:`$${(.08+E*.04).toFixed(2)}`,log:`[exec] ${j.label}
1786
+ `),{name:"InvalidDefinitionTypeError"})}}class PS extends kt{constructor({offset:t,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class RS extends kt{constructor({size:t,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function Dc(e,{dir:t,size:n=32}={}){return typeof e=="string"?vo(e,{dir:t,size:n}):yce(e,{dir:t,size:n})}function vo(e,{dir:t,size:n=32}={}){if(n===null)return e;const r=e.replace("0x","");if(r.length>n*2)throw new RS({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function yce(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new RS({size:e.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let s=0;s<n;s++){const o=t==="right";r[o?s:n-s-1]=e[o?s:e.length-s-1]}return r}class LS extends kt{constructor({max:t,min:n,signed:r,size:s,value:o}){super(`Number "${o}" is not in safe ${s?`${s*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class bce extends kt{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function hd(e,{size:t}){if(or(e)>t)throw new bce({givenSize:or(e),maxSize:t})}const vce=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function wce(e,t={}){return typeof e=="number"||typeof e=="bigint"?Fa(e,t):typeof e=="string"?FS(e,t):typeof e=="boolean"?DS(e,t):OS(e,t)}function DS(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(hd(n,{size:t.size}),Dc(n,{size:t.size})):n}function OS(e,t={}){let n="";for(let s=0;s<e.length;s++)n+=vce[e[s]];const r=`0x${n}`;return typeof t.size=="number"?(hd(r,{size:t.size}),Dc(r,{dir:"right",size:t.size})):r}function Fa(e,t={}){const{signed:n,size:r}=t,s=BigInt(e);let o;r?n?o=(1n<<BigInt(r)*8n-1n)-1n:o=2n**(BigInt(r)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof o=="bigint"&&n?-o-1n:0;if(o&&s>o||s<a){const l=typeof e=="bigint"?"n":"";throw new LS({max:o?`${o}${l}`:void 0,min:`${a}${l}`,signed:n,size:r,value:`${e}${l}`})}const c=`0x${(n&&s<0?(1n<<BigInt(r*8))+BigInt(s):s).toString(16)}`;return r?Dc(c,{size:r}):c}const _ce=new TextEncoder;function FS(e,t={}){const n=_ce.encode(e);return OS(n,t)}const xce=new TextEncoder;function $S(e,t={}){return typeof e=="number"||typeof e=="bigint"?Cce(e,t):typeof e=="boolean"?kce(e,t):fd(e)?zS(e,t):qS(e,t)}function kce(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(hd(n,{size:t.size}),Dc(n,{size:t.size})):n}const rs={zero:48,nine:57,A:65,F:70,a:97,f:102};function X6(e){if(e>=rs.zero&&e<=rs.nine)return e-rs.zero;if(e>=rs.A&&e<=rs.F)return e-(rs.A-10);if(e>=rs.a&&e<=rs.f)return e-(rs.a-10)}function zS(e,t={}){let n=e;t.size&&(hd(n,{size:t.size}),n=Dc(n,{dir:"right",size:t.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const s=r.length/2,o=new Uint8Array(s);for(let a=0,c=0;a<s;a++){const l=X6(r.charCodeAt(c++)),u=X6(r.charCodeAt(c++));if(l===void 0||u===void 0)throw new kt(`Invalid byte sequence ("${r[c-2]}${r[c-1]}" in "${r}").`);o[a]=l*16+u}return o}function Cce(e,t){const n=Fa(e,t);return zS(n)}function qS(e,t={}){const n=xce.encode(e);return typeof t.size=="number"?(hd(n,{size:t.size}),Dc(n,{dir:"right",size:t.size})):n}function US(e,t){const n=t||"hex",r=eb(fd(e,{strict:!1})?$S(e):e);return n==="bytes"?r:wce(r)}const jce=e=>US($S(e));function Sce(e){return jce(e)}function Ace(e){let t=!0,n="",r=0,s="",o=!1;for(let a=0;a<e.length;a++){const c=e[a];if(["(",")",","].includes(c)&&(t=!0),c==="("&&r++,c===")"&&r--,!!t){if(r===0){if(c===" "&&["event","function",""].includes(s))s="";else if(s+=c,c===")"){o=!0;break}continue}if(c===" "){e[a-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}s+=c,n+=c}}if(!o)throw new kt("Unable to normalize signature.");return s}const Ece=e=>{const t=typeof e=="string"?e:cce(e);return Ace(t)};function HS(e){return Sce(Ece(e))}const Nce=HS;class Ice extends kt{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class WS extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&(super.delete(t),super.set(t,n)),n}set(t,n){if(super.has(t)&&super.delete(t),super.set(t,n),this.maxSize&&this.size>this.maxSize){const r=super.keys().next().value;r!==void 0&&super.delete(r)}return this}}const E1=new WS(8192);function Mce(e,t){if(E1.has(`${e}.${t}`))return E1.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),r=US(qS(n),"bytes"),s=n.split("");for(let a=0;a<40;a+=2)r[a>>1]>>4>=8&&s[a]&&(s[a]=s[a].toUpperCase()),(r[a>>1]&15)>=8&&s[a+1]&&(s[a+1]=s[a+1].toUpperCase());const o=`0x${s.join("")}`;return E1.set(`${e}.${t}`,o),o}const Bce=/^0x[a-fA-F0-9]{40}$/,N1=new WS(8192);function Nh(e,t){const{strict:n=!0}=t??{},r=`${e}.${n}`;if(N1.has(r))return N1.get(r);const s=Bce.test(e)?e.toLowerCase()===e?!0:n?Mce(e)===e:!0:!1;return N1.set(r,s),s}function xc(e){return typeof e[0]=="string"?VS(e):Tce(e)}function Tce(e){let t=0;for(const s of e)t+=s.length;const n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function VS(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}function GS(e,t,n,{strict:r}={}){return fd(e,{strict:!1})?Rce(e,t,n,{strict:r}):Pce(e,t,n,{strict:r})}function KS(e,t){if(typeof t=="number"&&t>0&&t>or(e)-1)throw new PS({offset:t,position:"start",size:or(e)})}function QS(e,t,n){if(typeof t=="number"&&typeof n=="number"&&or(e)!==n-t)throw new PS({offset:n,position:"end",size:or(e)})}function Pce(e,t,n,{strict:r}={}){KS(e,t);const s=e.slice(t,n);return r&&QS(s,t,n),s}function Rce(e,t,n,{strict:r}={}){KS(e,t);const s=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return r&&QS(s,t,n),s}const Lce=/^(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 Dce(e,t){if(e.length!==t.length)throw new fce({expectedLength:e.length,givenLength:t.length});const n=Oce({params:e,values:t}),r=M2(n);return r.length===0?"0x":r}function Oce({params:e,values:t}){const n=[];for(let r=0;r<e.length;r++)n.push(I2({param:e[r],value:t[r]}));return n}function I2({param:e,value:t}){const n=Vce(e.type);if(n){const[r,s]=n;return $ce(t,{length:r,param:{...e,type:s}})}if(e.type==="tuple")return Wce(t,{param:e});if(e.type==="address")return Fce(t);if(e.type==="bool")return qce(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const r=e.type.startsWith("int"),[,,s="256"]=Lce.exec(e.type)??[];return Uce(t,{signed:r,size:Number(s)})}if(e.type.startsWith("bytes"))return zce(t,{param:e});if(e.type==="string")return Hce(t);throw new pce(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function M2(e){let t=0;for(let o=0;o<e.length;o++){const{dynamic:a,encoded:c}=e[o];a?t+=32:t+=or(c)}const n=[],r=[];let s=0;for(let o=0;o<e.length;o++){const{dynamic:a,encoded:c}=e[o];a?(n.push(Fa(t+s,{size:32})),r.push(c),s+=or(c)):n.push(c)}return xc([...n,...r])}function Fce(e){if(!Nh(e))throw new Ice({address:e});return{dynamic:!1,encoded:vo(e.toLowerCase())}}function $ce(e,{length:t,param:n}){const r=t===null;if(!Array.isArray(e))throw new mce(e);if(!r&&e.length!==t)throw new uce({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let s=!1;const o=[];for(let a=0;a<e.length;a++){const c=I2({param:n,value:e[a]});c.dynamic&&(s=!0),o.push(c)}if(r||s){const a=M2(o);if(r){const c=Fa(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?xc([c,a]):c}}if(s)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:xc(o.map(({encoded:a})=>a))}}function zce(e,{param:t}){const[,n]=t.type.split("bytes"),r=or(e);if(!n){let s=e;return r%32!==0&&(s=vo(s,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:xc([vo(Fa(r,{size:32})),s])}}if(r!==Number.parseInt(n,10))throw new dce({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:vo(e,{dir:"right"})}}function qce(e){if(typeof e!="boolean")throw new kt(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:vo(DS(e))}}function Uce(e,{signed:t,size:n=256}){if(typeof n=="number"){const r=2n**(BigInt(n)-(t?1n:0n))-1n,s=t?-r-1n:0n;if(e>r||e<s)throw new LS({max:r.toString(),min:s.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Fa(e,{size:32,signed:t})}}function Hce(e){const t=FS(e),n=Math.ceil(or(t)/32),r=[];for(let s=0;s<n;s++)r.push(vo(GS(t,s*32,(s+1)*32),{dir:"right"}));return{dynamic:!0,encoded:xc([vo(Fa(or(t),{size:32})),...r])}}function Wce(e,{param:t}){let n=!1;const r=[];for(let s=0;s<t.components.length;s++){const o=t.components[s],a=Array.isArray(e)?s:o.name,c=I2({param:o,value:e[a]});r.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?M2(r):xc(r.map(({encoded:s})=>s))}}function Vce(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const YS=e=>GS(HS(e),0,4);function Gce(e){const{abi:t,args:n=[],name:r}=e,s=fd(r,{strict:!1}),o=t.filter(c=>s?c.type==="function"?YS(c)===r:c.type==="event"?Nce(c)===r:!1:"name"in c&&c.name===r);if(o.length===0)return;if(o.length===1)return o[0];let a;for(const c of o){if(!("inputs"in c))continue;if(!n||n.length===0){if(!c.inputs||c.inputs.length===0)return c;continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==n.length)continue;if(n.every((u,d)=>{const f="inputs"in c&&c.inputs[d];return f?Kg(u,f):!1})){if(a&&"inputs"in a&&a.inputs){const u=JS(c.inputs,a.inputs,n);if(u)throw new hce({abiItem:c,type:u[0]},{abiItem:a,type:u[1]})}a=c}}return a||o[0]}function Kg(e,t){const n=typeof e,r=t.type;switch(r){case"address":return Nh(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return r==="tuple"&&"components"in t?Object.values(t.components).every((s,o)=>n==="object"&&Kg(Object.values(e)[o],s)):/^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(r)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(r)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(r)?Array.isArray(e)&&e.every(s=>Kg(s,{...t,type:r.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function JS(e,t,n){for(const r in e){const s=e[r],o=t[r];if(s.type==="tuple"&&o.type==="tuple"&&"components"in s&&"components"in o)return JS(s.components,o.components,n[r]);const a=[s.type,o.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?Nh(n[r],{strict:!1}):a.includes("address")&&a.includes("bytes")?Nh(n[r],{strict:!1}):!1)return a}}const Z6="/docs/contract/encodeFunctionData";function Kce(e){const{abi:t,args:n,functionName:r}=e;let s=t[0];if(r){const o=Gce({abi:t,args:n,name:r});if(!o)throw new J6(r,{docsPath:Z6});s=o}if(s.type!=="function")throw new J6(void 0,{docsPath:Z6});return{abi:[s],functionName:YS(Gg(s))}}function ex(e){const{args:t}=e,{abi:n,functionName:r}=(()=>{var c;return e.abi.length===1&&((c=e.functionName)!=null&&c.startsWith("0x"))?e:Kce(e)})(),s=n[0],o=r,a="inputs"in s&&s.inputs?Dce(s.inputs,t??[]):void 0;return VS([o,a??"0x"])}const tx="0x0000000000000000000000000000000000000000",XS=[{type:"function",name:"setup",stateMutability:"nonpayable",inputs:[{name:"_owners",type:"address[]"},{name:"_threshold",type:"uint256"},{name:"to",type:"address"},{name:"data",type:"bytes"},{name:"fallbackHandler",type:"address"},{name:"paymentToken",type:"address"},{name:"payment",type:"uint256"},{name:"paymentReceiver",type:"address"}],outputs:[]}],Qce=[{type:"function",name:"enable",stateMutability:"nonpayable",inputs:[{name:"module",type:"address"}],outputs:[]}],Ko={proxyFactory:"0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67",singletonL2:"0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",fallbackHandler:"0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99"};function Yce(e){const t=ex({abi:Qce,functionName:"enable",args:[e.kernel]});return ex({abi:XS,functionName:"setup",args:[e.owners,e.threshold,e.safeModuleEnabler,t,e.fallbackHandler??Ko.fallbackHandler,tx,0n,tx]})}const ZS=[{type:"function",name:"createAccount",stateMutability:"nonpayable",inputs:[{name:"safeFactory",type:"address"},{name:"safeSingleton",type:"address"},{name:"safeInitializer",type:"bytes"},{name:"saltNonce",type:"uint256"},{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"feeAsset",type:"address"}],outputs:[{name:"account",type:"address"}]},{type:"function",name:"registerAccount",stateMutability:"nonpayable",inputs:[{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"}],outputs:[]},{type:"function",name:"setManager",stateMutability:"nonpayable",inputs:[{name:"newManager",type:"address"}],outputs:[]},{type:"function",name:"getManager",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"address"}]},{type:"function",name:"registerPermission",stateMutability:"payable",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"registerPermissions",stateMutability:"payable",inputs:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"dispatch",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"managerSig",type:"bytes"},{name:"deadline",type:"uint256"}],outputs:[]},{type:"function",name:"dispatchBatch",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"calls",type:"tuple[]",components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}]},{name:"managerSig",type:"bytes"},{name:"deadline",type:"uint256"}],outputs:[]},{type:"function",name:"previewBatch",stateMutability:"view",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"},{name:"calls",type:"tuple[]",components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"}]}],outputs:[{name:"approved",type:"bool"},{name:"reason",type:"string"}]},{type:"function",name:"collectFees",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"grossFee",type:"uint256"},{name:"currentNav",type:"uint256"},{name:"feeToken",type:"address"}],outputs:[]},{type:"function",name:"recordDeposit",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"recordWithdrawal",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"amount",type:"uint256"}],outputs:[]},{type:"function",name:"getPermissions",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"address[]"}]},{type:"function",name:"getPermissionsWithInfo",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"infos",type:"tuple[]",components:[{name:"permission",type:"address"},{name:"isBatch",type:"bool"},{name:"hasIntrospection",type:"bool"},{name:"permissionId",type:"bytes32"},{name:"permissionVersion",type:"bytes32"}]}]},{type:"function",name:"isPermissionRegistered",stateMutability:"view",inputs:[{name:"account",type:"address"},{name:"permission",type:"address"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"configs",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"permissionSigner",type:"address"},{name:"manager",type:"address"},{name:"feePolicy",type:"address"},{name:"sessionActive",type:"bool"}]},{type:"function",name:"registered",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"bool"}]},{type:"function",name:"managerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"batchNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{name:"",type:"uint256"}]},{type:"event",name:"AccountRegistered",inputs:[{name:"account",type:"address",indexed:!0},{name:"permissionSigner",type:"address",indexed:!0},{name:"manager",type:"address",indexed:!0}]},{type:"event",name:"PermissionRegistered",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0}]},{type:"event",name:"ManagerChanged",inputs:[{name:"account",type:"address",indexed:!0},{name:"oldManager",type:"address",indexed:!0},{name:"newManager",type:"address",indexed:!0}]},{type:"event",name:"PermissionRevoked",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0}]},{type:"event",name:"Dispatched",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0},{name:"target",type:"address",indexed:!1},{name:"selector",type:"bytes4",indexed:!1},{name:"value",type:"uint256",indexed:!1}]},{type:"event",name:"BatchDispatched",inputs:[{name:"account",type:"address",indexed:!0},{name:"permission",type:"address",indexed:!0},{name:"batchHash",type:"bytes32",indexed:!1},{name:"callCount",type:"uint256",indexed:!1}]}],Jce="_overlay_vkkf7_6",Xce="_fadeIn_vkkf7_1",Zce="_card_vkkf7_21",ele="_cardRise_vkkf7_1",tle="_close_vkkf7_47",nle="_stepper_vkkf7_73",rle="_stepGroup_vkkf7_83",sle="_step_vkkf7_73",ole="_stepCircle_vkkf7_85",ale="_step_upcoming_vkkf7_99",ile="_step_current_vkkf7_104",cle="_step_done_vkkf7_111",lle="_stepLabel_vkkf7_115",ule="_stepLine_vkkf7_123",dle="_stepLineDone_vkkf7_130",fle="_body_vkkf7_133",hle="_bodyFade_vkkf7_1",ple="_bodyCentered_vkkf7_139",mle="_heroSai_vkkf7_149",gle="_header_vkkf7_155",yle="_headerCentered_vkkf7_162",ble="_kicker_vkkf7_170",vle="_headline_vkkf7_178",wle="_sub_vkkf7_187",_le="_points_vkkf7_197",xle="_liRise_vkkf7_1",kle="_checkBubble_vkkf7_218",Cle="_pointTitle_vkkf7_231",jle="_pointSub_vkkf7_239",Sle="_txPanel_vkkf7_249",Ale="_txPanelHeader_vkkf7_259",Ele="_txPanelKicker_vkkf7_267",Nle="_txPanelBadge_vkkf7_275",Ile="_netSelectWrap_vkkf7_288",Mle="_netSelectBtn_vkkf7_292",Ble="_netSelectBtnOpen_vkkf7_309",Tle="_netSelectDot_vkkf7_314",Ple="_netSelectName_vkkf7_320",Rle="_netSelectStack_vkkf7_326",Lle="_netSelectStackDot_vkkf7_331",Dle="_netSelectCaret_vkkf7_339",Ole="_netSelectCaretOpen_vkkf7_344",Fle="_netSelectMenu_vkkf7_346",$le="_netMenuRise_vkkf7_1",zle="_netSelectMenuHeader_vkkf7_365",qle="_netSelectMenuKicker_vkkf7_373",Ule="_netSelectMenuLink_vkkf7_381",Hle="_netSelectMenuList_vkkf7_398",Wle="_netSelectOption_vkkf7_412",Vle="_netSelectOptionActive_vkkf7_433",Gle="_netSelectOptionBody_vkkf7_440",Kle="_netSelectOptionName_vkkf7_446",Qle="_netSelectOptionMeta_vkkf7_450",Yle="_netSelectCheckbox_vkkf7_459",Jle="_netSelectCheckboxOn_vkkf7_471",Xle="_netSummary_vkkf7_479",Zle="_netSummaryItem_vkkf7_488",eue="_netSummarySep_vkkf7_493",tue="_netSummaryStack_vkkf7_497",nue="_netSummaryStackDot_vkkf7_501",rue="_txDetails_vkkf7_509",sue="_txRow_vkkf7_510",oue="_gas_vkkf7_522",aue="_txPanelFooter_vkkf7_523",iue="_actions_vkkf7_530",cue="_linkBtn_vkkf7_537",lue="_fineprint_vkkf7_551",uue="_confirmIndicator_vkkf7_562",due="_confirmDone_vkkf7_573",fue="_pulse_vkkf7_576",hue="_confirmHeadline_vkkf7_588",pue="_confirmSub_vkkf7_593",mue="_successHalo_vkkf7_601",oe={overlay:Jce,fadeIn:Xce,card:Zce,cardRise:ele,close:tle,stepper:nle,stepGroup:rle,step:sle,stepCircle:ole,step_upcoming:ale,step_current:ile,step_done:cle,stepLabel:lle,stepLine:ule,stepLineDone:dle,body:fle,bodyFade:hle,bodyCentered:ple,heroSai:mle,header:gle,headerCentered:yle,kicker:ble,headline:vle,sub:wle,points:_le,liRise:xle,checkBubble:kle,pointTitle:Cle,pointSub:jle,txPanel:Sle,txPanelHeader:Ale,txPanelKicker:Ele,txPanelBadge:Nle,netSelectWrap:Ile,netSelectBtn:Mle,netSelectBtnOpen:Ble,netSelectDot:Tle,netSelectName:Ple,netSelectStack:Rle,netSelectStackDot:Lle,netSelectCaret:Dle,netSelectCaretOpen:Ole,netSelectMenu:Fle,netMenuRise:$le,netSelectMenuHeader:zle,netSelectMenuKicker:qle,netSelectMenuLink:Ule,netSelectMenuList:Hle,netSelectOption:Wle,netSelectOptionActive:Vle,netSelectOptionBody:Gle,netSelectOptionName:Kle,netSelectOptionMeta:Qle,netSelectCheckbox:Yle,netSelectCheckboxOn:Jle,netSummary:Xle,netSummaryItem:Zle,netSummarySep:eue,netSummaryStack:tue,netSummaryStackDot:nue,txDetails:rue,txRow:sue,gas:oue,txPanelFooter:aue,actions:iue,linkBtn:cue,fineprint:lue,confirmIndicator:uue,confirmDone:due,pulse:fue,"confirm-pulse":"_confirm-pulse_vkkf7_1",confirmHeadline:hue,confirmSub:pue,successHalo:mue},gue=[{type:"function",name:"createProxyWithNonce",stateMutability:"nonpayable",inputs:[{name:"singleton",type:"address"},{name:"initializer",type:"bytes"},{name:"saltNonce",type:"uint256"}],outputs:[{name:"proxy",type:"address"}]}],yue="0x4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e235";function bue(e){var r,s;if(!(e!=null&&e.logs))return null;const[t]=hp({abi:ZS,eventName:"AccountRegistered",logs:e.logs});if((r=t==null?void 0:t.args)!=null&&r.account)return t.args.account;const n=e.logs.find(o=>{var a;return((a=o.topics)==null?void 0:a[0])===yue});return n?`0x${(s=n.topics[1])==null?void 0:s.slice(26)}`:null}function vue(e,t,n){if(e){const s=Yce({owners:[t],threshold:1n,kernel:e.kernel,safeModuleEnabler:e.safeModuleEnabler});return{to:e.kernel,data:ht({abi:ZS,functionName:"createAccount",args:[Ko.proxyFactory,Ko.singletonL2,s,n,t,t,e.standardFeePolicy,bt]})}}const r=ht({abi:XS,functionName:"setup",args:[[t],1n,bt,"0x",Ko.fallbackHandler,bt,0n,bt]});return{to:Ko.proxyFactory,data:ht({abi:gue,functionName:"createProxyWithNonce",args:[Ko.singletonL2,r,n]})}}async function wue(e){try{await fetch("/api/account",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}function _ue({open:e,onClose:t,onComplete:n}){const[r,s]=S.useState("intro"),[o,a]=S.useState([eA]),[c,l]=S.useState(""),[u,d]=S.useState(null),[f,h]=S.useState(null),[p,m]=S.useState(null),{address:g,chainId:_}=Oe(),{sendTransactionAsync:b}=Pc(),{switchChainAsync:y}=Ls(),v=at();S.useEffect(()=>{if(!e)return;s("intro"),l(""),d(null),h(null),m(null),document.body.style.overflow="hidden";const x=A=>{A.key==="Escape"&&r!=="confirm"&&(t==null||t())};return window.addEventListener("keydown",x),()=>{window.removeEventListener("keydown",x),document.body.style.overflow=""}},[e]);async function w(){var O;if(!g){l("No wallet connected.");return}const x=Ih.filter(B=>o.includes(B.id));if(x.length===0){l("Select a network.");return}const A=BigInt(Date.now());s("confirm"),l("");const C=[];let j=null,E="0",I=_;try{for(const B of x){m({index:C.length,total:x.length,name:B.name});let U=null;try{U=AS(B.chainId)}catch{}const{to:L,data:N}=vue(U,g,A);I!==B.chainId&&(await y({chainId:B.chainId}),I=B.chainId);const H=await b({to:L,data:N,chainId:B.chainId}),M=await ij(v,{hash:H,chainId:B.chainId});j||(j=bue(M),E=((O=M.blockNumber)==null?void 0:O.toString())??"0"),C.push(B.chainId)}}catch(B){if(C.length===0){l((B==null?void 0:B.shortMessage)||(B==null?void 0:B.message)||"Transaction rejected."),s("review"),m(null);return}l(`Deployed on ${C.length} of ${x.length} chains — the rest were not completed. ${(B==null?void 0:B.shortMessage)||(B==null?void 0:B.message)||""}`.trim())}if(m(null),!j){s("review");return}const T={safe:j,owner:g,permissionSigner:g,manager:g,chainId:C[0],createdAtBlock:E,deployedChains:C};d(j),wue(T),h(T),s("ready")}return e?i.jsx("div",{className:oe.overlay,role:"dialog","aria-modal":"true","aria-label":"Create your SMA",onClick:r==="confirm"?void 0:t,children:i.jsxs(Ct,{className:oe.card,onClick:x=>x.stopPropagation(),children:[r!=="confirm"&&i.jsx("button",{type:"button",className:oe.close,onClick:t,"aria-label":"Close",children:"×"}),r!=="ready"&&i.jsx(xue,{step:r}),r==="intro"&&i.jsx(kue,{onContinue:()=>s("review")}),r==="review"&&i.jsx(Cue,{onBack:()=>s("intro"),onSign:w,networks:o,onNetworksChange:a,error:c,ownerAddress:g}),r==="confirm"&&i.jsx(Eue,{progress:p}),r==="ready"&&i.jsx(Nue,{safeAddress:u,onContinue:()=>{t==null||t(),n==null||n(f)}})]})}):null}const I1=[{id:"intro",label:"Intro"},{id:"review",label:"Review"},{id:"confirm",label:"Confirm"}];function xue({step:e}){const t=I1.findIndex(n=>n.id===e);return i.jsx("div",{className:oe.stepper,"aria-label":"Setup progress",children:I1.map((n,r)=>{const s=r<t?"done":r===t?"current":"upcoming";return i.jsxs("span",{className:oe.stepGroup,children:[i.jsxs("span",{className:`${oe.step} ${oe[`step_${s}`]}`,children:[i.jsx("span",{className:oe.stepCircle,"aria-hidden":!0,children:s==="done"?i.jsx(Mue,{}):r+1}),s==="current"&&i.jsx("span",{className:oe.stepLabel,children:n.label})]}),r<I1.length-1&&i.jsx("span",{className:`${oe.stepLine} ${r<t?oe.stepLineDone:""}`,"aria-hidden":!0})]},n.id)})})}function kue({onContinue:e}){return i.jsxs("section",{className:oe.body,children:[i.jsx("div",{className:oe.heroSai,"aria-hidden":!0,children:i.jsx(Dt,{size:56,animate:!0})}),i.jsxs("header",{className:oe.header,children:[i.jsx("span",{className:oe.kicker,children:"FIRST AGENT"}),i.jsx("h2",{className:`${De.displayHeadline} ${oe.headline}`,children:"Before creating your first agent, we’ll create your SMA."}),i.jsx("p",{className:oe.sub,children:"Your Separately Managed Account is the self-custody smart contract that your AI operates inside. It’s deployed once. You alone control it."})]}),i.jsxs("ul",{className:oe.points,children:[i.jsxs("li",{style:{"--i":0},children:[i.jsx(M1,{}),i.jsxs("div",{children:[i.jsx("span",{className:oe.pointTitle,children:"You own this account"}),i.jsx("span",{className:oe.pointSub,children:"Not Sail. Not the AI. Only the wallet you just connected."})]})]}),i.jsxs("li",{style:{"--i":1},children:[i.jsx(M1,{}),i.jsxs("div",{children:[i.jsx("span",{className:oe.pointTitle,children:"Bounded delegation"}),i.jsx("span",{className:oe.pointSub,children:"Every agent has cap, time, and venue limits — enforced onchain."})]})]}),i.jsxs("li",{style:{"--i":2},children:[i.jsx(M1,{}),i.jsxs("div",{children:[i.jsx("span",{className:oe.pointTitle,children:"Revoke at any time"}),i.jsx("span",{className:oe.pointSub,children:"One signature halts every running agent. No waiting period."})]})]})]}),i.jsx(Me,{fullWidth:!0,onClick:e,children:"Continue"}),i.jsx("p",{className:oe.fineprint,children:"You can stop at any step. Nothing happens onchain until you sign."})]})}function Cue({onBack:e,onSign:t,networks:n,onNetworksChange:r,error:s,ownerAddress:o}){const a=Ih.filter(g=>n.includes(g.id)),c=a.reduce((g,_)=>g+Sue(_.gas),0),l=Aue(c),[u,d]=S.useState(!1),f=a[0];let h=null;if(f)try{h=AS(f.chainId)}catch{}const p=!!h;async function m(){d(!0);try{await t()}finally{d(!1)}}return i.jsxs("section",{className:oe.body,children:[i.jsxs("header",{className:oe.headerCentered,children:[i.jsx("span",{className:oe.kicker,children:"REVIEW & SIGN"}),i.jsx("h2",{className:`${De.displayHeadline} ${oe.headline}`,children:"Deploy your SMA."}),i.jsxs("p",{className:oe.sub,children:["One signature creates a self-custody smart account.",i.jsx("br",{}),"No AI has access until you create your first agent."]})]}),i.jsxs("div",{className:oe.txPanel,children:[i.jsxs("header",{className:oe.txPanelHeader,children:[i.jsx("span",{className:oe.txPanelKicker,children:"What you are signing"}),i.jsx(Iue,{value:n,onChange:r})]}),i.jsxs("dl",{className:oe.txDetails,children:[i.jsx(dl,{k:"Transaction",v:p?"Deploy & register SMA":"Safe proxy deployment"}),i.jsx(dl,{k:`Network${a.length===1?"":"s"}`,v:i.jsx(jue,{nets:a})}),p?i.jsx(dl,{k:"SailKernel",v:`${h.kernel.slice(0,10)}…`}):i.jsx(dl,{k:"Factory",v:`${Ko.proxyFactory.slice(0,10)}…`}),i.jsx(dl,{k:a.length===1?"Gas estimate":`Gas estimate · ${a.length} chains`,v:l,accent:!0})]})]}),s&&i.jsx("p",{style:{color:"#ff6b6b",fontSize:13,margin:"8px 0 0",textAlign:"center"},children:s}),i.jsxs("div",{className:oe.actions,children:[i.jsx(Me,{fullWidth:!0,onClick:m,disabled:a.length===0||u,children:u?"Check your wallet…":"Sign & deploy"}),i.jsx("button",{type:"button",className:oe.linkBtn,onClick:e,children:"Back"})]})]})}function jue({nets:e}){return e.length===0?i.jsx("span",{style:{opacity:.6},children:"None selected"}):e.length<=3?i.jsx("span",{className:oe.netSummary,children:e.map((t,n)=>i.jsxs("span",{className:oe.netSummaryItem,children:[i.jsx("span",{className:oe.netSelectDot,style:{background:t.color,boxShadow:`0 0 6px ${t.color}66`},"aria-hidden":!0}),i.jsx("span",{children:t.name}),n<e.length-1&&i.jsx("span",{className:oe.netSummarySep,"aria-hidden":!0,children:"·"})]},t.id))}):i.jsxs("span",{className:oe.netSummary,children:[i.jsx("span",{className:oe.netSummaryStack,"aria-hidden":!0,children:e.slice(0,4).map(t=>i.jsx("span",{className:oe.netSummaryStackDot,style:{background:t.color,boxShadow:`0 0 6px ${t.color}66`}},t.id))}),i.jsxs("span",{children:[e.length," networks"]})]})}function Sue(e){const t=String(e??"").match(/\$(\d+(?:\.\d+)?)/);return t?Number(t[1]):0}function Aue(e){return e<1?`$${e.toFixed(2)}`:e<100?`$${e.toFixed(2)}`:`$${Math.round(e)}`}function Eue({progress:e}){const t=e&&e.total>1;return i.jsxs("section",{className:`${oe.body} ${oe.bodyCentered}`,children:[i.jsx("div",{className:oe.confirmIndicator,children:i.jsx("span",{className:oe.pulse})}),i.jsx("h2",{className:`${De.displayHeadline} ${oe.confirmHeadline}`,children:e?`Deploying on ${e.name}…`:"Waiting for confirmation…"}),i.jsx("p",{className:oe.confirmSub,children:t?`Chain ${e.index+1} of ${e.total} — approve each deployment in your wallet. You may be asked to switch networks between chains.`:"Approve the deployment in your wallet, then wait for the block."})]})}function Nue({onContinue:e,safeAddress:t}){return i.jsxs("section",{className:`${oe.body} ${oe.bodyCentered}`,children:[i.jsx("span",{className:oe.successHalo,"aria-hidden":!0,children:i.jsx(Dt,{size:56,animate:!0})}),i.jsxs("header",{className:oe.headerCentered,children:[i.jsx("span",{className:oe.kicker,children:"SMA READY"}),i.jsx("h2",{className:`${De.displayHeadline} ${oe.headline}`,children:"Your account is ready."}),t&&i.jsx("p",{className:oe.sub,style:{fontFamily:"monospace",fontSize:12,wordBreak:"break-all"},children:t}),i.jsxs("p",{className:oe.sub,children:["Open a chat with your AI and ask it to draft your first agent.",i.jsx("br",{}),"When it’s ready you’ll see it here, waiting for your signature."]})]}),i.jsx(Me,{fullWidth:!0,onClick:e,children:"Open my dashboard"}),i.jsx("p",{className:oe.fineprint,children:"Tip: paste your SMA address into your AI chat to start."})]})}const Ih=[{id:"base",name:"Base",chainId:8453,color:"#0052FF",gas:"$0.18",tier:"L2",sail:!0},{id:"arbitrum",name:"Arbitrum One",chainId:42161,color:"#28A0F0",gas:"$0.42",tier:"L2",sail:!0},{id:"ethereum",name:"Ethereum",chainId:1,color:"#627EEA",gas:"$24.80",tier:"L1",sail:!0},{id:"unichain",name:"Unichain",chainId:130,color:"#FF007A",gas:"$0.10",tier:"L2",sail:!0},{id:"sepolia",name:"Ethereum Sepolia",chainId:11155111,color:"#627EEA",gas:"$0.01",tier:"Testnet",sail:!0},{id:"baseSepolia",name:"Base Sepolia",chainId:84532,color:"#3c6ef5",gas:"$0.01",tier:"Testnet",sail:!0},{id:"arbitrumSepolia",name:"Arbitrum Sepolia",chainId:421614,color:"#28A0F0",gas:"$0.01",tier:"Testnet",sail:!0},{id:"unichainSepolia",name:"Unichain Sepolia",chainId:1301,color:"#FF007A",gas:"$0.01",tier:"Testnet",sail:!0}],eA="base";function Iue({value:e,onChange:t}){const[n,r]=S.useState(!1),s=Ih.filter(c=>e.includes(c.id)),o=s.length===1?s[0]:null;S.useEffect(()=>{if(!n)return;const c=u=>{var d,f;(f=(d=u.target)==null?void 0:d.closest)!=null&&f.call(d,`.${oe.netSelectWrap}`)||r(!1)},l=u=>{u.key==="Escape"&&r(!1)};return window.addEventListener("click",c),window.addEventListener("keydown",l),()=>{window.removeEventListener("click",c),window.removeEventListener("keydown",l)}},[n]);function a(c){const l=e.includes(c)?e.filter(u=>u!==c):[...e,c];l.length!==0&&(t==null||t(l))}return i.jsxs("span",{className:oe.netSelectWrap,children:[i.jsxs("button",{type:"button",className:`${oe.netSelectBtn} ${n?oe.netSelectBtnOpen:""}`,onClick:()=>r(c=>!c),"aria-haspopup":"listbox","aria-expanded":n,children:[o?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:oe.netSelectDot,style:{background:o.color,boxShadow:`0 0 6px ${o.color}66`},"aria-hidden":!0}),i.jsx("span",{className:oe.netSelectName,children:o.name})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:oe.netSelectStack,"aria-hidden":!0,children:s.slice(0,4).map(c=>i.jsx("span",{className:oe.netSelectStackDot,style:{background:c.color,boxShadow:`0 0 6px ${c.color}66`}},c.id))}),i.jsx("span",{className:oe.netSelectName,children:s.length===0?"Select networks":`${s.length} networks`})]}),i.jsx("svg",{viewBox:"0 0 12 12",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round",className:`${oe.netSelectCaret} ${n?oe.netSelectCaretOpen:""}`,"aria-hidden":!0,children:i.jsx("path",{d:"M3 4.5l3 3 3-3"})})]}),n&&i.jsxs("div",{className:oe.netSelectMenu,role:"listbox","aria-multiselectable":"true","aria-label":"EVM networks",children:[i.jsxs("header",{className:oe.netSelectMenuHeader,children:[i.jsx("span",{className:oe.netSelectMenuKicker,children:s.length===0?"Select at least one chain":`${s.length} selected`}),i.jsx("button",{type:"button",className:oe.netSelectMenuLink,onClick:()=>t==null?void 0:t([eA]),children:"Reset"})]}),i.jsx("ul",{className:oe.netSelectMenuList,children:Ih.map(c=>{const l=e.includes(c.id);return i.jsx("li",{children:i.jsxs("button",{type:"button",role:"option","aria-selected":l,className:`${oe.netSelectOption} ${l?oe.netSelectOptionActive:""}`,onClick:()=>a(c.id),children:[i.jsx("span",{className:oe.netSelectDot,style:{background:c.color,boxShadow:`0 0 6px ${c.color}66`},"aria-hidden":!0}),i.jsxs("span",{className:oe.netSelectOptionBody,children:[i.jsxs("span",{className:oe.netSelectOptionName,children:[c.name,c.sail&&i.jsx("span",{style:{marginLeft:6,fontSize:10,color:"var(--accent-blue)",opacity:.9},children:"● Sail"})]}),i.jsxs("span",{className:oe.netSelectOptionMeta,children:[c.tier," · chain ",c.chainId]})]}),i.jsx("span",{className:`${oe.netSelectCheckbox} ${l?oe.netSelectCheckboxOn:""}`,"aria-hidden":!0,children:l&&i.jsx("svg",{viewBox:"0 0 14 14",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})})]})},c.id)})})]})]})}function dl({k:e,v:t,accent:n}){return i.jsxs("div",{className:oe.txRow,children:[i.jsx("dt",{children:e}),i.jsx("dd",{className:n?oe.gas:"",children:t})]})}function M1(){return i.jsx("span",{className:oe.checkBubble,"aria-hidden":!0,children:i.jsx("svg",{viewBox:"0 0 24 24",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M5 12.5l5 5L20 7"})})})}function Mue(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",children:i.jsx("path",{d:"M3 7.5l2.6 2.6L11 4"})})}const Bue="_overlay_1jzwq_1",Tue="_card_1jzwq_13",Pue="_close_1jzwq_19",Rue="_title_1jzwq_33",Lue="_body_1jzwq_40",Due="_meta_1jzwq_48",Oue="_error_1jzwq_68",Fue="_warn_1jzwq_77",$ue="_actions_1jzwq_83",zue="_cancel_1jzwq_89",que="_permList_1jzwq_104",Uue="_permItem_1jzwq_115",Hue="_permLabel_1jzwq_121",Wue="_permCheck_1jzwq_129",Vue="_permName_1jzwq_136",Gue="_permAddr_1jzwq_142",Kue="_confirmList_1jzwq_148",Que="_confirmItem_1jzwq_159",ke={overlay:Bue,card:Tue,close:Pue,title:Rue,body:Lue,meta:Due,error:Oue,warn:Fue,actions:$ue,cancel:zue,permList:que,permItem:Uue,permLabel:Hue,permCheck:Wue,permName:Vue,permAddr:Gue,confirmList:Kue,confirmItem:Que},nx=[{type:"function",name:"revokePermissions",stateMutability:"nonpayable",inputs:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]}],Yue={RevokePermissions:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};async function Jue(e){try{await fetch("/api/activity",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}function Xue({open:e,mandate:t,permissions:n,sma:r,kernel:s,chainId:o,onClose:a,onRevoked:c}){var T,O;const{address:l,chainId:u}=Oe(),d=Ap({chainId:o}),{signTypedDataAsync:f}=Ep(),{sendTransactionAsync:h}=Pc(),{switchChainAsync:p}=Ls(),m=Array.isArray(n)&&n.length>0,[g,_]=S.useState("confirm"),[b,y]=S.useState(new Set),[v,w]=S.useState(""),[x,A]=S.useState(null),{isSuccess:C}=yO({hash:x});if(S.useEffect(()=>{if(!e)return;_(m?"select":"confirm"),y(new Set),w(""),A(null),document.body.style.overflow="hidden";const B=U=>{U.key==="Escape"&&g!=="pending"&&(a==null||a())};return window.addEventListener("keydown",B),()=>{window.removeEventListener("keydown",B),document.body.style.overflow=""}},[e]),S.useEffect(()=>{if(!C||!x||g==="done")return;_("done");const B=m?[...b]:[t==null?void 0:t.address];Promise.all(B.map(U=>Jue({type:"permission_revoked",actor:"owner",permission:U,sma:r,txHash:x,chainId:o}))).then(()=>c==null?void 0:c())},[C,x]),!e)return null;const j=m?[...b]:t!=null&&t.address?[t.address]:[];async function E(){if(!l){w("Connect your owner wallet first.");return}if(!s||!r||j.length===0){w("Select at least one permission to revoke.");return}_("pending"),w("");try{u!==o&&await p({chainId:o});const B=await d.readContract({address:s,abi:nx,functionName:"signerNonces",args:[r]}),U=BigInt(Math.floor(Date.now()/1e3)+600),L=await f({domain:{name:"SailKernel",version:"1",chainId:o,verifyingContract:s},types:Yue,primaryType:"RevokePermissions",message:{account:r,permissions:j,nonce:B,deadline:U}}),N=ht({abi:nx,functionName:"revokePermissions",args:[r,j,U,L]}),H=await h({to:s,data:N,chainId:o});A(H)}catch(B){w((B==null?void 0:B.shortMessage)||(B==null?void 0:B.message)||"Transaction rejected."),_(m?"select":"confirm")}}function I(B){y(U=>{const L=new Set(U);return L.has(B)?L.delete(B):L.add(B),L})}return i.jsx("div",{className:ke.overlay,role:"dialog","aria-modal":"true","aria-label":"Revoke permission",onClick:g==="pending"?void 0:a,children:i.jsxs(Ct,{className:ke.card,onClick:B=>B.stopPropagation(),children:[g!=="pending"&&i.jsx("button",{type:"button",className:ke.close,onClick:a,"aria-label":"Close",children:"×"}),g==="done"?i.jsxs(i.Fragment,{children:[i.jsxs("h2",{className:ke.title,children:["Permission",j.length>1?"s":""," revoked"]}),i.jsxs("p",{className:ke.body,children:[j.length===1?i.jsxs(i.Fragment,{children:[i.jsx("strong",{children:(m?(T=n.find(B=>B.address===j[0]))==null?void 0:T.name:t==null?void 0:t.name)??j[0]})," is no longer attached to your SMA."]}):i.jsxs(i.Fragment,{children:[i.jsxs("strong",{children:[j.length," permissions"]})," removed from your SMA."]})," ","It now appears in Recent Activity."]}),i.jsx("div",{className:ke.actions,children:i.jsx(Me,{onClick:a,children:"Done"})})]}):g==="select"?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:ke.title,children:"Select permissions to revoke"}),i.jsx("p",{className:ke.body,children:"Choose which permissions to remove from your SMA. The agent will no longer be able to act under revoked permissions."}),i.jsx("ul",{className:ke.permList,children:n.map(B=>i.jsx("li",{className:ke.permItem,children:i.jsxs("label",{className:ke.permLabel,children:[i.jsx("input",{type:"checkbox",className:ke.permCheck,checked:b.has(B.address),onChange:()=>I(B.address)}),i.jsx("span",{className:ke.permName,children:B.name??B.address}),i.jsxs("span",{className:ke.permAddr,children:[B.address.slice(0,10),"…",B.address.slice(-6)]})]})},B.address))}),v&&i.jsx("p",{className:ke.error,children:v}),!l&&i.jsx("p",{className:ke.warn,children:"Connect your owner wallet to continue."}),i.jsxs("div",{className:ke.actions,children:[i.jsx("button",{type:"button",className:ke.cancel,onClick:a,children:"Cancel"}),i.jsx(Me,{onClick:()=>{if(b.size===0){w("Select at least one permission.");return}w(""),_("confirm")},disabled:!l,children:"Next"})]})]}):i.jsxs(i.Fragment,{children:[i.jsxs("h2",{className:ke.title,children:["Revoke ",j.length>1?`${j.length} permissions`:"this permission","?"]}),i.jsxs("p",{className:ke.body,children:[j.length>1?`Removing these ${j.length} permissions means the agent can no longer act under them.`:i.jsxs(i.Fragment,{children:["Removing ",i.jsx("strong",{children:(m?(O=n==null?void 0:n.find(B=>B.address===j[0]))==null?void 0:O.name:t==null?void 0:t.name)??"this permission"})," means the agent can no longer act under it."]})," ","You authorize the removal in your wallet and pay gas."]}),m&&j.length>0&&i.jsx("ul",{className:ke.confirmList,children:j.map(B=>{var L;const U=(L=n.find(N=>N.address===B))==null?void 0:L.name;return i.jsx("li",{className:ke.confirmItem,children:U??B},B)})}),!m&&i.jsxs("dl",{className:ke.meta,children:[i.jsxs("div",{children:[i.jsx("dt",{children:"Permission"}),i.jsx("dd",{children:t==null?void 0:t.address})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"SMA"}),i.jsx("dd",{children:r})]})]}),v&&i.jsx("p",{className:ke.error,children:v}),!l&&i.jsx("p",{className:ke.warn,children:"Connect your owner wallet to continue."}),i.jsxs("div",{className:ke.actions,children:[i.jsx("button",{type:"button",className:ke.cancel,onClick:m?()=>_("select"):a,disabled:g==="pending",children:m?"Back":"Cancel"}),i.jsx(Me,{onClick:E,disabled:g==="pending"||!l,children:g==="pending"?"Awaiting wallet…":"Revoke"})]})]})]})})}const Zue="_overlay_x1rfq_7",ede="_card_x1rfq_22",tde="_close_x1rfq_32",nde="_body_x1rfq_49",rde="_kicker_x1rfq_55",sde="_headline_x1rfq_63",ode="_sub_x1rfq_70",ade="_segmented_x1rfq_78",ide="_segmented2_x1rfq_79",cde="_segBtn_x1rfq_89",lde="_segActive_x1rfq_102",ude="_modeNote_x1rfq_107",dde="_field_x1rfq_115",fde="_fieldLabel_x1rfq_120",hde="_input_x1rfq_125",pde="_fieldHint_x1rfq_139",mde="_error_x1rfq_145",gde="_fineprint_x1rfq_151",yde="_addrPanel_x1rfq_159",bde="_revealPanel_x1rfq_160",vde="_addrLabel_x1rfq_169",wde="_revealLabel_x1rfq_170",_de="_addrValue_x1rfq_177",xde="_revealValue_x1rfq_178",kde="_revealNote_x1rfq_190",Cde="_copyBtn_x1rfq_196",jde="_savedList_x1rfq_211",Sde="_savedItem_x1rfq_218",Ade="_savedItemActive_x1rfq_235",Ede="_savedAddr_x1rfq_240",Nde="_savedBadge_x1rfq_247",le={overlay:Zue,card:ede,close:tde,body:nde,kicker:rde,headline:sde,sub:ode,segmented:ade,segmented2:ide,segBtn:cde,segActive:lde,modeNote:ude,field:dde,fieldLabel:fde,input:hde,fieldHint:pde,error:mde,fineprint:gde,addrPanel:yde,revealPanel:bde,addrLabel:vde,revealLabel:wde,addrValue:_de,revealValue:xde,revealNote:kde,copyBtn:Cde,savedList:jde,savedItem:Sde,savedItemActive:Ade,savedAddr:Ede,savedBadge:Nde},rx=8;function sx(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:"this SMA"}function Ide({open:e,safe:t,onClose:n,onCreated:r}){const[s,o]=S.useState("create"),[a,c]=S.useState("privateKey"),[l,u]=S.useState(""),[d,f]=S.useState(""),[h,p]=S.useState(!1),[m,g]=S.useState(""),[_,b]=S.useState(null),[y,v]=S.useState(!1);if(S.useEffect(()=>{if(!e)return;o("create"),c("privateKey"),u(""),f(""),p(!1),g(""),b(null),v(!1),document.body.style.overflow="hidden";const j=E=>{E.key==="Escape"&&!h&&(n==null||n())};return window.addEventListener("keydown",j),()=>{window.removeEventListener("keydown",j),document.body.style.overflow=""}},[e]),!e)return null;const w=s==="create"?"generate":a,x=s==="import";async function A(){if(g(""),d.length<rx){g(`Password must be at least ${rx} characters.`);return}if(x&&!l.trim()){g(a==="privateKey"?"Enter a private key.":"Enter your recovery phrase.");return}p(!0);try{const j=await fetch("/api/signer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:w,secret:x?l.trim():void 0,password:d})}),E=await j.json();if(!j.ok)throw new Error((E==null?void 0:E.error)||"Failed to create signer.");b(E),u(""),f("")}catch(j){g((j==null?void 0:j.message)||"Failed to create signer.")}finally{p(!1)}}function C(){var j;_!=null&&_.revealed&&((j=navigator==null?void 0:navigator.clipboard)!=null&&j.writeText)&&(navigator.clipboard.writeText(_.revealed),v(!0),setTimeout(()=>v(!1),1500))}return i.jsx("div",{className:le.overlay,role:"dialog","aria-modal":"true","aria-label":"Add agent wallet",onClick:h?void 0:n,children:i.jsxs(Ct,{className:le.card,onClick:j=>j.stopPropagation(),children:[!h&&i.jsx("button",{type:"button",className:le.close,onClick:n,"aria-label":"Close",children:"×"}),_?i.jsxs("section",{className:le.body,children:[i.jsx("span",{className:le.kicker,children:"SIGNER READY"}),i.jsx("h2",{className:`${De.displayHeadline} ${le.headline}`,children:"Agent wallet created."}),i.jsxs("p",{className:le.sub,children:["Encrypted on disk for ",sx(t),". It still needs to be delegated on-chain before the agent can sign with it."]}),i.jsxs("div",{className:le.addrPanel,children:[i.jsx("span",{className:le.addrLabel,children:"Signer address"}),i.jsx("code",{className:le.addrValue,children:_.address})]}),_.revealed&&i.jsxs("div",{className:le.revealPanel,children:[i.jsx("span",{className:le.revealLabel,children:"Private key — save it now, shown only once"}),i.jsx("code",{className:le.revealValue,children:_.revealed}),i.jsx("button",{type:"button",className:le.copyBtn,onClick:C,children:y?"Copied ✓":"Copy"}),i.jsx("p",{className:le.revealNote,children:"Anyone with this key controls the signer. Store it in a password manager — never paste it into a chat or commit it to a repo."})]}),i.jsx(Me,{fullWidth:!0,onClick:()=>r==null?void 0:r(_),children:_.revealed?"I've saved it — done":"Done"})]}):i.jsxs("section",{className:le.body,children:[i.jsx("span",{className:le.kicker,children:"DELEGATED SIGNER"}),i.jsx("h2",{className:`${De.displayHeadline} ${le.headline}`,children:"Add an agent wallet."}),i.jsxs("p",{className:le.sub,children:["A hot key the agent uses to sign dispatches for ",sx(t),". It’s encrypted on disk and never leaves this machine."]}),i.jsxs("div",{className:le.segmented,role:"tablist","aria-label":"Signer source",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":s==="create",className:`${le.segBtn} ${s==="create"?le.segActive:""}`,onClick:()=>o("create"),children:"Create new"}),i.jsx("button",{type:"button",role:"tab","aria-selected":s==="import",className:`${le.segBtn} ${s==="import"?le.segActive:""}`,onClick:()=>o("import"),children:"Import"})]}),s==="create"?i.jsx("p",{className:le.modeNote,children:"Generates a fresh random key. You’ll see the private key once, to back up."}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:le.segmented2,children:[i.jsx("button",{type:"button",className:`${le.segBtn} ${a==="privateKey"?le.segActive:""}`,onClick:()=>c("privateKey"),children:"Private key"}),i.jsx("button",{type:"button",className:`${le.segBtn} ${a==="mnemonic"?le.segActive:""}`,onClick:()=>c("mnemonic"),children:"Recovery phrase"})]}),i.jsxs("label",{className:le.field,children:[i.jsx("span",{className:le.fieldLabel,children:a==="privateKey"?"Private key":"Recovery phrase (12 or 24 words)"}),i.jsx("textarea",{className:le.input,rows:a==="privateKey"?2:3,placeholder:a==="privateKey"?"0x…":"word1 word2 word3 …",value:l,onChange:j=>u(j.target.value),autoComplete:"off",spellCheck:!1})]})]}),i.jsxs("label",{className:le.field,children:[i.jsx("span",{className:le.fieldLabel,children:"Encryption password"}),i.jsx("input",{className:le.input,type:"password",placeholder:"At least 8 characters",value:d,onChange:j=>f(j.target.value),autoComplete:"new-password"}),i.jsx("span",{className:le.fieldHint,children:"Encrypts the key on disk. You’ll enter it to run the agent (or set SAIL_PASSPHRASE)."})]}),m&&i.jsx("p",{className:le.error,children:m}),i.jsx(Me,{fullWidth:!0,onClick:A,disabled:h,children:h?"Working…":s==="create"?"Generate signer":"Import signer"}),i.jsx("p",{className:le.fineprint,children:"Self-custody. The key is encrypted locally and never sent anywhere."})]})]})})}const ox=8,Mde=[{type:"function",name:"setManager",stateMutability:"nonpayable",inputs:[{name:"newManager",type:"address"}],outputs:[]}],Bde=[{type:"function",name:"execTransaction",stateMutability:"payable",inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"},{name:"data",type:"bytes"},{name:"operation",type:"uint8"},{name:"safeTxGas",type:"uint256"},{name:"baseGas",type:"uint256"},{name:"gasPrice",type:"uint256"},{name:"gasToken",type:"address"},{name:"refundReceiver",type:"address"},{name:"signatures",type:"bytes"}],outputs:[{name:"success",type:"bool"}]}],ax=[{type:"function",name:"registerPermissions",stateMutability:"payable",inputs:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"deadline",type:"uint256"},{name:"sig",type:"bytes"}],outputs:[]},{type:"function",name:"signerNonces",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]}],Tde={RegisterPermissions:[{name:"account",type:"address"},{name:"permissions",type:"address[]"},{name:"nonce",type:"uint256"},{name:"deadline",type:"uint256"}]};function Pde(e){return HB(["bytes32","bytes32","uint8"],[_r(e,{size:32}),_r("0x",{size:32}),1])}async function ix(e){try{await fetch("/api/activity",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch{}}function Rde({open:e,sma:t,kernel:n,chainId:r,owner:s,currentManager:o,mandates:a=[],initialTo:c=null,onClose:l,onRotated:u}){const{address:d,chainId:f}=Oe(),h=Ap({chainId:r}),{signTypedDataAsync:p}=Ep(),{sendTransactionAsync:m}=Pc(),{switchChainAsync:g}=Ls(),_=(a??[]).map(re=>typeof re=="string"?re:re==null?void 0:re.address).filter(Boolean),[b,y]=S.useState("confirm"),[v,w]=S.useState("create"),[x,A]=S.useState("privateKey"),[C,j]=S.useState(""),[E,I]=S.useState(""),[T,O]=S.useState(!1),[B,U]=S.useState(""),[L,N]=S.useState(null),[H,M]=S.useState(!1),[$,W]=S.useState(null),[ie,de]=S.useState(null),[ye,z]=S.useState(null),[se,ge]=S.useState(!1),[xe,je]=S.useState("");if(S.useEffect(()=>{if(!e)return;y("confirm"),w(c?"saved":"create"),A("privateKey"),j(""),I(""),O(!1),U(""),N(null),M(!1),W(null),de(null),z(null),ge(!1),je(c??""),c&&In(),document.body.style.overflow="hidden";const re=Ke=>{Ke.key==="Escape"&&!T&&b!=="rotating"&&b!=="reattaching"&&(l==null||l())};return window.addEventListener("keydown",re),()=>{window.removeEventListener("keydown",re),document.body.style.overflow=""}},[e]),!e)return null;const Ue=s??d,Fe=d&&Ue&&d.toLowerCase()!==Ue.toLowerCase(),Ze=v==="create"?"generate":x,Nn=v==="import";async function Mt(){if(U(""),E.length<ox){U(`Passphrase must be at least ${ox} characters.`);return}if(Nn&&!C.trim()){U(x==="privateKey"?"Enter a private key.":"Enter your recovery phrase.");return}O(!0);try{const re=await fetch("/api/signer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:Ze,secret:Nn?C.trim():void 0,password:E})}),Ke=await re.json();if(!re.ok)throw new Error((Ke==null?void 0:Ke.error)||"Failed to prepare the new agent wallet.");N(Ke),j(""),I(""),y("backup")}catch(re){U((re==null?void 0:re.message)||"Failed to prepare the new agent wallet.")}finally{O(!1)}}async function In(){ge(!0),U("");try{const re=await fetch("/api/signers");if(!re.ok)throw new Error(re.status===404?"Saved-agent listing needs an updated Sailor UI — restart it (sailor ui stop && sailor ui).":`Could not list saved agents (HTTP ${re.status}).`);const Ke=await re.json().catch(()=>null);z(Array.isArray(Ke==null?void 0:Ke.signers)?Ke.signers:[])}catch(re){z([]),U((re==null?void 0:re.message)||"Could not list saved agents.")}finally{ge(!1)}}function Ot(re){w(re),U(""),re==="saved"&&ye===null&&!se&&In()}const dn=(ye??[]).filter(re=>!o||re.address.toLowerCase()!==o.toLowerCase());function pd(){U("");const re=dn.find(Ke=>Ke.address.toLowerCase()===xe.toLowerCase());if(!re){U("Select a saved agent to rotate to.");return}N({address:re.address,revealed:null,fromSaved:!0}),y("backup")}function md(){var re;L!=null&&L.revealed&&((re=navigator==null?void 0:navigator.clipboard)!=null&&re.writeText)&&(navigator.clipboard.writeText(L.revealed),M(!0),setTimeout(()=>M(!1),1500))}async function gd(re,Ke=8){let Ft;for(let Po=0;Po<Ke;Po++)try{return await h.waitForTransactionReceipt({hash:re})}catch(jr){Ft=jr,await new Promise($c=>setTimeout($c,1500))}throw Ft}async function Oc(){if(!d){U("Connect your owner wallet first.");return}if(!n||!t||!(L!=null&&L.address)){U("Missing SMA, kernel, or new signer.");return}y("rotating"),U("");try{f!==r&&await g({chainId:r});const re=ht({abi:Mde,functionName:"setManager",args:[L.address]}),Ke=ht({abi:Bde,functionName:"execTransaction",args:[n,0n,re,0,0n,0n,0n,bt,bt,Pde(Ue)]}),Ft=await m({to:t,data:Ke,chainId:r});W(Ft),await gd(Ft),await ix({type:"signer_rotated",actor:"owner",sma:t,oldManager:o??null,newManager:L.address,txHash:Ft,chainId:r}),_.length>0?await yd():await Fc(Ft)}catch(re){U((re==null?void 0:re.shortMessage)||(re==null?void 0:re.message)||"Rotation transaction rejected."),y("backup")}}async function yd(){y("reattaching"),U("");try{f!==r&&await g({chainId:r});const re=await h.readContract({address:n,abi:ax,functionName:"signerNonces",args:[t]}),Ke=BigInt(Math.floor(Date.now()/1e3)+600),Ft=await p({domain:{name:"SailKernel",version:"1",chainId:r,verifyingContract:n},types:Tde,primaryType:"RegisterPermissions",message:{account:t,permissions:_,nonce:re,deadline:Ke}}),Po=ht({abi:ax,functionName:"registerPermissions",args:[t,_,Ke,Ft]}),jr=await m({to:n,data:Po,chainId:r});de(jr),await gd(jr),await ix({type:"mandates_reattached",actor:"owner",sma:t,permissions:_,txHash:jr,chainId:r}),await Fc($)}catch(re){U(((re==null?void 0:re.shortMessage)||(re==null?void 0:re.message)||"Re-approval rejected.")+" The signer was rotated, but the mandates are not re-approved yet — reopen this to retry."),y("backup")}}async function Fc(re){try{L!=null&&L.fromSaved&&await fetch("/api/signer/activate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({address:L.address})}),await fetch("/api/manager/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newManager:L==null?void 0:L.address,txHash:re})})}catch{}y("done"),u==null||u()}const $a=b==="rotating"||b==="reattaching";return i.jsx("div",{className:ke.overlay,role:"dialog","aria-modal":"true","aria-label":"Rotate agent keys",onClick:$a?void 0:l,children:i.jsxs(Ct,{className:ke.card,onClick:re=>re.stopPropagation(),children:[!$a&&i.jsx("button",{type:"button",className:ke.close,onClick:l,"aria-label":"Close",children:"×"}),b==="done"?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:ke.title,children:"Agent rotated"}),i.jsxs("p",{className:ke.body,children:[i.jsx("strong",{children:L==null?void 0:L.address})," is now this SMA’s delegated signer.",_.length>0?` ${_.length} mandate(s) were re-approved and bound to it.`:" No mandates were attached, so none needed re-approval."]}),i.jsx("p",{className:ke.body,children:"Fund the new agent wallet so it can pay gas for dispatches, then restart your agent."}),i.jsx("div",{className:ke.actions,children:i.jsx(Me,{onClick:l,children:"Done"})})]}):b==="backup"?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:ke.title,children:L!=null&&L.revealed?"Back up the new agent":"New agent ready"}),i.jsx("p",{className:ke.body,children:L!=null&&L.revealed?"A fresh agent wallet was created and encrypted on disk. Save its private key now — it’s shown only once. Then rotate the SMA to it.":L!=null&&L.fromSaved?"This agent is already saved in this project. Rotate the SMA to it below — its keystore becomes this SMA’s active signer.":"Your agent wallet was imported and encrypted on disk. Rotate the SMA to it below."}),i.jsxs("div",{className:le.addrPanel,children:[i.jsx("span",{className:le.addrLabel,children:"New agent address"}),i.jsx("code",{className:le.addrValue,children:L==null?void 0:L.address})]}),(L==null?void 0:L.revealed)&&i.jsxs("div",{className:le.revealPanel,children:[i.jsx("span",{className:le.revealLabel,children:"Private key — save it now, shown only once"}),i.jsx("code",{className:le.revealValue,children:L.revealed}),i.jsx("button",{type:"button",className:le.copyBtn,onClick:md,children:H?"Copied ✓":"Copy"}),i.jsx("p",{className:le.revealNote,children:"Anyone with this key controls the signer. Store it in a password manager."})]}),_.length>0&&i.jsxs("p",{className:ke.warn,children:["Rotating clears all ",_.length," attached mandate(s); you’ll re-approve them in your wallet right after, rebinding them to the new signer."]}),B&&i.jsx("p",{className:ke.error,children:B}),!d&&i.jsx("p",{className:ke.warn,children:"Connect your owner wallet to continue."}),Fe&&i.jsxs("p",{className:ke.warn,children:["Connected wallet isn’t the SMA owner (",Ue,"). Switch to it to authorize."]}),i.jsxs("div",{className:ke.actions,children:[i.jsx("button",{type:"button",className:ke.cancel,onClick:l,children:"Cancel"}),i.jsx(Me,{onClick:Oc,disabled:!d,children:_.length>0?"Rotate & re-approve":"Rotate signer"})]})]}):$a?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:ke.title,children:b==="rotating"?"Rotating signer…":"Re-approving mandates…"}),i.jsx("p",{className:ke.body,children:b==="rotating"?"Confirm the Safe transaction in your wallet to set the new delegated signer.":"Sign the re-approval and confirm the transaction to rebind your mandates."}),i.jsxs("dl",{className:ke.meta,children:[$&&i.jsxs("div",{children:[i.jsx("dt",{children:"Rotation tx"}),i.jsx("dd",{children:$})]}),ie&&i.jsxs("div",{children:[i.jsx("dt",{children:"Re-approval tx"}),i.jsx("dd",{children:ie})]})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:ke.title,children:"Rotate the agent keys?"}),i.jsx("p",{className:ke.body,children:"Rotate this SMA to a new delegated signer (agent) — the recovery path when the current agent key is lost or compromised. Generate a fresh wallet, or import an existing one by private key or recovery phrase. Set a passphrase to encrypt it on disk."}),i.jsxs("dl",{className:ke.meta,children:[i.jsxs("div",{children:[i.jsx("dt",{children:"SMA"}),i.jsx("dd",{children:t})]}),o&&i.jsxs("div",{children:[i.jsx("dt",{children:"Current agent"}),i.jsx("dd",{children:o})]}),i.jsxs("div",{children:[i.jsx("dt",{children:"Attached mandates"}),i.jsx("dd",{children:_.length})]})]}),i.jsxs("div",{className:le.segmented,role:"tablist","aria-label":"New agent source",children:[i.jsx("button",{type:"button",role:"tab","aria-selected":v==="create",className:`${le.segBtn} ${v==="create"?le.segActive:""}`,onClick:()=>Ot("create"),children:"Create new"}),i.jsx("button",{type:"button",role:"tab","aria-selected":v==="import",className:`${le.segBtn} ${v==="import"?le.segActive:""}`,onClick:()=>Ot("import"),children:"Import"}),i.jsx("button",{type:"button",role:"tab","aria-selected":v==="saved",className:`${le.segBtn} ${v==="saved"?le.segActive:""}`,onClick:()=>Ot("saved"),children:"Use saved"})]}),v==="create"?i.jsx("p",{className:le.modeNote,children:"Generates a fresh random key. You’ll see the private key once, to back up."}):v==="saved"?i.jsx("div",{className:le.savedList,role:"radiogroup","aria-label":"Saved agents",children:se?i.jsx("p",{className:le.modeNote,children:"Loading saved agents…"}):(ye??[]).length===0?i.jsx("p",{className:le.modeNote,children:"No saved agents in this project. Create a new wallet or import one."}):i.jsxs(i.Fragment,{children:[dn.length===0&&i.jsx("p",{className:le.modeNote,children:"The only saved agent is this SMA’s current one. Create a new wallet or import one."}),(ye??[]).map(re=>i.jsxs("label",{className:`${le.savedItem} ${xe.toLowerCase()===re.address.toLowerCase()?le.savedItemActive:""}`,"aria-disabled":re.active,children:[i.jsx("input",{type:"radio",name:"saved-manager",value:re.address,disabled:re.active,checked:xe.toLowerCase()===re.address.toLowerCase(),onChange:()=>je(re.address)}),i.jsx("code",{className:le.savedAddr,children:re.address}),re.active&&i.jsx("span",{className:le.savedBadge,children:"current"})]},re.address))]})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:le.segmented2,children:[i.jsx("button",{type:"button",className:`${le.segBtn} ${x==="privateKey"?le.segActive:""}`,onClick:()=>A("privateKey"),children:"Private key"}),i.jsx("button",{type:"button",className:`${le.segBtn} ${x==="mnemonic"?le.segActive:""}`,onClick:()=>A("mnemonic"),children:"Recovery phrase"})]}),i.jsxs("label",{className:le.field,children:[i.jsx("span",{className:le.fieldLabel,children:x==="privateKey"?"Private key":"Recovery phrase (12 or 24 words)"}),i.jsx("textarea",{className:le.input,rows:x==="privateKey"?2:3,placeholder:x==="privateKey"?"0x…":"word1 word2 word3 …",value:C,onChange:re=>j(re.target.value),autoComplete:"off",spellCheck:!1})]})]}),v!=="saved"&&i.jsxs("label",{className:le.field,children:[i.jsx("span",{className:le.fieldLabel,children:"Encryption passphrase"}),i.jsx("input",{className:le.input,type:"password",placeholder:"At least 8 characters",value:E,onChange:re=>I(re.target.value),autoComplete:"new-password"}),i.jsx("span",{className:le.fieldHint,children:"Encrypts the key on disk. You’ll enter it to run the agent (or set SAIL_PASSPHRASE)."})]}),B&&i.jsx("p",{className:ke.error,children:B}),i.jsxs("div",{className:ke.actions,children:[i.jsx("button",{type:"button",className:ke.cancel,onClick:l,children:"Cancel"}),v==="saved"?i.jsx(Me,{onClick:pd,disabled:T||!xe,children:"Use this agent"}):i.jsx(Me,{onClick:Mt,disabled:T,children:T?"Working…":v==="create"?"Generate new wallet":"Import wallet"})]})]})]})})}const Lde="_overlay_1rcxh_1",Dde="_card_1rcxh_16",Ode="_close_1rcxh_28",Fde="_body_1rcxh_45",$de="_kicker_1rcxh_51",zde="_headline_1rcxh_59",qde="_sub_1rcxh_68",Ude="_addrBlock_1rcxh_75",Hde="_addrRow_1rcxh_84",Wde="_addrDivider_1rcxh_92",Vde="_addrLabel_1rcxh_97",Gde="_addrValue_1rcxh_106",Kde="_addrValueFull_1rcxh_112",Qde="_field_1rcxh_121",Yde="_fieldLabel_1rcxh_127",Jde="_amountWrap_1rcxh_133",Xde="_amountInput_1rcxh_144",Zde="_amountUnit_1rcxh_155",efe="_error_1rcxh_162",We={overlay:Lde,card:Dde,close:Ode,body:Fde,kicker:$de,headline:zde,sub:qde,addrBlock:Ude,addrRow:Hde,addrDivider:Wde,addrLabel:Vde,addrValue:Gde,addrValueFull:Kde,field:Qde,fieldLabel:Yde,amountWrap:Jde,amountInput:Xde,amountUnit:Zde,error:efe};function cx(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:"—"}function tfe({open:e,onClose:t,signer:n,network:r,chainId:s}){const[o,a]=S.useState("0.01"),[c,l]=S.useState(!1),[u,d]=S.useState(""),[f,h]=S.useState(!1),{address:p,chainId:m}=Oe(),{sendTransactionAsync:g}=Pc(),{switchChainAsync:_}=Ls(),b=p&&(n==null?void 0:n.address)&&p.toLowerCase()===n.address.toLowerCase();if(S.useEffect(()=>{if(!e)return;a("0.01"),l(!1),d(""),h(!1),document.body.style.overflow="hidden";const A=C=>{C.key==="Escape"&&!c&&(t==null||t())};return window.addEventListener("keydown",A),()=>{window.removeEventListener("keydown",A),document.body.style.overflow=""}},[e]),!e)return null;const y=o&&/^\d+(\.\d+)?$/.test(o)&&Number(o)>0,v=r?r.charAt(0).toUpperCase()+r.slice(1):null;function w(){var A;(A=navigator==null?void 0:navigator.clipboard)!=null&&A.writeText&&navigator.clipboard.writeText(n.address),h(!0),setTimeout(()=>h(!1),1500)}async function x(){if(y){l(!0),d("");try{s&&m!==s&&await _({chainId:s}),await g({to:n.address,value:rR(o),...s?{chainId:s}:{}}),t==null||t()}catch(A){const C=(A==null?void 0:A.shortMessage)??(A==null?void 0:A.message)??"Transaction rejected.";d(C)}finally{l(!1)}}}return i.jsx("div",{className:We.overlay,role:"dialog","aria-modal":"true","aria-label":"Fund gas",onClick:c?void 0:t,children:i.jsxs(Ct,{className:We.card,onClick:A=>A.stopPropagation(),children:[!c&&i.jsx("button",{type:"button",className:We.close,onClick:t,"aria-label":"Close",children:"×"}),i.jsxs("section",{className:We.body,children:[i.jsx("span",{className:We.kicker,children:"FUND GAS"}),b?i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:We.headline,children:"Send ETH to this address."}),i.jsxs("p",{className:We.sub,children:["This is your connected wallet — you can't send to yourself. Transfer ETH here from an exchange or another wallet",v?` on ${v}`:"","."]}),i.jsx("div",{className:We.addrBlock,children:i.jsx("div",{className:We.addrRow,children:i.jsx("code",{className:We.addrValueFull,children:n.address})})}),i.jsx(Me,{fullWidth:!0,onClick:w,children:f?"Copied ✓":"Copy address"})]}):i.jsxs(i.Fragment,{children:[i.jsx("h2",{className:We.headline,children:"Top up agent wallet."}),i.jsxs("p",{className:We.sub,children:["The agent signs transactions with its local wallet and pays gas from it. Send ETH from your connected wallet to keep it running.",v&&` The transfer happens on ${v}.`]}),i.jsxs("div",{className:We.addrBlock,children:[i.jsxs("div",{className:We.addrRow,children:[i.jsx("span",{className:We.addrLabel,children:"From"}),i.jsx("code",{className:We.addrValue,children:p?cx(p):"no wallet connected"})]}),i.jsx("div",{className:We.addrDivider,"aria-hidden":!0}),i.jsxs("div",{className:We.addrRow,children:[i.jsx("span",{className:We.addrLabel,children:"To · agent wallet"}),i.jsx("code",{className:We.addrValue,children:cx(n.address)})]})]}),i.jsxs("label",{className:We.field,children:[i.jsx("span",{className:We.fieldLabel,children:"Amount"}),i.jsxs("div",{className:We.amountWrap,children:[i.jsx("input",{type:"text",inputMode:"decimal",className:We.amountInput,value:o,autoFocus:!0,onChange:A=>a(A.target.value)}),i.jsx("span",{className:We.amountUnit,children:"ETH"})]})]}),u&&i.jsx("p",{className:We.error,children:u}),i.jsx(Me,{fullWidth:!0,onClick:x,disabled:c||!y,children:c?"Check wallet…":"Send"})]})]})]})})}const nfe="_section_1ihbw_5",rfe="_head_1ihbw_11",sfe="_eyebrow_1ihbw_17",ofe="_loading_1ihbw_25",afe="_health_1ihbw_32",ife="_healthDot_1ihbw_38",cfe="_healthOk_1ihbw_39",lfe="_healthWarn_1ihbw_41",ufe="_chainList_1ihbw_45",dfe="_chainCard_1ihbw_50",ffe="_chainCardActive_1ihbw_59",hfe="_chainCardHead_1ihbw_63",pfe="_chainMeta_1ihbw_70",mfe="_chainName_1ihbw_76",gfe="_chainTag_1ihbw_85",yfe="_chainTagActive_1ihbw_91",bfe="_chainEndpoint_1ihbw_98",vfe="_chainEndpointMissing_1ihbw_107",wfe="_edit_1ihbw_111",_fe="_editBtn_1ihbw_165",xfe="_listLabel_1ihbw_200",kfe="_optionList_1ihbw_234",Cfe="_optionRow_1ihbw_242",jfe="_optionRowActive_1ihbw_265",Sfe="_optionBody_1ihbw_293",Afe="_optionNameRow_1ihbw_294",Efe="_optionName_1ihbw_294",Nfe="_optionTag_1ihbw_302",Ife="_optionTagMuted_1ihbw_308",Mfe="_optionSub_1ihbw_314",Bfe="_optionRadio_1ihbw_320",Tfe="_optionRadioOn_1ihbw_327",Pfe="_fieldBlock_1ihbw_340",Rfe="_fieldLabel_1ihbw_341",Lfe="_field_1ihbw_340",Dfe="_fieldIcon_1ihbw_355",Ofe="_fieldInput_1ihbw_356",Ffe="_fieldOk_1ihbw_362",$fe="_fieldNote_1ihbw_363",zfe="_howBlock_1ihbw_371",qfe="_howTrigger_1ihbw_372",Ufe="_howTriggerIcon_1ihbw_381",Hfe="_howTriggerText_1ihbw_382",Wfe="_howChevron_1ihbw_388",Vfe="_howChevronOpen_1ihbw_392",Gfe="_howPanel_1ihbw_393",Kfe="_howPanelOpen_1ihbw_394",Qfe="_howPanelInner_1ihbw_395",Yfe="_howSteps_1ihbw_403",Jfe="_howStepNum_1ihbw_405",Xfe="_howStepText_1ihbw_410",Zfe="_howLink_1ihbw_411",ehe="_editActions_1ihbw_423",the="_cancelBtn_1ihbw_428",nhe="_saveBtn_1ihbw_440",me={section:nfe,head:rfe,eyebrow:sfe,loading:ofe,health:afe,healthDot:ife,healthOk:cfe,healthWarn:lfe,chainList:ufe,chainCard:dfe,chainCardActive:ffe,chainCardHead:hfe,chainMeta:pfe,chainName:mfe,chainTag:gfe,chainTagActive:yfe,chainEndpoint:bfe,chainEndpointMissing:vfe,edit:wfe,editBtn:_fe,listLabel:xfe,optionList:kfe,optionRow:Cfe,optionRowActive:jfe,optionBody:Sfe,optionNameRow:Afe,optionName:Efe,optionTag:Nfe,optionTagMuted:Ife,optionSub:Mfe,optionRadio:Bfe,optionRadioOn:Tfe,fieldBlock:Pfe,fieldLabel:Rfe,field:Lfe,fieldIcon:Dfe,fieldInput:Ofe,fieldOk:Ffe,fieldNote:$fe,howBlock:zfe,howTrigger:qfe,howTriggerIcon:Ufe,howTriggerText:Hfe,howChevron:Wfe,howChevronOpen:Vfe,howPanel:Gfe,howPanelOpen:Kfe,howPanelInner:Qfe,howSteps:Yfe,howStepNum:Jfe,howStepText:Xfe,howLink:Zfe,editActions:ehe,cancelBtn:the,saveBtn:nhe};async function rhe(){const e=await fetch("/api/onboard/state");if(!e.ok)throw new Error(`onboard/state ${e.status}`);return e.json()}async function she({rpcUrl:e,chainId:t}){const n=await fetch("/api/onboard/save-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rpcUrl:e,chainId:t})});if(!n.ok)throw new Error(`save-config ${n.status}`);return n.json()}const ohe="An RPC is the connection your dashboard uses to read the blockchain and broadcast transactions — like a phone line to the network. Sail talks to the chain directly through it; there's no Sail server in between. A free Alchemy/Infura key (or a public endpoint) works.",ahe=[{id:8453,name:"Base",kind:"mainnet"},{id:42161,name:"Arbitrum",kind:"mainnet"},{id:130,name:"Unichain",kind:"mainnet"},{id:84532,name:"Base Sepolia",kind:"testnet"}],lx=[{id:"alchemy",name:"Alchemy",tag:"Recommended",needsKey:!0,desc:"Free tier, reliable for automation. The Sailor default.",keyHint:"Paste your Alchemy API key",url:"https://dashboard.alchemy.com/apps",urlLabel:"Open Alchemy dashboard",steps:["Create a free account at alchemy.com.",'Click "Create new app" and pick this network.',"Open the app and copy the API key from the top of the page.","Paste it above — one key works across every network."]},{id:"infura",name:"Infura",needsKey:!0,desc:"Free tier. A solid alternative to Alchemy.",keyHint:"Paste your Infura project key",url:"https://app.infura.io/dashboard",urlLabel:"Open Infura dashboard",steps:["Sign up free at infura.io.",'Open "API Keys" and click "Create new API key".',"Under Endpoints, enable this network.","Copy the key and paste it above."]},{id:"custom",name:"Custom / Public",needsKey:!1,desc:"Paste any RPC URL — a public endpoint, your own node, or a private provider."}],ihe={8453:"base-mainnet.g.alchemy.com",42161:"arb-mainnet.g.alchemy.com",130:"unichain-mainnet.g.alchemy.com",84532:"base-sepolia.g.alchemy.com"},che={8453:"base-mainnet.infura.io",42161:"arbitrum-mainnet.infura.io",130:"unichain-mainnet.infura.io",84532:"base-sepolia.infura.io"},B1={8453:"https://mainnet.base.org",42161:"https://arb1.arbitrum.io/rpc",130:"https://mainnet.unichain.org",84532:"https://sepolia.base.org"};function ux(e,t,n){if(e==="infura"){const r=che[t];return r?`https://${r}/v3/${n}`:""}if(e==="alchemy"){const r=ihe[t];return r?`https://${r}/v2/${n}`:""}return n}function dx(e){return!e||/alchemy\.com/i.test(e)?"alchemy":/infura\.io/i.test(e)?"infura":"custom"}function lhe(e){if(!e)return"";const t=e.match(/^(https?:\/\/[^/]+)(\/.*\/)([^/]+)$/);if(!t)return e;const[,n,r,s]=t,o=s.length>6?`${s.slice(0,4)}••••`:"••••";return`${n}${r}${o}`}function uhe({chainId:e,rpcUrl:t,isActive:n,onSaved:r}){const s=ahe.find(j=>j.id===e),[o,a]=S.useState(!1),[c,l]=S.useState("alchemy"),[u,d]=S.useState(""),[f,h]=S.useState(""),[p,m]=S.useState(!1),[g,_]=S.useState(!1),[b,y]=S.useState(!1);function v(){const j=dx(t);l(j),d(""),h(j==="custom"?t??"":B1[e]??""),m(!1),a(!0)}async function w(){let j;c==="custom"?j=f.trim():c==="alchemy"&&u.trim()?j=ux("alchemy",e,u.trim()):c==="infura"&&u.trim()?j=ux("infura",e,u.trim()):j=t,j&&(_(!0),await she({rpcUrl:j,chainId:e}),_(!1),y(!0),setTimeout(()=>y(!1),1600),a(!1),r==null||r())}const x=lx.find(j=>j.id===c),A=(x==null?void 0:x.needsKey)??!1,C=c==="custom"?f.trim().startsWith("http"):!A||u.trim().length>=12||!!t;return i.jsxs("div",{className:`${me.chainCard} ${n?me.chainCardActive:""}`,children:[i.jsxs("div",{className:me.chainCardHead,children:[i.jsxs("div",{className:me.chainMeta,children:[i.jsxs("span",{className:me.chainName,children:[i.jsx(Dp,{chainId:e,size:16}),(s==null?void 0:s.name)??`Chain ${e}`,(s==null?void 0:s.kind)==="testnet"&&i.jsx("span",{className:me.chainTag,children:"testnet"}),n&&i.jsx("span",{className:me.chainTagActive,children:"active"})]}),!o&&i.jsx("span",{className:me.chainEndpoint,children:t?lhe(t):i.jsx("span",{className:me.chainEndpointMissing,children:"Not configured"})})]}),!o&&i.jsx("button",{type:"button",className:me.editBtn,onClick:v,children:b?"Saved ✓":t?"Edit":"Add"})]}),o&&i.jsxs("div",{className:me.edit,children:[i.jsx("span",{className:me.listLabel,children:"Provider"}),i.jsx("ul",{className:me.optionList,children:lx.map(j=>{const E=c===j.id;return i.jsx("li",{children:i.jsxs("button",{type:"button",className:`${me.optionRow} ${E?me.optionRowActive:""}`,onClick:()=>{l(j.id),j.id==="custom"&&h(t??B1[e]??"")},"aria-pressed":E,children:[i.jsxs("span",{className:me.optionBody,children:[i.jsxs("span",{className:me.optionNameRow,children:[i.jsx("span",{className:me.optionName,children:j.name}),j.tag&&i.jsx("span",{className:me.optionTag,children:j.tag}),!j.needsKey&&i.jsx("span",{className:me.optionTagMuted,children:"URL"})]}),i.jsx("span",{className:me.optionSub,children:j.desc})]}),i.jsx("span",{className:`${me.optionRadio} ${E?me.optionRadioOn:""}`,"aria-hidden":!0})]})},j.id)})}),A&&i.jsxs("div",{className:me.fieldBlock,children:[i.jsxs("label",{className:me.fieldLabel,htmlFor:`rpc-key-${e}`,children:[x.name," API key"]}),i.jsxs("div",{className:me.field,children:[i.jsx("span",{className:me.fieldIcon,"aria-hidden":!0,children:i.jsx(fhe,{})}),i.jsx("input",{id:`rpc-key-${e}`,type:"text",className:me.fieldInput,placeholder:t&&dx(t)===c?"•••••••••• (keep current)":x.keyHint,value:u,spellCheck:!1,autoComplete:"off",onChange:j=>d(j.target.value)}),u.trim().length>=12&&i.jsx("span",{className:me.fieldOk,"aria-hidden":!0,children:i.jsx(fx,{})})]}),i.jsxs("p",{className:me.fieldNote,children:["Stored in ",i.jsx("code",{children:".sail/.env.local"}),". Never sent to Sail."]}),i.jsxs("div",{className:me.howBlock,children:[i.jsxs("button",{type:"button",className:me.howTrigger,onClick:()=>m(j=>!j),"aria-expanded":p,children:[i.jsx("span",{className:me.howTriggerIcon,"aria-hidden":!0,children:i.jsx(phe,{})}),i.jsxs("span",{className:me.howTriggerText,children:["Where do I find my ",x.name," key?"]}),i.jsx("span",{className:`${me.howChevron} ${p?me.howChevronOpen:""}`,"aria-hidden":!0,children:i.jsx(mhe,{})})]}),i.jsx("div",{className:`${me.howPanel} ${p?me.howPanelOpen:""}`,"aria-hidden":!p,children:i.jsxs("div",{className:me.howPanelInner,children:[i.jsx("ol",{className:me.howSteps,children:x.steps.map((j,E)=>i.jsxs("li",{children:[i.jsx("span",{className:me.howStepNum,children:String(E+1).padStart(2,"0")}),i.jsx("span",{className:me.howStepText,children:j})]},E))}),i.jsxs("a",{className:me.howLink,href:x.url,target:"_blank",rel:"noreferrer",children:[x.urlLabel,i.jsx(ghe,{})]})]})})]})]}),!A&&i.jsxs("div",{className:me.fieldBlock,children:[i.jsx("label",{className:me.fieldLabel,htmlFor:`rpc-url-${e}`,children:"RPC URL"}),i.jsxs("div",{className:me.field,children:[i.jsx("span",{className:me.fieldIcon,"aria-hidden":!0,children:i.jsx(hhe,{})}),i.jsx("input",{id:`rpc-url-${e}`,type:"text",className:me.fieldInput,placeholder:B1[e]??"https://your-rpc-endpoint",value:f,spellCheck:!1,autoComplete:"off",onChange:j=>h(j.target.value)}),f.trim().startsWith("http")&&i.jsx("span",{className:me.fieldOk,"aria-hidden":!0,children:i.jsx(fx,{})})]}),i.jsxs("p",{className:me.fieldNote,children:["Stored in ",i.jsx("code",{children:".sail/.env.local"})," as ",i.jsxs("code",{children:["RPC_URL_",e]}),"."]})]}),i.jsxs("div",{className:me.editActions,children:[i.jsx("button",{type:"button",className:me.cancelBtn,onClick:()=>a(!1),disabled:g,children:"Cancel"}),i.jsx("button",{type:"button",className:me.saveBtn,onClick:w,disabled:g||!C,children:g?"Saving…":"Save"})]})]})]})}function dhe({deployedChains:e}){const[t,n]=S.useState(null);function r(){rhe().then(n).catch(()=>{})}if(S.useEffect(()=>{r()},[]),!t)return i.jsxs("div",{className:me.section,children:[i.jsx("span",{className:me.eyebrow,children:"RPC /"}),i.jsx("span",{className:me.loading,children:"Reading configuration…"})]});const s=t.rpcByChain??{},o=t.chainId??8453,a=e&&e.length>0?e:[o],c=a.filter(l=>s[l]).length;return i.jsxs("div",{className:me.section,children:[i.jsxs("div",{className:me.head,children:[i.jsxs("span",{className:me.eyebrow,children:["RPC / ",i.jsx($H,{label:"What is an RPC?",children:ohe})]}),i.jsxs("span",{className:`${me.health} ${c>0?me.healthOk:me.healthWarn}`,children:[i.jsx("span",{className:me.healthDot,"aria-hidden":!0}),c>0?`${c} network${c>1?"s":""} configured`:"No networks configured"]})]}),i.jsx("div",{className:me.chainList,children:a.map(l=>i.jsx(uhe,{chainId:l,rpcUrl:s[l]??null,isActive:!!s[l],onSaved:r},l))})]})}function fhe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"5.5",cy:"5.5",r:"3"}),i.jsx("path",{d:"M7.6 7.6l5 5M11 11l1.4-1.4M9.4 9.4l1.4-1.4"})]})}function hhe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M6.5 9.5a3.5 3.5 0 0 0 5 0l1.5-1.5a3.5 3.5 0 0 0-5-5L7.5 3.5"}),i.jsx("path",{d:"M9.5 6.5a3.5 3.5 0 0 0-5 0L3 8a3.5 3.5 0 0 0 5 5l.5-.5"})]})}function fx(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})}function phe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":!0,children:[i.jsx("circle",{cx:"8",cy:"8",r:"6"}),i.jsx("path",{d:"M8 7.2v3.4",strokeLinecap:"round"}),i.jsx("circle",{cx:"8",cy:"5.2",r:"0.8",fill:"currentColor",stroke:"none"})]})}function mhe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 5l4 4 4-4"})})}function ghe(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 9 L9 5"}),i.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}const yhe={ethereum:"eth",arbitrum:"arb1",base:"base",unichain:"unichain",optimism:"oeth",polygon:"matic"},mr={1:"ethereum",42161:"arbitrum",8453:"base",130:"unichain",10:"optimism",137:"polygon",84532:"base sepolia"};function bhe(e,t){return`https://app.safe.global/home?safe=${yhe[e]??"eth"}:${t}`}function qp(e,t){const n={arbitrum:`https://arbiscan.io/address/${t}`,ethereum:`https://etherscan.io/address/${t}`,base:`https://basescan.org/address/${t}`,unichain:`https://uniscan.xyz/address/${t}`,optimism:`https://optimistic.etherscan.io/address/${t}`,polygon:`https://polygonscan.com/address/${t}`};return n[e]??n.ethereum}function vhe(e,t){return`${qp(e,t)}#code`}function br(e){return!e||e.length<12?e??"":`${e.slice(0,6)}…${e.slice(-4)}`}function tA(e){return e?`${e.slice(0,10)}...${e.slice(-7)}`:""}const whe={SharedBoundedSwapPermission:e=>[`Maximum swap size: $${Number(e.maxSwapValueUsd??0).toLocaleString()} USD per transaction`,`Maximum slippage: ${Number(e.maxSlippageBps??0)/100}%`,`Allowed input tokens: ${(e.allowedInputTokens??[]).join(", ")}`,`Allowed output tokens: ${(e.allowedOutputTokens??[]).join(", ")}`,`Allowed protocols: ${(e.allowedProtocols??[]).join(", ")}`],SharedTransferTargetPermission:e=>[`ERC-20 transfers restricted to ${(e.allowedRecipients??[]).length} approved recipient(s)`,`Applies to: ${(e.allowedTokens??[]).length===0?"all tokens":(e.allowedTokens??[]).join(", ")}`,`Approved recipients: ${(e.allowedRecipients??[]).join(", ")}`]};function _he(e){const t=whe[e==null?void 0:e.template];if(!t)return[];try{return t(e.params??{})}catch{return[]}}function nA(e){try{const t=new Date(e),n=t.toLocaleDateString([],{month:"short",day:"numeric"}),r=t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});return`${n}, ${r}`}catch{return e??""}}const xhe={"create-sma":"Create Safe (SMA)","deploy-mandate":"Deploy mandate","register-permission":"Register permission","attach-mandate":"Attach mandate","set-delegate":"Set agent as manager","arbitrary-tx":"Arbitrary transaction"},khe={1:"Ethereum",10:"Optimism",137:"Polygon",8453:"Base",42161:"Arbitrum One",130:"Unichain",84532:"Base Sepolia"},Che={dispatch_executed:"executed dispatch",dispatch_approved:"approved dispatch",dispatch_denied:"denied dispatch",tick_start:"tick started",tick_end:"tick ended",error:"error",log:"log",permission_registered:"registered permission",permission_revoked:"revoked permission",owner_signed:"signed in wallet",owner_rejected:"rejected signing",sma_created:"created Safe (SMA)",mandate_deployed:"deployed mandate",mandate_attached:"attached mandate"},jhe=new Set(["dispatch_executed","dispatch_approved","owner_signed","sma_created","mandate_deployed","mandate_attached","permission_registered"]),She=new Set(["dispatch_denied","error","owner_rejected","permission_revoked"]);function Ahe(e){return jhe.has(e)?"success":She.has(e)?"rejected":"info"}function hx(e){return e.actor==="owner"?"owner":"agent"}const Ehe={owner:"Owner",agent:"Agent"};function Nhe(e){return e.type==="owner_signed"||e.type==="owner_rejected"?e.title??e.reason??e.kind??"":e.type==="sma_created"?br(e.sma):e.type==="mandate_deployed"||e.type==="mandate_attached"?e.name??br(e.address??e.permission):e.type==="permission_registered"||e.type==="permission_revoked"?e.name??br(e.permission):e.permission?br(e.permission):e.reason??e.msg??""}function Ihe(e){const t=Number(e??0);return Number.isFinite(t)?t===0?"0":t<1e-4?t.toFixed(6):t.toFixed(t<1?5:4):"—"}const px={ok:{label:"Funded"},low:{label:"Low gas balance"},critical:{label:"Empty"}},Mhe={manager:{label:"Agent",sub:"Pays gas for every dispatch."},owner:{label:"Owner",sub:"Holds the Safe and signs mandates."},permissionSigner:{label:"Permission signer",sub:"Authorizes which mandates apply."}};function Bhe({chainOverview:e,liveMandates:t,sma:n,onNewMandate:r,onAddSigner:s,onRotateSigner:o,onRevoke:a}){const c=e.chainId,l=e.network??mr[c]??null,u=l?l.charAt(0).toUpperCase()+l.slice(1):`Chain ${c}`,d=e.mandates??[],f=new Map(d.map(m=>[m.name??m.template,m.address])),h=t.length>0?t:d.map(m=>({chainId:c,registeredOnChain:!0,permissions:[{template:m.name??m.template??"Unknown permission",params:{}}]})),p=h.reduce((m,g)=>m+(g.permissions??[]).length,0);return i.jsxs("div",{className:P.chainSection,children:[i.jsxs("div",{className:P.chainSectionHeader,children:[i.jsxs("span",{className:P.chainSectionBadge,children:[i.jsx(Dp,{chainId:c,size:14}),u]}),e.onchainError&&i.jsx("span",{className:P.chainSectionMeta,children:"RPC unavailable"})]}),i.jsxs("section",{className:P.mandatesSection,"aria-label":`${u} mandates`,children:[i.jsxs("header",{className:P.mandatesSectionHead,children:[i.jsxs("h2",{className:P.mandatesSectionTitle,children:[i.jsx(P2,{}),"Your Mandates"]}),i.jsx("span",{className:P.mandatesSectionMeta,children:p>0?`${p} permission${p===1?"":"s"}${e.onchain?" · on-chain":""}`:"No permissions yet"})]}),i.jsx("div",{className:P.mandateList,children:h.length>0?h.map((m,g)=>i.jsx(sA,{mandate:m,network:l,addressByTemplate:f,onRevoke:a},m.signedAt??g)):i.jsx(oA,{onClick:r})})]}),i.jsxs("section",{className:P.signersSection,"aria-label":`${u} account details`,children:[i.jsxs("header",{className:P.mandatesSectionHead,children:[i.jsxs("h2",{className:P.mandatesSectionTitle,children:[i.jsx(lA,{}),"Your Wallets"]}),i.jsx("span",{className:P.mandatesSectionMeta,children:e.onchain?"live balances · refill when low":"Add RPC URL to enable balance tracking"})]}),i.jsx(rA,{overview:e,sma:n,onAddSigner:s,onRotateSigner:o})]})]})}function The({mandates:e,network:t,onchain:n,onRevoke:r}){return i.jsxs("div",{className:P.mandateRows,children:[e.map(s=>i.jsx(Phe,{mandate:s,network:t,onRevoke:r},s.address)),i.jsx("div",{className:P.mandateRowsFoot,children:n?`Reflecting the kernel's live permission set${t?` on ${t}`:""}.`:"Last known set — on-chain confirmation unavailable."})]})}function Phe({mandate:e,network:t,onRevoke:n}){const r=e.name??e.template??"Unrecognized permission",s=!!(e.name??e.template);return i.jsxs("article",{className:`${P.mandateRow} ${s?"":P.mandateRowUnknown}`,children:[i.jsx("span",{className:P.mandateRowIcon,"aria-hidden":!0,children:s?i.jsx(cA,{}):i.jsx(P2,{})}),i.jsxs("span",{className:P.mandateRowBody,children:[i.jsx("span",{className:P.mandateRowName,children:r}),i.jsx("span",{className:P.mandateRowAddr,children:e.address})]}),n&&i.jsx("button",{type:"button",className:P.mandateRowRevoke,onClick:()=>n(e),"aria-label":`Revoke ${r}`,children:"Revoke"}),i.jsx("a",{className:P.mandateRowOpen,href:qp(t??e.network,e.address),target:"_blank",rel:"noreferrer","aria-label":"Open permission contract on block explorer",children:i.jsx(qi,{})})]})}function rA({overview:e,sma:t,onAddSigner:n,onRotateSigner:r}){var p,m;const{address:s}=Oe(),o=(e==null?void 0:e.signers)??[],a=((m=(p=e==null?void 0:e.sma)==null?void 0:p.owner)==null?void 0:m.toLowerCase())??null;let c=!1,l=!1;const u=o.flatMap(g=>{var _,b;if(g.role==="manager"&&((_=g.managers)==null?void 0:_.length)>0){let y=g.managers;g.address&&!y.some(w=>{var x;return((x=w.address)==null?void 0:x.toLowerCase())===g.address.toLowerCase()})&&(y=[{address:g.address,balanceEth:g.balanceEth,isActive:!0},...y]);const v=[];for(const w of y){if(a&&((b=w.address)==null?void 0:b.toLowerCase())===a){c=!0,w.isActive&&(l=!0);continue}v.push({...g,address:w.address,balanceEth:w.balanceEth,status:w.isActive?g.status:"idle",managers:void 0,activeManager:w.isActive})}return v}return g.role==="manager"&&g.address&&a&&g.address.toLowerCase()===a?(c=!0,["local","unconfigured","idle"].includes(g.status)||(l=!0),[]):[g]}),d=u.findIndex(g=>g.role==="owner");if(d!==-1)u[d]={...u[d],isManager:c,managerActive:l};else if(c&&a){const g=o.find(_=>_.role==="manager");u.push({role:"owner",address:e.sma.owner,balanceEth:(g==null?void 0:g.balanceEth)??null,status:g==null?void 0:g.status,isManager:!0,managerActive:l})}const f=!!(e!=null&&e.rpcConfigured)&&!(e!=null&&e.onchain);let h=u;return f&&s&&!h.some(g=>{var _;return((_=g.address)==null?void 0:_.toLowerCase())===s.toLowerCase()})&&(h=[...h,{role:"owner",address:s,balanceEth:null,status:void 0}]),h.length===0?i.jsxs("div",{className:P.signersOffline,children:[i.jsx("p",{className:P.signersOfflineMsg,children:(e==null?void 0:e.rpcConfigured)===!1||e!=null&&e.onchainError?"Add RPC_URL to .sail/.env.local to see balances.":"Reading balances…"}),t&&i.jsx(Me,{variant:"secondary",onClick:n,children:"Add agent wallet"})]}):i.jsx("div",{className:P.signerGrid,children:h.map(g=>i.jsx(Rhe,{signer:g,network:e.network,chainId:e.chainId,loading:f,onAddSigner:n,onRotateSigner:r},g.address?`${g.role}:${g.address}`:g.role))})}function Rhe({signer:e,network:t,chainId:n,loading:r,onAddSigner:s,onRotateSigner:o}){const[a,c]=S.useState(!1),[l,u]=S.useState(!1),d=e.role==="sma"?{label:"SMA",sub:"Holds your funds. Native ETH shown; tokens not counted."}:Mhe[e.role]??{label:e.role,sub:""},f=e.status==="unconfigured",h=e.status==="local",p=e.status==="idle",m=e.role==="manager"&&(e.activeManager!==void 0?e.activeManager:!h&&!f&&!p),g=e.role==="owner"&&e.isManager,_=e.role==="owner"&&e.managerActive,b=(m||_)&&o,y=e.role==="sma"||f||h||p?null:px[e.status]??px.ok,v=h&&e.balanceEth!=null?Number(e.balanceEth):null,w=e.balanceEth!=null?Number(e.balanceEth):null,x=!!r&&!f&&e.balanceEth==null,A=!f&&!p&&e.role!=="sma"&&w===0,C=e.status==="critical"||A,j=!x&&(e.status==="low"||C||h&&(v===null||v<.002));function E(){var I;(I=navigator==null?void 0:navigator.clipboard)!=null&&I.writeText&&navigator.clipboard.writeText(e.address),c(!0),setTimeout(()=>c(!1),1400)}return i.jsxs("article",{className:`${P.signerCard} ${j?P.signerCardWarn:""} ${C?P.signerCardCrit:""}`,children:[i.jsxs("header",{className:P.signerCardHead,children:[i.jsxs("span",{className:P.signerRoleWrap,children:[i.jsx("span",{className:P.signerRole,children:d.label}),!x&&m&&i.jsx("span",{className:P.activeTag,title:"Registered as this SMA's delegated signer on-chain",children:"Active"})]}),x?i.jsxs("span",{className:`${P.balancePill} ${P.balancePillLoading}`,children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0}),"Reading…"]}):i.jsxs(i.Fragment,{children:[_?i.jsxs("span",{className:P.balancePill,style:{color:"#1990FF"},title:"This EOA is also registered as the SMA's delegated manager on-chain",children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0,style:{background:"#1990FF"}}),"Active manager"]}):g?i.jsxs("span",{className:P.balancePill,style:{color:"var(--text-secondary)"},title:"This EOA is a known manager for this SMA, not currently active on-chain",children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0,style:{background:"rgba(255,255,255,0.25)"}}),"Manager"]}):null,p&&i.jsxs("span",{className:P.balancePill,style:{color:"var(--text-secondary)"},children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0,style:{background:"rgba(255,255,255,0.25)"}}),"Idle"]}),y&&i.jsxs("span",{className:`${P.balancePill} ${P[`balancePill_${e.status}`]??""}`,children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0}),y.label]}),h&&i.jsxs("span",{className:P.balancePill,style:{color:"var(--text-secondary)"},children:[i.jsx("span",{className:P.balancePillDot,"aria-hidden":!0,style:{background:"var(--accent-blue)"}}),"Not registered"]})]})]}),i.jsxs("div",{className:P.signerBalance,children:[!f&&i.jsx("span",{className:P.ethGlyph,"aria-hidden":!0,children:i.jsx(npe,{})}),f?i.jsx("span",{className:P.signerBalanceNum,style:{opacity:.4},children:"—"}):x?i.jsxs(i.Fragment,{children:[i.jsx("span",{className:`${P.signerBalanceNum} ${P.signerBalanceNumLoading}`,"aria-label":"Loading balance",children:"0.0000"}),i.jsx("span",{className:`${P.signerBalanceUnit} ${P.signerBalanceNumLoading}`,children:"ETH"})]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{className:P.signerBalanceNum,children:Ihe(e.balanceEth)}),i.jsx("span",{className:P.signerBalanceUnit,children:"ETH"})]})]}),i.jsx("p",{className:P.signerSub,children:f?"No agent wallet assigned yet — create or import one to let your agent sign.":h?"Local key — not yet delegated.":p?"Known manager — not currently active on-chain.":d.sub}),f&&i.jsx(Me,{fullWidth:!0,variant:"secondary",onClick:s,children:"Add agent wallet"}),e.address&&i.jsxs("footer",{className:P.signerFoot,children:[i.jsxs("button",{type:"button",className:P.signerAddrPill,onClick:E,title:e.address,"aria-label":"Copy signer address",children:[i.jsx("span",{className:P.signerAddrMono,children:br(e.address)}),i.jsx("span",{className:P.signerAddrIcon,"aria-hidden":!0,children:a?i.jsx(T2,{}):i.jsx(iA,{})})]}),i.jsx("a",{className:P.signerAddrOpen,href:qp(t,e.address),target:"_blank",rel:"noreferrer","aria-label":"Open on block explorer",children:i.jsx(qi,{})})]}),b&&i.jsx("button",{type:"button",className:P.signerRotateBtn,onClick:()=>o(),children:"Rotate agent keys"}),e.role==="manager"&&p&&o&&i.jsx("button",{type:"button",className:P.signerRotateBtn,onClick:()=>o(e.address),children:"Rotate to this"}),i.jsx("div",{className:P.signerSpacer}),j&&i.jsxs("div",{className:P.signerTopUp,children:[i.jsx("span",{className:P.signerTopUpMsg,children:C?"Out of gas — agent is stalled.":"Running low — top up soon."}),i.jsx("button",{type:"button",className:P.signerFundBtn,onClick:()=>u(!0),children:"Fund Gas"})]}),i.jsx(tfe,{open:l,onClose:()=>u(!1),signer:e,network:t,chainId:n})]})}function sA({mandate:e,network:t,addressByTemplate:n,onRevoke:r}){const s=(e==null?void 0:e.permissions)??[],o=e!=null&&e.registeredOnChain?"active":"pending",a=e!=null&&e.signedAt?new Date(e.signedAt).toLocaleDateString():"",c=(()=>{const u=t??(e!=null&&e.chainId?mr[e.chainId]:null);return u?u.charAt(0).toUpperCase()+u.slice(1):null})(),l=r?(()=>{const u=new Set;return s.map(d=>({name:d.template,address:n==null?void 0:n.get(d.template)})).filter(d=>{if(!d.address)return!1;const f=d.address.toLowerCase();return u.has(f)?!1:(u.add(f),!0)})})():[];return i.jsxs("article",{className:P.mandateSummary,children:[i.jsxs("header",{className:P.mandateSummaryHead,children:[i.jsxs("div",{className:P.mandateSummaryHeadText,children:[i.jsxs("span",{className:P.mandateSummaryKicker,children:["Live mandate",a?` · signed ${a}`:""]}),i.jsx("h3",{className:P.mandateSummaryTitle,children:c?`Mandate · ${c}`:"Mandate"})]}),i.jsxs("div",{className:P.mandateSummaryHeadRight,children:[i.jsx(Bu,{status:o}),i.jsxs("span",{className:P.mandateSummaryCount,children:[s.length," permission",s.length===1?"":"s"]})]})]}),i.jsx("ul",{className:P.mandateSummaryPerms,children:s.map((u,d)=>{const f=n==null?void 0:n.get(u.template),h=i.jsxs("span",{className:P.mandateSummaryPermBody,children:[i.jsx("span",{className:P.mandateSummaryPermLabel,children:u.template}),(u.explanation?String(u.explanation).split("; "):_he(u)).map((p,m)=>i.jsx("span",{className:P.mandateSummaryPermSub,children:p},m))]});return i.jsxs("li",{className:P.mandateSummaryPermRow,children:[i.jsx("span",{className:P.mandateSummaryCheck,"aria-hidden":!0,children:i.jsx(cA,{})}),f?i.jsxs("a",{className:P.mandateSummaryPermLink,href:vhe(c,f),target:"_blank",rel:"noreferrer",title:f,children:[h,i.jsx("span",{className:P.mandateSummaryPermArrow,"aria-hidden":!0,children:i.jsx(qi,{})})]}):h]},`${u.template}-${d}`)})}),i.jsxs("footer",{className:P.mandateSummaryFoot,children:[i.jsx("span",{className:P.mandateSummaryFootMeta,children:o==="active"?"Registered on-chain":"Signed — awaiting on-chain registration"}),l.length>0&&i.jsx("button",{type:"button",className:P.mandateRevokeBtn,onClick:()=>r(l),children:"Revoke permission"})]})]})}const mx={arbitrum:e=>`https://arbiscan.io/tx/${e}`,ethereum:e=>`https://etherscan.io/tx/${e}`,base:e=>`https://basescan.org/tx/${e}`,optimism:e=>`https://optimistic.etherscan.io/tx/${e}`,polygon:e=>`https://polygonscan.com/tx/${e}`};function Lhe(e,t){return(mx[e]??mx.ethereum)(t)}const Dhe=[{key:"all",label:"All"},{key:"owner",label:"Owner"},{key:"agent",label:"Agent"}];function Ohe(e,t=new Map){const n=[];let r=null;for(const s of e){const o=s.chainId??(s.permission?t.get(s.permission.toLowerCase())??null:null);s.type==="tick_start"?(r={kind:"tick",startTs:s.ts,endTs:null,durationMs:null,logs:[],complete:!1,chainIds:new Set},o&&r.chainIds.add(o)):s.type==="tick_end"&&r?(o&&r.chainIds.add(o),r.endTs=s.ts,r.durationMs=new Date(s.ts)-new Date(r.startTs),r.complete=!0,n.push(r),r=null):s.type==="log"&&r?s.msg&&r.logs.push(s.msg):s.type!=="tick_start"&&s.type!=="tick_end"&&s.type!=="log"?(r&&(o&&r.chainIds.add(o),n.push(r),r=null),n.push({kind:"event",event:{...s,chainId:o}})):r&&o&&r.chainIds.add(o)}return r&&n.push({kind:"tick",...r}),n.reverse()}function Fhe(e){return e?e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`:""}function $he({tick:e,positions:t}){const[n,r]=S.useState(!1),s=!e.complete,o=e.logs.find(d=>d.includes("hold")||d.includes("below threshold")),a=e.logs.find(d=>d.includes("rebalance")||d.includes("deposit")||d.includes("withdraw")),c=e.logs.find(d=>d.startsWith("portfolio:")),l=a??o??c??e.logs[0]??(s?"Running…":"Tick complete"),u=(t==null?void 0:t.reduce((d,f)=>d+(f.valueUsd??0),0))??null;return i.jsxs("li",{className:P.tickCard,children:[i.jsxs("button",{type:"button",className:P.tickCardHead,onClick:()=>r(d=>!d),"aria-expanded":n,children:[i.jsx("span",{className:`${P.tickDot} ${s?P.tickDotLive:""}`,"aria-hidden":!0}),i.jsxs("span",{className:P.tickMeta,children:[i.jsx("span",{className:P.tickTime,children:nA(e.startTs)}),e.durationMs!=null&&i.jsx("span",{className:P.tickDuration,children:Fhe(e.durationMs)})]}),i.jsx("span",{className:P.tickHeadline,children:l}),u!=null&&i.jsxs("span",{className:P.tickValue,children:["$",u.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),i.jsx("span",{className:P.tickChevron,"aria-hidden":!0,children:n?"▴":"▾"})]}),n&&i.jsxs("div",{className:P.tickBody,children:[e.logs.map((d,f)=>i.jsx("p",{className:P.tickLog,children:d},f)),t&&t.length>0&&i.jsx("div",{className:P.tickPositions,children:t.map(d=>i.jsxs("div",{className:P.tickPosition,children:[i.jsx("span",{className:P.tickPositionToken,children:(d.token??"token").toUpperCase()}),i.jsxs("span",{className:P.tickPositionValue,children:["$",(d.valueUsd??0).toFixed(2)]}),d.protocol&&i.jsx("span",{className:P.tickPositionProto,children:d.protocol})]},d.vaultAddress))})]})]})}function zhe({source:e,pid:t,pids:n}){const[r,s]=S.useState(!1),o=S.useRef(null);S.useEffect(()=>{if(!r)return;const l=u=>{o.current&&!o.current.contains(u.target)&&s(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]);const a=e==="remote"?"remote agent":e==="github-actions"?"github actions":"Running",c=e==="local"&&n.length>0;return i.jsxs("div",{className:P.agentSourceWrap,ref:o,children:[i.jsxs("button",{type:"button",className:`${P.agentRunningBadge} ${c?P.agentRunningBadgeClickable:""}`,onClick:()=>c&&s(l=>!l),"aria-haspopup":c?"true":void 0,"aria-expanded":r,children:[i.jsx("span",{className:P.agentRunningDot,"aria-hidden":!0}),a,c&&i.jsx("svg",{className:`${P.agentSourceChevron} ${r?P.agentSourceChevronOpen:""}`,width:"8",height:"8",viewBox:"0 0 8 8",fill:"none","aria-hidden":"true",children:i.jsx("path",{d:"M1.5 3L4 5.5L6.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),r&&i.jsx("div",{className:P.agentSourcePanel,children:n.map(({chainId:l,pid:u})=>{const d=l?mr[l]??`chain ${l}`:"unknown chain";return i.jsxs("div",{className:P.agentSourceRow,children:[i.jsx("span",{className:P.agentSourceChain,children:d}),i.jsxs("span",{className:P.agentSourcePid,children:["PID ",u]})]},l??u)})})]})}function qhe({deployedChains:e,chainFilter:t,onChainFilterChange:n}){return e.length<=1?null:i.jsxs("div",{className:P.activityFilter,role:"tablist","aria-label":"Filter by chain",style:{marginBottom:14},children:[i.jsx("button",{type:"button",role:"tab","aria-selected":t==="all",className:`${P.activityFilterBtn} ${t==="all"?P.activityFilterBtnActive:""}`,onClick:()=>n("all"),children:"All chains"}),e.map(r=>{const s=mr[r],o=s?s.charAt(0).toUpperCase()+s.slice(1):`Chain ${r}`;return i.jsx("button",{type:"button",role:"tab","aria-selected":t===String(r),className:`${P.activityFilterBtn} ${t===String(r)?P.activityFilterBtnActive:""}`,onClick:()=>n(String(r)),children:o},r)})]})}function Uhe({events:e,positions:t,network:n,permToChain:r=new Map,chainFilter:s="all",actorFilter:o="all"}){const[c,l]=S.useState(8);S.useEffect(()=>{l(8)},[o,s]);const d=Ohe(e,r).filter(m=>{var b;const g=o==="all"||(m.kind==="tick"?o==="agent":hx(m.event)===o),_=s==="all"||(m.kind==="tick"?(b=m.chainIds)==null?void 0:b.has(Number(s)):m.event.chainId===Number(s));return g&&_}),f=d.slice(0,c),h=d.length>c,p=[o!=="all"?o:null,s!=="all"?mr[Number(s)]??s:null].filter(Boolean).join(" · ");return i.jsx(i.Fragment,{children:f.length===0?i.jsx("div",{className:P.emptyAgents,children:i.jsxs("p",{className:P.emptyAgentsBody,children:["No ",p?`${p} `:"","activity yet."]})}):i.jsxs(i.Fragment,{children:[i.jsx("ul",{className:`${Ie.journalList} ${P.tickList}`,children:f.map((m,g)=>{if(m.kind==="tick")return i.jsx($he,{tick:m,positions:t},`tick-${m.startTs}-${g}`);const _=m.event,b=Ahe(_.type),y=hx(_),v=_.txHash&&_.txHash!=="0x",w=Nhe(_);return i.jsx("li",{children:i.jsxs("div",{className:Ie.journalRow,children:[i.jsx("span",{className:Ie.journalTime,children:nA(_.ts)}),i.jsxs("span",{className:`${Ie.journalMark} ${Ie[`jStatus_${b}`]??""}`,"aria-hidden":!0,children:[b==="success"&&i.jsx(T2,{}),b==="rejected"&&i.jsx(Xhe,{}),b==="info"&&i.jsx(Zhe,{})]}),i.jsxs("span",{className:Ie.journalBody,children:[i.jsxs("span",{className:Ie.journalTitle,children:[i.jsx("span",{className:`${P.activityActor} ${P[`activityActor_${y}`]??""}`,children:Ehe[y]}),i.jsx("span",{className:Ie.journalAction,children:Che[_.type]??_.type})]}),i.jsxs("span",{className:Ie.journalMeta,children:[w,v&&i.jsxs(i.Fragment,{children:[w?" · ":"",i.jsx("a",{href:Lhe(n??"ethereum",_.txHash),target:"_blank",rel:"noreferrer",children:br(_.txHash)})]})]})]})]})},`${_.ts}-${g}`)})}),h&&i.jsx("div",{style:{marginTop:"12px",textAlign:"center"},children:i.jsx("button",{type:"button",onClick:()=>l(m=>m+10),style:{padding:"6px 14px",fontSize:"13px",borderRadius:"6px",border:"1px solid #3a3f4a",background:"transparent",color:"#9aa0ae",cursor:"pointer"},children:"Load more"})})]})})}let ff=null;function gx(){try{if(JSON.parse(localStorage.getItem("sail.account")??"null"))return{hasAccount:!0}}catch{}return null}function T1(){const[e,t]=S.useState(()=>ff??gx()),[n,r]=S.useState(()=>ff!==null||gx()!==null),{draft:s}=S2(),[o,a]=S.useState(!1);function c(){fetch("/api/onboard/state").then(u=>u.json()).then(u=>{ff=u,t(u),r(!0)}).catch(()=>r(!0))}function l(){const u={...e??{},hasAccount:!0};ff=u,t(u),r(!0),c()}return S.useEffect(()=>{c()},[]),S.useEffect(()=>{if(e!=null&&e.hasAccount)return;const u=setInterval(c,2e3);return()=>clearInterval(u)},[e==null?void 0:e.hasAccount]),n?!(e!=null&&e.hasAccount)&&!o?i.jsx(qoe,{onboardState:e,onComplete:l,onSkip:()=>a(!0)}):i.jsx(Hhe,{draft:s,onReset:c,wizardSkipped:o}):i.jsx("div",{className:`${De.pageShell} ${P.shell}`,children:i.jsx(N2,{})})}function Hhe({draft:e,onReset:t,wizardSkipped:n}){var R2,L2,D2,O2,F2,$2,z2,q2,U2,H2;const{isConnected:r,address:s}=Oe(),{disconnect:o}=Tc(),{openConnectModal:a}=Oa(),[c,l]=S.useState(0),[u,d]=S.useState(!1),[f,h]=S.useState(!1),[p,m]=S.useState(null),[g,_]=S.useState(null),{account:b,loading:y}=dd(c),{accounts:v}=fK(c),{overview:w}=pK(c),{overviews:x}=vK(c),A=new Map;for(const J of x)for(const Ee of J.mandates??[])Ee.address&&A.set(Ee.address.toLowerCase(),J.chainId);const{mandates:C}=Fp(c),{events:j}=kS(c),{positions:E}=bK(c),{running:I,pid:T,pids:O,source:B}=mK(),{pending:U}=gK(),[L,N]=S.useState(()=>{try{return JSON.parse(localStorage.getItem("sail.account")??"null")}catch{return null}}),[H,M]=S.useState(!1),[$,W]=S.useState(!1),[ie,de]=S.useState(!1),[ye,z]=S.useState(!1),[se,ge]=S.useState(!1),[xe,je]=S.useState(null),[Ue,Fe]=S.useState(null),[Ze,Nn]=S.useState(null),[Mt,In]=S.useState("all"),[Ot,dn]=S.useState("all"),[pd,md]=S.useState({}),[gd,Oc]=S.useState(!1),[yd,Fc]=S.useState(""),$a=(R2=w==null?void 0:w.sma)!=null&&R2.address?{safe:w.sma.address,owner:w.sma.owner,permissionSigner:w.sma.permissionSigner,manager:w.sma.manager,chainId:w.chainId}:null,re=$a??b??L,Ke=re!=null,Ft=(w==null?void 0:w.mandates)??[],Po=(D2=(L2=$a??b)==null?void 0:L2.safe)==null?void 0:D2.toLowerCase(),jr=C.filter(J=>J.safe!=null?J.safe.toLowerCase()===Po:v.length<=1),$c=jr.length>0,uA=$c||I,zc=re?mr[re.chainId]??"ethereum":null,He=re?{id:"live-sma",name:"My SMA",address:re.safe,network:zc}:null,Sr=(re==null?void 0:re.owner)??s??null,$t=v.find(J=>J.active)??v[0]??null,Ro=(()=>{const J=new Set(($t==null?void 0:$t.deployedChains)??[]);for(const Ee of x)(Ee==null?void 0:Ee.chainId)!=null&&J.add(Number(Ee.chainId));return($t==null?void 0:$t.chainId)!=null&&J.add(Number($t.chainId)),[...J].filter(Ee=>Number.isFinite(Ee)&&Ee>0)})(),bd=Ro.length>1,vd=pd[($t==null?void 0:$t.safe)??"live-sma"]??($t==null?void 0:$t.name)??(He==null?void 0:He.name)??"My SMA",za=($t==null?void 0:$t.safe)??(re==null?void 0:re.safe)??"live-sma",dA=v.length>0?(()=>{var Ee;const J=new Map;for(const yt of v){const Yr=yt.safe.toLowerCase(),ir=mr[yt.chainId]??"ethereum",mA=((Ee=yt.safe)==null?void 0:Ee.toLowerCase())===(za==null?void 0:za.toLowerCase()),W2=yt.deployedChains?yt.deployedChains.map(qa=>mr[qa]??"ethereum").filter(Boolean):null;if(!J.has(Yr))J.set(Yr,{id:yt.safe,name:pd[yt.safe]??yt.name??"My SMA",address:yt.safe,network:ir,networks:W2??[ir],mandateCount:mA?bd&&x.length>0?x.reduce((qa,Up)=>qa+(Up.mandateCount??0),0):(w==null?void 0:w.mandateCount)??0:0,createdAt:yt.addedAt??null});else{const qa=J.get(Yr),Up=W2??[ir];for(const V2 of Up)qa.networks.includes(V2)||qa.networks.push(V2)}}return[...J.values()]})():He?[{...He,name:vd,networks:Ro.length>0?Ro.map(J=>mr[J]??"ethereum").filter(Boolean):[zc],mandateCount:bd&&x.length>0?x.reduce((J,Ee)=>J+(Ee.mandateCount??0),0):(w==null?void 0:w.mandateCount)??0,createdAt:null}]:[],fA=He?bhe(He.network,He.address):"#",hA=He?`https://debank.com/profile/${He.address}`:"#";function pA(){var J;He&&((J=navigator==null?void 0:navigator.clipboard)!=null&&J.writeText&&navigator.clipboard.writeText(He.address),M(!0),setTimeout(()=>M(!1),1400))}return i.jsxs("div",{className:`${De.pageShell} ${P.shell}`,children:[i.jsx(N2,{}),i.jsxs("header",{className:P.header,children:[i.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:8},children:[i.jsx("button",{type:"button",className:P.brand,onClick:()=>{window.location.hash="#/dashboard"},"aria-label":"Go to dashboard",children:i.jsx(Dt,{size:48,animate:!0})}),i.jsx(ace,{})]}),i.jsxs("div",{className:P.topActionsPill,children:[i.jsx(Yhe,{pending:U,draft:e,open:ie,onToggle:()=>de(J=>!J),onClose:()=>de(!1),onOpenStation:()=>{de(!1),window.location.hash="#/station"},onOpenSigning:()=>{de(!1),window.location.hash="#/station"}}),i.jsxs("button",{type:"button",className:P.avatarBtn,onClick:r?()=>z(!0):a,"aria-label":r&&Sr?`Profile (${br(Sr)})`:"Connect wallet",title:r&&Sr?Sr:void 0,children:[i.jsx("span",{className:P.avatarBtnMonogram,"aria-hidden":!0,children:r&&Sr?Sr.slice(2,4).toUpperCase():"—"}),i.jsx("span",{className:P.avatarBtnAddr,children:r&&Sr?br(Sr):"Not connected"})]})]})]}),i.jsx("main",{className:Ie.main,children:r&&Ke&&s&&(re!=null&&re.owner)&&s.toLowerCase()!==re.owner.toLowerCase()?i.jsx(Whe,{projectOwner:re.owner,connectedAddress:s,onReset:async()=>{await fetch("/api/account",{method:"DELETE"}).catch(()=>{}),t()},onConnect:a}):r?!Ke&&y?i.jsx(Vhe,{}):Ke?i.jsxs(i.Fragment,{children:[e&&B2(e)>0&&i.jsx(Khe,{draft:e,onReview:()=>{window.location.hash="#/station"}}),U.length>0&&i.jsx(Qhe,{count:U.length,onReview:()=>{window.location.hash="#/station"}}),i.jsxs("section",{className:Ie.titleBlock,children:[i.jsxs("div",{className:P.titleHeadFlex,children:[gd?i.jsx("input",{className:P.titleNameInput,value:yd,autoFocus:!0,maxLength:40,onChange:J=>Fc(J.target.value),onBlur:()=>{const J=yd.trim();J&&J!==vd&&(md(Ee=>({...Ee,[za]:J})),F6(za,J).catch(()=>{}),l(Ee=>Ee+1)),Oc(!1)},onKeyDown:J=>{J.key==="Enter"&&J.target.blur(),J.key==="Escape"&&Oc(!1)}}):i.jsxs("button",{type:"button",className:P.titleNameBtn,onClick:()=>{Fc(vd),Oc(!0)},title:"Click to rename",children:[i.jsx("h1",{className:Ie.title,children:vd}),i.jsx(tpe,{})]}),(w==null?void 0:w.sma)&&i.jsxs("div",{className:P.smaBadges,children:[(Ro.length>0?Ro.map(J=>({id:J,name:mr[J]})).filter(J=>J.name):w.network?[{id:w.chainId,name:w.network}]:[]).map(J=>i.jsxs("span",{className:P.smaBadge,children:[J.id!=null&&i.jsx(Dp,{chainId:J.id,size:13}),J.name]},J.name)),i.jsx(Bu,{status:I?"active":"paused",kind:"agent"}),B&&i.jsx(zhe,{source:B,pid:T,pids:O})]})]}),i.jsx("div",{className:Ie.addrRow,children:i.jsxs("button",{type:"button",className:Ie.addrPill,onClick:pA,"aria-label":"Copy SMA address",title:He==null?void 0:He.address,children:[i.jsx("span",{className:Ie.addrMono,children:tA(He==null?void 0:He.address)}),i.jsx("span",{className:Ie.addrIcon,"aria-hidden":!0,children:H?i.jsx(T2,{}):i.jsx(iA,{})}),i.jsx("a",{href:qp(He==null?void 0:He.network,He==null?void 0:He.address),target:"_blank",rel:"noreferrer",className:Ie.addrOpen,onClick:J=>J.stopPropagation(),"aria-label":"Open SMA on block explorer",children:i.jsx(qi,{})})]})})]}),i.jsxs("section",{className:`${Ie.quickLinks} ${P.quickLinksLarge}`,"aria-label":"Quick links",children:[i.jsxs("a",{className:`${Ie.quickLink} ${P.quickLinkLarge}`,href:hA,target:"_blank",rel:"noreferrer",children:[i.jsxs("span",{className:Ie.qlText,children:[i.jsx("span",{className:`${Ie.qlTitle} ${P.qlTitleLarge}`,children:"View portfolio"}),i.jsx("span",{className:Ie.qlSub,children:"opens DeBank"})]}),i.jsx("span",{className:Ie.qlArrow,"aria-hidden":!0,children:i.jsx(qi,{})})]}),i.jsxs("a",{className:`${Ie.quickLink} ${P.quickLinkLarge}`,href:fA,target:"_blank",rel:"noreferrer",children:[i.jsxs("span",{className:Ie.qlText,children:[i.jsx("span",{className:`${Ie.qlTitle} ${P.qlTitleLarge}`,children:"Manage SMA"}),i.jsx("span",{className:Ie.qlSub,children:"opens Safe"})]}),i.jsx("span",{className:Ie.qlArrow,"aria-hidden":!0,children:i.jsx(qi,{})})]})]}),bd&&x.length>0?x.map(J=>{var yt,Yr;const Ee=C.filter(ir=>(ir.safe==null||ir.safe.toLowerCase()===Po)&&ir.chainId===J.chainId);return i.jsx(Bhe,{chainOverview:J,liveMandates:Ee,sma:He,onNewMandate:()=>je({variant:"new",context:"mandate"}),onAddSigner:()=>d(!0),onRotateSigner:J!=null&&J.kernel&&((yt=J==null?void 0:J.sma)!=null&&yt.address)?ir=>{_({sma:J.sma.address,kernel:J.kernel,chainId:J.chainId,owner:J.sma.owner,currentManager:J.sma.manager,mandates:J.mandates??[]}),m(ir??null),h(!0)}:void 0,onRevoke:J!=null&&J.kernel&&((Yr=J==null?void 0:J.sma)!=null&&Yr.address)?ir=>{Nn({sma:J.sma.address,kernel:J.kernel,chainId:J.chainId}),Fe(ir)}:void 0},J.chainId)}):i.jsxs(i.Fragment,{children:[i.jsxs("section",{className:P.mandatesSection,"aria-label":"Your mandates",children:[i.jsxs("header",{className:P.mandatesSectionHead,children:[i.jsxs("h2",{className:P.mandatesSectionTitle,children:[i.jsx(P2,{}),i.jsx("span",{className:P.sectionNum,children:"01 /"}),"Your Mandates"]}),i.jsx("span",{className:P.mandatesSectionMeta,children:Ft.length>0?`${Ft.length} permission${Ft.length===1?"":"s"}${w!=null&&w.onchain?" · attached on-chain":""}`:$c?`${jr.reduce((J,Ee)=>J+(Ee.permissions??[]).length,0)} permission${jr.reduce((J,Ee)=>J+(Ee.permissions??[]).length,0)===1?"":"s"} · live`:"No permissions registered yet"})]}),i.jsx("div",{className:P.mandateList,children:$c?(()=>{const J=new Map(Ft.map(Ee=>[Ee.name??Ee.template,Ee.address]));return jr.map((Ee,yt)=>{var Yr;return i.jsx(sA,{mandate:Ee,network:zc,addressByTemplate:J,onRevoke:w!=null&&w.kernel&&((Yr=w==null?void 0:w.sma)!=null&&Yr.address)?Fe:void 0},Ee.signedAt??yt)})})():Ft.length>0?i.jsx(The,{mandates:Ft,network:(w==null?void 0:w.network)??zc,onchain:w==null?void 0:w.onchain,onRevoke:w!=null&&w.kernel&&((O2=w==null?void 0:w.sma)!=null&&O2.address)?Fe:void 0}):i.jsx(oA,{onClick:()=>je({variant:"new",context:"mandate"})})})]}),i.jsxs("section",{className:P.signersSection,"aria-label":"Accounts details",children:[i.jsxs("header",{className:P.mandatesSectionHead,children:[i.jsxs("h2",{className:P.mandatesSectionTitle,children:[i.jsx(lA,{}),i.jsx("span",{className:P.sectionNum,children:"02 /"}),"Your Wallets"]}),i.jsx("span",{className:P.mandatesSectionMeta,children:w!=null&&w.onchain?"live balances · refill when low":"Add RPC URL to enable balance tracking"})]}),i.jsx(rA,{overview:w,sma:He,onAddSigner:()=>d(!0),onRotateSigner:w!=null&&w.kernel&&((F2=w==null?void 0:w.sma)!=null&&F2.address)?J=>{_({sma:w.sma.address,kernel:w.kernel,chainId:w.chainId,owner:w.sma.owner,currentManager:w.sma.manager,mandates:w.mandates??[]}),m(J??null),h(!0)}:void 0})]})]}),i.jsx("section",{className:Ie.card,children:i.jsx(dhe,{deployedChains:Ro})}),i.jsxs("section",{className:Ie.card,children:[i.jsxs("header",{className:Ie.cardHead,children:[i.jsxs("div",{className:Ie.cardHeadText,children:[i.jsxs("h2",{className:P.mandatesSectionTitle,children:[i.jsx(epe,{}),!bd&&i.jsx("span",{className:P.sectionNum,children:"03 /"}),"Recent Activity"]}),i.jsx("p",{className:Ie.cardSub,children:"Click any event to see the agent's reasoning and evidence."})]}),i.jsx("div",{className:P.activityFilter,role:"tablist","aria-label":"Filter by actor",children:Dhe.map(J=>i.jsx("button",{type:"button",role:"tab","aria-selected":Ot===J.key,className:`${P.activityFilterBtn} ${Ot===J.key?P.activityFilterBtnActive:""}`,onClick:()=>dn(J.key),children:J.label},J.key))})]}),i.jsx(qhe,{deployedChains:Ro,chainFilter:Mt,onChainFilterChange:In}),j.length>0?i.jsx(Uhe,{events:j,positions:E,network:zc,permToChain:A,chainFilter:Mt,actorFilter:Ot}):i.jsx("div",{className:P.emptyAgents,children:i.jsx("p",{className:P.emptyAgentsBody,children:uA?i.jsxs(i.Fragment,{children:["No activity yet — run ",i.jsx("code",{children:"sailor run"})," to start"]}):"Activity from your agents will appear here."})})]}),i.jsxs("footer",{className:P.localFootnote,children:[i.jsx("span",{className:P.localFootnoteDot,"aria-hidden":!0}),"Running locally at ",i.jsx("code",{children:window.location.host})," · project state lives in"," ",i.jsx("code",{children:".sail/"}),". There is no Sail-hosted backend; your wallet talks to the chain directly."]})]}):i.jsx(Ghe,{onCreate:()=>ge(!0),initialShowImport:n,onImport:J=>{N(J);try{localStorage.setItem("sail.account",JSON.stringify(J))}catch{}fetch("/api/account",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}).catch(()=>{}),l(Ee=>Ee+1)},ownerAddr:Sr}):i.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"center",padding:"40px 24px"},children:i.jsx(xS,{eyebrow:"DASHBOARD",title:"Connect to view your SMA.",sub:"Connect the owner wallet you used to set up this project."})})}),i.jsx(A2,{open:!!xe,variant:xe==null?void 0:xe.variant,context:xe==null?void 0:xe.context,mandate:xe==null?void 0:xe.mandate,onClose:()=>je(null)}),i.jsx(jS,{open:ye,wallet:Sr,safes:dA,currentSafeId:za,hasSMA:Ke,onClose:()=>z(!1),onDisconnect:()=>{z(!1),N(null);try{localStorage.removeItem("sail.account")}catch{}o()},onCreateSMA:()=>{z(!1),ge(!0)},onImportSMA:J=>{N(J);try{localStorage.setItem("sail.account",JSON.stringify(J))}catch{}fetch("/api/account",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(J)}).catch(()=>{}),l(Ee=>Ee+1),z(!1)},onRenameSafe:(J,Ee)=>{md(yt=>({...yt,[J]:Ee})),F6(J,Ee).catch(()=>{}),l(yt=>yt+1)},onSelectSafe:async J=>{try{await hK(J.address)}catch{}l(Ee=>Ee+1),z(!1)}}),i.jsx(Ide,{open:u,safe:($2=w==null?void 0:w.sma)==null?void 0:$2.address,onClose:()=>d(!1),onCreated:()=>{d(!1),l(J=>J+1)}}),i.jsx(Rde,{open:f,sma:(g==null?void 0:g.sma)??((z2=w==null?void 0:w.sma)==null?void 0:z2.address),kernel:(g==null?void 0:g.kernel)??(w==null?void 0:w.kernel),chainId:(g==null?void 0:g.chainId)??(w==null?void 0:w.chainId),owner:(g==null?void 0:g.owner)??((q2=w==null?void 0:w.sma)==null?void 0:q2.owner),currentManager:(g==null?void 0:g.currentManager)??((U2=w==null?void 0:w.sma)==null?void 0:U2.manager),mandates:(g==null?void 0:g.mandates)??(w==null?void 0:w.mandates)??[],initialTo:p,onClose:()=>{h(!1),m(null),_(null)},onRotated:()=>l(J=>J+1)}),i.jsx(_ue,{open:se,onClose:()=>ge(!1),onComplete:J=>{if(J){N(J);try{localStorage.setItem("sail.account",JSON.stringify(J))}catch{}}ge(!1)}}),i.jsx(Xue,{open:Ue!=null,mandate:Array.isArray(Ue)?void 0:Ue,permissions:Array.isArray(Ue)?Ue:void 0,sma:(Ze==null?void 0:Ze.sma)??((H2=w==null?void 0:w.sma)==null?void 0:H2.address),kernel:(Ze==null?void 0:Ze.kernel)??(w==null?void 0:w.kernel),chainId:(Ze==null?void 0:Ze.chainId)??(w==null?void 0:w.chainId),onClose:()=>{Fe(null),Nn(null)},onRevoked:()=>{Fe(null),Nn(null)}})]})}function Whe({projectOwner:e,connectedAddress:t,onReset:n,onConnect:r}){const[s,o]=S.useState(!1);return i.jsx("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"center",padding:"40px 24px"},children:i.jsxs("div",{style:{maxWidth:440,width:"100%",background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:20,padding:"36px 32px",display:"flex",flexDirection:"column",gap:16},children:[i.jsx("span",{style:{fontSize:11,fontWeight:700,letterSpacing:"0.14em",textTransform:"uppercase",color:"rgba(255,165,0,0.7)"},children:"Wrong wallet"}),i.jsx("h2",{style:{margin:0,fontSize:22,fontWeight:600,color:"#fff",lineHeight:1.2},children:"This project belongs to a different wallet."}),i.jsxs("p",{style:{margin:0,fontSize:14,color:"rgba(255,255,255,0.5)",lineHeight:1.6},children:["Project owner: ",i.jsx("code",{style:{fontSize:12,color:"rgba(255,255,255,0.75)"},children:br(e)}),i.jsx("br",{}),"Connected: ",i.jsx("code",{style:{fontSize:12,color:"rgba(255,255,255,0.75)"},children:br(t)})]}),i.jsx("p",{style:{margin:0,fontSize:13,color:"rgba(255,255,255,0.4)",lineHeight:1.5},children:"Connect the owner wallet to manage this SMA, or reset to start a new project with the current wallet."}),i.jsxs("div",{style:{display:"flex",gap:10,marginTop:4},children:[i.jsx(Me,{onClick:r,style:{flex:1},children:"Switch wallet"}),i.jsx("button",{type:"button",disabled:s,onClick:async()=>{o(!0),await n()},style:{flex:1,padding:"10px 16px",borderRadius:12,fontSize:14,fontWeight:500,color:"rgba(255,255,255,0.5)",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",cursor:s?"default":"pointer"},children:s?"Resetting…":"Reset project"})]})]})})}function Vhe(){return i.jsxs("section",{className:P.noSMAHero,children:[i.jsx("div",{className:P.noSMAMascot,"aria-hidden":!0,children:i.jsx(Dt,{size:64,animate:!0})}),i.jsx("h2",{className:P.noSMATitle,children:"Loading your project…"}),i.jsxs("p",{className:P.noSMASub,children:["Reading local state from ",i.jsx("code",{children:".sail/"}),"."]})]})}function Ghe({onCreate:e,onImport:t,ownerAddr:n,initialShowImport:r}){const[s,o]=S.useState(r??!1),[a,c]=S.useState(!1),[l,u]=S.useState(""),[d,f]=S.useState("8453"),[h,p]=S.useState(""),{safes:m,scanning:g,done:_}=CS(n,s&&!a);function b(v,w){t==null||t({safe:v,owner:n??v,permissionSigner:n??v,manager:n??v,chainId:w,createdAtBlock:"0"})}function y(){const v=l.trim();if(!/^0x[0-9a-fA-F]{40}$/.test(v)){p("Enter a valid 0x address.");return}const w=Number(d);if(!w){p("Enter a valid chain ID.");return}b(v,w)}return i.jsxs("section",{className:P.noSMAHero,children:[i.jsx("div",{className:P.noSMAMascot,"aria-hidden":!0,children:i.jsx(Dt,{size:64,animate:!0})}),i.jsxs("div",{className:P.noSMAStatus,children:[i.jsx("span",{className:P.noSMAStatusDot,"aria-hidden":!0}),"No SMA yet"]}),i.jsx("h2",{className:P.noSMATitle,children:"Your wallet is connected."}),i.jsx("p",{className:P.noSMASub,children:"Create a new Separately Managed Account for your AI to operate — you only pay gas when there’s something for it to do — or import an existing Safe you already own."}),s?a?i.jsxs("div",{className:P.noSMAImport,children:[i.jsx("input",{className:P.noSMAImportInput,type:"text",placeholder:"Safe address 0x…",value:l,onChange:v=>{u(v.target.value),p("")},spellCheck:!1}),i.jsx("input",{className:P.noSMAImportInput,type:"text",placeholder:"Chain ID e.g. 8453",value:d,onChange:v=>{f(v.target.value),p("")}}),h&&i.jsx("span",{className:P.noSMAImportErr,children:h}),i.jsxs("div",{className:P.noSMAImportActions,children:[i.jsx(Me,{onClick:y,children:"Import SMA"}),i.jsx("button",{type:"button",className:P.noSMAImportLink,onClick:()=>{c(!1),p("")},children:"Back to discovered Safes"})]})]}):i.jsxs("div",{className:P.noSMAImport,children:[g&&m.length===0&&i.jsxs("span",{className:P.noSMAImportScan,children:["Scanning for Safes owned by ",br(n),"…"]}),m.length>0&&i.jsx("ul",{className:P.importSafeList,children:m.map(v=>i.jsx("li",{children:i.jsxs("button",{type:"button",className:P.importSafeRow,onClick:()=>b(v.safe,v.chainId),children:[i.jsx("span",{className:P.importSafeAddr,children:tA(v.safe)}),i.jsx("span",{className:P.importSafeNet,children:mr[v.chainId]??`chain ${v.chainId}`})]})},`${v.chainId}-${v.safe}`))}),_&&m.length===0&&i.jsx("span",{className:P.noSMAImportScan,children:"No Safes found for this wallet on supported chains."}),i.jsxs("div",{className:P.noSMAImportActions,children:[i.jsx("button",{type:"button",className:P.noSMAImportLink,onClick:()=>c(!0),children:"Enter an address manually"}),i.jsx("button",{type:"button",className:P.noSMAImportLink,onClick:()=>o(!1),children:"Cancel"})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:P.noSMACta,children:i.jsx(Me,{onClick:e,children:"Create your first agent"})}),i.jsx("button",{type:"button",className:P.noSMAImportLink,onClick:()=>o(!0),children:"Already have a Safe? Import it as your SMA"})]}),i.jsx("p",{className:P.noSMAFine,children:"Self-custody. Sail never holds your keys."})]})}function B2(e){return((e==null?void 0:e.permissions)??(e==null?void 0:e.items)??[]).length}function Khe({draft:e,onReview:t}){const n=B2(e);return i.jsxs("button",{type:"button",className:`${P.pendingBanner} ${P.pendingBannerDraft}`,onClick:t,"aria-label":"Review pending mandate draft",children:[i.jsx("span",{className:P.pendingBannerPulse,"aria-hidden":!0}),i.jsxs("span",{className:P.pendingBannerBody,children:[i.jsx("span",{className:P.pendingBannerKicker,children:"Mandate draft ready"}),i.jsxs("span",{className:P.pendingBannerTitle,children:[i.jsx("strong",{children:n})," permission",n===1?"":"s"," queued — sign or reject"]})]})]})}function Qhe({count:e,onReview:t}){return i.jsxs("button",{type:"button",className:P.pendingBanner,onClick:t,"aria-label":`Review ${e} pending mandates`,children:[i.jsx("span",{className:P.pendingBannerPulse,"aria-hidden":!0}),i.jsxs("span",{className:P.pendingBannerBody,children:[i.jsx("span",{className:P.pendingBannerKicker,children:"Awaiting your signature"}),i.jsxs("span",{className:P.pendingBannerTitle,children:[i.jsx("strong",{children:e})," mandate",e===1?"":"s"," ready to authorize"]})]}),i.jsxs("span",{className:P.pendingBannerCta,children:["Review",i.jsx(aA,{})]})]})}function oA({onClick:e}){return i.jsxs("button",{type:"button",className:P.newMandateTile,onClick:e,children:[i.jsx("span",{className:P.newMandateTilePlus,"aria-hidden":!0,children:"+"}),i.jsxs("span",{className:P.newMandateTileText,children:[i.jsx("span",{className:P.newMandateTileLabel,children:"Register a permission"}),i.jsx("span",{className:P.newMandateTileHint,children:"Draft one with your AI — sign each permission individually."})]})]})}function Yhe({pending:e,draft:t,open:n,onToggle:r,onClose:s,onOpenStation:o,onOpenSigning:a}){const c=S.useRef(null);S.useEffect(()=>{if(!n)return;function f(p){c.current&&!c.current.contains(p.target)&&s()}function h(p){p.key==="Escape"&&s()}return document.addEventListener("mousedown",f),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",h)}},[n,s]);const l=B2(t),u=l>0,d=e.length+(u?1:0);return i.jsxs("div",{className:P.notifWrap,ref:c,children:[i.jsxs("button",{type:"button",className:`${P.notifBtn} ${d>0?P.notifBtnLive:""}`,onClick:r,"aria-label":d>0?`${d} pending signatures`:"Pending signatures","aria-expanded":n,children:[i.jsx(Jhe,{}),d>0&&i.jsx("span",{className:P.notifBadge,children:d})]}),n&&i.jsxs("div",{className:P.notifPanel,role:"menu",children:[i.jsxs("header",{className:P.notifPanelHead,children:[i.jsx("span",{className:P.notifPanelTitle,children:"Pending signatures"}),i.jsx("span",{className:P.notifPanelCount,children:d===0?"none":`${d} waiting`})]}),d===0?i.jsx("div",{className:P.notifEmpty,children:i.jsxs("p",{className:P.notifEmptyBody,children:["Nothing to approve right now. When your agent needs a signature it appears here — start it with ",i.jsx("code",{children:"sailor station start"}),"."]})}):i.jsxs("ul",{className:P.notifList,children:[u&&i.jsx("li",{children:i.jsxs("button",{type:"button",className:P.notifItem,onClick:a,children:[i.jsxs("span",{className:P.notifItemTop,children:[i.jsx("span",{className:P.notifItemKind,children:"Mandate"}),i.jsx("span",{className:P.notifItemType,children:"signature"})]}),i.jsx("span",{className:P.notifItemTitle,children:"Permission draft ready"}),i.jsxs("span",{className:P.notifItemDesc,children:[l," permission",l===1?"":"s"," queued — sign or reject"]})]})}),e.map(f=>i.jsx("li",{children:i.jsxs("button",{type:"button",className:P.notifItem,onClick:o,children:[i.jsxs("span",{className:P.notifItemTop,children:[i.jsx("span",{className:P.notifItemKind,children:xhe[f.kind]??f.kind}),i.jsx("span",{className:P.notifItemType,children:f.type==="typed-data"?"signature":"transaction"})]}),i.jsx("span",{className:P.notifItemTitle,children:f.title}),f.description&&i.jsx("span",{className:P.notifItemDesc,children:f.description}),i.jsx("span",{className:P.notifItemMeta,children:khe[f.chainId]??`Chain ${f.chainId}`})]})},f.id))]}),e.length>0&&i.jsxs("button",{type:"button",className:P.notifFootBtn,onClick:o,children:["Open signing station",i.jsx(aA,{})]})]})]})}function Jhe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M4.6 6.2a3.4 3.4 0 016.8 0v2.6c0 .9.3 1.7.9 2.3l.6.7H3.1l.6-.7c.6-.6.9-1.4.9-2.3V6.2z"}),i.jsx("path",{d:"M6.8 12.5a1.4 1.4 0 002.4 0"})]})}function qi(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 9 L9 5"}),i.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}function aA(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 7h8M8 4l3 3-3 3"})})}function iA(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("rect",{x:"2.5",y:"2.5",width:"7",height:"7",rx:"1.6"}),i.jsx("path",{d:"M4 4V3a1 1 0 011-1h4.5a1 1 0 011 1v5a1 1 0 01-1 1H9"})]})}function T2(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})}function cA(){return i.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3.5 8.4l3 3L13 5.2"})})}function Xhe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3.5 3.5l7 7M10.5 3.5l-7 7"})})}function Zhe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"8",height:"8","aria-hidden":!0,children:i.jsx("circle",{cx:"7",cy:"7",r:"3.2",fill:"currentColor"})})}function P2(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M4 2.5h5l3 3v8a.5.5 0 01-.5.5h-7.5a.5.5 0 01-.5-.5v-10a.5.5 0 01.5-.5z"}),i.jsx("path",{d:"M9 2.5v3h3"}),i.jsx("path",{d:"M5.6 9h5M5.6 11.4h5"})]})}function epe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"8",cy:"8",r:"5.5"}),i.jsx("path",{d:"M8 5v3.2l2.1 1.5"})]})}function lA(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"5.5",cy:"6",r:"2.8"}),i.jsx("path",{d:"M7.7 7.8l4.3 4.3M10.4 10.5l1.2-1.2M12 12.1l1.2-1.2"})]})}function tpe(){return i.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M11.5 2.5a1.414 1.414 0 0 1 2 2L5 13H3v-2L11.5 2.5z"})})}function npe(){return i.jsxs("svg",{viewBox:"0 0 32 32",width:"20",height:"20","aria-hidden":!0,children:[i.jsx("path",{d:"M16 3 7.8 16.6 16 12.9Z",fill:"#1990ff"}),i.jsx("path",{d:"M16 3 24.2 16.6 16 12.9Z",fill:"#1990ff",opacity:"0.55"}),i.jsx("path",{d:"M16 20.2 7.8 16.6 16 12.9Z",fill:"#1990ff",opacity:"0.8"}),i.jsx("path",{d:"M16 20.2 24.2 16.6 16 12.9Z",fill:"#1990ff",opacity:"0.4"}),i.jsx("path",{d:"M16 29 7.8 18.2 16 21.7Z",fill:"#1990ff"}),i.jsx("path",{d:"M16 29 24.2 18.2 16 21.7Z",fill:"#1990ff",opacity:"0.55"})]})}const rpe="_shell_12lj4_8",spe="_header_12lj4_18",ope="_backBtn_12lj4_33",ape="_headerActions_12lj4_60",ipe="_editBtnProvider_12lj4_68",cpe="_headerPauseBtn_12lj4_76",lpe="_headerRevokeBtn_12lj4_77",upe="_headerPauseBtnPaused_12lj4_100",dpe="_headerBtn_12lj4_117",fpe="_headerBtnGhost_12lj4_141",hpe="_headerBtnDanger_12lj4_142",ppe="_main_12lj4_185",mpe="_titleBlock_12lj4_198",gpe="_identityRow_12lj4_204",ype="_body_12lj4_215",bpe="_tierStack_12lj4_230",vpe="_tierCard_12lj4_241",wpe="_tierCardOpen_12lj4_255",_pe="_tierCardDepth_0_12lj4_263",xpe="_tierCardDepth_1_12lj4_264",kpe="_tierCardDepth_2_12lj4_265",Cpe="_tierCardConnector_12lj4_270",jpe="_tierCardHead_12lj4_288",Spe="_tierCardHeadText_12lj4_305",Ape="_tierCardLabel_12lj4_311",Epe="_tierCardPrimary_12lj4_319",Npe="_tierCardSummary_12lj4_330",Ipe="_tierCardChevron_12lj4_337",Mpe="_tierCardChevronOpen_12lj4_354",Bpe="_tierCardBody_12lj4_356",Tpe="_tierGrid_12lj4_369",Ppe="_statusStrip_12lj4_379",Rpe="_statusCell_12lj4_387",Lpe="_statusCellKicker_12lj4_397",Dpe="_statusCellValue_12lj4_405",Ope="_statusCellDot_12lj4_416",Fpe="_statusDot_success_12lj4_423",$pe="_statusDot_warn_12lj4_424",zpe="_statusDot_danger_12lj4_425",qpe="_statusDot_muted_12lj4_426",Upe="_statusCellSub_12lj4_427",Hpe="_gasRow_12lj4_435",Wpe="_gasChain_12lj4_444",Vpe="_gasValue_12lj4_451",Gpe="_actionCard_12lj4_457",Kpe="_actionCard_neutral_12lj4_471",Qpe="_actionCard_warn_12lj4_472",Ype="_actionCard_danger_12lj4_478",Jpe="_actionCardText_12lj4_484",Xpe="_actionCardKicker_12lj4_490",Zpe="_actionCardKicker_warn_12lj4_498",eme="_actionCardKicker_danger_12lj4_499",tme="_actionCardTitle_12lj4_500",nme="_actionCardDescription_12lj4_508",rme="_actionCardAction_12lj4_516",sme="_pauseBtn_12lj4_520",ome="_revokeBtn_12lj4_521",ame="_sidebar_12lj4_541",ime="_statusCard_12lj4_550",cme="_statusList_12lj4_557",lme="_statusRow_12lj4_562",ume="_statusRowProminent_12lj4_573",dme="_statusHead_12lj4_577",fme="_statusHeadProminent_12lj4_583",hme="_statusKicker_12lj4_588",pme="_statusValue_12lj4_596",mme="_statusValueLarge_12lj4_604",gme="_statusDot_12lj4_423",yme="_statusTone_muted_12lj4_622",bme="_statusSub_12lj4_623",vme="_actionsBlock_12lj4_631",wme="_actionsHint_12lj4_636",_me="_hero_12lj4_649",xme="_heroIdentity_12lj4_663",kme="_chainChips_12lj4_676",Cme="_chainChip_12lj4_676",jme="_chainChipDot_12lj4_696",Sme="_statStat_12lj4_712",Ame="_statTone_success_12lj4_722",Eme="_statTone_warn_12lj4_728",Nme="_statTone_danger_12lj4_734",Ime="_statTone_muted_12lj4_740",Mme="_statKicker_12lj4_743",Bme="_statValue_12lj4_751",Tme="_statDot_12lj4_762",Pme="_statDot_success_12lj4_769",Rme="_statDot_warn_12lj4_770",Lme="_statDot_danger_12lj4_771",Dme="_statDot_muted_12lj4_772",Ome="_statSub_12lj4_773",Fme="_heroActions_12lj4_787",$me="_heroActionsHint_12lj4_795",zme="_hierarchy_12lj4_811",qme="_hierStep_12lj4_825",Ume="_hierKicker_12lj4_840",Hme="_hierTitle_12lj4_848",Wme="_hierSub_12lj4_855",Vme="_hierStepActive_12lj4_862",Gme="_hierTone_owner_12lj4_868",Kme="_hierTone_sma_12lj4_869",Qme="_hierArrow_12lj4_872",Yme="_identityName_12lj4_885",Jme="_identityDot_12lj4_886",Xme="_title_12lj4_198",Zme="_summary_12lj4_894",e1e="_chainBlock_12lj4_906",t1e="_chainHeader_12lj4_917",n1e="_chainList_12lj4_922",r1e="_chainStep_12lj4_931",s1e="_chainDepth_0_12lj4_949",o1e="_chainDepth_1_12lj4_950",a1e="_chainDepth_2_12lj4_951",i1e="_chainConnector_12lj4_956",c1e="_chainConnectorSvg_12lj4_965",l1e="_chainStepActive_12lj4_971",u1e="_chainKicker_12lj4_976",d1e="_chainTitle_12lj4_985",f1e="_chainAddress_12lj4_992",h1e="_chainCopyIcon_12lj4_1013",p1e="_sidebarBlock_12lj4_1019",m1e="_sidebarBlockHead_12lj4_1028",g1e="_sidebarKicker_12lj4_1033",y1e="_sidebarBlockTitle_12lj4_1041",b1e="_sidebarBody_12lj4_1048",v1e="_sidebarMeta_12lj4_1053",w1e="_sidebarValue_12lj4_1068",_1e="_sidebarHint_12lj4_1074",x1e="_copyAddress_12lj4_1082",k1e="_copyAddressValue_12lj4_1103",C1e="_copyAddressIcon_12lj4_1104",j1e="_identityLink_12lj4_1114",S1e="_identityHandle_12lj4_1135",A1e="_identityArrow_12lj4_1136",E1e="_networkList_12lj4_1139",N1e="_networkRow_12lj4_1147",I1e="_networkDot_12lj4_1159",M1e="_netDot_ethereum_12lj4_1166",B1e="_netDot_base_12lj4_1167",T1e="_netDot_arbitrum_12lj4_1168",P1e="_netDot_optimism_12lj4_1169",R1e="_netDot_polygon_12lj4_1170",L1e="_networkName_12lj4_1171",D1e="_networkState_12lj4_1172",O1e="_pauseBtnPaused_12lj4_1203",F1e="_content_12lj4_1237",$1e="_section_12lj4_1243",z1e="_sectionAccent_mandate_12lj4_1261",q1e="_sectionKicker_12lj4_1269",U1e="_sectionAccent_permissions_12lj4_1270",H1e="_sectionAccent_identity_12lj4_1279",W1e="_mandateExplainer_12lj4_1291",V1e="_hierarchyHeader_12lj4_1310",G1e="_hierTier_12lj4_1329",K1e="_hierTier_depth_0_12lj4_1341",Q1e="_hierTier_depth_1_12lj4_1342",Y1e="_hierTier_depth_2_12lj4_1343",J1e="_hierTier_depth_3_12lj4_1344",X1e="_hierTier_depth_4_12lj4_1345",Z1e="_hierTier_identity_12lj4_1354",e0e="_hierTier_mandate_12lj4_1360",t0e="_hierTier_permissions_12lj4_1366",n0e="_hierTierActive_12lj4_1375",r0e="_hierTierConnector_12lj4_1385",s0e="_hierTierHead_12lj4_1396",o0e="_hierTierKicker_12lj4_1402",a0e="_hierTierPrimary_12lj4_1414",i0e="_hierTierSecondary_12lj4_1425",c0e="_hierTierChips_12lj4_1433",l0e="_hierTierChip_12lj4_1433",u0e="_hierTierChipMono_12lj4_1454",d0e="_hierTierAddress_12lj4_1488",f0e="_hierTierAddressKicker_12lj4_1514",h0e="_hierTierAddressValue_12lj4_1522",p0e="_hierTierAddressIcon_12lj4_1523",m0e="_sectionHead_12lj4_1538",g0e="_sectionHeadText_12lj4_1544",y0e="_sectionHeadAction_12lj4_1552",b0e="_sectionLink_12lj4_1556",v0e="_collapsibleSection_12lj4_1581",w0e="_collapsibleTrigger_12lj4_1584",_0e="_collapsibleOpen_12lj4_1603",x0e="_collapsibleChevron_12lj4_1607",k0e="_collapsibleChevronOpen_12lj4_1624",C0e="_collapsibleBody_12lj4_1625",j0e="_sectionTitle_12lj4_1639",S0e="_sectionTitleHint_12lj4_1653",A0e="_sectionNote_12lj4_1677",E0e="_subsection_12lj4_1687",N0e="_subsectionHead_12lj4_1696",I0e="_subsectionKicker_12lj4_1701",M0e="_subsectionTitle_12lj4_1709",B0e="_mandateSpec_12lj4_1719",T0e="_specCell_12lj4_1724",P0e="_specKey_12lj4_1733",R0e="_specHintWrap_12lj4_1744",L0e="_specHintIcon_12lj4_1745",D0e="_registryGrid_12lj4_1772",O0e="_gasCell_12lj4_1778",F0e="_gasKicker_12lj4_1787",$0e="_specValRow_12lj4_1808",z0e="_specVal_12lj4_1808",q0e="_specViewBtn_12lj4_1824",U0e="_specValMono_12lj4_1852",H0e="_targetList_12lj4_1858",W0e="_targetRow_12lj4_1866",V0e="_targetLabel_12lj4_1876",G0e="_targetVenue_12lj4_1884",K0e="_targetSep_12lj4_1889",Q0e="_targetSelector_12lj4_1890",Y0e="_targetMeta_12lj4_1902",J0e="_targetHash_12lj4_1911",X0e="_targetConstraint_12lj4_1916",Z0e="_targetTemplate_12lj4_1924",ege="_permRelation_12lj4_1940",tge="_permRelationText_12lj4_1952",nge="_permRelationKicker_12lj4_1958",rge="_permRelationRole_12lj4_1965",sge="_permRelationBody_12lj4_1972",oge="_permRelationLink_12lj4_1982",age="_permRelationHint_12lj4_2005",ige="_permRelationEmpty_12lj4_2015",cge="_agentPermList_12lj4_2030",lge="_agentPermRow_12lj4_2038",uge="_agentPermUsed_12lj4_2049",dge="_agentPermUnused_12lj4_2053",fge="_agentPermRevoked_12lj4_2056",hge="_agentPermLabel_12lj4_2059",pge="_agentPermMark_12lj4_2063",mge="_agentPermBody_12lj4_2081",gge="_agentPermSub_12lj4_2095",yge="_agentPermMeta_12lj4_2100",bge="_agentPermMetaTpl_12lj4_2110",vge="_agentPermMetaSep_12lj4_2114",wge="_agentPermMetaVer_12lj4_2115",_ge="_agentPermTag_12lj4_2116",xge="_scheduleList_12lj4_2143",kge="_scheduleRow_12lj4_2151",Cge="_scheduleRowDisabled_12lj4_2161",jge="_scheduleMain_12lj4_2162",Sge="_scheduleHeadRow_12lj4_2168",Age="_scheduleId_12lj4_2173",Ege="_scheduleMode_12lj4_2180",Nge="_scheduleModeLive_12lj4_2190",Ige="_scheduleModeFork_12lj4_2195",Mge="_scheduleCron_12lj4_2200",Bge="_scheduleRuns_12lj4_2213",Tge="_scheduleToggle_12lj4_2227",Pge="_scheduleToggleOn_12lj4_2246",Rge="_signerShareRow_12lj4_2257",Lge="_signerShareLabel_12lj4_2266",Dge="_signerShareList_12lj4_2271",Oge="_signerShareChip_12lj4_2276",Fge="_receiptGrid_12lj4_2291",$ge="_receiptRow_12lj4_2300",zge="_linkOut_12lj4_2312",qge="_recoQuote_12lj4_2326",Uge="_recoMark_12lj4_2340",Hge="_recoBody_12lj4_2347",Wge="_recoFoot_12lj4_2356",Vge="_pagesList_12lj4_2367",Gge="_pageRow_12lj4_2375",Kge="_pageIcon_12lj4_2390",Qge="_pageBody_12lj4_2404",Yge="_pageTitle_12lj4_2410",Jge="_pageMeta_12lj4_2417",Xge="_pageOpen_12lj4_2425",Zge="_pageNew_12lj4_2445",eye="_pageNewIcon_12lj4_2454",tye="_pageNewBody_12lj4_2466",nye="_pageNewTitle_12lj4_2472",rye="_pageNewSub_12lj4_2479",sye="_pagesEmpty_12lj4_2485",oye="_pagesEmptyIcon_12lj4_2496",aye="_pagesEmptyTitle_12lj4_2509",iye="_pagesEmptySub_12lj4_2516",cye="_activityList_12lj4_2525",lye="_activityRow_12lj4_2533",uye="_activityDot_12lj4_2545",dye="_actDot_exec_12lj4_2551",fye="_actDot_sim_12lj4_2552",hye="_actDot_check_12lj4_2553",pye="_actDot_sys_12lj4_2554",mye="_actDot_auth_12lj4_2555",gye="_activityLabel_12lj4_2556",yye="_activityAgo_12lj4_2557",bye="_activityEmpty_12lj4_2562",vye="_runList_12lj4_2571",wye="_runRow_12lj4_2579",_ye="_runStatus_12lj4_2600",xye="_runStatus_success_12lj4_2610",kye="_runStatus_failed_12lj4_2611",Cye="_runStatus_pending_12lj4_2612",jye="_runId_12lj4_2613",Sye="_runLabel_12lj4_2619",Aye="_runMeta_12lj4_2627",Eye="_runGas_12lj4_2636",Nye="_runAgo_12lj4_2637",Iye="_runChevron_12lj4_2638",Mye="_runFailed_12lj4_2640",Bye="_drawerScrim_12lj4_2643",Tye="_drawerScrimOpen_12lj4_2654",Pye="_drawer_12lj4_2643",Rye="_drawerOpen_12lj4_2672",Lye="_drawerHead_12lj4_2673",Dye="_drawerHeadLeft_12lj4_2680",Oye="_drawerKicker_12lj4_2681",Fye="_drawerTitle_12lj4_2689",$ye="_drawerClose_12lj4_2697",zye="_drawerBody_12lj4_2714",qye="_drawerGrid_12lj4_2722",Uye="_drawerRow_12lj4_2731",Hye="_drawerLink_12lj4_2748",Wye="_drawerStatus_12lj4_2760",Vye="_drawerError_12lj4_2772",Gye="_drawerSection_12lj4_2776",Kye="_drawerSectionTitle_12lj4_2781",Qye="_drawerNote_12lj4_2790",Yye="_drawerLog_12lj4_2797",Jye="_notFound_12lj4_2812",Xye="_notFoundTitle_12lj4_2822",Zye="_notFoundBody_12lj4_2829",ebe="_mandateLinkPill_12lj4_2847",tbe="_titleScope_12lj4_2873",nbe="_identityFootnote_12lj4_2886",rbe="_readinessLine_12lj4_2910",sbe="_readinessStatusRow_12lj4_2916",obe="_readinessDot_12lj4_2925",abe="_readinessDot_success_12lj4_2932",ibe="_readinessDot_warn_12lj4_2933",cbe="_readinessDot_muted_12lj4_2934",lbe="_readinessLabel_12lj4_2935",ube="_readinessDetail_12lj4_2939",dbe="_readinessRehearsal_12lj4_2943",fbe="_readinessRehearsalStaleBtn_12lj4_2968",hbe="_readinessRehearsalBusy_12lj4_2977",pbe="_readinessRehearsalStale_12lj4_2968",mbe="_readinessAttribution_12lj4_2987",F={shell:rpe,header:spe,backBtn:ope,headerActions:ape,editBtnProvider:ipe,headerPauseBtn:cpe,headerRevokeBtn:lpe,headerPauseBtnPaused:upe,headerBtn:dpe,headerBtnGhost:fpe,headerBtnDanger:hpe,main:ppe,titleBlock:mpe,identityRow:gpe,body:ype,tierStack:bpe,tierCard:vpe,tierCardOpen:wpe,tierCardDepth_0:_pe,tierCardDepth_1:xpe,tierCardDepth_2:kpe,tierCardConnector:Cpe,tierCardHead:jpe,tierCardHeadText:Spe,tierCardLabel:Ape,tierCardPrimary:Epe,tierCardSummary:Npe,tierCardChevron:Ipe,tierCardChevronOpen:Mpe,tierCardBody:Bpe,tierGrid:Tpe,statusStrip:Ppe,statusCell:Rpe,statusCellKicker:Lpe,statusCellValue:Dpe,statusCellDot:Ope,statusDot_success:Fpe,statusDot_warn:$pe,statusDot_danger:zpe,statusDot_muted:qpe,statusCellSub:Upe,gasRow:Hpe,gasChain:Wpe,gasValue:Vpe,actionCard:Gpe,actionCard_neutral:Kpe,actionCard_warn:Qpe,actionCard_danger:Ype,actionCardText:Jpe,actionCardKicker:Xpe,actionCardKicker_warn:Zpe,actionCardKicker_danger:eme,actionCardTitle:tme,actionCardDescription:nme,actionCardAction:rme,pauseBtn:sme,revokeBtn:ome,sidebar:ame,statusCard:ime,statusList:cme,statusRow:lme,statusRowProminent:ume,statusHead:dme,statusHeadProminent:fme,statusKicker:hme,statusValue:pme,statusValueLarge:mme,statusDot:gme,statusTone_muted:yme,statusSub:bme,actionsBlock:vme,actionsHint:wme,hero:_me,heroIdentity:xme,chainChips:kme,chainChip:Cme,chainChipDot:jme,statStat:Sme,statTone_success:Ame,statTone_warn:Eme,statTone_danger:Nme,statTone_muted:Ime,statKicker:Mme,statValue:Bme,statDot:Tme,statDot_success:Pme,statDot_warn:Rme,statDot_danger:Lme,statDot_muted:Dme,statSub:Ome,heroActions:Fme,heroActionsHint:$me,hierarchy:zme,hierStep:qme,hierKicker:Ume,hierTitle:Hme,hierSub:Wme,hierStepActive:Vme,hierTone_owner:Gme,hierTone_sma:Kme,hierArrow:Qme,identityName:Yme,identityDot:Jme,title:Xme,summary:Zme,chainBlock:e1e,chainHeader:t1e,chainList:n1e,chainStep:r1e,chainDepth_0:s1e,chainDepth_1:o1e,chainDepth_2:a1e,chainConnector:i1e,chainConnectorSvg:c1e,chainStepActive:l1e,chainKicker:u1e,chainTitle:d1e,chainAddress:f1e,chainCopyIcon:h1e,sidebarBlock:p1e,sidebarBlockHead:m1e,sidebarKicker:g1e,sidebarBlockTitle:y1e,sidebarBody:b1e,sidebarMeta:v1e,sidebarValue:w1e,sidebarHint:_1e,copyAddress:x1e,copyAddressValue:k1e,copyAddressIcon:C1e,identityLink:j1e,identityHandle:S1e,identityArrow:A1e,networkList:E1e,networkRow:N1e,networkDot:I1e,netDot_ethereum:M1e,netDot_base:B1e,netDot_arbitrum:T1e,netDot_optimism:P1e,netDot_polygon:R1e,networkName:L1e,networkState:D1e,pauseBtnPaused:O1e,content:F1e,section:$1e,sectionAccent_mandate:z1e,sectionKicker:q1e,sectionAccent_permissions:U1e,sectionAccent_identity:H1e,mandateExplainer:W1e,hierarchyHeader:V1e,hierTier:G1e,hierTier_depth_0:K1e,hierTier_depth_1:Q1e,hierTier_depth_2:Y1e,hierTier_depth_3:J1e,hierTier_depth_4:X1e,hierTier_identity:Z1e,hierTier_mandate:e0e,hierTier_permissions:t0e,hierTierActive:n0e,hierTierConnector:r0e,hierTierHead:s0e,hierTierKicker:o0e,hierTierPrimary:a0e,hierTierSecondary:i0e,hierTierChips:c0e,hierTierChip:l0e,hierTierChipMono:u0e,hierTierAddress:d0e,hierTierAddressKicker:f0e,hierTierAddressValue:h0e,hierTierAddressIcon:p0e,sectionHead:m0e,sectionHeadText:g0e,sectionHeadAction:y0e,sectionLink:b0e,collapsibleSection:v0e,collapsibleTrigger:w0e,collapsibleOpen:_0e,collapsibleChevron:x0e,collapsibleChevronOpen:k0e,collapsibleBody:C0e,sectionTitle:j0e,sectionTitleHint:S0e,sectionNote:A0e,subsection:E0e,subsectionHead:N0e,subsectionKicker:I0e,subsectionTitle:M0e,mandateSpec:B0e,specCell:T0e,specKey:P0e,specHintWrap:R0e,specHintIcon:L0e,registryGrid:D0e,gasCell:O0e,gasKicker:F0e,specValRow:$0e,specVal:z0e,specViewBtn:q0e,specValMono:U0e,targetList:H0e,targetRow:W0e,targetLabel:V0e,targetVenue:G0e,targetSep:K0e,targetSelector:Q0e,targetMeta:Y0e,targetHash:J0e,targetConstraint:X0e,targetTemplate:Z0e,permRelation:ege,permRelationText:tge,permRelationKicker:nge,permRelationRole:rge,permRelationBody:sge,permRelationLink:oge,permRelationHint:age,permRelationEmpty:ige,agentPermList:cge,agentPermRow:lge,agentPermUsed:uge,agentPermUnused:dge,agentPermRevoked:fge,agentPermLabel:hge,agentPermMark:pge,agentPermBody:mge,agentPermSub:gge,agentPermMeta:yge,agentPermMetaTpl:bge,agentPermMetaSep:vge,agentPermMetaVer:wge,agentPermTag:_ge,scheduleList:xge,scheduleRow:kge,scheduleRowDisabled:Cge,scheduleMain:jge,scheduleHeadRow:Sge,scheduleId:Age,scheduleMode:Ege,scheduleModeLive:Nge,scheduleModeFork:Ige,scheduleCron:Mge,scheduleRuns:Bge,scheduleToggle:Tge,scheduleToggleOn:Pge,signerShareRow:Rge,signerShareLabel:Lge,signerShareList:Dge,signerShareChip:Oge,receiptGrid:Fge,receiptRow:$ge,linkOut:zge,recoQuote:qge,recoMark:Uge,recoBody:Hge,recoFoot:Wge,pagesList:Vge,pageRow:Gge,pageIcon:Kge,pageBody:Qge,pageTitle:Yge,pageMeta:Jge,pageOpen:Xge,pageNew:Zge,pageNewIcon:eye,pageNewBody:tye,pageNewTitle:nye,pageNewSub:rye,pagesEmpty:sye,pagesEmptyIcon:oye,pagesEmptyTitle:aye,pagesEmptySub:iye,activityList:cye,activityRow:lye,activityDot:uye,actDot_exec:dye,actDot_sim:fye,actDot_check:hye,actDot_sys:pye,actDot_auth:mye,activityLabel:gye,activityAgo:yye,activityEmpty:bye,runList:vye,runRow:wye,runStatus:_ye,runStatus_success:xye,runStatus_failed:kye,runStatus_pending:Cye,runId:jye,runLabel:Sye,runMeta:Aye,runGas:Eye,runAgo:Nye,runChevron:Iye,runFailed:Mye,drawerScrim:Bye,drawerScrimOpen:Tye,drawer:Pye,drawerOpen:Rye,drawerHead:Lye,drawerHeadLeft:Dye,drawerKicker:Oye,drawerTitle:Fye,drawerClose:$ye,drawerBody:zye,drawerGrid:qye,drawerRow:Uye,drawerLink:Hye,drawerStatus:Wye,drawerError:Vye,drawerSection:Gye,drawerSectionTitle:Kye,drawerNote:Qye,drawerLog:Yye,notFound:Jye,notFoundTitle:Xye,notFoundBody:Zye,mandateLinkPill:ebe,titleScope:tbe,identityFootnote:nbe,readinessLine:rbe,readinessStatusRow:sbe,readinessDot:obe,readinessDot_success:abe,readinessDot_warn:ibe,readinessDot_muted:cbe,readinessLabel:lbe,readinessDetail:ube,readinessRehearsal:dbe,readinessRehearsalStaleBtn:fbe,readinessRehearsalBusy:hbe,readinessRehearsalStale:pbe,readinessAttribution:mbe},gbe="_overlay_1joyb_6",ybe="_contractFade_1joyb_1",bbe="_card_1joyb_21",vbe="_contractRise_1joyb_1",wbe="_close_1joyb_45",_be="_doc_1joyb_74",xbe="_docHead_1joyb_88",kbe="_docKicker_1joyb_95",Cbe="_docTitle_1joyb_103",jbe="_docLede_1joyb_113",Sbe="_docMeta_1joyb_132",Abe="_docMetaCell_1joyb_144",Ebe="_docMetaWithMark_1joyb_167",Nbe="_divider_1joyb_177",Ibe="_section_1joyb_186",Mbe="_sectionHead_1joyb_191",Bbe="_sectionRoman_1joyb_199",Tbe="_sectionTitle_1joyb_208",Pbe="_sectionKicker_1joyb_217",Rbe="_sectionBody_1joyb_224",Lbe="_docBody_1joyb_231",Dbe="_recital_1joyb_251",Obe="_recitalMark_1joyb_265",Fbe="_parties_1joyb_295",$be="_party_1joyb_306",zbe="_partyActive_1joyb_315",qbe="_partyRole_1joyb_319",Ube="_partyName_1joyb_328",Hbe="_partyDesc_1joyb_335",Wbe="_partyAddr_1joyb_341",Vbe="_scopeGrid_1joyb_351",Gbe="_scopeBlock_1joyb_359",Kbe="_scopeHead_1joyb_368",Qbe="_scopeCount_1joyb_380",Ybe="_scopeChips_1joyb_386",Jbe="_scopePill_1joyb_391",Xbe="_scopePillDot_1joyb_404",Zbe="_scopeEmpty_1joyb_410",e2e="_limitsGrid_1joyb_418",t2e="_limitCell_1joyb_426",n2e="_limitCellEmphasis_1joyb_435",r2e="_limitLabel_1joyb_441",s2e="_limitValueWrap_1joyb_449",o2e="_limitVal_1joyb_449",a2e="_limitSub_1joyb_464",i2e="_actionList_1joyb_473",c2e="_actionItem_1joyb_482",l2e="_actionIndex_1joyb_491",u2e="_actionBody_1joyb_500",d2e="_actionLabel_1joyb_506",f2e="_actionMeta_1joyb_513",h2e="_actionChip_1joyb_518",p2e="_actionChipDot_1joyb_531",m2e="_rights_1joyb_539",g2e="_sigBlock_1joyb_576",y2e="_sigHead_1joyb_588",b2e="_sigTitle_1joyb_595",v2e="_sigSub_1joyb_603",w2e="_sigGrid_1joyb_610",_2e="_sigCard_1joyb_619",x2e="_sigCard_signed_1joyb_629",k2e="_sigCardProvider_claude_1joyb_637",C2e="_sigCardRole_1joyb_641",j2e="_sigLine_1joyb_642",S2e="_sigX_1joyb_643",A2e="_sigCardProvider_cursor_1joyb_645",E2e="_sigCardProvider_codex_1joyb_653",N2e="_sigCard_signing_1joyb_660",I2e="_sigCardHead_1joyb_663",M2e="_sigCardName_1joyb_677",B2e="_sigCardAddr_1joyb_684",T2e="_sigCardAddrLabel_1joyb_689",P2e="_sigCardAddrValue_1joyb_697",R2e="_sigLineWrap_1joyb_706",L2e="_sigValue_1joyb_729",D2e="_sigWrite_1joyb_1",O2e="_sigPenLine_1joyb_747",F2e="_penDraw_1joyb_1",$2e="_docFooter_1joyb_770",z2e="_authorizeBtn_1joyb_788",q2e="_rejectBtn_1joyb_809",U2e="_docFooterNote_1joyb_827",H2e="_revokeError_1joyb_840",W2e="_readOnlyFoot_1joyb_855",V2e="_readOnlyNote_1joyb_862",G2e="_readOnlyClose_1joyb_869",K2e="_docFooterSuccess_1joyb_897",Q2e="_successBlock_1joyb_902",Y2e="_successRise_1joyb_1",J2e="_successMark_1joyb_914",X2e="_successPop_1joyb_1",Z2e="_successCheck_1joyb_1",eve="_successBody_1joyb_941",tve="_successTitle_1joyb_947",nve="_successSub_1joyb_954",rve="_successDone_1joyb_961",sve="_docRevoking_1joyb_1011",ove="_revokeStamp_1joyb_1029",ave="_revokeStampLanded_1joyb_1045",ive="_revokeStampInner_1joyb_1053",cve="_revokeStampText_1joyb_1081",lve="_revokeStampDate_1joyb_1096",uve="_revokeStampImpact_1joyb_1114",dve="_stampImpact_1joyb_1",fve="_docFooterRevoked_1joyb_1131",hve="_revokingBlock_1joyb_1138",pve="_revokingPulse_1joyb_1149",mve="_revokePulse_1joyb_1",gve="_revokingTitle_1joyb_1161",yve="_revokedBlock_1joyb_1165",bve="_revokedMark_1joyb_1173",vve="_revokedBody_1joyb_1192",wve="_revokedTitle_1joyb_1198",_ve="_revokedSub_1joyb_1205",xve="_scopeRow_1joyb_1288",kve="_limitRow_1joyb_1289",Cve="_actionLine_1joyb_1290",jve="_signatureRow_1joyb_1291",Sve="_signatureSlot_1joyb_1292",Ave="_actionsRow_1joyb_1367",Eve="_footerActions_1joyb_1368",Nve="_footerBar_1joyb_1369",Ive="_footerCta_1joyb_1370",Mve="_cta_1joyb_1373",Bve="_ctaSecondary_1joyb_1374",Tve="_ctaTertiary_1joyb_1375",Pve="_ctaDestructive_1joyb_1376",Rve="_docRequester_1joyb_1389",Lve="_protections_1joyb_1408",Dve="_protectionChip_1joyb_1414",Ove="_partyAvatar_1joyb_1441",Fve="_onchain_1joyb_1459",$ve="_onchainKicker_1joyb_1464",zve="_onchainList_1joyb_1472",qve="_onchainRow_1joyb_1479",Uve="_onchainLabel_1joyb_1488",Hve="_onchainAddr_1joyb_1494",Wve="_onchainLink_1joyb_1500",G={overlay:gbe,contractFade:ybe,card:bbe,contractRise:vbe,close:wbe,doc:_be,docHead:xbe,docKicker:kbe,docTitle:Cbe,docLede:jbe,docMeta:Sbe,docMetaCell:Abe,docMetaWithMark:Ebe,divider:Nbe,section:Ibe,sectionHead:Mbe,sectionRoman:Bbe,sectionTitle:Tbe,sectionKicker:Pbe,sectionBody:Rbe,docBody:Lbe,recital:Dbe,recitalMark:Obe,parties:Fbe,party:$be,partyActive:zbe,partyRole:qbe,partyName:Ube,partyDesc:Hbe,partyAddr:Wbe,scopeGrid:Vbe,scopeBlock:Gbe,scopeHead:Kbe,scopeCount:Qbe,scopeChips:Ybe,scopePill:Jbe,scopePillDot:Xbe,scopeEmpty:Zbe,limitsGrid:e2e,limitCell:t2e,limitCellEmphasis:n2e,limitLabel:r2e,limitValueWrap:s2e,limitVal:o2e,limitSub:a2e,actionList:i2e,actionItem:c2e,actionIndex:l2e,actionBody:u2e,actionLabel:d2e,actionMeta:f2e,actionChip:h2e,actionChipDot:p2e,rights:m2e,sigBlock:g2e,sigHead:y2e,sigTitle:b2e,sigSub:v2e,sigGrid:w2e,sigCard:_2e,sigCard_signed:x2e,sigCardProvider_claude:k2e,sigCardRole:C2e,sigLine:j2e,sigX:S2e,sigCardProvider_cursor:A2e,sigCardProvider_codex:E2e,sigCard_signing:N2e,sigCardHead:I2e,sigCardName:M2e,sigCardAddr:B2e,sigCardAddrLabel:T2e,sigCardAddrValue:P2e,sigLineWrap:R2e,sigValue:L2e,sigWrite:D2e,sigPenLine:O2e,penDraw:F2e,docFooter:$2e,authorizeBtn:z2e,rejectBtn:q2e,docFooterNote:U2e,revokeError:H2e,readOnlyFoot:W2e,readOnlyNote:V2e,readOnlyClose:G2e,docFooterSuccess:K2e,successBlock:Q2e,successRise:Y2e,successMark:J2e,successPop:X2e,successCheck:Z2e,successBody:eve,successTitle:tve,successSub:nve,successDone:rve,docRevoking:sve,revokeStamp:ove,revokeStampLanded:ave,revokeStampInner:ive,revokeStampText:cve,revokeStampDate:lve,revokeStampImpact:uve,stampImpact:dve,docFooterRevoked:fve,revokingBlock:hve,revokingPulse:pve,revokePulse:mve,revokingTitle:gve,revokedBlock:yve,revokedMark:bve,revokedBody:vve,revokedTitle:wve,revokedSub:_ve,scopeRow:xve,limitRow:kve,actionLine:Cve,signatureRow:jve,signatureSlot:Sve,actionsRow:Ave,footerActions:Eve,footerBar:Nve,footerCta:Ive,cta:Mve,ctaSecondary:Bve,ctaTertiary:Tve,ctaDestructive:Pve,docRequester:Rve,protections:Lve,protectionChip:Dve,partyAvatar:Ove,onchain:Fve,onchainKicker:$ve,onchainList:zve,onchainRow:qve,onchainLabel:Uve,onchainAddr:Hve,onchainLink:Wve},Vve={ethereum:{id:"ethereum",name:"Ethereum",chainId:1,color:"#627EEA",short:"ETH"},arbitrum:{id:"arbitrum",name:"Arbitrum",chainId:42161,color:"#2D374B",short:"ARB"},base:{id:"base",name:"Base",chainId:8453,color:"#0052FF",short:"BASE"},optimism:{id:"optimism",name:"Optimism",chainId:10,color:"#FF0420",short:"OP"},polygon:{id:"polygon",name:"Polygon",chainId:137,color:"#8247E5",short:"POL"}},Gve={USDC:{symbol:"USDC",name:"USD Coin",color:"#2775CA",decimals:6,addresses:{ethereum:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",arbitrum:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",base:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",optimism:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85"}},USDT:{symbol:"USDT",name:"Tether USD",color:"#26A17B",decimals:6,addresses:{ethereum:"0xdAC17F958D2ee523a2206206994597C13D831ec7",arbitrum:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",polygon:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F"}},DAI:{symbol:"DAI",name:"Dai Stablecoin",color:"#F4B731",decimals:18,addresses:{ethereum:"0x6B175474E89094C44Da98b954EedeAC495271d0F",arbitrum:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",base:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb"}},WETH:{symbol:"WETH",name:"Wrapped Ether",color:"#627EEA",decimals:18,addresses:{ethereum:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",arbitrum:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",base:"0x4200000000000000000000000000000000000006"}},ARB:{symbol:"ARB",name:"Arbitrum",color:"#2D374B",decimals:18,addresses:{arbitrum:"0x912CE59144191C1204E64559FE8253a0e49E6548"}},VVV:{symbol:"VVV",name:"Venice Token",color:"#FF3B5C",decimals:18,addresses:{base:"0xacfE6019Ed1A7Dc6f7B508C02d1b04ec88cC21bf"}},LINK:{symbol:"LINK",name:"Chainlink",color:"#2A5ADA",decimals:18,addresses:{ethereum:"0x514910771AF9Ca656af840dff83E8264EcF986CA",arbitrum:"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",base:"0x88Fb150BDc53A65fe94Dea0c9BA0a6dAf8C6e196"}},WBTC:{symbol:"WBTC",name:"Wrapped Bitcoin",color:"#F7931A",decimals:8,addresses:{ethereum:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",arbitrum:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f"}},CRV:{symbol:"CRV",name:"Curve DAO Token",color:"#A50E0E",decimals:18,addresses:{ethereum:"0xD533a949740bb3306d119CC777fa900bA034cd52",arbitrum:"0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978"}}},Kve={"morpho-blue":{id:"morpho-blue",name:"Morpho Blue",kind:"Lending vaults",color:"#2B5CFF",addresses:{ethereum:"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFFb",base:"0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFFb"}},aave:{id:"aave",name:"Aave V3",kind:"Lending pool",color:"#B6509E",addresses:{ethereum:"0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",arbitrum:"0x794a61358D6845594F94dc1DB02A252b5b4814aD",base:"0xA238Dd80C259a72e81d7e4664a9801593F98d1c5"}},compound:{id:"compound",name:"Compound III",kind:"Lending pool",color:"#00D395",addresses:{ethereum:"0xc3d688B66703497DAA19211EEdff47f25384cdc3",arbitrum:"0x9c4ec768c28520B50860ea7a15bd7213a9fF58bf",base:"0xb125E6687d4313864e53df431d5425969c15Eb2F"}},"uniswap-v3":{id:"uniswap-v3",name:"Uniswap V3",kind:"AMM",color:"#FF007A",addresses:{ethereum:"0xE592427A0AEce92De3Edee1F18E0157C05861564",arbitrum:"0xE592427A0AEce92De3Edee1F18E0157C05861564",base:"0x2626664c2603336E57B271c5C0b26F421741e481"}},curve:{id:"curve",name:"Curve",kind:"AMM",color:"#A50E0E",addresses:{ethereum:"0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7",arbitrum:"0x7544Fe3d184b6B55D6B36c3FCA1157eE0Ba30287"}},gmx:{id:"gmx",name:"GMX",kind:"Perps",color:"#3D88FF",addresses:{arbitrum:"0x489ee077994B6658eAfA855C308275EAd8097C4A"}},pendle:{id:"pendle",name:"Pendle",kind:"Fixed yield",color:"#00B388",addresses:{ethereum:"0x888888888889758F76e7103c6CbF23ABbF58F946",arbitrum:"0x888888888889758F76e7103c6CbF23ABbF58F946"}},ethena:{id:"ethena",name:"Ethena",kind:"Yield strategy",color:"#7AFAA1",addresses:{ethereum:"0x9D39A5DE30e57443BfF2A8307A4256c8797A3497"}},lyra:{id:"lyra",name:"Lyra",kind:"Options",color:"#39EBA0",addresses:{arbitrum:"0x2dD5edEEf3A77fcF8290a44C7CD96fAaa0E96322"}},dopex:{id:"dopex",name:"Dopex",kind:"Options",color:"#22E1FF",addresses:{arbitrum:"0xa12d0FaF12BC4d2DB8DD0F1F94B7C9DA02b2D7A8"}}},P1={deposit:{label:"Deposit",accent:"#1990FF"},withdraw:{label:"Withdraw",accent:"#6ba3ff"},claim:{label:"Claim",accent:"#5fd28a"},swap:{label:"Swap",accent:"#9b8eff"},rebalance:{label:"Rebalance",accent:"#ffb84d"},"conditional-swap":{label:"Conditional",accent:"#ff8a8a"},short:{label:"Short",accent:"#ff8a8a"},long:{label:"Long",accent:"#5fd28a"},hedge:{label:"Hedge",accent:"#9b8eff"}},yx=e=>Vve[e],bx=e=>Gve[e],R1=e=>Kve[e];function Mh({open:e,mandate:t,onClose:n,onAuthorize:r,onReject:s,onRevoke:o,readOnly:a=!1,signedDate:c=null,mode:l="sign"}){var O,B,U,L,N,H;const u=a&&l==="sign"?"view":l,{address:d}=Oe(),{account:f}=dd(),h=(f==null?void 0:f.safe)??null,p=f?[{name:"My SMA",address:f.safe}]:[],[m,g]=S.useState("preview"),[_,b]=S.useState(null),[y,v]=S.useState(!1),w=S.useRef(null),x=S.useRef(null);S.useEffect(()=>{if(!e)return;u==="view"?(g("signed"),b(c?new Date(c):new Date)):u==="revoke"?(g("preview"),b(c?new Date(c):new Date)):(g("preview"),b(null)),document.body.style.overflow="hidden";const M=$=>{$.key==="Escape"&&m!=="signing"&&m!=="revoking"&&m!=="revoked"&&(n==null||n())};return window.addEventListener("keydown",M),()=>{window.removeEventListener("keydown",M),document.body.style.overflow=""}},[e,u]);function A(){const M=w.current,$=x.current;if(M&&$){const W=Math.max(0,M.offsetTop-($.clientHeight-M.clientHeight)/2);vx($,W,360)}setTimeout(()=>g("signing"),280),setTimeout(()=>{b(new Date),g("signed"),setTimeout(()=>r==null?void 0:r(t.id),4200)},1880)}function C(){r==null||r(t.id)}function j(){const M=w.current,$=x.current;if(M&&$){const W=Math.max(0,M.offsetTop-($.clientHeight-M.clientHeight)/2);vx($,W,360)}setTimeout(()=>g("revoking"),280),setTimeout(()=>g("revoked"),640),setTimeout(()=>o==null?void 0:o(t.id),3600)}if(!e||!t)return null;const E=Qve(t),I=p[0],T=new Date;return i.jsxs("div",{className:G.overlay,role:"dialog","aria-modal":"true","aria-label":"Mandate",onClick:m==="preview"?n:void 0,children:[i.jsxs(Ct,{className:G.card,onClick:M=>M.stopPropagation(),children:[i.jsx("button",{type:"button",className:G.close,onClick:n,"aria-label":"Close",disabled:m==="signing",children:"×"}),i.jsxs("article",{ref:x,className:`${G.doc} ${m==="revoking"||m==="revoked"?G.docRevoking:""}`,children:[i.jsxs("header",{className:G.docHead,children:[i.jsx("span",{className:G.docKicker,children:"Mandate"}),i.jsx("h1",{className:G.docTitle,children:t.title}),i.jsxs("p",{className:G.docLede,children:["A bounded delegation between ",i.jsx("strong",{children:Qg(d)})," and the agent operating inside ",i.jsx("strong",{children:I.name}),"."]}),i.jsxs("dl",{className:G.docMeta,children:[i.jsxs("span",{className:G.docMetaCell,children:[i.jsx("dt",{children:"Drafted by"}),i.jsxs("dd",{className:G.docMetaWithMark,children:[i.jsx(xs,{name:t.aiName,size:14})," ",t.aiName]})]}),i.jsxs("span",{className:G.docMetaCell,children:[i.jsx("dt",{children:"Requested"}),i.jsx("dd",{children:t.requestedAgo??"just now"})]}),i.jsxs("span",{className:G.docMetaCell,children:[i.jsx("dt",{children:"Effective"}),i.jsx("dd",{children:"upon signature"})]}),i.jsxs("span",{className:G.docMetaCell,children:[i.jsx("dt",{children:"Date"}),i.jsx("dd",{children:ci(T)})]})]})]}),i.jsx(wx,{}),i.jsxs(ai,{roman:"",title:"Summary",kicker:"Plain-language recital",children:[i.jsxs("p",{className:G.docBody,children:["The undersigned wallet (the ",i.jsx("em",{children:"Owner"}),") hereby grants the agent identified herein a",i.jsx("em",{children:" bounded delegation"})," to act on its behalf inside the Separately Managed Account named ",i.jsx("strong",{children:I.name}),", strictly within the scope, limits, and permitted actions defined by this mandate."]}),t.summary&&i.jsxs("blockquote",{className:G.recital,children:[i.jsx("span",{className:G.recitalMark,"aria-hidden":!0,children:"“"}),i.jsx("p",{children:t.summary}),i.jsxs("footer",{children:[i.jsx(xs,{name:t.aiName,size:13}),i.jsxs("span",{children:["Drafted by ",t.aiName]})]})]})]}),i.jsx(ai,{roman:"I",title:"Parties",children:i.jsxs("ul",{className:G.parties,children:[i.jsx(L1,{role:"Owner",desc:"Externally Owned Account — sole signer",address:d}),i.jsx(L1,{role:"Safe Account",desc:`Separately Managed Account · ${ii(I.network)}`,name:I.name,address:h}),i.jsx(L1,{role:"Agent",desc:`Delegated EOA · operated by ${t.aiName}`,address:kx(t),active:!0})]})}),i.jsx(ai,{roman:"II",title:"Scope",children:i.jsxs("div",{className:G.scopeGrid,children:[i.jsx(D1,{label:"Networks",count:((O=t.networks)==null?void 0:O.length)??0,children:(t.networks??[]).map(M=>{const $=yx(M)??{label:ii(M),color:"#1990FF"};return i.jsxs("span",{className:G.scopePill,children:[i.jsx("span",{className:G.scopePillDot,style:{background:$.color},"aria-hidden":!0}),$.label]},M)})}),i.jsx(D1,{label:"Assets",count:((B=t.assets)==null?void 0:B.length)??0,children:(t.assets??[]).map(M=>{const $=bx(M)??{symbol:M,color:"#999"};return i.jsxs("span",{className:G.scopePill,children:[i.jsx("span",{className:G.scopePillDot,style:{background:$.color},"aria-hidden":!0}),$.symbol]},M)})}),i.jsxs(D1,{label:"Protocols",count:E.protocols.length,children:[E.protocols.length===0&&i.jsx("span",{className:G.scopeEmpty,children:"Any onchain target permitted under the action whitelist."}),E.protocols.map(M=>{const $=R1(M)??{label:ii(M),color:"#FFFFFF"};return i.jsxs("span",{className:G.scopePill,children:[i.jsx("span",{className:G.scopePillDot,style:{background:$.color??"#FFFFFF"},"aria-hidden":!0}),$.label]},M)})]})]})}),i.jsx(ai,{roman:"III",title:"Limits",children:i.jsxs("div",{className:G.limitsGrid,children:[i.jsx(_x,{label:"Spending cap",emphasis:!0,children:((U=t.caps)==null?void 0:U.length)>0?t.caps.map((M,$)=>i.jsxs("span",{className:G.limitVal,children:[M.currency==="USD"?`$${M.amount.toLocaleString()}`:`${M.amount} ${M.asset}`,i.jsxs("span",{className:G.limitSub,children:["max · ",M.asset]})]},$)):i.jsx("span",{className:G.limitVal,children:"—"})}),i.jsx(_x,{label:"Time limit",emphasis:!0,children:i.jsxs("span",{className:G.limitVal,children:[t.duration??"—",t.endsAt&&i.jsxs("span",{className:G.limitSub,children:["ends · ",ci(new Date(t.endsAt*1e3))]})]})})]})}),i.jsx(ai,{roman:"IV",title:"Permitted actions",kicker:`${((L=t.actions)==null?void 0:L.length)??((N=t.allowed)==null?void 0:N.length)??0} authorised`,children:((H=t.actions)==null?void 0:H.length)>0?i.jsx("ol",{className:G.actionList,children:t.actions.map((M,$)=>{var W,ie,de;return(P1==null?void 0:P1[M.kind])??ii(M.kind),i.jsxs("li",{className:G.actionItem,children:[i.jsx("span",{className:G.actionIndex,children:Cx($+1).toLowerCase()}),i.jsxs("div",{className:G.actionBody,children:[i.jsx("span",{className:G.actionLabel,children:M.label}),i.jsxs("div",{className:G.actionMeta,children:[M.asset&&i.jsxs("span",{className:G.actionChip,children:[i.jsx("span",{className:G.actionChipDot,style:{background:((W=bx(M.asset))==null?void 0:W.color)??"#999"}}),M.asset]}),M.venue&&i.jsxs("span",{className:G.actionChip,children:[i.jsx("span",{className:G.actionChipDot,style:{background:((ie=R1(M.venue))==null?void 0:ie.color)??"#fff"}}),((de=R1(M.venue))==null?void 0:de.label)??ii(M.venue)]}),(M.networks??[]).map(ye=>{var z;return i.jsxs("span",{className:G.actionChip,children:[i.jsx("span",{className:G.actionChipDot,style:{background:((z=yx(ye))==null?void 0:z.color)??"#1990FF"}}),ii(ye)]},ye)})]})]})]},M.id??$)})}):i.jsx("ol",{className:G.actionList,children:(t.allowed??[]).map((M,$)=>i.jsxs("li",{className:G.actionItem,children:[i.jsx("span",{className:G.actionIndex,children:Cx($+1).toLowerCase()}),i.jsx("div",{className:G.actionBody,children:i.jsx("span",{className:G.actionLabel,children:M})})]},$))})}),i.jsx(ai,{roman:"V",title:"Reservation of rights",children:i.jsxs("ul",{className:G.rights,children:[i.jsxs("li",{children:["The Owner may ",i.jsx("strong",{children:"pause"})," the agent at any time, halting future executions without revoking the mandate."]}),i.jsxs("li",{children:["The Owner may ",i.jsx("strong",{children:"revoke"})," the mandate at any time. Revocation is permanent and immediate onchain."]}),i.jsxs("li",{children:["The Owner retains ",i.jsx("strong",{children:"self-custody"})," of the Separately Managed Account at all times. Sail never holds the keys."]}),i.jsxs("li",{children:["Any action taken outside the scope, limits, or permitted actions of this mandate is ",i.jsx("strong",{children:"rejected onchain"})," by Template Logic."]})]})}),i.jsx(wx,{}),i.jsxs("section",{ref:w,className:G.sigBlock,"aria-label":"Signatures",children:[i.jsxs("header",{className:G.sigHead,children:[i.jsx("span",{className:G.docKicker,children:"Signatures"}),i.jsx("h2",{className:G.sigTitle,children:"In witness whereof"}),i.jsxs("p",{className:G.sigSub,children:["Signed on ",ci(T),m==="signed"&&_&&` at ${hf(_)} UTC`,"."]})]}),i.jsxs("div",{className:G.sigGrid,children:[i.jsx(xx,{role:"Drafted by",name:t.aiName,addressKicker:"Agent identity",address:`sail-agent#${kx(t).slice(2,8)}`,state:"signed",signatureValue:`/s/ ${t.aiName}`,signatureSub:"Counter-signed at draft",brand:t.aiName}),i.jsx(xx,{role:"Owner",name:"Externally Owned Account",addressKicker:"EOA address",address:Qg(d),state:u==="view"||u==="revoke"||m==="signed"?"signed":m==="signing"?"signing":"pending",signatureValue:d,signatureSub:u==="view"||u==="revoke"?_?`Signed ${ci(_)} at ${hf(_)} UTC`:"Signed onchain":m==="signed"&&_?`Signed ${ci(_)} at ${hf(_)} UTC`:"Awaiting signature"})]}),(m==="revoking"||m==="revoked")&&i.jsxs("div",{className:`${G.revokeStamp} ${m==="revoked"?G.revokeStampLanded:""}`,"aria-hidden":!0,children:[i.jsxs("span",{className:G.revokeStampInner,children:[i.jsx("span",{className:G.revokeStampText,children:"REVOKED"}),i.jsx("span",{className:G.revokeStampDate,children:_&&ci(_)})]}),i.jsx("span",{className:G.revokeStampImpact,"aria-hidden":!0})]})]}),i.jsx("footer",{className:`${G.docFooter} ${m==="signed"&&u!=="view"?G.docFooterSuccess:""} ${m==="revoked"?G.docFooterRevoked:""}`,children:u==="view"?i.jsxs("div",{className:G.readOnlyFoot,children:[i.jsx("span",{className:G.readOnlyNote,children:"Signed onchain · revocable at any time from the agent page."}),i.jsx("button",{type:"button",className:G.readOnlyClose,onClick:n,children:"Close"})]}):u==="revoke"?m==="preview"?i.jsxs(i.Fragment,{children:[i.jsx("button",{type:"button",className:G.rejectBtn,onClick:j,children:"Revoke this mandate"}),i.jsx("button",{type:"button",className:G.authorizeBtn,onClick:n,style:{background:"rgba(255,255,255,0.04)",borderColor:"rgba(255,255,255,0.12)",color:"var(--text-primary)",boxShadow:"none"},children:"Keep it active"}),i.jsxs("p",{className:G.docFooterNote,children:["Revocation is ",i.jsx("strong",{children:"permanent"})," and immediate onchain. Open positions stay in your SMA — Sail won't unwind anything — but your AI loses authority to act and you cannot undo this."]})]}):m==="revoking"?i.jsxs("div",{className:G.revokingBlock,role:"status","aria-live":"polite",children:[i.jsx("span",{className:G.revokingPulse,"aria-hidden":!0}),i.jsx("span",{className:G.revokingTitle,children:"Revoking onchain…"})]}):i.jsxs("div",{className:G.revokedBlock,role:"status","aria-live":"polite",children:[i.jsx("span",{className:G.revokedMark,"aria-hidden":!0,children:i.jsxs("svg",{viewBox:"0 0 32 32",width:"22",height:"22",fill:"none","aria-hidden":!0,children:[i.jsx("circle",{cx:"16",cy:"16",r:"15",stroke:"currentColor",strokeWidth:"1.4"}),i.jsx("path",{d:"M10 16h12",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round"})]})}),i.jsxs("div",{className:G.revokedBody,children:[i.jsx("span",{className:G.revokedTitle,children:"Mandate revoked"}),i.jsx("span",{className:G.revokedSub,children:"The delegated EOA is permanently disabled. Funds remain self-custody."})]})]}):m!=="signed"?i.jsxs(i.Fragment,{children:[i.jsxs("button",{type:"button",className:G.authorizeBtn,onClick:A,disabled:m!=="preview",children:[m==="preview"&&"Authorize & sign",m==="signing"&&"Signing…"]}),i.jsx("button",{type:"button",className:G.rejectBtn,onClick:()=>v(!0),disabled:m!=="preview",children:"Reject mandate"}),i.jsx("p",{className:G.docFooterNote,children:"By signing you agree to the scope, limits, and permitted actions described above. Revocable at any time from the agent page."})]}):i.jsxs("div",{className:G.successBlock,role:"status","aria-live":"polite",children:[i.jsx("span",{className:G.successMark,"aria-hidden":!0,children:i.jsxs("svg",{viewBox:"0 0 32 32",width:"22",height:"22",fill:"none","aria-hidden":!0,children:[i.jsx("circle",{cx:"16",cy:"16",r:"15",stroke:"currentColor",strokeWidth:"1.4"}),i.jsx("path",{d:"M9 16.5l4.5 4.5L23 11",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),i.jsxs("div",{className:G.successBody,children:[i.jsx("span",{className:G.successTitle,children:"Mandate signed"}),i.jsxs("span",{className:G.successSub,children:["Your agent is operating inside ",p[0].name," now.",_&&` Signed at ${hf(_)} UTC.`]})]}),i.jsx("button",{type:"button",className:G.successDone,onClick:C,autoFocus:!0,children:"Done"})]})})]})]}),i.jsx(bS,{open:y,title:"Reject this mandate?",body:i.jsxs(i.Fragment,{children:[i.jsx("strong",{style:{color:"var(--text-primary)"},children:t.aiName})," will be told the draft was declined. Nothing is created onchain. You can ask your AI to redraft anytime."]}),confirmLabel:"Reject mandate",cancelLabel:"Keep reading",onConfirm:()=>{v(!1),s==null||s(t.id)},onCancel:()=>v(!1)})]})}function vx(e,t,n=360){if(!e)return;const r=e.scrollTop,s=t-r;if(Math.abs(s)<1)return;const o=Date.now(),a=l=>1-Math.pow(1-l,3);function c(){const l=Math.min(1,(Date.now()-o)/n);e.scrollTop=r+s*a(l),l<1&&setTimeout(c,16)}c()}function ai({roman:e,title:t,kicker:n,children:r}){return i.jsxs("section",{className:G.section,children:[i.jsxs("header",{className:G.sectionHead,children:[e&&i.jsxs("span",{className:G.sectionRoman,children:["Article ",e]}),i.jsx("h2",{className:G.sectionTitle,children:t}),n&&i.jsx("span",{className:G.sectionKicker,children:n})]}),i.jsx("div",{className:G.sectionBody,children:r})]})}function wx(){return i.jsx("span",{className:G.divider,"aria-hidden":!0})}function L1({role:e,name:t,desc:n,address:r,active:s}){return i.jsxs("li",{className:`${G.party} ${s?G.partyActive:""}`,children:[i.jsx("span",{className:G.partyRole,children:e}),i.jsx("span",{className:G.partyName,children:t??Qg(r)}),i.jsx("span",{className:G.partyDesc,children:n}),i.jsx("span",{className:G.partyAddr,children:r})]})}function D1({label:e,count:t,children:n}){return i.jsxs("div",{className:G.scopeBlock,children:[i.jsxs("header",{className:G.scopeHead,children:[i.jsx("span",{children:e}),i.jsx("span",{className:G.scopeCount,children:t})]}),i.jsx("div",{className:G.scopeChips,children:n})]})}function _x({label:e,emphasis:t,children:n}){return i.jsxs("div",{className:`${G.limitCell} ${t?G.limitCellEmphasis:""}`,children:[i.jsx("span",{className:G.limitLabel,children:e}),i.jsx("div",{className:G.limitValueWrap,children:n})]})}function xx({role:e,name:t,addressKicker:n,address:r,state:s,signatureValue:o,signatureSub:a,brand:c}){const l=c?G[`sigCardProvider_${Yve(c)}`]:"";return i.jsxs("div",{className:`${G.sigCard} ${G[`sigCard_${s}`]} ${l}`,children:[i.jsxs("header",{className:G.sigCardHead,children:[i.jsx("span",{className:G.sigCardRole,children:e}),c&&i.jsx(xs,{name:c,size:14})]}),i.jsx("span",{className:G.sigCardName,children:t}),i.jsxs("div",{className:G.sigCardAddr,children:[i.jsx("span",{className:G.sigCardAddrLabel,children:n}),i.jsx("span",{className:G.sigCardAddrValue,children:r})]}),i.jsxs("div",{className:G.sigLineWrap,children:[i.jsx("span",{className:G.sigX,"aria-hidden":!0,children:"X"}),i.jsxs("div",{className:G.sigLine,children:[s==="signed"&&i.jsx("span",{className:G.sigValue,children:o}),s==="signing"&&i.jsx("span",{className:G.sigPenLine,"aria-hidden":!0})]})]}),i.jsx("span",{className:G.sigSub,children:a})]})}function Qve(e){const t=new Set;for(const n of e.actions??[])n.venue&&t.add(n.venue);return{protocols:Array.from(t)}}function kx(e){let t=0;const n=e.id??"";for(let a=0;a<n.length;a++)t=t*31+n.charCodeAt(a)|0;t=Math.abs(t);const r=t.toString(16).padStart(8,"0"),s=(t*7).toString(16).padStart(8,"0"),o=(t*11).toString(16).padStart(8,"0");return("0x"+r+s+o+r).slice(0,42)}function Cx(e){return["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI"][e-1]??`${e}`}function Yve(e){const t=(e??"").toLowerCase();return t==="claude"||t==="anthropic"?"claude":t==="cursor"?"cursor":t==="codex"||t==="chatgpt"||t==="openai"||t==="gpt"?"codex":"default"}function ii(e){return e&&e[0].toUpperCase()+e.slice(1)}function Qg(e){return!e||e.length<12?e??"":`${e.slice(0,6)}…${e.slice(-4)}`}function ci(e){return e.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}function hf(e){return e.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1})}function Jve({agentId:e,onBack:t,onEdit:n,onRevoke:r}){var U,L;const{mandate:s}=Fp(),{account:o}=dd(),{address:a}=Oe();o==null||o.safe,o&&o.safe;const c=s??null,l=S.useMemo(()=>uwe(c),[c]),u=((s==null?void 0:s.permissions)??[]).map(N=>({...N,usedByThisAgent:!0})),[d,f]=S.useState([]);function h(N){f(H=>H.map(M=>M.id===N?{...M,enabled:!M.enabled}:M))}const p=(c==null?void 0:c.lastRehearsalHoursAgo)??3,[m,g]=S.useState(p),[_,b]=S.useState(!1);S.useEffect(()=>{g(p)},[p]);function y(){_||(b(!0),setTimeout(()=>{g(0),b(!1)},900))}const[v,w]=S.useState(null),[x,A]=S.useState(!1),[C,j]=S.useState(!1),[E,I]=S.useState(!1);if(S.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"})},[e]),!c)return i.jsxs("div",{className:`${De.pageShell} ${F.shell}`,children:[i.jsx(Ms,{}),i.jsxs("main",{className:F.notFound,children:[i.jsx(Dt,{size:48}),i.jsx("h1",{className:F.notFoundTitle,children:"Agent not found"}),i.jsx("p",{className:F.notFoundBody,children:"The URL points to an agent that doesn’t exist."}),i.jsx(Me,{onClick:t,children:"Back to agents"})]})]});const T=c.status==="active",O=x?"paused":c.status,B=v?l.runs.find(N=>N.id===v):null;return awe(c),iwe(c,O),lwe(c),i.jsxs("div",{className:`${De.pageShell} ${F.shell}`,children:[i.jsx(Ms,{}),i.jsxs("header",{className:F.header,children:[i.jsxs("button",{type:"button",className:F.backBtn,onClick:t,"aria-label":"Back to dashboard",children:[i.jsx(gwe,{}),i.jsx("span",{children:"Dashboard"})]}),parentMandate&&i.jsxs("a",{href:`#/mandate/${parentMandate.id}`,className:F.mandateLinkPill,children:[i.jsx(mwe,{}),i.jsxs("span",{children:["Operating under: ",parentMandate.title]}),i.jsx(Ex,{})]})]}),i.jsxs("main",{className:F.main,children:[i.jsxs("section",{className:F.titleBlock,children:[i.jsxs("div",{className:F.identityRow,children:[i.jsx(xs,{name:c.aiName,size:22}),i.jsxs("span",{className:F.identityName,children:["Created in ",c.aiName]}),i.jsx("span",{className:F.identityDot,"aria-hidden":!0,children:"·"}),i.jsx(Bu,{status:O,kind:"agent"}),i.jsx(swe,{networks:c.networks})]}),i.jsx("h1",{className:`${De.displayHeadline} ${F.title}`,children:c.role??c.title}),c.role&&i.jsx("p",{className:F.titleScope,children:c.title}),l.agentId!=null&&i.jsxs("p",{className:F.identityFootnote,children:[i.jsx("code",{children:c.id}),i.jsx("span",{className:F.identityDot,"aria-hidden":!0,children:"·"}),i.jsxs("span",{children:["agentId ",i.jsx("code",{children:l.agentId.toLocaleString()})]})]}),i.jsx(ewe,{status:O,mandate:c,hasMpcWallet:!!((U=l.mpcWallet)!=null&&U.address),lastRehearsalHoursAgo:m,rehearsing:_,onRehearse:y,managerEndpoint:mockManagerEndpoint})]}),i.jsxs("div",{className:F.body,children:[i.jsx(jx,{title:"Your brief",kicker:"What you asked for",hint:`A summary of everything you told ${c.aiName} across your conversation — your goal, plus any follow-up details ${c.aiName} asked for while drafting this mandate. The mandate itself is ${c.aiName}'s interpretation of this brief into onchain rules.`,children:i.jsxs("blockquote",{className:F.recoQuote,children:[i.jsx("span",{className:F.recoMark,"aria-hidden":!0,children:"“"}),i.jsx("p",{className:F.recoBody,children:l.recommendation.body}),i.jsxs("footer",{className:F.recoFoot,children:[i.jsx(xs,{name:c.aiName,size:16}),i.jsxs("span",{children:["Interpreted by ",c.aiName," · ",l.recommendation.ago]})]})]})}),i.jsxs("div",{className:F.tierStack,children:[i.jsxs(Sx,{tier:"1",depth:0,label:"Agent",primary:l.erc8004.handle,summary:`${hwe(l.mpcWallet.address)} · ${l.runs.length} execution${l.runs.length===1?"":"s"} · last ${((L=l.activity[0])==null?void 0:L.ago)??"—"}`,defaultOpen:!0,children:[i.jsxs("div",{className:F.tierGrid,children:[i.jsxs(li,{title:"Verified handle",kicker:"ERC-8004 · optional",children:[i.jsxs("a",{href:l.erc8004.url,target:"_blank",rel:"noreferrer",className:F.identityLink,children:[i.jsx("span",{className:F.identityHandle,children:l.erc8004.handle}),i.jsx(Yg,{})]}),i.jsx("span",{className:F.sidebarHint,children:"Template-layer metadata only — the kernel doesn't read this. The canonical agent identity is the agentId above."})]}),i.jsxs(li,{title:"Gas balance",kicker:"Agent wallet",children:[i.jsxs("div",{className:F.gasRow,children:[i.jsxs("span",{className:F.gasChain,children:[i.jsx(vwe,{})," Arbitrum"]}),i.jsxs("span",{className:F.gasValue,children:[l.mpcWallet.gas," ETH"]})]}),l.mpcWallet.threshold&&i.jsxs("div",{className:F.signerShareRow,children:[i.jsxs("span",{className:F.signerShareLabel,children:["Signed by ",l.mpcWallet.threshold.replace("-of-"," of ")]}),i.jsx("span",{className:F.signerShareList,children:(l.mpcWallet.keyShares??[]).map(N=>i.jsx("span",{className:F.signerShareChip,children:N},N))})]})]})]}),d.length>0&&i.jsx(li,{title:"Schedules",kicker:`${d.filter(N=>N.enabled).length} of ${d.length} enabled`,children:i.jsx("ul",{className:F.scheduleList,children:d.map(N=>{var H;return i.jsxs("li",{className:`${F.scheduleRow} ${N.enabled?"":F.scheduleRowDisabled}`,children:[i.jsxs("div",{className:F.scheduleMain,children:[i.jsxs("div",{className:F.scheduleHeadRow,children:[i.jsx("span",{className:F.scheduleId,children:N.id}),i.jsx("span",{className:`${F.scheduleMode} ${N.mode==="live"?F.scheduleModeLive:F.scheduleModeFork}`,children:N.mode})]}),i.jsxs("span",{className:F.scheduleCron,children:[N.cronHuman," · ",i.jsx("code",{children:N.cron})]})]}),i.jsxs("div",{className:F.scheduleRuns,children:[i.jsxs("span",{children:["Last ",i.jsx("code",{children:((H=N.lastRun)==null?void 0:H.at)??"—"})]}),i.jsxs("span",{children:["Next ",i.jsx("code",{children:N.nextRun??"—"})]})]}),i.jsx("button",{type:"button",className:`${F.scheduleToggle} ${N.enabled?F.scheduleToggleOn:""}`,onClick:()=>h(N.id),"aria-pressed":N.enabled,"aria-label":`${N.enabled?"Disable":"Enable"} schedule ${N.id}`,children:N.enabled?"Enabled":"Disabled"})]},N.id)})})}),i.jsx(li,{title:"Activity",kicker:"Recent events",children:i.jsxs("ul",{className:F.activityList,children:[l.activity.map(N=>i.jsxs("li",{className:F.activityRow,children:[i.jsx("span",{className:`${F.activityDot} ${F[`actDot_${N.kind}`]??""}`,"aria-hidden":!0}),i.jsx("span",{className:F.activityLabel,children:N.label}),i.jsx("span",{className:F.activityAgo,children:N.ago})]},N.id)),l.activity.length===0&&i.jsx("li",{className:F.activityEmpty,children:"No recent activity."})]})}),i.jsx(li,{title:"Runs",kicker:`${l.runs.length} execution${l.runs.length===1?"":"s"}`,children:i.jsxs("ul",{className:F.runList,children:[l.runs.map(N=>i.jsx("li",{children:i.jsxs("button",{type:"button",className:`${F.runRow} ${N.status==="failed"?F.runFailed:""}`,onClick:()=>w(N.id),children:[i.jsx("span",{className:`${F.runStatus} ${F[`runStatus_${N.status}`]}`,"aria-hidden":!0,children:N.status==="success"?i.jsx(Nx,{}):N.status==="failed"?i.jsx(Ix,{}):i.jsx(Mx,{})}),i.jsx("span",{className:F.runId,children:N.id}),i.jsx("span",{className:F.runLabel,children:N.label}),i.jsxs("span",{className:F.runMeta,children:[i.jsx("span",{className:F.runGas,children:N.gas}),i.jsx("span",{className:F.runAgo,children:N.ago})]}),i.jsx("span",{className:F.runChevron,"aria-hidden":!0,children:i.jsx(ywe,{})})]})},N.id)),l.runs.length===0&&i.jsx("li",{className:F.activityEmpty,children:"This agent hasn’t executed yet."})]})})]}),i.jsx(Sx,{tier:"2",depth:1,label:"Permissions",primary:parentMandate?`${usedPermissionIds.size} of ${u.filter(N=>!N.revoked).length} active permissions`:"No mandate",summary:parentMandate?`Operating under ${parentMandate.title} · this agent uses the highlighted lines below`:"This agent is not bound to a signed mandate.",defaultOpen:!0,children:parentMandate?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:F.permRelation,children:[i.jsxs("div",{className:F.permRelationText,children:[i.jsx("span",{className:F.permRelationKicker,children:"Role"}),i.jsx("span",{className:F.permRelationRole,children:c.role??c.title}),i.jsxs("span",{className:F.permRelationBody,children:["Operates as an agent wallet under"," ",i.jsx("strong",{children:parentMandate.title}),". The mandate above defines the full permission set; this agent uses the",i.jsxs("strong",{children:[" ",usedPermissionIds.size]})," highlighted below."]})]}),i.jsxs("a",{href:`#/mandate/${parentMandate.id}`,className:F.permRelationLink,children:[i.jsx("span",{children:"Open mandate"}),i.jsx(Ex,{})]})]}),i.jsx(li,{title:"Permissions this agent uses",kicker:"Inherited from the mandate",children:i.jsx("ul",{className:F.agentPermList,children:u.map(N=>i.jsxs("li",{className:`${F.agentPermRow} ${N.usedByThisAgent?F.agentPermUsed:F.agentPermUnused} ${N.revoked?F.agentPermRevoked:""}`,children:[i.jsx("span",{className:F.agentPermMark,"aria-hidden":!0,children:N.revoked?i.jsx(Ix,{}):N.usedByThisAgent?i.jsx(Nx,{}):i.jsx(Mx,{})}),i.jsxs("span",{className:F.agentPermBody,children:[i.jsx("span",{className:F.agentPermLabel,children:N.label}),i.jsx("span",{className:F.agentPermSub,children:N.sub}),N.template&&i.jsxs("span",{className:F.agentPermMeta,children:[i.jsx("span",{className:F.agentPermMetaTpl,children:N.template}),N.version&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:F.agentPermMetaSep,"aria-hidden":!0,children:"·"}),i.jsxs("span",{className:F.agentPermMetaVer,children:["v",N.version]})]})]})]}),i.jsx("span",{className:F.agentPermTag,children:N.revoked?"Revoked on mandate":N.usedByThisAgent?"Used by this agent":"Available · not used"})]},N.id))})}),i.jsx("p",{className:F.permRelationHint,children:"To revoke an individual permission, open the parent mandate. Revocation always happens at the mandate level so every agent operating under it loses authority for that line at once."})]}):i.jsx("p",{className:F.permRelationEmpty,children:"This agent is not currently bound to a signed mandate."})})]}),i.jsx(jx,{title:"Custom pages",kicker:`${l.pages.length} created by your AI`,note:"Ask your AI to build a page for this agent — a dashboard, a watchlist, anything you want.",children:l.pages.length>0?i.jsxs("ul",{className:F.pagesList,children:[l.pages.map(N=>i.jsxs("li",{className:F.pageRow,children:[i.jsx("span",{className:F.pageIcon,"aria-hidden":!0,children:N.icon}),i.jsxs("div",{className:F.pageBody,children:[i.jsx("span",{className:F.pageTitle,children:N.title}),i.jsxs("span",{className:F.pageMeta,children:[i.jsx(xs,{name:N.maker,size:12}),i.jsxs("span",{children:[N.maker," · ",N.updated]})]})]}),i.jsxs("a",{className:F.pageOpen,href:N.url,target:"_blank",rel:"noreferrer",children:[i.jsx("span",{children:"Open"}),i.jsx(Yg,{})]})]},N.id)),i.jsxs("li",{className:F.pageNew,children:[i.jsx("span",{className:F.pageNewIcon,"aria-hidden":!0,children:"+"}),i.jsxs("div",{className:F.pageNewBody,children:[i.jsx("span",{className:F.pageNewTitle,children:"Ask your AI to build a page"}),i.jsx("span",{className:F.pageNewSub,children:"Try: “Sailor, build me a yield-history page for this agent.”"})]})]})]}):i.jsxs("div",{className:F.pagesEmpty,children:[i.jsx("span",{className:F.pagesEmptyIcon,"aria-hidden":!0,children:"+"}),i.jsx("span",{className:F.pagesEmptyTitle,children:"No custom pages yet"}),i.jsx("span",{className:F.pagesEmptySub,children:"Ask your AI to design one for this agent — Sail will serve it locally."})]})}),i.jsx(Zve,{tone:"warn",kicker:"Reversible · agent only",title:x?"Resume this agent":"Stop this agent",description:x?"This agent is stopped. Resume to let it dispatch again — no re-signing required.":"Stops this agent. Other agents under the same mandate keep running. You can resume at any time without re-signing. Agents are never revoked; only mandates and individual permissions are.",action:i.jsx("button",{type:"button",className:`${F.pauseBtn} ${x?F.pauseBtnPaused:""}`,onClick:()=>A(N=>!N),disabled:!T&&!x,children:x?"Resume this agent":"Stop this agent"})})]})]}),i.jsx(owe,{run:B,open:!!B,onClose:()=>w(null)}),i.jsx(Mh,{open:E,mandate:c,readOnly:!0,signedDate:l.receipt.signedAt,onClose:()=>I(!1)}),i.jsx(Mh,{open:C,mode:"revoke",mandate:c,signedDate:l.receipt.signedAt,onClose:()=>j(!1),onRevoke:()=>{j(!1),r==null||r()}})]})}function jx({title:e,kicker:t,note:n,hint:r,headerAction:s,accent:o,children:a}){return i.jsxs("section",{className:`${F.section} ${o?F[`sectionAccent_${o}`]:""}`,children:[i.jsxs("header",{className:F.sectionHead,children:[i.jsxs("div",{className:F.sectionHeadText,children:[i.jsx("span",{className:F.sectionKicker,children:t}),i.jsxs("h2",{className:F.sectionTitle,children:[e,r&&i.jsx("span",{className:F.sectionTitleHint,title:r,"aria-label":r,role:"img",children:"i"})]}),n&&i.jsx("p",{className:F.sectionNote,children:n})]}),s&&i.jsx("div",{className:F.sectionHeadAction,children:s})]}),a]})}function Sx({tier:e,depth:t=0,label:n,primary:r,summary:s,defaultOpen:o,children:a}){const[c,l]=S.useState(o??!1),u=`tier-${e}-heading`,d=`tier-${e}-body`;return i.jsxs("section",{className:`${F.tierCard} ${F[`tierCardDepth_${t}`]??""} ${c?F.tierCardOpen:""}`,"aria-labelledby":u,children:[t>0&&i.jsx("span",{className:F.tierCardConnector,"aria-hidden":!0,children:i.jsx(Xve,{})}),i.jsxs("button",{type:"button",className:F.tierCardHead,onClick:()=>l(f=>!f),"aria-expanded":c,"aria-controls":d,id:u,children:[i.jsxs("div",{className:F.tierCardHeadText,children:[i.jsx("span",{className:F.tierCardLabel,children:n}),i.jsx("span",{className:F.tierCardPrimary,children:r}),s&&i.jsx("span",{className:F.tierCardSummary,children:s})]}),i.jsx("span",{className:`${F.tierCardChevron} ${c?F.tierCardChevronOpen:""}`,"aria-hidden":!0,children:i.jsx(bwe,{})})]}),c&&i.jsx("div",{className:F.tierCardBody,id:d,role:"region",children:a})]})}function Xve(){return i.jsxs("svg",{viewBox:"0 0 24 52",width:"24",height:"52",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsx("defs",{children:i.jsxs("linearGradient",{id:"tier-conn",x1:"0",y1:"0",x2:"0",y2:"52",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{offset:"0%",stopColor:"#FFFFFF",stopOpacity:"0"}),i.jsx("stop",{offset:"35%",stopColor:"#FFFFFF",stopOpacity:"0.18"}),i.jsx("stop",{offset:"100%",stopColor:"#1990FF",stopOpacity:"0.65"})]})}),i.jsx("path",{d:"M 1.5 0 L 1.5 36 Q 1.5 44 11 44 L 22 44",stroke:"url(#tier-conn)",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),i.jsx("circle",{cx:"22",cy:"44",r:"2",fill:"#1990FF",fillOpacity:"0.75"})]})}function Zve({tone:e,kicker:t,title:n,description:r,action:s}){return i.jsxs("section",{className:`${F.actionCard} ${F[`actionCard_${e}`]}`,children:[i.jsxs("div",{className:F.actionCardText,children:[i.jsx("span",{className:`${F.actionCardKicker} ${F[`actionCardKicker_${e}`]}`,children:t}),i.jsx("h3",{className:F.actionCardTitle,children:n}),i.jsx("p",{className:F.actionCardDescription,children:r})]}),i.jsx("div",{className:F.actionCardAction,children:s})]})}function li({title:e,kicker:t,children:n}){return i.jsxs("section",{className:F.subsection,children:[i.jsxs("header",{className:F.subsectionHead,children:[i.jsx("span",{className:F.subsectionKicker,children:t}),i.jsx("h3",{className:F.subsectionTitle,children:e})]}),n]})}function ewe({status:e,mandate:t,hasMpcWallet:n,lastRehearsalHoursAgo:r,rehearsing:s,onRehearse:o,managerEndpoint:a}){const c=twe({status:e,hasMpcWallet:n,lastRehearsalHoursAgo:r}),l=r!=null&&r>24;return i.jsxs("div",{className:F.readinessLine,children:[i.jsxs("div",{className:F.readinessStatusRow,children:[i.jsx("span",{className:`${F.readinessDot} ${F[`readinessDot_${c.tone}`]}`,"aria-hidden":!0}),i.jsx("span",{className:F.readinessLabel,children:c.headline}),c.detail&&i.jsx("span",{className:F.readinessDetail,children:c.detail}),r!=null&&i.jsxs("button",{type:"button",className:`${F.readinessRehearsal} ${l?F.readinessRehearsalStaleBtn:""} ${s?F.readinessRehearsalBusy:""}`,onClick:o,disabled:s,title:"Click to re-run the dry run — runs against a local chain fork. Live dispatch requires a rehearsal ≤ 24h old.","aria-label":"Re-run dry run on a chain fork",children:[i.jsx(rwe,{}),s?i.jsx(i.Fragment,{children:"Re-running dry run…"}):i.jsxs(i.Fragment,{children:["Dry run · ",nwe(r),l&&i.jsx("span",{className:F.readinessRehearsalStale,children:" · stale · re-run"})]})]})]}),i.jsxs("p",{className:F.readinessAttribution,children:["Drafted in ",i.jsx("strong",{children:t.aiName}),". Runtime decisions come from your agent endpoint at ",i.jsx("code",{children:a.url})," — not from"," ",t.aiName,". Switching drafters doesn't change who runs the agent."]})]})}function twe({status:e,hasMpcWallet:t,lastRehearsalHoursAgo:n}){return e==="revoked"?{headline:"Ended",detail:"parent mandate was revoked",tone:"muted"}:e==="expired"?{headline:"Expired",detail:"window closed",tone:"muted"}:e==="paused"?{headline:"Stopped",detail:"schedules disabled · resume any time",tone:"warn"}:t?n!=null&&n>24?{headline:"Dry run stale",detail:"rerun on a chain fork to resume live dispatch",tone:"warn"}:{headline:"Live · dispatching",detail:"schedules firing onchain",tone:"success"}:{headline:"Awaiting signer",detail:"delegated MPC wallet not yet bound",tone:"warn"}}function nwe(e){if(e<1)return"just now";if(e<24)return`${Math.round(e)}h ago`;const t=Math.round(e/24);return t===1?"1 day ago":`${t} days ago`}function rwe(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M3 9.5c2-3.6 6-3.6 8 0"}),i.jsx("path",{d:"M5.5 7l-2.5 2.5L5.5 12"}),i.jsx("circle",{cx:"11",cy:"3.5",r:"1",fill:"currentColor"})]})}function swe({networks:e}){return!e||e.length===0?null:i.jsx("span",{className:F.chainChips,"aria-label":`Networks: ${e.map(Ax).join(", ")}`,children:e.map(t=>i.jsxs("span",{className:F.chainChip,children:[i.jsx("span",{className:`${F.chainChipDot} ${F[`netDot_${t}`]??""}`,"aria-hidden":!0}),i.jsx("span",{children:Ax(t)})]},t))})}function owe({run:e,open:t,onClose:n}){return S.useEffect(()=>{if(!t)return;const r=s=>{s.key==="Escape"&&(n==null||n())};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t,n]),i.jsxs(i.Fragment,{children:[i.jsx("div",{className:`${F.drawerScrim} ${t?F.drawerScrimOpen:""}`,onClick:n,"aria-hidden":!0}),i.jsx("aside",{className:`${F.drawer} ${t?F.drawerOpen:""}`,role:"dialog","aria-modal":"true","aria-label":"Run detail",children:e&&i.jsxs(i.Fragment,{children:[i.jsxs("header",{className:F.drawerHead,children:[i.jsxs("div",{className:F.drawerHeadLeft,children:[i.jsx("span",{className:F.drawerKicker,children:"Execution"}),i.jsx("span",{className:F.drawerTitle,children:e.id})]}),i.jsx("button",{type:"button",className:F.drawerClose,onClick:n,"aria-label":"Close",children:"×"})]}),i.jsxs("div",{className:F.drawerBody,children:[i.jsxs("dl",{className:F.drawerGrid,children:[i.jsx(qo,{k:"Status",v:i.jsx("span",{className:`${F.drawerStatus} ${F[`runStatus_${e.status}`]}`,children:e.status==="success"?"Success":e.status==="failed"?"Failed":"Pending"})}),i.jsx(qo,{k:"Action",v:e.label}),i.jsx(qo,{k:"Tx hash",v:i.jsxs("a",{className:F.drawerLink,href:`https://arbiscan.io/tx/${e.txHash}`,target:"_blank",rel:"noreferrer",children:[pwe(e.txHash),i.jsx(Yg,{})]})}),i.jsx(qo,{k:"Block",v:e.block}),i.jsx(qo,{k:"Gas",v:e.gas}),i.jsx(qo,{k:"When",v:`${e.ts} · ${e.ago}`}),e.error&&i.jsx(qo,{k:"Error",v:i.jsx("span",{className:F.drawerError,children:e.error})})]}),i.jsxs("section",{className:F.drawerSection,children:[i.jsx("h3",{className:F.drawerSectionTitle,children:"Simulation"}),i.jsx("p",{className:F.drawerNote,children:e.status==="failed"?"Simulation passed before broadcast. The revert was triggered onchain.":"Simulation matched the executed result exactly."})]}),i.jsxs("section",{className:F.drawerSection,children:[i.jsx("h3",{className:F.drawerSectionTitle,children:"Log"}),i.jsx("pre",{className:F.drawerLog,children:e.log})]})]})]})})]})}function qo({k:e,v:t}){return i.jsxs("div",{className:F.drawerRow,children:[i.jsx("dt",{children:e}),i.jsx("dd",{children:t})]})}function awe(e){return e.lastAction?{value:e.lastAction.ago,sub:e.lastAction.label}:{value:"—",sub:"No checks yet."}}function iwe(e,t){var c;if(t!=="active")return{value:"—",sub:t==="paused"?"Paused":"Not running"};const n=((c=e.lastAction)==null?void 0:c.ago)??"0h ago",r=cwe(n),s=6;if(r==null)return{value:"~6h",sub:"Continuous · every 6h"};const o=Math.max(0,s-r);return{value:o<=0?"soon":`in ${o}h`,sub:"Continuous · every 6h"}}function cwe(e){if(!e)return null;if(/just now/i.test(e))return 0;const t=e.match(/(\d+)\s*([mhd])/i);if(!t)return null;const n=Number(t[1]),r=t[2].toLowerCase();return r==="m"?n/60:r==="h"?n:r==="d"?n*24:null}function lwe(e){const t=e.duration??"",n=t.match(/Ends in (.+)/i);return n?{value:n[1],sub:"Auto-revokes at expiry."}:/^expired/i.test(t)?{value:"Expired",sub:t.replace(/^expired\s*/i,"")}:/^revoked/i.test(t)?{value:"Revoked",sub:t.replace(/^revoked\s*/i,"")}:{value:t||"—",sub:""}}function uwe(e){var w,x,A,C;if(!e)return{mpcWallet:{},runs:[],activity:[],schedule:{},erc8004:{},agentId:null,templateHash:"",policyHash:"",templateDeployed:!1,targets:[],receipt:{},pages:[],recommendation:{}};const t=dwe(e.id),n=t.toString(16).padStart(8,"0"),r=`0x${n}${(t*7).toString(16).padStart(8,"0")}${(t*11).toString(16).padStart(8,"0")}${n}`,s={address:fwe(r),gas:(.005+t%30/1e3).toFixed(4),threshold:"2-of-3",provenance:"sail-mpc-lab",keyShares:["operator-a","operator-b","paper-backup"]},o=8004e3+t%1e3,a={handle:`sail-agent#${s.address.slice(2,8)}`,url:`https://identity.erc8004.org/${s.address}`},c=e.status==="active"?{label:"Continuous · checks every 6h"}:{label:"Stopped"},l=((w=e.lastAction)==null?void 0:w.label)??"Mandate signed",u=e.status==="active"?[{id:"a1",label:l,ago:((x=e.lastAction)==null?void 0:x.ago)??"just now",kind:"exec"},{id:"a2",label:"Simulation passed before broadcast",ago:((A=e.lastAction)==null?void 0:A.ago)??"2h ago",kind:"sim"},{id:"a3",label:"Permission check ok",ago:"4h ago",kind:"check"},{id:"a4",label:"Gas balance refreshed",ago:"4h ago",kind:"sys"},{id:"a5",label:"Agent authorized",ago:"1d ago",kind:"auth"}]:[{id:"a1",label:e.status==="revoked"?"Agent revoked":"Agent expired",ago:((C=e.lastAction)==null?void 0:C.ago)??"—",kind:"auth"}],d=(e.actions??[]).slice(0,6).map((j,E)=>{var I;return{id:`run-${String(t%900+70+E).padStart(3,"0")}`,label:j.label,status:E===2&&e.status==="active"?"failed":"success",ago:["just now","2h ago","6h ago","1d ago","2d ago","4d ago"][E]??`${E+1}d ago`,ts:"2026-05-21 12:08 UTC",block:23481004-E*13,txHash:`0x${t.toString(16).padStart(4,"0").repeat(8).slice(0,60)}${E}`,gas:`$${(.08+E*.04).toFixed(2)}`,log:`[exec] ${j.label}
1787
1787
  [exec] target: ${j.venue??"protocol"}@${((I=j.networks)==null?void 0:I[0])??"arbitrum"}
1788
1788
  [sim ] preflight ok — gas 0.00018 ETH
1789
1789
  [bcst] tx submitted — nonce 0x4${E}
1790
- [recv] block ${23481004-E*13} · success`,error:E===2&&e.status==="active"?"Slippage exceeded limit (0.5%)":null}}),f=`0x${(t*13).toString(16).padStart(16,"0")}${n}`,h=`0x${(t*17).toString(16).padStart(8,"0")}…${(t*19).toString(16).padStart(4,"0")}`,p=e.status==="active"||e.status==="expired",m={deposit:{sig:"supply(address,uint256,address,uint16)",selector:"0x617ba037",template:"SharedBoundedSwapPermission"},rebalance:{sig:"withdraw(address,uint256,address)",selector:"0x69328dec",template:"SharedBoundedBorrowPermission"},claim:{sig:"claimAllRewards(address[],address)",selector:"0x3111e7b3",template:"SharedApproveAndCallBatchPermission"},withdraw:{sig:"transfer(address,uint256)",selector:"0xa9059cbb",template:"SharedTransferTargetPermission"},swap:{sig:"exactInputSingle((address,address,...))",selector:"0x414bf389",template:"SharedBoundedSwapPermission"},"conditional-swap":{sig:"swapWhenYieldOver(uint256,bytes)",selector:"0x8d5f63a2",template:"SharedDeFiBundlePermission"},bridge:{sig:"depositV3(address,uint256,uint32,bytes)",selector:"0x7b939232",template:"SharedApproveAndCallBatchPermission"},lp:{sig:"add_liquidity(uint256[3],uint256)",selector:"0x4515cef3",template:"SharedAMMLiquidityPermission"},hedge:{sig:"openPosition(address,uint256,bool)",selector:"0xb6b1b6c3",template:"SharedApproveAndCallBatchPermission"},short:{sig:"openShort(uint256,uint256,uint256)",selector:"0xa1d3e9bd",template:"SharedDeFiBundlePermission"}},g=(e.actions??[]).map(j=>{var O,B;const E=m[j.kind]??{sig:"call(bytes)",selector:"0x4e71e0c8",template:"IPermission"},I=(O=e.caps)==null?void 0:O[0],T=j.kind==="deposit"||j.kind==="rebalance"?I?`value ≤ ${I.currency==="USD"?`$${I.amount}`:`${I.amount} ${I.asset}`}`:"unconstrained":"no value transfer";return{venue:(j.venue??((B=j.networks)==null?void 0:B[0])??"protocol").toString(),template:E.template,signature:E.sig,selector:E.selector,constraint:T}}),_={txHash:`0x${(t*23).toString(16).padStart(8,"0").repeat(8).slice(0,60)}`,block:23480004-t%200,signedAt:"2026-04-27"},y={"mandate-1":[{id:"p1",title:"USDC yield watchlist",icon:"$",maker:"Claude",updated:"2h ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p2",title:"Aave ↔ Compound APY delta",icon:"%",maker:"Claude",updated:"1d ago",url:"http://localhost:5180/#/dashboard?demo=full"}],"mandate-2":[{id:"p1",title:"ETH hedge P&L",icon:"Ξ",maker:"Cursor",updated:"3h ago",url:"http://localhost:5180/#/dashboard?demo=full"}],"mandate-5":[{id:"p1",title:"Aave APY history",icon:"%",maker:"Claude",updated:"6h ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p2",title:"Daily rebalancer log",icon:"↻",maker:"Claude",updated:"12h ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p3",title:"Cap utilization chart",icon:"◔",maker:"Claude",updated:"2d ago",url:"http://localhost:5180/#/dashboard?demo=full"}],"mandate-6":[{id:"p1",title:"BTC put delta sheet",icon:"₿",maker:"Codex",updated:"1h ago",url:"http://localhost:5180/#/dashboard?demo=full"}],"mandate-8":[{id:"p1",title:"Cross-chain APY heatmap",icon:"◰",maker:"Claude",updated:"5m ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p2",title:"Stablecoin arb opportunities",icon:"⇄",maker:"Claude",updated:"22m ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p3",title:"Bridge fee tracker",icon:"⤳",maker:"Claude",updated:"1h ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p4",title:"Yield → ARB / OP recycler log",icon:"↻",maker:"Claude",updated:"3h ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p5",title:"WBTC put delta sheet",icon:"₿",maker:"Claude",updated:"6h ago",url:"http://localhost:5180/#/dashboard?demo=full"}]}[e.id]??[],v={body:e.summary??"Strategy goal recorded with this mandate.",confidence:88+t%10,ago:"5 days ago"};return{mpcWallet:s,runs:d,activity:u,schedule:c,erc8004:a,agentId:o,templateHash:f,policyHash:h,templateDeployed:p,targets:g,receipt:_,pages:y,recommendation:v}}function dwe(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)}function fwe(e){return"0x"+(e.replace(/[^0-9a-fA-F]/g,"")+"0".repeat(40)).slice(0,40)}function hwe(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:""}function pwe(e){return e?`${e.slice(0,10)}…${e.slice(-6)}`:""}function Ax(e){return e&&e[0].toUpperCase()+e.slice(1)}function mwe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M4 2.5h5l3 3v8a.5.5 0 01-.5.5h-7.5a.5.5 0 01-.5-.5v-10a.5.5 0 01.5-.5z"}),i.jsx("path",{d:"M9 2.5v3h3"}),i.jsx("path",{d:"M5.6 9h5M5.6 11.4h5"})]})}function Ex(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M5 3l4 4-4 4"})})}function gwe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M9 3l-4 4 4 4"})})}function ywe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M5 3l4 4-4 4"})})}function bwe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 5l4 4 4-4"})})}function Yg(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 9 L9 5"}),i.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}function Nx(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})}function Ix(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3.5 3.5l7 7M10.5 3.5l-7 7"})})}function Mx(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"6",height:"6","aria-hidden":!0,children:i.jsx("circle",{cx:"7",cy:"7",r:"3",fill:"currentColor"})})}function vwe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"10",height:"10","aria-hidden":!0,children:i.jsx("circle",{cx:"7",cy:"7",r:"3",fill:"currentColor"})})}const wwe="_shell_iy2rq_11",_we="_header_iy2rq_20",xwe="_backBtn_iy2rq_33",kwe="_main_iy2rq_55",Cwe="_titleBlock_iy2rq_68",jwe="_titleHeadRow_iy2rq_73",Swe="_title_iy2rq_68",Awe="_titleMeta_iy2rq_88",Ewe="_titleMetaSep_iy2rq_96",Nwe="_card_iy2rq_98",Iwe="_cardHead_iy2rq_123",Mwe="_cardHeadText_iy2rq_130",Bwe="_cardTitle_iy2rq_131",Twe="_cardSub_iy2rq_143",Pwe="_cardHeadMeta_iy2rq_150",Rwe="_viewContractBtn_iy2rq_158",Lwe="_recital_iy2rq_181",Dwe="_recitalMark_iy2rq_189",Owe="_recitalBody_iy2rq_199",Fwe="_recitalFoot_iy2rq_207",$we="_permMetaLine_iy2rq_216",zwe="_permMetaTpl_iy2rq_230",qwe="_permMetaSep_iy2rq_234",Uwe="_permMetaId_iy2rq_237",Hwe="_permMetaVer_iy2rq_240",Wwe="_permMetaAddr_iy2rq_243",Vwe="_permSlotPill_iy2rq_248",Gwe="_permSlotPillStrong_iy2rq_261",Kwe="_permSlotPillDot_iy2rq_262",Qwe="_permSlotPillRevoked_iy2rq_263",Ywe="_permRowTrailing_iy2rq_266",Jwe="_permRevokeBtn_iy2rq_273",Xwe="_permRevokedBadge_iy2rq_291",Zwe="_permRowDimmed_iy2rq_304",e_e="_metricsRow_iy2rq_315",t_e="_metricCard_iy2rq_324",n_e="_metricKicker_iy2rq_349",r_e="_metricValue_iy2rq_356",s_e="_metricValueDim_iy2rq_365",o_e="_metricValueDanger_iy2rq_366",a_e="_metricValueMono_iy2rq_367",i_e="_metricSub_iy2rq_373",c_e="_metricPill_iy2rq_381",l_e="_metricPillDot_iy2rq_396",u_e="_metricPillSuccess_iy2rq_403",d_e="_metricPillDanger_iy2rq_408",f_e="_metricBar_iy2rq_413",h_e="_metricBarFill_iy2rq_421",p_e="_metricFootnote_iy2rq_428",m_e="_attestationPill_iy2rq_438",g_e="_attestationPillSuccess_iy2rq_454",y_e="_endpointFailCount_iy2rq_459",b_e="_attestationDot_iy2rq_464",v_e="_bookGrid_iy2rq_472",w_e="_bookRow_iy2rq_481",__e="_bookRowAccent_iy2rq_505",x_e="_bookNote_iy2rq_516",k_e="_feeLine_iy2rq_534",C_e="_permListItem_iy2rq_567",j_e="_permListItemOpen_iy2rq_572",S_e="_permRowClickable_iy2rq_578",A_e="_permExpandChevron_iy2rq_591",E_e="_permExpandChevronOpen_iy2rq_599",N_e="_permDetail_iy2rq_601",I_e="_permDetailFadeIn_iy2rq_1",M_e="_permDescription_iy2rq_614",B_e="_permFieldGrid_iy2rq_625",T_e="_permFieldRow_iy2rq_634",P_e="_permFieldValueMono_iy2rq_660",R_e="_permFieldValueDim_iy2rq_665",L_e="_permFieldLink_iy2rq_666",D_e="_permDetailActions_iy2rq_676",O_e="_permActionGhost_iy2rq_684",F_e="_permActionDanger_iy2rq_709",$_e="_permRevokedNote_iy2rq_729",z_e="_redraftCard_iy2rq_741",q_e="_redraftKicker_iy2rq_746",U_e="_editBtn_iy2rq_754",H_e="_editBtn_claude_iy2rq_781",W_e="_editBtn_cursor_iy2rq_790",V_e="_editBtn_codex_iy2rq_799",G_e="_editBtn_chatgpt_iy2rq_800",K_e="_editBtn_openai_iy2rq_801",Q_e="_aboutCard_iy2rq_814",Y_e="_aboutList_iy2rq_819",J_e="_aboutMono_iy2rq_856",X_e="_permTech_iy2rq_867",Z_e="_permSelector_iy2rq_879",e6e="_permEnforced_iy2rq_880",t6e="_receiptGrid_iy2rq_895",n6e="_receiptRow_iy2rq_904",r6e="_mono_iy2rq_928",s6e="_receiptLink_iy2rq_929",o6e="_agentList_iy2rq_941",a6e="_agentRow_iy2rq_949",i6e="_agentDot_iy2rq_970",c6e="_agentDotActive_iy2rq_975",l6e="_agentDotIdle_iy2rq_979",u6e="_agentBody_iy2rq_983",d6e="_agentName_iy2rq_984",f6e="_agentSub_iy2rq_991",h6e="_agentChevron_iy2rq_996",p6e="_dangerCard_iy2rq_1004",m6e="_dangerKicker_iy2rq_1011",g6e="_revokeBtn_iy2rq_1018",y6e="_notFound_iy2rq_1049",b6e="_notFoundTitle_iy2rq_1057",v6e="_notFoundBody_iy2rq_1064",q={shell:wwe,header:_we,backBtn:xwe,main:kwe,titleBlock:Cwe,titleHeadRow:jwe,title:Swe,titleMeta:Awe,titleMetaSep:Ewe,card:Nwe,cardHead:Iwe,cardHeadText:Mwe,cardTitle:Bwe,cardSub:Twe,cardHeadMeta:Pwe,viewContractBtn:Rwe,recital:Lwe,recitalMark:Dwe,recitalBody:Owe,recitalFoot:Fwe,permMetaLine:$we,permMetaTpl:zwe,permMetaSep:qwe,permMetaId:Uwe,permMetaVer:Hwe,permMetaAddr:Wwe,permSlotPill:Vwe,permSlotPillStrong:Gwe,permSlotPillDot:Kwe,permSlotPillRevoked:Qwe,permRowTrailing:Ywe,permRevokeBtn:Jwe,permRevokedBadge:Xwe,permRowDimmed:Zwe,metricsRow:e_e,metricCard:t_e,metricKicker:n_e,metricValue:r_e,metricValueDim:s_e,metricValueDanger:o_e,metricValueMono:a_e,metricSub:i_e,metricPill:c_e,metricPillDot:l_e,metricPillSuccess:u_e,metricPillDanger:d_e,metricBar:f_e,metricBarFill:h_e,metricFootnote:p_e,attestationPill:m_e,attestationPillSuccess:g_e,endpointFailCount:y_e,attestationDot:b_e,bookGrid:v_e,bookRow:w_e,bookRowAccent:__e,bookNote:x_e,feeLine:k_e,permListItem:C_e,permListItemOpen:j_e,permRowClickable:S_e,permExpandChevron:A_e,permExpandChevronOpen:E_e,permDetail:N_e,permDetailFadeIn:I_e,permDescription:M_e,permFieldGrid:B_e,permFieldRow:T_e,permFieldValueMono:P_e,permFieldValueDim:R_e,permFieldLink:L_e,permDetailActions:D_e,permActionGhost:O_e,permActionDanger:F_e,permRevokedNote:$_e,redraftCard:z_e,redraftKicker:q_e,editBtn:U_e,editBtn_claude:H_e,editBtn_cursor:W_e,editBtn_codex:V_e,editBtn_chatgpt:G_e,editBtn_openai:K_e,aboutCard:Q_e,aboutList:Y_e,aboutMono:J_e,permTech:X_e,permSelector:Z_e,permEnforced:e6e,receiptGrid:t6e,receiptRow:n6e,mono:r6e,receiptLink:s6e,agentList:o6e,agentRow:a6e,agentDot:i6e,agentDotActive:c6e,agentDotIdle:l6e,agentBody:u6e,agentName:d6e,agentSub:f6e,agentChevron:h6e,dangerCard:p6e,dangerKicker:m6e,revokeBtn:g6e,notFound:y6e,notFoundTitle:b6e,notFoundBody:v6e},w6e={1:"ethereum",42161:"arbitrum",8453:"base",130:"unichain",10:"optimism",137:"polygon"},Bx={arbitrum:e=>`https://arbiscan.io/address/${e}`,ethereum:e=>`https://etherscan.io/address/${e}`,base:e=>`https://basescan.org/address/${e}`,unichain:e=>`https://uniscan.xyz/address/${e}`,optimism:e=>`https://optimistic.etherscan.io/address/${e}`,polygon:e=>`https://polygonscan.com/address/${e}`},Tx={arbitrum:e=>`https://arbiscan.io/tx/${e}`,ethereum:e=>`https://etherscan.io/tx/${e}`,base:e=>`https://basescan.org/tx/${e}`,unichain:e=>`https://uniscan.xyz/tx/${e}`,optimism:e=>`https://optimistic.etherscan.io/tx/${e}`,polygon:e=>`https://polygonscan.com/tx/${e}`};function _6e(e,t){return(Bx[e]??Bx.ethereum)(t)}function Px(e,t){return(Tx[e]??Tx.ethereum)(t)}const ui={maxPermissionsPerAccount:10,permissionRegistrationFeeEth:"0.001",permissionGasCapK:100,protocolCutBps:0,MAX_PROTOCOL_CUT_BPS:1e3};function x6e({mandateId:e,onBack:t,onRevoke:n}){var T,O,B,U,L;const{mandate:r}=Fp(),{account:s}=dd(),{address:o}=Oe(),a=w6e[s==null?void 0:s.chainId]??"ethereum",c=S.useMemo(()=>r?{id:e??"live",...r}:null,[r,e]),[l,u]=S.useState(()=>new Set),[d,f]=S.useState(null),h=S.useMemo(()=>{if(!c)return null;const N=c.permissionsAllowed??c.permissions??[];return{...c,permissionsAllowed:N.map(H=>({...H,revoked:l.has(H.id)||H.revoked===!0}))}},[c,l]),p=s?{name:"My SMA",address:s.safe}:null,m=[],[g,_]=S.useState(!1),[b,y]=S.useState(!1),[v,w]=S.useState(null),[x,A]=S.useState(!1);function C(){d&&(u(N=>{const H=new Set(N);return H.add(d.id),H}),f(null))}const j=((T=h==null?void 0:h.permissionsAllowed)==null?void 0:T.filter(N=>!N.revoked).length)??0,E=(((O=h==null?void 0:h.permissionsAllowed)==null?void 0:O.length)??0)-j;if(S.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"})},[e]),!h)return i.jsxs("div",{className:`${De.pageShell} ${q.shell}`,children:[i.jsx(Ms,{}),i.jsxs("main",{className:q.notFound,children:[i.jsx(Dt,{size:48}),i.jsx("h1",{className:q.notFoundTitle,children:"Mandate not found"}),i.jsx("p",{className:q.notFoundBody,children:"The URL points to a mandate that doesn’t exist."}),i.jsx(Me,{onClick:t,children:"Back to dashboard"})]})]});const I=h.status==="active";return h.status,i.jsxs("div",{className:`${De.pageShell} ${q.shell}`,children:[i.jsx(Ms,{}),i.jsx("header",{className:q.header,children:i.jsxs("button",{type:"button",className:q.backBtn,onClick:t,"aria-label":"Back to dashboard",children:[i.jsx(C6e,{}),i.jsx("span",{children:"Dashboard"})]})}),i.jsxs("main",{className:q.main,children:[i.jsxs("section",{className:q.titleBlock,children:[i.jsxs("div",{className:q.titleHeadRow,children:[i.jsx("h1",{className:q.title,children:h.title}),i.jsx(Bu,{status:h.status})]}),i.jsxs("p",{className:q.titleMeta,children:["Signed for ",i.jsx("strong",{children:p.name})," · ",h.signedAt,i.jsx("span",{className:q.titleMetaSep,"aria-hidden":!0,children:"·"}),m.length," agent wallet",m.length===1?"":"s"," running under it"]})]}),i.jsxs("section",{className:q.card,children:[i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(A6e,{}),"Mandate summary"]}),i.jsx("p",{className:q.cardSub,children:"The plain-language recital you signed when authorizing this mandate."})]}),i.jsxs("button",{type:"button",className:q.viewContractBtn,onClick:()=>y(!0),children:["View mandate detail",i.jsx(Df,{})]})]}),i.jsxs("blockquote",{className:q.recital,children:[i.jsx("span",{className:q.recitalMark,"aria-hidden":!0,children:"“"}),i.jsx("p",{className:q.recitalBody,children:h.summary}),i.jsxs("footer",{className:q.recitalFoot,children:[i.jsx(xs,{name:h.aiName,size:14}),i.jsxs("span",{children:["Drafted by ",h.aiName," · first registered ",h.signedAt]})]})]})]}),i.jsxs("section",{className:q.card,children:[i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(E6e,{}),"Permissions"]}),i.jsx("p",{className:q.cardSub,children:"What the agents under this mandate are authorized to do. Anything not listed below is forbidden by the mandate."}),h.permissionsCap&&i.jsxs("span",{className:q.permSlotPill,children:[i.jsxs("span",{className:q.permSlotPillStrong,children:[j," of ",h.permissionsCap]}),i.jsx("span",{children:"slots active"}),E>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:q.permSlotPillDot,"aria-hidden":!0,children:"·"}),i.jsxs("span",{className:q.permSlotPillRevoked,children:[E," revoked"]})]}),i.jsx("span",{className:q.permSlotPillDot,"aria-hidden":!0,children:"·"}),i.jsxs("span",{children:[h.registrationFeeEth," ETH each at registration"]})]})]}),i.jsxs("span",{className:q.cardHeadMeta,children:[j," active"]})]}),i.jsx("ul",{className:Ie.permList,children:h.permissionsAllowed.map(N=>{const H=!!N.revoked,M=v===N.id;return i.jsxs("li",{className:`${q.permListItem} ${M?q.permListItemOpen:""}`,children:[i.jsxs("div",{className:`${Ie.permRow} ${H?Ie.permRowRevoked:Ie.permRowAllow} ${H?q.permRowDimmed:""} ${q.permRowClickable}`,role:"button",tabIndex:0,"aria-expanded":M,onClick:()=>w(M?null:N.id),onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),w(M?null:N.id))},children:[i.jsx("span",{className:Ie.permMark,"aria-hidden":!0,children:H?i.jsx(S6e,{}):i.jsx(j6e,{})}),i.jsxs("span",{className:Ie.permBody,children:[i.jsx("span",{className:Ie.permLabel,children:N.label}),i.jsx("span",{className:Ie.permSub,children:N.sub}),(N.template||N.permissionId)&&i.jsxs("span",{className:q.permMetaLine,children:[N.template&&i.jsx("span",{className:q.permMetaTpl,children:N.template}),N.permissionId&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:q.permMetaSep,"aria-hidden":!0,children:"·"}),i.jsx("span",{className:q.permMetaId,children:N.permissionId})]}),N.version&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:q.permMetaSep,"aria-hidden":!0,children:"·"}),i.jsxs("span",{className:q.permMetaVer,children:["v",N.version]})]}),N.address&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:q.permMetaSep,"aria-hidden":!0,children:"·"}),i.jsxs("span",{className:q.permMetaAddr,children:[N.address.slice(0,6),"…",N.address.slice(-4)]})]})]})]}),i.jsxs("span",{className:q.permRowTrailing,children:[H?i.jsx("span",{className:q.permRevokedBadge,children:"Revoked"}):i.jsx("span",{className:q.permTech,title:N.signature,children:i.jsx("code",{className:q.permSelector,children:N.selector})}),i.jsx("span",{className:`${q.permExpandChevron} ${M?q.permExpandChevronOpen:""}`,"aria-hidden":!0,children:i.jsx(Lx,{})})]})]}),M&&i.jsxs("div",{className:q.permDetail,role:"region","aria-label":`${N.label} details`,children:[N.description&&i.jsx("p",{className:q.permDescription,children:N.description}),i.jsxs("dl",{className:q.permFieldGrid,children:[i.jsx(fl,{k:"Function signature",v:N.signature,mono:!0,dim:!0}),i.jsx(fl,{k:"Selector",v:N.selector,mono:!0}),i.jsx(fl,{k:"Contract address",v:N.address?`${N.address.slice(0,8)}…${N.address.slice(-6)}`:"—",mono:!0}),i.jsx(fl,{k:"Registered at",v:N.registeredAt}),i.jsx(fl,{k:"Registration tx",v:N.registeredTxHash,mono:!0,link:Px(a,N.registeredTxHash)})]}),i.jsxs("div",{className:q.permDetailActions,children:[i.jsxs("a",{href:_6e(a,N.address),target:"_blank",rel:"noreferrer",className:q.permActionGhost,onClick:$=>$.stopPropagation(),children:["View on explorer",i.jsx(Df,{})]}),!H&&I&&i.jsx("button",{type:"button",className:q.permActionDanger,onClick:$=>{$.stopPropagation(),f(N)},children:"Revoke permission"}),H&&i.jsx("span",{className:q.permRevokedNote,children:"This permission was revoked. The rest of the mandate remains signed and active."})]})]})]},N.id)})})]}),i.jsxs("section",{className:q.metricsRow,"aria-label":"Mandate status at a glance",children:[i.jsxs("article",{className:q.metricCard,children:[i.jsx("span",{className:q.metricKicker,children:"Mandate"}),i.jsx("span",{className:`${q.metricValue} ${h.sessionActive===!1?q.metricValueDanger:""}`,children:h.sessionActive===!1?"Revoked":"Active"}),i.jsxs("p",{className:q.metricSub,children:["Kill switch for the whole mandate. Setting it off halts ",i.jsx("em",{children:"all"})," dispatch but leaves permissions registered — you can re-activate without re-signing anything."]}),i.jsxs("span",{className:`${q.metricPill} ${h.sessionActive===!1?q.metricPillDanger:q.metricPillSuccess}`,children:[i.jsx("span",{className:q.metricPillDot,"aria-hidden":!0}),h.sessionActive===!1?"Dispatch halted":"Dispatch allowed"]})]}),i.jsxs("article",{className:q.metricCard,children:[i.jsx("span",{className:q.metricKicker,children:"Permission slots"}),i.jsxs("span",{className:q.metricValue,children:[j,i.jsxs("span",{className:q.metricValueDim,children:[" / ",h.permissionsCap??ui.maxPermissionsPerAccount]})]}),i.jsx("div",{className:q.metricBar,"aria-hidden":!0,children:i.jsx("div",{className:q.metricBarFill,style:{width:`${Math.min(100,j/(h.permissionsCap??ui.maxPermissionsPerAccount)*100)}%`}})}),i.jsxs("p",{className:q.metricSub,children:["Per-account ceiling set by governance. Registration fee:"," ",i.jsxs("strong",{children:[h.registrationFeeEth??ui.permissionRegistrationFeeEth," ETH"]})," per permission."]})]}),i.jsxs("article",{className:q.metricCard,children:[i.jsx("span",{className:q.metricKicker,children:"Policy hash"}),i.jsx("span",{className:`${q.metricValue} ${q.metricValueMono}`,children:h.policyHash}),i.jsx("p",{className:q.metricSub,children:"Composite fingerprint of all registered permission templates. Any drift from this hash invalidates the mandate's enforcement guarantees."}),i.jsxs("span",{className:q.metricFootnote,children:["Block ",i.jsx("strong",{children:h.blockNumber.toLocaleString()})," · ",h.signedAt]})]})]}),i.jsxs("section",{className:q.card,children:[i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(B6e,{}),"Manager endpoint"]}),i.jsx("p",{className:q.cardSub,children:"Where dispatch decisions come from. Every recommendation is signed by this endpoint and verified before your runner sends it onchain. Drafters (Claude, Cursor, etc.) write the policy — this endpoint runs it."})]}),i.jsxs("span",{className:`${q.attestationPill} ${q.attestationPillSuccess}`,children:[i.jsx("span",{className:q.attestationDot,"aria-hidden":!0}),"Verified · pinned"]})]}),i.jsxs("dl",{className:q.bookGrid,children:[i.jsx(pf,{k:"URL",v:(s==null?void 0:s.manager)??"—",mono:!0}),i.jsx(pf,{k:"Public key",v:`${(B=s==null?void 0:s.manager)==null?void 0:B.slice(0,10)}…${((U=s==null?void 0:s.manager)==null?void 0:U.slice(-6))??"—"}`,mono:!0}),i.jsx(pf,{k:"Last seen",v:"—"}),i.jsx(pf,{k:"Recommendations verified",v:i.jsxs(i.Fragment,{children:["—",!1]})})]})]}),i.jsxs("section",{className:q.card,children:[i.jsx("header",{className:q.cardHead,children:i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(N6e,{}),"SMA registration"]}),i.jsx("p",{className:q.cardSub,children:"The onchain record that created this account and locked in its signing roles. Each permission above was added later with its own signed message — see the expanded detail of any permission for its registration receipt."})]})}),i.jsxs("dl",{className:q.receiptGrid,children:[i.jsx(ss,{k:"Permission signer",v:Rx(h.signedBy),mono:!0}),i.jsx(ss,{k:"Manager",v:Rx(p.address??""),mono:!0}),i.jsx(ss,{k:"Fee policy",v:h.feePolicyKind??"StandardFeePolicy",mono:!0}),i.jsx(ss,{k:"Policy hash",v:h.policyHash,mono:!0}),i.jsx(ss,{k:"Block",v:h.blockNumber!=null?h.blockNumber.toLocaleString():"—"}),i.jsx(ss,{k:"Tx hash",v:i.jsxs("a",{href:Px(a,h.txHash),target:"_blank",rel:"noreferrer",className:q.receiptLink,children:[k6e(h.txHash),i.jsx(Df,{})]})}),i.jsx(ss,{k:"Registered",v:h.signedAt}),i.jsx(ss,{k:"Custody",v:"Held by the SMA Safe"}),i.jsx(ss,{k:"Permission slots",v:E>0?`${j} active · ${E} revoked · ${h.permissionsCap??20} cap`:`${j} of ${h.permissionsCap??20}`})]})]}),i.jsxs("section",{className:q.card,children:[i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(I6e,{}),"Agents running under this mandate"]}),i.jsx("p",{className:q.cardSub,children:"Agent wallets operating within the permissions above. Each can be stopped individually without revoking the mandate."})]}),i.jsxs("span",{className:q.cardHeadMeta,children:[m.filter(N=>N.status==="active").length," active · ",m.length," total"]})]}),i.jsx("ul",{className:q.agentList,children:m.map(N=>i.jsx("li",{children:i.jsxs("button",{type:"button",className:q.agentRow,onClick:()=>{window.location.hash=`#/agent/${N.id}`},children:[i.jsx("span",{className:`${q.agentDot} ${N.status==="active"?q.agentDotActive:q.agentDotIdle}`,"aria-hidden":!0}),i.jsx(xs,{name:N.aiName,size:20}),i.jsxs("span",{className:q.agentBody,children:[i.jsx("span",{className:q.agentName,children:N.role??N.title}),i.jsx("span",{className:q.agentSub,children:N.title})]}),i.jsx(Bu,{status:N.status,kind:"agent"}),i.jsx("span",{className:q.agentChevron,"aria-hidden":!0,children:i.jsx(Lx,{})})]})},N.id))})]}),i.jsxs("section",{className:`${q.card} ${q.aboutCard}`,children:[i.jsx("header",{className:q.cardHead,children:i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(M6e,{}),"About this mandate"]}),i.jsx("p",{className:q.cardSub,children:"The protocol-level guarantees this mandate gives you."})]})}),i.jsxs("ul",{className:q.aboutList,children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Per-permission revocation is supported."})," Each permission was added with its own signed message, so you can surgically revoke one line without touching the rest of the mandate."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Selective dispatch."})," At call time the manager ",i.jsx("em",{children:"names"})," ","which permission authorizes the call. There is no AND-across-permissions enforcement — the named permission either accepts the call or the call reverts."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Fail-closed evaluation."})," The kernel reads each permission's"," ",i.jsx("code",{className:q.aboutMono,children:"evaluate(...)"})," via a static call under a"," ",i.jsxs("strong",{children:[ui.permissionGasCapK,"k gas cap"]}),". Revert or gas exhaustion blocks the dispatch."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Bounded protocol fee."})," Sail's protocol cut is currently"," ",i.jsxs("strong",{children:[ui.protocolCutBps," bps"]})," on manager-collected fees, capped immutably at"," ",i.jsxs("strong",{children:[ui.MAX_PROTOCOL_CUT_BPS," bps"]})," in the kernel source."]})]})]}),i.jsx("section",{className:`${q.card} ${q.redraftCard}`,children:i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsx("span",{className:q.redraftKicker,children:"Editable · reversible"}),i.jsx("h2",{className:q.cardTitle,children:"Redraft this mandate"}),i.jsxs("p",{className:q.cardSub,children:["Opens ",h.aiName," to draft a new version of this mandate. Nothing changes onchain until you sign the replacement. The current mandate keeps running in the meantime."]})]}),i.jsxs("button",{type:"button",className:`${q.editBtn} ${q[`editBtn_${(L=h.aiName)==null?void 0:L.toLowerCase()}`]??""}`,onClick:()=>A(!0),disabled:!I,children:["Edit with ",h.aiName]})]})}),i.jsx("section",{className:`${q.card} ${q.dangerCard}`,children:i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsx("span",{className:q.dangerKicker,children:"Reversible · halts all dispatch"}),i.jsx("h2",{className:q.cardTitle,children:"Revoke mandate"}),i.jsx("p",{className:q.cardSub,children:"Flips the kill switch on this mandate. Every agent stops dispatching immediately, but the permissions below stay registered. You can re-activate the mandate at any time without re-signing anything. Always exempt from protocol pause."})]}),i.jsx("button",{type:"button",className:q.revokeBtn,onClick:()=>_(!0),disabled:!I,children:"Revoke mandate"})]})})]}),i.jsx(Mh,{open:b,mandate:h,readOnly:!0,signedDate:h.signedAt,onClose:()=>y(!1)}),i.jsx(Mh,{open:g,mode:"revoke",mandate:h,signedDate:h.signedAt,onClose:()=>_(!1),onRevoke:()=>{_(!1),n==null||n()}}),i.jsx(A2,{open:x,variant:"redraft",mandate:h,onClose:()=>A(!1)}),i.jsx(bS,{open:!!d,title:"Revoke this permission?",body:d?`Agents under this mandate will lose authority to call "${d.label}". The rest of the mandate stays signed and active. This action is not reversible.`:"",confirmLabel:"Revoke permission",cancelLabel:"Keep permission",onCancel:()=>f(null),onConfirm:C})]})}function ss({k:e,v:t,mono:n}){return i.jsxs("div",{className:q.receiptRow,children:[i.jsx("dt",{children:e}),i.jsx("dd",{className:n?q.mono:"",children:t})]})}function pf({k:e,v:t,mono:n,accent:r}){return i.jsxs("div",{className:`${q.bookRow} ${r?q.bookRowAccent:""}`,children:[i.jsx("dt",{children:e}),i.jsx("dd",{className:n?q.mono:"",children:t})]})}function fl({k:e,v:t,mono:n,dim:r,link:s}){let o=t??"—";return s&&t&&(o=i.jsxs("a",{href:s,target:"_blank",rel:"noreferrer",className:q.permFieldLink,onClick:a=>a.stopPropagation(),children:[t,i.jsx(Df,{})]})),i.jsxs("div",{className:q.permFieldRow,children:[i.jsx("dt",{children:e}),i.jsx("dd",{className:`${n?q.permFieldValueMono:""} ${r?q.permFieldValueDim:""}`,children:o})]})}function Rx(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:""}function k6e(e){return e?`${e.slice(0,10)}…${e.slice(-6)}`:""}function C6e(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M9 3l-4 4 4 4"})})}function Lx(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M5 3l4 4-4 4"})})}function Df(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 9 L9 5"}),i.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}function j6e(){return i.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3.5 8.4l3 3L13 5.2"})})}function S6e(){return i.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M4 4l8 8M12 4L4 12"})})}function A6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M4 2.5h5l3 3v8a.5.5 0 01-.5.5h-7.5a.5.5 0 01-.5-.5v-10a.5.5 0 01.5-.5z"}),i.jsx("path",{d:"M9 2.5v3h3"}),i.jsx("path",{d:"M5.6 9h5M5.6 11.4h5"})]})}function E6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 4h8M5 8h8M5 12h8"}),i.jsx("circle",{cx:"2.5",cy:"4",r:"0.7",fill:"currentColor"}),i.jsx("circle",{cx:"2.5",cy:"8",r:"0.7",fill:"currentColor"}),i.jsx("circle",{cx:"2.5",cy:"12",r:"0.7",fill:"currentColor"})]})}function N6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"8",cy:"7",r:"4"}),i.jsx("path",{d:"M6 10.5L5.2 13.4l2.8-1.6 2.8 1.6L10 10.5"})]})}function I6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("rect",{x:"3",y:"5.5",width:"10",height:"7",rx:"1.6"}),i.jsx("path",{d:"M8 3.2v2.3"}),i.jsx("circle",{cx:"8",cy:"2.6",r:"0.6",fill:"currentColor"}),i.jsx("circle",{cx:"6.3",cy:"8.6",r:"0.9",fill:"currentColor"}),i.jsx("circle",{cx:"9.7",cy:"8.6",r:"0.9",fill:"currentColor"}),i.jsx("path",{d:"M6.5 11h3"})]})}function M6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"8",cy:"8",r:"6"}),i.jsx("path",{d:"M8 7.2v3.6"}),i.jsx("circle",{cx:"8",cy:"5.2",r:"0.5",fill:"currentColor"})]})}function B6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M2.5 6.5l5.5-3 5.5 3-5.5 3-5.5-3z"}),i.jsx("path",{d:"M2.5 9.5l5.5 3 5.5-3"}),i.jsx("path",{d:"M2.5 12.5l5.5 3 5.5-3",opacity:"0.55"})]})}const T6e="_shell_1nll6_5",P6e="_header_1nll6_16",R6e="_backBtn_1nll6_28",L6e="_main_1nll6_49",D6e="_notFound_1nll6_63",O6e="_notFoundTitle_1nll6_74",F6e="_notFoundBody_1nll6_82",$6e="_titleBlock_1nll6_85",z6e="_titleMetaRow_1nll6_91",q6e="_kindPill_1nll6_99",U6e="_kind_run_1nll6_114",H6e="_kind_permission_1nll6_119",W6e="_timeMeta_1nll6_124",V6e="_metaDot_1nll6_130",G6e="_statusPill_1nll6_131",K6e="_statusPillDot_1nll6_143",Q6e="_status_success_1nll6_150",Y6e="_status_warn_1nll6_155",J6e="_status_danger_1nll6_160",X6e="_status_info_1nll6_165",Z6e="_titleActorRow_1nll6_171",exe="_titleActorBadge_1nll6_177",txe="_titleActorName_1nll6_188",nxe="_title_1nll6_85",rxe="_titleSub_1nll6_207",sxe="_card_1nll6_216",oxe="_cardHead_1nll6_222",axe="_cardHeadText_1nll6_229",ixe="_cardTitle_1nll6_235",cxe="_cardSub_1nll6_247",lxe="_cardHeadMeta_1nll6_253",uxe="_reasoning_1nll6_261",dxe="_reasoningMark_1nll6_274",fxe="_evidenceGrid_1nll6_288",hxe="_evidenceRow_1nll6_297",pxe="_authBox_1nll6_326",mxe="_authMark_1nll6_335",gxe="_authText_1nll6_348",yxe="_authLabel_1nll6_349",bxe="_authSub_1nll6_356",vxe="_artifactGrid_1nll6_363",wxe="_artifactRow_1nll6_372",_xe="_txLink_1nll6_398",xxe="_paginate_1nll6_409",kxe="_paginateLink_1nll6_418",Cxe="_paginateLinkRight_1nll6_436",jxe="_paginateText_1nll6_440",Sxe="_paginateKicker_1nll6_446",Axe="_paginateTitle_1nll6_453",Exe="_paginateSpacer_1nll6_463",he={shell:T6e,header:P6e,backBtn:R6e,main:L6e,notFound:D6e,notFoundTitle:O6e,notFoundBody:F6e,titleBlock:$6e,titleMetaRow:z6e,kindPill:q6e,kind_run:U6e,kind_permission:H6e,timeMeta:W6e,metaDot:V6e,statusPill:G6e,statusPillDot:K6e,status_success:Q6e,status_warn:Y6e,status_danger:J6e,status_info:X6e,titleActorRow:Z6e,titleActorBadge:exe,titleActorName:txe,title:nxe,titleSub:rxe,card:sxe,cardHead:oxe,cardHeadText:axe,cardTitle:ixe,cardSub:cxe,cardHeadMeta:lxe,reasoning:uxe,reasoningMark:dxe,evidenceGrid:fxe,evidenceRow:hxe,authBox:pxe,authMark:mxe,authText:gxe,authLabel:yxe,authSub:bxe,artifactGrid:vxe,artifactRow:wxe,txLink:_xe,paginate:xxe,paginateLink:kxe,paginateLinkRight:Cxe,paginateText:jxe,paginateKicker:Sxe,paginateTitle:Axe,paginateSpacer:Exe};function Nxe({entryId:e,onBack:t}){var u,d,f,h,p;const{events:n}=kS(),{mandate:r}=Fp(),s=S.useMemo(()=>n.find(m=>m.id===e)??n.find((m,g)=>String(g)===e),[n,e]),{prev:o,next:a}=S.useMemo(()=>{if(!s)return{prev:null,next:null};const m=n.indexOf(s);return{prev:m>0?n[m-1]:null,next:m<n.length-1?n[m+1]:null}},[s,n]),c=S.useMemo(()=>!s||!r?null:(r.permissions??[]).find(g=>(g.role??g.template)===s.actor)??null,[s,r]);if(S.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"})},[e]),!s)return i.jsxs("div",{className:`${De.pageShell} ${he.shell}`,children:[i.jsx(Ms,{}),i.jsxs("main",{className:he.notFound,children:[i.jsx(Dt,{size:48}),i.jsx("h1",{className:he.notFoundTitle,children:"Activity not found"}),i.jsx("p",{className:he.notFoundBody,children:"The URL points to a journal entry that doesn't exist. It may have been pruned from local storage."}),i.jsx(Me,{onClick:t,children:"Back to dashboard"})]})]});const l=s.status==="rejected"?"danger":s.status==="warn"?"warn":s.status==="success"?"success":"info";return i.jsxs("div",{className:`${De.pageShell} ${he.shell}`,children:[i.jsx(Ms,{}),i.jsx("header",{className:he.header,children:i.jsxs("button",{type:"button",className:he.backBtn,onClick:t,"aria-label":"Back to dashboard",children:[i.jsx(Ixe,{}),i.jsx("span",{children:"Dashboard"})]})}),i.jsxs("main",{className:he.main,children:[i.jsxs("section",{className:he.titleBlock,children:[i.jsxs("div",{className:he.titleMetaRow,children:[i.jsx("span",{className:`${he.kindPill} ${he[`kind_${s.kind??"event"}`]??""}`,children:s.kindLabel??"Event"}),i.jsxs("span",{className:he.timeMeta,children:[s.dateLabel?`${s.dateLabel}, `:"",s.time]}),i.jsx("span",{className:he.metaDot,"aria-hidden":!0,children:"·"}),i.jsxs("span",{className:`${he.statusPill} ${he[`status_${l}`]}`,children:[i.jsx("span",{className:he.statusPillDot,"aria-hidden":!0}),s.status==="success"&&"Confirmed",s.status==="rejected"&&"Held by mandate",s.status==="warn"&&"Warning",s.status==="info"&&"Info"]})]}),i.jsxs("div",{className:he.titleActorRow,children:[c&&i.jsxs("span",{className:he.titleActorBadge,children:[i.jsx(xs,{name:c.aiName,size:18}),i.jsx("span",{children:c.aiName})]}),i.jsx("span",{className:he.titleActorName,children:s.actor})]}),i.jsx("h1",{className:he.title,children:s.action}),s.meta&&i.jsx("p",{className:he.titleSub,children:s.meta})]}),((u=s.detail)==null?void 0:u.reasoning)&&i.jsxs("section",{className:he.card,children:[i.jsx("header",{className:he.cardHead,children:i.jsxs("div",{className:he.cardHeadText,children:[i.jsxs("h2",{className:he.cardTitle,children:[i.jsx(Txe,{}),"Reasoning"]}),i.jsx("p",{className:he.cardSub,children:"What the agent recorded as the rationale for this action."})]})}),i.jsxs("blockquote",{className:he.reasoning,children:[i.jsx("span",{className:he.reasoningMark,"aria-hidden":!0,children:"“"}),i.jsx("p",{children:s.detail.reasoning})]})]}),((f=(d=s.detail)==null?void 0:d.evidence)==null?void 0:f.length)>0&&i.jsxs("section",{className:he.card,children:[i.jsxs("header",{className:he.cardHead,children:[i.jsxs("div",{className:he.cardHeadText,children:[i.jsxs("h2",{className:he.cardTitle,children:[i.jsx(Pxe,{}),"Evidence"]}),i.jsx("p",{className:he.cardSub,children:"Inputs the agent cited at decision time."})]}),i.jsxs("span",{className:he.cardHeadMeta,children:[s.detail.evidence.length," data point",s.detail.evidence.length===1?"":"s"]})]}),i.jsx("dl",{className:he.evidenceGrid,children:s.detail.evidence.map(m=>i.jsxs("div",{className:he.evidenceRow,children:[i.jsx("dt",{children:m.k}),i.jsx("dd",{children:m.v})]},m.k))})]}),((h=s.detail)==null?void 0:h.authorization)&&i.jsxs("section",{className:he.card,children:[i.jsx("header",{className:he.cardHead,children:i.jsxs("div",{className:he.cardHeadText,children:[i.jsxs("h2",{className:he.cardTitle,children:[i.jsx(Rxe,{}),"Authorization"]}),i.jsx("p",{className:he.cardSub,children:"Which permission the manager named when authorizing this call."})]})}),i.jsxs("div",{className:he.authBox,children:[i.jsx("span",{className:he.authMark,"aria-hidden":!0,children:"✓"}),i.jsxs("div",{className:he.authText,children:[i.jsx("span",{className:he.authLabel,children:s.detail.authorization.label}),i.jsx("span",{className:he.authSub,children:s.detail.authorization.sub})]})]})]}),((p=s.detail)==null?void 0:p.artifact)&&i.jsxs("section",{className:he.card,children:[i.jsx("header",{className:he.cardHead,children:i.jsxs("div",{className:he.cardHeadText,children:[i.jsxs("h2",{className:he.cardTitle,children:[i.jsx(Lxe,{}),"Run artifact"]}),i.jsx("p",{className:he.cardSub,children:"The onchain receipt for this run."})]})}),i.jsx("dl",{className:he.artifactGrid,children:Object.entries(s.detail.artifact).map(([m,g])=>i.jsxs("div",{className:he.artifactRow,children:[i.jsx("dt",{children:m}),i.jsx("dd",{children:m==="Tx hash"?i.jsxs("a",{href:`https://arbiscan.io/tx/${String(g).replace("…","")}`,target:"_blank",rel:"noreferrer",className:he.txLink,children:[g,i.jsx(Dxe,{})]}):g})]},m))})]}),i.jsxs("nav",{className:he.paginate,"aria-label":"Adjacent activity",children:[o?i.jsxs("a",{href:`#/journal/${o.id}`,className:he.paginateLink,children:[i.jsx(Mxe,{}),i.jsxs("span",{className:he.paginateText,children:[i.jsx("span",{className:he.paginateKicker,children:"Previous"}),i.jsx("span",{className:he.paginateTitle,children:o.action})]})]}):i.jsx("span",{className:he.paginateSpacer,"aria-hidden":!0}),a?i.jsxs("a",{href:`#/journal/${a.id}`,className:`${he.paginateLink} ${he.paginateLinkRight}`,children:[i.jsxs("span",{className:he.paginateText,children:[i.jsx("span",{className:he.paginateKicker,children:"Next"}),i.jsx("span",{className:he.paginateTitle,children:a.action})]}),i.jsx(Bxe,{})]}):i.jsx("span",{className:he.paginateSpacer,"aria-hidden":!0})]})]})]})}function Ixe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M9 3l-4 4 4 4"})})}function Mxe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M9 3l-4 4 4 4"})})}function Bxe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M5 3l4 4-4 4"})})}function Txe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M4 2.5h5l3 3v8a.5.5 0 01-.5.5h-7.5a.5.5 0 01-.5-.5v-10a.5.5 0 01.5-.5z"}),i.jsx("path",{d:"M9 2.5v3h3"}),i.jsx("path",{d:"M5.6 9h5M5.6 11.4h3"})]})}function Pxe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 4h8M5 8h8M5 12h8"}),i.jsx("circle",{cx:"2.5",cy:"4",r:"0.7",fill:"currentColor"}),i.jsx("circle",{cx:"2.5",cy:"8",r:"0.7",fill:"currentColor"}),i.jsx("circle",{cx:"2.5",cy:"12",r:"0.7",fill:"currentColor"})]})}function Rxe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M8 2l5 2v4c0 3.6-2.5 5.4-5 6-2.5-.6-5-2.4-5-6V4l5-2z"}),i.jsx("path",{d:"M5.6 8.2l1.7 1.7L10.4 7"})]})}function Lxe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"8",cy:"7",r:"4"}),i.jsx("path",{d:"M6 10.5L5.2 13.4l2.8-1.6 2.8 1.6L10 10.5"})]})}function Dxe(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 9 L9 5"}),i.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}const Oxe=Kr({id:130,name:"Unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz"}}}),Fxe=Kr({id:1301,name:"Unichain Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan Sepolia",url:"https://sepolia.uniscan.xyz"}},testnet:!0}),$xe=[t8,lF,Ip,Oxe,n8,uF,Fxe,dF],zxe="sailor-local-dev",qxe=KU({appName:"Sailor",projectId:zxe,chains:$xe,ssr:!1}),Uxe=new LD;function Jg(){if(typeof window>"u")return"/";const e=window.location.hash.replace(/^#/,"")||"/";return e.startsWith("/")?e:`/${e}`}function Hxe(){if(typeof window>"u")return!1;const e=Number(window.location.port);return e>=3141&&e<=3150}if(typeof window<"u"){const e=Jg();(e==="/"||e==="")&&window.location.replace(Hxe()?"#/station":"#/dashboard")}function Wxe(){const[e,t]=S.useState(Jg);S.useEffect(()=>{const r=()=>t(Jg());return window.addEventListener("hashchange",r),()=>{window.removeEventListener("hashchange",r)}},[]);let n;if(e.startsWith("/home"))n=i.jsx(T1,{},e);else if(e.startsWith("/station"))n=i.jsx(XK,{},e);else if(e.startsWith("/signing"))n=i.jsx(qK,{},e);else if(e.startsWith("/mandate/")){const r=e.slice(9).split("?")[0];n=i.jsx(x6e,{mandateId:r,onBack:()=>{window.location.hash="#/dashboard"},onRevoke:()=>{window.location.hash="#/dashboard"}},e)}else if(e.startsWith("/agent/")){const r=e.slice(7).split("?")[0];n=i.jsx(Jve,{agentId:r,onBack:()=>{window.location.hash="#/dashboard"},onEdit:()=>{window.location.hash="#/dashboard"},onRevoke:()=>{window.location.hash="#/dashboard"}},e)}else if(e.startsWith("/journal/")){const r=e.slice(9).split("?")[0];n=i.jsx(Nxe,{entryId:r,onBack:()=>{window.location.hash="#/dashboard"}},e)}else e.startsWith("/dashboard")?n=i.jsx(T1,{},e):n=i.jsx(T1,{},e);return n}O1.createRoot(document.getElementById("root")).render(i.jsx(k.StrictMode,{children:i.jsx($L,{config:qxe,children:i.jsx(ZD,{client:Uxe,children:i.jsx(mq,{children:i.jsx(Wxe,{})})})})}));const Dx=Object.freeze(Object.defineProperty({__proto__:null,default:M0},Symbol.toStringTag,{value:"Module"}));export{WC as $,rE as A,K as B,cC as C,$0 as D,hI as E,pI as F,QN as G,nC as H,cb as I,z0 as J,II as K,MI as L,ch as M,Ky as N,uu as O,Cb as P,Xc as Q,LM as R,_b as S,jke as T,tB as U,EL as V,Ei as W,ja as X,W0 as Y,E5e as Z,QM as _,lw as a,SI as a$,Il as a0,Q0 as a1,Qy as a2,xa as a3,Y0 as a4,J0 as a5,fE as a6,dE as a7,ON as a8,A5e as a9,bT as aA,ru as aB,fc as aC,Hu as aD,rB as aE,Zl as aF,Xo as aG,K0 as aH,V0 as aI,G0 as aJ,Jl as aK,au as aL,En as aM,np as aN,tu as aO,qr as aP,An as aQ,Di as aR,jk as aS,bE as aT,Ck as aU,uh as aV,UN as aW,_I as aX,jn as aY,U0 as aZ,bu as a_,zN as aa,VN as ab,Yt as ac,kk as ad,gE as ae,ep as af,tR as ag,hE as ah,gT as ai,WN as aj,yE as ak,g5e as al,So as am,kI as an,HN as ao,qN as ap,eu as aq,YN as ar,yT as as,Xl as at,CI as au,I5e as av,N5e as aw,Ac as ax,jI as ay,KN as az,t5e as b,Wu as b$,aC as b0,iC as b1,AI as b2,nu as b3,X0 as b4,su as b5,du as b6,Xu as b7,FI as b8,GN as b9,Nb as bA,xE as bB,Jy as bC,Ok as bD,Fk as bE,w5e as bF,lt as bG,zr as bH,Ske as bI,$k as bJ,Ic as bK,Ch as bL,Jh as bM,ko as bN,vB as bO,QC as bP,Gxe as bQ,rr as bR,UE as bS,sN as bT,Un as bU,nj as bV,LC as bW,tb as bX,Yh as bY,rj as bZ,sj as b_,FN as ba,lu as bb,cu as bc,pE as bd,ou as be,JR as bf,Re as bg,EI as bh,mu as bi,Mw as bj,ae as bk,xo as bl,LE as bm,Ql as bn,lF as bo,iT as bp,La as bq,Pb as br,GB as bs,VB as bt,WB as bu,KB as bv,t8 as bw,n8 as bx,B0 as by,Eb as bz,bk as c,d4 as c$,yI as c0,ph as c1,BI as c2,Bo as c3,s4 as c4,aB as c5,Kr as c6,sB as c7,BB as c8,D5e as c9,Cn as cA,Vr as cB,td as cC,fp as cD,Ra as cE,tp as cF,S5e as cG,hw as cH,Ta as cI,jo as cJ,we as cK,Ge as cL,Kxe as cM,Ec as cN,vu as cO,hh as cP,hc as cQ,a4 as cR,Qx as cS,Mke as cT,HC as cU,n4 as cV,t4 as cW,Rb as cX,Ku as cY,dT as cZ,bI as c_,jC as ca,_M as cb,Bke as cc,Ba as cd,bb as ce,Iw as cf,ed as cg,ht as ch,TI as ci,HB as cj,Jxe as ck,Qxe as cl,Yxe as cm,Zxe as cn,cw as co,xM as cp,Xxe as cq,CB as cr,cB as cs,gR as ct,oC as cu,Ike as cv,Zu as cw,r4 as cx,Sb as cy,ib as cz,Uu as d,Q3e as d$,l4 as d0,f4 as d1,_T as d2,Gt as d3,Sk as d4,nr as d5,_5e as d6,tr as d7,Ake as d8,Yy as d9,i3e as dA,c3e as dB,l3e as dC,u3e as dD,d3e as dE,f3e as dF,$5e as dG,h3e as dH,p3e as dI,m3e as dJ,z5e as dK,q5e as dL,U5e as dM,H5e as dN,W5e as dO,V5e as dP,O5e as dQ,G5e as dR,K5e as dS,Q5e as dT,ake as dU,ike as dV,cke as dW,lke as dX,uke as dY,dke as dZ,fke as d_,y4 as da,eL as db,Nc as dc,ut as dd,pc as de,RE as df,Hr as dg,Xh as dh,Et as di,DI as dj,PI as dk,rp as dl,Ip as dm,Y5e as dn,J5e as dp,X5e as dq,Z5e as dr,e3e as ds,t3e as dt,n3e as du,F5e as dv,r3e as dw,s3e as dx,o3e as dy,a3e as dz,sE as e,mE as e$,hke as e0,pke as e1,mke as e2,gke as e3,yke as e4,bke as e5,vke as e6,wke as e7,_ke as e8,xke as e9,F3e as eA,$3e as eB,z3e as eC,q3e as eD,U3e as eE,H3e as eF,b3e as eG,W3e as eH,V3e as eI,G3e as eJ,v3e as eK,w3e as eL,_3e as eM,x3e as eN,k3e as eO,C3e as eP,g3e as eQ,j3e as eR,S3e as eS,A3e as eT,jw as eU,lc as eV,q0 as eW,kE as eX,te as eY,Ao as eZ,_r as e_,Y3e as ea,kke as eb,Cke as ec,up as ed,J3e as ee,X3e as ef,Z3e as eg,eke as eh,tke as ei,nke as ej,K3e as ek,rke as el,ske as em,oke as en,E3e as eo,N3e as ep,I3e as eq,M3e as er,B3e as es,T3e as et,P3e as eu,y3e as ev,R3e as ew,L3e as ex,D3e as ey,O3e as ez,oE as f,kn as f$,yo as f0,Zk as f1,Sw as f2,Es as f3,Aw as f4,Lt as f5,rR as f6,hp as f7,ab as f8,nR as f9,yB as fA,KC as fB,bB as fC,Nke as fD,Eke as fE,DR as fF,OR as fG,vR as fH,Je as fI,Co as fJ,Dk as fK,rN as fL,rC as fM,ha as fN,_a as fO,xt as fP,e4 as fQ,kB as fR,Sc as fS,Zh as fT,Vu as fU,rn as fV,mT as fW,Wr as fX,dI as fY,eC as fZ,qC as f_,ad as fa,fI as fb,Mb as fc,pT as fd,Gu as fe,YR as ff,HE as fg,sr as fh,MB as fi,Z0 as fj,kb as fk,JM as fl,v5e as fm,Fke as fn,kM as fo,qb as fp,J4 as fq,LR as fr,RR as fs,dF as ft,mp as fu,CR as fv,wb as fw,QB as fx,vT as fy,e5e as fz,vk as g,XP as g0,ZP as g1,u4 as g2,tg as g3,Vb as g4,BR as g5,vI as g6,NB as g7,AC as g8,mc as g9,sd as ga,Dke as gb,bt as gc,aE as h,uw as i,wk as j,dw as k,iE as l,cE as m,uc as n,_k as o,lE as p,Gb as q,wI as r,zm as s,hu as t,pu as u,zC as v,jb as w,fu as x,xk as y,iu as z};
1790
+ [recv] block ${23481004-E*13} · success`,error:E===2&&e.status==="active"?"Slippage exceeded limit (0.5%)":null}}),f=`0x${(t*13).toString(16).padStart(16,"0")}${n}`,h=`0x${(t*17).toString(16).padStart(8,"0")}…${(t*19).toString(16).padStart(4,"0")}`,p=e.status==="active"||e.status==="expired",m={deposit:{sig:"supply(address,uint256,address,uint16)",selector:"0x617ba037",template:"SharedBoundedSwapPermission"},rebalance:{sig:"withdraw(address,uint256,address)",selector:"0x69328dec",template:"SharedBoundedBorrowPermission"},claim:{sig:"claimAllRewards(address[],address)",selector:"0x3111e7b3",template:"SharedApproveAndCallBatchPermission"},withdraw:{sig:"transfer(address,uint256)",selector:"0xa9059cbb",template:"SharedTransferTargetPermission"},swap:{sig:"exactInputSingle((address,address,...))",selector:"0x414bf389",template:"SharedBoundedSwapPermission"},"conditional-swap":{sig:"swapWhenYieldOver(uint256,bytes)",selector:"0x8d5f63a2",template:"SharedDeFiBundlePermission"},bridge:{sig:"depositV3(address,uint256,uint32,bytes)",selector:"0x7b939232",template:"SharedApproveAndCallBatchPermission"},lp:{sig:"add_liquidity(uint256[3],uint256)",selector:"0x4515cef3",template:"SharedAMMLiquidityPermission"},hedge:{sig:"openPosition(address,uint256,bool)",selector:"0xb6b1b6c3",template:"SharedApproveAndCallBatchPermission"},short:{sig:"openShort(uint256,uint256,uint256)",selector:"0xa1d3e9bd",template:"SharedDeFiBundlePermission"}},g=(e.actions??[]).map(j=>{var O,B;const E=m[j.kind]??{sig:"call(bytes)",selector:"0x4e71e0c8",template:"IPermission"},I=(O=e.caps)==null?void 0:O[0],T=j.kind==="deposit"||j.kind==="rebalance"?I?`value ≤ ${I.currency==="USD"?`$${I.amount}`:`${I.amount} ${I.asset}`}`:"unconstrained":"no value transfer";return{venue:(j.venue??((B=j.networks)==null?void 0:B[0])??"protocol").toString(),template:E.template,signature:E.sig,selector:E.selector,constraint:T}}),_={txHash:`0x${(t*23).toString(16).padStart(8,"0").repeat(8).slice(0,60)}`,block:23480004-t%200,signedAt:"2026-04-27"},y={"mandate-1":[{id:"p1",title:"USDC yield watchlist",icon:"$",maker:"Claude",updated:"2h ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p2",title:"Aave ↔ Compound APY delta",icon:"%",maker:"Claude",updated:"1d ago",url:"http://localhost:5180/#/dashboard?demo=full"}],"mandate-2":[{id:"p1",title:"ETH hedge P&L",icon:"Ξ",maker:"Cursor",updated:"3h ago",url:"http://localhost:5180/#/dashboard?demo=full"}],"mandate-5":[{id:"p1",title:"Aave APY history",icon:"%",maker:"Claude",updated:"6h ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p2",title:"Daily rebalancer log",icon:"↻",maker:"Claude",updated:"12h ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p3",title:"Cap utilization chart",icon:"◔",maker:"Claude",updated:"2d ago",url:"http://localhost:5180/#/dashboard?demo=full"}],"mandate-6":[{id:"p1",title:"BTC put delta sheet",icon:"₿",maker:"Codex",updated:"1h ago",url:"http://localhost:5180/#/dashboard?demo=full"}],"mandate-8":[{id:"p1",title:"Cross-chain APY heatmap",icon:"◰",maker:"Claude",updated:"5m ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p2",title:"Stablecoin arb opportunities",icon:"⇄",maker:"Claude",updated:"22m ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p3",title:"Bridge fee tracker",icon:"⤳",maker:"Claude",updated:"1h ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p4",title:"Yield → ARB / OP recycler log",icon:"↻",maker:"Claude",updated:"3h ago",url:"http://localhost:5180/#/dashboard?demo=full"},{id:"p5",title:"WBTC put delta sheet",icon:"₿",maker:"Claude",updated:"6h ago",url:"http://localhost:5180/#/dashboard?demo=full"}]}[e.id]??[],v={body:e.summary??"Strategy goal recorded with this mandate.",confidence:88+t%10,ago:"5 days ago"};return{mpcWallet:s,runs:d,activity:u,schedule:c,erc8004:a,agentId:o,templateHash:f,policyHash:h,templateDeployed:p,targets:g,receipt:_,pages:y,recommendation:v}}function dwe(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Math.abs(t)}function fwe(e){return"0x"+(e.replace(/[^0-9a-fA-F]/g,"")+"0".repeat(40)).slice(0,40)}function hwe(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:""}function pwe(e){return e?`${e.slice(0,10)}…${e.slice(-6)}`:""}function Ax(e){return e&&e[0].toUpperCase()+e.slice(1)}function mwe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M4 2.5h5l3 3v8a.5.5 0 01-.5.5h-7.5a.5.5 0 01-.5-.5v-10a.5.5 0 01.5-.5z"}),i.jsx("path",{d:"M9 2.5v3h3"}),i.jsx("path",{d:"M5.6 9h5M5.6 11.4h5"})]})}function Ex(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M5 3l4 4-4 4"})})}function gwe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M9 3l-4 4 4 4"})})}function ywe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M5 3l4 4-4 4"})})}function bwe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 5l4 4 4-4"})})}function Yg(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 9 L9 5"}),i.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}function Nx(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3 7.4l2.6 2.6L11 4.4"})})}function Ix(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"10",height:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3.5 3.5l7 7M10.5 3.5l-7 7"})})}function Mx(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"6",height:"6","aria-hidden":!0,children:i.jsx("circle",{cx:"7",cy:"7",r:"3",fill:"currentColor"})})}function vwe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"10",height:"10","aria-hidden":!0,children:i.jsx("circle",{cx:"7",cy:"7",r:"3",fill:"currentColor"})})}const wwe="_shell_iy2rq_11",_we="_header_iy2rq_20",xwe="_backBtn_iy2rq_33",kwe="_main_iy2rq_55",Cwe="_titleBlock_iy2rq_68",jwe="_titleHeadRow_iy2rq_73",Swe="_title_iy2rq_68",Awe="_titleMeta_iy2rq_88",Ewe="_titleMetaSep_iy2rq_96",Nwe="_card_iy2rq_98",Iwe="_cardHead_iy2rq_123",Mwe="_cardHeadText_iy2rq_130",Bwe="_cardTitle_iy2rq_131",Twe="_cardSub_iy2rq_143",Pwe="_cardHeadMeta_iy2rq_150",Rwe="_viewContractBtn_iy2rq_158",Lwe="_recital_iy2rq_181",Dwe="_recitalMark_iy2rq_189",Owe="_recitalBody_iy2rq_199",Fwe="_recitalFoot_iy2rq_207",$we="_permMetaLine_iy2rq_216",zwe="_permMetaTpl_iy2rq_230",qwe="_permMetaSep_iy2rq_234",Uwe="_permMetaId_iy2rq_237",Hwe="_permMetaVer_iy2rq_240",Wwe="_permMetaAddr_iy2rq_243",Vwe="_permSlotPill_iy2rq_248",Gwe="_permSlotPillStrong_iy2rq_261",Kwe="_permSlotPillDot_iy2rq_262",Qwe="_permSlotPillRevoked_iy2rq_263",Ywe="_permRowTrailing_iy2rq_266",Jwe="_permRevokeBtn_iy2rq_273",Xwe="_permRevokedBadge_iy2rq_291",Zwe="_permRowDimmed_iy2rq_304",e_e="_metricsRow_iy2rq_315",t_e="_metricCard_iy2rq_324",n_e="_metricKicker_iy2rq_349",r_e="_metricValue_iy2rq_356",s_e="_metricValueDim_iy2rq_365",o_e="_metricValueDanger_iy2rq_366",a_e="_metricValueMono_iy2rq_367",i_e="_metricSub_iy2rq_373",c_e="_metricPill_iy2rq_381",l_e="_metricPillDot_iy2rq_396",u_e="_metricPillSuccess_iy2rq_403",d_e="_metricPillDanger_iy2rq_408",f_e="_metricBar_iy2rq_413",h_e="_metricBarFill_iy2rq_421",p_e="_metricFootnote_iy2rq_428",m_e="_attestationPill_iy2rq_438",g_e="_attestationPillSuccess_iy2rq_454",y_e="_endpointFailCount_iy2rq_459",b_e="_attestationDot_iy2rq_464",v_e="_bookGrid_iy2rq_472",w_e="_bookRow_iy2rq_481",__e="_bookRowAccent_iy2rq_505",x_e="_bookNote_iy2rq_516",k_e="_feeLine_iy2rq_534",C_e="_permListItem_iy2rq_567",j_e="_permListItemOpen_iy2rq_572",S_e="_permRowClickable_iy2rq_578",A_e="_permExpandChevron_iy2rq_591",E_e="_permExpandChevronOpen_iy2rq_599",N_e="_permDetail_iy2rq_601",I_e="_permDetailFadeIn_iy2rq_1",M_e="_permDescription_iy2rq_614",B_e="_permFieldGrid_iy2rq_625",T_e="_permFieldRow_iy2rq_634",P_e="_permFieldValueMono_iy2rq_660",R_e="_permFieldValueDim_iy2rq_665",L_e="_permFieldLink_iy2rq_666",D_e="_permDetailActions_iy2rq_676",O_e="_permActionGhost_iy2rq_684",F_e="_permActionDanger_iy2rq_709",$_e="_permRevokedNote_iy2rq_729",z_e="_redraftCard_iy2rq_741",q_e="_redraftKicker_iy2rq_746",U_e="_editBtn_iy2rq_754",H_e="_editBtn_claude_iy2rq_781",W_e="_editBtn_cursor_iy2rq_790",V_e="_editBtn_codex_iy2rq_799",G_e="_editBtn_chatgpt_iy2rq_800",K_e="_editBtn_openai_iy2rq_801",Q_e="_aboutCard_iy2rq_814",Y_e="_aboutList_iy2rq_819",J_e="_aboutMono_iy2rq_856",X_e="_permTech_iy2rq_867",Z_e="_permSelector_iy2rq_879",e6e="_permEnforced_iy2rq_880",t6e="_receiptGrid_iy2rq_895",n6e="_receiptRow_iy2rq_904",r6e="_mono_iy2rq_928",s6e="_receiptLink_iy2rq_929",o6e="_agentList_iy2rq_941",a6e="_agentRow_iy2rq_949",i6e="_agentDot_iy2rq_970",c6e="_agentDotActive_iy2rq_975",l6e="_agentDotIdle_iy2rq_979",u6e="_agentBody_iy2rq_983",d6e="_agentName_iy2rq_984",f6e="_agentSub_iy2rq_991",h6e="_agentChevron_iy2rq_996",p6e="_dangerCard_iy2rq_1004",m6e="_dangerKicker_iy2rq_1011",g6e="_revokeBtn_iy2rq_1018",y6e="_notFound_iy2rq_1049",b6e="_notFoundTitle_iy2rq_1057",v6e="_notFoundBody_iy2rq_1064",q={shell:wwe,header:_we,backBtn:xwe,main:kwe,titleBlock:Cwe,titleHeadRow:jwe,title:Swe,titleMeta:Awe,titleMetaSep:Ewe,card:Nwe,cardHead:Iwe,cardHeadText:Mwe,cardTitle:Bwe,cardSub:Twe,cardHeadMeta:Pwe,viewContractBtn:Rwe,recital:Lwe,recitalMark:Dwe,recitalBody:Owe,recitalFoot:Fwe,permMetaLine:$we,permMetaTpl:zwe,permMetaSep:qwe,permMetaId:Uwe,permMetaVer:Hwe,permMetaAddr:Wwe,permSlotPill:Vwe,permSlotPillStrong:Gwe,permSlotPillDot:Kwe,permSlotPillRevoked:Qwe,permRowTrailing:Ywe,permRevokeBtn:Jwe,permRevokedBadge:Xwe,permRowDimmed:Zwe,metricsRow:e_e,metricCard:t_e,metricKicker:n_e,metricValue:r_e,metricValueDim:s_e,metricValueDanger:o_e,metricValueMono:a_e,metricSub:i_e,metricPill:c_e,metricPillDot:l_e,metricPillSuccess:u_e,metricPillDanger:d_e,metricBar:f_e,metricBarFill:h_e,metricFootnote:p_e,attestationPill:m_e,attestationPillSuccess:g_e,endpointFailCount:y_e,attestationDot:b_e,bookGrid:v_e,bookRow:w_e,bookRowAccent:__e,bookNote:x_e,feeLine:k_e,permListItem:C_e,permListItemOpen:j_e,permRowClickable:S_e,permExpandChevron:A_e,permExpandChevronOpen:E_e,permDetail:N_e,permDetailFadeIn:I_e,permDescription:M_e,permFieldGrid:B_e,permFieldRow:T_e,permFieldValueMono:P_e,permFieldValueDim:R_e,permFieldLink:L_e,permDetailActions:D_e,permActionGhost:O_e,permActionDanger:F_e,permRevokedNote:$_e,redraftCard:z_e,redraftKicker:q_e,editBtn:U_e,editBtn_claude:H_e,editBtn_cursor:W_e,editBtn_codex:V_e,editBtn_chatgpt:G_e,editBtn_openai:K_e,aboutCard:Q_e,aboutList:Y_e,aboutMono:J_e,permTech:X_e,permSelector:Z_e,permEnforced:e6e,receiptGrid:t6e,receiptRow:n6e,mono:r6e,receiptLink:s6e,agentList:o6e,agentRow:a6e,agentDot:i6e,agentDotActive:c6e,agentDotIdle:l6e,agentBody:u6e,agentName:d6e,agentSub:f6e,agentChevron:h6e,dangerCard:p6e,dangerKicker:m6e,revokeBtn:g6e,notFound:y6e,notFoundTitle:b6e,notFoundBody:v6e},w6e={1:"ethereum",42161:"arbitrum",8453:"base",130:"unichain",10:"optimism",137:"polygon"},Bx={arbitrum:e=>`https://arbiscan.io/address/${e}`,ethereum:e=>`https://etherscan.io/address/${e}`,base:e=>`https://basescan.org/address/${e}`,unichain:e=>`https://uniscan.xyz/address/${e}`,optimism:e=>`https://optimistic.etherscan.io/address/${e}`,polygon:e=>`https://polygonscan.com/address/${e}`},Tx={arbitrum:e=>`https://arbiscan.io/tx/${e}`,ethereum:e=>`https://etherscan.io/tx/${e}`,base:e=>`https://basescan.org/tx/${e}`,unichain:e=>`https://uniscan.xyz/tx/${e}`,optimism:e=>`https://optimistic.etherscan.io/tx/${e}`,polygon:e=>`https://polygonscan.com/tx/${e}`};function _6e(e,t){return(Bx[e]??Bx.ethereum)(t)}function Px(e,t){return(Tx[e]??Tx.ethereum)(t)}const ui={maxPermissionsPerAccount:10,permissionRegistrationFeeEth:"0.001",permissionGasCapK:100,protocolCutBps:0,MAX_PROTOCOL_CUT_BPS:1e3};function x6e({mandateId:e,onBack:t,onRevoke:n}){var T,O,B,U,L;const{mandate:r}=Fp(),{account:s}=dd(),{address:o}=Oe(),a=w6e[s==null?void 0:s.chainId]??"ethereum",c=S.useMemo(()=>r?{id:e??"live",...r}:null,[r,e]),[l,u]=S.useState(()=>new Set),[d,f]=S.useState(null),h=S.useMemo(()=>{if(!c)return null;const N=c.permissionsAllowed??c.permissions??[];return{...c,permissionsAllowed:N.map(H=>({...H,revoked:l.has(H.id)||H.revoked===!0}))}},[c,l]),p=s?{name:"My SMA",address:s.safe}:null,m=[],[g,_]=S.useState(!1),[b,y]=S.useState(!1),[v,w]=S.useState(null),[x,A]=S.useState(!1);function C(){d&&(u(N=>{const H=new Set(N);return H.add(d.id),H}),f(null))}const j=((T=h==null?void 0:h.permissionsAllowed)==null?void 0:T.filter(N=>!N.revoked).length)??0,E=(((O=h==null?void 0:h.permissionsAllowed)==null?void 0:O.length)??0)-j;if(S.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"})},[e]),!h)return i.jsxs("div",{className:`${De.pageShell} ${q.shell}`,children:[i.jsx(Ms,{}),i.jsxs("main",{className:q.notFound,children:[i.jsx(Dt,{size:48}),i.jsx("h1",{className:q.notFoundTitle,children:"Mandate not found"}),i.jsx("p",{className:q.notFoundBody,children:"The URL points to a mandate that doesn’t exist."}),i.jsx(Me,{onClick:t,children:"Back to dashboard"})]})]});const I=h.status==="active";return h.status,i.jsxs("div",{className:`${De.pageShell} ${q.shell}`,children:[i.jsx(Ms,{}),i.jsx("header",{className:q.header,children:i.jsxs("button",{type:"button",className:q.backBtn,onClick:t,"aria-label":"Back to dashboard",children:[i.jsx(C6e,{}),i.jsx("span",{children:"Dashboard"})]})}),i.jsxs("main",{className:q.main,children:[i.jsxs("section",{className:q.titleBlock,children:[i.jsxs("div",{className:q.titleHeadRow,children:[i.jsx("h1",{className:q.title,children:h.title}),i.jsx(Bu,{status:h.status})]}),i.jsxs("p",{className:q.titleMeta,children:["Signed for ",i.jsx("strong",{children:p.name})," · ",h.signedAt,i.jsx("span",{className:q.titleMetaSep,"aria-hidden":!0,children:"·"}),m.length," agent wallet",m.length===1?"":"s"," running under it"]})]}),i.jsxs("section",{className:q.card,children:[i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(A6e,{}),"Mandate summary"]}),i.jsx("p",{className:q.cardSub,children:"The plain-language recital you signed when authorizing this mandate."})]}),i.jsxs("button",{type:"button",className:q.viewContractBtn,onClick:()=>y(!0),children:["View mandate detail",i.jsx(Df,{})]})]}),i.jsxs("blockquote",{className:q.recital,children:[i.jsx("span",{className:q.recitalMark,"aria-hidden":!0,children:"“"}),i.jsx("p",{className:q.recitalBody,children:h.summary}),i.jsxs("footer",{className:q.recitalFoot,children:[i.jsx(xs,{name:h.aiName,size:14}),i.jsxs("span",{children:["Drafted by ",h.aiName," · first registered ",h.signedAt]})]})]})]}),i.jsxs("section",{className:q.card,children:[i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(E6e,{}),"Permissions"]}),i.jsx("p",{className:q.cardSub,children:"What the agents under this mandate are authorized to do. Anything not listed below is forbidden by the mandate."}),h.permissionsCap&&i.jsxs("span",{className:q.permSlotPill,children:[i.jsxs("span",{className:q.permSlotPillStrong,children:[j," of ",h.permissionsCap]}),i.jsx("span",{children:"slots active"}),E>0&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:q.permSlotPillDot,"aria-hidden":!0,children:"·"}),i.jsxs("span",{className:q.permSlotPillRevoked,children:[E," revoked"]})]}),i.jsx("span",{className:q.permSlotPillDot,"aria-hidden":!0,children:"·"}),i.jsxs("span",{children:[h.registrationFeeEth," ETH each at registration"]})]})]}),i.jsxs("span",{className:q.cardHeadMeta,children:[j," active"]})]}),i.jsx("ul",{className:Ie.permList,children:h.permissionsAllowed.map(N=>{const H=!!N.revoked,M=v===N.id;return i.jsxs("li",{className:`${q.permListItem} ${M?q.permListItemOpen:""}`,children:[i.jsxs("div",{className:`${Ie.permRow} ${H?Ie.permRowRevoked:Ie.permRowAllow} ${H?q.permRowDimmed:""} ${q.permRowClickable}`,role:"button",tabIndex:0,"aria-expanded":M,onClick:()=>w(M?null:N.id),onKeyDown:$=>{($.key==="Enter"||$.key===" ")&&($.preventDefault(),w(M?null:N.id))},children:[i.jsx("span",{className:Ie.permMark,"aria-hidden":!0,children:H?i.jsx(S6e,{}):i.jsx(j6e,{})}),i.jsxs("span",{className:Ie.permBody,children:[i.jsx("span",{className:Ie.permLabel,children:N.label}),i.jsx("span",{className:Ie.permSub,children:N.sub}),(N.template||N.permissionId)&&i.jsxs("span",{className:q.permMetaLine,children:[N.template&&i.jsx("span",{className:q.permMetaTpl,children:N.template}),N.permissionId&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:q.permMetaSep,"aria-hidden":!0,children:"·"}),i.jsx("span",{className:q.permMetaId,children:N.permissionId})]}),N.version&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:q.permMetaSep,"aria-hidden":!0,children:"·"}),i.jsxs("span",{className:q.permMetaVer,children:["v",N.version]})]}),N.address&&i.jsxs(i.Fragment,{children:[i.jsx("span",{className:q.permMetaSep,"aria-hidden":!0,children:"·"}),i.jsxs("span",{className:q.permMetaAddr,children:[N.address.slice(0,6),"…",N.address.slice(-4)]})]})]})]}),i.jsxs("span",{className:q.permRowTrailing,children:[H?i.jsx("span",{className:q.permRevokedBadge,children:"Revoked"}):i.jsx("span",{className:q.permTech,title:N.signature,children:i.jsx("code",{className:q.permSelector,children:N.selector})}),i.jsx("span",{className:`${q.permExpandChevron} ${M?q.permExpandChevronOpen:""}`,"aria-hidden":!0,children:i.jsx(Lx,{})})]})]}),M&&i.jsxs("div",{className:q.permDetail,role:"region","aria-label":`${N.label} details`,children:[N.description&&i.jsx("p",{className:q.permDescription,children:N.description}),i.jsxs("dl",{className:q.permFieldGrid,children:[i.jsx(fl,{k:"Function signature",v:N.signature,mono:!0,dim:!0}),i.jsx(fl,{k:"Selector",v:N.selector,mono:!0}),i.jsx(fl,{k:"Contract address",v:N.address?`${N.address.slice(0,8)}…${N.address.slice(-6)}`:"—",mono:!0}),i.jsx(fl,{k:"Registered at",v:N.registeredAt}),i.jsx(fl,{k:"Registration tx",v:N.registeredTxHash,mono:!0,link:Px(a,N.registeredTxHash)})]}),i.jsxs("div",{className:q.permDetailActions,children:[i.jsxs("a",{href:_6e(a,N.address),target:"_blank",rel:"noreferrer",className:q.permActionGhost,onClick:$=>$.stopPropagation(),children:["View on explorer",i.jsx(Df,{})]}),!H&&I&&i.jsx("button",{type:"button",className:q.permActionDanger,onClick:$=>{$.stopPropagation(),f(N)},children:"Revoke permission"}),H&&i.jsx("span",{className:q.permRevokedNote,children:"This permission was revoked. The rest of the mandate remains signed and active."})]})]})]},N.id)})})]}),i.jsxs("section",{className:q.metricsRow,"aria-label":"Mandate status at a glance",children:[i.jsxs("article",{className:q.metricCard,children:[i.jsx("span",{className:q.metricKicker,children:"Mandate"}),i.jsx("span",{className:`${q.metricValue} ${h.sessionActive===!1?q.metricValueDanger:""}`,children:h.sessionActive===!1?"Revoked":"Active"}),i.jsxs("p",{className:q.metricSub,children:["Kill switch for the whole mandate. Setting it off halts ",i.jsx("em",{children:"all"})," dispatch but leaves permissions registered — you can re-activate without re-signing anything."]}),i.jsxs("span",{className:`${q.metricPill} ${h.sessionActive===!1?q.metricPillDanger:q.metricPillSuccess}`,children:[i.jsx("span",{className:q.metricPillDot,"aria-hidden":!0}),h.sessionActive===!1?"Dispatch halted":"Dispatch allowed"]})]}),i.jsxs("article",{className:q.metricCard,children:[i.jsx("span",{className:q.metricKicker,children:"Permission slots"}),i.jsxs("span",{className:q.metricValue,children:[j,i.jsxs("span",{className:q.metricValueDim,children:[" / ",h.permissionsCap??ui.maxPermissionsPerAccount]})]}),i.jsx("div",{className:q.metricBar,"aria-hidden":!0,children:i.jsx("div",{className:q.metricBarFill,style:{width:`${Math.min(100,j/(h.permissionsCap??ui.maxPermissionsPerAccount)*100)}%`}})}),i.jsxs("p",{className:q.metricSub,children:["Per-account ceiling set by governance. Registration fee:"," ",i.jsxs("strong",{children:[h.registrationFeeEth??ui.permissionRegistrationFeeEth," ETH"]})," per permission."]})]}),i.jsxs("article",{className:q.metricCard,children:[i.jsx("span",{className:q.metricKicker,children:"Policy hash"}),i.jsx("span",{className:`${q.metricValue} ${q.metricValueMono}`,children:h.policyHash}),i.jsx("p",{className:q.metricSub,children:"Composite fingerprint of all registered permission templates. Any drift from this hash invalidates the mandate's enforcement guarantees."}),i.jsxs("span",{className:q.metricFootnote,children:["Block ",i.jsx("strong",{children:h.blockNumber.toLocaleString()})," · ",h.signedAt]})]})]}),i.jsxs("section",{className:q.card,children:[i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(B6e,{}),"Agent endpoint"]}),i.jsx("p",{className:q.cardSub,children:"Where dispatch decisions come from. Every recommendation is signed by this endpoint and verified before your runner sends it onchain. Drafters (Claude, Cursor, etc.) write the policy — this endpoint runs it."})]}),i.jsxs("span",{className:`${q.attestationPill} ${q.attestationPillSuccess}`,children:[i.jsx("span",{className:q.attestationDot,"aria-hidden":!0}),"Verified · pinned"]})]}),i.jsxs("dl",{className:q.bookGrid,children:[i.jsx(pf,{k:"URL",v:(s==null?void 0:s.manager)??"—",mono:!0}),i.jsx(pf,{k:"Public key",v:`${(B=s==null?void 0:s.manager)==null?void 0:B.slice(0,10)}…${((U=s==null?void 0:s.manager)==null?void 0:U.slice(-6))??"—"}`,mono:!0}),i.jsx(pf,{k:"Last seen",v:"—"}),i.jsx(pf,{k:"Recommendations verified",v:i.jsxs(i.Fragment,{children:["—",!1]})})]})]}),i.jsxs("section",{className:q.card,children:[i.jsx("header",{className:q.cardHead,children:i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(N6e,{}),"SMA registration"]}),i.jsx("p",{className:q.cardSub,children:"The onchain record that created this account and locked in its signing roles. Each permission above was added later with its own signed message — see the expanded detail of any permission for its registration receipt."})]})}),i.jsxs("dl",{className:q.receiptGrid,children:[i.jsx(ss,{k:"Permission signer",v:Rx(h.signedBy),mono:!0}),i.jsx(ss,{k:"Manager",v:Rx(p.address??""),mono:!0}),i.jsx(ss,{k:"Fee policy",v:h.feePolicyKind??"StandardFeePolicy",mono:!0}),i.jsx(ss,{k:"Policy hash",v:h.policyHash,mono:!0}),i.jsx(ss,{k:"Block",v:h.blockNumber!=null?h.blockNumber.toLocaleString():"—"}),i.jsx(ss,{k:"Tx hash",v:i.jsxs("a",{href:Px(a,h.txHash),target:"_blank",rel:"noreferrer",className:q.receiptLink,children:[k6e(h.txHash),i.jsx(Df,{})]})}),i.jsx(ss,{k:"Registered",v:h.signedAt}),i.jsx(ss,{k:"Custody",v:"Held by the SMA Safe"}),i.jsx(ss,{k:"Permission slots",v:E>0?`${j} active · ${E} revoked · ${h.permissionsCap??20} cap`:`${j} of ${h.permissionsCap??20}`})]})]}),i.jsxs("section",{className:q.card,children:[i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(I6e,{}),"Agents running under this mandate"]}),i.jsx("p",{className:q.cardSub,children:"Agent wallets operating within the permissions above. Each can be stopped individually without revoking the mandate."})]}),i.jsxs("span",{className:q.cardHeadMeta,children:[m.filter(N=>N.status==="active").length," active · ",m.length," total"]})]}),i.jsx("ul",{className:q.agentList,children:m.map(N=>i.jsx("li",{children:i.jsxs("button",{type:"button",className:q.agentRow,onClick:()=>{window.location.hash=`#/agent/${N.id}`},children:[i.jsx("span",{className:`${q.agentDot} ${N.status==="active"?q.agentDotActive:q.agentDotIdle}`,"aria-hidden":!0}),i.jsx(xs,{name:N.aiName,size:20}),i.jsxs("span",{className:q.agentBody,children:[i.jsx("span",{className:q.agentName,children:N.role??N.title}),i.jsx("span",{className:q.agentSub,children:N.title})]}),i.jsx(Bu,{status:N.status,kind:"agent"}),i.jsx("span",{className:q.agentChevron,"aria-hidden":!0,children:i.jsx(Lx,{})})]})},N.id))})]}),i.jsxs("section",{className:`${q.card} ${q.aboutCard}`,children:[i.jsx("header",{className:q.cardHead,children:i.jsxs("div",{className:q.cardHeadText,children:[i.jsxs("h2",{className:q.cardTitle,children:[i.jsx(M6e,{}),"About this mandate"]}),i.jsx("p",{className:q.cardSub,children:"The protocol-level guarantees this mandate gives you."})]})}),i.jsxs("ul",{className:q.aboutList,children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Per-permission revocation is supported."})," Each permission was added with its own signed message, so you can surgically revoke one line without touching the rest of the mandate."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Selective dispatch."})," At call time the manager ",i.jsx("em",{children:"names"})," ","which permission authorizes the call. There is no AND-across-permissions enforcement — the named permission either accepts the call or the call reverts."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Fail-closed evaluation."})," The kernel reads each permission's"," ",i.jsx("code",{className:q.aboutMono,children:"evaluate(...)"})," via a static call under a"," ",i.jsxs("strong",{children:[ui.permissionGasCapK,"k gas cap"]}),". Revert or gas exhaustion blocks the dispatch."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Bounded protocol fee."})," Sail's protocol cut is currently"," ",i.jsxs("strong",{children:[ui.protocolCutBps," bps"]})," on manager-collected fees, capped immutably at"," ",i.jsxs("strong",{children:[ui.MAX_PROTOCOL_CUT_BPS," bps"]})," in the kernel source."]})]})]}),i.jsx("section",{className:`${q.card} ${q.redraftCard}`,children:i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsx("span",{className:q.redraftKicker,children:"Editable · reversible"}),i.jsx("h2",{className:q.cardTitle,children:"Redraft this mandate"}),i.jsxs("p",{className:q.cardSub,children:["Opens ",h.aiName," to draft a new version of this mandate. Nothing changes onchain until you sign the replacement. The current mandate keeps running in the meantime."]})]}),i.jsxs("button",{type:"button",className:`${q.editBtn} ${q[`editBtn_${(L=h.aiName)==null?void 0:L.toLowerCase()}`]??""}`,onClick:()=>A(!0),disabled:!I,children:["Edit with ",h.aiName]})]})}),i.jsx("section",{className:`${q.card} ${q.dangerCard}`,children:i.jsxs("header",{className:q.cardHead,children:[i.jsxs("div",{className:q.cardHeadText,children:[i.jsx("span",{className:q.dangerKicker,children:"Reversible · halts all dispatch"}),i.jsx("h2",{className:q.cardTitle,children:"Revoke mandate"}),i.jsx("p",{className:q.cardSub,children:"Flips the kill switch on this mandate. Every agent stops dispatching immediately, but the permissions below stay registered. You can re-activate the mandate at any time without re-signing anything. Always exempt from protocol pause."})]}),i.jsx("button",{type:"button",className:q.revokeBtn,onClick:()=>_(!0),disabled:!I,children:"Revoke mandate"})]})})]}),i.jsx(Mh,{open:b,mandate:h,readOnly:!0,signedDate:h.signedAt,onClose:()=>y(!1)}),i.jsx(Mh,{open:g,mode:"revoke",mandate:h,signedDate:h.signedAt,onClose:()=>_(!1),onRevoke:()=>{_(!1),n==null||n()}}),i.jsx(A2,{open:x,variant:"redraft",mandate:h,onClose:()=>A(!1)}),i.jsx(bS,{open:!!d,title:"Revoke this permission?",body:d?`Agents under this mandate will lose authority to call "${d.label}". The rest of the mandate stays signed and active. This action is not reversible.`:"",confirmLabel:"Revoke permission",cancelLabel:"Keep permission",onCancel:()=>f(null),onConfirm:C})]})}function ss({k:e,v:t,mono:n}){return i.jsxs("div",{className:q.receiptRow,children:[i.jsx("dt",{children:e}),i.jsx("dd",{className:n?q.mono:"",children:t})]})}function pf({k:e,v:t,mono:n,accent:r}){return i.jsxs("div",{className:`${q.bookRow} ${r?q.bookRowAccent:""}`,children:[i.jsx("dt",{children:e}),i.jsx("dd",{className:n?q.mono:"",children:t})]})}function fl({k:e,v:t,mono:n,dim:r,link:s}){let o=t??"—";return s&&t&&(o=i.jsxs("a",{href:s,target:"_blank",rel:"noreferrer",className:q.permFieldLink,onClick:a=>a.stopPropagation(),children:[t,i.jsx(Df,{})]})),i.jsxs("div",{className:q.permFieldRow,children:[i.jsx("dt",{children:e}),i.jsx("dd",{className:`${n?q.permFieldValueMono:""} ${r?q.permFieldValueDim:""}`,children:o})]})}function Rx(e){return e?`${e.slice(0,6)}…${e.slice(-4)}`:""}function k6e(e){return e?`${e.slice(0,10)}…${e.slice(-6)}`:""}function C6e(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M9 3l-4 4 4 4"})})}function Lx(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M5 3l4 4-4 4"})})}function Df(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 9 L9 5"}),i.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}function j6e(){return i.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M3.5 8.4l3 3L13 5.2"})})}function S6e(){return i.jsx("svg",{viewBox:"0 0 16 16",width:"13",height:"13",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M4 4l8 8M12 4L4 12"})})}function A6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M4 2.5h5l3 3v8a.5.5 0 01-.5.5h-7.5a.5.5 0 01-.5-.5v-10a.5.5 0 01.5-.5z"}),i.jsx("path",{d:"M9 2.5v3h3"}),i.jsx("path",{d:"M5.6 9h5M5.6 11.4h5"})]})}function E6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 4h8M5 8h8M5 12h8"}),i.jsx("circle",{cx:"2.5",cy:"4",r:"0.7",fill:"currentColor"}),i.jsx("circle",{cx:"2.5",cy:"8",r:"0.7",fill:"currentColor"}),i.jsx("circle",{cx:"2.5",cy:"12",r:"0.7",fill:"currentColor"})]})}function N6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"8",cy:"7",r:"4"}),i.jsx("path",{d:"M6 10.5L5.2 13.4l2.8-1.6 2.8 1.6L10 10.5"})]})}function I6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("rect",{x:"3",y:"5.5",width:"10",height:"7",rx:"1.6"}),i.jsx("path",{d:"M8 3.2v2.3"}),i.jsx("circle",{cx:"8",cy:"2.6",r:"0.6",fill:"currentColor"}),i.jsx("circle",{cx:"6.3",cy:"8.6",r:"0.9",fill:"currentColor"}),i.jsx("circle",{cx:"9.7",cy:"8.6",r:"0.9",fill:"currentColor"}),i.jsx("path",{d:"M6.5 11h3"})]})}function M6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"8",cy:"8",r:"6"}),i.jsx("path",{d:"M8 7.2v3.6"}),i.jsx("circle",{cx:"8",cy:"5.2",r:"0.5",fill:"currentColor"})]})}function B6e(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M2.5 6.5l5.5-3 5.5 3-5.5 3-5.5-3z"}),i.jsx("path",{d:"M2.5 9.5l5.5 3 5.5-3"}),i.jsx("path",{d:"M2.5 12.5l5.5 3 5.5-3",opacity:"0.55"})]})}const T6e="_shell_1nll6_5",P6e="_header_1nll6_16",R6e="_backBtn_1nll6_28",L6e="_main_1nll6_49",D6e="_notFound_1nll6_63",O6e="_notFoundTitle_1nll6_74",F6e="_notFoundBody_1nll6_82",$6e="_titleBlock_1nll6_85",z6e="_titleMetaRow_1nll6_91",q6e="_kindPill_1nll6_99",U6e="_kind_run_1nll6_114",H6e="_kind_permission_1nll6_119",W6e="_timeMeta_1nll6_124",V6e="_metaDot_1nll6_130",G6e="_statusPill_1nll6_131",K6e="_statusPillDot_1nll6_143",Q6e="_status_success_1nll6_150",Y6e="_status_warn_1nll6_155",J6e="_status_danger_1nll6_160",X6e="_status_info_1nll6_165",Z6e="_titleActorRow_1nll6_171",exe="_titleActorBadge_1nll6_177",txe="_titleActorName_1nll6_188",nxe="_title_1nll6_85",rxe="_titleSub_1nll6_207",sxe="_card_1nll6_216",oxe="_cardHead_1nll6_222",axe="_cardHeadText_1nll6_229",ixe="_cardTitle_1nll6_235",cxe="_cardSub_1nll6_247",lxe="_cardHeadMeta_1nll6_253",uxe="_reasoning_1nll6_261",dxe="_reasoningMark_1nll6_274",fxe="_evidenceGrid_1nll6_288",hxe="_evidenceRow_1nll6_297",pxe="_authBox_1nll6_326",mxe="_authMark_1nll6_335",gxe="_authText_1nll6_348",yxe="_authLabel_1nll6_349",bxe="_authSub_1nll6_356",vxe="_artifactGrid_1nll6_363",wxe="_artifactRow_1nll6_372",_xe="_txLink_1nll6_398",xxe="_paginate_1nll6_409",kxe="_paginateLink_1nll6_418",Cxe="_paginateLinkRight_1nll6_436",jxe="_paginateText_1nll6_440",Sxe="_paginateKicker_1nll6_446",Axe="_paginateTitle_1nll6_453",Exe="_paginateSpacer_1nll6_463",he={shell:T6e,header:P6e,backBtn:R6e,main:L6e,notFound:D6e,notFoundTitle:O6e,notFoundBody:F6e,titleBlock:$6e,titleMetaRow:z6e,kindPill:q6e,kind_run:U6e,kind_permission:H6e,timeMeta:W6e,metaDot:V6e,statusPill:G6e,statusPillDot:K6e,status_success:Q6e,status_warn:Y6e,status_danger:J6e,status_info:X6e,titleActorRow:Z6e,titleActorBadge:exe,titleActorName:txe,title:nxe,titleSub:rxe,card:sxe,cardHead:oxe,cardHeadText:axe,cardTitle:ixe,cardSub:cxe,cardHeadMeta:lxe,reasoning:uxe,reasoningMark:dxe,evidenceGrid:fxe,evidenceRow:hxe,authBox:pxe,authMark:mxe,authText:gxe,authLabel:yxe,authSub:bxe,artifactGrid:vxe,artifactRow:wxe,txLink:_xe,paginate:xxe,paginateLink:kxe,paginateLinkRight:Cxe,paginateText:jxe,paginateKicker:Sxe,paginateTitle:Axe,paginateSpacer:Exe};function Nxe({entryId:e,onBack:t}){var u,d,f,h,p;const{events:n}=kS(),{mandate:r}=Fp(),s=S.useMemo(()=>n.find(m=>m.id===e)??n.find((m,g)=>String(g)===e),[n,e]),{prev:o,next:a}=S.useMemo(()=>{if(!s)return{prev:null,next:null};const m=n.indexOf(s);return{prev:m>0?n[m-1]:null,next:m<n.length-1?n[m+1]:null}},[s,n]),c=S.useMemo(()=>!s||!r?null:(r.permissions??[]).find(g=>(g.role??g.template)===s.actor)??null,[s,r]);if(S.useEffect(()=>{window.scrollTo({top:0,behavior:"instant"})},[e]),!s)return i.jsxs("div",{className:`${De.pageShell} ${he.shell}`,children:[i.jsx(Ms,{}),i.jsxs("main",{className:he.notFound,children:[i.jsx(Dt,{size:48}),i.jsx("h1",{className:he.notFoundTitle,children:"Activity not found"}),i.jsx("p",{className:he.notFoundBody,children:"The URL points to a journal entry that doesn't exist. It may have been pruned from local storage."}),i.jsx(Me,{onClick:t,children:"Back to dashboard"})]})]});const l=s.status==="rejected"?"danger":s.status==="warn"?"warn":s.status==="success"?"success":"info";return i.jsxs("div",{className:`${De.pageShell} ${he.shell}`,children:[i.jsx(Ms,{}),i.jsx("header",{className:he.header,children:i.jsxs("button",{type:"button",className:he.backBtn,onClick:t,"aria-label":"Back to dashboard",children:[i.jsx(Ixe,{}),i.jsx("span",{children:"Dashboard"})]})}),i.jsxs("main",{className:he.main,children:[i.jsxs("section",{className:he.titleBlock,children:[i.jsxs("div",{className:he.titleMetaRow,children:[i.jsx("span",{className:`${he.kindPill} ${he[`kind_${s.kind??"event"}`]??""}`,children:s.kindLabel??"Event"}),i.jsxs("span",{className:he.timeMeta,children:[s.dateLabel?`${s.dateLabel}, `:"",s.time]}),i.jsx("span",{className:he.metaDot,"aria-hidden":!0,children:"·"}),i.jsxs("span",{className:`${he.statusPill} ${he[`status_${l}`]}`,children:[i.jsx("span",{className:he.statusPillDot,"aria-hidden":!0}),s.status==="success"&&"Confirmed",s.status==="rejected"&&"Held by mandate",s.status==="warn"&&"Warning",s.status==="info"&&"Info"]})]}),i.jsxs("div",{className:he.titleActorRow,children:[c&&i.jsxs("span",{className:he.titleActorBadge,children:[i.jsx(xs,{name:c.aiName,size:18}),i.jsx("span",{children:c.aiName})]}),i.jsx("span",{className:he.titleActorName,children:s.actor})]}),i.jsx("h1",{className:he.title,children:s.action}),s.meta&&i.jsx("p",{className:he.titleSub,children:s.meta})]}),((u=s.detail)==null?void 0:u.reasoning)&&i.jsxs("section",{className:he.card,children:[i.jsx("header",{className:he.cardHead,children:i.jsxs("div",{className:he.cardHeadText,children:[i.jsxs("h2",{className:he.cardTitle,children:[i.jsx(Txe,{}),"Reasoning"]}),i.jsx("p",{className:he.cardSub,children:"What the agent recorded as the rationale for this action."})]})}),i.jsxs("blockquote",{className:he.reasoning,children:[i.jsx("span",{className:he.reasoningMark,"aria-hidden":!0,children:"“"}),i.jsx("p",{children:s.detail.reasoning})]})]}),((f=(d=s.detail)==null?void 0:d.evidence)==null?void 0:f.length)>0&&i.jsxs("section",{className:he.card,children:[i.jsxs("header",{className:he.cardHead,children:[i.jsxs("div",{className:he.cardHeadText,children:[i.jsxs("h2",{className:he.cardTitle,children:[i.jsx(Pxe,{}),"Evidence"]}),i.jsx("p",{className:he.cardSub,children:"Inputs the agent cited at decision time."})]}),i.jsxs("span",{className:he.cardHeadMeta,children:[s.detail.evidence.length," data point",s.detail.evidence.length===1?"":"s"]})]}),i.jsx("dl",{className:he.evidenceGrid,children:s.detail.evidence.map(m=>i.jsxs("div",{className:he.evidenceRow,children:[i.jsx("dt",{children:m.k}),i.jsx("dd",{children:m.v})]},m.k))})]}),((h=s.detail)==null?void 0:h.authorization)&&i.jsxs("section",{className:he.card,children:[i.jsx("header",{className:he.cardHead,children:i.jsxs("div",{className:he.cardHeadText,children:[i.jsxs("h2",{className:he.cardTitle,children:[i.jsx(Rxe,{}),"Authorization"]}),i.jsx("p",{className:he.cardSub,children:"Which permission the manager named when authorizing this call."})]})}),i.jsxs("div",{className:he.authBox,children:[i.jsx("span",{className:he.authMark,"aria-hidden":!0,children:"✓"}),i.jsxs("div",{className:he.authText,children:[i.jsx("span",{className:he.authLabel,children:s.detail.authorization.label}),i.jsx("span",{className:he.authSub,children:s.detail.authorization.sub})]})]})]}),((p=s.detail)==null?void 0:p.artifact)&&i.jsxs("section",{className:he.card,children:[i.jsx("header",{className:he.cardHead,children:i.jsxs("div",{className:he.cardHeadText,children:[i.jsxs("h2",{className:he.cardTitle,children:[i.jsx(Lxe,{}),"Run artifact"]}),i.jsx("p",{className:he.cardSub,children:"The onchain receipt for this run."})]})}),i.jsx("dl",{className:he.artifactGrid,children:Object.entries(s.detail.artifact).map(([m,g])=>i.jsxs("div",{className:he.artifactRow,children:[i.jsx("dt",{children:m}),i.jsx("dd",{children:m==="Tx hash"?i.jsxs("a",{href:`https://arbiscan.io/tx/${String(g).replace("…","")}`,target:"_blank",rel:"noreferrer",className:he.txLink,children:[g,i.jsx(Dxe,{})]}):g})]},m))})]}),i.jsxs("nav",{className:he.paginate,"aria-label":"Adjacent activity",children:[o?i.jsxs("a",{href:`#/journal/${o.id}`,className:he.paginateLink,children:[i.jsx(Mxe,{}),i.jsxs("span",{className:he.paginateText,children:[i.jsx("span",{className:he.paginateKicker,children:"Previous"}),i.jsx("span",{className:he.paginateTitle,children:o.action})]})]}):i.jsx("span",{className:he.paginateSpacer,"aria-hidden":!0}),a?i.jsxs("a",{href:`#/journal/${a.id}`,className:`${he.paginateLink} ${he.paginateLinkRight}`,children:[i.jsxs("span",{className:he.paginateText,children:[i.jsx("span",{className:he.paginateKicker,children:"Next"}),i.jsx("span",{className:he.paginateTitle,children:a.action})]}),i.jsx(Bxe,{})]}):i.jsx("span",{className:he.paginateSpacer,"aria-hidden":!0})]})]})]})}function Ixe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"12",height:"12",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M9 3l-4 4 4 4"})})}function Mxe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M9 3l-4 4 4 4"})})}function Bxe(){return i.jsx("svg",{viewBox:"0 0 14 14",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:i.jsx("path",{d:"M5 3l4 4-4 4"})})}function Txe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M4 2.5h5l3 3v8a.5.5 0 01-.5.5h-7.5a.5.5 0 01-.5-.5v-10a.5.5 0 01.5-.5z"}),i.jsx("path",{d:"M9 2.5v3h3"}),i.jsx("path",{d:"M5.6 9h5M5.6 11.4h3"})]})}function Pxe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 4h8M5 8h8M5 12h8"}),i.jsx("circle",{cx:"2.5",cy:"4",r:"0.7",fill:"currentColor"}),i.jsx("circle",{cx:"2.5",cy:"8",r:"0.7",fill:"currentColor"}),i.jsx("circle",{cx:"2.5",cy:"12",r:"0.7",fill:"currentColor"})]})}function Rxe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M8 2l5 2v4c0 3.6-2.5 5.4-5 6-2.5-.6-5-2.4-5-6V4l5-2z"}),i.jsx("path",{d:"M5.6 8.2l1.7 1.7L10.4 7"})]})}function Lxe(){return i.jsxs("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("circle",{cx:"8",cy:"7",r:"4"}),i.jsx("path",{d:"M6 10.5L5.2 13.4l2.8-1.6 2.8 1.6L10 10.5"})]})}function Dxe(){return i.jsxs("svg",{viewBox:"0 0 14 14",width:"11",height:"11",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[i.jsx("path",{d:"M5 9 L9 5"}),i.jsx("path",{d:"M5.4 5 H9 V8.6"})]})}const Oxe=Kr({id:130,name:"Unichain",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan",url:"https://uniscan.xyz"}}}),Fxe=Kr({id:1301,name:"Unichain Sepolia",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://sepolia.unichain.org/"]}},blockExplorers:{default:{name:"Uniscan Sepolia",url:"https://sepolia.uniscan.xyz"}},testnet:!0}),$xe=[t8,lF,Ip,Oxe,n8,uF,Fxe,dF],zxe="sailor-local-dev",qxe=KU({appName:"Sailor",projectId:zxe,chains:$xe,ssr:!1}),Uxe=new LD;function Jg(){if(typeof window>"u")return"/";const e=window.location.hash.replace(/^#/,"")||"/";return e.startsWith("/")?e:`/${e}`}function Hxe(){if(typeof window>"u")return!1;const e=Number(window.location.port);return e>=3141&&e<=3150}if(typeof window<"u"){const e=Jg();(e==="/"||e==="")&&window.location.replace(Hxe()?"#/station":"#/dashboard")}function Wxe(){const[e,t]=S.useState(Jg);S.useEffect(()=>{const r=()=>t(Jg());return window.addEventListener("hashchange",r),()=>{window.removeEventListener("hashchange",r)}},[]);let n;if(e.startsWith("/home"))n=i.jsx(T1,{},e);else if(e.startsWith("/station"))n=i.jsx(XK,{},e);else if(e.startsWith("/signing"))n=i.jsx(qK,{},e);else if(e.startsWith("/mandate/")){const r=e.slice(9).split("?")[0];n=i.jsx(x6e,{mandateId:r,onBack:()=>{window.location.hash="#/dashboard"},onRevoke:()=>{window.location.hash="#/dashboard"}},e)}else if(e.startsWith("/agent/")){const r=e.slice(7).split("?")[0];n=i.jsx(Jve,{agentId:r,onBack:()=>{window.location.hash="#/dashboard"},onEdit:()=>{window.location.hash="#/dashboard"},onRevoke:()=>{window.location.hash="#/dashboard"}},e)}else if(e.startsWith("/journal/")){const r=e.slice(9).split("?")[0];n=i.jsx(Nxe,{entryId:r,onBack:()=>{window.location.hash="#/dashboard"}},e)}else e.startsWith("/dashboard")?n=i.jsx(T1,{},e):n=i.jsx(T1,{},e);return n}O1.createRoot(document.getElementById("root")).render(i.jsx(k.StrictMode,{children:i.jsx($L,{config:qxe,children:i.jsx(ZD,{client:Uxe,children:i.jsx(mq,{children:i.jsx(Wxe,{})})})})}));const Dx=Object.freeze(Object.defineProperty({__proto__:null,default:M0},Symbol.toStringTag,{value:"Module"}));export{WC as $,rE as A,K as B,cC as C,$0 as D,hI as E,pI as F,QN as G,nC as H,cb as I,z0 as J,II as K,MI as L,ch as M,Ky as N,uu as O,Cb as P,Xc as Q,LM as R,_b as S,jke as T,tB as U,EL as V,Ei as W,ja as X,W0 as Y,E5e as Z,QM as _,lw as a,SI as a$,Il as a0,Q0 as a1,Qy as a2,xa as a3,Y0 as a4,J0 as a5,fE as a6,dE as a7,ON as a8,A5e as a9,bT as aA,ru as aB,fc as aC,Hu as aD,rB as aE,Zl as aF,Xo as aG,K0 as aH,V0 as aI,G0 as aJ,Jl as aK,au as aL,En as aM,np as aN,tu as aO,qr as aP,An as aQ,Di as aR,jk as aS,bE as aT,Ck as aU,uh as aV,UN as aW,_I as aX,jn as aY,U0 as aZ,bu as a_,zN as aa,VN as ab,Yt as ac,kk as ad,gE as ae,ep as af,tR as ag,hE as ah,gT as ai,WN as aj,yE as ak,g5e as al,So as am,kI as an,HN as ao,qN as ap,eu as aq,YN as ar,yT as as,Xl as at,CI as au,I5e as av,N5e as aw,Ac as ax,jI as ay,KN as az,t5e as b,Wu as b$,aC as b0,iC as b1,AI as b2,nu as b3,X0 as b4,su as b5,du as b6,Xu as b7,FI as b8,GN as b9,Nb as bA,xE as bB,Jy as bC,Ok as bD,Fk as bE,w5e as bF,lt as bG,zr as bH,Ske as bI,$k as bJ,Ic as bK,Ch as bL,Jh as bM,ko as bN,vB as bO,QC as bP,Gxe as bQ,rr as bR,UE as bS,sN as bT,Un as bU,nj as bV,LC as bW,tb as bX,Yh as bY,rj as bZ,sj as b_,FN as ba,lu as bb,cu as bc,pE as bd,ou as be,JR as bf,Re as bg,EI as bh,mu as bi,Mw as bj,ae as bk,xo as bl,LE as bm,Ql as bn,lF as bo,iT as bp,La as bq,Pb as br,GB as bs,VB as bt,WB as bu,KB as bv,t8 as bw,n8 as bx,B0 as by,Eb as bz,bk as c,d4 as c$,yI as c0,ph as c1,BI as c2,Bo as c3,s4 as c4,aB as c5,Kr as c6,sB as c7,BB as c8,D5e as c9,Cn as cA,Vr as cB,td as cC,fp as cD,Ra as cE,tp as cF,S5e as cG,hw as cH,Ta as cI,jo as cJ,we as cK,Ge as cL,Kxe as cM,Ec as cN,vu as cO,hh as cP,hc as cQ,a4 as cR,Qx as cS,Mke as cT,HC as cU,n4 as cV,t4 as cW,Rb as cX,Ku as cY,dT as cZ,bI as c_,jC as ca,_M as cb,Bke as cc,Ba as cd,bb as ce,Iw as cf,ed as cg,ht as ch,TI as ci,HB as cj,Jxe as ck,Qxe as cl,Yxe as cm,Zxe as cn,cw as co,xM as cp,Xxe as cq,CB as cr,cB as cs,gR as ct,oC as cu,Ike as cv,Zu as cw,r4 as cx,Sb as cy,ib as cz,Uu as d,Q3e as d$,l4 as d0,f4 as d1,_T as d2,Gt as d3,Sk as d4,nr as d5,_5e as d6,tr as d7,Ake as d8,Yy as d9,i3e as dA,c3e as dB,l3e as dC,u3e as dD,d3e as dE,f3e as dF,$5e as dG,h3e as dH,p3e as dI,m3e as dJ,z5e as dK,q5e as dL,U5e as dM,H5e as dN,W5e as dO,V5e as dP,O5e as dQ,G5e as dR,K5e as dS,Q5e as dT,ake as dU,ike as dV,cke as dW,lke as dX,uke as dY,dke as dZ,fke as d_,y4 as da,eL as db,Nc as dc,ut as dd,pc as de,RE as df,Hr as dg,Xh as dh,Et as di,DI as dj,PI as dk,rp as dl,Ip as dm,Y5e as dn,J5e as dp,X5e as dq,Z5e as dr,e3e as ds,t3e as dt,n3e as du,F5e as dv,r3e as dw,s3e as dx,o3e as dy,a3e as dz,sE as e,mE as e$,hke as e0,pke as e1,mke as e2,gke as e3,yke as e4,bke as e5,vke as e6,wke as e7,_ke as e8,xke as e9,F3e as eA,$3e as eB,z3e as eC,q3e as eD,U3e as eE,H3e as eF,b3e as eG,W3e as eH,V3e as eI,G3e as eJ,v3e as eK,w3e as eL,_3e as eM,x3e as eN,k3e as eO,C3e as eP,g3e as eQ,j3e as eR,S3e as eS,A3e as eT,jw as eU,lc as eV,q0 as eW,kE as eX,te as eY,Ao as eZ,_r as e_,Y3e as ea,kke as eb,Cke as ec,up as ed,J3e as ee,X3e as ef,Z3e as eg,eke as eh,tke as ei,nke as ej,K3e as ek,rke as el,ske as em,oke as en,E3e as eo,N3e as ep,I3e as eq,M3e as er,B3e as es,T3e as et,P3e as eu,y3e as ev,R3e as ew,L3e as ex,D3e as ey,O3e as ez,oE as f,kn as f$,yo as f0,Zk as f1,Sw as f2,Es as f3,Aw as f4,Lt as f5,rR as f6,hp as f7,ab as f8,nR as f9,yB as fA,KC as fB,bB as fC,Nke as fD,Eke as fE,DR as fF,OR as fG,vR as fH,Je as fI,Co as fJ,Dk as fK,rN as fL,rC as fM,ha as fN,_a as fO,xt as fP,e4 as fQ,kB as fR,Sc as fS,Zh as fT,Vu as fU,rn as fV,mT as fW,Wr as fX,dI as fY,eC as fZ,qC as f_,ad as fa,fI as fb,Mb as fc,pT as fd,Gu as fe,YR as ff,HE as fg,sr as fh,MB as fi,Z0 as fj,kb as fk,JM as fl,v5e as fm,Fke as fn,kM as fo,qb as fp,J4 as fq,LR as fr,RR as fs,dF as ft,mp as fu,CR as fv,wb as fw,QB as fx,vT as fy,e5e as fz,vk as g,XP as g0,ZP as g1,u4 as g2,tg as g3,Vb as g4,BR as g5,vI as g6,NB as g7,AC as g8,mc as g9,sd as ga,Dke as gb,bt as gc,aE as h,uw as i,wk as j,dw as k,iE as l,cE as m,uc as n,_k as o,lE as p,Gb as q,wI as r,zm as s,hu as t,pu as u,zC as v,jb as w,fu as x,xk as y,iu as z};