@antseed/gateway-console 0.1.6 → 0.1.8

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 (143) hide show
  1. package/dist/assets/{Activity-CoD1LZfl.js → Activity-BTHWjCfF.js} +1 -1
  2. package/dist/assets/{Audit-CNmmoaeN.js → Audit-DEeTafQK.js} +1 -1
  3. package/dist/assets/{ChainGate-CeDu6YYJ.js → ChainGate-BGzMcc9t.js} +1 -1
  4. package/dist/assets/{ChannelClose-C_SM1g28.js → ChannelClose-B6aqPNyc.js} +1 -1
  5. package/dist/assets/{Charts-Dm9j6cVy.js → Charts-BqpYsDwi.js} +1 -1
  6. package/dist/assets/{Chat-D1yVH5Y-.js → Chat-CoYr5t7Q.js} +3 -3
  7. package/dist/assets/{ConnectWallet-phY-Bf7w.js → ConnectWallet-BPEdComN.js} +1 -1
  8. package/dist/assets/{DataTable-D65CSQpj.js → DataTable-nSpXggux.js} +1 -1
  9. package/dist/assets/{Disclosure-DrGE-NkF.js → Disclosure-DaXKEWtB.js} +1 -1
  10. package/dist/assets/{KeyHolder-CmffMcZD.js → KeyHolder-DaUngSci.js} +1 -1
  11. package/dist/assets/{Keys-BovEuhch.js → Keys-BIlAH1SD.js} +1 -1
  12. package/dist/assets/{Logs-B-T-V-pM.js → Logs-D6o56kmk.js} +1 -1
  13. package/dist/assets/{Members-tWNaQdIJ.js → Members-33LlQeJ4.js} +1 -1
  14. package/dist/assets/{Migrate-IZJLx1xU.js → Migrate-LZPwWSjY.js} +1 -1
  15. package/dist/assets/Models-n5Y-SyjO.js +1 -0
  16. package/dist/assets/{OperatorActions-DfjEKPUD.js → OperatorActions-hBx0zsfp.js} +1 -1
  17. package/dist/assets/{OperatorGateAlert-Bq1ilVp6.js → OperatorGateAlert-BTIl2CQW.js} +1 -1
  18. package/dist/assets/{Overview-CAxieiTF.js → Overview-B3WLdQF3.js} +1 -1
  19. package/dist/assets/PeerPicker-BvexRNjB.js +1 -0
  20. package/dist/assets/{PolicyEditor-BLo1sheV.js → PolicyEditor-zST9UHdU.js} +1 -1
  21. package/dist/assets/{PolicyField-CNEZju4W.js → PolicyField-BL2_pz19.js} +1 -1
  22. package/dist/assets/{Presets-DBRoMTo4.js → Presets-CMVeG1hO.js} +2 -2
  23. package/dist/assets/Providers-CVteCWoy.js +1 -0
  24. package/dist/assets/RequestLog-DHFCVVlZ.js +1 -0
  25. package/dist/assets/{Rewards-CRiw-wXO.js → Rewards-D3Hh7Soh.js} +2 -2
  26. package/dist/assets/{RewardsClaim-D6P8go-K.js → RewardsClaim-D2E08Ty-.js} +1 -1
  27. package/dist/assets/{Routing-YpzgjNx_.js → Routing-DSRUEAFE.js} +1 -1
  28. package/dist/assets/{Segmented-YOSVapPh.js → Segmented-D-_FvNVa.js} +1 -1
  29. package/dist/assets/{SelectField-Cog9tKMb.js → SelectField-CL9GSHwf.js} +1 -1
  30. package/dist/assets/{Settings-CSXJvDLz.js → Settings-DvqGXXJg.js} +3 -3
  31. package/dist/assets/{Switch-CGhLd0Ay.js → Switch-C5_JEBYO.js} +1 -1
  32. package/dist/assets/{Tabs-DuL015VX.js → Tabs-iPKA2Kfx.js} +1 -1
  33. package/dist/assets/{TextAreaField-Cxpnr6YH.js → TextAreaField-BwxpmCEP.js} +1 -1
  34. package/dist/assets/{UsageByModel-5QuGhD1d.js → UsageByModel-CWVN_g_S.js} +1 -1
  35. package/dist/assets/{Wallet-BOMYI48H.js → Wallet-DUot1EZD.js} +4 -4
  36. package/dist/assets/{WalletConfirm-Dc0AMNYH.js → WalletConfirm-PHdM3GaV.js} +1 -1
  37. package/dist/assets/{WalletFunding-CsUmR_iR.js → WalletFunding-BsxwGyzf.js} +1 -1
  38. package/dist/assets/{WalletSignIn-_VjhsjCt.js → WalletSignIn-3MlBmMgW.js} +1 -1
  39. package/dist/assets/{Workspaces-Da-rLWlz.js → Workspaces-Cbcnklsg.js} +1 -1
  40. package/dist/assets/{add-Btpjkoo6.js → add-R0POQ3W1.js} +1 -1
  41. package/dist/assets/{all-wallets-BfrjmkEM.js → all-wallets-DVwWXGmT.js} +1 -1
  42. package/dist/assets/{app-store-CjAKxMNO.js → app-store-BiL_qTZd.js} +1 -1
  43. package/dist/assets/{apple-BcO7LcJZ.js → apple-_Y_Xx6lJ.js} +1 -1
  44. package/dist/assets/{arrow-bottom-DYhsTHhV.js → arrow-bottom-QxKexUBC.js} +1 -1
  45. package/dist/assets/{arrow-bottom-circle-DH3-k8Pr.js → arrow-bottom-circle-C-fUzpyi.js} +1 -1
  46. package/dist/assets/{arrow-left-i-RgLGSY.js → arrow-left-B5dxgBhW.js} +1 -1
  47. package/dist/assets/{arrow-right-Byrj5OIH.js → arrow-right-B4qewp0i.js} +1 -1
  48. package/dist/assets/{arrow-top-BvEWR8S0.js → arrow-top-BKBiVc06.js} +1 -1
  49. package/dist/assets/{bank-CqGqrPxl.js → bank-FHD-xNqV.js} +1 -1
  50. package/dist/assets/{basic-DWDkRcdy.js → basic-BccV4Pg1.js} +1 -1
  51. package/dist/assets/{browser-CQNym1bY.js → browser-CLLI-CzN.js} +1 -1
  52. package/dist/assets/{bundle-full-C55tgBr2.js → bundle-full-C_dLAJOc.js} +1 -1
  53. package/dist/assets/{card-D2zVsWGG.js → card-NLpMEn-Z.js} +1 -1
  54. package/dist/assets/{ccip-2-SkbDQO.js → ccip-CRC4f413.js} +1 -1
  55. package/dist/assets/{checkmark-FRmQx2A8.js → checkmark-ChFh19kF.js} +1 -1
  56. package/dist/assets/{checkmark-bold-BQmDzpHv.js → checkmark-bold-CJoZ_Jrk.js} +1 -1
  57. package/dist/assets/{chevron-bottom-iNshLmUE.js → chevron-bottom-yTRY8YSB.js} +1 -1
  58. package/dist/assets/{chevron-left-DZ-hTSFy.js → chevron-left-DFmsJ_8-.js} +1 -1
  59. package/dist/assets/{chevron-right-ftn9B4r7.js → chevron-right-IFdWvKJ1.js} +1 -1
  60. package/dist/assets/{chevron-top-nKnnD3BB.js → chevron-top-Boye5Dtz.js} +1 -1
  61. package/dist/assets/{chrome-store-Jvo-YJCr.js → chrome-store-D8_25Dil.js} +1 -1
  62. package/dist/assets/{clock-J68M1oCn.js → clock-D9LUFCJ6.js} +1 -1
  63. package/dist/assets/{close-Bb5jO3su.js → close-C1PmyegA.js} +1 -1
  64. package/dist/assets/{code-block-6bmX2qDf.js → code-block-oleEXE1g.js} +1 -1
  65. package/dist/assets/{coinPlaceholder-BzR2PaE2.js → coinPlaceholder-DIV2a9lC.js} +1 -1
  66. package/dist/assets/{compass-_xiCm8H2.js → compass-CHoy_ibd.js} +1 -1
  67. package/dist/assets/{copy-Cn8HQUQ0.js → copy-CHW4cQpR.js} +1 -1
  68. package/dist/assets/{core-z96MxYDt.js → core-BTKMBBlw.js} +3 -3
  69. package/dist/assets/cursor-D7dlE2wt.js +3 -0
  70. package/dist/assets/{cursor-transparent-BtLB_SMp.js → cursor-transparent-C642YpxV.js} +1 -1
  71. package/dist/assets/{desktop-BbxKfMA_.js → desktop-CFX22rtl.js} +1 -1
  72. package/dist/assets/{disconnect-BLztvIUd.js → disconnect-D3FRtzUF.js} +1 -1
  73. package/dist/assets/{discord-CHUWozPc.js → discord-DVAbkC-9.js} +1 -1
  74. package/dist/assets/{en_US-Y4ZOVFV4-CAcvlKBB.js → en_US-Y4ZOVFV4-CkCCvmU2.js} +4 -4
  75. package/dist/assets/{etherscan-D5vLd5La.js → etherscan-CbJMIgqi.js} +1 -1
  76. package/dist/assets/{exclamation-triangle-qrQeSTv8.js → exclamation-triangle-Co4Jh1eh.js} +1 -1
  77. package/dist/assets/{extension-4gVUPN7H.js → extension-BDLbDfWs.js} +1 -1
  78. package/dist/assets/{external-link-B14WJWrF.js → external-link-zdLNy8XP.js} +1 -1
  79. package/dist/assets/{facebook-CIMBt82S.js → facebook-JC7OgGSS.js} +1 -1
  80. package/dist/assets/{farcaster-c2htRu7g.js → farcaster-Clihjnkd.js} +1 -1
  81. package/dist/assets/{filters-Bv71E2AR.js → filters-CUYKBCRj.js} +1 -1
  82. package/dist/assets/{github-UYR2U4eW.js → github-D6Beytth.js} +1 -1
  83. package/dist/assets/{google-n2NyY3Dw.js → google-BwFZTm-H.js} +1 -1
  84. package/dist/assets/{help-circle-BLFRE_d4.js → help-circle-bA9CuhxX.js} +1 -1
  85. package/dist/assets/{highlighted-body-KQOG7T2V-BPvcfizq.js → highlighted-body-KQOG7T2V-BhiY5JgE.js} +1 -1
  86. package/dist/assets/{id-Bx-RYygz.js → id-B1fJDhOC.js} +1 -1
  87. package/dist/assets/{image-BOkMzreg.js → image-Bs0ponob.js} +1 -1
  88. package/dist/assets/{index-DzFVk9QK.js → index-7LAxO3mh.js} +1 -1
  89. package/dist/assets/{index-BG30WuBG.js → index-CL8Uzy58.js} +5 -5
  90. package/dist/assets/{index-FSpcDkTF.js → index-DBg2OUwU.js} +3 -3
  91. package/dist/assets/{index-DUGIknuZ.js → index-DZnhs53K.js} +1 -1
  92. package/dist/assets/{index-RORHmLec.js → index-DeMxDxlw.js} +1 -1
  93. package/dist/assets/{index.es-CA2ape1X.js → index.es-BMcYAA4u.js} +4 -4
  94. package/dist/assets/{info-Cn0tJEtZ.js → info-Crty5prY.js} +1 -1
  95. package/dist/assets/{info-circle-Bu4Zfbo-.js → info-circle-bDiLcX0l.js} +1 -1
  96. package/dist/assets/{lightbulb-CEuGFxl3.js → lightbulb-wiOiTKWo.js} +1 -1
  97. package/dist/assets/{limits-Cv54gck6.js → limits-CLb8Vgob.js} +1 -1
  98. package/dist/assets/{mail-DTJ1wl6n.js → mail-Bpk1E7XK.js} +1 -1
  99. package/dist/assets/{mermaid-MCJ5UELQ-BedJEojm.js → mermaid-MCJ5UELQ-BGV7b3EX.js} +3 -3
  100. package/dist/assets/{metamask-sdk-CQV3kKmz.js → metamask-sdk-C52uEAVB.js} +1 -1
  101. package/dist/assets/{mobile-D5XkpStI.js → mobile-emFaTh5J.js} +1 -1
  102. package/dist/assets/models-BSFEBc_r.js +1 -0
  103. package/dist/assets/{more-DdrXAXX1.js → more-zpBj89SK.js} +1 -1
  104. package/dist/assets/{network-placeholder-DYxULQKf.js → network-placeholder-Ck50Grfu.js} +1 -1
  105. package/dist/assets/{nftPlaceholder-DNCBtU2V.js → nftPlaceholder-Du211GMR.js} +1 -1
  106. package/dist/assets/{off-x6tIm6IU.js → off-_wDqmoP5.js} +1 -1
  107. package/dist/assets/{play-store-DH_0xG8x.js → play-store-CnBTcLjB.js} +1 -1
  108. package/dist/assets/{plus-D6bTrOQ5.js → plus-Cb-EWMOz.js} +1 -1
  109. package/dist/assets/{qr-code-nZ-ywovk.js → qr-code-IAHrSZeD.js} +1 -1
  110. package/dist/assets/{recycle-horizontal-Dfef9bS8.js → recycle-horizontal-Dp5-d1QB.js} +1 -1
  111. package/dist/assets/{refresh-DjaTupr6.js → refresh-D-cPnY1R.js} +1 -1
  112. package/dist/assets/{reown-logo-8xfPxyEW.js → reown-logo-h7OXEqAA.js} +1 -1
  113. package/dist/assets/{search-CTyg9yLr.js → search-3DHLTaqT.js} +1 -1
  114. package/dist/assets/{secp256k1-C3GZOk0r.js → secp256k1-D_Ekx0rf.js} +1 -1
  115. package/dist/assets/{send-BRCwXyYl.js → send-B4rs7eAg.js} +1 -1
  116. package/dist/assets/{swapHorizontal-DQysA-xv.js → swapHorizontal-CvyPi1B5.js} +1 -1
  117. package/dist/assets/{swapHorizontalBold-CfvpnhxX.js → swapHorizontalBold-08GsNiPL.js} +1 -1
  118. package/dist/assets/{swapHorizontalMedium-Ei15IdQU.js → swapHorizontalMedium-BGToxjIs.js} +1 -1
  119. package/dist/assets/{swapHorizontalRoundedBold-BrdyV7V9.js → swapHorizontalRoundedBold-Brn-wznU.js} +1 -1
  120. package/dist/assets/{swapVertical-Chu7IZEN.js → swapVertical-DrQ-Bc70.js} +1 -1
  121. package/dist/assets/{telegram-WX2YRbPh.js → telegram-NopFeNMG.js} +1 -1
  122. package/dist/assets/{three-dots-DxlCOrsx.js → three-dots-DdTyzR9Y.js} +1 -1
  123. package/dist/assets/{twitch-DnDwl6Wp.js → twitch-CgscKAJj.js} +1 -1
  124. package/dist/assets/{twitterIcon-BRzgYnIv.js → twitterIcon-Dj2w3xJD.js} +1 -1
  125. package/dist/assets/{usage-CSmvbieU.js → usage-CVWdWZuC.js} +1 -1
  126. package/dist/assets/{useInfiniteQuery-Dd787Fyg.js → useInfiniteQuery-D6hnkAjP.js} +1 -1
  127. package/dist/assets/{useTx-BMOzJPjG.js → useTx-rdzQSfyH.js} +1 -1
  128. package/dist/assets/{verify-BDEQw6N7.js → verify-DYZt4X2T.js} +1 -1
  129. package/dist/assets/{verify-filled-4pi90YF-.js → verify-filled-CsYaVqHh.js} +1 -1
  130. package/dist/assets/{w3m-modal-0lsUnIxD.js → w3m-modal-DPin_wEK.js} +1 -1
  131. package/dist/assets/{wallet-Cdj3wKM9.js → wallet-BUXq0k4x.js} +1 -1
  132. package/dist/assets/{wallet-placeholder-9WrqEYA6.js → wallet-placeholder-BDl3Cn3J.js} +1 -1
  133. package/dist/assets/{walletconnect-Dxw2wfHl.js → walletconnect-B8r28svX.js} +1 -1
  134. package/dist/assets/{warning-circle-BS-8TEUR.js → warning-circle-CyUfdBFs.js} +1 -1
  135. package/dist/assets/{x-BuEdoHYI.js → x-DO-oPY_e.js} +1 -1
  136. package/dist/index.html +1 -1
  137. package/package.json +1 -1
  138. package/dist/assets/Models-gJrRx-QV.js +0 -1
  139. package/dist/assets/PeerPicker-JK4q0ZO9.js +0 -1
  140. package/dist/assets/Providers-B3qO68z-.js +0 -1
  141. package/dist/assets/RequestLog-vl46fVIZ.js +0 -1
  142. package/dist/assets/cursor-AmgDWaYf.js +0 -3
  143. package/dist/assets/models-DMYWCgsM.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WalletSignIn-_VjhsjCt.js","assets/en_US-Y4ZOVFV4-CAcvlKBB.js","assets/clsx-B-dksMZM.js","assets/index-BwpQbdIU.js","assets/en_US-Y4ZOVFV4-CcVPgXVa.css","assets/WalletConfirm-Dc0AMNYH.js","assets/ConnectWallet-phY-Bf7w.js","assets/Overview-CAxieiTF.js","assets/UsageByModel-5QuGhD1d.js","assets/usage-CSmvbieU.js","assets/Charts-Dm9j6cVy.js","assets/Segmented-YOSVapPh.js","assets/roving-DkptacxO.js","assets/Chat-D1yVH5Y-.js","assets/Chat-Dtte195G.css","assets/Activity-CoD1LZfl.js","assets/PeerPicker-JK4q0ZO9.js","assets/SelectField-Cog9tKMb.js","assets/DataTable-D65CSQpj.js","assets/Logs-B-T-V-pM.js","assets/RequestLog-vl46fVIZ.js","assets/useInfiniteQuery-Dd787Fyg.js","assets/dates-Pi3-Ywng.js","assets/Keys-BovEuhch.js","assets/PolicyField-CNEZju4W.js","assets/PolicyEditor-BLo1sheV.js","assets/Switch-CGhLd0Ay.js","assets/Disclosure-DrGE-NkF.js","assets/Tabs-DuL015VX.js","assets/limits-Cv54gck6.js","assets/Members-tWNaQdIJ.js","assets/Workspaces-Da-rLWlz.js","assets/Wallet-BOMYI48H.js","assets/ChainGate-CeDu6YYJ.js","assets/dijkstra-COg3n3zL.js","assets/Rewards-CRiw-wXO.js","assets/ants-B38m9Phv.js","assets/Providers-B3qO68z-.js","assets/models-DMYWCgsM.js","assets/Presets-DBRoMTo4.js","assets/TextAreaField-Cxpnr6YH.js","assets/Models-gJrRx-QV.js","assets/Routing-YpzgjNx_.js","assets/Audit-CNmmoaeN.js","assets/Settings-CSXJvDLz.js","assets/KeyHolder-CmffMcZD.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WalletSignIn-3MlBmMgW.js","assets/en_US-Y4ZOVFV4-CkCCvmU2.js","assets/clsx-B-dksMZM.js","assets/index-BwpQbdIU.js","assets/en_US-Y4ZOVFV4-CcVPgXVa.css","assets/WalletConfirm-PHdM3GaV.js","assets/ConnectWallet-BPEdComN.js","assets/Overview-B3WLdQF3.js","assets/UsageByModel-CWVN_g_S.js","assets/usage-CVWdWZuC.js","assets/Charts-BqpYsDwi.js","assets/Segmented-D-_FvNVa.js","assets/roving-DkptacxO.js","assets/Chat-CoYr5t7Q.js","assets/Chat-Dtte195G.css","assets/Activity-BTHWjCfF.js","assets/PeerPicker-BvexRNjB.js","assets/SelectField-CL9GSHwf.js","assets/DataTable-nSpXggux.js","assets/Logs-D6o56kmk.js","assets/RequestLog-DHFCVVlZ.js","assets/useInfiniteQuery-D6hnkAjP.js","assets/dates-Pi3-Ywng.js","assets/Keys-BIlAH1SD.js","assets/PolicyField-BL2_pz19.js","assets/PolicyEditor-zST9UHdU.js","assets/Switch-C5_JEBYO.js","assets/Disclosure-DaXKEWtB.js","assets/Tabs-iPKA2Kfx.js","assets/limits-CLb8Vgob.js","assets/Members-33LlQeJ4.js","assets/Workspaces-Cbcnklsg.js","assets/Wallet-DUot1EZD.js","assets/ChainGate-BGzMcc9t.js","assets/dijkstra-COg3n3zL.js","assets/Rewards-D3Hh7Soh.js","assets/ants-B38m9Phv.js","assets/Providers-CVteCWoy.js","assets/models-BSFEBc_r.js","assets/Presets-CMVeG1hO.js","assets/TextAreaField-BwxpmCEP.js","assets/Models-n5Y-SyjO.js","assets/Routing-DSRUEAFE.js","assets/Audit-DEeTafQK.js","assets/Settings-DvqGXXJg.js","assets/KeyHolder-DaUngSci.js"])))=>i.map(i=>d[i]);
2
2
  var iw=Object.defineProperty;var qh=t=>{throw TypeError(t)};var ow=(t,r,i)=>r in t?iw(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var gu=(t,r,i)=>ow(t,typeof r!="symbol"?r+"":r,i),yu=(t,r,i)=>r.has(t)||qh("Cannot "+i);var S=(t,r,i)=>(yu(t,r,"read from private field"),i?i.call(t):r.get(t)),ne=(t,r,i)=>r.has(t)?qh("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,i),q=(t,r,i,a)=>(yu(t,r,"write to private field"),a?a.call(t,i):r.set(t,i),i),ue=(t,r,i)=>(yu(t,r,"access private method"),i);var Ys=(t,r,i,a)=>({set _(u){q(t,r,u,i)},get _(){return S(t,r,a)}});function sw(t,r){for(var i=0;i<r.length;i++){const a=r[i];if(typeof a!="string"&&!Array.isArray(a)){for(const u in a)if(u!=="default"&&!(u in t)){const f=Object.getOwnPropertyDescriptor(a,u);f&&Object.defineProperty(t,u,f.get?f:{enumerable:!0,get:()=>a[u]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))a(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function i(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function a(u){if(u.ep)return;u.ep=!0;const f=i(u);fetch(u.href,f)}})();const aw="modulepreload",lw=function(t){return"/console/"+t},Kh={},Ue=function(r,i,a){let u=Promise.resolve();if(i&&i.length>0){let m=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const v=document.querySelector("meta[property=csp-nonce]"),g=(v==null?void 0:v.nonce)||(v==null?void 0:v.getAttribute("nonce"));u=m(i.map(h=>{if(h=lw(h),h in Kh)return;Kh[h]=!0;const y=h.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${x}`))return;const C=document.createElement("link");if(C.rel=y?"stylesheet":aw,y||(C.as="script"),C.crossOrigin="",C.href=h,g&&C.setAttribute("nonce",g),document.head.appendChild(C),y)return new Promise((N,A)=>{C.addEventListener("load",N),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function f(m){const v=new Event("vite:preloadError",{cancelable:!0});if(v.payload=m,window.dispatchEvent(v),!v.defaultPrevented)throw m}return u.then(m=>{for(const v of m||[])v.status==="rejected"&&f(v.reason);return r().catch(f)})};var dk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function fk(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var r=t.default;if(typeof r=="function"){var i=function a(){return this instanceof a?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};i.prototype=r.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var u=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(i,a,u.get?u:{enumerable:!0,get:function(){return t[a]}})}),i}var wu={exports:{}},xo={},xu={exports:{}},he={};/**
3
3
  * @license React
4
4
  * react.production.min.js
@@ -78,14 +78,14 @@ Error generating stack: `+c.message+`
78
78
  `)},Sp=function(){var t=parseInt(document.body.getAttribute(vi)||"0",10);return isFinite(t)?t:0},O0=function(){I.useEffect(function(){return document.body.setAttribute(vi,(Sp()+1).toString()),function(){var t=Sp()-1;t<=0?document.body.removeAttribute(vi):document.body.setAttribute(vi,t.toString())}},[])},A0=function(t){var r=t.noRelative,i=t.noImportant,a=t.gapMode,u=a===void 0?"margin":a;O0();var f=I.useMemo(function(){return I0(u)},[u]);return I.createElement(M0,{styles:L0(f,!r,u,i?"":"!important")})},nc=!1;if(typeof window<"u")try{var Js=Object.defineProperty({},"passive",{get:function(){return nc=!0,!0}});window.addEventListener("test",Js,Js),window.removeEventListener("test",Js,Js)}catch{nc=!1}var li=nc?{passive:!1}:!1,D0=function(t){return t.tagName==="TEXTAREA"},nv=function(t,r){if(!(t instanceof Element))return!1;var i=window.getComputedStyle(t);return i[r]!=="hidden"&&!(i.overflowY===i.overflowX&&!D0(t)&&i[r]==="visible")},F0=function(t){return nv(t,"overflowY")},$0=function(t){return nv(t,"overflowX")},kp=function(t,r){var i=r.ownerDocument,a=r;do{typeof ShadowRoot<"u"&&a instanceof ShadowRoot&&(a=a.host);var u=rv(t,a);if(u){var f=iv(t,a),m=f[1],v=f[2];if(m>v)return!0}a=a.parentNode}while(a&&a!==i.body);return!1},z0=function(t){var r=t.scrollTop,i=t.scrollHeight,a=t.clientHeight;return[r,i,a]},U0=function(t){var r=t.scrollLeft,i=t.scrollWidth,a=t.clientWidth;return[r,i,a]},rv=function(t,r){return t==="v"?F0(r):$0(r)},iv=function(t,r){return t==="v"?z0(r):U0(r)},B0=function(t,r){return t==="h"&&r==="rtl"?-1:1},H0=function(t,r,i,a,u){var f=B0(t,window.getComputedStyle(r).direction),m=f*a,v=i.target,g=r.contains(v),h=!1,y=m>0,x=0,C=0;do{if(!v)break;var N=iv(t,v),A=N[0],E=N[1],M=N[2],L=E-M-f*A;(A||L)&&rv(t,v)&&(x+=L,C+=A);var F=v.parentNode;v=F&&F.nodeType===Node.DOCUMENT_FRAGMENT_NODE?F.host:F}while(!g&&v!==document.body||g&&(r.contains(v)||r===v));return(y&&Math.abs(x)<1||!y&&Math.abs(C)<1)&&(h=!0),h},ea=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},Cp=function(t){return[t.deltaX,t.deltaY]},_p=function(t){return t&&"current"in t?t.current:t},W0=function(t,r){return t[0]===r[0]&&t[1]===r[1]},V0=function(t){return`
79
79
  .block-interactivity-`.concat(t,` {pointer-events: none;}
80
80
  .allow-interactivity-`).concat(t,` {pointer-events: all;}
81
- `)},q0=0,ui=[];function K0(t){var r=I.useRef([]),i=I.useRef([0,0]),a=I.useRef(),u=I.useState(q0++)[0],f=I.useState(tv)[0],m=I.useRef(t);I.useEffect(function(){m.current=t},[t]),I.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(u));var E=f1([t.lockRef.current],(t.shards||[]).map(_p),!0).filter(Boolean);return E.forEach(function(M){return M.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),E.forEach(function(M){return M.classList.remove("allow-interactivity-".concat(u))})}}},[t.inert,t.lockRef.current,t.shards]);var v=I.useCallback(function(E,M){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!m.current.allowPinchZoom;var L=ea(E),F=i.current,P="deltaX"in E?E.deltaX:F[0]-L[0],j="deltaY"in E?E.deltaY:F[1]-L[1],D,W=E.target,te=Math.abs(P)>Math.abs(j)?"h":"v";if("touches"in E&&te==="h"&&W.type==="range")return!1;var Z=window.getSelection(),se=Z&&Z.anchorNode,ce=se?se===W||se.contains(W):!1;if(ce)return!1;var X=kp(te,W);if(!X)return!0;if(X?D=te:(D=te==="v"?"h":"v",X=kp(te,W)),!X)return!1;if(!a.current&&"changedTouches"in E&&(P||j)&&(a.current=D),!D)return!0;var Te=a.current||D;return H0(Te,M,E,Te==="h"?P:j)},[]),g=I.useCallback(function(E){var M=E;if(!(!ui.length||ui[ui.length-1]!==f)){var L="deltaY"in M?Cp(M):ea(M),F=r.current.filter(function(D){return D.name===M.type&&(D.target===M.target||M.target===D.shadowParent)&&W0(D.delta,L)})[0];if(F&&F.should){M.cancelable&&M.preventDefault();return}if(!F){var P=(m.current.shards||[]).map(_p).filter(Boolean).filter(function(D){return D.contains(M.target)}),j=P.length>0?v(M,P[0]):!m.current.noIsolation;j&&M.cancelable&&M.preventDefault()}}},[]),h=I.useCallback(function(E,M,L,F){var P={name:E,delta:M,target:L,should:F,shadowParent:Q0(L)};r.current.push(P),setTimeout(function(){r.current=r.current.filter(function(j){return j!==P})},1)},[]),y=I.useCallback(function(E){i.current=ea(E),a.current=void 0},[]),x=I.useCallback(function(E){h(E.type,Cp(E),E.target,v(E,t.lockRef.current))},[]),C=I.useCallback(function(E){h(E.type,ea(E),E.target,v(E,t.lockRef.current))},[]);I.useEffect(function(){return ui.push(f),t.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:C}),document.addEventListener("wheel",g,li),document.addEventListener("touchmove",g,li),document.addEventListener("touchstart",y,li),function(){ui=ui.filter(function(E){return E!==f}),document.removeEventListener("wheel",g,li),document.removeEventListener("touchmove",g,li),document.removeEventListener("touchstart",y,li)}},[]);var N=t.removeScrollBar,A=t.inert;return I.createElement(I.Fragment,null,A?I.createElement(f,{styles:V0(u)}):null,N?I.createElement(A0,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Q0(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const G0=h1(ev,K0);var Ac=I.forwardRef(function(t,r){return I.createElement(xa,rn({},t,{ref:r,sideCar:G0}))});Ac.classNames=xa.classNames;var ov=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},ci=new WeakMap,ta=new WeakMap,na={},Nu=0,sv=function(t){return t&&(t.host||sv(t.parentNode))},Y0=function(t,r){return r.map(function(i){if(t.contains(i))return i;var a=sv(i);return a&&t.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",t,". Doing nothing"),null)}).filter(function(i){return!!i})},av=function(t,r,i,a){var u=Y0(r,Array.isArray(t)?t:[t]);na[i]||(na[i]=new WeakMap);var f=na[i],m=[],v=new Set,g=new Set(u),h=function(x){!x||v.has(x)||(v.add(x),h(x.parentNode))};u.forEach(h);var y=function(x){!x||g.has(x)||Array.prototype.forEach.call(x.children,function(C){if(v.has(C))y(C);else try{var N=C.getAttribute(a),A=N!==null&&N!=="false",E=(ci.get(C)||0)+1,M=(f.get(C)||0)+1;ci.set(C,E),f.set(C,M),m.push(C),E===1&&A&&ta.set(C,!0),M===1&&C.setAttribute(i,"true"),A||C.setAttribute(a,"true")}catch(L){console.error("aria-hidden: cannot operate on ",C,L)}})};return y(r),v.clear(),Nu++,function(){m.forEach(function(x){var C=ci.get(x)-1,N=f.get(x)-1;ci.set(x,C),f.set(x,N),C||(ta.has(x)||x.removeAttribute(a),ta.delete(x)),N||x.removeAttribute(i)}),Nu--,Nu||(ci=new WeakMap,ci=new WeakMap,ta=new WeakMap,na={})}},Z0=function(t,r,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),u=r||ov(t);return u?(a.push.apply(a,Array.from(u.querySelectorAll("[aria-live], script"))),av(a,u,i,"aria-hidden")):function(){return null}},X0=function(t,r,i){i===void 0&&(i="data-inert-ed");var a=r||ov(t);return a?av(t,a,i,"inert"):function(){return null}},J0=function(){return typeof HTMLElement<"u"&&HTMLElement.prototype.hasOwnProperty("inert")},e2=function(t,r,i){return i===void 0&&(i="data-suppressed"),(J0()?X0:Z0)(t,r,i)};let Rr=[];const rc=new Set;function lv(){rc.forEach(t=>t())}function t2(t){Rr=Rr.filter(r=>r!==t),Rr.push(t),lv()}function n2(t){Rr=Rr.filter(r=>r!==t),lv()}function Iu(t){return Rr[Rr.length-1]===t}function uv(t,r,i){const a=I.useRef(i),u=I.useRef(null),[f,m]=I.useState(!1);I.useEffect(()=>{a.current=i},[i]);const v=I.useCallback(()=>{const h=u.current;u.current=null,h&&document.contains(h)&&h.focus({preventScroll:!0})},[]),g=I.useCallback(()=>{a.current()},[]);return I.useEffect(()=>{if(!t)return;const h=r.current;if(!h)return;const y=h;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null,t2(y),m(Iu(y));function x(){m(Iu(y))}function C(N){if(!Iu(y))return;const A=N.target instanceof Element?N.target:null,E=A==null?void 0:A.closest('[role="dialog"]');E&&E!==y&&!y.contains(E)||N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),N.stopImmediatePropagation(),g())}return rc.add(x),window.addEventListener("keydown",C,!0),()=>{window.removeEventListener("keydown",C,!0),rc.delete(x),n2(y),v()}},[g,t,r,v]),I.useEffect(()=>{var x,C;if(!t||!f)return;const h=r.current;if(!h)return;const y=((C=(x=h.parentElement)==null?void 0:x.parentElement)==null?void 0:C.querySelectorAll("[data-focus-guard]"))??[];return e2([h,...y])},[t,f,r]),{closeDialog:g,isTopDialog:f}}const r2={sm:"24rem",md:"28.75rem",lg:"35rem",xl:"52rem"};function i2(){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function cv({bodyClassName:t,children:r,className:i,closeLabel:a="Close",eyebrow:u,footer:f,isOpen:m,onClose:v,overlayClassName:g,size:h="md",subtitle:y,title:x}){const C=I.useRef(null),N=I.useId(),A=I.useId(),{closeDialog:E,isTopDialog:M}=uv(m,C,v);if(!m)return null;const L=["as-modal-overlay",g].filter(Boolean).join(" "),F=["as-modal",`as-modal--${h}`,i].filter(Boolean).join(" "),P=["as-modal__body",t].filter(Boolean).join(" "),j={"--as-modal-width":r2[h]};return d.jsx("div",{className:L,role:"presentation",onMouseDown:E,children:d.jsx(Ac,{allowPinchZoom:!0,className:"as-modal__scroll-lock",enabled:M,style:j,children:d.jsx(Oc,{autoFocus:!0,className:"as-modal__focus-lock",disabled:!M,focusOptions:{preventScroll:!0},returnFocus:!1,children:d.jsxs("div",{"aria-describedby":y?A:void 0,"aria-hidden":M?void 0:!0,"aria-labelledby":N,"aria-modal":M?"true":void 0,className:F,ref:C,role:"dialog",tabIndex:-1,onMouseDown:D=>D.stopPropagation(),children:[d.jsxs("header",{className:"as-modal__header",children:[d.jsxs("div",{className:"as-modal__titles",children:[u&&d.jsx("div",{className:"as-modal__eyebrow",children:u}),d.jsx("h2",{className:"as-modal__title",id:N,children:x}),y&&d.jsx("p",{className:"as-modal__subtitle",id:A,children:y})]}),d.jsx(o2,{label:a,className:"as-modal__close",onClick:E,children:d.jsx(i2,{})})]}),d.jsx("div",{className:P,children:r}),f&&d.jsx("footer",{className:"as-modal__footer",children:f})]})})})})}function o2({children:t,className:r,label:i,onClick:a}){return d.jsx("button",{type:"button",className:r,onClick:a,"aria-label":i,children:t})}function s2(t){return t instanceof Error?t.message:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:"Something went wrong."}function a2({isOpen:t,title:r,body:i,confirmLabel:a="Confirm",cancelLabel:u="Cancel",busyLabel:f="Working…",tone:m="danger",busy:v,error:g,errorTitle:h="That did not work",confirmDisabled:y,onConfirm:x,onClose:C}){return d.jsx(cv,{isOpen:t,onClose:v?()=>{}:C,title:r,size:"sm",children:d.jsxs("div",{className:"as-confirm",children:[d.jsx("div",{className:"as-confirm__body",children:i}),g?d.jsx(lt,{tone:"danger",title:h,children:s2(g)}):null,d.jsxs("div",{className:"as-confirm__actions",children:[d.jsx(Le,{variant:"ghost",onClick:C,disabled:v,children:u}),d.jsx(Le,{variant:m,onClick:x,disabled:v||y,children:v?f:a})]})]})})}function $o({children:t,className:r,label:i,size:a="md",type:u="button",...f}){const m=["as-icon-button",a==="sm"?"as-icon-button--sm":null,r].filter(Boolean).join(" ");return d.jsx("button",{type:u,className:m,"aria-label":i,title:f.title??i,...f,children:t})}async function dv(t){try{return await navigator.clipboard.writeText(t),!0}catch{return!1}}function Ep(){return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"2"}),d.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]})}function Pp(){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"m5 12 5 5L20 7"})})}function Dc({value:t,label:r="Copy",copiedLabel:i="Copied",size:a="sm",variant:u="outline",className:f,iconOnly:m,onCopied:v}){const[g,h]=I.useState(!1),y=I.useRef(void 0);I.useEffect(()=>()=>window.clearTimeout(y.current),[]);const x=async()=>{await dv(t)&&(h(!0),v==null||v(),window.clearTimeout(y.current),y.current=window.setTimeout(()=>h(!1),1500))};return m?d.jsx($o,{label:g?i:r,size:"sm",className:f,onClick:()=>void x(),children:g?d.jsx(Pp,{}):d.jsx(Ep,{})}):d.jsx(Le,{variant:u,size:a,className:f,leadingIcon:g?d.jsx(Pp,{}):d.jsx(Ep,{}),"aria-live":"polite",onClick:()=>void x(),children:g?i:r})}function l2(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function u2({backdropClassName:t,bodyClassName:r,children:i,className:a,closeLabel:u="Close",eyebrow:f,isOpen:m,onClose:v,side:g="right",subtitle:h,title:y}){const x=I.useRef(null),C=I.useId(),N=I.useId(),{closeDialog:A,isTopDialog:E}=uv(m,x,v),M=m&&E,L=["as-drawer-backdrop",m?"as-drawer-backdrop--open":null,t].filter(Boolean).join(" "),F=["as-drawer",`as-drawer--${g}`,m?"as-drawer--open":null,a].filter(Boolean).join(" "),P=["as-drawer__body",r].filter(Boolean).join(" ");return I.useEffect(()=>{if(!m||!E)return;function j(D){const W=x.current;W&&(D.target instanceof Node&&W.contains(D.target)||D.target instanceof Element&&D.target.closest('[role="dialog"], [role="menu"]')!==null||A())}return document.addEventListener("pointerdown",j,!0),()=>document.removeEventListener("pointerdown",j,!0)},[A,m,E]),d.jsxs(d.Fragment,{children:[d.jsx("div",{"aria-hidden":!m,className:L,onClick:A}),d.jsx(Ac,{allowPinchZoom:!0,className:"as-drawer__scroll-lock",enabled:m&&E,children:d.jsx(Oc,{autoFocus:!0,className:"as-drawer__focus-lock",disabled:!m||!E,focusOptions:{preventScroll:!0},returnFocus:!1,children:d.jsxs("aside",{"aria-describedby":h?N:void 0,"aria-hidden":M?void 0:!0,"aria-labelledby":C,"aria-modal":M?"true":void 0,className:F,ref:x,role:"dialog",tabIndex:-1,children:[d.jsxs("header",{className:"as-drawer__header",children:[d.jsxs("div",{className:"as-drawer__titles",children:[f&&d.jsx("div",{className:"as-drawer__eyebrow",children:f}),d.jsx("h2",{className:"as-drawer__title",id:C,children:y}),h&&d.jsx("p",{className:"as-drawer__subtitle",id:N,children:h})]}),d.jsx("button",{type:"button",className:"as-drawer__close",onClick:A,"aria-label":u,children:d.jsx(l2,{})})]}),d.jsx("div",{className:P,children:i})]})})})]})}const c2=["M42.4461 10.2767H39.6752L35.9506 25.7053H38.2537L39.0994 21.902H43.0219L43.8495 25.7053H46.1346L42.4821 10.4203L42.4461 10.2767ZM42.59 19.9286H39.5132L41.0426 12.7525L42.59 19.9286Z","M53.9616 22.494L50.8668 10.2767H47.4841V25.7053H49.5893V13.506L52.6301 25.5618L52.6661 25.7053H56.0667V10.2767H53.9616V22.494Z","M57.7221 12.2681H61.1588V25.7053H63.3899V12.2681H66.8265V10.2767H57.7221V12.2681Z","M72.0265 16.7173H71.3788C70.9649 16.7173 70.6411 16.5917 70.3892 16.3226C70.1373 16.0535 70.0113 15.7485 70.0113 15.3359V13.7033C70.0113 13.3086 70.1552 12.9678 70.4611 12.6987C70.767 12.4116 71.1449 12.2681 71.6307 12.2681H75.1213V10.2767H71.8466C70.5511 10.2767 69.5435 10.5997 68.8418 11.2455C68.14 11.8914 67.7802 12.8601 67.7802 14.116V14.9412C67.7802 16.1791 68.104 17.1299 68.7518 17.7937C69.3995 18.4575 70.2992 18.7804 71.4148 18.7804H72.0625C72.4583 18.7804 72.7462 18.888 72.9262 19.1213C73.1241 19.3545 73.214 19.6595 73.214 20.0542V22.2967C73.214 22.6914 73.0701 23.0322 72.7642 23.3013C72.4583 23.5884 72.0805 23.7319 71.5947 23.7319H68.14V25.7233H71.3788C72.6743 25.7233 73.6819 25.4003 74.3836 24.7545C75.0853 24.1086 75.4452 23.1399 75.4452 21.8841V20.4668C75.4452 19.2289 75.1393 18.296 74.5455 17.6681C73.9518 17.0402 73.0881 16.7352 72.0265 16.7352V16.7173Z","M77.0825 25.7053H84.6576V23.7857H79.3317V18.7086H84.1178V16.7711H79.3317V12.2143H84.6576V10.2767H77.0825V25.7053Z","M86.3129 25.7053H93.888V23.7857H88.544V18.7086H93.3482V16.7711H88.544V12.2143H93.888V10.2767H86.3129V25.7053Z","M102.938 11.102C102.255 10.5459 101.211 10.2767 99.8976 10.2767H95.5253V25.7053H100.149C101.499 25.7053 102.489 25.4362 103.082 24.8801C103.694 24.3239 104 23.409 104 22.1173V13.811C104 12.5731 103.64 11.6581 102.938 11.102ZM100.347 23.7319H97.7564V12.2502H100.365C100.797 12.2502 101.121 12.3758 101.391 12.6269C101.643 12.8781 101.769 13.201 101.769 13.6316V22.3505C101.769 22.8349 101.661 23.1937 101.427 23.409C101.211 23.6243 100.833 23.7319 100.347 23.7319Z"],fv=["M12.5827 3.84445C13.2032 3.84445 13.7062 3.34146 13.7062 2.72099C13.7062 2.10052 13.2032 1.59753 12.5827 1.59753C11.9623 1.59753 11.4593 2.10052 11.4593 2.72099C11.4593 3.34146 11.9623 3.84445 12.5827 3.84445Z","M23.3679 3.84445C23.9884 3.84445 24.4914 3.34146 24.4914 2.72099C24.4914 2.10052 23.9884 1.59753 23.3679 1.59753C22.7474 1.59753 22.2445 2.10052 22.2445 2.72099C22.2445 3.34146 22.7474 3.84445 23.3679 3.84445Z","M8.0889 11.0346C8.70936 11.0346 9.21235 10.5316 9.21235 9.91112C9.21235 9.29065 8.70936 8.78766 8.0889 8.78766C7.46843 8.78766 6.96544 9.29065 6.96544 9.91112C6.96544 10.5316 7.46843 11.0346 8.0889 11.0346Z","M27.8617 11.0346C28.4822 11.0346 28.9852 10.5316 28.9852 9.91112C28.9852 9.29065 28.4822 8.78766 27.8617 8.78766C27.2413 8.78766 26.7383 9.29065 26.7383 9.91112C26.7383 10.5316 27.2413 11.0346 27.8617 11.0346Z","M6.29136 19.1235C6.91183 19.1235 7.41482 18.6205 7.41482 18C7.41482 17.3795 6.91183 16.8766 6.29136 16.8766C5.6709 16.8766 5.16791 17.3795 5.16791 18C5.16791 18.6205 5.6709 19.1235 6.29136 19.1235Z","M29.6593 19.1235C30.2797 19.1235 30.7827 18.6205 30.7827 18C30.7827 17.3795 30.2797 16.8766 29.6593 16.8766C29.0388 16.8766 28.5358 17.3795 28.5358 18C28.5358 18.6205 29.0388 19.1235 29.6593 19.1235Z","M7.19014 28.1111C7.81061 28.1111 8.31359 27.6081 8.31359 26.9877C8.31359 26.3672 7.81061 25.8642 7.19014 25.8642C6.56967 25.8642 6.06668 26.3672 6.06668 26.9877C6.06668 27.6081 6.56967 28.1111 7.19014 28.1111Z","M28.7605 28.1111C29.381 28.1111 29.884 27.6081 29.884 26.9877C29.884 26.3672 29.381 25.8642 28.7605 25.8642C28.14 25.8642 27.6371 26.3672 27.6371 26.9877C27.6371 27.6081 28.14 28.1111 28.7605 28.1111Z","M17.9753 12.3827C19.2163 12.3827 20.2222 11.2762 20.2222 9.91112C20.2222 8.54609 19.2163 7.43951 17.9753 7.43951C16.7344 7.43951 15.7284 8.54609 15.7284 9.91112C15.7284 11.2762 16.7344 12.3827 17.9753 12.3827Z","M17.9753 19.7975C19.7126 19.7975 21.121 18.188 21.121 16.2025C21.121 14.217 19.7126 12.6074 17.9753 12.6074C16.238 12.6074 14.8296 14.217 14.8296 16.2025C14.8296 18.188 16.238 19.7975 17.9753 19.7975Z","M17.9753 30.1333C20.209 30.1333 22.0198 27.719 22.0198 24.7408C22.0198 21.7625 20.209 19.3482 17.9753 19.3482C15.7416 19.3482 13.9309 21.7625 13.9309 24.7408C13.9309 27.719 15.7416 30.1333 17.9753 30.1333Z","M12.3264 2.40809C12.4993 2.26669 12.7542 2.29198 12.8956 2.4647L16.9401 7.40792C17.0815 7.58074 17.0562 7.83563 16.8835 7.9771C16.7106 8.1185 16.4558 8.09322 16.3143 7.92049L12.2698 2.97728C12.1284 2.80446 12.1537 2.54957 12.3264 2.40809Z","M23.055 2.4647C23.1965 2.29198 23.4514 2.26669 23.6242 2.40809C23.7969 2.54957 23.8222 2.80446 23.6808 2.97728L19.6364 7.92049C19.4949 8.09322 19.24 8.1185 19.0672 7.9771C18.8945 7.83563 18.8692 7.58074 19.0106 7.40792L23.055 2.4647Z","M7.73168 9.72198C7.83619 9.52458 8.08064 9.44939 8.27805 9.5539L15.9176 13.5983C16.1149 13.7029 16.1901 13.9473 16.0856 14.1447C15.9811 14.3421 15.7367 14.4173 15.5393 14.3128L7.89976 10.2683C7.70236 10.1638 7.62717 9.91938 7.73168 9.72198Z","M27.6726 9.5539C27.87 9.44939 28.1144 9.52458 28.219 9.72198C28.3235 9.91938 28.2483 10.1638 28.0509 10.2683L20.4114 14.3128C20.214 14.4173 19.9695 14.3421 19.865 14.1447C19.7605 13.9473 19.8357 13.7029 20.0331 13.5983L27.6726 9.5539Z","M14.7875 16.6988C15.0096 16.6756 15.2087 16.8371 15.2321 17.0591C15.2553 17.2812 15.0938 17.4803 14.8718 17.5037L6.3335 18.4024C6.11145 18.4257 5.91232 18.2642 5.88895 18.0421C5.8657 17.8201 6.02718 17.621 6.24924 17.5976L14.7875 16.6988Z","M21.1631 16.6988L29.7014 17.5976C29.9235 17.621 30.085 17.8201 30.0617 18.0421C30.0383 18.2642 29.8392 18.4257 29.6171 18.4024L21.0789 17.5037C20.8568 17.4803 20.6953 17.2812 20.7186 17.0591C20.742 16.8371 20.9411 16.6756 21.1631 16.6988Z","M15.1149 23.0231C15.319 22.9324 15.5578 23.0244 15.6485 23.2285C15.7392 23.4326 15.6472 23.6714 15.4432 23.7621L7.35427 27.3572C7.15017 27.4478 6.91133 27.3559 6.82063 27.1518C6.72997 26.9477 6.82192 26.7089 7.02601 26.6182L15.1149 23.0231Z","M20.3021 23.2285C20.3928 23.0244 20.6316 22.9324 20.8357 23.0231L28.9246 26.6182C29.1287 26.7089 29.2207 26.9477 29.13 27.1518C29.0393 27.3559 28.8005 27.4478 28.5964 27.3572L20.5075 23.7621C20.3034 23.6714 20.2114 23.4326 20.3021 23.2285Z"],hv="#10B981";function d2({height:t=24,className:r}){return d.jsxs("svg",{className:r,height:t,width:t*104/36,viewBox:"0 0 104 36",fill:"none",role:"img","aria-label":"Antseed",children:[fv.map(i=>d.jsx("path",{d:i,fill:hv},i)),c2.map(i=>d.jsx("path",{d:i,fill:"currentColor"},i))]})}function f2({size:t=24,className:r}){return d.jsx("svg",{className:r,height:t,width:t,viewBox:"4 0 28 32",fill:"none",role:"img","aria-label":"Antseed",children:fv.map(i=>d.jsx("path",{d:i,fill:hv},i))})}function No({className:t,height:r,radius:i,style:a,width:u,...f}){const m=["as-skeleton",t].filter(Boolean).join(" ");return d.jsx("div",{className:m,style:{...a,...r!==void 0?{height:r}:{},...i!==void 0?{borderRadius:i}:{},...u!==void 0?{width:u}:{}},...f})}function gk({title:t,description:r,actions:i}){return d.jsxs("header",{className:"as-page-header",children:[d.jsxs("div",{className:"as-page-header__text",children:[d.jsx("h1",{children:t}),r&&d.jsx("p",{children:r})]}),i&&d.jsx("div",{className:"as-page-header__actions",children:i})]})}function yk({title:t,description:r,actions:i,children:a,flush:u,className:f}){return d.jsxs("section",{className:["as-panel",f].filter(Boolean).join(" "),children:[(t||i)&&d.jsxs("div",{className:"as-panel__head",children:[d.jsxs("div",{children:[t&&d.jsx("h2",{className:"as-panel__title",children:t}),r&&d.jsx("p",{className:"as-panel__desc",children:r})]}),i&&d.jsx("div",{className:"as-panel__actions",children:i})]}),d.jsx(Sc,{className:"as-panel__card",children:d.jsx("div",{className:u?"as-panel__body as-panel__body--flush":"as-panel__body",children:a})})]})}function h2(t){return t!==null&&t>=1?"danger":t!==null&&t>=.8?"warning":"default"}function wk({label:t,value:r,sub:i,meter:a,tone:u}){const f=a==null?null:Math.max(0,Math.min(1,a));return d.jsxs(Sc,{className:"as-stat",children:[d.jsx("div",{className:"as-stat__label",children:t}),d.jsx("div",{className:"as-stat__value",children:r}),i&&d.jsx("div",{className:"as-stat__sub",children:i}),f!==null&&d.jsx("div",{className:`as-meter as-meter--${u??h2(f)}`,role:"meter","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(f*100),children:d.jsx("span",{style:{width:`${f*100}%`}})})]})}function xk({title:t,body:r,action:i,icon:a}){return d.jsxs("div",{className:"as-empty",children:[a&&d.jsx("div",{className:"as-empty__icon","aria-hidden":"true",children:a}),d.jsx("div",{className:"as-empty__title",children:t}),r&&d.jsx("div",{className:"as-empty__body",children:r}),i&&d.jsx("div",{className:"as-empty__action",children:i})]})}function Ni({rows:t=4,height:r=28}){return d.jsx("div",{className:"as-loading","aria-busy":"true","aria-label":"Loading",children:Array.from({length:t},(i,a)=>d.jsx(No,{height:r},a))})}function Sk({items:t}){return d.jsx("dl",{className:"as-details",children:t.map(([r,i],a)=>d.jsxs("div",{className:"as-details__row",children:[d.jsx("dt",{children:r}),d.jsx("dd",{children:i})]},a))})}function kk({code:t,label:r}){return d.jsxs("div",{className:"as-code",children:[d.jsxs("div",{className:"as-code__bar",children:[d.jsx("span",{className:"as-code__label",children:r}),d.jsx(Dc,{value:t})]}),d.jsx("pre",{children:d.jsx("code",{children:t})})]})}function Ck({secret:t,note:r="Copy it now. It will not be shown again."}){return d.jsxs("div",{className:"as-secret",children:[d.jsxs("div",{className:"as-secret__row",children:[d.jsx("code",{className:"as-secret__value",children:t}),d.jsx(Dc,{value:t})]}),d.jsx("p",{className:"as-secret__note",children:r})]})}function p2(t,r){return["as-field",r==="sm"?"as-field--sm":null,t].filter(Boolean).join(" ")}function m2(t,r){return["as-field__input",t,r?"as-field__input--mono":null].filter(Boolean).join(" ")}function v2({error:t,hint:r}){return t?d.jsx("span",{className:"as-field__error",children:t}):r?d.jsx("span",{className:"as-field__hint",children:r}):null}function g2({className:t,error:r,hint:i,id:a,label:u,size:f,mono:m,...v}){const g=I.useId(),h=a??v.name??g;return d.jsxs("label",{className:p2(t,f),htmlFor:h,children:[u&&d.jsx("span",{className:"as-field__label",children:u}),d.jsx("input",{id:h,className:m2(void 0,m),"aria-invalid":r?!0:void 0,...v}),d.jsx(v2,{error:r,hint:i})]})}const pv=I.createContext(()=>{});function mv(){return I.useContext(pv)}let y2=1;function w2({children:t}){const[r,i]=I.useState([]),a=I.useCallback((u,f="success")=>{const m=y2++;i(v=>[...v.slice(-3),{id:m,tone:f,text:u}]),window.setTimeout(()=>i(v=>v.filter(g=>g.id!==m)),4e3)},[]);return d.jsxs(pv.Provider,{value:a,children:[t,d.jsx("div",{className:"as-toasts",role:"status","aria-live":"polite",children:r.map(u=>d.jsx("div",{className:`as-toast as-toast--${u.tone}`,children:u.text},u.id))})]})}const x2="/console/api",S2="x-antseed-console";class Sa extends Error{constructor(i,a,u,f={}){super(u);gu(this,"details");this.status=i,this.code=a,this.name="ConsoleApiError",this.details=f}}function Lr(t,r){return t instanceof Sa&&(r===void 0||t.code===r)}const bp={buyer_policy_unsupported:"The buyer behind this gateway cannot apply routing policies yet. Update Antseed on the buyer host and restart it.",restart_unsupported:"The buyer cannot restart itself here. The change is saved; restart the buyer yourself to apply it.",reauth_required:"For this action, sign in again first.",config_unreadable:"The gateway could not read the buyer configuration file, so nothing was changed. Check the file on the gateway host.",operator_not_yours:"That wallet is not one of your sign-in methods. Add it as a sign-in method first, then authorize it.",reauth_wrong_member:"That passkey or wallet belongs to someone else. Confirm with one of your own sign-in methods.",reauth_unavailable:"You are signed in through Cloudflare Access, which cannot confirm this action. Sign in with a passkey or wallet instead (add one under Your sign-in methods first if you have none), then retry.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then retry.",reauth_other_credential:"Confirm with a different passkey or wallet than the one you are making the operator, then retry.",session_required:"Only an organization admin signed in to the console can change the export endpoint or content logging. Management tokens cannot.",otlp_headers_required:"You changed the endpoint, so the saved header values are not sent to it. Enter the header values again.",empty_allow_list:"This allow list is empty, so no seller could serve. Confirm to save it anyway.",last_credential:"You cannot remove your only sign-in method, or you could not sign in again. Add another passkey or wallet first.",credential_exists:"This passkey or wallet is already registered.",max_keys_reached:"You already have as many keys as you are allowed. Revoke one, or ask an admin to raise your limit."};function ka(t){return t instanceof Sa&&Object.hasOwn(bp,t.code)?bp[t.code]:t instanceof Error?t.message:typeof t=="string"?t:"Something went wrong."}function yr(t,r){return{...t,...r!=null&&r.confirmEmpty?{confirmEmpty:!0}:{},...r!=null&&r.acceptNarrowed?{acceptNarrowed:!0}:{}}}function ra(t){if(!t)return"";const r=new URLSearchParams;for(const[a,u]of Object.entries(t))u==null||u===""||r.set(a,String(u));const i=r.toString();return i?`?${i}`:""}async function k2(t){let r=`http_${t.status}`,i=t.statusText||`Request failed (${t.status})`,a={};try{const u=await t.json();u!=null&&u.error&&typeof u.error.code=="string"&&(r=u.error.code),u!=null&&u.error&&typeof u.error.message=="string"&&(i=u.error.message),u&&typeof u=="object"&&(a={...u.error,...u})}catch{}return new Sa(t.status,r,i,a)}function C2(t=(i,a)=>fetch(i,a),r=x2){async function i(h,y,x={}){const C={accept:"application/json"};h!=="GET"&&h!=="HEAD"&&(C[S2]="1");let A;x.body!==void 0&&(C["content-type"]="application/json",A=JSON.stringify(x.body));let E;try{E=await t(`${r}${y}${ra(x.query)}`,{method:h,headers:C,body:A,credentials:"same-origin"})}catch{throw new Sa(0,"network_error","Could not reach the gateway.")}if(!E.ok)throw await k2(E);return E.status===204?void 0:(E.headers.get("content-type")??"").includes("json")?await E.json():await E.text()}const a=(h,y)=>i("GET",h,{query:y}),u=(h,y)=>i("POST",h,{body:y??{}}),f=(h,y)=>i("PATCH",h,{body:y}),m=(h,y)=>i("PUT",h,{body:y}),v=h=>i("DELETE",h),g=encodeURIComponent;return{request:i,auth:{config:()=>a("/auth/config"),me:()=>a("/auth/me"),setup:h=>u("/auth/setup",{token:h}),invite:h=>u("/auth/invite",{token:h}),passkeyRegisterOptions:h=>u("/auth/passkey/register/options",{enrollment:h}),passkeyRegisterVerify:(h,y)=>u("/auth/passkey/register/verify",{enrollment:y,response:h}),passkeyLoginOptions:()=>u("/auth/passkey/login/options",{}),passkeyLoginVerify:h=>u("/auth/passkey/login/verify",{response:h}),walletNonce:h=>u("/auth/wallet/nonce",{address:h}),walletVerify:(h,y,x)=>u("/auth/wallet/verify",{message:h,signature:y,enrollment:x}),oidcStartUrl:h=>`${r}/auth/oidc/start${ra({enrollment:h})}`,oidcLinkUrl:()=>`${r}/auth/oidc/start?link=1`,reauthPasskeyOptions:()=>u("/auth/reauth/passkey/options",{}),reauthPasskeyVerify:h=>u("/auth/reauth/passkey/verify",{response:h}),reauthWalletNonce:h=>u("/auth/reauth/wallet/nonce",{address:h}),reauthWalletVerify:(h,y)=>u("/auth/reauth/wallet/verify",{message:h,signature:y}),apiKey:h=>u("/auth/api-key",{key:h}),logout:()=>u("/auth/logout")},members:{list:()=>a("/members"),update:(h,y,x)=>f(`/members/${g(h)}`,yr(y,x)),disable:h=>u(`/members/${g(h)}/disable`),enable:h=>u(`/members/${g(h)}/enable`),removeCredential:(h,y)=>v(`/members/${g(h)}/credentials/${g(y)}`)},invites:{list:()=>a("/invites"),create:h=>u("/invites",h),revoke:h=>v(`/invites/${g(h)}`)},workspaces:{list:()=>a("/workspaces"),get:h=>a(`/workspaces/${g(h)}`),create:(h,y)=>u("/workspaces",yr(h,y)),update:(h,y,x)=>f(`/workspaces/${g(h)}`,yr(y,x)),remove:h=>v(`/workspaces/${g(h)}`),members:h=>a(`/workspaces/${g(h)}/members`),setMember:(h,y,x)=>m(`/workspaces/${g(h)}/members/${g(y)}`,{role:x}),removeMember:(h,y)=>v(`/workspaces/${g(h)}/members/${g(y)}`)},keys:{list:(h={})=>a("/keys",h),create:(h,y)=>u("/keys",yr(h,y)),update:(h,y,x)=>f(`/keys/${g(h)}`,yr(y,x)),rotate:h=>u(`/keys/${g(h)}/rotate`),revoke:h=>u(`/keys/${g(h)}/revoke`)},adminTokens:{list:()=>a("/admin-tokens"),create:(h,y,x)=>u("/admin-tokens",{label:h,scope:y,...x!==void 0?{expiresInDays:x}:{}}),revoke:h=>v(`/admin-tokens/${g(h)}`)},usage:{report:h=>a("/usage",h),requests:h=>a("/requests",h),request:h=>a(`/requests/${g(h)}`),exportUrl:h=>`${r}/usage/export.csv${ra(h)}`},audit:{list:h=>a("/audit",h)},wallet:{get:h=>a(`/workspaces/${g(h)}/wallet`),cardLink:(h,y,x)=>u(`/workspaces/${g(h)}/wallet/card-link`,{amountUsd:y,provider:x}),watch:(h,y)=>u(`/workspaces/${g(h)}/wallet/watch`,{mode:y}),deposits:h=>a(`/workspaces/${g(h)}/deposits`),addDeposit:(h,y)=>u(`/workspaces/${g(h)}/deposits`,{txHash:y}),approveDeposit:(h,y,x)=>m(`/workspaces/${g(h)}/deposits/${g(y)}/approval`,{note:x}),unapproveDeposit:(h,y)=>i("DELETE",`/workspaces/${g(h)}/deposits/${g(y)}/approval`),operator:(h,y=!1)=>a(`/workspaces/${g(h)}/wallet/operator`,{fresh:y?1:void 0}),operators:()=>a("/wallet/operators"),operatorSync:(h,y)=>u(`/workspaces/${g(h)}/wallet/operator/sync`,y?{txHash:y}:{}),operatorAuth:(h,y)=>u(`/workspaces/${g(h)}/wallet/operator-auth`,{operator:y}),channels:(h,y=!1,x=!1)=>a(`/workspaces/${g(h)}/channels`,{all:y?1:void 0,fresh:x?1:void 0}),closeChannel:(h,y)=>u(`/workspaces/${g(h)}/channels/close`,{peerId:y}),rewards:h=>a(`/workspaces/${g(h)}/rewards`),chain:()=>a("/chain")},chat:{models:h=>a("/chat/models",{workspace:h}),context:h=>a("/chat/context",{workspace:h}),threads:h=>a("/chat/threads",{workspace:h}),thread:(h,y)=>a(`/chat/threads/${g(y)}`,{workspace:h}),deleteThread:(h,y)=>v(`/chat/threads/${g(y)}${ra({workspace:h})}`)},network:{peers:()=>a("/peers"),models:()=>a("/models"),routePreview:h=>a("/route-preview",h),gatewayPolicy:()=>a("/routing"),buyerLimits:()=>a("/routing/buyer-limits"),setGatewayPolicy:(h,y)=>i("PUT","/routing",{body:h,query:{confirmEmpty:y!=null&&y.confirmEmpty?1:void 0,acceptNarrowed:y!=null&&y.acceptNarrowed?1:void 0}}),peerLists:()=>a("/peer-lists"),createPeerList:h=>u("/peer-lists",h),updatePeerList:(h,y)=>f(`/peer-lists/${g(h)}`,y),removePeerList:h=>v(`/peer-lists/${g(h)}`)},presets:{list:h=>a("/presets",{workspace:h}),create:(h,y)=>u("/presets",yr(h,y)),update:(h,y,x)=>f(`/presets/${g(h)}`,yr(y,x)),remove:h=>v(`/presets/${g(h)}`)},settings:{status:()=>a("/status"),get:()=>a("/settings"),updateBuyer:h=>f("/settings/buyer",h),setObservability:h=>m("/settings/observability",h)}}}function vv(t){return!!t&&"ownerRoutingPolicy"in t}const fe=C2();function Ca(t){return t.orgRole==="owner"||t.orgRole==="admin"}function Fc(t){return Ca(t)||t.workspaceRole==="admin"}const $c=[{id:"overview",label:"Overview",group:"Workspace",access:"member"},{id:"chat",label:"Chat",group:"Workspace",access:"member"},{id:"activity",label:"Activity",group:"Workspace",access:"member"},{id:"logs",label:"Logs",group:"Workspace",access:"member"},{id:"keys",label:"Keys",group:"Workspace",access:"member"},{id:"presets",label:"Presets",group:"Workspace",access:"member"},{id:"wallet",label:"Wallet & Funding",group:"Money",access:"workspaceAdmin"},{id:"rewards",label:"Rewards",group:"Money",access:"workspaceAdmin"},{id:"providers",label:"Providers",group:"Routing",access:"member"},{id:"models",label:"Models",group:"Routing",access:"member"},{id:"routing",label:"Routing",group:"Routing",access:"workspaceAdmin"},{id:"members",label:"Members",group:"Organization",access:"workspaceAdmin"},{id:"workspaces",label:"Workspaces",group:"Organization",access:"workspaceAdmin"},{id:"audit",label:"Audit log",group:"Organization",access:"orgAdmin"},{id:"settings",label:"Settings",group:"Organization",access:"orgAdmin"}];function zc(t,r){const i=$c.find(a=>a.id===t);return i?i.access==="orgAdmin"?Ca(r):i.access==="workspaceAdmin"?Fc(r):!0:!1}function _2(t){return $c.filter(r=>zc(r.id,t))}function E2(t,r){const i=t.me.workspaces.find(a=>a.workspace.id===r);return{orgRole:t.me.member.orgRole,workspaceRole:(i==null?void 0:i.role)??null}}const Uc={owner:"Owner",admin:"Admin",member:"Member"};function P2(t,r){return r?`${t}/${encodeURIComponent(r)}`:t}function b2(t){const r=t.join("/");return r===""?null:r}function j2(t,r){return t==="network"?P2("providers",b2(r)):null}const gv=I.createContext(null);function ir(){const t=I.useContext(gv);if(!t)throw new Error("useConsole outside the console shell");return t}const yv="antseed-console-workspace";function T2(){try{return localStorage.getItem(yv)}catch{return null}}function R2(t){try{localStorage.setItem(yv,t)}catch{}}function jp(t,r){const i=t.workspaces.map(a=>a.workspace);return i.find(a=>a.id===r)??i.find(a=>a.isDefault)??i[0]??null}function _k(){const{workspace:t,viewer:r,me:i}=ir();return Fc(r)?{workspace:t.id}:{workspace:t.id,member:i.member.id}}const ic="antseed-console-theme";function wv(){try{const t=localStorage.getItem(ic);return t==="light"||t==="dark"?t:"system"}catch{return"system"}}function N2(){const t=wv();t!=="system"&&(document.documentElement.dataset.theme=t)}function I2(){const[t,r]=I.useState(wv);return I.useEffect(()=>{t==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=t;try{t==="system"?localStorage.removeItem(ic):localStorage.setItem(ic,t)}catch{}},[t]),[t,r]}function Ek(){var r;const t=document.documentElement.dataset.theme;return t?t==="dark":((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)??!1}const Io="/console";function M2(t){try{return decodeURIComponent(t)}catch{return t}}function xv(t,r="",i=""){const u=(t.startsWith(Io)?t.slice(Io.length):t).split("/").filter(Boolean).map(M2);return{page:u[0]??"",rest:u.slice(1),query:new URLSearchParams(r),hash:i.replace(/^#/,"")}}function Tp(){return xv(window.location.pathname,window.location.search,window.location.hash)}const oc=new Set;function an(t,r={}){const i=t.startsWith("/")?`${Io}${t}`:`${Io}/${t}`;r.replace?window.history.replaceState(null,"",i):window.history.pushState(null,"",i),oc.forEach(a=>a())}function Bc(){const[t,r]=I.useState(Tp);return I.useEffect(()=>{const i=()=>r(Tp());return oc.add(i),window.addEventListener("popstate",i),()=>{oc.delete(i),window.removeEventListener("popstate",i)}},[]),t}function _a(t){return`${Io}/${t.replace(/^\//,"")}`}function Hc(t){return r=>{r.defaultPrevented||r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||(r.preventDefault(),an(t))}}const L2=6;function Xe(t){if(t==null||t==="")return 0;const r=Number(t);return Number.isFinite(r)?r:0}function O2(t,r={}){if(t==null)return"—";const i=typeof t=="number"?t:Xe(t),a=i<0?"-":"",u=Math.abs(i);return r.compact&&u>=1e4?`${a}$${new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(u)}`:u!==0&&u<1e-4?`${a}<$0.0001`:u!==0&&u<.01?`${a}$${u.toFixed(4).replace(/0+$/,"").replace(/\.$/,"")}`:`${a}$${u.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Pk(t){const r=t.trim().replace(/^\$/,"").replace(/,/g,"");if(r==="")return null;const i=/^(\d+)(?:\.(\d{0,6}))?$/.exec(r);if(!i)throw new Error("Use a dollar amount like 5 or 12.50 (up to 6 decimals).");const a=i[1].replace(/^0+(?=\d)/,""),u=(i[2]??"").padEnd(L2,"0");return`${a}.${u}`}function bk(t){return t==null?"":t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t}function A2(t,r={}){return t==null||!Number.isFinite(t)?"—":r.compact&&Math.abs(t)>=1e4?new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(t):t.toLocaleString("en-US")}function jk(t){return A2(t,{compact:!0})}function gi(t){return t==null?"—":t===0?"Free":t<.01?`$${t.toLocaleString("en-US",{maximumSignificantDigits:2})}`:`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:t<1?3:2})}`}function Tk(t){return t?t.min===t.max?gi(t.min):`${t.min===0?"$0":gi(t.min)}–${gi(t.max)}`:"—"}function Rk(t){return t==null?"—":t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)} s`:`${Math.round(t)} ms`}function Nk(t){if(t==null)return"—";const r=Math.floor(t/6e4);if(r<1)return"<1 min";if(r<60)return`${r} min`;const i=Math.floor(r/60);return i<48?`${i} h ${r%60} min`:`${Math.floor(i/24)} d ${i%24} h`}function D2(t){return t?new Date(t).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function F2(t){return t?new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"—"}function Rp(t,r=Date.now()){if(!t)return"Never";const i=r-t,a=i<0,u=Math.abs(i),f=6e4,m=60*f,v=24*m;let g;if(u<f)return a?"in a moment":"just now";if(u<m)g=`${Math.round(u/f)} min`;else if(u<v)g=`${Math.round(u/m)} h`;else if(u<30*v)g=`${Math.round(u/v)} d`;else return F2(t);return a?`in ${g}`:`${g} ago`}function sn(t,r=6,i=4){return t?t.length<=r+i+1?t:`${t.slice(0,r)}…${t.slice(-i)}`:"—"}const Sv=["daily","weekly","monthly","total"],Ik={daily:"Daily",weekly:"Weekly",monthly:"Monthly",total:"Total"};function $2(t){if(!t)return"No limits";const r={daily:"/day",weekly:"/week",monthly:"/month",total:" total"},i=Sv.filter(a=>t[a]!==null).map(a=>`${O2(t[a])}${r[a]}`);return i.length>0?i.join(" · "):"No limits"}function Mk(t,r=Date.now()){const i=new Date(r),a=Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate());if(t==="daily")return a;if(t==="monthly")return Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1);const u=(i.getUTCDay()+6)%7;return a-u*864e5}const z2=15*6e4;function U2(t){return t.status==="active"||t.status==="open"||t.status==="closing"||t.status==="withdrawable"}function Lk(t,r){return t.status==="withdrawable"?"withdraw":t.status!=="active"&&t.status!=="open"?"none":t.canCooperativeClose&&!r?"cooperative":"on-chain"}function B2(t){return t.closeRequestedAt===null?null:t.closeRequestedAt+z2}function H2(t,r=Date.now()){const i=Math.max(0,t-r);return i>=6e4?`${Math.ceil(i/6e4)} min`:`${Math.ceil(i/1e3)} s`}function Ok(t,r=Date.now()){if(t.status==="closing"){const i=B2(t);return i===null?"closing":`closing · ${H2(i,r)} left`}return t.status==="withdrawable"?"ready to withdraw":t.status==="timedout"?"withdrawn":t.status}function Ak(t){return t.status==="active"||t.status==="open"?"success":t.status==="withdrawable"?"warning":t.status==="closing"?"info":"neutral"}function W2(t){return Math.max(0,Xe(t.reserved)-Xe(t.spent))}function V2(t){const r=t.filter(i=>i.status==="withdrawable");return{count:r.length,amount:r.reduce((i,a)=>i+W2(a),0)}}function Dk(t){return t.filter(U2).reduce((r,i)=>r+Math.max(0,Xe(i.spent)-Xe(i.settled??"0")),0)}function Fk(t){return Xe(t.reserved)>0&&Xe(t.available)<=0&&Xe(t.walletUsdc)<=0}function q2(t){const r=Xe(t.walletUsdc);if(r<=0)return!1;const i=t.creditLimit===null?0:Xe(t.creditLimit),a=Math.max(0,i-Xe(t.available)-Xe(t.reserved));return!(i>0&&r>a)}function $k(t){const r=Xe(t.walletUsdc),i=t.creditLimit===null?0:Xe(t.creditLimit),a=Math.max(0,i-Xe(t.available)-Xe(t.reserved));return i>0&&r>a?"Credits are at or near the credit limit, so this USDC waits in the workspace wallet and tops the credits up as they are spent.":"This USDC is in the workspace wallet and moves into the credits automatically."}function zk(t){const r=t.toLowerCase();return r.includes("already in flight")?"A close request to this seller is still waiting for an answer (it gives up after a minute). Close on chain instead, or try again shortly.":r.includes("busy")||r.includes("still processing")?"The seller is still processing a request. Try again shortly, or close on chain.":r.includes("pending_auth")||r.includes("latest payment authorization")?"The seller is waiting for the latest payment authorization. Try again shortly, or close on chain.":r.includes("no_channel")||r.includes("no longer has this channel")?"The seller no longer has this channel open. It may already be settled; refresh the list, or close on chain.":r.includes("did not answer")||r.includes("not connected")||r.includes("could not be found")||r.includes("disconnected")?"The seller did not answer. Close on chain instead: it does not need the seller.":r.includes("does not support cooperative close")?"This seller does not support a cooperative close. Close on chain instead.":`${t} The channel is unchanged; close on chain instead.`}const K2={usdc:["usdc","USDC","usdcToken"],deposits:["deposits","AntseedDeposits","antseedDeposits"],usageRewards:["usageRewards","AntseedUsageRewards","UsageRewards"],channels:["channels","AntseedChannels","antseedChannels"]};function Uk(t,r){if(!t)return null;const i=Object.entries(t.contracts);for(const a of K2[r]){const u=i.find(([f])=>f.toLowerCase()===a.toLowerCase());if(u&&/^0x[0-9a-fA-F]{40}$/.test(u[1]))return u[1]}return null}function Mo(t,r){return!!t&&!!r&&t.toLowerCase()===r.toLowerCase()}const Q2="0x0000000000000000000000000000000000000000";function Wc(t){return!!t&&/^0x[0-9a-fA-F]{40}$/.test(t)&&t.toLowerCase()!==Q2}function Bk(t,r){return t!=null&&t.explorerUrl?`${t.explorerUrl.replace(/\/+$/,"")}/tx/${r}`:null}const Pe={group:t=>[t],me:["me"],authConfig:["auth-config"],status:["status"],settings:["settings"],workspaces:["workspaces","list"],workspace:t=>["workspaces","detail",t],workspaceMembers:t=>["workspaces","members",t],members:["members","list"],invites:["invites"],keys:t=>["keys","list",t],usage:t=>["usage",t],requests:t=>["requests","list",t],request:t=>["requests","detail",t],audit:t=>["audit",t],wallet:t=>["wallet",t],deposits:t=>["deposits",t],channels:(t,r)=>["channels",t,r],operators:["wallet-operators"],rewards:t=>["rewards",t],chain:["chain"],chatModels:t=>["chat-models",t],chatContext:t=>["chat-context",t],chatThreads:t=>["chat-threads",t],chatThread:(t,r)=>["chat-thread",t,r],peers:["peers"],models:["models"],peerLists:["peer-lists"],gatewayPolicy:["routing","gateway"],buyerLimits:["routing","buyer-limits"],routePreview:t=>["routing","preview",t],presets:t=>["presets",t],adminTokens:["admin-tokens"]},Hk=["routing","workspaces","members","keys","presets"];function G2(t,r=fe){return{queryKey:Pe.workspace(t),queryFn:()=>r.workspaces.get(t)}}function Wk(t,r=!0){return De({...G2(t),enabled:r})}function Vk(t=!0){return De({queryKey:Pe.peers,queryFn:fe.network.peers,staleTime:3e4,enabled:t})}function qk(){return De({queryKey:Pe.models,queryFn:fe.network.models,staleTime:3e4})}function Kk(t=!0){return De({queryKey:Pe.peerLists,queryFn:fe.network.peerLists,staleTime:3e4,enabled:t})}function Qk(){return De({queryKey:Pe.workspaces,queryFn:fe.workspaces.list})}function Gk(t,r=!0){return De({queryKey:Pe.workspaceMembers(t),queryFn:()=>fe.workspaces.members(t),enabled:r})}function Yk(t=!0){return De({queryKey:Pe.members,queryFn:fe.members.list,enabled:t})}function Zk(){return De({queryKey:Pe.invites,queryFn:fe.invites.list})}function Xk(t,r=!0){return De({queryKey:Pe.keys(t),queryFn:()=>fe.keys.list(t),enabled:r})}function Jk(t,r=!0){return De({queryKey:Pe.presets(t),queryFn:()=>fe.presets.list(t),enabled:r})}function eC(t,r=!0){return De({queryKey:Pe.wallet(t),queryFn:()=>fe.wallet.get(t),enabled:r,refetchInterval:i=>i.state.data&&q2(i.state.data)?5e3:!1})}function tC(){return De({queryKey:Pe.gatewayPolicy,queryFn:fe.network.gatewayPolicy})}function nC(){return De({queryKey:Pe.buyerLimits,queryFn:fe.network.buyerLimits})}function rC(){return De({queryKey:Pe.adminTokens,queryFn:fe.adminTokens.list})}function Y2(){return De({queryKey:Pe.me,queryFn:fe.auth.me})}function Vc(t=!0){return De({queryKey:Pe.authConfig,queryFn:fe.auth.config,enabled:t})}function qc(){return De({queryKey:Pe.status,queryFn:fe.settings.status,refetchInterval:3e4})}function iC(t=!0){return De({queryKey:Pe.chain,queryFn:fe.wallet.chain,staleTime:1/0,enabled:t})}function oC(t){const r=new Set;for(const i of t??[])for(const a of i.services)r.add(a.service);return[...r].sort()}const kv=t=>["wallet-operator",t],Cv={get:(t,r=!1)=>fe.wallet.operator(t,r),sync:(t,r)=>fe.wallet.operatorSync(t,r),authorize:(t,r)=>fe.wallet.operatorAuth(t,r)};function sC(t,r=!0){return De({queryKey:kv(t),queryFn:()=>Cv.get(t),staleTime:3e4,enabled:r})}function Z2(t=!0){return De({queryKey:Pe.operators,queryFn:()=>fe.wallet.operators(),staleTime:6e4,enabled:t})}function X2(t){return(t==null?void 0:t.relation)==="none"}function aC(t){const r=rr(),i=a=>{r.setQueryData(kv(t),a),r.invalidateQueries({queryKey:Pe.operators}),r.invalidateQueries({queryKey:Pe.wallet(t)}),r.invalidateQueries({queryKey:Pe.rewards(t)})};return{apply:i,refresh:async()=>i(await Cv.get(t,!0))}}function lC(t,r){const i=t.operator,a=sn(i),u=Wc(i)&&Mo(r,i),f=m=>u?{canManage:!0,manageHint:null}:{canManage:!1,manageHint:`Only ${m} can transfer or remove it: connect ${a} to do so.`};switch(t.relation){case"none":return{tone:"warning",badge:"Not set",title:"No authorized wallet",summary:t.canAuthorize?"Authorize one of your wallets to withdraw funds and claim ANTS rewards. Requests keep working meanwhile.":"Nobody can withdraw funds or claim ANTS rewards until the organization owner authorizes a wallet.",body:t.canAuthorize?"Nobody can withdraw this workspace's funds or claim its ANTS rewards until you authorize one of your wallets. Requests keep working meanwhile.":"Nobody can withdraw this workspace's funds or claim its ANTS rewards until one is authorized. Only the organization owner can authorize a wallet; requests keep working meanwhile.",canAuthorize:t.canAuthorize,canManage:!1,manageHint:null,canLink:!1};case"self":return{tone:"info",badge:"Workspace wallet",title:"The workspace wallet authorizes itself",summary:"Withdrawals and rewards stay in the wallet the gateway holds.",body:"Withdrawals and rewards stay in the wallet the gateway holds. To hand the role to a personal wallet, run `antseed gateway workspace operator transfer <workspace> <address>` on the gateway host (the workspace wallet pays the gas).",canAuthorize:!1,canManage:!1,manageHint:null,canLink:!1};case"yours":return{tone:"success",badge:"Your wallet",title:`Your wallet ${a}`,summary:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",body:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",canAuthorize:!1,canLink:!1,...f("this wallet")};case"member":{const m=t.memberLabel?`${t.memberLabel}'s wallet`:"Another member's wallet";return{tone:"info",badge:t.memberLabel?t.memberLabel:"Member",title:`${m} ${a}`,summary:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",body:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",canAuthorize:!1,canLink:!1,...f(t.memberLabel?`${t.memberLabel}'s wallet`:"that member's wallet")}}case"unknown":return{tone:"info",badge:"Not linked to a console member",title:`Authorized wallet ${a}`,summary:"Withdrawals and ANTS rewards go to this wallet. If it is yours, link it to your account to manage it here.",body:"No member of this gateway signs in with this address, yet withdrawals and ANTS rewards go to it, and only it can transfer or remove the role: not the gateway, not the organization owner. If nobody on your team controls it, do not add more than you plan to spend (the gateway can still spend the balance on requests, but it cannot be withdrawn). Ask whoever controls it to transfer the role, or move to a new workspace with a fresh wallet.",canAuthorize:!1,canLink:!0,...f("that wallet")}}}function uC(t,r,i){if(!t)return{ok:!1,reason:"Checking the authorized wallet…",operator:null};const a=Wc(t.operator)?t.operator:null;return a?t.relation==="self"?{ok:!1,operator:a,reason:`This workspace's authorized wallet is the gateway-held wallet itself, so a browser wallet cannot ${i}. Use the antseed CLI on the gateway host, or transfer the role to a personal wallet.`}:r?Mo(r,a)?{ok:!0,operator:a,reason:null}:{ok:!1,operator:a,reason:`The connected wallet ${sn(r)} is not the authorized wallet ${sn(a)}. Switch to ${sn(a)} in your wallet to ${i}.`}:{ok:!1,operator:a,reason:`Connect the authorized wallet ${sn(a)} to ${i}. Funds go to that wallet.`}:{ok:!1,operator:null,reason:`Only the authorized wallet can ${i}, and none is set. ${t.canAuthorize?"Authorize one of your wallets under Authorized wallet.":"Ask the organization owner to authorize one."}`}}function cC(t,r=Date.now()){return t.eligibleWallets.map(i=>({...i,ready:i.eligibleAt<=r}))}function dC(t,r,i=Date.now()){if(!t.canAuthorize)return t.relation==="none"?"Only the organization owner can authorize a wallet.":"A wallet is already authorized; only it can transfer the role.";if(!r)return"Connect the wallet you want to authorize.";const a=t.eligibleWallets.find(u=>Mo(u.address,r));return a?a.eligibleAt>i?`${sn(r)} was added as a sign-in method recently. For your safety it can be authorized from ${D2(a.eligibleAt)}.`:null:`${sn(r)} is not one of your sign-in methods. Add it under Your sign-in methods first; it can be authorized 24 hours later.`}const _v={OperatorAlreadySet:{message:"Another wallet was authorized in the meantime. The panel now shows the current authorized wallet.",refresh:!0},InvalidNonce:{message:"The authorization expired: the operator nonce changed on chain. Start again to get a fresh authorization.",refresh:!0},InvalidSignature:{message:"The contract rejected the gateway's signature. The gateway and your wallet may be on different chains or deposits contracts.",refresh:!1},NotAuthorized:{message:"The connected wallet is not (or no longer) the authorized wallet. The panel now shows the current one.",refresh:!0},NotRewardRecipient:{message:"Only the authorized wallet can claim. The panel now shows the current one.",refresh:!0},RewardRecipientUnavailable:{message:"No authorized wallet is set, so rewards cannot be claimed yet.",refresh:!0},InsufficientBalance:{message:"Not enough available balance; funds reserved in open channels cannot be withdrawn.",refresh:!0},InvalidAddress:{message:"The contract rejected the address.",refresh:!1},ChannelNotActive:{message:"This channel is already settled or closed; nothing is left to do. The list now shows it.",refresh:!0},CloseAlreadyRequested:{message:"A close was already requested for this channel. The list now shows when the reserve can be withdrawn.",refresh:!0},CloseNotReady:{message:"The 15-minute grace period has not ended yet. Withdraw once the countdown reaches zero.",refresh:!0}};function J2(t){const r=new Set;let i=t;for(;i&&typeof i=="object"&&!r.has(i);){r.add(i);const u=i.data;if(u&&typeof u.errorName=="string")return u.errorName;i=i.cause}const a=t instanceof Error?`${t.message} ${t.shortMessage??""}`:String(t??"");return Object.keys(_v).find(u=>a.includes(u))??null}function fC(t){const r=J2(t);return r?_v[r]??null:null}class ko extends Error{constructor(r,i,a=!1){super(r),this.refresh=i,this.retryAuth=a,this.name="OperatorPreflightError"}}function hC(t,r,i){if(t.chainId!==void 0&&t.chainId!==i.chainId)throw new ko(`The gateway signed for chain ${t.chainId} but the console is set up for chain ${i.chainId}.`,!1);if(t.depositsContract&&i.depositsContract&&!Mo(t.depositsContract,i.depositsContract))throw new ko("The gateway signed for a different deposits contract than the one the console reports. Reload the page.",!1);if(t.operator&&!Mo(t.operator,i.operator))throw new ko(`The authorization is for ${sn(t.operator)}, not ${sn(i.operator)}.`,!1);if(Wc(r.operator))throw new ko(`An authorized wallet is already set (${sn(r.operator)}). The panel now shows it.`,!0);if(r.nonce.toString()!==t.nonce)throw new ko("The operator nonce changed since the gateway signed. Getting a fresh authorization…",!0,!0)}function ex(t,r=!0){return De({queryKey:Pe.channels(t,!1),queryFn:()=>fe.wallet.channels(t,!1),enabled:r})}function Ev(){const{workspace:t,viewer:r}=ir(),i=Fc(r),a=Z2(i),u=ex(t.id,i),f=a.data??[],m=new Set(f.filter(X2).map(y=>y.workspaceId)),v=f.find(y=>y.workspaceId===t.id),g=V2(u.data??[]),h=m.has(t.id);return{missingOperator:m,currentMissingOperator:h,canAuthorize:(v==null?void 0:v.canAuthorize)??!1,withdrawable:g,wallet:h||g.count>0}}const Pv=["pointerdown","mousedown","pointerup","mouseup","click"],sc=new WeakMap;function bv(t,r,i){Kc(t);let a=u=>{let f=u.target;t.contains(f)&&((!i||i(f))&&(u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation()),u.type==="click"&&(r==null||r(u)))};for(let u of Pv)document.addEventListener(u,a,!0);sc.set(t,a)}function Kc(t){let r=sc.get(t);if(r){for(let i of Pv)document.removeEventListener(i,r,!0);sc.delete(t)}}function tx(t,r){let i=t.wrapper.getBoundingClientRect();return{width:i.width+r,height:i.height+r,realWidth:i.width,realHeight:i.height}}function Np(t,r){let{elementDimensions:i,popoverDimensions:a,popoverPadding:u,popoverArrowDimensions:f}=r;return t==="start"?Math.max(Math.min(i.top-u,window.innerHeight-a.realHeight-f.width),f.width):t==="end"?Math.max(Math.min(i.top-(a==null?void 0:a.realHeight)+i.height+u,window.innerHeight-(a==null?void 0:a.realHeight)-f.width),f.width):t==="center"?Math.max(Math.min(i.top+i.height/2-(a==null?void 0:a.realHeight)/2,window.innerHeight-(a==null?void 0:a.realHeight)-f.width),f.width):0}function Ip(t,r){let{elementDimensions:i,popoverDimensions:a,popoverPadding:u,popoverArrowDimensions:f}=r;return t==="start"?Math.max(Math.min(i.left-u,window.innerWidth-a.realWidth-f.width),f.width):t==="end"?Math.max(Math.min(i.left-(a==null?void 0:a.realWidth)+i.width+u,window.innerWidth-(a==null?void 0:a.realWidth)-f.width),f.width):t==="center"?Math.max(Math.min(i.left+i.width/2-(a==null?void 0:a.realWidth)/2,window.innerWidth-(a==null?void 0:a.realWidth)-f.width),f.width):0}function Qc(t,r,i){let{align:a,side:u}=i,f=i.centered?"over":u,m=i.padding,v=tx(t,i.offset),g=t.arrow.getBoundingClientRect(),h=r.getBoundingClientRect(),y=h.top-v.height,x=y>=0,C=window.innerHeight-(h.bottom+v.height),N=C>=0,A=h.left-v.width,E=A>=0,M=window.innerWidth-(h.right+v.width),L=M>=0,F=!x&&!N&&!E&&!L,P=f;if(f==="top"&&x?L=E=N=!1:f==="bottom"&&N?L=E=x=!1:f==="left"&&E?L=x=N=!1:f==="right"&&L&&(E=x=N=!1),f==="over"){let j=window.innerWidth/2-v.realWidth/2,D=window.innerHeight/2-v.realHeight/2;t.wrapper.style.left=`${j}px`,t.wrapper.style.right="auto",t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto"}else if(F){let j=window.innerWidth/2-(v==null?void 0:v.realWidth)/2;t.wrapper.style.left=`${j}px`,t.wrapper.style.right="auto",t.wrapper.style.bottom="10px",t.wrapper.style.top="auto"}else if(E){let j=Math.min(A,window.innerWidth-(v==null?void 0:v.realWidth)-g.width),D=Np(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.left=`${j}px`,t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",P="left"}else if(L){let j=Math.min(M,window.innerWidth-(v==null?void 0:v.realWidth)-g.width),D=Np(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.right=`${j}px`,t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.left="auto",P="right"}else if(x){let j=Math.min(y,window.innerHeight-v.realHeight-g.width),D=Ip(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.top=`${j}px`,t.wrapper.style.left=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",P="top"}else if(N){let j=Math.min(C,window.innerHeight-(v==null?void 0:v.realHeight)-g.width),D=Ip(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.left=`${D}px`,t.wrapper.style.bottom=`${j}px`,t.wrapper.style.top="auto",t.wrapper.style.right="auto",P="bottom"}rx(t,F?"over":P,a,r),[...t.wrapper.classList].filter(j=>j.startsWith("driver-popover-side-")||j.startsWith("driver-popover-align-")).forEach(j=>t.wrapper.classList.remove(j)),t.wrapper.classList.add(`driver-popover-side-${P}`),t.wrapper.classList.add(`driver-popover-align-${a}`)}function Mp(t,r,i,a,u,f=10){let m=a-i;return t<=i&&r>=a?u==="start"?15+f/2:u==="end"?m-15-f/2:m/2:(Math.min(Math.max(t,i),a)+Math.min(Math.max(r,i),a))/2-i}function Lp(t,r,i=10){let a=r-15-i;if(a<15)return Math.max(0,(r-i)/2);let u=t-i/2;return Math.min(Math.max(u,15),a)}function nx(t,r,i){return t==="left"||t==="right"?r.bottom>i.top&&r.top<i.bottom?t:r.bottom<=i.top?"bottom":"top":r.right>i.left&&r.left<i.right?t:r.right<=i.left?"right":"left"}function rx(t,r,i,a){let u=t.arrow;if(u.className="driver-popover-arrow",u.style.top="",u.style.right="",u.style.bottom="",u.style.left="",r==="over"){u.classList.add("driver-popover-arrow-none");return}let f=a.getBoundingClientRect(),m=t.wrapper.getBoundingClientRect(),v=nx(r,f,m);u.classList.add(`driver-popover-arrow-side-${v}`);let g=u.getBoundingClientRect().width||10;if(v==="left"||v==="right"){let h=Mp(f.top,f.bottom,m.top,m.bottom,i,g);u.style.top=`${Lp(h,m.height,g)}px`}else{let h=Mp(f.left,f.right,m.left,m.right,i,g);u.style.left=`${Lp(h,m.width,g)}px`}}function ma(t){return typeof t=="function"?t():typeof t=="string"?document.querySelector(t):t}function ix(t){let r=window.getComputedStyle(t);return[r.overflow,r.overflowX,r.overflowY].some(i=>i==="auto"||i==="scroll")}function ia(t,r,i,a){return(t/=a/2)<1?i/2*t*t+r:-i/2*(--t*(t-2)-1)+r}function jv(t){let r='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return t.flatMap(i=>{let a=i.matches(r),u=Array.from(i.querySelectorAll(r));return[...a?[i]:[],...u]}).filter(i=>getComputedStyle(i).pointerEvents!=="none"&&ax(i))}function Tv(t,r){if(!t||sx(t))return;let i=t.offsetHeight>window.innerHeight;t.scrollIntoView({behavior:!r||ox(t)?"auto":"smooth",inline:"center",block:i?"start":"center"})}function ox(t){if(!t||!t.parentElement)return;let r=t.parentElement;return r.scrollHeight>r.clientHeight}function sx(t){let r=t.getBoundingClientRect();return r.top>=0&&r.left>=0&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&r.right<=(window.innerWidth||document.documentElement.clientWidth)}function ax(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function Rv(t){t&&(t.wrapper.style.display="none")}function lx(t,r){var E;let i=cx();document.body.appendChild(i.wrapper);let{title:a,description:u,showButtons:f,disableButtons:m,showProgress:v,nextBtnText:g,prevBtnText:h,progressText:y}=r;i.nextButton.innerHTML=g,i.previousButton.innerHTML=h,i.progress.innerHTML=y,i.closeButton.setAttribute("aria-label",r.closeBtnLabel),r.doneButton&&i.nextButton.classList.add("driver-popover-done-btn"),a?(i.title.innerHTML=a,i.title.style.display="block"):i.title.style.display="none",u?(i.description.innerHTML=u,i.description.style.display="block"):i.description.style.display="none";let x=f.includes("next")||f.includes("previous")||v;i.closeButton.style.display=f.includes("close")?"block":"none",x?(i.footer.style.display="flex",i.progress.style.display=v?"block":"none",i.nextButton.style.display=f.includes("next")?"block":"none",i.previousButton.style.display=f.includes("previous")?"block":"none"):i.footer.style.display="none",m.includes("next")&&(i.nextButton.disabled=!0,i.nextButton.classList.add("driver-popover-btn-disabled")),m.includes("previous")&&(i.previousButton.disabled=!0,i.previousButton.classList.add("driver-popover-btn-disabled")),m.includes("close")&&(i.closeButton.disabled=!0,i.closeButton.classList.add("driver-popover-btn-disabled"));let C=i.wrapper;C.style.display="block",C.style.left="",C.style.top="",C.style.bottom="",C.style.right="",C.id="driver-popover-content",C.setAttribute("role","dialog"),C.setAttribute("aria-labelledby","driver-popover-title"),C.setAttribute("aria-describedby","driver-popover-description");let N=i.arrow;N.className="driver-popover-arrow",C.className=`driver-popover ${r.popoverClass||""}`.trim(),bv(i.wrapper,M=>{var F,P,j;let L=M.target;if(L.closest(".driver-popover-next-btn"))return(F=r.onNextClick)==null?void 0:F.call(r);if(L.closest(".driver-popover-prev-btn"))return(P=r.onPrevClick)==null?void 0:P.call(r);if(L.closest(".driver-popover-close-btn"))return(j=r.onCloseClick)==null?void 0:j.call(r)},M=>i.description.contains(M)||i.title.contains(M)?!1:!!M.closest(".driver-popover-prev-btn, .driver-popover-next-btn, .driver-popover-close-btn")),(E=r.onRender)==null||E.call(r,i),Qc(i,t,r.position),ux(i,t,r.position),Tv(C,r.smoothScroll);let A=jv([C,t]);return A.length>0&&A[0].focus(),i}function ux(t,r,i){t.wrapper.querySelectorAll("img").forEach(a=>{if(a.complete)return;let u=()=>Qc(t,r,i);a.addEventListener("load",u,{once:!0}),a.addEventListener("error",u,{once:!0})})}function cx(){let t=document.createElement("div");t.classList.add("driver-popover");let r=document.createElement("div");r.classList.add("driver-popover-arrow");let i=document.createElement("header");i.id="driver-popover-title",i.classList.add("driver-popover-title"),i.style.display="none",i.innerText="Popover Title";let a=document.createElement("div");a.id="driver-popover-description",a.classList.add("driver-popover-description"),a.style.display="none",a.innerText="Popover description is here";let u=document.createElement("button");u.type="button",u.classList.add("driver-popover-close-btn"),u.innerHTML="&times;";let f=document.createElement("footer");f.classList.add("driver-popover-footer");let m=document.createElement("span");m.classList.add("driver-popover-progress-text"),m.innerText="";let v=document.createElement("span");v.classList.add("driver-popover-navigation-btns");let g=document.createElement("button");g.type="button",g.classList.add("driver-popover-prev-btn","driver-popover-footer-btn"),g.innerHTML="Previous";let h=document.createElement("button");return h.type="button",h.classList.add("driver-popover-next-btn","driver-popover-footer-btn"),h.innerHTML="Next",v.appendChild(g),v.appendChild(h),f.appendChild(m),f.appendChild(v),t.appendChild(u),t.appendChild(r),t.appendChild(i),t.appendChild(a),t.appendChild(f),{wrapper:t,arrow:r,title:i,description:a,footer:f,previousButton:g,nextButton:h,closeButton:u,footerButtons:v,progress:m}}function Nv(t){var r;t&&(Kc(t.wrapper),(r=t.wrapper.parentElement)==null||r.removeChild(t.wrapper))}function Iv(t,r){let i=window.innerWidth,a=window.innerHeight,u=r.padding,f=r.radius,m=t.width+u*2,v=t.height+u*2,g=Math.min(f,m/2,v/2),h=Math.floor(Math.max(g,0)),y=t.x-u+h,x=t.y-u,C=m-h*2,N=v-h*2;return`M${i},0L0,0L0,${a}L${i},${a}L${i},0Z
81
+ `)},q0=0,ui=[];function K0(t){var r=I.useRef([]),i=I.useRef([0,0]),a=I.useRef(),u=I.useState(q0++)[0],f=I.useState(tv)[0],m=I.useRef(t);I.useEffect(function(){m.current=t},[t]),I.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(u));var E=f1([t.lockRef.current],(t.shards||[]).map(_p),!0).filter(Boolean);return E.forEach(function(M){return M.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),E.forEach(function(M){return M.classList.remove("allow-interactivity-".concat(u))})}}},[t.inert,t.lockRef.current,t.shards]);var v=I.useCallback(function(E,M){if("touches"in E&&E.touches.length===2||E.type==="wheel"&&E.ctrlKey)return!m.current.allowPinchZoom;var L=ea(E),F=i.current,P="deltaX"in E?E.deltaX:F[0]-L[0],j="deltaY"in E?E.deltaY:F[1]-L[1],D,W=E.target,te=Math.abs(P)>Math.abs(j)?"h":"v";if("touches"in E&&te==="h"&&W.type==="range")return!1;var Z=window.getSelection(),se=Z&&Z.anchorNode,ce=se?se===W||se.contains(W):!1;if(ce)return!1;var X=kp(te,W);if(!X)return!0;if(X?D=te:(D=te==="v"?"h":"v",X=kp(te,W)),!X)return!1;if(!a.current&&"changedTouches"in E&&(P||j)&&(a.current=D),!D)return!0;var Te=a.current||D;return H0(Te,M,E,Te==="h"?P:j)},[]),g=I.useCallback(function(E){var M=E;if(!(!ui.length||ui[ui.length-1]!==f)){var L="deltaY"in M?Cp(M):ea(M),F=r.current.filter(function(D){return D.name===M.type&&(D.target===M.target||M.target===D.shadowParent)&&W0(D.delta,L)})[0];if(F&&F.should){M.cancelable&&M.preventDefault();return}if(!F){var P=(m.current.shards||[]).map(_p).filter(Boolean).filter(function(D){return D.contains(M.target)}),j=P.length>0?v(M,P[0]):!m.current.noIsolation;j&&M.cancelable&&M.preventDefault()}}},[]),h=I.useCallback(function(E,M,L,F){var P={name:E,delta:M,target:L,should:F,shadowParent:Q0(L)};r.current.push(P),setTimeout(function(){r.current=r.current.filter(function(j){return j!==P})},1)},[]),y=I.useCallback(function(E){i.current=ea(E),a.current=void 0},[]),x=I.useCallback(function(E){h(E.type,Cp(E),E.target,v(E,t.lockRef.current))},[]),C=I.useCallback(function(E){h(E.type,ea(E),E.target,v(E,t.lockRef.current))},[]);I.useEffect(function(){return ui.push(f),t.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:C}),document.addEventListener("wheel",g,li),document.addEventListener("touchmove",g,li),document.addEventListener("touchstart",y,li),function(){ui=ui.filter(function(E){return E!==f}),document.removeEventListener("wheel",g,li),document.removeEventListener("touchmove",g,li),document.removeEventListener("touchstart",y,li)}},[]);var N=t.removeScrollBar,A=t.inert;return I.createElement(I.Fragment,null,A?I.createElement(f,{styles:V0(u)}):null,N?I.createElement(A0,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function Q0(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const G0=h1(ev,K0);var Ac=I.forwardRef(function(t,r){return I.createElement(xa,rn({},t,{ref:r,sideCar:G0}))});Ac.classNames=xa.classNames;var ov=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},ci=new WeakMap,ta=new WeakMap,na={},Nu=0,sv=function(t){return t&&(t.host||sv(t.parentNode))},Y0=function(t,r){return r.map(function(i){if(t.contains(i))return i;var a=sv(i);return a&&t.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",t,". Doing nothing"),null)}).filter(function(i){return!!i})},av=function(t,r,i,a){var u=Y0(r,Array.isArray(t)?t:[t]);na[i]||(na[i]=new WeakMap);var f=na[i],m=[],v=new Set,g=new Set(u),h=function(x){!x||v.has(x)||(v.add(x),h(x.parentNode))};u.forEach(h);var y=function(x){!x||g.has(x)||Array.prototype.forEach.call(x.children,function(C){if(v.has(C))y(C);else try{var N=C.getAttribute(a),A=N!==null&&N!=="false",E=(ci.get(C)||0)+1,M=(f.get(C)||0)+1;ci.set(C,E),f.set(C,M),m.push(C),E===1&&A&&ta.set(C,!0),M===1&&C.setAttribute(i,"true"),A||C.setAttribute(a,"true")}catch(L){console.error("aria-hidden: cannot operate on ",C,L)}})};return y(r),v.clear(),Nu++,function(){m.forEach(function(x){var C=ci.get(x)-1,N=f.get(x)-1;ci.set(x,C),f.set(x,N),C||(ta.has(x)||x.removeAttribute(a),ta.delete(x)),N||x.removeAttribute(i)}),Nu--,Nu||(ci=new WeakMap,ci=new WeakMap,ta=new WeakMap,na={})}},Z0=function(t,r,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),u=r||ov(t);return u?(a.push.apply(a,Array.from(u.querySelectorAll("[aria-live], script"))),av(a,u,i,"aria-hidden")):function(){return null}},X0=function(t,r,i){i===void 0&&(i="data-inert-ed");var a=r||ov(t);return a?av(t,a,i,"inert"):function(){return null}},J0=function(){return typeof HTMLElement<"u"&&HTMLElement.prototype.hasOwnProperty("inert")},e2=function(t,r,i){return i===void 0&&(i="data-suppressed"),(J0()?X0:Z0)(t,r,i)};let Rr=[];const rc=new Set;function lv(){rc.forEach(t=>t())}function t2(t){Rr=Rr.filter(r=>r!==t),Rr.push(t),lv()}function n2(t){Rr=Rr.filter(r=>r!==t),lv()}function Iu(t){return Rr[Rr.length-1]===t}function uv(t,r,i){const a=I.useRef(i),u=I.useRef(null),[f,m]=I.useState(!1);I.useEffect(()=>{a.current=i},[i]);const v=I.useCallback(()=>{const h=u.current;u.current=null,h&&document.contains(h)&&h.focus({preventScroll:!0})},[]),g=I.useCallback(()=>{a.current()},[]);return I.useEffect(()=>{if(!t)return;const h=r.current;if(!h)return;const y=h;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null,t2(y),m(Iu(y));function x(){m(Iu(y))}function C(N){if(!Iu(y))return;const A=N.target instanceof Element?N.target:null,E=A==null?void 0:A.closest('[role="dialog"]');E&&E!==y&&!y.contains(E)||N.key==="Escape"&&(N.preventDefault(),N.stopPropagation(),N.stopImmediatePropagation(),g())}return rc.add(x),window.addEventListener("keydown",C,!0),()=>{window.removeEventListener("keydown",C,!0),rc.delete(x),n2(y),v()}},[g,t,r,v]),I.useEffect(()=>{var x,C;if(!t||!f)return;const h=r.current;if(!h)return;const y=((C=(x=h.parentElement)==null?void 0:x.parentElement)==null?void 0:C.querySelectorAll("[data-focus-guard]"))??[];return e2([h,...y])},[t,f,r]),{closeDialog:g,isTopDialog:f}}const r2={sm:"24rem",md:"28.75rem",lg:"35rem",xl:"52rem"};function i2(){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function cv({bodyClassName:t,children:r,className:i,closeLabel:a="Close",eyebrow:u,footer:f,isOpen:m,onClose:v,overlayClassName:g,size:h="md",subtitle:y,title:x}){const C=I.useRef(null),N=I.useId(),A=I.useId(),{closeDialog:E,isTopDialog:M}=uv(m,C,v);if(!m)return null;const L=["as-modal-overlay",g].filter(Boolean).join(" "),F=["as-modal",`as-modal--${h}`,i].filter(Boolean).join(" "),P=["as-modal__body",t].filter(Boolean).join(" "),j={"--as-modal-width":r2[h]};return d.jsx("div",{className:L,role:"presentation",onMouseDown:E,children:d.jsx(Ac,{allowPinchZoom:!0,className:"as-modal__scroll-lock",enabled:M,style:j,children:d.jsx(Oc,{autoFocus:!0,className:"as-modal__focus-lock",disabled:!M,focusOptions:{preventScroll:!0},returnFocus:!1,children:d.jsxs("div",{"aria-describedby":y?A:void 0,"aria-hidden":M?void 0:!0,"aria-labelledby":N,"aria-modal":M?"true":void 0,className:F,ref:C,role:"dialog",tabIndex:-1,onMouseDown:D=>D.stopPropagation(),children:[d.jsxs("header",{className:"as-modal__header",children:[d.jsxs("div",{className:"as-modal__titles",children:[u&&d.jsx("div",{className:"as-modal__eyebrow",children:u}),d.jsx("h2",{className:"as-modal__title",id:N,children:x}),y&&d.jsx("p",{className:"as-modal__subtitle",id:A,children:y})]}),d.jsx(o2,{label:a,className:"as-modal__close",onClick:E,children:d.jsx(i2,{})})]}),d.jsx("div",{className:P,children:r}),f&&d.jsx("footer",{className:"as-modal__footer",children:f})]})})})})}function o2({children:t,className:r,label:i,onClick:a}){return d.jsx("button",{type:"button",className:r,onClick:a,"aria-label":i,children:t})}function s2(t){return t instanceof Error?t.message:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:"Something went wrong."}function a2({isOpen:t,title:r,body:i,confirmLabel:a="Confirm",cancelLabel:u="Cancel",busyLabel:f="Working…",tone:m="danger",busy:v,error:g,errorTitle:h="That did not work",confirmDisabled:y,onConfirm:x,onClose:C}){return d.jsx(cv,{isOpen:t,onClose:v?()=>{}:C,title:r,size:"sm",children:d.jsxs("div",{className:"as-confirm",children:[d.jsx("div",{className:"as-confirm__body",children:i}),g?d.jsx(lt,{tone:"danger",title:h,children:s2(g)}):null,d.jsxs("div",{className:"as-confirm__actions",children:[d.jsx(Le,{variant:"ghost",onClick:C,disabled:v,children:u}),d.jsx(Le,{variant:m,onClick:x,disabled:v||y,children:v?f:a})]})]})})}function $o({children:t,className:r,label:i,size:a="md",type:u="button",...f}){const m=["as-icon-button",a==="sm"?"as-icon-button--sm":null,r].filter(Boolean).join(" ");return d.jsx("button",{type:u,className:m,"aria-label":i,title:f.title??i,...f,children:t})}async function dv(t){try{return await navigator.clipboard.writeText(t),!0}catch{return!1}}function Ep(){return d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[d.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"2"}),d.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]})}function Pp(){return d.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d.jsx("path",{d:"m5 12 5 5L20 7"})})}function Dc({value:t,label:r="Copy",copiedLabel:i="Copied",size:a="sm",variant:u="outline",className:f,iconOnly:m,onCopied:v}){const[g,h]=I.useState(!1),y=I.useRef(void 0);I.useEffect(()=>()=>window.clearTimeout(y.current),[]);const x=async()=>{await dv(t)&&(h(!0),v==null||v(),window.clearTimeout(y.current),y.current=window.setTimeout(()=>h(!1),1500))};return m?d.jsx($o,{label:g?i:r,size:"sm",className:f,onClick:()=>void x(),children:g?d.jsx(Pp,{}):d.jsx(Ep,{})}):d.jsx(Le,{variant:u,size:a,className:f,leadingIcon:g?d.jsx(Pp,{}):d.jsx(Ep,{}),"aria-live":"polite",onClick:()=>void x(),children:g?i:r})}function l2(){return d.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:d.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function u2({backdropClassName:t,bodyClassName:r,children:i,className:a,closeLabel:u="Close",eyebrow:f,isOpen:m,onClose:v,side:g="right",subtitle:h,title:y}){const x=I.useRef(null),C=I.useId(),N=I.useId(),{closeDialog:A,isTopDialog:E}=uv(m,x,v),M=m&&E,L=["as-drawer-backdrop",m?"as-drawer-backdrop--open":null,t].filter(Boolean).join(" "),F=["as-drawer",`as-drawer--${g}`,m?"as-drawer--open":null,a].filter(Boolean).join(" "),P=["as-drawer__body",r].filter(Boolean).join(" ");return I.useEffect(()=>{if(!m||!E)return;function j(D){const W=x.current;W&&(D.target instanceof Node&&W.contains(D.target)||D.target instanceof Element&&D.target.closest('[role="dialog"], [role="menu"]')!==null||A())}return document.addEventListener("pointerdown",j,!0),()=>document.removeEventListener("pointerdown",j,!0)},[A,m,E]),d.jsxs(d.Fragment,{children:[d.jsx("div",{"aria-hidden":!m,className:L,onClick:A}),d.jsx(Ac,{allowPinchZoom:!0,className:"as-drawer__scroll-lock",enabled:m&&E,children:d.jsx(Oc,{autoFocus:!0,className:"as-drawer__focus-lock",disabled:!m||!E,focusOptions:{preventScroll:!0},returnFocus:!1,children:d.jsxs("aside",{"aria-describedby":h?N:void 0,"aria-hidden":M?void 0:!0,"aria-labelledby":C,"aria-modal":M?"true":void 0,className:F,ref:x,role:"dialog",tabIndex:-1,children:[d.jsxs("header",{className:"as-drawer__header",children:[d.jsxs("div",{className:"as-drawer__titles",children:[f&&d.jsx("div",{className:"as-drawer__eyebrow",children:f}),d.jsx("h2",{className:"as-drawer__title",id:C,children:y}),h&&d.jsx("p",{className:"as-drawer__subtitle",id:N,children:h})]}),d.jsx("button",{type:"button",className:"as-drawer__close",onClick:A,"aria-label":u,children:d.jsx(l2,{})})]}),d.jsx("div",{className:P,children:i})]})})})]})}const c2=["M42.4461 10.2767H39.6752L35.9506 25.7053H38.2537L39.0994 21.902H43.0219L43.8495 25.7053H46.1346L42.4821 10.4203L42.4461 10.2767ZM42.59 19.9286H39.5132L41.0426 12.7525L42.59 19.9286Z","M53.9616 22.494L50.8668 10.2767H47.4841V25.7053H49.5893V13.506L52.6301 25.5618L52.6661 25.7053H56.0667V10.2767H53.9616V22.494Z","M57.7221 12.2681H61.1588V25.7053H63.3899V12.2681H66.8265V10.2767H57.7221V12.2681Z","M72.0265 16.7173H71.3788C70.9649 16.7173 70.6411 16.5917 70.3892 16.3226C70.1373 16.0535 70.0113 15.7485 70.0113 15.3359V13.7033C70.0113 13.3086 70.1552 12.9678 70.4611 12.6987C70.767 12.4116 71.1449 12.2681 71.6307 12.2681H75.1213V10.2767H71.8466C70.5511 10.2767 69.5435 10.5997 68.8418 11.2455C68.14 11.8914 67.7802 12.8601 67.7802 14.116V14.9412C67.7802 16.1791 68.104 17.1299 68.7518 17.7937C69.3995 18.4575 70.2992 18.7804 71.4148 18.7804H72.0625C72.4583 18.7804 72.7462 18.888 72.9262 19.1213C73.1241 19.3545 73.214 19.6595 73.214 20.0542V22.2967C73.214 22.6914 73.0701 23.0322 72.7642 23.3013C72.4583 23.5884 72.0805 23.7319 71.5947 23.7319H68.14V25.7233H71.3788C72.6743 25.7233 73.6819 25.4003 74.3836 24.7545C75.0853 24.1086 75.4452 23.1399 75.4452 21.8841V20.4668C75.4452 19.2289 75.1393 18.296 74.5455 17.6681C73.9518 17.0402 73.0881 16.7352 72.0265 16.7352V16.7173Z","M77.0825 25.7053H84.6576V23.7857H79.3317V18.7086H84.1178V16.7711H79.3317V12.2143H84.6576V10.2767H77.0825V25.7053Z","M86.3129 25.7053H93.888V23.7857H88.544V18.7086H93.3482V16.7711H88.544V12.2143H93.888V10.2767H86.3129V25.7053Z","M102.938 11.102C102.255 10.5459 101.211 10.2767 99.8976 10.2767H95.5253V25.7053H100.149C101.499 25.7053 102.489 25.4362 103.082 24.8801C103.694 24.3239 104 23.409 104 22.1173V13.811C104 12.5731 103.64 11.6581 102.938 11.102ZM100.347 23.7319H97.7564V12.2502H100.365C100.797 12.2502 101.121 12.3758 101.391 12.6269C101.643 12.8781 101.769 13.201 101.769 13.6316V22.3505C101.769 22.8349 101.661 23.1937 101.427 23.409C101.211 23.6243 100.833 23.7319 100.347 23.7319Z"],fv=["M12.5827 3.84445C13.2032 3.84445 13.7062 3.34146 13.7062 2.72099C13.7062 2.10052 13.2032 1.59753 12.5827 1.59753C11.9623 1.59753 11.4593 2.10052 11.4593 2.72099C11.4593 3.34146 11.9623 3.84445 12.5827 3.84445Z","M23.3679 3.84445C23.9884 3.84445 24.4914 3.34146 24.4914 2.72099C24.4914 2.10052 23.9884 1.59753 23.3679 1.59753C22.7474 1.59753 22.2445 2.10052 22.2445 2.72099C22.2445 3.34146 22.7474 3.84445 23.3679 3.84445Z","M8.0889 11.0346C8.70936 11.0346 9.21235 10.5316 9.21235 9.91112C9.21235 9.29065 8.70936 8.78766 8.0889 8.78766C7.46843 8.78766 6.96544 9.29065 6.96544 9.91112C6.96544 10.5316 7.46843 11.0346 8.0889 11.0346Z","M27.8617 11.0346C28.4822 11.0346 28.9852 10.5316 28.9852 9.91112C28.9852 9.29065 28.4822 8.78766 27.8617 8.78766C27.2413 8.78766 26.7383 9.29065 26.7383 9.91112C26.7383 10.5316 27.2413 11.0346 27.8617 11.0346Z","M6.29136 19.1235C6.91183 19.1235 7.41482 18.6205 7.41482 18C7.41482 17.3795 6.91183 16.8766 6.29136 16.8766C5.6709 16.8766 5.16791 17.3795 5.16791 18C5.16791 18.6205 5.6709 19.1235 6.29136 19.1235Z","M29.6593 19.1235C30.2797 19.1235 30.7827 18.6205 30.7827 18C30.7827 17.3795 30.2797 16.8766 29.6593 16.8766C29.0388 16.8766 28.5358 17.3795 28.5358 18C28.5358 18.6205 29.0388 19.1235 29.6593 19.1235Z","M7.19014 28.1111C7.81061 28.1111 8.31359 27.6081 8.31359 26.9877C8.31359 26.3672 7.81061 25.8642 7.19014 25.8642C6.56967 25.8642 6.06668 26.3672 6.06668 26.9877C6.06668 27.6081 6.56967 28.1111 7.19014 28.1111Z","M28.7605 28.1111C29.381 28.1111 29.884 27.6081 29.884 26.9877C29.884 26.3672 29.381 25.8642 28.7605 25.8642C28.14 25.8642 27.6371 26.3672 27.6371 26.9877C27.6371 27.6081 28.14 28.1111 28.7605 28.1111Z","M17.9753 12.3827C19.2163 12.3827 20.2222 11.2762 20.2222 9.91112C20.2222 8.54609 19.2163 7.43951 17.9753 7.43951C16.7344 7.43951 15.7284 8.54609 15.7284 9.91112C15.7284 11.2762 16.7344 12.3827 17.9753 12.3827Z","M17.9753 19.7975C19.7126 19.7975 21.121 18.188 21.121 16.2025C21.121 14.217 19.7126 12.6074 17.9753 12.6074C16.238 12.6074 14.8296 14.217 14.8296 16.2025C14.8296 18.188 16.238 19.7975 17.9753 19.7975Z","M17.9753 30.1333C20.209 30.1333 22.0198 27.719 22.0198 24.7408C22.0198 21.7625 20.209 19.3482 17.9753 19.3482C15.7416 19.3482 13.9309 21.7625 13.9309 24.7408C13.9309 27.719 15.7416 30.1333 17.9753 30.1333Z","M12.3264 2.40809C12.4993 2.26669 12.7542 2.29198 12.8956 2.4647L16.9401 7.40792C17.0815 7.58074 17.0562 7.83563 16.8835 7.9771C16.7106 8.1185 16.4558 8.09322 16.3143 7.92049L12.2698 2.97728C12.1284 2.80446 12.1537 2.54957 12.3264 2.40809Z","M23.055 2.4647C23.1965 2.29198 23.4514 2.26669 23.6242 2.40809C23.7969 2.54957 23.8222 2.80446 23.6808 2.97728L19.6364 7.92049C19.4949 8.09322 19.24 8.1185 19.0672 7.9771C18.8945 7.83563 18.8692 7.58074 19.0106 7.40792L23.055 2.4647Z","M7.73168 9.72198C7.83619 9.52458 8.08064 9.44939 8.27805 9.5539L15.9176 13.5983C16.1149 13.7029 16.1901 13.9473 16.0856 14.1447C15.9811 14.3421 15.7367 14.4173 15.5393 14.3128L7.89976 10.2683C7.70236 10.1638 7.62717 9.91938 7.73168 9.72198Z","M27.6726 9.5539C27.87 9.44939 28.1144 9.52458 28.219 9.72198C28.3235 9.91938 28.2483 10.1638 28.0509 10.2683L20.4114 14.3128C20.214 14.4173 19.9695 14.3421 19.865 14.1447C19.7605 13.9473 19.8357 13.7029 20.0331 13.5983L27.6726 9.5539Z","M14.7875 16.6988C15.0096 16.6756 15.2087 16.8371 15.2321 17.0591C15.2553 17.2812 15.0938 17.4803 14.8718 17.5037L6.3335 18.4024C6.11145 18.4257 5.91232 18.2642 5.88895 18.0421C5.8657 17.8201 6.02718 17.621 6.24924 17.5976L14.7875 16.6988Z","M21.1631 16.6988L29.7014 17.5976C29.9235 17.621 30.085 17.8201 30.0617 18.0421C30.0383 18.2642 29.8392 18.4257 29.6171 18.4024L21.0789 17.5037C20.8568 17.4803 20.6953 17.2812 20.7186 17.0591C20.742 16.8371 20.9411 16.6756 21.1631 16.6988Z","M15.1149 23.0231C15.319 22.9324 15.5578 23.0244 15.6485 23.2285C15.7392 23.4326 15.6472 23.6714 15.4432 23.7621L7.35427 27.3572C7.15017 27.4478 6.91133 27.3559 6.82063 27.1518C6.72997 26.9477 6.82192 26.7089 7.02601 26.6182L15.1149 23.0231Z","M20.3021 23.2285C20.3928 23.0244 20.6316 22.9324 20.8357 23.0231L28.9246 26.6182C29.1287 26.7089 29.2207 26.9477 29.13 27.1518C29.0393 27.3559 28.8005 27.4478 28.5964 27.3572L20.5075 23.7621C20.3034 23.6714 20.2114 23.4326 20.3021 23.2285Z"],hv="#10B981";function d2({height:t=24,className:r}){return d.jsxs("svg",{className:r,height:t,width:t*104/36,viewBox:"0 0 104 36",fill:"none",role:"img","aria-label":"Antseed",children:[fv.map(i=>d.jsx("path",{d:i,fill:hv},i)),c2.map(i=>d.jsx("path",{d:i,fill:"currentColor"},i))]})}function f2({size:t=24,className:r}){return d.jsx("svg",{className:r,height:t,width:t,viewBox:"4 0 28 32",fill:"none",role:"img","aria-label":"Antseed",children:fv.map(i=>d.jsx("path",{d:i,fill:hv},i))})}function No({className:t,height:r,radius:i,style:a,width:u,...f}){const m=["as-skeleton",t].filter(Boolean).join(" ");return d.jsx("div",{className:m,style:{...a,...r!==void 0?{height:r}:{},...i!==void 0?{borderRadius:i}:{},...u!==void 0?{width:u}:{}},...f})}function gk({title:t,description:r,actions:i}){return d.jsxs("header",{className:"as-page-header",children:[d.jsxs("div",{className:"as-page-header__text",children:[d.jsx("h1",{children:t}),r&&d.jsx("p",{children:r})]}),i&&d.jsx("div",{className:"as-page-header__actions",children:i})]})}function yk({title:t,description:r,actions:i,children:a,flush:u,className:f}){return d.jsxs("section",{className:["as-panel",f].filter(Boolean).join(" "),children:[(t||i)&&d.jsxs("div",{className:"as-panel__head",children:[d.jsxs("div",{children:[t&&d.jsx("h2",{className:"as-panel__title",children:t}),r&&d.jsx("p",{className:"as-panel__desc",children:r})]}),i&&d.jsx("div",{className:"as-panel__actions",children:i})]}),d.jsx(Sc,{className:"as-panel__card",children:d.jsx("div",{className:u?"as-panel__body as-panel__body--flush":"as-panel__body",children:a})})]})}function h2(t){return t!==null&&t>=1?"danger":t!==null&&t>=.8?"warning":"default"}function wk({label:t,value:r,sub:i,meter:a,tone:u}){const f=a==null?null:Math.max(0,Math.min(1,a));return d.jsxs(Sc,{className:"as-stat",children:[d.jsx("div",{className:"as-stat__label",children:t}),d.jsx("div",{className:"as-stat__value",children:r}),i&&d.jsx("div",{className:"as-stat__sub",children:i}),f!==null&&d.jsx("div",{className:`as-meter as-meter--${u??h2(f)}`,role:"meter","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(f*100),children:d.jsx("span",{style:{width:`${f*100}%`}})})]})}function xk({title:t,body:r,action:i,icon:a}){return d.jsxs("div",{className:"as-empty",children:[a&&d.jsx("div",{className:"as-empty__icon","aria-hidden":"true",children:a}),d.jsx("div",{className:"as-empty__title",children:t}),r&&d.jsx("div",{className:"as-empty__body",children:r}),i&&d.jsx("div",{className:"as-empty__action",children:i})]})}function Ni({rows:t=4,height:r=28}){return d.jsx("div",{className:"as-loading","aria-busy":"true","aria-label":"Loading",children:Array.from({length:t},(i,a)=>d.jsx(No,{height:r},a))})}function Sk({items:t}){return d.jsx("dl",{className:"as-details",children:t.map(([r,i],a)=>d.jsxs("div",{className:"as-details__row",children:[d.jsx("dt",{children:r}),d.jsx("dd",{children:i})]},a))})}function kk({code:t,label:r}){return d.jsxs("div",{className:"as-code",children:[d.jsxs("div",{className:"as-code__bar",children:[d.jsx("span",{className:"as-code__label",children:r}),d.jsx(Dc,{value:t})]}),d.jsx("pre",{children:d.jsx("code",{children:t})})]})}function Ck({secret:t,note:r="Copy it now. It will not be shown again."}){return d.jsxs("div",{className:"as-secret",children:[d.jsxs("div",{className:"as-secret__row",children:[d.jsx("code",{className:"as-secret__value",children:t}),d.jsx(Dc,{value:t})]}),d.jsx("p",{className:"as-secret__note",children:r})]})}function p2(t,r){return["as-field",r==="sm"?"as-field--sm":null,t].filter(Boolean).join(" ")}function m2(t,r){return["as-field__input",t,r?"as-field__input--mono":null].filter(Boolean).join(" ")}function v2({error:t,hint:r}){return t?d.jsx("span",{className:"as-field__error",children:t}):r?d.jsx("span",{className:"as-field__hint",children:r}):null}function g2({className:t,error:r,hint:i,id:a,label:u,size:f,mono:m,...v}){const g=I.useId(),h=a??v.name??g;return d.jsxs("label",{className:p2(t,f),htmlFor:h,children:[u&&d.jsx("span",{className:"as-field__label",children:u}),d.jsx("input",{id:h,className:m2(void 0,m),"aria-invalid":r?!0:void 0,...v}),d.jsx(v2,{error:r,hint:i})]})}const pv=I.createContext(()=>{});function mv(){return I.useContext(pv)}let y2=1;function w2({children:t}){const[r,i]=I.useState([]),a=I.useCallback((u,f="success")=>{const m=y2++;i(v=>[...v.slice(-3),{id:m,tone:f,text:u}]),window.setTimeout(()=>i(v=>v.filter(g=>g.id!==m)),4e3)},[]);return d.jsxs(pv.Provider,{value:a,children:[t,d.jsx("div",{className:"as-toasts",role:"status","aria-live":"polite",children:r.map(u=>d.jsx("div",{className:`as-toast as-toast--${u.tone}`,children:u.text},u.id))})]})}const x2="/console/api",S2="x-antseed-console";class Sa extends Error{constructor(i,a,u,f={}){super(u);gu(this,"details");this.status=i,this.code=a,this.name="ConsoleApiError",this.details=f}}function Lr(t,r){return t instanceof Sa&&(r===void 0||t.code===r)}const bp={buyer_policy_unsupported:"The buyer behind this gateway cannot apply routing policies yet. Update Antseed on the buyer host and restart it.",restart_unsupported:"The buyer cannot restart itself here. The change is saved; restart the buyer yourself to apply it.",reauth_required:"For this action, sign in again first.",config_unreadable:"The gateway could not read the buyer configuration file, so nothing was changed. Check the file on the gateway host.",operator_not_yours:"That wallet is not one of your sign-in methods. Add it as a sign-in method first, then authorize it.",reauth_wrong_member:"That passkey or wallet belongs to someone else. Confirm with one of your own sign-in methods.",reauth_unavailable:"You are signed in through Cloudflare Access, which cannot confirm this action. Sign in with a passkey or wallet instead (add one under Your sign-in methods first if you have none), then retry.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then retry.",reauth_other_credential:"Confirm with a different passkey or wallet than the one you are making the operator, then retry.",session_required:"Only an organization admin signed in to the console can change the export endpoint or content logging. Management tokens cannot.",otlp_headers_required:"You changed the endpoint, so the saved header values are not sent to it. Enter the header values again.",empty_allow_list:"This allow list is empty, so no seller could serve. Confirm to save it anyway.",last_credential:"You cannot remove your only sign-in method, or you could not sign in again. Add another passkey or wallet first.",credential_exists:"This passkey or wallet is already registered.",max_keys_reached:"You already have as many keys as you are allowed. Revoke one, or ask an admin to raise your limit."};function ka(t){return t instanceof Sa&&Object.hasOwn(bp,t.code)?bp[t.code]:t instanceof Error?t.message:typeof t=="string"?t:"Something went wrong."}function yr(t,r){return{...t,...r!=null&&r.confirmEmpty?{confirmEmpty:!0}:{},...r!=null&&r.acceptNarrowed?{acceptNarrowed:!0}:{}}}function ra(t){if(!t)return"";const r=new URLSearchParams;for(const[a,u]of Object.entries(t))u==null||u===""||r.set(a,String(u));const i=r.toString();return i?`?${i}`:""}async function k2(t){let r=`http_${t.status}`,i=t.statusText||`Request failed (${t.status})`,a={};try{const u=await t.json();u!=null&&u.error&&typeof u.error.code=="string"&&(r=u.error.code),u!=null&&u.error&&typeof u.error.message=="string"&&(i=u.error.message),u&&typeof u=="object"&&(a={...u.error,...u})}catch{}return new Sa(t.status,r,i,a)}function C2(t=(i,a)=>fetch(i,a),r=x2){async function i(h,y,x={}){const C={accept:"application/json"};h!=="GET"&&h!=="HEAD"&&(C[S2]="1");let A;x.body!==void 0&&(C["content-type"]="application/json",A=JSON.stringify(x.body));let E;try{E=await t(`${r}${y}${ra(x.query)}`,{method:h,headers:C,body:A,credentials:"same-origin"})}catch{throw new Sa(0,"network_error","Could not reach the gateway.")}if(!E.ok)throw await k2(E);return E.status===204?void 0:(E.headers.get("content-type")??"").includes("json")?await E.json():await E.text()}const a=(h,y)=>i("GET",h,{query:y}),u=(h,y)=>i("POST",h,{body:y??{}}),f=(h,y)=>i("PATCH",h,{body:y}),m=(h,y)=>i("PUT",h,{body:y}),v=h=>i("DELETE",h),g=encodeURIComponent;return{request:i,auth:{config:()=>a("/auth/config"),me:()=>a("/auth/me"),setup:h=>u("/auth/setup",{token:h}),invite:h=>u("/auth/invite",{token:h}),passkeyRegisterOptions:h=>u("/auth/passkey/register/options",{enrollment:h}),passkeyRegisterVerify:(h,y)=>u("/auth/passkey/register/verify",{enrollment:y,response:h}),passkeyLoginOptions:()=>u("/auth/passkey/login/options",{}),passkeyLoginVerify:h=>u("/auth/passkey/login/verify",{response:h}),walletNonce:h=>u("/auth/wallet/nonce",{address:h}),walletVerify:(h,y,x)=>u("/auth/wallet/verify",{message:h,signature:y,enrollment:x}),oidcStartUrl:h=>`${r}/auth/oidc/start${ra({enrollment:h})}`,oidcLinkUrl:()=>`${r}/auth/oidc/start?link=1`,reauthPasskeyOptions:()=>u("/auth/reauth/passkey/options",{}),reauthPasskeyVerify:h=>u("/auth/reauth/passkey/verify",{response:h}),reauthWalletNonce:h=>u("/auth/reauth/wallet/nonce",{address:h}),reauthWalletVerify:(h,y)=>u("/auth/reauth/wallet/verify",{message:h,signature:y}),apiKey:h=>u("/auth/api-key",{key:h}),logout:()=>u("/auth/logout")},members:{list:()=>a("/members"),update:(h,y,x)=>f(`/members/${g(h)}`,yr(y,x)),disable:h=>u(`/members/${g(h)}/disable`),enable:h=>u(`/members/${g(h)}/enable`),removeCredential:(h,y)=>v(`/members/${g(h)}/credentials/${g(y)}`)},invites:{list:()=>a("/invites"),create:h=>u("/invites",h),revoke:h=>v(`/invites/${g(h)}`)},workspaces:{list:()=>a("/workspaces"),get:h=>a(`/workspaces/${g(h)}`),create:(h,y)=>u("/workspaces",yr(h,y)),update:(h,y,x)=>f(`/workspaces/${g(h)}`,yr(y,x)),remove:h=>v(`/workspaces/${g(h)}`),members:h=>a(`/workspaces/${g(h)}/members`),setMember:(h,y,x)=>m(`/workspaces/${g(h)}/members/${g(y)}`,{role:x}),removeMember:(h,y)=>v(`/workspaces/${g(h)}/members/${g(y)}`)},keys:{list:(h={})=>a("/keys",h),create:(h,y)=>u("/keys",yr(h,y)),update:(h,y,x)=>f(`/keys/${g(h)}`,yr(y,x)),rotate:h=>u(`/keys/${g(h)}/rotate`),revoke:h=>u(`/keys/${g(h)}/revoke`)},adminTokens:{list:()=>a("/admin-tokens"),create:(h,y,x)=>u("/admin-tokens",{label:h,scope:y,...x!==void 0?{expiresInDays:x}:{}}),revoke:h=>v(`/admin-tokens/${g(h)}`)},usage:{report:h=>a("/usage",h),requests:h=>a("/requests",h),request:h=>a(`/requests/${g(h)}`),exportUrl:h=>`${r}/usage/export.csv${ra(h)}`},audit:{list:h=>a("/audit",h)},wallet:{get:h=>a(`/workspaces/${g(h)}/wallet`),cardLink:(h,y,x)=>u(`/workspaces/${g(h)}/wallet/card-link`,{amountUsd:y,provider:x}),watch:(h,y)=>u(`/workspaces/${g(h)}/wallet/watch`,{mode:y}),deposits:h=>a(`/workspaces/${g(h)}/deposits`),addDeposit:(h,y)=>u(`/workspaces/${g(h)}/deposits`,{txHash:y}),approveDeposit:(h,y,x)=>m(`/workspaces/${g(h)}/deposits/${g(y)}/approval`,{note:x}),unapproveDeposit:(h,y)=>i("DELETE",`/workspaces/${g(h)}/deposits/${g(y)}/approval`),operator:(h,y=!1)=>a(`/workspaces/${g(h)}/wallet/operator`,{fresh:y?1:void 0}),operators:()=>a("/wallet/operators"),operatorSync:(h,y)=>u(`/workspaces/${g(h)}/wallet/operator/sync`,y?{txHash:y}:{}),operatorAuth:(h,y)=>u(`/workspaces/${g(h)}/wallet/operator-auth`,{operator:y}),channels:(h,y=!1,x=!1)=>a(`/workspaces/${g(h)}/channels`,{all:y?1:void 0,fresh:x?1:void 0}),closeChannel:(h,y)=>u(`/workspaces/${g(h)}/channels/close`,{peerId:y}),rewards:h=>a(`/workspaces/${g(h)}/rewards`),chain:()=>a("/chain")},chat:{models:h=>a("/chat/models",{workspace:h}),context:h=>a("/chat/context",{workspace:h}),threads:h=>a("/chat/threads",{workspace:h}),thread:(h,y)=>a(`/chat/threads/${g(y)}`,{workspace:h}),deleteThread:(h,y)=>v(`/chat/threads/${g(y)}${ra({workspace:h})}`)},network:{peers:()=>a("/peers"),models:()=>a("/models"),routePreview:h=>a("/route-preview",h),gatewayPolicy:()=>a("/routing"),buyerLimits:()=>a("/routing/buyer-limits"),setGatewayPolicy:(h,y)=>i("PUT","/routing",{body:h,query:{confirmEmpty:y!=null&&y.confirmEmpty?1:void 0,acceptNarrowed:y!=null&&y.acceptNarrowed?1:void 0}}),peerLists:()=>a("/peer-lists"),createPeerList:h=>u("/peer-lists",h),updatePeerList:(h,y)=>f(`/peer-lists/${g(h)}`,y),removePeerList:h=>v(`/peer-lists/${g(h)}`)},presets:{list:h=>a("/presets",{workspace:h}),create:(h,y)=>u("/presets",yr(h,y)),update:(h,y,x)=>f(`/presets/${g(h)}`,yr(y,x)),remove:h=>v(`/presets/${g(h)}`)},settings:{status:()=>a("/status"),get:()=>a("/settings"),updateBuyer:h=>f("/settings/buyer",h),setObservability:h=>m("/settings/observability",h)}}}function vv(t){return!!t&&"ownerRoutingPolicy"in t}const fe=C2();function Ca(t){return t.orgRole==="owner"||t.orgRole==="admin"}function Fc(t){return Ca(t)||t.workspaceRole==="admin"}const $c=[{id:"overview",label:"Overview",group:"Workspace",access:"member"},{id:"chat",label:"Chat",group:"Workspace",access:"member"},{id:"activity",label:"Activity",group:"Workspace",access:"member"},{id:"logs",label:"Logs",group:"Workspace",access:"member"},{id:"keys",label:"Keys",group:"Workspace",access:"member"},{id:"presets",label:"Presets",group:"Workspace",access:"member"},{id:"wallet",label:"Wallet & Funding",group:"Money",access:"workspaceAdmin"},{id:"rewards",label:"Rewards",group:"Money",access:"workspaceAdmin"},{id:"providers",label:"Providers",group:"Routing",access:"member"},{id:"models",label:"Models",group:"Routing",access:"member"},{id:"routing",label:"Routing",group:"Routing",access:"workspaceAdmin"},{id:"members",label:"Members",group:"Organization",access:"workspaceAdmin"},{id:"workspaces",label:"Workspaces",group:"Organization",access:"workspaceAdmin"},{id:"audit",label:"Audit log",group:"Organization",access:"orgAdmin"},{id:"settings",label:"Settings",group:"Organization",access:"orgAdmin"}];function zc(t,r){const i=$c.find(a=>a.id===t);return i?i.access==="orgAdmin"?Ca(r):i.access==="workspaceAdmin"?Fc(r):!0:!1}function _2(t){return $c.filter(r=>zc(r.id,t))}function E2(t,r){const i=t.me.workspaces.find(a=>a.workspace.id===r);return{orgRole:t.me.member.orgRole,workspaceRole:(i==null?void 0:i.role)??null}}const Uc={owner:"Owner",admin:"Admin",member:"Member"};function P2(t,r){return r?`${t}/${encodeURIComponent(r)}`:t}function b2(t){const r=t.join("/");return r===""?null:r}function j2(t,r){return t==="network"?P2("providers",b2(r)):null}const gv=I.createContext(null);function ir(){const t=I.useContext(gv);if(!t)throw new Error("useConsole outside the console shell");return t}const yv="antseed-console-workspace";function T2(){try{return localStorage.getItem(yv)}catch{return null}}function R2(t){try{localStorage.setItem(yv,t)}catch{}}function jp(t,r){const i=t.workspaces.map(a=>a.workspace);return i.find(a=>a.id===r)??i.find(a=>a.isDefault)??i[0]??null}function _k(){const{workspace:t,viewer:r,me:i}=ir();return Fc(r)?{workspace:t.id}:{workspace:t.id,member:i.member.id}}const ic="antseed-console-theme";function wv(){try{const t=localStorage.getItem(ic);return t==="light"||t==="dark"?t:"system"}catch{return"system"}}function N2(){const t=wv();t!=="system"&&(document.documentElement.dataset.theme=t)}function I2(){const[t,r]=I.useState(wv);return I.useEffect(()=>{t==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=t;try{t==="system"?localStorage.removeItem(ic):localStorage.setItem(ic,t)}catch{}},[t]),[t,r]}function Ek(){var r;const t=document.documentElement.dataset.theme;return t?t==="dark":((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)??!1}const Io="/console";function M2(t){try{return decodeURIComponent(t)}catch{return t}}function xv(t,r="",i=""){const u=(t.startsWith(Io)?t.slice(Io.length):t).split("/").filter(Boolean).map(M2);return{page:u[0]??"",rest:u.slice(1),query:new URLSearchParams(r),hash:i.replace(/^#/,"")}}function Tp(){return xv(window.location.pathname,window.location.search,window.location.hash)}const oc=new Set;function an(t,r={}){const i=t.startsWith("/")?`${Io}${t}`:`${Io}/${t}`;r.replace?window.history.replaceState(null,"",i):window.history.pushState(null,"",i),oc.forEach(a=>a())}function Bc(){const[t,r]=I.useState(Tp);return I.useEffect(()=>{const i=()=>r(Tp());return oc.add(i),window.addEventListener("popstate",i),()=>{oc.delete(i),window.removeEventListener("popstate",i)}},[]),t}function _a(t){return`${Io}/${t.replace(/^\//,"")}`}function Hc(t){return r=>{r.defaultPrevented||r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||(r.preventDefault(),an(t))}}const L2=6;function Xe(t){if(t==null||t==="")return 0;const r=Number(t);return Number.isFinite(r)?r:0}function O2(t,r={}){if(t==null)return"—";const i=typeof t=="number"?t:Xe(t),a=i<0?"-":"",u=Math.abs(i);return r.compact&&u>=1e4?`${a}$${new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(u)}`:u!==0&&u<1e-4?`${a}<$0.0001`:u!==0&&u<.01?`${a}$${u.toFixed(4).replace(/0+$/,"").replace(/\.$/,"")}`:`${a}$${u.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function Pk(t){const r=t.trim().replace(/^\$/,"").replace(/,/g,"");if(r==="")return null;const i=/^(\d+)(?:\.(\d{0,6}))?$/.exec(r);if(!i)throw new Error("Use a dollar amount like 5 or 12.50 (up to 6 decimals).");const a=i[1].replace(/^0+(?=\d)/,""),u=(i[2]??"").padEnd(L2,"0");return`${a}.${u}`}function bk(t){return t==null?"":t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t}function A2(t,r={}){return t==null||!Number.isFinite(t)?"—":r.compact&&Math.abs(t)>=1e4?new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(t):t.toLocaleString("en-US")}function jk(t){return A2(t,{compact:!0})}function gi(t){return t==null?"—":t===0?"Free":t<.01?`$${t.toLocaleString("en-US",{maximumSignificantDigits:2})}`:`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:t<1?3:2})}`}function Tk(t){return t?t.min===t.max?gi(t.min):`${t.min===0?"$0":gi(t.min)}–${gi(t.max)}`:"—"}function Rk(t){return t==null?"—":t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)} s`:`${Math.round(t)} ms`}function Nk(t){return t==null?"—":`${Math.round(t)} tok/s`}function Ik(t){if(t==null)return"—";const r=Math.floor(t/6e4);if(r<1)return"<1 min";if(r<60)return`${r} min`;const i=Math.floor(r/60);return i<48?`${i} h ${r%60} min`:`${Math.floor(i/24)} d ${i%24} h`}function D2(t){return t?new Date(t).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function F2(t){return t?new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"—"}function Rp(t,r=Date.now()){if(!t)return"Never";const i=r-t,a=i<0,u=Math.abs(i),f=6e4,m=60*f,v=24*m;let g;if(u<f)return a?"in a moment":"just now";if(u<m)g=`${Math.round(u/f)} min`;else if(u<v)g=`${Math.round(u/m)} h`;else if(u<30*v)g=`${Math.round(u/v)} d`;else return F2(t);return a?`in ${g}`:`${g} ago`}function sn(t,r=6,i=4){return t?t.length<=r+i+1?t:`${t.slice(0,r)}…${t.slice(-i)}`:"—"}const Sv=["daily","weekly","monthly","total"],Mk={daily:"Daily",weekly:"Weekly",monthly:"Monthly",total:"Total"};function $2(t){if(!t)return"No limits";const r={daily:"/day",weekly:"/week",monthly:"/month",total:" total"},i=Sv.filter(a=>t[a]!==null).map(a=>`${O2(t[a])}${r[a]}`);return i.length>0?i.join(" · "):"No limits"}function Lk(t,r=Date.now()){const i=new Date(r),a=Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate());if(t==="daily")return a;if(t==="monthly")return Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1);const u=(i.getUTCDay()+6)%7;return a-u*864e5}const z2=15*6e4;function U2(t){return t.status==="active"||t.status==="open"||t.status==="closing"||t.status==="withdrawable"}function Ok(t,r){return t.status==="withdrawable"?"withdraw":t.status!=="active"&&t.status!=="open"?"none":t.canCooperativeClose&&!r?"cooperative":"on-chain"}function B2(t){return t.closeRequestedAt===null?null:t.closeRequestedAt+z2}function H2(t,r=Date.now()){const i=Math.max(0,t-r);return i>=6e4?`${Math.ceil(i/6e4)} min`:`${Math.ceil(i/1e3)} s`}function Ak(t,r=Date.now()){if(t.status==="closing"){const i=B2(t);return i===null?"closing":`closing · ${H2(i,r)} left`}return t.status==="withdrawable"?"ready to withdraw":t.status==="timedout"?"withdrawn":t.status}function Dk(t){return t.status==="active"||t.status==="open"?"success":t.status==="withdrawable"?"warning":t.status==="closing"?"info":"neutral"}function W2(t){return Math.max(0,Xe(t.reserved)-Xe(t.spent))}function V2(t){const r=t.filter(i=>i.status==="withdrawable");return{count:r.length,amount:r.reduce((i,a)=>i+W2(a),0)}}function Fk(t){return t.filter(U2).reduce((r,i)=>r+Math.max(0,Xe(i.spent)-Xe(i.settled??"0")),0)}function $k(t){return Xe(t.reserved)>0&&Xe(t.available)<=0&&Xe(t.walletUsdc)<=0}function q2(t){const r=Xe(t.walletUsdc);if(r<=0)return!1;const i=t.creditLimit===null?0:Xe(t.creditLimit),a=Math.max(0,i-Xe(t.available)-Xe(t.reserved));return!(i>0&&r>a)}function zk(t){const r=Xe(t.walletUsdc),i=t.creditLimit===null?0:Xe(t.creditLimit),a=Math.max(0,i-Xe(t.available)-Xe(t.reserved));return i>0&&r>a?"Credits are at or near the credit limit, so this USDC waits in the workspace wallet and tops the credits up as they are spent.":"This USDC is in the workspace wallet and moves into the credits automatically."}function Uk(t){const r=t.toLowerCase();return r.includes("already in flight")?"A close request to this seller is still waiting for an answer (it gives up after a minute). Close on chain instead, or try again shortly.":r.includes("busy")||r.includes("still processing")?"The seller is still processing a request. Try again shortly, or close on chain.":r.includes("pending_auth")||r.includes("latest payment authorization")?"The seller is waiting for the latest payment authorization. Try again shortly, or close on chain.":r.includes("no_channel")||r.includes("no longer has this channel")?"The seller no longer has this channel open. It may already be settled; refresh the list, or close on chain.":r.includes("did not answer")||r.includes("not connected")||r.includes("could not be found")||r.includes("disconnected")?"The seller did not answer. Close on chain instead: it does not need the seller.":r.includes("does not support cooperative close")?"This seller does not support a cooperative close. Close on chain instead.":`${t} The channel is unchanged; close on chain instead.`}const K2={usdc:["usdc","USDC","usdcToken"],deposits:["deposits","AntseedDeposits","antseedDeposits"],usageRewards:["usageRewards","AntseedUsageRewards","UsageRewards"],channels:["channels","AntseedChannels","antseedChannels"]};function Bk(t,r){if(!t)return null;const i=Object.entries(t.contracts);for(const a of K2[r]){const u=i.find(([f])=>f.toLowerCase()===a.toLowerCase());if(u&&/^0x[0-9a-fA-F]{40}$/.test(u[1]))return u[1]}return null}function Mo(t,r){return!!t&&!!r&&t.toLowerCase()===r.toLowerCase()}const Q2="0x0000000000000000000000000000000000000000";function Wc(t){return!!t&&/^0x[0-9a-fA-F]{40}$/.test(t)&&t.toLowerCase()!==Q2}function Hk(t,r){return t!=null&&t.explorerUrl?`${t.explorerUrl.replace(/\/+$/,"")}/tx/${r}`:null}const Pe={group:t=>[t],me:["me"],authConfig:["auth-config"],status:["status"],settings:["settings"],workspaces:["workspaces","list"],workspace:t=>["workspaces","detail",t],workspaceMembers:t=>["workspaces","members",t],members:["members","list"],invites:["invites"],keys:t=>["keys","list",t],usage:t=>["usage",t],requests:t=>["requests","list",t],request:t=>["requests","detail",t],audit:t=>["audit",t],wallet:t=>["wallet",t],deposits:t=>["deposits",t],channels:(t,r)=>["channels",t,r],operators:["wallet-operators"],rewards:t=>["rewards",t],chain:["chain"],chatModels:t=>["chat-models",t],chatContext:t=>["chat-context",t],chatThreads:t=>["chat-threads",t],chatThread:(t,r)=>["chat-thread",t,r],peers:["peers"],models:["models"],peerLists:["peer-lists"],gatewayPolicy:["routing","gateway"],buyerLimits:["routing","buyer-limits"],routePreview:t=>["routing","preview",t],presets:t=>["presets",t],adminTokens:["admin-tokens"]},Wk=["routing","workspaces","members","keys","presets"];function G2(t,r=fe){return{queryKey:Pe.workspace(t),queryFn:()=>r.workspaces.get(t)}}function Vk(t,r=!0){return De({...G2(t),enabled:r})}function qk(t=!0){return De({queryKey:Pe.peers,queryFn:fe.network.peers,staleTime:3e4,enabled:t})}function Kk(){return De({queryKey:Pe.models,queryFn:fe.network.models,staleTime:3e4})}function Qk(t=!0){return De({queryKey:Pe.peerLists,queryFn:fe.network.peerLists,staleTime:3e4,enabled:t})}function Gk(){return De({queryKey:Pe.workspaces,queryFn:fe.workspaces.list})}function Yk(t,r=!0){return De({queryKey:Pe.workspaceMembers(t),queryFn:()=>fe.workspaces.members(t),enabled:r})}function Zk(t=!0){return De({queryKey:Pe.members,queryFn:fe.members.list,enabled:t})}function Xk(){return De({queryKey:Pe.invites,queryFn:fe.invites.list})}function Jk(t,r=!0){return De({queryKey:Pe.keys(t),queryFn:()=>fe.keys.list(t),enabled:r})}function eC(t,r=!0){return De({queryKey:Pe.presets(t),queryFn:()=>fe.presets.list(t),enabled:r})}function tC(t,r=!0){return De({queryKey:Pe.wallet(t),queryFn:()=>fe.wallet.get(t),enabled:r,refetchInterval:i=>i.state.data&&q2(i.state.data)?5e3:!1})}function nC(){return De({queryKey:Pe.gatewayPolicy,queryFn:fe.network.gatewayPolicy})}function rC(){return De({queryKey:Pe.buyerLimits,queryFn:fe.network.buyerLimits})}function iC(){return De({queryKey:Pe.adminTokens,queryFn:fe.adminTokens.list})}function Y2(){return De({queryKey:Pe.me,queryFn:fe.auth.me})}function Vc(t=!0){return De({queryKey:Pe.authConfig,queryFn:fe.auth.config,enabled:t})}function qc(){return De({queryKey:Pe.status,queryFn:fe.settings.status,refetchInterval:3e4})}function oC(t=!0){return De({queryKey:Pe.chain,queryFn:fe.wallet.chain,staleTime:1/0,enabled:t})}function sC(t){const r=new Set;for(const i of t??[])for(const a of i.services)r.add(a.service);return[...r].sort()}const kv=t=>["wallet-operator",t],Cv={get:(t,r=!1)=>fe.wallet.operator(t,r),sync:(t,r)=>fe.wallet.operatorSync(t,r),authorize:(t,r)=>fe.wallet.operatorAuth(t,r)};function aC(t,r=!0){return De({queryKey:kv(t),queryFn:()=>Cv.get(t),staleTime:3e4,enabled:r})}function Z2(t=!0){return De({queryKey:Pe.operators,queryFn:()=>fe.wallet.operators(),staleTime:6e4,enabled:t})}function X2(t){return(t==null?void 0:t.relation)==="none"}function lC(t){const r=rr(),i=a=>{r.setQueryData(kv(t),a),r.invalidateQueries({queryKey:Pe.operators}),r.invalidateQueries({queryKey:Pe.wallet(t)}),r.invalidateQueries({queryKey:Pe.rewards(t)})};return{apply:i,refresh:async()=>i(await Cv.get(t,!0))}}function uC(t,r){const i=t.operator,a=sn(i),u=Wc(i)&&Mo(r,i),f=m=>u?{canManage:!0,manageHint:null}:{canManage:!1,manageHint:`Only ${m} can transfer or remove it: connect ${a} to do so.`};switch(t.relation){case"none":return{tone:"warning",badge:"Not set",title:"No authorized wallet",summary:t.canAuthorize?"Authorize one of your wallets to withdraw funds and claim ANTS rewards. Requests keep working meanwhile.":"Nobody can withdraw funds or claim ANTS rewards until the organization owner authorizes a wallet.",body:t.canAuthorize?"Nobody can withdraw this workspace's funds or claim its ANTS rewards until you authorize one of your wallets. Requests keep working meanwhile.":"Nobody can withdraw this workspace's funds or claim its ANTS rewards until one is authorized. Only the organization owner can authorize a wallet; requests keep working meanwhile.",canAuthorize:t.canAuthorize,canManage:!1,manageHint:null,canLink:!1};case"self":return{tone:"info",badge:"Workspace wallet",title:"The workspace wallet authorizes itself",summary:"Withdrawals and rewards stay in the wallet the gateway holds.",body:"Withdrawals and rewards stay in the wallet the gateway holds. To hand the role to a personal wallet, run `antseed gateway workspace operator transfer <workspace> <address>` on the gateway host (the workspace wallet pays the gas).",canAuthorize:!1,canManage:!1,manageHint:null,canLink:!1};case"yours":return{tone:"success",badge:"Your wallet",title:`Your wallet ${a}`,summary:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",body:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",canAuthorize:!1,canLink:!1,...f("this wallet")};case"member":{const m=t.memberLabel?`${t.memberLabel}'s wallet`:"Another member's wallet";return{tone:"info",badge:t.memberLabel?t.memberLabel:"Member",title:`${m} ${a}`,summary:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",body:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",canAuthorize:!1,canLink:!1,...f(t.memberLabel?`${t.memberLabel}'s wallet`:"that member's wallet")}}case"unknown":return{tone:"info",badge:"Not linked to a console member",title:`Authorized wallet ${a}`,summary:"Withdrawals and ANTS rewards go to this wallet. If it is yours, link it to your account to manage it here.",body:"No member of this gateway signs in with this address, yet withdrawals and ANTS rewards go to it, and only it can transfer or remove the role: not the gateway, not the organization owner. If nobody on your team controls it, do not add more than you plan to spend (the gateway can still spend the balance on requests, but it cannot be withdrawn). Ask whoever controls it to transfer the role, or move to a new workspace with a fresh wallet.",canAuthorize:!1,canLink:!0,...f("that wallet")}}}function cC(t,r,i){if(!t)return{ok:!1,reason:"Checking the authorized wallet…",operator:null};const a=Wc(t.operator)?t.operator:null;return a?t.relation==="self"?{ok:!1,operator:a,reason:`This workspace's authorized wallet is the gateway-held wallet itself, so a browser wallet cannot ${i}. Use the antseed CLI on the gateway host, or transfer the role to a personal wallet.`}:r?Mo(r,a)?{ok:!0,operator:a,reason:null}:{ok:!1,operator:a,reason:`The connected wallet ${sn(r)} is not the authorized wallet ${sn(a)}. Switch to ${sn(a)} in your wallet to ${i}.`}:{ok:!1,operator:a,reason:`Connect the authorized wallet ${sn(a)} to ${i}. Funds go to that wallet.`}:{ok:!1,operator:null,reason:`Only the authorized wallet can ${i}, and none is set. ${t.canAuthorize?"Authorize one of your wallets under Authorized wallet.":"Ask the organization owner to authorize one."}`}}function dC(t,r=Date.now()){return t.eligibleWallets.map(i=>({...i,ready:i.eligibleAt<=r}))}function fC(t,r,i=Date.now()){if(!t.canAuthorize)return t.relation==="none"?"Only the organization owner can authorize a wallet.":"A wallet is already authorized; only it can transfer the role.";if(!r)return"Connect the wallet you want to authorize.";const a=t.eligibleWallets.find(u=>Mo(u.address,r));return a?a.eligibleAt>i?`${sn(r)} was added as a sign-in method recently. For your safety it can be authorized from ${D2(a.eligibleAt)}.`:null:`${sn(r)} is not one of your sign-in methods. Add it under Your sign-in methods first; it can be authorized 24 hours later.`}const _v={OperatorAlreadySet:{message:"Another wallet was authorized in the meantime. The panel now shows the current authorized wallet.",refresh:!0},InvalidNonce:{message:"The authorization expired: the operator nonce changed on chain. Start again to get a fresh authorization.",refresh:!0},InvalidSignature:{message:"The contract rejected the gateway's signature. The gateway and your wallet may be on different chains or deposits contracts.",refresh:!1},NotAuthorized:{message:"The connected wallet is not (or no longer) the authorized wallet. The panel now shows the current one.",refresh:!0},NotRewardRecipient:{message:"Only the authorized wallet can claim. The panel now shows the current one.",refresh:!0},RewardRecipientUnavailable:{message:"No authorized wallet is set, so rewards cannot be claimed yet.",refresh:!0},InsufficientBalance:{message:"Not enough available balance; funds reserved in open channels cannot be withdrawn.",refresh:!0},InvalidAddress:{message:"The contract rejected the address.",refresh:!1},ChannelNotActive:{message:"This channel is already settled or closed; nothing is left to do. The list now shows it.",refresh:!0},CloseAlreadyRequested:{message:"A close was already requested for this channel. The list now shows when the reserve can be withdrawn.",refresh:!0},CloseNotReady:{message:"The 15-minute grace period has not ended yet. Withdraw once the countdown reaches zero.",refresh:!0}};function J2(t){const r=new Set;let i=t;for(;i&&typeof i=="object"&&!r.has(i);){r.add(i);const u=i.data;if(u&&typeof u.errorName=="string")return u.errorName;i=i.cause}const a=t instanceof Error?`${t.message} ${t.shortMessage??""}`:String(t??"");return Object.keys(_v).find(u=>a.includes(u))??null}function hC(t){const r=J2(t);return r?_v[r]??null:null}class ko extends Error{constructor(r,i,a=!1){super(r),this.refresh=i,this.retryAuth=a,this.name="OperatorPreflightError"}}function pC(t,r,i){if(t.chainId!==void 0&&t.chainId!==i.chainId)throw new ko(`The gateway signed for chain ${t.chainId} but the console is set up for chain ${i.chainId}.`,!1);if(t.depositsContract&&i.depositsContract&&!Mo(t.depositsContract,i.depositsContract))throw new ko("The gateway signed for a different deposits contract than the one the console reports. Reload the page.",!1);if(t.operator&&!Mo(t.operator,i.operator))throw new ko(`The authorization is for ${sn(t.operator)}, not ${sn(i.operator)}.`,!1);if(Wc(r.operator))throw new ko(`An authorized wallet is already set (${sn(r.operator)}). The panel now shows it.`,!0);if(r.nonce.toString()!==t.nonce)throw new ko("The operator nonce changed since the gateway signed. Getting a fresh authorization…",!0,!0)}function ex(t,r=!0){return De({queryKey:Pe.channels(t,!1),queryFn:()=>fe.wallet.channels(t,!1),enabled:r})}function Ev(){const{workspace:t,viewer:r}=ir(),i=Fc(r),a=Z2(i),u=ex(t.id,i),f=a.data??[],m=new Set(f.filter(X2).map(y=>y.workspaceId)),v=f.find(y=>y.workspaceId===t.id),g=V2(u.data??[]),h=m.has(t.id);return{missingOperator:m,currentMissingOperator:h,canAuthorize:(v==null?void 0:v.canAuthorize)??!1,withdrawable:g,wallet:h||g.count>0}}const Pv=["pointerdown","mousedown","pointerup","mouseup","click"],sc=new WeakMap;function bv(t,r,i){Kc(t);let a=u=>{let f=u.target;t.contains(f)&&((!i||i(f))&&(u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation()),u.type==="click"&&(r==null||r(u)))};for(let u of Pv)document.addEventListener(u,a,!0);sc.set(t,a)}function Kc(t){let r=sc.get(t);if(r){for(let i of Pv)document.removeEventListener(i,r,!0);sc.delete(t)}}function tx(t,r){let i=t.wrapper.getBoundingClientRect();return{width:i.width+r,height:i.height+r,realWidth:i.width,realHeight:i.height}}function Np(t,r){let{elementDimensions:i,popoverDimensions:a,popoverPadding:u,popoverArrowDimensions:f}=r;return t==="start"?Math.max(Math.min(i.top-u,window.innerHeight-a.realHeight-f.width),f.width):t==="end"?Math.max(Math.min(i.top-(a==null?void 0:a.realHeight)+i.height+u,window.innerHeight-(a==null?void 0:a.realHeight)-f.width),f.width):t==="center"?Math.max(Math.min(i.top+i.height/2-(a==null?void 0:a.realHeight)/2,window.innerHeight-(a==null?void 0:a.realHeight)-f.width),f.width):0}function Ip(t,r){let{elementDimensions:i,popoverDimensions:a,popoverPadding:u,popoverArrowDimensions:f}=r;return t==="start"?Math.max(Math.min(i.left-u,window.innerWidth-a.realWidth-f.width),f.width):t==="end"?Math.max(Math.min(i.left-(a==null?void 0:a.realWidth)+i.width+u,window.innerWidth-(a==null?void 0:a.realWidth)-f.width),f.width):t==="center"?Math.max(Math.min(i.left+i.width/2-(a==null?void 0:a.realWidth)/2,window.innerWidth-(a==null?void 0:a.realWidth)-f.width),f.width):0}function Qc(t,r,i){let{align:a,side:u}=i,f=i.centered?"over":u,m=i.padding,v=tx(t,i.offset),g=t.arrow.getBoundingClientRect(),h=r.getBoundingClientRect(),y=h.top-v.height,x=y>=0,C=window.innerHeight-(h.bottom+v.height),N=C>=0,A=h.left-v.width,E=A>=0,M=window.innerWidth-(h.right+v.width),L=M>=0,F=!x&&!N&&!E&&!L,P=f;if(f==="top"&&x?L=E=N=!1:f==="bottom"&&N?L=E=x=!1:f==="left"&&E?L=x=N=!1:f==="right"&&L&&(E=x=N=!1),f==="over"){let j=window.innerWidth/2-v.realWidth/2,D=window.innerHeight/2-v.realHeight/2;t.wrapper.style.left=`${j}px`,t.wrapper.style.right="auto",t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto"}else if(F){let j=window.innerWidth/2-(v==null?void 0:v.realWidth)/2;t.wrapper.style.left=`${j}px`,t.wrapper.style.right="auto",t.wrapper.style.bottom="10px",t.wrapper.style.top="auto"}else if(E){let j=Math.min(A,window.innerWidth-(v==null?void 0:v.realWidth)-g.width),D=Np(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.left=`${j}px`,t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",P="left"}else if(L){let j=Math.min(M,window.innerWidth-(v==null?void 0:v.realWidth)-g.width),D=Np(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.right=`${j}px`,t.wrapper.style.top=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.left="auto",P="right"}else if(x){let j=Math.min(y,window.innerHeight-v.realHeight-g.width),D=Ip(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.top=`${j}px`,t.wrapper.style.left=`${D}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",P="top"}else if(N){let j=Math.min(C,window.innerHeight-(v==null?void 0:v.realHeight)-g.width),D=Ip(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.left=`${D}px`,t.wrapper.style.bottom=`${j}px`,t.wrapper.style.top="auto",t.wrapper.style.right="auto",P="bottom"}rx(t,F?"over":P,a,r),[...t.wrapper.classList].filter(j=>j.startsWith("driver-popover-side-")||j.startsWith("driver-popover-align-")).forEach(j=>t.wrapper.classList.remove(j)),t.wrapper.classList.add(`driver-popover-side-${P}`),t.wrapper.classList.add(`driver-popover-align-${a}`)}function Mp(t,r,i,a,u,f=10){let m=a-i;return t<=i&&r>=a?u==="start"?15+f/2:u==="end"?m-15-f/2:m/2:(Math.min(Math.max(t,i),a)+Math.min(Math.max(r,i),a))/2-i}function Lp(t,r,i=10){let a=r-15-i;if(a<15)return Math.max(0,(r-i)/2);let u=t-i/2;return Math.min(Math.max(u,15),a)}function nx(t,r,i){return t==="left"||t==="right"?r.bottom>i.top&&r.top<i.bottom?t:r.bottom<=i.top?"bottom":"top":r.right>i.left&&r.left<i.right?t:r.right<=i.left?"right":"left"}function rx(t,r,i,a){let u=t.arrow;if(u.className="driver-popover-arrow",u.style.top="",u.style.right="",u.style.bottom="",u.style.left="",r==="over"){u.classList.add("driver-popover-arrow-none");return}let f=a.getBoundingClientRect(),m=t.wrapper.getBoundingClientRect(),v=nx(r,f,m);u.classList.add(`driver-popover-arrow-side-${v}`);let g=u.getBoundingClientRect().width||10;if(v==="left"||v==="right"){let h=Mp(f.top,f.bottom,m.top,m.bottom,i,g);u.style.top=`${Lp(h,m.height,g)}px`}else{let h=Mp(f.left,f.right,m.left,m.right,i,g);u.style.left=`${Lp(h,m.width,g)}px`}}function ma(t){return typeof t=="function"?t():typeof t=="string"?document.querySelector(t):t}function ix(t){let r=window.getComputedStyle(t);return[r.overflow,r.overflowX,r.overflowY].some(i=>i==="auto"||i==="scroll")}function ia(t,r,i,a){return(t/=a/2)<1?i/2*t*t+r:-i/2*(--t*(t-2)-1)+r}function jv(t){let r='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return t.flatMap(i=>{let a=i.matches(r),u=Array.from(i.querySelectorAll(r));return[...a?[i]:[],...u]}).filter(i=>getComputedStyle(i).pointerEvents!=="none"&&ax(i))}function Tv(t,r){if(!t||sx(t))return;let i=t.offsetHeight>window.innerHeight;t.scrollIntoView({behavior:!r||ox(t)?"auto":"smooth",inline:"center",block:i?"start":"center"})}function ox(t){if(!t||!t.parentElement)return;let r=t.parentElement;return r.scrollHeight>r.clientHeight}function sx(t){let r=t.getBoundingClientRect();return r.top>=0&&r.left>=0&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&r.right<=(window.innerWidth||document.documentElement.clientWidth)}function ax(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function Rv(t){t&&(t.wrapper.style.display="none")}function lx(t,r){var E;let i=cx();document.body.appendChild(i.wrapper);let{title:a,description:u,showButtons:f,disableButtons:m,showProgress:v,nextBtnText:g,prevBtnText:h,progressText:y}=r;i.nextButton.innerHTML=g,i.previousButton.innerHTML=h,i.progress.innerHTML=y,i.closeButton.setAttribute("aria-label",r.closeBtnLabel),r.doneButton&&i.nextButton.classList.add("driver-popover-done-btn"),a?(i.title.innerHTML=a,i.title.style.display="block"):i.title.style.display="none",u?(i.description.innerHTML=u,i.description.style.display="block"):i.description.style.display="none";let x=f.includes("next")||f.includes("previous")||v;i.closeButton.style.display=f.includes("close")?"block":"none",x?(i.footer.style.display="flex",i.progress.style.display=v?"block":"none",i.nextButton.style.display=f.includes("next")?"block":"none",i.previousButton.style.display=f.includes("previous")?"block":"none"):i.footer.style.display="none",m.includes("next")&&(i.nextButton.disabled=!0,i.nextButton.classList.add("driver-popover-btn-disabled")),m.includes("previous")&&(i.previousButton.disabled=!0,i.previousButton.classList.add("driver-popover-btn-disabled")),m.includes("close")&&(i.closeButton.disabled=!0,i.closeButton.classList.add("driver-popover-btn-disabled"));let C=i.wrapper;C.style.display="block",C.style.left="",C.style.top="",C.style.bottom="",C.style.right="",C.id="driver-popover-content",C.setAttribute("role","dialog"),C.setAttribute("aria-labelledby","driver-popover-title"),C.setAttribute("aria-describedby","driver-popover-description");let N=i.arrow;N.className="driver-popover-arrow",C.className=`driver-popover ${r.popoverClass||""}`.trim(),bv(i.wrapper,M=>{var F,P,j;let L=M.target;if(L.closest(".driver-popover-next-btn"))return(F=r.onNextClick)==null?void 0:F.call(r);if(L.closest(".driver-popover-prev-btn"))return(P=r.onPrevClick)==null?void 0:P.call(r);if(L.closest(".driver-popover-close-btn"))return(j=r.onCloseClick)==null?void 0:j.call(r)},M=>i.description.contains(M)||i.title.contains(M)?!1:!!M.closest(".driver-popover-prev-btn, .driver-popover-next-btn, .driver-popover-close-btn")),(E=r.onRender)==null||E.call(r,i),Qc(i,t,r.position),ux(i,t,r.position),Tv(C,r.smoothScroll);let A=jv([C,t]);return A.length>0&&A[0].focus(),i}function ux(t,r,i){t.wrapper.querySelectorAll("img").forEach(a=>{if(a.complete)return;let u=()=>Qc(t,r,i);a.addEventListener("load",u,{once:!0}),a.addEventListener("error",u,{once:!0})})}function cx(){let t=document.createElement("div");t.classList.add("driver-popover");let r=document.createElement("div");r.classList.add("driver-popover-arrow");let i=document.createElement("header");i.id="driver-popover-title",i.classList.add("driver-popover-title"),i.style.display="none",i.innerText="Popover Title";let a=document.createElement("div");a.id="driver-popover-description",a.classList.add("driver-popover-description"),a.style.display="none",a.innerText="Popover description is here";let u=document.createElement("button");u.type="button",u.classList.add("driver-popover-close-btn"),u.innerHTML="&times;";let f=document.createElement("footer");f.classList.add("driver-popover-footer");let m=document.createElement("span");m.classList.add("driver-popover-progress-text"),m.innerText="";let v=document.createElement("span");v.classList.add("driver-popover-navigation-btns");let g=document.createElement("button");g.type="button",g.classList.add("driver-popover-prev-btn","driver-popover-footer-btn"),g.innerHTML="Previous";let h=document.createElement("button");return h.type="button",h.classList.add("driver-popover-next-btn","driver-popover-footer-btn"),h.innerHTML="Next",v.appendChild(g),v.appendChild(h),f.appendChild(m),f.appendChild(v),t.appendChild(u),t.appendChild(r),t.appendChild(i),t.appendChild(a),t.appendChild(f),{wrapper:t,arrow:r,title:i,description:a,footer:f,previousButton:g,nextButton:h,closeButton:u,footerButtons:v,progress:m}}function Nv(t){var r;t&&(Kc(t.wrapper),(r=t.wrapper.parentElement)==null||r.removeChild(t.wrapper))}function Iv(t,r){let i=window.innerWidth,a=window.innerHeight,u=r.padding,f=r.radius,m=t.width+u*2,v=t.height+u*2,g=Math.min(f,m/2,v/2),h=Math.floor(Math.max(g,0)),y=t.x-u+h,x=t.y-u,C=m-h*2,N=v-h*2;return`M${i},0L0,0L0,${a}L${i},${a}L${i},0Z
82
82
  M${y},${x} h${C} a${h},${h} 0 0 1 ${h},${h} v${N} a${h},${h} 0 0 1 -${h},${h} h-${C} a${h},${h} 0 0 1 -${h},-${h} v-${N} a${h},${h} 0 0 1 ${h},-${h} z`}function dx(t,r,i,a,u){let f=t.getState("__activeStagePosition"),m=f||a.getBoundingClientRect(),v=u.getBoundingClientRect();f={x:ia(r,m.x,v.x-m.x,i),y:ia(r,m.y,v.y-m.y,i),width:ia(r,m.width,v.width-m.width,i),height:ia(r,m.height,v.height-m.height,i)},Lv(t,f),t.setState("__activeStagePosition",f)}function Mv(t,r){if(!r)return;let i=r.getBoundingClientRect(),a={x:i.x,y:i.y,width:i.width,height:i.height};t.setState("__activeStagePosition",a),Lv(t,a)}function fx(t){let r=t.getState("__activeStagePosition"),i=t.getState("__overlaySvg");if(!r)return;if(!i){console.warn("No stage svg found.");return}let a=window.innerWidth,u=window.innerHeight;i.setAttribute("viewBox",`0 0 ${a} ${u}`)}function hx(t,r){let i=px(t,r);document.body.appendChild(i),bv(i,a=>{a.target.tagName==="path"&&t.emit("overlayClick")}),t.setState("__overlaySvg",i)}function Lv(t,r){let i=t.getState("__overlaySvg");if(!i){hx(t,r);return}let a=i.firstElementChild;if((a==null?void 0:a.tagName)!=="path")throw Error("no path element found in stage svg");a.setAttribute("d",Iv(r,Ov(t)))}function Ov(t){var r;return((r=t.getState("activeElement"))==null?void 0:r.id)==="driver-dummy-element"?{padding:0,radius:0}:{padding:t.getConfig("stagePadding")||0,radius:t.getConfig("stageRadius")||0}}function px(t,r){let i=window.innerWidth,a=window.innerHeight,u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.classList.add("driver-overlay","driver-overlay-animated"),u.setAttribute("viewBox",`0 0 ${i} ${a}`),u.setAttribute("xmlSpace","preserve"),u.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),u.setAttribute("version","1.1"),u.setAttribute("preserveAspectRatio","xMinYMin slice"),u.style.fillRule="evenodd",u.style.clipRule="evenodd",u.style.strokeLinejoin="round",u.style.strokeMiterlimit="2",u.style.zIndex="10000",u.style.position="fixed",u.style.top="0",u.style.left="0",u.style.width="100%",u.style.height="100%";let f=document.createElementNS("http://www.w3.org/2000/svg","path");return f.setAttribute("d",Iv(r,Ov(t))),f.style.fill=t.getConfig("overlayColor")||"rgb(0,0,0)",f.style.opacity=`${t.getConfig("overlayOpacity")}`,f.style.pointerEvents="auto",f.style.cursor="auto",u.appendChild(f),u}function mx(t){let r=t.getState("__overlaySvg");r&&(Kc(r),r.remove())}const Av="{{current}} of {{total}}";function Dv(t,r){return!(r.skipMissingElement??t.getConfig("skipMissingElement"))||!r.element?!1:!ma(r.element)}function _n(t,r,i){let a=t.getConfig("steps")||[];for(let u=r;u>=0&&u<a.length;u+=i)if(!Dv(t,a[u]))return u}function ca(t,r){var f,m;let i=t.getState("activeIndex"),a=i!==void 0&&_n(t,i+1,1)===void 0,u=((f=r==null?void 0:r.popover)==null?void 0:f.onDoneClick)||t.getConfig("onDoneClick");return a&&u?u:((m=r==null?void 0:r.popover)==null?void 0:m.onNextClick)||t.getConfig("onNextClick")}function Fv(t,r){var i;return((i=r==null?void 0:r.popover)==null?void 0:i.onPrevClick)||t.getConfig("onPrevClick")}function vx(t,r){var i;return((i=r==null?void 0:r.popover)==null?void 0:i.onCloseClick)||t.getConfig("onCloseClick")}function gx(t,r,i){let a=t.getConfig("steps")||[],u=a[r],f=u.popover||{},m=_n(t,r+1,1)!==void 0,v=_n(t,r-1,-1)!==void 0,g=f.doneBtnText||t.getConfig("doneBtnText")||"Done",h=t.getConfig("allowClose"),y=f.showProgress===void 0?t.getConfig("showProgress"):f.showProgress,x=(f.progressText||t.getConfig("progressText")||Av).replace("{{current}}",`${r+1}`).replace("{{total}}",`${a.length}`),C=f.showButtons||t.getConfig("showButtons"),N=["next","previous",...h?["close"]:[]].filter(L=>!(C!=null&&C.length)||C.includes(L)),A=f.onNextClick||t.getConfig("onNextClick"),E=f.onPrevClick||t.getConfig("onPrevClick"),M=f.onCloseClick||t.getConfig("onCloseClick");return{...u,popover:{showButtons:N,nextBtnText:m?void 0:g,disableButtons:[...t.getConfig("disableButtons")||[],...v?[]:["previous"]],showProgress:y,onNextClick:A||i.onNextClick,onPrevClick:E||i.onPrevClick,onCloseClick:M||i.onCloseClick,...f,progressText:x}}}function ac(t,r){var i,a;return{showButtons:((i=r==null?void 0:r.popover)==null?void 0:i.showButtons)||t.getConfig("showButtons")||[],disableButtons:((a=r==null?void 0:r.popover)==null?void 0:a.disableButtons)||t.getConfig("disableButtons")||[]}}function $v(t,r,i){var u,f;let a=t.getConfig("stagePadding")||0;return{side:((u=i.popover)==null?void 0:u.side)||"bottom",align:((f=i.popover)==null?void 0:f.align)||"start",offset:a+(t.getConfig("popoverOffset")||0),padding:a,centered:r.id==="driver-dummy-element"}}function yx(t,r,i){let a=i.popover||{},u=t.getState("activeIndex"),f=u!==void 0&&_n(t,u+1,1)===void 0;return{title:a.title,description:a.description,...ac(t,i),showProgress:a.showProgress||t.getConfig("showProgress")||!1,progressText:a.progressText??(t.getConfig("progressText")||Av),nextBtnText:a.nextBtnText??(t.getConfig("nextBtnText")||"Next"),prevBtnText:a.prevBtnText??(t.getConfig("prevBtnText")||"Previous"),closeBtnLabel:a.closeBtnLabel??(t.getConfig("closeBtnLabel")||"Close"),doneButton:f,popoverClass:a.popoverClass||t.getConfig("popoverClass")||"",smoothScroll:t.getConfig("smoothScroll"),onNextClick:()=>{let m=ca(t,i);return m?m(r,i,t.getHookOpts()):t.emit("nextClick")},onPrevClick:()=>{let m=Fv(t,i);return m?m(r,i,t.getHookOpts()):t.emit("prevClick")},onCloseClick:()=>{let m=vx(t,i);return m?m(r,i,t.getHookOpts()):t.emit("closeClick")},onRender:m=>{var v;t.setState("popover",m),(v=a.onPopoverRender||t.getConfig("onPopoverRender"))==null||v(m,t.getHookOpts())},position:$v(t,r,i)}}function Op(t,r,i){Nv(t.getState("popover")),lx(r,yx(t,r,i))}function wx(t,r,i){let a=t.getState("popover");a&&Qc(a,r,$v(t,r,i))}const Ap={"aria-haspopup":"dialog","aria-expanded":"true","aria-controls":"driver-popover-content"},va=new WeakMap;function xx(t){if(!va.has(t)){let r=Object.fromEntries(Object.keys(Ap).map(i=>[i,t.getAttribute(i)]));va.set(t,r)}for(let[r,i]of Object.entries(Ap))t.setAttribute(r,i)}function zv(t){let r=va.get(t);if(r){for(let[i,a]of Object.entries(r))a===null?t.removeAttribute(i):t.setAttribute(i,a);va.delete(t)}}function Sx(){let t=document.getElementById("driver-dummy-element");if(t)return t;let r=document.createElement("div");return r.id="driver-dummy-element",r.style.width="0",r.style.height="0",r.style.pointerEvents="none",r.style.opacity="0",r.style.position="fixed",r.style.top="50%",r.style.left="50%",document.body.appendChild(r),r}function Dp(t,r){let i=ma(r.element);i||(i=Sx()),Cx(t,i,r)}function kx(t){let r=t.getState("__activeElement"),i=t.getState("__activeStep");r&&(Mv(t,r),fx(t),wx(t,r,i))}function Cx(t,r,i){let a=t.getConfig("duration")||400,u=Date.now(),f=t.getState("__activeStep"),m=t.getState("__activeElement")||r,v=!m||m===r,g=r.id==="driver-dummy-element",h=m.id==="driver-dummy-element",y=t.getConfig("animate"),x=i.onHighlightStarted||t.getConfig("onHighlightStarted"),C=(i==null?void 0:i.onHighlighted)||t.getConfig("onHighlighted"),N=(f==null?void 0:f.onDeselected)||t.getConfig("onDeselected"),A=t.getHookOpts();f&&f!==i&&N&&N(h?void 0:m,f,A),x&&x(g?void 0:r,i,A);let E=!v&&y,M=!1;Rv(t.getState("popover")),t.setState("previousStep",f),t.setState("previousElement",m),t.setState("activeStep",i),t.setState("activeElement",r);let L=()=>{if(t.getState("__transitionCallback")!==L)return;let P=Date.now()-u,j=a-P<=a/2;i.popover&&j&&!M&&E&&(Op(t,r,i),M=!0),t.getConfig("animate")&&P<a?dx(t,P,a,m,r):(Mv(t,r),C&&C(g?void 0:r,i,t.getHookOpts()),t.setState("__transitionCallback",void 0),t.setState("__previousStep",f),t.setState("__previousElement",m),t.setState("__activeStep",i),t.setState("__activeElement",r)),window.requestAnimationFrame(L)};t.setState("__transitionCallback",L),window.requestAnimationFrame(L),Tv(r,t.getConfig("smoothScroll")),!E&&i.popover&&Op(t,r,i),document.querySelectorAll(".driver-active-element-parent").forEach(P=>{P.classList.remove("driver-active-element-parent","driver-active-element-parent-no-scroll")}),document.querySelectorAll(".driver-active-element").forEach(P=>{P.classList.remove("driver-active-element","driver-no-interaction"),zv(P)}),(i.disableActiveInteraction??t.getConfig("disableActiveInteraction"))&&r.classList.add("driver-no-interaction");let F=r.parentElement;F&&F!==document.body&&(F.classList.add("driver-active-element-parent"),ix(F)&&F.classList.add("driver-active-element-parent-no-scroll")),r.classList.add("driver-active-element"),xx(r)}function _x(){var t;(t=document.getElementById("driver-dummy-element"))==null||t.remove(),document.querySelectorAll(".driver-active-element").forEach(r=>{let i=r.parentElement;i&&i!==document.body&&i.classList.remove("driver-active-element-parent","driver-active-element-parent-no-scroll"),r.classList.remove("driver-active-element","driver-no-interaction"),zv(r)})}function lc(t){let r=t.getState("__resizeTimeout");r&&window.cancelAnimationFrame(r),t.setState("__resizeTimeout",window.requestAnimationFrame(()=>kx(t)))}function Ex(t,r){var v,g,h;if(!t.getState("isInitialized")||!(r.key==="Tab"||r.keyCode===9))return;let i=t.getState("__activeElement"),a=(v=t.getState("popover"))==null?void 0:v.wrapper,u=jv([...a?[a]:[],...i?[i]:[]]),f=u[0],m=u[u.length-1];r.preventDefault(),r.shiftKey?(g=u[u.indexOf(document.activeElement)-1]||m)==null||g.focus():(h=u[u.indexOf(document.activeElement)+1]||f)==null||h.focus()}function Px(t,r){(t.getConfig("allowKeyboardControl")??!0)&&(r.key==="Escape"?t.emit("escapePress"):r.key==="ArrowRight"?t.emit("arrowRightPress"):r.key==="ArrowLeft"&&t.emit("arrowLeftPress"))}function bx(t,r){let i=t.getState("__activeElement"),a=r.target;!i||!a||!i.contains(a)||t.emit("activeElementClick")}function jx(t){let r=m=>Px(t,m),i=m=>Ex(t,m),a=()=>lc(t),u=()=>lc(t),f=m=>bx(t,m);t.setState("__events",{onKeyup:r,onKeydown:i,onResize:a,onScroll:u,onClick:f}),window.addEventListener("keyup",r,!1),window.addEventListener("keydown",i,!1),window.addEventListener("resize",a),window.addEventListener("scroll",u),document.addEventListener("click",f,!1)}function Tx(t){let r=t.getState("__events");r&&(window.removeEventListener("keyup",r.onKeyup),window.removeEventListener("keydown",r.onKeydown),window.removeEventListener("resize",r.onResize),window.removeEventListener("scroll",r.onScroll),document.removeEventListener("click",r.onClick,!1))}function Rx(){let t={};function r(i={}){t={animate:!0,duration:400,allowClose:!0,allowScroll:!0,overlayClickBehavior:"close",overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,advanceOnClick:!1,skipMissingElement:!1,waitForElement:0,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...i}}return r(),{getConfig:(i=>i?t[i]:t),configure:r}}function Nx(){let t={},r=(u=>u?t[u]:t),i=(u,f)=>{t[u]=f};function a(){t={}}return{getState:r,setState:i,resetState:a}}function Ix(){let t={};function r(u,f){t[u]=f}function i(u){var f;(f=t[u])==null||f.call(t)}function a(){t={}}return{listen:r,emit:i,reset:a}}function Mx(t={}){let r=Rx();r.configure(t);let i=Nx(),a=Ix(),u;return{getConfig:r.getConfig,setConfig:r.configure,getState:i.getState,setState:i.setState,resetState:i.resetState,listen:a.listen,emit:a.emit,resetEmitter:a.reset,getDriver:()=>u,setDriver:f=>{u=f},getHookOpts:f=>{let m=f||i.getState();return{config:r.getConfig(),state:m,driver:u,index:m.activeIndex}}}}let di;function Lx(t={}){let r=Mx(t),i=()=>L(!1);function a(){r.getConfig("allowClose")&&L()}function u(){let{disableButtons:P}=ac(r,r.getState("__activeStep"));P.includes("close")||a()}function f(P){let{showButtons:j,disableButtons:D}=ac(r,r.getState("__activeStep"));return j.includes(P)&&!D.includes(P)}function m(){let P=r.getConfig("overlayClickBehavior");if(r.getConfig("allowClose")&&P==="close"){L();return}if(typeof P=="function"){let j=r.getState("__activeStep");P(r.getState("__activeElement"),j,r.getHookOpts());return}if(P==="nextStep"){let j=r.getState("activeStep"),D=r.getState("activeElement"),W=ca(r,j);if(W){W(D,j,r.getHookOpts());return}v()}}function v(){let P=r.getState("activeIndex"),j=r.getConfig("steps")||[];if(P===void 0)return;let D=P+1;j[D]?M(D):L()}function g(){let P=r.getState("activeIndex"),j=r.getConfig("steps")||[];if(P===void 0)return;let D=P-1;j[D]?M(D):L()}function h(P){(r.getConfig("steps")||[])[P]?M(P):L()}function y(){if(r.getState("__transitionCallback"))return;let P=r.getState("__activeStep");if(!P||!(P.advanceOnClick??r.getConfig("advanceOnClick")))return;let j=r.getState("__activeElement"),D=ca(r,P);if(D){D(j,P,r.getHookOpts());return}v()}function x(){if(r.getState("__transitionCallback"))return;let P=r.getState("activeIndex"),j=r.getState("__activeStep"),D=r.getState("__activeElement");if(P===void 0||j===void 0||!(r.getConfig("steps")||[])[P-1]||!f("previous"))return;let W=Fv(r,j);if(W)return W(D,j,r.getHookOpts());g()}function C(){if(r.getState("__transitionCallback"))return;let P=r.getState("activeIndex"),j=r.getState("__activeStep"),D=r.getState("__activeElement");if(P===void 0||j===void 0||!f("next"))return;let W=ca(r,j);if(W)return W(D,j,r.getHookOpts());v()}function N(){r.getState("isInitialized")||(di&&di!==i&&di(),di=i,r.setState("isInitialized",!0),document.body.classList.add("driver-active",r.getConfig("animate")?"driver-fade":"driver-simple"),r.getConfig("allowScroll")||document.body.classList.add("driver-no-scroll"),document.body.style.setProperty("--driver-animation-duration",`${r.getConfig("duration")||400}ms`),jx(r),r.listen("overlayClick",m),r.listen("activeElementClick",y),r.listen("escapePress",u),r.listen("closeClick",a),r.listen("arrowLeftPress",x),r.listen("arrowRightPress",C))}function A(){let P=r.getState("__pendingWaitCancel");P&&(r.setState("__pendingWaitCancel",void 0),P())}function E(P,j,D){let W=()=>{te.disconnect(),window.clearTimeout(Z),r.setState("__pendingWaitCancel",void 0),D()},te=new MutationObserver(()=>{ma(P.element)&&W()}),Z=window.setTimeout(W,j);r.setState("__pendingWaitCancel",()=>{te.disconnect(),window.clearTimeout(Z)}),te.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}function M(P=0,j=!1){A();let D=r.getConfig("steps");if(!D){console.error("No steps to drive through"),L();return}if(!D[P]){L();return}let W=D[P],te=W.waitForElement??r.getConfig("waitForElement")??0;if(!j&&te>0&&W.element&&!ma(W.element)){Rv(r.getState("popover")),E(W,te,()=>M(P,!0));return}if(Dv(r,W)){let se=r.getState("activeIndex"),ce=typeof se=="number"&&P<se?-1:1;D[P+ce]?M(P+ce):ce===1&&L();return}r.setState("__activeOnDestroyed",document.activeElement),r.setState("activeIndex",P);let Z=D[P+1];Dp(r,gx(r,P,{onNextClick:()=>{Z?M(P+1):L()},onPrevClick:()=>{M(P-1)},onCloseClick:()=>{L()}}))}function L(P=!0){if(!r.getState("isInitialized"))return;let j=r.getState("__activeElement"),D=r.getState("__activeStep"),W=r.getState("__activeOnDestroyed"),te=r.getConfig("onDestroyStarted");if(P&&te){te(!j||(j==null?void 0:j.id)==="driver-dummy-element"?void 0:j,D,r.getHookOpts());return}di===i&&(di=void 0);let Z=(D==null?void 0:D.onDeselected)||r.getConfig("onDeselected"),se=r.getConfig("onDestroyed");document.body.classList.remove("driver-active","driver-fade","driver-simple","driver-no-scroll"),document.body.style.removeProperty("--driver-animation-duration"),A(),Tx(r),Nv(r.getState("popover")),_x(),mx(r),r.resetEmitter();let ce=r.getState();if(r.resetState(),j&&D){let X=j.id==="driver-dummy-element";Z&&Z(X?void 0:j,D,r.getHookOpts(ce)),se&&se(X?void 0:j,D,r.getHookOpts(ce))}W&&W.focus()}let F={isActive:()=>r.getState("isInitialized")||!1,refresh:()=>lc(r),drive:(P=0)=>{N(),M(P)},setConfig:r.setConfig,setSteps:P=>{A(),r.resetState(),r.setConfig({...r.getConfig(),steps:P})},getConfig:r.getConfig,getState:r.getState,getActiveIndex:()=>r.getState("activeIndex"),isFirstStep:()=>{let P=r.getState("activeIndex");return P!==void 0&&_n(r,P-1,-1)===void 0},isLastStep:()=>{let P=r.getState("activeIndex");return P!==void 0&&_n(r,P+1,1)===void 0},getActiveStep:()=>r.getState("activeStep"),getActiveElement:()=>r.getState("activeElement"),getPreviousElement:()=>r.getState("previousElement"),getPreviousStep:()=>r.getState("previousStep"),getNextStep:()=>{let P=r.getConfig("steps")||[],j=r.getState("activeIndex");if(j===void 0)return;let D=_n(r,j+1,1);return D===void 0?void 0:P[D]},moveNext:v,movePrevious:g,moveTo:h,hasNextStep:()=>{let P=r.getState("activeIndex");return P!==void 0&&_n(r,P+1,1)!==void 0},hasPreviousStep:()=>{let P=r.getState("activeIndex");return P!==void 0&&_n(r,P-1,-1)!==void 0},highlight:P=>{N(),Dp(r,{...P,popover:P.popover?{showButtons:[],showProgress:!1,progressText:"",...P.popover}:void 0})},destroy:()=>{L(!1)}};return r.setDriver(F),F}const Ox="antseed-console:tour-seen",Ax=t=>`nav-${t}`;function Dx(t){const r=(i,a)=>zc(i,t)?[{target:Ax(i),...a}]:[];return[{title:"Welcome to your gateway",description:"This console runs on your gateway. It decides who can call the API, which sellers on the Antseed network serve those calls, and what they cost. Here is where everything lives."},{target:"workspace",title:"Workspaces",description:"Each workspace has its own wallet, members, keys and budgets. Switch between them here."},...r("wallet",{title:"Fund the wallet",description:"Requests are paid in USDC from the workspace wallet. Add funds by card where available or by sending USDC, and authorize the wallet that may withdraw."}),...r("keys",{title:"API keys",description:"Create a key for each app or person. Each key can have daily, weekly, monthly and total budgets and its own routing policy. Clients call the gateway's /v1 address with the key."}),...Ca(t)?r("settings",{title:"Buyer settings come first",description:"Settings → Buyer is the top of every routing policy: price caps, minimum trust (60 by default) and reputation, verification, payment limits and the RPC endpoint. If sellers you expect are missing, look here first."}):[],...r("routing",{title:"Routing policies",description:"Choose which sellers may serve: allow or block sellers, minimum trust, price caps, TEE only, fallback chains. Policies go from the buyer settings to the gateway default, workspaces, members, keys and presets, and each level can only narrow the one above. The route preview shows which sellers a request would use."}),...r("providers",{title:"Providers",description:"Every provider (seller) on the network this gateway sees, with prices, trust and the latency it measured. Open one to copy its models and an API call, or allow, block or prefer it."}),...r("activity",{title:"Usage and logs",description:"Spend and requests by model, key and member, and a searchable log of every request."}),...r("chat",{title:"Try it in Chat",description:"Chat with any model on the network, paid by your own Web chat key. Every answer shows which seller served it and what it cost."}),{target:"account",title:"That is the tour",description:"Replay it any time from your account menu."}]}function Fx(t){return t instanceof HTMLElement&&t.getClientRects().length>0}function $x(t){var a;const r=t.target?document.querySelector(`[data-tour="${t.target}"]`):null,i=(a=t.target)!=null&&a.startsWith("nav-")?"right":"bottom";return{...Fx(r)?{element:r}:{},popover:{title:t.title,description:t.description,side:i,align:"start"}}}function Uv(t){return`${Ox}:${t}`}function zx(t){try{return localStorage.getItem(Uv(t))==="1"}catch{return!0}}function Ux(t){try{localStorage.setItem(Uv(t),"1")}catch{}}function Fp(t,r){const i=Dx(t).map($x);Lx({steps:i,showProgress:!0,progressText:"{{current}} of {{total}}",nextBtnText:"Next",prevBtnText:"Back",doneBtnText:"Done",popoverClass:"gc-tour",stagePadding:4,stageRadius:8,onDestroyed:()=>Ux(r)}).drive()}function on(t){const r=new Uint8Array(t);let i="";for(const u of r)i+=String.fromCharCode(u);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ga(t){const r=t.replace(/-/g,"+").replace(/_/g,"/"),i=(4-r.length%4)%4,a=r.padEnd(r.length+i,"="),u=atob(a),f=new ArrayBuffer(u.length),m=new Uint8Array(f);for(let v=0;v<u.length;v++)m[v]=u.charCodeAt(v);return f}function zo(){return Bx.stubThis((globalThis==null?void 0:globalThis.PublicKeyCredential)!==void 0&&typeof globalThis.PublicKeyCredential=="function")}const Bx={stubThis:t=>t};function Bv(t){const{id:r}=t;return{...t,id:ga(r),transports:t.transports}}function Hv(t){return t==="localhost"||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(t)}class tt extends Error{constructor({message:r,code:i,cause:a,name:u}){super(r,{cause:a}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=u??a.name,this.code=i}}function Hx({error:t,options:r}){var a,u,f;const{publicKey:i}=r;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(r.signal instanceof AbortSignal)return new tt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((a=i.authenticatorSelection)==null?void 0:a.requireResidentKey)===!0)return new tt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(r.mediation==="conditional"&&((u=i.authenticatorSelection)==null?void 0:u.userVerification)==="required")return new tt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((f=i.authenticatorSelection)==null?void 0:f.userVerification)==="required")return new tt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new tt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new tt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(v=>v.type==="public-key").length===0?new tt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new tt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const m=globalThis.location.hostname;if(Hv(m)){if(i.rp.id!==m)return new tt({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new tt({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new tt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new tt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}class Wx{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){const i=new Error("Cancelling existing WebAuthn API call for new one");i.name="AbortError",this.controller.abort(i)}const r=new AbortController;return this.controller=r,r.signal}cancelCeremony(){if(this.controller){const r=new Error("Manually cancelling existing WebAuthn API call");r.name="AbortError",this.controller.abort(r),this.controller=void 0}}}const Wv=new Wx,Vx=["cross-platform","platform"];function Vv(t){if(t&&!(Vx.indexOf(t)<0))return t}async function qv(t){var A;!t.optionsJSON&&t.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:r,useAutoRegister:i=!1}=t;if(!zo())throw new Error("WebAuthn is not supported in this browser");const a={...r,challenge:ga(r.challenge),user:{...r.user,id:ga(r.user.id)},excludeCredentials:(A=r.excludeCredentials)==null?void 0:A.map(Bv)},u={};i&&(u.mediation="conditional"),u.publicKey=a,u.signal=Wv.createNewAbortSignal();let f;try{f=await navigator.credentials.create(u)}catch(E){throw Hx({error:E,options:u})}if(!f)throw new Error("Registration was not completed");const{id:m,rawId:v,response:g,type:h}=f;let y;typeof g.getTransports=="function"&&(y=g.getTransports());let x;if(typeof g.getPublicKeyAlgorithm=="function")try{x=g.getPublicKeyAlgorithm()}catch(E){Mu("getPublicKeyAlgorithm()",E)}let C;if(typeof g.getPublicKey=="function")try{const E=g.getPublicKey();E!==null&&(C=on(E))}catch(E){Mu("getPublicKey()",E)}let N;if(typeof g.getAuthenticatorData=="function")try{N=on(g.getAuthenticatorData())}catch(E){Mu("getAuthenticatorData()",E)}return{id:m,rawId:on(v),response:{attestationObject:on(g.attestationObject),clientDataJSON:on(g.clientDataJSON),transports:y,publicKeyAlgorithm:x,publicKey:C,authenticatorData:N},type:h,clientExtensionResults:f.getClientExtensionResults(),authenticatorAttachment:Vv(f.authenticatorAttachment)}}function Mu(t,r){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
83
- `,r)}function qx(){if(!zo())return Lu.stubThis(new Promise(r=>r(!1)));const t=globalThis.PublicKeyCredential;return(t==null?void 0:t.isConditionalMediationAvailable)===void 0?Lu.stubThis(new Promise(r=>r(!1))):Lu.stubThis(t.isConditionalMediationAvailable())}const Lu={stubThis:t=>t};function Kx({error:t,options:r}){const{publicKey:i}=r;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(r.signal instanceof AbortSignal)return new tt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new tt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const a=globalThis.location.hostname;if(Hv(a)){if(i.rpId!==a)return new tt({message:`The RP ID "${i.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new tt({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new tt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}async function Kv(t){var N,A;!t.optionsJSON&&t.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:r,useBrowserAutofill:i=!1,verifyBrowserAutofillInput:a=!0}=t;if(!zo())throw new Error("WebAuthn is not supported in this browser");let u;((N=r.allowCredentials)==null?void 0:N.length)!==0&&(u=(A=r.allowCredentials)==null?void 0:A.map(Bv));const f={...r,challenge:ga(r.challenge),allowCredentials:u},m={};if(i){if(!await qx())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&a)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');m.mediation="conditional",f.allowCredentials=[]}m.publicKey=f,m.signal=Wv.createNewAbortSignal();let v;try{v=await navigator.credentials.get(m)}catch(E){throw Kx({error:E,options:m})}if(!v)throw new Error("Authentication was not completed");const{id:g,rawId:h,response:y,type:x}=v;let C;return y.userHandle&&(C=on(y.userHandle)),{id:g,rawId:on(h),response:{authenticatorData:on(y.authenticatorData),clientDataJSON:on(y.clientDataJSON),signature:on(y.signature),userHandle:C},type:x,clientExtensionResults:v.getClientExtensionResults(),authenticatorAttachment:Vv(v.authenticatorAttachment)}}function Nr(t){return t.trim().toLowerCase().replace(/^0x/,"")}function Qv(t,r){return Nr(t)===Nr(r)}const Qx={balanced:"Balanced",price:"Lowest price",latency:"Lowest latency",trust:"Highest trust"};function Gc(){return{allowMode:"any",allowedPeerIds:[],allowedListIds:[],blockedPeerIds:[],blockedListIds:[],minTrustScore:"",minReputation:"",requireVerified:!1,requireTee:!1,maxInputUsdPerMillion:"",maxOutputUsdPerMillion:"",maxCachedInputUsdPerMillion:"",maxImageUsdPerImage:"",preferFreePeers:"inherit",sort:"",modelsMode:"any",allowedModels:[],routes:[]}}function fi(t){return t===void 0?"":String(t)}function Gx(t){return t===void 0?"inherit":t?"yes":"no"}function Yx(t){const r=Gc();return t?{...r,allowMode:t.allowedPeerIds||t.allowedPeerLists?"only":"any",allowedPeerIds:[...t.allowedPeerIds??[]],allowedListIds:[...t.allowedPeerLists??[]],blockedPeerIds:[...t.blockedPeerIds??[]],blockedListIds:[...t.blockedPeerLists??[]],minTrustScore:fi(t.minTrustScore),minReputation:fi(t.minReputation),requireVerified:t.requireVerified===!0,requireTee:t.requireTee===!0,maxInputUsdPerMillion:fi(t.maxInputUsdPerMillion),maxOutputUsdPerMillion:fi(t.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:fi(t.maxCachedInputUsdPerMillion),maxImageUsdPerImage:fi(t.maxImageUsdPerImage),preferFreePeers:Gx(t.preferFreePeers),sort:t.sort??"",modelsMode:t.allowedModels?"only":"any",allowedModels:[...t.allowedModels??[]],routes:Object.entries(t.modelRoutes??{}).map(([i,a])=>({model:i,peerIds:[...a.peerIds],strict:a.strict===!0}))}:r}class ya extends Error{}function Ou(t,r,i){const a=r.trim();if(a==="")return;const u=Number(a);if(!Number.isFinite(u)||u<0)throw new ya(`${t} must be a positive number.`);if(i!==void 0&&u>i)throw new ya(`${t} must be at most ${i}.`);return u}function hi(t){return[...new Set(t.map(r=>r.trim()).filter(Boolean))]}function $p(t,r){const i=hi(t);return r?i.filter(a=>r.some(u=>u.id===a)):i}function pC(t,r=null){const i={};if(t.allowMode==="only"){const h=$p(t.allowedListIds,r),y=hi(t.allowedPeerIds);(y.length>0||h.length===0)&&(i.allowedPeerIds=y),h.length>0&&(i.allowedPeerLists=h)}const a=hi(t.blockedPeerIds);a.length>0&&(i.blockedPeerIds=a);const u=$p(t.blockedListIds,r);u.length>0&&(i.blockedPeerLists=u);const f=Ou("Minimum trust",t.minTrustScore,100);f!==void 0&&(i.minTrustScore=f);const m=Ou("Minimum reputation",t.minReputation,100);m!==void 0&&(i.minReputation=m),t.requireVerified&&(i.requireVerified=!0),t.requireTee&&(i.requireTee=!0);const v=[["maxInputUsdPerMillion","Input price cap"],["maxOutputUsdPerMillion","Output price cap"],["maxCachedInputUsdPerMillion","Cached input price cap"],["maxImageUsdPerImage","Image price cap"]];for(const[h,y]of v){const x=Ou(y,t[h]);x!==void 0&&(i[h]=x)}t.preferFreePeers!=="inherit"&&(i.preferFreePeers=t.preferFreePeers==="yes"),t.sort&&(i.sort=t.sort),t.modelsMode==="only"&&(i.allowedModels=hi(t.allowedModels));const g=t.routes.filter(h=>h.model.trim()!=="");if(g.length>0){const h=new Set;i.modelRoutes={};for(const y of g){const x=y.model.trim();if(h.has(x))throw new ya(`Model "${x}" has two fallback chains.`);h.add(x);const C=hi(y.peerIds);if(C.length===0)throw new ya(`Add at least one seller to the "${x}" chain.`);i.modelRoutes[x]=y.strict?{peerIds:C,strict:!0}:{peerIds:C}}}return i}function Yc(t){return!t||Object.keys(t).length===0}function mC(t){return Yc(t)?null:t}function Zx(t){var a,u,f,m,v,g;if(Yc(t))return"Inherits";const r=t,i=[];if(r.allowedPeerIds||r.allowedPeerLists){const h=(a=r.allowedPeerLists)!=null&&a.length?` + ${r.allowedPeerLists.length} list${r.allowedPeerLists.length===1?"":"s"}`:"";i.push(`${((u=r.allowedPeerIds)==null?void 0:u.length)??0} allowed${h}`)}if((f=r.blockedPeerIds)!=null&&f.length||(m=r.blockedPeerLists)!=null&&m.length){const h=(v=r.blockedPeerLists)!=null&&v.length?` + ${r.blockedPeerLists.length} list${r.blockedPeerLists.length===1?"":"s"}`:"";i.push(`${((g=r.blockedPeerIds)==null?void 0:g.length)??0} blocked${h}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("verified only"),r.minTrustScore!==void 0&&i.push(`trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`reputation ≥ ${r.minReputation}`),(r.maxInputUsdPerMillion!==void 0||r.maxOutputUsdPerMillion!==void 0)&&i.push("price caps"),r.allowedModels&&i.push(`${r.allowedModels.length} models`),r.modelRoutes&&i.push(`${Object.keys(r.modelRoutes).length} fallback chains`),r.sort&&i.push(Qx[r.sort].toLowerCase()),r.preferFreePeers&&i.push("free first"),i.join(" · ")||"Custom"}function vC(t){if(!t)return null;const r={};t.minPeerReputation>0&&(r.minReputation=t.minPeerReputation),t.requireVerifier&&(r.requireVerified=!0),t.maxPricing&&(r.maxInputUsdPerMillion=t.maxPricing.inputUsdPerMillion,r.maxOutputUsdPerMillion=t.maxPricing.outputUsdPerMillion,t.maxPricing.cachedInputUsdPerMillion!==null&&(r.maxCachedInputUsdPerMillion=t.maxPricing.cachedInputUsdPerMillion));const i=t.routingPreferences;return i&&(i.minTrustScore>0&&(r.minTrustScore=i.minTrustScore),i.allowedPeerIds.length>0&&(r.allowedPeerIds=[...i.allowedPeerIds]),i.blockedPeerIds.length>0&&(r.blockedPeerIds=[...i.blockedPeerIds])),r}function gC(t){const r=[];t.minPeerReputation>0&&r.push(`reputation ≥ ${t.minPeerReputation}`),t.requireVerifier&&r.push("verified sellers only"),t.maxPricing&&(r.push(`≤ ${gi(t.maxPricing.inputUsdPerMillion)}/M in`),r.push(`≤ ${gi(t.maxPricing.outputUsdPerMillion)}/M out`),t.maxPricing.cachedInputUsdPerMillion!==null&&r.push(`≤ ${gi(t.maxPricing.cachedInputUsdPerMillion)}/M cached`));const i=t.routingPreferences;return i&&(i.minTrustScore>0&&r.push(`trust ≥ ${i.minTrustScore}`),i.allowedPeerIds.length>0&&r.push(`only ${wn(i.allowedPeerIds.length,"allowed seller")}`),i.blockedPeerIds.length>0&&r.push(wn(i.blockedPeerIds.length,"blocked seller")),i.preferFreePeers&&r.push("free first")),r}const wn=(t,r)=>`${t} ${r}${t===1?"":"s"}`,Xx={balanced:"balanced",price:"price",latency:"latency",trust:"trust"};function yC(t){var u,f,m,v,g,h,y;if(Yc(t))return[];const r=t,i=[],a=x=>x?` + ${wn(x,"list")}`:"";if(r.allowedPeerIds||r.allowedPeerLists){const x=((u=r.allowedPeerIds)==null?void 0:u.length)??0;i.push(x===0&&!((f=r.allowedPeerLists)!=null&&f.length)?"No seller allowed":`Allow ${x?wn(x,"seller"):""}${x?a((m=r.allowedPeerLists)==null?void 0:m.length):wn(r.allowedPeerLists.length,"list")}`)}if((v=r.blockedPeerIds)!=null&&v.length||(g=r.blockedPeerLists)!=null&&g.length){const x=((h=r.blockedPeerIds)==null?void 0:h.length)??0;i.push(`Block ${x?wn(x,"seller")+a((y=r.blockedPeerLists)==null?void 0:y.length):wn(r.blockedPeerLists.length,"list")}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("Verified only"),r.minTrustScore!==void 0&&i.push(`Trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`Reputation ≥ ${r.minReputation}`),r.maxInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxInputUsdPerMillion}/M in`),r.maxOutputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxOutputUsdPerMillion}/M out`),r.maxCachedInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxCachedInputUsdPerMillion}/M cached`),r.maxImageUsdPerImage!==void 0&&i.push(`≤ $${r.maxImageUsdPerImage}/image`),r.allowedModels&&i.push(r.allowedModels.length===0?"No model allowed":wn(r.allowedModels.length,"model")),r.modelRoutes&&Object.keys(r.modelRoutes).length>0&&i.push(wn(Object.keys(r.modelRoutes).length,"fallback chain")),r.sort&&i.push(`Sort: ${Xx[r.sort]}`),r.preferFreePeers!==void 0&&i.push(r.preferFreePeers?"Free sellers first":"Free sellers not first"),i}const wC=[{id:"cheapest",label:"Cheapest",description:"Lowest price first, free sellers ahead."},{id:"trusted",label:"Most trusted",description:"Trust 70+ and reputation 60+, ranked by trust."},{id:"tee",label:"TEE only",description:"Only sellers running in a trusted execution environment."},{id:"own",label:"Own peers only",description:"Only sellers in one of your peer lists."}];function xC(t,r=[]){switch(t){case"cheapest":return{sort:"price",preferFreePeers:!0};case"trusted":return{sort:"trust",minTrustScore:70,minReputation:60};case"tee":return{requireTee:!0};case"own":return{allowedPeerIds:hi(r)}}}function SC(t,r,i,a){var m,v,g;const u=structuredClone(t??{}),f=h=>h==null?void 0:h.filter(y=>!Qv(y,i));if(r==="allow")u.allowedPeerIds=[...f(u.allowedPeerIds)??[],i],u.blockedPeerIds=f(u.blockedPeerIds);else if(r==="block")u.blockedPeerIds=[...f(u.blockedPeerIds)??[],i],u.allowedPeerIds&&(u.allowedPeerIds=f(u.allowedPeerIds)),((m=u.allowedPeerIds)==null?void 0:m.length)===0&&!((v=u.allowedPeerLists)!=null&&v.length)&&delete u.allowedPeerIds;else if(r==="prefer"){if(!a)throw new Error("Pick a model to prefer this seller for.");const h={...u.modelRoutes??{}},y=h[a];h[a]={...y??{},peerIds:[i,...f(y==null?void 0:y.peerIds)??[]]},u.modelRoutes=h,u.blockedPeerIds=f(u.blockedPeerIds)}else u.allowedPeerIds&&(u.allowedPeerIds=f(u.allowedPeerIds)),u.blockedPeerIds=f(u.blockedPeerIds),u.modelRoutes&&(u.modelRoutes=Object.fromEntries(Object.entries(u.modelRoutes).map(([h,y])=>[h,{...y,peerIds:f(y.peerIds)??[]}]).filter(([,h])=>h.peerIds.length>0)));return((g=u.blockedPeerIds)==null?void 0:g.length)===0&&delete u.blockedPeerIds,u.modelRoutes&&Object.keys(u.modelRoutes).length===0&&delete u.modelRoutes,u}function kC(t,r){var a;const i=t==null?void 0:t.allowedPeerIds;return!i||(a=t==null?void 0:t.allowedPeerLists)!=null&&a.length?!1:i.length>0&&i.every(u=>Qv(u,r))}const Jx={allowMode:"allowed sellers",minTrustScore:"minimum trust",minReputation:"minimum reputation",requireVerified:"verified only",requireTee:"TEE only",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",preferFreePeers:"free sellers first",sort:"sort order",modelsMode:"allowed models"};function CC(t){const r=Yx(t),i=Gc(),a={};for(const u of Object.keys(r))JSON.stringify(r[u])!==JSON.stringify(i[u])&&(a[u]=r[u]);return(t.allowedPeerIds||t.allowedPeerLists)&&(a.allowMode="only",a.allowedPeerIds=r.allowedPeerIds,a.allowedListIds=r.allowedListIds),a}function _C(t,r){const i=Gc(),a=new Set;for(const u of Object.keys(r)){const f=JSON.stringify(t[u]);if(f===JSON.stringify(i[u])||f===JSON.stringify(r[u]))continue;const m=Jx[u]??(u==="allowedPeerIds"||u==="allowedListIds"?"allowed sellers":null);m&&a.add(m)}return[...a]}function EC(t,r){return{...t,...r}}function PC(t,r,i){const a=[...t],u=r+i;if(r<0||r>=a.length||u<0||u>=a.length)return a;const[f]=a.splice(r,1);return a.splice(u,0,f),a}function bC(t,r=null){if(!t||t.allowedPeerIds===void 0&&t.allowedPeerLists===void 0||(t.allowedPeerIds??[]).some(a=>a.trim()!==""))return!1;const i=t.allowedPeerLists??[];return i.length===0?!0:r?i.every(a=>{var u;return(((u=r.find(f=>f.id===a))==null?void 0:u.peerIds.length)??0)===0}):!1}function eS(t,r){if(t===void 0)return r;if(r===void 0)return t;const i=new Set(r.map(Nr));return t.filter(a=>i.has(Nr(a)))}function tS(t,r){return t===void 0?r:r===void 0?t:[...new Set([...t,...r])]}function Zc(t,r,i){return t===void 0?r:r===void 0?t:i(t,r)}const zp=(t,r)=>Zc(t,r,Math.max),oa=(t,r)=>Zc(t,r,Math.min),nS=(t,r)=>t.filter(i=>r.some(a=>a.toLowerCase()===i.toLowerCase()));function rS(t,r){const{allowedPeerLists:i,blockedPeerLists:a,...u}=t,f=v=>v.flatMap(g=>{var h;return((h=r.find(y=>y.id===g))==null?void 0:h.peerIds)??[]}),m={...u};return i!==void 0&&(m.allowedPeerIds=[...u.allowedPeerIds??[],...f(i)]),a!=null&&a.length&&(m.blockedPeerIds=[...u.blockedPeerIds??[],...f(a)]),m}function iS(...t){let r={};for(const i of t){if(!i)continue;const a={allowedPeerIds:eS(r.allowedPeerIds,i.allowedPeerIds),blockedPeerIds:tS(r.blockedPeerIds,i.blockedPeerIds),minTrustScore:zp(r.minTrustScore,i.minTrustScore),minReputation:zp(r.minReputation,i.minReputation),requireVerified:r.requireVerified||i.requireVerified?!0:void 0,requireTee:r.requireTee||i.requireTee?!0:void 0,maxInputUsdPerMillion:oa(r.maxInputUsdPerMillion,i.maxInputUsdPerMillion),maxOutputUsdPerMillion:oa(r.maxOutputUsdPerMillion,i.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:oa(r.maxCachedInputUsdPerMillion,i.maxCachedInputUsdPerMillion),maxImageUsdPerImage:oa(r.maxImageUsdPerImage,i.maxImageUsdPerImage),preferFreePeers:i.preferFreePeers??r.preferFreePeers,sort:i.sort??r.sort,allowedModels:Zc(r.allowedModels,i.allowedModels,nS),modelRoutes:i.modelRoutes||r.modelRoutes?{...r.modelRoutes??{},...i.modelRoutes??{}}:void 0};r=Object.fromEntries(Object.entries(a).filter(([,u])=>u!==void 0))}return r}function oS(t,r){if(t.allowedModels&&!t.allowedModels.some(a=>a.toLowerCase()===r.service.toLowerCase()))return!1;const i=(a,u)=>u!==void 0&&a!==null&&a>u;return!(i(r.inputUsdPerMillion,t.maxInputUsdPerMillion)||i(r.outputUsdPerMillion,t.maxOutputUsdPerMillion)||i(r.cachedInputUsdPerMillion,t.maxCachedInputUsdPerMillion))}function jC(t,r,i=[]){const a=rS(t,i),u=a.allowedPeerIds?new Set(a.allowedPeerIds.map(Nr)):null,f=new Set((a.blockedPeerIds??[]).map(Nr));return r.filter(m=>{const v=Nr(m.peerId);return f.has(v)||u&&!u.has(v)||a.minTrustScore!==void 0&&(m.trustScore??0)<a.minTrustScore||a.minReputation!==void 0&&(m.reputationScore??0)<a.minReputation||a.requireVerified&&!m.verified||a.requireTee&&!m.tee?!1:m.services.some(g=>oS(a,g))})}function TC(t){return!!t&&t.some(r=>r.reputationScore!==null)}function RC(t,r,i=!1){const a=t?t.ownerMemberId===r.memberId:!0;return{admin:r.workspaceAdmin,owner:a,layered:t?vv(t):i}}function sS(t,r){return t===null?r:r===null||Xe(t)<=Xe(r)?t:r}function aS(t,r){const i={};for(const a of Sv)i[a]=sS((t==null?void 0:t[a])??null,(r==null?void 0:r[a])??null);return i}function NC(t){const r=vv(t)?t:null;return{limits:aS(t.limits,r==null?void 0:r.ownerLimits),policy:iS(t.routingPolicy,(r==null?void 0:r.ownerRoutingPolicy)??null)}}function IC(t,r,i){const a={label:i.label};return i.expiresAt!==r.expiresAt&&(a.expiresAt=i.expiresAt),t.admin&&(a.limits=i.adminLimits,a.routingPolicy=i.adminPolicy,i.topupEnabled!==r.topupEnabled&&(a.topupEnabled=i.topupEnabled)),t.owner&&t.layered?(a.ownerLimits=i.ownerLimits,a.ownerRoutingPolicy=i.ownerPolicy):t.owner&&!t.admin&&(a.limits=i.ownerLimits,a.routingPolicy=i.ownerPolicy),a}const lS={allowedPeerIds:"allowed sellers",allowedPeerLists:"allowed peer lists",allowedModels:"allowed models",modelRoutes:"fallback chains",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",minTrustScore:"minimum trust",minReputation:"minimum reputation"};function uS(t){const[,r=t]=t.split(".");return/Limits$|^limits$/.test(t.split(".")[0]??"")?`${r} limit`:lS[r]??r}function cS(t){const r=[],i=t.fields;Array.isArray(i)&&i.length&&r.push(`Narrowed by the levels above: ${[...new Set(i.map(f=>uS(String(f))))].join(", ")}.`);const a=t.effectiveRoutingPolicy;a&&typeof a=="object"&&r.push(`Routing that would apply: ${Zx(a)}.`);const u=t.effectiveLimits;return u&&typeof u=="object"&&r.push(`Limits that would apply: ${$2(u)}.`),r}const da=Symbol("cancelled");async function MC(t,r,i){const a={};if(t){if(!await i({kind:"empty"}))return da;a.confirmEmpty=!0}for(;;)try{return await r({...a})}catch(u){if(Lr(u,"empty_allow_list")&&!a.confirmEmpty){if(!await i({kind:"empty"}))return da;a.confirmEmpty=!0}else if(Lr(u,"narrowed")&&!a.acceptNarrowed){if(!await i({kind:"narrowed",message:u.message,lines:cS(u.details)}))return da;a.acceptNarrowed=!0}else throw u}}function dS(t){const r=rr(),i=mv();return e1({mutationFn:t.mutationFn,onSuccess:(a,u)=>{var v;if(a===da)return;const f=a;(v=t.onSuccess)==null||v.call(t,f,u);for(const g of t.invalidate??[])r.invalidateQueries({queryKey:g});const m=typeof t.toast=="function"?t.toast(f,u):t.toast;m&&i(m)},onError:t.onError})}async function fS(t=fe){const r=await t.auth.reauthPasskeyOptions(),i=await Kv({optionsJSON:r});return t.auth.reauthPasskeyVerify(i)}async function LC(t,r,i=fe){const{message:a}=await i.auth.reauthWalletNonce(t);return i.auth.reauthWalletVerify(a,await r(a))}function hS(t,r){if(t.kind!=="member"||t.me.member.id!==r)throw new Error("That sign-in belongs to a different account. Reload the page and sign in as yourself.")}const uc="The passkey prompt was closed.";function cc(t){return t instanceof Error&&t.name==="NotAllowedError"}function Xc({error:t,onRetry:r,title:i="Could not load this"}){return d.jsx(lt,{tone:"danger",title:i,action:r?d.jsx(Le,{variant:"outline",size:"sm",onClick:r,children:"Retry"}):void 0,children:ka(t)})}function OC({query:t,children:r,rows:i}){return t.isLoading?d.jsx(Ni,{rows:i}):t.error?d.jsx(Xc,{error:t.error,onRetry:()=>void t.refetch()}):t.data===void 0?null:d.jsx(d.Fragment,{children:r(t.data)})}function AC({children:t,title:r}){return d.jsx("code",{className:"gc-mono",title:r,children:t})}function DC({label:t,value:r,strong:i}){return d.jsxs("div",{className:"gc-figure",children:[d.jsx("div",{className:"gc-figure__label",children:t}),d.jsx("div",{className:i?"gc-figure__value gc-figure__value--strong":"gc-figure__value",children:r})]})}function FC({name:t,hint:r}){return d.jsxs("div",{children:[d.jsx("div",{className:"gc-strong",children:t}),d.jsx("code",{className:"gc-mono gc-muted",children:r})]})}function $C({at:t,format:r}){return t===null?d.jsx(d.Fragment,{children:"Never"}):t<Date.now()?d.jsx(Sm,{tone:"warning",children:"Expired"}):d.jsx(d.Fragment,{children:r(t)})}const pS="Showing last known values — the chain RPC is busy.";function zC({stale:t}){return t?d.jsx("p",{className:"gc-muted",role:"status",children:pS}):null}function UC({to:t,children:r}){return d.jsx("a",{className:"gc-link",href:_a(t),onClick:Hc(t),children:r})}const mS=I.lazy(()=>Ue(()=>import("./WalletSignIn-_VjhsjCt.js"),__vite__mapDeps([0,1,2,3,4]))),vS=I.lazy(()=>Ue(()=>import("./WalletConfirm-Dc0AMNYH.js"),__vite__mapDeps([5,6,1,2,3,4])));function gS({isOpen:t,onClose:r,startWith:i,intro:a,onCredentialAdded:u}){const{me:f}=ir(),m=rr(),v=Vc(t),[g,h]=I.useState("idle"),[y,x]=I.useState(i==="wallet"?"add":null),[C,N]=I.useState(null),[A,E]=I.useState(null),[M,L]=I.useState(!1),F=f.member.credentials,P=F.some(X=>X.kind==="passkey"),j=F.some(X=>X.kind==="wallet");function D(X){hS(X,f.member.id),m.setQueryData(Pe.me,X)}function W(X){return Lr(X,"reauth_required")?(h("needed"),N(null)):N(X),!0}async function te(){L(!0),N(null);try{const X=await fe.auth.passkeyRegisterOptions(),Te=await qv({optionsJSON:X});D(await fe.auth.passkeyRegisterVerify(Te)),h("idle"),u==null||u()}catch(X){cc(X)?N(new Error(uc)):W(X)}finally{L(!1)}}async function Z(){L(!0),N(null);try{D(await fS()),h("done")}catch(X){N(cc(X)?new Error(uc):X)}finally{L(!1)}}const se=dS({mutationFn:X=>fe.members.removeCredential(f.member.id,X.id),onSuccess:()=>E(null),onError:X=>{Lr(X,"reauth_required")&&(E(null),h("needed"))},invalidate:[Pe.me]}),ce=F.length<=1;return d.jsxs(cv,{isOpen:t,onClose:r,size:"lg",eyebrow:Uc[f.member.orgRole],title:f.member.label,subtitle:f.member.email??void 0,children:[d.jsxs("div",{className:"gc-stack",children:[a,d.jsxs("section",{className:"gc-stack gc-stack--tight",children:[d.jsx("div",{className:"as-field__label",children:"Your sign-in methods"}),F.length===0?d.jsx(lt,{tone:"info",children:"You signed in through your organization's access proxy and have no passkey or wallet here. Add one to approve sensitive actions, such as authorizing a withdrawal wallet."}):d.jsx("ul",{className:"gc-list gc-credentials",children:F.map(X=>d.jsxs("li",{className:"gc-inline gc-inline--between",children:[d.jsxs("span",{className:"gc-credential",children:[d.jsx(Sm,{children:X.kind})," ",d.jsx("span",{className:"gc-credential__label",children:X.label}),d.jsxs("span",{className:"gc-muted",children:[" · added ",Rp(X.createdAt)," · last used ",Rp(X.lastUsedAt)]})]}),d.jsx(Le,{variant:"ghost",size:"sm",disabled:ce,title:ce?"Add another sign-in method first":void 0,onClick:()=>{se.reset(),E(X)},children:"Remove"})]},X.id))}),ce&&F.length===1&&d.jsx("p",{className:"gc-fineprint",children:"This is your only sign-in method. Add another before removing it."})]}),g==="needed"&&d.jsx(lt,{tone:"info",title:"Confirm it is you",children:d.jsxs("div",{className:"gc-stack gc-stack--tight",children:[d.jsx("span",{children:"Changing your sign-in methods needs a recent sign-in. Confirm with one you already have, then try again."}),d.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[P&&d.jsx(Le,{size:"sm",disabled:M,onClick:()=>void Z(),children:"Confirm with a passkey"}),j&&y!=="confirm"&&d.jsx(Le,{size:"sm",variant:"outline",onClick:()=>x("confirm"),children:"Confirm with a wallet"})]}),y==="confirm"&&d.jsx(I.Suspense,{fallback:d.jsx(Le,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:d.jsx(vS,{onConfirmed:X=>{D(X),h("done"),x(null)}})}),!P&&!j&&d.jsx("span",{children:"Sign out and sign in again, then add it."})]})}),g==="done"&&d.jsx(lt,{tone:"success",children:"Confirmed. Add or remove the sign-in method now."}),v.data&&d.jsxs("section",{className:"gc-stack gc-stack--tight",children:[d.jsx("div",{className:"as-field__label",children:"Add a sign-in method"}),d.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[v.data.passkey&&d.jsx(Le,{variant:"outline",size:"sm",disabled:M||!zo(),onClick:()=>void te(),children:M?"Waiting for your passkey…":"Add a passkey"}),v.data.wallet&&y!=="add"&&d.jsx(Le,{variant:"outline",size:"sm",onClick:()=>x("add"),children:"Add a wallet"}),v.data.oidc&&d.jsxs(Le,{variant:"outline",size:"sm",href:fe.auth.oidcLinkUrl(),children:["Link ",v.data.oidc.label]})]}),y==="add"&&d.jsx(I.Suspense,{fallback:d.jsx(Le,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:d.jsx(mS,{autoConnect:!0,actionLabel:X=>`Add ${X} as a sign-in method`,onError:W,onSignedIn:X=>{D(X),x(null),h("idle"),u==null||u()}})}),d.jsx("p",{className:"gc-fineprint",children:"A wallet you add can become this workspace's withdrawal wallet only 24 hours later."})]}),C?d.jsx(lt,{tone:"danger",children:ka(C)}):null,d.jsx("div",{className:"gc-actions",children:d.jsx(Le,{onClick:r,children:"Done"})})]}),d.jsx(a2,{isOpen:A!==null,busy:se.isPending,error:se.error,onClose:()=>{E(null),se.reset()},onConfirm:()=>A&&se.mutate(A),title:"Remove this sign-in method?",confirmLabel:"Remove",body:`You can no longer sign in with ${(A==null?void 0:A.label)??"it"}.`})]})}const Gv="antseed-console-exposure-dismissed";function yS(t,r,i){return!r||r.mode==="public"||i?!1:Ca(t)}function Up(t){if(!t)return!1;try{return sessionStorage.getItem(Gv)===t}catch{return!1}}function wS(t){try{sessionStorage.setItem(Gv,t)}catch{}}function xS(t){return t.mode==="local"?"This gateway runs on this computer":"This gateway is only reachable on your network"}function SS(t){return t.mode==="local"?"Keys only work while it's on and can't be reached from other machines.":t.personalComputer?"Keys only work while this computer is on, over plain HTTP, and not from outside your network.":"It has no public HTTPS address: keys travel over plain HTTP and do not work from outside your network."}const kS=/^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;function BC(t){const r=t.trim().toLowerCase().replace(/^https?:\/\//,"").replace(/[/:].*$/,"");return kS.test(r)?r:null}const sa="antseed-gateway.bundle";function HC(t){const r=t.domain??"llm.example.com",i=t.server.trim()||"user@your-server",a=`/tmp/${sa}`;return{exportBundle:`antseed gateway export --out ${sa}`,copy:`scp ${sa} ${i}:${a}`,install:`curl -fsSL https://antseed.com/install-gateway.sh | sudo bash -s -- --domain ${r} --import ${a}`,baseUrl:`https://${r}/v1`,stop:`rm ${sa}`,recover:"antseed gateway console-link --recover",tunnel:`CLOUDFLARED_TUNNEL_TOKEN=<tunnel-token> ANTSEED_TUNNEL_PUBLIC_URL=https://${r} \\
84
- antseed tunnel start --provider cloudflare`}}function pe({size:t=16,children:r,...i}){return d.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i,children:r})}const ut={overview:t=>d.jsxs(pe,{...t,children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"9",rx:"1.5"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"5",rx:"1.5"}),d.jsx("rect",{x:"14",y:"12",width:"7",height:"9",rx:"1.5"}),d.jsx("rect",{x:"3",y:"16",width:"7",height:"5",rx:"1.5"})]}),chat:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M4 5h16v11H9l-5 4z"}),d.jsx("path",{d:"M8 9.5h8M8 12.5h5"})]}),activity:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M3 12h4l3 8 4-16 3 8h4"})}),logs:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),keys:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"8",cy:"15",r:"4"}),d.jsx("path",{d:"m10.8 12.2 9.2-9.2M17 6l3 3M14 9l2 2"})]}),members:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"9",cy:"8",r:"3.5"}),d.jsx("path",{d:"M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14.5a6.5 6.5 0 0 1 3.5 5.5"})]}),workspaces:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M3 7h18v13H3zM8 7V4h8v3"})}),wallet:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M3 7a2 2 0 0 1 2-2h13v4"}),d.jsx("rect",{x:"3",y:"7",width:"18",height:"13",rx:"2"}),d.jsx("circle",{cx:"16.5",cy:"13.5",r:"1.3"})]}),rewards:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M12 15a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z"}),d.jsx("path",{d:"m8.5 14-1.5 7 5-3 5 3-1.5-7"})]}),providers:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"12",cy:"5",r:"2.2"}),d.jsx("circle",{cx:"5",cy:"18",r:"2.2"}),d.jsx("circle",{cx:"19",cy:"18",r:"2.2"}),d.jsx("path",{d:"M11 7 6 16M13 7l5 9M7.2 18h9.6"})]}),network:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"12",cy:"5",r:"2.2"}),d.jsx("circle",{cx:"5",cy:"18",r:"2.2"}),d.jsx("circle",{cx:"19",cy:"18",r:"2.2"}),d.jsx("path",{d:"M11 7 6 16M13 7l5 9M7.2 18h9.6"})]}),models:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"m12 3 9 5-9 5-9-5z"}),d.jsx("path",{d:"m3 12.5 9 5 9-5M3 17l9 5 9-5"})]}),routing:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M6 3v6a4 4 0 0 0 4 4h8M14 9l4 4-4 4M6 21v-4"})}),presets:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0"}),d.jsx("circle",{cx:"16",cy:"6",r:"2"}),d.jsx("circle",{cx:"10",cy:"12",r:"2"}),d.jsx("circle",{cx:"18",cy:"18",r:"2"})]}),settings:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"3"}),d.jsx("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z"})]}),audit:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M9 4h6a1 1 0 0 1 1 1v1H8V5a1 1 0 0 1 1-1Z"}),d.jsx("path",{d:"M8 6H6a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-2M9 12h6M9 16h4"})]}),copy:t=>d.jsxs(pe,{...t,children:[d.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"2"}),d.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]}),check:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"m5 12 5 5L20 7"})}),right:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"m9 6 6 6-6 6"})}),left:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"m15 6-6 6 6 6"})}),qr:t=>d.jsxs(pe,{...t,children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),d.jsx("path",{d:"M14 14h3v3M21 14v.01M14 21h3M20 18v3"})]}),lock:t=>d.jsxs(pe,{...t,children:[d.jsx("rect",{x:"4",y:"10",width:"16",height:"11",rx:"2"}),d.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"})]}),plus:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M12 5v14M5 12h14"})}),up:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"m6 15 6-6 6 6"})}),down:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"m6 9 6 6 6-6"})}),x:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),menu:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})}),sun:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"4"}),d.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),monitor:t=>d.jsxs(pe,{...t,children:[d.jsx("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2"}),d.jsx("path",{d:"M8 20h8M12 16v4"})]}),moon:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),external:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"})}),download:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M12 4v11M7 10l5 5 5-5M4 20h16"})}),more:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"5",cy:"12",r:"1"}),d.jsx("circle",{cx:"12",cy:"12",r:"1"}),d.jsx("circle",{cx:"19",cy:"12",r:"1"})]}),shield:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M12 3 4 6v6c0 4.5 3.4 8.3 8 9 4.6-.7 8-4.5 8-9V6Z"}),d.jsx("path",{d:"m9 12 2 2 4-4"})]}),compass:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"9"}),d.jsx("path",{d:"m15.5 8.5-2 5-5 2 2-5z"})]}),logout:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M15 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4M10 17l5-5-5-5M15 12H3"})})};function CS(t){t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),an("migrate"))}function _S(){var f;const{viewer:t}=ir(),i=(f=qc().data)==null?void 0:f.exposure,[a,u]=I.useState(()=>Up(i==null?void 0:i.mode));return!yS(t,i,a||Up(i==null?void 0:i.mode))||!i?null:d.jsxs("div",{className:"gc-exposure",role:"region","aria-label":"Gateway reachability",children:[d.jsx("span",{className:"gc-exposure__icon","aria-hidden":"true",children:d.jsx(ut.monitor,{size:16})}),d.jsxs("div",{className:"gc-exposure__text",children:[d.jsxs("strong",{children:[xS(i),"."]})," ",d.jsx("span",{children:SS(i)})]}),d.jsxs("div",{className:"gc-exposure__actions",children:[d.jsxs(Le,{size:"sm",variant:"outline",href:_a("migrate"),onClick:CS,className:"gc-exposure__cta",children:["Move to a server ",d.jsx("span",{className:"gc-exposure__rec",children:"(recommended)"})]}),d.jsx($o,{label:"Dismiss for this session",className:"gc-exposure__close",onClick:()=>{wS(i.mode),u(!0)},children:d.jsx(ut.x,{size:14})})]})]})}function ES(t,r){return(t||r).replace(/\/+$/,"")}function PS(t){return`${t}/v1`}const Ea="ANTSEED_API_KEY",Pa={env:Ea};function bS(t){return"secret"in t?t.secret:`$${t.env}`}function Yv(t){return"secret"in t?`'${t.secret}'`:`process.env.${t.env}`}function jS(t){return"secret"in t?`"${t.secret}"`:`os.environ["${t.env}"]`}function Zv(t,r){return`${t.trim().toLowerCase().replace(/^0x/,"")}@${r.trim()}`}function TS(t){const r=t.apiProtocols??[];if(r.includes("openai-chat-completions"))return"openai-chat-completions";if(r.includes("anthropic-messages"))return"anthropic-messages";if(r.includes("openai-responses"))return"openai-responses";if(r.includes("openai-images"))return"openai-images";const i=t.provider.toLowerCase();return i.includes("anthropic")||i.includes("claude")?"anthropic-messages":i.includes("responses")?"openai-responses":"openai-chat-completions"}const RS={"anthropic-messages":"/v1/messages","openai-responses":"/v1/responses","openai-chat-completions":"/v1/chat/completions","openai-images":"/v1/images/generations"};function WC(t,r){if(t==="image")return"openai-images";if(t!=="text")return null;if(!r)return"openai-chat-completions";const i=TS({provider:r.provider,apiProtocols:r.protocols});return i==="openai-images"?"openai-chat-completions":i}const Jc="A lighthouse on a cliff at dawn, watercolor";function NS(t,r){return JSON.stringify(t==="anthropic-messages"?{model:r,max_tokens:1024,messages:[{role:"user",content:"Hello"}]}:t==="openai-responses"?{model:r,input:"Hello"}:t==="openai-images"?{model:r,prompt:Jc,n:1}:{model:r,messages:[{role:"user",content:"Hello"}]})}function Xv(t,r,i="openai-chat-completions",a=Pa){return[`curl ${t}${RS[i]} \\`,` -H "Authorization: Bearer ${bS(a)}" \\`,' -H "Content-Type: application/json" \\',` -d '${NS(i,r).replaceAll("'","'\\''")}'`].join(`
83
+ `,r)}function qx(){if(!zo())return Lu.stubThis(new Promise(r=>r(!1)));const t=globalThis.PublicKeyCredential;return(t==null?void 0:t.isConditionalMediationAvailable)===void 0?Lu.stubThis(new Promise(r=>r(!1))):Lu.stubThis(t.isConditionalMediationAvailable())}const Lu={stubThis:t=>t};function Kx({error:t,options:r}){const{publicKey:i}=r;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(r.signal instanceof AbortSignal)return new tt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new tt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const a=globalThis.location.hostname;if(Hv(a)){if(i.rpId!==a)return new tt({message:`The RP ID "${i.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new tt({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new tt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}async function Kv(t){var N,A;!t.optionsJSON&&t.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:r,useBrowserAutofill:i=!1,verifyBrowserAutofillInput:a=!0}=t;if(!zo())throw new Error("WebAuthn is not supported in this browser");let u;((N=r.allowCredentials)==null?void 0:N.length)!==0&&(u=(A=r.allowCredentials)==null?void 0:A.map(Bv));const f={...r,challenge:ga(r.challenge),allowCredentials:u},m={};if(i){if(!await qx())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&a)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');m.mediation="conditional",f.allowCredentials=[]}m.publicKey=f,m.signal=Wv.createNewAbortSignal();let v;try{v=await navigator.credentials.get(m)}catch(E){throw Kx({error:E,options:m})}if(!v)throw new Error("Authentication was not completed");const{id:g,rawId:h,response:y,type:x}=v;let C;return y.userHandle&&(C=on(y.userHandle)),{id:g,rawId:on(h),response:{authenticatorData:on(y.authenticatorData),clientDataJSON:on(y.clientDataJSON),signature:on(y.signature),userHandle:C},type:x,clientExtensionResults:v.getClientExtensionResults(),authenticatorAttachment:Vv(v.authenticatorAttachment)}}function Nr(t){return t.trim().toLowerCase().replace(/^0x/,"")}function Qv(t,r){return Nr(t)===Nr(r)}const Qx={balanced:"Balanced",price:"Lowest price",latency:"Lowest latency",trust:"Highest trust"};function Gc(){return{allowMode:"any",allowedPeerIds:[],allowedListIds:[],blockedPeerIds:[],blockedListIds:[],minTrustScore:"",minReputation:"",requireVerified:!1,requireTee:!1,maxInputUsdPerMillion:"",maxOutputUsdPerMillion:"",maxCachedInputUsdPerMillion:"",maxImageUsdPerImage:"",preferFreePeers:"inherit",sort:"",modelsMode:"any",allowedModels:[],routes:[]}}function fi(t){return t===void 0?"":String(t)}function Gx(t){return t===void 0?"inherit":t?"yes":"no"}function Yx(t){const r=Gc();return t?{...r,allowMode:t.allowedPeerIds||t.allowedPeerLists?"only":"any",allowedPeerIds:[...t.allowedPeerIds??[]],allowedListIds:[...t.allowedPeerLists??[]],blockedPeerIds:[...t.blockedPeerIds??[]],blockedListIds:[...t.blockedPeerLists??[]],minTrustScore:fi(t.minTrustScore),minReputation:fi(t.minReputation),requireVerified:t.requireVerified===!0,requireTee:t.requireTee===!0,maxInputUsdPerMillion:fi(t.maxInputUsdPerMillion),maxOutputUsdPerMillion:fi(t.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:fi(t.maxCachedInputUsdPerMillion),maxImageUsdPerImage:fi(t.maxImageUsdPerImage),preferFreePeers:Gx(t.preferFreePeers),sort:t.sort??"",modelsMode:t.allowedModels?"only":"any",allowedModels:[...t.allowedModels??[]],routes:Object.entries(t.modelRoutes??{}).map(([i,a])=>({model:i,peerIds:[...a.peerIds],strict:a.strict===!0}))}:r}class ya extends Error{}function Ou(t,r,i){const a=r.trim();if(a==="")return;const u=Number(a);if(!Number.isFinite(u)||u<0)throw new ya(`${t} must be a positive number.`);if(i!==void 0&&u>i)throw new ya(`${t} must be at most ${i}.`);return u}function hi(t){return[...new Set(t.map(r=>r.trim()).filter(Boolean))]}function $p(t,r){const i=hi(t);return r?i.filter(a=>r.some(u=>u.id===a)):i}function mC(t,r=null){const i={};if(t.allowMode==="only"){const h=$p(t.allowedListIds,r),y=hi(t.allowedPeerIds);(y.length>0||h.length===0)&&(i.allowedPeerIds=y),h.length>0&&(i.allowedPeerLists=h)}const a=hi(t.blockedPeerIds);a.length>0&&(i.blockedPeerIds=a);const u=$p(t.blockedListIds,r);u.length>0&&(i.blockedPeerLists=u);const f=Ou("Minimum trust",t.minTrustScore,100);f!==void 0&&(i.minTrustScore=f);const m=Ou("Minimum reputation",t.minReputation,100);m!==void 0&&(i.minReputation=m),t.requireVerified&&(i.requireVerified=!0),t.requireTee&&(i.requireTee=!0);const v=[["maxInputUsdPerMillion","Input price cap"],["maxOutputUsdPerMillion","Output price cap"],["maxCachedInputUsdPerMillion","Cached input price cap"],["maxImageUsdPerImage","Image price cap"]];for(const[h,y]of v){const x=Ou(y,t[h]);x!==void 0&&(i[h]=x)}t.preferFreePeers!=="inherit"&&(i.preferFreePeers=t.preferFreePeers==="yes"),t.sort&&(i.sort=t.sort),t.modelsMode==="only"&&(i.allowedModels=hi(t.allowedModels));const g=t.routes.filter(h=>h.model.trim()!=="");if(g.length>0){const h=new Set;i.modelRoutes={};for(const y of g){const x=y.model.trim();if(h.has(x))throw new ya(`Model "${x}" has two fallback chains.`);h.add(x);const C=hi(y.peerIds);if(C.length===0)throw new ya(`Add at least one seller to the "${x}" chain.`);i.modelRoutes[x]=y.strict?{peerIds:C,strict:!0}:{peerIds:C}}}return i}function Yc(t){return!t||Object.keys(t).length===0}function vC(t){return Yc(t)?null:t}function Zx(t){var a,u,f,m,v,g;if(Yc(t))return"Inherits";const r=t,i=[];if(r.allowedPeerIds||r.allowedPeerLists){const h=(a=r.allowedPeerLists)!=null&&a.length?` + ${r.allowedPeerLists.length} list${r.allowedPeerLists.length===1?"":"s"}`:"";i.push(`${((u=r.allowedPeerIds)==null?void 0:u.length)??0} allowed${h}`)}if((f=r.blockedPeerIds)!=null&&f.length||(m=r.blockedPeerLists)!=null&&m.length){const h=(v=r.blockedPeerLists)!=null&&v.length?` + ${r.blockedPeerLists.length} list${r.blockedPeerLists.length===1?"":"s"}`:"";i.push(`${((g=r.blockedPeerIds)==null?void 0:g.length)??0} blocked${h}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("verified only"),r.minTrustScore!==void 0&&i.push(`trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`reputation ≥ ${r.minReputation}`),(r.maxInputUsdPerMillion!==void 0||r.maxOutputUsdPerMillion!==void 0)&&i.push("price caps"),r.allowedModels&&i.push(`${r.allowedModels.length} models`),r.modelRoutes&&i.push(`${Object.keys(r.modelRoutes).length} fallback chains`),r.sort&&i.push(Qx[r.sort].toLowerCase()),r.preferFreePeers&&i.push("free first"),i.join(" · ")||"Custom"}function gC(t){if(!t)return null;const r={};t.minPeerReputation>0&&(r.minReputation=t.minPeerReputation),t.requireVerifier&&(r.requireVerified=!0),t.maxPricing&&(r.maxInputUsdPerMillion=t.maxPricing.inputUsdPerMillion,r.maxOutputUsdPerMillion=t.maxPricing.outputUsdPerMillion,t.maxPricing.cachedInputUsdPerMillion!==null&&(r.maxCachedInputUsdPerMillion=t.maxPricing.cachedInputUsdPerMillion));const i=t.routingPreferences;return i&&(i.minTrustScore>0&&(r.minTrustScore=i.minTrustScore),i.allowedPeerIds.length>0&&(r.allowedPeerIds=[...i.allowedPeerIds]),i.blockedPeerIds.length>0&&(r.blockedPeerIds=[...i.blockedPeerIds])),r}function yC(t){const r=[];t.minPeerReputation>0&&r.push(`reputation ≥ ${t.minPeerReputation}`),t.requireVerifier&&r.push("verified sellers only"),t.maxPricing&&(r.push(`≤ ${gi(t.maxPricing.inputUsdPerMillion)}/M in`),r.push(`≤ ${gi(t.maxPricing.outputUsdPerMillion)}/M out`),t.maxPricing.cachedInputUsdPerMillion!==null&&r.push(`≤ ${gi(t.maxPricing.cachedInputUsdPerMillion)}/M cached`));const i=t.routingPreferences;return i&&(i.minTrustScore>0&&r.push(`trust ≥ ${i.minTrustScore}`),i.allowedPeerIds.length>0&&r.push(`only ${wn(i.allowedPeerIds.length,"allowed seller")}`),i.blockedPeerIds.length>0&&r.push(wn(i.blockedPeerIds.length,"blocked seller")),i.preferFreePeers&&r.push("free first")),r}const wn=(t,r)=>`${t} ${r}${t===1?"":"s"}`,Xx={balanced:"balanced",price:"price",latency:"latency",trust:"trust"};function wC(t){var u,f,m,v,g,h,y;if(Yc(t))return[];const r=t,i=[],a=x=>x?` + ${wn(x,"list")}`:"";if(r.allowedPeerIds||r.allowedPeerLists){const x=((u=r.allowedPeerIds)==null?void 0:u.length)??0;i.push(x===0&&!((f=r.allowedPeerLists)!=null&&f.length)?"No seller allowed":`Allow ${x?wn(x,"seller"):""}${x?a((m=r.allowedPeerLists)==null?void 0:m.length):wn(r.allowedPeerLists.length,"list")}`)}if((v=r.blockedPeerIds)!=null&&v.length||(g=r.blockedPeerLists)!=null&&g.length){const x=((h=r.blockedPeerIds)==null?void 0:h.length)??0;i.push(`Block ${x?wn(x,"seller")+a((y=r.blockedPeerLists)==null?void 0:y.length):wn(r.blockedPeerLists.length,"list")}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("Verified only"),r.minTrustScore!==void 0&&i.push(`Trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`Reputation ≥ ${r.minReputation}`),r.maxInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxInputUsdPerMillion}/M in`),r.maxOutputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxOutputUsdPerMillion}/M out`),r.maxCachedInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxCachedInputUsdPerMillion}/M cached`),r.maxImageUsdPerImage!==void 0&&i.push(`≤ $${r.maxImageUsdPerImage}/image`),r.allowedModels&&i.push(r.allowedModels.length===0?"No model allowed":wn(r.allowedModels.length,"model")),r.modelRoutes&&Object.keys(r.modelRoutes).length>0&&i.push(wn(Object.keys(r.modelRoutes).length,"fallback chain")),r.sort&&i.push(`Sort: ${Xx[r.sort]}`),r.preferFreePeers!==void 0&&i.push(r.preferFreePeers?"Free sellers first":"Free sellers not first"),i}const xC=[{id:"cheapest",label:"Cheapest",description:"Lowest price first, free sellers ahead."},{id:"trusted",label:"Most trusted",description:"Trust 70+ and reputation 60+, ranked by trust."},{id:"tee",label:"TEE only",description:"Only sellers running in a trusted execution environment."},{id:"own",label:"Own peers only",description:"Only sellers in one of your peer lists."}];function SC(t,r=[]){switch(t){case"cheapest":return{sort:"price",preferFreePeers:!0};case"trusted":return{sort:"trust",minTrustScore:70,minReputation:60};case"tee":return{requireTee:!0};case"own":return{allowedPeerIds:hi(r)}}}function kC(t,r,i,a){var m,v,g;const u=structuredClone(t??{}),f=h=>h==null?void 0:h.filter(y=>!Qv(y,i));if(r==="allow")u.allowedPeerIds=[...f(u.allowedPeerIds)??[],i],u.blockedPeerIds=f(u.blockedPeerIds);else if(r==="block")u.blockedPeerIds=[...f(u.blockedPeerIds)??[],i],u.allowedPeerIds&&(u.allowedPeerIds=f(u.allowedPeerIds)),((m=u.allowedPeerIds)==null?void 0:m.length)===0&&!((v=u.allowedPeerLists)!=null&&v.length)&&delete u.allowedPeerIds;else if(r==="prefer"){if(!a)throw new Error("Pick a model to prefer this seller for.");const h={...u.modelRoutes??{}},y=h[a];h[a]={...y??{},peerIds:[i,...f(y==null?void 0:y.peerIds)??[]]},u.modelRoutes=h,u.blockedPeerIds=f(u.blockedPeerIds)}else u.allowedPeerIds&&(u.allowedPeerIds=f(u.allowedPeerIds)),u.blockedPeerIds=f(u.blockedPeerIds),u.modelRoutes&&(u.modelRoutes=Object.fromEntries(Object.entries(u.modelRoutes).map(([h,y])=>[h,{...y,peerIds:f(y.peerIds)??[]}]).filter(([,h])=>h.peerIds.length>0)));return((g=u.blockedPeerIds)==null?void 0:g.length)===0&&delete u.blockedPeerIds,u.modelRoutes&&Object.keys(u.modelRoutes).length===0&&delete u.modelRoutes,u}function CC(t,r){var a;const i=t==null?void 0:t.allowedPeerIds;return!i||(a=t==null?void 0:t.allowedPeerLists)!=null&&a.length?!1:i.length>0&&i.every(u=>Qv(u,r))}const Jx={allowMode:"allowed sellers",minTrustScore:"minimum trust",minReputation:"minimum reputation",requireVerified:"verified only",requireTee:"TEE only",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",preferFreePeers:"free sellers first",sort:"sort order",modelsMode:"allowed models"};function _C(t){const r=Yx(t),i=Gc(),a={};for(const u of Object.keys(r))JSON.stringify(r[u])!==JSON.stringify(i[u])&&(a[u]=r[u]);return(t.allowedPeerIds||t.allowedPeerLists)&&(a.allowMode="only",a.allowedPeerIds=r.allowedPeerIds,a.allowedListIds=r.allowedListIds),a}function EC(t,r){const i=Gc(),a=new Set;for(const u of Object.keys(r)){const f=JSON.stringify(t[u]);if(f===JSON.stringify(i[u])||f===JSON.stringify(r[u]))continue;const m=Jx[u]??(u==="allowedPeerIds"||u==="allowedListIds"?"allowed sellers":null);m&&a.add(m)}return[...a]}function PC(t,r){return{...t,...r}}function bC(t,r,i){const a=[...t],u=r+i;if(r<0||r>=a.length||u<0||u>=a.length)return a;const[f]=a.splice(r,1);return a.splice(u,0,f),a}function jC(t,r=null){if(!t||t.allowedPeerIds===void 0&&t.allowedPeerLists===void 0||(t.allowedPeerIds??[]).some(a=>a.trim()!==""))return!1;const i=t.allowedPeerLists??[];return i.length===0?!0:r?i.every(a=>{var u;return(((u=r.find(f=>f.id===a))==null?void 0:u.peerIds.length)??0)===0}):!1}function eS(t,r){if(t===void 0)return r;if(r===void 0)return t;const i=new Set(r.map(Nr));return t.filter(a=>i.has(Nr(a)))}function tS(t,r){return t===void 0?r:r===void 0?t:[...new Set([...t,...r])]}function Zc(t,r,i){return t===void 0?r:r===void 0?t:i(t,r)}const zp=(t,r)=>Zc(t,r,Math.max),oa=(t,r)=>Zc(t,r,Math.min),nS=(t,r)=>t.filter(i=>r.some(a=>a.toLowerCase()===i.toLowerCase()));function rS(t,r){const{allowedPeerLists:i,blockedPeerLists:a,...u}=t,f=v=>v.flatMap(g=>{var h;return((h=r.find(y=>y.id===g))==null?void 0:h.peerIds)??[]}),m={...u};return i!==void 0&&(m.allowedPeerIds=[...u.allowedPeerIds??[],...f(i)]),a!=null&&a.length&&(m.blockedPeerIds=[...u.blockedPeerIds??[],...f(a)]),m}function iS(...t){let r={};for(const i of t){if(!i)continue;const a={allowedPeerIds:eS(r.allowedPeerIds,i.allowedPeerIds),blockedPeerIds:tS(r.blockedPeerIds,i.blockedPeerIds),minTrustScore:zp(r.minTrustScore,i.minTrustScore),minReputation:zp(r.minReputation,i.minReputation),requireVerified:r.requireVerified||i.requireVerified?!0:void 0,requireTee:r.requireTee||i.requireTee?!0:void 0,maxInputUsdPerMillion:oa(r.maxInputUsdPerMillion,i.maxInputUsdPerMillion),maxOutputUsdPerMillion:oa(r.maxOutputUsdPerMillion,i.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:oa(r.maxCachedInputUsdPerMillion,i.maxCachedInputUsdPerMillion),maxImageUsdPerImage:oa(r.maxImageUsdPerImage,i.maxImageUsdPerImage),preferFreePeers:i.preferFreePeers??r.preferFreePeers,sort:i.sort??r.sort,allowedModels:Zc(r.allowedModels,i.allowedModels,nS),modelRoutes:i.modelRoutes||r.modelRoutes?{...r.modelRoutes??{},...i.modelRoutes??{}}:void 0};r=Object.fromEntries(Object.entries(a).filter(([,u])=>u!==void 0))}return r}function oS(t,r){if(t.allowedModels&&!t.allowedModels.some(a=>a.toLowerCase()===r.service.toLowerCase()))return!1;const i=(a,u)=>u!==void 0&&a!==null&&a>u;return!(i(r.inputUsdPerMillion,t.maxInputUsdPerMillion)||i(r.outputUsdPerMillion,t.maxOutputUsdPerMillion)||i(r.cachedInputUsdPerMillion,t.maxCachedInputUsdPerMillion))}function TC(t,r,i=[]){const a=rS(t,i),u=a.allowedPeerIds?new Set(a.allowedPeerIds.map(Nr)):null,f=new Set((a.blockedPeerIds??[]).map(Nr));return r.filter(m=>{const v=Nr(m.peerId);return f.has(v)||u&&!u.has(v)||a.minTrustScore!==void 0&&(m.trustScore??0)<a.minTrustScore||a.minReputation!==void 0&&(m.reputationScore??0)<a.minReputation||a.requireVerified&&!m.verified||a.requireTee&&!m.tee?!1:m.services.some(g=>oS(a,g))})}function RC(t){return!!t&&t.some(r=>r.reputationScore!==null)}function NC(t,r,i=!1){const a=t?t.ownerMemberId===r.memberId:!0;return{admin:r.workspaceAdmin,owner:a,layered:t?vv(t):i}}function sS(t,r){return t===null?r:r===null||Xe(t)<=Xe(r)?t:r}function aS(t,r){const i={};for(const a of Sv)i[a]=sS((t==null?void 0:t[a])??null,(r==null?void 0:r[a])??null);return i}function IC(t){const r=vv(t)?t:null;return{limits:aS(t.limits,r==null?void 0:r.ownerLimits),policy:iS(t.routingPolicy,(r==null?void 0:r.ownerRoutingPolicy)??null)}}function MC(t,r,i){const a={label:i.label};return i.expiresAt!==r.expiresAt&&(a.expiresAt=i.expiresAt),t.admin&&(a.limits=i.adminLimits,a.routingPolicy=i.adminPolicy,i.topupEnabled!==r.topupEnabled&&(a.topupEnabled=i.topupEnabled)),t.owner&&t.layered?(a.ownerLimits=i.ownerLimits,a.ownerRoutingPolicy=i.ownerPolicy):t.owner&&!t.admin&&(a.limits=i.ownerLimits,a.routingPolicy=i.ownerPolicy),a}const lS={allowedPeerIds:"allowed sellers",allowedPeerLists:"allowed peer lists",allowedModels:"allowed models",modelRoutes:"fallback chains",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",minTrustScore:"minimum trust",minReputation:"minimum reputation"};function uS(t){const[,r=t]=t.split(".");return/Limits$|^limits$/.test(t.split(".")[0]??"")?`${r} limit`:lS[r]??r}function cS(t){const r=[],i=t.fields;Array.isArray(i)&&i.length&&r.push(`Narrowed by the levels above: ${[...new Set(i.map(f=>uS(String(f))))].join(", ")}.`);const a=t.effectiveRoutingPolicy;a&&typeof a=="object"&&r.push(`Routing that would apply: ${Zx(a)}.`);const u=t.effectiveLimits;return u&&typeof u=="object"&&r.push(`Limits that would apply: ${$2(u)}.`),r}const da=Symbol("cancelled");async function LC(t,r,i){const a={};if(t){if(!await i({kind:"empty"}))return da;a.confirmEmpty=!0}for(;;)try{return await r({...a})}catch(u){if(Lr(u,"empty_allow_list")&&!a.confirmEmpty){if(!await i({kind:"empty"}))return da;a.confirmEmpty=!0}else if(Lr(u,"narrowed")&&!a.acceptNarrowed){if(!await i({kind:"narrowed",message:u.message,lines:cS(u.details)}))return da;a.acceptNarrowed=!0}else throw u}}function dS(t){const r=rr(),i=mv();return e1({mutationFn:t.mutationFn,onSuccess:(a,u)=>{var v;if(a===da)return;const f=a;(v=t.onSuccess)==null||v.call(t,f,u);for(const g of t.invalidate??[])r.invalidateQueries({queryKey:g});const m=typeof t.toast=="function"?t.toast(f,u):t.toast;m&&i(m)},onError:t.onError})}async function fS(t=fe){const r=await t.auth.reauthPasskeyOptions(),i=await Kv({optionsJSON:r});return t.auth.reauthPasskeyVerify(i)}async function OC(t,r,i=fe){const{message:a}=await i.auth.reauthWalletNonce(t);return i.auth.reauthWalletVerify(a,await r(a))}function hS(t,r){if(t.kind!=="member"||t.me.member.id!==r)throw new Error("That sign-in belongs to a different account. Reload the page and sign in as yourself.")}const uc="The passkey prompt was closed.";function cc(t){return t instanceof Error&&t.name==="NotAllowedError"}function Xc({error:t,onRetry:r,title:i="Could not load this"}){return d.jsx(lt,{tone:"danger",title:i,action:r?d.jsx(Le,{variant:"outline",size:"sm",onClick:r,children:"Retry"}):void 0,children:ka(t)})}function AC({query:t,children:r,rows:i}){return t.isLoading?d.jsx(Ni,{rows:i}):t.error?d.jsx(Xc,{error:t.error,onRetry:()=>void t.refetch()}):t.data===void 0?null:d.jsx(d.Fragment,{children:r(t.data)})}function DC({children:t,title:r}){return d.jsx("code",{className:"gc-mono",title:r,children:t})}function FC({label:t,value:r,strong:i}){return d.jsxs("div",{className:"gc-figure",children:[d.jsx("div",{className:"gc-figure__label",children:t}),d.jsx("div",{className:i?"gc-figure__value gc-figure__value--strong":"gc-figure__value",children:r})]})}function $C({name:t,hint:r}){return d.jsxs("div",{children:[d.jsx("div",{className:"gc-strong",children:t}),d.jsx("code",{className:"gc-mono gc-muted",children:r})]})}function zC({at:t,format:r}){return t===null?d.jsx(d.Fragment,{children:"Never"}):t<Date.now()?d.jsx(Sm,{tone:"warning",children:"Expired"}):d.jsx(d.Fragment,{children:r(t)})}const pS="Showing last known values — the chain RPC is busy.";function UC({stale:t}){return t?d.jsx("p",{className:"gc-muted",role:"status",children:pS}):null}function BC({to:t,children:r}){return d.jsx("a",{className:"gc-link",href:_a(t),onClick:Hc(t),children:r})}const mS=I.lazy(()=>Ue(()=>import("./WalletSignIn-3MlBmMgW.js"),__vite__mapDeps([0,1,2,3,4]))),vS=I.lazy(()=>Ue(()=>import("./WalletConfirm-PHdM3GaV.js"),__vite__mapDeps([5,6,1,2,3,4])));function gS({isOpen:t,onClose:r,startWith:i,intro:a,onCredentialAdded:u}){const{me:f}=ir(),m=rr(),v=Vc(t),[g,h]=I.useState("idle"),[y,x]=I.useState(i==="wallet"?"add":null),[C,N]=I.useState(null),[A,E]=I.useState(null),[M,L]=I.useState(!1),F=f.member.credentials,P=F.some(X=>X.kind==="passkey"),j=F.some(X=>X.kind==="wallet");function D(X){hS(X,f.member.id),m.setQueryData(Pe.me,X)}function W(X){return Lr(X,"reauth_required")?(h("needed"),N(null)):N(X),!0}async function te(){L(!0),N(null);try{const X=await fe.auth.passkeyRegisterOptions(),Te=await qv({optionsJSON:X});D(await fe.auth.passkeyRegisterVerify(Te)),h("idle"),u==null||u()}catch(X){cc(X)?N(new Error(uc)):W(X)}finally{L(!1)}}async function Z(){L(!0),N(null);try{D(await fS()),h("done")}catch(X){N(cc(X)?new Error(uc):X)}finally{L(!1)}}const se=dS({mutationFn:X=>fe.members.removeCredential(f.member.id,X.id),onSuccess:()=>E(null),onError:X=>{Lr(X,"reauth_required")&&(E(null),h("needed"))},invalidate:[Pe.me]}),ce=F.length<=1;return d.jsxs(cv,{isOpen:t,onClose:r,size:"lg",eyebrow:Uc[f.member.orgRole],title:f.member.label,subtitle:f.member.email??void 0,children:[d.jsxs("div",{className:"gc-stack",children:[a,d.jsxs("section",{className:"gc-stack gc-stack--tight",children:[d.jsx("div",{className:"as-field__label",children:"Your sign-in methods"}),F.length===0?d.jsx(lt,{tone:"info",children:"You signed in through your organization's access proxy and have no passkey or wallet here. Add one to approve sensitive actions, such as authorizing a withdrawal wallet."}):d.jsx("ul",{className:"gc-list gc-credentials",children:F.map(X=>d.jsxs("li",{className:"gc-inline gc-inline--between",children:[d.jsxs("span",{className:"gc-credential",children:[d.jsx(Sm,{children:X.kind})," ",d.jsx("span",{className:"gc-credential__label",children:X.label}),d.jsxs("span",{className:"gc-muted",children:[" · added ",Rp(X.createdAt)," · last used ",Rp(X.lastUsedAt)]})]}),d.jsx(Le,{variant:"ghost",size:"sm",disabled:ce,title:ce?"Add another sign-in method first":void 0,onClick:()=>{se.reset(),E(X)},children:"Remove"})]},X.id))}),ce&&F.length===1&&d.jsx("p",{className:"gc-fineprint",children:"This is your only sign-in method. Add another before removing it."})]}),g==="needed"&&d.jsx(lt,{tone:"info",title:"Confirm it is you",children:d.jsxs("div",{className:"gc-stack gc-stack--tight",children:[d.jsx("span",{children:"Changing your sign-in methods needs a recent sign-in. Confirm with one you already have, then try again."}),d.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[P&&d.jsx(Le,{size:"sm",disabled:M,onClick:()=>void Z(),children:"Confirm with a passkey"}),j&&y!=="confirm"&&d.jsx(Le,{size:"sm",variant:"outline",onClick:()=>x("confirm"),children:"Confirm with a wallet"})]}),y==="confirm"&&d.jsx(I.Suspense,{fallback:d.jsx(Le,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:d.jsx(vS,{onConfirmed:X=>{D(X),h("done"),x(null)}})}),!P&&!j&&d.jsx("span",{children:"Sign out and sign in again, then add it."})]})}),g==="done"&&d.jsx(lt,{tone:"success",children:"Confirmed. Add or remove the sign-in method now."}),v.data&&d.jsxs("section",{className:"gc-stack gc-stack--tight",children:[d.jsx("div",{className:"as-field__label",children:"Add a sign-in method"}),d.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[v.data.passkey&&d.jsx(Le,{variant:"outline",size:"sm",disabled:M||!zo(),onClick:()=>void te(),children:M?"Waiting for your passkey…":"Add a passkey"}),v.data.wallet&&y!=="add"&&d.jsx(Le,{variant:"outline",size:"sm",onClick:()=>x("add"),children:"Add a wallet"}),v.data.oidc&&d.jsxs(Le,{variant:"outline",size:"sm",href:fe.auth.oidcLinkUrl(),children:["Link ",v.data.oidc.label]})]}),y==="add"&&d.jsx(I.Suspense,{fallback:d.jsx(Le,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:d.jsx(mS,{autoConnect:!0,actionLabel:X=>`Add ${X} as a sign-in method`,onError:W,onSignedIn:X=>{D(X),x(null),h("idle"),u==null||u()}})}),d.jsx("p",{className:"gc-fineprint",children:"A wallet you add can become this workspace's withdrawal wallet only 24 hours later."})]}),C?d.jsx(lt,{tone:"danger",children:ka(C)}):null,d.jsx("div",{className:"gc-actions",children:d.jsx(Le,{onClick:r,children:"Done"})})]}),d.jsx(a2,{isOpen:A!==null,busy:se.isPending,error:se.error,onClose:()=>{E(null),se.reset()},onConfirm:()=>A&&se.mutate(A),title:"Remove this sign-in method?",confirmLabel:"Remove",body:`You can no longer sign in with ${(A==null?void 0:A.label)??"it"}.`})]})}const Gv="antseed-console-exposure-dismissed";function yS(t,r,i){return!r||r.mode==="public"||i?!1:Ca(t)}function Up(t){if(!t)return!1;try{return sessionStorage.getItem(Gv)===t}catch{return!1}}function wS(t){try{sessionStorage.setItem(Gv,t)}catch{}}function xS(t){return t.mode==="local"?"This gateway runs on this computer":"This gateway is only reachable on your network"}function SS(t){return t.mode==="local"?"Keys only work while it's on and can't be reached from other machines.":t.personalComputer?"Keys only work while this computer is on, over plain HTTP, and not from outside your network.":"It has no public HTTPS address: keys travel over plain HTTP and do not work from outside your network."}const kS=/^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;function HC(t){const r=t.trim().toLowerCase().replace(/^https?:\/\//,"").replace(/[/:].*$/,"");return kS.test(r)?r:null}const sa="antseed-gateway.bundle";function WC(t){const r=t.domain??"llm.example.com",i=t.server.trim()||"user@your-server",a=`/tmp/${sa}`;return{exportBundle:`antseed gateway export --out ${sa}`,copy:`scp ${sa} ${i}:${a}`,install:`curl -fsSL https://antseed.com/install-gateway.sh | sudo bash -s -- --domain ${r} --import ${a}`,baseUrl:`https://${r}/v1`,stop:`rm ${sa}`,recover:"antseed gateway console-link --recover",tunnel:`CLOUDFLARED_TUNNEL_TOKEN=<tunnel-token> ANTSEED_TUNNEL_PUBLIC_URL=https://${r} \\
84
+ antseed tunnel start --provider cloudflare`}}function pe({size:t=16,children:r,...i}){return d.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i,children:r})}const ut={teeFull:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M12 3 4.5 6v5.5c0 4.6 3.2 8.4 7.5 9.5 4.3-1.1 7.5-4.9 7.5-9.5V6z"}),d.jsx("path",{d:"m8.8 12 2.2 2.2 4.2-4.4"})]}),teePartial:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M12 3 4.5 6v5.5c0 4.6 3.2 8.4 7.5 9.5 4.3-1.1 7.5-4.9 7.5-9.5V6z"}),d.jsx("path",{d:"M12 3v18c-4.3-1.1-7.5-4.9-7.5-9.5V6z",fill:"currentColor",stroke:"none"})]}),overview:t=>d.jsxs(pe,{...t,children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"9",rx:"1.5"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"5",rx:"1.5"}),d.jsx("rect",{x:"14",y:"12",width:"7",height:"9",rx:"1.5"}),d.jsx("rect",{x:"3",y:"16",width:"7",height:"5",rx:"1.5"})]}),chat:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M4 5h16v11H9l-5 4z"}),d.jsx("path",{d:"M8 9.5h8M8 12.5h5"})]}),activity:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M3 12h4l3 8 4-16 3 8h4"})}),logs:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),keys:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"8",cy:"15",r:"4"}),d.jsx("path",{d:"m10.8 12.2 9.2-9.2M17 6l3 3M14 9l2 2"})]}),members:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"9",cy:"8",r:"3.5"}),d.jsx("path",{d:"M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14.5a6.5 6.5 0 0 1 3.5 5.5"})]}),workspaces:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M3 7h18v13H3zM8 7V4h8v3"})}),wallet:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M3 7a2 2 0 0 1 2-2h13v4"}),d.jsx("rect",{x:"3",y:"7",width:"18",height:"13",rx:"2"}),d.jsx("circle",{cx:"16.5",cy:"13.5",r:"1.3"})]}),rewards:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M12 15a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z"}),d.jsx("path",{d:"m8.5 14-1.5 7 5-3 5 3-1.5-7"})]}),providers:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"12",cy:"5",r:"2.2"}),d.jsx("circle",{cx:"5",cy:"18",r:"2.2"}),d.jsx("circle",{cx:"19",cy:"18",r:"2.2"}),d.jsx("path",{d:"M11 7 6 16M13 7l5 9M7.2 18h9.6"})]}),network:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"12",cy:"5",r:"2.2"}),d.jsx("circle",{cx:"5",cy:"18",r:"2.2"}),d.jsx("circle",{cx:"19",cy:"18",r:"2.2"}),d.jsx("path",{d:"M11 7 6 16M13 7l5 9M7.2 18h9.6"})]}),models:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"m12 3 9 5-9 5-9-5z"}),d.jsx("path",{d:"m3 12.5 9 5 9-5M3 17l9 5 9-5"})]}),routing:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M6 3v6a4 4 0 0 0 4 4h8M14 9l4 4-4 4M6 21v-4"})}),presets:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0"}),d.jsx("circle",{cx:"16",cy:"6",r:"2"}),d.jsx("circle",{cx:"10",cy:"12",r:"2"}),d.jsx("circle",{cx:"18",cy:"18",r:"2"})]}),settings:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"3"}),d.jsx("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z"})]}),audit:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M9 4h6a1 1 0 0 1 1 1v1H8V5a1 1 0 0 1 1-1Z"}),d.jsx("path",{d:"M8 6H6a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-2M9 12h6M9 16h4"})]}),copy:t=>d.jsxs(pe,{...t,children:[d.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"2"}),d.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]}),check:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"m5 12 5 5L20 7"})}),right:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"m9 6 6 6-6 6"})}),left:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"m15 6-6 6 6 6"})}),qr:t=>d.jsxs(pe,{...t,children:[d.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),d.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),d.jsx("path",{d:"M14 14h3v3M21 14v.01M14 21h3M20 18v3"})]}),lock:t=>d.jsxs(pe,{...t,children:[d.jsx("rect",{x:"4",y:"10",width:"16",height:"11",rx:"2"}),d.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"})]}),plus:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M12 5v14M5 12h14"})}),up:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"m6 15 6-6 6 6"})}),down:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"m6 9 6 6 6-6"})}),x:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),menu:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})}),sun:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"4"}),d.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),monitor:t=>d.jsxs(pe,{...t,children:[d.jsx("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2"}),d.jsx("path",{d:"M8 20h8M12 16v4"})]}),moon:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),external:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"})}),download:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M12 4v11M7 10l5 5 5-5M4 20h16"})}),more:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"5",cy:"12",r:"1"}),d.jsx("circle",{cx:"12",cy:"12",r:"1"}),d.jsx("circle",{cx:"19",cy:"12",r:"1"})]}),shield:t=>d.jsxs(pe,{...t,children:[d.jsx("path",{d:"M12 3 4 6v6c0 4.5 3.4 8.3 8 9 4.6-.7 8-4.5 8-9V6Z"}),d.jsx("path",{d:"m9 12 2 2 4-4"})]}),compass:t=>d.jsxs(pe,{...t,children:[d.jsx("circle",{cx:"12",cy:"12",r:"9"}),d.jsx("path",{d:"m15.5 8.5-2 5-5 2 2-5z"})]}),logout:t=>d.jsx(pe,{...t,children:d.jsx("path",{d:"M15 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4M10 17l5-5-5-5M15 12H3"})})};function CS(t){t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),an("migrate"))}function _S(){var f;const{viewer:t}=ir(),i=(f=qc().data)==null?void 0:f.exposure,[a,u]=I.useState(()=>Up(i==null?void 0:i.mode));return!yS(t,i,a||Up(i==null?void 0:i.mode))||!i?null:d.jsxs("div",{className:"gc-exposure",role:"region","aria-label":"Gateway reachability",children:[d.jsx("span",{className:"gc-exposure__icon","aria-hidden":"true",children:d.jsx(ut.monitor,{size:16})}),d.jsxs("div",{className:"gc-exposure__text",children:[d.jsxs("strong",{children:[xS(i),"."]})," ",d.jsx("span",{children:SS(i)})]}),d.jsxs("div",{className:"gc-exposure__actions",children:[d.jsxs(Le,{size:"sm",variant:"outline",href:_a("migrate"),onClick:CS,className:"gc-exposure__cta",children:["Move to a server ",d.jsx("span",{className:"gc-exposure__rec",children:"(recommended)"})]}),d.jsx($o,{label:"Dismiss for this session",className:"gc-exposure__close",onClick:()=>{wS(i.mode),u(!0)},children:d.jsx(ut.x,{size:14})})]})]})}function ES(t,r){return(t||r).replace(/\/+$/,"")}function PS(t){return`${t}/v1`}const Ea="ANTSEED_API_KEY",Pa={env:Ea};function bS(t){return"secret"in t?t.secret:`$${t.env}`}function Yv(t){return"secret"in t?`'${t.secret}'`:`process.env.${t.env}`}function jS(t){return"secret"in t?`"${t.secret}"`:`os.environ["${t.env}"]`}function Zv(t,r){return`${t.trim().toLowerCase().replace(/^0x/,"")}@${r.trim()}`}function TS(t){const r=t.apiProtocols??[];if(r.includes("openai-chat-completions"))return"openai-chat-completions";if(r.includes("anthropic-messages"))return"anthropic-messages";if(r.includes("openai-responses"))return"openai-responses";if(r.includes("openai-images"))return"openai-images";const i=t.provider.toLowerCase();return i.includes("anthropic")||i.includes("claude")?"anthropic-messages":i.includes("responses")?"openai-responses":"openai-chat-completions"}const RS={"anthropic-messages":"/v1/messages","openai-responses":"/v1/responses","openai-chat-completions":"/v1/chat/completions","openai-images":"/v1/images/generations"};function VC(t,r){if(t==="image")return"openai-images";if(t!=="text")return null;if(!r)return"openai-chat-completions";const i=TS({provider:r.provider,apiProtocols:r.protocols});return i==="openai-images"?"openai-chat-completions":i}const Jc="A lighthouse on a cliff at dawn, watercolor";function NS(t,r){return JSON.stringify(t==="anthropic-messages"?{model:r,max_tokens:1024,messages:[{role:"user",content:"Hello"}]}:t==="openai-responses"?{model:r,input:"Hello"}:t==="openai-images"?{model:r,prompt:Jc,n:1}:{model:r,messages:[{role:"user",content:"Hello"}]})}function Xv(t,r,i="openai-chat-completions",a=Pa){return[`curl ${t}${RS[i]} \\`,` -H "Authorization: Bearer ${bS(a)}" \\`,' -H "Content-Type: application/json" \\',` -d '${NS(i,r).replaceAll("'","'\\''")}'`].join(`
85
85
  `)}function Jv(t,r,i="openai-chat-completions",a=Pa){return["import OpenAI from 'openai'","","const client = new OpenAI({",` baseURL: '${t}/v1',`,` apiKey: ${Yv(a)},`,"})","",...i==="openai-images"?["const result = await client.images.generate({",` model: '${r}',`,` prompt: '${Jc}',`,"})","console.log(result.data[0].url ?? result.data[0].b64_json)"]:i==="openai-responses"?["const reply = await client.responses.create({",` model: '${r}',`," input: 'Hello',","})","console.log(reply.output_text)"]:["const reply = await client.chat.completions.create({",` model: '${r}',`," messages: [{ role: 'user', content: 'Hello' }],","})","console.log(reply.choices[0].message.content)"]].join(`
86
86
  `)}function IS(t,r,i="openai-chat-completions",a=Pa){return[..."env"in a?["import os"]:[],"from openai import OpenAI","",`client = OpenAI(base_url="${t}/v1", api_key=${jS(a)})`,"",...i==="openai-images"?[`result = client.images.generate(model="${r}", prompt="${Jc}")`,"print(result.data[0].url or result.data[0].b64_json)"]:i==="openai-responses"?[`reply = client.responses.create(model="${r}", input="Hello")`,"print(reply.output_text)"]:["reply = client.chat.completions.create(",` model="${r}",`,' messages=[{"role": "user", "content": "Hello"}],',")","print(reply.choices[0].message.content)"]].join(`
87
87
  `)}function eg(t,r,i=Pa){return["import Anthropic from '@anthropic-ai/sdk'","","const client = new Anthropic({",` baseURL: '${t}',`,` authToken: ${Yv(i)}, // sent as Authorization: Bearer`,"})","","const reply = await client.messages.create({",` model: '${r}',`," max_tokens: 1024,"," messages: [{ role: 'user', content: 'Hello' }],","})"].join(`
88
88
  `)}function MS(t,r){return["# ~/.codex/config.toml",`model = "${r}"`,'model_provider = "antseed"',"","[model_providers.antseed]",'name = "Antseed gateway"',`base_url = "${t}/v1"`,`env_key = "${Ea}"`,'wire_api = "responses"'].join(`
89
89
  `)}function LS(t,r){return[`export ANTHROPIC_BASE_URL="${t}"`,`export ANTHROPIC_AUTH_TOKEN="$${Ea}"`,`export ANTHROPIC_MODEL="${r}"`,"claude"].join(`
90
90
  `)}function OS(t,r){return[`Base URL: ${t}/v1`,`API key: $${Ea} (your Antseed key)`,`Model: ${r}`].join(`
91
- `)}function VC(t,r,i="<model>"){const a={secret:r};return[{id:"curl",label:"curl",code:Xv(t,i,"openai-chat-completions",a)},{id:"openai",label:"OpenAI SDK",code:Jv(t,i,"openai-chat-completions",a)},{id:"anthropic",label:"Anthropic SDK",code:eg(t,i,a)}]}function AS(t,r,i){const a=[{id:"curl",label:"curl",language:"shell",code:Xv(t,r,i)},{id:"openai-python",label:"Python",language:"python",code:IS(t,r,i)},{id:"openai-js",label:"JavaScript",language:"javascript",code:Jv(t,r,i)}];return i==="anthropic-messages"&&a.push({id:"anthropic",label:"Anthropic SDK",language:"javascript",code:eg(t,r)}),a}function qC(t,r,i,a,u){const f=Zv(r,i),m=AS(t,f,a);return a==="openai-images"||m.push({id:"codex",label:"Codex",language:"toml",code:MS(t,u??"@preset/<your-preset>")},{id:"claude-code",label:"Claude Code",language:"shell",code:LS(t,f)},{id:"openai-compatible",label:"Cursor / OpenAI-compatible",language:"text",code:OS(t,f)}),m}function DS(){var r;const t=qc();return ES((r=t.data)==null?void 0:r.publicUrl,window.location.origin)}function FS(){const t=mv();return async r=>{await dv(r)?t("Copied"):t("Could not copy to the clipboard","danger")}}function KC(t,r,i){return{label:"Copy model id",onSelect:()=>void t(Zv(r,i))}}function QC({value:t,label:r}){const i=FS();return d.jsx($o,{label:r,size:"sm",className:"gc-copy-id",onClick:a=>{a.stopPropagation(),i(t)},children:d.jsx(ut.copy,{size:13})})}function Bp({className:t}){const r=PS(DS());return d.jsxs("div",{className:["gc-endpoint",t].filter(Boolean).join(" "),title:`OpenAI-compatible base URL: ${r}`,children:[d.jsx("span",{className:"gc-endpoint__label",children:"API"}),d.jsx("code",{className:"gc-endpoint__url",children:r}),d.jsx(Dc,{iconOnly:!0,value:r,label:"Copy the gateway API URL",className:"gc-endpoint__copy"})]})}const tg="https://antseed.com/docs/gateway",$S=I.lazy(()=>Ue(()=>import("./Migrate-IZJLx1xU.js"),[]));function dc({to:t="overview",tagged:r,size:i=26}){const a=d.jsxs(d.Fragment,{children:[d.jsx(d2,{height:i,className:"gc-brand__full"}),d.jsx(f2,{size:26,className:"gc-brand__mark"}),d.jsx("span",{className:"gc-brand__tag",children:"Console"})]}),u=r?"gc-brand gc-brand--tagged":"gc-brand";return t===null?d.jsx("span",{className:u,children:a}):d.jsx("a",{className:u,href:_a(t),onClick:Hc(t),"aria-label":"Antseed console home",children:a})}const fc="No authorized wallet: nobody can withdraw funds or claim ANTS rewards";function zS(){var v;const{me:t,workspace:r,setWorkspaceId:i}=ir(),{missingOperator:a,currentMissingOperator:u}=Ev(),f=u&&d.jsx("span",{className:"gc-attention",role:"img","aria-label":fc,title:fc});if(t.workspaces.length<=1)return d.jsxs("span",{className:"gc-ws",title:"Workspace","data-tour":"workspace",children:[d.jsx(ut.workspaces,{size:14}),d.jsx("span",{className:"gc-ws__name",children:r.name}),f]});const m=(v=t.workspaces.find(g=>g.workspace.id===r.id))==null?void 0:v.role;return d.jsx("span",{"data-tour":"workspace",className:"gc-ws-wrap",children:d.jsx(o1,{label:`Workspace: ${r.name}. Switch workspace`,triggerStyle:"plain",align:"start",width:260,className:"gc-ws gc-ws--select",trigger:d.jsxs(d.Fragment,{children:[d.jsx(ut.workspaces,{size:14}),d.jsx("span",{className:"gc-ws__name",children:r.name}),m==="admin"&&d.jsx("span",{className:"gc-ws__role",children:"admin"}),f,d.jsx(ut.down,{size:14,className:"gc-ws__chevron"})]}),items:t.workspaces.map(({workspace:g,role:h})=>({label:g.name,description:[h==="admin"?"Admin":"Member",g.id!==r.id&&a.has(g.id)?"no authorized wallet":null].filter(Boolean).join(" · "),checked:g.id===r.id,onSelect:()=>{g.id!==r.id&&i(g.id)}}))})})}function US(t,r){return t!=="wallet"?null:r.currentMissingOperator?fc:r.withdrawable.count>0?`${r.withdrawable.count} channel${r.withdrawable.count===1?"":"s"} ready to withdraw`:null}function Hp({current:t,onNavigate:r}){const{viewer:i}=ir(),a=Ev(),u=_2(i),f=[...new Set(u.map(m=>m.group))];return d.jsx("nav",{className:"gc-nav","aria-label":"Console",children:f.map(m=>d.jsxs("div",{className:"gc-nav__group",children:[d.jsx("div",{className:"gc-nav__heading",children:m}),u.filter(v=>v.group===m).map(v=>{const g=ut[v.id]??ut.overview;return d.jsxs("a",{href:_a(v.id),"aria-current":v.id===t?"page":void 0,"data-tour":`nav-${v.id}`,className:v.id===t?"gc-nav__item gc-nav__item--on":"gc-nav__item",onClick:h=>{Hc(v.id)(h),r==null||r()},children:[d.jsx(g,{size:16}),d.jsx("span",{children:v.label}),(()=>{const h=US(v.id,a);return h&&d.jsx("span",{className:"gc-attention gc-nav__attention",role:"img","aria-label":h,title:h})})()]},v.id)})]},m))})}const Wp={system:"System",dark:"Dark",light:"Light"},BS={system:"dark",dark:"light",light:"system"},HS={system:ut.monitor,dark:ut.moon,light:ut.sun};function ng(){const[t,r]=I2(),i=BS[t],a=HS[t];return d.jsx($o,{className:"gc-topbar__icon",label:`Color theme: ${Wp[t]}. Switch to ${Wp[i]}.`,onClick:()=>r(i),children:d.jsx(a,{size:16})})}function WS(){const t=rr();return async()=>{try{await fe.auth.logout()}finally{t.clear(),an("login",{replace:!0})}}}function VS(t){var u;const r=t.trim().split(/\s+/).filter(Boolean),i=((u=r[0])==null?void 0:u[0])??"?",a=r.length>1?r[r.length-1][0]:"";return(i+a).toUpperCase()}function qS({onAccount:t,onTour:r,onSignOut:i}){const{me:a}=ir(),[u,f]=I.useState(!1),m=I.useRef(null),v=I.useRef(null);I.useEffect(()=>{var N,A;if(!u)return;const x=E=>{var M;(M=m.current)!=null&&M.contains(E.target)||f(!1)},C=E=>{var M;E.key==="Escape"&&(f(!1),(M=v.current)==null||M.focus())};return document.addEventListener("mousedown",x),document.addEventListener("keydown",C),(A=(N=m.current)==null?void 0:N.querySelector('[role="menuitem"]'))==null||A.focus(),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",C)}},[u]);const g=x=>()=>{f(!1),x()},h=Uc[a.member.orgRole],y=a.member.email?`${a.member.email} · ${h}`:h;return d.jsxs("div",{className:"gc-account",ref:m,"data-tour":"account",children:[d.jsx("button",{ref:v,type:"button",className:"gc-user","aria-haspopup":"menu","aria-expanded":u,"aria-label":`Your account: ${a.member.label}`,onClick:()=>f(x=>!x),children:d.jsx("span",{className:"gc-avatar","aria-hidden":"true",children:VS(a.member.label)})}),u&&d.jsxs("div",{className:"gc-account__menu",role:"menu","aria-label":"Account",children:[d.jsxs("div",{className:"gc-account__who",children:[d.jsx("div",{className:"gc-account__name",children:a.member.label}),d.jsx("div",{className:"gc-account__meta",children:y})]}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(t),children:[d.jsx(ut.shield,{size:15}),"Account and sign-in"]}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(r),children:[d.jsx(ut.compass,{size:15}),"Take the tour"]}),d.jsxs("a",{role:"menuitem",className:"gc-account__item",href:tg,target:"_blank",rel:"noreferrer",onClick:()=>f(!1),children:[d.jsx(ut.external,{size:15}),"Documentation"]}),d.jsx("div",{className:"gc-account__sep"}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(i),children:[d.jsx(ut.logout,{size:15}),"Sign out"]})]})]})}function Vp(){var r;const t=(r=qc().data)==null?void 0:r.version;return t?d.jsxs("p",{className:"gc-version",children:["Antseed v",t]}):null}function KS({page:t,children:r}){const[i,a]=I.useState(!1),[u,f]=I.useState(()=>new URLSearchParams(window.location.search).get("account")==="1"),m=WS(),v=Bc().page==="migrate",g=v?null:t,{me:h,viewer:y}=ir();return I.useEffect(()=>{if(v||zx(h.member.id))return;const x=window.setTimeout(()=>Fp(y,h.member.id),600);return()=>window.clearTimeout(x)},[h.member.id]),d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"gc-app","data-page":g??void 0,children:[d.jsx("a",{className:"gc-skip",href:"#gc-main",children:"Skip to content"}),d.jsxs("header",{className:"gc-topbar",children:[d.jsxs("div",{className:"gc-topbar__inner",children:[d.jsx($o,{label:"Open menu",className:"gc-topbar__menu gc-topbar__icon",onClick:()=>a(!0),children:d.jsx(ut.menu,{size:16})}),d.jsx(dc,{}),d.jsx("span",{className:"gc-topbar__sep","aria-hidden":"true",children:"/"}),d.jsx(zS,{}),d.jsx("div",{className:"gc-topbar__spacer"}),d.jsx(Bp,{className:"gc-endpoint--inline"}),d.jsx("a",{className:"gc-topbar__link",href:tg,target:"_blank",rel:"noreferrer",children:"Docs"}),d.jsx(ng,{}),d.jsx(qS,{onAccount:()=>f(!0),onTour:()=>Fp(y,h.member.id),onSignOut:()=>void m()})]}),d.jsx("div",{className:"gc-topbar__strip",children:d.jsx(Bp,{})})]}),d.jsxs("div",{className:"gc-body",children:[d.jsxs("aside",{className:"gc-rail",children:[d.jsx(Hp,{current:g}),d.jsx(Vp,{})]}),d.jsx("main",{id:"gc-main",className:"gc-main",tabIndex:-1,children:v?d.jsx(I.Suspense,{fallback:d.jsx(Ni,{rows:6}),children:d.jsx($S,{})}):d.jsxs(d.Fragment,{children:[d.jsx(_S,{}),r]})})]})]}),d.jsxs(u2,{isOpen:i,onClose:()=>a(!1),side:"left",title:d.jsx(dc,{to:null}),className:"gc-mobile-nav",children:[d.jsx(Hp,{current:g,onNavigate:()=>a(!1)}),d.jsx(Vp,{})]}),d.jsx(gS,{isOpen:u,onClose:()=>f(!1)})]})}const QS=I.lazy(()=>Ue(()=>import("./WalletSignIn-_VjhsjCt.js"),__vite__mapDeps([0,1,2,3,4]))),qp={not_invited:"This account has not been invited to this console. Ask an admin for an invite link.",invite_expired:"This invite link has expired. Ask an admin for a new one.",invite_used:"This invite link was already used. Sign in instead.",invalid_token:"This link is not valid. Check that you copied all of it.",setup_complete:"This console is already set up. Sign in instead.",member_disabled:"Your access to this console has been turned off.",unknown_credential:"This passkey or wallet is not registered here.",key_revoked:"This API key has been revoked.",invalid_key:"That API key is not valid.",rate_limited:"Too many attempts. Wait a minute and try again.",key_expired:"This API key has expired.",not_linked:"This account is not linked to a member yet. Sign in another way and link it from your profile, or use your invite link.",invalid_enrollment:"This sign-up link has expired. Open your invite link again, or ask for a new one.",unauthenticated:"Sign in first.",oidc_denied:"Single sign-on was cancelled.",oidc_state:"The single sign-on attempt expired. Try again.",oidc_failed:"Single sign-on could not be verified. Try again, or use another sign-in method.",oidc_unavailable:"The single sign-on provider could not be reached. Try again later.",reauth_required:"Linking a sign-in provider needs a fresh sign-in. Go back to the console, confirm it is you under Your sign-in methods, then link it again.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then link the provider again.",credential_exists:"This single sign-on account is already linked to another member."},GS=new Set(["reauth_required","access_reauth_required","credential_exists"]);function rg(t){return Object.hasOwn(qp,t)?qp[t]:void 0}function ed(t){return Lr(t)&&rg(t.code)||ka(t)}function hc({title:t,subtitle:r,children:i}){return d.jsxs("div",{className:"gc-auth",children:[d.jsx("div",{className:"gc-auth__theme",children:d.jsx(ng,{})}),d.jsx("div",{className:"gc-auth__logo",children:d.jsx(dc,{to:null,tagged:!0,size:30})}),d.jsxs(Sc,{className:"gc-auth__card",children:[d.jsx("h1",{className:"gc-auth__title",children:t}),r&&d.jsx("p",{className:"gc-auth__subtitle",children:r}),i]}),d.jsx("p",{className:"gc-auth__foot",children:"Self-hosted Antseed gateway"})]})}function ig(){const t=rr();return r=>{t.setQueryData(Pe.me,r),an(r.kind==="key"?"key":"overview",{replace:!0})}}function Kp({label:t,run:r,primary:i}){const[a,u]=I.useState(!1),[f,m]=I.useState(null),v=zo();return d.jsxs("div",{className:"gc-stack gc-stack--tight",children:[d.jsx(Le,{fullWidth:!0,variant:i?"primary":"outline",disabled:a||!v,onClick:async()=>{u(!0),m(null);try{await r()}catch(g){m(cc(g)?uc:ed(g))}finally{u(!1)}},children:a?"Waiting for your passkey…":t}),!v&&d.jsx("p",{className:"gc-fineprint",children:"This browser does not support passkeys."}),f&&d.jsx(lt,{tone:"danger",children:f})]})}function YS({enrollment:t,onSignedIn:r}){const[i,a]=I.useState(!1);return i?d.jsx(I.Suspense,{fallback:d.jsx(Le,{variant:"outline",fullWidth:!0,disabled:!0,children:"Loading wallets…"}),children:d.jsx(QS,{enrollment:t,onSignedIn:r,autoConnect:!0})}):d.jsx(Le,{variant:"outline",fullWidth:!0,onClick:()=>a(!0),children:"Sign in with a wallet"})}function ZS(){return d.jsx("div",{className:"gc-divider",children:d.jsx("span",{children:"or"})})}function XS({onSignedIn:t}){const[r,i]=I.useState(""),[a,u]=I.useState(!1),[f,m]=I.useState(null);return d.jsxs("form",{className:"gc-stack gc-stack--tight",onSubmit:async v=>{v.preventDefault(),u(!0),m(null);try{t(await fe.auth.apiKey(r.trim()))}catch(g){m(ed(g))}finally{u(!1)}},children:[d.jsx(g2,{label:"API key",type:"password",autoComplete:"off",placeholder:"Paste your key to see its usage",value:r,onChange:v=>i(v.target.value)}),d.jsx(Le,{type:"submit",variant:"outline",fullWidth:!0,disabled:a||!r.trim(),children:a?"Checking…":"View key usage"}),f&&d.jsx(lt,{tone:"danger",children:f})]})}function JS({mode:t,enrollment:r,onSignedIn:i}){return t==="login"?d.jsx(Kp,{primary:!0,label:"Sign in with a passkey",run:async()=>{const a=await fe.auth.passkeyLoginOptions(),u=await Kv({optionsJSON:a});i(await fe.auth.passkeyLoginVerify(u))}}):d.jsx(Kp,{primary:!0,label:"Create a passkey",run:async()=>{const a=await fe.auth.passkeyRegisterOptions(r),u=await qv({optionsJSON:a});i(await fe.auth.passkeyRegisterVerify(u,r))}})}function og({config:t,enrollment:r,onSignedIn:i,mode:a}){const u=[];return t.passkey&&u.push(d.jsx(JS,{mode:a,enrollment:r,onSignedIn:i},"passkey")),t.wallet&&u.push(d.jsx(YS,{enrollment:r,onSignedIn:i},"wallet")),t.oidc&&u.push(d.jsxs(Le,{variant:"outline",fullWidth:!0,href:fe.auth.oidcStartUrl(r),children:["Continue with ",t.oidc.label]},"oidc")),u.length===0?d.jsx(lt,{tone:"warning",children:"No sign-in method is enabled on this gateway. Check the gateway's console auth settings."}):d.jsx("div",{className:"gc-stack",children:u})}function ek(){const t=Vc(),r=ig(),i=new URLSearchParams(window.location.search).get("error");return d.jsxs(hc,{title:"Sign in",subtitle:"Manage keys, budgets, routing and funding for this gateway.",children:[i&&d.jsx(lt,{tone:"danger",action:GS.has(i)?d.jsx(Le,{size:"sm",variant:"outline",onClick:()=>an("overview?account=1",{replace:!0}),children:"Back to the console"}):void 0,children:rg(i)??"Sign-in did not complete. Try again."}),t.isLoading&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(No,{height:34}),d.jsx(No,{height:34})]}),t.error?d.jsx(lt,{tone:"danger",title:"Could not reach the gateway",children:ka(t.error)}):null,t.data&&d.jsxs("div",{className:"gc-stack",children:[t.data.setupRequired&&d.jsxs(lt,{tone:"info",title:"Not set up yet",children:["Get a one-time setup link by running ",d.jsx("code",{children:"antseed gateway console-link"})," on the gateway, or ask the operator for it."]}),d.jsx(og,{config:t.data,mode:"login",onSignedIn:r}),t.data.cloudflareAccess&&d.jsx("p",{className:"gc-fineprint",children:"This gateway also accepts Cloudflare Access. If you signed in there, reload this page."}),t.data.apiKeyLogin&&d.jsxs(d.Fragment,{children:[d.jsx(ZS,{}),d.jsx(XS,{onSignedIn:r})]})]})]})}function tk({kind:t}){const[r,i]=I.useState(()=>window.location.hash.replace(/^#/,""));I.useEffect(()=>{const v=()=>{const g=window.location.hash.replace(/^#/,"");g&&(i(g),window.history.replaceState(null,"",window.location.pathname))};return v(),window.addEventListener("hashchange",v),()=>window.removeEventListener("hashchange",v)},[]);const a=ig(),u=Vc(),f=De({queryKey:["enrollment",t,r],queryFn:()=>t==="setup"?fe.auth.setup(r):t==="recover"?fe.request("POST","/auth/recover",{body:{token:r}}):fe.auth.invite(r),enabled:r!=="",retry:!1,staleTime:1/0}),m=t==="setup"?"Set up your Antseed console":t==="recover"?"Add a sign-in method":"You are invited";return r?d.jsxs(hc,{title:m,subtitle:f.data?t==="recover"?d.jsxs(d.Fragment,{children:["Welcome back, ",d.jsx("strong",{children:f.data.label}),". Add a passkey, wallet or single sign-on to sign in on this address."]}):d.jsxs(d.Fragment,{children:["Welcome, ",d.jsx("strong",{children:f.data.label}),". You will join as ",Uc[f.data.orgRole].toLowerCase(),". Choose how you sign in."]}):"Checking your link…",children:[(f.isLoading||u.isLoading)&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(No,{height:34}),d.jsx(No,{height:34})]}),f.error?d.jsxs("div",{className:"gc-stack",children:[d.jsx(lt,{tone:"danger",children:ed(f.error)}),d.jsx(Le,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]}):null,f.data&&u.data&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(og,{config:u.data,mode:"enroll",enrollment:f.data.enrollment,onSignedIn:a}),d.jsx("p",{className:"gc-fineprint",children:"A passkey uses your device's screen lock or a security key. Nothing to remember."})]})]}):d.jsxs(hc,{title:m,children:[d.jsx(lt,{tone:"danger",children:"This link is missing its token. Open the full link you were given."}),d.jsx(Le,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]})}const wa={overview:()=>Ue(()=>import("./Overview-CAxieiTF.js"),__vite__mapDeps([7,8,9,10,11,12])),chat:()=>Ue(()=>import("./Chat-D1yVH5Y-.js").then(t=>t.C),__vite__mapDeps([13,2,14])),activity:()=>Ue(()=>import("./Activity-CoD1LZfl.js"),__vite__mapDeps([15,8,9,10,16,11,12,17,18])),logs:()=>Ue(()=>import("./Logs-B-T-V-pM.js"),__vite__mapDeps([19,20,21,16,9,18,22,17])),keys:()=>Ue(()=>import("./Keys-BovEuhch.js"),__vite__mapDeps([23,24,25,16,17,11,12,26,27,28,29,22,9,18,10])),members:()=>Ue(()=>import("./Members-tWNaQdIJ.js"),__vite__mapDeps([30,24,25,16,17,11,12,26,27,29,18])),workspaces:()=>Ue(()=>import("./Workspaces-Da-rLWlz.js"),__vite__mapDeps([31,24,25,16,17,11,12,26,27,29,18])),wallet:()=>Ue(()=>import("./Wallet-BOMYI48H.js"),__vite__mapDeps([32,33,3,34,18,27,26])),rewards:()=>Ue(()=>import("./Rewards-CRiw-wXO.js"),__vite__mapDeps([35,33,36,18])),providers:()=>Ue(()=>import("./Providers-B3qO68z-.js"),__vite__mapDeps([37,16,17,18,38,36,39,24,25,11,12,26,27,40,28])),models:()=>Ue(()=>import("./Models-gJrRx-QV.js"),__vite__mapDeps([41,28,12,38,17,26,18])),routing:()=>Ue(()=>import("./Routing-YpzgjNx_.js"),__vite__mapDeps([42,24,25,16,17,11,12,26,27,18,28])),presets:()=>Ue(()=>import("./Presets-DBRoMTo4.js"),__vite__mapDeps([39,24,25,16,17,11,12,26,27,18,40])),audit:()=>Ue(()=>import("./Audit-CNmmoaeN.js"),__vite__mapDeps([43,21,17,18])),settings:()=>Ue(()=>import("./Settings-CSXJvDLz.js"),__vite__mapDeps([44,16,25,17,11,12,26,27,40,28,18]))},sg={};for(const t of Object.keys(wa))sg[t]=I.lazy(wa[t]);const Qp=xv(window.location.pathname).page;ag(Qp)&&wa[Qp]().catch(()=>{});const Gp=()=>{wa.chat().catch(()=>{})};"requestIdleCallback"in window?window.requestIdleCallback(Gp,{timeout:4e3}):setTimeout(Gp,2e3);const nk=I.lazy(()=>Ue(()=>import("./KeyHolder-CmffMcZD.js"),__vite__mapDeps([45,20,21,16,9,18,10]))),rk=new Uw({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:(t,r)=>!(Lr(r)&&r.status>=400&&r.status<500)&&t<2}}});class ik extends I.Component{constructor(){super(...arguments);gu(this,"state",{failed:!1})}static getDerivedStateFromError(i){return{failed:!0,error:i}}render(){return this.state.failed?d.jsx(Xc,{error:this.state.error,title:"This page failed to load",onRetry:()=>this.setState({failed:!1,error:void 0})}):this.props.children}}function ag(t){return $c.some(r=>r.id===t)}function ok({me:t,page:r}){const[i,a]=I.useState(()=>{var C;return((C=jp(t,T2()))==null?void 0:C.id)??null}),u=jp(t,i),f=rr(),m=Bc(),v=j2(m.page,m.rest);I.useEffect(()=>{v&&an(v,{replace:!0})},[v]);const g=I.useMemo(()=>{if(!u)return null;const C=E2({me:t},u.id);return{me:t,workspace:u,workspaceRole:C.workspaceRole,viewer:C,setWorkspaceId:N=>{R2(N),a(N),f.invalidateQueries()}}},[t,u,f]);if(v)return d.jsx("div",{className:"gc-centered",children:d.jsx(Ni,{rows:3})});if(!g)return d.jsx("div",{className:"gc-centered",children:d.jsx(lt,{tone:"warning",title:"No workspace",children:"You are not a member of any workspace yet. Ask an admin to add you."})});const h=ag(r)?r:"overview",y=zc(h,g.viewer),x=sg[h];return d.jsx(gv.Provider,{value:g,children:d.jsx(KS,{page:h,children:d.jsx(ik,{children:d.jsx(I.Suspense,{fallback:d.jsx(Ni,{rows:6}),children:y?d.jsx(x,{}):d.jsx(lt,{tone:"warning",title:"Not available",children:"Your role cannot open this page."})})},m.page)})})}function sk({page:t}){const r=Y2(),i=Lr(r.error)&&r.error.status===401;return I.useEffect(()=>{i&&an("login",{replace:!0})},[i]),r.isLoading||i?d.jsx("div",{className:"gc-centered",children:d.jsx(Ni,{rows:3})}):r.error?d.jsxs("div",{className:"gc-centered gc-stack",children:[d.jsx(Xc,{error:r.error,title:"Could not open the console",onRetry:()=>void r.refetch()}),d.jsx(Le,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]}):r.data?r.data.kind==="key"?d.jsx(I.Suspense,{fallback:d.jsx(Ni,{rows:6}),children:d.jsx(nk,{})}):d.jsx(ok,{me:r.data.me,page:t}):null}function ak(){const t=Bc();return t.page==="login"?d.jsx(ek,{}):t.page==="setup"||t.page==="invite"||t.page==="recover"?d.jsx(tk,{kind:t.page}):d.jsx(sk,{page:t.page})}function lk(){return d.jsx(Bw,{client:rk,children:d.jsx(w2,{children:d.jsx(ak,{})})})}N2();async function uk(){const t=document.getElementById("root");if(!t)throw new Error("#root element is missing");gw.createRoot(t).render(d.jsx(I.StrictMode,{children:d.jsx(lk,{})}))}uk();export{m2 as $,Zx as A,Le as B,cv as C,a2 as D,xk as E,rr as F,mv as G,iC as H,ut as I,sC as J,zC as K,Ni as L,AC as M,Wc as N,UC as O,gk as P,OC as Q,Yk as R,wk as S,g2 as T,rC as U,u2 as V,Sk as W,kk as X,D2 as Y,Lr as Z,Ue as _,_k as a,Ck as a$,v2 as a0,p2 as a1,oC as a2,vC as a3,nC as a4,iS as a5,zc as a6,Hc as a7,_a as a8,TC as a9,qc as aA,BC as aB,HC as aC,ka as aD,LC as aE,aC as aF,Uk as aG,uC as aH,B2 as aI,W2 as aJ,H2 as aK,Dc as aL,ko as aM,z2 as aN,dC as aO,cC as aP,Mo as aQ,lC as aR,Q2 as aS,fS as aT,hS as aU,uc as aV,cc as aW,hC as aX,Cv as aY,ES as aZ,VC as a_,wC as aa,Gc as ab,Qx as ac,EC as ad,pC as ae,jC as af,lt as ag,CC as ah,xC as ai,_C as aj,gi as ak,WS as al,Y2 as am,dc as an,Bp as ao,ng as ap,Sv as aq,Ik as ar,Rp as as,F2 as at,Mk as au,Rk as av,Qv as aw,$o as ax,PC as ay,o1 as az,Vk as b,qC as b$,FC as b0,NC as b1,vv as b2,RC as b3,Wk as b4,IC as b5,da as b6,Uc as b7,Zk as b8,$C as b9,pk as bA,Jw as bB,MC as bC,bC as bD,yC as bE,Ii as bF,Ve as bG,fa as bH,um as bI,Hw as bJ,qw as bK,Yw as bL,Kw as bM,Qw as bN,pt as bO,Xw as bP,fp as bQ,Gw as bR,eC as bS,Ev as bT,DC as bU,Nk as bV,SC as bW,kC as bX,cS as bY,Hk as bZ,TS as b_,bk as ba,Pk as bb,DS as bc,AS as bd,Ea as be,Bc as bf,b2 as bg,qk as bh,FS as bi,QC as bj,Tk as bk,P2 as bl,Zv as bm,WC as bn,Jk as bo,KC as bp,gC as bq,Kk as br,tC as bs,rS as bt,mC as bu,Yx as bv,e1 as bw,Lw as bx,dp as by,mk as bz,Xk as c,Bk as c0,fC as c1,dk as c2,uw as c3,ex as c4,Dk as c5,d2 as c6,gS as c7,q2 as c8,Fk as c9,Ek as cA,$k as ca,V2 as cb,Ok as cc,Ak as cd,U2 as ce,Lk as cf,zk as cg,fk as ch,hk as ci,t1 as cj,Ac as ck,Z0 as cl,x2 as cm,S2 as cn,mc as co,bm as cp,_m as cq,Cm as cr,rn as cs,la as ct,ua as cu,tv as cv,f1 as cw,A0 as cx,h1 as cy,Jt as cz,Gk as d,De as e,fe as f,O2 as g,A2 as h,Fc as i,d as j,jk as k,yk as l,Xe as m,Ca as n,Xc as o,Qk as p,Pe as q,I as r,Z2 as s,dS as t,ir as u,Sm as v,sn as w,X2 as x,an as y,$2 as z};
91
+ `)}function qC(t,r,i="<model>"){const a={secret:r};return[{id:"curl",label:"curl",code:Xv(t,i,"openai-chat-completions",a)},{id:"openai",label:"OpenAI SDK",code:Jv(t,i,"openai-chat-completions",a)},{id:"anthropic",label:"Anthropic SDK",code:eg(t,i,a)}]}function AS(t,r,i){const a=[{id:"curl",label:"curl",language:"shell",code:Xv(t,r,i)},{id:"openai-python",label:"Python",language:"python",code:IS(t,r,i)},{id:"openai-js",label:"JavaScript",language:"javascript",code:Jv(t,r,i)}];return i==="anthropic-messages"&&a.push({id:"anthropic",label:"Anthropic SDK",language:"javascript",code:eg(t,r)}),a}function KC(t,r,i,a,u){const f=Zv(r,i),m=AS(t,f,a);return a==="openai-images"||m.push({id:"codex",label:"Codex",language:"toml",code:MS(t,u??"@preset/<your-preset>")},{id:"claude-code",label:"Claude Code",language:"shell",code:LS(t,f)},{id:"openai-compatible",label:"Cursor / OpenAI-compatible",language:"text",code:OS(t,f)}),m}function DS(){var r;const t=qc();return ES((r=t.data)==null?void 0:r.publicUrl,window.location.origin)}function FS(){const t=mv();return async r=>{await dv(r)?t("Copied"):t("Could not copy to the clipboard","danger")}}function QC(t,r,i){return{label:"Copy model id",onSelect:()=>void t(Zv(r,i))}}function GC({value:t,label:r}){const i=FS();return d.jsx($o,{label:r,size:"sm",className:"gc-copy-id",onClick:a=>{a.stopPropagation(),i(t)},children:d.jsx(ut.copy,{size:13})})}function Bp({className:t}){const r=PS(DS());return d.jsxs("div",{className:["gc-endpoint",t].filter(Boolean).join(" "),title:`OpenAI-compatible base URL: ${r}`,children:[d.jsx("span",{className:"gc-endpoint__label",children:"API"}),d.jsx("code",{className:"gc-endpoint__url",children:r}),d.jsx(Dc,{iconOnly:!0,value:r,label:"Copy the gateway API URL",className:"gc-endpoint__copy"})]})}const tg="https://antseed.com/docs/gateway",$S=I.lazy(()=>Ue(()=>import("./Migrate-LZPwWSjY.js"),[]));function dc({to:t="overview",tagged:r,size:i=26}){const a=d.jsxs(d.Fragment,{children:[d.jsx(d2,{height:i,className:"gc-brand__full"}),d.jsx(f2,{size:26,className:"gc-brand__mark"}),d.jsx("span",{className:"gc-brand__tag",children:"Console"})]}),u=r?"gc-brand gc-brand--tagged":"gc-brand";return t===null?d.jsx("span",{className:u,children:a}):d.jsx("a",{className:u,href:_a(t),onClick:Hc(t),"aria-label":"Antseed console home",children:a})}const fc="No authorized wallet: nobody can withdraw funds or claim ANTS rewards";function zS(){var v;const{me:t,workspace:r,setWorkspaceId:i}=ir(),{missingOperator:a,currentMissingOperator:u}=Ev(),f=u&&d.jsx("span",{className:"gc-attention",role:"img","aria-label":fc,title:fc});if(t.workspaces.length<=1)return d.jsxs("span",{className:"gc-ws",title:"Workspace","data-tour":"workspace",children:[d.jsx(ut.workspaces,{size:14}),d.jsx("span",{className:"gc-ws__name",children:r.name}),f]});const m=(v=t.workspaces.find(g=>g.workspace.id===r.id))==null?void 0:v.role;return d.jsx("span",{"data-tour":"workspace",className:"gc-ws-wrap",children:d.jsx(o1,{label:`Workspace: ${r.name}. Switch workspace`,triggerStyle:"plain",align:"start",width:260,className:"gc-ws gc-ws--select",trigger:d.jsxs(d.Fragment,{children:[d.jsx(ut.workspaces,{size:14}),d.jsx("span",{className:"gc-ws__name",children:r.name}),m==="admin"&&d.jsx("span",{className:"gc-ws__role",children:"admin"}),f,d.jsx(ut.down,{size:14,className:"gc-ws__chevron"})]}),items:t.workspaces.map(({workspace:g,role:h})=>({label:g.name,description:[h==="admin"?"Admin":"Member",g.id!==r.id&&a.has(g.id)?"no authorized wallet":null].filter(Boolean).join(" · "),checked:g.id===r.id,onSelect:()=>{g.id!==r.id&&i(g.id)}}))})})}function US(t,r){return t!=="wallet"?null:r.currentMissingOperator?fc:r.withdrawable.count>0?`${r.withdrawable.count} channel${r.withdrawable.count===1?"":"s"} ready to withdraw`:null}function Hp({current:t,onNavigate:r}){const{viewer:i}=ir(),a=Ev(),u=_2(i),f=[...new Set(u.map(m=>m.group))];return d.jsx("nav",{className:"gc-nav","aria-label":"Console",children:f.map(m=>d.jsxs("div",{className:"gc-nav__group",children:[d.jsx("div",{className:"gc-nav__heading",children:m}),u.filter(v=>v.group===m).map(v=>{const g=ut[v.id]??ut.overview;return d.jsxs("a",{href:_a(v.id),"aria-current":v.id===t?"page":void 0,"data-tour":`nav-${v.id}`,className:v.id===t?"gc-nav__item gc-nav__item--on":"gc-nav__item",onClick:h=>{Hc(v.id)(h),r==null||r()},children:[d.jsx(g,{size:16}),d.jsx("span",{children:v.label}),(()=>{const h=US(v.id,a);return h&&d.jsx("span",{className:"gc-attention gc-nav__attention",role:"img","aria-label":h,title:h})})()]},v.id)})]},m))})}const Wp={system:"System",dark:"Dark",light:"Light"},BS={system:"dark",dark:"light",light:"system"},HS={system:ut.monitor,dark:ut.moon,light:ut.sun};function ng(){const[t,r]=I2(),i=BS[t],a=HS[t];return d.jsx($o,{className:"gc-topbar__icon",label:`Color theme: ${Wp[t]}. Switch to ${Wp[i]}.`,onClick:()=>r(i),children:d.jsx(a,{size:16})})}function WS(){const t=rr();return async()=>{try{await fe.auth.logout()}finally{t.clear(),an("login",{replace:!0})}}}function VS(t){var u;const r=t.trim().split(/\s+/).filter(Boolean),i=((u=r[0])==null?void 0:u[0])??"?",a=r.length>1?r[r.length-1][0]:"";return(i+a).toUpperCase()}function qS({onAccount:t,onTour:r,onSignOut:i}){const{me:a}=ir(),[u,f]=I.useState(!1),m=I.useRef(null),v=I.useRef(null);I.useEffect(()=>{var N,A;if(!u)return;const x=E=>{var M;(M=m.current)!=null&&M.contains(E.target)||f(!1)},C=E=>{var M;E.key==="Escape"&&(f(!1),(M=v.current)==null||M.focus())};return document.addEventListener("mousedown",x),document.addEventListener("keydown",C),(A=(N=m.current)==null?void 0:N.querySelector('[role="menuitem"]'))==null||A.focus(),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",C)}},[u]);const g=x=>()=>{f(!1),x()},h=Uc[a.member.orgRole],y=a.member.email?`${a.member.email} · ${h}`:h;return d.jsxs("div",{className:"gc-account",ref:m,"data-tour":"account",children:[d.jsx("button",{ref:v,type:"button",className:"gc-user","aria-haspopup":"menu","aria-expanded":u,"aria-label":`Your account: ${a.member.label}`,onClick:()=>f(x=>!x),children:d.jsx("span",{className:"gc-avatar","aria-hidden":"true",children:VS(a.member.label)})}),u&&d.jsxs("div",{className:"gc-account__menu",role:"menu","aria-label":"Account",children:[d.jsxs("div",{className:"gc-account__who",children:[d.jsx("div",{className:"gc-account__name",children:a.member.label}),d.jsx("div",{className:"gc-account__meta",children:y})]}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(t),children:[d.jsx(ut.shield,{size:15}),"Account and sign-in"]}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(r),children:[d.jsx(ut.compass,{size:15}),"Take the tour"]}),d.jsxs("a",{role:"menuitem",className:"gc-account__item",href:tg,target:"_blank",rel:"noreferrer",onClick:()=>f(!1),children:[d.jsx(ut.external,{size:15}),"Documentation"]}),d.jsx("div",{className:"gc-account__sep"}),d.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(i),children:[d.jsx(ut.logout,{size:15}),"Sign out"]})]})]})}function Vp(){var r;const t=(r=qc().data)==null?void 0:r.version;return t?d.jsxs("p",{className:"gc-version",children:["Antseed v",t]}):null}function KS({page:t,children:r}){const[i,a]=I.useState(!1),[u,f]=I.useState(()=>new URLSearchParams(window.location.search).get("account")==="1"),m=WS(),v=Bc().page==="migrate",g=v?null:t,{me:h,viewer:y}=ir();return I.useEffect(()=>{if(v||zx(h.member.id))return;const x=window.setTimeout(()=>Fp(y,h.member.id),600);return()=>window.clearTimeout(x)},[h.member.id]),d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"gc-app","data-page":g??void 0,children:[d.jsx("a",{className:"gc-skip",href:"#gc-main",children:"Skip to content"}),d.jsxs("header",{className:"gc-topbar",children:[d.jsxs("div",{className:"gc-topbar__inner",children:[d.jsx($o,{label:"Open menu",className:"gc-topbar__menu gc-topbar__icon",onClick:()=>a(!0),children:d.jsx(ut.menu,{size:16})}),d.jsx(dc,{}),d.jsx("span",{className:"gc-topbar__sep","aria-hidden":"true",children:"/"}),d.jsx(zS,{}),d.jsx("div",{className:"gc-topbar__spacer"}),d.jsx(Bp,{className:"gc-endpoint--inline"}),d.jsx("a",{className:"gc-topbar__link",href:tg,target:"_blank",rel:"noreferrer",children:"Docs"}),d.jsx(ng,{}),d.jsx(qS,{onAccount:()=>f(!0),onTour:()=>Fp(y,h.member.id),onSignOut:()=>void m()})]}),d.jsx("div",{className:"gc-topbar__strip",children:d.jsx(Bp,{})})]}),d.jsxs("div",{className:"gc-body",children:[d.jsxs("aside",{className:"gc-rail",children:[d.jsx(Hp,{current:g}),d.jsx(Vp,{})]}),d.jsx("main",{id:"gc-main",className:"gc-main",tabIndex:-1,children:v?d.jsx(I.Suspense,{fallback:d.jsx(Ni,{rows:6}),children:d.jsx($S,{})}):d.jsxs(d.Fragment,{children:[d.jsx(_S,{}),r]})})]})]}),d.jsxs(u2,{isOpen:i,onClose:()=>a(!1),side:"left",title:d.jsx(dc,{to:null}),className:"gc-mobile-nav",children:[d.jsx(Hp,{current:g,onNavigate:()=>a(!1)}),d.jsx(Vp,{})]}),d.jsx(gS,{isOpen:u,onClose:()=>f(!1)})]})}const QS=I.lazy(()=>Ue(()=>import("./WalletSignIn-3MlBmMgW.js"),__vite__mapDeps([0,1,2,3,4]))),qp={not_invited:"This account has not been invited to this console. Ask an admin for an invite link.",invite_expired:"This invite link has expired. Ask an admin for a new one.",invite_used:"This invite link was already used. Sign in instead.",invalid_token:"This link is not valid. Check that you copied all of it.",setup_complete:"This console is already set up. Sign in instead.",member_disabled:"Your access to this console has been turned off.",unknown_credential:"This passkey or wallet is not registered here.",key_revoked:"This API key has been revoked.",invalid_key:"That API key is not valid.",rate_limited:"Too many attempts. Wait a minute and try again.",key_expired:"This API key has expired.",not_linked:"This account is not linked to a member yet. Sign in another way and link it from your profile, or use your invite link.",invalid_enrollment:"This sign-up link has expired. Open your invite link again, or ask for a new one.",unauthenticated:"Sign in first.",oidc_denied:"Single sign-on was cancelled.",oidc_state:"The single sign-on attempt expired. Try again.",oidc_failed:"Single sign-on could not be verified. Try again, or use another sign-in method.",oidc_unavailable:"The single sign-on provider could not be reached. Try again later.",reauth_required:"Linking a sign-in provider needs a fresh sign-in. Go back to the console, confirm it is you under Your sign-in methods, then link it again.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then link the provider again.",credential_exists:"This single sign-on account is already linked to another member."},GS=new Set(["reauth_required","access_reauth_required","credential_exists"]);function rg(t){return Object.hasOwn(qp,t)?qp[t]:void 0}function ed(t){return Lr(t)&&rg(t.code)||ka(t)}function hc({title:t,subtitle:r,children:i}){return d.jsxs("div",{className:"gc-auth",children:[d.jsx("div",{className:"gc-auth__theme",children:d.jsx(ng,{})}),d.jsx("div",{className:"gc-auth__logo",children:d.jsx(dc,{to:null,tagged:!0,size:30})}),d.jsxs(Sc,{className:"gc-auth__card",children:[d.jsx("h1",{className:"gc-auth__title",children:t}),r&&d.jsx("p",{className:"gc-auth__subtitle",children:r}),i]}),d.jsx("p",{className:"gc-auth__foot",children:"Self-hosted Antseed gateway"})]})}function ig(){const t=rr();return r=>{t.setQueryData(Pe.me,r),an(r.kind==="key"?"key":"overview",{replace:!0})}}function Kp({label:t,run:r,primary:i}){const[a,u]=I.useState(!1),[f,m]=I.useState(null),v=zo();return d.jsxs("div",{className:"gc-stack gc-stack--tight",children:[d.jsx(Le,{fullWidth:!0,variant:i?"primary":"outline",disabled:a||!v,onClick:async()=>{u(!0),m(null);try{await r()}catch(g){m(cc(g)?uc:ed(g))}finally{u(!1)}},children:a?"Waiting for your passkey…":t}),!v&&d.jsx("p",{className:"gc-fineprint",children:"This browser does not support passkeys."}),f&&d.jsx(lt,{tone:"danger",children:f})]})}function YS({enrollment:t,onSignedIn:r}){const[i,a]=I.useState(!1);return i?d.jsx(I.Suspense,{fallback:d.jsx(Le,{variant:"outline",fullWidth:!0,disabled:!0,children:"Loading wallets…"}),children:d.jsx(QS,{enrollment:t,onSignedIn:r,autoConnect:!0})}):d.jsx(Le,{variant:"outline",fullWidth:!0,onClick:()=>a(!0),children:"Sign in with a wallet"})}function ZS(){return d.jsx("div",{className:"gc-divider",children:d.jsx("span",{children:"or"})})}function XS({onSignedIn:t}){const[r,i]=I.useState(""),[a,u]=I.useState(!1),[f,m]=I.useState(null);return d.jsxs("form",{className:"gc-stack gc-stack--tight",onSubmit:async v=>{v.preventDefault(),u(!0),m(null);try{t(await fe.auth.apiKey(r.trim()))}catch(g){m(ed(g))}finally{u(!1)}},children:[d.jsx(g2,{label:"API key",type:"password",autoComplete:"off",placeholder:"Paste your key to see its usage",value:r,onChange:v=>i(v.target.value)}),d.jsx(Le,{type:"submit",variant:"outline",fullWidth:!0,disabled:a||!r.trim(),children:a?"Checking…":"View key usage"}),f&&d.jsx(lt,{tone:"danger",children:f})]})}function JS({mode:t,enrollment:r,onSignedIn:i}){return t==="login"?d.jsx(Kp,{primary:!0,label:"Sign in with a passkey",run:async()=>{const a=await fe.auth.passkeyLoginOptions(),u=await Kv({optionsJSON:a});i(await fe.auth.passkeyLoginVerify(u))}}):d.jsx(Kp,{primary:!0,label:"Create a passkey",run:async()=>{const a=await fe.auth.passkeyRegisterOptions(r),u=await qv({optionsJSON:a});i(await fe.auth.passkeyRegisterVerify(u,r))}})}function og({config:t,enrollment:r,onSignedIn:i,mode:a}){const u=[];return t.passkey&&u.push(d.jsx(JS,{mode:a,enrollment:r,onSignedIn:i},"passkey")),t.wallet&&u.push(d.jsx(YS,{enrollment:r,onSignedIn:i},"wallet")),t.oidc&&u.push(d.jsxs(Le,{variant:"outline",fullWidth:!0,href:fe.auth.oidcStartUrl(r),children:["Continue with ",t.oidc.label]},"oidc")),u.length===0?d.jsx(lt,{tone:"warning",children:"No sign-in method is enabled on this gateway. Check the gateway's console auth settings."}):d.jsx("div",{className:"gc-stack",children:u})}function ek(){const t=Vc(),r=ig(),i=new URLSearchParams(window.location.search).get("error");return d.jsxs(hc,{title:"Sign in",subtitle:"Manage keys, budgets, routing and funding for this gateway.",children:[i&&d.jsx(lt,{tone:"danger",action:GS.has(i)?d.jsx(Le,{size:"sm",variant:"outline",onClick:()=>an("overview?account=1",{replace:!0}),children:"Back to the console"}):void 0,children:rg(i)??"Sign-in did not complete. Try again."}),t.isLoading&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(No,{height:34}),d.jsx(No,{height:34})]}),t.error?d.jsx(lt,{tone:"danger",title:"Could not reach the gateway",children:ka(t.error)}):null,t.data&&d.jsxs("div",{className:"gc-stack",children:[t.data.setupRequired&&d.jsxs(lt,{tone:"info",title:"Not set up yet",children:["Get a one-time setup link by running ",d.jsx("code",{children:"antseed gateway console-link"})," on the gateway, or ask the operator for it."]}),d.jsx(og,{config:t.data,mode:"login",onSignedIn:r}),t.data.cloudflareAccess&&d.jsx("p",{className:"gc-fineprint",children:"This gateway also accepts Cloudflare Access. If you signed in there, reload this page."}),t.data.apiKeyLogin&&d.jsxs(d.Fragment,{children:[d.jsx(ZS,{}),d.jsx(XS,{onSignedIn:r})]})]})]})}function tk({kind:t}){const[r,i]=I.useState(()=>window.location.hash.replace(/^#/,""));I.useEffect(()=>{const v=()=>{const g=window.location.hash.replace(/^#/,"");g&&(i(g),window.history.replaceState(null,"",window.location.pathname))};return v(),window.addEventListener("hashchange",v),()=>window.removeEventListener("hashchange",v)},[]);const a=ig(),u=Vc(),f=De({queryKey:["enrollment",t,r],queryFn:()=>t==="setup"?fe.auth.setup(r):t==="recover"?fe.request("POST","/auth/recover",{body:{token:r}}):fe.auth.invite(r),enabled:r!=="",retry:!1,staleTime:1/0}),m=t==="setup"?"Set up your Antseed console":t==="recover"?"Add a sign-in method":"You are invited";return r?d.jsxs(hc,{title:m,subtitle:f.data?t==="recover"?d.jsxs(d.Fragment,{children:["Welcome back, ",d.jsx("strong",{children:f.data.label}),". Add a passkey, wallet or single sign-on to sign in on this address."]}):d.jsxs(d.Fragment,{children:["Welcome, ",d.jsx("strong",{children:f.data.label}),". You will join as ",Uc[f.data.orgRole].toLowerCase(),". Choose how you sign in."]}):"Checking your link…",children:[(f.isLoading||u.isLoading)&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(No,{height:34}),d.jsx(No,{height:34})]}),f.error?d.jsxs("div",{className:"gc-stack",children:[d.jsx(lt,{tone:"danger",children:ed(f.error)}),d.jsx(Le,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]}):null,f.data&&u.data&&d.jsxs("div",{className:"gc-stack",children:[d.jsx(og,{config:u.data,mode:"enroll",enrollment:f.data.enrollment,onSignedIn:a}),d.jsx("p",{className:"gc-fineprint",children:"A passkey uses your device's screen lock or a security key. Nothing to remember."})]})]}):d.jsxs(hc,{title:m,children:[d.jsx(lt,{tone:"danger",children:"This link is missing its token. Open the full link you were given."}),d.jsx(Le,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]})}const wa={overview:()=>Ue(()=>import("./Overview-B3WLdQF3.js"),__vite__mapDeps([7,8,9,10,11,12])),chat:()=>Ue(()=>import("./Chat-CoYr5t7Q.js").then(t=>t.C),__vite__mapDeps([13,2,14])),activity:()=>Ue(()=>import("./Activity-BTHWjCfF.js"),__vite__mapDeps([15,8,9,10,16,11,12,17,18])),logs:()=>Ue(()=>import("./Logs-D6o56kmk.js"),__vite__mapDeps([19,20,21,16,9,18,22,17])),keys:()=>Ue(()=>import("./Keys-BIlAH1SD.js"),__vite__mapDeps([23,24,25,16,17,11,12,26,27,28,29,22,9,18,10])),members:()=>Ue(()=>import("./Members-33LlQeJ4.js"),__vite__mapDeps([30,24,25,16,17,11,12,26,27,29,18])),workspaces:()=>Ue(()=>import("./Workspaces-Cbcnklsg.js"),__vite__mapDeps([31,24,25,16,17,11,12,26,27,29,18])),wallet:()=>Ue(()=>import("./Wallet-DUot1EZD.js"),__vite__mapDeps([32,33,3,34,18,27,26])),rewards:()=>Ue(()=>import("./Rewards-D3Hh7Soh.js"),__vite__mapDeps([35,33,36,18])),providers:()=>Ue(()=>import("./Providers-CVteCWoy.js"),__vite__mapDeps([37,16,17,18,38,36,39,24,25,11,12,26,27,40,28])),models:()=>Ue(()=>import("./Models-n5Y-SyjO.js"),__vite__mapDeps([41,28,12,38,17,26,18])),routing:()=>Ue(()=>import("./Routing-DSRUEAFE.js"),__vite__mapDeps([42,24,25,16,17,11,12,26,27,18,28])),presets:()=>Ue(()=>import("./Presets-CMVeG1hO.js"),__vite__mapDeps([39,24,25,16,17,11,12,26,27,18,40])),audit:()=>Ue(()=>import("./Audit-DEeTafQK.js"),__vite__mapDeps([43,21,17,18])),settings:()=>Ue(()=>import("./Settings-DvqGXXJg.js"),__vite__mapDeps([44,16,25,17,11,12,26,27,40,28,18]))},sg={};for(const t of Object.keys(wa))sg[t]=I.lazy(wa[t]);const Qp=xv(window.location.pathname).page;ag(Qp)&&wa[Qp]().catch(()=>{});const Gp=()=>{wa.chat().catch(()=>{})};"requestIdleCallback"in window?window.requestIdleCallback(Gp,{timeout:4e3}):setTimeout(Gp,2e3);const nk=I.lazy(()=>Ue(()=>import("./KeyHolder-DaUngSci.js"),__vite__mapDeps([45,20,21,16,9,18,10]))),rk=new Uw({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:(t,r)=>!(Lr(r)&&r.status>=400&&r.status<500)&&t<2}}});class ik extends I.Component{constructor(){super(...arguments);gu(this,"state",{failed:!1})}static getDerivedStateFromError(i){return{failed:!0,error:i}}render(){return this.state.failed?d.jsx(Xc,{error:this.state.error,title:"This page failed to load",onRetry:()=>this.setState({failed:!1,error:void 0})}):this.props.children}}function ag(t){return $c.some(r=>r.id===t)}function ok({me:t,page:r}){const[i,a]=I.useState(()=>{var C;return((C=jp(t,T2()))==null?void 0:C.id)??null}),u=jp(t,i),f=rr(),m=Bc(),v=j2(m.page,m.rest);I.useEffect(()=>{v&&an(v,{replace:!0})},[v]);const g=I.useMemo(()=>{if(!u)return null;const C=E2({me:t},u.id);return{me:t,workspace:u,workspaceRole:C.workspaceRole,viewer:C,setWorkspaceId:N=>{R2(N),a(N),f.invalidateQueries()}}},[t,u,f]);if(v)return d.jsx("div",{className:"gc-centered",children:d.jsx(Ni,{rows:3})});if(!g)return d.jsx("div",{className:"gc-centered",children:d.jsx(lt,{tone:"warning",title:"No workspace",children:"You are not a member of any workspace yet. Ask an admin to add you."})});const h=ag(r)?r:"overview",y=zc(h,g.viewer),x=sg[h];return d.jsx(gv.Provider,{value:g,children:d.jsx(KS,{page:h,children:d.jsx(ik,{children:d.jsx(I.Suspense,{fallback:d.jsx(Ni,{rows:6}),children:y?d.jsx(x,{}):d.jsx(lt,{tone:"warning",title:"Not available",children:"Your role cannot open this page."})})},m.page)})})}function sk({page:t}){const r=Y2(),i=Lr(r.error)&&r.error.status===401;return I.useEffect(()=>{i&&an("login",{replace:!0})},[i]),r.isLoading||i?d.jsx("div",{className:"gc-centered",children:d.jsx(Ni,{rows:3})}):r.error?d.jsxs("div",{className:"gc-centered gc-stack",children:[d.jsx(Xc,{error:r.error,title:"Could not open the console",onRetry:()=>void r.refetch()}),d.jsx(Le,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]}):r.data?r.data.kind==="key"?d.jsx(I.Suspense,{fallback:d.jsx(Ni,{rows:6}),children:d.jsx(nk,{})}):d.jsx(ok,{me:r.data.me,page:t}):null}function ak(){const t=Bc();return t.page==="login"?d.jsx(ek,{}):t.page==="setup"||t.page==="invite"||t.page==="recover"?d.jsx(tk,{kind:t.page}):d.jsx(sk,{page:t.page})}function lk(){return d.jsx(Bw,{client:rk,children:d.jsx(w2,{children:d.jsx(ak,{})})})}N2();async function uk(){const t=document.getElementById("root");if(!t)throw new Error("#root element is missing");gw.createRoot(t).render(d.jsx(I.StrictMode,{children:d.jsx(lk,{})}))}uk();export{m2 as $,Zx as A,Le as B,cv as C,a2 as D,xk as E,rr as F,mv as G,oC as H,ut as I,aC as J,UC as K,Ni as L,DC as M,Wc as N,BC as O,gk as P,AC as Q,Zk as R,wk as S,g2 as T,iC as U,u2 as V,Sk as W,kk as X,D2 as Y,Lr as Z,Ue as _,_k as a,qC as a$,v2 as a0,p2 as a1,sC as a2,gC as a3,rC as a4,iS as a5,zc as a6,Hc as a7,_a as a8,RC as a9,o1 as aA,qc as aB,HC as aC,WC as aD,ka as aE,OC as aF,lC as aG,Bk as aH,cC as aI,B2 as aJ,W2 as aK,H2 as aL,Dc as aM,ko as aN,z2 as aO,fC as aP,dC as aQ,Mo as aR,uC as aS,Q2 as aT,fS as aU,hS as aV,uc as aW,cc as aX,pC as aY,Cv as aZ,ES as a_,xC as aa,Gc as ab,Qx as ac,PC as ad,mC as ae,TC as af,lt as ag,_C as ah,SC as ai,EC as aj,gi as ak,WS as al,Y2 as am,dc as an,Bp as ao,ng as ap,Sv as aq,Mk as ar,Rp as as,F2 as at,Lk as au,Rk as av,Nk as aw,Qv as ax,$o as ay,bC as az,qk as b,TS as b$,Ck as b0,$C as b1,IC as b2,vv as b3,NC as b4,Vk as b5,MC as b6,da as b7,Uc as b8,Xk as b9,mk as bA,pk as bB,Jw as bC,LC as bD,jC as bE,wC as bF,Ii as bG,Ve as bH,fa as bI,um as bJ,Hw as bK,qw as bL,Yw as bM,Kw as bN,Qw as bO,pt as bP,Xw as bQ,fp as bR,Gw as bS,tC as bT,Ev as bU,FC as bV,Ik as bW,kC as bX,CC as bY,cS as bZ,Wk as b_,zC as ba,bk as bb,Pk as bc,DS as bd,AS as be,Ea as bf,Bc as bg,b2 as bh,Kk as bi,FS as bj,GC as bk,Tk as bl,P2 as bm,Zv as bn,VC as bo,eC as bp,QC as bq,yC as br,Qk as bs,nC as bt,rS as bu,vC as bv,Yx as bw,e1 as bx,Lw as by,dp as bz,Jk as c,KC as c0,Hk as c1,hC as c2,dk as c3,uw as c4,ex as c5,Fk as c6,d2 as c7,gS as c8,q2 as c9,Jt as cA,Ek as cB,$k as ca,zk as cb,V2 as cc,Ak as cd,Dk as ce,U2 as cf,Ok as cg,Uk as ch,fk as ci,hk as cj,t1 as ck,Ac as cl,Z0 as cm,x2 as cn,S2 as co,mc as cp,bm as cq,_m as cr,Cm as cs,rn as ct,la as cu,ua as cv,tv as cw,f1 as cx,A0 as cy,h1 as cz,Yk as d,De as e,fe as f,O2 as g,A2 as h,Fc as i,d as j,jk as k,yk as l,Xe as m,Ca as n,Xc as o,Gk as p,Pe as q,I as r,Z2 as s,dS as t,ir as u,Sm as v,sn as w,X2 as x,an as y,$2 as z};